@locusgraph/components 0.1.1 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/dist/action/button-group.js +148 -17
  2. package/dist/action/button.js +91 -27
  3. package/dist/action/toggle-group.js +176 -12
  4. package/dist/action/toggle.js +71 -18
  5. package/dist/display/avatar.js +118 -7
  6. package/dist/display/badge.d.ts +1 -1
  7. package/dist/display/badge.js +74 -17
  8. package/dist/display/chart/chart-container.js +205 -45
  9. package/dist/display/chart/chart-legend.js +79 -14
  10. package/dist/display/chart/chart-tooltip.js +211 -40
  11. package/dist/display/chat/attachment/attachment-parts.js +222 -13
  12. package/dist/display/chat/attachment/attachment.js +210 -28
  13. package/dist/display/chat/bubble.js +225 -37
  14. package/dist/display/chat/marker.js +143 -15
  15. package/dist/display/chat/message-scroller.js +277 -15
  16. package/dist/display/chat/message.js +238 -13
  17. package/dist/display/content/item.js +448 -47
  18. package/dist/display/content/kbd.js +78 -5
  19. package/dist/display/media/aspect-ratio.js +27 -3
  20. package/dist/display/media/carousel-controls.js +163 -12
  21. package/dist/display/media/carousel.js +325 -65
  22. package/dist/display/rule-grid/rule-grid.d.ts +3 -1
  23. package/dist/display/rule-grid/rule-grid.js +311 -25
  24. package/dist/display/separator.js +56 -3
  25. package/dist/display/skeletons/layouts/skeleton-rule-grid.d.ts +8 -0
  26. package/dist/display/skeletons/layouts/skeleton-rule-grid.js +83 -0
  27. package/dist/display/skeletons/layouts/skeleton-table.d.ts +8 -0
  28. package/dist/display/skeletons/layouts/skeleton-table.js +174 -0
  29. package/dist/display/skeletons/shapes/skeleton-avatar.d.ts +10 -0
  30. package/dist/display/skeletons/shapes/skeleton-avatar.js +102 -0
  31. package/dist/display/skeletons/shapes/skeleton-button.d.ts +10 -0
  32. package/dist/display/skeletons/shapes/skeleton-button.js +102 -0
  33. package/dist/display/skeletons/shapes/skeleton-text.d.ts +7 -0
  34. package/dist/display/skeletons/shapes/skeleton-text.js +84 -0
  35. package/dist/display/skeletons/skeleton-parts.d.ts +11 -0
  36. package/dist/display/skeletons/skeleton-parts.js +68 -0
  37. package/dist/display/status/alert.d.ts +1 -1
  38. package/dist/display/status/alert.js +137 -17
  39. package/dist/display/status/empty.js +250 -22
  40. package/dist/display/status/progress.d.ts +5 -1
  41. package/dist/display/status/progress.js +120 -3
  42. package/dist/display/status/skeleton.js +40 -3
  43. package/dist/display/status/spinner.js +42 -4
  44. package/dist/display/table.js +310 -17
  45. package/dist/feedback/toaster.d.ts +1 -1
  46. package/dist/feedback/toaster.js +100 -25
  47. package/dist/form/advanced/calendar-day-button.js +89 -12
  48. package/dist/form/advanced/calendar.js +349 -56
  49. package/dist/form/advanced/combobox/combobox-chips.js +152 -9
  50. package/dist/form/advanced/combobox/combobox-items.js +240 -15
  51. package/dist/form/advanced/combobox/combobox.js +387 -14
  52. package/dist/form/advanced/input-otp.js +202 -12
  53. package/dist/form/choice/checkbox.js +59 -4
  54. package/dist/form/choice/radio-group.js +95 -6
  55. package/dist/form/choice/select.js +479 -25
  56. package/dist/form/choice/slider.js +118 -4
  57. package/dist/form/choice/switch.js +53 -3
  58. package/dist/form/field/field-error.js +117 -14
  59. package/dist/form/field/field-separator.js +70 -3
  60. package/dist/form/field/field-set.js +85 -5
  61. package/dist/form/field/field-text.js +116 -7
  62. package/dist/form/field/field.js +138 -26
  63. package/dist/form/hook-form/form.js +338 -40
  64. package/dist/form/input-group.js +297 -47
  65. package/dist/form/input.js +47 -3
  66. package/dist/form/label.js +42 -3
  67. package/dist/form/native-select.js +148 -8
  68. package/dist/form/textarea.js +41 -3
  69. package/dist/index.d.ts +6 -0
  70. package/dist/index.js +6 -0
  71. package/dist/layout/accordion.js +166 -9
  72. package/dist/layout/collapsible.js +75 -7
  73. package/dist/layout/resizable.js +123 -8
  74. package/dist/layout/scroll/direction.js +25 -3
  75. package/dist/layout/scroll/scroll-area.d.ts +1 -1
  76. package/dist/layout/scroll/scroll-area.js +138 -5
  77. package/dist/layout/sidebar/sidebar-context.js +184 -51
  78. package/dist/layout/sidebar/sidebar-menu-sub.js +219 -14
  79. package/dist/layout/sidebar/sidebar-menu.js +319 -38
  80. package/dist/layout/sidebar/sidebar-sections.js +369 -22
  81. package/dist/layout/sidebar/sidebar.js +385 -29
  82. package/dist/layout/tabs.js +183 -18
  83. package/dist/layout/use-mobile.js +23 -10
  84. package/dist/navigation/breadcrumb.js +302 -18
  85. package/dist/navigation/menubar/menubar-items.js +323 -17
  86. package/dist/navigation/menubar/menubar-sub.js +126 -8
  87. package/dist/navigation/menubar/menubar.js +213 -13
  88. package/dist/navigation/navigation-menu.js +367 -19
  89. package/dist/navigation/pagination.js +329 -20
  90. package/dist/overlay/alert-dialog.js +485 -26
  91. package/dist/overlay/context-menu/context-menu-items.js +323 -17
  92. package/dist/overlay/context-menu/context-menu-sub.js +126 -8
  93. package/dist/overlay/context-menu/context-menu.js +140 -11
  94. package/dist/overlay/dialog.js +406 -25
  95. package/dist/overlay/floating/command.js +424 -21
  96. package/dist/overlay/floating/drawer.js +354 -22
  97. package/dist/overlay/floating/hover-card.js +107 -7
  98. package/dist/overlay/menu/dropdown-menu-choice.js +150 -8
  99. package/dist/overlay/menu/dropdown-menu-item.js +174 -9
  100. package/dist/overlay/menu/dropdown-menu-sub.js +125 -8
  101. package/dist/overlay/menu/dropdown-menu.js +147 -12
  102. package/dist/overlay/popover.js +106 -7
  103. package/dist/overlay/sheet.js +380 -27
  104. package/dist/overlay/tooltip.js +145 -9
  105. package/dist/shell/app-header.js +81 -5
  106. package/dist/shell/app-shell.js +58 -3
  107. package/dist/shell/breadcrumbs.js +102 -12
  108. package/dist/shell/docs/docs-header.js +211 -11
  109. package/dist/shell/docs/docs-shell.js +100 -3
  110. package/dist/shell/docs/docs-sidebar.js +88 -7
  111. package/dist/shell/docs/on-this-page.js +78 -7
  112. package/dist/shell/docs/use-active-section.js +88 -42
  113. package/dist/shell/navigation/app-sidebar.js +188 -6
  114. package/dist/shell/navigation/nav-group.js +161 -10
  115. package/dist/shell/theme-toggle.js +52 -5
  116. package/package.json +5 -5
@@ -1,8 +1,58 @@
1
1
  "use client";
2
- import { jsx as _jsx } from "react/jsx-runtime";
2
+
3
+ import { c as _c } from "react/compiler-runtime";
3
4
  import { cn } from "cn";
4
5
  import * as SwitchPrimitive from "radix-ui/switch";
5
- function Switch({ className, ...props }) {
6
- return (_jsx(SwitchPrimitive.Root, { "data-slot": "switch", className: cn("peer inline-flex h-5 w-9 shrink-0 items-center rounded-full border border-transparent transition-all outline-none", "data-[state=checked]:bg-primary data-[state=unchecked]:bg-ghost", "focus-visible:ring-2 focus-visible:ring-ring/70 focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50", className), ...props, children: _jsx(SwitchPrimitive.Thumb, { "data-slot": "switch-thumb", className: cn("pointer-events-none block size-4 rounded-full bg-surface ring-0 transition-transform", "data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0") }) }));
6
+ import * as React from "react";
7
+ import { jsx as _jsx } from "react/jsx-runtime";
8
+ function Switch(t0) {
9
+ const $ = _c(9);
10
+ let className;
11
+ let props;
12
+ if ($[0] !== t0) {
13
+ ({
14
+ className,
15
+ ...props
16
+ } = t0);
17
+ $[0] = t0;
18
+ $[1] = className;
19
+ $[2] = props;
20
+ } else {
21
+ className = $[1];
22
+ props = $[2];
23
+ }
24
+ let t1;
25
+ if ($[3] !== className) {
26
+ t1 = cn("peer inline-flex h-5 w-9 shrink-0 items-center rounded-full border border-transparent px-px transition-all outline-none", "data-[state=checked]:bg-primary data-[state=unchecked]:bg-input", "focus-visible:ring-2 focus-visible:ring-ring/70 focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50", className);
27
+ $[3] = className;
28
+ $[4] = t1;
29
+ } else {
30
+ t1 = $[4];
31
+ }
32
+ let t2;
33
+ if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
34
+ t2 = /*#__PURE__*/_jsx(SwitchPrimitive.Thumb, {
35
+ "data-slot": "switch-thumb",
36
+ className: cn("pointer-events-none block size-4 rounded-full bg-background shadow-sm ring-0 transition-transform", "data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")
37
+ });
38
+ $[5] = t2;
39
+ } else {
40
+ t2 = $[5];
41
+ }
42
+ let t3;
43
+ if ($[6] !== props || $[7] !== t1) {
44
+ t3 = /*#__PURE__*/_jsx(SwitchPrimitive.Root, {
45
+ "data-slot": "switch",
46
+ className: t1,
47
+ ...props,
48
+ children: t2
49
+ });
50
+ $[6] = props;
51
+ $[7] = t1;
52
+ $[8] = t3;
53
+ } else {
54
+ t3 = $[8];
55
+ }
56
+ return t3;
7
57
  }
8
58
  export { Switch };
@@ -1,20 +1,123 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { c as _c } from "react/compiler-runtime";
2
2
  import { cn } from "cn";
3
+ import { jsx as _jsx } from "react/jsx-runtime";
3
4
  function uniqueMessages(errors) {
4
- const messages = errors.map((error) => error?.message).filter((message) => !!message);
5
- return [...new Set(messages)];
5
+ const messages = errors.map(error => error?.message).filter(message => !!message);
6
+ return [...new Set(messages)];
7
+ }
8
+ function FieldErrorContent(t0) {
9
+ const $ = _c(4);
10
+ const {
11
+ messages
12
+ } = t0;
13
+ if (messages.length === 1) {
14
+ return messages[0];
15
+ }
16
+ let t1;
17
+ if ($[0] !== messages) {
18
+ t1 = messages.map(_temp);
19
+ $[0] = messages;
20
+ $[1] = t1;
21
+ } else {
22
+ t1 = $[1];
23
+ }
24
+ let t2;
25
+ if ($[2] !== t1) {
26
+ t2 = /*#__PURE__*/_jsx("ul", {
27
+ className: "ml-4 flex list-disc flex-col gap-1",
28
+ children: t1
29
+ });
30
+ $[2] = t1;
31
+ $[3] = t2;
32
+ } else {
33
+ t2 = $[3];
34
+ }
35
+ return t2;
6
36
  }
7
- function FieldErrorContent({ messages }) {
8
- if (messages.length === 1) {
9
- return messages[0];
10
- }
11
- return (_jsx("ul", { className: "ml-4 flex list-disc flex-col gap-1", children: messages.map((message) => (_jsx("li", { children: message }, message))) }));
37
+ function _temp(message) {
38
+ return /*#__PURE__*/_jsx("li", {
39
+ children: message
40
+ }, message);
12
41
  }
13
- function FieldError({ className, children, errors, ...props }) {
14
- const messages = uniqueMessages(errors ?? []);
15
- if (!children && messages.length === 0) {
16
- return null;
17
- }
18
- return (_jsx("div", { role: "alert", "data-slot": "field-error", className: cn("text-sm font-normal text-destructive", className), ...props, children: children ?? _jsx(FieldErrorContent, { messages: messages }) }));
42
+ function FieldError(t0) {
43
+ const $ = _c(18);
44
+ let children;
45
+ let className;
46
+ let errors;
47
+ let props;
48
+ if ($[0] !== t0) {
49
+ ({
50
+ className,
51
+ children,
52
+ errors,
53
+ ...props
54
+ } = t0);
55
+ $[0] = t0;
56
+ $[1] = children;
57
+ $[2] = className;
58
+ $[3] = errors;
59
+ $[4] = props;
60
+ } else {
61
+ children = $[1];
62
+ className = $[2];
63
+ errors = $[3];
64
+ props = $[4];
65
+ }
66
+ let t1;
67
+ if ($[5] !== errors) {
68
+ t1 = errors ?? [];
69
+ $[5] = errors;
70
+ $[6] = t1;
71
+ } else {
72
+ t1 = $[6];
73
+ }
74
+ let t2;
75
+ if ($[7] !== t1) {
76
+ t2 = uniqueMessages(t1);
77
+ $[7] = t1;
78
+ $[8] = t2;
79
+ } else {
80
+ t2 = $[8];
81
+ }
82
+ const messages = t2;
83
+ if (!children && messages.length === 0) {
84
+ return null;
85
+ }
86
+ let t3;
87
+ if ($[9] !== className) {
88
+ t3 = cn("text-sm font-normal text-destructive", className);
89
+ $[9] = className;
90
+ $[10] = t3;
91
+ } else {
92
+ t3 = $[10];
93
+ }
94
+ let t4;
95
+ if ($[11] !== children || $[12] !== messages) {
96
+ t4 = children ?? /*#__PURE__*/_jsx(FieldErrorContent, {
97
+ messages: messages
98
+ });
99
+ $[11] = children;
100
+ $[12] = messages;
101
+ $[13] = t4;
102
+ } else {
103
+ t4 = $[13];
104
+ }
105
+ let t5;
106
+ if ($[14] !== props || $[15] !== t3 || $[16] !== t4) {
107
+ t5 = /*#__PURE__*/_jsx("div", {
108
+ role: "alert",
109
+ "data-slot": "field-error",
110
+ className: t3,
111
+ ...props,
112
+ children: t4
113
+ });
114
+ $[14] = props;
115
+ $[15] = t3;
116
+ $[16] = t4;
117
+ $[17] = t5;
118
+ } else {
119
+ t5 = $[17];
120
+ }
121
+ return t5;
19
122
  }
20
123
  export { FieldError };
@@ -1,7 +1,74 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { c as _c } from "react/compiler-runtime";
2
2
  import { cn } from "cn";
3
3
  import { Separator } from "../../display/separator.js";
4
- function FieldSeparator({ children, className, ...props }) {
5
- return (_jsxs("div", { "data-slot": "field-separator", "data-content": !!children, className: cn("relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2", className), ...props, children: [_jsx(Separator, { className: "absolute inset-0 top-1/2" }), children && (_jsx("span", { className: "relative mx-auto block w-fit bg-background px-2 text-muted-foreground", "data-slot": "field-separator-content", children: children }))] }));
4
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
5
+ function FieldSeparator(t0) {
6
+ const $ = _c(14);
7
+ let children;
8
+ let className;
9
+ let props;
10
+ if ($[0] !== t0) {
11
+ ({
12
+ children,
13
+ className,
14
+ ...props
15
+ } = t0);
16
+ $[0] = t0;
17
+ $[1] = children;
18
+ $[2] = className;
19
+ $[3] = props;
20
+ } else {
21
+ children = $[1];
22
+ className = $[2];
23
+ props = $[3];
24
+ }
25
+ const t1 = !!children;
26
+ let t2;
27
+ if ($[4] !== className) {
28
+ t2 = cn("relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2", className);
29
+ $[4] = className;
30
+ $[5] = t2;
31
+ } else {
32
+ t2 = $[5];
33
+ }
34
+ let t3;
35
+ if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
36
+ t3 = /*#__PURE__*/_jsx(Separator, {
37
+ className: "absolute inset-0 top-1/2"
38
+ });
39
+ $[6] = t3;
40
+ } else {
41
+ t3 = $[6];
42
+ }
43
+ let t4;
44
+ if ($[7] !== children) {
45
+ t4 = children && /*#__PURE__*/_jsx("span", {
46
+ className: "relative mx-auto block w-fit bg-background px-2 text-muted-foreground",
47
+ "data-slot": "field-separator-content",
48
+ children: children
49
+ });
50
+ $[7] = children;
51
+ $[8] = t4;
52
+ } else {
53
+ t4 = $[8];
54
+ }
55
+ let t5;
56
+ if ($[9] !== props || $[10] !== t1 || $[11] !== t2 || $[12] !== t4) {
57
+ t5 = /*#__PURE__*/_jsxs("div", {
58
+ "data-slot": "field-separator",
59
+ "data-content": t1,
60
+ className: t2,
61
+ ...props,
62
+ children: [t3, t4]
63
+ });
64
+ $[9] = props;
65
+ $[10] = t1;
66
+ $[11] = t2;
67
+ $[12] = t4;
68
+ $[13] = t5;
69
+ } else {
70
+ t5 = $[13];
71
+ }
72
+ return t5;
6
73
  }
7
74
  export { FieldSeparator };
@@ -1,9 +1,89 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { c as _c } from "react/compiler-runtime";
2
2
  import { cn } from "cn";
3
- function FieldSet({ className, ...props }) {
4
- return (_jsx("fieldset", { "data-slot": "field-set", className: cn("flex flex-col gap-6", "has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3", className), ...props }));
3
+ import { jsx as _jsx } from "react/jsx-runtime";
4
+ function FieldSet(t0) {
5
+ const $ = _c(8);
6
+ let className;
7
+ let props;
8
+ if ($[0] !== t0) {
9
+ ({
10
+ className,
11
+ ...props
12
+ } = t0);
13
+ $[0] = t0;
14
+ $[1] = className;
15
+ $[2] = props;
16
+ } else {
17
+ className = $[1];
18
+ props = $[2];
19
+ }
20
+ let t1;
21
+ if ($[3] !== className) {
22
+ t1 = cn("flex flex-col gap-6", "has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3", className);
23
+ $[3] = className;
24
+ $[4] = t1;
25
+ } else {
26
+ t1 = $[4];
27
+ }
28
+ let t2;
29
+ if ($[5] !== props || $[6] !== t1) {
30
+ t2 = /*#__PURE__*/_jsx("fieldset", {
31
+ "data-slot": "field-set",
32
+ className: t1,
33
+ ...props
34
+ });
35
+ $[5] = props;
36
+ $[6] = t1;
37
+ $[7] = t2;
38
+ } else {
39
+ t2 = $[7];
40
+ }
41
+ return t2;
5
42
  }
6
- function FieldLegend({ className, variant = "legend", ...props }) {
7
- return (_jsx("legend", { "data-slot": "field-legend", "data-variant": variant, className: cn("mb-3 font-medium", "data-[variant=legend]:text-base", "data-[variant=label]:text-sm", className), ...props }));
43
+ function FieldLegend(t0) {
44
+ const $ = _c(10);
45
+ let className;
46
+ let props;
47
+ let t1;
48
+ if ($[0] !== t0) {
49
+ ({
50
+ className,
51
+ variant: t1,
52
+ ...props
53
+ } = t0);
54
+ $[0] = t0;
55
+ $[1] = className;
56
+ $[2] = props;
57
+ $[3] = t1;
58
+ } else {
59
+ className = $[1];
60
+ props = $[2];
61
+ t1 = $[3];
62
+ }
63
+ const variant = t1 === undefined ? "legend" : t1;
64
+ let t2;
65
+ if ($[4] !== className) {
66
+ t2 = cn("mb-3 font-medium", "data-[variant=legend]:text-base", "data-[variant=label]:text-sm", className);
67
+ $[4] = className;
68
+ $[5] = t2;
69
+ } else {
70
+ t2 = $[5];
71
+ }
72
+ let t3;
73
+ if ($[6] !== props || $[7] !== t2 || $[8] !== variant) {
74
+ t3 = /*#__PURE__*/_jsx("legend", {
75
+ "data-slot": "field-legend",
76
+ "data-variant": variant,
77
+ className: t2,
78
+ ...props
79
+ });
80
+ $[6] = props;
81
+ $[7] = t2;
82
+ $[8] = variant;
83
+ $[9] = t3;
84
+ } else {
85
+ t3 = $[9];
86
+ }
87
+ return t3;
8
88
  }
9
89
  export { FieldLegend, FieldSet };
@@ -1,13 +1,122 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { c as _c } from "react/compiler-runtime";
2
2
  import { cn } from "cn";
3
3
  import { Label } from "../label.js";
4
- function FieldLabel({ className, ...props }) {
5
- return (_jsx(Label, { "data-slot": "field-label", className: cn("group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50", "has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-4", "has-data-[state=checked]:border-primary has-data-[state=checked]:bg-primary/5 dark:has-data-[state=checked]:bg-primary/10", className), ...props }));
4
+ import { jsx as _jsx } from "react/jsx-runtime";
5
+ function FieldLabel(t0) {
6
+ const $ = _c(8);
7
+ let className;
8
+ let props;
9
+ if ($[0] !== t0) {
10
+ ({
11
+ className,
12
+ ...props
13
+ } = t0);
14
+ $[0] = t0;
15
+ $[1] = className;
16
+ $[2] = props;
17
+ } else {
18
+ className = $[1];
19
+ props = $[2];
20
+ }
21
+ let t1;
22
+ if ($[3] !== className) {
23
+ t1 = cn("group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50", "has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-4", "has-data-[state=checked]:border-primary has-data-[state=checked]:bg-primary/5 dark:has-data-[state=checked]:bg-primary/10", className);
24
+ $[3] = className;
25
+ $[4] = t1;
26
+ } else {
27
+ t1 = $[4];
28
+ }
29
+ let t2;
30
+ if ($[5] !== props || $[6] !== t1) {
31
+ t2 = /*#__PURE__*/_jsx(Label, {
32
+ "data-slot": "field-label",
33
+ className: t1,
34
+ ...props
35
+ });
36
+ $[5] = props;
37
+ $[6] = t1;
38
+ $[7] = t2;
39
+ } else {
40
+ t2 = $[7];
41
+ }
42
+ return t2;
6
43
  }
7
- function FieldTitle({ className, ...props }) {
8
- return (_jsx("div", { "data-slot": "field-label", className: cn("flex w-fit items-center gap-2 text-sm leading-snug font-medium group-data-[disabled=true]/field:opacity-50", className), ...props }));
44
+ function FieldTitle(t0) {
45
+ const $ = _c(8);
46
+ let className;
47
+ let props;
48
+ if ($[0] !== t0) {
49
+ ({
50
+ className,
51
+ ...props
52
+ } = t0);
53
+ $[0] = t0;
54
+ $[1] = className;
55
+ $[2] = props;
56
+ } else {
57
+ className = $[1];
58
+ props = $[2];
59
+ }
60
+ let t1;
61
+ if ($[3] !== className) {
62
+ t1 = cn("flex w-fit items-center gap-2 text-sm leading-snug font-medium group-data-[disabled=true]/field:opacity-50", className);
63
+ $[3] = className;
64
+ $[4] = t1;
65
+ } else {
66
+ t1 = $[4];
67
+ }
68
+ let t2;
69
+ if ($[5] !== props || $[6] !== t1) {
70
+ t2 = /*#__PURE__*/_jsx("div", {
71
+ "data-slot": "field-label",
72
+ className: t1,
73
+ ...props
74
+ });
75
+ $[5] = props;
76
+ $[6] = t1;
77
+ $[7] = t2;
78
+ } else {
79
+ t2 = $[7];
80
+ }
81
+ return t2;
9
82
  }
10
- function FieldDescription({ className, ...props }) {
11
- return (_jsx("p", { "data-slot": "field-description", className: cn("text-sm leading-normal font-normal text-muted-foreground group-has-[[data-orientation=horizontal]]/field:text-balance", "last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5", "[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary", className), ...props }));
83
+ function FieldDescription(t0) {
84
+ const $ = _c(8);
85
+ let className;
86
+ let props;
87
+ if ($[0] !== t0) {
88
+ ({
89
+ className,
90
+ ...props
91
+ } = t0);
92
+ $[0] = t0;
93
+ $[1] = className;
94
+ $[2] = props;
95
+ } else {
96
+ className = $[1];
97
+ props = $[2];
98
+ }
99
+ let t1;
100
+ if ($[3] !== className) {
101
+ t1 = cn("text-sm leading-normal font-normal text-muted-foreground group-has-[[data-orientation=horizontal]]/field:text-balance", "last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5", "[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary", className);
102
+ $[3] = className;
103
+ $[4] = t1;
104
+ } else {
105
+ t1 = $[4];
106
+ }
107
+ let t2;
108
+ if ($[5] !== props || $[6] !== t1) {
109
+ t2 = /*#__PURE__*/_jsx("p", {
110
+ "data-slot": "field-description",
111
+ className: t1,
112
+ ...props
113
+ });
114
+ $[5] = props;
115
+ $[6] = t1;
116
+ $[7] = t2;
117
+ } else {
118
+ t2 = $[7];
119
+ }
120
+ return t2;
12
121
  }
13
122
  export { FieldDescription, FieldLabel, FieldTitle };
@@ -1,33 +1,145 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { c as _c } from "react/compiler-runtime";
2
2
  import { cva } from "class-variance-authority";
3
3
  import { cn } from "cn";
4
- const fieldVariants = cva("group/field flex w-full gap-3 data-[invalid=true]:text-destructive", {
5
- variants: {
6
- orientation: {
7
- vertical: ["flex-col [&>*]:w-full [&>.sr-only]:w-auto"],
8
- horizontal: [
9
- "flex-row items-center",
10
- "[&>[data-slot=field-label]]:flex-auto",
11
- "has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",
12
- ],
13
- responsive: [
14
- "flex-col @md/field-group:flex-row @md/field-group:items-center [&>*]:w-full @md/field-group:[&>*]:w-auto [&>.sr-only]:w-auto",
15
- "@md/field-group:[&>[data-slot=field-label]]:flex-auto",
16
- "@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",
17
- ],
18
- },
19
- },
20
- defaultVariants: {
21
- orientation: "vertical",
22
- },
4
+ import { jsx as _jsx } from "react/jsx-runtime";
5
+ const fieldVariants = cva("group/field flex w-full gap-3", {
6
+ variants: {
7
+ orientation: {
8
+ vertical: ["flex-col gap-2 [&>*]:w-full [&>.sr-only]:w-auto"],
9
+ horizontal: ["flex-row items-center", "[&>[data-slot=field-label]]:flex-auto", "has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"],
10
+ responsive: ["flex-col gap-2 @md/field-group:flex-row @md/field-group:gap-3 @md/field-group:items-center [&>*]:w-full @md/field-group:[&>*]:w-auto [&>.sr-only]:w-auto", "@md/field-group:[&>[data-slot=field-label]]:flex-auto", "@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"]
11
+ }
12
+ },
13
+ defaultVariants: {
14
+ orientation: "vertical"
15
+ }
23
16
  });
24
- function Field({ className, orientation = "vertical", ...props }) {
25
- return (_jsx("div", { role: "group", "data-slot": "field", "data-orientation": orientation, className: cn(fieldVariants({ orientation }), className), ...props }));
17
+ function Field(t0) {
18
+ const $ = _c(11);
19
+ let className;
20
+ let props;
21
+ let t1;
22
+ if ($[0] !== t0) {
23
+ ({
24
+ className,
25
+ orientation: t1,
26
+ ...props
27
+ } = t0);
28
+ $[0] = t0;
29
+ $[1] = className;
30
+ $[2] = props;
31
+ $[3] = t1;
32
+ } else {
33
+ className = $[1];
34
+ props = $[2];
35
+ t1 = $[3];
36
+ }
37
+ const orientation = t1 === undefined ? "vertical" : t1;
38
+ let t2;
39
+ if ($[4] !== className || $[5] !== orientation) {
40
+ t2 = cn(fieldVariants({
41
+ orientation
42
+ }), className);
43
+ $[4] = className;
44
+ $[5] = orientation;
45
+ $[6] = t2;
46
+ } else {
47
+ t2 = $[6];
48
+ }
49
+ let t3;
50
+ if ($[7] !== orientation || $[8] !== props || $[9] !== t2) {
51
+ t3 = /*#__PURE__*/_jsx("div", {
52
+ role: "group",
53
+ "data-slot": "field",
54
+ "data-orientation": orientation,
55
+ className: t2,
56
+ ...props
57
+ });
58
+ $[7] = orientation;
59
+ $[8] = props;
60
+ $[9] = t2;
61
+ $[10] = t3;
62
+ } else {
63
+ t3 = $[10];
64
+ }
65
+ return t3;
26
66
  }
27
- function FieldGroup({ className, ...props }) {
28
- return (_jsx("div", { "data-slot": "field-group", className: cn("group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4", className), ...props }));
67
+ function FieldGroup(t0) {
68
+ const $ = _c(8);
69
+ let className;
70
+ let props;
71
+ if ($[0] !== t0) {
72
+ ({
73
+ className,
74
+ ...props
75
+ } = t0);
76
+ $[0] = t0;
77
+ $[1] = className;
78
+ $[2] = props;
79
+ } else {
80
+ className = $[1];
81
+ props = $[2];
82
+ }
83
+ let t1;
84
+ if ($[3] !== className) {
85
+ t1 = cn("group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4", className);
86
+ $[3] = className;
87
+ $[4] = t1;
88
+ } else {
89
+ t1 = $[4];
90
+ }
91
+ let t2;
92
+ if ($[5] !== props || $[6] !== t1) {
93
+ t2 = /*#__PURE__*/_jsx("div", {
94
+ "data-slot": "field-group",
95
+ className: t1,
96
+ ...props
97
+ });
98
+ $[5] = props;
99
+ $[6] = t1;
100
+ $[7] = t2;
101
+ } else {
102
+ t2 = $[7];
103
+ }
104
+ return t2;
29
105
  }
30
- function FieldContent({ className, ...props }) {
31
- return (_jsx("div", { "data-slot": "field-content", className: cn("group/field-content flex flex-1 flex-col gap-1.5 leading-snug", className), ...props }));
106
+ function FieldContent(t0) {
107
+ const $ = _c(8);
108
+ let className;
109
+ let props;
110
+ if ($[0] !== t0) {
111
+ ({
112
+ className,
113
+ ...props
114
+ } = t0);
115
+ $[0] = t0;
116
+ $[1] = className;
117
+ $[2] = props;
118
+ } else {
119
+ className = $[1];
120
+ props = $[2];
121
+ }
122
+ let t1;
123
+ if ($[3] !== className) {
124
+ t1 = cn("group/field-content flex flex-1 flex-col gap-1.5 leading-snug", className);
125
+ $[3] = className;
126
+ $[4] = t1;
127
+ } else {
128
+ t1 = $[4];
129
+ }
130
+ let t2;
131
+ if ($[5] !== props || $[6] !== t1) {
132
+ t2 = /*#__PURE__*/_jsx("div", {
133
+ "data-slot": "field-content",
134
+ className: t1,
135
+ ...props
136
+ });
137
+ $[5] = props;
138
+ $[6] = t1;
139
+ $[7] = t2;
140
+ } else {
141
+ t2 = $[7];
142
+ }
143
+ return t2;
32
144
  }
33
145
  export { Field, FieldContent, FieldGroup, fieldVariants };