@giddaa-housing/ui 3.5.0 → 3.7.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/components.css +13 -0
- package/css/generated/shared.css +1 -1
- package/css/theme.css +11 -8
- package/dist/badge.d.ts +5 -1
- package/dist/badge.js +19 -5
- package/dist/bar-chart.d.ts +1 -1
- package/dist/bullet-chart.d.ts +1 -1
- package/dist/button-BS5KCibF.d.ts +33 -0
- package/dist/button-group.d.ts +1 -1
- package/dist/button.d.ts +1 -1
- package/dist/button.js +49 -21
- package/dist/calendar.js +1 -1
- package/dist/carousel.d.ts +4 -2
- package/dist/carousel.js +11 -14
- package/dist/chart.d.ts +1 -1
- package/dist/chat.d.ts +1 -1
- package/dist/checkbox.d.ts +2 -2
- package/dist/checkbox.js +20 -6
- package/dist/{combobox-B7cKFJ9V.js → combobox-D70DFHoM.js} +55 -10
- package/dist/combobox.d.ts +8 -3
- package/dist/combobox.js +2 -2
- package/dist/cta.d.ts +1 -1
- package/dist/data-table.d.ts +2 -2
- package/dist/date-picker.d.ts +3 -3
- package/dist/date-picker.js +1 -1
- package/dist/dialog.d.ts +6 -2
- package/dist/dialog.js +15 -12
- package/dist/dropdown-menu.d.ts +1 -1
- package/dist/field.d.ts +4 -1
- package/dist/field.js +28 -11
- package/dist/footer.d.ts +2 -2
- package/dist/funnel-chart.d.ts +1 -1
- package/dist/heatmap-chart.d.ts +1 -1
- package/dist/infotip.js +0 -1
- package/dist/input-group.d.ts +6 -6
- package/dist/input-group.js +43 -18
- package/dist/input-otp.d.ts +2 -2
- package/dist/input-otp.js +31 -14
- package/dist/input-size-context-BMhves-J.d.ts +13 -0
- package/dist/input-size-context.d.ts +2 -2
- package/dist/input-size-context.js +9 -2
- package/dist/input.d.ts +20 -2
- package/dist/input.js +30 -11
- package/dist/line-chart.d.ts +1 -1
- package/dist/mask-input.d.ts +1 -1
- package/dist/match.d.ts +14 -2
- package/dist/match.js +221 -48
- package/dist/media-gallery-hero.js +9 -7
- package/dist/media-player.js +3 -3
- package/dist/mobile-sidebar.js +7 -6
- package/dist/number-input.d.ts +2 -2
- package/dist/number-input.js +2 -2
- package/dist/pagination.d.ts +1 -1
- package/dist/phone-input.d.ts +20 -3
- package/dist/phone-input.js +137 -67
- package/dist/picker-BTXBrsl4.js +62 -0
- package/dist/{picker-CsnHtbe4.d.ts → picker-j3txxA5t.d.ts} +2 -2
- package/dist/pie-chart.d.ts +1 -1
- package/dist/{popover-DSlPeH7x.d.ts → popover-CNymD33m.d.ts} +1 -1
- package/dist/popover.d.ts +1 -1
- package/dist/property-listing-card.d.ts +7 -3
- package/dist/property-listing-card.js +25 -8
- package/dist/radar-chart.d.ts +1 -1
- package/dist/radio-group.d.ts +2 -2
- package/dist/radio-group.js +23 -9
- package/dist/rating.d.ts +60 -0
- package/dist/rating.js +187 -0
- package/dist/rich-text-editor.d.ts +1 -1
- package/dist/scatter-chart.d.ts +1 -1
- package/dist/scroll-spy.d.ts +8 -2
- package/dist/scroll-spy.js +13 -13
- package/dist/section-jumper.d.ts +31 -0
- package/dist/section-jumper.js +276 -0
- package/dist/select.d.ts +9 -4
- package/dist/select.js +148 -20
- package/dist/sheet.d.ts +5 -1
- package/dist/sheet.js +15 -12
- package/dist/sidebar.d.ts +2 -2
- package/dist/sidebar.js +1 -0
- package/dist/size-context-BVhHduLi.d.ts +33 -0
- package/dist/size-context.d.ts +2 -2
- package/dist/size-context.js +30 -1
- package/dist/slider.d.ts +5 -3
- package/dist/slider.js +25 -10
- package/dist/sonar.d.ts +4 -2
- package/dist/sonar.js +116 -28
- package/dist/sparkline.d.ts +1 -1
- package/dist/styles.css +1674 -252
- package/dist/switch.d.ts +2 -2
- package/dist/switch.js +20 -6
- package/dist/tabs.d.ts +1 -1
- package/dist/tag.d.ts +1 -1
- package/dist/textarea.d.ts +17 -1
- package/dist/textarea.js +23 -9
- package/dist/time-picker.d.ts +3 -3
- package/dist/time-picker.js +1 -1
- package/dist/tree-map.d.ts +1 -1
- package/dist/video-player-dialog.js +4 -3
- package/dist/waterfall-chart.d.ts +1 -1
- package/package.json +9 -1
- package/dist/button-DW5OijoR.d.ts +0 -17
- package/dist/dialog-nesting.d.ts +0 -9
- package/dist/dialog-nesting.js +0 -27
- package/dist/input-CfoEJ8A6.d.ts +0 -12
- package/dist/input-size-context-C-SFx9sx.d.ts +0 -10
- package/dist/picker-DmIiQKLJ.js +0 -45
- package/dist/size-context-BX6kAdVj.d.ts +0 -11
- package/dist/textarea-IS_D8pXf.d.ts +0 -11
package/dist/input.js
CHANGED
|
@@ -1,28 +1,47 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "./utils/cn.js";
|
|
3
|
-
import {
|
|
3
|
+
import { responsiveValueClasses } from "./size-context.js";
|
|
4
|
+
import { useInputComponentSizeValue } from "./input-size-context.js";
|
|
4
5
|
import { jsx } from "react/jsx-runtime";
|
|
5
6
|
import { cva } from "class-variance-authority";
|
|
6
7
|
import { Input as Input$1 } from "@base-ui/react/input";
|
|
7
8
|
//#region src/input.tsx
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
const inputSizeVariants = {
|
|
10
|
+
sm: "h-8 px-3 text-gdt-xs font-normal file:text-gdt-xs",
|
|
11
|
+
md: "h-10 px-3.5 text-gdt-sm font-normal file:text-gdt-sm",
|
|
12
|
+
lg: "h-12 px-4 text-gdt-md font-normal file:text-gdt-md",
|
|
13
|
+
xl: "h-14 px-4.5 text-gdt-lg font-normal file:text-gdt-lg"
|
|
14
|
+
};
|
|
15
|
+
const inputVariants = cva("gdt-input-autofill flex w-full min-w-0 rounded-full border border-line bg-canvas text-fg-primary transition-[background-color,border-color,box-shadow,color] outline-none file:inline-flex file:border-0 file:bg-transparent file:font-normal file:text-fg-primary placeholder:text-fg-caption-placeholder hover:border-line-strong focus-visible:border-line-focus focus-visible:inset-ring-1 focus-visible:inset-ring-line-focus disabled:pointer-events-none disabled:cursor-not-allowed disabled:border-line-subtle disabled:bg-surface disabled:text-fg-caption-placeholder disabled:placeholder:text-fg-caption-placeholder aria-invalid:border-line-danger aria-invalid:text-fg-danger aria-invalid:placeholder:text-fg-danger aria-invalid:shadow-none aria-invalid:focus-visible:border-line-danger aria-invalid:focus-visible:inset-ring-line-danger", {
|
|
16
|
+
variants: { size: inputSizeVariants },
|
|
15
17
|
defaultVariants: { size: "md" }
|
|
16
18
|
});
|
|
17
19
|
function Input({ className, size, type, ...props }) {
|
|
18
|
-
const resolvedSize =
|
|
20
|
+
const resolvedSize = responsiveValueClasses(useInputComponentSizeValue(size), responsiveInputSizes);
|
|
19
21
|
return /* @__PURE__ */ jsx(Input$1, {
|
|
20
22
|
type,
|
|
21
23
|
"data-slot": "input",
|
|
22
|
-
"data-size": resolvedSize,
|
|
23
|
-
|
|
24
|
+
"data-size": resolvedSize.base,
|
|
25
|
+
"data-size-md": resolvedSize.responsive ? resolvedSize.md : void 0,
|
|
26
|
+
"data-size-lg": resolvedSize.responsive ? resolvedSize.lg : void 0,
|
|
27
|
+
className: cn(inputVariants({ size: null }), resolvedSize.className, className),
|
|
24
28
|
...props
|
|
25
29
|
});
|
|
26
30
|
}
|
|
31
|
+
const responsiveInputSizes = {
|
|
32
|
+
base: inputSizeVariants,
|
|
33
|
+
md: {
|
|
34
|
+
sm: "md:h-8 md:px-3 md:text-gdt-xs md:file:text-gdt-xs",
|
|
35
|
+
md: "md:h-10 md:px-3.5 md:text-gdt-sm md:file:text-gdt-sm",
|
|
36
|
+
lg: "md:h-12 md:px-4 md:text-gdt-md md:file:text-gdt-md",
|
|
37
|
+
xl: "md:h-14 md:px-4.5 md:text-gdt-lg md:file:text-gdt-lg"
|
|
38
|
+
},
|
|
39
|
+
lg: {
|
|
40
|
+
sm: "lg:h-8 lg:px-3 lg:text-gdt-xs lg:file:text-gdt-xs",
|
|
41
|
+
md: "lg:h-10 lg:px-3.5 lg:text-gdt-sm lg:file:text-gdt-sm",
|
|
42
|
+
lg: "lg:h-12 lg:px-4 lg:text-gdt-md lg:file:text-gdt-md",
|
|
43
|
+
xl: "lg:h-14 lg:px-4.5 lg:text-gdt-lg lg:file:text-gdt-lg"
|
|
44
|
+
}
|
|
45
|
+
};
|
|
27
46
|
//#endregion
|
|
28
47
|
export { Input, inputVariants };
|
package/dist/line-chart.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as ComponentSize } from "./size-context-
|
|
1
|
+
import { t as ComponentSize } from "./size-context-BVhHduLi.js";
|
|
2
2
|
import { ChartConfig } from "./chart.js";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { Area, AreaChart as AreaChart$1, CartesianGrid, Line, LineChart as LineChart$1, XAxis, YAxis } from "recharts";
|
package/dist/mask-input.d.ts
CHANGED
package/dist/match.d.ts
CHANGED
|
@@ -1,15 +1,27 @@
|
|
|
1
|
+
import { n as ComponentSizeValue } from "./size-context-BVhHduLi.js";
|
|
1
2
|
import { VariantProps } from "class-variance-authority";
|
|
2
3
|
import * as React from "react";
|
|
3
4
|
//#region src/match.d.ts
|
|
4
5
|
declare const matchVariants: (props?: ({
|
|
5
6
|
variant?: "bar" | "donut" | null | undefined;
|
|
7
|
+
size?: "lg" | "md" | "sm" | null | undefined;
|
|
6
8
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
9
|
type MatchVariant = NonNullable<VariantProps<typeof matchVariants>["variant"]>;
|
|
8
|
-
type MatchProps = Omit<React.
|
|
10
|
+
type MatchProps = Omit<React.HTMLAttributes<HTMLElement>, "children"> & Omit<VariantProps<typeof matchVariants>, "size"> & {
|
|
9
11
|
value: number;
|
|
12
|
+
size?: ComponentSizeValue;
|
|
10
13
|
label?: string;
|
|
11
14
|
showChevron?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Forces the read-only presentation on (`true`) or off (`false`). Left
|
|
17
|
+
* unset, a `Match` is read-only unless it is given an `onClick` — a score
|
|
18
|
+
* with nothing behind it should not read as a control.
|
|
19
|
+
*/
|
|
20
|
+
readOnly?: boolean;
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
type?: "button" | "submit" | "reset";
|
|
23
|
+
ref?: React.Ref<HTMLElement>;
|
|
12
24
|
};
|
|
13
|
-
declare function Match({ className, value, variant, label, showChevron, type, "aria-label": ariaLabel, ...props }: MatchProps): React.JSX.Element;
|
|
25
|
+
declare function Match({ className, value, variant, size, label, showChevron, readOnly, type, disabled, onClick, ref, "aria-label": ariaLabel, ...props }: MatchProps): React.JSX.Element;
|
|
14
26
|
//#endregion
|
|
15
27
|
export { Match, type MatchProps, type MatchVariant, matchVariants };
|
package/dist/match.js
CHANGED
|
@@ -1,67 +1,240 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { ChevronDown } from "./icons.js";
|
|
3
3
|
import { cn } from "./utils/cn.js";
|
|
4
|
+
import { resolveResponsiveComponentSize, useComponentSizeValue } from "./size-context.js";
|
|
4
5
|
import { CircularProgress } from "./progress.js";
|
|
5
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
7
|
import { cva } from "class-variance-authority";
|
|
7
8
|
//#region src/match.tsx
|
|
8
|
-
const matchVariants = cva("inline-flex
|
|
9
|
-
variants: {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
const matchVariants = cva("inline-flex w-fit shrink-0 items-center rounded-full border border-line-subtle bg-surface text-fg-primary shadow-none transition-[background-color,border-color,box-shadow] outline-none focus-visible:border-line-focus focus-visible:shadow-[0px_0px_0px_2px_var(--color-line-focus)] disabled:pointer-events-none disabled:opacity-60", {
|
|
10
|
+
variants: {
|
|
11
|
+
variant: {
|
|
12
|
+
bar: "",
|
|
13
|
+
donut: ""
|
|
14
|
+
},
|
|
15
|
+
size: {
|
|
16
|
+
sm: "h-7 text-gdt-subtext",
|
|
17
|
+
md: "h-8 text-gdt-xs",
|
|
18
|
+
lg: "h-10 text-gdt-sm"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
compoundVariants: [
|
|
22
|
+
{
|
|
23
|
+
variant: "bar",
|
|
24
|
+
size: "sm",
|
|
25
|
+
className: "gap-1.5 px-2.5"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
variant: "bar",
|
|
29
|
+
size: "md",
|
|
30
|
+
className: "gap-2 px-3"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
variant: "bar",
|
|
34
|
+
size: "lg",
|
|
35
|
+
className: "gap-2.5 px-3.5"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
variant: "donut",
|
|
39
|
+
size: "sm",
|
|
40
|
+
className: "gap-2 pl-1.5 pr-2.5"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
variant: "donut",
|
|
44
|
+
size: "md",
|
|
45
|
+
className: "gap-3 pl-2 pr-3"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
variant: "donut",
|
|
49
|
+
size: "lg",
|
|
50
|
+
className: "gap-3.5 pl-2.5 pr-3.5"
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
defaultVariants: {
|
|
54
|
+
variant: "bar",
|
|
55
|
+
size: "md"
|
|
56
|
+
}
|
|
14
57
|
});
|
|
58
|
+
const matchDonutSizes = {
|
|
59
|
+
sm: {
|
|
60
|
+
pixelSize: 20,
|
|
61
|
+
strokeWidth: 3
|
|
62
|
+
},
|
|
63
|
+
md: {
|
|
64
|
+
pixelSize: 24,
|
|
65
|
+
strokeWidth: 4
|
|
66
|
+
},
|
|
67
|
+
lg: {
|
|
68
|
+
pixelSize: 28,
|
|
69
|
+
strokeWidth: 4
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
const matchBarSizes = {
|
|
73
|
+
sm: "h-1 w-12",
|
|
74
|
+
md: "h-1.5 w-15",
|
|
75
|
+
lg: "h-2 w-18"
|
|
76
|
+
};
|
|
77
|
+
const matchChevronSizes = {
|
|
78
|
+
sm: "size-2.5",
|
|
79
|
+
md: "size-3",
|
|
80
|
+
lg: "size-3.5"
|
|
81
|
+
};
|
|
15
82
|
function normalizeMatchValue(value) {
|
|
16
83
|
if (!Number.isFinite(value)) return 0;
|
|
17
84
|
return Math.min(100, Math.max(0, Math.round(value)));
|
|
18
85
|
}
|
|
19
|
-
function Match({ className, value, variant = "bar", label = "Match", showChevron
|
|
86
|
+
function Match({ className, value, variant = "bar", size, label = "Match", showChevron, readOnly, type = "button", disabled, onClick, ref, "aria-label": ariaLabel, ...props }) {
|
|
87
|
+
const sizeValue = useComponentSizeValue(size);
|
|
88
|
+
const resolvedSizes = resolveResponsiveComponentSize(sizeValue);
|
|
89
|
+
const responsive = typeof sizeValue !== "string";
|
|
90
|
+
const resolvedVariant = variant ?? "bar";
|
|
20
91
|
const progress = normalizeMatchValue(value);
|
|
21
92
|
const text = `${progress}% ${label}`;
|
|
22
|
-
|
|
23
|
-
|
|
93
|
+
const interactive = readOnly === void 0 ? onClick !== void 0 : !readOnly;
|
|
94
|
+
const chevron = showChevron ?? interactive;
|
|
95
|
+
const rootSizeClasses = cn(matchVariants({
|
|
96
|
+
variant: resolvedVariant,
|
|
97
|
+
size: resolvedSizes.base
|
|
98
|
+
}), responsive && matchBreakpointClasses(resolvedVariant, "md", resolvedSizes.md), responsive && matchBreakpointClasses(resolvedVariant, "lg", resolvedSizes.lg));
|
|
99
|
+
const rootProps = {
|
|
24
100
|
"aria-label": ariaLabel ?? text,
|
|
25
101
|
"data-slot": "match",
|
|
26
|
-
"data-variant":
|
|
27
|
-
|
|
102
|
+
"data-variant": resolvedVariant,
|
|
103
|
+
"data-size": resolvedSizes.base,
|
|
104
|
+
"data-size-md": responsive ? resolvedSizes.md : void 0,
|
|
105
|
+
"data-size-lg": responsive ? resolvedSizes.lg : void 0,
|
|
106
|
+
className: cn(rootSizeClasses, className)
|
|
107
|
+
};
|
|
108
|
+
const content = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
109
|
+
resolvedVariant === "donut" ? /* @__PURE__ */ jsx(MatchDonut, {
|
|
110
|
+
progress,
|
|
111
|
+
sizes: resolvedSizes,
|
|
112
|
+
responsive
|
|
113
|
+
}) : null,
|
|
114
|
+
/* @__PURE__ */ jsx("span", {
|
|
115
|
+
"data-slot": "match-label",
|
|
116
|
+
className: "shrink-0 font-bold",
|
|
117
|
+
children: text
|
|
118
|
+
}),
|
|
119
|
+
resolvedVariant === "bar" ? /* @__PURE__ */ jsx("span", {
|
|
120
|
+
"aria-hidden": "true",
|
|
121
|
+
"data-slot": "match-bar-track",
|
|
122
|
+
className: cn("relative shrink-0 overflow-hidden rounded-full bg-surface-raised", matchBarSizes[resolvedSizes.base], responsive && responsiveClass("md", matchBarSizes[resolvedSizes.md]), responsive && responsiveClass("lg", matchBarSizes[resolvedSizes.lg])),
|
|
123
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
124
|
+
"data-slot": "match-bar-fill",
|
|
125
|
+
className: "absolute inset-y-0 left-0 rounded-full bg-action-primary",
|
|
126
|
+
style: { width: `${progress}%` }
|
|
127
|
+
})
|
|
128
|
+
}) : null,
|
|
129
|
+
chevron ? /* @__PURE__ */ jsx(ChevronDown, {
|
|
130
|
+
"aria-hidden": "true",
|
|
131
|
+
"data-slot": "match-chevron",
|
|
132
|
+
className: cn("shrink-0 text-fg-secondary", matchChevronSizes[resolvedSizes.base], responsive && responsiveClass("md", matchChevronSizes[resolvedSizes.md]), responsive && responsiveClass("lg", matchChevronSizes[resolvedSizes.lg]))
|
|
133
|
+
}) : null
|
|
134
|
+
] });
|
|
135
|
+
if (!interactive) return /* @__PURE__ */ jsx("span", {
|
|
136
|
+
...rootProps,
|
|
137
|
+
"data-readonly": "true",
|
|
138
|
+
role: "img",
|
|
139
|
+
ref,
|
|
140
|
+
...props,
|
|
141
|
+
children: content
|
|
142
|
+
});
|
|
143
|
+
return /* @__PURE__ */ jsx("button", {
|
|
144
|
+
...rootProps,
|
|
145
|
+
type,
|
|
146
|
+
disabled,
|
|
147
|
+
onClick,
|
|
148
|
+
ref,
|
|
28
149
|
...props,
|
|
29
|
-
children:
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
150
|
+
children: content
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
const responsiveSizeClasses = {
|
|
154
|
+
md: {
|
|
155
|
+
sm: "md:h-7 md:text-gdt-subtext",
|
|
156
|
+
md: "md:h-8 md:text-gdt-xs",
|
|
157
|
+
lg: "md:h-10 md:text-gdt-sm"
|
|
158
|
+
},
|
|
159
|
+
lg: {
|
|
160
|
+
sm: "lg:h-7 lg:text-gdt-subtext",
|
|
161
|
+
md: "lg:h-8 lg:text-gdt-xs",
|
|
162
|
+
lg: "lg:h-10 lg:text-gdt-sm"
|
|
163
|
+
}
|
|
164
|
+
};
|
|
165
|
+
const responsiveVariantClasses = {
|
|
166
|
+
md: {
|
|
167
|
+
bar: {
|
|
168
|
+
sm: "md:gap-1.5 md:px-2.5",
|
|
169
|
+
md: "md:gap-2 md:px-3",
|
|
170
|
+
lg: "md:gap-2.5 md:px-3.5"
|
|
171
|
+
},
|
|
172
|
+
donut: {
|
|
173
|
+
sm: "md:gap-2 md:pl-1.5 md:pr-2.5",
|
|
174
|
+
md: "md:gap-3 md:pl-2 md:pr-3",
|
|
175
|
+
lg: "md:gap-3.5 md:pl-2.5 md:pr-3.5"
|
|
176
|
+
}
|
|
177
|
+
},
|
|
178
|
+
lg: {
|
|
179
|
+
bar: {
|
|
180
|
+
sm: "lg:gap-1.5 lg:px-2.5",
|
|
181
|
+
md: "lg:gap-2 lg:px-3",
|
|
182
|
+
lg: "lg:gap-2.5 lg:px-3.5"
|
|
183
|
+
},
|
|
184
|
+
donut: {
|
|
185
|
+
sm: "lg:gap-2 lg:pl-1.5 lg:pr-2.5",
|
|
186
|
+
md: "lg:gap-3 lg:pl-2 lg:pr-3",
|
|
187
|
+
lg: "lg:gap-3.5 lg:pl-2.5 lg:pr-3.5"
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
};
|
|
191
|
+
function matchBreakpointClasses(variant, breakpoint, size) {
|
|
192
|
+
return cn(responsiveSizeClasses[breakpoint][size], responsiveVariantClasses[breakpoint][variant][size]);
|
|
193
|
+
}
|
|
194
|
+
const responsiveTokenClasses = {
|
|
195
|
+
md: {
|
|
196
|
+
"h-1 w-12": "md:h-1 md:w-12",
|
|
197
|
+
"h-1.5 w-15": "md:h-1.5 md:w-15",
|
|
198
|
+
"h-2 w-18": "md:h-2 md:w-18",
|
|
199
|
+
"size-2.5": "md:size-2.5",
|
|
200
|
+
"size-3": "md:size-3",
|
|
201
|
+
"size-3.5": "md:size-3.5"
|
|
202
|
+
},
|
|
203
|
+
lg: {
|
|
204
|
+
"h-1 w-12": "lg:h-1 lg:w-12",
|
|
205
|
+
"h-1.5 w-15": "lg:h-1.5 lg:w-15",
|
|
206
|
+
"h-2 w-18": "lg:h-2 lg:w-18",
|
|
207
|
+
"size-2.5": "lg:size-2.5",
|
|
208
|
+
"size-3": "lg:size-3",
|
|
209
|
+
"size-3.5": "lg:size-3.5"
|
|
210
|
+
}
|
|
211
|
+
};
|
|
212
|
+
function responsiveClass(breakpoint, className) {
|
|
213
|
+
return responsiveTokenClasses[breakpoint][className];
|
|
214
|
+
}
|
|
215
|
+
function MatchDonut({ progress, sizes, responsive }) {
|
|
216
|
+
return (responsive ? [
|
|
217
|
+
"base",
|
|
218
|
+
"md",
|
|
219
|
+
"lg"
|
|
220
|
+
] : ["base"]).map((breakpoint) => {
|
|
221
|
+
const size = sizes[breakpoint];
|
|
222
|
+
const dimensions = matchDonutSizes[size];
|
|
223
|
+
const visibility = responsive ? breakpoint === "base" ? "md:hidden" : breakpoint === "md" ? "hidden md:grid lg:hidden" : "hidden lg:grid" : "";
|
|
224
|
+
return /* @__PURE__ */ jsx(CircularProgress, {
|
|
225
|
+
"aria-hidden": "true",
|
|
226
|
+
role: "presentation",
|
|
227
|
+
"data-slot": "match-donut",
|
|
228
|
+
value: progress,
|
|
229
|
+
pixelSize: dimensions.pixelSize,
|
|
230
|
+
strokeWidth: dimensions.strokeWidth,
|
|
231
|
+
strokeLinecap: "butt",
|
|
232
|
+
className: cn("shrink-0", visibility),
|
|
233
|
+
children: /* @__PURE__ */ jsxs("span", {
|
|
234
|
+
className: "sr-only",
|
|
235
|
+
children: [progress, "%"]
|
|
236
|
+
})
|
|
237
|
+
}, breakpoint);
|
|
65
238
|
});
|
|
66
239
|
}
|
|
67
240
|
//#endregion
|
|
@@ -9,7 +9,7 @@ import { ReviewBlock } from "./review-block.js";
|
|
|
9
9
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
10
10
|
import { cva } from "class-variance-authority";
|
|
11
11
|
//#region src/media-gallery-hero.tsx
|
|
12
|
-
const mediaGalleryHeroVariants = cva("relative isolate h-[350px] w-full overflow-hidden rounded-
|
|
12
|
+
const mediaGalleryHeroVariants = cva("relative isolate h-[350px] w-full overflow-hidden rounded-none md:h-[380px] md:rounded-[40px] lg:h-[480px]");
|
|
13
13
|
const mediaGalleryImagesVariants = cva("absolute inset-0 z-0 hidden size-full min-h-0 min-w-0 md:grid", {
|
|
14
14
|
variants: { imageCount: {
|
|
15
15
|
1: "",
|
|
@@ -53,7 +53,7 @@ function MediaGalleryTile({ className, image, index, isDesktopTile, onMediaClick
|
|
|
53
53
|
className: "text-gdt-sm font-medium text-fg-caption-placeholder",
|
|
54
54
|
children: "Media"
|
|
55
55
|
}));
|
|
56
|
-
const tileClassName = cn("relative flex size-full min-h-0 min-w-0 items-center justify-center overflow-hidden rounded-
|
|
56
|
+
const tileClassName = cn("relative flex size-full min-h-0 min-w-0 items-center justify-center overflow-hidden rounded-none bg-surface-raised md:rounded-[40px]", "[&>img]:size-full [&>img]:object-cover", isDesktopTile && "hidden md:flex", className);
|
|
57
57
|
if (!onMediaClick) return /* @__PURE__ */ jsx("div", {
|
|
58
58
|
className: tileClassName,
|
|
59
59
|
"data-slot": "media-gallery-tile",
|
|
@@ -71,6 +71,7 @@ function MediaGalleryTile({ className, image, index, isDesktopTile, onMediaClick
|
|
|
71
71
|
function MobileGalleryCounter({ total }) {
|
|
72
72
|
const { selectedIndex } = useCarousel();
|
|
73
73
|
return /* @__PURE__ */ jsx(GalleryIndicator, {
|
|
74
|
+
className: "h-[35px] lg:h-[45px]",
|
|
74
75
|
currentPhoto: selectedIndex + 1,
|
|
75
76
|
size: "sm",
|
|
76
77
|
totalPhotos: total
|
|
@@ -79,17 +80,16 @@ function MobileGalleryCounter({ total }) {
|
|
|
79
80
|
function MobileMediaCarousel({ currentMedia, images, mediaTotal, onMediaClick, renderMedia, showMobileIndicator }) {
|
|
80
81
|
const carouselImages = images.length > 0 ? images : [{}];
|
|
81
82
|
return /* @__PURE__ */ jsxs(Carousel, {
|
|
82
|
-
className: "absolute inset-0 z-0 block size-full rounded-
|
|
83
|
+
className: "absolute inset-0 z-0 block size-full rounded-none md:hidden",
|
|
83
84
|
imageSize: "full",
|
|
84
85
|
opts: {
|
|
85
86
|
align: "start",
|
|
86
|
-
loop: carouselImages.length > 1,
|
|
87
87
|
startIndex: Math.max(0, currentMedia - 1)
|
|
88
88
|
},
|
|
89
89
|
children: [/* @__PURE__ */ jsx(CarouselContent, { children: carouselImages.map((image, index) => /* @__PURE__ */ jsx(CarouselItem, {
|
|
90
90
|
className: "h-full",
|
|
91
91
|
children: /* @__PURE__ */ jsx(MediaGalleryTile, {
|
|
92
|
-
className: "rounded-
|
|
92
|
+
className: "rounded-none",
|
|
93
93
|
image,
|
|
94
94
|
index,
|
|
95
95
|
onMediaClick,
|
|
@@ -148,7 +148,7 @@ function MediaGalleryVideo({ alt = "", autoPlay, className, controls, label = "P
|
|
|
148
148
|
children: "Video"
|
|
149
149
|
}));
|
|
150
150
|
return /* @__PURE__ */ jsxs("div", {
|
|
151
|
-
className: cn("absolute inset-0 z-0 flex size-full items-center justify-center overflow-hidden rounded-
|
|
151
|
+
className: cn("absolute inset-0 z-0 flex size-full items-center justify-center overflow-hidden rounded-none bg-surface-raised md:rounded-[40px]", "[&>img]:size-full [&>img]:object-cover [&>video]:size-full [&>video]:object-cover", className),
|
|
152
152
|
"data-slot": "media-gallery-video",
|
|
153
153
|
...props,
|
|
154
154
|
children: [content, controls ? null : /* @__PURE__ */ jsx("button", {
|
|
@@ -156,7 +156,7 @@ function MediaGalleryVideo({ alt = "", autoPlay, className, controls, label = "P
|
|
|
156
156
|
className: cn(buttonVariants({
|
|
157
157
|
variant: "glass-overlay",
|
|
158
158
|
size: "icon-xl"
|
|
159
|
-
}), "absolute top-1/2 left-1/2 z-10 size-
|
|
159
|
+
}), "absolute top-1/2 left-1/2 z-10 size-[35px] -translate-x-1/2 -translate-y-1/2 active:not-aria-[haspopup]:-translate-y-1/2 lg:size-[45px] [&>svg]:size-4 lg:[&>svg]:size-5"),
|
|
160
160
|
"data-slot": "media-gallery-video-play",
|
|
161
161
|
onClick: onPlayClick,
|
|
162
162
|
type: "button",
|
|
@@ -187,6 +187,7 @@ function MediaGalleryIndicator({ "aria-label": ariaLabel, className, label, onCl
|
|
|
187
187
|
...props,
|
|
188
188
|
children: /* @__PURE__ */ jsx(GalleryIndicator, {
|
|
189
189
|
"aria-hidden": "true",
|
|
190
|
+
className: "h-[35px] lg:h-[45px]",
|
|
190
191
|
label: indicatorLabel,
|
|
191
192
|
size
|
|
192
193
|
})
|
|
@@ -195,6 +196,7 @@ function MediaGalleryIndicator({ "aria-label": ariaLabel, className, label, onCl
|
|
|
195
196
|
className: cn("absolute right-4 bottom-4 z-10 hidden md:block", className),
|
|
196
197
|
"data-slot": "media-gallery-indicator",
|
|
197
198
|
children: /* @__PURE__ */ jsx(GalleryIndicator, {
|
|
199
|
+
className: "h-[35px] lg:h-[45px]",
|
|
198
200
|
label: indicatorLabel,
|
|
199
201
|
size
|
|
200
202
|
})
|
package/dist/media-player.js
CHANGED
|
@@ -171,7 +171,7 @@ function MediaPlayerRoot({ audio, children, className, onBlurCapture, onFocusCap
|
|
|
171
171
|
"data-slot": "media-player",
|
|
172
172
|
role: "region",
|
|
173
173
|
tabIndex: 0,
|
|
174
|
-
className: cn("group/media-player relative isolate block w-full overflow-hidden rounded-2xl bg-fg-primary text-fg-on-brand shadow-2 outline-none", "data-[controls=hidden]:cursor-none", "data-[audio]:bg-[image:var(--gradient-accent-forest-to-brass)]", "data-[fullscreen]:rounded-none data-[fullscreen]:shadow-none", className),
|
|
174
|
+
className: cn("group/media-player relative isolate block w-full overflow-hidden rounded-2xl bg-fg-primary text-fg-on-brand shadow-2 outline-none [transform:translateZ(0)]", "data-[controls=hidden]:cursor-none", "data-[audio]:bg-[image:var(--gradient-accent-forest-to-brass)]", "data-[fullscreen]:rounded-none data-[fullscreen]:shadow-none", className),
|
|
175
175
|
...props,
|
|
176
176
|
onBlurCapture: (event) => {
|
|
177
177
|
onBlurCapture?.(event);
|
|
@@ -264,7 +264,7 @@ function MediaPlayerVideo({ className, ref, ...props }) {
|
|
|
264
264
|
setRef(ref, node);
|
|
265
265
|
}, [ref]),
|
|
266
266
|
"data-slot": "media-player-video",
|
|
267
|
-
className: cn("block aspect-video size-full
|
|
267
|
+
className: cn("block aspect-video size-full object-cover", "group-data-[fullscreen]/media-player:aspect-auto group-data-[fullscreen]/media-player:object-contain", className),
|
|
268
268
|
playsInline: true,
|
|
269
269
|
...props
|
|
270
270
|
});
|
|
@@ -891,7 +891,7 @@ function MediaPlayerError({ children, className, ...props }) {
|
|
|
891
891
|
return /* @__PURE__ */ jsx("div", {
|
|
892
892
|
"data-slot": "media-player-error",
|
|
893
893
|
role: "alert",
|
|
894
|
-
className: cn("absolute inset-0 z-20 flex flex-col items-center justify-center gap-1
|
|
894
|
+
className: cn("absolute inset-0 z-20 flex flex-col items-center justify-center gap-1 bg-canvas px-6 text-center text-fg-primary", className),
|
|
895
895
|
...props,
|
|
896
896
|
children: children ?? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
897
897
|
/* @__PURE__ */ jsx(TriangleAlert, {
|
package/dist/mobile-sidebar.js
CHANGED
|
@@ -27,7 +27,8 @@ function MobileSidebarContent({ className, showCloseButton = false, ...props })
|
|
|
27
27
|
side: "right",
|
|
28
28
|
size: "sm",
|
|
29
29
|
showCloseButton,
|
|
30
|
-
|
|
30
|
+
popupClassName: "h-dvh w-full max-w-[24.375rem]",
|
|
31
|
+
className: cn("h-dvh w-full rounded-none border-y-0 border-r-0 bg-canvas [--sheet-padding-x:1.25rem] [--sheet-padding-top:0.8125rem]", className),
|
|
31
32
|
...props
|
|
32
33
|
});
|
|
33
34
|
}
|
|
@@ -80,7 +81,7 @@ function MobileSidebarNav({ className, ...props }) {
|
|
|
80
81
|
function MobileSidebarList({ className, ...props }) {
|
|
81
82
|
return /* @__PURE__ */ jsx("ul", {
|
|
82
83
|
"data-slot": "mobile-sidebar-list",
|
|
83
|
-
className: cn("flex flex-col", className),
|
|
84
|
+
className: cn("-mx-4 flex flex-col gap-1", className),
|
|
84
85
|
...props
|
|
85
86
|
});
|
|
86
87
|
}
|
|
@@ -96,7 +97,7 @@ function MobileSidebarLink({ active = false, icon, className, children, render,
|
|
|
96
97
|
defaultTagName: "a",
|
|
97
98
|
props: mergeProps({
|
|
98
99
|
"aria-current": active ? "page" : void 0,
|
|
99
|
-
className: cn("group/mobile-sidebar-link grid min-h-11 w-full grid-cols-1 items-center rounded-xl px-
|
|
100
|
+
className: cn("group/mobile-sidebar-link grid min-h-11 w-full grid-cols-1 items-center rounded-xl px-4 py-2.5 text-left text-gdt-md font-semibold text-fg-primary outline-none transition-colors hover:bg-surface focus-visible:shadow-[0_0_0_2px_var(--color-line-focus)]", active && "bg-surface-brand-subtle text-fg-brand hover:bg-surface-brand-subtle", className),
|
|
100
101
|
children: /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs("span", {
|
|
101
102
|
className: cn("grid min-w-0 items-center", icon ? "grid-cols-[1.25rem_minmax(0,1fr)] gap-3" : "grid-cols-1"),
|
|
102
103
|
children: [icon ? /* @__PURE__ */ jsx("span", {
|
|
@@ -126,7 +127,7 @@ function MobileSidebarGroupTrigger({ active = false, icon, className, children,
|
|
|
126
127
|
return /* @__PURE__ */ jsxs(CollapsibleTrigger, {
|
|
127
128
|
"data-slot": "mobile-sidebar-group-trigger",
|
|
128
129
|
"data-active": active || void 0,
|
|
129
|
-
className: cn("grid min-h-11 w-full grid-cols-[minmax(0,1fr)_auto] items-center gap-3 rounded-xl px-
|
|
130
|
+
className: cn("grid min-h-11 w-full grid-cols-[minmax(0,1fr)_auto] items-center gap-3 rounded-xl px-4 py-2.5 text-left text-gdt-md font-semibold text-fg-primary outline-none transition-colors hover:bg-surface focus-visible:shadow-[0_0_0_2px_var(--color-line-focus)]", active && "bg-surface-brand-subtle text-fg-brand hover:bg-surface-brand-subtle", className),
|
|
130
131
|
...props,
|
|
131
132
|
children: [/* @__PURE__ */ jsxs("span", {
|
|
132
133
|
className: cn("grid min-w-0 items-center", icon ? "grid-cols-[1.25rem_minmax(0,1fr)] gap-3" : "grid-cols-1"),
|
|
@@ -153,7 +154,7 @@ function MobileSidebarGroupPanel({ className, ...props }) {
|
|
|
153
154
|
function MobileSidebarSubList({ className, ...props }) {
|
|
154
155
|
return /* @__PURE__ */ jsx("ul", {
|
|
155
156
|
"data-slot": "mobile-sidebar-sub-list",
|
|
156
|
-
className: cn("ml-8 flex flex-col pb-1", className),
|
|
157
|
+
className: cn("ml-8 flex flex-col gap-0.5 pb-2 pt-1", className),
|
|
157
158
|
...props
|
|
158
159
|
});
|
|
159
160
|
}
|
|
@@ -167,7 +168,7 @@ function MobileSidebarSubheading({ className, ...props }) {
|
|
|
167
168
|
function MobileSidebarSubLink({ className, render, ...props }) {
|
|
168
169
|
return useRender({
|
|
169
170
|
defaultTagName: "a",
|
|
170
|
-
props: mergeProps({ className: cn("block rounded-lg px-
|
|
171
|
+
props: mergeProps({ className: cn("block rounded-lg px-4 py-1.5 text-gdt-sm font-medium text-fg-secondary outline-none transition-colors hover:bg-surface hover:text-fg-primary focus-visible:shadow-[0_0_0_2px_var(--color-line-focus)]", className) }, props),
|
|
171
172
|
render,
|
|
172
173
|
state: { slot: "mobile-sidebar-sub-link" }
|
|
173
174
|
});
|
package/dist/number-input.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as ComponentSizeValue } from "./size-context-BVhHduLi.js";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { NumberFieldRootProps } from "@base-ui/react/number-field";
|
|
4
4
|
//#region src/number-input.d.ts
|
|
@@ -32,7 +32,7 @@ type NumberInputProps = Omit<NumberFieldRootProps, "format"> & {
|
|
|
32
32
|
format?: Intl.NumberFormatOptions;
|
|
33
33
|
formatPreset?: NumberInputFormatPreset;
|
|
34
34
|
placeholder?: string;
|
|
35
|
-
size?:
|
|
35
|
+
size?: ComponentSizeValue;
|
|
36
36
|
thousandSeparator?: boolean;
|
|
37
37
|
};
|
|
38
38
|
declare function NumberInput({ children, format, formatPreset, placeholder, size, thousandSeparator, ...props }: NumberInputProps): React.JSX.Element;
|
package/dist/number-input.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { Minus, Plus } from "./icons.js";
|
|
3
3
|
import { cn } from "./utils/cn.js";
|
|
4
|
-
import { SizeProvider, useComponentSize } from "./size-context.js";
|
|
4
|
+
import { SizeProvider, useComponentSize, useComponentSizeValue } from "./size-context.js";
|
|
5
5
|
import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput } from "./input-group.js";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
import { NumberField } from "@base-ui/react/number-field";
|
|
@@ -25,7 +25,7 @@ const numberInputFormatPresets = {
|
|
|
25
25
|
plain: { useGrouping: false }
|
|
26
26
|
};
|
|
27
27
|
function NumberInput({ children, format, formatPreset, placeholder, size, thousandSeparator, ...props }) {
|
|
28
|
-
const resolvedSize =
|
|
28
|
+
const resolvedSize = useComponentSizeValue(size);
|
|
29
29
|
const resolvedFormat = format ?? (formatPreset ? numberInputFormatPresets[formatPreset] : void 0) ?? (thousandSeparator ? numberInputFormatPresets.decimal : void 0);
|
|
30
30
|
return /* @__PURE__ */ jsx(SizeProvider, {
|
|
31
31
|
size: resolvedSize,
|
package/dist/pagination.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as ButtonLink, t as Button } from "./button-
|
|
1
|
+
import { n as ButtonLink, t as Button } from "./button-BS5KCibF.js";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
//#region src/pagination.d.ts
|
|
4
4
|
declare function Pagination({ className, ...props }: React.ComponentProps<"nav">): React.JSX.Element;
|
package/dist/phone-input.d.ts
CHANGED
|
@@ -1,21 +1,38 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as ComponentSizeValue } from "./size-context-BVhHduLi.js";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { CountryCode } from "libphonenumber-js";
|
|
4
4
|
//#region src/phone-input.d.ts
|
|
5
5
|
interface PhoneInputProps {
|
|
6
|
+
/** Controlled E.164 value, e.g. `"+2348012345678"`. */
|
|
6
7
|
value?: string;
|
|
7
8
|
onChange?: (value: string | undefined) => void;
|
|
9
|
+
/** Country the field starts on, before anything is typed. */
|
|
8
10
|
defaultCountry?: CountryCode;
|
|
9
|
-
size?:
|
|
11
|
+
size?: ComponentSizeValue;
|
|
10
12
|
disabled?: boolean;
|
|
11
13
|
readOnly?: boolean;
|
|
12
14
|
placeholder?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Content pinned to the trailing edge of the field — a validity tick, a
|
|
17
|
+
* "Verify" button, an extension. It sits outside the number, so it never
|
|
18
|
+
* shifts as the number is formatted.
|
|
19
|
+
*/
|
|
20
|
+
rightAddon?: React.ReactNode;
|
|
13
21
|
className?: string;
|
|
14
22
|
id?: string;
|
|
15
23
|
name?: string;
|
|
16
24
|
ref?: React.Ref<HTMLInputElement>;
|
|
17
25
|
"aria-invalid"?: boolean;
|
|
18
26
|
}
|
|
19
|
-
|
|
27
|
+
/**
|
|
28
|
+
* A phone field that takes a number written either way round.
|
|
29
|
+
*
|
|
30
|
+
* `0801 234 5678` and `+234 801 234 5678` are the same number, and both are
|
|
31
|
+
* accepted here: typing or pasting a leading `+` switches the field to
|
|
32
|
+
* international entry and moves the country selector to match, while a plain
|
|
33
|
+
* national number is read against the selected country, trunk prefix and all.
|
|
34
|
+
* `onChange` receives E.164 in both cases.
|
|
35
|
+
*/
|
|
36
|
+
declare function PhoneInput({ value, onChange, defaultCountry, size, disabled, readOnly, placeholder, rightAddon, className, id, name, ref, "aria-invalid": ariaInvalid }: PhoneInputProps): React.JSX.Element;
|
|
20
37
|
//#endregion
|
|
21
38
|
export { type CountryCode, PhoneInput, type PhoneInputProps };
|