@watermarkinsights/ripple 5.15.0-alpha.2 → 5.15.0-alpha.4
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/{app-globals-07a183eb.js → app-globals-ac327e5e.js} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/ripple.cjs.js +1 -1
- package/dist/cjs/wm-button.cjs.entry.js +77 -11
- package/dist/cjs/wm-toggletip.cjs.entry.js +5 -5
- package/dist/cjs/wm-uploader.cjs.entry.js +1 -1
- package/dist/collection/components/wm-button/wm-button.css +198 -12
- package/dist/collection/components/wm-button/wm-button.js +77 -11
- package/dist/collection/components/wm-toggletip/wm-toggletip.css +6 -6
- package/dist/collection/components/wm-toggletip/wm-toggletip.js +4 -4
- package/dist/collection/components/wm-uploader/wm-uploader.css +198 -12
- package/dist/esm/{app-globals-abcc4b57.js → app-globals-c670e9b4.js} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/ripple.js +1 -1
- package/dist/esm/wm-button.entry.js +77 -11
- package/dist/esm/wm-toggletip.entry.js +5 -5
- package/dist/esm/wm-uploader.entry.js +1 -1
- package/dist/esm-es5/{app-globals-abcc4b57.js → app-globals-c670e9b4.js} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/ripple.js +1 -1
- package/dist/esm-es5/wm-button.entry.js +1 -1
- package/dist/esm-es5/wm-toggletip.entry.js +1 -1
- package/dist/esm-es5/wm-uploader.entry.js +1 -1
- package/dist/ripple/{p-d0cf99ea.js → p-27bae047.js} +1 -1
- package/dist/ripple/p-2de38730.entry.js +1 -0
- package/dist/ripple/{p-bacccb48.system.js → p-33dc6883.system.js} +1 -1
- package/dist/ripple/{p-9a87f3a0.system.js → p-50145994.system.js} +1 -1
- package/dist/ripple/{p-4f156fee.system.entry.js → p-53fef577.system.entry.js} +1 -1
- package/dist/ripple/p-cfcd001c.system.entry.js +1 -0
- package/dist/ripple/p-e08c4a29.system.entry.js +1 -0
- package/dist/ripple/p-ed23fd68.entry.js +1 -0
- package/dist/ripple/p-fe5059fe.entry.js +1 -0
- package/dist/ripple/ripple.esm.js +1 -1
- package/dist/ripple/ripple.js +1 -1
- package/dist/types/components/wm-button/wm-button.d.ts +5 -0
- package/dist/types/global/interfaces.d.ts +1 -1
- package/package.json +2 -2
- package/dist/ripple/p-6ab4e970.entry.js +0 -1
- package/dist/ripple/p-6d248f1b.entry.js +0 -1
- package/dist/ripple/p-8c19079b.entry.js +0 -1
- package/dist/ripple/p-8f70cd7d.system.entry.js +0 -1
- package/dist/ripple/p-c0f72da2.system.entry.js +0 -1
|
@@ -191,9 +191,7 @@
|
|
|
191
191
|
:host .wm-button:not(.-icononly):not(.-navigational) .mdi,
|
|
192
192
|
:host .wm-button:not(.-icononly):not(.-navigational) .svg-icon {
|
|
193
193
|
display: inline-block;
|
|
194
|
-
|
|
195
|
-
font-size: 0.875rem;
|
|
196
|
-
width: var(--icon-size, 14px);
|
|
194
|
+
font-size: var(--icon-size, 14px);
|
|
197
195
|
height: var(--icon-size, 14px);
|
|
198
196
|
}
|
|
199
197
|
:host .wm-button.-primary:not(.-textonly) {
|
|
@@ -203,7 +201,7 @@
|
|
|
203
201
|
:host .wm-button.-primary:not(.-textonly):not(:focus) {
|
|
204
202
|
box-shadow: 0 0 4px 0 rgba(0, 0, 0, 0.14), 0 3px 4px 0 rgba(0, 0, 0, 0.12), 0 1px 5px 0 rgba(0, 0, 0, 0.2);
|
|
205
203
|
}
|
|
206
|
-
:host .wm-button.-primary:not(.-textonly):hover:not(:disabled):not(.disabled) {
|
|
204
|
+
:host .wm-button.-primary:not(.-textonly):hover:not(:disabled):not(.disabled):not(.ai) {
|
|
207
205
|
background: var(--wmcolor-button-background-primary-hover);
|
|
208
206
|
}
|
|
209
207
|
:host .wm-button.-primary:not(.-textonly).dark:not(:disabled):not(.disabled) {
|
|
@@ -218,7 +216,7 @@
|
|
|
218
216
|
border: 2px solid var(--wmcolor-button-border-secondary);
|
|
219
217
|
background: var(--wmcolor-button-background-secondary);
|
|
220
218
|
}
|
|
221
|
-
:host .wm-button.-secondary:hover:not(:disabled):not(.disabled) {
|
|
219
|
+
:host .wm-button.-secondary:hover:not(:disabled):not(.disabled):not(.ai) {
|
|
222
220
|
background: var(--wmcolor-button-background-secondary-hover);
|
|
223
221
|
color: var(--wmcolor-button-text-secondary-hover);
|
|
224
222
|
border-color: transparent;
|
|
@@ -312,7 +310,7 @@
|
|
|
312
310
|
-webkit-font-smoothing: antialiased;
|
|
313
311
|
-moz-osx-font-smoothing: grayscale;
|
|
314
312
|
}
|
|
315
|
-
:host .wm-button.-icononly:hover:not(:disabled):not(.disabled) {
|
|
313
|
+
:host .wm-button.-icononly:hover:not(:disabled):not(.disabled):not(.ai) {
|
|
316
314
|
background: var(--wmcolor-button-background-icononly-hover);
|
|
317
315
|
color: var(--wmcolor-button-icon-icononly-hover);
|
|
318
316
|
border-color: transparent;
|
|
@@ -330,11 +328,9 @@
|
|
|
330
328
|
:host .wm-button.-navigational {
|
|
331
329
|
border: none !important;
|
|
332
330
|
background-color: var(--wmcolor-button-background-navigational);
|
|
333
|
-
}
|
|
334
|
-
:host .wm-button.-navigational:not(.dark):not(:disabled):not(.disabled) {
|
|
335
331
|
color: var(--wmcolor-button-icon-navigational);
|
|
336
332
|
}
|
|
337
|
-
:host .wm-button.-navigational:
|
|
333
|
+
:host .wm-button.-navigational:hover, :host .wm-button.-navigational.selected {
|
|
338
334
|
background-color: var(--wmcolor-button-background-navigational-hover);
|
|
339
335
|
}
|
|
340
336
|
:host .wm-button.-navigational:before {
|
|
@@ -346,14 +342,18 @@
|
|
|
346
342
|
-webkit-font-smoothing: antialiased;
|
|
347
343
|
-moz-osx-font-smoothing: grayscale;
|
|
348
344
|
}
|
|
349
|
-
:host .wm-button.-navigational.dark
|
|
345
|
+
:host .wm-button.-navigational.dark {
|
|
350
346
|
color: var(--wmcolor-button-icon-navigational-ondark);
|
|
351
347
|
background: var(--wmcolor-button-background-navigational-ondark);
|
|
352
348
|
}
|
|
353
|
-
:host .wm-button.-navigational.dark:
|
|
349
|
+
:host .wm-button.-navigational.dark:hover {
|
|
354
350
|
color: var(--wmcolor-button-icon-navigational-hover-ondark);
|
|
355
351
|
background: var(--wmcolor-button-background-navigational-hover-ondark);
|
|
356
352
|
}
|
|
353
|
+
:host .wm-button.-navigational:disabled:hover, :host .wm-button.-navigational.disabled:hover {
|
|
354
|
+
background-color: var(--wmcolor-button-background-navigational) !important;
|
|
355
|
+
color: var(--wmcolor-button-icon-navigational) !important;
|
|
356
|
+
}
|
|
357
357
|
:host .wm-button.-permanentlydelete:not(.-textonly) {
|
|
358
358
|
background: var(--wmcolor-button-background-delete);
|
|
359
359
|
border-color: var(--wmcolor-button-background-delete);
|
|
@@ -443,7 +443,7 @@
|
|
|
443
443
|
background: var(--wmcolor-button-background-selectorprimary);
|
|
444
444
|
color: var(--wmcolor-button-text-selectorprimary);
|
|
445
445
|
}
|
|
446
|
-
:host .wm-button.-selector-primary:hover:not(:disabled):not(.disabled) {
|
|
446
|
+
:host .wm-button.-selector-primary:hover:not(:disabled):not(.disabled):not(.ai) {
|
|
447
447
|
background: var(--wmcolor-button-background-selectorprimary-hover);
|
|
448
448
|
}
|
|
449
449
|
:host .wm-button.-selector-primary.dark:not(:disabled):not(.disabled) {
|
|
@@ -534,6 +534,192 @@
|
|
|
534
534
|
background: var(--wmcolor-button-background-delete-disabled-ondark);
|
|
535
535
|
color: var(--wmcolor-button-text-delete-disabled-ondark);
|
|
536
536
|
}
|
|
537
|
+
:host .wm-button .svg-ai-sparkles {
|
|
538
|
+
--icon-size: 0.875rem;
|
|
539
|
+
}
|
|
540
|
+
:host .wm-button .svg-ai-sparkles::before {
|
|
541
|
+
background: var(--icon-fill, currentColor);
|
|
542
|
+
}
|
|
543
|
+
:host .wm-button.-primary.ai {
|
|
544
|
+
--ai-gradient-start: var(--wmcolor-ai-interactive-gradientstart);
|
|
545
|
+
--ai-gradient-end: var(--wmcolor-ai-interactive-gradientend);
|
|
546
|
+
--wmbutton-percent-1: 0%;
|
|
547
|
+
--wmbutton-percent-2: 70.19%;
|
|
548
|
+
--wmbutton-percent-3: 180%;
|
|
549
|
+
color: #fff;
|
|
550
|
+
gap: 5px;
|
|
551
|
+
background-image: linear-gradient(-225deg, var(--ai-gradient-start) var(--wmbutton-percent-1), var(--ai-gradient-end) var(--wmbutton-percent-2), var(--ai-gradient-start) var(--wmbutton-percent-3));
|
|
552
|
+
background-origin: border-box;
|
|
553
|
+
background-clip: border-box;
|
|
554
|
+
border: 2px solid transparent;
|
|
555
|
+
transition: --ai-gradient-start, --ai-gradient-end, --wmbutton-percent-1, --wmbutton-percent-2, --wmbutton-percent-3;
|
|
556
|
+
transition-timing-function: ease-out;
|
|
557
|
+
}
|
|
558
|
+
:host .wm-button.-primary.ai:hover {
|
|
559
|
+
--ai-gradient-start: var(--wmcolor-ai-interactive-gradientstart-hover);
|
|
560
|
+
--ai-gradient-end: var(--wmcolor-ai-interactive-gradientend-hover);
|
|
561
|
+
--wmbutton-percent-1: -50%;
|
|
562
|
+
--wmbutton-percent-2: 0%;
|
|
563
|
+
--wmbutton-percent-3: 89.81%;
|
|
564
|
+
}
|
|
565
|
+
:host .wm-button.-secondary.ai, :host .wm-button.-icononly.ai {
|
|
566
|
+
--ai-gradient-start: var(--wmcolor-ai-interactive-gradientstart);
|
|
567
|
+
--ai-gradient-end: var(--wmcolor-ai-interactive-gradientend);
|
|
568
|
+
--wmbutton-percent-1: 0%;
|
|
569
|
+
--wmbutton-percent-2: 70.19%;
|
|
570
|
+
--wmbutton-percent-3: 180%;
|
|
571
|
+
--secondary-button-fill: #ffffff;
|
|
572
|
+
border: 2px solid transparent;
|
|
573
|
+
gap: 5px;
|
|
574
|
+
transition: --secondary-button-fill, --ai-gradient-start, --ai-gradient-end;
|
|
575
|
+
transition-timing-function: ease-out;
|
|
576
|
+
transition-duration: 100ms;
|
|
577
|
+
background: linear-gradient(var(--secondary-button-fill) 0 0) padding-box, linear-gradient(-225deg, var(--ai-gradient-start) var(--wmbutton-percent-1), var(--ai-gradient-end) var(--wmbutton-percent-2), var(--ai-gradient-start) var(--wmbutton-percent-3)) border-box;
|
|
578
|
+
}
|
|
579
|
+
:host .wm-button.-secondary.ai .button-text, :host .wm-button.-icononly.ai .button-text {
|
|
580
|
+
--icon-fill: linear-gradient(
|
|
581
|
+
135deg,
|
|
582
|
+
var(--ai-gradient-start) var(--wmbutton-percent-1),
|
|
583
|
+
var(--ai-gradient-end) var(--wmbutton-percent-2)
|
|
584
|
+
);
|
|
585
|
+
display: flex;
|
|
586
|
+
color: transparent;
|
|
587
|
+
transition: color 100ms;
|
|
588
|
+
background: linear-gradient(135deg, var(--ai-gradient-start) var(--wmbutton-percent-1), var(--ai-gradient-end) var(--wmbutton-percent-2));
|
|
589
|
+
background-clip: text;
|
|
590
|
+
-webkit-background-clip: text;
|
|
591
|
+
align-items: center;
|
|
592
|
+
}
|
|
593
|
+
:host .wm-button.-secondary.ai .svg-ai-sparkles::before, :host .wm-button.-icononly.ai .svg-ai-sparkles::before {
|
|
594
|
+
--icon-fill: linear-gradient(
|
|
595
|
+
135deg,
|
|
596
|
+
var(--ai-gradient-start) var(--wmbutton-percent-1),
|
|
597
|
+
var(--ai-gradient-end) var(--wmbutton-percent-2)
|
|
598
|
+
);
|
|
599
|
+
}
|
|
600
|
+
:host .wm-button.-secondary.ai:hover, :host .wm-button.-icononly.ai:hover {
|
|
601
|
+
--secondary-button-fill: transparent;
|
|
602
|
+
--ai-gradient-start: var(--wmcolor-ai-interactive-gradientstart-hover);
|
|
603
|
+
--ai-gradient-end: var(--wmcolor-ai-interactive-gradientend-hover);
|
|
604
|
+
transition-timing-function: ease-in;
|
|
605
|
+
transition-duration: 100ms;
|
|
606
|
+
}
|
|
607
|
+
:host .wm-button.-secondary.ai:hover .button-text, :host .wm-button.-icononly.ai:hover .button-text {
|
|
608
|
+
--icon-fill: #fff;
|
|
609
|
+
color: #fff;
|
|
610
|
+
}
|
|
611
|
+
:host .wm-button.-secondary.ai:hover .svg-ai-sparkles::before, :host .wm-button.-icononly.ai:hover .svg-ai-sparkles::before {
|
|
612
|
+
--icon-fill: #fff;
|
|
613
|
+
}
|
|
614
|
+
:host .wm-button.-navigational.ai {
|
|
615
|
+
--ai-gradient-start: var(--wmcolor-ai-interactive-gradientstart);
|
|
616
|
+
--ai-gradient-end: var(--wmcolor-ai-interactive-gradientend);
|
|
617
|
+
--wmbutton-percent-1: 0%;
|
|
618
|
+
--wmbutton-percent-2: 70.19%;
|
|
619
|
+
--wmbutton-percent-3: 180%;
|
|
620
|
+
--icon-fill: linear-gradient(
|
|
621
|
+
-225deg,
|
|
622
|
+
var(--ai-gradient-start) var(--wmbutton-percent-1),
|
|
623
|
+
var(--ai-gradient-end) var(--wmbutton-percent-2),
|
|
624
|
+
var(--ai-gradient-start) var(--wmbutton-percent-3)
|
|
625
|
+
);
|
|
626
|
+
color: #fff;
|
|
627
|
+
transition: --ai-gradient-start, --ai-gradient-end, --wmbutton-percent-1, --wmbutton-percent-2, --wmbutton-percent-3;
|
|
628
|
+
transition-timing-function: ease-in;
|
|
629
|
+
transition-delay: 0ms, 0ms, 150ms, 150ms, 150ms;
|
|
630
|
+
transition-duration: 150ms;
|
|
631
|
+
}
|
|
632
|
+
:host .wm-button.-navigational.ai:hover {
|
|
633
|
+
--ai-gradient-start: var(--wmcolor-ai-interactive-gradientstart-hover);
|
|
634
|
+
--ai-gradient-end: var(--wmcolor-ai-interactive-gradientend-hover);
|
|
635
|
+
--wmbutton-percent-1: -50%;
|
|
636
|
+
--wmbutton-percent-2: 0%;
|
|
637
|
+
--wmbutton-percent-3: 89.81%;
|
|
638
|
+
transition-timing-function: ease-in;
|
|
639
|
+
transition-duration: 100ms;
|
|
640
|
+
}
|
|
641
|
+
:host .wm-button.-icononly.ai {
|
|
642
|
+
border-width: 1px;
|
|
643
|
+
}
|
|
644
|
+
:host .wm-button.-navigational.ai .svg-ai-sparkles, :host .wm-button.-icononly.ai .svg-ai-sparkles {
|
|
645
|
+
--icon-size: 1.125rem;
|
|
646
|
+
}
|
|
647
|
+
:host .wm-button.-textonly.ai {
|
|
648
|
+
--secondary-button-fill: transparent;
|
|
649
|
+
--ai-gradient-start: var(--wmcolor-ai-interactive-gradientstart);
|
|
650
|
+
--ai-gradient-end: var(--wmcolor-ai-interactive-gradientend);
|
|
651
|
+
--wmbutton-percent-1: 0%;
|
|
652
|
+
--wmbutton-percent-2: 70.19%;
|
|
653
|
+
--wmbutton-percent-3: 180%;
|
|
654
|
+
--icon-fill: linear-gradient(
|
|
655
|
+
135deg,
|
|
656
|
+
var(--ai-gradient-start) var(--wmbutton-percent-1),
|
|
657
|
+
var(--ai-gradient-end) var(--wmbutton-percent-2)
|
|
658
|
+
);
|
|
659
|
+
display: flex;
|
|
660
|
+
color: transparent;
|
|
661
|
+
gap: 5px;
|
|
662
|
+
transition: --ai-gradient-start, --ai-gradient-end, --wmbutton-percent-1, --wmbutton-percent-2, --wmbutton-percent-3, --secondary-button-fill;
|
|
663
|
+
transition-timing-function: ease-out;
|
|
664
|
+
transition-delay: 0ms, 100ms, 100ms, 100ms, 200ms, 0ms;
|
|
665
|
+
transition-duration: 150ms;
|
|
666
|
+
background: linear-gradient(-225deg, var(--ai-gradient-start) var(--wmbutton-percent-1), var(--ai-gradient-end) var(--wmbutton-percent-2), var(--ai-gradient-start) var(--wmbutton-percent-3));
|
|
667
|
+
background-clip: text;
|
|
668
|
+
-webkit-background-clip: text;
|
|
669
|
+
border: none;
|
|
670
|
+
border-bottom: 1px solid;
|
|
671
|
+
border-image: linear-gradient(var(--secondary-button-fill) 0 0) 1;
|
|
672
|
+
}
|
|
673
|
+
:host .wm-button.-textonly.ai:hover {
|
|
674
|
+
--secondary-button-fill: var(--wmcolor-azurite-70);
|
|
675
|
+
--ai-gradient-start: var(--wmcolor-ai-interactive-gradientstart-hover);
|
|
676
|
+
--ai-gradient-end: var(--wmcolor-ai-interactive-gradientend-hover);
|
|
677
|
+
transition-duration: 100ms;
|
|
678
|
+
}
|
|
679
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
680
|
+
:host .wm-button.-primary.ai {
|
|
681
|
+
transition-timing-function: ease-in;
|
|
682
|
+
transition-delay: 0ms, 0ms, 150ms, 150ms, 150ms;
|
|
683
|
+
transition-duration: 150ms;
|
|
684
|
+
}
|
|
685
|
+
:host .wm-button.-primary.ai:hover {
|
|
686
|
+
transition-timing-function: ease-in;
|
|
687
|
+
transition-duration: 100ms;
|
|
688
|
+
}
|
|
689
|
+
:host .wm-button.-secondary.ai, :host .wm-button.-icononly.ai {
|
|
690
|
+
transition: --secondary-button-fill, --ai-gradient-start, --ai-gradient-end, --wmbutton-percent-1, --wmbutton-percent-2, --wmbutton-percent-3;
|
|
691
|
+
transition-timing-function: ease-out;
|
|
692
|
+
transition-delay: 200ms, 0ms, 0ms, 100ms, 100ms, 100ms;
|
|
693
|
+
transition-duration: 150ms;
|
|
694
|
+
}
|
|
695
|
+
:host .wm-button.-secondary.ai:hover, :host .wm-button.-icononly.ai:hover {
|
|
696
|
+
--secondary-button-fill: transparent;
|
|
697
|
+
--ai-gradient-start: var(--wmcolor-ai-interactive-gradientstart-hover);
|
|
698
|
+
--ai-gradient-end: var(--wmcolor-ai-interactive-gradientend-hover);
|
|
699
|
+
--wmbutton-percent-1: -50%;
|
|
700
|
+
--wmbutton-percent-2: 0%;
|
|
701
|
+
--wmbutton-percent-3: 89.81%;
|
|
702
|
+
transition-delay: 0ms, 100ms, 100ms, 200ms, 200ms, 200ms;
|
|
703
|
+
transition-duration: 200ms, 200ms, 200ms, 200ms, 200ms, 200ms;
|
|
704
|
+
}
|
|
705
|
+
:host .wm-button.-textonly.ai {
|
|
706
|
+
transition: --ai-gradient-start, --ai-gradient-end, --wmbutton-percent-1, --wmbutton-percent-2, --wmbutton-percent-3, --secondary-button-fill;
|
|
707
|
+
transition-timing-function: ease-out;
|
|
708
|
+
transition-delay: 0ms, 100ms, 100ms, 100ms, 200ms, 0ms;
|
|
709
|
+
transition-duration: 150ms;
|
|
710
|
+
border-image: linear-gradient(var(--secondary-button-fill) 0 0) 1;
|
|
711
|
+
}
|
|
712
|
+
:host .wm-button.-textonly.ai:hover {
|
|
713
|
+
--secondary-button-fill: var(--wmcolor-azurite-70);
|
|
714
|
+
--ai-gradient-start: var(--wmcolor-ai-interactive-gradientstart-hover);
|
|
715
|
+
--ai-gradient-end: var(--wmcolor-ai-interactive-gradientend-hover);
|
|
716
|
+
--wmbutton-percent-1: -50%;
|
|
717
|
+
--wmbutton-percent-2: 0%;
|
|
718
|
+
--wmbutton-percent-3: 89.81%;
|
|
719
|
+
transition-delay: 100ms, 100ms, 200ms, 200ms, 200ms, 0s;
|
|
720
|
+
transition-duration: 200ms, 200ms, 200ms, 200ms, 200ms, 1s;
|
|
721
|
+
}
|
|
722
|
+
}
|
|
537
723
|
:host a.wm-button,
|
|
538
724
|
:host label.wm-button {
|
|
539
725
|
height: auto;
|
|
@@ -29,12 +29,19 @@ export class Button {
|
|
|
29
29
|
}
|
|
30
30
|
get hasTooltip() {
|
|
31
31
|
// tooltip is only rendered for icononly and navigational types, or if the button text is truncated
|
|
32
|
-
return ["icononly", "navigational"].includes(this.buttonType) || this.isTruncated;
|
|
32
|
+
return ["icononly", "navigational", "icononly-ai", "navigational-ai"].includes(this.buttonType) || this.isTruncated;
|
|
33
33
|
}
|
|
34
34
|
get buttonClasses() {
|
|
35
35
|
let classes = "wm-button";
|
|
36
36
|
classes += this.permanentlyDelete ? " -permanentlydelete" : "";
|
|
37
|
-
|
|
37
|
+
// Handle AI variants by adding both base and ai classes
|
|
38
|
+
if (this.buttonType.endsWith("-ai")) {
|
|
39
|
+
const baseType = this.buttonType.replace("-ai", "");
|
|
40
|
+
classes += ` -${baseType} ai`;
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
classes += this.buttonType ? ` -${this.buttonType}` : " -secondary";
|
|
44
|
+
}
|
|
38
45
|
classes += this.textWrap ? "" : " nowrap";
|
|
39
46
|
classes += this.isTabbing ? " user-is-tabbing" : "";
|
|
40
47
|
classes += this.isTruncated ? " -truncated" : "";
|
|
@@ -64,6 +71,11 @@ export class Button {
|
|
|
64
71
|
"selector-primary",
|
|
65
72
|
"pairpositive",
|
|
66
73
|
"pairnegative",
|
|
74
|
+
"primary-ai",
|
|
75
|
+
"secondary-ai",
|
|
76
|
+
"textonly-ai",
|
|
77
|
+
"icononly-ai",
|
|
78
|
+
"navigational-ai",
|
|
67
79
|
].includes(newValue);
|
|
68
80
|
if (!valid) {
|
|
69
81
|
this.buttonType = "secondary";
|
|
@@ -136,10 +148,64 @@ export class Button {
|
|
|
136
148
|
showTooltip(this.tooltipPosition, ev.target, tooltipText);
|
|
137
149
|
}
|
|
138
150
|
}
|
|
151
|
+
/**
|
|
152
|
+
* Register CSS custom properties for AI gradient animations
|
|
153
|
+
* These need to be registered in JS since @property doesn't work in shadow DOM
|
|
154
|
+
*/
|
|
155
|
+
registerCSSProperties() {
|
|
156
|
+
if (typeof CSS !== "undefined" && "registerProperty" in CSS) {
|
|
157
|
+
try {
|
|
158
|
+
CSS.registerProperty({
|
|
159
|
+
name: "--ai-gradient-start",
|
|
160
|
+
syntax: "<color>",
|
|
161
|
+
inherits: false,
|
|
162
|
+
initialValue: "#2779C8"
|
|
163
|
+
});
|
|
164
|
+
CSS.registerProperty({
|
|
165
|
+
name: "--ai-gradient-end",
|
|
166
|
+
syntax: "<color>",
|
|
167
|
+
inherits: false,
|
|
168
|
+
initialValue: "#6259C4"
|
|
169
|
+
});
|
|
170
|
+
CSS.registerProperty({
|
|
171
|
+
name: "--secondary-button-fill",
|
|
172
|
+
syntax: "<color>",
|
|
173
|
+
inherits: false,
|
|
174
|
+
initialValue: "#FFFFFF"
|
|
175
|
+
});
|
|
176
|
+
CSS.registerProperty({
|
|
177
|
+
name: "--wmbutton-percent-1",
|
|
178
|
+
syntax: "<percentage>",
|
|
179
|
+
inherits: false,
|
|
180
|
+
initialValue: "0%"
|
|
181
|
+
});
|
|
182
|
+
CSS.registerProperty({
|
|
183
|
+
name: "--wmbutton-percent-2",
|
|
184
|
+
syntax: "<percentage>",
|
|
185
|
+
inherits: false,
|
|
186
|
+
initialValue: "70.19%"
|
|
187
|
+
});
|
|
188
|
+
CSS.registerProperty({
|
|
189
|
+
name: "--wmbutton-percent-3",
|
|
190
|
+
syntax: "<percentage>",
|
|
191
|
+
inherits: false,
|
|
192
|
+
initialValue: "-50%"
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
catch (e) {
|
|
196
|
+
// Properties might already be registered, or CSS.registerProperty might not be supported
|
|
197
|
+
// This is fine, the animations will still work but might be less smooth
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
139
201
|
componentWillLoad() {
|
|
202
|
+
this.registerCSSProperties();
|
|
203
|
+
if (this.buttonType.endsWith("-ai")) {
|
|
204
|
+
this.icon = "#ai-sparkles";
|
|
205
|
+
}
|
|
140
206
|
this.validateType(this.buttonType);
|
|
141
207
|
if (this.icon) {
|
|
142
|
-
this.icon =
|
|
208
|
+
this.icon = getIconCodeFromName(this.icon);
|
|
143
209
|
}
|
|
144
210
|
handleDisabledAttribute(this.el, this.isDisabled);
|
|
145
211
|
}
|
|
@@ -151,7 +217,10 @@ export class Button {
|
|
|
151
217
|
this.ariaPopup = !!this.el.getAttribute("aria-haspopup");
|
|
152
218
|
}
|
|
153
219
|
getAriaLabel() {
|
|
154
|
-
if (this.buttonType === "icononly" ||
|
|
220
|
+
if (this.buttonType === "icononly" ||
|
|
221
|
+
this.buttonType === "navigational" ||
|
|
222
|
+
this.buttonType === "icononly-ai" ||
|
|
223
|
+
this.buttonType === "navigational-ai") {
|
|
155
224
|
return this.labelForIdenticalButtons || this.tooltip;
|
|
156
225
|
}
|
|
157
226
|
if (this.labelForIdenticalButtons) {
|
|
@@ -159,15 +228,12 @@ export class Button {
|
|
|
159
228
|
}
|
|
160
229
|
}
|
|
161
230
|
renderIcon() {
|
|
162
|
-
|
|
231
|
+
this.iconSize && this.el.style.setProperty("--icon-size", this.iconSize);
|
|
163
232
|
let transformStyle = "";
|
|
164
233
|
transformStyle += this.iconRotate ? `rotate(${this.iconRotate}deg)` : "";
|
|
165
234
|
transformStyle += this.iconFlip === "horizontal" ? `scaleX(-1)` : "";
|
|
166
235
|
transformStyle += this.iconFlip === "vertical" ? `scaleY(-1)` : "";
|
|
167
|
-
const iconStyles = Object.assign({
|
|
168
|
-
fontSize: this.iconSize ? this.iconSize : defaultIconSize,
|
|
169
|
-
"--icon-size": this.iconSize ? this.iconSize : defaultIconSize,
|
|
170
|
-
}, ((this.iconRotate || this.iconFlip) && { transform: transformStyle }));
|
|
236
|
+
const iconStyles = Object.assign({}, ((this.iconRotate || this.iconFlip) && { transform: transformStyle }));
|
|
171
237
|
if (this.icon.match(/^#/)) {
|
|
172
238
|
// Icon ID
|
|
173
239
|
return h("span", { class: `svg-icon svg-${this.icon.slice(1)}`, style: iconStyles });
|
|
@@ -183,7 +249,7 @@ export class Button {
|
|
|
183
249
|
}
|
|
184
250
|
}
|
|
185
251
|
render() {
|
|
186
|
-
return (h(Host, { key: '
|
|
252
|
+
return (h(Host, { key: 'ed44edc43c12cbbc088b6a2872e1e26d816c1cba', class: `${this.isDisabled ? "button-disabled" : ""} -${this.buttonType}` }, h("button", { key: '0b94c327dd29d98e981a72fe38b122cc06313aa1', id: this.id, class: `${this.buttonClasses}`, disabled: this.isDisabled, ref: (el) => (this.buttonEl = el), "aria-label": this.getAriaLabel(), "aria-hasPopup": this.ariaPopup ? "menu" : null, onMouseEnter: (ev) => this.handleMouseEnter(ev), onMouseLeave: () => hideTooltip(), onFocus: (ev) => this.handleFocus(ev), onBlur: () => hideTooltip(), onClick: () => hideTooltip() }, (this.icon || this.buttonType.endsWith("-ai")) && this.renderIcon(), (!this.buttonType.startsWith("navigational") && !this.buttonType.startsWith("icononly")) && (h("span", { key: 'c31ae6ac51a1aee66734f3501e49cf9cde1bfc7a', class: "button-text" }, h("slot", { key: 'd75aa45be52f340e755bd96ea029bd51fdd69150' }))), (this.buttonType == "selector" || this.buttonType == "selector-primary") && (h("div", { key: '8d510ff0af0bdbd882214d09b41a26d344591b55', class: "selector-icon svg-icon svg-expand-more" })))));
|
|
187
253
|
}
|
|
188
254
|
static get is() { return "wm-button"; }
|
|
189
255
|
static get encapsulation() { return "shadow"; }
|
|
@@ -223,7 +289,7 @@ export class Button {
|
|
|
223
289
|
"mutable": true,
|
|
224
290
|
"complexType": {
|
|
225
291
|
"original": "validButtonTypes",
|
|
226
|
-
"resolved": "\"icononly\" | \"navigational\" | \"pairnegative\" | \"pairpositive\" | \"primary\" | \"secondary\" | \"selector\" | \"selector-primary\" | \"textonly\"",
|
|
292
|
+
"resolved": "\"icononly\" | \"icononly-ai\" | \"navigational\" | \"navigational-ai\" | \"pairnegative\" | \"pairpositive\" | \"primary\" | \"primary-ai\" | \"secondary\" | \"secondary-ai\" | \"selector\" | \"selector-primary\" | \"textonly\" | \"textonly-ai\"",
|
|
227
293
|
"references": {
|
|
228
294
|
"validButtonTypes": {
|
|
229
295
|
"location": "import",
|
|
@@ -898,9 +898,9 @@
|
|
|
898
898
|
--icon-size: 28px;
|
|
899
899
|
}
|
|
900
900
|
:host .button #ai-icon .svg-ai-sparkles:before {
|
|
901
|
-
--
|
|
902
|
-
--
|
|
903
|
-
background: linear-gradient(to bottom, var(--
|
|
901
|
+
--ai-gradient-start: var(--wmcolor-ai-accent-gradientstart);
|
|
902
|
+
--ai-gradient-end: var(--wmcolor-ai-accent-gradientend);
|
|
903
|
+
background: linear-gradient(to bottom, var(--ai-gradient-start) 30%, var(--ai-gradient-end) 100%);
|
|
904
904
|
}
|
|
905
905
|
:host .button #ai-icon .main {
|
|
906
906
|
clip-path: polygon(0 0, 40% 0%, 70% 50%, 40% 100%, 0 100%);
|
|
@@ -1221,9 +1221,9 @@
|
|
|
1221
1221
|
}
|
|
1222
1222
|
:host button:hover #ai-icon .svg-ai-sparkles:before,
|
|
1223
1223
|
:host button:has(+ #toggletip:popover-open) #ai-icon .svg-ai-sparkles:before {
|
|
1224
|
-
--
|
|
1225
|
-
--
|
|
1226
|
-
transition: --
|
|
1224
|
+
--ai-gradient-start: var(--wmcolor-ai-accent-gradientstart-final);
|
|
1225
|
+
--ai-gradient-end: var(--wmcolor-ai-accent-gradientend-final);
|
|
1226
|
+
transition: --ai-gradient-start, --ai-gradient-end;
|
|
1227
1227
|
transition-delay: 500ms;
|
|
1228
1228
|
transition-duration: 100ms;
|
|
1229
1229
|
}
|
|
@@ -89,13 +89,13 @@ export class Toggletip {
|
|
|
89
89
|
if (typeof CSS !== "undefined" && "registerProperty" in CSS) {
|
|
90
90
|
try {
|
|
91
91
|
CSS.registerProperty({
|
|
92
|
-
name: "--
|
|
92
|
+
name: "--ai-gradient-start",
|
|
93
93
|
syntax: "<color>",
|
|
94
94
|
inherits: false,
|
|
95
95
|
initialValue: "red", // Should always be overwritten. Technically optional, but needed to animate.
|
|
96
96
|
});
|
|
97
97
|
CSS.registerProperty({
|
|
98
|
-
name: "--
|
|
98
|
+
name: "--ai-gradient-end",
|
|
99
99
|
syntax: "<color>",
|
|
100
100
|
inherits: false,
|
|
101
101
|
initialValue: "blue", // Should always be overwritten. Technically optional, but needed to animate.
|
|
@@ -221,9 +221,9 @@ export class Toggletip {
|
|
|
221
221
|
}
|
|
222
222
|
}
|
|
223
223
|
render() {
|
|
224
|
-
return (h(Host, { key: '
|
|
224
|
+
return (h(Host, { key: '5d8d7bd25f7ed0e9626944a09f18c7a534b35181', class: `size-${this.targetSize}` }, h("button", { key: '414f8f09f3a1d20b9e8641cab03632ccd91f8f71', class: "button", type: "button", "aria-label": this.label, popoverTarget: "toggletip", popoverTargetAction: "toggle", onClick: () => this.open(),
|
|
225
225
|
// In order to position the tooltip identically to the toggletip, its presence is determined by these four events
|
|
226
|
-
onMouseEnter: () => !this.isOpen && showTooltip(this.toggletipPosition, this.el, this.tooltipMessage), onMouseLeave: () => hideTooltip(), onFocus: () => !this.isOpen && showTooltip(this.toggletipPosition, this.el, this.tooltipMessage), onBlur: () => this.handleBlur() }, this.renderIcon()), h("div", { key: '
|
|
226
|
+
onMouseEnter: () => !this.isOpen && showTooltip(this.toggletipPosition, this.el, this.tooltipMessage), onMouseLeave: () => hideTooltip(), onFocus: () => !this.isOpen && showTooltip(this.toggletipPosition, this.el, this.tooltipMessage), onBlur: () => this.handleBlur() }, this.renderIcon()), h("div", { key: '8d032e897502ded7631b494314f201d35dd3acb3', popover: "", ref: (el) => (this.toggletipEl = el), class: `toggletip ${this.targetSize} ${this.isHidden ? "hidden" : ""}`, id: "toggletip" }, this.tooltip), h("div", { key: '4cc15a0db02fb19faa8d8ac7e9253c29e74e7ac5', ref: (el) => (this.liveRegionEl = el), class: "live-region sr-only", role: "status", "aria-live": "polite", "aria-atomic": "true" })));
|
|
227
227
|
}
|
|
228
228
|
static get is() { return "wm-toggletip"; }
|
|
229
229
|
static get encapsulation() { return "shadow"; }
|