@deriv-web-design/ui 0.1.21 → 0.1.23

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.
@@ -4261,6 +4261,132 @@
4261
4261
  }
4262
4262
  }
4263
4263
  },
4264
+ "language-select-modal": {
4265
+ "id": "language-select-modal",
4266
+ "name": "Language Select Modal",
4267
+ "component": "LanguageSelectModal",
4268
+ "category": "overlay",
4269
+ "description": "Centred language-picker dialog with a grid of flag-plus-label destination links, built on LinkModal.",
4270
+ "purpose": "Use this template when a page needs a language (or locale) picker dialog — typically opened from a DocumentChips language link — where each option is a flag image plus a label linking to that language's destination.",
4271
+ "keywords": [
4272
+ "language",
4273
+ "locale",
4274
+ "modal",
4275
+ "dialog",
4276
+ "flag",
4277
+ "translation",
4278
+ "document",
4279
+ "regulatory",
4280
+ "overlay",
4281
+ "deriv"
4282
+ ],
4283
+ "sectionType": "language-select-modal",
4284
+ "global": false,
4285
+ "requiredFields": [
4286
+ "open"
4287
+ ],
4288
+ "optionalFields": [
4289
+ "title",
4290
+ "closeLabel",
4291
+ "options",
4292
+ "headingLevel",
4293
+ "container"
4294
+ ],
4295
+ "variants": [
4296
+ "default"
4297
+ ],
4298
+ "recommendedPosition": 99,
4299
+ "placement": [
4300
+ "overlay"
4301
+ ],
4302
+ "layout": {
4303
+ "alignment": "center",
4304
+ "gridColumns": "2-3",
4305
+ "contentWidth": "narrow",
4306
+ "background": false,
4307
+ "overlay": true
4308
+ },
4309
+ "supports": {
4310
+ "backgroundImage": false,
4311
+ "backgroundVideo": false,
4312
+ "foregroundImage": false,
4313
+ "primaryButton": false,
4314
+ "secondaryButton": false,
4315
+ "sectionLink": false,
4316
+ "icons": true
4317
+ },
4318
+ "imageRoles": [
4319
+ "flag"
4320
+ ],
4321
+ "defaultValues": {
4322
+ "title": "Select your language",
4323
+ "closeLabel": "Close",
4324
+ "headingLevel": "h2"
4325
+ },
4326
+ "fields": {
4327
+ "closeLabel": {
4328
+ "type": "string",
4329
+ "required": false,
4330
+ "default": "Close",
4331
+ "maxLength": 40
4332
+ },
4333
+ "headingLevel": {
4334
+ "type": "string",
4335
+ "required": false,
4336
+ "default": "h2",
4337
+ "enum": [
4338
+ "h2",
4339
+ "h3"
4340
+ ]
4341
+ },
4342
+ "open": {
4343
+ "type": "boolean",
4344
+ "required": true,
4345
+ "description": "Whether the dialog is rendered. Nothing mounts while false."
4346
+ },
4347
+ "options": {
4348
+ "type": "array",
4349
+ "required": false,
4350
+ "description": "Flag + label destinations. Flag sources are consumer-supplied remote URLs.",
4351
+ "itemFields": {
4352
+ "external": {
4353
+ "type": "boolean",
4354
+ "required": false,
4355
+ "default": true
4356
+ },
4357
+ "flagAlt": {
4358
+ "type": "string",
4359
+ "required": false,
4360
+ "default": ""
4361
+ },
4362
+ "flagSrc": {
4363
+ "type": "url",
4364
+ "required": false,
4365
+ "description": "Remote flag image. Omit for a label-only option."
4366
+ },
4367
+ "href": {
4368
+ "type": "url",
4369
+ "required": true
4370
+ },
4371
+ "id": {
4372
+ "type": "string",
4373
+ "required": false
4374
+ },
4375
+ "label": {
4376
+ "type": "string",
4377
+ "required": true,
4378
+ "maxLength": 80
4379
+ }
4380
+ }
4381
+ },
4382
+ "title": {
4383
+ "type": "string",
4384
+ "required": false,
4385
+ "default": "Select your language",
4386
+ "maxLength": 80
4387
+ }
4388
+ }
4389
+ },
4264
4390
  "leaders": {
4265
4391
  "id": "leaders",
4266
4392
  "name": "Leaders",
@@ -4851,7 +4977,8 @@
4851
4977
  ],
4852
4978
  "variants": [
4853
4979
  "tabs",
4854
- "single"
4980
+ "single",
4981
+ "toggle"
4855
4982
  ],
4856
4983
  "recommendedPosition": 4,
4857
4984
  "placement": [
@@ -5023,8 +5150,10 @@
5023
5150
  "default": "tabs",
5024
5151
  "enum": [
5025
5152
  "tabs",
5026
- "single"
5027
- ]
5153
+ "single",
5154
+ "toggle"
5155
+ ],
5156
+ "description": "`tabs` lists selectable option types; `single` shows one option as a media/copy split; `toggle` shows one option as a single media well whose animation is swapped by an icon switch above the card heading."
5028
5157
  }
5029
5158
  }
5030
5159
  },
@@ -3037,7 +3037,7 @@
3037
3037
  "variant": {
3038
3038
  "type": "OptionsTypesVariant",
3039
3039
  "required": false,
3040
- "description": "`tabs` shows a selectable list of option types. `single` shows one option in a media/content split.",
3040
+ "description": "`tabs` shows a selectable list of option types. `single` shows one option in a media/content split. `toggle` shows one option as a single media well whose animation is swapped by an icon switch above the card heading, with the copy beside it. Use it when the animations are two views of the same idea (up/down, before/after) rather than two separate things worth showing at once.",
3041
3041
  "default": "tabs"
3042
3042
  }
3043
3043
  }
package/dist/index.css CHANGED
@@ -11563,6 +11563,110 @@
11563
11563
  height: 16px;
11564
11564
  flex: 0 0 auto;
11565
11565
  }
11566
+ .ot--toggle {
11567
+ --ot-toggle-card-bg: var(--background-surface);
11568
+ --ot-toggle-switch-bg: var(--color-opacity-slate-4);
11569
+ --ot-toggle-switch-radius: var(--radius-md);
11570
+ --ot-toggle-switch-padding: var(--spacing-4);
11571
+ --ot-toggle-option-width: var(--spacing-40);
11572
+ --ot-toggle-option-height: var(--spacing-32);
11573
+ --ot-toggle-option-radius: 0.25rem;
11574
+ --ot-toggle-icon-size: 1.375rem;
11575
+ --ot-toggle-card-max-width: 24.06rem;
11576
+ --ot-toggle-column-gap: var(--spacing-16);
11577
+ --ot-toggle-media-padding: var(--spacing-16);
11578
+ --ot-toggle-copy-padding-inline: var(--spacing-24);
11579
+ --ot-toggle-switch-offset: var(--spacing-16);
11580
+ }
11581
+ .ot__option--toggle {
11582
+ display: flex;
11583
+ flex-direction: column;
11584
+ gap: 0;
11585
+ width: 100%;
11586
+ max-width: var(--ot-toggle-card-max-width);
11587
+ margin-inline: auto;
11588
+ background: var(--ot-toggle-card-bg);
11589
+ border-radius: var(--ot-card-radius);
11590
+ overflow: visible;
11591
+ }
11592
+ .ot__toggle-media {
11593
+ min-width: 0;
11594
+ padding: var(--ot-toggle-media-padding);
11595
+ }
11596
+ .ot__toggle-pane {
11597
+ min-width: 0;
11598
+ }
11599
+ .ot__toggle-pane[hidden] {
11600
+ display: none;
11601
+ }
11602
+ .ot__toggle-side {
11603
+ display: flex;
11604
+ min-width: 0;
11605
+ flex-direction: column;
11606
+ align-items: flex-start;
11607
+ gap: 0;
11608
+ padding-block: var(--spacing-16) var(--spacing-32);
11609
+ padding-inline: var(--ot-toggle-copy-padding-inline);
11610
+ }
11611
+ .ot__toggle-switch {
11612
+ display: flex;
11613
+ align-items: center;
11614
+ align-self: center;
11615
+ margin-bottom: var(--ot-toggle-switch-offset);
11616
+ padding: var(--ot-toggle-switch-padding);
11617
+ background: var(--ot-toggle-switch-bg);
11618
+ border-radius: var(--ot-toggle-switch-radius);
11619
+ }
11620
+ .ot__toggle-option {
11621
+ display: flex;
11622
+ align-items: center;
11623
+ justify-content: center;
11624
+ width: var(--ot-toggle-option-width);
11625
+ height: var(--ot-toggle-option-height);
11626
+ padding: 0;
11627
+ border: 0;
11628
+ border-radius: var(--ot-toggle-option-radius);
11629
+ background: transparent;
11630
+ color: var(--ot-text);
11631
+ cursor: pointer;
11632
+ transition: background-color 0.2s ease;
11633
+ }
11634
+ .ot__toggle-option--active {
11635
+ background: var(--ot-toggle-card-bg);
11636
+ }
11637
+ .ot__toggle-option:focus-visible {
11638
+ outline: 2px solid var(--ot-focus);
11639
+ outline-offset: 2px;
11640
+ }
11641
+ .ot__toggle-icon {
11642
+ display: block;
11643
+ width: var(--ot-toggle-icon-size);
11644
+ height: var(--ot-toggle-icon-size);
11645
+ object-fit: contain;
11646
+ }
11647
+ .ot__toggle-option:has(.ot__toggle-option-label) {
11648
+ width: auto;
11649
+ min-width: var(--ot-toggle-option-width);
11650
+ padding-inline: var(--spacing-16);
11651
+ }
11652
+ .ot__toggle-option-label {
11653
+ font-family: var(--typography-body-sm-font-family);
11654
+ font-size: var(--typography-body-sm-font-size);
11655
+ font-weight: var(--font-weight-semi-bold);
11656
+ line-height: var(--typography-body-sm-line-height);
11657
+ white-space: nowrap;
11658
+ }
11659
+ .ot__toggle-title {
11660
+ margin: 0;
11661
+ color: var(--ot-text);
11662
+ font-family: var(--typography-h5-font-family);
11663
+ font-size: var(--typography-h5-font-size);
11664
+ font-weight: var(--typography-h5-font-weight);
11665
+ line-height: var(--typography-h5-line-height);
11666
+ }
11667
+ .ot__option--toggle .ot__metadata {
11668
+ margin-top: var(--spacing-24);
11669
+ }
11566
11670
  @media (min-width: 480px) {
11567
11671
  .ot {
11568
11672
  --ot-stack-gap: var(--spacing-32);
@@ -11617,6 +11721,27 @@
11617
11721
  grid-template-columns: 1fr;
11618
11722
  gap: var(--spacing-48);
11619
11723
  }
11724
+ .ot--toggle {
11725
+ --ot-toggle-switch-offset: var(--spacing-32);
11726
+ }
11727
+ .ot__option--toggle {
11728
+ flex-direction: row;
11729
+ align-items: stretch;
11730
+ gap: var(--ot-toggle-column-gap);
11731
+ max-width: none;
11732
+ overflow: hidden;
11733
+ }
11734
+ .ot__toggle-media {
11735
+ flex: 1 1 0;
11736
+ padding: 0;
11737
+ }
11738
+ .ot__toggle-side {
11739
+ flex: 1 1 0;
11740
+ padding: var(--spacing-48);
11741
+ }
11742
+ .ot__toggle-switch {
11743
+ align-self: flex-start;
11744
+ }
11620
11745
  }
11621
11746
  @media (prefers-reduced-motion: reduce) {
11622
11747
  .ot__control-icon {