@ctrliq/quantic-components 1.81.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.
- package/dist/astro.d.ts +3 -1
- package/dist/astro.js +3 -1
- package/dist/astro.js.map +1 -1
- package/dist/button/index.js +1 -1
- package/dist/button-bar/button-bar-item.d.ts +11 -0
- package/dist/button-bar/button-bar-item.js +191 -0
- package/dist/button-bar/button-bar.d.ts +11 -0
- package/dist/button-bar/button-bar.js +76 -0
- package/dist/button-bar/index.constants.d.ts +6 -0
- package/dist/button-bar/index.constants.js +5 -0
- package/dist/button-bar/index.context.d.ts +4 -0
- package/dist/button-bar/index.context.js +2 -0
- package/dist/button-bar/index.d.ts +3 -0
- package/dist/button-bar/index.js +3 -0
- package/dist/{types/button-group → button-bar}/index.stories.d.ts +2 -2
- package/dist/button-bar/index.stories.js +107 -0
- package/dist/button-group/button-group-item.d.ts +6 -8
- package/dist/button-group/button-group-item.js +11 -167
- package/dist/button-group/button-group.d.ts +9 -7
- package/dist/button-group/button-group.js +17 -58
- package/dist/button-group/index.constants.d.ts +4 -1
- package/dist/button-group/index.constants.js +3 -5
- package/dist/card/index.d.ts +1 -1
- package/dist/card/index.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/meta/constants-barrel.test.d.ts +1 -0
- package/dist/meta/constants-barrel.test.js +74 -0
- package/dist/meta/index.js +4 -0
- package/dist/meta/index.js.map +1 -1
- package/dist/meta/serialize.js +1 -0
- package/dist/meta.json +92 -22
- package/dist/pagination/pagination.component.js +15 -15
- package/dist/quantic-components.js +137 -78
- package/dist/quantic-components.js.map +1 -1
- package/dist/quantic-components.min.js +149 -143
- package/dist/quantic-components.min.js.map +1 -1
- package/dist/register.js.map +1 -1
- package/dist/shared/meta.types.d.ts +4 -0
- package/dist/tabs/index.stories.js +1 -1
- package/dist/tooltip/index.d.ts +1 -0
- package/dist/tooltip/index.js +1 -0
- package/dist/types/astro.d.ts +3 -1
- package/dist/types/button-bar/button-bar-item.d.ts +11 -0
- package/dist/types/button-bar/button-bar.d.ts +11 -0
- package/dist/types/button-bar/index.constants.d.ts +6 -0
- package/dist/types/button-bar/index.context.d.ts +4 -0
- package/dist/types/button-bar/index.d.ts +3 -0
- package/dist/{button-group → types/button-bar}/index.stories.d.ts +2 -2
- package/dist/types/button-group/button-group-item.d.ts +6 -8
- package/dist/types/button-group/button-group.d.ts +9 -7
- package/dist/types/button-group/index.constants.d.ts +4 -1
- package/dist/types/card/index.d.ts +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/meta/constants-barrel.test.d.ts +1 -0
- package/dist/types/shared/meta.types.d.ts +4 -0
- package/dist/types/tooltip/index.d.ts +1 -0
- package/package.json +1 -1
- package/dist/button-group/index.context.d.ts +0 -4
- package/dist/button-group/index.context.js +0 -2
- package/dist/button-group/index.stories.js +0 -107
- package/dist/types/button-group/index.context.d.ts +0 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { globSync, 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
|
+
const ROOT_BARREL = 'index.ts';
|
|
7
|
+
const DECLARED = /^export\s+(?:declare\s+)?(?:const enum|enum|type|interface|const|function|class)\s+(\w+)/gm;
|
|
8
|
+
const PROP_TYPE = /@prop\(\{[^}]*?type:\s*'([A-Za-z_]\w*)'/gs;
|
|
9
|
+
const STAR_REEXPORT = /export\s*\*\s*from\s*'\.\/([\w./-]+)'/g;
|
|
10
|
+
const NAMED_EXPORT = /export\s*\{([^}]*)\}\s*(?:from\s*'\.\/[\w./-]+')?\s*;/g;
|
|
11
|
+
const INTERNAL = new Set([
|
|
12
|
+
'tabsTag',
|
|
13
|
+
'buttonTag',
|
|
14
|
+
'panelTag',
|
|
15
|
+
'buttonsSlot',
|
|
16
|
+
'panelsSlot',
|
|
17
|
+
'BrandIconName',
|
|
18
|
+
'TabsVariant',
|
|
19
|
+
]);
|
|
20
|
+
function read(file) {
|
|
21
|
+
return globSync(file, { cwd: SRC_DIR }).length ? readFileSync(join(SRC_DIR, file), 'utf-8') : '';
|
|
22
|
+
}
|
|
23
|
+
function moduleFile(specifier) {
|
|
24
|
+
const direct = specifier.replace(/\.js$/, '');
|
|
25
|
+
return globSync(`${direct}.ts`, { cwd: SRC_DIR }).length ? `${direct}.ts` : `${direct}/index.ts`;
|
|
26
|
+
}
|
|
27
|
+
function namesReachableFrom(entry, seen = new Set()) {
|
|
28
|
+
if (seen.has(entry))
|
|
29
|
+
return new Set();
|
|
30
|
+
seen.add(entry);
|
|
31
|
+
const source = read(entry);
|
|
32
|
+
const names = new Set([...source.matchAll(DECLARED)].map(([, name]) => name));
|
|
33
|
+
const base = dirname(entry);
|
|
34
|
+
for (const [, clause] of source.matchAll(NAMED_EXPORT)) {
|
|
35
|
+
for (const entryName of clause.split(',')) {
|
|
36
|
+
const name = entryName.trim().split(/\s+as\s+/).pop()?.trim();
|
|
37
|
+
if (name)
|
|
38
|
+
names.add(name);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
for (const [, specifier] of source.matchAll(STAR_REEXPORT)) {
|
|
42
|
+
const target = moduleFile(base === '.' ? specifier : `${base}/${specifier}`);
|
|
43
|
+
for (const name of namesReachableFrom(target, seen))
|
|
44
|
+
names.add(name);
|
|
45
|
+
}
|
|
46
|
+
return names;
|
|
47
|
+
}
|
|
48
|
+
const sources = globSync('**/*.ts', { cwd: SRC_DIR }).filter((file) => !/\.(stories|test|d)\.ts$/.test(file));
|
|
49
|
+
const declared = new Set(sources.flatMap((file) => [...read(file).matchAll(DECLARED)].map(([, n]) => n)));
|
|
50
|
+
const propTypes = new Set(sources.flatMap((file) => [...read(file).matchAll(PROP_TYPE)].map(([, t]) => t)));
|
|
51
|
+
const fromConstantsModules = new Set(sources
|
|
52
|
+
.filter((file) => file.endsWith('index.constants.ts'))
|
|
53
|
+
.flatMap((file) => [...read(file).matchAll(DECLARED)].map(([, n]) => n)));
|
|
54
|
+
const rootExports = namesReachableFrom(ROOT_BARREL);
|
|
55
|
+
describe('public constants surface', () => {
|
|
56
|
+
it('finds sources, prop types and root exports to check', () => {
|
|
57
|
+
expect(sources.length).toBeGreaterThan(0);
|
|
58
|
+
expect(propTypes.size).toBeGreaterThan(0);
|
|
59
|
+
expect(fromConstantsModules.size).toBeGreaterThan(0);
|
|
60
|
+
expect(rootExports.size).toBeGreaterThan(0);
|
|
61
|
+
});
|
|
62
|
+
it('exports every constant used as a prop type from the package root', () => {
|
|
63
|
+
const unreachable = [...propTypes]
|
|
64
|
+
.filter((name) => declared.has(name) && !INTERNAL.has(name) && !rootExports.has(name))
|
|
65
|
+
.sort();
|
|
66
|
+
expect(unreachable).toEqual([]);
|
|
67
|
+
});
|
|
68
|
+
it('exports every index.constants.ts declaration from the package root', () => {
|
|
69
|
+
const unreachable = [...fromConstantsModules]
|
|
70
|
+
.filter((name) => !INTERNAL.has(name) && !rootExports.has(name))
|
|
71
|
+
.sort();
|
|
72
|
+
expect(unreachable).toEqual([]);
|
|
73
|
+
});
|
|
74
|
+
});
|
package/dist/meta/index.js
CHANGED
|
@@ -5,6 +5,8 @@ import { StatusBadge } from '../badge/status-badge.component';
|
|
|
5
5
|
import { Button } from '../button/index';
|
|
6
6
|
import { ButtonGroup } from '../button-group/button-group';
|
|
7
7
|
import { ButtonGroupItem } from '../button-group/button-group-item';
|
|
8
|
+
import { ButtonBar } from '../button-bar/button-bar';
|
|
9
|
+
import { ButtonBarItem } from '../button-bar/button-bar-item';
|
|
8
10
|
import { CapacityBar } from '../capacity-bar/index';
|
|
9
11
|
import { Card } from '../card/card.component';
|
|
10
12
|
import { CardCarousel } from '../card/card-carousel.component';
|
|
@@ -88,6 +90,8 @@ export const allMeta = [
|
|
|
88
90
|
Button.meta,
|
|
89
91
|
ButtonGroup.meta,
|
|
90
92
|
ButtonGroupItem.meta,
|
|
93
|
+
ButtonBar.meta,
|
|
94
|
+
ButtonBarItem.meta,
|
|
91
95
|
CapacityBar.meta,
|
|
92
96
|
Card.meta,
|
|
93
97
|
CardCarousel.meta,
|