@descope/web-components-ui 3.23.2 → 3.24.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/index.cjs.js +32 -2
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/index.esm.js +150 -120
- package/dist/index.esm.js.map +1 -1
- package/dist/umd/DescopeDev.js +1 -1
- package/dist/umd/DescopeDev.js.map +1 -1
- package/dist/umd/button-selection-group-fields-descope-button-multi-selection-group-index-js.js +1 -1
- package/dist/umd/button-selection-group-fields-descope-button-multi-selection-group-index-js.js.map +1 -1
- package/dist/umd/button-selection-group-fields-descope-button-selection-group-index-js.js +1 -1
- package/dist/umd/button-selection-group-fields-descope-button-selection-group-index-js.js.map +1 -1
- package/dist/umd/button-selection-group-fields-descope-button-selection-group-item-index-js.js +1 -1
- package/dist/umd/button-selection-group-fields-descope-button-selection-group-item-index-js.js.map +1 -1
- package/dist/umd/descope-recovery-codes.js +1 -1
- package/dist/umd/descope-recovery-codes.js.map +1 -1
- package/dist/umd/index.js +1 -1
- package/dist/umd/index.js.map +1 -1
- package/package.json +43 -43
- package/src/components/button-selection-group-fields/baseButtonSelectionGroup.js +7 -0
- package/src/components/button-selection-group-fields/descope-button-selection-group-item/ButtonSelectionGroupItemClass.js +1 -0
- package/src/theme/components/buttonSelectionGroup/baseButtonSelectionGroup.js +11 -0
- package/src/theme/components/buttonSelectionGroup/buttonSelectionGroupItem.js +1 -0
- package/stories/descope-button-multi-selection-group.stories.js +7 -0
- package/stories/descope-button-selection-group.stories.js +7 -0
package/dist/index.esm.js
CHANGED
|
@@ -14379,6 +14379,121 @@ class ButtonSelectionGroupInternalClass extends createBaseButtonSelectionGroupIn
|
|
|
14379
14379
|
}
|
|
14380
14380
|
}
|
|
14381
14381
|
|
|
14382
|
+
const componentName$$ = getComponentName('button-selection-group-item');
|
|
14383
|
+
|
|
14384
|
+
class RawSelectItem extends createBaseClass({
|
|
14385
|
+
componentName: componentName$$,
|
|
14386
|
+
baseSelector: ':host > descope-button',
|
|
14387
|
+
}) {
|
|
14388
|
+
get size() {
|
|
14389
|
+
return this.getAttribute('size') || 'md';
|
|
14390
|
+
}
|
|
14391
|
+
|
|
14392
|
+
get variant() {
|
|
14393
|
+
return this.getAttribute('variant') || 'contained';
|
|
14394
|
+
}
|
|
14395
|
+
|
|
14396
|
+
get value() {
|
|
14397
|
+
return this.getAttribute('value') || '';
|
|
14398
|
+
}
|
|
14399
|
+
|
|
14400
|
+
set value(value) {
|
|
14401
|
+
this.setAttribute('value', value);
|
|
14402
|
+
}
|
|
14403
|
+
|
|
14404
|
+
constructor() {
|
|
14405
|
+
super();
|
|
14406
|
+
|
|
14407
|
+
this.attachShadow({ mode: 'open' }).innerHTML = `
|
|
14408
|
+
<descope-button variant="${this.variant}" size="${this.size}" mode="primary">
|
|
14409
|
+
<slot></slot>
|
|
14410
|
+
</descope-button>
|
|
14411
|
+
`;
|
|
14412
|
+
|
|
14413
|
+
injectStyle(
|
|
14414
|
+
`
|
|
14415
|
+
descope-button {
|
|
14416
|
+
max-width: 100%;
|
|
14417
|
+
}
|
|
14418
|
+
descope-button > slot {
|
|
14419
|
+
width: 100%;
|
|
14420
|
+
overflow: hidden;
|
|
14421
|
+
text-overflow: ellipsis;
|
|
14422
|
+
display: inline-block;
|
|
14423
|
+
}
|
|
14424
|
+
:host {
|
|
14425
|
+
display: inline-block;
|
|
14426
|
+
max-width: 100%
|
|
14427
|
+
}
|
|
14428
|
+
`,
|
|
14429
|
+
this
|
|
14430
|
+
);
|
|
14431
|
+
|
|
14432
|
+
forwardAttrs(this, this.baseElement, { includeAttrs: ['size', 'variant'] });
|
|
14433
|
+
forwardAttrs(this.baseElement, this, { includeAttrs: ['focused', 'active'] });
|
|
14434
|
+
}
|
|
14435
|
+
|
|
14436
|
+
handleFocus() {
|
|
14437
|
+
this.shadowRoot.querySelector('descope-button')?.focus();
|
|
14438
|
+
}
|
|
14439
|
+
|
|
14440
|
+
focus() {
|
|
14441
|
+
this.handleFocus();
|
|
14442
|
+
}
|
|
14443
|
+
|
|
14444
|
+
init() {
|
|
14445
|
+
super.init();
|
|
14446
|
+
this.addEventListener('focus', (e) => {
|
|
14447
|
+
// we want to ignore focus events we are dispatching
|
|
14448
|
+
if (e.isTrusted) {
|
|
14449
|
+
this.handleFocus();
|
|
14450
|
+
}
|
|
14451
|
+
});
|
|
14452
|
+
}
|
|
14453
|
+
}
|
|
14454
|
+
|
|
14455
|
+
const ButtonSelectionGroupItemClass = compose(
|
|
14456
|
+
createStyleMixin({
|
|
14457
|
+
mappings: {
|
|
14458
|
+
hostDirection: {
|
|
14459
|
+
selector: () => ButtonClass.componentName,
|
|
14460
|
+
property: ButtonClass.cssVarList.hostDirection,
|
|
14461
|
+
},
|
|
14462
|
+
hostWidth: { selector: () => ButtonClass.componentName, property: 'width' },
|
|
14463
|
+
backgroundColor: {
|
|
14464
|
+
selector: () => ButtonClass.componentName,
|
|
14465
|
+
property: ButtonClass.cssVarList.backgroundColor,
|
|
14466
|
+
},
|
|
14467
|
+
labelTextColor: {
|
|
14468
|
+
selector: () => ButtonClass.componentName,
|
|
14469
|
+
property: ButtonClass.cssVarList.labelTextColor,
|
|
14470
|
+
},
|
|
14471
|
+
borderColor: {
|
|
14472
|
+
selector: () => ButtonClass.componentName,
|
|
14473
|
+
property: ButtonClass.cssVarList.borderColor,
|
|
14474
|
+
},
|
|
14475
|
+
borderWidth: {
|
|
14476
|
+
selector: () => ButtonClass.componentName,
|
|
14477
|
+
property: ButtonClass.cssVarList.borderWidth,
|
|
14478
|
+
},
|
|
14479
|
+
borderStyle: {
|
|
14480
|
+
selector: () => ButtonClass.componentName,
|
|
14481
|
+
property: ButtonClass.cssVarList.borderStyle,
|
|
14482
|
+
},
|
|
14483
|
+
borderRadius: {
|
|
14484
|
+
selector: () => ButtonClass.componentName,
|
|
14485
|
+
property: ButtonClass.cssVarList.borderRadius,
|
|
14486
|
+
},
|
|
14487
|
+
outlineColor: {
|
|
14488
|
+
selector: () => ButtonClass.componentName,
|
|
14489
|
+
property: ButtonClass.cssVarList.outlineColor,
|
|
14490
|
+
},
|
|
14491
|
+
},
|
|
14492
|
+
}),
|
|
14493
|
+
draggableMixin,
|
|
14494
|
+
componentNameValidationMixin
|
|
14495
|
+
)(RawSelectItem);
|
|
14496
|
+
|
|
14382
14497
|
const buttonSelectionGroupBaseMixin = (superclass) =>
|
|
14383
14498
|
class ButtonSelectionGroupMixinClass extends superclass {
|
|
14384
14499
|
#renderItem = ({ value, label }) =>
|
|
@@ -14486,6 +14601,12 @@ const buttonSelectionGroupMappings = {
|
|
|
14486
14601
|
errorMessageIconPosition: { ...errorMessage$3, property: 'background-position' },
|
|
14487
14602
|
errorMessageFontSize: { ...errorMessage$3, property: 'font-size' },
|
|
14488
14603
|
itemsSpacing: { ...internalWrapper$1, property: 'gap' },
|
|
14604
|
+
itemsDirection: { ...internalWrapper$1, property: 'flex-direction' },
|
|
14605
|
+
itemsAlignment: { ...internalWrapper$1, property: 'align-items' },
|
|
14606
|
+
itemsWidth: {
|
|
14607
|
+
selector: () => `::slotted(${ButtonSelectionGroupItemClass.componentName})`,
|
|
14608
|
+
property: ButtonSelectionGroupItemClass.cssVarList.hostWidth,
|
|
14609
|
+
},
|
|
14489
14610
|
};
|
|
14490
14611
|
|
|
14491
14612
|
const buttonSelectionGroupStyles = `
|
|
@@ -14550,7 +14671,7 @@ const buttonSelectionGroupStyles = `
|
|
|
14550
14671
|
${resetInputCursor('vaadin-text-field')}
|
|
14551
14672
|
`;
|
|
14552
14673
|
|
|
14553
|
-
const componentName
|
|
14674
|
+
const componentName$_ = getComponentName('button-selection-group');
|
|
14554
14675
|
|
|
14555
14676
|
const buttonSelectionGroupMixin = (superclass) =>
|
|
14556
14677
|
class ButtonMultiSelectionGroupMixinClass extends superclass {
|
|
@@ -14604,129 +14725,15 @@ const ButtonSelectionGroupClass = compose(
|
|
|
14604
14725
|
wrappedEleName: 'vaadin-text-field',
|
|
14605
14726
|
style: () => buttonSelectionGroupStyles,
|
|
14606
14727
|
excludeAttrsSync: ['tabindex', 'style'],
|
|
14607
|
-
componentName: componentName
|
|
14728
|
+
componentName: componentName$_,
|
|
14608
14729
|
})
|
|
14609
14730
|
);
|
|
14610
14731
|
|
|
14611
14732
|
customElements.define(componentName$10, ButtonSelectionGroupInternalClass);
|
|
14612
14733
|
|
|
14613
|
-
|
|
14734
|
+
customElements.define(componentName$$, ButtonSelectionGroupItemClass);
|
|
14614
14735
|
|
|
14615
|
-
|
|
14616
|
-
componentName: componentName$_,
|
|
14617
|
-
baseSelector: ':host > descope-button',
|
|
14618
|
-
}) {
|
|
14619
|
-
get size() {
|
|
14620
|
-
return this.getAttribute('size') || 'md';
|
|
14621
|
-
}
|
|
14622
|
-
|
|
14623
|
-
get variant() {
|
|
14624
|
-
return this.getAttribute('variant') || 'contained';
|
|
14625
|
-
}
|
|
14626
|
-
|
|
14627
|
-
get value() {
|
|
14628
|
-
return this.getAttribute('value') || '';
|
|
14629
|
-
}
|
|
14630
|
-
|
|
14631
|
-
set value(value) {
|
|
14632
|
-
this.setAttribute('value', value);
|
|
14633
|
-
}
|
|
14634
|
-
|
|
14635
|
-
constructor() {
|
|
14636
|
-
super();
|
|
14637
|
-
|
|
14638
|
-
this.attachShadow({ mode: 'open' }).innerHTML = `
|
|
14639
|
-
<descope-button variant="${this.variant}" size="${this.size}" mode="primary">
|
|
14640
|
-
<slot></slot>
|
|
14641
|
-
</descope-button>
|
|
14642
|
-
`;
|
|
14643
|
-
|
|
14644
|
-
injectStyle(
|
|
14645
|
-
`
|
|
14646
|
-
descope-button {
|
|
14647
|
-
max-width: 100%;
|
|
14648
|
-
}
|
|
14649
|
-
descope-button > slot {
|
|
14650
|
-
width: 100%;
|
|
14651
|
-
overflow: hidden;
|
|
14652
|
-
text-overflow: ellipsis;
|
|
14653
|
-
display: inline-block;
|
|
14654
|
-
}
|
|
14655
|
-
:host {
|
|
14656
|
-
display: inline-block;
|
|
14657
|
-
max-width: 100%
|
|
14658
|
-
}
|
|
14659
|
-
`,
|
|
14660
|
-
this
|
|
14661
|
-
);
|
|
14662
|
-
|
|
14663
|
-
forwardAttrs(this, this.baseElement, { includeAttrs: ['size', 'variant'] });
|
|
14664
|
-
forwardAttrs(this.baseElement, this, { includeAttrs: ['focused', 'active'] });
|
|
14665
|
-
}
|
|
14666
|
-
|
|
14667
|
-
handleFocus() {
|
|
14668
|
-
this.shadowRoot.querySelector('descope-button')?.focus();
|
|
14669
|
-
}
|
|
14670
|
-
|
|
14671
|
-
focus() {
|
|
14672
|
-
this.handleFocus();
|
|
14673
|
-
}
|
|
14674
|
-
|
|
14675
|
-
init() {
|
|
14676
|
-
super.init();
|
|
14677
|
-
this.addEventListener('focus', (e) => {
|
|
14678
|
-
// we want to ignore focus events we are dispatching
|
|
14679
|
-
if (e.isTrusted) {
|
|
14680
|
-
this.handleFocus();
|
|
14681
|
-
}
|
|
14682
|
-
});
|
|
14683
|
-
}
|
|
14684
|
-
}
|
|
14685
|
-
|
|
14686
|
-
const ButtonSelectionGroupItemClass = compose(
|
|
14687
|
-
createStyleMixin({
|
|
14688
|
-
mappings: {
|
|
14689
|
-
hostDirection: {
|
|
14690
|
-
selector: () => ButtonClass.componentName,
|
|
14691
|
-
property: ButtonClass.cssVarList.hostDirection,
|
|
14692
|
-
},
|
|
14693
|
-
backgroundColor: {
|
|
14694
|
-
selector: () => ButtonClass.componentName,
|
|
14695
|
-
property: ButtonClass.cssVarList.backgroundColor,
|
|
14696
|
-
},
|
|
14697
|
-
labelTextColor: {
|
|
14698
|
-
selector: () => ButtonClass.componentName,
|
|
14699
|
-
property: ButtonClass.cssVarList.labelTextColor,
|
|
14700
|
-
},
|
|
14701
|
-
borderColor: {
|
|
14702
|
-
selector: () => ButtonClass.componentName,
|
|
14703
|
-
property: ButtonClass.cssVarList.borderColor,
|
|
14704
|
-
},
|
|
14705
|
-
borderWidth: {
|
|
14706
|
-
selector: () => ButtonClass.componentName,
|
|
14707
|
-
property: ButtonClass.cssVarList.borderWidth,
|
|
14708
|
-
},
|
|
14709
|
-
borderStyle: {
|
|
14710
|
-
selector: () => ButtonClass.componentName,
|
|
14711
|
-
property: ButtonClass.cssVarList.borderStyle,
|
|
14712
|
-
},
|
|
14713
|
-
borderRadius: {
|
|
14714
|
-
selector: () => ButtonClass.componentName,
|
|
14715
|
-
property: ButtonClass.cssVarList.borderRadius,
|
|
14716
|
-
},
|
|
14717
|
-
outlineColor: {
|
|
14718
|
-
selector: () => ButtonClass.componentName,
|
|
14719
|
-
property: ButtonClass.cssVarList.outlineColor,
|
|
14720
|
-
},
|
|
14721
|
-
},
|
|
14722
|
-
}),
|
|
14723
|
-
draggableMixin,
|
|
14724
|
-
componentNameValidationMixin
|
|
14725
|
-
)(RawSelectItem);
|
|
14726
|
-
|
|
14727
|
-
customElements.define(componentName$_, ButtonSelectionGroupItemClass);
|
|
14728
|
-
|
|
14729
|
-
customElements.define(componentName$$, ButtonSelectionGroupClass);
|
|
14736
|
+
customElements.define(componentName$_, ButtonSelectionGroupClass);
|
|
14730
14737
|
|
|
14731
14738
|
const componentName$Z = getComponentName('button-multi-selection-group-internal');
|
|
14732
14739
|
|
|
@@ -25099,7 +25106,7 @@ class RawRecoveryCodes extends createBaseClass$1({
|
|
|
25099
25106
|
this.attachShadow({ mode: 'open' }).innerHTML = `
|
|
25100
25107
|
<div class="wrapper">
|
|
25101
25108
|
<div class="codes-box">
|
|
25102
|
-
<div class="list"></div>
|
|
25109
|
+
<div class="list"><div class="codes-list"></div></div>
|
|
25103
25110
|
<descope-text class="icon-wrapper">
|
|
25104
25111
|
<div class="icons">
|
|
25105
25112
|
<vaadin-icon class="icon copy-icon" icon="vaadin:copy-o" title="Copy"></vaadin-icon>
|
|
@@ -25139,6 +25146,17 @@ class RawRecoveryCodes extends createBaseClass$1({
|
|
|
25139
25146
|
display: flex;
|
|
25140
25147
|
flex-grow: 1;
|
|
25141
25148
|
flex-direction: column;
|
|
25149
|
+
/* text-align maps to align-items here, so it positions the codes block
|
|
25150
|
+
(start/center/end) inside the available space, not each row */
|
|
25151
|
+
}
|
|
25152
|
+
.codes-list {
|
|
25153
|
+
display: flex;
|
|
25154
|
+
flex-direction: column;
|
|
25155
|
+
/* rows always start-aligned so the bullets line up in any font.
|
|
25156
|
+
width:fit-content hugs the codes so .list can position the whole
|
|
25157
|
+
block (keep it, it also defeats the stretch fallback) */
|
|
25158
|
+
align-items: flex-start;
|
|
25159
|
+
width: fit-content;
|
|
25142
25160
|
}
|
|
25143
25161
|
descope-text span {
|
|
25144
25162
|
display: inline-flex;
|
|
@@ -25482,7 +25500,7 @@ const RecoveryCodesClass = compose$1(
|
|
|
25482
25500
|
createDynamicDataMixin$1({
|
|
25483
25501
|
itemRenderer: itemRenderer$4,
|
|
25484
25502
|
rerenderAttrsList: ['variant', 'mode'],
|
|
25485
|
-
targetSelector: '.list',
|
|
25503
|
+
targetSelector: '.codes-list',
|
|
25486
25504
|
}),
|
|
25487
25505
|
draggableMixin$1,
|
|
25488
25506
|
componentNameValidationMixin$1,
|
|
@@ -34330,6 +34348,7 @@ const vars$n = ButtonSelectionGroupItemClass.cssVarList;
|
|
|
34330
34348
|
|
|
34331
34349
|
const buttonSelectionGroupItem = {
|
|
34332
34350
|
[vars$n.hostDirection]: 'inherit',
|
|
34351
|
+
[vars$n.hostWidth]: 'auto',
|
|
34333
34352
|
[vars$n.backgroundColor]: globalRefs$f.colors.surface.main,
|
|
34334
34353
|
[vars$n.labelTextColor]: globalRefs$f.colors.surface.contrast,
|
|
34335
34354
|
[vars$n.borderColor]: globalRefs$f.colors.surface.light,
|
|
@@ -34378,6 +34397,17 @@ const createBaseButtonSelectionGroupMappings = (vars) => ({
|
|
|
34378
34397
|
[vars.errorMessageIconRepeat]: refs.errorMessageIconRepeat,
|
|
34379
34398
|
[vars.errorMessageIconPosition]: refs.errorMessageIconPosition,
|
|
34380
34399
|
[vars.errorMessageFontSize]: refs.errorMessageFontSize,
|
|
34400
|
+
|
|
34401
|
+
layout: {
|
|
34402
|
+
vertical: {
|
|
34403
|
+
[vars.itemsDirection]: 'column',
|
|
34404
|
+
[vars.itemsAlignment]: 'flex-start',
|
|
34405
|
+
_fullWidth: {
|
|
34406
|
+
[vars.itemsAlignment]: 'stretch',
|
|
34407
|
+
[vars.itemsWidth]: '100%',
|
|
34408
|
+
},
|
|
34409
|
+
},
|
|
34410
|
+
},
|
|
34381
34411
|
});
|
|
34382
34412
|
|
|
34383
34413
|
const vars$m = ButtonSelectionGroupClass.cssVarList;
|