@ctrliq/quantic-components 1.84.1 → 1.85.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/action-group/action-group.component.js +2 -1
- package/dist/badge/badge-group.component.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/meta/index.js.map +1 -1
- package/dist/meta/sibling-groups.test.d.ts +1 -0
- package/dist/meta/sibling-groups.test.js +42 -0
- package/dist/meta.json +4 -4
- package/dist/quantic-components.js +6 -3
- package/dist/quantic-components.js.map +1 -1
- package/dist/quantic-components.min.js +6 -6
- package/dist/quantic-components.min.js.map +1 -1
- package/dist/register.js.map +1 -1
- package/dist/tag/tag-group.component.js +2 -1
- package/dist/types/meta/sibling-groups.test.d.ts +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
import { dirname, join } from 'node:path';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
import { describe, expect, it } from 'vitest';
|
|
5
|
+
const SRC_DIR = join(dirname(fileURLToPath(import.meta.url)), '..');
|
|
6
|
+
// quantic-action-group, quantic-tag-group and quantic-badge-group are the same component
|
|
7
|
+
// with different children. They exist to carry one accessible name and one gap over a run
|
|
8
|
+
// of siblings, and they deliberately take no layout props: Cluster was deprecated rather
|
|
9
|
+
// than have three copies of its axis and align. That makes ::part(group) the only way out
|
|
10
|
+
// for a caller who needs a column, so it has to be on all three or the escape hatch is a
|
|
11
|
+
// coin flip.
|
|
12
|
+
const GROUPS = [
|
|
13
|
+
'action-group/action-group.component.ts',
|
|
14
|
+
'tag/tag-group.component.ts',
|
|
15
|
+
'badge/badge-group.component.ts',
|
|
16
|
+
];
|
|
17
|
+
const LAYOUT_PROPS = /attribute:\s*'(axis|direction|align|orientation|gap|wrap)'/;
|
|
18
|
+
function source(file) {
|
|
19
|
+
return readFileSync(join(SRC_DIR, file), 'utf-8');
|
|
20
|
+
}
|
|
21
|
+
describe('sibling groups', () => {
|
|
22
|
+
it.each(GROUPS)('%s exposes the role container as ::part(group)', (file) => {
|
|
23
|
+
const roleContainer = /<div[^>]*role="group"[^>]*>/.exec(source(file));
|
|
24
|
+
expect(roleContainer, 'expected a div carrying role="group"').not.toBeNull();
|
|
25
|
+
expect(roleContainer?.[0]).toContain('part="group"');
|
|
26
|
+
});
|
|
27
|
+
it.each(GROUPS)('%s takes no layout prop', (file) => {
|
|
28
|
+
expect(LAYOUT_PROPS.exec(source(file))?.[1]).toBeUndefined();
|
|
29
|
+
});
|
|
30
|
+
it('gives all three the same public surface', () => {
|
|
31
|
+
const surfaces = GROUPS.map((file) => {
|
|
32
|
+
const text = source(file);
|
|
33
|
+
return {
|
|
34
|
+
props: [...text.matchAll(/attribute:\s*'([a-z-]+)'/g)].map(([, name]) => name).sort(),
|
|
35
|
+
parts: [...text.matchAll(/part="([a-z-]+)"/g)].map(([, name]) => name).sort(),
|
|
36
|
+
};
|
|
37
|
+
});
|
|
38
|
+
expect(surfaces[0]).toEqual({ props: ['aria-label'], parts: ['group'] });
|
|
39
|
+
for (const surface of surfaces.slice(1))
|
|
40
|
+
expect(surface).toEqual(surfaces[0]);
|
|
41
|
+
});
|
|
42
|
+
});
|
package/dist/meta.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
|
-
"generated": "2026-08-
|
|
3
|
+
"generated": "2026-08-28T16:29:07.660Z",
|
|
4
4
|
"components": [
|
|
5
5
|
{
|
|
6
6
|
"tag": "quantic-action-group",
|
|
7
|
-
"description": "A row of related actions sharing one accessible name and a consistent gap. Takes quantic-button, and quantic-dropdown-menu or quantic-popover when the trigger is a button. Wraps when the row runs out of width. Gap: --quantic-component-action-group-gap. Use quantic-button-bar when the buttons should read as one joined control.",
|
|
7
|
+
"description": "A row of related actions sharing one accessible name and a consistent gap. Takes quantic-button, and quantic-dropdown-menu or quantic-popover when the trigger is a button. Wraps when the row runs out of width. Gap: --quantic-component-action-group-gap. Layout: ::part(group), for a column or a different alignment. Use quantic-button-bar when the buttons should read as one joined control.",
|
|
8
8
|
"category": "action",
|
|
9
9
|
"props": [
|
|
10
10
|
{
|
|
@@ -183,7 +183,7 @@
|
|
|
183
183
|
},
|
|
184
184
|
{
|
|
185
185
|
"tag": "quantic-badge-group",
|
|
186
|
-
"description": "A run of quantic-badge or quantic-status-badge sharing one accessible name and a consistent gap. Wraps across lines, and each badge keeps its own size. Gap: --quantic-component-badge-group-gap. Use quantic-tag-group for tags.",
|
|
186
|
+
"description": "A run of quantic-badge or quantic-status-badge sharing one accessible name and a consistent gap. Wraps across lines, and each badge keeps its own size. Gap: --quantic-component-badge-group-gap. Layout: ::part(group), for a column or a different alignment. Use quantic-tag-group for tags.",
|
|
187
187
|
"category": "display",
|
|
188
188
|
"props": [
|
|
189
189
|
{
|
|
@@ -4774,7 +4774,7 @@
|
|
|
4774
4774
|
},
|
|
4775
4775
|
{
|
|
4776
4776
|
"tag": "quantic-tag-group",
|
|
4777
|
-
"description": "A run of quantic-tag, quantic-status-tag or quantic-count-tag sharing one accessible name and a consistent gap. Wraps across lines, and each tag keeps its own size. Gap: --quantic-component-tag-group-gap. Use quantic-badge-group for badges.",
|
|
4777
|
+
"description": "A run of quantic-tag, quantic-status-tag or quantic-count-tag sharing one accessible name and a consistent gap. Wraps across lines, and each tag keeps its own size. Gap: --quantic-component-tag-group-gap. Layout: ::part(group), for a column or a different alignment. Use quantic-badge-group for badges.",
|
|
4778
4778
|
"category": "display",
|
|
4779
4779
|
"props": [
|
|
4780
4780
|
{
|
|
@@ -5761,7 +5761,7 @@
|
|
|
5761
5761
|
}
|
|
5762
5762
|
render() {
|
|
5763
5763
|
return b `
|
|
5764
|
-
<div class="group" role="group" aria-label=${this.ariaLabel ?? 'Badges'}>
|
|
5764
|
+
<div class="group" part="group" role="group" aria-label=${this.ariaLabel ?? 'Badges'}>
|
|
5765
5765
|
<slot></slot>
|
|
5766
5766
|
</div>
|
|
5767
5767
|
`;
|
|
@@ -5771,6 +5771,7 @@
|
|
|
5771
5771
|
tag: 'quantic-badge-group',
|
|
5772
5772
|
description: 'A run of quantic-badge or quantic-status-badge sharing one accessible name and a consistent gap. ' +
|
|
5773
5773
|
'Wraps across lines, and each badge keeps its own size. Gap: --quantic-component-badge-group-gap. ' +
|
|
5774
|
+
'Layout: ::part(group), for a column or a different alignment. ' +
|
|
5774
5775
|
'Use quantic-tag-group for tags.',
|
|
5775
5776
|
category: 'display',
|
|
5776
5777
|
slots: {
|
|
@@ -6003,7 +6004,7 @@
|
|
|
6003
6004
|
}
|
|
6004
6005
|
render() {
|
|
6005
6006
|
return b `
|
|
6006
|
-
<div class="group" role="group" aria-label=${this.ariaLabel ?? 'Actions'}>
|
|
6007
|
+
<div class="group" part="group" role="group" aria-label=${this.ariaLabel ?? 'Actions'}>
|
|
6007
6008
|
<slot></slot>
|
|
6008
6009
|
</div>
|
|
6009
6010
|
`;
|
|
@@ -6014,6 +6015,7 @@
|
|
|
6014
6015
|
description: 'A row of related actions sharing one accessible name and a consistent gap. ' +
|
|
6015
6016
|
'Takes quantic-button, and quantic-dropdown-menu or quantic-popover when the trigger is a button. ' +
|
|
6016
6017
|
'Wraps when the row runs out of width. Gap: --quantic-component-action-group-gap. ' +
|
|
6018
|
+
'Layout: ::part(group), for a column or a different alignment. ' +
|
|
6017
6019
|
'Use quantic-button-bar when the buttons should read as one joined control.',
|
|
6018
6020
|
category: 'action',
|
|
6019
6021
|
slots: {
|
|
@@ -70057,7 +70059,7 @@
|
|
|
70057
70059
|
}
|
|
70058
70060
|
render() {
|
|
70059
70061
|
return b `
|
|
70060
|
-
<div class="group" role="group" aria-label=${this.ariaLabel ?? 'Tags'}>
|
|
70062
|
+
<div class="group" part="group" role="group" aria-label=${this.ariaLabel ?? 'Tags'}>
|
|
70061
70063
|
<slot></slot>
|
|
70062
70064
|
</div>
|
|
70063
70065
|
`;
|
|
@@ -70067,6 +70069,7 @@
|
|
|
70067
70069
|
tag: 'quantic-tag-group',
|
|
70068
70070
|
description: 'A run of quantic-tag, quantic-status-tag or quantic-count-tag sharing one accessible name and a consistent gap. ' +
|
|
70069
70071
|
'Wraps across lines, and each tag keeps its own size. Gap: --quantic-component-tag-group-gap. ' +
|
|
70072
|
+
'Layout: ::part(group), for a column or a different alignment. ' +
|
|
70070
70073
|
'Use quantic-badge-group for badges.',
|
|
70071
70074
|
category: 'display',
|
|
70072
70075
|
slots: {
|