@simple-builder/react 1.0.2 → 1.0.4
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/{build-container-client-LHGW2FFR.js → build-container-client-PDM3LRIQ.js} +380 -412
- package/dist/build-container-client-QJL5MQR6.css +1123 -0
- package/dist/{build-container-client-SL4TZBOD.mjs → build-container-client-Y55WZE6M.mjs} +338 -364
- package/dist/{builder-content-FCQHSHSY.mjs → builder-content-GELONUMY.mjs} +2 -3
- package/dist/{builder-content-66LHSBUX.js → builder-content-QNCUQJUB.js} +7 -8
- package/dist/builder-content-YW6SKGMM.css +1123 -0
- package/dist/chunk-BSE6WW6Q.mjs +115 -0
- package/dist/{chunk-BXL6F5AB.mjs → chunk-EQMVGJ6X.mjs} +2 -35
- package/dist/chunk-J36K7WVK.js +145 -0
- package/dist/{chunk-5ZDNACOH.js → chunk-KOBGFPWB.js} +16 -12
- package/dist/chunk-NP2NHVJP.mjs +20 -0
- package/dist/{chunk-3S4FFEHM.js → chunk-XEMUNFCV.js} +5 -40
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +12 -40
- package/dist/index.mjs +2 -22
- package/package.json +11 -11
- package/dist/chunk-7K7IGTF3.mjs +0 -40
- package/dist/chunk-NROQCSBF.mjs +0 -16
- package/dist/chunk-VMHWPKU4.js +0 -42
|
@@ -1,27 +1,24 @@
|
|
|
1
|
+
'use client';
|
|
1
2
|
'use strict';
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var React15 = require('react');
|
|
4
|
+
require('./chunk-KOBGFPWB.js');
|
|
5
|
+
var chunkXEMUNFCV_js = require('./chunk-XEMUNFCV.js');
|
|
6
|
+
var chunkJ36K7WVK_js = require('./chunk-J36K7WVK.js');
|
|
7
|
+
var React12 = require('react');
|
|
8
8
|
var lucideReact = require('lucide-react');
|
|
9
|
+
var AlertDialogPrimitive = require('@radix-ui/react-alert-dialog');
|
|
10
|
+
var PopoverPrimitive = require('@radix-ui/react-popover');
|
|
9
11
|
var zod$1 = require('@hookform/resolvers/zod');
|
|
10
|
-
var dateFns = require('date-fns');
|
|
11
12
|
var reactHookForm = require('react-hook-form');
|
|
12
13
|
var zod = require('zod');
|
|
13
|
-
var AlertDialogPrimitive = require('@radix-ui/react-alert-dialog');
|
|
14
14
|
var reactSlot = require('@radix-ui/react-slot');
|
|
15
15
|
var LabelPrimitive = require('@radix-ui/react-label');
|
|
16
16
|
var classVarianceAuthority = require('class-variance-authority');
|
|
17
|
-
var PopoverPrimitive = require('@radix-ui/react-popover');
|
|
18
17
|
var TabsPrimitive = require('@radix-ui/react-tabs');
|
|
19
|
-
var NextImage = require('next/image');
|
|
20
|
-
var reactDayPicker = require('react-day-picker');
|
|
21
18
|
var SwitchPrimitives = require('@radix-ui/react-switch');
|
|
22
19
|
var TogglePrimitive = require('@radix-ui/react-toggle');
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
var dateFns = require('date-fns');
|
|
21
|
+
var reactDayPicker = require('react-day-picker');
|
|
25
22
|
|
|
26
23
|
function _interopNamespace(e) {
|
|
27
24
|
if (e && e.__esModule) return e;
|
|
@@ -41,22 +38,21 @@ function _interopNamespace(e) {
|
|
|
41
38
|
return Object.freeze(n);
|
|
42
39
|
}
|
|
43
40
|
|
|
44
|
-
var
|
|
41
|
+
var React12__namespace = /*#__PURE__*/_interopNamespace(React12);
|
|
45
42
|
var AlertDialogPrimitive__namespace = /*#__PURE__*/_interopNamespace(AlertDialogPrimitive);
|
|
46
|
-
var LabelPrimitive__namespace = /*#__PURE__*/_interopNamespace(LabelPrimitive);
|
|
47
43
|
var PopoverPrimitive__namespace = /*#__PURE__*/_interopNamespace(PopoverPrimitive);
|
|
44
|
+
var LabelPrimitive__namespace = /*#__PURE__*/_interopNamespace(LabelPrimitive);
|
|
48
45
|
var TabsPrimitive__namespace = /*#__PURE__*/_interopNamespace(TabsPrimitive);
|
|
49
|
-
var NextImage__default = /*#__PURE__*/_interopDefault(NextImage);
|
|
50
46
|
var SwitchPrimitives__namespace = /*#__PURE__*/_interopNamespace(SwitchPrimitives);
|
|
51
47
|
var TogglePrimitive__namespace = /*#__PURE__*/_interopNamespace(TogglePrimitive);
|
|
52
48
|
|
|
53
49
|
var AlertDialog = AlertDialogPrimitive__namespace.Root;
|
|
54
50
|
var AlertDialogTrigger = AlertDialogPrimitive__namespace.Trigger;
|
|
55
51
|
var AlertDialogPortal = AlertDialogPrimitive__namespace.Portal;
|
|
56
|
-
var AlertDialogOverlay =
|
|
52
|
+
var AlertDialogOverlay = React12__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React12__namespace.createElement(
|
|
57
53
|
AlertDialogPrimitive__namespace.Overlay,
|
|
58
54
|
{
|
|
59
|
-
className:
|
|
55
|
+
className: chunkJ36K7WVK_js.cn(
|
|
60
56
|
"sb-fixed sb-inset-0 sb-z-50 sb-bg-background/80 sb-backdrop-blur-sm data-[state=open]:sb-animate-in data-[state=closed]:sb-animate-out data-[state=closed]:sb-fade-out-0 data-[state=open]:sb-fade-in-0",
|
|
61
57
|
className
|
|
62
58
|
),
|
|
@@ -65,11 +61,11 @@ var AlertDialogOverlay = React15__namespace.forwardRef(({ className, ...props },
|
|
|
65
61
|
}
|
|
66
62
|
));
|
|
67
63
|
AlertDialogOverlay.displayName = AlertDialogPrimitive__namespace.Overlay.displayName;
|
|
68
|
-
var AlertDialogContent =
|
|
64
|
+
var AlertDialogContent = React12__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React12__namespace.createElement(AlertDialogPortal, null, /* @__PURE__ */ React12__namespace.createElement(AlertDialogOverlay, null), /* @__PURE__ */ React12__namespace.createElement(
|
|
69
65
|
AlertDialogPrimitive__namespace.Content,
|
|
70
66
|
{
|
|
71
67
|
ref,
|
|
72
|
-
className:
|
|
68
|
+
className: chunkJ36K7WVK_js.cn(
|
|
73
69
|
"sb-fixed sb-font-roboto sb-left-[50%] sb-top-[50%] sb-z-50 sb-grid sb-w-full sb-max-w-lg sb-translate-x-[-50%] sb-translate-y-[-50%] sb-gap-4 sb-border sb-bg-background sb-p-6 sb-shadow-lg sb-duration-200 data-[state=open]:sb-animate-in data-[state=closed]:sb-animate-out data-[state=closed]:sb-fade-out-0 data-[state=open]:sb-fade-in-0 data-[state=closed]:sb-zoom-out-95 data-[state=open]:sb-zoom-in-95 data-[state=closed]:sb-slide-out-to-left-1/2 data-[state=closed]:sb-slide-out-to-top-[48%] data-[state=open]:sb-slide-in-from-left-1/2 data-[state=open]:sb-slide-in-from-top-[48%] sm:sb-rounded-lg",
|
|
74
70
|
className
|
|
75
71
|
),
|
|
@@ -80,10 +76,10 @@ AlertDialogContent.displayName = AlertDialogPrimitive__namespace.Content.display
|
|
|
80
76
|
var AlertDialogFooter = ({
|
|
81
77
|
className,
|
|
82
78
|
...props
|
|
83
|
-
}) => /* @__PURE__ */
|
|
79
|
+
}) => /* @__PURE__ */ React12__namespace.createElement(
|
|
84
80
|
"div",
|
|
85
81
|
{
|
|
86
|
-
className:
|
|
82
|
+
className: chunkJ36K7WVK_js.cn(
|
|
87
83
|
"sb-flex sb-flex-col-reverse sm:sb-flex-row sm:sb-justify-end sm:sb-space-x-2",
|
|
88
84
|
className
|
|
89
85
|
),
|
|
@@ -91,39 +87,39 @@ var AlertDialogFooter = ({
|
|
|
91
87
|
}
|
|
92
88
|
);
|
|
93
89
|
AlertDialogFooter.displayName = "AlertDialogFooter";
|
|
94
|
-
var AlertDialogTitle =
|
|
90
|
+
var AlertDialogTitle = React12__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React12__namespace.createElement(
|
|
95
91
|
AlertDialogPrimitive__namespace.Title,
|
|
96
92
|
{
|
|
97
93
|
ref,
|
|
98
|
-
className:
|
|
94
|
+
className: chunkJ36K7WVK_js.cn("sb-text-lg sb-font-semibold", className),
|
|
99
95
|
...props
|
|
100
96
|
}
|
|
101
97
|
));
|
|
102
98
|
AlertDialogTitle.displayName = AlertDialogPrimitive__namespace.Title.displayName;
|
|
103
|
-
var AlertDialogDescription =
|
|
99
|
+
var AlertDialogDescription = React12__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React12__namespace.createElement(
|
|
104
100
|
AlertDialogPrimitive__namespace.Description,
|
|
105
101
|
{
|
|
106
102
|
ref,
|
|
107
|
-
className:
|
|
103
|
+
className: chunkJ36K7WVK_js.cn("sb-text-sm sb-text-muted-foreground", className),
|
|
108
104
|
...props
|
|
109
105
|
}
|
|
110
106
|
));
|
|
111
107
|
AlertDialogDescription.displayName = AlertDialogPrimitive__namespace.Description.displayName;
|
|
112
|
-
var AlertDialogAction =
|
|
108
|
+
var AlertDialogAction = React12__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React12__namespace.createElement(
|
|
113
109
|
AlertDialogPrimitive__namespace.Action,
|
|
114
110
|
{
|
|
115
111
|
ref,
|
|
116
|
-
className:
|
|
112
|
+
className: chunkJ36K7WVK_js.cn(chunkXEMUNFCV_js.buttonVariants(), className),
|
|
117
113
|
...props
|
|
118
114
|
}
|
|
119
115
|
));
|
|
120
116
|
AlertDialogAction.displayName = AlertDialogPrimitive__namespace.Action.displayName;
|
|
121
|
-
var AlertDialogCancel =
|
|
117
|
+
var AlertDialogCancel = React12__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React12__namespace.createElement(
|
|
122
118
|
AlertDialogPrimitive__namespace.Cancel,
|
|
123
119
|
{
|
|
124
120
|
ref,
|
|
125
|
-
className:
|
|
126
|
-
|
|
121
|
+
className: chunkJ36K7WVK_js.cn(
|
|
122
|
+
chunkXEMUNFCV_js.buttonVariants({ variant: "outline" }),
|
|
127
123
|
"sb-mt-2 sm:sb-mt-0",
|
|
128
124
|
className
|
|
129
125
|
),
|
|
@@ -131,14 +127,31 @@ var AlertDialogCancel = React15__namespace.forwardRef(({ className, ...props },
|
|
|
131
127
|
}
|
|
132
128
|
));
|
|
133
129
|
AlertDialogCancel.displayName = AlertDialogPrimitive__namespace.Cancel.displayName;
|
|
130
|
+
var Popover = PopoverPrimitive__namespace.Root;
|
|
131
|
+
var PopoverTrigger = PopoverPrimitive__namespace.Trigger;
|
|
132
|
+
var PopoverClose = PopoverPrimitive__namespace.Close;
|
|
133
|
+
var PopoverContent = React12__namespace.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ React12__namespace.createElement(PopoverPrimitive__namespace.Portal, null, /* @__PURE__ */ React12__namespace.createElement(
|
|
134
|
+
PopoverPrimitive__namespace.Content,
|
|
135
|
+
{
|
|
136
|
+
ref,
|
|
137
|
+
align,
|
|
138
|
+
sideOffset,
|
|
139
|
+
className: chunkJ36K7WVK_js.cn(
|
|
140
|
+
"sb-z-50 sb-w-72 sb-font-roboto sb-rounded-md sb-border sb-bg-popover sb-p-4 sb-text-popover-foreground sb-shadow-md sb-outline-none data-[state=open]:sb-animate-in data-[state=closed]:sb-animate-out data-[state=closed]:sb-fade-out-0 data-[state=open]:sb-fade-in-0 data-[state=closed]:sb-zoom-out-95 data-[state=open]:sb-zoom-in-95 data-[side=bottom]:sb-slide-in-from-top-2 data-[side=left]:sb-slide-in-from-right-2 data-[side=right]:sb-slide-in-from-left-2 data-[side=top]:sb-slide-in-from-bottom-2",
|
|
141
|
+
className
|
|
142
|
+
),
|
|
143
|
+
...props
|
|
144
|
+
}
|
|
145
|
+
)));
|
|
146
|
+
PopoverContent.displayName = PopoverPrimitive__namespace.Content.displayName;
|
|
134
147
|
var labelVariants = classVarianceAuthority.cva(
|
|
135
148
|
"sb-text-sm sb-font-medium sb-font-roboto sb-leading-none peer-disabled:sb-cursor-not-allowed peer-disabled:sb-opacity-70"
|
|
136
149
|
);
|
|
137
|
-
var Label =
|
|
150
|
+
var Label = React12__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React12__namespace.createElement(
|
|
138
151
|
LabelPrimitive__namespace.Root,
|
|
139
152
|
{
|
|
140
153
|
ref,
|
|
141
|
-
className:
|
|
154
|
+
className: chunkJ36K7WVK_js.cn(labelVariants(), className),
|
|
142
155
|
...props
|
|
143
156
|
}
|
|
144
157
|
));
|
|
@@ -146,17 +159,17 @@ Label.displayName = LabelPrimitive__namespace.Root.displayName;
|
|
|
146
159
|
|
|
147
160
|
// src/components/ui/form.tsx
|
|
148
161
|
var Form = reactHookForm.FormProvider;
|
|
149
|
-
var FormFieldContext =
|
|
162
|
+
var FormFieldContext = React12__namespace.createContext(
|
|
150
163
|
{}
|
|
151
164
|
);
|
|
152
165
|
var FormField = ({
|
|
153
166
|
...props
|
|
154
167
|
}) => {
|
|
155
|
-
return /* @__PURE__ */
|
|
168
|
+
return /* @__PURE__ */ React12__namespace.createElement(FormFieldContext.Provider, { value: { name: props.name } }, /* @__PURE__ */ React12__namespace.createElement(reactHookForm.Controller, { ...props }));
|
|
156
169
|
};
|
|
157
170
|
var useFormField = () => {
|
|
158
|
-
const fieldContext =
|
|
159
|
-
const itemContext =
|
|
171
|
+
const fieldContext = React12__namespace.useContext(FormFieldContext);
|
|
172
|
+
const itemContext = React12__namespace.useContext(FormItemContext);
|
|
160
173
|
const { getFieldState, formState } = reactHookForm.useFormContext();
|
|
161
174
|
const fieldState = getFieldState(fieldContext.name, formState);
|
|
162
175
|
if (!fieldContext) {
|
|
@@ -172,30 +185,30 @@ var useFormField = () => {
|
|
|
172
185
|
...fieldState
|
|
173
186
|
};
|
|
174
187
|
};
|
|
175
|
-
var FormItemContext =
|
|
188
|
+
var FormItemContext = React12__namespace.createContext(
|
|
176
189
|
{}
|
|
177
190
|
);
|
|
178
|
-
var FormItem =
|
|
179
|
-
const id =
|
|
180
|
-
return /* @__PURE__ */
|
|
191
|
+
var FormItem = React12__namespace.forwardRef(({ className, ...props }, ref) => {
|
|
192
|
+
const id = React12__namespace.useId();
|
|
193
|
+
return /* @__PURE__ */ React12__namespace.createElement(FormItemContext.Provider, { value: { id } }, /* @__PURE__ */ React12__namespace.createElement("div", { ref, className: chunkJ36K7WVK_js.cn("sb-space-y-2", className), ...props }));
|
|
181
194
|
});
|
|
182
195
|
FormItem.displayName = "FormItem";
|
|
183
|
-
var FormLabel =
|
|
196
|
+
var FormLabel = React12__namespace.forwardRef(({ className, ...props }, ref) => {
|
|
184
197
|
const { error, formItemId } = useFormField();
|
|
185
|
-
return /* @__PURE__ */
|
|
198
|
+
return /* @__PURE__ */ React12__namespace.createElement(
|
|
186
199
|
Label,
|
|
187
200
|
{
|
|
188
201
|
ref,
|
|
189
|
-
className:
|
|
202
|
+
className: chunkJ36K7WVK_js.cn(error && "sb-text-destructive", className),
|
|
190
203
|
htmlFor: formItemId,
|
|
191
204
|
...props
|
|
192
205
|
}
|
|
193
206
|
);
|
|
194
207
|
});
|
|
195
208
|
FormLabel.displayName = "FormLabel";
|
|
196
|
-
var FormControl =
|
|
209
|
+
var FormControl = React12__namespace.forwardRef(({ ...props }, ref) => {
|
|
197
210
|
const { error, formItemId, formDescriptionId, formMessageId } = useFormField();
|
|
198
|
-
return /* @__PURE__ */
|
|
211
|
+
return /* @__PURE__ */ React12__namespace.createElement(
|
|
199
212
|
reactSlot.Slot,
|
|
200
213
|
{
|
|
201
214
|
ref,
|
|
@@ -207,14 +220,14 @@ var FormControl = React15__namespace.forwardRef(({ ...props }, ref) => {
|
|
|
207
220
|
);
|
|
208
221
|
});
|
|
209
222
|
FormControl.displayName = "FormControl";
|
|
210
|
-
var FormDescription =
|
|
223
|
+
var FormDescription = React12__namespace.forwardRef(({ className, ...props }, ref) => {
|
|
211
224
|
const { formDescriptionId } = useFormField();
|
|
212
|
-
return /* @__PURE__ */
|
|
225
|
+
return /* @__PURE__ */ React12__namespace.createElement(
|
|
213
226
|
"p",
|
|
214
227
|
{
|
|
215
228
|
ref,
|
|
216
229
|
id: formDescriptionId,
|
|
217
|
-
className:
|
|
230
|
+
className: chunkJ36K7WVK_js.cn(
|
|
218
231
|
"sb-text-sm sb-font-roboto sb-text-muted-foreground",
|
|
219
232
|
className
|
|
220
233
|
),
|
|
@@ -223,18 +236,18 @@ var FormDescription = React15__namespace.forwardRef(({ className, ...props }, re
|
|
|
223
236
|
);
|
|
224
237
|
});
|
|
225
238
|
FormDescription.displayName = "FormDescription";
|
|
226
|
-
var FormMessage =
|
|
239
|
+
var FormMessage = React12__namespace.forwardRef(({ className, children, ...props }, ref) => {
|
|
227
240
|
const { error, formMessageId } = useFormField();
|
|
228
241
|
const body = error ? String(error?.message) : children;
|
|
229
242
|
if (!body) {
|
|
230
243
|
return null;
|
|
231
244
|
}
|
|
232
|
-
return /* @__PURE__ */
|
|
245
|
+
return /* @__PURE__ */ React12__namespace.createElement(
|
|
233
246
|
"p",
|
|
234
247
|
{
|
|
235
248
|
ref,
|
|
236
249
|
id: formMessageId,
|
|
237
|
-
className:
|
|
250
|
+
className: chunkJ36K7WVK_js.cn(
|
|
238
251
|
"sb-text-sm sb-font-roboto sb-font-medium sb-text-destructive",
|
|
239
252
|
className
|
|
240
253
|
),
|
|
@@ -244,29 +257,12 @@ var FormMessage = React15__namespace.forwardRef(({ className, children, ...props
|
|
|
244
257
|
);
|
|
245
258
|
});
|
|
246
259
|
FormMessage.displayName = "FormMessage";
|
|
247
|
-
var Popover = PopoverPrimitive__namespace.Root;
|
|
248
|
-
var PopoverTrigger = PopoverPrimitive__namespace.Trigger;
|
|
249
|
-
var PopoverClose = PopoverPrimitive__namespace.Close;
|
|
250
|
-
var PopoverContent = React15__namespace.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ React15__namespace.createElement(PopoverPrimitive__namespace.Portal, null, /* @__PURE__ */ React15__namespace.createElement(
|
|
251
|
-
PopoverPrimitive__namespace.Content,
|
|
252
|
-
{
|
|
253
|
-
ref,
|
|
254
|
-
align,
|
|
255
|
-
sideOffset,
|
|
256
|
-
className: chunk3S4FFEHM_js.cn(
|
|
257
|
-
"sb-z-50 sb-w-72 sb-font-roboto sb-rounded-md sb-border sb-bg-popover sb-p-4 sb-text-popover-foreground sb-shadow-md sb-outline-none data-[state=open]:sb-animate-in data-[state=closed]:sb-animate-out data-[state=closed]:sb-fade-out-0 data-[state=open]:sb-fade-in-0 data-[state=closed]:sb-zoom-out-95 data-[state=open]:sb-zoom-in-95 data-[side=bottom]:sb-slide-in-from-top-2 data-[side=left]:sb-slide-in-from-right-2 data-[side=right]:sb-slide-in-from-left-2 data-[side=top]:sb-slide-in-from-bottom-2",
|
|
258
|
-
className
|
|
259
|
-
),
|
|
260
|
-
...props
|
|
261
|
-
}
|
|
262
|
-
)));
|
|
263
|
-
PopoverContent.displayName = PopoverPrimitive__namespace.Content.displayName;
|
|
264
260
|
var Tabs = TabsPrimitive__namespace.Root;
|
|
265
|
-
var TabsList =
|
|
261
|
+
var TabsList = React12__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React12__namespace.createElement(
|
|
266
262
|
TabsPrimitive__namespace.List,
|
|
267
263
|
{
|
|
268
264
|
ref,
|
|
269
|
-
className:
|
|
265
|
+
className: chunkJ36K7WVK_js.cn(
|
|
270
266
|
"sb-flex sb-items-center sb-border-b sb-px-4 sb-space-x-6",
|
|
271
267
|
className
|
|
272
268
|
),
|
|
@@ -274,11 +270,11 @@ var TabsList = React15__namespace.forwardRef(({ className, ...props }, ref) => /
|
|
|
274
270
|
}
|
|
275
271
|
));
|
|
276
272
|
TabsList.displayName = TabsPrimitive__namespace.List.displayName;
|
|
277
|
-
var TabsTrigger =
|
|
273
|
+
var TabsTrigger = React12__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React12__namespace.createElement(
|
|
278
274
|
TabsPrimitive__namespace.Trigger,
|
|
279
275
|
{
|
|
280
276
|
ref,
|
|
281
|
-
className:
|
|
277
|
+
className: chunkJ36K7WVK_js.cn(
|
|
282
278
|
"sb-inline-flex sb-font-roboto sb-items-center sb-justify-center sb-whitespace-nowrap sb-py-3 sb-text-sm sb-font-medium sb-transition-all focus-visible:sb-outline-none disabled:sb-pointer-events-none disabled:sb-opacity-50 data-[state=active]:sb-border-black sb-border-b-2 sb-border-transparent data-[state=active]:sb-text-foreground sb-text-muted-foreground",
|
|
283
279
|
className
|
|
284
280
|
),
|
|
@@ -286,11 +282,11 @@ var TabsTrigger = React15__namespace.forwardRef(({ className, ...props }, ref) =
|
|
|
286
282
|
}
|
|
287
283
|
));
|
|
288
284
|
TabsTrigger.displayName = TabsPrimitive__namespace.Trigger.displayName;
|
|
289
|
-
var TabsContent =
|
|
285
|
+
var TabsContent = React12__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React12__namespace.createElement(
|
|
290
286
|
TabsPrimitive__namespace.Content,
|
|
291
287
|
{
|
|
292
288
|
ref,
|
|
293
|
-
className:
|
|
289
|
+
className: chunkJ36K7WVK_js.cn(
|
|
294
290
|
"sb-ring-offset-background sb-font-roboto focus-visible:sb-outline-none focus-visible:sb-ring-2 focus-visible:sb-ring-ring focus-visible:sb-ring-offset-2",
|
|
295
291
|
className
|
|
296
292
|
),
|
|
@@ -298,21 +294,13 @@ var TabsContent = React15__namespace.forwardRef(({ className, ...props }, ref) =
|
|
|
298
294
|
}
|
|
299
295
|
));
|
|
300
296
|
TabsContent.displayName = TabsPrimitive__namespace.Content.displayName;
|
|
301
|
-
var Image = (props) => {
|
|
302
|
-
if (typeof NextImage__default.default !== "undefined") {
|
|
303
|
-
return /* @__PURE__ */ React15__namespace.createElement(NextImage__default.default.default, { ...props });
|
|
304
|
-
}
|
|
305
|
-
return /* @__PURE__ */ React15__namespace.createElement("img", { ...props });
|
|
306
|
-
};
|
|
307
|
-
|
|
308
|
-
// src/components/ui/media-input.tsx
|
|
309
297
|
var MediaInput = (props) => {
|
|
310
298
|
const { onFilesChange, limit = 32, multiple = false, onError } = props;
|
|
311
|
-
const id =
|
|
312
|
-
const [queue, setQueue] =
|
|
313
|
-
const [sources, setSources] =
|
|
299
|
+
const id = React12__namespace.useId();
|
|
300
|
+
const [queue, setQueue] = React12__namespace.useState([]);
|
|
301
|
+
const [sources, setSources] = React12__namespace.useState(props.files ?? []);
|
|
314
302
|
const maxConcurrentUploads = 3;
|
|
315
|
-
const uploadingCountRef =
|
|
303
|
+
const uploadingCountRef = React12__namespace.useRef(0);
|
|
316
304
|
const handleFilesAdd = async (e) => {
|
|
317
305
|
const files = e.target.files;
|
|
318
306
|
if (!files || files.length === 0) {
|
|
@@ -383,42 +371,42 @@ var MediaInput = (props) => {
|
|
|
383
371
|
body: JSON.stringify({ src })
|
|
384
372
|
});
|
|
385
373
|
};
|
|
386
|
-
return /* @__PURE__ */
|
|
387
|
-
Image,
|
|
374
|
+
return /* @__PURE__ */ React12__namespace.createElement("div", { className: chunkJ36K7WVK_js.cn("flex flex-wrap gap-4", props.className) }, sources.map((src) => /* @__PURE__ */ React12__namespace.createElement(MediaInputItem, { key: src, className: chunkJ36K7WVK_js.cn("group", props.itemClassName) }, /* @__PURE__ */ React12__namespace.createElement(
|
|
375
|
+
chunkJ36K7WVK_js.Image,
|
|
388
376
|
{
|
|
389
377
|
src,
|
|
390
378
|
alt: "",
|
|
391
379
|
fill: true,
|
|
392
380
|
className: "sb-absolute sb-inset-0 sb-object-cover sb-pointer-events-none"
|
|
393
381
|
}
|
|
394
|
-
), /* @__PURE__ */
|
|
382
|
+
), /* @__PURE__ */ React12__namespace.createElement("div", { className: "sb-absolute sb-right-1 sb-top-1 sb-z-30 sb-flex sb-items-center sb-justify-end sb-gap-3 sb-opacity-0 sb-transition-opacity group-hover:sb-opacity-100" }, /* @__PURE__ */ React12__namespace.createElement(
|
|
395
383
|
"button",
|
|
396
384
|
{
|
|
397
385
|
className: "sb-flex sb-h-8 sb-w-8 sb-items-center sb-justify-center sb-rounded-full sb-border sb-bg-secondary sb-text-secondary-foreground sb-opacity-90 sb-shadow sb-transition-opacity hover:sb-opacity-100",
|
|
398
386
|
onClick: () => handleSourceDelete(src)
|
|
399
387
|
},
|
|
400
|
-
/* @__PURE__ */
|
|
401
|
-
)))), queue.map((_, i) => /* @__PURE__ */
|
|
388
|
+
/* @__PURE__ */ React12__namespace.createElement(lucideReact.Trash2Icon, { className: "sb-h-4 sb-w-4" })
|
|
389
|
+
)))), queue.map((_, i) => /* @__PURE__ */ React12__namespace.createElement(
|
|
402
390
|
MediaInputItem,
|
|
403
391
|
{
|
|
404
392
|
key: i,
|
|
405
|
-
className:
|
|
393
|
+
className: chunkJ36K7WVK_js.cn(
|
|
406
394
|
"sb-flex sb-h-28 sb-w-28 sb-items-center sb-justify-center",
|
|
407
395
|
props.itemClassName
|
|
408
396
|
)
|
|
409
397
|
},
|
|
410
|
-
/* @__PURE__ */
|
|
411
|
-
)), multiple || !multiple && !sources.length && !queue.length ? /* @__PURE__ */
|
|
398
|
+
/* @__PURE__ */ React12__namespace.createElement(lucideReact.Loader2Icon, { className: "sb-h-6 sb-w-6 sb-animate-spin" })
|
|
399
|
+
)), multiple || !multiple && !sources.length && !queue.length ? /* @__PURE__ */ React12__namespace.createElement(
|
|
412
400
|
"label",
|
|
413
401
|
{
|
|
414
402
|
htmlFor: id,
|
|
415
|
-
className:
|
|
403
|
+
className: chunkJ36K7WVK_js.cn(
|
|
416
404
|
"sb-flex sb-h-28 sb-w-28 sb-cursor-pointer sb-items-center sb-justify-center sb-rounded-lg sb-border",
|
|
417
405
|
props.itemClassName
|
|
418
406
|
)
|
|
419
407
|
},
|
|
420
|
-
/* @__PURE__ */
|
|
421
|
-
/* @__PURE__ */
|
|
408
|
+
/* @__PURE__ */ React12__namespace.createElement(lucideReact.PlusIcon, { className: "sb-h-6 sb-w-6" }),
|
|
409
|
+
/* @__PURE__ */ React12__namespace.createElement(
|
|
422
410
|
"input",
|
|
423
411
|
{
|
|
424
412
|
id,
|
|
@@ -432,10 +420,10 @@ var MediaInput = (props) => {
|
|
|
432
420
|
) : null);
|
|
433
421
|
};
|
|
434
422
|
var MediaInputItem = (props) => {
|
|
435
|
-
return /* @__PURE__ */
|
|
423
|
+
return /* @__PURE__ */ React12__namespace.createElement(
|
|
436
424
|
"div",
|
|
437
425
|
{
|
|
438
|
-
className:
|
|
426
|
+
className: chunkJ36K7WVK_js.cn(
|
|
439
427
|
"sb-relative sb-h-28 sb-w-28 sb-overflow-hidden sb-rounded-lg sb-border",
|
|
440
428
|
props.className
|
|
441
429
|
)
|
|
@@ -475,38 +463,38 @@ var BackgroundPicker = (props) => {
|
|
|
475
463
|
"url(https://images.unsplash.com/photo-1688822863426-8c5f9b257090?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=2532&q=90)",
|
|
476
464
|
"url(https://images.unsplash.com/photo-1691225850735-6e4e51834cad?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=2532&q=90)"
|
|
477
465
|
];
|
|
478
|
-
const defaultTab =
|
|
466
|
+
const defaultTab = React12__namespace.useMemo(() => {
|
|
479
467
|
if (background.includes("url"))
|
|
480
468
|
return "image";
|
|
481
469
|
if (background.includes("gradient"))
|
|
482
470
|
return "gradient";
|
|
483
471
|
return "solid";
|
|
484
472
|
}, [background]);
|
|
485
|
-
return /* @__PURE__ */
|
|
486
|
-
|
|
473
|
+
return /* @__PURE__ */ React12__namespace.createElement(Popover, null, /* @__PURE__ */ React12__namespace.createElement(PopoverTrigger, { asChild: true }, /* @__PURE__ */ React12__namespace.createElement(
|
|
474
|
+
chunkXEMUNFCV_js.Button,
|
|
487
475
|
{
|
|
488
476
|
variant: "outline",
|
|
489
477
|
size: "sm",
|
|
490
|
-
className:
|
|
478
|
+
className: chunkJ36K7WVK_js.cn(
|
|
491
479
|
"sb-justify-start sb-text-left sb-font-normal sb-normal-case sb-w-full",
|
|
492
480
|
!background && "sb-text-muted-foreground",
|
|
493
481
|
className
|
|
494
482
|
)
|
|
495
483
|
},
|
|
496
|
-
/* @__PURE__ */
|
|
484
|
+
/* @__PURE__ */ React12__namespace.createElement("div", { className: "sb-w-full sb-flex sb-items-center sb-gap-2" }, background ? /* @__PURE__ */ React12__namespace.createElement(
|
|
497
485
|
"div",
|
|
498
486
|
{
|
|
499
487
|
className: "sb-h-4 sb-w-4 sb-rounded !sb-bg-center !sb-bg-cover sb-transition-all sb-border",
|
|
500
488
|
style: { background }
|
|
501
489
|
}
|
|
502
|
-
) : /* @__PURE__ */
|
|
503
|
-
)), /* @__PURE__ */
|
|
490
|
+
) : /* @__PURE__ */ React12__namespace.createElement(lucideReact.PaintbrushIcon, { className: "sb-h-4 sb-w-4" }), /* @__PURE__ */ React12__namespace.createElement("div", { className: "sb-truncate sb-flex-1" }, background ? background : "Kies een achtergrond"))
|
|
491
|
+
)), /* @__PURE__ */ React12__namespace.createElement(PopoverContent, { className: "sb-w-64 sb-p-0" }, /* @__PURE__ */ React12__namespace.createElement(Tabs, { defaultValue: defaultTab }, /* @__PURE__ */ React12__namespace.createElement(TabsList, { className: "sb-w-full" }, /* @__PURE__ */ React12__namespace.createElement(TabsTrigger, { className: "sb-flex-1", value: "solid" }, "Solid"), /* @__PURE__ */ React12__namespace.createElement(TabsTrigger, { className: "sb-flex-1", value: "gradient" }, "Gradient"), /* @__PURE__ */ React12__namespace.createElement(TabsTrigger, { className: "sb-flex-1", value: "image" }, "Image")), /* @__PURE__ */ React12__namespace.createElement(
|
|
504
492
|
TabsContent,
|
|
505
493
|
{
|
|
506
494
|
value: "solid",
|
|
507
495
|
className: "data-[state=active]:sb-flex sb-flex-wrap sb-gap-1 sb-p-4"
|
|
508
496
|
},
|
|
509
|
-
solids.map((s) => /* @__PURE__ */
|
|
497
|
+
solids.map((s) => /* @__PURE__ */ React12__namespace.createElement(
|
|
510
498
|
"div",
|
|
511
499
|
{
|
|
512
500
|
key: s,
|
|
@@ -515,13 +503,13 @@ var BackgroundPicker = (props) => {
|
|
|
515
503
|
onClick: () => onBackgroundChange(s)
|
|
516
504
|
}
|
|
517
505
|
))
|
|
518
|
-
), /* @__PURE__ */
|
|
506
|
+
), /* @__PURE__ */ React12__namespace.createElement(
|
|
519
507
|
TabsContent,
|
|
520
508
|
{
|
|
521
509
|
value: "gradient",
|
|
522
510
|
className: "data-[state=active]:sb-flex sb-flex-wrap sb-gap-1 sb-p-4"
|
|
523
511
|
},
|
|
524
|
-
gradients.map((s) => /* @__PURE__ */
|
|
512
|
+
gradients.map((s) => /* @__PURE__ */ React12__namespace.createElement(
|
|
525
513
|
"div",
|
|
526
514
|
{
|
|
527
515
|
key: s,
|
|
@@ -530,7 +518,7 @@ var BackgroundPicker = (props) => {
|
|
|
530
518
|
onClick: () => onBackgroundChange(s)
|
|
531
519
|
}
|
|
532
520
|
))
|
|
533
|
-
), /* @__PURE__ */
|
|
521
|
+
), /* @__PURE__ */ React12__namespace.createElement(TabsContent, { value: "image" }, /* @__PURE__ */ React12__namespace.createElement("div", { className: "sb-p-4 sb-border-b" }, /* @__PURE__ */ React12__namespace.createElement(
|
|
534
522
|
MediaInput,
|
|
535
523
|
{
|
|
536
524
|
className: "sb-grid sb-grid-cols-2 sb-gap-1",
|
|
@@ -546,7 +534,7 @@ var BackgroundPicker = (props) => {
|
|
|
546
534
|
"media-input: Error: " + e?.description
|
|
547
535
|
)
|
|
548
536
|
}
|
|
549
|
-
)), /* @__PURE__ */
|
|
537
|
+
)), /* @__PURE__ */ React12__namespace.createElement("div", { className: "sb-grid sb-grid-cols-2 sb-gap-1 sb-p-4" }, images.map((s) => /* @__PURE__ */ React12__namespace.createElement(
|
|
550
538
|
"div",
|
|
551
539
|
{
|
|
552
540
|
key: s,
|
|
@@ -556,60 +544,6 @@ var BackgroundPicker = (props) => {
|
|
|
556
544
|
}
|
|
557
545
|
)))))));
|
|
558
546
|
};
|
|
559
|
-
function Calendar({
|
|
560
|
-
className,
|
|
561
|
-
classNames,
|
|
562
|
-
showOutsideDays = true,
|
|
563
|
-
...props
|
|
564
|
-
}) {
|
|
565
|
-
return /* @__PURE__ */ React15__namespace.createElement(
|
|
566
|
-
reactDayPicker.DayPicker,
|
|
567
|
-
{
|
|
568
|
-
showOutsideDays,
|
|
569
|
-
className: chunk3S4FFEHM_js.cn("sb-p-3 sb-font-roboto", className),
|
|
570
|
-
classNames: {
|
|
571
|
-
months: "sb-flex sb-flex-col sm:sb-flex-row sb-space-y-4 sm:sb-space-x-4 sm:sb-space-y-0",
|
|
572
|
-
month: "sb-space-y-4",
|
|
573
|
-
caption: "sb-flex sb-justify-center sb-pt-1 sb-relative sb-items-center",
|
|
574
|
-
caption_label: "sb-text-sm sb-font-medium",
|
|
575
|
-
nav: "sb-space-x-1 sb-flex sb-items-center",
|
|
576
|
-
nav_button: chunk3S4FFEHM_js.cn(
|
|
577
|
-
chunk3S4FFEHM_js.buttonVariants({ variant: "outline" }),
|
|
578
|
-
"sb-h-7 sb-w-7 sb-bg-transparent sb-p-0 sb-opacity-50 hover:sb-opacity-100"
|
|
579
|
-
),
|
|
580
|
-
nav_button_previous: "sb-absolute sb-left-1",
|
|
581
|
-
nav_button_next: "sb-absolute sb-right-1",
|
|
582
|
-
table: "sb-w-full sb-border-collapse sb-space-y-1",
|
|
583
|
-
head_row: "sb-flex",
|
|
584
|
-
head_cell: "sb-text-muted-foreground sb-rounded-md sb-w-8 sb-font-normal sb-text-[0.8rem]",
|
|
585
|
-
row: "sb-flex sb-w-full sb-mt-2",
|
|
586
|
-
cell: chunk3S4FFEHM_js.cn(
|
|
587
|
-
"sb-relative sb-p-0 sb-text-center sb-text-sm focus-within:sb-relative focus-within:sb-z-20 [&:has([aria-selected])]:sb-bg-accent [&:has([aria-selected].day-outside)]:sb-bg-accent/50 [&:has([aria-selected].day-range-end)]:sb-rounded-r-md",
|
|
588
|
-
props.mode === "range" ? "[&:has(>.day-range-end)]:sb-rounded-r-md [&:has(>.day-range-start)]:sb-rounded-l-md first:[&:has([aria-selected])]:sb-rounded-l-md last:[&:has([aria-selected])]:sb-rounded-r-md" : "[&:has([aria-selected])]:sb-rounded-md"
|
|
589
|
-
),
|
|
590
|
-
day: chunk3S4FFEHM_js.cn(
|
|
591
|
-
chunk3S4FFEHM_js.buttonVariants({ variant: "ghost" }),
|
|
592
|
-
"sb-h-8 sb-w-8 sb-p-0 sb-font-normal aria-selected:sb-opacity-100"
|
|
593
|
-
),
|
|
594
|
-
day_range_start: "day-range-start",
|
|
595
|
-
day_range_end: "day-range-end",
|
|
596
|
-
day_selected: "sb-bg-primary sb-text-primary-foreground hover:sb-bg-primary hover:sb-text-primary-foreground focus:sb-bg-primary focus:sb-text-primary-foreground",
|
|
597
|
-
day_today: "sb-bg-accent sb-text-accent-foreground",
|
|
598
|
-
day_outside: "day-outside sb-text-muted-foreground sb-opacity-50 aria-selected:sb-bg-accent/50 aria-selected:sb-text-muted-foreground aria-selected:sb-opacity-30",
|
|
599
|
-
day_disabled: "sb-text-muted-foreground sb-opacity-50",
|
|
600
|
-
day_range_middle: "aria-selected:sb-bg-accent aria-selected:sb-text-accent-foreground",
|
|
601
|
-
day_hidden: "invisible",
|
|
602
|
-
...classNames
|
|
603
|
-
},
|
|
604
|
-
components: {
|
|
605
|
-
IconLeft: () => /* @__PURE__ */ React15__namespace.createElement(lucideReact.ChevronLeftIcon, { className: "sb-h-4 sb-w-4" }),
|
|
606
|
-
IconRight: () => /* @__PURE__ */ React15__namespace.createElement(lucideReact.ChevronRightIcon, { className: "sb-h-4 sb-w-4" })
|
|
607
|
-
},
|
|
608
|
-
...props
|
|
609
|
-
}
|
|
610
|
-
);
|
|
611
|
-
}
|
|
612
|
-
Calendar.displayName = "Calendar";
|
|
613
547
|
var ColorPicker = (props) => {
|
|
614
548
|
const { color, onColorChange, className } = props;
|
|
615
549
|
const colors = props.colors ?? [
|
|
@@ -623,25 +557,25 @@ var ColorPicker = (props) => {
|
|
|
623
557
|
"#009DD1",
|
|
624
558
|
"#FF0000"
|
|
625
559
|
];
|
|
626
|
-
return /* @__PURE__ */
|
|
627
|
-
|
|
560
|
+
return /* @__PURE__ */ React12__namespace.createElement(Popover, null, /* @__PURE__ */ React12__namespace.createElement(PopoverTrigger, { asChild: true }, /* @__PURE__ */ React12__namespace.createElement(
|
|
561
|
+
chunkXEMUNFCV_js.Button,
|
|
628
562
|
{
|
|
629
563
|
variant: "outline",
|
|
630
564
|
size: "sm",
|
|
631
|
-
className:
|
|
565
|
+
className: chunkJ36K7WVK_js.cn(
|
|
632
566
|
"sb-justify-start sb-text-left sb-font-normal sb-normal-case sb-w-full",
|
|
633
567
|
!color && "sb-text-muted-foreground",
|
|
634
568
|
className
|
|
635
569
|
)
|
|
636
570
|
},
|
|
637
|
-
/* @__PURE__ */
|
|
571
|
+
/* @__PURE__ */ React12__namespace.createElement("div", { className: "sb-w-full sb-flex sb-items-center sb-gap-2" }, color ? /* @__PURE__ */ React12__namespace.createElement(
|
|
638
572
|
"div",
|
|
639
573
|
{
|
|
640
574
|
className: "sb-h-4 sb-w-4 sb-rounded !sb-bg-center !sb-bg-cover sb-transition-all sb-border",
|
|
641
575
|
style: { background: color }
|
|
642
576
|
}
|
|
643
|
-
) : /* @__PURE__ */
|
|
644
|
-
)), /* @__PURE__ */
|
|
577
|
+
) : /* @__PURE__ */ React12__namespace.createElement(lucideReact.PaintbrushIcon, { className: "sb-h-4 sb-w-4" }), /* @__PURE__ */ React12__namespace.createElement("div", { className: "sb-truncate sb-flex-1" }, color ? color : "Kies een kleur"))
|
|
578
|
+
)), /* @__PURE__ */ React12__namespace.createElement(PopoverContent, { className: "sb-w-64 sb-p-4 sb-flex sb-flex-wrap sb-gap-1" }, colors.map((s) => /* @__PURE__ */ React12__namespace.createElement(
|
|
645
579
|
"div",
|
|
646
580
|
{
|
|
647
581
|
key: s,
|
|
@@ -651,13 +585,13 @@ var ColorPicker = (props) => {
|
|
|
651
585
|
}
|
|
652
586
|
))));
|
|
653
587
|
};
|
|
654
|
-
var Input =
|
|
588
|
+
var Input = React12__namespace.forwardRef(
|
|
655
589
|
({ className, type, ...props }, ref) => {
|
|
656
|
-
return /* @__PURE__ */
|
|
590
|
+
return /* @__PURE__ */ React12__namespace.createElement(
|
|
657
591
|
"input",
|
|
658
592
|
{
|
|
659
593
|
type,
|
|
660
|
-
className:
|
|
594
|
+
className: chunkJ36K7WVK_js.cn(
|
|
661
595
|
"sb-flex sb-h-8 sb-w-full sb-font-roboto sb-rounded-md sb-border sb-border-input sb-bg-background sb-px-3 sb-py-1 sb-text-sm sb-ring-offset-background file:sb-border-0 file:sb-bg-transparent file:sb-text-sm file:sb-font-medium placeholder:sb-text-muted-foreground focus-visible:sb-outline-none focus-visible:sb-ring-1 focus-visible:ring-sb-ring focus-visible:sb-ring-offset-2 disabled:sb-cursor-not-allowed disabled:sb-opacity-50",
|
|
662
596
|
className
|
|
663
597
|
),
|
|
@@ -668,48 +602,32 @@ var Input = React15__namespace.forwardRef(
|
|
|
668
602
|
}
|
|
669
603
|
);
|
|
670
604
|
Input.displayName = "Input";
|
|
671
|
-
var AdvancedInput =
|
|
605
|
+
var AdvancedInput = React12__namespace.forwardRef(
|
|
672
606
|
({ prepend, append, ...props }, ref) => {
|
|
673
|
-
return /* @__PURE__ */
|
|
607
|
+
return /* @__PURE__ */ React12__namespace.createElement("div", { className: "sb-relative" }, /* @__PURE__ */ React12__namespace.createElement(Input, { ref, className: "sb-pl-9 sb-pr-7 sb-text-right", ...props }), prepend && /* @__PURE__ */ React12__namespace.createElement("div", { className: "sb-absolute sb-font-roboto sb-top-1/2 sb-left-3 sb--translate-y-1/2" }, prepend), append && /* @__PURE__ */ React12__namespace.createElement("div", { className: "sb-absolute sb-font-roboto sb-top-1/2 sb-right-3 sb--translate-y-1/2" }, append));
|
|
674
608
|
}
|
|
675
609
|
);
|
|
676
610
|
AdvancedInput.displayName = "AdvancedInput";
|
|
677
|
-
var Switch =
|
|
611
|
+
var Switch = React12__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React12__namespace.createElement(
|
|
678
612
|
SwitchPrimitives__namespace.Root,
|
|
679
613
|
{
|
|
680
|
-
className:
|
|
614
|
+
className: chunkJ36K7WVK_js.cn(
|
|
681
615
|
"peer sb-inline-flex sb-h-6 sb-w-11 sb-shrink-0 sb-cursor-pointer sb-items-center sb-rounded-full sb-border-2 sb-border-transparent sb-transition-colors focus-visible:sb-outline-none focus-visible:sb-ring-2 focus-visible:sb-ring-ring focus-visible:sb-ring-offset-2 focus-visible:sb-ring-offset-background disabled:sb-cursor-not-allowed disabled:sb-opacity-50 data-[state=checked]:sb-bg-primary data-[state=unchecked]:sb-bg-input",
|
|
682
616
|
className
|
|
683
617
|
),
|
|
684
618
|
...props,
|
|
685
619
|
ref
|
|
686
620
|
},
|
|
687
|
-
/* @__PURE__ */
|
|
621
|
+
/* @__PURE__ */ React12__namespace.createElement(
|
|
688
622
|
SwitchPrimitives__namespace.Thumb,
|
|
689
623
|
{
|
|
690
|
-
className:
|
|
624
|
+
className: chunkJ36K7WVK_js.cn(
|
|
691
625
|
"sb-pointer-events-none sb-block sb-h-5 sb-w-5 sb-rounded-full sb-bg-background sb-shadow-lg sb-ring-0 sb-transition-transform data-[state=checked]:sb-translate-x-5 data-[state=unchecked]:sb-translate-x-0"
|
|
692
626
|
)
|
|
693
627
|
}
|
|
694
628
|
)
|
|
695
629
|
));
|
|
696
630
|
Switch.displayName = SwitchPrimitives__namespace.Root.displayName;
|
|
697
|
-
var Textarea = React15__namespace.forwardRef(
|
|
698
|
-
({ className, ...props }, ref) => {
|
|
699
|
-
return /* @__PURE__ */ React15__namespace.createElement(
|
|
700
|
-
"textarea",
|
|
701
|
-
{
|
|
702
|
-
className: chunk3S4FFEHM_js.cn(
|
|
703
|
-
"sb-flex sb-min-h-[60px] sb-font-roboto sb-w-full sb-rounded-md sb-border sb-border-input sb-bg-transparent sb-px-3 sb-py-2 sb-text-sm sb-shadow-sm placeholder:sb-text-muted-foreground focus-visible:sb-outline-none focus-visible:sb-ring-1 focus-visible:sb-ring-ring disabled:sb-cursor-not-allowed disabled:sb-opacity-50",
|
|
704
|
-
className
|
|
705
|
-
),
|
|
706
|
-
ref,
|
|
707
|
-
...props
|
|
708
|
-
}
|
|
709
|
-
);
|
|
710
|
-
}
|
|
711
|
-
);
|
|
712
|
-
Textarea.displayName = "Textarea";
|
|
713
631
|
var toggleVariants = classVarianceAuthority.cva(
|
|
714
632
|
"sb-inline-flex sb-items-center sb-justify-center sb-rounded-md sb-text-sm sb-font-medium sb-ring-offset-background sb-transition-colors hover:sb-bg-muted hover:sb-text-muted-foreground focus-visible:sb-outline-none focus-visible:sb-ring-1 focus-visible:sb-ring-ring focus-visible:sb-ring-offset-2 disabled:sb-pointer-events-none disabled:sb-opacity-50 data-[state=on]:sb-bg-accent data-[state=on]:sb-text-accent-foreground",
|
|
715
633
|
{
|
|
@@ -730,102 +648,17 @@ var toggleVariants = classVarianceAuthority.cva(
|
|
|
730
648
|
}
|
|
731
649
|
}
|
|
732
650
|
);
|
|
733
|
-
var Toggle =
|
|
651
|
+
var Toggle = React12__namespace.forwardRef(({ className, variant, size, ...props }, ref) => /* @__PURE__ */ React12__namespace.createElement(
|
|
734
652
|
TogglePrimitive__namespace.Root,
|
|
735
653
|
{
|
|
736
654
|
ref,
|
|
737
|
-
className:
|
|
655
|
+
className: chunkJ36K7WVK_js.cn(toggleVariants({ variant, size, className })),
|
|
738
656
|
...props
|
|
739
657
|
}
|
|
740
658
|
));
|
|
741
659
|
Toggle.displayName = TogglePrimitive__namespace.Root.displayName;
|
|
742
660
|
|
|
743
|
-
// src/components/
|
|
744
|
-
var ContainerItemToolbar = (props) => {
|
|
745
|
-
const { contentId, canBringUp = false, canBringDown = false } = props;
|
|
746
|
-
const { bringUp, bringDown } = chunk3S4FFEHM_js.useBuilder();
|
|
747
|
-
return /* @__PURE__ */ React15__namespace.createElement("div", { className: "sb-absolute sb-z-20 sb-top-1 sb-right-1 sb-rounded-md sb-shadow sb-flex sb-flex-col sb-gap-1 sb-p-1 sb-bg-card sb-text-card-foreground sb-item-toolbar sb-opacity-0 sb-transition-opacity" }, /* @__PURE__ */ React15__namespace.createElement("div", { className: "sb-h-10 sb-p-1 sb-border sb-border-input sb-bg-background sb-rounded-md sb-text-sm sb-font-medium sb-flex sb-gap-1 sb-items-center sb-justify-start" }, /* @__PURE__ */ React15__namespace.createElement(EditButton, { id: contentId }), /* @__PURE__ */ React15__namespace.createElement(
|
|
748
|
-
chunk3S4FFEHM_js.Button,
|
|
749
|
-
{
|
|
750
|
-
variant: "ghost",
|
|
751
|
-
className: "sb-w-8 sb-h-8 sb-p-0",
|
|
752
|
-
onClick: () => bringUp(contentId),
|
|
753
|
-
disabled: !canBringUp
|
|
754
|
-
},
|
|
755
|
-
/* @__PURE__ */ React15__namespace.createElement(lucideReact.ArrowUp, { className: "sb-h-5 sb-w-5" })
|
|
756
|
-
), /* @__PURE__ */ React15__namespace.createElement(
|
|
757
|
-
chunk3S4FFEHM_js.Button,
|
|
758
|
-
{
|
|
759
|
-
variant: "ghost",
|
|
760
|
-
className: "sb-w-8 sb-h-8 sb-p-0",
|
|
761
|
-
onClick: () => bringDown(contentId),
|
|
762
|
-
disabled: !canBringDown
|
|
763
|
-
},
|
|
764
|
-
/* @__PURE__ */ React15__namespace.createElement(lucideReact.ArrowDown, { className: "sb-h-5 sb-w-5" })
|
|
765
|
-
), /* @__PURE__ */ React15__namespace.createElement(DeleteButton, { contentId })));
|
|
766
|
-
};
|
|
767
|
-
var EditButton = ({ id }) => {
|
|
768
|
-
return /* @__PURE__ */ React15__namespace.createElement(Popover, null, /* @__PURE__ */ React15__namespace.createElement(PopoverTrigger, { asChild: true }, /* @__PURE__ */ React15__namespace.createElement(chunk3S4FFEHM_js.Button, { variant: "ghost", className: "sb-w-8 sb-h-8 sb-p-0" }, /* @__PURE__ */ React15__namespace.createElement(lucideReact.Edit2Icon, { className: "sb-h-5 sb-w-5" }))), /* @__PURE__ */ React15__namespace.createElement(
|
|
769
|
-
PopoverContent,
|
|
770
|
-
{
|
|
771
|
-
side: "left",
|
|
772
|
-
align: "start",
|
|
773
|
-
sideOffset: 16,
|
|
774
|
-
alignOffset: -8,
|
|
775
|
-
className: "sb-p-0",
|
|
776
|
-
collisionPadding: 16
|
|
777
|
-
},
|
|
778
|
-
/* @__PURE__ */ React15__namespace.createElement(EditPopoverInner, { id })
|
|
779
|
-
));
|
|
780
|
-
};
|
|
781
|
-
var EditPopoverInner = (props) => {
|
|
782
|
-
const { id } = props;
|
|
783
|
-
const { getItem } = chunk3S4FFEHM_js.useBuilder();
|
|
784
|
-
const item = getItem(id);
|
|
785
|
-
if (!item) {
|
|
786
|
-
throw new Error(
|
|
787
|
-
`[simple-builder]: Item with id ${id} not found in container item form component`
|
|
788
|
-
);
|
|
789
|
-
}
|
|
790
|
-
return /* @__PURE__ */ React15__namespace.createElement(Tabs, null, /* @__PURE__ */ React15__namespace.createElement(TabsList, { defaultValue: "content" }, /* @__PURE__ */ React15__namespace.createElement(TabsTrigger, { value: "content" }, "Inhoud"), /* @__PURE__ */ React15__namespace.createElement(TabsTrigger, { value: "design" }, "Design")), /* @__PURE__ */ React15__namespace.createElement(TabsContent, { value: "content" }, /* @__PURE__ */ React15__namespace.createElement(ContainerItemForm, { item })), /* @__PURE__ */ React15__namespace.createElement(TabsContent, { value: "design" }, /* @__PURE__ */ React15__namespace.createElement(ItemDesignForm, { item })));
|
|
791
|
-
};
|
|
792
|
-
var ContainerItemForm = (props) => {
|
|
793
|
-
const { item } = props;
|
|
794
|
-
const { patchItem } = chunk3S4FFEHM_js.useBuilder();
|
|
795
|
-
const component = chunkVMHWPKU4_js.builder.getComponent(item.component);
|
|
796
|
-
if (!component) {
|
|
797
|
-
throw new Error(
|
|
798
|
-
`[simple-builder]: Component with id ${item.component} not found in container item form component`
|
|
799
|
-
);
|
|
800
|
-
}
|
|
801
|
-
const form = reactHookForm.useForm({
|
|
802
|
-
defaultValues: (component.inputs || []).reduce(
|
|
803
|
-
(acc, input) => ({
|
|
804
|
-
...acc,
|
|
805
|
-
[input.name]: item?.props?.[input.name] ?? input.defaultValue
|
|
806
|
-
}),
|
|
807
|
-
{}
|
|
808
|
-
)
|
|
809
|
-
});
|
|
810
|
-
const onSubmit = (values) => {
|
|
811
|
-
patchItem(item.id, {
|
|
812
|
-
props: values
|
|
813
|
-
});
|
|
814
|
-
};
|
|
815
|
-
React15__namespace.useEffect(() => {
|
|
816
|
-
const subscription = form.watch(() => form.handleSubmit(onSubmit)());
|
|
817
|
-
return () => subscription.unsubscribe();
|
|
818
|
-
}, [form.watch, form.handleSubmit]);
|
|
819
|
-
return /* @__PURE__ */ React15__namespace.createElement(Form, { ...form }, /* @__PURE__ */ React15__namespace.createElement("form", { onSubmit: form.handleSubmit(onSubmit) }, /* @__PURE__ */ React15__namespace.createElement("div", { className: "sb-space-y-4 sb-p-4" }, (component.inputs || []).map((input) => /* @__PURE__ */ React15__namespace.createElement(
|
|
820
|
-
FormField,
|
|
821
|
-
{
|
|
822
|
-
key: input.name,
|
|
823
|
-
control: form.control,
|
|
824
|
-
name: input.name,
|
|
825
|
-
render: ({ field }) => /* @__PURE__ */ React15__namespace.createElement(RenderInput, { type: input.type, input, field })
|
|
826
|
-
}
|
|
827
|
-
)))));
|
|
828
|
-
};
|
|
661
|
+
// src/components/item-design-form.tsx
|
|
829
662
|
var spacingSchema = zod.z.discriminatedUnion("indipendent", [
|
|
830
663
|
zod.z.object({
|
|
831
664
|
indipendent: zod.z.literal(false),
|
|
@@ -849,9 +682,9 @@ var designSchema = zod.z.object({
|
|
|
849
682
|
});
|
|
850
683
|
var ItemDesignForm = (props) => {
|
|
851
684
|
const { item } = props;
|
|
852
|
-
const { patchItem } =
|
|
853
|
-
const initialPadding =
|
|
854
|
-
const initialMargin =
|
|
685
|
+
const { patchItem } = chunkXEMUNFCV_js.useBuilder();
|
|
686
|
+
const initialPadding = chunkJ36K7WVK_js.spacing.parse(item.styles?.padding ?? "");
|
|
687
|
+
const initialMargin = chunkJ36K7WVK_js.spacing.parse(item.styles?.margin ?? "");
|
|
855
688
|
const form = reactHookForm.useForm({
|
|
856
689
|
resolver: zod$1.zodResolver(designSchema),
|
|
857
690
|
defaultValues: {
|
|
@@ -859,7 +692,7 @@ var ItemDesignForm = (props) => {
|
|
|
859
692
|
background: item.styles?.background ?? "",
|
|
860
693
|
color: item.styles?.color ?? "",
|
|
861
694
|
padding: {
|
|
862
|
-
indipendent:
|
|
695
|
+
indipendent: chunkJ36K7WVK_js.spacing.isIndipendent(
|
|
863
696
|
item.styles?.padding ?? ""
|
|
864
697
|
),
|
|
865
698
|
horizontal: initialPadding.left,
|
|
@@ -870,7 +703,7 @@ var ItemDesignForm = (props) => {
|
|
|
870
703
|
bottom: initialPadding.bottom
|
|
871
704
|
},
|
|
872
705
|
margin: {
|
|
873
|
-
indipendent:
|
|
706
|
+
indipendent: chunkJ36K7WVK_js.spacing.isIndipendent(
|
|
874
707
|
item.styles?.margin ?? ""
|
|
875
708
|
),
|
|
876
709
|
horizontal: initialMargin.left,
|
|
@@ -896,7 +729,7 @@ var ItemDesignForm = (props) => {
|
|
|
896
729
|
}
|
|
897
730
|
});
|
|
898
731
|
};
|
|
899
|
-
|
|
732
|
+
React12__namespace.useEffect(() => {
|
|
900
733
|
const subscription = form.watch(() => form.handleSubmit(onSubmit)());
|
|
901
734
|
return () => subscription.unsubscribe();
|
|
902
735
|
}, [form.watch, form.handleSubmit]);
|
|
@@ -904,135 +737,135 @@ var ItemDesignForm = (props) => {
|
|
|
904
737
|
"padding.indipendent",
|
|
905
738
|
"margin.indipendent"
|
|
906
739
|
]);
|
|
907
|
-
return /* @__PURE__ */
|
|
740
|
+
return /* @__PURE__ */ React12__namespace.createElement(Form, { ...form }, /* @__PURE__ */ React12__namespace.createElement("form", { onSubmit: form.handleSubmit(onSubmit) }, /* @__PURE__ */ React12__namespace.createElement("div", { className: "sb-space-y-4 sb-p-4" }, /* @__PURE__ */ React12__namespace.createElement(
|
|
908
741
|
FormField,
|
|
909
742
|
{
|
|
910
743
|
control: form.control,
|
|
911
744
|
name: "background",
|
|
912
|
-
render: ({ field }) => /* @__PURE__ */
|
|
745
|
+
render: ({ field }) => /* @__PURE__ */ React12__namespace.createElement(FormItem, null, /* @__PURE__ */ React12__namespace.createElement(FormLabel, null, "Achtergrond"), /* @__PURE__ */ React12__namespace.createElement(FormControl, null, /* @__PURE__ */ React12__namespace.createElement(
|
|
913
746
|
BackgroundPicker,
|
|
914
747
|
{
|
|
915
748
|
background: field.value,
|
|
916
749
|
onBackgroundChange: field.onChange
|
|
917
750
|
}
|
|
918
|
-
)), /* @__PURE__ */
|
|
751
|
+
)), /* @__PURE__ */ React12__namespace.createElement(FormMessage, null))
|
|
919
752
|
}
|
|
920
|
-
), /* @__PURE__ */
|
|
753
|
+
), /* @__PURE__ */ React12__namespace.createElement(
|
|
921
754
|
FormField,
|
|
922
755
|
{
|
|
923
756
|
control: form.control,
|
|
924
757
|
name: "color",
|
|
925
|
-
render: ({ field }) => /* @__PURE__ */
|
|
758
|
+
render: ({ field }) => /* @__PURE__ */ React12__namespace.createElement(FormItem, null, /* @__PURE__ */ React12__namespace.createElement(FormLabel, null, "Inhoud kleur"), /* @__PURE__ */ React12__namespace.createElement(FormControl, null, /* @__PURE__ */ React12__namespace.createElement(
|
|
926
759
|
ColorPicker,
|
|
927
760
|
{
|
|
928
761
|
color: field.value,
|
|
929
762
|
onColorChange: field.onChange
|
|
930
763
|
}
|
|
931
|
-
)), /* @__PURE__ */
|
|
764
|
+
)), /* @__PURE__ */ React12__namespace.createElement(FormMessage, null))
|
|
932
765
|
}
|
|
933
|
-
), /* @__PURE__ */
|
|
766
|
+
), /* @__PURE__ */ React12__namespace.createElement("hr", null), /* @__PURE__ */ React12__namespace.createElement(
|
|
934
767
|
FormField,
|
|
935
768
|
{
|
|
936
769
|
control: form.control,
|
|
937
770
|
name: "container",
|
|
938
|
-
render: ({ field }) => /* @__PURE__ */
|
|
771
|
+
render: ({ field }) => /* @__PURE__ */ React12__namespace.createElement(FormItem, { className: "sb-flex sb-flex-row sb-items-center sb-justify-between sb-space-y-0" }, /* @__PURE__ */ React12__namespace.createElement(FormLabel, null, "Volledige breedte"), /* @__PURE__ */ React12__namespace.createElement(FormControl, null, /* @__PURE__ */ React12__namespace.createElement(
|
|
939
772
|
Switch,
|
|
940
773
|
{
|
|
941
774
|
checked: !field.value,
|
|
942
775
|
onCheckedChange: (v) => field.onChange(!v)
|
|
943
776
|
}
|
|
944
|
-
)), /* @__PURE__ */
|
|
777
|
+
)), /* @__PURE__ */ React12__namespace.createElement(FormMessage, null))
|
|
945
778
|
}
|
|
946
|
-
), /* @__PURE__ */
|
|
779
|
+
), /* @__PURE__ */ React12__namespace.createElement("hr", null), /* @__PURE__ */ React12__namespace.createElement("div", { className: "sb-space-y-2" }, /* @__PURE__ */ React12__namespace.createElement(FormLabel, null, "Padding"), /* @__PURE__ */ React12__namespace.createElement("div", { className: "sb-grid sb-grid-cols-[1fr,auto] sb-gap-3" }, /* @__PURE__ */ React12__namespace.createElement("div", { className: "sb-grid sb-grid-cols-2 sb-items-center sb-gap-3" }, !indipendentPadding ? /* @__PURE__ */ React12__namespace.createElement(React12__namespace.Fragment, null, /* @__PURE__ */ React12__namespace.createElement(
|
|
947
780
|
FormField,
|
|
948
781
|
{
|
|
949
782
|
control: form.control,
|
|
950
783
|
name: "padding.horizontal",
|
|
951
|
-
render: ({ field }) => /* @__PURE__ */
|
|
784
|
+
render: ({ field }) => /* @__PURE__ */ React12__namespace.createElement(FormItem, null, /* @__PURE__ */ React12__namespace.createElement(FormControl, null, /* @__PURE__ */ React12__namespace.createElement(
|
|
952
785
|
AdvancedInput,
|
|
953
786
|
{
|
|
954
787
|
...field,
|
|
955
|
-
prepend: /* @__PURE__ */
|
|
956
|
-
append: /* @__PURE__ */
|
|
788
|
+
prepend: /* @__PURE__ */ React12__namespace.createElement(lucideReact.AlignHorizontalSpaceAroundIcon, { className: "sb-h-4 sb-w-4" }),
|
|
789
|
+
append: /* @__PURE__ */ React12__namespace.createElement("span", { className: "sb-text-muted-foreground" }, "px")
|
|
957
790
|
}
|
|
958
791
|
)))
|
|
959
792
|
}
|
|
960
|
-
), /* @__PURE__ */
|
|
793
|
+
), /* @__PURE__ */ React12__namespace.createElement(
|
|
961
794
|
FormField,
|
|
962
795
|
{
|
|
963
796
|
control: form.control,
|
|
964
797
|
name: "padding.vertical",
|
|
965
|
-
render: ({ field }) => /* @__PURE__ */
|
|
798
|
+
render: ({ field }) => /* @__PURE__ */ React12__namespace.createElement(FormItem, null, /* @__PURE__ */ React12__namespace.createElement(FormControl, null, /* @__PURE__ */ React12__namespace.createElement(
|
|
966
799
|
AdvancedInput,
|
|
967
800
|
{
|
|
968
801
|
...field,
|
|
969
|
-
prepend: /* @__PURE__ */
|
|
970
|
-
append: /* @__PURE__ */
|
|
802
|
+
prepend: /* @__PURE__ */ React12__namespace.createElement(lucideReact.AlignHorizontalSpaceAroundIcon, { className: "sb-h-4 sb-w-4 sb-rotate-90" }),
|
|
803
|
+
append: /* @__PURE__ */ React12__namespace.createElement("span", { className: "sb-text-muted-foreground" }, "px")
|
|
971
804
|
}
|
|
972
805
|
)))
|
|
973
806
|
}
|
|
974
|
-
)) : /* @__PURE__ */
|
|
807
|
+
)) : /* @__PURE__ */ React12__namespace.createElement(React12__namespace.Fragment, null, /* @__PURE__ */ React12__namespace.createElement(
|
|
975
808
|
FormField,
|
|
976
809
|
{
|
|
977
810
|
control: form.control,
|
|
978
811
|
name: "padding.left",
|
|
979
|
-
render: ({ field }) => /* @__PURE__ */
|
|
812
|
+
render: ({ field }) => /* @__PURE__ */ React12__namespace.createElement(FormItem, null, /* @__PURE__ */ React12__namespace.createElement(FormControl, null, /* @__PURE__ */ React12__namespace.createElement(
|
|
980
813
|
AdvancedInput,
|
|
981
814
|
{
|
|
982
815
|
...field,
|
|
983
|
-
prepend: /* @__PURE__ */
|
|
984
|
-
append: /* @__PURE__ */
|
|
816
|
+
prepend: /* @__PURE__ */ React12__namespace.createElement(lucideReact.AlignHorizontalJustifyStartIcon, { className: "sb-h-4 sb-w-4" }),
|
|
817
|
+
append: /* @__PURE__ */ React12__namespace.createElement("span", { className: "sb-text-muted-foreground" }, "px")
|
|
985
818
|
}
|
|
986
819
|
)))
|
|
987
820
|
}
|
|
988
|
-
), /* @__PURE__ */
|
|
821
|
+
), /* @__PURE__ */ React12__namespace.createElement(
|
|
989
822
|
FormField,
|
|
990
823
|
{
|
|
991
824
|
control: form.control,
|
|
992
825
|
name: "padding.top",
|
|
993
|
-
render: ({ field }) => /* @__PURE__ */
|
|
826
|
+
render: ({ field }) => /* @__PURE__ */ React12__namespace.createElement(FormItem, null, /* @__PURE__ */ React12__namespace.createElement(FormControl, null, /* @__PURE__ */ React12__namespace.createElement(
|
|
994
827
|
AdvancedInput,
|
|
995
828
|
{
|
|
996
829
|
...field,
|
|
997
|
-
prepend: /* @__PURE__ */
|
|
998
|
-
append: /* @__PURE__ */
|
|
830
|
+
prepend: /* @__PURE__ */ React12__namespace.createElement(lucideReact.AlignHorizontalJustifyStartIcon, { className: "sb-h-4 sb-w-4 sb-rotate-90" }),
|
|
831
|
+
append: /* @__PURE__ */ React12__namespace.createElement("span", { className: "sb-text-muted-foreground" }, "px")
|
|
999
832
|
}
|
|
1000
833
|
)))
|
|
1001
834
|
}
|
|
1002
|
-
), /* @__PURE__ */
|
|
835
|
+
), /* @__PURE__ */ React12__namespace.createElement(
|
|
1003
836
|
FormField,
|
|
1004
837
|
{
|
|
1005
838
|
control: form.control,
|
|
1006
839
|
name: "padding.right",
|
|
1007
|
-
render: ({ field }) => /* @__PURE__ */
|
|
840
|
+
render: ({ field }) => /* @__PURE__ */ React12__namespace.createElement(FormItem, null, /* @__PURE__ */ React12__namespace.createElement(FormControl, null, /* @__PURE__ */ React12__namespace.createElement(
|
|
1008
841
|
AdvancedInput,
|
|
1009
842
|
{
|
|
1010
843
|
...field,
|
|
1011
|
-
prepend: /* @__PURE__ */
|
|
1012
|
-
append: /* @__PURE__ */
|
|
844
|
+
prepend: /* @__PURE__ */ React12__namespace.createElement(lucideReact.AlignHorizontalJustifyStartIcon, { className: "sb-h-4 sb-w-4 sb-rotate-180" }),
|
|
845
|
+
append: /* @__PURE__ */ React12__namespace.createElement("span", { className: "sb-text-muted-foreground" }, "px")
|
|
1013
846
|
}
|
|
1014
847
|
)))
|
|
1015
848
|
}
|
|
1016
|
-
), /* @__PURE__ */
|
|
849
|
+
), /* @__PURE__ */ React12__namespace.createElement(
|
|
1017
850
|
FormField,
|
|
1018
851
|
{
|
|
1019
852
|
control: form.control,
|
|
1020
853
|
name: "padding.bottom",
|
|
1021
|
-
render: ({ field }) => /* @__PURE__ */
|
|
854
|
+
render: ({ field }) => /* @__PURE__ */ React12__namespace.createElement(FormItem, null, /* @__PURE__ */ React12__namespace.createElement(FormControl, null, /* @__PURE__ */ React12__namespace.createElement(
|
|
1022
855
|
AdvancedInput,
|
|
1023
856
|
{
|
|
1024
857
|
...field,
|
|
1025
|
-
prepend: /* @__PURE__ */
|
|
1026
|
-
append: /* @__PURE__ */
|
|
858
|
+
prepend: /* @__PURE__ */ React12__namespace.createElement(lucideReact.AlignHorizontalJustifyStartIcon, { className: "sb-h-4 sb-w-4 sb--rotate-90" }),
|
|
859
|
+
append: /* @__PURE__ */ React12__namespace.createElement("span", { className: "sb-text-muted-foreground" }, "px")
|
|
1027
860
|
}
|
|
1028
861
|
)))
|
|
1029
862
|
}
|
|
1030
|
-
))), /* @__PURE__ */
|
|
863
|
+
))), /* @__PURE__ */ React12__namespace.createElement("div", { className: "sb-shrink-0" }, /* @__PURE__ */ React12__namespace.createElement(
|
|
1031
864
|
FormField,
|
|
1032
865
|
{
|
|
1033
866
|
control: form.control,
|
|
1034
867
|
name: "padding.indipendent",
|
|
1035
|
-
render: ({ field }) => /* @__PURE__ */
|
|
868
|
+
render: ({ field }) => /* @__PURE__ */ React12__namespace.createElement(FormControl, null, /* @__PURE__ */ React12__namespace.createElement(
|
|
1036
869
|
Toggle,
|
|
1037
870
|
{
|
|
1038
871
|
className: "sb-shrink-0 sb-flex sb-w-8 sb-h-8 sb-p-0",
|
|
@@ -1041,99 +874,99 @@ var ItemDesignForm = (props) => {
|
|
|
1041
874
|
pressed: field.value,
|
|
1042
875
|
onPressedChange: field.onChange
|
|
1043
876
|
},
|
|
1044
|
-
/* @__PURE__ */
|
|
877
|
+
/* @__PURE__ */ React12__namespace.createElement(lucideReact.ScanIcon, { className: "sb-h-4 sb-w-4" })
|
|
1045
878
|
))
|
|
1046
879
|
}
|
|
1047
|
-
))), /* @__PURE__ */
|
|
880
|
+
))), /* @__PURE__ */ React12__namespace.createElement(FormMessage, null)), /* @__PURE__ */ React12__namespace.createElement("div", { className: "sb-space-y-2" }, /* @__PURE__ */ React12__namespace.createElement(FormLabel, null, "Margin"), /* @__PURE__ */ React12__namespace.createElement("div", { className: "sb-grid sb-grid-cols-[1fr,auto] sb-gap-3" }, /* @__PURE__ */ React12__namespace.createElement("div", { className: "sb-grid sb-grid-cols-2 sb-items-center sb-gap-3" }, !indipendentMargin ? /* @__PURE__ */ React12__namespace.createElement(React12__namespace.Fragment, null, /* @__PURE__ */ React12__namespace.createElement(
|
|
1048
881
|
FormField,
|
|
1049
882
|
{
|
|
1050
883
|
control: form.control,
|
|
1051
884
|
name: "margin.horizontal",
|
|
1052
|
-
render: ({ field }) => /* @__PURE__ */
|
|
885
|
+
render: ({ field }) => /* @__PURE__ */ React12__namespace.createElement(FormItem, null, /* @__PURE__ */ React12__namespace.createElement(FormControl, null, /* @__PURE__ */ React12__namespace.createElement(
|
|
1053
886
|
AdvancedInput,
|
|
1054
887
|
{
|
|
1055
888
|
...field,
|
|
1056
|
-
prepend: /* @__PURE__ */
|
|
1057
|
-
append: /* @__PURE__ */
|
|
889
|
+
prepend: /* @__PURE__ */ React12__namespace.createElement(lucideReact.AlignHorizontalSpaceAroundIcon, { className: "sb-h-4 sb-w-4" }),
|
|
890
|
+
append: /* @__PURE__ */ React12__namespace.createElement("span", { className: "sb-text-muted-foreground" }, "px")
|
|
1058
891
|
}
|
|
1059
892
|
)))
|
|
1060
893
|
}
|
|
1061
|
-
), /* @__PURE__ */
|
|
894
|
+
), /* @__PURE__ */ React12__namespace.createElement(
|
|
1062
895
|
FormField,
|
|
1063
896
|
{
|
|
1064
897
|
control: form.control,
|
|
1065
898
|
name: "margin.vertical",
|
|
1066
|
-
render: ({ field }) => /* @__PURE__ */
|
|
899
|
+
render: ({ field }) => /* @__PURE__ */ React12__namespace.createElement(FormItem, null, /* @__PURE__ */ React12__namespace.createElement(FormControl, null, /* @__PURE__ */ React12__namespace.createElement(
|
|
1067
900
|
AdvancedInput,
|
|
1068
901
|
{
|
|
1069
902
|
...field,
|
|
1070
|
-
prepend: /* @__PURE__ */
|
|
1071
|
-
append: /* @__PURE__ */
|
|
903
|
+
prepend: /* @__PURE__ */ React12__namespace.createElement(lucideReact.AlignHorizontalSpaceAroundIcon, { className: "sb-h-4 sb-w-4 sb-rotate-90" }),
|
|
904
|
+
append: /* @__PURE__ */ React12__namespace.createElement("span", { className: "sb-text-muted-foreground" }, "px")
|
|
1072
905
|
}
|
|
1073
906
|
)))
|
|
1074
907
|
}
|
|
1075
|
-
)) : /* @__PURE__ */
|
|
908
|
+
)) : /* @__PURE__ */ React12__namespace.createElement(React12__namespace.Fragment, null, /* @__PURE__ */ React12__namespace.createElement(
|
|
1076
909
|
FormField,
|
|
1077
910
|
{
|
|
1078
911
|
control: form.control,
|
|
1079
912
|
name: "margin.left",
|
|
1080
|
-
render: ({ field }) => /* @__PURE__ */
|
|
913
|
+
render: ({ field }) => /* @__PURE__ */ React12__namespace.createElement(FormItem, null, /* @__PURE__ */ React12__namespace.createElement(FormControl, null, /* @__PURE__ */ React12__namespace.createElement(
|
|
1081
914
|
AdvancedInput,
|
|
1082
915
|
{
|
|
1083
916
|
...field,
|
|
1084
|
-
prepend: /* @__PURE__ */
|
|
1085
|
-
append: /* @__PURE__ */
|
|
917
|
+
prepend: /* @__PURE__ */ React12__namespace.createElement(lucideReact.AlignHorizontalJustifyStartIcon, { className: "sb-h-4 sb-w-4" }),
|
|
918
|
+
append: /* @__PURE__ */ React12__namespace.createElement("span", { className: "sb-text-muted-foreground" }, "px")
|
|
1086
919
|
}
|
|
1087
920
|
)))
|
|
1088
921
|
}
|
|
1089
|
-
), /* @__PURE__ */
|
|
922
|
+
), /* @__PURE__ */ React12__namespace.createElement(
|
|
1090
923
|
FormField,
|
|
1091
924
|
{
|
|
1092
925
|
control: form.control,
|
|
1093
926
|
name: "margin.top",
|
|
1094
|
-
render: ({ field }) => /* @__PURE__ */
|
|
927
|
+
render: ({ field }) => /* @__PURE__ */ React12__namespace.createElement(FormItem, null, /* @__PURE__ */ React12__namespace.createElement(FormControl, null, /* @__PURE__ */ React12__namespace.createElement(
|
|
1095
928
|
AdvancedInput,
|
|
1096
929
|
{
|
|
1097
930
|
...field,
|
|
1098
|
-
prepend: /* @__PURE__ */
|
|
1099
|
-
append: /* @__PURE__ */
|
|
931
|
+
prepend: /* @__PURE__ */ React12__namespace.createElement(lucideReact.AlignHorizontalJustifyStartIcon, { className: "sb-h-4 sb-w-4 sb-rotate-90" }),
|
|
932
|
+
append: /* @__PURE__ */ React12__namespace.createElement("span", { className: "sb-text-muted-foreground" }, "px")
|
|
1100
933
|
}
|
|
1101
934
|
)))
|
|
1102
935
|
}
|
|
1103
|
-
), /* @__PURE__ */
|
|
936
|
+
), /* @__PURE__ */ React12__namespace.createElement(
|
|
1104
937
|
FormField,
|
|
1105
938
|
{
|
|
1106
939
|
control: form.control,
|
|
1107
940
|
name: "margin.right",
|
|
1108
|
-
render: ({ field }) => /* @__PURE__ */
|
|
941
|
+
render: ({ field }) => /* @__PURE__ */ React12__namespace.createElement(FormItem, null, /* @__PURE__ */ React12__namespace.createElement(FormControl, null, /* @__PURE__ */ React12__namespace.createElement(
|
|
1109
942
|
AdvancedInput,
|
|
1110
943
|
{
|
|
1111
944
|
...field,
|
|
1112
|
-
prepend: /* @__PURE__ */
|
|
1113
|
-
append: /* @__PURE__ */
|
|
945
|
+
prepend: /* @__PURE__ */ React12__namespace.createElement(lucideReact.AlignHorizontalJustifyStartIcon, { className: "sb-h-4 sb-w-4 sb-rotate-180" }),
|
|
946
|
+
append: /* @__PURE__ */ React12__namespace.createElement("span", { className: "sb-text-muted-foreground" }, "px")
|
|
1114
947
|
}
|
|
1115
948
|
)))
|
|
1116
949
|
}
|
|
1117
|
-
), /* @__PURE__ */
|
|
950
|
+
), /* @__PURE__ */ React12__namespace.createElement(
|
|
1118
951
|
FormField,
|
|
1119
952
|
{
|
|
1120
953
|
control: form.control,
|
|
1121
954
|
name: "margin.bottom",
|
|
1122
|
-
render: ({ field }) => /* @__PURE__ */
|
|
955
|
+
render: ({ field }) => /* @__PURE__ */ React12__namespace.createElement(FormItem, null, /* @__PURE__ */ React12__namespace.createElement(FormControl, null, /* @__PURE__ */ React12__namespace.createElement(
|
|
1123
956
|
AdvancedInput,
|
|
1124
957
|
{
|
|
1125
958
|
...field,
|
|
1126
|
-
prepend: /* @__PURE__ */
|
|
1127
|
-
append: /* @__PURE__ */
|
|
959
|
+
prepend: /* @__PURE__ */ React12__namespace.createElement(lucideReact.AlignHorizontalJustifyStartIcon, { className: "sb-h-4 sb-w-4 sb--rotate-90" }),
|
|
960
|
+
append: /* @__PURE__ */ React12__namespace.createElement("span", { className: "sb-text-muted-foreground" }, "px")
|
|
1128
961
|
}
|
|
1129
962
|
)))
|
|
1130
963
|
}
|
|
1131
|
-
))), /* @__PURE__ */
|
|
964
|
+
))), /* @__PURE__ */ React12__namespace.createElement("div", { className: "sb-shrink-0" }, /* @__PURE__ */ React12__namespace.createElement(
|
|
1132
965
|
FormField,
|
|
1133
966
|
{
|
|
1134
967
|
control: form.control,
|
|
1135
968
|
name: "margin.indipendent",
|
|
1136
|
-
render: ({ field }) => /* @__PURE__ */
|
|
969
|
+
render: ({ field }) => /* @__PURE__ */ React12__namespace.createElement(FormControl, null, /* @__PURE__ */ React12__namespace.createElement(
|
|
1137
970
|
Toggle,
|
|
1138
971
|
{
|
|
1139
972
|
className: "sb-shrink-0 sb-flex sb-w-8 sb-h-8 sb-p-0",
|
|
@@ -1142,38 +975,147 @@ var ItemDesignForm = (props) => {
|
|
|
1142
975
|
pressed: field.value,
|
|
1143
976
|
onPressedChange: field.onChange
|
|
1144
977
|
},
|
|
1145
|
-
/* @__PURE__ */
|
|
978
|
+
/* @__PURE__ */ React12__namespace.createElement(lucideReact.ScanIcon, { className: "sb-h-4 sb-w-4" })
|
|
1146
979
|
))
|
|
1147
980
|
}
|
|
1148
|
-
))), /* @__PURE__ */
|
|
981
|
+
))), /* @__PURE__ */ React12__namespace.createElement(FormMessage, null)))));
|
|
982
|
+
};
|
|
983
|
+
function Calendar({
|
|
984
|
+
className,
|
|
985
|
+
classNames,
|
|
986
|
+
showOutsideDays = true,
|
|
987
|
+
...props
|
|
988
|
+
}) {
|
|
989
|
+
return /* @__PURE__ */ React12__namespace.createElement(
|
|
990
|
+
reactDayPicker.DayPicker,
|
|
991
|
+
{
|
|
992
|
+
showOutsideDays,
|
|
993
|
+
className: chunkJ36K7WVK_js.cn("sb-p-3 sb-font-roboto", className),
|
|
994
|
+
classNames: {
|
|
995
|
+
months: "sb-flex sb-flex-col sm:sb-flex-row sb-space-y-4 sm:sb-space-x-4 sm:sb-space-y-0",
|
|
996
|
+
month: "sb-space-y-4",
|
|
997
|
+
caption: "sb-flex sb-justify-center sb-pt-1 sb-relative sb-items-center",
|
|
998
|
+
caption_label: "sb-text-sm sb-font-medium",
|
|
999
|
+
nav: "sb-space-x-1 sb-flex sb-items-center",
|
|
1000
|
+
nav_button: chunkJ36K7WVK_js.cn(
|
|
1001
|
+
chunkXEMUNFCV_js.buttonVariants({ variant: "outline" }),
|
|
1002
|
+
"sb-h-7 sb-w-7 sb-bg-transparent sb-p-0 sb-opacity-50 hover:sb-opacity-100"
|
|
1003
|
+
),
|
|
1004
|
+
nav_button_previous: "sb-absolute sb-left-1",
|
|
1005
|
+
nav_button_next: "sb-absolute sb-right-1",
|
|
1006
|
+
table: "sb-w-full sb-border-collapse sb-space-y-1",
|
|
1007
|
+
head_row: "sb-flex",
|
|
1008
|
+
head_cell: "sb-text-muted-foreground sb-rounded-md sb-w-8 sb-font-normal sb-text-[0.8rem]",
|
|
1009
|
+
row: "sb-flex sb-w-full sb-mt-2",
|
|
1010
|
+
cell: chunkJ36K7WVK_js.cn(
|
|
1011
|
+
"sb-relative sb-p-0 sb-text-center sb-text-sm focus-within:sb-relative focus-within:sb-z-20 [&:has([aria-selected])]:sb-bg-accent [&:has([aria-selected].day-outside)]:sb-bg-accent/50 [&:has([aria-selected].day-range-end)]:sb-rounded-r-md",
|
|
1012
|
+
props.mode === "range" ? "[&:has(>.day-range-end)]:sb-rounded-r-md [&:has(>.day-range-start)]:sb-rounded-l-md first:[&:has([aria-selected])]:sb-rounded-l-md last:[&:has([aria-selected])]:sb-rounded-r-md" : "[&:has([aria-selected])]:sb-rounded-md"
|
|
1013
|
+
),
|
|
1014
|
+
day: chunkJ36K7WVK_js.cn(
|
|
1015
|
+
chunkXEMUNFCV_js.buttonVariants({ variant: "ghost" }),
|
|
1016
|
+
"sb-h-8 sb-w-8 sb-p-0 sb-font-normal aria-selected:sb-opacity-100"
|
|
1017
|
+
),
|
|
1018
|
+
day_range_start: "day-range-start",
|
|
1019
|
+
day_range_end: "day-range-end",
|
|
1020
|
+
day_selected: "sb-bg-primary sb-text-primary-foreground hover:sb-bg-primary hover:sb-text-primary-foreground focus:sb-bg-primary focus:sb-text-primary-foreground",
|
|
1021
|
+
day_today: "sb-bg-accent sb-text-accent-foreground",
|
|
1022
|
+
day_outside: "day-outside sb-text-muted-foreground sb-opacity-50 aria-selected:sb-bg-accent/50 aria-selected:sb-text-muted-foreground aria-selected:sb-opacity-30",
|
|
1023
|
+
day_disabled: "sb-text-muted-foreground sb-opacity-50",
|
|
1024
|
+
day_range_middle: "aria-selected:sb-bg-accent aria-selected:sb-text-accent-foreground",
|
|
1025
|
+
day_hidden: "invisible",
|
|
1026
|
+
...classNames
|
|
1027
|
+
},
|
|
1028
|
+
components: {
|
|
1029
|
+
IconLeft: () => /* @__PURE__ */ React12__namespace.createElement(lucideReact.ChevronLeftIcon, { className: "sb-h-4 sb-w-4" }),
|
|
1030
|
+
IconRight: () => /* @__PURE__ */ React12__namespace.createElement(lucideReact.ChevronRightIcon, { className: "sb-h-4 sb-w-4" })
|
|
1031
|
+
},
|
|
1032
|
+
...props
|
|
1033
|
+
}
|
|
1034
|
+
);
|
|
1035
|
+
}
|
|
1036
|
+
Calendar.displayName = "Calendar";
|
|
1037
|
+
var Textarea = React12__namespace.forwardRef(
|
|
1038
|
+
({ className, ...props }, ref) => {
|
|
1039
|
+
return /* @__PURE__ */ React12__namespace.createElement(
|
|
1040
|
+
"textarea",
|
|
1041
|
+
{
|
|
1042
|
+
className: chunkJ36K7WVK_js.cn(
|
|
1043
|
+
"sb-flex sb-min-h-[60px] sb-font-roboto sb-w-full sb-rounded-md sb-border sb-border-input sb-bg-transparent sb-px-3 sb-py-2 sb-text-sm sb-shadow-sm placeholder:sb-text-muted-foreground focus-visible:sb-outline-none focus-visible:sb-ring-1 focus-visible:sb-ring-ring disabled:sb-cursor-not-allowed disabled:sb-opacity-50",
|
|
1044
|
+
className
|
|
1045
|
+
),
|
|
1046
|
+
ref,
|
|
1047
|
+
...props
|
|
1048
|
+
}
|
|
1049
|
+
);
|
|
1050
|
+
}
|
|
1051
|
+
);
|
|
1052
|
+
Textarea.displayName = "Textarea";
|
|
1053
|
+
|
|
1054
|
+
// src/components/container-item-form.tsx
|
|
1055
|
+
var ContainerItemForm = (props) => {
|
|
1056
|
+
const { item } = props;
|
|
1057
|
+
const { patchItem } = chunkXEMUNFCV_js.useBuilder();
|
|
1058
|
+
const component = chunkJ36K7WVK_js.builder.getComponent(item.component);
|
|
1059
|
+
if (!component) {
|
|
1060
|
+
throw new Error(
|
|
1061
|
+
`[simple-builder]: Component with id ${item.component} not found in container item form component`
|
|
1062
|
+
);
|
|
1063
|
+
}
|
|
1064
|
+
const form = reactHookForm.useForm({
|
|
1065
|
+
defaultValues: (component.inputs || []).reduce(
|
|
1066
|
+
(acc, input) => ({
|
|
1067
|
+
...acc,
|
|
1068
|
+
[input.name]: item?.props?.[input.name] ?? input.defaultValue
|
|
1069
|
+
}),
|
|
1070
|
+
{}
|
|
1071
|
+
)
|
|
1072
|
+
});
|
|
1073
|
+
const onSubmit = (values) => {
|
|
1074
|
+
patchItem(item.id, {
|
|
1075
|
+
props: values
|
|
1076
|
+
});
|
|
1077
|
+
};
|
|
1078
|
+
React12__namespace.useEffect(() => {
|
|
1079
|
+
const subscription = form.watch(() => form.handleSubmit(onSubmit)());
|
|
1080
|
+
return () => subscription.unsubscribe();
|
|
1081
|
+
}, [form.watch, form.handleSubmit]);
|
|
1082
|
+
return /* @__PURE__ */ React12__namespace.createElement(Form, { ...form }, /* @__PURE__ */ React12__namespace.createElement("form", { onSubmit: form.handleSubmit(onSubmit) }, /* @__PURE__ */ React12__namespace.createElement("div", { className: "sb-space-y-4 sb-p-4" }, (component.inputs || []).map((input) => /* @__PURE__ */ React12__namespace.createElement(
|
|
1083
|
+
FormField,
|
|
1084
|
+
{
|
|
1085
|
+
key: input.name,
|
|
1086
|
+
control: form.control,
|
|
1087
|
+
name: input.name,
|
|
1088
|
+
render: ({ field }) => /* @__PURE__ */ React12__namespace.createElement(RenderInput, { type: input.type, input, field })
|
|
1089
|
+
}
|
|
1090
|
+
)))));
|
|
1149
1091
|
};
|
|
1150
1092
|
var RenderInput = (props) => {
|
|
1151
1093
|
const { type, input, field } = props;
|
|
1152
1094
|
switch (type) {
|
|
1153
1095
|
case "string":
|
|
1154
|
-
return /* @__PURE__ */
|
|
1096
|
+
return /* @__PURE__ */ React12__namespace.createElement(FormItem, null, /* @__PURE__ */ React12__namespace.createElement(FormLabel, null, input.friendlyName || input.name), /* @__PURE__ */ React12__namespace.createElement(FormControl, null, /* @__PURE__ */ React12__namespace.createElement(Input, { ...field })), input.helperText && /* @__PURE__ */ React12__namespace.createElement(FormDescription, null, input.helperText), /* @__PURE__ */ React12__namespace.createElement(FormMessage, null));
|
|
1155
1097
|
case "longText":
|
|
1156
|
-
return /* @__PURE__ */
|
|
1098
|
+
return /* @__PURE__ */ React12__namespace.createElement(FormItem, null, /* @__PURE__ */ React12__namespace.createElement(FormLabel, null, input.friendlyName || input.name), /* @__PURE__ */ React12__namespace.createElement(FormControl, null, /* @__PURE__ */ React12__namespace.createElement(Textarea, { ...field })), input.helperText && /* @__PURE__ */ React12__namespace.createElement(FormDescription, null, input.helperText), /* @__PURE__ */ React12__namespace.createElement(FormMessage, null));
|
|
1157
1099
|
case "richText":
|
|
1158
|
-
return /* @__PURE__ */
|
|
1100
|
+
return /* @__PURE__ */ React12__namespace.createElement(FormItem, null, /* @__PURE__ */ React12__namespace.createElement(FormLabel, null, input.friendlyName || input.name), /* @__PURE__ */ React12__namespace.createElement(FormControl, null, /* @__PURE__ */ React12__namespace.createElement(Textarea, { ...field })), input.helperText && /* @__PURE__ */ React12__namespace.createElement(FormDescription, null, input.helperText), /* @__PURE__ */ React12__namespace.createElement(FormMessage, null));
|
|
1159
1101
|
case "number":
|
|
1160
|
-
return /* @__PURE__ */
|
|
1102
|
+
return /* @__PURE__ */ React12__namespace.createElement(FormItem, null, /* @__PURE__ */ React12__namespace.createElement(FormLabel, null, input.friendlyName || input.name), /* @__PURE__ */ React12__namespace.createElement(FormControl, null, /* @__PURE__ */ React12__namespace.createElement(Input, { type: "number", ...field })), input.helperText && /* @__PURE__ */ React12__namespace.createElement(FormDescription, null, input.helperText), /* @__PURE__ */ React12__namespace.createElement(FormMessage, null));
|
|
1161
1103
|
case "color":
|
|
1162
|
-
return /* @__PURE__ */
|
|
1104
|
+
return /* @__PURE__ */ React12__namespace.createElement(FormItem, null, /* @__PURE__ */ React12__namespace.createElement(FormLabel, null, input.friendlyName || input.name), /* @__PURE__ */ React12__namespace.createElement(FormControl, null, /* @__PURE__ */ React12__namespace.createElement(ColorPicker, { color: field.value, onColorChange: field.onChange })), input.helperText && /* @__PURE__ */ React12__namespace.createElement(FormDescription, null, input.helperText), /* @__PURE__ */ React12__namespace.createElement(FormMessage, null));
|
|
1163
1105
|
case "date":
|
|
1164
|
-
return /* @__PURE__ */
|
|
1165
|
-
|
|
1106
|
+
return /* @__PURE__ */ React12__namespace.createElement(FormItem, null, /* @__PURE__ */ React12__namespace.createElement(FormLabel, null, input.friendlyName || input.name), /* @__PURE__ */ React12__namespace.createElement(FormControl, null, /* @__PURE__ */ React12__namespace.createElement(Popover, null, /* @__PURE__ */ React12__namespace.createElement(PopoverTrigger, { asChild: true }, /* @__PURE__ */ React12__namespace.createElement(
|
|
1107
|
+
chunkXEMUNFCV_js.Button,
|
|
1166
1108
|
{
|
|
1167
1109
|
variant: "outline",
|
|
1168
1110
|
size: "sm",
|
|
1169
|
-
className:
|
|
1111
|
+
className: chunkJ36K7WVK_js.cn(
|
|
1170
1112
|
"sb-w-full sb-flex sb-justify-start sb-text-left sb-font-normal",
|
|
1171
1113
|
!field.value && "sb-text-muted-foreground"
|
|
1172
1114
|
)
|
|
1173
1115
|
},
|
|
1174
|
-
/* @__PURE__ */
|
|
1175
|
-
field.value ? dateFns.format(field.value, "PPP") : /* @__PURE__ */
|
|
1176
|
-
)), /* @__PURE__ */
|
|
1116
|
+
/* @__PURE__ */ React12__namespace.createElement(lucideReact.CalendarIcon, { className: "sb-mr-2 sb-h-4 sb-w-4" }),
|
|
1117
|
+
field.value ? dateFns.format(field.value, "PPP") : /* @__PURE__ */ React12__namespace.createElement("span", null, "Pick a date")
|
|
1118
|
+
)), /* @__PURE__ */ React12__namespace.createElement(PopoverContent, { className: "sb-w-auto sb-p-0", align: "start" }, /* @__PURE__ */ React12__namespace.createElement(
|
|
1177
1119
|
Calendar,
|
|
1178
1120
|
{
|
|
1179
1121
|
mode: "single",
|
|
@@ -1181,11 +1123,11 @@ var RenderInput = (props) => {
|
|
|
1181
1123
|
onSelect: field.onChange,
|
|
1182
1124
|
initialFocus: true
|
|
1183
1125
|
}
|
|
1184
|
-
)))), input.helperText && /* @__PURE__ */
|
|
1126
|
+
)))), input.helperText && /* @__PURE__ */ React12__namespace.createElement(FormDescription, null, input.helperText), /* @__PURE__ */ React12__namespace.createElement(FormMessage, null));
|
|
1185
1127
|
case "boolean":
|
|
1186
|
-
return /* @__PURE__ */
|
|
1128
|
+
return /* @__PURE__ */ React12__namespace.createElement(FormItem, { className: "sb-flex sb-flex-row sb-items-center sb-justify-between sb-space-y-0" }, /* @__PURE__ */ React12__namespace.createElement(FormLabel, null, input.friendlyName || input.name), /* @__PURE__ */ React12__namespace.createElement(FormControl, null, /* @__PURE__ */ React12__namespace.createElement(Switch, { checked: field.value, onCheckedChange: field.onChange })), input.helperText && /* @__PURE__ */ React12__namespace.createElement(FormDescription, null, input.helperText), /* @__PURE__ */ React12__namespace.createElement(FormMessage, null));
|
|
1187
1129
|
case "file":
|
|
1188
|
-
return /* @__PURE__ */
|
|
1130
|
+
return /* @__PURE__ */ React12__namespace.createElement(FormItem, null, /* @__PURE__ */ React12__namespace.createElement(FormLabel, null, input.friendlyName || input.name), /* @__PURE__ */ React12__namespace.createElement(FormControl, null, /* @__PURE__ */ React12__namespace.createElement(
|
|
1189
1131
|
MediaInput,
|
|
1190
1132
|
{
|
|
1191
1133
|
className: "sb-grid sb-grid-cols-2 sb-gap-1",
|
|
@@ -1197,54 +1139,81 @@ var RenderInput = (props) => {
|
|
|
1197
1139
|
"media-input: Error: " + e?.description
|
|
1198
1140
|
)
|
|
1199
1141
|
}
|
|
1200
|
-
)), input.helperText && /* @__PURE__ */
|
|
1142
|
+
)), input.helperText && /* @__PURE__ */ React12__namespace.createElement(FormDescription, null, input.helperText), /* @__PURE__ */ React12__namespace.createElement(FormMessage, null));
|
|
1201
1143
|
default:
|
|
1202
1144
|
throw new Error(
|
|
1203
1145
|
`[simple-builder]: Input type "${props.type}" not supported`
|
|
1204
1146
|
);
|
|
1205
1147
|
}
|
|
1206
1148
|
};
|
|
1149
|
+
|
|
1150
|
+
// src/components/container-item-toolbar.tsx
|
|
1151
|
+
var ContainerItemToolbar = (props) => {
|
|
1152
|
+
const { contentId, canBringUp = false, canBringDown = false } = props;
|
|
1153
|
+
const { bringUp, bringDown } = chunkXEMUNFCV_js.useBuilder();
|
|
1154
|
+
return /* @__PURE__ */ React12__namespace.createElement("div", { className: "sb-absolute sb-z-20 sb-top-1 sb-right-1 sb-rounded-md sb-shadow sb-flex sb-flex-col sb-gap-1 sb-p-1 sb-bg-card sb-text-card-foreground sb-item-toolbar sb-opacity-0 sb-transition-opacity" }, /* @__PURE__ */ React12__namespace.createElement("div", { className: "sb-h-10 sb-p-1 sb-border sb-border-input sb-bg-background sb-rounded-md sb-text-sm sb-font-medium sb-flex sb-gap-1 sb-items-center sb-justify-start" }, /* @__PURE__ */ React12__namespace.createElement(EditButton, { id: contentId }), /* @__PURE__ */ React12__namespace.createElement(
|
|
1155
|
+
chunkXEMUNFCV_js.Button,
|
|
1156
|
+
{
|
|
1157
|
+
variant: "ghost",
|
|
1158
|
+
className: "sb-w-8 sb-h-8 sb-p-0",
|
|
1159
|
+
onClick: () => bringUp(contentId),
|
|
1160
|
+
disabled: !canBringUp
|
|
1161
|
+
},
|
|
1162
|
+
/* @__PURE__ */ React12__namespace.createElement(lucideReact.ArrowUp, { className: "sb-h-5 sb-w-5" })
|
|
1163
|
+
), /* @__PURE__ */ React12__namespace.createElement(
|
|
1164
|
+
chunkXEMUNFCV_js.Button,
|
|
1165
|
+
{
|
|
1166
|
+
variant: "ghost",
|
|
1167
|
+
className: "sb-w-8 sb-h-8 sb-p-0",
|
|
1168
|
+
onClick: () => bringDown(contentId),
|
|
1169
|
+
disabled: !canBringDown
|
|
1170
|
+
},
|
|
1171
|
+
/* @__PURE__ */ React12__namespace.createElement(lucideReact.ArrowDown, { className: "sb-h-5 sb-w-5" })
|
|
1172
|
+
), /* @__PURE__ */ React12__namespace.createElement(DeleteButton, { contentId })));
|
|
1173
|
+
};
|
|
1174
|
+
var EditButton = ({ id }) => {
|
|
1175
|
+
return /* @__PURE__ */ React12__namespace.createElement(Popover, null, /* @__PURE__ */ React12__namespace.createElement(PopoverTrigger, { asChild: true }, /* @__PURE__ */ React12__namespace.createElement(chunkXEMUNFCV_js.Button, { variant: "ghost", className: "sb-w-8 sb-h-8 sb-p-0" }, /* @__PURE__ */ React12__namespace.createElement(lucideReact.Edit2Icon, { className: "sb-h-5 sb-w-5" }))), /* @__PURE__ */ React12__namespace.createElement(
|
|
1176
|
+
PopoverContent,
|
|
1177
|
+
{
|
|
1178
|
+
side: "left",
|
|
1179
|
+
align: "start",
|
|
1180
|
+
sideOffset: 16,
|
|
1181
|
+
alignOffset: -8,
|
|
1182
|
+
className: "sb-p-0",
|
|
1183
|
+
collisionPadding: 16
|
|
1184
|
+
},
|
|
1185
|
+
/* @__PURE__ */ React12__namespace.createElement(EditPopoverInner, { id })
|
|
1186
|
+
));
|
|
1187
|
+
};
|
|
1188
|
+
var EditPopoverInner = (props) => {
|
|
1189
|
+
const { id } = props;
|
|
1190
|
+
const { getItem } = chunkXEMUNFCV_js.useBuilder();
|
|
1191
|
+
const item = getItem(id);
|
|
1192
|
+
if (!item) {
|
|
1193
|
+
throw new Error(
|
|
1194
|
+
`[simple-builder]: Item with id ${id} not found in container item form component`
|
|
1195
|
+
);
|
|
1196
|
+
}
|
|
1197
|
+
return /* @__PURE__ */ React12__namespace.createElement(Tabs, null, /* @__PURE__ */ React12__namespace.createElement(TabsList, { defaultValue: "content" }, /* @__PURE__ */ React12__namespace.createElement(TabsTrigger, { value: "content" }, "Inhoud"), /* @__PURE__ */ React12__namespace.createElement(TabsTrigger, { value: "design" }, "Design")), /* @__PURE__ */ React12__namespace.createElement(TabsContent, { value: "content" }, /* @__PURE__ */ React12__namespace.createElement(ContainerItemForm, { item })), /* @__PURE__ */ React12__namespace.createElement(TabsContent, { value: "design" }, /* @__PURE__ */ React12__namespace.createElement(ItemDesignForm, { item })));
|
|
1198
|
+
};
|
|
1207
1199
|
var DeleteButton = ({ contentId }) => {
|
|
1208
|
-
const { deleteContent } =
|
|
1209
|
-
return /* @__PURE__ */
|
|
1210
|
-
|
|
1200
|
+
const { deleteContent } = chunkXEMUNFCV_js.useBuilder();
|
|
1201
|
+
return /* @__PURE__ */ React12__namespace.createElement(AlertDialog, null, /* @__PURE__ */ React12__namespace.createElement(AlertDialogTrigger, { asChild: true }, /* @__PURE__ */ React12__namespace.createElement(
|
|
1202
|
+
chunkXEMUNFCV_js.Button,
|
|
1211
1203
|
{
|
|
1212
1204
|
variant: "ghost",
|
|
1213
1205
|
className: "sb-w-8 sb-h-8 sb-p-0 sb-text-destructive"
|
|
1214
1206
|
},
|
|
1215
|
-
/* @__PURE__ */
|
|
1216
|
-
)), /* @__PURE__ */
|
|
1207
|
+
/* @__PURE__ */ React12__namespace.createElement(lucideReact.Trash2Icon, { className: "sb-h-5 sb-w-5" })
|
|
1208
|
+
)), /* @__PURE__ */ React12__namespace.createElement(AlertDialogContent, null, /* @__PURE__ */ React12__namespace.createElement(AlertDialogDescription, null, "Weet je zeker dat je dit blok wilt verwijderen?"), /* @__PURE__ */ React12__namespace.createElement(AlertDialogFooter, null, /* @__PURE__ */ React12__namespace.createElement(AlertDialogCancel, null, "Annuleren"), /* @__PURE__ */ React12__namespace.createElement(
|
|
1217
1209
|
AlertDialogAction,
|
|
1218
1210
|
{
|
|
1219
|
-
className:
|
|
1211
|
+
className: chunkXEMUNFCV_js.buttonVariants({ variant: "destructive" }),
|
|
1220
1212
|
onClick: () => deleteContent(contentId)
|
|
1221
1213
|
},
|
|
1222
1214
|
"Verwijderen"
|
|
1223
1215
|
))));
|
|
1224
1216
|
};
|
|
1225
|
-
var DesignWrapper = (props) => {
|
|
1226
|
-
const { children, className, styles } = props;
|
|
1227
|
-
const { container = true, background, ...rest } = styles || {};
|
|
1228
|
-
const matches = typeof background === "string" ? background.match(/url\(["']?(.*?)["']?\)/) : void 0;
|
|
1229
|
-
const src = matches ? matches[1] : void 0;
|
|
1230
|
-
return /* @__PURE__ */ React15__namespace.createElement(
|
|
1231
|
-
"div",
|
|
1232
|
-
{
|
|
1233
|
-
className: chunk3S4FFEHM_js.cn("sb-relative", className),
|
|
1234
|
-
style: { ...!src && { background }, ...rest }
|
|
1235
|
-
},
|
|
1236
|
-
src && /* @__PURE__ */ React15__namespace.createElement(
|
|
1237
|
-
Image,
|
|
1238
|
-
{
|
|
1239
|
-
src,
|
|
1240
|
-
alt: "",
|
|
1241
|
-
fill: true,
|
|
1242
|
-
className: "sb-object-cover sb-absolute sb-inset-0 sb-pointer-events-none sb--z-[1]"
|
|
1243
|
-
}
|
|
1244
|
-
),
|
|
1245
|
-
container ? /* @__PURE__ */ React15__namespace.createElement("div", { className: "sb-container sb-mx-auto" }, children) : children
|
|
1246
|
-
);
|
|
1247
|
-
};
|
|
1248
1217
|
|
|
1249
1218
|
// src/components/build-container-client.tsx
|
|
1250
1219
|
var BuildContainerInner = (props) => {
|
|
@@ -1255,14 +1224,14 @@ var BuildContainerInner = (props) => {
|
|
|
1255
1224
|
"[simple-builder]: Multiple content blocks detected when using property multiple false."
|
|
1256
1225
|
);
|
|
1257
1226
|
}
|
|
1258
|
-
return /* @__PURE__ */
|
|
1227
|
+
return /* @__PURE__ */ React12__namespace.createElement("div", null, items.length <= 0 ? /* @__PURE__ */ React12__namespace.createElement(AddContentPlaceholder, { parent: id, container: name, index: 0 }) : multiple && /* @__PURE__ */ React12__namespace.createElement(AddContentDividerButton, { parent: id, container: name, index: 0 }), items.map((item, i) => /* @__PURE__ */ React12__namespace.createElement(React12__namespace.Fragment, { key: item.id }, /* @__PURE__ */ React12__namespace.createElement("div", { className: "sb-relative sb-container-item" }, /* @__PURE__ */ React12__namespace.createElement(chunkJ36K7WVK_js.DesignWrapper, { styles: item.styles }, chunkJ36K7WVK_js.builder.bindComponent(item, true)), /* @__PURE__ */ React12__namespace.createElement(
|
|
1259
1228
|
ContainerItemToolbar,
|
|
1260
1229
|
{
|
|
1261
1230
|
contentId: item.id,
|
|
1262
1231
|
canBringUp: i > 0,
|
|
1263
1232
|
canBringDown: i < items.length - 1
|
|
1264
1233
|
}
|
|
1265
|
-
)), multiple && /* @__PURE__ */
|
|
1234
|
+
)), multiple && /* @__PURE__ */ React12__namespace.createElement(
|
|
1266
1235
|
AddContentDividerButton,
|
|
1267
1236
|
{
|
|
1268
1237
|
parent: id,
|
|
@@ -1273,12 +1242,12 @@ var BuildContainerInner = (props) => {
|
|
|
1273
1242
|
};
|
|
1274
1243
|
var build_container_client_default = BuildContainerInner;
|
|
1275
1244
|
var AddContentButton = (props) => {
|
|
1276
|
-
const components =
|
|
1277
|
-
const { addContent } =
|
|
1278
|
-
return /* @__PURE__ */
|
|
1245
|
+
const components = chunkJ36K7WVK_js.builder.getComponents();
|
|
1246
|
+
const { addContent } = chunkXEMUNFCV_js.useBuilder();
|
|
1247
|
+
return /* @__PURE__ */ React12__namespace.createElement(Popover, null, /* @__PURE__ */ React12__namespace.createElement(PopoverTrigger, { asChild: true }, props.children), /* @__PURE__ */ React12__namespace.createElement(PopoverContent, { className: "sb-p-1" }, /* @__PURE__ */ React12__namespace.createElement("div", { className: "sb-grid sb-grid-cols-2 sb-gap-2" }, components.map((component) => {
|
|
1279
1248
|
const Icon = component.icon ?? lucideReact.ImageIcon;
|
|
1280
|
-
return /* @__PURE__ */
|
|
1281
|
-
|
|
1249
|
+
return /* @__PURE__ */ React12__namespace.createElement(PopoverClose, { key: component.name, asChild: true }, /* @__PURE__ */ React12__namespace.createElement(
|
|
1250
|
+
chunkXEMUNFCV_js.Button,
|
|
1282
1251
|
{
|
|
1283
1252
|
variant: "ghost",
|
|
1284
1253
|
className: "sb-justify-start",
|
|
@@ -1291,25 +1260,24 @@ var AddContentButton = (props) => {
|
|
|
1291
1260
|
);
|
|
1292
1261
|
}
|
|
1293
1262
|
},
|
|
1294
|
-
/* @__PURE__ */
|
|
1263
|
+
/* @__PURE__ */ React12__namespace.createElement(Icon, { className: "sb-mr-2 sb-h-4 sb-w-4 sb-shrink-0" }),
|
|
1295
1264
|
component.friendlyName ?? component.name
|
|
1296
1265
|
));
|
|
1297
1266
|
}))));
|
|
1298
1267
|
};
|
|
1299
1268
|
var AddContentPlaceholder = (props) => {
|
|
1300
|
-
return /* @__PURE__ */
|
|
1269
|
+
return /* @__PURE__ */ React12__namespace.createElement(AddContentButton, { ...props }, /* @__PURE__ */ React12__namespace.createElement("div", { className: "sb-flex sb-justify-center sb-bg-primary/50 p-4" }, /* @__PURE__ */ React12__namespace.createElement(chunkXEMUNFCV_js.Button, { size: "sm" }, /* @__PURE__ */ React12__namespace.createElement(lucideReact.PlusIcon, { className: "sb-mr-2 sb-h-4 sb-w-4" }), "Blok Toevoegen")));
|
|
1301
1270
|
};
|
|
1302
1271
|
var AddContentDividerButton = (props) => {
|
|
1303
|
-
return /* @__PURE__ */
|
|
1304
|
-
|
|
1272
|
+
return /* @__PURE__ */ React12__namespace.createElement(AddContentButton, { ...props }, /* @__PURE__ */ React12__namespace.createElement("div", { className: "sb-w-full sb-h-1 sb--my-[2px] sb-bg-primary sb-relative sb-z-20 sb-opacity-0 add-content-divider-button sb-transition-opacity" }, /* @__PURE__ */ React12__namespace.createElement(
|
|
1273
|
+
chunkXEMUNFCV_js.Button,
|
|
1305
1274
|
{
|
|
1306
1275
|
size: "sm",
|
|
1307
1276
|
className: "sb-absolute sb-left-1/2 sb-top-1/2 sb--translate-y-1/2 sb--translate-x-1/2 sb-shadow"
|
|
1308
1277
|
},
|
|
1309
|
-
/* @__PURE__ */
|
|
1278
|
+
/* @__PURE__ */ React12__namespace.createElement(lucideReact.PlusIcon, { className: "sb-mr-2 sb-h-4 sb-w-4" }),
|
|
1310
1279
|
"Blok Toevoegen"
|
|
1311
1280
|
)));
|
|
1312
1281
|
};
|
|
1313
1282
|
|
|
1314
|
-
exports
|
|
1315
|
-
exports.default = build_container_client_default;
|
|
1283
|
+
module.exports = build_container_client_default;
|