@teseor/css 1.14.2 → 1.14.3
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/package.json +1 -1
- package/src/base/root.docs.json +35 -0
- package/src/components/actions/button/button.visual.spec.ts +5 -1
- package/src/components/actions/button-group/button-group.visual.spec.ts +5 -1
- package/src/components/actions/close-button/close-button.visual.spec.ts +5 -1
- package/src/components/content/divider/divider.visual.spec.ts +5 -1
- package/src/components/content/scroll-area/scroll-area.visual.spec.ts +5 -1
- package/src/components/content/spacer/spacer.visual.spec.ts +1 -1
- package/src/components/data-display/avatar/avatar.visual.spec.ts +5 -1
- package/src/components/data-display/badge/badge.visual.spec.ts +5 -1
- package/src/components/data-display/card/card.visual.spec.ts +5 -1
- package/src/components/data-display/data-list/data-list.visual.spec.ts +5 -1
- package/src/components/data-display/icon/icon.visual.spec.ts +5 -1
- package/src/components/data-display/image/image.visual.spec.ts +5 -1
- package/src/components/data-display/stat/stat.visual.spec.ts +5 -1
- package/src/components/data-display/status/status.visual.spec.ts +5 -1
- package/src/components/data-display/table/table.visual.spec.ts +5 -1
- package/src/components/data-display/tag/tag.visual.spec.ts +5 -1
- package/src/components/disclosure/accordion/accordion.visual.spec.ts +5 -1
- package/src/components/disclosure/disclosure/disclosure.visual.spec.ts +5 -1
- package/src/components/feedback/alert/alert.visual.spec.ts +5 -1
- package/src/components/feedback/progress/progress.visual.spec.ts +5 -1
- package/src/components/feedback/progress-circle/progress-circle.visual.spec.ts +5 -1
- package/src/components/feedback/skeleton/skeleton.visual.spec.ts +5 -1
- package/src/components/feedback/spinner/spinner.visual.spec.ts +5 -1
- package/src/components/feedback/toast/toast.visual.spec.ts +5 -1
- package/src/components/forms/checkbox/checkbox.visual.spec.ts +5 -1
- package/src/components/forms/checkbox-group/checkbox-group.visual.spec.ts +5 -1
- package/src/components/forms/field/field.visual.spec.ts +5 -1
- package/src/components/forms/fieldset/fieldset.visual.spec.ts +5 -1
- package/src/components/forms/form/form.visual.spec.ts +5 -1
- package/src/components/forms/form-error/form-error.visual.spec.ts +5 -1
- package/src/components/forms/form-helper/form-helper.visual.spec.ts +5 -1
- package/src/components/forms/input/input.visual.spec.ts +5 -1
- package/src/components/forms/label/label.visual.spec.ts +5 -1
- package/src/components/forms/number-input/number-input.visual.spec.ts +5 -1
- package/src/components/forms/password-input/password-input.visual.spec.ts +5 -1
- package/src/components/forms/radio/radio.visual.spec.ts +5 -1
- package/src/components/forms/radio-group/radio-group.visual.spec.ts +5 -1
- package/src/components/forms/search-input/search-input.visual.spec.ts +5 -1
- package/src/components/forms/select/select.visual.spec.ts +5 -1
- package/src/components/forms/slider/slider.visual.spec.ts +5 -1
- package/src/components/forms/textarea/textarea.visual.spec.ts +5 -1
- package/src/components/forms/toggle/toggle.visual.spec.ts +5 -1
- package/src/components/navigation/breadcrumb/breadcrumb.visual.spec.ts +5 -1
- package/src/components/navigation/dropdown-menu/dropdown-menu.visual.spec.ts +5 -1
- package/src/components/navigation/menu/menu.visual.spec.ts +5 -1
- package/src/components/navigation/nav/nav.visual.spec.ts +5 -1
- package/src/components/navigation/pagination/pagination.visual.spec.ts +5 -1
- package/src/components/navigation/tabs/tabs.visual.spec.ts +5 -1
- package/src/components/overlays/dialog/dialog.visual.spec.ts +5 -1
- package/src/components/overlays/drawer/drawer.visual.spec.ts +5 -1
- package/src/components/overlays/modal/modal.visual.spec.ts +5 -1
- package/src/components/overlays/overlay/overlay.visual.spec.ts +5 -1
- package/src/components/overlays/popover/popover.visual.spec.ts +5 -1
- package/src/components/overlays/tooltip/tooltip.visual.spec.ts +5 -1
- package/src/components/typography/blockquote/blockquote.visual.spec.ts +5 -1
- package/src/components/typography/code/code.visual.spec.ts +5 -1
- package/src/components/typography/code-block/code-block.visual.spec.ts +5 -1
- package/src/components/typography/heading/heading.visual.spec.ts +5 -1
- package/src/components/typography/kbd/kbd.visual.spec.ts +5 -1
- package/src/components/typography/link/link.visual.spec.ts +5 -1
- package/src/components/typography/list/list.visual.spec.ts +5 -1
- package/src/components/typography/mark/mark.visual.spec.ts +5 -1
- package/src/config/{tokens → guides}/accessibility.docs.json +1 -0
- package/src/config/guides/getting-started.docs.json +106 -0
- package/src/config/{tokens → guides}/theming.docs.json +1 -0
- package/src/config/tokens/design-tokens.docs.json +239 -0
- package/src/debug/debug.docs.json +96 -0
- package/src/debug/index.scss +81 -1
- package/src/layout/app-shell/app-shell.visual.spec.ts +1 -1
- package/src/layout/aspect-ratio/aspect-ratio.visual.spec.ts +1 -1
- package/src/layout/box/box.visual.spec.ts +1 -1
- package/src/layout/center/center.visual.spec.ts +1 -1
- package/src/layout/column/column.visual.spec.ts +1 -1
- package/src/layout/content/content.visual.spec.ts +1 -1
- package/src/layout/footer/footer.visual.spec.ts +1 -1
- package/src/layout/grid/grid.visual.spec.ts +1 -1
- package/src/layout/nav-rail/nav-rail.visual.spec.ts +1 -1
- package/src/layout/page-header/page-header.visual.spec.ts +1 -1
- package/src/layout/row/row.visual.spec.ts +1 -1
- package/src/layout/sidebar/sidebar.visual.spec.ts +1 -1
- package/src/layout/sidebar-nav/sidebar-nav.visual.spec.ts +1 -1
- package/src/layout/topbar/topbar.visual.spec.ts +1 -1
- package/src/debug/grid-overlay.scss +0 -81
- package/src/testing/api-types.ts +0 -20
- package/src/testing/grid-alignment.spec.ts +0 -38
- package/src/testing/html-generator.ts +0 -151
- package/src/testing/index.ts +0 -15
- package/src/testing/page-setup.ts +0 -149
- package/src/testing/rhythm.ts +0 -146
- package/src/testing/scaffold.ts +0 -50
package/src/testing/rhythm.ts
DELETED
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
import type { Page } from '@playwright/test';
|
|
2
|
-
|
|
3
|
-
// Elements that are fluid containers (viewport-dependent)
|
|
4
|
-
const SKIP_SELECTORS = [
|
|
5
|
-
'html',
|
|
6
|
-
'body',
|
|
7
|
-
'main',
|
|
8
|
-
'aside',
|
|
9
|
-
'.ui-sidebar',
|
|
10
|
-
'.ui-main',
|
|
11
|
-
'.ui-app-shell',
|
|
12
|
-
'.ui-drawer', // Fluid panel - adapts to container/viewport
|
|
13
|
-
];
|
|
14
|
-
|
|
15
|
-
// Inline elements that don't follow grid
|
|
16
|
-
const INLINE_TAGS = [
|
|
17
|
-
'STRONG',
|
|
18
|
-
'B',
|
|
19
|
-
'EM',
|
|
20
|
-
'I',
|
|
21
|
-
'SMALL',
|
|
22
|
-
'SPAN',
|
|
23
|
-
'A',
|
|
24
|
-
'CODE',
|
|
25
|
-
'ABBR',
|
|
26
|
-
'CITE',
|
|
27
|
-
'Q',
|
|
28
|
-
'SUB',
|
|
29
|
-
'SUP',
|
|
30
|
-
'MARK',
|
|
31
|
-
'BR',
|
|
32
|
-
'WBR',
|
|
33
|
-
];
|
|
34
|
-
|
|
35
|
-
export interface RhythmViolation {
|
|
36
|
-
selector: string;
|
|
37
|
-
height: number;
|
|
38
|
-
expected: number;
|
|
39
|
-
offBy: number;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Validates that all elements in a component follow the 8px grid rhythm
|
|
44
|
-
* Throws an error if violations are found
|
|
45
|
-
*/
|
|
46
|
-
export async function validateGridRhythm(
|
|
47
|
-
page: Page,
|
|
48
|
-
componentName: string,
|
|
49
|
-
): Promise<RhythmViolation[]> {
|
|
50
|
-
const violations = await page.evaluate(
|
|
51
|
-
({ skipSelectors, inlineTags, component }) => {
|
|
52
|
-
// Get unit from CSS custom property (default 8px)
|
|
53
|
-
// Note: PostCSS prefixes --unit to --ui-unit in compiled CSS
|
|
54
|
-
const temp = document.createElement('div');
|
|
55
|
-
temp.style.cssText = 'position:absolute;visibility:hidden;width:var(--ui-unit, 8px)';
|
|
56
|
-
document.body.appendChild(temp);
|
|
57
|
-
const unit = temp.getBoundingClientRect().width || 8;
|
|
58
|
-
document.body.removeChild(temp);
|
|
59
|
-
|
|
60
|
-
const results: Array<{ selector: string; height: number; expected: number; offBy: number }> =
|
|
61
|
-
[];
|
|
62
|
-
|
|
63
|
-
// Target component elements
|
|
64
|
-
const selector = `.ui-${component}, .ui-${component} *`;
|
|
65
|
-
const elements = document.querySelectorAll(selector);
|
|
66
|
-
|
|
67
|
-
for (const el of elements) {
|
|
68
|
-
const tagName = el.tagName;
|
|
69
|
-
|
|
70
|
-
// Skip script, style, SVG internals, etc.
|
|
71
|
-
const upperTag = tagName.toUpperCase();
|
|
72
|
-
if (
|
|
73
|
-
[
|
|
74
|
-
'SCRIPT',
|
|
75
|
-
'STYLE',
|
|
76
|
-
'LINK',
|
|
77
|
-
'META',
|
|
78
|
-
'TITLE',
|
|
79
|
-
'HEAD',
|
|
80
|
-
'SVG',
|
|
81
|
-
'PATH',
|
|
82
|
-
'CIRCLE',
|
|
83
|
-
'RECT',
|
|
84
|
-
'LINE',
|
|
85
|
-
'POLYGON',
|
|
86
|
-
'POLYLINE',
|
|
87
|
-
'ELLIPSE',
|
|
88
|
-
'G',
|
|
89
|
-
'DEFS',
|
|
90
|
-
'USE',
|
|
91
|
-
'SYMBOL',
|
|
92
|
-
'CLIPPATH',
|
|
93
|
-
'MASK',
|
|
94
|
-
'PATTERN',
|
|
95
|
-
'IMAGE',
|
|
96
|
-
'TEXT',
|
|
97
|
-
'TSPAN',
|
|
98
|
-
'TEXTPATH',
|
|
99
|
-
'FOREIGNOBJECT',
|
|
100
|
-
].includes(upperTag)
|
|
101
|
-
)
|
|
102
|
-
continue;
|
|
103
|
-
|
|
104
|
-
// Skip inline elements
|
|
105
|
-
if (inlineTags.includes(tagName)) continue;
|
|
106
|
-
|
|
107
|
-
// Skip BEM element children (__element) - only check blocks and modifiers
|
|
108
|
-
const classes = el.className?.toString?.() || '';
|
|
109
|
-
if (classes.includes('__')) continue;
|
|
110
|
-
|
|
111
|
-
// Skip fluid containers
|
|
112
|
-
if (skipSelectors.some((sel) => el.matches(sel))) continue;
|
|
113
|
-
|
|
114
|
-
const height = el.getBoundingClientRect().height;
|
|
115
|
-
// Skip zero-height and decorative lines (borders, dividers < half unit)
|
|
116
|
-
if (height === 0 || height < unit / 2) continue;
|
|
117
|
-
|
|
118
|
-
const remainder = height % unit;
|
|
119
|
-
const isAligned = remainder < 0.5 || remainder > unit - 0.5;
|
|
120
|
-
|
|
121
|
-
if (!isAligned) {
|
|
122
|
-
const firstClass = classes.split(' ')[0];
|
|
123
|
-
results.push({
|
|
124
|
-
selector: `${tagName.toLowerCase()}${firstClass ? `.${firstClass}` : ''}`,
|
|
125
|
-
height: Math.round(height * 10) / 10,
|
|
126
|
-
expected: Math.round(height / unit) * unit,
|
|
127
|
-
offBy: Math.round(remainder * 10) / 10,
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
return results;
|
|
133
|
-
},
|
|
134
|
-
{ skipSelectors: SKIP_SELECTORS, inlineTags: INLINE_TAGS, component: componentName },
|
|
135
|
-
);
|
|
136
|
-
|
|
137
|
-
if (violations.length > 0) {
|
|
138
|
-
console.log(`Grid rhythm violations in ${componentName}:`);
|
|
139
|
-
console.table(violations);
|
|
140
|
-
throw new Error(
|
|
141
|
-
`Grid rhythm violations in ${componentName}:\n${JSON.stringify(violations, null, 2)}`,
|
|
142
|
-
);
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
return violations;
|
|
146
|
-
}
|
package/src/testing/scaffold.ts
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
export const scaffoldCss = `
|
|
2
|
-
html {
|
|
3
|
-
font-size: 16px;
|
|
4
|
-
}
|
|
5
|
-
body {
|
|
6
|
-
background-image:
|
|
7
|
-
linear-gradient(45deg, #f0f0f0 25%, transparent 25%),
|
|
8
|
-
linear-gradient(-45deg, #f0f0f0 25%, transparent 25%),
|
|
9
|
-
linear-gradient(45deg, transparent 75%, #f0f0f0 75%),
|
|
10
|
-
linear-gradient(-45deg, transparent 75%, #f0f0f0 75%);
|
|
11
|
-
background-size: 12px 12px;
|
|
12
|
-
background-position: 0 0, 0 6px, 6px -6px, -6px 0px;
|
|
13
|
-
background-color: #fafafa;
|
|
14
|
-
}
|
|
15
|
-
.test-container {
|
|
16
|
-
padding: 1.5rem;
|
|
17
|
-
}
|
|
18
|
-
.test-title {
|
|
19
|
-
font-family: var(--ui-font-sans, system-ui, sans-serif);
|
|
20
|
-
font-size: 1.5rem;
|
|
21
|
-
font-weight: 600;
|
|
22
|
-
margin-block-end: 1.5rem;
|
|
23
|
-
}
|
|
24
|
-
.test-section {
|
|
25
|
-
margin-block-end: 1.5rem;
|
|
26
|
-
}
|
|
27
|
-
.test-section-title {
|
|
28
|
-
font-family: var(--ui-font-sans, system-ui, sans-serif);
|
|
29
|
-
font-size: 0.75rem;
|
|
30
|
-
color: #666;
|
|
31
|
-
text-transform: uppercase;
|
|
32
|
-
letter-spacing: 0.05em;
|
|
33
|
-
margin-block-end: 0.5rem;
|
|
34
|
-
}
|
|
35
|
-
.test-row {
|
|
36
|
-
display: flex;
|
|
37
|
-
gap: 1rem;
|
|
38
|
-
align-items: center;
|
|
39
|
-
flex-wrap: wrap;
|
|
40
|
-
}
|
|
41
|
-
.test-grid {
|
|
42
|
-
display: grid;
|
|
43
|
-
grid-template-columns: repeat(auto-fill, minmax(100px, max-content));
|
|
44
|
-
gap: 1rem;
|
|
45
|
-
align-items: start;
|
|
46
|
-
}
|
|
47
|
-
.test-element--block {
|
|
48
|
-
width: 200px;
|
|
49
|
-
}
|
|
50
|
-
`;
|