@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
@@ -1,10 +1,12 @@
1
- import { ButtonGroupSize } from './index.constants';
2
- import { QuanticElement } from '../shared/quantic-element';
1
+ import { ButtonBar } from '../button-bar/button-bar';
3
2
  import type { ComponentMeta } from '../shared/meta.types';
4
- export declare class ButtonGroup extends QuanticElement {
3
+ /**
4
+ * @deprecated Renamed to `ButtonBar` (`quantic-button-bar`). This element
5
+ * never grouped buttons: it joins borders and gives its items a pressed state, which is a
6
+ * button bar. Removed in the next major. For a spaced row of related actions use
7
+ * `ActionGroup`; the `ButtonGroup` name is retired rather than reused.
8
+ */
9
+ export declare class ButtonGroup extends ButtonBar {
5
10
  static meta: ComponentMeta;
6
- size: ButtonGroupSize;
7
- ariaLabel: string | null;
8
- static styles: import("lit").CSSResult;
9
- render(): import("lit").TemplateResult<1>;
11
+ protected defaultLabel: string;
10
12
  }
@@ -4,73 +4,32 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
4
4
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
- import { css, html } from 'lit';
8
- import { provide } from '@lit/context';
9
- import { ButtonGroupSize } from './index.constants';
10
- import { sizeContext } from './index.context';
11
- import { quanticElement, QuanticElement } from '../shared/quantic-element';
12
- import { prop } from '../shared/component-meta.decorators';
13
- let ButtonGroup = class ButtonGroup extends QuanticElement {
7
+ import { quanticElement } from '../shared/quantic-element';
8
+ import { ButtonBar } from '../button-bar/button-bar';
9
+ /**
10
+ * @deprecated Renamed to `ButtonBar` (`quantic-button-bar`). This element
11
+ * never grouped buttons: it joins borders and gives its items a pressed state, which is a
12
+ * button bar. Removed in the next major. For a spaced row of related actions use
13
+ * `ActionGroup`; the `ButtonGroup` name is retired rather than reused.
14
+ */
15
+ let ButtonGroup = class ButtonGroup extends ButtonBar {
14
16
  constructor() {
15
17
  super(...arguments);
16
- this.size = ButtonGroupSize.Medium;
17
- this.ariaLabel = null;
18
- }
19
- render() {
20
- return html `
21
- <div
22
- class="container"
23
- role="toolbar"
24
- aria-label=${this.ariaLabel || 'Button group'}
25
- >
26
- <slot></slot>
27
- </div>
28
- `;
18
+ this.defaultLabel = 'Button group';
29
19
  }
30
20
  };
31
21
  ButtonGroup.meta = {
22
+ ...ButtonBar.meta,
32
23
  tag: 'quantic-button-group',
33
- description: 'Toolbar container that groups multiple action buttons with joined borders and shared sizing. ' +
34
- 'Use when two or more related actions should appear as a single cohesive control.',
35
- category: 'action',
24
+ description: 'Deprecated alias of quantic-button-bar. This element never grouped buttons: ' +
25
+ 'it joins borders and gives its items a pressed state. Use quantic-button-bar.',
26
+ deprecated: {
27
+ use: 'quantic-button-bar',
28
+ reason: 'The name describes a row of buttons, which this is not. Use quantic-action-group for that.',
29
+ },
36
30
  slots: { '': { description: 'One or more quantic-button-group-item elements.' } },
37
31
  subComponents: ['quantic-button-group-item'],
38
- relatedTo: ['quantic-button'],
39
32
  };
40
- ButtonGroup.styles = css `
41
- :host {
42
- --quantic-component-button-group-padding-block: var(--quantic-spacing-2);
43
- --quantic-component-button-group-padding-inline: var(--quantic-spacing-3);
44
- --quantic-component-button-group-font-size: var(
45
- --quantic-font-size-body-sm
46
- );
47
- --quantic-component-button-group-line-height: var(
48
- --quantic-line-height-body-sm
49
- );
50
- --quantic-component-button-group-item-max-width: var(--quantic-width-xxs);
51
- --quantic-component-button-group-border-radius: var(--quantic-radius-md);
52
- --quantic-component-button-group-border-color: var(
53
- --quantic-border-primary
54
- );
55
-
56
- max-width: 100%;
57
- display: inline-flex;
58
- overflow: visible;
59
- }
60
-
61
- .container {
62
- display: inline-flex;
63
- border: 1px solid var(--quantic-component-button-group-border-color);
64
- border-radius: var(--quantic-component-button-group-border-radius);
65
- }
66
- `;
67
- __decorate([
68
- provide({ context: sizeContext }),
69
- prop({ type: 'ButtonGroupSize', options: Object.values(ButtonGroupSize), default: ButtonGroupSize.Medium, description: 'Size applied to all child items via context.' })
70
- ], ButtonGroup.prototype, "size", void 0);
71
- __decorate([
72
- prop({ type: 'string', attribute: 'aria-label', description: 'Accessible label for the toolbar role.' })
73
- ], ButtonGroup.prototype, "ariaLabel", void 0);
74
33
  ButtonGroup = __decorate([
75
34
  quanticElement('quantic-button-group')
76
35
  ], ButtonGroup);
@@ -1,6 +1,9 @@
1
+ import { ButtonBarSize } from '../button-bar/index.constants';
2
+ /** @deprecated Renamed to `ButtonBarSize`. Removed in the next major. */
1
3
  export declare const ButtonGroupSize: {
2
4
  readonly Small: "sm";
3
5
  readonly Medium: "md";
4
6
  readonly Large: "lg";
5
7
  };
6
- export type ButtonGroupSize = (typeof ButtonGroupSize)[keyof typeof ButtonGroupSize];
8
+ /** @deprecated Renamed to `ButtonBarSize`. Removed in the next major. */
9
+ export type ButtonGroupSize = ButtonBarSize;
@@ -1,5 +1,3 @@
1
- export const ButtonGroupSize = {
2
- Small: 'sm',
3
- Medium: 'md',
4
- Large: 'lg',
5
- };
1
+ import { ButtonBarSize } from '../button-bar/index.constants';
2
+ /** @deprecated Renamed to `ButtonBarSize`. Removed in the next major. */
3
+ export const ButtonGroupSize = ButtonBarSize;
package/dist/index.d.ts CHANGED
@@ -4,6 +4,7 @@ export * from './badge';
4
4
  export * from './capacity-bar';
5
5
  export * from './button';
6
6
  export * from './button-group';
7
+ export * from './button-bar';
7
8
  export * from './card';
8
9
  export * from './code-input';
9
10
  export * from './checkbox';
package/dist/index.js CHANGED
@@ -4,6 +4,7 @@ export * from './badge';
4
4
  export * from './capacity-bar';
5
5
  export * from './button';
6
6
  export * from './button-group';
7
+ export * from './button-bar';
7
8
  export * from './card';
8
9
  export * from './code-input';
9
10
  export * from './checkbox';