@rt-tools/ui-kit 0.0.19 → 0.0.21
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 +338 -144
- package/fesm2022/rt-tools-ui-kit.mjs.map +1 -1
- package/package.json +5 -5
- package/rt-tools-ui-kit-0.0.21.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 +25 -32
- package/src/lib/ui-kit/aside/stories/aside-component/test-aside.component.scss +1 -1
- package/src/lib/ui-kit/buttons/multi-button/rtui-multi-button.component.scss +7 -7
- package/src/lib/ui-kit/buttons/unified-button/rtui-button.component.scss +247 -0
- package/src/lib/ui-kit/checkbox/rtui-checkbox.component.scss +10 -10
- 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 +2 -2
- 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 +17 -17
- package/src/lib/ui-kit/dynamic-selectors/components/placeholder/rtui-dynamic-selector-placeholder.component.scss +3 -4
- 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 +5 -5
- 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/icon/rtui-icon.component.scss +110 -0
- 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 +5 -5
- package/src/lib/ui-kit/popover/rtui-popover-container.component.scss +2 -3
- package/src/lib/ui-kit/scrollable/scrollable-container.component.scss +3 -5
- package/src/lib/ui-kit/side-menu/menu/rtui-side-menu.component.scss +25 -25
- package/src/lib/ui-kit/side-menu/menu-sub-item/rtui-side-menu-sub-item.component.scss +14 -14
- 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 +9 -9
- 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 +10 -13
- package/src/lib/ui-kit/table/components/clear-search-button/rtui-clear-button.component.scss +5 -5
- package/src/lib/ui-kit/table/components/pagination-view/rtui-pagination.component.scss +14 -22
- package/src/lib/ui-kit/table/components/table-base-cell/table-base-cell.component.scss +8 -9
- 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 +16 -14
- package/src/lib/ui-kit/table/components/table-header-cell/table-header-cell.component.scss +6 -7
- 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 +15 -21
- package/src/lib/ui-kit/toggle/stories/component/test-toggle.component.scss +2 -2
- package/src/lib/ui-kit/toolbar/toolbar.component.scss +5 -10
- package/src/styles/TOKENS.md +95 -2
- package/src/styles/base/_base.scss +4 -5
- package/src/styles/base/_color-scheme.scss +86 -0
- package/src/styles/base/_mixin.scss +12 -15
- package/src/styles/base/_tokens.scss +139 -99
- package/src/styles/base/_variables.scss +5 -11
- package/src/styles/color-scheme.spec.ts +236 -0
- package/src/styles/components/_button.scss +32 -24
- package/src/styles/components/_dynamic-selectors.scss +9 -10
- package/src/styles/components/_form.scss +8 -13
- package/src/styles/components/_material-bridge.scss +30 -0
- package/src/styles/components/_rtui_button.scss +100 -5
- package/src/styles/components/_table.scss +23 -39
- package/src/styles/main.scss +4 -0
- package/styles/tokens.css +79 -101
- package/types/rt-tools-ui-kit.d.ts +99 -37
- package/rt-tools-ui-kit-0.0.19.tgz +0 -0
- package/src/lib/ui-kit/buttons/icon-round/rtui-round-icon-button.component.scss +0 -44
|
@@ -44,24 +44,26 @@ $table-container: (
|
|
|
44
44
|
);
|
|
45
45
|
|
|
46
46
|
:host {
|
|
47
|
-
width: 100%;
|
|
48
47
|
position: relative;
|
|
49
48
|
display: flex;
|
|
50
49
|
overflow: hidden;
|
|
50
|
+
width: 100%;
|
|
51
51
|
|
|
52
52
|
// initial table container scrollbar styles
|
|
53
53
|
::-webkit-scrollbar-track:hover {
|
|
54
54
|
border: 1px solid var(--rt-border-neutral-subtle);
|
|
55
55
|
}
|
|
56
|
+
|
|
56
57
|
::-webkit-scrollbar-thumb {
|
|
57
|
-
background: var(--rt-scrollbar-thumb);
|
|
58
58
|
border: 3px solid transparent;
|
|
59
|
-
border-radius:
|
|
59
|
+
border-radius: var(--rt-radius-sm);
|
|
60
|
+
background: var(--rt-scrollbar-thumb);
|
|
60
61
|
background-clip: content-box;
|
|
61
62
|
}
|
|
63
|
+
|
|
62
64
|
::-webkit-scrollbar-thumb:hover {
|
|
63
|
-
background: var(--rt-scrollbar-thumb-hover);
|
|
64
65
|
border: 2px solid transparent;
|
|
66
|
+
background: var(--rt-scrollbar-thumb-hover);
|
|
65
67
|
background-clip: content-box;
|
|
66
68
|
}
|
|
67
69
|
|
|
@@ -94,10 +96,10 @@ $table-container: (
|
|
|
94
96
|
.table-container {
|
|
95
97
|
&__selectors {
|
|
96
98
|
display: flex;
|
|
97
|
-
justify-content: flex-start;
|
|
98
|
-
align-items: center;
|
|
99
|
-
flex-grow: 1;
|
|
100
99
|
width: 100%;
|
|
100
|
+
flex-grow: 1;
|
|
101
|
+
align-items: center;
|
|
102
|
+
justify-content: flex-start;
|
|
101
103
|
margin: var(--rt-table-container-selectors-margin);
|
|
102
104
|
gap: var(--rt-table-container-toolbar-actions-gap);
|
|
103
105
|
|
|
@@ -110,16 +112,16 @@ $table-container: (
|
|
|
110
112
|
}
|
|
111
113
|
|
|
112
114
|
&-counter {
|
|
113
|
-
font-size: var(--rt-table-container-selector-counter-font-size);
|
|
114
115
|
color: var(--rt-table-container-selector-counter-color);
|
|
116
|
+
font-size: var(--rt-table-container-selector-counter-font-size);
|
|
115
117
|
}
|
|
116
118
|
}
|
|
117
119
|
|
|
118
120
|
&__toolbar {
|
|
119
|
-
width: 100%;
|
|
120
121
|
display: flex;
|
|
121
|
-
|
|
122
|
+
width: 100%;
|
|
122
123
|
align-items: center;
|
|
124
|
+
justify-content: flex-end;
|
|
123
125
|
|
|
124
126
|
&-actions {
|
|
125
127
|
display: flex;
|
|
@@ -143,9 +145,9 @@ $table-container: (
|
|
|
143
145
|
}
|
|
144
146
|
|
|
145
147
|
&__content {
|
|
148
|
+
overflow: auto;
|
|
146
149
|
width: 100%;
|
|
147
150
|
flex-grow: 1;
|
|
148
|
-
overflow: auto;
|
|
149
151
|
padding: var(--rt-table-container-content-padding);
|
|
150
152
|
|
|
151
153
|
&::-webkit-scrollbar {
|
|
@@ -155,12 +157,12 @@ $table-container: (
|
|
|
155
157
|
}
|
|
156
158
|
|
|
157
159
|
&__placeholder {
|
|
160
|
+
display: flex;
|
|
158
161
|
width: var(--rt-table-container-placeholder-width);
|
|
159
162
|
height: var(--rt-table-container-placeholder-height);
|
|
160
|
-
display: flex;
|
|
161
163
|
flex-direction: column;
|
|
162
|
-
justify-content: center;
|
|
163
164
|
align-items: center;
|
|
165
|
+
justify-content: center;
|
|
164
166
|
gap: var(--rt-table-container-placeholder-gap);
|
|
165
167
|
|
|
166
168
|
&-icon {
|
|
@@ -203,8 +205,8 @@ $table-container: (
|
|
|
203
205
|
|
|
204
206
|
&-search {
|
|
205
207
|
width: 100%;
|
|
206
|
-
grid-row: 1;
|
|
207
208
|
justify-content: center;
|
|
209
|
+
grid-row: 1;
|
|
208
210
|
}
|
|
209
211
|
}
|
|
210
212
|
}
|
|
@@ -21,8 +21,8 @@ $header-cell: (
|
|
|
21
21
|
|
|
22
22
|
:host {
|
|
23
23
|
display: flex;
|
|
24
|
-
justify-content: space-between;
|
|
25
24
|
align-items: center;
|
|
25
|
+
justify-content: space-between;
|
|
26
26
|
cursor: pointer;
|
|
27
27
|
|
|
28
28
|
@each $element, $elements in $header-cell {
|
|
@@ -38,8 +38,8 @@ $header-cell: (
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
.header-cell-label {
|
|
41
|
-
flex-grow: 1;
|
|
42
41
|
display: flex;
|
|
42
|
+
flex-grow: 1;
|
|
43
43
|
align-items: center;
|
|
44
44
|
gap: var(--rt-table-header-cell-label-gap);
|
|
45
45
|
|
|
@@ -64,9 +64,9 @@ $header-cell: (
|
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
&__text {
|
|
67
|
-
white-space: nowrap;
|
|
68
67
|
overflow: hidden;
|
|
69
68
|
text-overflow: ellipsis;
|
|
69
|
+
white-space: nowrap;
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
&__suffix {
|
|
@@ -85,10 +85,9 @@ $header-cell: (
|
|
|
85
85
|
.header-cell-icons {
|
|
86
86
|
display: flex;
|
|
87
87
|
flex-direction: column;
|
|
88
|
-
justify-content: center;
|
|
89
88
|
align-items: center;
|
|
89
|
+
justify-content: center;
|
|
90
90
|
margin: var(--rt-table-header-cell-icon-margin);
|
|
91
|
-
|
|
92
91
|
visibility: hidden;
|
|
93
92
|
|
|
94
93
|
&--active {
|
|
@@ -98,12 +97,12 @@ $header-cell: (
|
|
|
98
97
|
&__icon {
|
|
99
98
|
width: 0;
|
|
100
99
|
height: 0;
|
|
101
|
-
border-left: 3px solid transparent;
|
|
102
100
|
border-right: 3px solid transparent;
|
|
103
101
|
border-bottom: 5.2px solid var(--rt-table-header-cell-icon-color);
|
|
102
|
+
border-left: 3px solid transparent;
|
|
104
103
|
|
|
105
104
|
&--second {
|
|
106
|
-
margin-top:
|
|
105
|
+
margin-top: var(--rt-spacing-2);
|
|
107
106
|
transform: scaleY(-1);
|
|
108
107
|
}
|
|
109
108
|
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
:host {
|
|
2
|
+
position: relative;
|
|
3
|
+
display: flex;
|
|
4
|
+
overflow: hidden;
|
|
2
5
|
width: 100vw;
|
|
3
6
|
height: 100vh;
|
|
4
|
-
display: flex;
|
|
5
7
|
flex-direction: column;
|
|
6
8
|
margin: -1rem;
|
|
7
|
-
position: relative;
|
|
8
|
-
overflow: hidden;
|
|
9
9
|
|
|
10
10
|
.pagination {
|
|
11
|
-
width: 100%;
|
|
12
11
|
position: absolute;
|
|
13
12
|
top: 0;
|
|
14
13
|
left: 0;
|
|
14
|
+
width: 100%;
|
|
15
15
|
}
|
|
16
16
|
}
|
|
@@ -13,7 +13,7 @@ $toggle: (
|
|
|
13
13
|
toggle: (
|
|
14
14
|
border-radius: 6.25rem,
|
|
15
15
|
background-color: var(--rt-bg-base-subtle),
|
|
16
|
-
box-shadow: inset 0 0 0.125rem 0.0625rem
|
|
16
|
+
box-shadow: inset 0 0 0.125rem 0.0625rem rgb(0 0 0 / 5%),
|
|
17
17
|
),
|
|
18
18
|
toggle-check: (
|
|
19
19
|
box-shadow: inset 0 0 0 1.25rem var(--rt-control-checked),
|
|
@@ -21,7 +21,7 @@ $toggle: (
|
|
|
21
21
|
toggle-switch: (
|
|
22
22
|
border-radius: 2.25rem,
|
|
23
23
|
background-color: var(--rt-control-thumb),
|
|
24
|
-
box-shadow: 0 0.0625rem 0.125rem
|
|
24
|
+
box-shadow: 0 0.0625rem 0.125rem rgb(0 0 0 / 20%),
|
|
25
25
|
),
|
|
26
26
|
toggle-track: (
|
|
27
27
|
background-color: var(--rt-control-track),
|
|
@@ -79,12 +79,12 @@ $toggle: (
|
|
|
79
79
|
|
|
80
80
|
.rtui-toggle {
|
|
81
81
|
position: relative;
|
|
82
|
+
overflow: hidden;
|
|
82
83
|
width: 3.125rem;
|
|
83
84
|
min-width: 3.125rem;
|
|
84
85
|
height: 1.875rem;
|
|
85
86
|
border-radius: var(--rt-toggle-toggle-border-radius);
|
|
86
87
|
background-color: var(--rt-toggle-toggle-background-color);
|
|
87
|
-
overflow: hidden;
|
|
88
88
|
box-shadow: var(--rt-toggle-toggle-box-shadow);
|
|
89
89
|
cursor: pointer;
|
|
90
90
|
|
|
@@ -103,36 +103,30 @@ $toggle: (
|
|
|
103
103
|
right: 0.125rem;
|
|
104
104
|
left: 1.375rem;
|
|
105
105
|
transition: 0.35s cubic-bezier(0.785, 0.135, 0.15, 0.86);
|
|
106
|
-
transition-property: left, right;
|
|
107
106
|
transition-delay: 0.05s, 0s;
|
|
107
|
+
transition-property: left, right;
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
&__switch {
|
|
112
112
|
position: absolute;
|
|
113
|
-
left: 0.125rem;
|
|
114
|
-
top: 0.125rem;
|
|
115
|
-
bottom: 0.125rem;
|
|
116
|
-
right: 1.375rem;
|
|
117
|
-
background-color: var(--rt-toggle-toggle-switch-background-color);
|
|
118
|
-
border-radius: var(--rt-toggle-toggle-switch-border-radius);
|
|
119
113
|
z-index: 1;
|
|
114
|
+
border-radius: var(--rt-toggle-toggle-switch-border-radius);
|
|
115
|
+
background-color: var(--rt-toggle-toggle-switch-background-color);
|
|
116
|
+
box-shadow: var(--rt-toggle-toggle-switch-box-shadow);
|
|
117
|
+
inset: 0.125rem 1.375rem 0.125rem 0.125rem;
|
|
120
118
|
transition: 0.35s cubic-bezier(0.785, 0.135, 0.15, 0.86);
|
|
121
|
-
transition-property: left, right;
|
|
122
119
|
transition-delay: 0s, 0.05s;
|
|
123
|
-
|
|
120
|
+
transition-property: left, right;
|
|
124
121
|
}
|
|
125
122
|
|
|
126
123
|
&__track {
|
|
127
124
|
position: absolute;
|
|
128
|
-
left: 0;
|
|
129
|
-
top: 0;
|
|
130
|
-
right: 0;
|
|
131
|
-
bottom: 0;
|
|
132
|
-
transition: 0.35s cubic-bezier(0.785, 0.135, 0.15, 0.86);
|
|
133
|
-
background-color: var(--rt-toggle-toggle-track-background-color);
|
|
134
|
-
border-radius: var(--rt-toggle-toggle-track-border-radius);
|
|
135
125
|
border: var(--rt-toggle-toggle-track-border);
|
|
126
|
+
border-radius: var(--rt-toggle-toggle-track-border-radius);
|
|
127
|
+
background-color: var(--rt-toggle-toggle-track-background-color);
|
|
128
|
+
inset: 0;
|
|
129
|
+
transition: 0.35s cubic-bezier(0.785, 0.135, 0.15, 0.86);
|
|
136
130
|
}
|
|
137
131
|
|
|
138
132
|
// modify
|
|
@@ -148,8 +142,8 @@ $toggle: (
|
|
|
148
142
|
}
|
|
149
143
|
|
|
150
144
|
.rtui-toggle__check:checked ~ .rtui-toggle__switch {
|
|
151
|
-
left: 1.625rem;
|
|
152
145
|
right: 0.125rem;
|
|
146
|
+
left: 1.625rem;
|
|
153
147
|
}
|
|
154
148
|
}
|
|
155
149
|
|
|
@@ -165,8 +159,8 @@ $toggle: (
|
|
|
165
159
|
}
|
|
166
160
|
|
|
167
161
|
.rtui-toggle__check:checked ~ .rtui-toggle__switch {
|
|
168
|
-
left: 0.75rem;
|
|
169
162
|
right: 0.125rem;
|
|
163
|
+
left: 0.75rem;
|
|
170
164
|
}
|
|
171
165
|
}
|
|
172
166
|
}
|
|
@@ -40,9 +40,8 @@ $toolbar: (
|
|
|
40
40
|
--mat-toolbar-standard-height: var(--rt-toolbar-body-mobile-height);
|
|
41
41
|
--mdc-secondary-navigation-tab-container-height: var(--rt-toolbar-body-mobile-height);
|
|
42
42
|
|
|
43
|
-
min-height: var(--rt-toolbar-body-mobile-height);
|
|
44
43
|
height: var(--rt-toolbar-body-mobile-height);
|
|
45
|
-
|
|
44
|
+
min-height: var(--rt-toolbar-body-mobile-height);
|
|
46
45
|
padding: var(--rt-toolbar-body-padding);
|
|
47
46
|
background-color: transparent;
|
|
48
47
|
|
|
@@ -61,25 +60,21 @@ $toolbar: (
|
|
|
61
60
|
|
|
62
61
|
.bars {
|
|
63
62
|
position: relative;
|
|
64
|
-
|
|
65
63
|
display: flex;
|
|
66
64
|
width: 100%;
|
|
67
65
|
height: 100%;
|
|
68
|
-
|
|
66
|
+
border-bottom: var(--rt-toolbar-bars-border-bottom-width) var(--rt-toolbar-bars-border-bottom-style)
|
|
67
|
+
var(--rt-toolbar-bars-border-bottom-color);
|
|
69
68
|
background-color: var(--rt-toolbar-body-background-color);
|
|
70
69
|
|
|
71
|
-
border-bottom-style: var(--rt-toolbar-bars-border-bottom-style);
|
|
72
|
-
border-bottom-width: var(--rt-toolbar-bars-border-bottom-width);
|
|
73
|
-
border-bottom-color: var(--rt-toolbar-bars-border-bottom-color);
|
|
74
|
-
|
|
75
70
|
&__bar {
|
|
76
71
|
&--left {
|
|
77
72
|
width: var(--rt-toolbar-bars-left-width);
|
|
78
73
|
}
|
|
79
74
|
|
|
80
75
|
&--center {
|
|
81
|
-
width: var(--rt-toolbar-bars-center-width);
|
|
82
76
|
overflow: hidden;
|
|
77
|
+
width: var(--rt-toolbar-bars-center-width);
|
|
83
78
|
}
|
|
84
79
|
|
|
85
80
|
&--right {
|
|
@@ -89,8 +84,8 @@ $toolbar: (
|
|
|
89
84
|
&--left,
|
|
90
85
|
&--center,
|
|
91
86
|
&--right {
|
|
92
|
-
height: 100%;
|
|
93
87
|
display: flex;
|
|
88
|
+
height: 100%;
|
|
94
89
|
align-items: center;
|
|
95
90
|
}
|
|
96
91
|
}
|
package/src/styles/TOKENS.md
CHANGED
|
@@ -18,11 +18,104 @@ Quick facts:
|
|
|
18
18
|
fallback chains. Opt out: `@use '...main' with ($tokens-use-material: false)`.
|
|
19
19
|
- Accent roles `{primary,success,warning,danger,info,neutral}`,
|
|
20
20
|
steps `{subtle,solid,hover,disabled}` (simplified vs GMT).
|
|
21
|
+
- Accent indirection: the accent semantic tier derives from `--rt-color-{role}-{0..100}`
|
|
22
|
+
ramps (`{primary,info,success,warning,danger,brand}`). Custom brand palettes
|
|
23
|
+
override only those rows — see **Custom color schemes** below.
|
|
21
24
|
- Foundations: `--rt-spacing-{0..64}` (px-named, rem values), `--rt-radius-*`,
|
|
22
25
|
`--rt-font-*`, `--rt-shadow-*`, `--rt-transition-*`, `--rt-z-index-*`.
|
|
23
|
-
- Legacy `--clr-*` variables are emitted as **deprecated aliases**.
|
|
24
26
|
- Prebuilt CSS for non-sass consumers: `dist/ui-kit/styles/tokens.css`
|
|
25
27
|
(`pnpm run build:tokens`).
|
|
26
28
|
- Figma parity: collections `core` (`rt/color/*`) and `theme` (`rt/{bg,text,icon,border}/*`,
|
|
27
29
|
Light/Dark modes) in the “RT-Tools UI Kit” file mirror these names 1:1.
|
|
28
|
-
- App-defined (never set by the kit): `--
|
|
30
|
+
- App-defined (never set by the kit): `--font-default`, mat theme colors.
|
|
31
|
+
|
|
32
|
+
## Component theming API (Tier 3 contract)
|
|
33
|
+
|
|
34
|
+
Tier-3 vars are split into a **public theming API** and **internal implementation details**.
|
|
35
|
+
Only the public set is a compatibility promise; internal vars may be renamed or stop being
|
|
36
|
+
emitted in the next major release.
|
|
37
|
+
|
|
38
|
+
**Public** (override these from your app):
|
|
39
|
+
|
|
40
|
+
1. Every var matching `--rt-<component>-*-{color,background-color,bg,shadow,indicator}` —
|
|
41
|
+
the color surface of each component.
|
|
42
|
+
2. Documented size hooks proven by consumers:
|
|
43
|
+
`--rt-table-row-height`, `--rt-toolbar-body-height`, `--rt-toolbar-body-mobile-height`,
|
|
44
|
+
`--rt-aside-error-box-height`, `--rt-aside-host-width`,
|
|
45
|
+
`--rt-image-upload-host-min-height`, `--rt-image-upload-image-container-image-max-height`.
|
|
46
|
+
|
|
47
|
+
**Internal** (everything else): layout paddings/margins/gaps/font-sizes generated from SCSS maps.
|
|
48
|
+
They currently _are_ emitted (≈380 vars total, ~14% actually themed by consumers) — in the next
|
|
49
|
+
major the internal set stops being emitted and gets inlined into rules.
|
|
50
|
+
|
|
51
|
+
### `:root` vs `:host` emission — override semantics
|
|
52
|
+
|
|
53
|
+
- Vars emitted at **`:root`** (global stylesheets + `ViewEncapsulation.None` components like
|
|
54
|
+
aside-panel) are overridable from any ancestor scope: `.dark-mode { --rt-aside-host-background-color: …; }`.
|
|
55
|
+
- Vars emitted at **`:host`** are set on the element itself and **win over inherited values** —
|
|
56
|
+
consumers must target the element (`rtui-toolbar { --rt-toolbar-body-height: … !important; }`).
|
|
57
|
+
This asymmetry is why some consumers need `!important` for toolbar/toggle but not for aside/table.
|
|
58
|
+
- Planned unification (major): emit defaults via `var(--override, default)` indirection so all
|
|
59
|
+
components are ancestor-overridable without `!important`.
|
|
60
|
+
|
|
61
|
+
## Buttons: legacy vs rtui
|
|
62
|
+
|
|
63
|
+
`.c-button` (\_button.scss) is **deprecated**; `.rtui-btn` (\_rtui_button.scss) is the system.
|
|
64
|
+
Both stay until the next major because consumers apply `.c-button` classes and override
|
|
65
|
+
`--rt-button-*` directly. Migration map:
|
|
66
|
+
|
|
67
|
+
| legacy `.c-button` | `.rtui-btn` |
|
|
68
|
+
| ------------------------- | --------------------------------------------------------------------- |
|
|
69
|
+
| `--fill-green` / `-light` | `rtui-btn-success` / `-light` |
|
|
70
|
+
| `--fill-red` / `-light` | `rtui-btn-error` / `-light` |
|
|
71
|
+
| `--fill-blue` | `rtui-btn-accent-light` |
|
|
72
|
+
| `--fill-base/black/gray` | `rtui-btn-secondary` (+`-light`) |
|
|
73
|
+
| `--outline-{blue,base}` | `rtui-btn-{accent,secondary}-outline` |
|
|
74
|
+
| `--txt-*`, `--fab` | no equivalent yet — needs a text/icon appearance in `.rtui-btn` first |
|
|
75
|
+
| `--size-{sm,md,l}` | `rtui-btn-{sm,md,lg}` (+`-full`) |
|
|
76
|
+
|
|
77
|
+
## Material bridge
|
|
78
|
+
|
|
79
|
+
All **global** Material/CDK overrides live in `styles/components/_material-bridge.scss`
|
|
80
|
+
(single file to review on a Material upgrade). Component-scoped piercings stay with their
|
|
81
|
+
component; the bridge header keeps the inventory of those locations.
|
|
82
|
+
|
|
83
|
+
## Custom color schemes (brand palettes)
|
|
84
|
+
|
|
85
|
+
The accent semantic tier never hardcodes color — it derives from an indirection layer,
|
|
86
|
+
the **accent-role ramps** `--rt-color-{role}-{0..100}` for
|
|
87
|
+
`{primary, info, success, warning, danger, brand}`. A custom brand palette overrides
|
|
88
|
+
**only** those rows; the kit derives `--rt-{bg,text,icon,border}-accent-*`,
|
|
89
|
+
hover/subtle/disabled and `--rt-border-focus` from them. The block is scoped to
|
|
90
|
+
`[data-rt-scheme="<name>"]` on `<html>`, set raw → it wins over `--mat-sys-*`.
|
|
91
|
+
|
|
92
|
+
```scss
|
|
93
|
+
@use '@rt-tools/ui-kit/src/styles/main' as rt;
|
|
94
|
+
@include rt.color-scheme(
|
|
95
|
+
'teal',
|
|
96
|
+
(
|
|
97
|
+
primary: (
|
|
98
|
+
20: #b3e3e1,
|
|
99
|
+
40: #5cb8b5,
|
|
100
|
+
60: #1a9d99,
|
|
101
|
+
100: #008582,
|
|
102
|
+
),
|
|
103
|
+
brand: (
|
|
104
|
+
20: #e8e8e8,
|
|
105
|
+
100: #008582,
|
|
106
|
+
),
|
|
107
|
+
)
|
|
108
|
+
);
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
```typescript
|
|
112
|
+
// runtime twin (browser-only); prefer the Sass path for SSR/brand-critical schemes
|
|
113
|
+
theme.registerColorScheme('teal', { primary: { 100: '#008582' /* … */ } });
|
|
114
|
+
theme.setColorScheme('teal'); // data-rt-scheme="teal"; persisted to rt-color-scheme
|
|
115
|
+
theme.setColorScheme(null); // back to the default palette
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
- Orthogonal to light/dark (one ramp per role serves both modes).
|
|
119
|
+
- Δ0: with no scheme the accent layer is byte-for-byte the historical palette
|
|
120
|
+
(regression-tested in `styles/color-scheme.spec.ts`); Sass↔JS generator parity is tested too.
|
|
121
|
+
- Full guide: Storybook **Foundation/Theming/Custom color schemes** (`docs/ColorSchemes.mdx`).
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
$palette: (
|
|
2
2
|
white: (
|
|
3
|
-
100: #
|
|
3
|
+
100: #fff,
|
|
4
4
|
),
|
|
5
5
|
gray: (
|
|
6
6
|
5: #f5f6f8,
|
|
@@ -10,7 +10,7 @@ $palette: (
|
|
|
10
10
|
),
|
|
11
11
|
black: (
|
|
12
12
|
10: #f3f3f3,
|
|
13
|
-
15: #
|
|
13
|
+
15: #eee,
|
|
14
14
|
20: #e0e0e0,
|
|
15
15
|
30: #b2cbca,
|
|
16
16
|
40: #a3a3a3,
|
|
@@ -55,10 +55,9 @@ $palette: (
|
|
|
55
55
|
|
|
56
56
|
// NOTE: the $palette map above is kept for backwards compatibility (consumers may @use it).
|
|
57
57
|
// All CSS custom property emission lives in base/_tokens.scss:
|
|
58
|
-
// --rt-color-* primitives, --rt-{bg,text,icon,border}-* semantic, foundations
|
|
59
|
-
// and deprecated --clr-* aliases.
|
|
58
|
+
// --rt-color-* primitives, --rt-{bg,text,icon,border}-* semantic, and foundations.
|
|
60
59
|
|
|
61
60
|
:root {
|
|
62
61
|
// Buttons
|
|
63
|
-
--rt-button-box-shadow: 0 3px 5px -1px
|
|
62
|
+
--rt-button-box-shadow: 0 3px 5px -1px rgb(0 0 0 / 20%), 0 6px 10px 0 rgb(0 0 0 / 12%), 0 1px 18px 0 rgb(0 0 0 / 14%);
|
|
64
63
|
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use 'sass:meta';
|
|
3
|
+
@use 'sass:list';
|
|
4
|
+
@use './tokens' as tokens;
|
|
5
|
+
|
|
6
|
+
/// ============================================================================
|
|
7
|
+
/// Custom color schemes (brand palettes)
|
|
8
|
+
/// ============================================================================
|
|
9
|
+
///
|
|
10
|
+
/// A color scheme overrides ONLY the accent-role indirection rows
|
|
11
|
+
/// `--rt-color-{role}-{0..100}` (see `_tokens.scss`). The whole semantic accent
|
|
12
|
+
/// tier (`--rt-bg/text/icon/border-accent-*`, hover/subtle/disabled, `--rt-border-focus`)
|
|
13
|
+
/// re-derives from those rows — so a brand recolors with Δ0 effort and the
|
|
14
|
+
/// component contract (semantic token names) stays untouched.
|
|
15
|
+
///
|
|
16
|
+
/// The emitted block is scoped to `[data-rt-scheme="<name>"]`, which the runtime
|
|
17
|
+
/// (`RtThemeService.setColorScheme`) toggles on `<html>`. Because the scheme sets
|
|
18
|
+
/// raw values, it overrides the default rows that carry the `--mat-sys-*` fallback
|
|
19
|
+
/// → the scheme wins over an active Material theme.
|
|
20
|
+
///
|
|
21
|
+
/// Usage:
|
|
22
|
+
/// @use '@rt-tools/ui-kit/src/styles/main' as rt; // or the package's scss entry
|
|
23
|
+
/// @include rt.color-scheme('teal', (
|
|
24
|
+
/// primary: (20: #b3e3e1, 40: #5cb8b5, 60: #1a9d99, 100: #008582),
|
|
25
|
+
/// brand: (20: #e8e8e8, 100: #008582),
|
|
26
|
+
/// ));
|
|
27
|
+
///
|
|
28
|
+
/// One tonal ramp per role serves both light and dark (M3-style): the mode picks
|
|
29
|
+
/// the tone via `light-dark()` inside the semantic tier — schemes never duplicate
|
|
30
|
+
/// that logic. `$modes` is accepted for forward-compatibility but a single ramp
|
|
31
|
+
/// already covers every mode.
|
|
32
|
+
|
|
33
|
+
/// Roles a scheme may override, with their valid tone steps (from the default ramps).
|
|
34
|
+
$known-roles: tokens.$accent-roles;
|
|
35
|
+
|
|
36
|
+
/// Validate a single role/ramp pair; @error with an actionable message on bad input.
|
|
37
|
+
@function _validate-role($name, $role, $ramp) {
|
|
38
|
+
@if not map.has-key($known-roles, $role) {
|
|
39
|
+
@error 'rt.color-scheme("#{$name}"): unknown role "#{$role}". Allowed roles: #{map.keys($known-roles)}.';
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@if meta.type-of($ramp) != 'map' {
|
|
43
|
+
@error 'rt.color-scheme("#{$name}"): role "#{$role}" must be a map of (tone: color), got #{meta.type-of($ramp)}.';
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
@each $step, $value in $ramp {
|
|
47
|
+
@if meta.type-of($step) != 'number' or not _is-integer-step($step) {
|
|
48
|
+
@error 'rt.color-scheme("#{$name}"): role "#{$role}" tone "#{$step}" must be an integer 0–100.';
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
@return true;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/// Tone steps must be integers within 0–100.
|
|
56
|
+
@function _is-integer-step($step) {
|
|
57
|
+
@return $step >= 0 and $step <= 100 and ($step % 1 == 0);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/// Emit a named color scheme as a `[data-rt-scheme]` block (only raw `--rt-color-{role}-{N}` rows).
|
|
61
|
+
///
|
|
62
|
+
/// @param {String} $name Scheme name, matched by `data-rt-scheme="<name>"`.
|
|
63
|
+
/// @param {Map} $roles Map of `role: (tone: color, …)`. Roles ⊆ #{map.keys($known-roles)}.
|
|
64
|
+
/// @param {List} $modes Reserved for forward-compat; one ramp already serves all modes.
|
|
65
|
+
@mixin color-scheme($name, $roles, $modes: (light, dark)) {
|
|
66
|
+
@if meta.type-of($name) != 'string' {
|
|
67
|
+
@error 'rt.color-scheme: $name must be a string, got #{meta.type-of($name)}.';
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
@if meta.type-of($roles) != 'map' or list.length(map.keys($roles)) == 0 {
|
|
71
|
+
@error 'rt.color-scheme("#{$name}"): $roles must be a non-empty map of (role: ramp).';
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
@each $role, $ramp in $roles {
|
|
75
|
+
$ok: _validate-role($name, $role, $ramp);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// `:root[...]` (0,2,0) outranks the default `:root` rows (0,1,0) regardless of source order.
|
|
79
|
+
:root[data-rt-scheme='#{$name}'] {
|
|
80
|
+
@each $role, $ramp in $roles {
|
|
81
|
+
@each $step, $value in $ramp {
|
|
82
|
+
--rt-color-#{$role}-#{$step}: #{$value};
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
@@ -1,12 +1,7 @@
|
|
|
1
|
+
@use 'sass:color';
|
|
1
2
|
@use 'sass:math';
|
|
2
3
|
@use './variables' as vars;
|
|
3
4
|
|
|
4
|
-
// css clr var generator
|
|
5
|
-
// #{generateCssVar(red, 100)}: #eb5055;
|
|
6
|
-
@function generateCssClrVar($color, $saturate) {
|
|
7
|
-
@return --#{vars.$styles-clr-prefix}-#{$color}-#{$saturate};
|
|
8
|
-
}
|
|
9
|
-
|
|
10
5
|
// css var generator
|
|
11
6
|
// #{generateCssVar(table-base-cell, suffix-icon, size)}: 1rem;
|
|
12
7
|
@function generateCssVar($component-name, $element, $style-token) {
|
|
@@ -16,9 +11,9 @@
|
|
|
16
11
|
// convert hex to rgb values
|
|
17
12
|
// #{convert-hex-to-rgb-values(#ab2727)}: 171, 39, 39;
|
|
18
13
|
@function convert-hex-to-rgb-values($hex) {
|
|
19
|
-
$r:
|
|
20
|
-
$g:
|
|
21
|
-
$b:
|
|
14
|
+
$r: color.channel($hex, 'red', $space: rgb);
|
|
15
|
+
$g: color.channel($hex, 'green', $space: rgb);
|
|
16
|
+
$b: color.channel($hex, 'blue', $space: rgb);
|
|
22
17
|
|
|
23
18
|
@return $r + ', ' + $g + ', ' + $b;
|
|
24
19
|
}
|
|
@@ -26,6 +21,7 @@
|
|
|
26
21
|
// px to rem
|
|
27
22
|
// font-size: rem(16);
|
|
28
23
|
$browser-context: 16;
|
|
24
|
+
|
|
29
25
|
@function rem($valueRem, $context: $browser-context) {
|
|
30
26
|
@return #{math.div($valueRem, $context)}rem;
|
|
31
27
|
}
|
|
@@ -47,20 +43,21 @@ $browser-context: 16;
|
|
|
47
43
|
@mixin flex-column-center {
|
|
48
44
|
display: flex;
|
|
49
45
|
flex-direction: column;
|
|
50
|
-
justify-content: center;
|
|
51
46
|
align-items: center;
|
|
47
|
+
justify-content: center;
|
|
52
48
|
}
|
|
53
49
|
|
|
54
50
|
@mixin visually-hidden {
|
|
55
51
|
position: absolute;
|
|
52
|
+
overflow: hidden;
|
|
56
53
|
width: 1px;
|
|
57
54
|
height: 1px;
|
|
58
|
-
margin: -1px;
|
|
59
|
-
border: 0;
|
|
60
55
|
padding: 0;
|
|
61
|
-
|
|
62
|
-
|
|
56
|
+
border: 0;
|
|
57
|
+
margin: -1px;
|
|
58
|
+
/* stylelint-disable-next-line property-no-deprecated -- legacy-browser leg of the visually-hidden pattern */
|
|
63
59
|
clip: rect(0 0 0 0);
|
|
64
|
-
|
|
60
|
+
clip-path: inset(100%);
|
|
65
61
|
pointer-events: none;
|
|
62
|
+
white-space: nowrap;
|
|
66
63
|
}
|