@arch-cadre/ui 0.0.33 → 0.0.34

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 (65) hide show
  1. package/build.config.ts +7 -7
  2. package/package.json +3 -3
  3. package/dist/components/accordion.cjs +0 -62
  4. package/dist/components/alert-dialog.cjs +0 -127
  5. package/dist/components/alert.cjs +0 -58
  6. package/dist/components/aspect-ratio.cjs +0 -19
  7. package/dist/components/avatar.cjs +0 -44
  8. package/dist/components/badge.cjs +0 -41
  9. package/dist/components/breadcrumb.cjs +0 -106
  10. package/dist/components/button-group.cjs +0 -65
  11. package/dist/components/button.cjs +0 -57
  12. package/dist/components/calendar.cjs +0 -143
  13. package/dist/components/card.cjs +0 -86
  14. package/dist/components/checkbox.cjs +0 -28
  15. package/dist/components/collapsible.cjs +0 -37
  16. package/dist/components/command.cjs +0 -125
  17. package/dist/components/context-menu.cjs +0 -188
  18. package/dist/components/dialog.cjs +0 -123
  19. package/dist/components/drawer.cjs +0 -118
  20. package/dist/components/dropdown-menu.cjs +0 -190
  21. package/dist/components/empty.cjs +0 -92
  22. package/dist/components/field.cjs +0 -173
  23. package/dist/components/form.cjs +0 -143
  24. package/dist/components/hover-card.cjs +0 -46
  25. package/dist/components/input-group.cjs +0 -130
  26. package/dist/components/input-otp.cjs +0 -69
  27. package/dist/components/input.cjs +0 -22
  28. package/dist/components/item.cjs +0 -168
  29. package/dist/components/kbd.cjs +0 -31
  30. package/dist/components/label.cjs +0 -22
  31. package/dist/components/language-switcher.cjs +0 -43
  32. package/dist/components/menubar.cjs +0 -207
  33. package/dist/components/navigation-menu.cjs +0 -113
  34. package/dist/components/pagination.cjs +0 -106
  35. package/dist/components/popover.cjs +0 -53
  36. package/dist/components/progress.cjs +0 -29
  37. package/dist/components/radio-group.cjs +0 -39
  38. package/dist/components/scroll-area.cjs +0 -45
  39. package/dist/components/select.cjs +0 -140
  40. package/dist/components/separator.cjs +0 -26
  41. package/dist/components/sheet.cjs +0 -120
  42. package/dist/components/sidebar.cjs +0 -508
  43. package/dist/components/skeleton.cjs +0 -20
  44. package/dist/components/slider.cjs +0 -43
  45. package/dist/components/sonner.cjs +0 -49
  46. package/dist/components/spinner.cjs +0 -22
  47. package/dist/components/switch.cjs +0 -25
  48. package/dist/components/table.cjs +0 -101
  49. package/dist/components/tabs.cjs +0 -55
  50. package/dist/components/textarea.cjs +0 -20
  51. package/dist/components/toggle-group.cjs +0 -65
  52. package/dist/components/toggle.cjs +0 -47
  53. package/dist/components/tooltip.cjs +0 -56
  54. package/dist/hooks/use-mobile.cjs +0 -23
  55. package/dist/hooks/use-user.cjs +0 -21
  56. package/dist/index.cjs +0 -179
  57. package/dist/lib/utils.cjs +0 -11
  58. package/dist/logo.cjs +0 -49
  59. package/dist/postcss.config.cjs +0 -13
  60. package/dist/providers/auth-provider.cjs +0 -44
  61. package/dist/providers/index.cjs +0 -47
  62. package/dist/shared/access-denied.cjs +0 -38
  63. package/dist/shared/loader.cjs +0 -95
  64. package/dist/shared/page-loader.cjs +0 -23
  65. package/dist/shared/scroll-fade-effect.cjs +0 -21
@@ -1,173 +0,0 @@
1
- "use strict";
2
- "use client";
3
-
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.Field = Field;
8
- exports.FieldContent = FieldContent;
9
- exports.FieldDescription = FieldDescription;
10
- exports.FieldError = FieldError;
11
- exports.FieldGroup = FieldGroup;
12
- exports.FieldLabel = FieldLabel;
13
- exports.FieldLegend = FieldLegend;
14
- exports.FieldSeparator = FieldSeparator;
15
- exports.FieldSet = FieldSet;
16
- exports.FieldTitle = FieldTitle;
17
- var _classVarianceAuthority = require("class-variance-authority");
18
- var _react = _interopRequireWildcard(require("react"));
19
- var React = _react;
20
- var _utils = require("../lib/utils.cjs");
21
- var _label = require("./label.cjs");
22
- var _separator = require("./separator.cjs");
23
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
24
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
25
- function FieldSet({
26
- className,
27
- ...props
28
- }) {
29
- return /* @__PURE__ */React.createElement("fieldset", {
30
- "data-slot": "field-set",
31
- className: (0, _utils.cn)("flex flex-col gap-6", "has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3", className),
32
- ...props
33
- });
34
- }
35
- function FieldLegend({
36
- className,
37
- variant = "legend",
38
- ...props
39
- }) {
40
- return /* @__PURE__ */React.createElement("legend", {
41
- "data-slot": "field-legend",
42
- "data-variant": variant,
43
- className: (0, _utils.cn)("mb-3 font-medium", "data-[variant=legend]:text-base", "data-[variant=label]:text-sm", className),
44
- ...props
45
- });
46
- }
47
- function FieldGroup({
48
- className,
49
- ...props
50
- }) {
51
- return /* @__PURE__ */React.createElement("div", {
52
- "data-slot": "field-group",
53
- className: (0, _utils.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),
54
- ...props
55
- });
56
- }
57
- const fieldVariants = (0, _classVarianceAuthority.cva)("group/field flex w-full gap-3 data-[invalid=true]:text-destructive", {
58
- variants: {
59
- orientation: {
60
- vertical: ["flex-col [&>*]:w-full [&>.sr-only]:w-auto"],
61
- 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"],
62
- responsive: ["flex-col [&>*]:w-full [&>.sr-only]:w-auto @md/field-group:flex-row @md/field-group:items-center @md/field-group:[&>*]: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"]
63
- }
64
- },
65
- defaultVariants: {
66
- orientation: "vertical"
67
- }
68
- });
69
- function Field({
70
- className,
71
- orientation = "vertical",
72
- ...props
73
- }) {
74
- return /* @__PURE__ */React.createElement("div", {
75
- role: "group",
76
- "data-slot": "field",
77
- "data-orientation": orientation,
78
- className: (0, _utils.cn)(fieldVariants({
79
- orientation
80
- }), className),
81
- ...props
82
- });
83
- }
84
- function FieldContent({
85
- className,
86
- ...props
87
- }) {
88
- return /* @__PURE__ */React.createElement("div", {
89
- "data-slot": "field-content",
90
- className: (0, _utils.cn)("group/field-content flex flex-1 flex-col gap-1.5 leading-snug", className),
91
- ...props
92
- });
93
- }
94
- function FieldLabel({
95
- className,
96
- ...props
97
- }) {
98
- return /* @__PURE__ */React.createElement(_label.Label, {
99
- "data-slot": "field-label",
100
- className: (0, _utils.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]:bg-primary/5 has-data-[state=checked]:border-primary dark:has-data-[state=checked]:bg-primary/10", className),
101
- ...props
102
- });
103
- }
104
- function FieldTitle({
105
- className,
106
- ...props
107
- }) {
108
- return /* @__PURE__ */React.createElement("div", {
109
- "data-slot": "field-label",
110
- className: (0, _utils.cn)("flex w-fit items-center gap-2 text-sm leading-snug font-medium group-data-[disabled=true]/field:opacity-50", className),
111
- ...props
112
- });
113
- }
114
- function FieldDescription({
115
- className,
116
- ...props
117
- }) {
118
- return /* @__PURE__ */React.createElement("p", {
119
- "data-slot": "field-description",
120
- className: (0, _utils.cn)("text-muted-foreground text-sm leading-normal font-normal group-has-[[data-orientation=horizontal]]/field:text-balance", "last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5", "[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4", className),
121
- ...props
122
- });
123
- }
124
- function FieldSeparator({
125
- children,
126
- className,
127
- ...props
128
- }) {
129
- return /* @__PURE__ */React.createElement("div", {
130
- "data-slot": "field-separator",
131
- "data-content": !!children,
132
- className: (0, _utils.cn)("relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2", className),
133
- ...props
134
- }, /* @__PURE__ */React.createElement(_separator.Separator, {
135
- className: "absolute inset-0 top-1/2"
136
- }), children && /* @__PURE__ */React.createElement("span", {
137
- className: "bg-background text-muted-foreground relative mx-auto block w-fit px-2",
138
- "data-slot": "field-separator-content"
139
- }, children));
140
- }
141
- function FieldError({
142
- className,
143
- children,
144
- errors,
145
- ...props
146
- }) {
147
- const content = (0, _react.useMemo)(() => {
148
- if (children) {
149
- return children;
150
- }
151
- if (!errors?.length) {
152
- return null;
153
- }
154
- const uniqueErrors = [...new Map(errors.map(error => [error?.message, error])).values()];
155
- if (uniqueErrors?.length === 1) {
156
- return uniqueErrors[0]?.message;
157
- }
158
- return /* @__PURE__ */React.createElement("ul", {
159
- className: "ml-4 flex list-disc flex-col gap-1"
160
- }, uniqueErrors.map((error, index) => error?.message && /* @__PURE__ */React.createElement("li", {
161
- key: index
162
- }, error.message)));
163
- }, [children, errors]);
164
- if (!content) {
165
- return null;
166
- }
167
- return /* @__PURE__ */React.createElement("div", {
168
- role: "alert",
169
- "data-slot": "field-error",
170
- className: (0, _utils.cn)("text-destructive text-sm font-normal", className),
171
- ...props
172
- }, content);
173
- }
@@ -1,143 +0,0 @@
1
- "use strict";
2
- "use client";
3
-
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.Form = void 0;
8
- exports.FormControl = FormControl;
9
- exports.FormDescription = FormDescription;
10
- exports.FormField = void 0;
11
- exports.FormItem = FormItem;
12
- exports.FormLabel = FormLabel;
13
- exports.FormMessage = FormMessage;
14
- exports.useFormField = void 0;
15
- var _radixUi = require("radix-ui");
16
- var React = _interopRequireWildcard(require("react"));
17
- var _reactHookForm = require("react-hook-form");
18
- var _utils = require("../lib/utils.cjs");
19
- var _label = require("./label.cjs");
20
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
21
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
22
- const Form = exports.Form = _reactHookForm.FormProvider;
23
- const FormFieldContext = React.createContext({});
24
- const FormField = ({
25
- ...props
26
- }) => {
27
- return /* @__PURE__ */React.createElement(FormFieldContext.Provider, {
28
- value: {
29
- name: props.name
30
- }
31
- }, /* @__PURE__ */React.createElement(_reactHookForm.Controller, {
32
- ...props
33
- }));
34
- };
35
- exports.FormField = FormField;
36
- const useFormField = () => {
37
- const fieldContext = React.useContext(FormFieldContext);
38
- const itemContext = React.useContext(FormItemContext);
39
- const {
40
- getFieldState
41
- } = (0, _reactHookForm.useFormContext)();
42
- const formState = (0, _reactHookForm.useFormState)({
43
- name: fieldContext.name
44
- });
45
- const fieldState = getFieldState(fieldContext.name, formState);
46
- if (!fieldContext) {
47
- throw new Error("useFormField should be used within <FormField>");
48
- }
49
- const {
50
- id
51
- } = itemContext;
52
- return {
53
- id,
54
- name: fieldContext.name,
55
- formItemId: `${id}-form-item`,
56
- formDescriptionId: `${id}-form-item-description`,
57
- formMessageId: `${id}-form-item-message`,
58
- ...fieldState
59
- };
60
- };
61
- exports.useFormField = useFormField;
62
- const FormItemContext = React.createContext({});
63
- function FormItem({
64
- className,
65
- ...props
66
- }) {
67
- const id = React.useId();
68
- return /* @__PURE__ */React.createElement(FormItemContext.Provider, {
69
- value: {
70
- id
71
- }
72
- }, /* @__PURE__ */React.createElement("div", {
73
- "data-slot": "form-item",
74
- className: (0, _utils.cn)("grid gap-2", className),
75
- ...props
76
- }));
77
- }
78
- function FormLabel({
79
- className,
80
- ...props
81
- }) {
82
- const {
83
- error,
84
- formItemId
85
- } = useFormField();
86
- return /* @__PURE__ */React.createElement(_label.Label, {
87
- "data-slot": "form-label",
88
- "data-error": !!error,
89
- className: (0, _utils.cn)("data-[error=true]:text-destructive", className),
90
- htmlFor: formItemId,
91
- ...props
92
- });
93
- }
94
- function FormControl({
95
- ...props
96
- }) {
97
- const {
98
- error,
99
- formItemId,
100
- formDescriptionId,
101
- formMessageId
102
- } = useFormField();
103
- return /* @__PURE__ */React.createElement(_radixUi.Slot.Slot, {
104
- "data-slot": "form-control",
105
- id: formItemId,
106
- "aria-describedby": !error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`,
107
- "aria-invalid": !!error,
108
- ...props
109
- });
110
- }
111
- function FormDescription({
112
- className,
113
- ...props
114
- }) {
115
- const {
116
- formDescriptionId
117
- } = useFormField();
118
- return /* @__PURE__ */React.createElement("p", {
119
- "data-slot": "form-description",
120
- id: formDescriptionId,
121
- className: (0, _utils.cn)("text-muted-foreground text-sm", className),
122
- ...props
123
- });
124
- }
125
- function FormMessage({
126
- className,
127
- ...props
128
- }) {
129
- const {
130
- error,
131
- formMessageId
132
- } = useFormField();
133
- const body = error ? String(error?.message ?? "") : props.children;
134
- if (!body) {
135
- return null;
136
- }
137
- return /* @__PURE__ */React.createElement("p", {
138
- "data-slot": "form-message",
139
- id: formMessageId,
140
- className: (0, _utils.cn)("text-destructive text-sm", className),
141
- ...props
142
- }, body);
143
- }
@@ -1,46 +0,0 @@
1
- "use strict";
2
- "use client";
3
-
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.HoverCard = HoverCard;
8
- exports.HoverCardContent = HoverCardContent;
9
- exports.HoverCardTrigger = HoverCardTrigger;
10
- var _radixUi = require("radix-ui");
11
- var React = _interopRequireWildcard(require("react"));
12
- var _utils = require("../lib/utils.cjs");
13
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
14
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
15
- function HoverCard({
16
- ...props
17
- }) {
18
- return /* @__PURE__ */React.createElement(_radixUi.HoverCard.Root, {
19
- "data-slot": "hover-card",
20
- ...props
21
- });
22
- }
23
- function HoverCardTrigger({
24
- ...props
25
- }) {
26
- return /* @__PURE__ */React.createElement(_radixUi.HoverCard.Trigger, {
27
- "data-slot": "hover-card-trigger",
28
- ...props
29
- });
30
- }
31
- function HoverCardContent({
32
- className,
33
- align = "center",
34
- sideOffset = 4,
35
- ...props
36
- }) {
37
- return /* @__PURE__ */React.createElement(_radixUi.HoverCard.Portal, {
38
- "data-slot": "hover-card-portal"
39
- }, /* @__PURE__ */React.createElement(_radixUi.HoverCard.Content, {
40
- "data-slot": "hover-card-content",
41
- align,
42
- sideOffset,
43
- className: (0, _utils.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden", className),
44
- ...props
45
- }));
46
- }
@@ -1,130 +0,0 @@
1
- "use strict";
2
- "use client";
3
-
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.InputGroup = InputGroup;
8
- exports.InputGroupAddon = InputGroupAddon;
9
- exports.InputGroupButton = InputGroupButton;
10
- exports.InputGroupInput = InputGroupInput;
11
- exports.InputGroupText = InputGroupText;
12
- exports.InputGroupTextarea = InputGroupTextarea;
13
- var _classVarianceAuthority = require("class-variance-authority");
14
- var React = _interopRequireWildcard(require("react"));
15
- var _utils = require("../lib/utils.cjs");
16
- var _button = require("./button.cjs");
17
- var _input = require("./input.cjs");
18
- var _textarea = require("./textarea.cjs");
19
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
20
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
21
- function InputGroup({
22
- className,
23
- ...props
24
- }) {
25
- return /* @__PURE__ */React.createElement("div", {
26
- "data-slot": "input-group",
27
- role: "group",
28
- className: (0, _utils.cn)("group/input-group border-input dark:bg-input/30 relative flex w-full items-center rounded-md border shadow-xs transition-[color,box-shadow] outline-none", "h-9 min-w-0 has-[>textarea]:h-auto",
29
- // Variants based on alignment.
30
- "has-[>[data-align=inline-start]]:[&>input]:pl-2", "has-[>[data-align=inline-end]]:[&>input]:pr-2", "has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3", "has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3",
31
- // Focus state.
32
- "has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot=input-group-control]:focus-visible]:ring-[3px]",
33
- // Error state.
34
- "has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40", className),
35
- ...props
36
- });
37
- }
38
- const inputGroupAddonVariants = (0, _classVarianceAuthority.cva)("text-muted-foreground flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium select-none [&>svg:not([class*='size-'])]:size-4 [&>kbd]:rounded-[calc(var(--radius)-5px)] group-data-[disabled=true]/input-group:opacity-50", {
39
- variants: {
40
- align: {
41
- "inline-start": "order-first pl-3 has-[>button]:ml-[-0.45rem] has-[>kbd]:ml-[-0.35rem]",
42
- "inline-end": "order-last pr-3 has-[>button]:mr-[-0.45rem] has-[>kbd]:mr-[-0.35rem]",
43
- "block-start": "order-first w-full justify-start px-3 pt-3 [.border-b]:pb-3 group-has-[>input]/input-group:pt-2.5",
44
- "block-end": "order-last w-full justify-start px-3 pb-3 [.border-t]:pt-3 group-has-[>input]/input-group:pb-2.5"
45
- }
46
- },
47
- defaultVariants: {
48
- align: "inline-start"
49
- }
50
- });
51
- function InputGroupAddon({
52
- className,
53
- align = "inline-start",
54
- ...props
55
- }) {
56
- return /* @__PURE__ */React.createElement("div", {
57
- role: "group",
58
- "data-slot": "input-group-addon",
59
- "data-align": align,
60
- className: (0, _utils.cn)(inputGroupAddonVariants({
61
- align
62
- }), className),
63
- onClick: e => {
64
- if (e.target.closest("button")) {
65
- return;
66
- }
67
- e.currentTarget.parentElement?.querySelector("input")?.focus();
68
- },
69
- ...props
70
- });
71
- }
72
- const inputGroupButtonVariants = (0, _classVarianceAuthority.cva)("text-sm shadow-none flex gap-2 items-center", {
73
- variants: {
74
- size: {
75
- xs: "h-6 gap-1 px-2 rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-3.5 has-[>svg]:px-2",
76
- sm: "h-8 px-2.5 gap-1.5 rounded-md has-[>svg]:px-2.5",
77
- "icon-xs": "size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0",
78
- "icon-sm": "size-8 p-0 has-[>svg]:p-0"
79
- }
80
- },
81
- defaultVariants: {
82
- size: "xs"
83
- }
84
- });
85
- function InputGroupButton({
86
- className,
87
- type = "button",
88
- variant = "ghost",
89
- size = "xs",
90
- ...props
91
- }) {
92
- return /* @__PURE__ */React.createElement(_button.Button, {
93
- type,
94
- "data-size": size,
95
- variant,
96
- className: (0, _utils.cn)(inputGroupButtonVariants({
97
- size
98
- }), className),
99
- ...props
100
- });
101
- }
102
- function InputGroupText({
103
- className,
104
- ...props
105
- }) {
106
- return /* @__PURE__ */React.createElement("span", {
107
- className: (0, _utils.cn)("text-muted-foreground flex items-center gap-2 text-sm [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4", className),
108
- ...props
109
- });
110
- }
111
- function InputGroupInput({
112
- className,
113
- ...props
114
- }) {
115
- return /* @__PURE__ */React.createElement(_input.Input, {
116
- "data-slot": "input-group-control",
117
- className: (0, _utils.cn)("flex-1 rounded-none border-0 bg-transparent shadow-none focus-visible:ring-0 dark:bg-transparent", className),
118
- ...props
119
- });
120
- }
121
- function InputGroupTextarea({
122
- className,
123
- ...props
124
- }) {
125
- return /* @__PURE__ */React.createElement(_textarea.Textarea, {
126
- "data-slot": "input-group-control",
127
- className: (0, _utils.cn)("flex-1 resize-none rounded-none border-0 bg-transparent py-3 shadow-none focus-visible:ring-0 dark:bg-transparent", className),
128
- ...props
129
- });
130
- }
@@ -1,69 +0,0 @@
1
- "use strict";
2
- "use client";
3
-
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.InputOTP = InputOTP;
8
- exports.InputOTPGroup = InputOTPGroup;
9
- exports.InputOTPSeparator = InputOTPSeparator;
10
- exports.InputOTPSlot = InputOTPSlot;
11
- var _inputOtp = require("input-otp");
12
- var _lucideReact = require("lucide-react");
13
- var React = _interopRequireWildcard(require("react"));
14
- var _utils = require("../lib/utils.cjs");
15
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
16
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
17
- function InputOTP({
18
- className,
19
- containerClassName,
20
- ...props
21
- }) {
22
- return /* @__PURE__ */React.createElement(_inputOtp.OTPInput, {
23
- "data-slot": "input-otp",
24
- containerClassName: (0, _utils.cn)("flex items-center gap-2 has-disabled:opacity-50", containerClassName),
25
- className: (0, _utils.cn)("disabled:cursor-not-allowed", className),
26
- ...props
27
- });
28
- }
29
- function InputOTPGroup({
30
- className,
31
- ...props
32
- }) {
33
- return /* @__PURE__ */React.createElement("div", {
34
- "data-slot": "input-otp-group",
35
- className: (0, _utils.cn)("flex items-center", className),
36
- ...props
37
- });
38
- }
39
- function InputOTPSlot({
40
- index,
41
- className,
42
- ...props
43
- }) {
44
- const inputOTPContext = React.useContext(_inputOtp.OTPInputContext);
45
- const {
46
- char,
47
- hasFakeCaret,
48
- isActive
49
- } = inputOTPContext?.slots[index] ?? {};
50
- return /* @__PURE__ */React.createElement("div", {
51
- "data-slot": "input-otp-slot",
52
- "data-active": isActive,
53
- className: (0, _utils.cn)("data-[active=true]:border-ring data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:ring-destructive/20 dark:data-[active=true]:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[active=true]:aria-invalid:border-destructive dark:bg-input/30 border-input relative flex h-9 w-9 items-center justify-center border-y border-r text-sm shadow-xs transition-all outline-none first:rounded-l-md first:border-l last:rounded-r-md data-[active=true]:z-10 data-[active=true]:ring-[3px]", className),
54
- ...props
55
- }, char, hasFakeCaret && /* @__PURE__ */React.createElement("div", {
56
- className: "pointer-events-none absolute inset-0 flex items-center justify-center"
57
- }, /* @__PURE__ */React.createElement("div", {
58
- className: "animate-caret-blink bg-foreground h-4 w-px duration-1000"
59
- })));
60
- }
61
- function InputOTPSeparator({
62
- ...props
63
- }) {
64
- return /* @__PURE__ */React.createElement("div", {
65
- "data-slot": "input-otp-separator",
66
- role: "separator",
67
- ...props
68
- }, /* @__PURE__ */React.createElement(_lucideReact.MinusIcon, null));
69
- }
@@ -1,22 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.Input = Input;
7
- var React = _interopRequireWildcard(require("react"));
8
- var _utils = require("../lib/utils.cjs");
9
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
10
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
11
- function Input({
12
- className,
13
- type,
14
- ...props
15
- }) {
16
- return /* @__PURE__ */React.createElement("input", {
17
- type,
18
- "data-slot": "input",
19
- className: (0, _utils.cn)("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]", "aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive", className),
20
- ...props
21
- });
22
- }