@soyio/soyio-widget 2.16.1 → 2.17.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/README.md CHANGED
@@ -460,21 +460,145 @@ Customize the look and feel of Soyio UI components by passing an `appearance` ob
460
460
 
461
461
  ### Structure
462
462
 
463
- The appearance object consists of three main sections:
463
+ The appearance object consists of four main sections:
464
464
 
465
465
  ```javascript
466
466
  const appearance = {
467
467
  theme: string,
468
468
  variables: Variables,
469
469
  rules: Rules,
470
+ config: Config,
470
471
  };
471
472
  ```
472
473
 
473
474
  ### Themes
474
475
 
475
- Currently supported themes:
476
+ Built-in themes provide pre-configured color palettes and component styles:
476
477
 
477
- - `"soyio"` (default) - The standard Soyio theme
478
+ | Theme | Description |
479
+ | ----- | ----------- |
480
+ | `"soyio"` | Default light theme with Soyio brand colors (purple/indigo), uppercase titles |
481
+ | `"night"` | Dark mode theme with deep blues, muted colors, and subtle borders |
482
+ | `"flat"` | Minimal theme with square corners, normal-case titles, thicker borders |
483
+
484
+ **Theme style differences:**
485
+
486
+ - **soyio**: Standard styling with rounded corners and uppercase card titles
487
+ - **night**: Dark backgrounds, lighter text, borders using theme variables
488
+ - **flat**: No border radius, sentence-case titles (no uppercase), 2px borders, lighter font weights
489
+
490
+ **Example:**
491
+ ```javascript
492
+ const appearance = {
493
+ theme: "night", // Use the dark theme
494
+ variables: {
495
+ // You can still override specific variables
496
+ colorPrimary: "#FF6B6B",
497
+ },
498
+ rules: {
499
+ // You can also override theme rules
500
+ ".CardTitle": { fontWeight: "700" },
501
+ },
502
+ };
503
+ ```
504
+
505
+ Theme variables and rules are applied first, then your custom overrides take precedence.
506
+
507
+ ### Config
508
+
509
+ The `config` object allows you to adjust component behavior settings.
510
+
511
+ ```javascript
512
+ interface Config {
513
+ helperTextPosition?: 'top' | 'bottom';
514
+ hintIcon?: string;
515
+ icon?: {
516
+ weight?: 'thin' | 'light' | 'regular' | 'bold' | 'fill' | 'duotone';
517
+ size?: number;
518
+ };
519
+ iconRules?: Record<string, { weight?: IconWeight; size?: number }>;
520
+ mainPageColumns?: 1 | 2 | 3 | 4;
521
+ }
522
+ ```
523
+
524
+ | Property | Description | Default |
525
+ | -------- | ----------- | ------- |
526
+ | `helperTextPosition` | Position of helper/description text relative to form inputs | `"bottom"` |
527
+ | `hintIcon` | Icon name for hint/help tooltips on input labels (see available icons below) | `"Question"` |
528
+ | `icon.weight` | Global icon weight/style variant (see below) | `"regular"` |
529
+ | `icon.size` | Global default icon size in pixels | `24` |
530
+ | `iconRules` | Per-component icon style overrides | `{}` |
531
+ | `mainPageColumns` | Number of columns in the main page feature cards grid (1-4) | `2` |
532
+
533
+ #### Icons
534
+
535
+ Soyio uses [Phosphor Icons](https://phosphoricons.com/), a flexible icon family with multiple weight variants. You can customize the icon appearance globally using the `config.icon` settings, or override icons for specific components using `config.iconRules`.
536
+
537
+ **Available icon weights:**
538
+
539
+ | Weight | Description |
540
+ | ------ | ----------- |
541
+ | `thin` | Thinnest stroke width |
542
+ | `light` | Light stroke width |
543
+ | `regular` | Default stroke width |
544
+ | `bold` | Bold stroke width |
545
+ | `fill` | Filled/solid icons |
546
+ | `duotone` | Two-tone icons with opacity |
547
+
548
+ **Global icon example:**
549
+
550
+ ```javascript
551
+ const appearance = {
552
+ config: {
553
+ icon: {
554
+ weight: "bold",
555
+ size: 20,
556
+ },
557
+ },
558
+ };
559
+ ```
560
+
561
+ **Per-component icon overrides:**
562
+
563
+ Use `iconRules` to customize icons for specific components. The key is the component name (e.g., `Alert`, `Switch`) or a variant-specific key (e.g., `Alert.error`):
564
+
565
+ > **Note:** For variant-specific icon rules, use dot notation (`Alert.error`) rather than the CSS double-dash syntax (`Alert--error`).
566
+
567
+ ```javascript
568
+ const appearance = {
569
+ config: {
570
+ icon: {
571
+ weight: "regular", // Global default
572
+ },
573
+ iconRules: {
574
+ Alert: { weight: "fill" }, // All alerts use filled icons
575
+ Switch: { weight: "bold", size: 16 }, // Switch icons are bold and smaller
576
+ "Alert.error": { weight: "fill" }, // Error alerts specifically
577
+ },
578
+ },
579
+ };
580
+ ```
581
+
582
+ **Hint icon customization:**
583
+
584
+ The hint icon appears next to input labels when a tooltip/hint is available. You can change which icon is displayed using `hintIcon`:
585
+
586
+ | Icon Name | Description |
587
+ | --------- | ----------- |
588
+ | `Question` | Question mark in circle (default) |
589
+ | `Info` | Information "i" icon |
590
+ | `QuestionMark` | Simple question mark |
591
+ | `Warning` | Warning/exclamation icon |
592
+
593
+ ```javascript
594
+ const appearance = {
595
+ config: {
596
+ hintIcon: "Info", // Use info icon instead of question mark
597
+ },
598
+ };
599
+ ```
600
+
601
+ You can also style the hint icon using the `.HintIcon` rule (see [Supported rules](#supported-rules)).
478
602
 
479
603
  ### Variables
480
604
 
@@ -483,21 +607,28 @@ Use variables to adjust common visual attributes across all components.
483
607
  ```javascript
484
608
  interface Variables {
485
609
  fontFamily?: string;
610
+ fontFamilyBody?: string;
611
+ fontFamilyTitle?: string;
486
612
  fontSizeBase?: string;
487
613
  colorPrimary?: string;
614
+ colorPrimarySurface?: string;
488
615
  colorSecondary?: string;
489
616
  colorBackground?: string;
490
- colorText?: string;
491
- colorTextSecondary?: string;
492
- colorTextSubtle?: string;
493
- colorTextInverted?: string;
494
- colorPrimarySurface?: string;
495
617
  colorSurface?: string;
496
618
  colorSurfaceMuted?: string;
497
619
  colorSurfaceStrong?: string;
498
620
  colorBorder?: string;
499
621
  colorBorderMuted?: string;
500
622
  colorSwitchBorder?: string;
623
+ colorText?: string;
624
+ colorTextSecondary?: string;
625
+ colorTextSubtle?: string;
626
+ colorTextInverted?: string;
627
+ colorTextTitle?: string;
628
+ colorLink?: string;
629
+ colorInputFocus?: string;
630
+ colorInputErrorFocus?: string;
631
+ colorSelectArrow?: string;
501
632
  colorInfo?: string;
502
633
  colorInfoBg?: string;
503
634
  colorSuccess?: string;
@@ -517,7 +648,10 @@ interface Variables {
517
648
 
518
649
  | Variable | Description | Default |
519
650
  | ----------------- | ---------------------------------------- | ------------------------- |
520
- | `fontFamily` | The font stack to use for text | `"system-ui, sans-serif"` |
651
+ | `fontFamily` | Base font stack (fallback for body and title) | `"system-ui, sans-serif"` |
652
+ | `fontFamilyBody` | Font stack for body/paragraph text (falls back to `fontFamily`) | `var(--fontFamily)` |
653
+ | `fontFamilyTitle` | Font stack for titles and headings (falls back to `fontFamily`) | `var(--fontFamily)` |
654
+ | `fontSizeBase` | Base font size for text | `"1rem"` |
521
655
  | `colorPrimary` | Primary color for interactive elements | `"#0570DE"` |
522
656
  | `colorPrimarySurface` | Background color for primary elements (e.g. active tab) | `"#EEF2FF"` |
523
657
  | `colorSecondary` | Secondary color for interactive elements | `"#A180F0"` |
@@ -532,6 +666,11 @@ interface Variables {
532
666
  | `colorTextSecondary` | Secondary text color | `"#6B7280"` |
533
667
  | `colorTextSubtle` | Subtle text color | `"#9CA3AF"` |
534
668
  | `colorTextInverted` | Inverted text color | `"#FFFFFF"` |
669
+ | `colorTextTitle` | Title/heading text color (falls back to `colorText`) | `var(--colorText)` |
670
+ | `colorLink` | Color for link elements | `"#0570DE"` |
671
+ | `colorInputFocus` | Focus border/ring color for input elements | `"#0570DE"` |
672
+ | `colorInputErrorFocus`| Focus border/ring color for input elements in error state | `"#EF4444"` |
673
+ | `colorSelectArrow` | Color for select dropdown arrow icon | `"#6B7280"` |
535
674
  | `colorInfo` | Info status color | `"#1E40AF"` |
536
675
  | `colorInfoBg` | Info status background color | `"#E0E7FF"` |
537
676
  | `colorSuccess` | Success status color | `"#15803D"` |
@@ -553,26 +692,56 @@ The `rules` object allows you to apply custom CSS to specific elements. Soyio su
553
692
 
554
693
  #### Supported rules
555
694
 
556
- The rules are grouped by component category:
695
+ The rules are grouped by component category. Most rules support **pseudo-classes** and **pseudo-elements** that can be appended to style different states:
696
+
697
+ **Supported pseudo-classes:**
698
+ - `:hover` - When the element is hovered
699
+ - `:focus` - When the element is focused
700
+ - `:active` - When the element is active/pressed
701
+ - `:disabled` - When the element is disabled
702
+ - `:autofill` - When the input is autofilled
703
+ - `:focus-visible` - When focused via keyboard navigation
704
+
705
+ **Supported pseudo-elements:**
706
+ - `::placeholder` - Placeholder text in inputs
707
+ - `::selection` - Selected text
708
+
709
+ **Example usage:**
710
+ ```javascript
711
+ rules: {
712
+ ".Button": { backgroundColor: "blue" }, // Base style
713
+ ".Button:hover": { backgroundColor: "darkblue" }, // Hover state
714
+ ".Button:disabled": { opacity: "0.5" }, // Disabled state
715
+ ".Input::placeholder": { color: "gray" }, // Placeholder text
716
+ ".RadioCard:hover": { borderColor: "var(--colorPrimary)" }, // Card hover
717
+ }
718
+ ```
557
719
 
558
720
  ##### Layout
559
721
  - `.MainContainer` - The main container.
560
722
  - `.Card` - Card containers.
723
+ - `.CardTitle` - Card title text.
561
724
  - `.Dialog` - Dialog containers.
562
725
  - `.DialogOverlay` - Dialog overlays.
563
726
  - `.DialogContent` - Dialog content areas.
564
727
 
565
728
  ##### Typography
566
- - `.Title` - Title text.
729
+ - `.Title` - Title text (base class for all titles).
730
+ - `.StepTitle` - Step indicator title text (also inherits from `.Title`).
567
731
  - `.Description` - Description text.
568
732
 
569
733
  ##### Inputs
570
734
  - `.Input` - Input fields.
735
+ - `.Input--error` - Input fields in error state.
571
736
  - `.Label` - Labels.
737
+ - `.HintIcon` - Hint/help icons next to input labels.
572
738
  - `.TextArea` - Text area inputs.
573
739
  - `.Select` - Select dropdowns.
574
740
  - `.Combobox` - Combobox inputs.
575
741
  - `.NinInput` - Styles the input field for national identity numbers.
742
+ - `.TrackingCodeInput` - Styles the tracking code input component.
743
+ - `.TrackingCodeInputCell` - Styles individual cells in the tracking code input.
744
+ - `.TrackingCodeInputSeparator` - Styles the separator between tracking code cells.
576
745
 
577
746
  ##### Buttons & Links
578
747
  - `.Button` - The button component.
@@ -587,13 +756,15 @@ The rules are grouped by component category:
587
756
  - `.CheckboxInput` - The styled checkbox element (supports `borderRadius`, `borderColor`, `backgroundColor`).
588
757
  - `.CheckboxLabel` - The checkbox label.
589
758
  - `.CheckboxCheck` - The checkmark icon inside the checkbox.
590
- - `.CheckboxInput--checked` - The checked state of the checkbox
591
- - `.CheckboxInput--focus` - Focus state of the checkbox (visible focus ring)
592
- - `.CheckboxInput:hover` - Hover state of the checkbox
759
+ - `.CheckboxInput--checked` - The checked state of the checkbox.
593
760
 
594
761
 
595
762
  **Radio**
596
763
  - `.Radio` - Radio button containers.
764
+ - `.RadioButton` - The radio button element (the clickable circle).
765
+ - `.RadioButton--checked` - Checked state of the radio button.
766
+ - `.RadioIndicator` - The inner indicator point of the radio button.
767
+ - `.RadioIndicator--checked` - Checked state of the radio indicator (visible when selected).
597
768
  - `.RadioLabel` - Radio button labels.
598
769
 
599
770
  **Switch**
@@ -606,8 +777,30 @@ The rules are grouped by component category:
606
777
 
607
778
  **Radio Card**
608
779
  - `.RadioCard` - Styles the wrapper card element of a radio card item.
609
- - `.RadioCardIndicator` - Styles the container of the radio indicator (circle) inside a radio card.
610
- - `.RadioCardIndicatorPoint` - Styles the inner point of the radio indicator inside a radio card.
780
+ - `.RadioCard--checked` - Checked state of the radio card.
781
+ - `.RadioCardButton` - The radio button element inside a radio card.
782
+ - `.RadioCardButton--checked` - Checked state of the radio card button.
783
+ - `.RadioCardIndicator` - The inner indicator point inside a radio card.
784
+ - `.RadioCardIndicator--checked` - Checked state of the radio card indicator.
785
+ - `.RadioCardTitle` - The title text inside a radio card (also inherits from `.CardTitle`).
786
+
787
+ > **Note:** `.RadioCardTitle` elements also have the `.CardTitle` class, so you can style all card titles together with `.CardTitle` and override specifically for radio cards with `.RadioCardTitle`.
788
+
789
+ ##### Step Indicator
790
+
791
+ The step indicator shows progress through multi-step forms.
792
+
793
+ - `.StepIndicatorContainer` - The container wrapping all step indicators.
794
+ - `.StepIndicator` - Individual step indicator item.
795
+ - `.StepIndicator--active` - The currently active step.
796
+ - `.StepIndicator--completed` - Steps that have been completed.
797
+ - `.StepIndicator--pending` - Steps that are not yet reached.
798
+ - `.StepIndicatorLine` - The connecting line between steps.
799
+ - `.StepIndicatorLine--top` - The line segment above a step indicator.
800
+ - `.StepIndicatorLine--bottom` - The line segment below a step indicator.
801
+ - `.StepIndicatorIcon` - Icon displayed inside a step indicator (for completed steps).
802
+ - `.StepIndicatorDot` - The dot marker in a step indicator.
803
+ - `.StepIndicatorNumber` - The step number displayed in the indicator.
611
804
 
612
805
  ##### Feedback
613
806
  - `.Loader` - Loading indicators.
@@ -618,8 +811,10 @@ The rules are grouped by component category:
618
811
  - `.Alert` - Alert boxes.
619
812
  - `.Alert--error` - Error alert variant.
620
813
  - `.Alert--warning` - Warning alert variant.
621
- - `.Alert--information` - Information alert variant.
814
+ - `.Alert--info` - Information alert variant.
622
815
  - `.Alert--success` - Success alert variant.
816
+ - `.AlertIcon` - The icon inside an alert.
817
+ - `.AlertContent` - The content/text area inside an alert.
623
818
 
624
819
  **Chip**
625
820
  - `.Chip` - Chips/Tags.
@@ -693,6 +888,9 @@ const appearance = {
693
888
  display: "none", // Hide the check/cross icons
694
889
  },
695
890
  },
891
+ config: {
892
+ helperTextPosition: "top", // Position helper text above inputs
893
+ },
696
894
  };
697
895
  ```
698
896
 
@@ -836,3 +1034,14 @@ VITE_PRIVACY_CENTER_URL=http://localhost:5173
836
1034
  VITE_CONSENT_URL=http://localhost:5173
837
1035
  VITE_CONSENT_TEMPLATE_ID=constpl_test
838
1036
  ```
1037
+
1038
+ ### Presets Management
1039
+
1040
+ The smoke test includes preset management functionality that allows you to save, load, and share widget configurations:
1041
+
1042
+ - **Save Presets**: Save your current widget configuration with a custom name
1043
+ - **Load Presets**: Quickly switch between saved configurations
1044
+ - **Export Presets**: Download all presets as a JSON file for backup or sharing
1045
+ - **Import Presets**: Load presets from a previously exported JSON file
1046
+
1047
+ All presets are automatically saved to your browser's localStorage. Use the export feature to persist presets to disk and share them with your team. See [smoke-test/PRESETS.md](./smoke-test/PRESETS.md) for detailed documentation.
package/dist/index.d.ts CHANGED
@@ -137,7 +137,36 @@ declare type CSSProperties = {
137
137
  WebkitAppearance?: string;
138
138
  webkitFontSmoothing?: 'auto' | 'antialiased' | 'subpixel-antialiased';
139
139
  webkitTextFillColor?: string;
140
+ textTransform?: 'none' | 'capitalize' | 'uppercase' | 'lowercase';
140
141
  width?: string;
142
+ display?: 'block' | 'inline' | 'inline-block' | 'flex' | 'inline-flex' | 'grid' | 'inline-grid' | 'none';
143
+ justifyContent?: 'flex-start' | 'flex-end' | 'center' | 'space-between' | 'space-around' | 'space-evenly';
144
+ alignItems?: 'flex-start' | 'flex-end' | 'center' | 'baseline' | 'stretch';
145
+ flexDirection?: 'row' | 'row-reverse' | 'column' | 'column-reverse';
146
+ flexWrap?: 'nowrap' | 'wrap' | 'wrap-reverse';
147
+ flex?: string;
148
+ gap?: string;
149
+ position?: 'static' | 'relative' | 'absolute' | 'fixed' | 'sticky';
150
+ top?: string;
151
+ right?: string;
152
+ bottom?: string;
153
+ left?: string;
154
+ zIndex?: number | string;
155
+ transition?: string;
156
+ transitionProperty?: string;
157
+ transitionDuration?: string;
158
+ transitionTimingFunction?: string;
159
+ transitionDelay?: string;
160
+ transform?: string;
161
+ transformOrigin?: string;
162
+ visibility?: 'visible' | 'hidden' | 'collapse';
163
+ overflow?: 'visible' | 'hidden' | 'scroll' | 'auto';
164
+ overflowX?: 'visible' | 'hidden' | 'scroll' | 'auto';
165
+ overflowY?: 'visible' | 'hidden' | 'scroll' | 'auto';
166
+ textAlign?: 'left' | 'right' | 'center' | 'justify';
167
+ textDecoration?: string;
168
+ whiteSpace?: 'normal' | 'nowrap' | 'pre' | 'pre-wrap' | 'pre-line';
169
+ wordBreak?: 'normal' | 'break-all' | 'keep-all' | 'break-word';
141
170
  };
142
171
 
143
172
  declare type DataSubject = 'anonymous_user' | 'citizen_voter' | 'commuter' | 'consultant' | 'customer' | 'employee' | 'job_applicant' | 'next_of_kin' | 'passenger' | 'patient' | 'prospect' | 'shareholder' | 'supplier_vendor' | 'trainee' | 'visitor';
@@ -172,6 +201,8 @@ declare interface IBaseEventData {
172
201
  eventName: string;
173
202
  }
174
203
 
204
+ declare type IconWeight = 'thin' | 'light' | 'regular' | 'bold' | 'fill' | 'duotone';
205
+
175
206
  declare type IframeCSSConfig = {
176
207
  minWidth?: string;
177
208
  };
@@ -249,28 +280,70 @@ declare interface SoyioAppearance {
249
280
  theme?: SoyioTheme;
250
281
  variables?: SoyioAppearanceVariables;
251
282
  rules?: SoyioRule;
283
+ config?: SoyioAppearanceConfig;
284
+ }
285
+
286
+ declare interface SoyioAppearanceConfig {
287
+ helperTextPosition?: 'top' | 'bottom';
288
+ /**
289
+ * Icon name to use for hint/help tooltips on input labels.
290
+ * Available icons: 'Question' (default), 'Info', 'QuestionMark', etc.
291
+ * @default 'Question'
292
+ */
293
+ hintIcon?: string;
294
+ /**
295
+ * Global icon appearance configuration.
296
+ * Controls default weight and size for all icons.
297
+ */
298
+ icon?: SoyioIconConfig;
299
+ /**
300
+ * Per-component icon overrides.
301
+ * Allows customizing icon styles for specific components.
302
+ *
303
+ * @example
304
+ * ```ts
305
+ * iconRules: {
306
+ * Alert: { weight: 'fill' },
307
+ * Switch: { weight: 'bold' },
308
+ * 'Alert.error': { weight: 'fill', size: 20 },
309
+ * }
310
+ * ```
311
+ */
312
+ iconRules?: Record<string, SoyioIconConfig>;
313
+ /**
314
+ * Number of columns in the main page feature cards grid.
315
+ * @default 2
316
+ */
317
+ mainPageColumns?: 1 | 2 | 3 | 4;
252
318
  }
253
319
 
254
320
  declare interface SoyioAppearanceVariables {
255
321
  fontFamily?: string;
322
+ fontFamilyBody?: string;
323
+ fontFamilyTitle?: string;
256
324
  fontSizeBase?: string;
257
325
  borderRadius?: string;
258
326
  borderWidth?: string;
259
327
  borderStyle?: string;
260
328
  colorPrimary?: string;
329
+ colorPrimarySurface?: string;
261
330
  colorSecondary?: string;
262
331
  colorBackground?: string;
263
- colorText?: string;
264
- colorTextSecondary?: string;
265
- colorTextSubtle?: string;
266
- colorTextInverted?: string;
267
- colorPrimarySurface?: string;
268
332
  colorSurface?: string;
269
333
  colorSurfaceMuted?: string;
270
334
  colorSurfaceStrong?: string;
271
335
  colorBorder?: string;
272
336
  colorBorderMuted?: string;
273
337
  colorSwitchBorder?: string;
338
+ colorText?: string;
339
+ colorTextSecondary?: string;
340
+ colorTextSubtle?: string;
341
+ colorTextInverted?: string;
342
+ colorTextTitle?: string;
343
+ colorLink?: string;
344
+ colorInputFocus?: string;
345
+ colorInputErrorFocus?: string;
346
+ colorSelectArrow?: string;
274
347
  colorInfo?: string;
275
348
  colorInfoBg?: string;
276
349
  colorSuccess?: string;
@@ -282,10 +355,29 @@ declare interface SoyioAppearanceVariables {
282
355
  colorOverlay?: string;
283
356
  }
284
357
 
285
- declare type SoyioBaseRule = '.MainContainer' | '.Button' | '.Checkbox' | '.CheckboxInput' | '.CheckboxLabel' | '.Input' | '.Label' | '.Title' | '.Link' | '.Card' | '.Select' | '.Loader' | '.TextArea' | '.ErrorMessage' | '.Description' | '.Switch' | '.SwitchRoot' | '.SwitchThumb' | '.SwitchIcon' | '.Alert' | '.Alert--error' | '.Alert--warning' | '.Alert--information' | '.Alert--success' | '.Radio' | '.RadioLabel' | '.Chip' | '.Chip--info' | '.Chip--green' | '.Chip--red' | '.Chip--amber' | '.Dialog' | '.DialogOverlay' | '.DialogContent' | '.Combobox' | '.NinInput' | '.RadioCard' | '.RadioCardIndicator' | '.RadioCardIndicatorPoint' | '.TooltipContent';
358
+ declare type SoyioBaseRule = '.MainContainer' | '.Button' | '.Checkbox' | '.CheckboxInput' | '.CheckboxLabel' | '.Input' | '.Label' | '.HintIcon' | '.Title' | '.StepTitle' | '.Link' | '.Card' | '.CardTitle' | '.Select' | '.Loader' | '.TextArea' | '.ErrorMessage' | '.Description' | '.Switch' | '.SwitchRoot' | '.SwitchThumb' | '.SwitchIcon' | '.Alert' | '.AlertIcon' | '.AlertContent' | '.Radio' | '.RadioButton' | '.RadioIndicator' | '.RadioLabel' | '.Chip' | '.Dialog' | '.DialogOverlay' | '.DialogContent' | '.DialogTitle' | '.DialogDescription' | '.Combobox' | '.NinInput' | '.TrackingCodeInput' | '.TrackingCodeInputCell' | '.TrackingCodeInputSeparator' | '.RadioCard' | '.RadioCardButton' | '.RadioCardIndicator' | '.RadioCardTitle' | '.StepIndicatorContainer' | '.StepIndicator' | '.StepIndicatorLine' | '.StepIndicatorIcon' | '.StepIndicatorDot' | '.StepIndicatorNumber' | '.TooltipContent';
286
359
 
287
360
  declare type SoyioElementState = '--checked';
288
361
 
362
+ declare interface SoyioIconConfig {
363
+ /**
364
+ * Icon weight/style variant.
365
+ * - thin: Thinnest stroke
366
+ * - light: Light stroke
367
+ * - regular: Default stroke (default)
368
+ * - bold: Bold stroke
369
+ * - fill: Filled/solid icons
370
+ * - duotone: Two-tone icons with opacity
371
+ * @default 'regular'
372
+ */
373
+ weight?: IconWeight;
374
+ /**
375
+ * Default icon size in pixels.
376
+ * @default 24
377
+ */
378
+ size?: number;
379
+ }
380
+
289
381
  declare type SoyioPseudoClass = ':hover' | ':focus' | ':active' | ':disabled' | ':autofill' | ':focus-visible';
290
382
 
291
383
  declare type SoyioPseudoElement = '::placeholder' | '::selection';
@@ -294,9 +386,11 @@ declare type SoyioRule = {
294
386
  [K in SoyioRuleKey]?: CSSProperties;
295
387
  };
296
388
 
297
- declare type SoyioRuleKey = `${SoyioBaseRule}${SoyioElementState | SoyioPseudoClass | SoyioPseudoElement | ''}`;
389
+ declare type SoyioRuleKey = `${SoyioBaseRule}${SoyioElementState | SoyioPseudoClass | SoyioPseudoElement | ''}` | SoyioStateRule;
390
+
391
+ declare type SoyioStateRule = '.Input--error' | '.Alert--error' | '.Alert--warning' | '.Alert--info' | '.Alert--success' | '.Chip--info' | '.Chip--green' | '.Chip--red' | '.Chip--amber' | '.RadioCard--checked' | '.RadioCardIndicator--checked' | '.StepIndicator--active' | '.StepIndicator--completed' | '.StepIndicator--pending' | '.StepIndicatorLine--top' | '.StepIndicatorLine--bottom';
298
392
 
299
- declare type SoyioTheme = 'soyio';
393
+ declare type SoyioTheme = 'soyio' | 'night' | 'flat';
300
394
 
301
395
  declare namespace SoyioTypes {
302
396
  export {
package/dist/index.js CHANGED
@@ -432,7 +432,7 @@ class Hn {
432
432
  this.element.style.opacity = "0", setTimeout(() => this.element.remove(), 300);
433
433
  }
434
434
  }
435
- const qe = "2.16.1";
435
+ const qe = "2.17.0";
436
436
  function qn(c) {
437
437
  var E;
438
438
  const d = [
@@ -121,7 +121,7 @@
121
121
  0% { background-position: 200% 0; }
122
122
  100% { background-position: -200% 0; }
123
123
  }
124
- `,document.head.appendChild(X)}d.appendChild(v),d.appendChild(y),d.appendChild(E),F.appendChild(q),F.appendChild(oe),W.appendChild(U),W.appendChild(F),g.appendChild(d),g.appendChild(W),this.element.appendChild(g)}cleanupExistingSkeleton(){const l=document.getElementById(this.identifier);l&&l.remove()}mount(l){this.cleanupExistingSkeleton(),l.appendChild(this.element)}hide(){this.element.style.opacity="0",setTimeout(()=>this.element.remove(),300)}}const ze="2.16.1";function mn(f){var E;const l=["actionToken","entityId","context","optionalReconsentBehavior","mandatoryReconsentBehavior"],g=(E=f.isSandbox)!=null?E:!1,d=f.developmentUrl||(g?at:it),v=new URLSearchParams;v.set("sdkVersion",ze),l.forEach(W=>{f[W]&&v.set(W,f[W])});const y=v.toString();return`${d}/embed/consents/${f.consentTemplateId}${y?`?${y}`:""}`}class Le extends xe{constructor(g){super(g);j(this,"defaultIframePrefix","consent-box");j(this,"defaultIframeCSSConfig",fn);j(this,"state",{isSelected:!1,actionToken:null});this.Skeleton=hn}get uniqueIdentifier(){return this.options.consentTemplateId}iframeUrl(){return mn(this.options)}handleStateChange(g){const{isSelected:d,actionToken:v}=g;this.state={isSelected:d,actionToken:v},this.options.onEvent({eventName:"CONSENT_CHECKBOX_CHANGE",isSelected:d,actionToken:v})}setupListeners(){return G(this,null,function*(){yield Vt(Le.prototype,this,"setupListeners").call(this),ot(this.uniqueIdentifier,{onStateChange:this.handleStateChange.bind(this)})})}getState(){return this.state}}function pn(f){var y,E,W;const l=(y=f.isSandbox)!=null?y:!1,g=f.developmentUrl||(l?rn:nn),d=new URLSearchParams;if(d.set("sdkVersion",ze),f.sessionToken?d.set("sessionToken",f.sessionToken):f.companyId&&d.set("companyId",f.companyId),(E=f.enabledFeatures)!=null&&E.length&&d.set("enabledFeatures",f.enabledFeatures.join(",")),(W=f.dataSubjects)!=null&&W.length&&d.set("dataSubjects",f.dataSubjects.join(",")),f.requestReference&&d.set("requestReference",f.requestReference),f.fileRequisites){const U=JSON.stringify(f.fileRequisites);U!=="{}"&&d.set("fileRequisites",U)}const v=d.toString();return`${g}${v?`?${v}`:""}`}class vn extends xe{constructor(){super(...arguments);j(this,"defaultIframePrefix","privacy-center");j(this,"_uniqueIdentifier","privacy-center");j(this,"defaultIframeCSSConfig",ln)}get uniqueIdentifier(){return this._uniqueIdentifier}iframeUrl(){return pn(this.options)}}const wn=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),gn="WIDGET_EVENT";function yn(f){let l="widget/";return"disclosureRequestId"in f.configProps?l+=["disclosures",f.configProps.disclosureRequestId].join("/"):l+=f.request,l}function En(f){var y;const l=(y=f.isSandbox)!=null?y:!1,g=f.developmentUrl||(l?at:it),d=Object.entries(f.configProps).filter(([E,W])=>W||E==="disclosureRequestId").map(([E,W])=>`${E}=${encodeURIComponent(W)}`).join("&"),v=yn(f);return`${g}/${v}?sdk=web&sdkVersion=${ze}&${d}`}let Q=null,ke=null;function Ue(f=null){Q&&!Q.closed&&Q.focus(),f==null||f.preventDefault()}function Ie(){document.body.style.filter="",document.body.removeEventListener("click",Ue)}function Sn(){ke=setInterval(()=>{(!Q||Q.closed)&&(ke&&clearInterval(ke),Ie())},cn)}function bn(f){const l=En(f),g=sn,d=un,v=window.screenLeft!==void 0?window.screenLeft:window.screenX,y=window.screenTop!==void 0?window.screenTop:window.screenY,E=window.innerWidth||document.documentElement.clientWidth||window.screen.width,W=window.innerHeight||document.documentElement.clientHeight||window.screen.height,U=E/window.screen.availWidth,F=(E-g)/2/U+v,q=(W-d)/2/U+y,oe=["scrollbars=yes",`width=${g}`,`height=${d}`,`top=${q}`,`left=${F}`].join(","),X=window.open("about:blank","Soyio",oe);X?(Q=X,Q.location.href=l,document.body.style.filter="blur(5px)",document.body.addEventListener("click",Ue),Ue(),Sn()):(Ie(),alert("Debes habilitar las ventanas emergentes para poder iniciar el flujo."))}function xn(){Q&&(Q.close(),Q=null),Ie()}let he=null;function In(){he&&(he.cancel(),he=null)}function Wn(f){return G(this,null,function*(){const{onEvent:l}=f,g=yield Promise.resolve().then(()=>He);he&&In(),he=g.on(gn,v=>G(null,[v],function*({data:d}){return l(d),on.includes(d.eventName)?xn():d.eventName===an&&Ie(),Promise.resolve()}))})}function Pn(f){Wn(f)}class st{constructor(l){$t(this,Pe);j(this,"onEvent");this.onEvent=l.onEvent,R&&(bn(l),Pn({onEvent:Gt(this,Pe,Jt).bind(this)}))}}Pe=new WeakSet,Jt=function(l){this.onEvent(l)};function Tn(f){return f&&f.__esModule&&Object.prototype.hasOwnProperty.call(f,"default")?f.default:f}var Fe={exports:{}},We={exports:{}},Cn=We.exports,ut;function Rn(){return ut||(ut=1,function(f,l){(function(g,d){f.exports=d()})(typeof self!="undefined"?self:Cn,function(){return function(g){var d={};function v(y){if(d[y])return d[y].exports;var E=d[y]={i:y,l:!1,exports:{}};return g[y].call(E.exports,E,E.exports,v),E.l=!0,E.exports}return v.m=g,v.c=d,v.d=function(y,E,W){v.o(y,E)||Object.defineProperty(y,E,{enumerable:!0,get:W})},v.r=function(y){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(y,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(y,"__esModule",{value:!0})},v.t=function(y,E){if(1&E&&(y=v(y)),8&E||4&E&&typeof y=="object"&&y&&y.__esModule)return y;var W=Object.create(null);if(v.r(W),Object.defineProperty(W,"default",{enumerable:!0,value:y}),2&E&&typeof y!="string")for(var U in y)v.d(W,U,function(F){return y[F]}.bind(null,U));return W},v.n=function(y){var E=y&&y.__esModule?function(){return y.default}:function(){return y};return v.d(E,"a",E),E},v.o=function(y,E){return{}.hasOwnProperty.call(y,E)},v.p="",v(v.s=0)}([function(g,d,v){v.r(d),v.d(d,"Promise",function(){return C}),v.d(d,"TYPES",function(){return Xn}),v.d(d,"ProxyWindow",function(){return Y}),v.d(d,"setup",function(){return Ht}),v.d(d,"destroy",function(){return Kn}),v.d(d,"serializeMessage",function(){return Vn}),v.d(d,"deserializeMessage",function(){return Jn}),v.d(d,"createProxyWindow",function(){return Yn}),v.d(d,"toProxyWindow",function(){return Zn}),v.d(d,"on",function(){return ce}),v.d(d,"once",function(){return Gn}),v.d(d,"send",function(){return ne}),v.d(d,"markWindowKnown",function(){return Rt}),v.d(d,"cleanUpWindow",function(){return Qn}),v.d(d,"bridge",function(){});function y(e){return{}.toString.call(e)==="[object RegExp]"}var E=`Call was rejected by callee.\r
124
+ `,document.head.appendChild(X)}d.appendChild(v),d.appendChild(y),d.appendChild(E),F.appendChild(q),F.appendChild(oe),W.appendChild(U),W.appendChild(F),g.appendChild(d),g.appendChild(W),this.element.appendChild(g)}cleanupExistingSkeleton(){const l=document.getElementById(this.identifier);l&&l.remove()}mount(l){this.cleanupExistingSkeleton(),l.appendChild(this.element)}hide(){this.element.style.opacity="0",setTimeout(()=>this.element.remove(),300)}}const ze="2.17.0";function mn(f){var E;const l=["actionToken","entityId","context","optionalReconsentBehavior","mandatoryReconsentBehavior"],g=(E=f.isSandbox)!=null?E:!1,d=f.developmentUrl||(g?at:it),v=new URLSearchParams;v.set("sdkVersion",ze),l.forEach(W=>{f[W]&&v.set(W,f[W])});const y=v.toString();return`${d}/embed/consents/${f.consentTemplateId}${y?`?${y}`:""}`}class Le extends xe{constructor(g){super(g);j(this,"defaultIframePrefix","consent-box");j(this,"defaultIframeCSSConfig",fn);j(this,"state",{isSelected:!1,actionToken:null});this.Skeleton=hn}get uniqueIdentifier(){return this.options.consentTemplateId}iframeUrl(){return mn(this.options)}handleStateChange(g){const{isSelected:d,actionToken:v}=g;this.state={isSelected:d,actionToken:v},this.options.onEvent({eventName:"CONSENT_CHECKBOX_CHANGE",isSelected:d,actionToken:v})}setupListeners(){return G(this,null,function*(){yield Vt(Le.prototype,this,"setupListeners").call(this),ot(this.uniqueIdentifier,{onStateChange:this.handleStateChange.bind(this)})})}getState(){return this.state}}function pn(f){var y,E,W;const l=(y=f.isSandbox)!=null?y:!1,g=f.developmentUrl||(l?rn:nn),d=new URLSearchParams;if(d.set("sdkVersion",ze),f.sessionToken?d.set("sessionToken",f.sessionToken):f.companyId&&d.set("companyId",f.companyId),(E=f.enabledFeatures)!=null&&E.length&&d.set("enabledFeatures",f.enabledFeatures.join(",")),(W=f.dataSubjects)!=null&&W.length&&d.set("dataSubjects",f.dataSubjects.join(",")),f.requestReference&&d.set("requestReference",f.requestReference),f.fileRequisites){const U=JSON.stringify(f.fileRequisites);U!=="{}"&&d.set("fileRequisites",U)}const v=d.toString();return`${g}${v?`?${v}`:""}`}class vn extends xe{constructor(){super(...arguments);j(this,"defaultIframePrefix","privacy-center");j(this,"_uniqueIdentifier","privacy-center");j(this,"defaultIframeCSSConfig",ln)}get uniqueIdentifier(){return this._uniqueIdentifier}iframeUrl(){return pn(this.options)}}const wn=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),gn="WIDGET_EVENT";function yn(f){let l="widget/";return"disclosureRequestId"in f.configProps?l+=["disclosures",f.configProps.disclosureRequestId].join("/"):l+=f.request,l}function En(f){var y;const l=(y=f.isSandbox)!=null?y:!1,g=f.developmentUrl||(l?at:it),d=Object.entries(f.configProps).filter(([E,W])=>W||E==="disclosureRequestId").map(([E,W])=>`${E}=${encodeURIComponent(W)}`).join("&"),v=yn(f);return`${g}/${v}?sdk=web&sdkVersion=${ze}&${d}`}let Q=null,ke=null;function Ue(f=null){Q&&!Q.closed&&Q.focus(),f==null||f.preventDefault()}function Ie(){document.body.style.filter="",document.body.removeEventListener("click",Ue)}function Sn(){ke=setInterval(()=>{(!Q||Q.closed)&&(ke&&clearInterval(ke),Ie())},cn)}function bn(f){const l=En(f),g=sn,d=un,v=window.screenLeft!==void 0?window.screenLeft:window.screenX,y=window.screenTop!==void 0?window.screenTop:window.screenY,E=window.innerWidth||document.documentElement.clientWidth||window.screen.width,W=window.innerHeight||document.documentElement.clientHeight||window.screen.height,U=E/window.screen.availWidth,F=(E-g)/2/U+v,q=(W-d)/2/U+y,oe=["scrollbars=yes",`width=${g}`,`height=${d}`,`top=${q}`,`left=${F}`].join(","),X=window.open("about:blank","Soyio",oe);X?(Q=X,Q.location.href=l,document.body.style.filter="blur(5px)",document.body.addEventListener("click",Ue),Ue(),Sn()):(Ie(),alert("Debes habilitar las ventanas emergentes para poder iniciar el flujo."))}function xn(){Q&&(Q.close(),Q=null),Ie()}let he=null;function In(){he&&(he.cancel(),he=null)}function Wn(f){return G(this,null,function*(){const{onEvent:l}=f,g=yield Promise.resolve().then(()=>He);he&&In(),he=g.on(gn,v=>G(null,[v],function*({data:d}){return l(d),on.includes(d.eventName)?xn():d.eventName===an&&Ie(),Promise.resolve()}))})}function Pn(f){Wn(f)}class st{constructor(l){$t(this,Pe);j(this,"onEvent");this.onEvent=l.onEvent,R&&(bn(l),Pn({onEvent:Gt(this,Pe,Jt).bind(this)}))}}Pe=new WeakSet,Jt=function(l){this.onEvent(l)};function Tn(f){return f&&f.__esModule&&Object.prototype.hasOwnProperty.call(f,"default")?f.default:f}var Fe={exports:{}},We={exports:{}},Cn=We.exports,ut;function Rn(){return ut||(ut=1,function(f,l){(function(g,d){f.exports=d()})(typeof self!="undefined"?self:Cn,function(){return function(g){var d={};function v(y){if(d[y])return d[y].exports;var E=d[y]={i:y,l:!1,exports:{}};return g[y].call(E.exports,E,E.exports,v),E.l=!0,E.exports}return v.m=g,v.c=d,v.d=function(y,E,W){v.o(y,E)||Object.defineProperty(y,E,{enumerable:!0,get:W})},v.r=function(y){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(y,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(y,"__esModule",{value:!0})},v.t=function(y,E){if(1&E&&(y=v(y)),8&E||4&E&&typeof y=="object"&&y&&y.__esModule)return y;var W=Object.create(null);if(v.r(W),Object.defineProperty(W,"default",{enumerable:!0,value:y}),2&E&&typeof y!="string")for(var U in y)v.d(W,U,function(F){return y[F]}.bind(null,U));return W},v.n=function(y){var E=y&&y.__esModule?function(){return y.default}:function(){return y};return v.d(E,"a",E),E},v.o=function(y,E){return{}.hasOwnProperty.call(y,E)},v.p="",v(v.s=0)}([function(g,d,v){v.r(d),v.d(d,"Promise",function(){return C}),v.d(d,"TYPES",function(){return Xn}),v.d(d,"ProxyWindow",function(){return Y}),v.d(d,"setup",function(){return Ht}),v.d(d,"destroy",function(){return Kn}),v.d(d,"serializeMessage",function(){return Vn}),v.d(d,"deserializeMessage",function(){return Jn}),v.d(d,"createProxyWindow",function(){return Yn}),v.d(d,"toProxyWindow",function(){return Zn}),v.d(d,"on",function(){return ce}),v.d(d,"once",function(){return Gn}),v.d(d,"send",function(){return ne}),v.d(d,"markWindowKnown",function(){return Rt}),v.d(d,"cleanUpWindow",function(){return Qn}),v.d(d,"bridge",function(){});function y(e){return{}.toString.call(e)==="[object RegExp]"}var E=`Call was rejected by callee.\r
125
125
  `;function W(e){return e===void 0&&(e=window),e.location.protocol}function U(e){if(e===void 0&&(e=window),e.mockDomain){var n=e.mockDomain.split("//")[0];if(n)return n}return W(e)}function F(e){return e===void 0&&(e=window),U(e)==="about:"}function q(e){if(e===void 0&&(e=window),e)try{if(e.parent&&e.parent!==e)return e.parent}catch(n){}}function oe(e){if(e===void 0&&(e=window),e&&!q(e))try{return e.opener}catch(n){}}function X(e){try{return!0}catch(n){}return!1}function Te(e){e===void 0&&(e=window);var n=e.location;if(!n)throw new Error("Can not read window location");var t=W(e);if(!t)throw new Error("Can not read window protocol");if(t==="file:")return"file://";if(t==="about:"){var r=q(e);return r&&X()?Te(r):"about://"}var o=n.host;if(!o)throw new Error("Can not read window host");return t+"//"+o}function B(e){e===void 0&&(e=window);var n=Te(e);return n&&e.mockDomain&&e.mockDomain.indexOf("mock:")===0?e.mockDomain:n}function ie(e){if(!function(n){try{if(n===window)return!0}catch(r){}try{var t=Object.getOwnPropertyDescriptor(n,"location");if(t&&t.enumerable===!1)return!1}catch(r){}try{if(F(n)&&X())return!0}catch(r){}try{if(function(r){return r===void 0&&(r=window),U(r)==="mock:"}(n)&&X())return!0}catch(r){}try{if(Te(n)===Te(window))return!0}catch(r){}return!1}(e))return!1;try{if(e===window||F(e)&&X()||B(window)===B(e))return!0}catch(n){}return!1}function Ce(e){if(!ie(e))throw new Error("Expected window to be same domain");return e}function ft(e,n){if(!e||!n)return!1;var t=q(n);return t?t===e:function(r){var o=[];try{for(;r.parent!==r;)o.push(r.parent),r=r.parent}catch(i){}return o}(n).indexOf(e)!==-1}function lt(e){var n=[],t;try{t=e.frames}catch(u){t=e}var r;try{r=t.length}catch(u){}if(r===0)return n;if(r){for(var o=0;o<r;o++){var i=void 0;try{i=t[o]}catch(u){continue}n.push(i)}return n}for(var a=0;a<100;a++){var c=void 0;try{c=t[a]}catch(u){return n}if(!c)return n;n.push(c)}return n}var An=[],Nn=[];function Z(e,n){n===void 0&&(n=!0);try{if(e===window)return!1}catch(o){return!0}try{if(!e)return!0}catch(o){return!0}try{if(e.closed)return!0}catch(o){return!o||o.message!==E}if(n&&ie(e))try{if(e.mockclosed)return!0}catch(o){}try{if(!e.parent||!e.top)return!0}catch(o){}var t=function(o,i){for(var a=0;a<o.length;a++)try{if(o[a]===i)return a}catch(c){}return-1}(An,e);if(t!==-1){var r=Nn[t];if(r&&function(o){if(!o.contentWindow||!o.parentNode)return!0;var i=o.ownerDocument;if(i&&i.documentElement&&!i.documentElement.contains(o)){for(var a=o;a.parentNode&&a.parentNode!==a;)a=a.parentNode;if(!a.host||!i.documentElement.contains(a.host))return!0}return!1}(r))return!0}return!1}function ht(e){return e===void 0&&(e=window),oe(e=e||window)||q(e)||void 0}function de(e,n){if(typeof e=="string"){if(typeof n=="string")return e==="*"||n===e;if(y(n)||Array.isArray(n))return!1}return y(e)?y(n)?e.toString()===n.toString():!Array.isArray(n)&&!!n.match(e):!!Array.isArray(e)&&(Array.isArray(n)?JSON.stringify(e)===JSON.stringify(n):!y(n)&&e.some(function(t){return de(t,n)}))}function Re(e){try{if(e===window)return!0}catch(n){if(n&&n.message===E)return!0}try{if({}.toString.call(e)==="[object Window]")return!0}catch(n){if(n&&n.message===E)return!0}try{if(window.Window&&e instanceof window.Window)return!0}catch(n){if(n&&n.message===E)return!0}try{if(e&&e.self===e)return!0}catch(n){if(n&&n.message===E)return!0}try{if(e&&e.parent===e)return!0}catch(n){if(n&&n.message===E)return!0}try{if(e&&e.top===e)return!0}catch(n){if(n&&n.message===E)return!0}try{if(e&&e.__cross_domain_utils_window_check__==="__unlikely_value__")return!1}catch(n){return!0}try{if("postMessage"in e&&"self"in e&&"location"in e)return!0}catch(n){}return!1}function mt(e){if(ie(e))return Ce(e).frameElement;for(var n=0,t=document.querySelectorAll("iframe");n<t.length;n++){var r=t[n];if(r&&r.contentWindow&&r.contentWindow===e)return r}}function Dn(e){if(function(t){return t===void 0&&(t=window),!!q(t)}(e)){var n=mt(e);if(n&&n.parentElement){n.parentElement.removeChild(n);return}}try{e.close()}catch(t){}}function ae(e){try{if(!e)return!1;if(typeof Promise!="undefined"&&e instanceof Promise)return!0;if(typeof window!="undefined"&&typeof window.Window=="function"&&e instanceof window.Window||typeof window!="undefined"&&typeof window.constructor=="function"&&e instanceof window.constructor)return!1;var n={}.toString;if(n){var t=n.call(e);if(t==="[object Window]"||t==="[object global]"||t==="[object DOMWindow]")return!1}if(typeof e.then=="function")return!0}catch(r){return!1}return!1}var pt=[],me=[],qe=0,pe;function vt(){if(!qe&&pe){var e=pe;pe=null,e.resolve()}}function _e(){qe+=1}function ve(){qe-=1,vt()}var C=function(){function e(t){var r=this;if(this.resolved=void 0,this.rejected=void 0,this.errorHandled=void 0,this.value=void 0,this.error=void 0,this.handlers=void 0,this.dispatching=void 0,this.stack=void 0,this.resolved=!1,this.rejected=!1,this.errorHandled=!1,this.handlers=[],t){var o,i,a=!1,c=!1,u=!1;_e();try{t(function(s){u?r.resolve(s):(a=!0,o=s)},function(s){u?r.reject(s):(c=!0,i=s)})}catch(s){ve(),this.reject(s);return}ve(),u=!0,a?this.resolve(o):c&&this.reject(i)}}var n=e.prototype;return n.resolve=function(t){if(this.resolved||this.rejected)return this;if(ae(t))throw new Error("Can not resolve promise with another promise");return this.resolved=!0,this.value=t,this.dispatch(),this},n.reject=function(t){var r=this;if(this.resolved||this.rejected)return this;if(ae(t))throw new Error("Can not reject promise with another promise");if(!t){var o=t&&typeof t.toString=="function"?t.toString():{}.toString.call(t);t=new Error("Expected reject to be called with Error, got "+o)}return this.rejected=!0,this.error=t,this.errorHandled||setTimeout(function(){r.errorHandled||function(i,a){if(pt.indexOf(i)===-1){pt.push(i),setTimeout(function(){throw i},1);for(var c=0;c<me.length;c++)me[c](i,a)}}(t,r)},1),this.dispatch(),this},n.asyncReject=function(t){return this.errorHandled=!0,this.reject(t),this},n.dispatch=function(){var t=this.resolved,r=this.rejected,o=this.handlers;if(!this.dispatching&&(t||r)){this.dispatching=!0,_e();for(var i=function(w,x){return w.then(function(S){x.resolve(S)},function(S){x.reject(S)})},a=0;a<o.length;a++){var c=o[a],u=c.onSuccess,s=c.onError,p=c.promise,h=void 0;if(t)try{h=u?u(this.value):this.value}catch(w){p.reject(w);continue}else if(r){if(!s){p.reject(this.error);continue}try{h=s(this.error)}catch(w){p.reject(w);continue}}if(h instanceof e&&(h.resolved||h.rejected)){var m=h;m.resolved?p.resolve(m.value):p.reject(m.error),m.errorHandled=!0}else ae(h)?h instanceof e&&(h.resolved||h.rejected)?h.resolved?p.resolve(h.value):p.reject(h.error):i(h,p):p.resolve(h)}o.length=0,this.dispatching=!1,ve()}},n.then=function(t,r){if(t&&typeof t!="function"&&!t.call)throw new Error("Promise.then expected a function for success handler");if(r&&typeof r!="function"&&!r.call)throw new Error("Promise.then expected a function for error handler");var o=new e;return this.handlers.push({promise:o,onSuccess:t,onError:r}),this.errorHandled=!0,this.dispatch(),o},n.catch=function(t){return this.then(void 0,t)},n.finally=function(t){if(t&&typeof t!="function"&&!t.call)throw new Error("Promise.finally expected a function");return this.then(function(r){return e.try(t).then(function(){return r})},function(r){return e.try(t).then(function(){throw r})})},n.timeout=function(t,r){var o=this;if(this.resolved||this.rejected)return this;var i=setTimeout(function(){o.resolved||o.rejected||o.reject(r||new Error("Promise timed out after "+t+"ms"))},t);return this.then(function(a){return clearTimeout(i),a})},n.toPromise=function(){if(typeof Promise=="undefined")throw new TypeError("Could not find Promise");return Promise.resolve(this)},n.lazy=function(){return this.errorHandled=!0,this},e.resolve=function(t){return t instanceof e?t:ae(t)?new e(function(r,o){return t.then(r,o)}):new e().resolve(t)},e.reject=function(t){return new e().reject(t)},e.asyncReject=function(t){return new e().asyncReject(t)},e.all=function(t){var r=new e,o=t.length,i=[].slice();if(!o)return r.resolve(i),r;for(var a=function(s,p,h){return p.then(function(m){i[s]=m,(o-=1)==0&&r.resolve(i)},function(m){h.reject(m)})},c=0;c<t.length;c++){var u=t[c];if(u instanceof e){if(u.resolved){i[c]=u.value,o-=1;continue}}else if(!ae(u)){i[c]=u,o-=1;continue}a(c,e.resolve(u),r)}return o===0&&r.resolve(i),r},e.hash=function(t){var r={},o=[],i=function(c){if(t.hasOwnProperty(c)){var u=t[c];ae(u)?o.push(u.then(function(s){r[c]=s})):r[c]=u}};for(var a in t)i(a);return e.all(o).then(function(){return r})},e.map=function(t,r){return e.all(t.map(r))},e.onPossiblyUnhandledException=function(t){return function(r){return me.push(r),{cancel:function(){me.splice(me.indexOf(r),1)}}}(t)},e.try=function(t,r,o){if(t&&typeof t!="function"&&!t.call)throw new Error("Promise.try expected a function");var i;_e();try{i=t.apply(r,o||[])}catch(a){return ve(),e.reject(a)}return ve(),e.resolve(i)},e.delay=function(t){return new e(function(r){setTimeout(r,t)})},e.isPromise=function(t){return!!(t&&t instanceof e)||ae(t)},e.flush=function(){return function(t){var r=pe=pe||new t;return vt(),r}(e)},e}();function Oe(e,n){for(var t=0;t<e.length;t++)try{if(e[t]===n)return t}catch(r){}return-1}var Be=function(){function e(){if(this.name=void 0,this.weakmap=void 0,this.keys=void 0,this.values=void 0,this.name="__weakmap_"+(1e9*Math.random()>>>0)+"__",function(){if(typeof WeakMap=="undefined"||Object.freeze===void 0)return!1;try{var t=new WeakMap,r={};return Object.freeze(r),t.set(r,"__testvalue__"),t.get(r)==="__testvalue__"}catch(o){return!1}}())try{this.weakmap=new WeakMap}catch(t){}this.keys=[],this.values=[]}var n=e.prototype;return n._cleanupClosedWindows=function(){for(var t=this.weakmap,r=this.keys,o=0;o<r.length;o++){var i=r[o];if(Re(i)&&Z(i)){if(t)try{t.delete(i)}catch(a){}r.splice(o,1),this.values.splice(o,1),o-=1}}},n.isSafeToReadWrite=function(t){return!Re(t)},n.set=function(t,r){if(!t)throw new Error("WeakMap expected key");var o=this.weakmap;if(o)try{o.set(t,r)}catch(p){delete this.weakmap}if(this.isSafeToReadWrite(t))try{var i=this.name,a=t[i];a&&a[0]===t?a[1]=r:Object.defineProperty(t,i,{value:[t,r],writable:!0});return}catch(p){}this._cleanupClosedWindows();var c=this.keys,u=this.values,s=Oe(c,t);s===-1?(c.push(t),u.push(r)):u[s]=r},n.get=function(t){if(!t)throw new Error("WeakMap expected key");var r=this.weakmap;if(r)try{if(r.has(t))return r.get(t)}catch(a){delete this.weakmap}if(this.isSafeToReadWrite(t))try{var o=t[this.name];return o&&o[0]===t?o[1]:void 0}catch(a){}this._cleanupClosedWindows();var i=Oe(this.keys,t);if(i!==-1)return this.values[i]},n.delete=function(t){if(!t)throw new Error("WeakMap expected key");var r=this.weakmap;if(r)try{r.delete(t)}catch(c){delete this.weakmap}if(this.isSafeToReadWrite(t))try{var o=t[this.name];o&&o[0]===t&&(o[0]=o[1]=void 0)}catch(c){}this._cleanupClosedWindows();var i=this.keys,a=Oe(i,t);a!==-1&&(i.splice(a,1),this.values.splice(a,1))},n.has=function(t){if(!t)throw new Error("WeakMap expected key");var r=this.weakmap;if(r)try{if(r.has(t))return!0}catch(i){delete this.weakmap}if(this.isSafeToReadWrite(t))try{var o=t[this.name];return!(!o||o[0]!==t)}catch(i){}return this._cleanupClosedWindows(),Oe(this.keys,t)!==-1},n.getOrSet=function(t,r){if(this.has(t))return this.get(t);var o=r();return this.set(t,o),o},e}();function wt(e){return e.name||e.__name__||e.displayName||"anonymous"}function gt(e,n){try{delete e.name,e.name=n}catch(t){}return e.__name__=e.displayName=n,e}function ee(){var e="0123456789abcdef";return"uid_"+"xxxxxxxxxx".replace(/./g,function(){return e.charAt(Math.floor(Math.random()*e.length))})+"_"+function(n){if(typeof btoa=="function")return btoa(encodeURIComponent(n).replace(/%([0-9A-F]{2})/g,function(t,r){return String.fromCharCode(parseInt(r,16))})).replace(/[=]/g,"");if(typeof Buffer!="undefined")return Buffer.from(n,"utf8").toString("base64").replace(/[=]/g,"");throw new Error("Can not find window.btoa or Buffer")}(new Date().toISOString().slice(11,19).replace("T",".")).replace(/[^a-zA-Z0-9]/g,"").toLowerCase()}var Ae;function yt(e){try{return JSON.stringify([].slice.call(e),function(n,t){return typeof t=="function"?"memoize["+function(r){if(Ae=Ae||new Be,r==null||typeof r!="object"&&typeof r!="function")throw new Error("Invalid object");var o=Ae.get(r);return o||(o=typeof r+":"+ee(),Ae.set(r,o)),o}(t)+"]":typeof window!="undefined"&&t instanceof window.Element||t!==null&&typeof t=="object"&&t.nodeType===1&&typeof t.style=="object"&&typeof t.ownerDocument=="object"?{}:t})}catch(n){throw new Error("Arguments not serializable -- can not be used to memoize")}}function jn(){return{}}var we=0,Et=0;function ge(e,n){n===void 0&&(n={});var t=n.thisNamespace,r=t!==void 0&&t,o=n.time,i,a,c=we;we+=1;var u=function(){for(var s=arguments.length,p=new Array(s),h=0;h<s;h++)p[h]=arguments[h];c<Et&&(i=null,a=null,c=we,we+=1);var m;m=r?(a=a||new Be).getOrSet(this,jn):i=i||{};var w;try{w=yt(p)}catch(O){return e.apply(this,arguments)}var x=m[w];if(x&&o&&Date.now()-x.time<o&&(delete m[w],x=null),x)return x.value;var S=Date.now(),b=e.apply(this,arguments);return m[w]={time:S,value:b},b};return u.reset=function(){i=null,a=null},gt(u,(n.name||wt(e))+"::memoized")}ge.clear=function(){Et=we};function Mn(e){var n={};function t(){for(var r=arguments,o=this,i=arguments.length,a=new Array(i),c=0;c<i;c++)a[c]=arguments[c];var u=yt(a);return n.hasOwnProperty(u)||(n[u]=C.try(function(){return e.apply(o,r)}).finally(function(){delete n[u]})),n[u]}return t.reset=function(){n={}},gt(t,wt(e)+"::promiseMemoized")}function se(){}function ye(e,n){if(n===void 0&&(n=1),n>=3)return"stringifyError stack overflow";try{if(!e)return"<unknown error: "+{}.toString.call(e)+">";if(typeof e=="string")return e;if(e instanceof Error){var t=e&&e.stack,r=e&&e.message;if(t&&r)return t.indexOf(r)!==-1?t:r+`
126
126
  `+t;if(t)return t;if(r)return r}return e&&e.toString&&typeof e.toString=="function"?e.toString():{}.toString.call(e)}catch(o){return"Error while stringifying error: "+ye(o,n+1)}}function St(e){return typeof e=="string"?e:e.toString&&typeof e.toString=="function"?e.toString():{}.toString.call(e)}ge(function(e){if(Object.values)return Object.values(e);var n=[];for(var t in e)e.hasOwnProperty(t)&&n.push(e[t]);return n});function $e(e){return{}.toString.call(e)==="[object RegExp]"}function Ee(e,n,t){if(e.hasOwnProperty(n))return e[n];var r=t();return e[n]=r,r}function bt(){var e=document.body;if(!e)throw new Error("Body element not found");return e}function xt(){return!!document.body&&document.readyState==="complete"}function It(){return!!document.body&&document.readyState==="interactive"}ge(function(){return new C(function(e){if(xt()||It())return e();var n=setInterval(function(){if(xt()||It())return clearInterval(n),e()},10)})});var Ne=typeof document!="undefined"?document.currentScript:null,zn=ge(function(){if(Ne||(Ne=function(){try{var e=function(){try{throw new Error("_")}catch(a){return a.stack||""}}(),n=/.*at [^(]*\((.*):(.+):(.+)\)$/gi.exec(e),t=n&&n[1];if(!t)return;for(var r=0,o=[].slice.call(document.getElementsByTagName("script")).reverse();r<o.length;r++){var i=o[r];if(i.src&&i.src===t)return i}}catch(a){}}()))return Ne;throw new Error("Can not determine current script")}),Ln=ee();ge(function(){var e;try{e=zn()}catch(r){return Ln}var n=e.getAttribute("data-uid");if(n&&typeof n=="string"||(n=e.getAttribute("data-uid-auto"))&&typeof n=="string")return n;if(e.src){var t=function(r){for(var o="",i=0;i<r.length;i++){var a=r[i].charCodeAt(0)*i;r[i+1]&&(a+=r[i+1].charCodeAt(0)*(i-1)),o+=String.fromCharCode(97+Math.abs(a)%26)}return o}(JSON.stringify({src:e.src,dataset:e.dataset}));n="uid_"+t.slice(t.length-30)}else n=ee();return e.setAttribute("data-uid-auto",n),n});function Se(e){e===void 0&&(e=window);var n="__post_robot_10_0_46__";return e!==window?e[n]:e[n]=e[n]||{}}var Wt=function(){return{}};function L(e,n){return e===void 0&&(e="store"),n===void 0&&(n=Wt),Ee(Se(),e,function(){var t=n();return{has:function(r){return t.hasOwnProperty(r)},get:function(r,o){return t.hasOwnProperty(r)?t[r]:o},set:function(r,o){return t[r]=o,o},del:function(r){delete t[r]},getOrSet:function(r,o){return Ee(t,r,o)},reset:function(){t=n()},keys:function(){return Object.keys(t)}}})}var kn=function(){};function De(){var e=Se();return e.WINDOW_WILDCARD=e.WINDOW_WILDCARD||new kn,e.WINDOW_WILDCARD}function $(e,n){return e===void 0&&(e="store"),n===void 0&&(n=Wt),L("windowStore").getOrSet(e,function(){var t=new Be,r=function(o){return t.getOrSet(o,n)};return{has:function(o){return r(o).hasOwnProperty(e)},get:function(o,i){var a=r(o);return a.hasOwnProperty(e)?a[e]:i},set:function(o,i){return r(o)[e]=i,i},del:function(o){delete r(o)[e]},getOrSet:function(o,i){return Ee(r(o),e,i)}}})}function Pt(){return L("instance").getOrSet("instanceID",ee)}function Tt(e,n){var t=n.domain,r=$("helloPromises"),o=r.get(e);o&&o.resolve({domain:t});var i=C.resolve({domain:t});return r.set(e,i),i}function Ge(e,n){return(0,n.send)(e,"postrobot_hello",{instanceID:Pt()},{domain:"*",timeout:-1}).then(function(t){var r=t.origin,o=t.data.instanceID;return Tt(e,{domain:r}),{win:e,domain:r,instanceID:o}})}function Ct(e,n){var t=n.send;return $("windowInstanceIDPromises").getOrSet(e,function(){return Ge(e,{send:t}).then(function(r){return r.instanceID})})}function Rt(e){$("knownWindows").set(e,!0)}function Ve(e){return typeof e=="object"&&e!==null&&typeof e.__type__=="string"}function Ot(e){return e===void 0?"undefined":e===null?"null":Array.isArray(e)?"array":typeof e=="function"?"function":typeof e=="object"?e instanceof Error?"error":typeof e.then=="function"?"promise":{}.toString.call(e)==="[object RegExp]"?"regex":{}.toString.call(e)==="[object Date]"?"date":"object":typeof e=="string"?"string":typeof e=="number"?"number":typeof e=="boolean"?"boolean":void 0}function ue(e,n){return{__type__:e,__val__:n}}var V,Un=((V={}).function=function(){},V.error=function(e){return ue("error",{message:e.message,stack:e.stack,code:e.code,data:e.data})},V.promise=function(){},V.regex=function(e){return ue("regex",e.source)},V.date=function(e){return ue("date",e.toJSON())},V.array=function(e){return e},V.object=function(e){return e},V.string=function(e){return e},V.number=function(e){return e},V.boolean=function(e){return e},V.null=function(e){return e},V[void 0]=function(e){return ue("undefined",e)},V),Fn={},J,Hn=((J={}).function=function(){throw new Error("Function serialization is not implemented; nothing to deserialize")},J.error=function(e){var n=e.stack,t=e.code,r=e.data,o=new Error(e.message);return o.code=t,r&&(o.data=r),o.stack=n+`
127
127
 
package/package.json CHANGED
@@ -1,10 +1,14 @@
1
1
  {
2
2
  "name": "@soyio/soyio-widget",
3
- "version": "2.16.1",
3
+ "version": "2.17.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.umd.cjs",
6
6
  "module": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "https://github.com/Soyio-id/soy-io-widget"
11
+ },
8
12
  "exports": {
9
13
  ".": {
10
14
  "import": "./dist/index.js",