@descope/web-components-ui 3.23.3 → 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/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$$ = getComponentName('button-selection-group');
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
- const componentName$_ = getComponentName('button-selection-group-item');
14734
+ customElements.define(componentName$$, ButtonSelectionGroupItemClass);
14614
14735
 
14615
- class RawSelectItem extends createBaseClass({
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
 
@@ -34341,6 +34348,7 @@ const vars$n = ButtonSelectionGroupItemClass.cssVarList;
34341
34348
 
34342
34349
  const buttonSelectionGroupItem = {
34343
34350
  [vars$n.hostDirection]: 'inherit',
34351
+ [vars$n.hostWidth]: 'auto',
34344
34352
  [vars$n.backgroundColor]: globalRefs$f.colors.surface.main,
34345
34353
  [vars$n.labelTextColor]: globalRefs$f.colors.surface.contrast,
34346
34354
  [vars$n.borderColor]: globalRefs$f.colors.surface.light,
@@ -34389,6 +34397,17 @@ const createBaseButtonSelectionGroupMappings = (vars) => ({
34389
34397
  [vars.errorMessageIconRepeat]: refs.errorMessageIconRepeat,
34390
34398
  [vars.errorMessageIconPosition]: refs.errorMessageIconPosition,
34391
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
+ },
34392
34411
  });
34393
34412
 
34394
34413
  const vars$m = ButtonSelectionGroupClass.cssVarList;