@rt-tools/ui-kit 0.3.1 → 0.5.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.
Files changed (42) hide show
  1. package/README.md +1 -1
  2. package/fesm2022/rt-tools-ui-kit.mjs +4394 -3750
  3. package/fesm2022/rt-tools-ui-kit.mjs.map +1 -1
  4. package/package.json +3 -4
  5. package/rt-tools-ui-kit-0.5.0.tgz +0 -0
  6. package/src/lib/ui-kit/action-bar/components/bar/rtui-action-bar.component.scss +14 -0
  7. package/src/lib/ui-kit/action-bar/components/container/rtui-action-bar-container.component.scss +47 -0
  8. package/src/lib/ui-kit/action-bar/stories/component/test-action-bar.component.scss +15 -0
  9. package/src/lib/ui-kit/aside/components/container/aside-container.component.scss +4 -1
  10. package/src/lib/ui-kit/aside/components/error-notification/aside-error-box.component.scss +1 -1
  11. package/src/lib/ui-kit/aside/components/panel/aside-panel.component.scss +24 -0
  12. package/src/lib/ui-kit/buttons/unified-button/rtui-button.component.scss +210 -206
  13. package/src/lib/ui-kit/buttons/unified-button/stories/component/test-button-matrix.component.scss +38 -0
  14. package/src/lib/ui-kit/icon/rtui-icon.component.scss +43 -24
  15. package/src/lib/ui-kit/info-badge/info-badge.component.scss +23 -23
  16. package/src/lib/ui-kit/popover/stories/component/test-popover.component.scss +32 -0
  17. package/src/lib/ui-kit/scrollable/scrollable-container.component.scss +57 -0
  18. package/src/lib/ui-kit/scrollable/stories/component/test-scrollable.component.scss +17 -0
  19. package/src/lib/ui-kit/side-menu/menu/rtui-side-menu.component.scss +185 -4
  20. package/src/lib/ui-kit/side-menu/menu-sub-item/rtui-side-menu-sub-item.component.scss +45 -4
  21. package/src/lib/ui-kit/snack-bar/snack-bar.component.scss +20 -0
  22. package/src/lib/ui-kit/spinner/spinner.component.scss +1 -1
  23. package/src/lib/ui-kit/table/components/pagination-view/rtui-pagination.component.scss +20 -17
  24. package/src/lib/ui-kit/table/components/table-base-cell/table-base-cell.component.scss +21 -0
  25. package/src/lib/ui-kit/table/components/table-container/table-container.component.scss +26 -0
  26. package/src/lib/ui-kit/table/stories/dynamic-list/test-dynamic-list.component.scss +18 -0
  27. package/src/lib/ui-kit/toolbar/stories/component/test-toolbar.component.scss +22 -0
  28. package/src/styles/TOKENS.md +25 -16
  29. package/src/styles/base/_base.scss +6 -3
  30. package/src/styles/base/_tokens.scss +24 -0
  31. package/src/styles/color-scheme.spec.ts +4 -1
  32. package/src/styles/components/_rtui_button.scss +13 -547
  33. package/src/styles/components/button/_base.scss +64 -0
  34. package/src/styles/components/button/_map.scss +184 -0
  35. package/src/styles/components/button/_palettes.scss +218 -0
  36. package/src/styles/components/button/_sizes.scss +29 -0
  37. package/src/styles/components/button/_text.scss +68 -0
  38. package/src/styles/main.scss +0 -1
  39. package/styles/tokens.css +11 -0
  40. package/types/rt-tools-ui-kit.d.ts +614 -361
  41. package/rt-tools-ui-kit-0.3.1.tgz +0 -0
  42. package/src/styles/components/_button.scss +0 -372
@@ -1,4 +1,5 @@
1
1
  @use '../../../../../styles/base/mixin' as mixins;
2
+ @use '../../../../../styles/base/variables' as vars;
2
3
 
3
4
  $base-cell: (
4
5
  host: (
@@ -18,8 +19,13 @@ $base-cell: (
18
19
  position-left: 0.25rem,
19
20
  padding: 0.25rem,
20
21
  background-color: var(--mat-fab-small-container-color),
22
+ border-radius: 5px,
23
+ color: var(--rt-color-neutral-60),
21
24
  icon-size: 1rem,
22
25
  ),
26
+ copy-button-hover: (
27
+ color: var(--rt-color-neutral-100),
28
+ ),
23
29
  copy-button-complete: (
24
30
  color: var(--rt-text-base-strong),
25
31
  ),
@@ -88,10 +94,24 @@ $base-cell: (
88
94
 
89
95
  &__copy-button {
90
96
  position: absolute;
97
+ display: inline-flex;
98
+ align-items: center;
99
+ justify-content: center;
91
100
  padding: var(--rt-table-base-cell-copy-button-padding);
101
+ border: 0;
102
+ border-radius: var(--rt-table-base-cell-copy-button-border-radius);
92
103
  background-color: var(--rt-table-base-cell-copy-button-background-color);
104
+ color: var(--rt-table-base-cell-copy-button-color);
105
+ line-height: 1;
106
+ transition: all 0.15s linear;
93
107
  visibility: hidden;
94
108
 
109
+ // На узком экране кнопка показана всегда: наведения, по которому она
110
+ // проявляется на широком, там не бывает.
111
+ @include mixins.media-breakpoint-down(vars.$device-xs) {
112
+ visibility: visible;
113
+ }
114
+
95
115
  &--position {
96
116
  &--left {
97
117
  left: var(--rt-table-base-cell-copy-button-position-left);
@@ -106,6 +126,7 @@ $base-cell: (
106
126
  &:focus,
107
127
  &:active {
108
128
  background-color: var(--rt-table-base-cell-copy-button-background-color);
129
+ color: var(--rt-table-base-cell-copy-button-hover-color);
109
130
  }
110
131
 
111
132
  &--complete {
@@ -28,6 +28,12 @@ $table-container: (
28
28
  height: 2rem,
29
29
  border-left: 1px solid var(--rt-border-neutral-divider),
30
30
  ),
31
+ toolbar-action: (
32
+ color: var(--rt-color-neutral-60),
33
+ ),
34
+ toolbar-action-hover: (
35
+ color: var(--rt-color-neutral-100),
36
+ ),
31
37
  toolbar-search: (
32
38
  width: 22rem,
33
39
  ),
@@ -139,6 +145,26 @@ $table-container: (
139
145
  border-left: var(--rt-table-container-toolbar-actions-divider-border-left);
140
146
  }
141
147
 
148
+ &-action {
149
+ position: relative;
150
+ display: inline-flex;
151
+ align-items: center;
152
+ justify-content: center;
153
+ border: 0;
154
+ background-color: transparent;
155
+ color: var(--rt-table-container-toolbar-action-color);
156
+ line-height: 1;
157
+ transition: all 0.15s linear;
158
+
159
+ &:hover {
160
+ color: var(--rt-table-container-toolbar-action-hover-color);
161
+
162
+ svg g {
163
+ fill: var(--rt-table-container-toolbar-action-hover-color);
164
+ }
165
+ }
166
+ }
167
+
142
168
  &-search {
143
169
  width: var(--rt-table-container-toolbar-search-width);
144
170
  }
@@ -12,4 +12,22 @@
12
12
  width: 100px;
13
13
  height: 40px;
14
14
  }
15
+
16
+ // Так приложение гасит собственный вид материальной кнопки-действия. Кит своих кнопок
17
+ // этим набором больше не оформляет, и витрина показывает приём, а не заимствует его.
18
+ .demo-fab {
19
+ position: relative;
20
+ display: inline-flex;
21
+ align-items: center;
22
+ justify-content: center;
23
+ border: 0;
24
+ background-color: transparent;
25
+ color: var(--rt-color-neutral-60);
26
+ line-height: 1;
27
+ transition: all 0.15s linear;
28
+
29
+ &:hover {
30
+ color: var(--rt-color-neutral-100);
31
+ }
32
+ }
15
33
  }
@@ -0,0 +1,22 @@
1
+ :host {
2
+ display: block;
3
+ width: 100%;
4
+ margin: -1rem;
5
+
6
+ .title {
7
+ overflow: hidden;
8
+ padding: 0 1rem;
9
+ font-weight: 500;
10
+ text-overflow: ellipsis;
11
+ white-space: nowrap;
12
+ }
13
+
14
+ .page {
15
+ padding: 0 1rem;
16
+
17
+ &__row {
18
+ padding: 0.75rem 0;
19
+ border-bottom: 1px solid var(--rt-border-neutral-default);
20
+ }
21
+ }
22
+ }
@@ -22,7 +22,10 @@ Quick facts:
22
22
  ramps (`{primary,info,success,warning,danger,brand}`). Custom brand palettes
23
23
  override only those rows — see **Custom color schemes** below.
24
24
  - Foundations: `--rt-spacing-{0..64}` (px-named, rem values), `--rt-radius-*`,
25
- `--rt-font-*`, `--rt-shadow-*`, `--rt-transition-*`, `--rt-z-index-*`.
25
+ `--rt-font-*`, `--rt-icon-size-{xs..3xl}`, `--rt-shadow-*`, `--rt-transition-*`,
26
+ `--rt-z-index-*`.
27
+ - `--rt-icon-size-*` sizes an icon box whole — width, height and font-size take the same
28
+ step, because a glyph icon is sized by its font-size and the box has to follow it.
26
29
  - Prebuilt CSS for non-sass consumers: `dist/ui-kit/styles/tokens.css`
27
30
  (`pnpm run build:tokens`).
28
31
  - Figma parity: collections `core` (`rt/color/*`) and `theme` (`rt/{bg,text,icon,border}/*`,
@@ -58,21 +61,27 @@ major the internal set stops being emitted and gets inlined into rules.
58
61
  - Planned unification (major): emit defaults via `var(--override, default)` indirection so all
59
62
  components are ancestor-overridable without `!important`.
60
63
 
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`) |
64
+ ## Buttons: the retired `.c-button` set
65
+
66
+ `.c-button` is **gone** `.rtui-btn` (\_rtui_button.scss) is the only button set the kit ships.
67
+ The `--rt-button-*` custom properties went with it; an app that overrode them (dark mode
68
+ included) overrides `--rt-rtui-btn-*` instead. Migration map:
69
+
70
+ | retired `.c-button` | `.rtui-btn` |
71
+ | ------------------------- | ------------------------------------------------------------------------ |
72
+ | `--fill-green` / `-light` | `rtui-btn-success` / `-light` |
73
+ | `--fill-red` / `-light` | `rtui-btn-error` / `-light` |
74
+ | `--fill-blue` | `rtui-btn-accent-light` |
75
+ | `--fill-base/black/gray` | `rtui-btn-secondary` (+`-light`) |
76
+ | `--outline-{blue,base}` | `rtui-btn-{accent,secondary}-outline` |
77
+ | `--txt-{base,gray,blue}` | `rtui-btn-{secondary,secondary,accent}-text` |
78
+ | `--size-{sm,md,l}` | `rtui-btn-{sm,md,lg}` (+`-full`) — a text appearance sizes itself |
79
+ | `--fab` | none: an icon-only button is styled by the component that owns it |
80
+ | `--h-{30,40}`, `--shadow` | none — pick a size class, or declare the box on your own component class |
81
+ | `--disabled` | none: `.rtui-btn:disabled` dims the button, the class is not needed |
82
+
83
+ `button { cursor: pointer; line-height: 1 }` used to ride along with the set and now lives in
84
+ `styles/base/_base.scss` — it is a page-wide reset, not part of any button set.
76
85
 
77
86
  ## Material bridge
78
87
 
@@ -57,7 +57,10 @@ $palette: (
57
57
  // All CSS custom property emission lives in base/_tokens.scss:
58
58
  // --rt-color-* primitives, --rt-{bg,text,icon,border}-* semantic, and foundations.
59
59
 
60
- :root {
61
- // Buttons
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%);
60
+ // Base reset for every button on the page. It used to ride along with the legacy `.c-button`
61
+ // set; the set is gone, the reset is not — dropping it would move the text metrics of every
62
+ // button in a consuming app, which has nothing to do with retiring a class set.
63
+ button {
64
+ cursor: pointer;
65
+ line-height: 1;
63
66
  }
@@ -193,6 +193,11 @@ $semantic: (
193
193
  color-mix(in srgb, var(--rt-color-warning-80) 90%, #fff)
194
194
  ),
195
195
  bg-accent-warning-disabled: color-mix(in srgb, var(--rt-color-warning-80) 38%, transparent),
196
+ /* Подсветка найденного. Жёлтая в обеих темах — так подсвечивает найденное сам браузер,
197
+ и человек читает эту заливку без объяснений. Текст на ней тёмный всегда: жёлтый фон
198
+ светлый в любой теме, и светлая подпись на нём пропадает. */
199
+ bg-accent-highlight: t(#ffeb3b, #ffd54f),
200
+ text-accent-highlight: #181818,
196
201
  bg-accent-danger-subtle: t(var(--rt-color-danger-10), color-mix(in srgb, var(--rt-color-danger-100) 18%, #1c1b1e)),
197
202
  bg-accent-danger-solid: var(--rt-color-danger-100),
198
203
  bg-accent-danger-hover: t(
@@ -267,7 +272,9 @@ $spacing: (
267
272
  4: 0.25rem,
268
273
  6: 0.375rem,
269
274
  8: 0.5rem,
275
+ 10: 0.625rem,
270
276
  12: 0.75rem,
277
+ 14: 0.875rem,
271
278
  16: 1rem,
272
279
  20: 1.25rem,
273
280
  24: 1.5rem,
@@ -299,6 +306,19 @@ $font-weight: (
299
306
  semibold: 600,
300
307
  bold: 700,
301
308
  );
309
+
310
+ // Icon box: one step drives width, height and font-size at once — a glyph icon is sized
311
+ // by its font-size, and the box has to follow it exactly. Separate from $font-size because
312
+ // the large steps (32-56px) are icon sizes, not type sizes.
313
+ $icon-size: (
314
+ xs: 0.875rem,
315
+ sm: 1rem,
316
+ md: 1.5rem,
317
+ lg: 2rem,
318
+ xl: 2.5rem,
319
+ xxl: 3rem,
320
+ 3xl: 3.5rem,
321
+ );
302
322
  $shadow: (
303
323
  sm: (
304
324
  0 0.0625rem 0.25rem 0 rgb(0 0 0 / 12%),
@@ -393,6 +413,10 @@ $breakpoint: (
393
413
  --rt-font-weight-#{$token}: #{$value};
394
414
  }
395
415
 
416
+ @each $token, $value in $icon-size {
417
+ --rt-icon-size-#{$token}: #{$value};
418
+ }
419
+
396
420
  @each $token, $value in $shadow {
397
421
  --rt-shadow-#{$token}: #{$value};
398
422
  }
@@ -230,7 +230,10 @@ describe('rt-tools color schemes', () => {
230
230
  const scheme: Record<string, string> = extractDeclarations(css, '--rt-color-primary-\\d+');
231
231
  // bg-accent-primary-solid === var(--rt-color-primary-100); under the teal scheme that is #008582
232
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)');
233
+ const solid: RegExpMatchArray | null = css.match(/--rt-bg-accent-primary-solid:\s*([^;]+);/);
234
+
235
+ expect(solid).not.toBeNull();
236
+ expect(normalize(stripMat(solid?.[1] ?? ''))).toBe('var(--rt-color-primary-100)');
234
237
  });
235
238
  });
236
239
  });