@giddaa-housing/ui 3.4.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/accordion.js +1 -1
- package/dist/activity-timeline.js +1 -1
- package/dist/alert.js +1 -1
- package/dist/auth-layout.js +1 -1
- package/dist/avatar.js +1 -1
- package/dist/badge.d.ts +5 -1
- package/dist/badge.js +20 -6
- package/dist/bar-chart.d.ts +1 -1
- package/dist/bar-chart.js +1 -1
- package/dist/breadcrumb.js +1 -1
- package/dist/bullet-chart.d.ts +1 -1
- package/dist/bullet-chart.js +1 -1
- package/dist/button-BS5KCibF.d.ts +33 -0
- package/dist/button-group.d.ts +1 -1
- package/dist/button-group.js +1 -1
- package/dist/button.d.ts +1 -1
- package/dist/button.js +50 -22
- package/dist/calendar.js +2 -2
- package/dist/call-card.js +1 -1
- package/dist/card.js +1 -1
- package/dist/carousel.d.ts +4 -2
- package/dist/carousel.js +13 -16
- package/dist/chart.d.ts +1 -1
- package/dist/chart.js +1 -1
- package/dist/chat.d.ts +1 -1
- package/dist/chat.js +1 -1
- package/dist/checkbox.d.ts +2 -2
- package/dist/checkbox.js +21 -7
- package/dist/collapsible.js +1 -1
- package/dist/combobox-CACVdp1R.js +430 -0
- package/dist/combobox.d.ts +9 -4
- package/dist/combobox.js +2 -309
- package/dist/cta.d.ts +1 -1
- package/dist/cta.js +1 -1
- package/dist/currency-selector.js +2 -2
- package/dist/data-table.d.ts +2 -2
- package/dist/data-table.js +1 -1
- package/dist/date-picker.d.ts +6 -5
- package/dist/date-picker.js +7 -17
- package/dist/details-card.js +1 -1
- package/dist/dialog.d.ts +3 -1
- package/dist/dialog.js +10 -6
- package/dist/dropdown-menu.d.ts +1 -1
- package/dist/dropdown-menu.js +1 -1
- package/dist/dropzone.js +1 -1
- package/dist/editorial-card.js +2 -4
- package/dist/empty-state.js +1 -1
- package/dist/field.d.ts +4 -1
- package/dist/field.js +29 -12
- package/dist/file-upload.js +1 -1
- package/dist/filter.js +1 -1
- package/dist/footer.d.ts +2 -2
- package/dist/footer.js +1 -1
- package/dist/funnel-chart.d.ts +1 -1
- package/dist/funnel-chart.js +1 -1
- package/dist/gallery-indicator.js +1 -1
- package/dist/heatmap-chart.d.ts +1 -1
- package/dist/icons-C9JXR5Xv.d.ts +111 -0
- package/dist/icons.d.ts +2 -93
- package/dist/icons.js +37 -1
- package/dist/image.d.ts +59 -0
- package/dist/image.js +53 -0
- package/dist/infinite-scroll.js +3 -29
- package/dist/infotip.js +1 -1
- package/dist/input-group.d.ts +6 -6
- package/dist/input-group.js +39 -14
- package/dist/input-otp.d.ts +2 -2
- package/dist/input-otp.js +32 -15
- 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 +31 -12
- package/dist/item.js +1 -1
- package/dist/kpi-card.js +1 -1
- package/dist/label.js +1 -1
- package/dist/line-chart.d.ts +1 -1
- package/dist/line-chart.js +1 -1
- package/dist/list-item.js +1 -1
- package/dist/map-indicator.js +1 -1
- package/dist/mask-input.d.ts +1 -1
- package/dist/match.d.ts +5 -2
- package/dist/match.js +183 -27
- package/dist/media-gallery-hero.js +15 -10
- package/dist/media-player.js +5 -13
- package/dist/message.js +2 -12
- package/dist/mobile-sidebar.js +2 -1
- package/dist/multi-step-form.js +2 -2
- package/dist/number-input.d.ts +2 -2
- package/dist/number-input.js +3 -3
- package/dist/page-header.js +1 -1
- package/dist/pagination.d.ts +1 -1
- package/dist/pagination.js +1 -1
- package/dist/password-input.js +1 -1
- package/dist/phone-input.d.ts +2 -2
- package/dist/phone-input.js +16 -21
- package/dist/photo-gallery.js +6 -3
- package/dist/picker-BTXBrsl4.js +62 -0
- package/dist/picker-j3txxA5t.d.ts +14 -0
- package/dist/pie-chart.d.ts +1 -1
- package/dist/pie-chart.js +1 -1
- package/dist/popover-CNymD33m.d.ts +20 -0
- package/dist/popover.d.ts +1 -19
- package/dist/popover.js +1 -1
- package/dist/price-tag.d.ts +1 -1
- package/dist/price-tag.js +50 -22
- package/dist/progress.js +1 -1
- package/dist/property-listing-card.d.ts +68 -2
- package/dist/property-listing-card.js +115 -29
- package/dist/purchase-option-card.js +1 -1
- package/dist/radar-chart.d.ts +1 -1
- package/dist/radar-chart.js +1 -1
- package/dist/radio-group.d.ts +2 -2
- package/dist/radio-group.js +24 -10
- package/dist/review-block.js +1 -1
- package/dist/rich-text-editor.d.ts +1 -1
- package/dist/rich-text-editor.js +1 -1
- package/dist/scatter-chart.d.ts +1 -1
- package/dist/scatter-chart.js +1 -1
- package/dist/scroll-spy.d.ts +8 -2
- package/dist/scroll-spy.js +16 -16
- package/dist/search-input.js +1 -1
- 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 +113 -20
- package/dist/separator.js +1 -1
- package/dist/sheet.d.ts +3 -1
- package/dist/sheet.js +10 -6
- package/dist/sidebar.d.ts +2 -2
- package/dist/sidebar.js +4 -16
- 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/skeleton.js +1 -1
- package/dist/slider.d.ts +5 -3
- package/dist/slider.js +26 -11
- package/dist/sonar.d.ts +1 -1
- package/dist/sonar.js +2 -2
- package/dist/sparkline.d.ts +1 -1
- package/dist/sparkline.js +1 -1
- package/dist/stepper.js +1 -1
- package/dist/styles.css +1622 -264
- package/dist/switch.d.ts +2 -2
- package/dist/switch.js +21 -7
- package/dist/table-card.js +1 -1
- package/dist/table.js +1 -1
- package/dist/tabs.d.ts +1 -1
- package/dist/tabs.js +1 -1
- package/dist/tag.d.ts +1 -1
- package/dist/tag.js +1 -1
- package/dist/testimonial-block.js +1 -1
- package/dist/textarea.d.ts +17 -1
- package/dist/textarea.js +24 -10
- package/dist/theme-switcher.js +1 -1
- package/dist/time-picker.d.ts +5 -4
- package/dist/time-picker.js +5 -7
- package/dist/toast.js +1 -1
- package/dist/tooltip.js +1 -1
- package/dist/top-navbar.js +1 -1
- package/dist/tree-map.d.ts +1 -1
- package/dist/tree-map.js +1 -1
- package/dist/utils/cn.d.ts +5 -0
- package/dist/utils/cn.js +33 -0
- package/dist/utils/format.d.ts +45 -0
- package/dist/utils/format.js +70 -0
- package/dist/utils/phone.d.ts +98 -0
- package/dist/utils/phone.js +93 -0
- package/dist/utils/use-intersection.d.ts +9 -0
- package/dist/utils/use-intersection.js +29 -0
- package/dist/utils/use-is-mobile.d.ts +5 -0
- package/dist/utils/use-is-mobile.js +16 -0
- package/dist/utils/use-reduced-motion.d.ts +5 -0
- package/dist/{use-reduced-motion-BDvOK14x.js → utils/use-reduced-motion.js} +2 -2
- package/dist/utils/use-uncontrolled.d.ts +11 -0
- package/dist/{use-uncontrolled-CLfM1XbB.js → utils/use-uncontrolled.js} +2 -2
- package/dist/video-player-dialog.d.ts +12 -2
- package/dist/video-player-dialog.js +50 -9
- package/dist/waterfall-chart.d.ts +1 -1
- package/dist/waterfall-chart.js +1 -1
- package/package.json +13 -1
- package/dist/button-DW5OijoR.d.ts +0 -17
- package/dist/cn-BI_4DMBf.js +0 -23
- package/dist/input-CfoEJ8A6.d.ts +0 -12
- package/dist/input-size-context-C-SFx9sx.d.ts +0 -10
- package/dist/picker-xSTzeYhc.js +0 -50
- package/dist/size-context-BX6kAdVj.d.ts +0 -11
- package/dist/textarea-IS_D8pXf.d.ts +0 -11
package/dist/input-group.js
CHANGED
|
@@ -1,38 +1,63 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import { SizeProvider } from "./size-context.js";
|
|
2
|
+
import { cn } from "./utils/cn.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
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { cn } from "./utils/cn.js";
|
|
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
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { cn } from "./utils/cn.js";
|
|
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/item.js
CHANGED
package/dist/kpi-card.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { ArrowDown, ArrowUp, ArrowUpRight } from "./icons.js";
|
|
3
|
-
import {
|
|
3
|
+
import { cn } from "./utils/cn.js";
|
|
4
4
|
import { Skeleton } from "./skeleton.js";
|
|
5
5
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import { mergeProps } from "@base-ui/react/merge-props";
|
package/dist/label.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { cn } from "./utils/cn.js";
|
|
3
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
//#region src/label.tsx
|
|
5
5
|
function Label({ className, children, withAsterisk = false, showOptionalText = false, ...props }) {
|
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/line-chart.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { cn } from "./utils/cn.js";
|
|
3
3
|
import { SizeProvider, useComponentSize } from "./size-context.js";
|
|
4
4
|
import { ChartContainer, cartesianAxisProps } from "./chart.js";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
package/dist/list-item.js
CHANGED
package/dist/map-indicator.js
CHANGED
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 };
|
package/dist/match.js
CHANGED
|
@@ -1,55 +1,124 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { ChevronDown } from "./icons.js";
|
|
3
|
-
import {
|
|
3
|
+
import { cn } from "./utils/cn.js";
|
|
4
|
+
import { resolveResponsiveComponentSize, useComponentSizeValue } from "./size-context.js";
|
|
4
5
|
import { CircularProgress } from "./progress.js";
|
|
5
6
|
import { 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 = true, type = "button", "aria-label": ariaLabel, ...props }) {
|
|
86
|
+
function Match({ className, value, variant = "bar", size, label = "Match", showChevron = true, type = "button", "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}`;
|
|
93
|
+
const rootSizeClasses = cn(matchVariants({
|
|
94
|
+
variant: resolvedVariant,
|
|
95
|
+
size: resolvedSizes.base
|
|
96
|
+
}), responsive && matchBreakpointClasses(resolvedVariant, "md", resolvedSizes.md), responsive && matchBreakpointClasses(resolvedVariant, "lg", resolvedSizes.lg));
|
|
22
97
|
return /* @__PURE__ */ jsxs("button", {
|
|
23
98
|
type,
|
|
24
99
|
"aria-label": ariaLabel ?? text,
|
|
25
100
|
"data-slot": "match",
|
|
26
|
-
"data-variant":
|
|
27
|
-
|
|
101
|
+
"data-variant": resolvedVariant,
|
|
102
|
+
"data-size": resolvedSizes.base,
|
|
103
|
+
"data-size-md": responsive ? resolvedSizes.md : void 0,
|
|
104
|
+
"data-size-lg": responsive ? resolvedSizes.lg : void 0,
|
|
105
|
+
className: cn(rootSizeClasses, className),
|
|
28
106
|
...props,
|
|
29
107
|
children: [
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
value: progress,
|
|
35
|
-
pixelSize: 24,
|
|
36
|
-
strokeWidth: 4,
|
|
37
|
-
strokeLinecap: "butt",
|
|
38
|
-
className: "shrink-0",
|
|
39
|
-
children: /* @__PURE__ */ jsxs("span", {
|
|
40
|
-
className: "sr-only",
|
|
41
|
-
children: [progress, "%"]
|
|
42
|
-
})
|
|
108
|
+
resolvedVariant === "donut" ? /* @__PURE__ */ jsx(MatchDonut, {
|
|
109
|
+
progress,
|
|
110
|
+
sizes: resolvedSizes,
|
|
111
|
+
responsive
|
|
43
112
|
}) : null,
|
|
44
113
|
/* @__PURE__ */ jsx("span", {
|
|
45
114
|
"data-slot": "match-label",
|
|
46
|
-
className: "shrink-0
|
|
115
|
+
className: "shrink-0 font-bold",
|
|
47
116
|
children: text
|
|
48
117
|
}),
|
|
49
|
-
|
|
118
|
+
resolvedVariant === "bar" ? /* @__PURE__ */ jsx("span", {
|
|
50
119
|
"aria-hidden": "true",
|
|
51
120
|
"data-slot": "match-bar-track",
|
|
52
|
-
className: "relative
|
|
121
|
+
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])),
|
|
53
122
|
children: /* @__PURE__ */ jsx("span", {
|
|
54
123
|
"data-slot": "match-bar-fill",
|
|
55
124
|
className: "absolute inset-y-0 left-0 rounded-full bg-action-primary",
|
|
@@ -59,10 +128,97 @@ function Match({ className, value, variant = "bar", label = "Match", showChevron
|
|
|
59
128
|
showChevron ? /* @__PURE__ */ jsx(ChevronDown, {
|
|
60
129
|
"aria-hidden": "true",
|
|
61
130
|
"data-slot": "match-chevron",
|
|
62
|
-
className: "
|
|
131
|
+
className: cn("shrink-0 text-fg-secondary", matchChevronSizes[resolvedSizes.base], responsive && responsiveClass("md", matchChevronSizes[resolvedSizes.md]), responsive && responsiveClass("lg", matchChevronSizes[resolvedSizes.lg]))
|
|
63
132
|
}) : null
|
|
64
133
|
]
|
|
65
134
|
});
|
|
66
135
|
}
|
|
136
|
+
const responsiveSizeClasses = {
|
|
137
|
+
md: {
|
|
138
|
+
sm: "md:h-7 md:text-gdt-subtext",
|
|
139
|
+
md: "md:h-8 md:text-gdt-xs",
|
|
140
|
+
lg: "md:h-10 md:text-gdt-sm"
|
|
141
|
+
},
|
|
142
|
+
lg: {
|
|
143
|
+
sm: "lg:h-7 lg:text-gdt-subtext",
|
|
144
|
+
md: "lg:h-8 lg:text-gdt-xs",
|
|
145
|
+
lg: "lg:h-10 lg:text-gdt-sm"
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
const responsiveVariantClasses = {
|
|
149
|
+
md: {
|
|
150
|
+
bar: {
|
|
151
|
+
sm: "md:gap-1.5 md:px-2.5",
|
|
152
|
+
md: "md:gap-2 md:px-3",
|
|
153
|
+
lg: "md:gap-2.5 md:px-3.5"
|
|
154
|
+
},
|
|
155
|
+
donut: {
|
|
156
|
+
sm: "md:gap-2 md:pl-1.5 md:pr-2.5",
|
|
157
|
+
md: "md:gap-3 md:pl-2 md:pr-3",
|
|
158
|
+
lg: "md:gap-3.5 md:pl-2.5 md:pr-3.5"
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
lg: {
|
|
162
|
+
bar: {
|
|
163
|
+
sm: "lg:gap-1.5 lg:px-2.5",
|
|
164
|
+
md: "lg:gap-2 lg:px-3",
|
|
165
|
+
lg: "lg:gap-2.5 lg:px-3.5"
|
|
166
|
+
},
|
|
167
|
+
donut: {
|
|
168
|
+
sm: "lg:gap-2 lg:pl-1.5 lg:pr-2.5",
|
|
169
|
+
md: "lg:gap-3 lg:pl-2 lg:pr-3",
|
|
170
|
+
lg: "lg:gap-3.5 lg:pl-2.5 lg:pr-3.5"
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
};
|
|
174
|
+
function matchBreakpointClasses(variant, breakpoint, size) {
|
|
175
|
+
return cn(responsiveSizeClasses[breakpoint][size], responsiveVariantClasses[breakpoint][variant][size]);
|
|
176
|
+
}
|
|
177
|
+
const responsiveTokenClasses = {
|
|
178
|
+
md: {
|
|
179
|
+
"h-1 w-12": "md:h-1 md:w-12",
|
|
180
|
+
"h-1.5 w-15": "md:h-1.5 md:w-15",
|
|
181
|
+
"h-2 w-18": "md:h-2 md:w-18",
|
|
182
|
+
"size-2.5": "md:size-2.5",
|
|
183
|
+
"size-3": "md:size-3",
|
|
184
|
+
"size-3.5": "md:size-3.5"
|
|
185
|
+
},
|
|
186
|
+
lg: {
|
|
187
|
+
"h-1 w-12": "lg:h-1 lg:w-12",
|
|
188
|
+
"h-1.5 w-15": "lg:h-1.5 lg:w-15",
|
|
189
|
+
"h-2 w-18": "lg:h-2 lg:w-18",
|
|
190
|
+
"size-2.5": "lg:size-2.5",
|
|
191
|
+
"size-3": "lg:size-3",
|
|
192
|
+
"size-3.5": "lg:size-3.5"
|
|
193
|
+
}
|
|
194
|
+
};
|
|
195
|
+
function responsiveClass(breakpoint, className) {
|
|
196
|
+
return responsiveTokenClasses[breakpoint][className];
|
|
197
|
+
}
|
|
198
|
+
function MatchDonut({ progress, sizes, responsive }) {
|
|
199
|
+
return (responsive ? [
|
|
200
|
+
"base",
|
|
201
|
+
"md",
|
|
202
|
+
"lg"
|
|
203
|
+
] : ["base"]).map((breakpoint) => {
|
|
204
|
+
const size = sizes[breakpoint];
|
|
205
|
+
const dimensions = matchDonutSizes[size];
|
|
206
|
+
const visibility = responsive ? breakpoint === "base" ? "md:hidden" : breakpoint === "md" ? "hidden md:grid lg:hidden" : "hidden lg:grid" : "";
|
|
207
|
+
return /* @__PURE__ */ jsx(CircularProgress, {
|
|
208
|
+
"aria-hidden": "true",
|
|
209
|
+
role: "presentation",
|
|
210
|
+
"data-slot": "match-donut",
|
|
211
|
+
value: progress,
|
|
212
|
+
pixelSize: dimensions.pixelSize,
|
|
213
|
+
strokeWidth: dimensions.strokeWidth,
|
|
214
|
+
strokeLinecap: "butt",
|
|
215
|
+
className: cn("shrink-0", visibility),
|
|
216
|
+
children: /* @__PURE__ */ jsxs("span", {
|
|
217
|
+
className: "sr-only",
|
|
218
|
+
children: [progress, "%"]
|
|
219
|
+
})
|
|
220
|
+
}, breakpoint);
|
|
221
|
+
});
|
|
222
|
+
}
|
|
67
223
|
//#endregion
|
|
68
224
|
export { Match, matchVariants };
|