@rt-tools/ui-kit 0.0.16 → 0.0.20
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/fesm2022/rt-tools-ui-kit.mjs +310 -75
- package/fesm2022/rt-tools-ui-kit.mjs.map +1 -1
- package/package.json +1 -1
- package/rt-tools-ui-kit-0.0.20.tgz +0 -0
- package/src/lib/ui-kit/action-bar/components/bar/rtui-action-bar.component.scss +18 -18
- package/src/lib/ui-kit/action-bar/components/container/rtui-action-bar-container.component.scss +5 -7
- package/src/lib/ui-kit/aside/components/container/aside-container.component.scss +1 -0
- package/src/lib/ui-kit/aside/components/error-notification/aside-error-box.component.scss +6 -6
- package/src/lib/ui-kit/aside/components/panel/aside-panel.component.scss +33 -40
- package/src/lib/ui-kit/aside/stories/aside-component/test-aside.component.scss +1 -1
- package/src/lib/ui-kit/buttons/icon-round/rtui-round-icon-button.component.scss +4 -4
- package/src/lib/ui-kit/buttons/multi-button/rtui-multi-button.component.scss +13 -13
- package/src/lib/ui-kit/checkbox/rtui-checkbox.component.scss +11 -11
- package/src/lib/ui-kit/checkbox/stories/component/test-checkbox.component.scss +2 -2
- package/src/lib/ui-kit/dynamic-selectors/components/actions/rtui-dynamic-selector-list-actions.component.scss +3 -3
- package/src/lib/ui-kit/dynamic-selectors/components/dynamic-selector/rtui-dynamic-selector.component.scss +3 -3
- package/src/lib/ui-kit/dynamic-selectors/components/multi-selector-popup/rtui-multi-selector-popup.component.scss +28 -28
- package/src/lib/ui-kit/dynamic-selectors/components/placeholder/rtui-dynamic-selector-placeholder.component.scss +6 -7
- package/src/lib/ui-kit/dynamic-selectors/components/selected-list/rtui-dynamic-selector-selected-list.component.scss +2 -2
- package/src/lib/ui-kit/dynamic-selectors/strories/component/input/test-dynamic-input.component.scss +2 -3
- package/src/lib/ui-kit/dynamic-selectors/strories/component/selector/test-selector.component.scss +4 -5
- package/src/lib/ui-kit/file-uploader/rtui-file-upload.component.scss +8 -8
- package/src/lib/ui-kit/file-uploader/stories/component/test-file-upload.component.scss +1 -1
- package/src/lib/ui-kit/header/header.component.scss +1 -0
- package/src/lib/ui-kit/header/stories/component/test-header.component.scss +3 -3
- package/src/lib/ui-kit/image-uploader/image-uploader/rtui-image-upload.component.scss +5 -5
- package/src/lib/ui-kit/image-uploader/stories/component/test-image-upload.component.scss +2 -2
- package/src/lib/ui-kit/info-badge/info-badge.component.scss +20 -19
- package/src/lib/ui-kit/info-badge/stories/component/test-info-badge/test-info-badge.component.scss +1 -1
- package/src/lib/ui-kit/modal/modal.component.scss +9 -9
- package/src/lib/ui-kit/popover/rtui-popover-container.component.scss +2 -3
- package/src/lib/ui-kit/scrollable/scrollable-container.component.scss +7 -9
- package/src/lib/ui-kit/side-menu/menu/rtui-side-menu.component.scss +26 -26
- package/src/lib/ui-kit/side-menu/menu-sub-item/rtui-side-menu-sub-item.component.scss +15 -15
- package/src/lib/ui-kit/side-menu/stories/component/test-side-menu-wrapper.component.scss +10 -10
- package/src/lib/ui-kit/snack-bar/snack-bar.component.scss +13 -13
- package/src/lib/ui-kit/snack-bar/stories/component/test-snack-bar.component.scss +3 -3
- package/src/lib/ui-kit/spinner/spinner.component.scss +12 -15
- package/src/lib/ui-kit/table/components/clear-search-button/rtui-clear-button.component.scss +8 -8
- package/src/lib/ui-kit/table/components/pagination-view/rtui-pagination.component.scss +20 -28
- package/src/lib/ui-kit/table/components/table-base-cell/table-base-cell.component.scss +9 -10
- package/src/lib/ui-kit/table/components/table-config-aside/rt-table-config-aside.component.scss +1 -1
- package/src/lib/ui-kit/table/components/table-container/table-container.component.scss +21 -19
- package/src/lib/ui-kit/table/components/table-header-cell/table-header-cell.component.scss +8 -9
- package/src/lib/ui-kit/table/components/table-header-filter-cell/table-header-filter-cell.component.scss +3 -3
- package/src/lib/ui-kit/table/dynamic-list.component.scss +2 -2
- package/src/lib/ui-kit/table/stories/dynamic-list/test-dynamic-list.component.scss +1 -1
- package/src/lib/ui-kit/table/stories/pagination/test-pagination-component.scss +4 -4
- package/src/lib/ui-kit/table/stories/table/test-table-component.scss +1 -1
- package/src/lib/ui-kit/toggle/rtui-toggle.component.scss +23 -29
- package/src/lib/ui-kit/toggle/stories/component/test-toggle.component.scss +2 -2
- package/src/lib/ui-kit/toolbar/toolbar.component.scss +6 -11
- package/src/styles/TOKENS.md +121 -0
- package/src/styles/base/_base.scss +7 -15
- package/src/styles/base/_color-scheme.scss +86 -0
- package/src/styles/base/_mixin.scss +12 -15
- package/src/styles/base/_tokens.scss +426 -0
- package/src/styles/base/_variables.scss +7 -13
- package/src/styles/color-scheme.spec.ts +236 -0
- package/src/styles/components/_action-bar.scss +8 -8
- package/src/styles/components/_button.scss +63 -55
- package/src/styles/components/_checkbox.scss +5 -5
- package/src/styles/components/_dynamic-selectors.scss +13 -14
- package/src/styles/components/_form.scss +8 -13
- package/src/styles/components/_material-bridge.scss +30 -0
- package/src/styles/components/_rtui_button.scss +82 -82
- package/src/styles/components/_snackbar.scss +14 -14
- package/src/styles/components/_table.scss +34 -50
- package/src/styles/main.scss +5 -0
- package/src/styles/tokens.scss +5 -0
- package/styles/tokens.css +301 -0
- package/types/rt-tools-ui-kit.d.ts +101 -2
- package/rt-tools-ui-kit-0.0.16.tgz +0 -0
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
import * as path from 'path';
|
|
2
|
+
import * as sass from 'sass';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Build-time guarantees for the custom color-scheme mechanism:
|
|
6
|
+
* 1. Δ0 — moving the accent tier onto the `--rt-color-{role}-{N}` indirection
|
|
7
|
+
* keeps every accent semantic token byte-for-byte identical (own palette).
|
|
8
|
+
* 2. The `rt.color-scheme` Sass mixin emits a scoped `[data-rt-scheme]` block.
|
|
9
|
+
* 3. Input validation rejects unknown roles / out-of-range tones.
|
|
10
|
+
* 4. The teal case: a custom teal ramp drives `--rt-bg-accent-primary-solid` to teal.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
const STYLES_DIR: string = __dirname;
|
|
14
|
+
|
|
15
|
+
/** Frozen resolved (own-palette) values of every accent token BEFORE the indirection refactor. */
|
|
16
|
+
const BASELINE: Record<string, string> = {
|
|
17
|
+
'--rt-bg-accent-primary-subtle': 'light-dark(#eaedfc, color-mix(in srgb, #4284d7 18%, #1c1b1e))',
|
|
18
|
+
'--rt-bg-accent-primary-solid': '#4284d7',
|
|
19
|
+
'--rt-bg-accent-primary-hover': 'light-dark(color-mix(in srgb, #4284d7 90%, #000), color-mix(in srgb, #4284d7 90%, #fff))',
|
|
20
|
+
'--rt-bg-accent-primary-disabled': 'color-mix(in srgb, #4284d7 38%, transparent)',
|
|
21
|
+
'--rt-bg-accent-success-subtle': 'light-dark(#e5f8f4, color-mix(in srgb, #01af8d 18%, #1c1b1e))',
|
|
22
|
+
'--rt-bg-accent-success-solid': '#21b18e',
|
|
23
|
+
'--rt-bg-accent-success-hover': 'light-dark(color-mix(in srgb, #21b18e 90%, #000), color-mix(in srgb, #21b18e 90%, #fff))',
|
|
24
|
+
'--rt-bg-accent-success-disabled': 'color-mix(in srgb, #21b18e 38%, transparent)',
|
|
25
|
+
'--rt-bg-accent-warning-subtle': 'light-dark(#e8cbbf, color-mix(in srgb, #ef7128 18%, #1c1b1e))',
|
|
26
|
+
'--rt-bg-accent-warning-solid': '#ee7a34',
|
|
27
|
+
'--rt-bg-accent-warning-hover': 'light-dark(color-mix(in srgb, #ee7a34 90%, #000), color-mix(in srgb, #ee7a34 90%, #fff))',
|
|
28
|
+
'--rt-bg-accent-warning-disabled': 'color-mix(in srgb, #ee7a34 38%, transparent)',
|
|
29
|
+
'--rt-bg-accent-danger-subtle': 'light-dark(#fdedee, color-mix(in srgb, #eb5055 18%, #1c1b1e))',
|
|
30
|
+
'--rt-bg-accent-danger-solid': '#eb5055',
|
|
31
|
+
'--rt-bg-accent-danger-hover': 'light-dark(color-mix(in srgb, #eb5055 90%, #000), color-mix(in srgb, #eb5055 90%, #fff))',
|
|
32
|
+
'--rt-bg-accent-danger-disabled': 'color-mix(in srgb, #eb5055 38%, transparent)',
|
|
33
|
+
'--rt-bg-accent-info-subtle': 'light-dark(#eaedfc, color-mix(in srgb, #4284d7 18%, #1c1b1e))',
|
|
34
|
+
'--rt-bg-accent-info-solid': '#4284d7',
|
|
35
|
+
'--rt-bg-accent-info-hover': 'light-dark(color-mix(in srgb, #4284d7 90%, #000), color-mix(in srgb, #4284d7 90%, #fff))',
|
|
36
|
+
'--rt-bg-accent-info-disabled': 'color-mix(in srgb, #4284d7 38%, transparent)',
|
|
37
|
+
'--rt-text-accent-brand': 'light-dark(#0d1c2b, #e8e8e8)',
|
|
38
|
+
'--rt-text-accent-primary': 'light-dark(#4284d7, #6d96e8)',
|
|
39
|
+
'--rt-text-accent-success': '#01af8d',
|
|
40
|
+
'--rt-text-accent-success-soft': '#21b18e',
|
|
41
|
+
'--rt-text-accent-warning': '#ef7128',
|
|
42
|
+
'--rt-text-accent-warning-soft': '#ee7a34',
|
|
43
|
+
'--rt-text-accent-danger': '#eb5055',
|
|
44
|
+
'--rt-text-accent-danger-soft': '#e88487',
|
|
45
|
+
'--rt-text-accent-info': '#4284d7',
|
|
46
|
+
'--rt-text-accent-info-soft': '#4285f4',
|
|
47
|
+
'--rt-icon-accent-brand': 'light-dark(#0d1c2b, #e8e8e8)',
|
|
48
|
+
'--rt-icon-accent-primary': 'light-dark(#4284d7, #6d96e8)',
|
|
49
|
+
'--rt-icon-accent-success': '#01af8d',
|
|
50
|
+
'--rt-icon-accent-warning': '#ef7128',
|
|
51
|
+
'--rt-icon-accent-danger': '#eb5055',
|
|
52
|
+
'--rt-icon-accent-info': '#4284d7',
|
|
53
|
+
'--rt-border-accent-primary': 'light-dark(#4284d7, #6d96e8)',
|
|
54
|
+
'--rt-border-accent-success': '#01af8d',
|
|
55
|
+
'--rt-border-accent-warning': '#ef7128',
|
|
56
|
+
'--rt-border-accent-danger': '#eb5055',
|
|
57
|
+
'--rt-border-accent-danger-soft': '#e88487',
|
|
58
|
+
'--rt-border-accent-info': '#4284d7',
|
|
59
|
+
'--rt-border-focus': 'light-dark(#b3ceef, #6d96e8)',
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
/** Resolve `var(--mat-sys-X, FALLBACK)` to its fallback (own-palette, no Material configured). */
|
|
63
|
+
function stripMat(input: string): string {
|
|
64
|
+
let value: string = input;
|
|
65
|
+
let index: number = value.indexOf('var(--mat-sys-');
|
|
66
|
+
|
|
67
|
+
while (index >= 0) {
|
|
68
|
+
let depth: number = 0;
|
|
69
|
+
let j: number = index + 4;
|
|
70
|
+
|
|
71
|
+
for (; j < value.length; j++) {
|
|
72
|
+
if (value[j] === '(') {
|
|
73
|
+
depth++;
|
|
74
|
+
} else if (value[j] === ')') {
|
|
75
|
+
if (depth === 0) {
|
|
76
|
+
break;
|
|
77
|
+
}
|
|
78
|
+
depth--;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const inner: string = value.slice(index + 4, j);
|
|
83
|
+
const comma: number = inner.indexOf(',');
|
|
84
|
+
value = value.slice(0, index) + inner.slice(comma + 1).trim() + value.slice(j + 1);
|
|
85
|
+
index = value.indexOf('var(--mat-sys-');
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
return value;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/** Collapse `light-dark(X, X)` to `X` (identical branches render the same in both modes). */
|
|
92
|
+
function normalize(input: string): string {
|
|
93
|
+
let value: string = input.replace(/\s+/g, ' ').trim();
|
|
94
|
+
let prev: string = '';
|
|
95
|
+
|
|
96
|
+
while (value !== prev) {
|
|
97
|
+
prev = value;
|
|
98
|
+
value = value.replace(/light-dark\(\s*([^,()]+?)\s*,\s*\1\s*\)/g, '$1');
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return value.replace(/\s+/g, ' ').trim();
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/** Extract `--name: value;` declarations matching a name pattern from compiled CSS. */
|
|
105
|
+
function extractDeclarations(css: string, namePattern: string): Record<string, string> {
|
|
106
|
+
const out: Record<string, string> = {};
|
|
107
|
+
const re: RegExp = new RegExp(`(${namePattern}):\\s*([^;]+);`, 'g');
|
|
108
|
+
let match: RegExpExecArray | null = re.exec(css);
|
|
109
|
+
|
|
110
|
+
while (match !== null) {
|
|
111
|
+
out[match[1]] = match[2].trim();
|
|
112
|
+
match = re.exec(css);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
return out;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
function compileTokens(): string {
|
|
119
|
+
return sass.compile(path.join(STYLES_DIR, 'tokens.scss')).css;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
function compileWithMixin(body: string): sass.CompileResult {
|
|
123
|
+
return sass.compileString(`@use 'main' as rt;\n${body}`, { loadPaths: [STYLES_DIR] });
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
describe('rt-tools color schemes', () => {
|
|
127
|
+
describe('Δ0 regression — accent indirection keeps the own palette byte-for-byte', () => {
|
|
128
|
+
it('every accent semantic token resolves to its pre-refactor value', () => {
|
|
129
|
+
const css: string = compileTokens();
|
|
130
|
+
const ramp: Record<string, string> = extractDeclarations(css, '--rt-color-(?:primary|info|success|warning|danger|brand)-\\d+');
|
|
131
|
+
const semantic: Record<string, string> = extractDeclarations(
|
|
132
|
+
css,
|
|
133
|
+
'--rt-(?:bg|text|icon|border)-accent[\\w-]*|--rt-border-focus'
|
|
134
|
+
);
|
|
135
|
+
|
|
136
|
+
const resolveRamp: (value: string) => string = (value: string): string => {
|
|
137
|
+
let resolved: string = value;
|
|
138
|
+
let prev: string = '';
|
|
139
|
+
|
|
140
|
+
while (resolved !== prev) {
|
|
141
|
+
prev = resolved;
|
|
142
|
+
for (const key of Object.keys(ramp)) {
|
|
143
|
+
resolved = resolved.split(`var(${key})`).join(stripMat(ramp[key]));
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
return normalize(stripMat(resolved));
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
for (const token of Object.keys(BASELINE)) {
|
|
151
|
+
expect(semantic[token]).toBeDefined();
|
|
152
|
+
expect(resolveRamp(semantic[token])).toBe(BASELINE[token]);
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
describe('Material hybrid — default honors --mat-sys-*, a scheme overrides it', () => {
|
|
158
|
+
it('default ramp tones carry the --mat-sys-* fallback where the original token did', () => {
|
|
159
|
+
const ramp: Record<string, string> = extractDeclarations(
|
|
160
|
+
compileTokens(),
|
|
161
|
+
'--rt-color-(?:primary|info|success|warning|danger|brand)-\\d+'
|
|
162
|
+
);
|
|
163
|
+
|
|
164
|
+
// tones that mapped to a Material system color carry the fallback (default honors Material)
|
|
165
|
+
expect(ramp['--rt-color-primary-100']).toBe('var(--mat-sys-primary, #4284d7)');
|
|
166
|
+
expect(ramp['--rt-color-primary-20']).toBe('var(--mat-sys-primary-container, #eaedfc)');
|
|
167
|
+
expect(ramp['--rt-color-danger-100']).toBe('var(--mat-sys-error, #eb5055)');
|
|
168
|
+
expect(ramp['--rt-color-brand-100']).toBe('var(--mat-sys-primary, #0d1c2b)');
|
|
169
|
+
|
|
170
|
+
// roles with no Material mapping stay raw — and a scheme overriding ANY tone with a raw
|
|
171
|
+
// value drops the fallback entirely, so the scheme wins over an active Material theme.
|
|
172
|
+
expect(ramp['--rt-color-info-100']).toBe('#4284d7');
|
|
173
|
+
expect(ramp['--rt-color-success-100']).toBe('#01af8d');
|
|
174
|
+
expect(ramp['--rt-color-warning-100']).toBe('#ef7128');
|
|
175
|
+
});
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
describe('dark mode — a scheme drives both modes via distinct ramp tones', () => {
|
|
179
|
+
it('accent tokens pick tone-100 in light and tone-60 in dark (scheme controls each)', () => {
|
|
180
|
+
const semantic: Record<string, string> = extractDeclarations(
|
|
181
|
+
compileTokens(),
|
|
182
|
+
'--rt-text-accent-primary|--rt-border-accent-primary|--rt-icon-accent-primary'
|
|
183
|
+
);
|
|
184
|
+
|
|
185
|
+
// light-dark(primary-100, primary-60): the kit fixes WHICH tone per mode; the scheme
|
|
186
|
+
// supplies the VALUE of each tone → a scheme can set a different dark tone (tone-60) than light.
|
|
187
|
+
for (const token of Object.keys(semantic)) {
|
|
188
|
+
expect(semantic[token]).toContain('var(--rt-color-primary-100)');
|
|
189
|
+
expect(semantic[token]).toContain('var(--rt-color-primary-60)');
|
|
190
|
+
expect(semantic[token].indexOf('primary-100')).toBeLessThan(semantic[token].indexOf('primary-60'));
|
|
191
|
+
}
|
|
192
|
+
});
|
|
193
|
+
});
|
|
194
|
+
|
|
195
|
+
describe('rt.color-scheme mixin', () => {
|
|
196
|
+
it('emits a scoped [data-rt-scheme] block with only raw role rows', () => {
|
|
197
|
+
const css: string = compileWithMixin(
|
|
198
|
+
'@include rt.color-scheme(\'teal\', (primary: (20: #b3e3e1, 100: #008582), brand: (100: #008582)));'
|
|
199
|
+
).css;
|
|
200
|
+
|
|
201
|
+
const block: string = css.slice(css.indexOf('[data-rt-scheme=teal]'));
|
|
202
|
+
|
|
203
|
+
expect(block).toContain('[data-rt-scheme=teal]');
|
|
204
|
+
expect(block).toContain('--rt-color-primary-100: #008582');
|
|
205
|
+
expect(block).toContain('--rt-color-primary-20: #b3e3e1');
|
|
206
|
+
expect(block).toContain('--rt-color-brand-100: #008582');
|
|
207
|
+
// schemes never duplicate the semantic derivation layer
|
|
208
|
+
expect(block).not.toContain('--rt-bg-accent-primary-solid:');
|
|
209
|
+
});
|
|
210
|
+
|
|
211
|
+
it('rejects an unknown role', () => {
|
|
212
|
+
expect(() => compileWithMixin('@include rt.color-scheme(\'x\', (foo: (100: #000000)));')).toThrow(/unknown role/i);
|
|
213
|
+
});
|
|
214
|
+
|
|
215
|
+
it('rejects an out-of-range tone', () => {
|
|
216
|
+
expect(() => compileWithMixin('@include rt.color-scheme(\'x\', (primary: (150: #000000)));')).toThrow(/integer 0–100/i);
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
it('rejects an empty role map', () => {
|
|
220
|
+
expect(() => compileWithMixin('@include rt.color-scheme(\'x\', ());')).toThrow(/non-empty map/i);
|
|
221
|
+
});
|
|
222
|
+
});
|
|
223
|
+
|
|
224
|
+
describe('teal reference case', () => {
|
|
225
|
+
it('a teal primary ramp recolors --rt-bg-accent-primary-solid to teal', () => {
|
|
226
|
+
const css: string = compileWithMixin(
|
|
227
|
+
'@include rt.color-scheme(\'teal\', (primary: (20: #b3e3e1, 40: #5cb8b5, 60: #1a9d99, 100: #008582)));'
|
|
228
|
+
).css;
|
|
229
|
+
|
|
230
|
+
const scheme: Record<string, string> = extractDeclarations(css, '--rt-color-primary-\\d+');
|
|
231
|
+
// bg-accent-primary-solid === var(--rt-color-primary-100); under the teal scheme that is #008582
|
|
232
|
+
expect(scheme['--rt-color-primary-100']).toBe('#008582');
|
|
233
|
+
expect(normalize(stripMat(css.match(/--rt-bg-accent-primary-solid:\s*([^;]+);/)![1]))).toBe('var(--rt-color-primary-100)');
|
|
234
|
+
});
|
|
235
|
+
});
|
|
236
|
+
});
|
|
@@ -15,9 +15,9 @@ $action-bar: (
|
|
|
15
15
|
gap: 0.75rem,
|
|
16
16
|
padding: 0.5rem 1rem,
|
|
17
17
|
border-radius: 0.5rem,
|
|
18
|
-
color: var(--
|
|
19
|
-
background-color: var(--
|
|
20
|
-
box-shadow: 0 0.5rem 1rem 0 var(--
|
|
18
|
+
color: var(--rt-text-base-inverse),
|
|
19
|
+
background-color: var(--rt-bg-base-inverse),
|
|
20
|
+
box-shadow: 0 0.5rem 1rem 0 var(--rt-shadow-color),
|
|
21
21
|
),
|
|
22
22
|
bar-mobile: (
|
|
23
23
|
gap: 0.5rem,
|
|
@@ -45,15 +45,15 @@ $action-bar: (
|
|
|
45
45
|
padding: 0.325rem 0.5rem,
|
|
46
46
|
),
|
|
47
47
|
action-hover: (
|
|
48
|
-
background-color: var(--
|
|
48
|
+
background-color: var(--rt-bg-base-inverse-soft),
|
|
49
49
|
),
|
|
50
50
|
action-menu: (
|
|
51
51
|
gap: 0.5rem,
|
|
52
52
|
padding: 0.5rem,
|
|
53
53
|
border-radius: 0.5rem,
|
|
54
|
-
color: var(--
|
|
55
|
-
background-color: var(--
|
|
56
|
-
box-shadow: 0 0.5rem 1rem 0 var(--
|
|
54
|
+
color: var(--rt-text-base-strong),
|
|
55
|
+
background-color: var(--rt-bg-base-base),
|
|
56
|
+
box-shadow: 0 0.5rem 1rem 0 var(--rt-shadow-color),
|
|
57
57
|
),
|
|
58
58
|
action-menu-mobile: (
|
|
59
59
|
gap: 0.25rem,
|
|
@@ -71,7 +71,7 @@ $action-bar: (
|
|
|
71
71
|
padding: 0.325rem 0.5rem,
|
|
72
72
|
),
|
|
73
73
|
action-menu-action-hover: (
|
|
74
|
-
background-color: var(--
|
|
74
|
+
background-color: var(--rt-bg-base-emphasis-soft),
|
|
75
75
|
),
|
|
76
76
|
);
|
|
77
77
|
|
|
@@ -1,105 +1,113 @@
|
|
|
1
|
+
/// @deprecated — legacy `.c-button` system. New code uses `.rtui-btn` (_rtui_button.scss);
|
|
2
|
+
/// ~60% of this module duplicates it. Kept because consumers still apply `.c-button`
|
|
3
|
+
/// classes AND override `--rt-button-*` vars directly (incl. dark mode) — rerouting these rules
|
|
4
|
+
/// onto `--rt-rtui-btn-*` would silently kill those overrides. Removal plan (next major):
|
|
5
|
+
/// map classes `--fill-green→success`, `--fill-red→error`, `--fill-blue→accent-light`,
|
|
6
|
+
/// `--outline-*→*-outline`; `--txt-*`/`--fab` first need a text/icon appearance in .rtui-btn.
|
|
7
|
+
/// See TOKENS.md "Buttons: legacy vs rtui".
|
|
1
8
|
@use '../base/mixin' as mixins;
|
|
2
9
|
@use '../base/variables' as vars;
|
|
3
10
|
@use 'sass:color' as color;
|
|
4
11
|
|
|
5
12
|
$button: (
|
|
6
13
|
base: (
|
|
7
|
-
color: var(--
|
|
14
|
+
color: var(--rt-color-neutral-100),
|
|
8
15
|
font-family: var(--font-default),
|
|
9
16
|
),
|
|
10
17
|
fab: (
|
|
11
|
-
color: var(--
|
|
18
|
+
color: var(--rt-color-neutral-60),
|
|
12
19
|
),
|
|
13
20
|
fab-hover: (
|
|
14
|
-
color: var(--
|
|
21
|
+
color: var(--rt-color-neutral-100),
|
|
15
22
|
),
|
|
16
23
|
text-hover: (
|
|
17
|
-
background: var(--
|
|
24
|
+
background: var(--rt-color-neutral-15),
|
|
18
25
|
),
|
|
19
26
|
text-focus: (
|
|
20
|
-
background: var(--
|
|
27
|
+
background: var(--rt-color-neutral-25),
|
|
21
28
|
),
|
|
22
29
|
text-active: (
|
|
23
|
-
background:
|
|
30
|
+
background: #b2cbca,
|
|
31
|
+
// palette outlier, no neutral-scale equivalent
|
|
24
32
|
),
|
|
25
33
|
text-base: (
|
|
26
|
-
color: var(--
|
|
34
|
+
color: var(--rt-color-neutral-60),
|
|
27
35
|
),
|
|
28
36
|
text-base-hover: (
|
|
29
|
-
color: var(--
|
|
37
|
+
color: var(--rt-color-neutral-100),
|
|
30
38
|
),
|
|
31
39
|
text-gray: (
|
|
32
|
-
color: var(--
|
|
40
|
+
color: var(--rt-color-neutral-60),
|
|
33
41
|
),
|
|
34
42
|
text-gray-hover: (
|
|
35
|
-
color: var(--
|
|
43
|
+
color: var(--rt-color-blue-60),
|
|
36
44
|
),
|
|
37
45
|
text-blue: (
|
|
38
|
-
color: var(--
|
|
46
|
+
color: var(--rt-color-blue-100),
|
|
39
47
|
),
|
|
40
48
|
text-blue-hover: (
|
|
41
|
-
color: var(--
|
|
49
|
+
color: var(--rt-color-neutral-100),
|
|
42
50
|
),
|
|
43
51
|
fill-base: (
|
|
44
|
-
background-color: var(--
|
|
45
|
-
color: var(--
|
|
52
|
+
background-color: var(--rt-color-neutral-100),
|
|
53
|
+
color: var(--rt-color-neutral-0),
|
|
46
54
|
),
|
|
47
55
|
fill-blue: (
|
|
48
|
-
background-color: var(--
|
|
49
|
-
color: var(--
|
|
56
|
+
background-color: var(--rt-color-blue-20),
|
|
57
|
+
color: var(--rt-color-blue-100),
|
|
50
58
|
),
|
|
51
59
|
fill-gray: (
|
|
52
|
-
background-color: var(--
|
|
53
|
-
color: var(--
|
|
60
|
+
background-color: var(--rt-color-neutral-5),
|
|
61
|
+
color: var(--rt-color-neutral-40),
|
|
54
62
|
),
|
|
55
63
|
fill-black: (
|
|
56
|
-
background-color: var(--
|
|
57
|
-
color: var(--
|
|
64
|
+
background-color: var(--rt-color-neutral-100),
|
|
65
|
+
color: var(--rt-color-neutral-0),
|
|
58
66
|
),
|
|
59
67
|
fill-green: (
|
|
60
|
-
border: 1px solid color.scale(vars.$
|
|
61
|
-
color: var(--
|
|
62
|
-
background-color: var(--
|
|
68
|
+
border: 1px solid color.scale(vars.$btn-success, $lightness: -10%),
|
|
69
|
+
color: var(--rt-color-neutral-0),
|
|
70
|
+
background-color: var(--rt-color-green-80),
|
|
63
71
|
),
|
|
64
72
|
fill-green-hover: (
|
|
65
|
-
background-color: color.scale(vars.$
|
|
73
|
+
background-color: color.scale(vars.$btn-success, $lightness: -10%),
|
|
66
74
|
),
|
|
67
75
|
fill-green-light: (
|
|
68
|
-
border-color: color.scale(vars.$
|
|
69
|
-
color: var(--
|
|
70
|
-
background-color: var(--
|
|
76
|
+
border-color: color.scale(vars.$btn-success-soft, $lightness: -10%),
|
|
77
|
+
color: var(--rt-color-green-100),
|
|
78
|
+
background-color: var(--rt-color-green-10),
|
|
71
79
|
),
|
|
72
80
|
fill-green-light-hover: (
|
|
73
|
-
background-color: color.scale(vars.$
|
|
81
|
+
background-color: color.scale(vars.$btn-success-soft, $lightness: -10%),
|
|
74
82
|
),
|
|
75
83
|
fill-red: (
|
|
76
|
-
border: 1px solid color.scale(vars.$
|
|
77
|
-
color: var(--
|
|
78
|
-
background-color: vars.$
|
|
84
|
+
border: 1px solid color.scale(vars.$btn-danger, $lightness: -10%),
|
|
85
|
+
color: var(--rt-color-neutral-0),
|
|
86
|
+
background-color: vars.$btn-danger,
|
|
79
87
|
),
|
|
80
88
|
fill-red-hover: (
|
|
81
|
-
background-color: color.scale(vars.$
|
|
89
|
+
background-color: color.scale(vars.$btn-danger, $lightness: -10%),
|
|
82
90
|
),
|
|
83
91
|
fill-red-light: (
|
|
84
|
-
border-color: color.scale(vars.$
|
|
85
|
-
color: var(--
|
|
86
|
-
background-color: var(--
|
|
92
|
+
border-color: color.scale(vars.$btn-danger-soft, $lightness: -10%),
|
|
93
|
+
color: var(--rt-color-red-100),
|
|
94
|
+
background-color: var(--rt-color-red-10),
|
|
87
95
|
),
|
|
88
96
|
fill-red-light-hover: (
|
|
89
|
-
background-color: color.scale(vars.$
|
|
97
|
+
background-color: color.scale(vars.$btn-danger-soft, $lightness: -10%),
|
|
90
98
|
),
|
|
91
99
|
outline: (
|
|
92
|
-
border: 1px solid var(--
|
|
100
|
+
border: 1px solid var(--rt-color-blue-40),
|
|
93
101
|
),
|
|
94
102
|
outline-blue: (
|
|
95
|
-
color: var(--
|
|
103
|
+
color: var(--rt-color-blue-100),
|
|
96
104
|
),
|
|
97
105
|
outline-base: (
|
|
98
|
-
color: var(--
|
|
106
|
+
color: var(--rt-color-neutral-100),
|
|
99
107
|
),
|
|
100
108
|
disabled: (
|
|
101
|
-
background-color: var(--
|
|
102
|
-
color: var(--
|
|
109
|
+
background-color: var(--rt-color-neutral-5),
|
|
110
|
+
color: var(--rt-color-neutral-40),
|
|
103
111
|
),
|
|
104
112
|
);
|
|
105
113
|
|
|
@@ -112,22 +120,22 @@ $button: (
|
|
|
112
120
|
}
|
|
113
121
|
|
|
114
122
|
button {
|
|
115
|
-
line-height: 1;
|
|
116
123
|
cursor: pointer;
|
|
124
|
+
line-height: 1;
|
|
117
125
|
}
|
|
118
126
|
|
|
119
127
|
.c-button {
|
|
128
|
+
position: relative;
|
|
120
129
|
display: inline-flex;
|
|
121
130
|
align-items: center;
|
|
122
|
-
font-family: var(--rt-button-base-font-family);
|
|
123
|
-
line-height: 1;
|
|
124
|
-
position: relative;
|
|
125
131
|
justify-content: center;
|
|
126
|
-
font-size: 1rem;
|
|
127
132
|
color: var(--rt-button-base-color);
|
|
133
|
+
font-family: var(--rt-button-base-font-family);
|
|
134
|
+
font-size: 1rem;
|
|
135
|
+
line-height: 1;
|
|
128
136
|
transition: all 0.15s linear;
|
|
129
137
|
|
|
130
|
-
//FAB
|
|
138
|
+
// FAB
|
|
131
139
|
&[class*='--fab'] {
|
|
132
140
|
border: 0;
|
|
133
141
|
background-color: transparent;
|
|
@@ -149,8 +157,8 @@ button {
|
|
|
149
157
|
// TEXT
|
|
150
158
|
&[class*='--txt-'] {
|
|
151
159
|
border: 0;
|
|
152
|
-
background-color: transparent;
|
|
153
160
|
border-radius: 5px;
|
|
161
|
+
background-color: transparent;
|
|
154
162
|
|
|
155
163
|
&:hover {
|
|
156
164
|
background: var(--rt-button-text-hover-background);
|
|
@@ -239,9 +247,9 @@ button {
|
|
|
239
247
|
&[class*='green'] {
|
|
240
248
|
border: var(--rt-button-fill-green-border);
|
|
241
249
|
border-radius: 2px;
|
|
242
|
-
color: var(--rt-button-fill-green-color);
|
|
243
|
-
box-shadow: 0 2px 4px rgba(24, 24, 24, 0.1);
|
|
244
250
|
background-color: var(--rt-button-fill-green-background-color);
|
|
251
|
+
box-shadow: 0 2px 4px rgb(24 24 24 / 10%);
|
|
252
|
+
color: var(--rt-button-fill-green-color);
|
|
245
253
|
|
|
246
254
|
&:hover {
|
|
247
255
|
background-color: var(--rt-button-fill-green-hover-background-color);
|
|
@@ -249,8 +257,8 @@ button {
|
|
|
249
257
|
|
|
250
258
|
&[class*='-light'] {
|
|
251
259
|
border-color: var(--rt-button-fill-green-light-border-color);
|
|
252
|
-
color: var(--rt-button-fill-green-light-color);
|
|
253
260
|
background-color: var(--rt-button-fill-green-light-background-color);
|
|
261
|
+
color: var(--rt-button-fill-green-light-color);
|
|
254
262
|
|
|
255
263
|
&:hover {
|
|
256
264
|
background-color: var(--rt-button-fill-green-light-hover-background-color);
|
|
@@ -261,9 +269,9 @@ button {
|
|
|
261
269
|
&[class*='red'] {
|
|
262
270
|
border: var(--rt-button-fill-red-border);
|
|
263
271
|
border-radius: 2px;
|
|
264
|
-
color: var(--rt-button-fill-red-color);
|
|
265
|
-
box-shadow: 0 2px 4px rgba(24, 24, 24, 0.1);
|
|
266
272
|
background-color: var(--rt-button-fill-red-background-color);
|
|
273
|
+
box-shadow: 0 2px 4px rgb(24 24 24 / 10%);
|
|
274
|
+
color: var(--rt-button-fill-red-color);
|
|
267
275
|
|
|
268
276
|
&:hover {
|
|
269
277
|
background-color: var(--rt-button-fill-red-hover-background-color);
|
|
@@ -271,8 +279,8 @@ button {
|
|
|
271
279
|
|
|
272
280
|
&[class*='-light'] {
|
|
273
281
|
border-color: var(--rt-button-fill-red-light-border-color);
|
|
274
|
-
color: var(--rt-button-fill-red-light-color);
|
|
275
282
|
background-color: var(--rt-button-fill-red-light-background-color);
|
|
283
|
+
color: var(--rt-button-fill-red-light-color);
|
|
276
284
|
|
|
277
285
|
&:hover {
|
|
278
286
|
background-color: var(--rt-button-fill-red-light-hover-background-color);
|
|
@@ -348,7 +356,7 @@ button {
|
|
|
348
356
|
|
|
349
357
|
// SHADOW
|
|
350
358
|
&[class*='--shadow'] {
|
|
351
|
-
box-shadow: 0 2px 4px
|
|
359
|
+
box-shadow: 0 2px 4px rgb(24 24 24 / 10%);
|
|
352
360
|
}
|
|
353
361
|
|
|
354
362
|
// --shadow
|
|
@@ -8,26 +8,26 @@ $checkbox: (
|
|
|
8
8
|
box: (
|
|
9
9
|
width: 1rem,
|
|
10
10
|
height: 1rem,
|
|
11
|
-
border: 0.125rem solid var(--
|
|
11
|
+
border: 0.125rem solid var(--rt-border-neutral-strong),
|
|
12
12
|
border-radius: 0.25rem,
|
|
13
|
-
background-color: var(--
|
|
13
|
+
background-color: var(--rt-bg-base-base),
|
|
14
14
|
),
|
|
15
15
|
box-active: (
|
|
16
16
|
color: var(--mat-button-text-label-text-color),
|
|
17
17
|
),
|
|
18
18
|
box-inactive: (
|
|
19
|
-
color: var(--
|
|
19
|
+
color: var(--rt-text-base-disabled),
|
|
20
20
|
),
|
|
21
21
|
label: (
|
|
22
22
|
font-size: 1rem,
|
|
23
23
|
font-weight: 500,
|
|
24
|
-
color: var(--
|
|
24
|
+
color: var(--rt-text-base-soft),
|
|
25
25
|
),
|
|
26
26
|
description: (
|
|
27
27
|
margin-top: 0.125rem,
|
|
28
28
|
font-size: 0.75rem,
|
|
29
29
|
font-weight: 500,
|
|
30
|
-
color: var(--
|
|
30
|
+
color: var(--rt-text-base-disabled),
|
|
31
31
|
),
|
|
32
32
|
);
|
|
33
33
|
|
|
@@ -13,12 +13,12 @@ $dynamic-selector: (
|
|
|
13
13
|
),
|
|
14
14
|
item-mover: (
|
|
15
15
|
padding: 0 0.25rem 0 0,
|
|
16
|
-
border-right: 1px solid var(--
|
|
16
|
+
border-right: 1px solid var(--rt-border-neutral-divider),
|
|
17
17
|
margin-right: 0.75rem,
|
|
18
18
|
),
|
|
19
19
|
item-control: (
|
|
20
20
|
padding: 0 0.25rem 0 0.25rem,
|
|
21
|
-
border-right: 1px solid var(--
|
|
21
|
+
border-right: 1px solid var(--rt-border-neutral-divider),
|
|
22
22
|
gap: 0.5rem,
|
|
23
23
|
),
|
|
24
24
|
item-control-last-child: (
|
|
@@ -26,13 +26,13 @@ $dynamic-selector: (
|
|
|
26
26
|
border-right: none,
|
|
27
27
|
),
|
|
28
28
|
item-control-button-active: (
|
|
29
|
-
color: var(--
|
|
29
|
+
color: var(--rt-text-accent-danger),
|
|
30
30
|
),
|
|
31
31
|
item-control-icon: (
|
|
32
32
|
size: 1.125rem,
|
|
33
33
|
),
|
|
34
34
|
item-drag-preview: (
|
|
35
|
-
box-shadow: 0 0.5rem 1rem 0 var(--
|
|
35
|
+
box-shadow: 0 0.5rem 1rem 0 var(--rt-shadow-color),
|
|
36
36
|
),
|
|
37
37
|
);
|
|
38
38
|
|
|
@@ -46,15 +46,14 @@ $dynamic-selector: (
|
|
|
46
46
|
|
|
47
47
|
.rtui-dynamic-selector {
|
|
48
48
|
&__item {
|
|
49
|
-
height: var(--rt-dynamic-selector-item-height);
|
|
50
49
|
display: flex;
|
|
51
|
-
|
|
50
|
+
height: var(--rt-dynamic-selector-item-height);
|
|
52
51
|
align-items: center;
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
justify-content: flex-start;
|
|
53
|
+
padding: var(--rt-dynamic-selector-item-padding);
|
|
55
54
|
border-radius: var(--rt-dynamic-selector-item-border-radius);
|
|
56
55
|
margin-bottom: var(--rt-dynamic-selector-item-margin-bottom);
|
|
57
|
-
|
|
56
|
+
background-color: var(--rt-dynamic-selector-item-background-color);
|
|
58
57
|
|
|
59
58
|
&::-webkit-scrollbar {
|
|
60
59
|
display: none;
|
|
@@ -66,17 +65,17 @@ $dynamic-selector: (
|
|
|
66
65
|
|
|
67
66
|
&-mover {
|
|
68
67
|
display: flex;
|
|
69
|
-
justify-content: center;
|
|
70
68
|
align-items: center;
|
|
69
|
+
justify-content: center;
|
|
71
70
|
padding: var(--rt-dynamic-selector-item-mover-padding);
|
|
72
71
|
border-right: var(--rt-dynamic-selector-item-mover-border-right);
|
|
73
72
|
margin-right: var(--rt-dynamic-selector-item-mover-margin-right);
|
|
74
73
|
}
|
|
75
74
|
|
|
76
75
|
&-title {
|
|
77
|
-
white-space: nowrap;
|
|
78
76
|
overflow: hidden;
|
|
79
77
|
text-overflow: ellipsis;
|
|
78
|
+
white-space: nowrap;
|
|
80
79
|
}
|
|
81
80
|
|
|
82
81
|
&-input {
|
|
@@ -92,11 +91,11 @@ $dynamic-selector: (
|
|
|
92
91
|
|
|
93
92
|
&-control {
|
|
94
93
|
display: flex;
|
|
95
|
-
justify-content: center;
|
|
96
94
|
align-items: center;
|
|
97
|
-
|
|
95
|
+
justify-content: center;
|
|
98
96
|
padding: var(--rt-dynamic-selector-item-control-padding);
|
|
99
97
|
border-right: var(--rt-dynamic-selector-item-control-border-right);
|
|
98
|
+
gap: var(--rt-dynamic-selector-item-control-gap);
|
|
100
99
|
|
|
101
100
|
&:last-child {
|
|
102
101
|
padding: var(--rt-dynamic-selector-item-control-last-child-padding);
|
|
@@ -105,8 +104,8 @@ $dynamic-selector: (
|
|
|
105
104
|
|
|
106
105
|
&-button {
|
|
107
106
|
display: flex;
|
|
108
|
-
justify-content: center;
|
|
109
107
|
align-items: center;
|
|
108
|
+
justify-content: center;
|
|
110
109
|
|
|
111
110
|
.mat-icon {
|
|
112
111
|
width: var(--rt-dynamic-selector-item-control-icon-size);
|