@vkzstudio/muza-ui 1.0.16 → 1.0.18
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/dist/components/Button/buttonVariants.js +1 -1
- package/dist/components/Checkbox/Checkbox.d.ts +4 -0
- package/dist/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/components/Checkbox/Checkbox.js +36 -29
- package/dist/components/Checkbox/Checkbox.stories.d.ts +1 -0
- package/dist/components/Checkbox/Checkbox.stories.d.ts.map +1 -1
- package/dist/components/DatePicker/DatePicker.d.ts +2 -0
- package/dist/components/DatePicker/DatePicker.d.ts.map +1 -1
- package/dist/components/DatePicker/DatePicker.js +33 -31
- package/dist/components/EmptyState/EmptyState.d.ts.map +1 -1
- package/dist/components/EmptyState/EmptyState.js +15 -15
- package/dist/components/FileUpload/FileUpload.d.ts +6 -2
- package/dist/components/FileUpload/FileUpload.d.ts.map +1 -1
- package/dist/components/FileUpload/FileUpload.js +141 -135
- package/dist/components/FileUpload/FileUpload.stories.d.ts +2 -0
- package/dist/components/FileUpload/FileUpload.stories.d.ts.map +1 -1
- package/dist/components/Flex/Flex.d.ts +3 -1
- package/dist/components/Flex/Flex.d.ts.map +1 -1
- package/dist/components/Flex/Flex.js +33 -31
- package/dist/components/FormField/FormField.d.ts +30 -0
- package/dist/components/FormField/FormField.d.ts.map +1 -0
- package/dist/components/FormField/FormField.js +56 -0
- package/dist/components/FormField/InputHint.d.ts +13 -0
- package/dist/components/FormField/InputHint.d.ts.map +1 -0
- package/dist/components/FormField/InputHint.js +26 -0
- package/dist/components/FormField/InputLabel.d.ts +20 -0
- package/dist/components/FormField/InputLabel.d.ts.map +1 -0
- package/dist/components/FormField/InputLabel.js +27 -0
- package/dist/components/FormField/index.d.ts +4 -0
- package/dist/components/FormField/index.d.ts.map +1 -0
- package/dist/components/Input/Input.d.ts.map +1 -1
- package/dist/components/Input/Input.js +79 -94
- package/dist/components/MultiSelect/MultiSelect.d.ts +2 -0
- package/dist/components/MultiSelect/MultiSelect.d.ts.map +1 -1
- package/dist/components/MultiSelect/MultiSelect.js +125 -131
- package/dist/components/Radio/Radio.js +1 -1
- package/dist/components/Reorderable/Reorderable.d.ts +1 -1
- package/dist/components/Reorderable/Reorderable.d.ts.map +1 -1
- package/dist/components/Reorderable/Reorderable.js +47 -45
- package/dist/components/ReorderableTable/ReorderableTable.js +5 -5
- package/dist/components/Select/Select.d.ts +2 -0
- package/dist/components/Select/Select.d.ts.map +1 -1
- package/dist/components/Select/Select.js +126 -131
- package/dist/components/TextEditor/TextEditor.d.ts +4 -0
- package/dist/components/TextEditor/TextEditor.d.ts.map +1 -1
- package/dist/components/TextEditor/TextEditor.js +113 -135
- package/dist/components/Textarea/Textarea.d.ts +4 -0
- package/dist/components/Textarea/Textarea.d.ts.map +1 -1
- package/dist/components/Textarea/Textarea.js +52 -61
- package/dist/components/Textarea/Textarea.stories.d.ts +1 -0
- package/dist/components/Textarea/Textarea.stories.d.ts.map +1 -1
- package/dist/components/TimePicker/TimePicker.d.ts +2 -0
- package/dist/components/TimePicker/TimePicker.d.ts.map +1 -1
- package/dist/muza-ui.css +1 -1
- package/package.json +1 -1
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import * as
|
|
3
|
-
import { cva as
|
|
4
|
-
import { useDropzone as
|
|
5
|
-
import { FileItem as
|
|
6
|
-
import { useMuzaTranslations as
|
|
7
|
-
import { Flex as
|
|
8
|
-
import {
|
|
9
|
-
import { cn as
|
|
10
|
-
import { CloudUploadOutline as
|
|
11
|
-
|
|
1
|
+
import { jsxs as u, jsx as i, Fragment as H } from "react/jsx-runtime";
|
|
2
|
+
import * as M from "react";
|
|
3
|
+
import { cva as T } from "class-variance-authority";
|
|
4
|
+
import { useDropzone as E } from "react-dropzone";
|
|
5
|
+
import { FileItem as C } from "./FileItem.js";
|
|
6
|
+
import { useMuzaTranslations as ee } from "../../translations/TranslationContext.js";
|
|
7
|
+
import { Flex as oe } from "../Flex/Flex.js";
|
|
8
|
+
import { FormField as te } from "../FormField/FormField.js";
|
|
9
|
+
import { cn as P } from "../../utils/cn.js";
|
|
10
|
+
import { CloudUploadOutline as re } from "@solar-icons/react-perf";
|
|
11
|
+
import { Typography as F } from "../Typography/Typography.js";
|
|
12
|
+
const le = T(
|
|
12
13
|
[
|
|
13
14
|
"group relative cursor-pointer rounded-xl border-1 border-dashed transition-colors",
|
|
14
15
|
"p-4xl pt-3xl pr-4xl pb-3xl",
|
|
@@ -44,7 +45,7 @@ const ee = P(
|
|
|
44
45
|
}
|
|
45
46
|
}
|
|
46
47
|
}
|
|
47
|
-
),
|
|
48
|
+
), se = T(
|
|
48
49
|
[
|
|
49
50
|
"text-center transition-colors",
|
|
50
51
|
"text-comp-file-upload-text-dark-secondary"
|
|
@@ -56,161 +57,166 @@ const ee = P(
|
|
|
56
57
|
}
|
|
57
58
|
}
|
|
58
59
|
}
|
|
59
|
-
),
|
|
60
|
+
), ie = M.forwardRef(
|
|
60
61
|
({
|
|
61
62
|
className: S,
|
|
62
|
-
onDrop:
|
|
63
|
+
onDrop: n,
|
|
63
64
|
accept: f,
|
|
64
65
|
multiple: U = !0,
|
|
65
|
-
maxSize:
|
|
66
|
-
maxSizeErrorMessage:
|
|
67
|
-
size:
|
|
68
|
-
disabled:
|
|
69
|
-
readOnly:
|
|
70
|
-
dropzoneOptions:
|
|
71
|
-
label:
|
|
72
|
-
title:
|
|
73
|
-
subtitle:
|
|
74
|
-
preselectedFiles:
|
|
75
|
-
fileStatus:
|
|
76
|
-
itemErrors:
|
|
77
|
-
itemHints:
|
|
78
|
-
error:
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
66
|
+
maxSize: x,
|
|
67
|
+
maxSizeErrorMessage: V,
|
|
68
|
+
size: K = "base",
|
|
69
|
+
disabled: c = !1,
|
|
70
|
+
readOnly: g = !1,
|
|
71
|
+
dropzoneOptions: _,
|
|
72
|
+
label: k,
|
|
73
|
+
title: B,
|
|
74
|
+
subtitle: y,
|
|
75
|
+
preselectedFiles: G = [],
|
|
76
|
+
fileStatus: J = [],
|
|
77
|
+
itemErrors: b,
|
|
78
|
+
itemHints: h,
|
|
79
|
+
error: L,
|
|
80
|
+
required: v,
|
|
81
|
+
disableRequiredAsterisk: O,
|
|
82
|
+
onError: t,
|
|
83
|
+
onDelete: z,
|
|
84
|
+
onChange: p,
|
|
85
|
+
...Q
|
|
86
|
+
}, W) => {
|
|
87
|
+
const m = ee(), [w, $] = M.useState(G), [N, I] = M.useState(!1), X = B ?? m.fileUpload.title, R = x ? m.fileUpload.maxSizeError.replace(
|
|
85
88
|
"{size}",
|
|
86
|
-
(
|
|
87
|
-
) : "",
|
|
88
|
-
onDrop: (
|
|
89
|
+
(x / (1024 * 1024)).toFixed(0)
|
|
90
|
+
) : "", j = V ?? R, { getRootProps: Y, getInputProps: Z, isDragActive: q } = E({
|
|
91
|
+
onDrop: (o, a) => {
|
|
89
92
|
try {
|
|
90
|
-
if (
|
|
93
|
+
if (I(!1), a.length > 0 && a.some(
|
|
91
94
|
(r) => r.errors.some((l) => l.code === "file-too-large")
|
|
92
95
|
)) {
|
|
93
|
-
|
|
94
|
-
const r =
|
|
95
|
-
|
|
96
|
+
I(!0);
|
|
97
|
+
const r = j || R;
|
|
98
|
+
t == null || t(r, a[0].file);
|
|
96
99
|
return;
|
|
97
100
|
}
|
|
98
|
-
|
|
101
|
+
$((e) => {
|
|
99
102
|
const r = new Set(
|
|
100
103
|
e.map((s) => `${s.name}-${s.size}-${s.lastModified}`)
|
|
101
|
-
), l =
|
|
104
|
+
), l = o.filter(
|
|
102
105
|
(s) => !r.has(`${s.name}-${s.size}-${s.lastModified}`)
|
|
103
106
|
), d = [...e, ...l];
|
|
104
|
-
return
|
|
105
|
-
}),
|
|
107
|
+
return p == null || p(d), d;
|
|
108
|
+
}), n == null || n(o);
|
|
106
109
|
} catch (e) {
|
|
107
|
-
const r = e instanceof Error ? e.message :
|
|
108
|
-
|
|
110
|
+
const r = e instanceof Error ? e.message : m.fileUpload.processingError;
|
|
111
|
+
t == null || t(r);
|
|
109
112
|
}
|
|
110
113
|
},
|
|
111
|
-
accept: typeof f == "string" ? { [f]: [] } : f ? Object.fromEntries(f.map((
|
|
114
|
+
accept: typeof f == "string" ? { [f]: [] } : f ? Object.fromEntries(f.map((o) => [o, []])) : void 0,
|
|
112
115
|
multiple: U,
|
|
113
|
-
maxSize:
|
|
114
|
-
disabled:
|
|
115
|
-
...
|
|
116
|
-
}),
|
|
117
|
-
return /* @__PURE__ */
|
|
118
|
-
!
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
116
|
+
maxSize: x,
|
|
117
|
+
disabled: c,
|
|
118
|
+
..._
|
|
119
|
+
}), A = g || !U && w.length > 0;
|
|
120
|
+
return /* @__PURE__ */ u(oe, { direction: "column", gap: "lg", children: [
|
|
121
|
+
(!A || k) && /* @__PURE__ */ i(
|
|
122
|
+
te,
|
|
123
|
+
{
|
|
124
|
+
label: k,
|
|
125
|
+
required: v,
|
|
126
|
+
disableRequiredAsterisk: O,
|
|
127
|
+
children: !A && /* @__PURE__ */ u(H, { children: [
|
|
128
|
+
/* @__PURE__ */ u(
|
|
129
|
+
"div",
|
|
130
|
+
{
|
|
131
|
+
ref: W,
|
|
132
|
+
tabIndex: c ? void 0 : 0,
|
|
133
|
+
className: P(
|
|
134
|
+
le({
|
|
135
|
+
error: L || N,
|
|
136
|
+
disabled: c,
|
|
137
|
+
className: S,
|
|
138
|
+
isDragActive: q
|
|
139
|
+
})
|
|
140
|
+
),
|
|
141
|
+
...Y(),
|
|
142
|
+
...Q,
|
|
143
|
+
children: [
|
|
144
|
+
/* @__PURE__ */ i(
|
|
145
|
+
"input",
|
|
146
|
+
{
|
|
147
|
+
...Z({ required: v }),
|
|
148
|
+
"aria-required": v
|
|
149
|
+
}
|
|
150
|
+
),
|
|
151
|
+
/* @__PURE__ */ i(re, { className: "inline size-comp-file-upload-ico-size" }),
|
|
152
|
+
/* @__PURE__ */ u("div", { children: [
|
|
153
|
+
/* @__PURE__ */ i(F, { size: "base", component: "p", weight: "medium", children: X }),
|
|
154
|
+
y && /* @__PURE__ */ i(
|
|
155
|
+
F,
|
|
156
|
+
{
|
|
157
|
+
size: "sm",
|
|
158
|
+
component: "p",
|
|
159
|
+
weight: "regular",
|
|
160
|
+
className: P(
|
|
161
|
+
se({
|
|
162
|
+
disabled: c,
|
|
163
|
+
className: S
|
|
164
|
+
})
|
|
165
|
+
),
|
|
166
|
+
children: y
|
|
167
|
+
}
|
|
168
|
+
)
|
|
169
|
+
] })
|
|
170
|
+
]
|
|
171
|
+
}
|
|
142
172
|
),
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
),
|
|
162
|
-
children: k
|
|
163
|
-
}
|
|
164
|
-
)
|
|
165
|
-
] })
|
|
166
|
-
]
|
|
167
|
-
}
|
|
168
|
-
),
|
|
169
|
-
N && /* @__PURE__ */ i(
|
|
170
|
-
x,
|
|
171
|
-
{
|
|
172
|
-
size: "sm",
|
|
173
|
-
variant: "body",
|
|
174
|
-
component: "p",
|
|
175
|
-
weight: "regular",
|
|
176
|
-
className: "text-comp-file-upload-text-error-def",
|
|
177
|
-
children: R
|
|
178
|
-
}
|
|
179
|
-
)
|
|
180
|
-
] }),
|
|
181
|
-
/* @__PURE__ */ i("ul", { className: "flex flex-col gap-md", children: w.map((t, a) => {
|
|
182
|
-
const e = B[a], r = e == null ? void 0 : e.uploaded;
|
|
183
|
-
return h && !r ? null : /* @__PURE__ */ i(
|
|
184
|
-
H,
|
|
173
|
+
N && /* @__PURE__ */ i(
|
|
174
|
+
F,
|
|
175
|
+
{
|
|
176
|
+
size: "sm",
|
|
177
|
+
variant: "body",
|
|
178
|
+
component: "p",
|
|
179
|
+
weight: "regular",
|
|
180
|
+
className: "text-comp-file-upload-text-error-def",
|
|
181
|
+
children: j
|
|
182
|
+
}
|
|
183
|
+
)
|
|
184
|
+
] })
|
|
185
|
+
}
|
|
186
|
+
),
|
|
187
|
+
/* @__PURE__ */ i("ul", { className: "flex flex-col gap-md", children: w.map((o, a) => {
|
|
188
|
+
const e = J[a], r = e == null ? void 0 : e.uploaded;
|
|
189
|
+
return g && !r ? null : /* @__PURE__ */ i(
|
|
190
|
+
C,
|
|
185
191
|
{
|
|
186
|
-
file:
|
|
192
|
+
file: o,
|
|
187
193
|
uploaded: r,
|
|
188
194
|
progress: e == null ? void 0 : e.progress,
|
|
189
|
-
disabled:
|
|
190
|
-
readOnly:
|
|
191
|
-
error:
|
|
192
|
-
note:
|
|
193
|
-
onError:
|
|
194
|
-
size:
|
|
195
|
+
disabled: c,
|
|
196
|
+
readOnly: g,
|
|
197
|
+
error: b == null ? void 0 : b.get(o),
|
|
198
|
+
note: h == null ? void 0 : h.get(o),
|
|
199
|
+
onError: t,
|
|
200
|
+
size: K,
|
|
195
201
|
onDelete: () => {
|
|
196
202
|
try {
|
|
197
|
-
|
|
198
|
-
const d = l.filter((s,
|
|
199
|
-
return
|
|
200
|
-
}),
|
|
203
|
+
$((l) => {
|
|
204
|
+
const d = l.filter((s, D) => D !== a);
|
|
205
|
+
return p == null || p(d), d;
|
|
206
|
+
}), z == null || z(o, a);
|
|
201
207
|
} catch (l) {
|
|
202
|
-
const d = l instanceof Error ? l.message :
|
|
203
|
-
|
|
208
|
+
const d = l instanceof Error ? l.message : m.fileUpload.deleteError;
|
|
209
|
+
t == null || t(d, o);
|
|
204
210
|
}
|
|
205
211
|
}
|
|
206
212
|
},
|
|
207
|
-
|
|
213
|
+
o.name
|
|
208
214
|
);
|
|
209
215
|
}) })
|
|
210
216
|
] });
|
|
211
217
|
}
|
|
212
218
|
);
|
|
213
|
-
|
|
219
|
+
ie.displayName = "FileUpload";
|
|
214
220
|
export {
|
|
215
|
-
|
|
221
|
+
ie as FileUpload
|
|
216
222
|
};
|
|
@@ -4,11 +4,13 @@ declare const meta: Meta<typeof FileUpload>;
|
|
|
4
4
|
export default meta;
|
|
5
5
|
type Story = StoryObj<typeof meta>;
|
|
6
6
|
export declare const Default: Story;
|
|
7
|
+
export declare const Required: Story;
|
|
7
8
|
export declare const Error: Story;
|
|
8
9
|
export declare const ErrorWithUploadedFiles: Story;
|
|
9
10
|
export declare const UploadInProgress: Story;
|
|
10
11
|
export declare const UploadedFiles: Story;
|
|
11
12
|
export declare const SingleFile: Story;
|
|
13
|
+
export declare const SingleFileWithLabel: Story;
|
|
12
14
|
export declare const ImagesOnly: Story;
|
|
13
15
|
export declare const WithSizeLimit: Story;
|
|
14
16
|
export declare const Disabled: Story;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileUpload.stories.d.ts","sourceRoot":"","sources":["../../../src/components/FileUpload/FileUpload.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAE3D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAEzC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,UAAU,
|
|
1
|
+
{"version":3,"file":"FileUpload.stories.d.ts","sourceRoot":"","sources":["../../../src/components/FileUpload/FileUpload.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAE3D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAEzC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,UAAU,CAkKjC,CAAA;AAED,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAA;AAElC,eAAO,MAAM,OAAO,EAAE,KAerB,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,KAgBtB,CAAA;AAED,eAAO,MAAM,KAAK,EAAE,KAmBnB,CAAA;AAED,eAAO,MAAM,sBAAsB,EAAE,KAoBpC,CAAA;AAED,eAAO,MAAM,gBAAgB,EAAE,KAsB9B,CAAA;AAED,eAAO,MAAM,aAAa,EAAE,KAkB3B,CAAA;AAED,eAAO,MAAM,UAAU,EAAE,KAiBxB,CAAA;AAED,eAAO,MAAM,mBAAmB,EAAE,KAqBjC,CAAA;AAED,eAAO,MAAM,UAAU,EAAE,KAexB,CAAA;AAED,eAAO,MAAM,aAAa,EAAE,KAiB3B,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,KAmBtB,CAAA;AAED,eAAO,MAAM,kBAAkB,EAAE,KA0ChC,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,KAoBtB,CAAA;AAED,eAAO,MAAM,gBAAgB,EAAE,KA0F9B,CAAA"}
|
|
@@ -37,6 +37,8 @@ export interface FlexProps extends Omit<VariantProps<typeof flexVariants>, 'gap'
|
|
|
37
37
|
component?: HTMLElementTag;
|
|
38
38
|
/** Additional CSS classes for custom styling. */
|
|
39
39
|
className?: string;
|
|
40
|
+
/** Inline styles for escape-hatch customizations not covered by tokens. */
|
|
41
|
+
style?: React.CSSProperties;
|
|
40
42
|
/** Sets the main axis direction for flex items. @default 'row' */
|
|
41
43
|
direction?: 'row' | 'column' | 'row-reverse' | 'column-reverse';
|
|
42
44
|
/** Controls whether flex items wrap to multiple lines. @default 'nowrap' */
|
|
@@ -79,6 +81,6 @@ export interface FlexProps extends Omit<VariantProps<typeof flexVariants>, 'gap'
|
|
|
79
81
|
*/
|
|
80
82
|
margin?: SpacingProps['margin'];
|
|
81
83
|
}
|
|
82
|
-
declare const Flex: ({ children, className, direction, wrap, justify, align, flex, gap, padding, margin, component, ...props }: FlexProps) => import("react/jsx-runtime").JSX.Element;
|
|
84
|
+
declare const Flex: ({ children, className, style, direction, wrap, justify, align, flex, gap, padding, margin, component, ...props }: FlexProps) => import("react/jsx-runtime").JSX.Element;
|
|
83
85
|
export { Flex, flexVariants };
|
|
84
86
|
//# sourceMappingURL=Flex.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Flex.d.ts","sourceRoot":"","sources":["../../../src/components/Flex/Flex.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,KAAK,YAAY,EAAO,MAAM,0BAA0B,CAAA;AAEjE,OAAO,EACL,KAAK,YAAY,EAGlB,MAAM,iBAAiB,CAAA;AAExB,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;8EA+CjB,CAAA;AAED,KAAK,cAAc,GAAG,MAAM,KAAK,CAAC,GAAG,CAAC,iBAAiB,GACrD,MAAM,qBAAqB,CAAA;AAE7B;;;GAGG;AACH,MAAM,WAAW,SACf,SAAQ,IAAI,CACR,YAAY,CAAC,OAAO,YAAY,CAAC,EAC/B,KAAK,GACL,MAAM,GACN,MAAM,GACN,GAAG,GACH,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,GAAG,GACH,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,WAAW,GACX,MAAM,GACN,SAAS,GACT,OAAO,GACP,MAAM,CACT,EACD,YAAY;IACd,oDAAoD;IACpD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;I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IACH,MAAM,CAAC,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAA;CAChC;AAED,QAAA,MAAM,IAAI,GAAI,kHAcX,SAAS,4CAwBX,CAAA;AAED,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as w } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import { cva as
|
|
4
|
-
import { getSpacingVariants as
|
|
5
|
-
import { cn as
|
|
6
|
-
const
|
|
3
|
+
import { cva as v } from "class-variance-authority";
|
|
4
|
+
import { getSpacingVariants as d, spacingVariantDefinitions as y } from "../../utils/spacing.js";
|
|
5
|
+
import { cn as j } from "../../utils/cn.js";
|
|
6
|
+
const g = v(
|
|
7
7
|
// Base classes
|
|
8
8
|
"flex",
|
|
9
9
|
{
|
|
@@ -41,7 +41,7 @@ const j = w(
|
|
|
41
41
|
initial: "flex-initial",
|
|
42
42
|
none: "flex-none"
|
|
43
43
|
},
|
|
44
|
-
...
|
|
44
|
+
...y
|
|
45
45
|
},
|
|
46
46
|
defaultVariants: {
|
|
47
47
|
direction: "row",
|
|
@@ -50,41 +50,43 @@ const j = w(
|
|
|
50
50
|
align: "stretch"
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
|
-
),
|
|
53
|
+
), F = ({
|
|
54
54
|
children: e,
|
|
55
55
|
className: t,
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
56
|
+
style: r,
|
|
57
|
+
direction: n,
|
|
58
|
+
wrap: i,
|
|
59
|
+
justify: s,
|
|
60
|
+
align: a,
|
|
61
|
+
flex: o,
|
|
62
|
+
gap: f,
|
|
63
|
+
padding: l,
|
|
64
|
+
margin: c,
|
|
65
|
+
component: p = "div",
|
|
66
|
+
...m
|
|
66
67
|
}) => {
|
|
67
|
-
const
|
|
68
|
-
return /* @__PURE__ */
|
|
69
|
-
|
|
68
|
+
const u = p ?? "div", x = d({ gap: f, padding: l, margin: c });
|
|
69
|
+
return /* @__PURE__ */ w(
|
|
70
|
+
u,
|
|
70
71
|
{
|
|
71
|
-
className:
|
|
72
|
-
|
|
73
|
-
direction:
|
|
74
|
-
wrap:
|
|
75
|
-
justify:
|
|
76
|
-
align:
|
|
77
|
-
flex:
|
|
78
|
-
...
|
|
72
|
+
className: j(
|
|
73
|
+
g({
|
|
74
|
+
direction: n,
|
|
75
|
+
wrap: i,
|
|
76
|
+
justify: s,
|
|
77
|
+
align: a,
|
|
78
|
+
flex: o,
|
|
79
|
+
...x
|
|
79
80
|
}),
|
|
80
81
|
t
|
|
81
82
|
),
|
|
82
|
-
|
|
83
|
+
style: r,
|
|
84
|
+
...m,
|
|
83
85
|
children: e
|
|
84
86
|
}
|
|
85
87
|
);
|
|
86
88
|
};
|
|
87
89
|
export {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
+
F as Flex,
|
|
91
|
+
g as flexVariants
|
|
90
92
|
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface FormFieldProps {
|
|
3
|
+
/** The form control element (input, textarea, select trigger, etc.). */
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
/** Label text displayed above the control. */
|
|
6
|
+
label?: string;
|
|
7
|
+
/** Helper or error text displayed below the control. */
|
|
8
|
+
hint?: string;
|
|
9
|
+
/** Renders the hint in an error color when true. */
|
|
10
|
+
error?: boolean;
|
|
11
|
+
/** Displays a red asterisk in the label when true. */
|
|
12
|
+
required?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Hides the required asterisk (*) even when `required` is true.
|
|
15
|
+
* @default false
|
|
16
|
+
*/
|
|
17
|
+
disableRequiredAsterisk?: boolean;
|
|
18
|
+
/** Associates the label with a form element by ID. */
|
|
19
|
+
htmlFor?: string;
|
|
20
|
+
/** ID for the label element (used with `aria-labelledby`). */
|
|
21
|
+
labelId?: string;
|
|
22
|
+
/** ID for the hint element (used with `aria-describedby`). */
|
|
23
|
+
hintId?: string;
|
|
24
|
+
/** Extra content rendered inline next to the label (e.g. a tooltip icon). */
|
|
25
|
+
labelExtra?: ReactNode;
|
|
26
|
+
/** Additional CSS classes for the outer wrapper. */
|
|
27
|
+
className?: string;
|
|
28
|
+
}
|
|
29
|
+
export declare const FormField: import('react').ForwardRefExoticComponent<FormFieldProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
30
|
+
//# sourceMappingURL=FormField.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormField.d.ts","sourceRoot":"","sources":["../../../src/components/FormField/FormField.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAc,MAAM,OAAO,CAAA;AAKlD,MAAM,WAAW,cAAc;IAC7B,wEAAwE;IACxE,QAAQ,EAAE,SAAS,CAAA;IACnB,8CAA8C;IAC9C,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,wDAAwD;IACxD,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,oDAAoD;IACpD,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,sDAAsD;IACtD,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;;OAGG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAA;IACjC,sDAAsD;IACtD,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,8DAA8D;IAC9D,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,8DAA8D;IAC9D,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,6EAA6E;IAC7E,UAAU,CAAC,EAAE,SAAS,CAAA;IACtB,oDAAoD;IACpD,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,eAAO,MAAM,SAAS,2GAoDrB,CAAA"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { jsxs as f, jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as g } from "react";
|
|
3
|
+
import { InputHint as h } from "./InputHint.js";
|
|
4
|
+
import { InputLabel as e } from "./InputLabel.js";
|
|
5
|
+
import { cn as F } from "../../utils/cn.js";
|
|
6
|
+
const N = g(
|
|
7
|
+
({
|
|
8
|
+
children: t,
|
|
9
|
+
label: i,
|
|
10
|
+
hint: o,
|
|
11
|
+
error: s,
|
|
12
|
+
required: r,
|
|
13
|
+
disableRequiredAsterisk: p,
|
|
14
|
+
htmlFor: c,
|
|
15
|
+
labelId: n,
|
|
16
|
+
hintId: x,
|
|
17
|
+
labelExtra: d,
|
|
18
|
+
className: a
|
|
19
|
+
}, l) => /* @__PURE__ */ f(
|
|
20
|
+
"div",
|
|
21
|
+
{
|
|
22
|
+
ref: l,
|
|
23
|
+
className: F("flex flex-col gap-comp-input-gap", a),
|
|
24
|
+
children: [
|
|
25
|
+
i && (d ? /* @__PURE__ */ f("div", { className: "flex items-center gap-2xs", children: [
|
|
26
|
+
/* @__PURE__ */ m(
|
|
27
|
+
e,
|
|
28
|
+
{
|
|
29
|
+
htmlFor: c,
|
|
30
|
+
id: n,
|
|
31
|
+
required: r,
|
|
32
|
+
disableRequiredAsterisk: p,
|
|
33
|
+
children: i
|
|
34
|
+
}
|
|
35
|
+
),
|
|
36
|
+
d
|
|
37
|
+
] }) : /* @__PURE__ */ m(
|
|
38
|
+
e,
|
|
39
|
+
{
|
|
40
|
+
htmlFor: c,
|
|
41
|
+
id: n,
|
|
42
|
+
required: r,
|
|
43
|
+
disableRequiredAsterisk: p,
|
|
44
|
+
children: i
|
|
45
|
+
}
|
|
46
|
+
)),
|
|
47
|
+
t,
|
|
48
|
+
o && /* @__PURE__ */ m(h, { error: s, id: x, children: o })
|
|
49
|
+
]
|
|
50
|
+
}
|
|
51
|
+
)
|
|
52
|
+
);
|
|
53
|
+
N.displayName = "FormField";
|
|
54
|
+
export {
|
|
55
|
+
N as FormField
|
|
56
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface InputHintProps {
|
|
3
|
+
/** Hint or error message content. */
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
/** When true, renders the hint in an error color. */
|
|
6
|
+
error?: boolean;
|
|
7
|
+
/** ID for the hint element (used with `aria-describedby`). */
|
|
8
|
+
id?: string;
|
|
9
|
+
/** Additional CSS classes for the hint element. */
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare const InputHint: ({ children, error, id, className, }: InputHintProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
//# sourceMappingURL=InputHint.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InputHint.d.ts","sourceRoot":"","sources":["../../../src/components/FormField/InputHint.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAItC,MAAM,WAAW,cAAc;IAC7B,qCAAqC;IACrC,QAAQ,EAAE,SAAS,CAAA;IACnB,qDAAqD;IACrD,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,8DAA8D;IAC9D,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,mDAAmD;IACnD,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,eAAO,MAAM,SAAS,GAAI,qCAKvB,cAAc,4CAchB,CAAA"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { Typography as m } from "../Typography/Typography.js";
|
|
3
|
+
import { cn as n } from "../../utils/cn.js";
|
|
4
|
+
const a = ({
|
|
5
|
+
children: t,
|
|
6
|
+
error: o,
|
|
7
|
+
id: r,
|
|
8
|
+
className: p
|
|
9
|
+
}) => /* @__PURE__ */ e(
|
|
10
|
+
m,
|
|
11
|
+
{
|
|
12
|
+
component: "span",
|
|
13
|
+
size: "sm",
|
|
14
|
+
weight: "regular",
|
|
15
|
+
className: n(
|
|
16
|
+
"text-comp-input-text-secondary",
|
|
17
|
+
{ "text-comp-input-text-error": o },
|
|
18
|
+
p
|
|
19
|
+
),
|
|
20
|
+
id: r,
|
|
21
|
+
children: t
|
|
22
|
+
}
|
|
23
|
+
);
|
|
24
|
+
export {
|
|
25
|
+
a as InputHint
|
|
26
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface InputLabelProps {
|
|
3
|
+
/** Label text content. */
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
/** Associates the label with a form element by ID. */
|
|
6
|
+
htmlFor?: string;
|
|
7
|
+
/** ID for the label element itself (used with `aria-labelledby`). */
|
|
8
|
+
id?: string;
|
|
9
|
+
/** When true, displays a red asterisk after the label text. */
|
|
10
|
+
required?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Hides the required asterisk (*) even when `required` is true.
|
|
13
|
+
* @default false
|
|
14
|
+
*/
|
|
15
|
+
disableRequiredAsterisk?: boolean;
|
|
16
|
+
/** Additional CSS classes for the label element. */
|
|
17
|
+
className?: string;
|
|
18
|
+
}
|
|
19
|
+
export declare const InputLabel: ({ children, htmlFor, id, required, disableRequiredAsterisk, className, }: InputLabelProps) => import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
//# sourceMappingURL=InputLabel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InputLabel.d.ts","sourceRoot":"","sources":["../../../src/components/FormField/InputLabel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGtC,MAAM,WAAW,eAAe;IAC9B,0BAA0B;IAC1B,QAAQ,EAAE,SAAS,CAAA;IACnB,sDAAsD;IACtD,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,qEAAqE;IACrE,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,+DAA+D;IAC/D,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;;OAGG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAA;IACjC,oDAAoD;IACpD,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,eAAO,MAAM,UAAU,GAAI,0EAOxB,eAAe,4CAcjB,CAAA"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsxs as m, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { Typography as a } from "../Typography/Typography.js";
|
|
3
|
+
const c = ({
|
|
4
|
+
children: e,
|
|
5
|
+
htmlFor: r,
|
|
6
|
+
id: t,
|
|
7
|
+
required: o,
|
|
8
|
+
disableRequiredAsterisk: p,
|
|
9
|
+
className: s
|
|
10
|
+
}) => /* @__PURE__ */ m(
|
|
11
|
+
a,
|
|
12
|
+
{
|
|
13
|
+
component: "label",
|
|
14
|
+
weight: "regular",
|
|
15
|
+
size: "sm",
|
|
16
|
+
htmlFor: r,
|
|
17
|
+
id: t,
|
|
18
|
+
className: s,
|
|
19
|
+
children: [
|
|
20
|
+
e,
|
|
21
|
+
o && !p && /* @__PURE__ */ n("span", { className: "text-comp-input-text-error", children: " *" })
|
|
22
|
+
]
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
export {
|
|
26
|
+
c as InputLabel
|
|
27
|
+
};
|