@rt-tools/ui-kit 0.0.24 → 0.0.26

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rt-tools/ui-kit",
3
- "version": "0.0.24",
3
+ "version": "0.0.26",
4
4
  "license": "Apache-2.0",
5
5
  "author": "Yauheni Krumin",
6
6
  "type": "module",
Binary file
@@ -6,7 +6,8 @@
6
6
  display: block;
7
7
  width: 100%;
8
8
 
9
- .rtui-button {
9
+ .rtui-button,
10
+ .rtui-button-material {
10
11
  width: 100%;
11
12
  }
12
13
  }
@@ -103,11 +104,11 @@
103
104
 
104
105
  /* ===================== pill ===================== */
105
106
  &--type-pill {
106
- gap: 0.375rem;
107
107
  border-radius: 1.5rem;
108
108
  background-color: var(--mat-sys-surface-container-high);
109
109
  color: var(--mat-sys-on-surface-variant);
110
110
  font-weight: 500;
111
+ gap: 0.375rem;
111
112
 
112
113
  &:hover:not(:disabled) {
113
114
  background-color: var(--mat-sys-surface-container-highest);
@@ -245,72 +246,36 @@
245
246
  background-color: var(--rt-bg-base-hover);
246
247
  }
247
248
  }
249
+ }
248
250
 
249
- /* ===================== design: material =====================
250
- Classic Material (M3) look, opted in per instance ([design]="'material'")
251
- or app-wide via the RT_UI_CONFIG provider. Renders the pill as an M3
252
- filled button; `appearance-text` renders as an M3 text button. Variants
253
- map onto the Material theme: `danger` -> error, everything else -> primary
254
- (M3 has no success/warning roles). These rules come after the custom-look
255
- blocks on purpose: equal-or-higher specificity wins by source order. */
256
- &--type-pill.rtui-button--design-material {
257
- min-height: 2.5rem;
258
- padding: 0 var(--mat-button-filled-horizontal-padding, 1.5rem);
259
- border-radius: var(--mat-sys-corner-full, 1.25rem);
260
- background-color: var(--mat-sys-primary);
261
- color: var(--mat-sys-on-primary);
262
- font-size: var(--mat-sys-label-large-size, 0.875rem);
263
- font-weight: var(--mat-sys-label-large-weight, 500);
264
-
265
- &:hover:not(:disabled) {
266
- background-color: color-mix(in srgb, var(--mat-sys-primary) 92%, var(--mat-sys-on-primary));
267
- }
268
-
269
- &:active:not(:disabled) {
270
- background-color: color-mix(in srgb, var(--mat-sys-primary) 84%, var(--mat-sys-on-primary));
271
- }
272
- }
273
-
274
- &--type-pill.rtui-button--design-material.rtui-button--variant-danger {
275
- background-color: var(--mat-sys-error);
276
- color: var(--mat-sys-on-error);
277
-
278
- &:hover:not(:disabled) {
279
- background-color: color-mix(in srgb, var(--mat-sys-error) 92%, var(--mat-sys-on-error));
280
- }
281
-
282
- &:active:not(:disabled) {
283
- background-color: color-mix(in srgb, var(--mat-sys-error) 84%, var(--mat-sys-on-error));
284
- }
285
- }
286
-
287
- &--type-pill.rtui-button--design-material.rtui-button--appearance-text {
288
- min-height: 2.5rem;
289
- padding: 0 var(--mat-button-text-horizontal-padding, 0.75rem);
290
- background-color: transparent;
291
- color: var(--mat-sys-primary);
292
- font-size: var(--mat-sys-label-large-size, 0.875rem);
293
- font-weight: var(--mat-sys-label-large-weight, 500);
294
-
295
- &:hover:not(:disabled) {
296
- background-color: color-mix(in srgb, var(--mat-sys-primary) 8%, transparent);
297
- }
298
-
299
- &:active:not(:disabled) {
300
- background-color: color-mix(in srgb, var(--mat-sys-primary) 12%, transparent);
301
- }
251
+ /* ===================== design: material =====================
252
+ Under `design: 'material'` the pill renders a NATIVE Material button (see the
253
+ template) whose look is fully owned by the Material theme. The only styling
254
+ the library adds is the variant mapping: `danger` re-points the button's own
255
+ theme tokens at the M3 error role (M3 has no success/warning roles, so every
256
+ other variant keeps the theme primary). */
257
+ .rtui-button-material {
258
+ rtui-spinner {
259
+ display: flex;
260
+ align-items: center;
261
+ justify-content: center;
302
262
  }
303
263
 
304
- &--type-pill.rtui-button--design-material.rtui-button--variant-danger.rtui-button--appearance-text {
305
- background-color: transparent;
306
- color: var(--mat-sys-error);
307
-
308
- &:hover:not(:disabled) {
309
- background-color: color-mix(in srgb, var(--mat-sys-error) 8%, transparent);
310
- }
311
-
312
- &:active:not(:disabled) {
313
- background-color: color-mix(in srgb, var(--mat-sys-error) 12%, transparent);
314
- }
264
+ &--danger {
265
+ --mat-button-filled-container-color: var(--mat-sys-error);
266
+ --mat-button-filled-label-text-color: var(--mat-sys-on-error);
267
+ --mat-button-filled-state-layer-color: var(--mat-sys-on-error);
268
+ --mat-button-filled-ripple-color: color-mix(in srgb, var(--mat-sys-on-error) 12%, transparent);
269
+ --mat-button-outlined-label-text-color: var(--mat-sys-error);
270
+ --mat-button-outlined-outline-color: var(--mat-sys-error);
271
+ --mat-button-outlined-state-layer-color: var(--mat-sys-error);
272
+ --mat-button-outlined-ripple-color: color-mix(in srgb, var(--mat-sys-error) 12%, transparent);
273
+ --mat-button-text-label-text-color: var(--mat-sys-error);
274
+ --mat-button-text-state-layer-color: var(--mat-sys-error);
275
+ --mat-button-text-ripple-color: color-mix(in srgb, var(--mat-sys-error) 12%, transparent);
276
+ --mat-button-tonal-container-color: var(--mat-sys-error-container);
277
+ --mat-button-tonal-label-text-color: var(--mat-sys-on-error-container);
278
+ --mat-button-tonal-state-layer-color: var(--mat-sys-on-error-container);
279
+ --mat-button-tonal-ripple-color: color-mix(in srgb, var(--mat-sys-on-error-container) 12%, transparent);
315
280
  }
316
281
  }
@@ -10,6 +10,7 @@ import { OverlayRef, ComponentType, ConnectedPosition, CdkOverlayOrigin } from '
10
10
  import { ComponentType as ComponentType$1 } from '@angular/cdk/portal';
11
11
  import { HttpErrorResponse } from '@angular/common/http';
12
12
  import { BooleanInput, NumberInput } from '@angular/cdk/coercion';
13
+ import { MatButtonAppearance } from '@angular/material/button';
13
14
  import * as i1 from '@angular/material/tooltip';
14
15
  import { TooltipPosition } from '@angular/material/tooltip';
15
16
  import { MatFormFieldAppearance } from '@angular/material/form-field';
@@ -327,8 +328,9 @@ declare const RT_SCHEME_ATTRIBUTE: string;
327
328
  /**
328
329
  * Design system a control renders with:
329
330
  * - `'custom'` — the rt-tools look (design tokens, pill shapes). The default.
330
- * - `'material'` — the classic Material (M3) look, for apps that have not migrated
331
- * their visual language yet or need to match surrounding Material controls.
331
+ * - `'material'` — the control renders a NATIVE Angular Material component
332
+ * (e.g. the button pill becomes a real `matButton`), for apps that have not
333
+ * migrated their visual language yet or need to match surrounding Material controls.
332
334
  */
333
335
  type RtUiDesign = 'material' | 'custom';
334
336
  declare namespace IRtUiConfig {
@@ -413,6 +415,8 @@ declare class RtuiButtonComponent {
413
415
  protected readonly resolvedSize: Signal<IRtuiButton.Size>;
414
416
  protected readonly resolvedRadius: Signal<IRtuiButton.Radius>;
415
417
  protected readonly resolvedAppearance: Signal<IRtuiButton.Appearance | undefined>;
418
+ /** Native Material button appearance the pill renders with under `design: 'material'`. */
419
+ protected readonly materialAppearance: Signal<MatButtonAppearance>;
416
420
  protected readonly resolvedIconSize: Signal<RtuiIconSizeType>;
417
421
  protected readonly spinnerSize: Signal<number>;
418
422
  protected readonly modifiers: Signal<Record<string, boolean>>;
Binary file