@giddaa-housing/ui 3.5.0 → 3.6.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/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-CACVdp1R.js} +41 -9
- 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 +3 -1
- package/dist/dialog.js +9 -5
- 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/input-group.d.ts +6 -6
- package/dist/input-group.js +38 -13
- 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 +5 -2
- package/dist/match.js +182 -26
- package/dist/media-gallery-hero.js +9 -7
- package/dist/mobile-sidebar.js +1 -0
- 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 +2 -2
- package/dist/phone-input.js +5 -4
- 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/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 +112 -19
- package/dist/sheet.d.ts +3 -1
- package/dist/sheet.js +9 -5
- 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 +1 -1
- package/dist/sonar.js +1 -1
- package/dist/sparkline.d.ts +1 -1
- package/dist/styles.css +1576 -258
- 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 +3 -2
- package/dist/waterfall-chart.d.ts +1 -1
- package/package.json +5 -1
- package/dist/button-DW5OijoR.d.ts +0 -17
- 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/dialog.js
CHANGED
|
@@ -42,7 +42,7 @@ function DialogOverlay({ className, ...props }) {
|
|
|
42
42
|
...props
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
|
-
const dialogContentVariants = cva("group/dialog-content fixed top-1/2 left-1/2 z-50
|
|
45
|
+
const dialogContentVariants = cva("group/dialog-content pointer-events-none fixed top-1/2 left-1/2 z-50 w-full max-w-[calc(100vw-2rem)] -translate-x-1/2 -translate-y-1/2 overflow-visible outline-none [--dialog-padding:1.25rem] origin-center transition-[opacity,scale] duration-[var(--duration-motion-popup)] ease-gdt-out data-starting-style:opacity-0 data-starting-style:scale-95 data-ending-style:opacity-0 data-ending-style:scale-95 motion-reduce:data-starting-style:scale-100 motion-reduce:data-ending-style:scale-100 data-[nested-dialog-open]:scale-[0.96]", {
|
|
46
46
|
variants: { size: {
|
|
47
47
|
sm: "sm:w-90 sm:[--dialog-padding:1.5rem]",
|
|
48
48
|
md: "sm:w-105 sm:[--dialog-padding:1.5rem]",
|
|
@@ -69,20 +69,24 @@ const dialogIconVariants = cva("flex shrink-0 items-center justify-center [&_svg
|
|
|
69
69
|
tone: "brand"
|
|
70
70
|
}
|
|
71
71
|
});
|
|
72
|
-
function DialogContent({ className, children, size, showCloseButton = true, ...props }) {
|
|
72
|
+
function DialogContent({ className, children, size, showCloseButton = true, popupClassName, ...props }) {
|
|
73
73
|
const resolvedSize = useComponentSize(size);
|
|
74
74
|
return /* @__PURE__ */ jsxs(DialogPortal, { children: [/* @__PURE__ */ jsx(DialogOverlay, {}), /* @__PURE__ */ jsx(SizeProvider, {
|
|
75
75
|
size: resolvedSize,
|
|
76
76
|
children: /* @__PURE__ */ jsxs(Dialog$1.Popup, {
|
|
77
77
|
"data-slot": "dialog-content",
|
|
78
78
|
"data-size": resolvedSize,
|
|
79
|
-
className: cn(dialogContentVariants({ size: resolvedSize }),
|
|
79
|
+
className: cn(dialogContentVariants({ size: resolvedSize }), popupClassName),
|
|
80
80
|
...props,
|
|
81
|
-
children: [
|
|
81
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
82
|
+
"data-slot": "dialog-surface",
|
|
83
|
+
className: cn("pointer-events-auto flex max-h-[calc(100dvh-5rem)] w-full flex-col gap-4 overflow-visible rounded-2xl border border-line-subtle bg-surface-overlay bg-clip-padding p-(--dialog-padding) text-fg-primary shadow-(--elevation-e2-shadow)", className),
|
|
84
|
+
children
|
|
85
|
+
}), showCloseButton && /* @__PURE__ */ jsx(Dialog$1.Close, {
|
|
82
86
|
"data-slot": "dialog-close",
|
|
83
87
|
render: /* @__PURE__ */ jsxs(Button, {
|
|
84
88
|
variant: "tertiary",
|
|
85
|
-
className: "absolute -top-10 right-0 z-10 group-data-[nested-dialog-open]/dialog-content:hidden",
|
|
89
|
+
className: "pointer-events-auto absolute -top-10 right-0 z-10 group-data-[nested-dialog-open]/dialog-content:hidden",
|
|
86
90
|
size: "icon-sm",
|
|
87
91
|
children: [/* @__PURE__ */ jsx(X, {}), /* @__PURE__ */ jsx("span", {
|
|
88
92
|
className: "sr-only",
|
package/dist/dropdown-menu.d.ts
CHANGED
package/dist/field.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { n as ComponentSizeValue } from "./size-context-BVhHduLi.js";
|
|
1
2
|
import { Label } from "./label.js";
|
|
2
3
|
import { VariantProps } from "class-variance-authority";
|
|
3
4
|
//#region src/field.d.ts
|
|
@@ -10,7 +11,9 @@ declare const fieldVariants: (props?: ({
|
|
|
10
11
|
orientation?: "horizontal" | "responsive" | "vertical" | null | undefined;
|
|
11
12
|
size?: "lg" | "md" | "sm" | null | undefined;
|
|
12
13
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
13
|
-
declare function Field({ className, orientation, size, ...props }: React.ComponentProps<"div"> & VariantProps<typeof fieldVariants
|
|
14
|
+
declare function Field({ className, orientation, size, ...props }: React.ComponentProps<"div"> & Omit<VariantProps<typeof fieldVariants>, "size"> & {
|
|
15
|
+
size?: ComponentSizeValue;
|
|
16
|
+
}): import("react").JSX.Element;
|
|
14
17
|
declare function FieldContent({ className, ...props }: React.ComponentProps<"div">): import("react").JSX.Element;
|
|
15
18
|
declare function FieldLabel({ className, ...props }: React.ComponentProps<typeof Label>): import("react").JSX.Element;
|
|
16
19
|
declare function FieldTitle({ className, ...props }: React.ComponentProps<"div">): import("react").JSX.Element;
|
package/dist/field.js
CHANGED
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "./utils/cn.js";
|
|
3
|
-
import { SizeProvider,
|
|
3
|
+
import { SizeProvider, responsiveValueClasses, useComponentSizeValue } from "./size-context.js";
|
|
4
4
|
import { Separator } from "./separator.js";
|
|
5
5
|
import { Label } from "./label.js";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
import { cva } from "class-variance-authority";
|
|
8
8
|
import { useMemo } from "react";
|
|
9
9
|
//#region src/field.tsx
|
|
10
|
+
const fieldSizeVariants = {
|
|
11
|
+
sm: "gap-1",
|
|
12
|
+
md: "gap-1.5",
|
|
13
|
+
lg: "gap-2"
|
|
14
|
+
};
|
|
10
15
|
function FieldSet({ className, ...props }) {
|
|
11
16
|
return /* @__PURE__ */ jsx("fieldset", {
|
|
12
17
|
"data-slot": "field-set",
|
|
@@ -36,11 +41,7 @@ const fieldVariants = cva("group/field flex w-full", {
|
|
|
36
41
|
horizontal: "flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio],[role=switch]]:mt-px data-[size=sm]:gap-1.5 data-[size=md]:gap-2.5 data-[size=lg]:gap-3",
|
|
37
42
|
responsive: "flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio],[role=switch]]:mt-px"
|
|
38
43
|
},
|
|
39
|
-
size:
|
|
40
|
-
sm: "gap-1",
|
|
41
|
-
md: "gap-1.5",
|
|
42
|
-
lg: "gap-2"
|
|
43
|
-
}
|
|
44
|
+
size: fieldSizeVariants
|
|
44
45
|
},
|
|
45
46
|
defaultVariants: {
|
|
46
47
|
orientation: "vertical",
|
|
@@ -48,22 +49,38 @@ const fieldVariants = cva("group/field flex w-full", {
|
|
|
48
49
|
}
|
|
49
50
|
});
|
|
50
51
|
function Field({ className, orientation = "vertical", size, ...props }) {
|
|
51
|
-
const
|
|
52
|
+
const sizeValue = useComponentSizeValue(size);
|
|
53
|
+
const resolvedSize = responsiveValueClasses(sizeValue, responsiveFieldSizes);
|
|
52
54
|
return /* @__PURE__ */ jsx(SizeProvider, {
|
|
53
|
-
size:
|
|
55
|
+
size: sizeValue,
|
|
54
56
|
children: /* @__PURE__ */ jsx("div", {
|
|
55
57
|
role: "group",
|
|
56
58
|
"data-slot": "field",
|
|
57
59
|
"data-orientation": orientation,
|
|
58
|
-
"data-size": resolvedSize,
|
|
60
|
+
"data-size": resolvedSize.base,
|
|
61
|
+
"data-size-md": resolvedSize.responsive ? resolvedSize.md : void 0,
|
|
62
|
+
"data-size-lg": resolvedSize.responsive ? resolvedSize.lg : void 0,
|
|
59
63
|
className: cn(fieldVariants({
|
|
60
64
|
orientation,
|
|
61
|
-
size:
|
|
62
|
-
}), className),
|
|
65
|
+
size: null
|
|
66
|
+
}), resolvedSize.className, className),
|
|
63
67
|
...props
|
|
64
68
|
})
|
|
65
69
|
});
|
|
66
70
|
}
|
|
71
|
+
const responsiveFieldSizes = {
|
|
72
|
+
base: fieldSizeVariants,
|
|
73
|
+
md: {
|
|
74
|
+
sm: "md:gap-1",
|
|
75
|
+
md: "md:gap-1.5",
|
|
76
|
+
lg: "md:gap-2"
|
|
77
|
+
},
|
|
78
|
+
lg: {
|
|
79
|
+
sm: "lg:gap-1",
|
|
80
|
+
md: "lg:gap-1.5",
|
|
81
|
+
lg: "lg:gap-2"
|
|
82
|
+
}
|
|
83
|
+
};
|
|
67
84
|
function FieldContent({ className, ...props }) {
|
|
68
85
|
return /* @__PURE__ */ jsx("div", {
|
|
69
86
|
"data-slot": "field-content",
|
package/dist/footer.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { InputSizeValue } from "./input.js";
|
|
2
2
|
import { useRender } from "@base-ui/react/use-render";
|
|
3
3
|
import { VariantProps } from "class-variance-authority";
|
|
4
4
|
import * as React from "react";
|
|
@@ -39,7 +39,7 @@ declare function FooterNewsletter({ className, ...props }: React.ComponentProps<
|
|
|
39
39
|
declare function FooterNewsletterTitle({ className, ...props }: React.ComponentProps<"h3">): React.JSX.Element;
|
|
40
40
|
declare function FooterNewsletterDescription({ className, ...props }: React.ComponentProps<"p">): React.JSX.Element;
|
|
41
41
|
declare function FooterNewsletterControl({ className, children, size, ...props }: React.ComponentProps<"div"> & {
|
|
42
|
-
size?:
|
|
42
|
+
size?: InputSizeValue;
|
|
43
43
|
}): React.JSX.Element;
|
|
44
44
|
declare function FooterBottom({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
45
45
|
declare function FooterLegalLinks({ className, ...props }: React.ComponentProps<"nav">): React.JSX.Element;
|
package/dist/funnel-chart.d.ts
CHANGED
package/dist/heatmap-chart.d.ts
CHANGED
package/dist/input-group.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { n as
|
|
1
|
+
import { n as ComponentSizeValue } from "./size-context-BVhHduLi.js";
|
|
2
|
+
import { t as Button } from "./button-BS5KCibF.js";
|
|
3
|
+
import { n as InputComponentSizeValue } from "./input-size-context-BMhves-J.js";
|
|
4
4
|
import { VariantProps } from "class-variance-authority";
|
|
5
5
|
import * as React from "react";
|
|
6
6
|
//#region src/input-group.d.ts
|
|
7
7
|
declare function InputGroup({ className, size, ...props }: React.ComponentProps<"div"> & {
|
|
8
|
-
size?:
|
|
8
|
+
size?: InputComponentSizeValue;
|
|
9
9
|
}): React.JSX.Element;
|
|
10
10
|
declare const inputGroupAddonVariants: (props?: ({
|
|
11
11
|
align?: "block-end" | "block-start" | "inline-end" | "inline-start" | null | undefined;
|
|
@@ -19,10 +19,10 @@ declare function InputGroupButton({ className, type, variant, size, ...props }:
|
|
|
19
19
|
}): React.JSX.Element;
|
|
20
20
|
declare function InputGroupText({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
|
21
21
|
declare function InputGroupInput({ className, size, ...props }: Omit<React.ComponentProps<"input">, "size"> & {
|
|
22
|
-
size?:
|
|
22
|
+
size?: InputComponentSizeValue;
|
|
23
23
|
}): React.JSX.Element;
|
|
24
24
|
declare function InputGroupTextarea({ className, size, ...props }: Omit<React.ComponentProps<"textarea">, "size"> & {
|
|
25
|
-
size?:
|
|
25
|
+
size?: ComponentSizeValue;
|
|
26
26
|
}): React.JSX.Element;
|
|
27
27
|
//#endregion
|
|
28
28
|
export { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea };
|
package/dist/input-group.js
CHANGED
|
@@ -1,38 +1,63 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "./utils/cn.js";
|
|
3
|
-
import { SizeProvider } from "./size-context.js";
|
|
3
|
+
import { SizeProvider, resolveResponsiveValue, responsiveValueClasses } from "./size-context.js";
|
|
4
4
|
import { Button } from "./button.js";
|
|
5
|
-
import { InputSizeProvider,
|
|
5
|
+
import { InputSizeProvider, useInputComponentSizeValue } from "./input-size-context.js";
|
|
6
6
|
import { Input } from "./input.js";
|
|
7
7
|
import { Textarea } from "./textarea.js";
|
|
8
8
|
import { jsx } from "react/jsx-runtime";
|
|
9
9
|
import { cva } from "class-variance-authority";
|
|
10
10
|
//#region src/input-group.tsx
|
|
11
|
+
const inputGroupSizeVariants = {
|
|
12
|
+
sm: "h-8",
|
|
13
|
+
md: "h-10",
|
|
14
|
+
lg: "h-12",
|
|
15
|
+
xl: "h-14"
|
|
16
|
+
};
|
|
11
17
|
const inputGroupVariants = cva("group/input-group relative flex w-full min-w-0 items-center overflow-hidden rounded-full has-[textarea]:rounded-xl has-data-[align=block-end]:rounded-xl has-data-[align=block-start]:rounded-xl border border-line bg-canvas transition-[background-color,border-color,box-shadow,color] outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:border-line-subtle has-disabled:bg-surface has-disabled:text-fg-caption-placeholder focus-within:border-line-focus focus-within:inset-ring-1 focus-within:inset-ring-line-focus has-[[data-slot][aria-invalid=true]]:border-line-danger has-[[data-slot][aria-invalid=true]]:inset-shadow-none has-[[data-slot][aria-invalid=true]]:focus-within:border-line-danger has-[[data-slot][aria-invalid=true]]:focus-within:inset-ring-line-danger has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-start]]:[&>[data-slot=input-group-control]]:group-data-[size=sm]/input-group:pl-2 has-[>[data-align=inline-start]]:[&>[data-slot=input-group-control]]:group-data-[size=md]/input-group:pl-2.5 has-[>[data-align=inline-start]]:[&>[data-slot=input-group-control]]:group-data-[size=lg]/input-group:pl-3 has-[>[data-align=inline-start]]:[&>[data-slot=input-group-control]]:group-data-[size=xl]/input-group:pl-3 has-[>[data-align=inline-end]]:[&>[data-slot=input-group-control]]:group-data-[size=sm]/input-group:pr-2 has-[>[data-align=inline-end]]:[&>[data-slot=input-group-control]]:group-data-[size=md]/input-group:pr-2.5 has-[>[data-align=inline-end]]:[&>[data-slot=input-group-control]]:group-data-[size=lg]/input-group:pr-3 has-[>[data-align=inline-end]]:[&>[data-slot=input-group-control]]:group-data-[size=xl]/input-group:pr-3", {
|
|
12
|
-
variants: { size:
|
|
13
|
-
sm: "h-8",
|
|
14
|
-
md: "h-10",
|
|
15
|
-
lg: "h-12",
|
|
16
|
-
xl: "h-14"
|
|
17
|
-
} },
|
|
18
|
+
variants: { size: inputGroupSizeVariants },
|
|
18
19
|
defaultVariants: { size: "md" }
|
|
19
20
|
});
|
|
20
21
|
function InputGroup({ className, size, ...props }) {
|
|
21
|
-
const
|
|
22
|
+
const sizeValue = useInputComponentSizeValue(size);
|
|
23
|
+
const resolvedSize = responsiveValueClasses(sizeValue, responsiveInputGroupSizes);
|
|
24
|
+
const inputSizes = resolveResponsiveValue(sizeValue);
|
|
25
|
+
const clamp = (value) => value === "xl" ? "lg" : value;
|
|
22
26
|
return /* @__PURE__ */ jsx(SizeProvider, {
|
|
23
|
-
size: resolvedSize
|
|
27
|
+
size: resolvedSize.responsive ? {
|
|
28
|
+
base: clamp(inputSizes.base),
|
|
29
|
+
md: clamp(inputSizes.md),
|
|
30
|
+
lg: clamp(inputSizes.lg)
|
|
31
|
+
} : clamp(inputSizes.base),
|
|
24
32
|
children: /* @__PURE__ */ jsx(InputSizeProvider, {
|
|
25
|
-
size:
|
|
33
|
+
size: sizeValue,
|
|
26
34
|
children: /* @__PURE__ */ jsx("div", {
|
|
27
35
|
"data-slot": "input-group",
|
|
28
|
-
"data-size": resolvedSize,
|
|
36
|
+
"data-size": resolvedSize.base,
|
|
37
|
+
"data-size-md": resolvedSize.responsive ? resolvedSize.md : void 0,
|
|
38
|
+
"data-size-lg": resolvedSize.responsive ? resolvedSize.lg : void 0,
|
|
29
39
|
role: "group",
|
|
30
|
-
className: cn(inputGroupVariants({ size:
|
|
40
|
+
className: cn(inputGroupVariants({ size: null }), resolvedSize.className, className),
|
|
31
41
|
...props
|
|
32
42
|
})
|
|
33
43
|
})
|
|
34
44
|
});
|
|
35
45
|
}
|
|
46
|
+
const responsiveInputGroupSizes = {
|
|
47
|
+
base: inputGroupSizeVariants,
|
|
48
|
+
md: {
|
|
49
|
+
sm: "md:h-8",
|
|
50
|
+
md: "md:h-10",
|
|
51
|
+
lg: "md:h-12",
|
|
52
|
+
xl: "md:h-14"
|
|
53
|
+
},
|
|
54
|
+
lg: {
|
|
55
|
+
sm: "lg:h-8",
|
|
56
|
+
md: "lg:h-10",
|
|
57
|
+
lg: "lg:h-12",
|
|
58
|
+
xl: "lg:h-14"
|
|
59
|
+
}
|
|
60
|
+
};
|
|
36
61
|
const inputGroupAddonVariants = cva("flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-gdt-sm font-normal text-fg-secondary select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] group-data-[size=lg]/input-group:[&>svg:not([class*='size-'])]:size-4.5 group-data-[size=xl]/input-group:[&>svg:not([class*='size-'])]:size-5 [&>svg:not([class*='size-'])]:size-4", {
|
|
37
62
|
variants: { align: {
|
|
38
63
|
"inline-start": "order-first group-data-[size=sm]/input-group:pl-3 group-data-[size=md]/input-group:pl-3.5 group-data-[size=lg]/input-group:pl-4 group-data-[size=xl]/input-group:pl-4.5 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]",
|
package/dist/input-otp.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as
|
|
1
|
+
import { n as InputComponentSizeValue } from "./input-size-context-BMhves-J.js";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { OTPField } from "@base-ui/react/otp-field";
|
|
4
4
|
//#region src/input-otp.d.ts
|
|
@@ -7,7 +7,7 @@ declare const inputOTPSlotVariants: (props?: ({
|
|
|
7
7
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
8
|
type InputOTPProps = Omit<OTPField.Root.Props, "className"> & {
|
|
9
9
|
className?: string;
|
|
10
|
-
size?:
|
|
10
|
+
size?: InputComponentSizeValue;
|
|
11
11
|
};
|
|
12
12
|
declare function InputOTP({ className, size, ...props }: InputOTPProps): React.JSX.Element;
|
|
13
13
|
declare function InputOTPGroup({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
package/dist/input-otp.js
CHANGED
|
@@ -1,27 +1,30 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { Minus } from "./icons.js";
|
|
3
3
|
import { cn } from "./utils/cn.js";
|
|
4
|
-
import {
|
|
4
|
+
import { responsiveValueClasses } from "./size-context.js";
|
|
5
|
+
import { InputSizeProvider, useInputComponentSizeValue } from "./input-size-context.js";
|
|
5
6
|
import { jsx } from "react/jsx-runtime";
|
|
6
7
|
import { cva } from "class-variance-authority";
|
|
7
8
|
import { OTPField } from "@base-ui/react/otp-field";
|
|
8
9
|
//#region src/input-otp.tsx
|
|
10
|
+
const inputOTPSlotSizeVariants = {
|
|
11
|
+
sm: "size-8 text-gdt-xs",
|
|
12
|
+
md: "size-10 text-gdt-sm",
|
|
13
|
+
lg: "size-12 text-gdt-md",
|
|
14
|
+
xl: "size-14 text-gdt-lg"
|
|
15
|
+
};
|
|
9
16
|
const inputOTPSlotVariants = cva("relative flex shrink-0 appearance-none items-center justify-center rounded-full border border-line bg-canvas text-center font-normal text-fg-primary caret-fg-primary outline-none transition-[background-color,border-color,box-shadow,color] placeholder:text-fg-caption-placeholder hover:border-line-strong focus:z-10 focus:border-line-focus focus:inset-ring-1 focus:inset-ring-line-focus data-disabled:pointer-events-none data-disabled:cursor-not-allowed data-disabled:border-line-subtle data-disabled:bg-surface data-disabled:text-fg-caption-placeholder aria-invalid:border-line-danger aria-invalid:text-fg-danger aria-invalid:focus:border-line-danger aria-invalid:focus:inset-ring-line-danger data-invalid:border-line-danger data-invalid:text-fg-danger data-invalid:focus:border-line-danger data-invalid:focus:inset-ring-line-danger group-aria-invalid/input-otp:border-line-danger group-aria-invalid/input-otp:text-fg-danger group-aria-invalid/input-otp:focus:border-line-danger group-aria-invalid/input-otp:focus:inset-ring-line-danger", {
|
|
10
|
-
variants: { size:
|
|
11
|
-
sm: "size-8 text-gdt-xs",
|
|
12
|
-
md: "size-10 text-gdt-sm",
|
|
13
|
-
lg: "size-12 text-gdt-md",
|
|
14
|
-
xl: "size-14 text-gdt-lg"
|
|
15
|
-
} },
|
|
17
|
+
variants: { size: inputOTPSlotSizeVariants },
|
|
16
18
|
defaultVariants: { size: "md" }
|
|
17
19
|
});
|
|
18
20
|
function InputOTP({ className, size, ...props }) {
|
|
19
|
-
const
|
|
21
|
+
const sizeValue = useInputComponentSizeValue(size);
|
|
22
|
+
const resolvedSize = responsiveValueClasses(sizeValue, responsiveInputOTPSlotSizes);
|
|
20
23
|
return /* @__PURE__ */ jsx(InputSizeProvider, {
|
|
21
|
-
size:
|
|
24
|
+
size: sizeValue,
|
|
22
25
|
children: /* @__PURE__ */ jsx(OTPField.Root, {
|
|
23
26
|
"data-slot": "input-otp",
|
|
24
|
-
"data-size": resolvedSize,
|
|
27
|
+
"data-size": resolvedSize.base,
|
|
25
28
|
className: cn("group/input-otp flex items-center gap-2 data-disabled:cursor-not-allowed data-disabled:opacity-50", className),
|
|
26
29
|
...props
|
|
27
30
|
})
|
|
@@ -30,20 +33,34 @@ function InputOTP({ className, size, ...props }) {
|
|
|
30
33
|
function InputOTPGroup({ className, ...props }) {
|
|
31
34
|
return /* @__PURE__ */ jsx("div", {
|
|
32
35
|
"data-slot": "input-otp-group",
|
|
33
|
-
"data-size": useInputComponentSize(),
|
|
34
36
|
className: cn("flex items-center rounded-full [&>[data-slot=input-otp-slot]:first-child]:rounded-l-full [&>[data-slot=input-otp-slot]:last-child]:rounded-r-full [&>[data-slot=input-otp-slot]:not(:first-child)]:-ml-px [&>[data-slot=input-otp-slot]]:rounded-none", className),
|
|
35
37
|
...props
|
|
36
38
|
});
|
|
37
39
|
}
|
|
38
40
|
function InputOTPSlot({ className, ...props }) {
|
|
39
|
-
const resolvedSize =
|
|
41
|
+
const resolvedSize = responsiveValueClasses(useInputComponentSizeValue(), responsiveInputOTPSlotSizes);
|
|
40
42
|
return /* @__PURE__ */ jsx(OTPField.Input, {
|
|
41
43
|
"data-slot": "input-otp-slot",
|
|
42
|
-
"data-size": resolvedSize,
|
|
43
|
-
className: cn(inputOTPSlotVariants({ size:
|
|
44
|
+
"data-size": resolvedSize.base,
|
|
45
|
+
className: cn(inputOTPSlotVariants({ size: null }), resolvedSize.className, className),
|
|
44
46
|
...props
|
|
45
47
|
});
|
|
46
48
|
}
|
|
49
|
+
const responsiveInputOTPSlotSizes = {
|
|
50
|
+
base: inputOTPSlotSizeVariants,
|
|
51
|
+
md: {
|
|
52
|
+
sm: "md:size-8 md:text-gdt-xs",
|
|
53
|
+
md: "md:size-10 md:text-gdt-sm",
|
|
54
|
+
lg: "md:size-12 md:text-gdt-md",
|
|
55
|
+
xl: "md:size-14 md:text-gdt-lg"
|
|
56
|
+
},
|
|
57
|
+
lg: {
|
|
58
|
+
sm: "lg:size-8 lg:text-gdt-xs",
|
|
59
|
+
md: "lg:size-10 lg:text-gdt-sm",
|
|
60
|
+
lg: "lg:size-12 lg:text-gdt-md",
|
|
61
|
+
xl: "lg:size-14 lg:text-gdt-lg"
|
|
62
|
+
}
|
|
63
|
+
};
|
|
47
64
|
function InputOTPSeparator({ children, className, ...props }) {
|
|
48
65
|
return /* @__PURE__ */ jsx(OTPField.Separator, {
|
|
49
66
|
"data-slot": "input-otp-separator",
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { a as ResponsiveValue } from "./size-context-BVhHduLi.js";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
//#region src/input-size-context.d.ts
|
|
4
|
+
type InputComponentSize = "sm" | "md" | "lg" | "xl";
|
|
5
|
+
type InputComponentSizeValue = InputComponentSize | ResponsiveValue<InputComponentSize>;
|
|
6
|
+
declare function InputSizeProvider({ children, size }: {
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
size?: InputComponentSizeValue | null;
|
|
9
|
+
}): import("react").JSX.Element;
|
|
10
|
+
declare function useInputComponentSize(size?: InputComponentSize | null, fallback?: InputComponentSize): InputComponentSize;
|
|
11
|
+
declare function useInputComponentSizeValue(size?: InputComponentSizeValue | null, fallback?: InputComponentSize): ResponsiveValue<InputComponentSize> | InputComponentSize;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { useInputComponentSizeValue as a, useInputComponentSize as i, InputComponentSizeValue as n, InputSizeProvider as r, InputComponentSize as t };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as
|
|
2
|
-
export { type InputComponentSize, InputSizeProvider, useInputComponentSize };
|
|
1
|
+
import { a as useInputComponentSizeValue, i as useInputComponentSize, n as InputComponentSizeValue, r as InputSizeProvider, t as InputComponentSize } from "./input-size-context-BMhves-J.js";
|
|
2
|
+
export { type InputComponentSize, type InputComponentSizeValue, InputSizeProvider, useInputComponentSize, useInputComponentSizeValue };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { useInheritedComponentSize } from "./size-context.js";
|
|
2
|
+
import { resolveResponsiveValue, useInheritedComponentSize } from "./size-context.js";
|
|
3
3
|
import { Fragment, jsx } from "react/jsx-runtime";
|
|
4
4
|
import { createContext, useContext } from "react";
|
|
5
5
|
//#region src/input-size-context.tsx
|
|
@@ -12,9 +12,16 @@ function InputSizeProvider({ children, size }) {
|
|
|
12
12
|
});
|
|
13
13
|
}
|
|
14
14
|
function useInputComponentSize(size, fallback = "md") {
|
|
15
|
+
const inheritedInputSize = useContext(InputSizeContext);
|
|
16
|
+
const inheritedComponentSizeValue = useInheritedComponentSize();
|
|
17
|
+
const inheritedComponentSize = inheritedComponentSizeValue ? resolveResponsiveValue(inheritedComponentSizeValue).base : void 0;
|
|
18
|
+
const inheritedInputBase = inheritedInputSize ? resolveResponsiveValue(inheritedInputSize).base : void 0;
|
|
19
|
+
return size ?? inheritedInputBase ?? inheritedComponentSize ?? fallback;
|
|
20
|
+
}
|
|
21
|
+
function useInputComponentSizeValue(size, fallback = "md") {
|
|
15
22
|
const inheritedInputSize = useContext(InputSizeContext);
|
|
16
23
|
const inheritedComponentSize = useInheritedComponentSize();
|
|
17
24
|
return size ?? inheritedInputSize ?? inheritedComponentSize ?? fallback;
|
|
18
25
|
}
|
|
19
26
|
//#endregion
|
|
20
|
-
export { InputSizeProvider, useInputComponentSize };
|
|
27
|
+
export { InputSizeProvider, useInputComponentSize, useInputComponentSizeValue };
|
package/dist/input.d.ts
CHANGED
|
@@ -1,2 +1,20 @@
|
|
|
1
|
-
import { n as
|
|
2
|
-
|
|
1
|
+
import { n as InputComponentSizeValue } from "./input-size-context-BMhves-J.js";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
//#region src/input.d.ts
|
|
4
|
+
declare const inputSizeVariants: {
|
|
5
|
+
readonly sm: "h-8 px-3 text-gdt-xs font-normal file:text-gdt-xs";
|
|
6
|
+
readonly md: "h-10 px-3.5 text-gdt-sm font-normal file:text-gdt-sm";
|
|
7
|
+
readonly lg: "h-12 px-4 text-gdt-md font-normal file:text-gdt-md";
|
|
8
|
+
readonly xl: "h-14 px-4.5 text-gdt-lg font-normal file:text-gdt-lg";
|
|
9
|
+
};
|
|
10
|
+
declare const inputVariants: (props?: ({
|
|
11
|
+
size?: "lg" | "md" | "sm" | "xl" | null | undefined;
|
|
12
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
13
|
+
type InputProps = Omit<React.ComponentProps<"input">, "size"> & {
|
|
14
|
+
size?: InputComponentSizeValue;
|
|
15
|
+
};
|
|
16
|
+
type InputSize = keyof typeof inputSizeVariants;
|
|
17
|
+
type InputSizeValue = InputComponentSizeValue;
|
|
18
|
+
declare function Input({ className, size, type, ...props }: InputProps): React.JSX.Element;
|
|
19
|
+
//#endregion
|
|
20
|
+
export { Input, type InputSize, type InputSizeValue, inputVariants };
|
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,18 @@
|
|
|
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.ComponentProps<"button">, "children" | "value"> & VariantProps<typeof matchVariants> & {
|
|
10
|
+
type MatchProps = Omit<React.ComponentProps<"button">, "children" | "value"> & Omit<VariantProps<typeof matchVariants>, "size"> & {
|
|
9
11
|
value: number;
|
|
12
|
+
size?: ComponentSizeValue;
|
|
10
13
|
label?: string;
|
|
11
14
|
showChevron?: boolean;
|
|
12
15
|
};
|
|
13
|
-
declare function Match({ className, value, variant, label, showChevron, type, "aria-label": ariaLabel, ...props }: MatchProps): React.JSX.Element;
|
|
16
|
+
declare function Match({ className, value, variant, size, label, showChevron, type, "aria-label": ariaLabel, ...props }: MatchProps): React.JSX.Element;
|
|
14
17
|
//#endregion
|
|
15
18
|
export { Match, type MatchProps, type MatchVariant, matchVariants };
|