@resolve-components/theme 1.0.0 → 1.2.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 (49) hide show
  1. package/accordion/rc-accordion.scss +141 -0
  2. package/alert/rc-alert.scss +158 -0
  3. package/autocomplete/rc-autocomplete.scss +64 -0
  4. package/badge/rc-badge.scss +57 -0
  5. package/button/rc-button.scss +198 -0
  6. package/card/rc-card.scss +31 -0
  7. package/checkbox/rc-checkbox.scss +163 -0
  8. package/chip/rc-chip.scss +172 -0
  9. package/datepicker/rc-datepicker.scss +322 -0
  10. package/dialog/rc-dialog.scss +114 -0
  11. package/fesm2022/resolve-components-theme.mjs +44 -30
  12. package/fesm2022/resolve-components-theme.mjs.map +1 -1
  13. package/file-upload/rc-file-upload.scss +143 -0
  14. package/icon/rc-icon.scss +47 -0
  15. package/infinite-scroll/rc-infinite-scroll.scss +54 -0
  16. package/input/rc-input.scss +156 -0
  17. package/menu/rc-menu.scss +84 -0
  18. package/navbar/rc-navbar.scss +112 -0
  19. package/package.json +16 -9
  20. package/paginator/rc-paginator.scss +86 -0
  21. package/progress-bar/rc-progress-bar.scss +88 -0
  22. package/radio/rc-radio.scss +124 -0
  23. package/schematics/ng-add/index.js +149 -69
  24. package/schematics/ng-add/schema.json +14 -0
  25. package/select/rc-select.scss +197 -0
  26. package/sidenav/rc-sidenav.scss +154 -0
  27. package/slider/rc-slider.scss +311 -0
  28. package/spinner/rc-spinner.scss +106 -0
  29. package/{src/lib/styles → styles}/theming/_mapping.scss +2 -1
  30. package/table/rc-table.scss +147 -0
  31. package/tabs/rc-tabs.scss +155 -0
  32. package/toast/rc-toast.scss +228 -0
  33. package/toggle/rc-toggle.scss +138 -0
  34. package/tooltip/rc-tooltip.scss +34 -0
  35. package/tree/rc-tree.scss +114 -0
  36. package/types/resolve-components-theme.d.ts +32 -31
  37. package/virtual-scroll/rc-virtual-scroll.scss +38 -0
  38. /package/{src/lib/styles → styles}/_all.scss +0 -0
  39. /package/{src/lib/styles → styles}/_globals.scss +0 -0
  40. /package/{src/lib/styles → styles}/_themes.scss +0 -0
  41. /package/{src/lib/styles → styles}/_theming.scss +0 -0
  42. /package/{src/lib/styles → styles}/themes/_dark.scss +0 -0
  43. /package/{src/lib/styles → styles}/themes/_default.scss +0 -0
  44. /package/{src/lib/styles → styles}/theming/_animation.scss +0 -0
  45. /package/{src/lib/styles → styles}/theming/_functions.scss +0 -0
  46. /package/{src/lib/styles → styles}/theming/_get-value.scss +0 -0
  47. /package/{src/lib/styles → styles}/theming/_install.scss +0 -0
  48. /package/{src/lib/styles → styles}/theming/_register.scss +0 -0
  49. /package/{src/lib/styles → styles}/theming/_theming-variables.scss +0 -0
@@ -0,0 +1,114 @@
1
+ // =============================================================================
2
+ // rc-dialog Resolve Components Dialog (Themed)
3
+ // =============================================================================
4
+
5
+ @use '../styles/theming/get-value' as *;
6
+ @use '../styles/theming/install' as *;
7
+ @use '../styles/theming/animation' as *;
8
+
9
+ @include rc-install-component() {
10
+ // ── Backdrop ──────────────────────────────────────────────────────────────
11
+ .rc-dialog-backdrop {
12
+ background: rc-theme('dialog-overlay-backdrop-color');
13
+ }
14
+
15
+ // ── Dialog panel ──────────────────────────────────────────────────────────
16
+ .rc-dialog {
17
+ position: relative;
18
+ display: flex;
19
+ flex-direction: column;
20
+ min-width: 20rem;
21
+ max-height: 85vh;
22
+ outline: none;
23
+ overflow: hidden;
24
+ background: rc-theme('dialog-background');
25
+ color: rc-theme('dialog-text-color');
26
+ border-radius: rc-theme('dialog-border-radius');
27
+ box-shadow: rc-theme('dialog-shadow');
28
+
29
+ @media (prefers-reduced-motion: no-preference) {
30
+ animation: rc-dialog-enter rc-theme('transition-duration-normal')
31
+ cubic-bezier(0, 0, 0.2, 1);
32
+ }
33
+ }
34
+
35
+ @keyframes rc-dialog-enter {
36
+ from {
37
+ opacity: 0;
38
+ transform: scale(0.96) translateY(-12px);
39
+ }
40
+ to {
41
+ opacity: 1;
42
+ transform: scale(1) translateY(0);
43
+ }
44
+ }
45
+
46
+ // ── Close button ──────────────────────────────────────────────────────────
47
+ .rc-dialog-close-btn {
48
+ position: absolute;
49
+ top: 0.875rem;
50
+ right: 0.875rem;
51
+ z-index: 1;
52
+ display: flex;
53
+ align-items: center;
54
+ justify-content: center;
55
+ width: 2rem;
56
+ height: 2rem;
57
+ padding: 0;
58
+ background: transparent;
59
+ border: none;
60
+ border-radius: rc-theme('radius-md');
61
+ cursor: pointer;
62
+ color: rc-theme('dialog-close-color');
63
+ @include rc-component-animation(background color);
64
+
65
+ &:hover {
66
+ background: rc-theme('dialog-close-hover-background');
67
+ color: rc-theme('dialog-close-hover-color');
68
+ }
69
+
70
+ &:focus-visible {
71
+ outline: rc-theme('focus-ring-width') solid rc-theme('focus-ring-color');
72
+ outline-offset: rc-theme('focus-ring-offset');
73
+ }
74
+ }
75
+
76
+ // ── Layout directives (applied in user content components) ───────────────
77
+
78
+ // [rcDialogTitle]
79
+ .rc-dialog-title {
80
+ display: block;
81
+ padding: rc-theme('dialog-header-padding');
82
+ // Extra right padding to avoid overlap with the close button
83
+ font-size: rc-theme('dialog-title-font-size');
84
+ font-weight: rc-theme('dialog-title-font-weight');
85
+ color: rc-theme('dialog-text-color');
86
+ margin: 0;
87
+ border-bottom: 1px solid rc-theme('dialog-border-color');
88
+ line-height: 1.4;
89
+ }
90
+
91
+ // [rcDialogContent]
92
+ .rc-dialog-content {
93
+ display: block;
94
+ padding: rc-theme('dialog-body-padding');
95
+ overflow-y: auto;
96
+ flex: 1 1 auto;
97
+ -webkit-overflow-scrolling: touch;
98
+ }
99
+
100
+ // [rcDialogActions]
101
+ .rc-dialog-actions {
102
+ display: flex;
103
+ align-items: center;
104
+ justify-content: flex-end;
105
+ gap: rc-theme('spacing-sm');
106
+ padding: rc-theme('dialog-actions-padding');
107
+ border-top: 1px solid rc-theme('dialog-border-color');
108
+ flex-shrink: 0;
109
+
110
+ &.rc-dialog-actions-start {
111
+ justify-content: flex-start;
112
+ }
113
+ }
114
+ }
@@ -483,7 +483,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
483
483
  * ```
484
484
  *
485
485
  * @input variant - Visual shape: `'filled'` | `'outline'` | `'ghost'`. Default: `'filled'`
486
- * @input status - Semantic colour: `'primary'` | `'secondary'` | `'danger'` | `'info'` | `'success'` | `'warning'`. Default: `'primary'`
486
+ * @input status - Semantic color: `'primary'` | `'secondary'` | `'danger'` | `'info'` | `'success'` | `'warning'`. Default: `'primary'`
487
487
  * @input size - Button size: `'sm'` | `'md'` | `'lg'`. Default: `'md'`
488
488
  * @input disabled - Whether the element is disabled. Default: `false`
489
489
  * @input iconOnly - Renders as a square icon-only button. Default: `false`
@@ -491,10 +491,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
491
491
  *
492
492
  * Variants (shape):
493
493
  * - `filled` Solid background — default
494
- * - `outline` Transparent with coloured border
494
+ * - `outline` Transparent with colored border
495
495
  * - `ghost` Fully transparent, hover reveals background
496
496
  *
497
- * Status (colour):
497
+ * Status (color):
498
498
  * - `primary` Blue — main call-to-action
499
499
  * - `secondary` Gray — secondary / neutral action
500
500
  * - `danger` Red — destructive / irreversible action
@@ -505,7 +505,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
505
505
  class RcButtonComponent {
506
506
  /** Visual shape of the button */
507
507
  variant = 'filled';
508
- /** Semantic colour / importance */
508
+ /** Semantic color / importance */
509
509
  status = 'primary';
510
510
  /** Button size */
511
511
  size = 'md';
@@ -541,7 +541,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
541
541
  '[class.rc-button-filled]': "variant === 'filled'",
542
542
  '[class.rc-button-outline]': "variant === 'outline'",
543
543
  '[class.rc-button-ghost]': "variant === 'ghost'",
544
- // status — colour
544
+ // status — color
545
545
  '[class.rc-button-primary]': "status === 'primary'",
546
546
  '[class.rc-button-secondary]': "status === 'secondary'",
547
547
  '[class.rc-button-danger]': "status === 'danger'",
@@ -587,7 +587,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
587
587
  * ```
588
588
  */
589
589
  class RcBadgeComponent {
590
- /** Colour status of the badge. */
590
+ /** Color status of the badge. */
591
591
  status = 'default';
592
592
  /** Badge size. */
593
593
  size = 'md';
@@ -679,7 +679,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
679
679
  * <rc-icon name="star"></rc-icon>
680
680
  * ```
681
681
  *
682
- * @example With status colour
682
+ * @example With status color
683
683
  * ```html
684
684
  * <rc-icon name="checkmark-circle" status="success"></rc-icon>
685
685
  * <rc-icon name="alert-circle" status="danger"></rc-icon>
@@ -704,15 +704,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
704
704
  * ```
705
705
  *
706
706
  * @input name - Eva Icons icon name (e.g. `'star'`, `'home'`, `'checkmark'`)
707
- * @input status - Colour variant using semantic theme tokens. Default: `'basic'`
707
+ * @input status - Color variant using semantic theme tokens. Default: `'basic'`
708
708
  */
709
709
  class RcIconComponent {
710
710
  sanitizer;
711
711
  /** Eva Icons icon name */
712
712
  name;
713
713
  /**
714
- * Colour status applied via theme CSS custom properties.
715
- * `'basic'` inherits the surrounding text colour.
714
+ * Color status applied via theme CSS custom properties.
715
+ * `'basic'` inherits the surrounding text color.
716
716
  */
717
717
  status = 'basic';
718
718
  svgHtml = '';
@@ -785,8 +785,8 @@ class RcTabComponent {
785
785
  /** Optional Eva Icons icon name shown before the label */
786
786
  icon;
787
787
  /**
788
- * Semantic status — colours the active tab indicator.
789
- * `'basic'` uses the default primary colour.
788
+ * Semantic status — colors the active tab indicator.
789
+ * `'basic'` uses the default primary color.
790
790
  */
791
791
  status = 'basic';
792
792
  /** When true the tab header is non-interactive */
@@ -1014,14 +1014,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
1014
1014
  * </rc-alert>
1015
1015
  * ```
1016
1016
  *
1017
- * @input status - Semantic status colour. Default: `'info'`
1017
+ * @input status - Semantic status color. Default: `'info'`
1018
1018
  * @input variant - Visual style. Default: `'subtle'`
1019
1019
  * @input title - Optional bold heading above the message.
1020
1020
  * @input dismissible - Shows a close button. Default: `false`
1021
1021
  * @output dismissed - Emits when the close button is clicked.
1022
1022
  */
1023
1023
  class RcAlertComponent {
1024
- /** Semantic status colour */
1024
+ /** Semantic status color */
1025
1025
  status = 'info';
1026
1026
  /** Visual style variant */
1027
1027
  variant = 'subtle';
@@ -2645,7 +2645,7 @@ class RcTableDataSource extends DataSource {
2645
2645
  * <rc-chip [disabled]="true">Not available</rc-chip>
2646
2646
  * ```
2647
2647
  *
2648
- * @input status - Colour status. Default: `'default'`
2648
+ * @input status - Color status. Default: `'default'`
2649
2649
  * @input size - Chip size. Default: `'md'`
2650
2650
  * @input icon - Eva Icons icon name shown before the label.
2651
2651
  * @input closeable - Shows a close/remove button. Default: `false`
@@ -2655,7 +2655,7 @@ class RcTableDataSource extends DataSource {
2655
2655
  * @output closed - Emits when the close button is clicked (and not disabled).
2656
2656
  */
2657
2657
  class RcChipComponent {
2658
- /** Colour status */
2658
+ /** Color status */
2659
2659
  status = 'default';
2660
2660
  /** Chip size */
2661
2661
  size = 'md';
@@ -5386,7 +5386,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
5386
5386
  * </rc-navbar>
5387
5387
  * ```
5388
5388
  *
5389
- * @example Primary colour + sticky
5389
+ * @example Primary color + sticky
5390
5390
  * ```html
5391
5391
  * <rc-navbar color="primary" position="sticky">…</rc-navbar>
5392
5392
  * ```
@@ -5421,9 +5421,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
5421
5421
  */
5422
5422
  class RcNavbarComponent {
5423
5423
  /**
5424
- * Colour variant.
5424
+ * Color variant.
5425
5425
  * - `'default'` — white / surface background (default)
5426
- * - `'primary'` — primary brand colour
5426
+ * - `'primary'` — primary brand color
5427
5427
  */
5428
5428
  color = 'default';
5429
5429
  /**
@@ -7058,7 +7058,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
7058
7058
  * <rc-spinner status="danger" message="Saving failed — retrying…"></rc-spinner>
7059
7059
  * ```
7060
7060
  *
7061
- * @example Status colours
7061
+ * @example Status colors
7062
7062
  * ```html
7063
7063
  * <rc-spinner status="primary"></rc-spinner>
7064
7064
  * <rc-spinner status="info"></rc-spinner>
@@ -7069,7 +7069,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
7069
7069
  * ```
7070
7070
  */
7071
7071
  class RcSpinnerComponent {
7072
- /** Colour status of the spinner circle. Default: `'primary'` */
7072
+ /** Color status of the spinner circle. Default: `'primary'` */
7073
7073
  status = 'primary';
7074
7074
  /** Visual size of the spinner. Default: `'md'` */
7075
7075
  size = 'md';
@@ -7153,7 +7153,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
7153
7153
  class RcSpinnerDirective {
7154
7154
  /** When `true`, the spinner overlay is rendered inside the host element. */
7155
7155
  rcSpinner = false;
7156
- /** Colour status forwarded to the inner `rc-spinner`. Default: `'primary'` */
7156
+ /** Color status forwarded to the inner `rc-spinner`. Default: `'primary'` */
7157
7157
  rcSpinnerStatus = 'primary';
7158
7158
  /** Size forwarded to the inner `rc-spinner`. Default: `'md'` */
7159
7159
  rcSpinnerSize = 'md';
@@ -7214,7 +7214,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
7214
7214
  * <rc-progress-bar [value]="60"></rc-progress-bar>
7215
7215
  * ```
7216
7216
  *
7217
- * @example Status colours
7217
+ * @example Status colors
7218
7218
  * ```html
7219
7219
  * <rc-progress-bar [value]="80" status="success"></rc-progress-bar>
7220
7220
  * <rc-progress-bar [value]="20" status="danger"></rc-progress-bar>
@@ -7238,7 +7238,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
7238
7238
  class RcProgressBarComponent {
7239
7239
  /** Progress value from 0 to 100. Ignored when `indeterminate` is true. Default: `0` */
7240
7240
  value = 0;
7241
- /** Colour variant of the fill. Default: `'primary'` */
7241
+ /** Color variant of the fill. Default: `'primary'` */
7242
7242
  status = 'primary';
7243
7243
  /** When true, shows an animated looping bar. Default: `false` */
7244
7244
  indeterminate = false;
@@ -8051,7 +8051,7 @@ const RC_MENU_CLOSE = new InjectionToken('RC_MENU_CLOSE');
8051
8051
  class RcMenuItemComponent {
8052
8052
  /** Eva icon name for the leading icon slot. */
8053
8053
  icon = '';
8054
- /** Renders the item with danger (red) text colouring. Default: `false` */
8054
+ /** Renders the item with danger (red) text coloring. Default: `false` */
8055
8055
  danger = false;
8056
8056
  /** Prevents clicking. Default: `false` */
8057
8057
  disabled = false;
@@ -8374,7 +8374,7 @@ class RcInfiniteScrollComponent {
8374
8374
  * Default: `false` — the page scroll triggers loading.
8375
8375
  */
8376
8376
  scrollable = false;
8377
- /** Colour variant passed to the internal `<rc-spinner>`. Default: `'primary'` */
8377
+ /** Color variant passed to the internal `<rc-spinner>`. Default: `'primary'` */
8378
8378
  spinnerStatus = 'primary';
8379
8379
  /** Optional message displayed beneath the spinner while loading. */
8380
8380
  loadingMessage = '';
@@ -8397,6 +8397,7 @@ class RcInfiniteScrollComponent {
8397
8397
  // ── Private state ─────────────────────────────────────────────────────────
8398
8398
  observer;
8399
8399
  isSentinelVisible = false;
8400
+ pendingEmit = false;
8400
8401
  // ── Lifecycle ─────────────────────────────────────────────────────────────
8401
8402
  ngAfterViewInit() {
8402
8403
  this.zone.runOutsideAngular(() => {
@@ -8411,13 +8412,26 @@ class RcInfiniteScrollComponent {
8411
8412
  });
8412
8413
  }
8413
8414
  ngOnChanges(changes) {
8414
- // Re-fire when loading transitions false while sentinel is still in view
8415
+ // Re-fire after a batch finishes loading, but defer until after the next
8416
+ // paint so the IntersectionObserver has updated isSentinelVisible with
8417
+ // the new scroll position. A pendingEmit guard prevents stacking.
8415
8418
  if (changes['loading'] &&
8416
8419
  !changes['loading'].firstChange &&
8417
8420
  !this.loading &&
8418
- this.isSentinelVisible &&
8419
- this.hasMore) {
8420
- this.loadMore.emit();
8421
+ this.hasMore &&
8422
+ !this.pendingEmit) {
8423
+ this.pendingEmit = true;
8424
+ this.zone.runOutsideAngular(() => {
8425
+ // Double-rAF: first frame commits the layout, second reads intersection.
8426
+ requestAnimationFrame(() => {
8427
+ requestAnimationFrame(() => {
8428
+ this.pendingEmit = false;
8429
+ if (this.isSentinelVisible && !this.loading && this.hasMore) {
8430
+ this.zone.run(() => this.loadMore.emit());
8431
+ }
8432
+ });
8433
+ });
8434
+ });
8421
8435
  }
8422
8436
  }
8423
8437
  ngOnDestroy() {