@compsych-ui-components/angular 6.1.1 → 7.0.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.
- package/esm2022/index.js.map +1 -1
- package/esm2022/lib/accordion/accordion.js +1 -1
- package/esm2022/lib/accordion/accordion.js.map +1 -1
- package/esm2022/lib/button/button.js +168 -69
- package/esm2022/lib/button/button.js.map +1 -1
- package/esm2022/lib/header-nav/header-nav.js +10 -9
- package/esm2022/lib/header-nav/header-nav.js.map +1 -1
- package/esm2022/lib/sidebar/sidebar.js +6 -6
- package/esm2022/lib/sidebar/sidebar.js.map +1 -1
- package/index.d.ts +1 -1
- package/lib/button/button.d.ts +49 -20
- package/lib/header-nav/header-nav.d.ts +9 -9
- package/lib/sidebar/sidebar.d.ts +2 -2
- package/package.json +1 -1
package/lib/button/button.d.ts
CHANGED
|
@@ -1,52 +1,81 @@
|
|
|
1
|
+
import { OnChanges } from '@angular/core';
|
|
2
|
+
import { SafeHtml } from '@angular/platform-browser';
|
|
1
3
|
import * as i0 from "@angular/core";
|
|
2
4
|
/** Visual style of a `compsych-button`. Controls color, border, and elevation. */
|
|
3
5
|
export type ButtonVariant = 'filled' | 'tonal' | 'outlined' | 'elevated' | 'text' | 'danger' | 'danger-outlined';
|
|
4
|
-
/** Button dimensions — controls height, padding, and
|
|
6
|
+
/** Button dimensions — controls height, padding, font size, and icon size. */
|
|
5
7
|
export type ButtonSize = 'small' | 'medium' | 'large' | 'xlarge';
|
|
6
|
-
/** Placement of `icon` relative to the label. */
|
|
7
|
-
export type ButtonIconPosition = 'leading' | 'trailing';
|
|
8
8
|
/** Native button behaviour. `'submit'`/`'reset'` make the component a real form control. */
|
|
9
9
|
export type ButtonType = 'button' | 'submit' | 'reset';
|
|
10
10
|
/**
|
|
11
11
|
* A themeable button that renders a native `<button>` element, so it is fully
|
|
12
|
-
* form-submittable and keyboard/screen-reader accessible out of the box.
|
|
12
|
+
* form-submittable and keyboard/screen-reader accessible out of the box. Icons
|
|
13
|
+
* are Lucide glyphs (matching the rest of the library); a button may carry a
|
|
14
|
+
* leading icon, a trailing icon, or both.
|
|
13
15
|
*/
|
|
14
|
-
export declare class ButtonComponent {
|
|
16
|
+
export declare class ButtonComponent implements OnChanges {
|
|
17
|
+
private readonly sanitizer;
|
|
15
18
|
/** Text label rendered on the button. */
|
|
16
19
|
label: string;
|
|
17
20
|
/** Visual style of the button. Defaults to `'filled'`. */
|
|
18
21
|
variant: ButtonVariant;
|
|
19
|
-
/** Button dimensions — controls height, padding, and
|
|
22
|
+
/** Button dimensions — controls height, padding, font size, and icon size. Defaults to `'small'`. */
|
|
20
23
|
size: ButtonSize;
|
|
21
|
-
/**
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
|
|
24
|
+
/** Lucide icon name shown before the label (e.g. `'house'`). Swapped for a spinner when loading. */
|
|
25
|
+
leadingIcon?: string;
|
|
26
|
+
/** Lucide icon name shown after the label (e.g. `'chevron-right'`). Can be combined with `leadingIcon`. */
|
|
27
|
+
trailingIcon?: string;
|
|
25
28
|
/** Native button type. Use `'submit'` inside a `<form>` to submit it. Defaults to `'button'`. */
|
|
26
29
|
type: ButtonType;
|
|
27
30
|
/**
|
|
28
|
-
* Accessible name. Required for icon-only buttons since the icon is decorative
|
|
29
|
-
*
|
|
31
|
+
* Accessible name. Required for icon-only buttons since the icon is decorative.
|
|
32
|
+
* When `iconOnly` or `loading` is set and this is omitted, `label` is used.
|
|
30
33
|
*/
|
|
31
34
|
ariaLabel?: string;
|
|
32
|
-
/** Hides the label and renders a square icon-only button.
|
|
35
|
+
/** Hides the label and renders a square icon-only button. Uses `leadingIcon`. Supports boolean coercion. */
|
|
33
36
|
iconOnly: boolean;
|
|
34
|
-
/** Disables the button — non-interactive and
|
|
37
|
+
/** Disables the button — non-interactive and rendered in a neutral grey. Supports boolean coercion. */
|
|
35
38
|
disabled: boolean;
|
|
36
39
|
/**
|
|
37
|
-
* Loading state.
|
|
38
|
-
*
|
|
39
|
-
* variant's colours
|
|
40
|
-
* Supports boolean coercion.
|
|
40
|
+
* Loading state. Swaps the leading icon for a spinner and suppresses activation
|
|
41
|
+
* (native `disabled` blocks click/keyboard), while keeping the label and exposing
|
|
42
|
+
* `aria-busy="true"`. Retains the variant's colours. Supports boolean coercion.
|
|
41
43
|
*/
|
|
42
44
|
loading: boolean;
|
|
45
|
+
/** Stretches the button to the full width of its container. Supports boolean coercion. */
|
|
46
|
+
fullWidth: boolean;
|
|
47
|
+
/** Mirrors `fullWidth` onto the host so it can stretch. */
|
|
48
|
+
get hostFullWidth(): boolean;
|
|
49
|
+
/** Pre-sanitized icon markup, recomputed on input change (avoids re-sanitizing every CD cycle). */
|
|
50
|
+
protected leadingIconSvg: SafeHtml | null;
|
|
51
|
+
protected trailingIconSvg: SafeHtml | null;
|
|
52
|
+
ngOnChanges(): void;
|
|
43
53
|
/** Space-separated class list applied to the inner native button. */
|
|
44
54
|
get buttonClasses(): string;
|
|
45
|
-
/** Resolves the accessible name
|
|
55
|
+
/** Resolves the accessible name. Icon-only buttons have no visible text, so they fall back to `label`. */
|
|
46
56
|
get computedAriaLabel(): string | null;
|
|
57
|
+
/**
|
|
58
|
+
* Looks up a Lucide icon by name and injects an explicit width/height so the SVG
|
|
59
|
+
* renders at the correct size when injected via `[innerHTML]` (Angular's CSS
|
|
60
|
+
* encapsulation does not reach dynamically injected content).
|
|
61
|
+
*/
|
|
62
|
+
private buildIconSvg;
|
|
63
|
+
/** M3 pressed ripple: pointer-down spawns a ripple at the pointer position. */
|
|
64
|
+
onPointerDown(event: PointerEvent): void;
|
|
65
|
+
/** M3 pressed ripple: keyboard activation (Enter/Space) spawns a centered ripple. */
|
|
66
|
+
onKeyDown(event: KeyboardEvent): void;
|
|
67
|
+
/** Diameter that reaches the farthest corner from (x, y), so the ripple always covers the button. */
|
|
68
|
+
private farthestCornerDiameter;
|
|
69
|
+
/**
|
|
70
|
+
* Spawns an expanding ripple circle. Created imperatively with inline styles and
|
|
71
|
+
* animated via the Web Animations API — Angular's emulated encapsulation does not
|
|
72
|
+
* reach dynamically created nodes, so it cannot rely on the component stylesheet.
|
|
73
|
+
*/
|
|
74
|
+
private spawnRipple;
|
|
47
75
|
static ɵfac: i0.ɵɵFactoryDeclaration<ButtonComponent, never>;
|
|
48
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<ButtonComponent, "compsych-button", never, { "label": { "alias": "label"; "required": false; }; "variant": { "alias": "variant"; "required": false; }; "size": { "alias": "size"; "required": false; }; "
|
|
76
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ButtonComponent, "compsych-button", never, { "label": { "alias": "label"; "required": false; }; "variant": { "alias": "variant"; "required": false; }; "size": { "alias": "size"; "required": false; }; "leadingIcon": { "alias": "leadingIcon"; "required": false; }; "trailingIcon": { "alias": "trailingIcon"; "required": false; }; "type": { "alias": "type"; "required": false; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; }; "iconOnly": { "alias": "iconOnly"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "loading": { "alias": "loading"; "required": false; }; "fullWidth": { "alias": "fullWidth"; "required": false; }; }, {}, never, ["*"], true, never>;
|
|
49
77
|
static ngAcceptInputType_iconOnly: unknown;
|
|
50
78
|
static ngAcceptInputType_disabled: unknown;
|
|
51
79
|
static ngAcceptInputType_loading: unknown;
|
|
80
|
+
static ngAcceptInputType_fullWidth: unknown;
|
|
52
81
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EventEmitter } from '@angular/core';
|
|
2
2
|
import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
|
|
3
|
-
import { ButtonVariant
|
|
3
|
+
import { ButtonVariant } from '../button/button';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
5
|
export type HeaderNavLevel = 'main' | 'sub-page' | 'not-logged';
|
|
6
6
|
/**
|
|
@@ -15,10 +15,10 @@ export interface NavAction {
|
|
|
15
15
|
label: string;
|
|
16
16
|
/** Button style for action buttons. Defaults to `'filled'` when omitted. Not used for breadcrumbs. */
|
|
17
17
|
variant?: ButtonVariant;
|
|
18
|
-
/**
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
|
|
18
|
+
/** Lucide icon shown before the label (e.g. `'house'`). Not used for breadcrumbs. */
|
|
19
|
+
leadingIcon?: string;
|
|
20
|
+
/** Lucide icon shown after the label (e.g. `'chevron-right'`). Not used for breadcrumbs. */
|
|
21
|
+
trailingIcon?: string;
|
|
22
22
|
/** Renders the action button disabled. */
|
|
23
23
|
disabled?: boolean;
|
|
24
24
|
/** Renders the action button in a loading state (spinner, interaction blocked). */
|
|
@@ -127,10 +127,10 @@ export declare class HeaderNavComponent {
|
|
|
127
127
|
get notificationAriaLabel(): string;
|
|
128
128
|
/**
|
|
129
129
|
* Looks up a Lucide icon by name and injects explicit width/height attributes
|
|
130
|
-
* (20 × 20) so the SVG renders at the correct size when injected via
|
|
131
|
-
* Angular's CSS encapsulation does not add _ngcontent attributes to
|
|
132
|
-
* injected content, so CSS descendant selectors targeting `svg` would
|
|
133
|
-
* explicit SVG attributes are the reliable solution.
|
|
130
|
+
* (default 20 × 20) so the SVG renders at the correct size when injected via
|
|
131
|
+
* [innerHTML]. Angular's CSS encapsulation does not add _ngcontent attributes to
|
|
132
|
+
* dynamically injected content, so CSS descendant selectors targeting `svg` would
|
|
133
|
+
* not apply — explicit SVG attributes are the reliable solution.
|
|
134
134
|
*/
|
|
135
135
|
private trustedIcon;
|
|
136
136
|
static ɵfac: i0.ɵɵFactoryDeclaration<HeaderNavComponent, never>;
|
package/lib/sidebar/sidebar.d.ts
CHANGED
|
@@ -39,8 +39,8 @@ export declare class SidebarComponent {
|
|
|
39
39
|
/** Currently active item id — supports two-way binding via `[(activeId)]`. Updated on click for route items; unchanged for `nonRoute` items. */
|
|
40
40
|
readonly activeId: import("@angular/core").ModelSignal<string>;
|
|
41
41
|
/**
|
|
42
|
-
* Emitted with the item's `id`
|
|
43
|
-
*
|
|
42
|
+
* Emitted with the item's `id` when a non-disabled action (`nonRoute`) item is clicked.
|
|
43
|
+
* Navigation (route) items do not emit — they update `activeId` instead (bind via `[(activeId)]`).
|
|
44
44
|
* Group items (those with `children`) do not emit — they only toggle their expanded state.
|
|
45
45
|
*/
|
|
46
46
|
readonly itemClick: import("@angular/core").OutputEmitterRef<string>;
|