@native-systems/ui 1.1.1 → 1.2.0

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
@@ -5,6 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var jsxRuntime = require('react/jsx-runtime');
6
6
  var React = require('react');
7
7
  var reactHookForm = require('react-hook-form');
8
+ var react = require('@headlessui/react');
8
9
  var utility = require('@native-systems/utility');
9
10
 
10
11
  function _interopNamespaceDefault(e) {
@@ -80,7 +81,7 @@ function ChevronDoubleLeftIcon({ title, titleId, ...props }, svgRef) {
80
81
  })
81
82
  );
82
83
  }
83
- const ForwardRef$5 = /*#__PURE__*/ React__namespace.forwardRef(
84
+ const ForwardRef$7 = /*#__PURE__*/ React__namespace.forwardRef(
84
85
  ChevronDoubleLeftIcon
85
86
  );
86
87
 
@@ -115,10 +116,43 @@ function ChevronDoubleRightIcon({ title, titleId, ...props }, svgRef) {
115
116
  })
116
117
  );
117
118
  }
118
- const ForwardRef$4 = /*#__PURE__*/ React__namespace.forwardRef(
119
+ const ForwardRef$6 = /*#__PURE__*/ React__namespace.forwardRef(
119
120
  ChevronDoubleRightIcon
120
121
  );
121
122
 
123
+ function ChevronDownIcon({ title, titleId, ...props }, svgRef) {
124
+ return /*#__PURE__*/ React__namespace.createElement(
125
+ 'svg',
126
+ Object.assign(
127
+ {
128
+ 'xmlns': 'http://www.w3.org/2000/svg',
129
+ 'viewBox': '0 0 20 20',
130
+ 'fill': 'currentColor',
131
+ 'aria-hidden': 'true',
132
+ 'data-slot': 'icon',
133
+ 'ref': svgRef,
134
+ 'aria-labelledby': titleId,
135
+ },
136
+ props
137
+ ),
138
+ title
139
+ ? /*#__PURE__*/ React__namespace.createElement(
140
+ 'title',
141
+ {
142
+ id: titleId,
143
+ },
144
+ title
145
+ )
146
+ : null,
147
+ /*#__PURE__*/ React__namespace.createElement('path', {
148
+ fillRule: 'evenodd',
149
+ d: 'M5.22 8.22a.75.75 0 0 1 1.06 0L10 11.94l3.72-3.72a.75.75 0 1 1 1.06 1.06l-4.25 4.25a.75.75 0 0 1-1.06 0L5.22 9.28a.75.75 0 0 1 0-1.06Z',
150
+ clipRule: 'evenodd',
151
+ })
152
+ );
153
+ }
154
+ const ForwardRef$5 = /*#__PURE__*/ React__namespace.forwardRef(ChevronDownIcon);
155
+
122
156
  function ChevronLeftIcon({ title, titleId, ...props }, svgRef) {
123
157
  return /*#__PURE__*/ React__namespace.createElement(
124
158
  'svg',
@@ -150,7 +184,7 @@ function ChevronLeftIcon({ title, titleId, ...props }, svgRef) {
150
184
  })
151
185
  );
152
186
  }
153
- const ForwardRef$3 = /*#__PURE__*/ React__namespace.forwardRef(ChevronLeftIcon);
187
+ const ForwardRef$4 = /*#__PURE__*/ React__namespace.forwardRef(ChevronLeftIcon);
154
188
 
155
189
  function ChevronRightIcon({ title, titleId, ...props }, svgRef) {
156
190
  return /*#__PURE__*/ React__namespace.createElement(
@@ -183,7 +217,7 @@ function ChevronRightIcon({ title, titleId, ...props }, svgRef) {
183
217
  })
184
218
  );
185
219
  }
186
- const ForwardRef$2 =
220
+ const ForwardRef$3 =
187
221
  /*#__PURE__*/ React__namespace.forwardRef(ChevronRightIcon);
188
222
 
189
223
  function Pagination({
@@ -208,7 +242,7 @@ function Pagination({
208
242
  'aria-label': 'Zur ersten Seite',
209
243
  'className':
210
244
  '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, {
245
+ 'children': jsxRuntime.jsx(ForwardRef$7, {
212
246
  className: 'w-5 h-auto',
213
247
  }),
214
248
  }),
@@ -218,7 +252,7 @@ function Pagination({
218
252
  'aria-label': 'Zur vorherigen Seite',
219
253
  'className':
220
254
  '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, {
255
+ 'children': jsxRuntime.jsx(ForwardRef$4, {
222
256
  className: 'w-5 h-auto',
223
257
  }),
224
258
  }),
@@ -233,7 +267,7 @@ function Pagination({
233
267
  'aria-label': 'Zur nächsten Seite',
234
268
  'className':
235
269
  '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, {
270
+ 'children': jsxRuntime.jsx(ForwardRef$3, {
237
271
  className: 'w-5 h-5',
238
272
  }),
239
273
  }),
@@ -248,7 +282,7 @@ function Pagination({
248
282
  'aria-label': 'Zur letzten Seite',
249
283
  'className':
250
284
  '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, {
285
+ 'children': jsxRuntime.jsx(ForwardRef$6, {
252
286
  className: 'w-5 h-5',
253
287
  }),
254
288
  }),
@@ -256,31 +290,40 @@ function Pagination({
256
290
  });
257
291
  }
258
292
 
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
- });
293
+ function CheckIcon({ title, titleId, ...props }, svgRef) {
294
+ return /*#__PURE__*/ React__namespace.createElement(
295
+ 'svg',
296
+ Object.assign(
297
+ {
298
+ 'xmlns': 'http://www.w3.org/2000/svg',
299
+ 'fill': 'none',
300
+ 'viewBox': '0 0 24 24',
301
+ 'strokeWidth': 1.5,
302
+ 'stroke': 'currentColor',
303
+ 'aria-hidden': 'true',
304
+ 'data-slot': 'icon',
305
+ 'ref': svgRef,
306
+ 'aria-labelledby': titleId,
307
+ },
308
+ props
309
+ ),
310
+ title
311
+ ? /*#__PURE__*/ React__namespace.createElement(
312
+ 'title',
313
+ {
314
+ id: titleId,
315
+ },
316
+ title
317
+ )
318
+ : null,
319
+ /*#__PURE__*/ React__namespace.createElement('path', {
320
+ strokeLinecap: 'round',
321
+ strokeLinejoin: 'round',
322
+ d: 'm4.5 12.75 6 6 9-13.5',
323
+ })
324
+ );
283
325
  }
326
+ const ForwardRef$2 = /*#__PURE__*/ React__namespace.forwardRef(CheckIcon);
284
327
 
285
328
  function EyeSlashIcon({ title, titleId, ...props }, svgRef) {
286
329
  return /*#__PURE__*/ React__namespace.createElement(
@@ -357,6 +400,186 @@ function EyeIcon({ title, titleId, ...props }, svgRef) {
357
400
  }
358
401
  const ForwardRef = /*#__PURE__*/ React__namespace.forwardRef(EyeIcon);
359
402
 
403
+ function r(e) {
404
+ var t,
405
+ f,
406
+ n = '';
407
+ if ('string' == typeof e || 'number' == typeof e) n += e;
408
+ else if ('object' == typeof e)
409
+ if (Array.isArray(e)) {
410
+ var o = e.length;
411
+ for (t = 0; t < o; t++)
412
+ e[t] && (f = r(e[t])) && (n && (n += ' '), (n += f));
413
+ } else for (f in e) e[f] && (n && (n += ' '), (n += f));
414
+ return n;
415
+ }
416
+ function clsx() {
417
+ for (var e, t, f = 0, n = '', o = arguments.length; f < o; f++)
418
+ (e = arguments[f]) && (t = r(e)) && (n && (n += ' '), (n += t));
419
+ return n;
420
+ }
421
+
422
+ function countryCodeToFlag(countryCode) {
423
+ return countryCode
424
+ .toUpperCase()
425
+ .replace(/./g, (char) =>
426
+ String.fromCodePoint(0x1f1e6 + char.charCodeAt(0) - 65)
427
+ );
428
+ }
429
+ function LocaleSelect({
430
+ locales,
431
+ value,
432
+ set,
433
+ className,
434
+ buttonClassName,
435
+ listClassName,
436
+ disabled,
437
+ ariaLabel = 'Select language',
438
+ }) {
439
+ const selected = React.useMemo(() => {
440
+ var _locales_find, _ref;
441
+ return (_ref =
442
+ (_locales_find = locales.find((l) => l.locale === value)) !== null &&
443
+ _locales_find !== void 0
444
+ ? _locales_find
445
+ : locales[0]) !== null && _ref !== void 0
446
+ ? _ref
447
+ : null;
448
+ }, [locales, value]);
449
+ if (!locales.length) return null;
450
+ var _selected_locale;
451
+ return jsxRuntime.jsx('div', {
452
+ className: clsx('relative inline-block', className),
453
+ children: jsxRuntime.jsx(react.Listbox, {
454
+ value:
455
+ (_selected_locale =
456
+ selected === null || selected === void 0
457
+ ? void 0
458
+ : selected.locale) !== null && _selected_locale !== void 0
459
+ ? _selected_locale
460
+ : null,
461
+ onChange: (nextLocale) => {
462
+ set(nextLocale);
463
+ },
464
+ disabled: disabled,
465
+ children: ({ open }) => {
466
+ var _selected_label;
467
+ return jsxRuntime.jsxs(jsxRuntime.Fragment, {
468
+ children: [
469
+ jsxRuntime.jsxs(react.ListboxButton, {
470
+ 'aria-label': ariaLabel,
471
+ 'className': clsx(
472
+ 'inline-flex items-center gap-2 px-3 py-2 text-sm border rounded-md',
473
+ 'disabled:opacity-50 disabled:cursor-not-allowed',
474
+ buttonClassName
475
+ ),
476
+ 'children': [
477
+ jsxRuntime.jsx('span', {
478
+ 'aria-hidden': 'true',
479
+ 'className': 'text-base leading-none',
480
+ 'children': selected
481
+ ? countryCodeToFlag(selected.countryCode)
482
+ : '🏳️',
483
+ }),
484
+ jsxRuntime.jsx('span', {
485
+ className: 'whitespace-nowrap',
486
+ children:
487
+ (_selected_label =
488
+ selected === null || selected === void 0
489
+ ? void 0
490
+ : selected.label) !== null && _selected_label !== void 0
491
+ ? _selected_label
492
+ : '',
493
+ }),
494
+ jsxRuntime.jsx(ForwardRef$5, {
495
+ 'aria-hidden': 'true',
496
+ 'className': 'size-4 ml-1',
497
+ }),
498
+ ],
499
+ }),
500
+ jsxRuntime.jsx(react.Transition, {
501
+ as: React.Fragment,
502
+ show: open,
503
+ enter: 'transition ease-out duration-100',
504
+ enterFrom: 'opacity-0 translate-y-1',
505
+ enterTo: 'opacity-100 translate-y-0',
506
+ leave: 'transition ease-in duration-75',
507
+ leaveFrom: 'opacity-100 translate-y-0',
508
+ leaveTo: 'opacity-0 translate-y-1',
509
+ children: jsxRuntime.jsx(react.ListboxOptions, {
510
+ className: clsx(
511
+ 'z-50 absolute min-w-[12rem] mt-2 overflow-hidden bg-white border rounded-md shadow-lg focus:outline-none',
512
+ listClassName
513
+ ),
514
+ children: locales.map((opt) =>
515
+ jsxRuntime.jsx(
516
+ react.ListboxOption,
517
+ {
518
+ value: opt.locale,
519
+ className: ({ focus }) =>
520
+ clsx(
521
+ 'cursor-pointer select-none px-3 py-2 text-sm',
522
+ focus && 'bg-black/5'
523
+ ),
524
+ children: ({ selected: isSelected }) =>
525
+ jsxRuntime.jsxs('div', {
526
+ className: 'flex items-center gap-2',
527
+ children: [
528
+ jsxRuntime.jsx('span', {
529
+ 'aria-hidden': 'true',
530
+ 'className': 'text-base leading-none',
531
+ 'children': countryCodeToFlag(opt.countryCode),
532
+ }),
533
+ jsxRuntime.jsx('span', {
534
+ className: 'flex-1',
535
+ children: opt.label,
536
+ }),
537
+ isSelected &&
538
+ jsxRuntime.jsx(ForwardRef$2, {
539
+ 'aria-hidden': 'true',
540
+ 'className': 'size-4',
541
+ }),
542
+ ],
543
+ }),
544
+ },
545
+ opt.locale
546
+ )
547
+ ),
548
+ }),
549
+ }),
550
+ ],
551
+ });
552
+ },
553
+ }),
554
+ });
555
+ }
556
+
557
+ function CancelButton({ onClick }) {
558
+ return jsxRuntime.jsx('button', {
559
+ type: 'button',
560
+ className:
561
+ '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 ',
562
+ onClick: onClick,
563
+ children: 'Cancel',
564
+ });
565
+ }
566
+
567
+ function ErrorDisplay({ error }) {
568
+ if (!error) return null;
569
+ return jsxRuntime.jsx('div', {
570
+ className:
571
+ 'error-display p-4 mb-4 text-red-700 bg-red-100 border rounded border-red-400',
572
+ children: error,
573
+ });
574
+ }
575
+
576
+ function HowToCloseText() {
577
+ return jsxRuntime.jsx('p', {
578
+ className: 'absolute top-full mt-2 text-xs text-black dark:text-white',
579
+ children: 'Schließen: außerhalb klicken oder die Esc-Taste drücken',
580
+ });
581
+ }
582
+
360
583
  function InputField({
361
584
  id,
362
585
  label,
@@ -424,25 +647,6 @@ function InputField({
424
647
  });
425
648
  }
426
649
 
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
650
  function LoadingSpinner({ className, innerClassName }) {
447
651
  return jsxRuntime.jsx('div', {
448
652
  className: clsx(
@@ -493,10 +697,12 @@ var Util = /*#__PURE__*/ Object.freeze({
493
697
  HowToCloseText: HowToCloseText,
494
698
  InputField: InputField,
495
699
  LoadingSpinner: LoadingSpinner,
700
+ LocaleSelect: LocaleSelect,
496
701
  MainContentFrame: MainContentFrame,
497
702
  Pagination: Pagination,
498
703
  SaveButton: SaveButton,
499
704
  Textarea: Textarea,
705
+ countryCodeToFlag: countryCodeToFlag,
500
706
  });
501
707
 
502
708
  const SigninForm = ({
@@ -707,6 +913,7 @@ exports.ErrorDisplay = ErrorDisplay;
707
913
  exports.HowToCloseText = HowToCloseText;
708
914
  exports.InputField = InputField;
709
915
  exports.LoadingSpinner = LoadingSpinner;
916
+ exports.LocaleSelect = LocaleSelect;
710
917
  exports.MainContentFrame = MainContentFrame;
711
918
  exports.Pagination = Pagination;
712
919
  exports.SaveButton = SaveButton;
@@ -714,5 +921,6 @@ exports.SigninForm = SigninForm;
714
921
  exports.SigninLayout = SigninLayout;
715
922
  exports.TemplateParserProvider = TemplateParserProvider;
716
923
  exports.Textarea = Textarea;
924
+ exports.countryCodeToFlag = countryCodeToFlag;
717
925
  exports.default = index;
718
926
  exports.useTemplateParser = useTemplateParser;
package/dist/index.d.ts CHANGED
@@ -21,6 +21,26 @@ declare module "@native-systems/ui" {
21
21
  export function Pagination({ currentPage, totalPages, hasPrevPage, hasNextPage, goToFirstPage, goToPreviousPage, goToNextPage, goToLastPage, }: PaginationProps): import("react/jsx-runtime").JSX.Element;
22
22
  }
23
23
 
24
+ declare module "@native-systems/ui" {
25
+ export type LocaleSelectOption = {
26
+ locale: string;
27
+ countryCode: string;
28
+ label: string;
29
+ };
30
+ type LocaleSelectProps = {
31
+ locales: Array<LocaleSelectOption>;
32
+ value: string | null | undefined;
33
+ set: (locale: string) => void;
34
+ className?: string;
35
+ buttonClassName?: string;
36
+ listClassName?: string;
37
+ disabled?: boolean;
38
+ ariaLabel?: string;
39
+ };
40
+ export function countryCodeToFlag(countryCode: string): string;
41
+ export function LocaleSelect({ locales, value, set, className, buttonClassName, listClassName, disabled, ariaLabel, }: LocaleSelectProps): import("react/jsx-runtime").JSX.Element;
42
+ }
43
+
24
44
  declare module "@native-systems/ui" {
25
45
  type CancelButtonProps = {
26
46
  onClick: () => void;
@@ -144,6 +164,8 @@ declare module "@native-systems/ui" {
144
164
  };
145
165
  MainContentFrame: typeof Util.MainContentFrame;
146
166
  Pagination: typeof Util.Pagination;
167
+ LocaleSelect: typeof Util.LocaleSelect;
168
+ countryCodeToFlag: typeof Util.countryCodeToFlag;
147
169
  CancelButton: typeof Util.CancelButton;
148
170
  ErrorDisplay: typeof Util.ErrorDisplay;
149
171
  HowToCloseText: typeof Util.HowToCloseText;
@@ -1 +1 @@
1
- {"version":3,"sources":["src/components/util/layout/MainContentFrame.tsx","src/components/util/widgets/Pagination.tsx","src/components/util/views/CancelButton.tsx","src/components/util/views/ErrorDisplay.tsx","src/components/util/views/HowToCloseText.tsx","src/components/util/views/Input.tsx","src/components/util/views/LoadingSpinner.tsx","src/components/util/views/SaveButton.tsx","src/components/util/views/Textarea.tsx","src/components/auth/widgets/SigninForm.tsx","src/components/auth/layout/SigninLayout.tsx","src/context/TemplateParserContext.tsx","src/index.ts"],"names":[],"mappings":";IAAA,OAAO,EAAE,SAAS,EAAE,cAAc;IAElC,KAAK,qBAAqB,GAAG;QAC3B,QAAQ,EAAE,SAAS,CAAC;KACrB,CAAC;IAEF,SAAS,gBAAgB,CAAC,EAAE,QAAQ,EAAE,EAAE,qBAAqB,GAAA,OAAA,mBAAA,EAAA,GAAA,CAAA,OAAA,CAQ5D;IAED,OAAO,EAAE,gBAAgB,EAAE,CAAC;;;;ICX5B,KAAK,eAAe,GAAG;QACrB,WAAW,EAAE,MAAM,CAAC;QACpB,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;QAC/B,WAAW,EAAE,OAAO,CAAC;QACrB,WAAW,EAAE,OAAO,CAAC;QACrB,aAAa,EAAE,MAAM,IAAI,CAAC;QAC1B,gBAAgB,EAAE,MAAM,IAAI,CAAC;QAC7B,YAAY,EAAE,MAAM,IAAI,CAAC;QACzB,YAAY,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;KAC1C,CAAC;IAEF,MAAM,UAAU,UAAU,CAAC,EACzB,WAAW,EACX,UAAU,EACV,WAAW,EACX,WA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GAAA,CAAA,OA+CxE,CAAC;IAEF,MAAM,CAAC,MAAM,iBAAiB,EAAA,MAAA,0BAQ7B,CAAC;;;;IC/EF,OAAO,KAAK,EAAE,2BAA0B;IACxC,OAAO,KAAK,IAAI,2BAA0B;IAC1C,OAAO,KAAK,GAAG,2BAAkB;;;;;;;;;;;;;;;;;;;;;;;;;IAEjC,eAAA,QAAA,CAIE","file":"index.d.ts","sourceRoot":".."}
1
+ {"version":3,"sources":["src/components/util/layout/MainContentFrame.tsx","src/components/util/widgets/Pagination.tsx","src/components/util/widgets/LocaleSelect.tsx","src/components/util/views/CancelButton.tsx","src/components/util/views/ErrorDisplay.tsx","src/components/util/views/HowToCloseText.tsx","src/components/util/views/Input.tsx","src/components/util/views/LoadingSpinner.tsx","src/components/util/views/SaveButton.tsx","src/components/util/views/Textarea.tsx","src/components/auth/widgets/SigninForm.tsx","src/components/auth/layout/SigninLayout.tsx","src/context/TemplateParserContext.tsx","src/index.ts"],"names":[],"mappings":";IAAA,OAAO,EAAE,SAAS,EAAE,cAAc;IAElC,KAAK,qBAAqB,GAAG;QAC3B,QAAQ,EAAE,SAAS,CAAC;KACrB,CAAC;IAEF,SAAS,gBAAgB,CAAC,EAAE,QAAQ,EAAE,EAAE,qBAAqB,GAAA,OAAA,mBAAA,EAAA,GAAA,CAAA,OAAA,CAQ5D;IAED,OAAO,EAAE,gBAAgB,EAAE,CAAC;;;;ICX5B,KAAK,eAAe,GAAG;QACrB,WAAW,EAAE,MAAM,CAAC;QACpB,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;QAC/B,WAAW,EAAE,OAAO,CAAC;QACrB,WAAW,EAAE,OAAO,CAAC;QACrB,aAAa,EAAE,MAAM,IAAI,CAAC;QAC1B,gBAAgB,EAAE,MAAM,IAAI,CAAC;QAC7B,YAAY,EAAE,MAAM,IAAI,CAAC;QACzB,YAAY,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;KAC1C,CAAC;IAEF,MAAM,U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
2
  import * as React from 'react';
3
- import { useState, createContext, useRef, useContext } from 'react';
3
+ import {
4
+ useMemo,
5
+ Fragment as Fragment$1,
6
+ useState,
7
+ createContext,
8
+ useRef,
9
+ useContext,
10
+ } from 'react';
4
11
  import { useForm } from 'react-hook-form';
12
+ import {
13
+ Listbox,
14
+ ListboxButton,
15
+ Transition,
16
+ ListboxOptions,
17
+ ListboxOption,
18
+ } from '@headlessui/react';
5
19
  import {
6
20
  PatternCompiler,
7
21
  eqPlugin,
@@ -57,7 +71,7 @@ function ChevronDoubleLeftIcon({ title, titleId, ...props }, svgRef) {
57
71
  })
58
72
  );
59
73
  }
60
- const ForwardRef$5 = /*#__PURE__*/ React.forwardRef(ChevronDoubleLeftIcon);
74
+ const ForwardRef$7 = /*#__PURE__*/ React.forwardRef(ChevronDoubleLeftIcon);
61
75
 
62
76
  function ChevronDoubleRightIcon({ title, titleId, ...props }, svgRef) {
63
77
  return /*#__PURE__*/ React.createElement(
@@ -90,7 +104,40 @@ function ChevronDoubleRightIcon({ title, titleId, ...props }, svgRef) {
90
104
  })
91
105
  );
92
106
  }
93
- const ForwardRef$4 = /*#__PURE__*/ React.forwardRef(ChevronDoubleRightIcon);
107
+ const ForwardRef$6 = /*#__PURE__*/ React.forwardRef(ChevronDoubleRightIcon);
108
+
109
+ function ChevronDownIcon({ title, titleId, ...props }, svgRef) {
110
+ return /*#__PURE__*/ React.createElement(
111
+ 'svg',
112
+ Object.assign(
113
+ {
114
+ 'xmlns': 'http://www.w3.org/2000/svg',
115
+ 'viewBox': '0 0 20 20',
116
+ 'fill': 'currentColor',
117
+ 'aria-hidden': 'true',
118
+ 'data-slot': 'icon',
119
+ 'ref': svgRef,
120
+ 'aria-labelledby': titleId,
121
+ },
122
+ props
123
+ ),
124
+ title
125
+ ? /*#__PURE__*/ React.createElement(
126
+ 'title',
127
+ {
128
+ id: titleId,
129
+ },
130
+ title
131
+ )
132
+ : null,
133
+ /*#__PURE__*/ React.createElement('path', {
134
+ fillRule: 'evenodd',
135
+ d: 'M5.22 8.22a.75.75 0 0 1 1.06 0L10 11.94l3.72-3.72a.75.75 0 1 1 1.06 1.06l-4.25 4.25a.75.75 0 0 1-1.06 0L5.22 9.28a.75.75 0 0 1 0-1.06Z',
136
+ clipRule: 'evenodd',
137
+ })
138
+ );
139
+ }
140
+ const ForwardRef$5 = /*#__PURE__*/ React.forwardRef(ChevronDownIcon);
94
141
 
95
142
  function ChevronLeftIcon({ title, titleId, ...props }, svgRef) {
96
143
  return /*#__PURE__*/ React.createElement(
@@ -123,7 +170,7 @@ function ChevronLeftIcon({ title, titleId, ...props }, svgRef) {
123
170
  })
124
171
  );
125
172
  }
126
- const ForwardRef$3 = /*#__PURE__*/ React.forwardRef(ChevronLeftIcon);
173
+ const ForwardRef$4 = /*#__PURE__*/ React.forwardRef(ChevronLeftIcon);
127
174
 
128
175
  function ChevronRightIcon({ title, titleId, ...props }, svgRef) {
129
176
  return /*#__PURE__*/ React.createElement(
@@ -156,7 +203,7 @@ function ChevronRightIcon({ title, titleId, ...props }, svgRef) {
156
203
  })
157
204
  );
158
205
  }
159
- const ForwardRef$2 = /*#__PURE__*/ React.forwardRef(ChevronRightIcon);
206
+ const ForwardRef$3 = /*#__PURE__*/ React.forwardRef(ChevronRightIcon);
160
207
 
161
208
  function Pagination({
162
209
  currentPage,
@@ -180,7 +227,7 @@ function Pagination({
180
227
  'aria-label': 'Zur ersten Seite',
181
228
  'className':
182
229
  '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',
183
- 'children': jsx(ForwardRef$5, {
230
+ 'children': jsx(ForwardRef$7, {
184
231
  className: 'w-5 h-auto',
185
232
  }),
186
233
  }),
@@ -190,7 +237,7 @@ function Pagination({
190
237
  'aria-label': 'Zur vorherigen Seite',
191
238
  'className':
192
239
  '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',
193
- 'children': jsx(ForwardRef$3, {
240
+ 'children': jsx(ForwardRef$4, {
194
241
  className: 'w-5 h-auto',
195
242
  }),
196
243
  }),
@@ -205,7 +252,7 @@ function Pagination({
205
252
  'aria-label': 'Zur nächsten Seite',
206
253
  'className':
207
254
  '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',
208
- 'children': jsx(ForwardRef$2, {
255
+ 'children': jsx(ForwardRef$3, {
209
256
  className: 'w-5 h-5',
210
257
  }),
211
258
  }),
@@ -220,7 +267,7 @@ function Pagination({
220
267
  'aria-label': 'Zur letzten Seite',
221
268
  'className':
222
269
  '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',
223
- 'children': jsx(ForwardRef$4, {
270
+ 'children': jsx(ForwardRef$6, {
224
271
  className: 'w-5 h-5',
225
272
  }),
226
273
  }),
@@ -228,31 +275,40 @@ function Pagination({
228
275
  });
229
276
  }
230
277
 
231
- function CancelButton({ onClick }) {
232
- return jsx('button', {
233
- type: 'button',
234
- className:
235
- '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 ',
236
- onClick: onClick,
237
- children: 'Cancel',
238
- });
239
- }
240
-
241
- function ErrorDisplay({ error }) {
242
- if (!error) return null;
243
- return jsx('div', {
244
- className:
245
- 'error-display p-4 mb-4 text-red-700 bg-red-100 border rounded border-red-400',
246
- children: error,
247
- });
248
- }
249
-
250
- function HowToCloseText() {
251
- return jsx('p', {
252
- className: 'absolute top-full mt-2 text-xs text-black dark:text-white',
253
- children: 'Schließen: außerhalb klicken oder die Esc-Taste drücken',
254
- });
278
+ function CheckIcon({ title, titleId, ...props }, svgRef) {
279
+ return /*#__PURE__*/ React.createElement(
280
+ 'svg',
281
+ Object.assign(
282
+ {
283
+ 'xmlns': 'http://www.w3.org/2000/svg',
284
+ 'fill': 'none',
285
+ 'viewBox': '0 0 24 24',
286
+ 'strokeWidth': 1.5,
287
+ 'stroke': 'currentColor',
288
+ 'aria-hidden': 'true',
289
+ 'data-slot': 'icon',
290
+ 'ref': svgRef,
291
+ 'aria-labelledby': titleId,
292
+ },
293
+ props
294
+ ),
295
+ title
296
+ ? /*#__PURE__*/ React.createElement(
297
+ 'title',
298
+ {
299
+ id: titleId,
300
+ },
301
+ title
302
+ )
303
+ : null,
304
+ /*#__PURE__*/ React.createElement('path', {
305
+ strokeLinecap: 'round',
306
+ strokeLinejoin: 'round',
307
+ d: 'm4.5 12.75 6 6 9-13.5',
308
+ })
309
+ );
255
310
  }
311
+ const ForwardRef$2 = /*#__PURE__*/ React.forwardRef(CheckIcon);
256
312
 
257
313
  function EyeSlashIcon({ title, titleId, ...props }, svgRef) {
258
314
  return /*#__PURE__*/ React.createElement(
@@ -329,6 +385,186 @@ function EyeIcon({ title, titleId, ...props }, svgRef) {
329
385
  }
330
386
  const ForwardRef = /*#__PURE__*/ React.forwardRef(EyeIcon);
331
387
 
388
+ function r(e) {
389
+ var t,
390
+ f,
391
+ n = '';
392
+ if ('string' == typeof e || 'number' == typeof e) n += e;
393
+ else if ('object' == typeof e)
394
+ if (Array.isArray(e)) {
395
+ var o = e.length;
396
+ for (t = 0; t < o; t++)
397
+ e[t] && (f = r(e[t])) && (n && (n += ' '), (n += f));
398
+ } else for (f in e) e[f] && (n && (n += ' '), (n += f));
399
+ return n;
400
+ }
401
+ function clsx() {
402
+ for (var e, t, f = 0, n = '', o = arguments.length; f < o; f++)
403
+ (e = arguments[f]) && (t = r(e)) && (n && (n += ' '), (n += t));
404
+ return n;
405
+ }
406
+
407
+ function countryCodeToFlag(countryCode) {
408
+ return countryCode
409
+ .toUpperCase()
410
+ .replace(/./g, (char) =>
411
+ String.fromCodePoint(0x1f1e6 + char.charCodeAt(0) - 65)
412
+ );
413
+ }
414
+ function LocaleSelect({
415
+ locales,
416
+ value,
417
+ set,
418
+ className,
419
+ buttonClassName,
420
+ listClassName,
421
+ disabled,
422
+ ariaLabel = 'Select language',
423
+ }) {
424
+ const selected = useMemo(() => {
425
+ var _locales_find, _ref;
426
+ return (_ref =
427
+ (_locales_find = locales.find((l) => l.locale === value)) !== null &&
428
+ _locales_find !== void 0
429
+ ? _locales_find
430
+ : locales[0]) !== null && _ref !== void 0
431
+ ? _ref
432
+ : null;
433
+ }, [locales, value]);
434
+ if (!locales.length) return null;
435
+ var _selected_locale;
436
+ return jsx('div', {
437
+ className: clsx('relative inline-block', className),
438
+ children: jsx(Listbox, {
439
+ value:
440
+ (_selected_locale =
441
+ selected === null || selected === void 0
442
+ ? void 0
443
+ : selected.locale) !== null && _selected_locale !== void 0
444
+ ? _selected_locale
445
+ : null,
446
+ onChange: (nextLocale) => {
447
+ set(nextLocale);
448
+ },
449
+ disabled: disabled,
450
+ children: ({ open }) => {
451
+ var _selected_label;
452
+ return jsxs(Fragment, {
453
+ children: [
454
+ jsxs(ListboxButton, {
455
+ 'aria-label': ariaLabel,
456
+ 'className': clsx(
457
+ 'inline-flex items-center gap-2 px-3 py-2 text-sm border rounded-md',
458
+ 'disabled:opacity-50 disabled:cursor-not-allowed',
459
+ buttonClassName
460
+ ),
461
+ 'children': [
462
+ jsx('span', {
463
+ 'aria-hidden': 'true',
464
+ 'className': 'text-base leading-none',
465
+ 'children': selected
466
+ ? countryCodeToFlag(selected.countryCode)
467
+ : '🏳️',
468
+ }),
469
+ jsx('span', {
470
+ className: 'whitespace-nowrap',
471
+ children:
472
+ (_selected_label =
473
+ selected === null || selected === void 0
474
+ ? void 0
475
+ : selected.label) !== null && _selected_label !== void 0
476
+ ? _selected_label
477
+ : '',
478
+ }),
479
+ jsx(ForwardRef$5, {
480
+ 'aria-hidden': 'true',
481
+ 'className': 'size-4 ml-1',
482
+ }),
483
+ ],
484
+ }),
485
+ jsx(Transition, {
486
+ as: Fragment$1,
487
+ show: open,
488
+ enter: 'transition ease-out duration-100',
489
+ enterFrom: 'opacity-0 translate-y-1',
490
+ enterTo: 'opacity-100 translate-y-0',
491
+ leave: 'transition ease-in duration-75',
492
+ leaveFrom: 'opacity-100 translate-y-0',
493
+ leaveTo: 'opacity-0 translate-y-1',
494
+ children: jsx(ListboxOptions, {
495
+ className: clsx(
496
+ 'z-50 absolute min-w-[12rem] mt-2 overflow-hidden bg-white border rounded-md shadow-lg focus:outline-none',
497
+ listClassName
498
+ ),
499
+ children: locales.map((opt) =>
500
+ jsx(
501
+ ListboxOption,
502
+ {
503
+ value: opt.locale,
504
+ className: ({ focus }) =>
505
+ clsx(
506
+ 'cursor-pointer select-none px-3 py-2 text-sm',
507
+ focus && 'bg-black/5'
508
+ ),
509
+ children: ({ selected: isSelected }) =>
510
+ jsxs('div', {
511
+ className: 'flex items-center gap-2',
512
+ children: [
513
+ jsx('span', {
514
+ 'aria-hidden': 'true',
515
+ 'className': 'text-base leading-none',
516
+ 'children': countryCodeToFlag(opt.countryCode),
517
+ }),
518
+ jsx('span', {
519
+ className: 'flex-1',
520
+ children: opt.label,
521
+ }),
522
+ isSelected &&
523
+ jsx(ForwardRef$2, {
524
+ 'aria-hidden': 'true',
525
+ 'className': 'size-4',
526
+ }),
527
+ ],
528
+ }),
529
+ },
530
+ opt.locale
531
+ )
532
+ ),
533
+ }),
534
+ }),
535
+ ],
536
+ });
537
+ },
538
+ }),
539
+ });
540
+ }
541
+
542
+ function CancelButton({ onClick }) {
543
+ return jsx('button', {
544
+ type: 'button',
545
+ className:
546
+ '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 ',
547
+ onClick: onClick,
548
+ children: 'Cancel',
549
+ });
550
+ }
551
+
552
+ function ErrorDisplay({ error }) {
553
+ if (!error) return null;
554
+ return jsx('div', {
555
+ className:
556
+ 'error-display p-4 mb-4 text-red-700 bg-red-100 border rounded border-red-400',
557
+ children: error,
558
+ });
559
+ }
560
+
561
+ function HowToCloseText() {
562
+ return jsx('p', {
563
+ className: 'absolute top-full mt-2 text-xs text-black dark:text-white',
564
+ children: 'Schließen: außerhalb klicken oder die Esc-Taste drücken',
565
+ });
566
+ }
567
+
332
568
  function InputField({
333
569
  id,
334
570
  label,
@@ -396,25 +632,6 @@ function InputField({
396
632
  });
397
633
  }
398
634
 
399
- function r(e) {
400
- var t,
401
- f,
402
- n = '';
403
- if ('string' == typeof e || 'number' == typeof e) n += e;
404
- else if ('object' == typeof e)
405
- if (Array.isArray(e)) {
406
- var o = e.length;
407
- for (t = 0; t < o; t++)
408
- e[t] && (f = r(e[t])) && (n && (n += ' '), (n += f));
409
- } else for (f in e) e[f] && (n && (n += ' '), (n += f));
410
- return n;
411
- }
412
- function clsx() {
413
- for (var e, t, f = 0, n = '', o = arguments.length; f < o; f++)
414
- (e = arguments[f]) && (t = r(e)) && (n && (n += ' '), (n += t));
415
- return n;
416
- }
417
-
418
635
  function LoadingSpinner({ className, innerClassName }) {
419
636
  return jsx('div', {
420
637
  className: clsx(
@@ -465,10 +682,12 @@ var Util = /*#__PURE__*/ Object.freeze({
465
682
  HowToCloseText: HowToCloseText,
466
683
  InputField: InputField,
467
684
  LoadingSpinner: LoadingSpinner,
685
+ LocaleSelect: LocaleSelect,
468
686
  MainContentFrame: MainContentFrame,
469
687
  Pagination: Pagination,
470
688
  SaveButton: SaveButton,
471
689
  Textarea: Textarea,
690
+ countryCodeToFlag: countryCodeToFlag,
472
691
  });
473
692
 
474
693
  const SigninForm = ({
@@ -680,6 +899,7 @@ export {
680
899
  HowToCloseText,
681
900
  InputField,
682
901
  LoadingSpinner,
902
+ LocaleSelect,
683
903
  MainContentFrame,
684
904
  Pagination,
685
905
  SaveButton,
@@ -687,6 +907,7 @@ export {
687
907
  SigninLayout,
688
908
  TemplateParserProvider,
689
909
  Textarea,
910
+ countryCodeToFlag,
690
911
  index as default,
691
912
  useTemplateParser,
692
913
  };
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  "publishConfig": {
11
11
  "access": "public"
12
12
  },
13
- "version": "1.1.1",
13
+ "version": "1.2.0",
14
14
  "license": "MIT",
15
15
  "private": false,
16
16
  "engines": {
@@ -60,6 +60,7 @@
60
60
  "dependencies": {
61
61
  },
62
62
  "devDependencies": {
63
+ "@headlessui/react": "^2.2.9",
63
64
  "@heroicons/react": "^2.1.5",
64
65
  "@native-systems/utility": "^2.1.0",
65
66
  "@rollup/plugin-commonjs": "^22.0.2",
@@ -88,8 +89,8 @@
88
89
  "@heroicons/react": "^2.1.5",
89
90
  "@native-systems/utility": "^2.1.0",
90
91
  "handlebars": "^4",
91
- "react-hook-form": "^7",
92
92
  "react": ">=19",
93
- "react-dom": ">=19"
93
+ "react-dom": ">=19",
94
+ "react-hook-form": "^7"
94
95
  }
95
96
  }