@ctrliq/quantic-components 1.82.0 → 1.83.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.
Files changed (54) hide show
  1. package/dist/astro.d.ts +3 -1
  2. package/dist/astro.js +3 -1
  3. package/dist/astro.js.map +1 -1
  4. package/dist/button/index.js +1 -1
  5. package/dist/button-bar/button-bar-item.d.ts +11 -0
  6. package/dist/button-bar/button-bar-item.js +191 -0
  7. package/dist/button-bar/button-bar.d.ts +11 -0
  8. package/dist/button-bar/button-bar.js +76 -0
  9. package/dist/button-bar/index.constants.d.ts +6 -0
  10. package/dist/button-bar/index.constants.js +5 -0
  11. package/dist/button-bar/index.context.d.ts +4 -0
  12. package/dist/button-bar/index.context.js +2 -0
  13. package/dist/button-bar/index.d.ts +3 -0
  14. package/dist/button-bar/index.js +3 -0
  15. package/dist/{types/button-group → button-bar}/index.stories.d.ts +2 -2
  16. package/dist/button-bar/index.stories.js +107 -0
  17. package/dist/button-group/button-group-item.d.ts +6 -8
  18. package/dist/button-group/button-group-item.js +11 -167
  19. package/dist/button-group/button-group.d.ts +9 -7
  20. package/dist/button-group/button-group.js +17 -58
  21. package/dist/button-group/index.constants.d.ts +4 -1
  22. package/dist/button-group/index.constants.js +3 -5
  23. package/dist/index.d.ts +1 -0
  24. package/dist/index.js +1 -0
  25. package/dist/index.js.map +1 -1
  26. package/dist/meta/index.js +4 -0
  27. package/dist/meta/index.js.map +1 -1
  28. package/dist/meta/serialize.js +1 -0
  29. package/dist/meta.json +92 -22
  30. package/dist/pagination/pagination.component.js +15 -15
  31. package/dist/quantic-components.js +131 -73
  32. package/dist/quantic-components.js.map +1 -1
  33. package/dist/quantic-components.min.js +148 -142
  34. package/dist/quantic-components.min.js.map +1 -1
  35. package/dist/register.js.map +1 -1
  36. package/dist/shared/meta.types.d.ts +4 -0
  37. package/dist/tabs/index.stories.js +1 -1
  38. package/dist/types/astro.d.ts +3 -1
  39. package/dist/types/button-bar/button-bar-item.d.ts +11 -0
  40. package/dist/types/button-bar/button-bar.d.ts +11 -0
  41. package/dist/types/button-bar/index.constants.d.ts +6 -0
  42. package/dist/types/button-bar/index.context.d.ts +4 -0
  43. package/dist/types/button-bar/index.d.ts +3 -0
  44. package/dist/{button-group → types/button-bar}/index.stories.d.ts +2 -2
  45. package/dist/types/button-group/button-group-item.d.ts +6 -8
  46. package/dist/types/button-group/button-group.d.ts +9 -7
  47. package/dist/types/button-group/index.constants.d.ts +4 -1
  48. package/dist/types/index.d.ts +1 -0
  49. package/dist/types/shared/meta.types.d.ts +4 -0
  50. package/package.json +1 -1
  51. package/dist/button-group/index.context.d.ts +0 -4
  52. package/dist/button-group/index.context.js +0 -2
  53. package/dist/button-group/index.stories.js +0 -107
  54. package/dist/types/button-group/index.context.d.ts +0 -4
@@ -575,7 +575,7 @@
575
575
  'Supports icon-only mode and polymorphic rendering as an <a> or <span>. ' +
576
576
  'Prefer over quantic-icon-label when the element needs to be interactive.',
577
577
  category: 'action',
578
- relatedTo: ['quantic-button-group', 'quantic-icon-label'],
578
+ relatedTo: ['quantic-button-bar', 'quantic-icon-label'],
579
579
  };
580
580
  exports.Button.formAssociated = true;
581
581
  exports.Button.styles = i$7 `
@@ -5988,54 +5988,53 @@
5988
5988
  * SPDX-License-Identifier: BSD-3-Clause
5989
5989
  */function c({context:c,subscribe:e}){return (o,n)=>{"object"==typeof n?n.addInitializer((function(){new s$1(this,{context:c,callback:t=>{o.set.call(this,t);},subscribe:e});})):o.constructor.addInitializer((o=>{new s$1(o,{context:c,callback:t=>{o[n]=t;},subscribe:e});}));}}
5990
5990
 
5991
- const ButtonGroupSize = {
5991
+ const ButtonBarSize = {
5992
5992
  Small: 'sm',
5993
5993
  Medium: 'md',
5994
5994
  Large: 'lg',
5995
5995
  };
5996
5996
 
5997
- const sizeContext$2 = n$1('button-group.size');
5997
+ const sizeContext$2 = n$1('button-bar.size');
5998
5998
 
5999
- exports.ButtonGroup = class ButtonGroup extends QuanticElement {
5999
+ exports.ButtonBar = class ButtonBar extends QuanticElement {
6000
6000
  constructor() {
6001
6001
  super(...arguments);
6002
- this.size = ButtonGroupSize.Medium;
6002
+ this.size = ButtonBarSize.Medium;
6003
6003
  this.ariaLabel = null;
6004
+ this.defaultLabel = 'Button bar';
6004
6005
  }
6005
6006
  render() {
6006
6007
  return b `
6007
6008
  <div
6008
6009
  class="container"
6009
6010
  role="toolbar"
6010
- aria-label=${this.ariaLabel || 'Button group'}
6011
+ aria-label=${this.ariaLabel || this.defaultLabel}
6011
6012
  >
6012
6013
  <slot></slot>
6013
6014
  </div>
6014
6015
  `;
6015
6016
  }
6016
6017
  };
6017
- exports.ButtonGroup.meta = {
6018
- tag: 'quantic-button-group',
6019
- description: 'Toolbar container that groups multiple action buttons with joined borders and shared sizing. ' +
6020
- 'Use when two or more related actions should appear as a single cohesive control.',
6018
+ exports.ButtonBar.meta = {
6019
+ tag: 'quantic-button-bar',
6020
+ description: 'Toolbar of related buttons joined into one cohesive control, with shared sizing. ' +
6021
+ 'Use for switching between views or modes, and for a compact run of icon actions. ' +
6022
+ 'Items carry aria-pressed via active, so a set can behave as exclusive options or as independent toggles. ' +
6023
+ 'Prefer quantic-button for a standalone action, and quantic-tabs when each segment reveals a panel.',
6021
6024
  category: 'action',
6022
- slots: { '': { description: 'One or more quantic-button-group-item elements.' } },
6023
- subComponents: ['quantic-button-group-item'],
6025
+ slots: { '': { description: 'One or more quantic-button-bar-item elements.' } },
6026
+ subComponents: ['quantic-button-bar-item'],
6024
6027
  relatedTo: ['quantic-button'],
6025
6028
  };
6026
- exports.ButtonGroup.styles = i$7 `
6029
+ exports.ButtonBar.styles = i$7 `
6027
6030
  :host {
6028
- --quantic-component-button-group-padding-block: var(--quantic-spacing-2);
6029
- --quantic-component-button-group-padding-inline: var(--quantic-spacing-3);
6030
- --quantic-component-button-group-font-size: var(
6031
- --quantic-font-size-body-sm
6032
- );
6033
- --quantic-component-button-group-line-height: var(
6034
- --quantic-line-height-body-sm
6035
- );
6036
- --quantic-component-button-group-item-max-width: var(--quantic-width-xxs);
6037
- --quantic-component-button-group-border-radius: var(--quantic-radius-md);
6038
- --quantic-component-button-group-border-color: var(
6031
+ --quantic-internal-button-bar-item-padding-block: var(--quantic-spacing-2);
6032
+ --quantic-internal-button-bar-item-padding-inline: var(--quantic-spacing-3);
6033
+ --quantic-internal-button-bar-item-font-size: var(--quantic-font-size-body-sm);
6034
+ --quantic-internal-button-bar-item-line-height: var(--quantic-line-height-body-sm);
6035
+ --quantic-component-button-bar-item-max-width: var(--quantic-width-xxs);
6036
+ --quantic-component-button-bar-border-radius: var(--quantic-radius-md);
6037
+ --quantic-component-button-bar-border-color: var(
6039
6038
  --quantic-border-primary
6040
6039
  );
6041
6040
 
@@ -6046,22 +6045,50 @@
6046
6045
 
6047
6046
  .container {
6048
6047
  display: inline-flex;
6049
- border: 1px solid var(--quantic-component-button-group-border-color);
6050
- border-radius: var(--quantic-component-button-group-border-radius);
6048
+ border: 1px solid var(--quantic-component-button-bar-border-color);
6049
+ border-radius: var(--quantic-component-button-bar-border-radius);
6051
6050
  }
6052
6051
  `;
6053
6052
  __decorate([
6054
6053
  e({ context: sizeContext$2 }),
6055
- prop({ type: 'ButtonGroupSize', options: Object.values(ButtonGroupSize), default: ButtonGroupSize.Medium, description: 'Size applied to all child items via context.' })
6056
- ], exports.ButtonGroup.prototype, "size", void 0);
6054
+ prop({ type: 'ButtonBarSize', options: Object.values(ButtonBarSize), default: ButtonBarSize.Medium, description: 'Size applied to all child items via context.' })
6055
+ ], exports.ButtonBar.prototype, "size", void 0);
6057
6056
  __decorate([
6058
- prop({ type: 'string', attribute: 'aria-label', description: 'Accessible label for the toolbar role.' })
6059
- ], exports.ButtonGroup.prototype, "ariaLabel", void 0);
6057
+ prop({ type: 'string', attribute: 'aria-label', description: 'Accessible label for the group.' })
6058
+ ], exports.ButtonBar.prototype, "ariaLabel", void 0);
6059
+ exports.ButtonBar = __decorate([
6060
+ quanticElement('quantic-button-bar')
6061
+ ], exports.ButtonBar);
6062
+
6063
+ /**
6064
+ * @deprecated Renamed to `ButtonBar` (`quantic-button-bar`). This element
6065
+ * never grouped buttons: it joins borders and gives its items a pressed state, which is a
6066
+ * button bar. Removed in the next major. For a spaced row of related actions use
6067
+ * `ActionGroup`; the `ButtonGroup` name is retired rather than reused.
6068
+ */
6069
+ exports.ButtonGroup = class ButtonGroup extends exports.ButtonBar {
6070
+ constructor() {
6071
+ super(...arguments);
6072
+ this.defaultLabel = 'Button group';
6073
+ }
6074
+ };
6075
+ exports.ButtonGroup.meta = {
6076
+ ...exports.ButtonBar.meta,
6077
+ tag: 'quantic-button-group',
6078
+ description: 'Deprecated alias of quantic-button-bar. This element never grouped buttons: ' +
6079
+ 'it joins borders and gives its items a pressed state. Use quantic-button-bar.',
6080
+ deprecated: {
6081
+ use: 'quantic-button-bar',
6082
+ reason: 'The name describes a row of buttons, which this is not. Use quantic-action-group for that.',
6083
+ },
6084
+ slots: { '': { description: 'One or more quantic-button-group-item elements.' } },
6085
+ subComponents: ['quantic-button-group-item'],
6086
+ };
6060
6087
  exports.ButtonGroup = __decorate([
6061
6088
  quanticElement('quantic-button-group')
6062
6089
  ], exports.ButtonGroup);
6063
6090
 
6064
- exports.ButtonGroupItem = class ButtonGroupItem extends QuanticElement {
6091
+ exports.ButtonBarItem = class ButtonBarItem extends QuanticElement {
6065
6092
  constructor() {
6066
6093
  super(...arguments);
6067
6094
  this.disabled = false;
@@ -6075,6 +6102,7 @@
6075
6102
  });
6076
6103
  return b `
6077
6104
  <button
6105
+ type="button"
6078
6106
  class=${classes}
6079
6107
  tabindex=${this.disabled ? -1 : 0}
6080
6108
  ?disabled=${this.disabled}
@@ -6087,15 +6115,15 @@
6087
6115
  `;
6088
6116
  }
6089
6117
  };
6090
- exports.ButtonGroupItem.meta = {
6091
- tag: 'quantic-button-group-item',
6092
- description: 'Individual button within a quantic-button-group. ' +
6093
- 'Renders as a native button with shared sizing from the parent group context and a toggle-style active state.',
6118
+ exports.ButtonBarItem.meta = {
6119
+ tag: 'quantic-button-bar-item',
6120
+ description: 'Single segment within a quantic-button-bar. ' +
6121
+ 'Renders as a native button with shared sizing from the parent context and a pressed state via active.',
6094
6122
  category: 'action',
6095
6123
  slots: { '': { description: 'Button label or icon content.' } },
6096
- relatedTo: ['quantic-button-group', 'quantic-button'],
6124
+ relatedTo: ['quantic-button-bar', 'quantic-button'],
6097
6125
  };
6098
- exports.ButtonGroupItem.styles = i$7 `
6126
+ exports.ButtonBarItem.styles = i$7 `
6099
6127
  :host {
6100
6128
  display: inline-flex;
6101
6129
  }
@@ -6117,18 +6145,27 @@
6117
6145
  text-decoration: none;
6118
6146
  text-align: center;
6119
6147
  display: block;
6120
- align-items: center;
6121
- justify-content: center;
6122
- gap: var(--quantic-spacing-2);
6123
6148
  width: 100%;
6124
6149
  color: var(--quantic-text-primary);
6125
6150
  cursor: pointer;
6126
6151
  outline: none;
6127
6152
  box-sizing: border-box;
6128
- padding: var(--quantic-component-button-group-padding-block)
6129
- var(--quantic-component-button-group-padding-inline);
6130
- font-size: var(--quantic-component-button-group-font-size);
6131
- line-height: var(--quantic-component-button-group-line-height);
6153
+ padding: var(
6154
+ --quantic-component-button-bar-padding-block,
6155
+ var(--quantic-internal-button-bar-item-padding-block)
6156
+ )
6157
+ var(
6158
+ --quantic-component-button-bar-padding-inline,
6159
+ var(--quantic-internal-button-bar-item-padding-inline)
6160
+ );
6161
+ font-size: var(
6162
+ --quantic-component-button-bar-font-size,
6163
+ var(--quantic-internal-button-bar-item-font-size)
6164
+ );
6165
+ line-height: var(
6166
+ --quantic-component-button-bar-line-height,
6167
+ var(--quantic-internal-button-bar-item-line-height)
6168
+ );
6132
6169
  transition:
6133
6170
  background-color 0.2s ease-in-out,
6134
6171
  color 0.2s ease-in-out;
@@ -6162,7 +6199,7 @@
6162
6199
  display: block;
6163
6200
  overflow: hidden;
6164
6201
  text-overflow: ellipsis;
6165
- max-width: var(--quantic-component-button-group-item-max-width);
6202
+ max-width: var(--quantic-component-button-bar-item-max-width);
6166
6203
  }
6167
6204
 
6168
6205
  .is-active {
@@ -6170,34 +6207,34 @@
6170
6207
  }
6171
6208
 
6172
6209
  .size--sm {
6173
- --quantic-component-button-group-padding-block: var(--quantic-spacing-1);
6174
- --quantic-component-button-group-padding-inline: var(--quantic-spacing-2);
6175
- --quantic-component-button-group-font-size: var(
6210
+ --quantic-internal-button-bar-item-padding-block: var(--quantic-spacing-1);
6211
+ --quantic-internal-button-bar-item-padding-inline: var(--quantic-spacing-2);
6212
+ --quantic-internal-button-bar-item-font-size: var(
6176
6213
  --quantic-font-size-body-xs
6177
6214
  );
6178
- --quantic-component-button-group-line-height: var(
6215
+ --quantic-internal-button-bar-item-line-height: var(
6179
6216
  --quantic-line-height-body-xs
6180
6217
  );
6181
6218
  }
6182
6219
 
6183
6220
  .size--md {
6184
- --quantic-component-button-group-padding-block: var(--quantic-spacing-2);
6185
- --quantic-component-button-group-padding-inline: var(--quantic-spacing-3);
6186
- --quantic-component-button-group-font-size: var(
6221
+ --quantic-internal-button-bar-item-padding-block: var(--quantic-spacing-2);
6222
+ --quantic-internal-button-bar-item-padding-inline: var(--quantic-spacing-3);
6223
+ --quantic-internal-button-bar-item-font-size: var(
6187
6224
  --quantic-font-size-body-sm
6188
6225
  );
6189
- --quantic-component-button-group-line-height: var(
6226
+ --quantic-internal-button-bar-item-line-height: var(
6190
6227
  --quantic-line-height-body-sm
6191
6228
  );
6192
6229
  }
6193
6230
 
6194
6231
  .size--lg {
6195
- --quantic-component-button-group-padding-block: 10px;
6196
- --quantic-component-button-group-padding-inline: var(--quantic-spacing-3);
6197
- --quantic-component-button-group-font-size: var(
6232
+ --quantic-internal-button-bar-item-padding-block: 10px;
6233
+ --quantic-internal-button-bar-item-padding-inline: var(--quantic-spacing-3);
6234
+ --quantic-internal-button-bar-item-font-size: var(
6198
6235
  --quantic-font-size-body-md
6199
6236
  );
6200
- --quantic-component-button-group-line-height: var(
6237
+ --quantic-internal-button-bar-item-line-height: var(
6201
6238
  --quantic-line-height-body-md
6202
6239
  );
6203
6240
  }
@@ -6209,7 +6246,7 @@
6209
6246
  `;
6210
6247
  __decorate([
6211
6248
  c({ context: sizeContext$2, subscribe: true })
6212
- ], exports.ButtonGroupItem.prototype, "size", void 0);
6249
+ ], exports.ButtonBarItem.prototype, "size", void 0);
6213
6250
  __decorate([
6214
6251
  prop({
6215
6252
  type: 'boolean',
@@ -6217,7 +6254,7 @@
6217
6254
  description: 'Prevents interaction and reduces opacity.',
6218
6255
  reflect: true,
6219
6256
  })
6220
- ], exports.ButtonGroupItem.prototype, "disabled", void 0);
6257
+ ], exports.ButtonBarItem.prototype, "disabled", void 0);
6221
6258
  __decorate([
6222
6259
  prop({
6223
6260
  type: 'boolean',
@@ -6225,11 +6262,31 @@
6225
6262
  description: 'Marks this item as the currently selected/active option.',
6226
6263
  reflect: true,
6227
6264
  })
6228
- ], exports.ButtonGroupItem.prototype, "active", void 0);
6265
+ ], exports.ButtonBarItem.prototype, "active", void 0);
6266
+ exports.ButtonBarItem = __decorate([
6267
+ quanticElement('quantic-button-bar-item')
6268
+ ], exports.ButtonBarItem);
6269
+
6270
+ /**
6271
+ * @deprecated Renamed to `ButtonBarItem` (`quantic-button-bar-item`).
6272
+ * Removed in the next major.
6273
+ */
6274
+ exports.ButtonGroupItem = class ButtonGroupItem extends exports.ButtonBarItem {
6275
+ };
6276
+ exports.ButtonGroupItem.meta = {
6277
+ ...exports.ButtonBarItem.meta,
6278
+ tag: 'quantic-button-group-item',
6279
+ description: 'Deprecated alias of quantic-button-bar-item. Use quantic-button-bar-item.',
6280
+ deprecated: { use: 'quantic-button-bar-item' },
6281
+ relatedTo: ['quantic-button-group'],
6282
+ };
6229
6283
  exports.ButtonGroupItem = __decorate([
6230
6284
  quanticElement('quantic-button-group-item')
6231
6285
  ], exports.ButtonGroupItem);
6232
6286
 
6287
+ /** @deprecated Renamed to `ButtonBarSize`. Removed in the next major. */
6288
+ const ButtonGroupSize = ButtonBarSize;
6289
+
6233
6290
  exports.GridDensity = void 0;
6234
6291
  (function (GridDensity) {
6235
6292
  GridDensity["Dense"] = "dense";
@@ -66488,8 +66545,8 @@
66488
66545
 
66489
66546
  exports.LucideIconArrowLeft.ensureDefined();
66490
66547
  exports.LucideIconArrowRight.ensureDefined();
66491
- exports.ButtonGroup.ensureDefined();
66492
- exports.ButtonGroupItem.ensureDefined();
66548
+ exports.ButtonBar.ensureDefined();
66549
+ exports.ButtonBarItem.ensureDefined();
66493
66550
  exports.Pagination = class Pagination extends QuanticElement {
66494
66551
  constructor() {
66495
66552
  super(...arguments);
@@ -66520,8 +66577,8 @@
66520
66577
  const pageNumbers = getPageNumbers(this.currentPage, this.totalPages, this.maxDisplayedPages);
66521
66578
  return b `
66522
66579
  <nav role="navigation" aria-label="Pagination">
66523
- <quantic-button-group size=${this.size}>
66524
- <quantic-button-group-item
66580
+ <quantic-button-bar size=${this.size}>
66581
+ <quantic-button-bar-item
66525
66582
  ?disabled=${isPrevDisabled}
66526
66583
  @click=${this._handlePrevious}
66527
66584
  aria-label="Go to previous page"
@@ -66530,26 +66587,26 @@
66530
66587
  size="xs"
66531
66588
  class="icon"
66532
66589
  ></quantic-icon-lucide-arrow-left>
66533
- </quantic-button-group-item>
66590
+ </quantic-button-bar-item>
66534
66591
 
66535
66592
  ${pageNumbers.map((page) => page === 'ellipsis'
66536
66593
  ? b `
66537
- <quantic-button-group-item disabled>
66594
+ <quantic-button-bar-item disabled>
66538
66595
  ...
66539
- </quantic-button-group-item>
66596
+ </quantic-button-bar-item>
66540
66597
  `
66541
66598
  : b `
66542
- <quantic-button-group-item
66599
+ <quantic-button-bar-item
66543
66600
  ?active=${page === this.currentPage}
66544
66601
  @click=${() => this._handlePageChange(page)}
66545
66602
  aria-label="Go to page ${page}"
66546
66603
  aria-current=${page === this.currentPage ? 'page' : 'false'}
66547
66604
  >
66548
66605
  ${page}
66549
- </quantic-button-group-item>
66606
+ </quantic-button-bar-item>
66550
66607
  `)}
66551
66608
 
66552
- <quantic-button-group-item
66609
+ <quantic-button-bar-item
66553
66610
  ?disabled=${isNextDisabled}
66554
66611
  @click=${this._handleNext}
66555
66612
  aria-label="Go to next page"
@@ -66558,8 +66615,8 @@
66558
66615
  size="xs"
66559
66616
  class="icon"
66560
66617
  ></quantic-icon-lucide-arrow-right>
66561
- </quantic-button-group-item>
66562
- </quantic-button-group>
66618
+ </quantic-button-bar-item>
66619
+ </quantic-button-bar>
66563
66620
  </nav>
66564
66621
  `;
66565
66622
  }
@@ -66569,7 +66626,7 @@
66569
66626
  description: 'Page navigation control with previous/next and numbered page buttons. ' +
66570
66627
  'Emits page-change events; the host is responsible for updating currentPage.',
66571
66628
  category: 'navigation',
66572
- relatedTo: ['quantic-button-group'],
66629
+ relatedTo: ['quantic-button-bar'],
66573
66630
  };
66574
66631
  exports.Pagination.styles = i$7 `
66575
66632
  .icon {
@@ -70568,6 +70625,7 @@
70568
70625
  exports.AlertType = AlertType;
70569
70626
  exports.BadgeColor = BadgeColor;
70570
70627
  exports.BadgeSize = BadgeSize;
70628
+ exports.ButtonBarSize = ButtonBarSize;
70571
70629
  exports.ButtonGroupSize = ButtonGroupSize;
70572
70630
  exports.ButtonGrow = ButtonGrow;
70573
70631
  exports.ButtonSize = ButtonSize;