@ebertjendustries/cswrapper 1.0.4 → 1.0.6

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.d.mts CHANGED
@@ -1,23 +1,8 @@
1
1
  import React, { Dispatch, SetStateAction } from 'react';
2
2
  import { FormFieldProps } from '@cloudscape-design/components/form-field/interfaces';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
- import { AlertProps } from '@cloudscape-design/components/alert';
5
- import { BoxProps } from '@cloudscape-design/components/box';
6
- import { ButtonProps } from '@cloudscape-design/components/button';
4
+ import { AlertProps, BoxProps, ButtonProps, DatePickerProps, MultiselectProps, SegmentedControlProps, SelectProps, TilesProps, LinkProps, HeaderProps, InputProps, StatusIndicatorProps, TextContentProps, TextareaProps, TimeInputProps, ToggleProps } from '@cloudscape-design/components';
7
5
  import { CheckboxProps } from '@cloudscape-design/components/checkbox/interfaces';
8
- import { DatePickerProps } from '@cloudscape-design/components/date-picker';
9
- import { MultiselectProps } from '@cloudscape-design/components/multiselect';
10
- import { SegmentedControlProps } from '@cloudscape-design/components/segmented-control';
11
- import { SelectProps } from '@cloudscape-design/components/select';
12
- import { TilesProps } from '@cloudscape-design/components/tiles';
13
- import { LinkProps } from '@cloudscape-design/components/link';
14
- import { HeaderProps } from '@cloudscape-design/components/header';
15
- import { InputProps } from '@cloudscape-design/components/input';
16
- import { StatusIndicatorProps } from '@cloudscape-design/components/status-indicator';
17
- import { TextContentProps } from '@cloudscape-design/components/text-content';
18
- import { TextareaProps } from '@cloudscape-design/components/textarea';
19
- import { TimeInputProps } from '@cloudscape-design/components/time-input';
20
- import { ToggleProps } from '@cloudscape-design/components/toggle';
21
6
  import { OptionDefinition } from '@cloudscape-design/components/internal/components/option/interfaces';
22
7
 
23
8
  /**
package/dist/index.d.ts CHANGED
@@ -1,23 +1,8 @@
1
1
  import React, { Dispatch, SetStateAction } from 'react';
2
2
  import { FormFieldProps } from '@cloudscape-design/components/form-field/interfaces';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
- import { AlertProps } from '@cloudscape-design/components/alert';
5
- import { BoxProps } from '@cloudscape-design/components/box';
6
- import { ButtonProps } from '@cloudscape-design/components/button';
4
+ import { AlertProps, BoxProps, ButtonProps, DatePickerProps, MultiselectProps, SegmentedControlProps, SelectProps, TilesProps, LinkProps, HeaderProps, InputProps, StatusIndicatorProps, TextContentProps, TextareaProps, TimeInputProps, ToggleProps } from '@cloudscape-design/components';
7
5
  import { CheckboxProps } from '@cloudscape-design/components/checkbox/interfaces';
8
- import { DatePickerProps } from '@cloudscape-design/components/date-picker';
9
- import { MultiselectProps } from '@cloudscape-design/components/multiselect';
10
- import { SegmentedControlProps } from '@cloudscape-design/components/segmented-control';
11
- import { SelectProps } from '@cloudscape-design/components/select';
12
- import { TilesProps } from '@cloudscape-design/components/tiles';
13
- import { LinkProps } from '@cloudscape-design/components/link';
14
- import { HeaderProps } from '@cloudscape-design/components/header';
15
- import { InputProps } from '@cloudscape-design/components/input';
16
- import { StatusIndicatorProps } from '@cloudscape-design/components/status-indicator';
17
- import { TextContentProps } from '@cloudscape-design/components/text-content';
18
- import { TextareaProps } from '@cloudscape-design/components/textarea';
19
- import { TimeInputProps } from '@cloudscape-design/components/time-input';
20
- import { ToggleProps } from '@cloudscape-design/components/toggle';
21
6
  import { OptionDefinition } from '@cloudscape-design/components/internal/components/option/interfaces';
22
7
 
23
8
  /**
package/dist/index.js CHANGED
@@ -1,9 +1,7 @@
1
1
  "use strict";
2
- var __create = Object.create;
3
2
  var __defProp = Object.defineProperty;
4
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
6
  var __export = (target, all) => {
9
7
  for (var name in all)
@@ -17,14 +15,6 @@ var __copyProps = (to, from, except, desc) => {
17
15
  }
18
16
  return to;
19
17
  };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
19
 
30
20
  // src/index.ts
@@ -118,7 +108,7 @@ __export(index_exports, {
118
108
  module.exports = __toCommonJS(index_exports);
119
109
 
120
110
  // src/components/CSAlert.tsx
121
- var import_alert = __toESM(require("@cloudscape-design/components/alert"));
111
+ var import_components2 = require("@cloudscape-design/components");
122
112
 
123
113
  // src/types/CSFormProps.ts
124
114
  var FromPropsHelper = class {
@@ -148,7 +138,7 @@ FromPropsHelper.sanitizeValueToString = (value) => {
148
138
  };
149
139
 
150
140
  // src/components/CSFormField.tsx
151
- var import_form_field = __toESM(require("@cloudscape-design/components/form-field"));
141
+ var import_components = require("@cloudscape-design/components");
152
142
  var import_jsx_runtime = (
153
143
  // IMPORTANT: Order of props determines which one "wins". You can override Elements that are present in the
154
144
  // localisation texts via the additional props. For instance, you can pass in
@@ -162,7 +152,7 @@ function CSFormField(props) {
162
152
  if (!FromPropsHelper.usesFormField(props)) {
163
153
  return props.children;
164
154
  }
165
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form_field.default, { "data-testid": formFieldId, ...localisationObject == null ? void 0 : localisationObject.formField, ...props.formField, children: props.children });
155
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.FormField, { "data-testid": formFieldId, ...localisationObject == null ? void 0 : localisationObject.formField, ...props.formField, children: props.children });
166
156
  }
167
157
 
168
158
  // src/components/ChildUtils.tsx
@@ -199,7 +189,7 @@ function CSAlert(props) {
199
189
  const { localisationObject, uniqueId } = FromPropsHelper.getBasicProps(props);
200
190
  const { children, formProps } = ChildUtils.getChildren(props, localisationObject);
201
191
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(CSFormField, { ...formProps, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
202
- import_alert.default,
192
+ import_components2.Alert,
203
193
  {
204
194
  "data-testid": uniqueId,
205
195
  ...props,
@@ -210,13 +200,13 @@ function CSAlert(props) {
210
200
  }
211
201
 
212
202
  // src/components/CSBox.tsx
213
- var import_box = __toESM(require("@cloudscape-design/components/box"));
203
+ var import_components3 = require("@cloudscape-design/components");
214
204
  var import_jsx_runtime4 = require("react/jsx-runtime");
215
205
  function CSBox(props) {
216
206
  const { localisationObject, uniqueId } = FromPropsHelper.getBasicProps(props);
217
207
  const { children, formProps } = ChildUtils.getChildren(props, localisationObject);
218
208
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(CSFormField, { ...formProps, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
219
- import_box.default,
209
+ import_components3.Box,
220
210
  {
221
211
  "data-testid": uniqueId,
222
212
  ...props,
@@ -227,13 +217,13 @@ function CSBox(props) {
227
217
  }
228
218
 
229
219
  // src/components/CSButton.tsx
230
- var import_button = __toESM(require("@cloudscape-design/components/button"));
220
+ var import_components4 = require("@cloudscape-design/components");
231
221
  var import_jsx_runtime5 = require("react/jsx-runtime");
232
222
  function CSButton(props) {
233
223
  const { localisationObject, uniqueId } = FromPropsHelper.getBasicProps(props);
234
224
  const { children, formProps } = ChildUtils.getChildren(props, localisationObject);
235
225
  return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(CSFormField, { ...formProps, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
236
- import_button.default,
226
+ import_components4.Button,
237
227
  {
238
228
  "data-testid": uniqueId,
239
229
  ...props,
@@ -244,13 +234,13 @@ function CSButton(props) {
244
234
  }
245
235
 
246
236
  // src/components/CSCheckbox.tsx
247
- var import_checkbox = __toESM(require("@cloudscape-design/components/checkbox"));
237
+ var import_components5 = require("@cloudscape-design/components");
248
238
  var import_jsx_runtime6 = require("react/jsx-runtime");
249
239
  function CSCheckbox(props) {
250
240
  const { localisationObject, uniqueId } = FromPropsHelper.getBasicProps(props);
251
241
  const { children, formProps } = ChildUtils.getChildren(props, localisationObject);
252
242
  return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(CSFormField, { ...formProps, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
253
- import_checkbox.default,
243
+ import_components5.Checkbox,
254
244
  {
255
245
  "data-testid": uniqueId,
256
246
  name: uniqueId,
@@ -264,7 +254,7 @@ function CSCheckbox(props) {
264
254
  }
265
255
 
266
256
  // src/components/CSDatePicker.tsx
267
- var import_date_picker = __toESM(require("@cloudscape-design/components/date-picker"));
257
+ var import_components6 = require("@cloudscape-design/components");
268
258
  var import_jsx_runtime7 = require("react/jsx-runtime");
269
259
  function CSDatePicker(props) {
270
260
  const { localisationObject, uniqueId } = FromPropsHelper.getBasicProps(props);
@@ -272,7 +262,7 @@ function CSDatePicker(props) {
272
262
  return new Date(FromPropsHelper.sanitizeValueToString(props.value)).toISOString().split("T")[0];
273
263
  };
274
264
  return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(CSFormField, { ...props, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
275
- import_date_picker.default,
265
+ import_components6.DatePicker,
276
266
  {
277
267
  "data-testid": uniqueId,
278
268
  controlId: uniqueId,
@@ -285,7 +275,7 @@ function CSDatePicker(props) {
285
275
  }
286
276
 
287
277
  // src/components/CSMultiselect.tsx
288
- var import_multiselect = __toESM(require("@cloudscape-design/components/multiselect"));
278
+ var import_components7 = require("@cloudscape-design/components");
289
279
  var import_jsx_runtime8 = require("react/jsx-runtime");
290
280
  function CSMultiselect(props) {
291
281
  var _a, _b;
@@ -304,7 +294,7 @@ function CSMultiselect(props) {
304
294
  };
305
295
  const hideTokens = (_a = props.hideTokens) != null ? _a : props.tokenLimit !== void 0 && props.tokenLimit === 0;
306
296
  return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(CSFormField, { ...formProps, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
307
- import_multiselect.default,
297
+ import_components7.Multiselect,
308
298
  {
309
299
  "data-testid": uniqueId,
310
300
  controlId: uniqueId,
@@ -415,13 +405,13 @@ function CSEnumMultiselect(props) {
415
405
  }
416
406
 
417
407
  // src/components/CSSegmentedControl.tsx
418
- var import_segmented_control = __toESM(require("@cloudscape-design/components/segmented-control"));
408
+ var import_components8 = require("@cloudscape-design/components");
419
409
  var import_jsx_runtime10 = require("react/jsx-runtime");
420
410
  function CSSegmentedControl(props) {
421
411
  const { localisationObject, uniqueId } = FromPropsHelper.getBasicProps(props);
422
412
  const { formProps } = ChildUtils.getChildren(props, localisationObject);
423
413
  return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(CSFormField, { ...formProps, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
424
- import_segmented_control.default,
414
+ import_components8.SegmentedControl,
425
415
  {
426
416
  "data-testid": uniqueId,
427
417
  onChange: ({ detail }) => props.onChangeValue(props.fieldSpec.key, detail.selectedId),
@@ -450,13 +440,13 @@ function CSEnumSegmentedControl(props) {
450
440
  }
451
441
 
452
442
  // src/components/CSSelect.tsx
453
- var import_select = __toESM(require("@cloudscape-design/components/select"));
443
+ var import_components9 = require("@cloudscape-design/components");
454
444
  var import_jsx_runtime12 = require("react/jsx-runtime");
455
445
  function CSSelect(props) {
456
446
  const { localisationObject, uniqueId } = FromPropsHelper.getBasicProps(props);
457
447
  const { formProps } = ChildUtils.getChildren(props, localisationObject);
458
448
  return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(CSFormField, { ...formProps, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
459
- import_select.default,
449
+ import_components9.Select,
460
450
  {
461
451
  "data-testid": uniqueId,
462
452
  controlId: uniqueId,
@@ -480,7 +470,7 @@ function CSEnumSelect(props) {
480
470
  }
481
471
 
482
472
  // src/components/CSEnumTiles.tsx
483
- var import_tiles = __toESM(require("@cloudscape-design/components/tiles"));
473
+ var import_components10 = require("@cloudscape-design/components");
484
474
  var import_jsx_runtime14 = require("react/jsx-runtime");
485
475
  function CSEnumTiles(props) {
486
476
  const { localisationObject, uniqueId } = FromPropsHelper.getBasicProps(props);
@@ -493,7 +483,7 @@ function CSEnumTiles(props) {
493
483
  };
494
484
  });
495
485
  return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
496
- import_tiles.default,
486
+ import_components10.Tiles,
497
487
  {
498
488
  "data-testid": uniqueId,
499
489
  controlId: uniqueId,
@@ -508,7 +498,7 @@ function CSEnumTiles(props) {
508
498
  }
509
499
 
510
500
  // src/components/CSLink.tsx
511
- var import_link = __toESM(require("@cloudscape-design/components/link"));
501
+ var import_components11 = require("@cloudscape-design/components");
512
502
 
513
503
  // src/utils/BrowserUtils.ts
514
504
  var openInNewTab = (link) => {
@@ -535,7 +525,7 @@ function CSLink(props) {
535
525
  const { localisationObject, uniqueId } = FromPropsHelper.getBasicProps(props);
536
526
  const { children, formProps } = ChildUtils.getChildren(props, localisationObject);
537
527
  return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(CSFormField, { ...formProps, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
538
- import_link.default,
528
+ import_components11.Link,
539
529
  {
540
530
  "data-testid": uniqueId,
541
531
  ...props,
@@ -549,13 +539,13 @@ function CSExternalLink(props) {
549
539
  }
550
540
 
551
541
  // src/components/CSHeader.tsx
552
- var import_header = __toESM(require("@cloudscape-design/components/header"));
542
+ var import_components12 = require("@cloudscape-design/components");
553
543
  var import_jsx_runtime16 = require("react/jsx-runtime");
554
544
  function CSHeader(props) {
555
545
  const { localisationObject, uniqueId } = FromPropsHelper.getBasicProps(props);
556
546
  const { children } = ChildUtils.getChildren(props, localisationObject);
557
547
  return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
558
- import_header.default,
548
+ import_components12.Header,
559
549
  {
560
550
  "data-testid": uniqueId,
561
551
  ...props,
@@ -566,7 +556,7 @@ function CSHeader(props) {
566
556
  }
567
557
 
568
558
  // src/components/CSInput.tsx
569
- var import_input = __toESM(require("@cloudscape-design/components/input"));
559
+ var import_components13 = require("@cloudscape-design/components");
570
560
  var import_jsx_runtime17 = require("react/jsx-runtime");
571
561
  function CSInput(props) {
572
562
  const { localisationObject, uniqueId } = FromPropsHelper.getBasicProps(props);
@@ -574,7 +564,7 @@ function CSInput(props) {
574
564
  const sanitizedValue = FromPropsHelper.sanitizeValueToString(props.value);
575
565
  const errorText = FromPropsHelper.getLocalisedErrorText(props, sanitizedValue, props.localiser.getFieldValidityLocalisationFunction());
576
566
  return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(CSFormField, { ...props, formField: { ...formProps, errorText }, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
577
- import_input.default,
567
+ import_components13.Input,
578
568
  {
579
569
  "data-testid": uniqueId,
580
570
  controlId: uniqueId,
@@ -587,7 +577,7 @@ function CSInput(props) {
587
577
  }
588
578
 
589
579
  // src/components/CSNumericInput.tsx
590
- var import_input2 = __toESM(require("@cloudscape-design/components/input"));
580
+ var import_components14 = require("@cloudscape-design/components");
591
581
  var import_jsx_runtime18 = require("react/jsx-runtime");
592
582
  function CSNumericInput(props) {
593
583
  const { localisationObject, uniqueId } = FromPropsHelper.getBasicProps(props);
@@ -601,7 +591,7 @@ function CSNumericInput(props) {
601
591
  const sanitizedValue = sanitizeValue();
602
592
  const errorText = FromPropsHelper.getLocalisedErrorText(props, sanitizedValue, props.localiser.getFieldValidityLocalisationFunction());
603
593
  return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(CSFormField, { ...formProps, formField: { ...props.formField, errorText }, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
604
- import_input2.default,
594
+ import_components14.Input,
605
595
  {
606
596
  "data-testid": uniqueId,
607
597
  controlId: uniqueId,
@@ -618,13 +608,13 @@ function CSNumericInput(props) {
618
608
  }
619
609
 
620
610
  // src/components/CSStatusIndicator.tsx
621
- var import_status_indicator = __toESM(require("@cloudscape-design/components/status-indicator"));
611
+ var import_components15 = require("@cloudscape-design/components");
622
612
  var import_jsx_runtime19 = require("react/jsx-runtime");
623
613
  function CSStatusIndicator(props) {
624
614
  const { localisationObject, uniqueId } = FromPropsHelper.getBasicProps(props);
625
615
  const { children, formProps } = ChildUtils.getChildren(props, localisationObject);
626
616
  return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(CSFormField, { ...formProps, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
627
- import_status_indicator.default,
617
+ import_components15.StatusIndicator,
628
618
  {
629
619
  "data-testid": uniqueId,
630
620
  ...props,
@@ -635,13 +625,13 @@ function CSStatusIndicator(props) {
635
625
  }
636
626
 
637
627
  // src/components/CSTextContent.tsx
638
- var import_text_content = __toESM(require("@cloudscape-design/components/text-content"));
628
+ var import_components16 = require("@cloudscape-design/components");
639
629
  var import_jsx_runtime20 = require("react/jsx-runtime");
640
630
  function CSTextContent(props) {
641
631
  const { localisationObject, uniqueId } = FromPropsHelper.getBasicProps(props);
642
632
  const { children, formProps } = ChildUtils.getChildren(props, localisationObject);
643
633
  return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(CSFormField, { ...formProps, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
644
- import_text_content.default,
634
+ import_components16.TextContent,
645
635
  {
646
636
  "data-testid": uniqueId,
647
637
  ...props,
@@ -652,7 +642,7 @@ function CSTextContent(props) {
652
642
  }
653
643
 
654
644
  // src/components/CSTextarea.tsx
655
- var import_textarea = __toESM(require("@cloudscape-design/components/textarea"));
645
+ var import_components17 = require("@cloudscape-design/components");
656
646
  var import_jsx_runtime21 = require("react/jsx-runtime");
657
647
  function CSTextarea(props) {
658
648
  const { localisationObject, uniqueId } = FromPropsHelper.getBasicProps(props);
@@ -660,7 +650,7 @@ function CSTextarea(props) {
660
650
  const sanitizedValue = FromPropsHelper.sanitizeValueToString(props.value);
661
651
  const errorText = FromPropsHelper.getLocalisedErrorText(props, sanitizedValue, props.localiser.getFieldValidityLocalisationFunction());
662
652
  return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(CSFormField, { ...props, formField: { ...formProps, errorText }, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
663
- import_textarea.default,
653
+ import_components17.Textarea,
664
654
  {
665
655
  "data-testid": uniqueId,
666
656
  controlId: uniqueId,
@@ -673,14 +663,14 @@ function CSTextarea(props) {
673
663
  }
674
664
 
675
665
  // src/components/CSTimeInput.tsx
676
- var import_time_input = __toESM(require("@cloudscape-design/components/time-input"));
666
+ var import_components18 = require("@cloudscape-design/components");
677
667
  var import_jsx_runtime22 = require("react/jsx-runtime");
678
668
  function CSTimeInput(props) {
679
669
  const { localisationObject, uniqueId } = FromPropsHelper.getBasicProps(props);
680
670
  const { formProps } = ChildUtils.getChildren(props, localisationObject);
681
671
  const defaultFormat = "hh:mm";
682
672
  return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(CSFormField, { ...formProps, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
683
- import_time_input.default,
673
+ import_components18.TimeInput,
684
674
  {
685
675
  "data-testid": uniqueId,
686
676
  autoFocus: props.autoFocus,
@@ -694,13 +684,13 @@ function CSTimeInput(props) {
694
684
  }
695
685
 
696
686
  // src/components/CSToggle.tsx
697
- var import_toggle = __toESM(require("@cloudscape-design/components/toggle"));
687
+ var import_components19 = require("@cloudscape-design/components");
698
688
  var import_jsx_runtime23 = require("react/jsx-runtime");
699
689
  function CSToggle(props) {
700
690
  const { localisationObject, uniqueId } = FromPropsHelper.getBasicProps(props);
701
691
  const { children, formProps } = ChildUtils.getChildren(props, localisationObject);
702
692
  return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(CSFormField, { ...formProps, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
703
- import_toggle.default,
693
+ import_components19.Toggle,
704
694
  {
705
695
  "data-testid": uniqueId,
706
696
  name: uniqueId,
@@ -1031,8 +1021,7 @@ function CSVEnumRatingView(props) {
1031
1021
  }
1032
1022
 
1033
1023
  // src/views/CSVNoItemsView.tsx
1034
- var import_box2 = __toESM(require("@cloudscape-design/components/box"));
1035
- var import_space_between = __toESM(require("@cloudscape-design/components/space-between"));
1024
+ var import_components20 = require("@cloudscape-design/components");
1036
1025
  var import_jsx_runtime25 = require("react/jsx-runtime");
1037
1026
  var CSV_NO_ITEMS_VIEW_SPEC = (ns) => ViewSpec.create("CSVNoItemsView", ns, (spec) => ({
1038
1027
  boxHeading: spec.addField(new FieldSpec("boxHeading")),
@@ -1041,7 +1030,7 @@ var CSV_NO_ITEMS_VIEW_SPEC = (ns) => ViewSpec.create("CSVNoItemsView", ns, (spec
1041
1030
  function CSVNoItemsView(props) {
1042
1031
  const spec = props.viewSpec;
1043
1032
  const { elements } = spec;
1044
- return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { "data-testid": spec.getDataTestId(), children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_box2.default, { textAlign: "center", color: "inherit", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_space_between.default, { size: "xxs", direction: "vertical", children: [
1033
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { "data-testid": spec.getDataTestId(), children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_components20.Box, { textAlign: "center", color: "inherit", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_components20.SpaceBetween, { size: "xxs", direction: "vertical", children: [
1045
1034
  /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
1046
1035
  CSBox,
1047
1036
  {
@@ -1070,7 +1059,7 @@ function CSVNoItemsView(props) {
1070
1059
  }
1071
1060
 
1072
1061
  // src/views/CSVPriceInputView.tsx
1073
- var import_grid = __toESM(require("@cloudscape-design/components/grid"));
1062
+ var import_components21 = require("@cloudscape-design/components");
1074
1063
 
1075
1064
  // src/utils/PriceUtils.ts
1076
1065
  var LOGGER2 = new Log("PriceUtils");
@@ -1145,7 +1134,7 @@ function CSVPriceInputView(props) {
1145
1134
  const priceInCents = props.value ? props.value.priceInCents : 0;
1146
1135
  const currency = props.value ? props.value.currency : props.defaultCurrency;
1147
1136
  return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
1148
- import_grid.default,
1137
+ import_components21.Grid,
1149
1138
  {
1150
1139
  gridDefinition: [{ colspan: 4 }, { colspan: { default: 4, xxs: 3 } }, { colspan: { default: 4, xxs: 5 } }],
1151
1140
  disableGutters: true,
@@ -1196,7 +1185,7 @@ function CSVPriceInputView(props) {
1196
1185
  }
1197
1186
 
1198
1187
  // src/views/CSVSearchFilterView.tsx
1199
- var import_space_between2 = __toESM(require("@cloudscape-design/components/space-between"));
1188
+ var import_components22 = require("@cloudscape-design/components");
1200
1189
  var import_jsx_runtime27 = require("react/jsx-runtime");
1201
1190
  var CSV_SEARCH_FILTER_VIEW_SPEC = (parent, key) => ViewSpec.create(key, parent.ns, (spec) => ({
1202
1191
  inputSearch: spec.addField(new FieldSpec("inputSearch")),
@@ -1205,7 +1194,7 @@ var CSV_SEARCH_FILTER_VIEW_SPEC = (parent, key) => ViewSpec.create(key, parent.n
1205
1194
  function CSVSearchFilterView(props) {
1206
1195
  const spec = props.viewSpec;
1207
1196
  const { elements } = spec;
1208
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_space_between2.default, { size: "s", direction: "horizontal", children: [
1197
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_components22.SpaceBetween, { size: "s", direction: "horizontal", children: [
1209
1198
  /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { style: { minWidth: "320px" }, children: props.inputSearch === void 0 || typeof props.inputSearch === "string" ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
1210
1199
  CSInput,
1211
1200
  {
@@ -1236,9 +1225,7 @@ function CSVSearchFilterView(props) {
1236
1225
  }
1237
1226
 
1238
1227
  // src/views/CSVTextPromptModalView.tsx
1239
- var import_box3 = __toESM(require("@cloudscape-design/components/box"));
1240
- var import_modal = __toESM(require("@cloudscape-design/components/modal"));
1241
- var import_space_between3 = __toESM(require("@cloudscape-design/components/space-between"));
1228
+ var import_components23 = require("@cloudscape-design/components");
1242
1229
  var import_jsx_runtime28 = require("react/jsx-runtime");
1243
1230
  var CSV_TEXT_PROMPT_MODAL_VIEW_SPEC = (parent, key) => ViewSpec.create(key, parent.ns, (spec) => ({
1244
1231
  headerHeading: spec.addField(new FieldSpec("headerHeading")),
@@ -1260,7 +1247,7 @@ function CSVTextPromptModalView(props) {
1260
1247
  }
1261
1248
  ) : props.buttonSecondary : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_jsx_runtime28.Fragment, {});
1262
1249
  return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
1263
- import_modal.default,
1250
+ import_components23.Modal,
1264
1251
  {
1265
1252
  "data-testid": props.viewSpec.getDataTestId(),
1266
1253
  onDismiss: props.onDismiss,
@@ -1273,7 +1260,7 @@ function CSVTextPromptModalView(props) {
1273
1260
  children: props.headerHeading
1274
1261
  }
1275
1262
  ) : props.headerHeading,
1276
- footer: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_box3.default, { float: "right", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_space_between3.default, { direction: "horizontal", size: "l", children: [
1263
+ footer: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_components23.Box, { float: "right", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_components23.SpaceBetween, { direction: "horizontal", size: "l", children: [
1277
1264
  props.buttonPrimary === void 0 || typeof props.buttonPrimary === "string" ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
1278
1265
  CSButton,
1279
1266
  {
@@ -1720,7 +1707,7 @@ var RestClient = class {
1720
1707
  json
1721
1708
  }));
1722
1709
  } else {
1723
- return response.text().then((text) => ({
1710
+ return response.text().then(() => ({
1724
1711
  status: response.status,
1725
1712
  json: {}
1726
1713
  }));
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  // src/components/CSAlert.tsx
2
- import Alert from "@cloudscape-design/components/alert";
2
+ import { Alert } from "@cloudscape-design/components";
3
3
 
4
4
  // src/types/CSFormProps.ts
5
5
  var FromPropsHelper = class {
@@ -29,7 +29,7 @@ FromPropsHelper.sanitizeValueToString = (value) => {
29
29
  };
30
30
 
31
31
  // src/components/CSFormField.tsx
32
- import FormField from "@cloudscape-design/components/form-field";
32
+ import { FormField } from "@cloudscape-design/components";
33
33
  import { jsx } from "react/jsx-runtime";
34
34
  var FORM_FIELD_ID_SUFFIX = "_FORM_FIELD";
35
35
  function CSFormField(props) {
@@ -91,7 +91,7 @@ function CSAlert(props) {
91
91
  }
92
92
 
93
93
  // src/components/CSBox.tsx
94
- import Box from "@cloudscape-design/components/box";
94
+ import { Box } from "@cloudscape-design/components";
95
95
  import { jsx as jsx4 } from "react/jsx-runtime";
96
96
  function CSBox(props) {
97
97
  const { localisationObject, uniqueId } = FromPropsHelper.getBasicProps(props);
@@ -108,7 +108,7 @@ function CSBox(props) {
108
108
  }
109
109
 
110
110
  // src/components/CSButton.tsx
111
- import Button from "@cloudscape-design/components/button";
111
+ import { Button } from "@cloudscape-design/components";
112
112
  import { jsx as jsx5 } from "react/jsx-runtime";
113
113
  function CSButton(props) {
114
114
  const { localisationObject, uniqueId } = FromPropsHelper.getBasicProps(props);
@@ -125,7 +125,7 @@ function CSButton(props) {
125
125
  }
126
126
 
127
127
  // src/components/CSCheckbox.tsx
128
- import Checkbox from "@cloudscape-design/components/checkbox";
128
+ import { Checkbox } from "@cloudscape-design/components";
129
129
  import { jsx as jsx6 } from "react/jsx-runtime";
130
130
  function CSCheckbox(props) {
131
131
  const { localisationObject, uniqueId } = FromPropsHelper.getBasicProps(props);
@@ -145,7 +145,7 @@ function CSCheckbox(props) {
145
145
  }
146
146
 
147
147
  // src/components/CSDatePicker.tsx
148
- import DatePicker from "@cloudscape-design/components/date-picker";
148
+ import { DatePicker } from "@cloudscape-design/components";
149
149
  import { jsx as jsx7 } from "react/jsx-runtime";
150
150
  function CSDatePicker(props) {
151
151
  const { localisationObject, uniqueId } = FromPropsHelper.getBasicProps(props);
@@ -166,7 +166,7 @@ function CSDatePicker(props) {
166
166
  }
167
167
 
168
168
  // src/components/CSMultiselect.tsx
169
- import Multiselect from "@cloudscape-design/components/multiselect";
169
+ import { Multiselect } from "@cloudscape-design/components";
170
170
  import { jsx as jsx8 } from "react/jsx-runtime";
171
171
  function CSMultiselect(props) {
172
172
  var _a, _b;
@@ -296,7 +296,7 @@ function CSEnumMultiselect(props) {
296
296
  }
297
297
 
298
298
  // src/components/CSSegmentedControl.tsx
299
- import SegmentedControl from "@cloudscape-design/components/segmented-control";
299
+ import { SegmentedControl } from "@cloudscape-design/components";
300
300
  import { jsx as jsx10 } from "react/jsx-runtime";
301
301
  function CSSegmentedControl(props) {
302
302
  const { localisationObject, uniqueId } = FromPropsHelper.getBasicProps(props);
@@ -331,7 +331,7 @@ function CSEnumSegmentedControl(props) {
331
331
  }
332
332
 
333
333
  // src/components/CSSelect.tsx
334
- import Select from "@cloudscape-design/components/select";
334
+ import { Select } from "@cloudscape-design/components";
335
335
  import { jsx as jsx12 } from "react/jsx-runtime";
336
336
  function CSSelect(props) {
337
337
  const { localisationObject, uniqueId } = FromPropsHelper.getBasicProps(props);
@@ -361,7 +361,7 @@ function CSEnumSelect(props) {
361
361
  }
362
362
 
363
363
  // src/components/CSEnumTiles.tsx
364
- import Tiles from "@cloudscape-design/components/tiles";
364
+ import { Tiles } from "@cloudscape-design/components";
365
365
  import { jsx as jsx14 } from "react/jsx-runtime";
366
366
  function CSEnumTiles(props) {
367
367
  const { localisationObject, uniqueId } = FromPropsHelper.getBasicProps(props);
@@ -389,7 +389,7 @@ function CSEnumTiles(props) {
389
389
  }
390
390
 
391
391
  // src/components/CSLink.tsx
392
- import Link from "@cloudscape-design/components/link";
392
+ import { Link } from "@cloudscape-design/components";
393
393
 
394
394
  // src/utils/BrowserUtils.ts
395
395
  var openInNewTab = (link) => {
@@ -430,7 +430,7 @@ function CSExternalLink(props) {
430
430
  }
431
431
 
432
432
  // src/components/CSHeader.tsx
433
- import Header from "@cloudscape-design/components/header";
433
+ import { Header } from "@cloudscape-design/components";
434
434
  import { jsx as jsx16 } from "react/jsx-runtime";
435
435
  function CSHeader(props) {
436
436
  const { localisationObject, uniqueId } = FromPropsHelper.getBasicProps(props);
@@ -447,7 +447,7 @@ function CSHeader(props) {
447
447
  }
448
448
 
449
449
  // src/components/CSInput.tsx
450
- import Input from "@cloudscape-design/components/input";
450
+ import { Input } from "@cloudscape-design/components";
451
451
  import { jsx as jsx17 } from "react/jsx-runtime";
452
452
  function CSInput(props) {
453
453
  const { localisationObject, uniqueId } = FromPropsHelper.getBasicProps(props);
@@ -468,7 +468,7 @@ function CSInput(props) {
468
468
  }
469
469
 
470
470
  // src/components/CSNumericInput.tsx
471
- import Input2 from "@cloudscape-design/components/input";
471
+ import { Input as Input2 } from "@cloudscape-design/components";
472
472
  import { jsx as jsx18 } from "react/jsx-runtime";
473
473
  function CSNumericInput(props) {
474
474
  const { localisationObject, uniqueId } = FromPropsHelper.getBasicProps(props);
@@ -499,7 +499,7 @@ function CSNumericInput(props) {
499
499
  }
500
500
 
501
501
  // src/components/CSStatusIndicator.tsx
502
- import StatusIndicator from "@cloudscape-design/components/status-indicator";
502
+ import { StatusIndicator } from "@cloudscape-design/components";
503
503
  import { jsx as jsx19 } from "react/jsx-runtime";
504
504
  function CSStatusIndicator(props) {
505
505
  const { localisationObject, uniqueId } = FromPropsHelper.getBasicProps(props);
@@ -516,7 +516,7 @@ function CSStatusIndicator(props) {
516
516
  }
517
517
 
518
518
  // src/components/CSTextContent.tsx
519
- import TextContent from "@cloudscape-design/components/text-content";
519
+ import { TextContent } from "@cloudscape-design/components";
520
520
  import { jsx as jsx20 } from "react/jsx-runtime";
521
521
  function CSTextContent(props) {
522
522
  const { localisationObject, uniqueId } = FromPropsHelper.getBasicProps(props);
@@ -533,7 +533,7 @@ function CSTextContent(props) {
533
533
  }
534
534
 
535
535
  // src/components/CSTextarea.tsx
536
- import Textarea from "@cloudscape-design/components/textarea";
536
+ import { Textarea } from "@cloudscape-design/components";
537
537
  import { jsx as jsx21 } from "react/jsx-runtime";
538
538
  function CSTextarea(props) {
539
539
  const { localisationObject, uniqueId } = FromPropsHelper.getBasicProps(props);
@@ -554,7 +554,7 @@ function CSTextarea(props) {
554
554
  }
555
555
 
556
556
  // src/components/CSTimeInput.tsx
557
- import TimeInput from "@cloudscape-design/components/time-input";
557
+ import { TimeInput } from "@cloudscape-design/components";
558
558
  import { jsx as jsx22 } from "react/jsx-runtime";
559
559
  function CSTimeInput(props) {
560
560
  const { localisationObject, uniqueId } = FromPropsHelper.getBasicProps(props);
@@ -575,7 +575,7 @@ function CSTimeInput(props) {
575
575
  }
576
576
 
577
577
  // src/components/CSToggle.tsx
578
- import Toggle from "@cloudscape-design/components/toggle";
578
+ import { Toggle } from "@cloudscape-design/components";
579
579
  import { jsx as jsx23 } from "react/jsx-runtime";
580
580
  function CSToggle(props) {
581
581
  const { localisationObject, uniqueId } = FromPropsHelper.getBasicProps(props);
@@ -912,8 +912,7 @@ function CSVEnumRatingView(props) {
912
912
  }
913
913
 
914
914
  // src/views/CSVNoItemsView.tsx
915
- import Box2 from "@cloudscape-design/components/box";
916
- import SpaceBetween from "@cloudscape-design/components/space-between";
915
+ import { Box as Box2, SpaceBetween } from "@cloudscape-design/components";
917
916
  import { jsx as jsx25, jsxs as jsxs3 } from "react/jsx-runtime";
918
917
  var CSV_NO_ITEMS_VIEW_SPEC = (ns) => ViewSpec.create("CSVNoItemsView", ns, (spec) => ({
919
918
  boxHeading: spec.addField(new FieldSpec("boxHeading")),
@@ -951,7 +950,7 @@ function CSVNoItemsView(props) {
951
950
  }
952
951
 
953
952
  // src/views/CSVPriceInputView.tsx
954
- import Grid from "@cloudscape-design/components/grid";
953
+ import { Grid } from "@cloudscape-design/components";
955
954
 
956
955
  // src/utils/PriceUtils.ts
957
956
  var LOGGER2 = new Log("PriceUtils");
@@ -1077,7 +1076,7 @@ function CSVPriceInputView(props) {
1077
1076
  }
1078
1077
 
1079
1078
  // src/views/CSVSearchFilterView.tsx
1080
- import SpaceBetween2 from "@cloudscape-design/components/space-between";
1079
+ import { SpaceBetween as SpaceBetween2 } from "@cloudscape-design/components";
1081
1080
  import { jsx as jsx27, jsxs as jsxs5 } from "react/jsx-runtime";
1082
1081
  var CSV_SEARCH_FILTER_VIEW_SPEC = (parent, key) => ViewSpec.create(key, parent.ns, (spec) => ({
1083
1082
  inputSearch: spec.addField(new FieldSpec("inputSearch")),
@@ -1117,9 +1116,7 @@ function CSVSearchFilterView(props) {
1117
1116
  }
1118
1117
 
1119
1118
  // src/views/CSVTextPromptModalView.tsx
1120
- import Box3 from "@cloudscape-design/components/box";
1121
- import Modal from "@cloudscape-design/components/modal";
1122
- import SpaceBetween3 from "@cloudscape-design/components/space-between";
1119
+ import { Box as Box3, Modal, SpaceBetween as SpaceBetween3 } from "@cloudscape-design/components";
1123
1120
  import { Fragment, jsx as jsx28, jsxs as jsxs6 } from "react/jsx-runtime";
1124
1121
  var CSV_TEXT_PROMPT_MODAL_VIEW_SPEC = (parent, key) => ViewSpec.create(key, parent.ns, (spec) => ({
1125
1122
  headerHeading: spec.addField(new FieldSpec("headerHeading")),
@@ -1601,7 +1598,7 @@ var RestClient = class {
1601
1598
  json
1602
1599
  }));
1603
1600
  } else {
1604
- return response.text().then((text) => ({
1601
+ return response.text().then(() => ({
1605
1602
  status: response.status,
1606
1603
  json: {}
1607
1604
  }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ebertjendustries/cswrapper",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "main": "dist/index.cjs",
5
5
  "module": "dist/index.mjs",
6
6
  "types": "dist/index.d.ts",
@@ -43,9 +43,11 @@
43
43
  "@types/node": "^22.15.21",
44
44
  "@types/react": "^19.1.5",
45
45
  "@types/react-dom": "^19.1.5",
46
+ "@vitejs/plugin-react": "^4.5.0",
46
47
  "eslint": "^9.27.0",
47
48
  "eslint-plugin-jest-dom": "^5.5.0",
48
49
  "eslint-plugin-testing-library": "^7.2.1",
50
+ "jsdom": "^26.1.0",
49
51
  "react": "^19.1.0",
50
52
  "react-dom": "^19.1.0",
51
53
  "ts-node": "^10.9.2",
@@ -54,7 +56,8 @@
54
56
  "vitest": "^3.1.4"
55
57
  },
56
58
  "scripts": {
57
- "build": "tsup"
59
+ "build": "tsup",
60
+ "test": "vitest run"
58
61
  },
59
62
  "eslintConfig": {
60
63
  "extends": [