@soyio/soyio-widget 2.26.0 → 3.0.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 +19 -4
- package/dist/index.d.ts +21 -2
- package/dist/index.js +700 -704
- package/dist/index.umd.cjs +36 -36
- package/package.json +1 -1
- package/src/schemas/appearance.schema.json +16 -2
- package/src/schemas/config.schema.json +16 -2
package/README.md
CHANGED
|
@@ -595,19 +595,31 @@ Built-in themes provide pre-configured color palettes and component styles:
|
|
|
595
595
|
| Theme | Description |
|
|
596
596
|
| ----- | ----------- |
|
|
597
597
|
| `"soyio"` | Default light theme with Soyio brand colors (purple/indigo), uppercase titles |
|
|
598
|
-
| `"night"` | Dark mode theme with deep blues, muted colors, and subtle borders |
|
|
599
598
|
| `"flat"` | Minimal theme with square corners, normal-case titles, thicker borders |
|
|
599
|
+
| `"neutral"` | Neutral palette that works well for both light and dark modes |
|
|
600
|
+
| `"night"` | Deprecated alias for `theme: "soyio"` with `mode: "dark"` |
|
|
600
601
|
|
|
601
602
|
**Theme style differences:**
|
|
602
603
|
|
|
603
604
|
- **soyio**: Standard styling with rounded corners and uppercase card titles
|
|
604
|
-
- **night**: Dark backgrounds, lighter text, borders using theme variables
|
|
605
605
|
- **flat**: No border radius, sentence-case titles (no uppercase), 2px borders, lighter font weights
|
|
606
|
+
- **neutral**: Balanced grayscale palette intended for a more subdued branded experience
|
|
607
|
+
|
|
608
|
+
### Color Modes
|
|
609
|
+
|
|
610
|
+
Appearance now supports a `mode` field:
|
|
611
|
+
|
|
612
|
+
| Mode | Description |
|
|
613
|
+
| ---- | ----------- |
|
|
614
|
+
| `"light"` | Forces light mode |
|
|
615
|
+
| `"dark"` | Forces dark mode |
|
|
616
|
+
| `"auto"` | Follows the user's system color scheme |
|
|
606
617
|
|
|
607
618
|
**Example:**
|
|
608
619
|
```javascript
|
|
609
620
|
const appearance = {
|
|
610
|
-
theme: "
|
|
621
|
+
theme: "soyio",
|
|
622
|
+
mode: "dark",
|
|
611
623
|
variables: {
|
|
612
624
|
// You can still override specific variables
|
|
613
625
|
colorPrimary: "#FF6B6B",
|
|
@@ -621,6 +633,8 @@ const appearance = {
|
|
|
621
633
|
|
|
622
634
|
Theme variables and rules are applied first, then your custom overrides take precedence.
|
|
623
635
|
|
|
636
|
+
> `theme: "night"` is still accepted as a deprecated alias for backwards compatibility, but new integrations should use `theme + mode`.
|
|
637
|
+
|
|
624
638
|
### Config
|
|
625
639
|
|
|
626
640
|
The `config` object allows you to adjust component behavior settings.
|
|
@@ -1055,7 +1069,8 @@ const ajv = new Ajv();
|
|
|
1055
1069
|
const validate = ajv.compile(appearanceSchema);
|
|
1056
1070
|
|
|
1057
1071
|
const appearance = {
|
|
1058
|
-
theme: "
|
|
1072
|
+
theme: "soyio",
|
|
1073
|
+
mode: "dark",
|
|
1059
1074
|
variables: {
|
|
1060
1075
|
colorPrimary: "#007bff",
|
|
1061
1076
|
borderRadius: "8px"
|
package/dist/index.d.ts
CHANGED
|
@@ -412,10 +412,11 @@ declare type SignatureRequestConfig = {
|
|
|
412
412
|
developmentUrl?: string;
|
|
413
413
|
};
|
|
414
414
|
|
|
415
|
-
declare type SkeletonConstructor = new (id: string,
|
|
415
|
+
declare type SkeletonConstructor = new (id: string, appearance?: SoyioAppearance) => ISkeletonView;
|
|
416
416
|
|
|
417
417
|
declare interface SoyioAppearance {
|
|
418
418
|
theme?: SoyioTheme;
|
|
419
|
+
mode?: SoyioColorMode;
|
|
419
420
|
variables?: SoyioAppearanceVariables;
|
|
420
421
|
rules?: SoyioRule;
|
|
421
422
|
config?: SoyioAppearanceConfig;
|
|
@@ -518,6 +519,15 @@ declare interface SoyioAppearanceVariables {
|
|
|
518
519
|
|
|
519
520
|
declare type SoyioBaseRule = '.MainContainer' | '.Button' | '.Checkbox' | '.CheckboxInput' | '.CheckboxLabel' | '.CheckboxCheck' | '.Input' | '.Label' | '.HintIcon' | '.Title' | '.CategoryTag' | '.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';
|
|
520
521
|
|
|
522
|
+
/**
|
|
523
|
+
* Appearance color mode.
|
|
524
|
+
*
|
|
525
|
+
* - `light`: force light mode
|
|
526
|
+
* - `dark`: force dark mode
|
|
527
|
+
* - `auto`: follow the consumer's system color scheme
|
|
528
|
+
*/
|
|
529
|
+
declare type SoyioColorMode = 'light' | 'dark' | 'auto';
|
|
530
|
+
|
|
521
531
|
declare type SoyioElementState = '--checked';
|
|
522
532
|
|
|
523
533
|
declare interface SoyioIconConfig {
|
|
@@ -556,7 +566,12 @@ declare type SoyioRuleKey = `${SoyioBaseRule}${SoyioElementState | SoyioPseudoCl
|
|
|
556
566
|
|
|
557
567
|
declare type SoyioStateRule = '.Input--error' | '.Alert--error' | '.Alert--warning' | '.Alert--info' | '.Alert--note' | '.Alert--success' | '.Chip--info' | '.Chip--green' | '.Chip--red' | '.Chip--amber' | '.RadioCard--checked' | '.RadioCardIndicator--checked' | '.StepIndicator--active' | '.StepIndicator--completed' | '.StepIndicator--pending' | '.StepIndicatorLine--top' | '.StepIndicatorLine--bottom';
|
|
558
568
|
|
|
559
|
-
|
|
569
|
+
/**
|
|
570
|
+
* Appearance theme palette.
|
|
571
|
+
*
|
|
572
|
+
* `night` is kept as a deprecated alias for `theme: 'soyio'` + `mode: 'dark'`.
|
|
573
|
+
*/
|
|
574
|
+
declare type SoyioTheme = 'soyio' | 'flat' | 'neutral' | 'night';
|
|
560
575
|
|
|
561
576
|
declare namespace SoyioTypes {
|
|
562
577
|
export {
|
|
@@ -564,6 +579,10 @@ declare namespace SoyioTypes {
|
|
|
564
579
|
ConsentConfig,
|
|
565
580
|
PrivacyCenterConfig,
|
|
566
581
|
SoyioAppearance,
|
|
582
|
+
SoyioAppearanceConfig,
|
|
583
|
+
SoyioAppearanceVariables,
|
|
584
|
+
SoyioColorMode,
|
|
585
|
+
SoyioTheme,
|
|
567
586
|
Request_2 as Request,
|
|
568
587
|
NewDisclosureRequestProps,
|
|
569
588
|
ExistingDisclosureRequestProps,
|