@native-systems/ui 1.0.11 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -3,8 +3,8 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var jsxRuntime = require('react/jsx-runtime');
6
- var reactHookForm = require('react-hook-form');
7
6
  var React = require('react');
7
+ var reactHookForm = require('react-hook-form');
8
8
  var utility = require('@native-systems/utility');
9
9
 
10
10
  function _interopNamespaceDefault(e) {
@@ -34,6 +34,254 @@ function _interopNamespaceDefault(e) {
34
34
 
35
35
  var React__namespace = /*#__PURE__*/ _interopNamespaceDefault(React);
36
36
 
37
+ function MainContentFrame({ children }) {
38
+ return jsxRuntime.jsx('main', {
39
+ className:
40
+ 'w-full pb-2 overflow-hidden bg-zinc-100 lg:pt-2 lg:pr-2 dark:bg-zinc-950',
41
+ children: jsxRuntime.jsx('div', {
42
+ className:
43
+ 'w-full h-full p-6 content-canvas bg-white border-zinc-950/10 lg:p-10 lg:border lg:rounded-lg lg:shadow-xs dark:bg-zinc-900 dark:border-white/5',
44
+ children: jsxRuntime.jsx('div', {
45
+ className: 'mx-auto max-w-[1400px]',
46
+ children: children,
47
+ }),
48
+ }),
49
+ });
50
+ }
51
+
52
+ function ChevronDoubleLeftIcon({ title, titleId, ...props }, svgRef) {
53
+ return /*#__PURE__*/ React__namespace.createElement(
54
+ 'svg',
55
+ Object.assign(
56
+ {
57
+ 'xmlns': 'http://www.w3.org/2000/svg',
58
+ 'viewBox': '0 0 20 20',
59
+ 'fill': 'currentColor',
60
+ 'aria-hidden': 'true',
61
+ 'data-slot': 'icon',
62
+ 'ref': svgRef,
63
+ 'aria-labelledby': titleId,
64
+ },
65
+ props
66
+ ),
67
+ title
68
+ ? /*#__PURE__*/ React__namespace.createElement(
69
+ 'title',
70
+ {
71
+ id: titleId,
72
+ },
73
+ title
74
+ )
75
+ : null,
76
+ /*#__PURE__*/ React__namespace.createElement('path', {
77
+ fillRule: 'evenodd',
78
+ d: 'M4.72 9.47a.75.75 0 0 0 0 1.06l4.25 4.25a.75.75 0 1 0 1.06-1.06L6.31 10l3.72-3.72a.75.75 0 1 0-1.06-1.06L4.72 9.47Zm9.25-4.25L9.72 9.47a.75.75 0 0 0 0 1.06l4.25 4.25a.75.75 0 1 0 1.06-1.06L11.31 10l3.72-3.72a.75.75 0 0 0-1.06-1.06Z',
79
+ clipRule: 'evenodd',
80
+ })
81
+ );
82
+ }
83
+ const ForwardRef$5 = /*#__PURE__*/ React__namespace.forwardRef(
84
+ ChevronDoubleLeftIcon
85
+ );
86
+
87
+ function ChevronDoubleRightIcon({ title, titleId, ...props }, svgRef) {
88
+ return /*#__PURE__*/ React__namespace.createElement(
89
+ 'svg',
90
+ Object.assign(
91
+ {
92
+ 'xmlns': 'http://www.w3.org/2000/svg',
93
+ 'viewBox': '0 0 20 20',
94
+ 'fill': 'currentColor',
95
+ 'aria-hidden': 'true',
96
+ 'data-slot': 'icon',
97
+ 'ref': svgRef,
98
+ 'aria-labelledby': titleId,
99
+ },
100
+ props
101
+ ),
102
+ title
103
+ ? /*#__PURE__*/ React__namespace.createElement(
104
+ 'title',
105
+ {
106
+ id: titleId,
107
+ },
108
+ title
109
+ )
110
+ : null,
111
+ /*#__PURE__*/ React__namespace.createElement('path', {
112
+ fillRule: 'evenodd',
113
+ d: 'M15.28 9.47a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 1 1-1.06-1.06L13.69 10 9.97 6.28a.75.75 0 0 1 1.06-1.06l4.25 4.25ZM6.03 5.22l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06-1.06L8.69 10 4.97 6.28a.75.75 0 0 1 1.06-1.06Z',
114
+ clipRule: 'evenodd',
115
+ })
116
+ );
117
+ }
118
+ const ForwardRef$4 = /*#__PURE__*/ React__namespace.forwardRef(
119
+ ChevronDoubleRightIcon
120
+ );
121
+
122
+ function ChevronLeftIcon({ title, titleId, ...props }, svgRef) {
123
+ return /*#__PURE__*/ React__namespace.createElement(
124
+ 'svg',
125
+ Object.assign(
126
+ {
127
+ 'xmlns': 'http://www.w3.org/2000/svg',
128
+ 'viewBox': '0 0 20 20',
129
+ 'fill': 'currentColor',
130
+ 'aria-hidden': 'true',
131
+ 'data-slot': 'icon',
132
+ 'ref': svgRef,
133
+ 'aria-labelledby': titleId,
134
+ },
135
+ props
136
+ ),
137
+ title
138
+ ? /*#__PURE__*/ React__namespace.createElement(
139
+ 'title',
140
+ {
141
+ id: titleId,
142
+ },
143
+ title
144
+ )
145
+ : null,
146
+ /*#__PURE__*/ React__namespace.createElement('path', {
147
+ fillRule: 'evenodd',
148
+ d: 'M11.78 5.22a.75.75 0 0 1 0 1.06L8.06 10l3.72 3.72a.75.75 0 1 1-1.06 1.06l-4.25-4.25a.75.75 0 0 1 0-1.06l4.25-4.25a.75.75 0 0 1 1.06 0Z',
149
+ clipRule: 'evenodd',
150
+ })
151
+ );
152
+ }
153
+ const ForwardRef$3 = /*#__PURE__*/ React__namespace.forwardRef(ChevronLeftIcon);
154
+
155
+ function ChevronRightIcon({ title, titleId, ...props }, svgRef) {
156
+ return /*#__PURE__*/ React__namespace.createElement(
157
+ 'svg',
158
+ Object.assign(
159
+ {
160
+ 'xmlns': 'http://www.w3.org/2000/svg',
161
+ 'viewBox': '0 0 20 20',
162
+ 'fill': 'currentColor',
163
+ 'aria-hidden': 'true',
164
+ 'data-slot': 'icon',
165
+ 'ref': svgRef,
166
+ 'aria-labelledby': titleId,
167
+ },
168
+ props
169
+ ),
170
+ title
171
+ ? /*#__PURE__*/ React__namespace.createElement(
172
+ 'title',
173
+ {
174
+ id: titleId,
175
+ },
176
+ title
177
+ )
178
+ : null,
179
+ /*#__PURE__*/ React__namespace.createElement('path', {
180
+ fillRule: 'evenodd',
181
+ d: 'M8.22 5.22a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06-1.06L11.94 10 8.22 6.28a.75.75 0 0 1 0-1.06Z',
182
+ clipRule: 'evenodd',
183
+ })
184
+ );
185
+ }
186
+ const ForwardRef$2 =
187
+ /*#__PURE__*/ React__namespace.forwardRef(ChevronRightIcon);
188
+
189
+ function Pagination({
190
+ currentPage,
191
+ totalPages,
192
+ hasPrevPage,
193
+ hasNextPage,
194
+ goToFirstPage,
195
+ goToPreviousPage,
196
+ goToNextPage,
197
+ goToLastPage,
198
+ }) {
199
+ if (totalPages === 0) {
200
+ return null;
201
+ }
202
+ return jsxRuntime.jsxs('div', {
203
+ className: 'w-full flex justify-center items-center gap-x-2 mt-6',
204
+ children: [
205
+ jsxRuntime.jsx('button', {
206
+ 'onClick': goToFirstPage,
207
+ 'disabled': !hasPrevPage,
208
+ 'aria-label': 'Zur ersten Seite',
209
+ 'className':
210
+ 'flex gap-0.5 px-4 py-2.5 text-sm text-white bg-primary-500 rounded-lg transition-colors disabled:bg-zinc-300 enabled:hover:bg-primary-400 dark:disabled:bg-zinc-800',
211
+ 'children': jsxRuntime.jsx(ForwardRef$5, {
212
+ className: 'w-5 h-auto',
213
+ }),
214
+ }),
215
+ jsxRuntime.jsx('button', {
216
+ 'onClick': goToPreviousPage,
217
+ 'disabled': !hasPrevPage,
218
+ 'aria-label': 'Zur vorherigen Seite',
219
+ 'className':
220
+ 'flex gap-0.5 px-4 py-2.5 text-sm text-white bg-primary-500 rounded-lg transition-colors disabled:bg-zinc-300 enabled:hover:bg-primary-400 dark:disabled:bg-zinc-800',
221
+ 'children': jsxRuntime.jsx(ForwardRef$3, {
222
+ className: 'w-5 h-auto',
223
+ }),
224
+ }),
225
+ jsxRuntime.jsx('span', {
226
+ className:
227
+ 'size-10 flex justify-center items-center text-sm text-black rounded-md dark:text-white',
228
+ children: currentPage,
229
+ }),
230
+ jsxRuntime.jsx('button', {
231
+ 'onClick': goToNextPage,
232
+ 'disabled': !hasNextPage,
233
+ 'aria-label': 'Zur nächsten Seite',
234
+ 'className':
235
+ 'flex gap-0.5 px-4 py-2.5 text-sm text-white bg-primary-500 rounded-lg transition-colors disabled:bg-zinc-300 enabled:hover:bg-primary-400 dark:disabled:bg-zinc-800',
236
+ 'children': jsxRuntime.jsx(ForwardRef$2, {
237
+ className: 'w-5 h-5',
238
+ }),
239
+ }),
240
+ jsxRuntime.jsx('button', {
241
+ 'onClick': () =>
242
+ goToLastPage(
243
+ totalPages !== null && totalPages !== void 0
244
+ ? totalPages
245
+ : currentPage
246
+ ),
247
+ 'disabled': !hasNextPage,
248
+ 'aria-label': 'Zur letzten Seite',
249
+ 'className':
250
+ 'flex gap-0.5 px-4 py-2.5 text-sm text-white bg-primary-500 rounded-lg transition-colors disabled:bg-zinc-300 enabled:hover:bg-primary-400 dark:disabled:bg-zinc-800',
251
+ 'children': jsxRuntime.jsx(ForwardRef$4, {
252
+ className: 'w-5 h-5',
253
+ }),
254
+ }),
255
+ ],
256
+ });
257
+ }
258
+
259
+ function CancelButton({ onClick }) {
260
+ return jsxRuntime.jsx('button', {
261
+ type: 'button',
262
+ className:
263
+ 'px-5 py-1.5 isolate text-sm font-semibold text-white bg-zinc-500 rounded-lg transition-colors cursor-pointer hover:bg-zinc-400 ',
264
+ onClick: onClick,
265
+ children: 'Cancel',
266
+ });
267
+ }
268
+
269
+ function ErrorDisplay({ error }) {
270
+ if (!error) return null;
271
+ return jsxRuntime.jsx('div', {
272
+ className:
273
+ 'error-display p-4 mb-4 text-red-700 bg-red-100 border rounded border-red-400',
274
+ children: error,
275
+ });
276
+ }
277
+
278
+ function HowToCloseText() {
279
+ return jsxRuntime.jsx('p', {
280
+ className: 'absolute top-full mt-2 text-xs text-black dark:text-white',
281
+ children: 'Schließen: außerhalb klicken oder die Esc-Taste drücken',
282
+ });
283
+ }
284
+
37
285
  function EyeSlashIcon({ title, titleId, ...props }, svgRef) {
38
286
  return /*#__PURE__*/ React__namespace.createElement(
39
287
  'svg',
@@ -67,7 +315,7 @@ function EyeSlashIcon({ title, titleId, ...props }, svgRef) {
67
315
  })
68
316
  );
69
317
  }
70
- const ForwardRef$5 = /*#__PURE__*/ React__namespace.forwardRef(EyeSlashIcon);
318
+ const ForwardRef$1 = /*#__PURE__*/ React__namespace.forwardRef(EyeSlashIcon);
71
319
 
72
320
  function EyeIcon({ title, titleId, ...props }, svgRef) {
73
321
  return /*#__PURE__*/ React__namespace.createElement(
@@ -107,7 +355,7 @@ function EyeIcon({ title, titleId, ...props }, svgRef) {
107
355
  })
108
356
  );
109
357
  }
110
- const ForwardRef$4 = /*#__PURE__*/ React__namespace.forwardRef(EyeIcon);
358
+ const ForwardRef = /*#__PURE__*/ React__namespace.forwardRef(EyeIcon);
111
359
 
112
360
  function InputField({
113
361
  id,
@@ -149,12 +397,12 @@ function InputField({
149
397
  className:
150
398
  'size-5 absolute top-1/2 right-2 -translate-y-1/2 text-font-400 transition-colors cursor-pointer hover:text-font-300 dark:text-font-600 dark:hover:text-font-500',
151
399
  children: isPasswordVisible
152
- ? jsxRuntime.jsx(ForwardRef$5, {
400
+ ? jsxRuntime.jsx(ForwardRef$1, {
153
401
  onClick: () => {
154
402
  setIsPasswordVisible(false);
155
403
  },
156
404
  })
157
- : jsxRuntime.jsx(ForwardRef$4, {
405
+ : jsxRuntime.jsx(ForwardRef, {
158
406
  onClick: () => {
159
407
  setIsPasswordVisible(true);
160
408
  },
@@ -176,20 +424,95 @@ function InputField({
176
424
  });
177
425
  }
178
426
 
179
- const SigninForm = ({
180
- mapText,
181
- onSubmit,
182
- errorMessage,
183
- hideLabels,
184
- onForgotPassword,
185
- }) => {
186
- const { register, handleSubmit } = reactHookForm.useForm({
187
- shouldUseNativeValidation: true,
188
- });
189
- const [email, setEmail] = React.useState('');
190
- return jsxRuntime.jsxs('form', {
191
- onSubmit: handleSubmit(onSubmit),
192
- className: 'space-y-6',
427
+ function r(e) {
428
+ var t,
429
+ f,
430
+ n = '';
431
+ if ('string' == typeof e || 'number' == typeof e) n += e;
432
+ else if ('object' == typeof e)
433
+ if (Array.isArray(e)) {
434
+ var o = e.length;
435
+ for (t = 0; t < o; t++)
436
+ e[t] && (f = r(e[t])) && (n && (n += ' '), (n += f));
437
+ } else for (f in e) e[f] && (n && (n += ' '), (n += f));
438
+ return n;
439
+ }
440
+ function clsx() {
441
+ for (var e, t, f = 0, n = '', o = arguments.length; f < o; f++)
442
+ (e = arguments[f]) && (t = r(e)) && (n && (n += ' '), (n += t));
443
+ return n;
444
+ }
445
+
446
+ function LoadingSpinner({ className, innerClassName }) {
447
+ return jsxRuntime.jsx('div', {
448
+ className: clsx(
449
+ 'loading-spinner w-full h-full flex flex-col justify-center items-center px-1',
450
+ className
451
+ ),
452
+ children: jsxRuntime.jsx('div', {
453
+ 'className': clsx(
454
+ 'size-5 inline-block border-[3px] border-t-transparent rounded-full border-current animate-spin',
455
+ innerClassName
456
+ ),
457
+ 'role': 'status',
458
+ 'aria-label': 'loading',
459
+ 'children': jsxRuntime.jsx('span', {
460
+ className: 'sr-only',
461
+ children: 'Loading...',
462
+ }),
463
+ }),
464
+ });
465
+ }
466
+
467
+ function SaveButton({ isSaving, onClick, disabled }) {
468
+ return jsxRuntime.jsx('button', {
469
+ type: 'submit',
470
+ className:
471
+ 'px-5 py-1.5 isolate text-sm font-semibold text-white bg-primary-500 rounded-lg transition-colors cursor-pointer disabled:bg-zinc-300 disabled:cursor-default enabled:hover:bg-primary-400 dark:disabled:bg-zinc-800',
472
+ onClick: onClick,
473
+ disabled: disabled || isSaving,
474
+ children: isSaving ? jsxRuntime.jsx(LoadingSpinner, {}) : 'Save',
475
+ });
476
+ }
477
+
478
+ function Textarea({ value, onChange, rows = 2 }) {
479
+ return jsxRuntime.jsx('textarea', {
480
+ className: clsx(
481
+ 'w-full block px-3 py-1.5 mt-3 text-sm/6 text-white bg-white/5 border-none rounded-lg'
482
+ ),
483
+ rows: rows,
484
+ value: value,
485
+ onChange: (e) => onChange(e.target.value),
486
+ });
487
+ }
488
+
489
+ var Util = /*#__PURE__*/ Object.freeze({
490
+ __proto__: null,
491
+ CancelButton: CancelButton,
492
+ ErrorDisplay: ErrorDisplay,
493
+ HowToCloseText: HowToCloseText,
494
+ InputField: InputField,
495
+ LoadingSpinner: LoadingSpinner,
496
+ MainContentFrame: MainContentFrame,
497
+ Pagination: Pagination,
498
+ SaveButton: SaveButton,
499
+ Textarea: Textarea,
500
+ });
501
+
502
+ const SigninForm = ({
503
+ mapText,
504
+ onSubmit,
505
+ errorMessage,
506
+ hideLabels,
507
+ onForgotPassword,
508
+ }) => {
509
+ const { register, handleSubmit, setValue } = reactHookForm.useForm({
510
+ shouldUseNativeValidation: true,
511
+ });
512
+ const [email, setEmail] = React.useState('');
513
+ return jsxRuntime.jsxs('form', {
514
+ onSubmit: handleSubmit(onSubmit),
515
+ className: 'space-y-6',
193
516
  children: [
194
517
  jsxRuntime.jsx(InputField, {
195
518
  id: 'email',
@@ -200,7 +523,10 @@ const SigninForm = ({
200
523
  autoCompleteId: 'email',
201
524
  register: register('email', {
202
525
  required: mapText('form.email.validations.required'),
203
- onChange: (e) => setEmail(e.target.value),
526
+ onChange: (event) => {
527
+ setValue('email', event.target.value);
528
+ setEmail(event.target.value);
529
+ },
204
530
  }),
205
531
  }),
206
532
  jsxRuntime.jsx(InputField, {
@@ -212,6 +538,9 @@ const SigninForm = ({
212
538
  autoCompleteId: 'password',
213
539
  register: register('password', {
214
540
  required: mapText('form.password.validations.required'),
541
+ onChange: (event) => {
542
+ setValue('password', event.target.value);
543
+ },
215
544
  }),
216
545
  isPasswordField: true,
217
546
  }),
@@ -297,328 +626,6 @@ var UI = /*#__PURE__*/ Object.freeze({
297
626
  SigninLayout: SigninLayout,
298
627
  });
299
628
 
300
- function MainContentFrame({ children }) {
301
- return jsxRuntime.jsx('main', {
302
- className:
303
- 'w-full pb-2 overflow-hidden bg-zinc-100 lg:pt-2 lg:pr-2 dark:bg-zinc-950',
304
- children: jsxRuntime.jsx('div', {
305
- className:
306
- 'w-full h-full p-6 content-canvas bg-white border-zinc-950/10 lg:p-10 lg:border lg:rounded-lg lg:shadow-xs dark:bg-zinc-900 dark:border-white/5',
307
- children: jsxRuntime.jsx('div', {
308
- className: 'mx-auto max-w-[1400px]',
309
- children: children,
310
- }),
311
- }),
312
- });
313
- }
314
-
315
- function ChevronDoubleLeftIcon({ title, titleId, ...props }, svgRef) {
316
- return /*#__PURE__*/ React__namespace.createElement(
317
- 'svg',
318
- Object.assign(
319
- {
320
- 'xmlns': 'http://www.w3.org/2000/svg',
321
- 'viewBox': '0 0 20 20',
322
- 'fill': 'currentColor',
323
- 'aria-hidden': 'true',
324
- 'data-slot': 'icon',
325
- 'ref': svgRef,
326
- 'aria-labelledby': titleId,
327
- },
328
- props
329
- ),
330
- title
331
- ? /*#__PURE__*/ React__namespace.createElement(
332
- 'title',
333
- {
334
- id: titleId,
335
- },
336
- title
337
- )
338
- : null,
339
- /*#__PURE__*/ React__namespace.createElement('path', {
340
- fillRule: 'evenodd',
341
- d: 'M4.72 9.47a.75.75 0 0 0 0 1.06l4.25 4.25a.75.75 0 1 0 1.06-1.06L6.31 10l3.72-3.72a.75.75 0 1 0-1.06-1.06L4.72 9.47Zm9.25-4.25L9.72 9.47a.75.75 0 0 0 0 1.06l4.25 4.25a.75.75 0 1 0 1.06-1.06L11.31 10l3.72-3.72a.75.75 0 0 0-1.06-1.06Z',
342
- clipRule: 'evenodd',
343
- })
344
- );
345
- }
346
- const ForwardRef$3 = /*#__PURE__*/ React__namespace.forwardRef(
347
- ChevronDoubleLeftIcon
348
- );
349
-
350
- function ChevronDoubleRightIcon({ title, titleId, ...props }, svgRef) {
351
- return /*#__PURE__*/ React__namespace.createElement(
352
- 'svg',
353
- Object.assign(
354
- {
355
- 'xmlns': 'http://www.w3.org/2000/svg',
356
- 'viewBox': '0 0 20 20',
357
- 'fill': 'currentColor',
358
- 'aria-hidden': 'true',
359
- 'data-slot': 'icon',
360
- 'ref': svgRef,
361
- 'aria-labelledby': titleId,
362
- },
363
- props
364
- ),
365
- title
366
- ? /*#__PURE__*/ React__namespace.createElement(
367
- 'title',
368
- {
369
- id: titleId,
370
- },
371
- title
372
- )
373
- : null,
374
- /*#__PURE__*/ React__namespace.createElement('path', {
375
- fillRule: 'evenodd',
376
- d: 'M15.28 9.47a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 1 1-1.06-1.06L13.69 10 9.97 6.28a.75.75 0 0 1 1.06-1.06l4.25 4.25ZM6.03 5.22l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06-1.06L8.69 10 4.97 6.28a.75.75 0 0 1 1.06-1.06Z',
377
- clipRule: 'evenodd',
378
- })
379
- );
380
- }
381
- const ForwardRef$2 = /*#__PURE__*/ React__namespace.forwardRef(
382
- ChevronDoubleRightIcon
383
- );
384
-
385
- function ChevronLeftIcon({ title, titleId, ...props }, svgRef) {
386
- return /*#__PURE__*/ React__namespace.createElement(
387
- 'svg',
388
- Object.assign(
389
- {
390
- 'xmlns': 'http://www.w3.org/2000/svg',
391
- 'viewBox': '0 0 20 20',
392
- 'fill': 'currentColor',
393
- 'aria-hidden': 'true',
394
- 'data-slot': 'icon',
395
- 'ref': svgRef,
396
- 'aria-labelledby': titleId,
397
- },
398
- props
399
- ),
400
- title
401
- ? /*#__PURE__*/ React__namespace.createElement(
402
- 'title',
403
- {
404
- id: titleId,
405
- },
406
- title
407
- )
408
- : null,
409
- /*#__PURE__*/ React__namespace.createElement('path', {
410
- fillRule: 'evenodd',
411
- d: 'M11.78 5.22a.75.75 0 0 1 0 1.06L8.06 10l3.72 3.72a.75.75 0 1 1-1.06 1.06l-4.25-4.25a.75.75 0 0 1 0-1.06l4.25-4.25a.75.75 0 0 1 1.06 0Z',
412
- clipRule: 'evenodd',
413
- })
414
- );
415
- }
416
- const ForwardRef$1 = /*#__PURE__*/ React__namespace.forwardRef(ChevronLeftIcon);
417
-
418
- function ChevronRightIcon({ title, titleId, ...props }, svgRef) {
419
- return /*#__PURE__*/ React__namespace.createElement(
420
- 'svg',
421
- Object.assign(
422
- {
423
- 'xmlns': 'http://www.w3.org/2000/svg',
424
- 'viewBox': '0 0 20 20',
425
- 'fill': 'currentColor',
426
- 'aria-hidden': 'true',
427
- 'data-slot': 'icon',
428
- 'ref': svgRef,
429
- 'aria-labelledby': titleId,
430
- },
431
- props
432
- ),
433
- title
434
- ? /*#__PURE__*/ React__namespace.createElement(
435
- 'title',
436
- {
437
- id: titleId,
438
- },
439
- title
440
- )
441
- : null,
442
- /*#__PURE__*/ React__namespace.createElement('path', {
443
- fillRule: 'evenodd',
444
- d: 'M8.22 5.22a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06-1.06L11.94 10 8.22 6.28a.75.75 0 0 1 0-1.06Z',
445
- clipRule: 'evenodd',
446
- })
447
- );
448
- }
449
- const ForwardRef = /*#__PURE__*/ React__namespace.forwardRef(ChevronRightIcon);
450
-
451
- function Pagination({
452
- currentPage,
453
- totalPages,
454
- hasPrevPage,
455
- hasNextPage,
456
- goToFirstPage,
457
- goToPreviousPage,
458
- goToNextPage,
459
- goToLastPage,
460
- }) {
461
- if (totalPages === 0) {
462
- return null;
463
- }
464
- return jsxRuntime.jsxs('div', {
465
- className: 'w-full flex justify-center items-center gap-x-2 mt-6',
466
- children: [
467
- jsxRuntime.jsx('button', {
468
- 'onClick': goToFirstPage,
469
- 'disabled': !hasPrevPage,
470
- 'aria-label': 'Zur ersten Seite',
471
- 'className':
472
- 'flex gap-0.5 px-4 py-2.5 text-sm text-white bg-primary-500 rounded-lg transition-colors disabled:bg-zinc-300 enabled:hover:bg-primary-400 dark:disabled:bg-zinc-800',
473
- 'children': jsxRuntime.jsx(ForwardRef$3, {
474
- className: 'w-5 h-auto',
475
- }),
476
- }),
477
- jsxRuntime.jsx('button', {
478
- 'onClick': goToPreviousPage,
479
- 'disabled': !hasPrevPage,
480
- 'aria-label': 'Zur vorherigen Seite',
481
- 'className':
482
- 'flex gap-0.5 px-4 py-2.5 text-sm text-white bg-primary-500 rounded-lg transition-colors disabled:bg-zinc-300 enabled:hover:bg-primary-400 dark:disabled:bg-zinc-800',
483
- 'children': jsxRuntime.jsx(ForwardRef$1, {
484
- className: 'w-5 h-auto',
485
- }),
486
- }),
487
- jsxRuntime.jsx('span', {
488
- className:
489
- 'size-10 flex justify-center items-center text-sm text-black rounded-md dark:text-white',
490
- children: currentPage,
491
- }),
492
- jsxRuntime.jsx('button', {
493
- 'onClick': goToNextPage,
494
- 'disabled': !hasNextPage,
495
- 'aria-label': 'Zur nächsten Seite',
496
- 'className':
497
- 'flex gap-0.5 px-4 py-2.5 text-sm text-white bg-primary-500 rounded-lg transition-colors disabled:bg-zinc-300 enabled:hover:bg-primary-400 dark:disabled:bg-zinc-800',
498
- 'children': jsxRuntime.jsx(ForwardRef, {
499
- className: 'w-5 h-5',
500
- }),
501
- }),
502
- jsxRuntime.jsx('button', {
503
- 'onClick': () =>
504
- goToLastPage(
505
- totalPages !== null && totalPages !== void 0
506
- ? totalPages
507
- : currentPage
508
- ),
509
- 'disabled': !hasNextPage,
510
- 'aria-label': 'Zur letzten Seite',
511
- 'className':
512
- 'flex gap-0.5 px-4 py-2.5 text-sm text-white bg-primary-500 rounded-lg transition-colors disabled:bg-zinc-300 enabled:hover:bg-primary-400 dark:disabled:bg-zinc-800',
513
- 'children': jsxRuntime.jsx(ForwardRef$2, {
514
- className: 'w-5 h-5',
515
- }),
516
- }),
517
- ],
518
- });
519
- }
520
-
521
- function CancelButton({ onClick }) {
522
- return jsxRuntime.jsx('button', {
523
- type: 'button',
524
- className:
525
- 'px-5 py-1.5 isolate text-sm font-semibold text-white bg-zinc-500 rounded-lg transition-colors cursor-pointer hover:bg-zinc-400 ',
526
- onClick: onClick,
527
- children: 'Cancel',
528
- });
529
- }
530
-
531
- function ErrorDisplay({ error }) {
532
- if (!error) return null;
533
- return jsxRuntime.jsx('div', {
534
- className:
535
- 'error-display p-4 mb-4 text-red-700 bg-red-100 border rounded border-red-400',
536
- children: error,
537
- });
538
- }
539
-
540
- function HowToCloseText() {
541
- return jsxRuntime.jsx('p', {
542
- className: 'absolute top-full mt-2 text-xs text-black dark:text-white',
543
- children: 'Schließen: außerhalb klicken oder die Esc-Taste drücken',
544
- });
545
- }
546
-
547
- function r(e) {
548
- var t,
549
- f,
550
- n = '';
551
- if ('string' == typeof e || 'number' == typeof e) n += e;
552
- else if ('object' == typeof e)
553
- if (Array.isArray(e)) {
554
- var o = e.length;
555
- for (t = 0; t < o; t++)
556
- e[t] && (f = r(e[t])) && (n && (n += ' '), (n += f));
557
- } else for (f in e) e[f] && (n && (n += ' '), (n += f));
558
- return n;
559
- }
560
- function clsx() {
561
- for (var e, t, f = 0, n = '', o = arguments.length; f < o; f++)
562
- (e = arguments[f]) && (t = r(e)) && (n && (n += ' '), (n += t));
563
- return n;
564
- }
565
-
566
- function LoadingSpinner({ className, innerClassName }) {
567
- return jsxRuntime.jsx('div', {
568
- className: clsx(
569
- 'loading-spinner w-full h-full flex flex-col justify-center items-center px-1',
570
- className
571
- ),
572
- children: jsxRuntime.jsx('div', {
573
- 'className': clsx(
574
- 'size-5 inline-block border-[3px] border-t-transparent rounded-full border-current animate-spin',
575
- innerClassName
576
- ),
577
- 'role': 'status',
578
- 'aria-label': 'loading',
579
- 'children': jsxRuntime.jsx('span', {
580
- className: 'sr-only',
581
- children: 'Loading...',
582
- }),
583
- }),
584
- });
585
- }
586
-
587
- function SaveButton({ isSaving, onClick, disabled }) {
588
- return jsxRuntime.jsx('button', {
589
- type: 'submit',
590
- className:
591
- 'px-5 py-1.5 isolate text-sm font-semibold text-white bg-primary-500 rounded-lg transition-colors cursor-pointer disabled:bg-zinc-300 disabled:cursor-default enabled:hover:bg-primary-400 dark:disabled:bg-zinc-800',
592
- onClick: onClick,
593
- disabled: disabled || isSaving,
594
- children: isSaving ? jsxRuntime.jsx(LoadingSpinner, {}) : 'Save',
595
- });
596
- }
597
-
598
- function Textarea({ value, onChange, rows = 2 }) {
599
- return jsxRuntime.jsx('textarea', {
600
- className: clsx(
601
- 'w-full block px-3 py-1.5 mt-3 text-sm/6 text-white bg-white/5 border-none rounded-lg'
602
- ),
603
- rows: rows,
604
- value: value,
605
- onChange: (e) => onChange(e.target.value),
606
- });
607
- }
608
-
609
- var Util = /*#__PURE__*/ Object.freeze({
610
- __proto__: null,
611
- CancelButton: CancelButton,
612
- ErrorDisplay: ErrorDisplay,
613
- HowToCloseText: HowToCloseText,
614
- InputField: InputField,
615
- LoadingSpinner: LoadingSpinner,
616
- MainContentFrame: MainContentFrame,
617
- Pagination: Pagination,
618
- SaveButton: SaveButton,
619
- Textarea: Textarea,
620
- });
621
-
622
629
  const TemplateParserContext = React.createContext({
623
630
  parse: () => String(),
624
631
  addToTemporaryView: () => {},