@assistanz/carbideui 1.4.0 → 1.4.1

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/index.d.ts CHANGED
@@ -1248,6 +1248,10 @@ declare class NgccTabHeaders extends NgccBaseTabHeader implements OnInit, OnChan
1248
1248
  private destroyEffect?;
1249
1249
  private readonly activatedRoute;
1250
1250
  constructor();
1251
+ /**
1252
+ * Shows the full label as a tooltip only when it is cut off.
1253
+ */
1254
+ protected onTabHover(event: MouseEvent, tab: NgccTab): void;
1251
1255
  ngOnInit(): void;
1252
1256
  ngAfterViewInit(): void;
1253
1257
  ngAfterContentInit(): void;
@@ -1960,6 +1964,13 @@ declare class NgccColorThemeService {
1960
1964
  * Replaces current customizations. Accepts a preset or its id; returns false if unknown/invalid.
1961
1965
  */
1962
1966
  applyPreset(preset: NgccColorThemePreset | string): boolean;
1967
+ /** Plain Carbon: Carbon's blue and no customization, whatever default the app configured. */
1968
+ resetToCarbon(): void;
1969
+ /**
1970
+ * Which starting point the current colors match: a preset id, `'carbon'` for plain Carbon, or
1971
+ * `''` once customized. Follows the real state, so it is right on load and after a reload.
1972
+ */
1973
+ readonly activePresetId: _angular_core.Signal<string>;
1963
1974
  /** Remove one override (token given) or every override of a theme. */
1964
1975
  resetThemeColors(theme: CarbonThemeName, token?: NgccThemeColorToken): void;
1965
1976
  private withTheme;
@@ -2770,7 +2781,7 @@ declare class NgccColorThemeSwitcher {
2770
2781
  protected readonly themes: readonly CarbonThemeName[];
2771
2782
  /** Built-in color themes offered as one-click starting points. */
2772
2783
  protected readonly colorPresets: readonly NgccColorThemePreset[];
2773
- protected readonly activePreset: _angular_core.WritableSignal<string>;
2784
+ protected readonly activePreset: _angular_core.Signal<string>;
2774
2785
  protected readonly brandTokens: readonly string[];
2775
2786
  /** Search over color names, descriptions and CSS token names. */
2776
2787
  protected readonly filter: _angular_core.WritableSignal<string>;
@@ -2843,6 +2854,7 @@ declare class NgccColorThemeSwitcher {
2843
2854
  protected onWcagLevelChange(level: string): void;
2844
2855
  protected onAutoAdjustChange(enabled: boolean): void;
2845
2856
  protected resetOverrides(): void;
2857
+ protected selectCarbon(): void;
2846
2858
  protected applyColorPreset(preset: NgccColorThemePreset): void;
2847
2859
  protected copyToken(name: string): Promise<void>;
2848
2860
  protected copySnippet(): Promise<void>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@assistanz/carbideui",
3
- "version": "1.4.0",
3
+ "version": "1.4.1",
4
4
  "description": "An independent, community-driven Angular component library inspired by the Carbon Design System. NOT affiliated with IBM.",
5
5
  "license": "MIT",
6
6
  "author": "Assistanz",
@@ -0,0 +1,50 @@
1
+ // ngcc-content-switcher wraps every Carbon button in an <ngcc-content-switcher-option>, so Carbon's
2
+ // sibling-based rules (:first-child, :last-child, :first-of-type, `+`) see each button as both the
3
+ // first and the last. These rules re-create the intended look from the option's position instead.
4
+ // Selectors out-rank Carbon's (0,4,0) first/last-child rules without !important.
5
+ .cds--content-switcher:not(.cds--content-switcher--icon-only) {
6
+ ngcc-content-switcher-option > .cds--content-switcher-btn {
7
+ border-radius: 0;
8
+ box-shadow: none;
9
+ }
10
+
11
+ ngcc-content-switcher-option:first-child > .cds--content-switcher-btn {
12
+ border-end-start-radius: 0.25rem;
13
+ border-start-start-radius: 0.25rem;
14
+ box-shadow: inset 0.0625rem 0 0 0 var(--cds-border-inverse);
15
+ }
16
+
17
+ ngcc-content-switcher-option:last-child > .cds--content-switcher-btn {
18
+ border-end-end-radius: 0.25rem;
19
+ border-start-end-radius: 0.25rem;
20
+ box-shadow: inset -0.0625rem 0 0 0 var(--cds-border-inverse);
21
+ }
22
+
23
+ ngcc-content-switcher-option:only-child > .cds--content-switcher-btn {
24
+ box-shadow:
25
+ inset 0.0625rem 0 0 0 var(--cds-border-inverse),
26
+ inset -0.0625rem 0 0 0 var(--cds-border-inverse);
27
+ }
28
+
29
+ // Divider between neighbours; Carbon hides it on every button here.
30
+ ngcc-content-switcher-option:not(:first-child) > .cds--content-switcher-btn::before {
31
+ background-color: var(--cds-border-subtle);
32
+ }
33
+
34
+ // No divider next to the hovered, focused or selected button.
35
+ ngcc-content-switcher-option:not(:first-child) > .cds--content-switcher-btn:hover::before,
36
+ ngcc-content-switcher-option:not(:first-child) > .cds--content-switcher-btn:focus::before,
37
+ ngcc-content-switcher-option:not(:first-child)
38
+ > .cds--content-switcher-btn.cds--content-switcher--selected::before,
39
+ ngcc-content-switcher-option:hover
40
+ + ngcc-content-switcher-option
41
+ > .cds--content-switcher-btn::before,
42
+ ngcc-content-switcher-option:focus-within
43
+ + ngcc-content-switcher-option
44
+ > .cds--content-switcher-btn::before,
45
+ ngcc-content-switcher-option:has(> .cds--content-switcher--selected)
46
+ + ngcc-content-switcher-option
47
+ > .cds--content-switcher-btn::before {
48
+ background-color: transparent;
49
+ }
50
+ }
@@ -4,4 +4,5 @@
4
4
  // supports the legacy data-carbon-theme="rounded|curved|centered" values) comes last.
5
5
  @use 'theme-corners';
6
6
  @use 'theme-button-align';
7
+ @use 'content-switcher';
7
8
  @use 'custom-themes' as *;