@ukic/web-components 2.21.0 → 2.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/core.cjs.js +1 -1
- package/dist/cjs/ic-back-to-top.cjs.entry.js +2 -1
- package/dist/cjs/ic-back-to-top.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-button_3.cjs.entry.js +1 -1
- package/dist/cjs/ic-button_3.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-checkbox.cjs.entry.js +18 -5
- package/dist/cjs/ic-checkbox.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-dialog.cjs.entry.js +1 -1
- package/dist/cjs/ic-dialog.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-input-component-container_3.cjs.entry.js +5 -7
- package/dist/cjs/ic-input-component-container_3.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-input-label_2.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-navigation-item.cjs.entry.js +1 -1
- package/dist/cjs/ic-navigation-item.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-radio-option.cjs.entry.js +1 -1
- package/dist/cjs/ic-radio-option.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-search-bar.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-section-container.cjs.entry.js +1 -1
- package/dist/cjs/ic-section-container.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-side-navigation.cjs.entry.js +1 -1
- package/dist/cjs/ic-side-navigation.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-step.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-stepper.cjs.entry.js +29 -8
- package/dist/cjs/ic-stepper.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-tab-context.cjs.entry.js +8 -0
- package/dist/cjs/ic-tab-context.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-tab.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-toast.cjs.entry.js +6 -0
- package/dist/cjs/ic-toast.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-toggle-button-group.cjs.entry.js +1 -1
- package/dist/cjs/ic-toggle-button-group.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-toggle-button.cjs.entry.js +4 -2
- package/dist/cjs/ic-toggle-button.cjs.entry.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/ic-back-to-top/ic-back-to-top.css +10 -0
- package/dist/collection/components/ic-back-to-top/ic-back-to-top.js +1 -0
- package/dist/collection/components/ic-back-to-top/ic-back-to-top.js.map +1 -1
- package/dist/collection/components/ic-button/ic-button.css +42 -171
- package/dist/collection/components/ic-checkbox/ic-checkbox.js +61 -8
- package/dist/collection/components/ic-checkbox/ic-checkbox.js.map +1 -1
- package/dist/collection/components/ic-checkbox-group/test/basic/ic-checkbox-group.spec.js +61 -2
- package/dist/collection/components/ic-checkbox-group/test/basic/ic-checkbox-group.spec.js.map +1 -1
- package/dist/collection/components/ic-dialog/ic-dialog.css +10 -5
- package/dist/collection/components/ic-input-label/ic-input-label.css +11 -0
- package/dist/collection/components/ic-menu/ic-menu.css +1 -0
- package/dist/collection/components/ic-menu/ic-menu.js +4 -6
- package/dist/collection/components/ic-menu/ic-menu.js.map +1 -1
- package/dist/collection/components/ic-navigation-item/ic-navigation-item.css +1 -1
- package/dist/collection/components/ic-navigation-item/ic-navigation-item.js +1 -0
- package/dist/collection/components/ic-navigation-item/ic-navigation-item.js.map +1 -1
- package/dist/collection/components/ic-radio-option/ic-radio-option.js +1 -1
- package/dist/collection/components/ic-radio-option/ic-radio-option.js.map +1 -1
- package/dist/collection/components/ic-search-bar/ic-search-bar.js.map +1 -1
- package/dist/collection/components/ic-section-container/ic-section-container.js +1 -1
- package/dist/collection/components/ic-section-container/ic-section-container.js.map +1 -1
- package/dist/collection/components/ic-side-navigation/ic-side-navigation.css +4 -0
- package/dist/collection/components/ic-step/ic-step.css +13 -0
- package/dist/collection/components/ic-stepper/ic-stepper.js +34 -8
- package/dist/collection/components/ic-stepper/ic-stepper.js.map +1 -1
- package/dist/collection/components/ic-stepper/test/basic/ic-stepper.spec.js +26 -0
- package/dist/collection/components/ic-stepper/test/basic/ic-stepper.spec.js.map +1 -1
- package/dist/collection/components/ic-tab/ic-tab.css +2 -0
- package/dist/collection/components/ic-tab-context/ic-tab-context.js +10 -0
- package/dist/collection/components/ic-tab-context/ic-tab-context.js.map +1 -1
- package/dist/collection/components/ic-toast/ic-toast.js +9 -0
- package/dist/collection/components/ic-toast/ic-toast.js.map +1 -1
- package/dist/collection/components/ic-toggle-button/ic-toggle-button.css +5 -0
- package/dist/collection/components/ic-toggle-button/ic-toggle-button.js +3 -1
- package/dist/collection/components/ic-toggle-button/ic-toggle-button.js.map +1 -1
- package/dist/collection/components/ic-toggle-button-group/ic-toggle-button-group.css +3 -1
- package/dist/components/ic-back-to-top.js +2 -1
- package/dist/components/ic-back-to-top.js.map +1 -1
- package/dist/components/ic-button2.js +1 -1
- package/dist/components/ic-button2.js.map +1 -1
- package/dist/components/ic-checkbox.js +25 -7
- package/dist/components/ic-checkbox.js.map +1 -1
- package/dist/components/ic-dialog.js +1 -1
- package/dist/components/ic-dialog.js.map +1 -1
- package/dist/components/ic-input-label2.js.map +1 -1
- package/dist/components/ic-menu2.js +5 -7
- package/dist/components/ic-menu2.js.map +1 -1
- package/dist/components/ic-navigation-item.js +1 -1
- package/dist/components/ic-navigation-item.js.map +1 -1
- package/dist/components/ic-radio-option.js +1 -1
- package/dist/components/ic-radio-option.js.map +1 -1
- package/dist/components/ic-search-bar.js.map +1 -1
- package/dist/components/ic-section-container2.js +1 -1
- package/dist/components/ic-section-container2.js.map +1 -1
- package/dist/components/ic-side-navigation.js +1 -1
- package/dist/components/ic-side-navigation.js.map +1 -1
- package/dist/components/ic-step.js.map +1 -1
- package/dist/components/ic-stepper.js +32 -8
- package/dist/components/ic-stepper.js.map +1 -1
- package/dist/components/ic-tab-context.js +9 -0
- package/dist/components/ic-tab-context.js.map +1 -1
- package/dist/components/ic-tab.js.map +1 -1
- package/dist/components/ic-toast.js +9 -1
- package/dist/components/ic-toast.js.map +1 -1
- package/dist/components/ic-toggle-button-group.js +1 -1
- package/dist/components/ic-toggle-button-group.js.map +1 -1
- package/dist/components/ic-toggle-button.js +4 -2
- package/dist/components/ic-toggle-button.js.map +1 -1
- package/dist/core/core.esm.js +1 -1
- package/dist/core/core.esm.js.map +1 -1
- package/dist/core/{p-af5e3bab.entry.js → p-1c228028.entry.js} +2 -2
- package/dist/core/{p-af5e3bab.entry.js.map → p-1c228028.entry.js.map} +1 -1
- package/dist/core/{p-4a0acd0f.entry.js → p-244d38ed.entry.js} +2 -2
- package/dist/core/{p-4a0acd0f.entry.js.map → p-244d38ed.entry.js.map} +1 -1
- package/dist/core/p-26793ea2.entry.js +2 -0
- package/dist/core/p-26793ea2.entry.js.map +1 -0
- package/dist/core/p-4522e5c0.entry.js.map +1 -1
- package/dist/core/p-687af4e5.entry.js.map +1 -1
- package/dist/core/{p-de40b0b1.entry.js → p-69fc2feb.entry.js} +2 -2
- package/dist/core/p-69fc2feb.entry.js.map +1 -0
- package/dist/core/p-7dbd0a9f.entry.js.map +1 -1
- package/dist/core/p-9de95c50.entry.js +2 -0
- package/dist/core/p-9de95c50.entry.js.map +1 -0
- package/dist/core/{p-c6ac1a01.entry.js → p-a2704b98.entry.js} +2 -2
- package/dist/core/p-a2704b98.entry.js.map +1 -0
- package/dist/core/{p-e9723eaa.entry.js → p-a87d13b3.entry.js} +2 -2
- package/dist/core/{p-e9723eaa.entry.js.map → p-a87d13b3.entry.js.map} +1 -1
- package/dist/core/{p-6fae929c.entry.js → p-b47021d8.entry.js} +2 -2
- package/dist/core/p-b47021d8.entry.js.map +1 -0
- package/dist/core/p-bbfe15b5.entry.js +2 -0
- package/dist/core/p-bbfe15b5.entry.js.map +1 -0
- package/dist/core/p-c59c733e.entry.js +2 -0
- package/dist/core/p-c59c733e.entry.js.map +1 -0
- package/dist/core/{p-adecaedd.entry.js → p-c698064f.entry.js} +2 -2
- package/dist/core/p-c698064f.entry.js.map +1 -0
- package/dist/core/p-cf93053d.entry.js +2 -0
- package/dist/core/p-cf93053d.entry.js.map +1 -0
- package/dist/core/{p-1624f4de.entry.js → p-df0deff0.entry.js} +2 -2
- package/dist/core/p-df0deff0.entry.js.map +1 -0
- package/dist/core/p-e6a8f0de.entry.js +2 -0
- package/dist/core/p-e6a8f0de.entry.js.map +1 -0
- package/dist/core/p-e70c6b33.entry.js.map +1 -1
- package/dist/esm/core.js +1 -1
- package/dist/esm/ic-back-to-top.entry.js +2 -1
- package/dist/esm/ic-back-to-top.entry.js.map +1 -1
- package/dist/esm/ic-button_3.entry.js +1 -1
- package/dist/esm/ic-button_3.entry.js.map +1 -1
- package/dist/esm/ic-checkbox.entry.js +18 -5
- package/dist/esm/ic-checkbox.entry.js.map +1 -1
- package/dist/esm/ic-dialog.entry.js +1 -1
- package/dist/esm/ic-dialog.entry.js.map +1 -1
- package/dist/esm/ic-input-component-container_3.entry.js +5 -7
- package/dist/esm/ic-input-component-container_3.entry.js.map +1 -1
- package/dist/esm/ic-input-label_2.entry.js.map +1 -1
- package/dist/esm/ic-navigation-item.entry.js +1 -1
- package/dist/esm/ic-navigation-item.entry.js.map +1 -1
- package/dist/esm/ic-radio-option.entry.js +1 -1
- package/dist/esm/ic-radio-option.entry.js.map +1 -1
- package/dist/esm/ic-search-bar.entry.js.map +1 -1
- package/dist/esm/ic-section-container.entry.js +1 -1
- package/dist/esm/ic-section-container.entry.js.map +1 -1
- package/dist/esm/ic-side-navigation.entry.js +1 -1
- package/dist/esm/ic-side-navigation.entry.js.map +1 -1
- package/dist/esm/ic-step.entry.js.map +1 -1
- package/dist/esm/ic-stepper.entry.js +29 -8
- package/dist/esm/ic-stepper.entry.js.map +1 -1
- package/dist/esm/ic-tab-context.entry.js +8 -0
- package/dist/esm/ic-tab-context.entry.js.map +1 -1
- package/dist/esm/ic-tab.entry.js.map +1 -1
- package/dist/esm/ic-toast.entry.js +6 -0
- package/dist/esm/ic-toast.entry.js.map +1 -1
- package/dist/esm/ic-toggle-button-group.entry.js +1 -1
- package/dist/esm/ic-toggle-button-group.entry.js.map +1 -1
- package/dist/esm/ic-toggle-button.entry.js +4 -2
- package/dist/esm/ic-toggle-button.entry.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/ic-checkbox/ic-checkbox.d.ts +10 -0
- package/dist/types/components/ic-navigation-item/ic-navigation-item.d.ts +1 -0
- package/dist/types/components/ic-stepper/ic-stepper.d.ts +3 -0
- package/dist/types/components/ic-tab-context/ic-tab-context.d.ts +1 -0
- package/dist/types/components/ic-toast/ic-toast.d.ts +1 -0
- package/dist/types/components/ic-toggle-button/ic-toggle-button.d.ts +1 -0
- package/dist/types/components.d.ts +16 -0
- package/hydrate/index.js +85 -32
- package/package.json +2 -2
- package/vscode-data.json +8 -0
- package/dist/collection/components/ic-status-tag/test/a11y/ic-status-tag.test.a11y.js +0 -11
- package/dist/collection/components/ic-status-tag/test/a11y/ic-status-tag.test.a11y.js.map +0 -1
- package/dist/core/p-1624f4de.entry.js.map +0 -1
- package/dist/core/p-49cdaddc.entry.js +0 -2
- package/dist/core/p-49cdaddc.entry.js.map +0 -1
- package/dist/core/p-6fae929c.entry.js.map +0 -1
- package/dist/core/p-ad6176a2.entry.js +0 -2
- package/dist/core/p-ad6176a2.entry.js.map +0 -1
- package/dist/core/p-adecaedd.entry.js.map +0 -1
- package/dist/core/p-c6ac1a01.entry.js.map +0 -1
- package/dist/core/p-cbba9c7c.entry.js +0 -2
- package/dist/core/p-cbba9c7c.entry.js.map +0 -1
- package/dist/core/p-d3f10067.entry.js +0 -2
- package/dist/core/p-d3f10067.entry.js.map +0 -1
- package/dist/core/p-dae27567.entry.js +0 -2
- package/dist/core/p-dae27567.entry.js.map +0 -1
- package/dist/core/p-de40b0b1.entry.js.map +0 -1
- package/dist/core/p-fe702898.entry.js +0 -2
- package/dist/core/p-fe702898.entry.js.map +0 -1
- package/dist/types/components/ic-status-tag/test/a11y/ic-status-tag.test.a11y.d.ts +0 -1
|
@@ -489,8 +489,6 @@ video {
|
|
|
489
489
|
}
|
|
490
490
|
|
|
491
491
|
.button:focus,
|
|
492
|
-
:host .button:focus,
|
|
493
|
-
:host(.light) .button:focus,
|
|
494
492
|
::slotted(a:focus) {
|
|
495
493
|
box-shadow: var(--ic-border-focus);
|
|
496
494
|
}
|
|
@@ -558,6 +556,7 @@ video {
|
|
|
558
556
|
|
|
559
557
|
:host(.top-icon) .button {
|
|
560
558
|
flex-direction: column;
|
|
559
|
+
|
|
561
560
|
--height: fit-content;
|
|
562
561
|
}
|
|
563
562
|
|
|
@@ -571,42 +570,19 @@ video {
|
|
|
571
570
|
|
|
572
571
|
:host(.button-variant-primary) .button,
|
|
573
572
|
:host(.button-variant-primary) ::slotted(a) {
|
|
574
|
-
color: var(--ic-
|
|
573
|
+
color: var(--ic-color-white-text);
|
|
575
574
|
background-color: var(--button-default);
|
|
576
575
|
}
|
|
577
576
|
|
|
578
|
-
:host(.button-variant-primary) .button:hover
|
|
579
|
-
background-color: var(--button-default-hover);
|
|
580
|
-
}
|
|
581
|
-
|
|
582
|
-
:host(.button-variant-primary) .button:hover:focus {
|
|
577
|
+
:host(.button-variant-primary) .button:hover {
|
|
583
578
|
background-color: var(--button-default-hover);
|
|
584
|
-
border-color: var(--button-default-hover);
|
|
585
|
-
}
|
|
586
|
-
|
|
587
|
-
:host(.button-variant-primary:not(.light)) .button:hover:focus,
|
|
588
|
-
:host(.button-variant-primary:not(.light)) ::slotted(a:hover:focus) {
|
|
589
|
-
color: var(--ic-architectural-white);
|
|
590
|
-
}
|
|
591
|
-
|
|
592
|
-
:host(.button-variant-primary) .button:active:not(:focus),
|
|
593
|
-
:host(.button-variant-primary.loading) .button {
|
|
594
|
-
background-color: var(--button-default-active);
|
|
595
|
-
}
|
|
596
|
-
|
|
597
|
-
:host(.button-variant-primary) .button:active:focus {
|
|
598
|
-
background-color: var(--button-default-active);
|
|
599
579
|
}
|
|
600
580
|
|
|
581
|
+
:host(.button-variant-primary.loading) .button,
|
|
601
582
|
:host(.button-variant-primary) .button:active {
|
|
602
583
|
background-color: var(--button-default-active);
|
|
603
584
|
}
|
|
604
585
|
|
|
605
|
-
:host(.button-variant-primary:not(.light)) .button:active,
|
|
606
|
-
:host(.button-variant-primary:not(.light)) ::slotted(a:active) {
|
|
607
|
-
color: var(--ic-architectural-white);
|
|
608
|
-
}
|
|
609
|
-
|
|
610
586
|
:host(.button-variant-primary.disabled) .button,
|
|
611
587
|
:host(.button-variant-primary.disabled) ::slotted(a) {
|
|
612
588
|
background: var(--ic-architectural-200);
|
|
@@ -627,26 +603,15 @@ video {
|
|
|
627
603
|
color: var(--button-default);
|
|
628
604
|
}
|
|
629
605
|
|
|
630
|
-
:host(.button-variant-secondary) .button:hover
|
|
631
|
-
:host(.button-variant-secondary)
|
|
632
|
-
:host(.button-variant-secondary) ::slotted(a:hover:not(:focus)),
|
|
633
|
-
:host(.button-variant-secondary) ::slotted(a:hover:focus) {
|
|
606
|
+
:host(.button-variant-secondary) .button:hover,
|
|
607
|
+
:host(.button-variant-secondary) ::slotted(a:hover) {
|
|
634
608
|
background-color: var(--button-default-background-hover);
|
|
635
609
|
border-color: var(--button-default-hover);
|
|
636
610
|
color: var(--button-default-hover);
|
|
637
611
|
}
|
|
638
612
|
|
|
639
|
-
:host(.button-variant-secondary) .button:active:not(:focus),
|
|
640
|
-
:host(.button-variant-secondary) .button:active:focus,
|
|
641
613
|
:host(.button-variant-secondary) .button:active,
|
|
642
|
-
:host(.button-variant-secondary) ::slotted(a:active
|
|
643
|
-
:host(.button-variant-secondary) ::slotted(a:active:focus),
|
|
644
|
-
:host(.button-variant-secondary) ::slotted(a:active) {
|
|
645
|
-
border-color: var(--button-default-active);
|
|
646
|
-
background-color: var(--button-default-background-active);
|
|
647
|
-
color: var(--button-default-active);
|
|
648
|
-
}
|
|
649
|
-
|
|
614
|
+
:host(.button-variant-secondary) ::slotted(a:active),
|
|
650
615
|
:host(.button-variant-secondary.loading) .button {
|
|
651
616
|
border-color: var(--button-default-active);
|
|
652
617
|
background-color: var(--button-default-background-active);
|
|
@@ -654,25 +619,16 @@ video {
|
|
|
654
619
|
}
|
|
655
620
|
|
|
656
621
|
:host(.button-variant-secondary.disabled) .button,
|
|
657
|
-
:host(.button-variant-secondary.disabled)
|
|
658
|
-
:host(.button-variant-secondary.disabled) .button:active,
|
|
659
|
-
:host(.button-variant-secondary.disabled) ::slotted(a),
|
|
660
|
-
:host(.button-variant-secondary.disabled) ::slotted(a:hover),
|
|
661
|
-
:host(.button-variant-secondary.disabled) ::slotted(a:active) {
|
|
622
|
+
:host(.button-variant-secondary.disabled) ::slotted(a) {
|
|
662
623
|
border-color: var(--ic-architectural-300);
|
|
663
624
|
color: var(--ic-architectural-300);
|
|
664
625
|
background: none;
|
|
665
626
|
}
|
|
666
627
|
|
|
667
628
|
:host(.button-variant-secondary.light.disabled) .button,
|
|
668
|
-
:host(.button-variant-secondary.light.disabled)
|
|
669
|
-
:host(.button-variant-secondary.light.disabled) .button:active,
|
|
670
|
-
:host(.button-variant-secondary.light.disabled) ::slotted(a),
|
|
671
|
-
:host(.button-variant-secondary.light.disabled) ::slotted(a:hover),
|
|
672
|
-
:host(.button-variant-secondary.light.disabled) ::slotted(a:active) {
|
|
629
|
+
:host(.button-variant-secondary.light.disabled) ::slotted(a) {
|
|
673
630
|
border-color: var(--ic-architectural-500);
|
|
674
631
|
color: var(--ic-architectural-500);
|
|
675
|
-
background: none;
|
|
676
632
|
}
|
|
677
633
|
|
|
678
634
|
/* Tertiary */
|
|
@@ -682,19 +638,13 @@ video {
|
|
|
682
638
|
color: var(--button-default);
|
|
683
639
|
}
|
|
684
640
|
|
|
685
|
-
:host(.button-variant-tertiary) .button:hover
|
|
686
|
-
:host(.button-variant-tertiary)
|
|
687
|
-
:host(.button-variant-tertiary) ::slotted(a:hover:not(:focus)),
|
|
688
|
-
:host(.button-variant-tertiary) ::slotted(a:hover:focus) {
|
|
641
|
+
:host(.button-variant-tertiary) .button:hover,
|
|
642
|
+
:host(.button-variant-tertiary) ::slotted(a:hover) {
|
|
689
643
|
background-color: var(--button-default-background-hover);
|
|
690
644
|
color: var(--button-default-hover);
|
|
691
645
|
}
|
|
692
646
|
|
|
693
|
-
:host(.button-variant-tertiary) .button:active:not(:focus),
|
|
694
|
-
:host(.button-variant-tertiary) .button:active:focus,
|
|
695
647
|
:host(.button-variant-tertiary) .button:active,
|
|
696
|
-
:host(.button-variant-tertiary) ::slotted(a:active:not(:focus)),
|
|
697
|
-
:host(.button-variant-tertiary) ::slotted(a:active:focus),
|
|
698
648
|
:host(.button-variant-tertiary) ::slotted(a:active),
|
|
699
649
|
:host(.button-variant-tertiary.loading) .button {
|
|
700
650
|
background-color: var(--button-default-background-active);
|
|
@@ -702,43 +652,30 @@ video {
|
|
|
702
652
|
}
|
|
703
653
|
|
|
704
654
|
:host(.button-variant-tertiary.disabled) .button,
|
|
705
|
-
:host(.button-variant-tertiary.disabled)
|
|
706
|
-
:host(.button-variant-tertiary.disabled) .button:active,
|
|
707
|
-
:host(.button-variant-tertiary.disabled) ::slotted(a),
|
|
708
|
-
:host(.button-variant-tertiary.disabled) ::slotted(a:hover),
|
|
709
|
-
:host(.button-variant-tertiary.disabled) ::slotted(a:active) {
|
|
710
|
-
border-color: var(--ic-architectural-300);
|
|
655
|
+
:host(.button-variant-tertiary.disabled) ::slotted(a) {
|
|
711
656
|
color: var(--ic-architectural-300);
|
|
712
657
|
background: none;
|
|
713
658
|
}
|
|
714
659
|
|
|
715
660
|
:host(.button-variant-tertiary.light.disabled) .button,
|
|
716
|
-
:host(.button-variant-tertiary.light.disabled)
|
|
717
|
-
:host(.button-variant-tertiary.light.disabled) .button:active,
|
|
718
|
-
:host(.button-variant-tertiary.light.disabled) ::slotted(a),
|
|
719
|
-
:host(.button-variant-tertiary.light.disabled) ::slotted(a:hover),
|
|
720
|
-
:host(.button-variant-tertiary.light.disabled) ::slotted(a:active) {
|
|
721
|
-
border-color: var(--ic-architectural-500);
|
|
661
|
+
:host(.button-variant-tertiary.light.disabled) ::slotted(a) {
|
|
722
662
|
color: var(--ic-architectural-500);
|
|
723
|
-
background: none;
|
|
724
663
|
}
|
|
725
664
|
|
|
726
665
|
/* Destructive */
|
|
727
666
|
|
|
728
667
|
:host(.button-variant-destructive) .button,
|
|
729
668
|
:host(.button-variant-destructive) ::slotted(a) {
|
|
730
|
-
color: var(--ic-
|
|
669
|
+
color: var(--ic-color-white-text);
|
|
731
670
|
background-color: var(--ic-action-destructive);
|
|
732
671
|
text-transform: uppercase;
|
|
733
672
|
}
|
|
734
673
|
|
|
735
|
-
:host(.button-variant-destructive) .button:hover
|
|
736
|
-
:host(.button-variant-destructive) .button:hover:focus {
|
|
674
|
+
:host(.button-variant-destructive) .button:hover {
|
|
737
675
|
background-color: var(--ic-action-destructive-hover);
|
|
738
676
|
}
|
|
739
677
|
|
|
740
|
-
:host(.button-variant-destructive) .button:active
|
|
741
|
-
:host(.button-variant-destructive) .button:active:focus,
|
|
678
|
+
:host(.button-variant-destructive) .button:active,
|
|
742
679
|
:host(.button-variant-destructive.loading) .button {
|
|
743
680
|
background-color: var(--ic-action-destructive-active);
|
|
744
681
|
}
|
|
@@ -764,10 +701,8 @@ video {
|
|
|
764
701
|
height: var(--ic-space-lg) !important;
|
|
765
702
|
}
|
|
766
703
|
|
|
767
|
-
:host(.button-variant-icon) .button:hover
|
|
768
|
-
:host(.button-variant-icon)
|
|
769
|
-
:host(.button-variant-icon) ::slotted(a:hover:not(:focus)),
|
|
770
|
-
:host(.button-variant-icon) ::slotted(a:hover:focus) {
|
|
704
|
+
:host(.button-variant-icon) .button:hover,
|
|
705
|
+
:host(.button-variant-icon) ::slotted(a:hover) {
|
|
771
706
|
background-color: var(--button-default-background-hover);
|
|
772
707
|
color: var(--button-default-hover);
|
|
773
708
|
}
|
|
@@ -780,11 +715,7 @@ video {
|
|
|
780
715
|
}
|
|
781
716
|
|
|
782
717
|
:host(.button-variant-icon.disabled) .button,
|
|
783
|
-
:host(.button-variant-icon.disabled)
|
|
784
|
-
:host(.button-variant-icon.disabled) .button:active,
|
|
785
|
-
:host(.button-variant-icon.disabled) ::slotted(a),
|
|
786
|
-
:host(.button-variant-icon.disabled) ::slotted(a:hover),
|
|
787
|
-
:host(.button-variant-icon.disabled) ::slotted(a:active) {
|
|
718
|
+
:host(.button-variant-icon.disabled) ::slotted(a) {
|
|
788
719
|
color: var(--ic-architectural-300);
|
|
789
720
|
background: none;
|
|
790
721
|
}
|
|
@@ -797,7 +728,7 @@ video {
|
|
|
797
728
|
|
|
798
729
|
:host(.button-variant-icon-primary) .button,
|
|
799
730
|
:host(.button-variant-icon-primary) ::slotted(a) {
|
|
800
|
-
color: var(--ic-
|
|
731
|
+
color: var(--ic-color-white-text);
|
|
801
732
|
background-color: var(--button-default);
|
|
802
733
|
min-width: 0;
|
|
803
734
|
gap: var(--ic-space-xs);
|
|
@@ -809,21 +740,12 @@ video {
|
|
|
809
740
|
height: var(--ic-space-lg) !important;
|
|
810
741
|
}
|
|
811
742
|
|
|
812
|
-
:host(.button-variant-icon-primary) .button:hover
|
|
813
|
-
:host(.button-variant-icon-primary) ::slotted(a:hover
|
|
743
|
+
:host(.button-variant-icon-primary) .button:hover,
|
|
744
|
+
:host(.button-variant-icon-primary) ::slotted(a:hover) {
|
|
814
745
|
background-color: var(--button-default-hover);
|
|
815
746
|
}
|
|
816
|
-
:host(.button-variant-icon-primary) .button:hover:focus,
|
|
817
|
-
:host(.button-variant-icon-primary) ::slotted(a:hover:focus) {
|
|
818
|
-
background-color: var(--button-default-hover);
|
|
819
|
-
border-color: var(--button-default-hover);
|
|
820
|
-
}
|
|
821
747
|
|
|
822
|
-
:host(.button-variant-icon-primary) .button:active:not(:focus),
|
|
823
|
-
:host(.button-variant-icon-primary) .button:active:focus,
|
|
824
748
|
:host(.button-variant-icon-primary) .button:active,
|
|
825
|
-
:host(.button-variant-icon-primary) ::slotted(a:active:not(:focus)),
|
|
826
|
-
:host(.button-variant-icon-primary) ::slotted(a:active:focus),
|
|
827
749
|
:host(.button-variant-icon-primary) ::slotted(a:active),
|
|
828
750
|
:host(.button-variant-icon-primary.loading) .button {
|
|
829
751
|
background: var(--button-default-active);
|
|
@@ -833,17 +755,8 @@ video {
|
|
|
833
755
|
--inner-color: var(--ic-architectural-white);
|
|
834
756
|
}
|
|
835
757
|
|
|
836
|
-
:host(.button-variant-icon-primary:not(.light)) .button:active,
|
|
837
|
-
:host(.button-variant-icon-primary:not(.light)) ::slotted(a:active) {
|
|
838
|
-
color: var(--ic-architectural-white);
|
|
839
|
-
}
|
|
840
|
-
|
|
841
758
|
:host(.button-variant-icon-primary.disabled) .button,
|
|
842
|
-
:host(.button-variant-icon-primary.disabled)
|
|
843
|
-
:host(.button-variant-icon-primary.disabled) .button:active,
|
|
844
|
-
:host(.button-variant-icon-primary.disabled) ::slotted(a),
|
|
845
|
-
:host(.button-variant-icon-primary.disabled) ::slotted(a:hover),
|
|
846
|
-
:host(.button-variant-icon-primary.disabled) ::slotted(a:active) {
|
|
759
|
+
:host(.button-variant-icon-primary.disabled) ::slotted(a) {
|
|
847
760
|
color: var(--ic-architectural-300);
|
|
848
761
|
background: var(--ic-architectural-200);
|
|
849
762
|
}
|
|
@@ -853,11 +766,6 @@ video {
|
|
|
853
766
|
color: var(--ic-color-primary-text);
|
|
854
767
|
}
|
|
855
768
|
|
|
856
|
-
:host(.button-variant-icon-primary.light) .button,
|
|
857
|
-
:host(.button-variant-icon-primary.light) ::slotted(a) {
|
|
858
|
-
color: var(--ic-color-primary-text);
|
|
859
|
-
}
|
|
860
|
-
|
|
861
769
|
:host(.button-variant-icon-primary.light) .button:hover,
|
|
862
770
|
:host(.button-variant-icon-primary.light) ::slotted(a:hover) {
|
|
863
771
|
background: var(--ic-action-light-hover);
|
|
@@ -867,12 +775,7 @@ video {
|
|
|
867
775
|
:host(.button-variant-icon-primary.light) ::slotted(a:active),
|
|
868
776
|
:host(.button-variant-icon-primary.light.loading) .button,
|
|
869
777
|
:host(.button-variant-icon-primary.light.loading) ::slotted(a) {
|
|
870
|
-
background: var(--ic-
|
|
871
|
-
}
|
|
872
|
-
|
|
873
|
-
:host(.button-variant-icon-primary.dark) .button,
|
|
874
|
-
:host(.button-variant-icon-primary.dark) ::slotted(a) {
|
|
875
|
-
color: var(--ic-architectural-white);
|
|
778
|
+
background: var(--ic-action-light-active);
|
|
876
779
|
}
|
|
877
780
|
|
|
878
781
|
:host(.button-variant-icon-primary.dark) .button:hover,
|
|
@@ -903,29 +806,18 @@ video {
|
|
|
903
806
|
height: var(--ic-space-lg) !important;
|
|
904
807
|
}
|
|
905
808
|
|
|
906
|
-
:host(.button-variant-icon-secondary) .button:hover
|
|
907
|
-
:host(.button-variant-icon-secondary) ::slotted(a:hover
|
|
908
|
-
:host(.button-variant-icon-secondary) .button:hover:focus,
|
|
909
|
-
:host(.button-variant-icon-secondary) ::slotted(a:hover:focus) {
|
|
809
|
+
:host(.button-variant-icon-secondary) .button:hover,
|
|
810
|
+
:host(.button-variant-icon-secondary) ::slotted(a:hover) {
|
|
910
811
|
background-color: var(--button-default-background-hover);
|
|
911
812
|
border-color: var(--button-default-hover);
|
|
912
813
|
color: var(--button-default-hover);
|
|
913
814
|
}
|
|
914
815
|
|
|
915
|
-
:host(.button-variant-icon-secondary) .button:active:not(:focus),
|
|
916
|
-
:host(.button-variant-icon-secondary) .button:active:focus,
|
|
917
816
|
:host(.button-variant-icon-secondary) .button:active,
|
|
918
|
-
:host(.button-variant-icon-secondary) ::slotted(a:active
|
|
919
|
-
:host(.button-variant-icon-secondary) ::slotted(a:active:focus),
|
|
920
|
-
:host(.button-variant-icon-secondary) ::slotted(a:active) {
|
|
921
|
-
border-color: var(--button-default-active);
|
|
922
|
-
background-color: var(--button-default-background-active);
|
|
923
|
-
color: var(--button-default-active);
|
|
924
|
-
}
|
|
925
|
-
|
|
817
|
+
:host(.button-variant-icon-secondary) ::slotted(a:active),
|
|
926
818
|
:host(.button-variant-icon-secondary.loading) .button {
|
|
927
819
|
border-color: var(--button-default-active);
|
|
928
|
-
background: var(--button-default-background-active);
|
|
820
|
+
background-color: var(--button-default-background-active);
|
|
929
821
|
color: var(--button-default-active);
|
|
930
822
|
}
|
|
931
823
|
|
|
@@ -948,7 +840,6 @@ video {
|
|
|
948
840
|
:host(.button-variant-icon-secondary.light.disabled) ::slotted(a:active) {
|
|
949
841
|
border-color: var(--ic-architectural-500);
|
|
950
842
|
color: var(--ic-architectural-500);
|
|
951
|
-
background: none;
|
|
952
843
|
}
|
|
953
844
|
|
|
954
845
|
/* Icon-tertiary */
|
|
@@ -966,19 +857,13 @@ video {
|
|
|
966
857
|
height: var(--ic-space-lg) !important;
|
|
967
858
|
}
|
|
968
859
|
|
|
969
|
-
:host(.button-variant-icon-tertiary) .button:hover
|
|
970
|
-
:host(.button-variant-icon-tertiary)
|
|
971
|
-
:host(.button-variant-icon-tertiary) ::slotted(a:hover:not(:focus)),
|
|
972
|
-
:host(.button-variant-icon-tertiary) ::slotted(a:hover:focus) {
|
|
860
|
+
:host(.button-variant-icon-tertiary) .button:hover,
|
|
861
|
+
:host(.button-variant-icon-tertiary) ::slotted(a:hover) {
|
|
973
862
|
background-color: var(--button-default-background-hover);
|
|
974
863
|
color: var(--button-default-hover);
|
|
975
864
|
}
|
|
976
865
|
|
|
977
|
-
:host(.button-variant-icon-tertiary) .button:active:not(:focus),
|
|
978
|
-
:host(.button-variant-icon-tertiary) .button:active:focus,
|
|
979
866
|
:host(.button-variant-icon-tertiary) .button:active,
|
|
980
|
-
:host(.button-variant-icon-tertiary) ::slotted(a:active:not(:focus)),
|
|
981
|
-
:host(.button-variant-icon-tertiary) ::slotted(a:active:focus),
|
|
982
867
|
:host(.button-variant-icon-tertiary) ::slotted(a:active),
|
|
983
868
|
:host(.button-variant-icon-tertiary.loading) .button {
|
|
984
869
|
background-color: var(--button-default-background-active);
|
|
@@ -999,7 +884,7 @@ video {
|
|
|
999
884
|
|
|
1000
885
|
:host(.button-variant-icon-destructive) .button,
|
|
1001
886
|
:host(.button-variant-icon-destructive) ::slotted(a) {
|
|
1002
|
-
color: var(--ic-
|
|
887
|
+
color: var(--ic-color-white-text);
|
|
1003
888
|
background-color: var(--ic-action-destructive);
|
|
1004
889
|
min-width: 0;
|
|
1005
890
|
gap: var(--ic-space-xs);
|
|
@@ -1011,16 +896,13 @@ video {
|
|
|
1011
896
|
height: var(--ic-space-lg) !important;
|
|
1012
897
|
}
|
|
1013
898
|
|
|
1014
|
-
:host(.button-variant-icon-destructive) .button:hover
|
|
1015
|
-
:host(.button-variant-icon-destructive)
|
|
1016
|
-
:host(.button-variant-icon-destructive) ::slotted(a:hover:not(:focus)),
|
|
1017
|
-
:host(.button-variant-icon-destructive) ::slotted(a:hover:focus) {
|
|
899
|
+
:host(.button-variant-icon-destructive) .button:hover,
|
|
900
|
+
:host(.button-variant-icon-destructive) ::slotted(a:hover) {
|
|
1018
901
|
background-color: var(--ic-action-destructive-hover);
|
|
1019
902
|
}
|
|
1020
903
|
|
|
1021
|
-
:host(.button-variant-icon-destructive) .button:active
|
|
1022
|
-
:host(.button-variant-icon-destructive)
|
|
1023
|
-
:host(.button-variant-icon-destructive) ::slotted(a:active:not(:focus)),
|
|
904
|
+
:host(.button-variant-icon-destructive) .button:active,
|
|
905
|
+
:host(.button-variant-icon-destructive) ::slotted(a:active),
|
|
1024
906
|
:host(.button-variant-icon-destructive.loading) .button {
|
|
1025
907
|
background-color: var(--ic-action-destructive-active);
|
|
1026
908
|
}
|
|
@@ -1282,14 +1164,11 @@ slot[name="router-item"]::slotted(a) {
|
|
|
1282
1164
|
background-color: var(--button-default) !important;
|
|
1283
1165
|
}
|
|
1284
1166
|
|
|
1285
|
-
:host(.button-variant-primary) ::slotted(a:hover
|
|
1286
|
-
:host(.button-variant-primary) ::slotted(a:hover:focus) {
|
|
1167
|
+
:host(.button-variant-primary) ::slotted(a:hover) {
|
|
1287
1168
|
background-color: var(--button-default-hover) !important;
|
|
1288
1169
|
}
|
|
1289
1170
|
|
|
1290
|
-
:host(.button-variant-primary) ::slotted(a:active
|
|
1291
|
-
:host(.button-variant-primary) ::slotted(a:active),
|
|
1292
|
-
:host(.button-variant-primary) ::sloted(a:active:focus) {
|
|
1171
|
+
:host(.button-variant-primary) ::slotted(a:active) {
|
|
1293
1172
|
background-color: var(--button-default-active) !important;
|
|
1294
1173
|
}
|
|
1295
1174
|
|
|
@@ -1306,14 +1185,11 @@ slot[name="router-item"]::slotted(a) {
|
|
|
1306
1185
|
border: var(--ic-border-width) solid var(--button-default) !important;
|
|
1307
1186
|
}
|
|
1308
1187
|
|
|
1309
|
-
:host(.button-variant-secondary) ::slotted(a:hover
|
|
1310
|
-
:host(.button-variant-secondary) ::slotted(a:hover:focus) {
|
|
1188
|
+
:host(.button-variant-secondary) ::slotted(a:hover) {
|
|
1311
1189
|
background-color: var(--button-default-background-hover) !important;
|
|
1312
1190
|
border-color: var(--button-default-hover) !important;
|
|
1313
1191
|
}
|
|
1314
1192
|
|
|
1315
|
-
:host(.button-variant-secondary) ::slotted(a:active:not(:focus)),
|
|
1316
|
-
:host(.button-variant-secondary) ::slotted(a:active:focus),
|
|
1317
1193
|
:host(.button-variant-secondary) ::slotted(a:active) {
|
|
1318
1194
|
border-color: var(--button-default-active) !important;
|
|
1319
1195
|
background-color: var(--button-default-background-active) !important;
|
|
@@ -1336,13 +1212,10 @@ slot[name="router-item"]::slotted(a) {
|
|
|
1336
1212
|
:host(.button-variant-tertiary.light.disabled) ::slotted(a:hover),
|
|
1337
1213
|
:host(.button-variant-tertiary.light.disabled) ::slotted(a:active) {
|
|
1338
1214
|
border-color: var(--ic-architectural-500) !important;
|
|
1339
|
-
background: none !important;
|
|
1340
1215
|
}
|
|
1341
1216
|
|
|
1342
|
-
:host(.button-variant-tertiary) ::slotted(a:hover
|
|
1343
|
-
:host(.button-variant-
|
|
1344
|
-
:host(.button-variant-icon) ::slotted(a:hover:not(:focus)),
|
|
1345
|
-
:host(.button-variant-icon) ::slotted(a:hover:focus) {
|
|
1217
|
+
:host(.button-variant-tertiary) ::slotted(a:hover),
|
|
1218
|
+
:host(.button-variant-icon) ::slotted(a:hover) {
|
|
1346
1219
|
background-color: var(--button-default-background-hover) !important;
|
|
1347
1220
|
}
|
|
1348
1221
|
|
|
@@ -1363,13 +1236,11 @@ slot[name="router-item"]::slotted(a) {
|
|
|
1363
1236
|
background-color: var(--ic-action-destructive) !important;
|
|
1364
1237
|
}
|
|
1365
1238
|
|
|
1366
|
-
:host(.button-variant-destructive) ::slotted(a:hover
|
|
1367
|
-
:host(.button-variant-destructive) ::slotted(a:hover:focus) {
|
|
1239
|
+
:host(.button-variant-destructive) ::slotted(a:hover) {
|
|
1368
1240
|
background-color: var(--ic-action-destructive-hover) !important;
|
|
1369
1241
|
}
|
|
1370
1242
|
|
|
1371
|
-
:host(.button-variant-destructive) ::slotted(a:active
|
|
1372
|
-
:host(.button-variant-destructive) ::slotted(a:active:focus) {
|
|
1243
|
+
:host(.button-variant-destructive) ::slotted(a:active) {
|
|
1373
1244
|
background-color: var(--ic-action-destructive-active) !important;
|
|
1374
1245
|
}
|
|
1375
1246
|
|
|
@@ -8,6 +8,9 @@ export class Checkbox {
|
|
|
8
8
|
constructor() {
|
|
9
9
|
this.handleClick = () => {
|
|
10
10
|
this.checked = !this.checked;
|
|
11
|
+
this.displayIndeterminate = this.nativeIndeterminateBehaviour
|
|
12
|
+
? false
|
|
13
|
+
: this.indeterminate && this.checked;
|
|
11
14
|
this.icCheck.emit();
|
|
12
15
|
this.checkboxChecked.emit();
|
|
13
16
|
};
|
|
@@ -27,11 +30,19 @@ export class Checkbox {
|
|
|
27
30
|
this.formtarget = undefined;
|
|
28
31
|
this.groupLabel = undefined;
|
|
29
32
|
this.indeterminate = false;
|
|
33
|
+
this.displayIndeterminate = this.indeterminate;
|
|
30
34
|
this.label = undefined;
|
|
31
35
|
this.name = undefined;
|
|
36
|
+
this.nativeIndeterminateBehaviour = false;
|
|
32
37
|
this.size = undefined;
|
|
33
38
|
this.small = false;
|
|
34
39
|
this.value = undefined;
|
|
40
|
+
this.hideLabel = false;
|
|
41
|
+
}
|
|
42
|
+
watchIndeterminateHandler() {
|
|
43
|
+
this.displayIndeterminate = this.nativeIndeterminateBehaviour
|
|
44
|
+
? this.indeterminate
|
|
45
|
+
: this.indeterminate && this.checked;
|
|
35
46
|
}
|
|
36
47
|
componentWillLoad() {
|
|
37
48
|
removeDisabledFalse(this.disabled, this.el);
|
|
@@ -76,7 +87,7 @@ export class Checkbox {
|
|
|
76
87
|
(_a = this.el.shadowRoot.querySelector(".checkbox")) === null || _a === void 0 ? void 0 : _a.focus();
|
|
77
88
|
}
|
|
78
89
|
render() {
|
|
79
|
-
const { additionalFieldDisplay, checked, disabled, dynamicText, el, form, formaction, formenctype, formmethod, formnovalidate, formtarget,
|
|
90
|
+
const { additionalFieldDisplay, checked, disabled, dynamicText, el, form, formaction, formenctype, formmethod, formnovalidate, formtarget, displayIndeterminate, groupLabel, label, name, size, small, value, } = this;
|
|
80
91
|
const id = `ic-checkbox-${isPropDefined(label) || value}-${groupLabel}`.replace(/ /g, "-");
|
|
81
92
|
const parentElementSize = el.parentElement
|
|
82
93
|
.size;
|
|
@@ -87,12 +98,11 @@ export class Checkbox {
|
|
|
87
98
|
disabled,
|
|
88
99
|
small,
|
|
89
100
|
[`${size || parentElementSize}`]: true,
|
|
90
|
-
} }, h("div", { class: "container" }, checked &&
|
|
91
|
-
(!indeterminate ? (h("svg", { class: "checkmark", width: "1.5rem", height: "1.5rem", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", "fill-rule": "evenodd", "clip-rule": "evenodd" }, h("title", null, "checkmark icon"), h("path", { d: "M21 6.285l-11.16 12.733-6.84-6.018 1.319-1.49 5.341 4.686 9.865-11.196 1.475 1.285z" }))) : (h("div", { class: "indeterminate-symbol" }))), h("input", { role: "checkbox", class: {
|
|
101
|
+
} }, h("div", { class: "container" }, displayIndeterminate && h("div", { class: "indeterminate-symbol" }), !displayIndeterminate && checked && (h("svg", { class: "checkmark", width: "1.5rem", height: "1.5rem", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", "fill-rule": "evenodd", "clip-rule": "evenodd" }, h("title", null, "checkmark icon"), h("path", { d: "M21 6.285l-11.16 12.733-6.84-6.018 1.319-1.49 5.341 4.686 9.865-11.196 1.475 1.285z" }))), h("input", { role: "checkbox", class: {
|
|
92
102
|
checkbox: true,
|
|
93
103
|
checked,
|
|
94
|
-
indeterminate,
|
|
95
|
-
}, type: "checkbox", name: name, id: id, value: value, disabled: disabled ? true : null, checked: checked, indeterminate:
|
|
104
|
+
indeterminate: displayIndeterminate,
|
|
105
|
+
}, type: "checkbox", name: name, id: id, value: value, disabled: disabled ? true : null, checked: checked, indeterminate: displayIndeterminate, onClick: this.handleClick, form: form, formaction: formaction, formenctype: formenctype, formmethod: formmethod, formnovalidate: formnovalidate, formtarget: formtarget, "aria-label": this.hideLabel ? this.label : undefined }), !this.hideLabel && (h("ic-typography", { class: "checkbox-label", variant: "body" }, h("label", { htmlFor: id }, label)))), isSlotUsed(el, "additional-field") && (h("div", { class: "dynamic-container", ref: (el) => (this.additionalFieldContainer = el) }, additionalFieldDisplay === "dynamic" && (h("div", { class: "branch-corner" })), h("div", null, additionalFieldDisplay === "dynamic" && (h("ic-typography", { variant: "caption" }, h("p", { class: "dynamic-text", "aria-live": "polite" }, dynamicText))), h("div", { class: {
|
|
96
106
|
"additional-field-wrapper": additionalFieldDisplay === "static",
|
|
97
107
|
} }, h("slot", { name: "additional-field" })))))));
|
|
98
108
|
}
|
|
@@ -293,7 +303,7 @@ export class Checkbox {
|
|
|
293
303
|
},
|
|
294
304
|
"groupLabel": {
|
|
295
305
|
"type": "string",
|
|
296
|
-
"mutable":
|
|
306
|
+
"mutable": true,
|
|
297
307
|
"complexType": {
|
|
298
308
|
"original": "string",
|
|
299
309
|
"resolved": "string",
|
|
@@ -345,7 +355,7 @@ export class Checkbox {
|
|
|
345
355
|
},
|
|
346
356
|
"name": {
|
|
347
357
|
"type": "string",
|
|
348
|
-
"mutable":
|
|
358
|
+
"mutable": true,
|
|
349
359
|
"complexType": {
|
|
350
360
|
"original": "string",
|
|
351
361
|
"resolved": "string",
|
|
@@ -360,6 +370,24 @@ export class Checkbox {
|
|
|
360
370
|
"attribute": "name",
|
|
361
371
|
"reflect": false
|
|
362
372
|
},
|
|
373
|
+
"nativeIndeterminateBehaviour": {
|
|
374
|
+
"type": "boolean",
|
|
375
|
+
"mutable": false,
|
|
376
|
+
"complexType": {
|
|
377
|
+
"original": "boolean",
|
|
378
|
+
"resolved": "boolean",
|
|
379
|
+
"references": {}
|
|
380
|
+
},
|
|
381
|
+
"required": false,
|
|
382
|
+
"optional": false,
|
|
383
|
+
"docs": {
|
|
384
|
+
"tags": [],
|
|
385
|
+
"text": "If `true`, the checkbox will behave like a native checkbox where the `indeterminate` prop sets the indeterminate visual styling, independent of the `checked` state."
|
|
386
|
+
},
|
|
387
|
+
"attribute": "native-indeterminate-behaviour",
|
|
388
|
+
"reflect": false,
|
|
389
|
+
"defaultValue": "false"
|
|
390
|
+
},
|
|
363
391
|
"size": {
|
|
364
392
|
"type": "string",
|
|
365
393
|
"mutable": false,
|
|
@@ -420,12 +448,31 @@ export class Checkbox {
|
|
|
420
448
|
},
|
|
421
449
|
"attribute": "value",
|
|
422
450
|
"reflect": false
|
|
451
|
+
},
|
|
452
|
+
"hideLabel": {
|
|
453
|
+
"type": "boolean",
|
|
454
|
+
"mutable": false,
|
|
455
|
+
"complexType": {
|
|
456
|
+
"original": "boolean",
|
|
457
|
+
"resolved": "boolean",
|
|
458
|
+
"references": {}
|
|
459
|
+
},
|
|
460
|
+
"required": false,
|
|
461
|
+
"optional": false,
|
|
462
|
+
"docs": {
|
|
463
|
+
"tags": [],
|
|
464
|
+
"text": "If `true`, the label will be hidden and the required label value will be applied as an aria-label."
|
|
465
|
+
},
|
|
466
|
+
"attribute": "hide-label",
|
|
467
|
+
"reflect": false,
|
|
468
|
+
"defaultValue": "false"
|
|
423
469
|
}
|
|
424
470
|
};
|
|
425
471
|
}
|
|
426
472
|
static get states() {
|
|
427
473
|
return {
|
|
428
|
-
"initiallyChecked": {}
|
|
474
|
+
"initiallyChecked": {},
|
|
475
|
+
"displayIndeterminate": {}
|
|
429
476
|
};
|
|
430
477
|
}
|
|
431
478
|
static get events() {
|
|
@@ -490,5 +537,11 @@ export class Checkbox {
|
|
|
490
537
|
};
|
|
491
538
|
}
|
|
492
539
|
static get elementRef() { return "el"; }
|
|
540
|
+
static get watchers() {
|
|
541
|
+
return [{
|
|
542
|
+
"propName": "indeterminate",
|
|
543
|
+
"methodName": "watchIndeterminateHandler"
|
|
544
|
+
}];
|
|
545
|
+
}
|
|
493
546
|
}
|
|
494
547
|
//# sourceMappingURL=ic-checkbox.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ic-checkbox.js","sourceRoot":"","sources":["../../../src/components/ic-checkbox/ic-checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,IAAI,EACJ,CAAC,EACD,IAAI,EACJ,OAAO,EACP,KAAK,EAEL,KAAK,EACL,MAAM,GACP,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,UAAU,EACV,gCAAgC,EAChC,iBAAiB,EACjB,iBAAiB,EACjB,oBAAoB,EACpB,uBAAuB,EACvB,mBAAmB,EACnB,aAAa,GACd,MAAM,qBAAqB,CAAC;AAE7B;;GAEG;AAQH,6DAA6D;AAC7D,MAAM,OAAO,QAAQ;;QAwJX,gBAAW,GAAG,GAAG,EAAE;YACzB,IAAI,CAAC,OAAO,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC;YAC7B,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;YACpB,IAAI,CAAC,eAAe,CAAC,IAAI,EAAE,CAAC;QAC9B,CAAC,CAAC;QAEM,oBAAe,GAAG,GAAS,EAAE;YACnC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,gBA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AS,IAAI,CACvC,qBAAe,OAAO,EAAC,SAAS;wBAC9B,SAAG,KAAK,EAAC,cAAc,eAAW,QAAQ,IACvC,WAAW,CACV,CACU,CACjB;oBACD,WACE,KAAK,EAAE;4BACL,0BAA0B,EACxB,sBAAsB,KAAK,QAAQ;yBACtC;wBAED,YAAM,IAAI,EAAC,kBAAkB,GAAQ,CACjC,CACF,CACF,CACP,CACI,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n Component,\n Host,\n h,\n Prop,\n Element,\n Event,\n EventEmitter,\n State,\n Method,\n} from \"@stencil/core\";\nimport { IcAdditionalFieldTypes, IcSizes } from \"../../utils/types\";\nimport {\n isSlotUsed,\n onComponentRequiredPropUndefined,\n renderHiddenInput,\n removeHiddenInput,\n addFormResetListener,\n removeFormResetListener,\n removeDisabledFalse,\n isPropDefined,\n} from \"../../utils/helpers\";\n\n/**\n * @slot additional-field - Content to be displayed alongside a checkbox.\n */\n@Component({\n tag: \"ic-checkbox\",\n styleUrl: \"ic-checkbox.css\",\n shadow: {\n delegatesFocus: true,\n },\n})\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport class Checkbox {\n private additionalFieldContainer: HTMLDivElement;\n\n @Element() el: HTMLIcCheckboxElement;\n\n /**\n * The style of additionalField that will be displayed if used.\n */\n @Prop({ reflect: true }) additionalFieldDisplay: IcAdditionalFieldTypes =\n \"static\";\n\n /**\n * If `true`, the checkbox will be set to the checked state.\n */\n @Prop({ reflect: true, mutable: true }) checked?: boolean = false;\n @State() initiallyChecked = this.checked;\n\n /**\n * If `true`, the checkbox will be set to the disabled state.\n */\n @Prop() disabled?: boolean = false;\n\n /**\n * The text to be displayed when dynamic.\n */\n\n @Prop() dynamicText: string = \"This selection requires additional answers\";\n\n /**\n * The <form> element to associate the checkbox with.\n */\n @Prop() form?: string;\n\n /**\n * The URL that processes the information submitted by the checkbox. It overrides the action attribute of the checkbox's form owner. Does nothing if there is no form owner.\n */\n @Prop() formaction?: string;\n\n /**\n * The way the submitted form data is encoded.\n */\n @Prop() formenctype?: string;\n\n /**\n * The HTTP method used to submit the form.\n */\n @Prop() formmethod?: string;\n\n /**\n * If `true`, the form will not be validated when submitted.\n */\n @Prop() formnovalidate?: boolean;\n\n /**\n * The place to display the response from submitting the form. It overrides the target attribute of the checkbox's form owner.\n */\n @Prop() formtarget?: string;\n\n /**\n * The group label for the checkbox.\n */\n @Prop() groupLabel: string;\n\n /**\n * If `true`, the indeterminate state will be displayed when checked.\n */\n @Prop() indeterminate: boolean = false;\n\n /**\n * The label for the checkbox.\n */\n @Prop() label!: string;\n\n /**\n * The name for the checkbox. If not set when used in a checkbox group, the name will be based on the group name.\n */\n @Prop() name: string;\n\n /**\n * The size of the checkbox to be displayed. This does not affect the font size of the label. If a checkbox is contained in a checkbox group, this will override the size set on checkbox group.\n */\n @Prop() size?: IcSizes;\n\n /**\n * @deprecated This prop should not be used anymore. Set prop `size` to \"small\" instead.\n */\n @Prop() small?: boolean = false;\n\n /**\n * The value for the checkbox.\n */\n @Prop() value!: string;\n\n /**\n * @deprecated This event should not be used anymore. Use icCheck instead.\n */\n @Event() checkboxChecked: EventEmitter<void>;\n\n /**\n * Emitted when a checkbox has been checked.\n */\n @Event() icCheck: EventEmitter<void>;\n\n componentWillLoad(): void {\n removeDisabledFalse(this.disabled, this.el);\n\n addFormResetListener(this.el, this.handleFormReset);\n\n const checkboxGroup = this.el.parentElement as HTMLIcCheckboxGroupElement;\n if (checkboxGroup) {\n if (!this.name) this.name = checkboxGroup.name;\n this.groupLabel = checkboxGroup.label;\n }\n }\n\n componentDidLoad(): void {\n onComponentRequiredPropUndefined(\n [\n { prop: this.label, propName: \"label\" },\n { prop: this.value, propName: \"value\" },\n ],\n \"Checkbox\"\n );\n }\n\n componentDidRender(): void {\n if (this.additionalFieldDisplay === \"static\") {\n const textfield = this.el.querySelector(\"ic-text-field\");\n if (!this.checked) {\n textfield?.setAttribute(\"disabled\", \"\");\n } else {\n textfield?.removeAttribute(\"disabled\");\n }\n } else if (this.additionalFieldContainer) {\n this.additionalFieldContainer.style.display = !this.checked\n ? \"none\"\n : \"flex\";\n }\n }\n\n disconnectedCallback(): void {\n removeFormResetListener(this.el, this.handleFormReset);\n }\n\n /**\n * Sets focus on the checkbox.\n */\n @Method()\n async setFocus(): Promise<void> {\n this.el.shadowRoot.querySelector<HTMLElement>(\".checkbox\")?.focus();\n }\n\n private handleClick = () => {\n this.checked = !this.checked;\n this.icCheck.emit();\n this.checkboxChecked.emit();\n };\n\n private handleFormReset = (): void => {\n this.checked = this.initiallyChecked;\n };\n\n render() {\n const {\n additionalFieldDisplay,\n checked,\n disabled,\n dynamicText,\n el,\n form,\n formaction,\n formenctype,\n formmethod,\n formnovalidate,\n formtarget,\n indeterminate,\n groupLabel,\n label,\n name,\n size,\n small,\n value,\n } = this;\n\n const id = `ic-checkbox-${\n isPropDefined(label) || value\n }-${groupLabel}`.replace(/ /g, \"-\");\n\n const parentElementSize = (el.parentElement as HTMLIcCheckboxGroupElement)\n .size;\n\n checked\n ? renderHiddenInput(true, el, name, checked && value, disabled)\n : removeHiddenInput(el);\n\n return (\n <Host\n class={{\n disabled,\n small,\n [`${size || parentElementSize}`]: true,\n }}\n >\n <div class=\"container\">\n {checked &&\n (!indeterminate ? (\n <svg\n class=\"checkmark\"\n width=\"1.5rem\"\n height=\"1.5rem\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n >\n <title>checkmark icon</title>\n <path d=\"M21 6.285l-11.16 12.733-6.84-6.018 1.319-1.49 5.341 4.686 9.865-11.196 1.475 1.285z\" />\n </svg>\n ) : (\n <div class=\"indeterminate-symbol\" />\n ))}\n <input\n role=\"checkbox\"\n class={{\n checkbox: true,\n checked,\n indeterminate,\n }}\n type=\"checkbox\"\n name={name}\n id={id}\n value={value}\n disabled={disabled ? true : null}\n checked={checked}\n indeterminate={indeterminate}\n onClick={this.handleClick}\n form={form}\n formaction={formaction}\n formenctype={formenctype}\n formmethod={formmethod}\n formnovalidate={formnovalidate}\n formtarget={formtarget}\n ></input>\n <ic-typography class=\"checkbox-label\" variant=\"body\">\n <label htmlFor={id}>{label}</label>\n </ic-typography>\n </div>\n {isSlotUsed(el, \"additional-field\") && (\n <div\n class=\"dynamic-container\"\n ref={(el) => (this.additionalFieldContainer = el)}\n >\n {additionalFieldDisplay === \"dynamic\" && (\n <div class=\"branch-corner\"></div>\n )}\n <div>\n {additionalFieldDisplay === \"dynamic\" && (\n <ic-typography variant=\"caption\">\n <p class=\"dynamic-text\" aria-live=\"polite\">\n {dynamicText}\n </p>\n </ic-typography>\n )}\n <div\n class={{\n \"additional-field-wrapper\":\n additionalFieldDisplay === \"static\",\n }}\n >\n <slot name=\"additional-field\"></slot>\n </div>\n </div>\n </div>\n )}\n </Host>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ic-checkbox.js","sourceRoot":"","sources":["../../../src/components/ic-checkbox/ic-checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,IAAI,EACJ,CAAC,EACD,IAAI,EACJ,OAAO,EACP,KAAK,EAEL,KAAK,EACL,MAAM,EACN,KAAK,GACN,MAAM,eAAe,C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ACF,CACP,CACI,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n Component,\n Host,\n h,\n Prop,\n Element,\n Event,\n EventEmitter,\n State,\n Method,\n Watch,\n} from \"@stencil/core\";\nimport { IcAdditionalFieldTypes, IcSizes } from \"../../utils/types\";\nimport {\n isSlotUsed,\n onComponentRequiredPropUndefined,\n renderHiddenInput,\n removeHiddenInput,\n addFormResetListener,\n removeFormResetListener,\n removeDisabledFalse,\n isPropDefined,\n} from \"../../utils/helpers\";\n\n/**\n * @slot additional-field - Content to be displayed alongside a checkbox.\n */\n@Component({\n tag: \"ic-checkbox\",\n styleUrl: \"ic-checkbox.css\",\n shadow: {\n delegatesFocus: true,\n },\n})\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport class Checkbox {\n private additionalFieldContainer: HTMLDivElement;\n\n @Element() el: HTMLIcCheckboxElement;\n\n /**\n * The style of additionalField that will be displayed if used.\n */\n @Prop({ reflect: true }) additionalFieldDisplay: IcAdditionalFieldTypes =\n \"static\";\n\n /**\n * If `true`, the checkbox will be set to the checked state.\n */\n @Prop({ reflect: true, mutable: true }) checked?: boolean = false;\n @State() initiallyChecked = this.checked;\n\n /**\n * If `true`, the checkbox will be set to the disabled state.\n */\n @Prop() disabled?: boolean = false;\n\n /**\n * The text to be displayed when dynamic.\n */\n\n @Prop() dynamicText: string = \"This selection requires additional answers\";\n\n /**\n * The <form> element to associate the checkbox with.\n */\n @Prop() form?: string;\n\n /**\n * The URL that processes the information submitted by the checkbox. It overrides the action attribute of the checkbox's form owner. Does nothing if there is no form owner.\n */\n @Prop() formaction?: string;\n\n /**\n * The way the submitted form data is encoded.\n */\n @Prop() formenctype?: string;\n\n /**\n * The HTTP method used to submit the form.\n */\n @Prop() formmethod?: string;\n\n /**\n * If `true`, the form will not be validated when submitted.\n */\n @Prop() formnovalidate?: boolean;\n\n /**\n * The place to display the response from submitting the form. It overrides the target attribute of the checkbox's form owner.\n */\n @Prop() formtarget?: string;\n\n /**\n * The group label for the checkbox.\n */\n @Prop({ mutable: true }) groupLabel: string;\n\n /**\n * If `true`, the indeterminate state will be displayed when checked.\n */\n @Prop() indeterminate: boolean = false;\n @State() displayIndeterminate = this.indeterminate;\n\n @Watch(\"indeterminate\")\n watchIndeterminateHandler(): void {\n this.displayIndeterminate = this.nativeIndeterminateBehaviour\n ? this.indeterminate\n : this.indeterminate && this.checked;\n }\n\n /**\n * The label for the checkbox.\n */\n @Prop() label!: string;\n\n /**\n * The name for the checkbox. If not set when used in a checkbox group, the name will be based on the group name.\n */\n @Prop({ mutable: true }) name: string;\n\n /**\n * If `true`, the checkbox will behave like a native checkbox where the `indeterminate` prop sets the indeterminate visual styling, independent of the `checked` state.\n */\n @Prop() nativeIndeterminateBehaviour: boolean = false;\n\n /**\n * The size of the checkbox to be displayed. This does not affect the font size of the label. If a checkbox is contained in a checkbox group, this will override the size set on checkbox group.\n */\n @Prop() size?: IcSizes;\n\n /**\n * @deprecated This prop should not be used anymore. Set prop `size` to \"small\" instead.\n */\n @Prop() small?: boolean = false;\n\n /**\n * The value for the checkbox.\n */\n @Prop() value!: string;\n\n /**\n * If `true`, the label will be hidden and the required label value will be applied as an aria-label.\n */\n @Prop() hideLabel = false;\n\n /**\n * @deprecated This event should not be used anymore. Use icCheck instead.\n */\n @Event() checkboxChecked: EventEmitter<void>;\n\n /**\n * Emitted when a checkbox has been checked.\n */\n @Event() icCheck: EventEmitter<void>;\n\n componentWillLoad(): void {\n removeDisabledFalse(this.disabled, this.el);\n\n addFormResetListener(this.el, this.handleFormReset);\n\n const checkboxGroup = this.el.parentElement as HTMLIcCheckboxGroupElement;\n if (checkboxGroup) {\n if (!this.name) this.name = checkboxGroup.name;\n this.groupLabel = checkboxGroup.label;\n }\n }\n\n componentDidLoad(): void {\n onComponentRequiredPropUndefined(\n [\n { prop: this.label, propName: \"label\" },\n { prop: this.value, propName: \"value\" },\n ],\n \"Checkbox\"\n );\n }\n\n componentDidRender(): void {\n if (this.additionalFieldDisplay === \"static\") {\n const textfield = this.el.querySelector(\"ic-text-field\");\n if (!this.checked) {\n textfield?.setAttribute(\"disabled\", \"\");\n } else {\n textfield?.removeAttribute(\"disabled\");\n }\n } else if (this.additionalFieldContainer) {\n this.additionalFieldContainer.style.display = !this.checked\n ? \"none\"\n : \"flex\";\n }\n }\n\n disconnectedCallback(): void {\n removeFormResetListener(this.el, this.handleFormReset);\n }\n\n /**\n * Sets focus on the checkbox.\n */\n @Method()\n async setFocus(): Promise<void> {\n this.el.shadowRoot.querySelector<HTMLElement>(\".checkbox\")?.focus();\n }\n\n private handleClick = () => {\n this.checked = !this.checked;\n this.displayIndeterminate = this.nativeIndeterminateBehaviour\n ? false\n : this.indeterminate && this.checked;\n this.icCheck.emit();\n this.checkboxChecked.emit();\n };\n\n private handleFormReset = (): void => {\n this.checked = this.initiallyChecked;\n };\n\n render() {\n const {\n additionalFieldDisplay,\n checked,\n disabled,\n dynamicText,\n el,\n form,\n formaction,\n formenctype,\n formmethod,\n formnovalidate,\n formtarget,\n displayIndeterminate,\n groupLabel,\n label,\n name,\n size,\n small,\n value,\n } = this;\n\n const id = `ic-checkbox-${\n isPropDefined(label) || value\n }-${groupLabel}`.replace(/ /g, \"-\");\n\n const parentElementSize = (el.parentElement as HTMLIcCheckboxGroupElement)\n .size;\n\n checked\n ? renderHiddenInput(true, el, name, checked && value, disabled)\n : removeHiddenInput(el);\n\n return (\n <Host\n class={{\n disabled,\n small,\n [`${size || parentElementSize}`]: true,\n }}\n >\n <div class=\"container\">\n {displayIndeterminate && <div class=\"indeterminate-symbol\" />}\n {!displayIndeterminate && checked && (\n <svg\n class=\"checkmark\"\n width=\"1.5rem\"\n height=\"1.5rem\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n >\n <title>checkmark icon</title>\n <path d=\"M21 6.285l-11.16 12.733-6.84-6.018 1.319-1.49 5.341 4.686 9.865-11.196 1.475 1.285z\" />\n </svg>\n )}\n <input\n role=\"checkbox\"\n class={{\n checkbox: true,\n checked,\n indeterminate: displayIndeterminate,\n }}\n type=\"checkbox\"\n name={name}\n id={id}\n value={value}\n disabled={disabled ? true : null}\n checked={checked}\n indeterminate={displayIndeterminate}\n onClick={this.handleClick}\n form={form}\n formaction={formaction}\n formenctype={formenctype}\n formmethod={formmethod}\n formnovalidate={formnovalidate}\n formtarget={formtarget}\n aria-label={this.hideLabel ? this.label : undefined}\n ></input>\n {!this.hideLabel && (\n <ic-typography class=\"checkbox-label\" variant=\"body\">\n <label htmlFor={id}>{label}</label>\n </ic-typography>\n )}\n </div>\n {isSlotUsed(el, \"additional-field\") && (\n <div\n class=\"dynamic-container\"\n ref={(el) => (this.additionalFieldContainer = el)}\n >\n {additionalFieldDisplay === \"dynamic\" && (\n <div class=\"branch-corner\"></div>\n )}\n <div>\n {additionalFieldDisplay === \"dynamic\" && (\n <ic-typography variant=\"caption\">\n <p class=\"dynamic-text\" aria-live=\"polite\">\n {dynamicText}\n </p>\n </ic-typography>\n )}\n <div\n class={{\n \"additional-field-wrapper\":\n additionalFieldDisplay === \"static\",\n }}\n >\n <slot name=\"additional-field\"></slot>\n </div>\n </div>\n </div>\n )}\n </Host>\n );\n }\n}\n"]}
|