@compsych-ui-components/angular 8.0.3 → 8.0.5

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.
@@ -0,0 +1,108 @@
1
+ import { SafeHtml } from '@angular/platform-browser';
2
+ import * as i0 from "@angular/core";
3
+ import * as i1 from "../card-base/ripple.directive";
4
+ /** Figma "Style". */
5
+ export type ChipVariant = 'tonal' | 'outlined' | 'filled';
6
+ /** Figma "Usage". `inverse` pairs with the tonal style only. */
7
+ export type ChipUsage = 'neutral' | 'informative' | 'positive' | 'danger' | 'warning' | 'inverse';
8
+ /** Chip dimensions — 20 / 24 / 32 / 40 tall. */
9
+ export type ChipSize = 'sm' | 'md' | 'lg' | 'xl';
10
+ /**
11
+ * Chip — Figma "Chip" component set (Core Components › Molecules, node 14:942).
12
+ *
13
+ * Three axes: Style (Tonal / Outlined / Filled) × Usage (Neutral / Informative /
14
+ * Positive / Danger / Warning, plus Inverse on Tonal only) × Size (sm / md / lg /
15
+ * xl = 20 / 24 / 32 / 40). Booleans: leading icon, dismissible, badge — all off by
16
+ * default, as in Figma.
17
+ *
18
+ * Chips are INTERACTIVE BY DEFAULT (ruled 2026-09-02, Jean — the Material 3
19
+ * convention: every chip is something you press; a read-only status marker is a
20
+ * Badge). The icon + label render inside a real `<button>` whose hit area is the
21
+ * whole pill; `(click)` on the host is the chip's action. The interaction recipe is
22
+ * Button's (ruled 2026-08-24): the chip's own foreground as an 8% state layer,
23
+ * 120ms hover-in / 240ms release, the level-2 elevation lift, the shared press
24
+ * ripple, and the Focus Ring drawn around the pill. The Figma set authors no State
25
+ * variants — recorded as a reconciliation; the recipe follows them the day they
26
+ * exist. `[interactive]="false"` opts a chip out (a display-only tag inside another
27
+ * control) — then the host is a plain pill with no role.
28
+ *
29
+ * The dismiss affordance is a SIBLING button, never nested in the primary one
30
+ * (nested interactive controls are invalid); it emits `dismiss` and stops its click
31
+ * at the host so the chip's action does not fire. It is ALWAYS the outermost
32
+ * element — icon, label, badge, then the x (ruled 2026-09-02, Jean; the Figma file
33
+ * orders the badge after the Close Button). With a trailing control the pill's end
34
+ * padding tightens so the control sits concentric with the pill's end, and a
35
+ * leading icon mirrors that inset at the start (ruled 2026-09-02; the file authors
36
+ * symmetric padding).
37
+ *
38
+ * Colour recipe (usage → sys tokens; neutral maps to the surface family):
39
+ * tonal bg `<usage>`-container fg on-`<usage>`-container
40
+ * filled bg `<usage>`, white content (neutral: plain white pill — Figma
41
+ * authors a level-2 elevation on it; ruled 2026-08-24 that chips carry
42
+ * no resting shadow, Figma queued to update)
43
+ * outlined border `<usage>`-container, label `<usage>`, icon = label (neutral:
44
+ * outline / on-surface). EXCEPT warning: label and icon take
45
+ * on-warning-container — an accessibility exception ruled 2026-09-02
46
+ * (sys-warning on white is 3.09:1).
47
+ * inverse transparent-white-20 + backdrop blur, white content — for placement
48
+ * on photos. Tonal only, per the Figma set.
49
+ *
50
+ * Figma reconciliations this implementation carries (flagged to design, majority
51
+ * pattern followed instead):
52
+ * - Outlined/Informative binds primary-family colours in the file where its three
53
+ * status siblings all use their own family. Implemented info-family.
54
+ * - The Warning badge count binds on-surface in the file where every other usage
55
+ * uses the usage foreground. Implemented as the usage foreground.
56
+ * - The counter inverts on filled-status and inverse chips for AA (see chip.css).
57
+ *
58
+ * @example
59
+ * ```html
60
+ * <compsych-chip label="Active" variant="tonal" usage="positive" size="md" />
61
+ * <compsych-chip label="Filter" leadingIcon="tag" [dismissible]="true"
62
+ * (dismiss)="remove()" (click)="apply()" />
63
+ * ```
64
+ */
65
+ export declare class ChipComponent {
66
+ /** Figma "Style". Defaults to Tonal, as the set does. */
67
+ readonly variant: import("@angular/core").InputSignal<ChipVariant>;
68
+ /** Figma "Usage". `inverse` pairs with the tonal style only. */
69
+ readonly usage: import("@angular/core").InputSignal<ChipUsage>;
70
+ readonly size: import("@angular/core").InputSignal<ChipSize>;
71
+ readonly label: import("@angular/core").InputSignal<string>;
72
+ /** Lucide icon name for the leading slot (Figma "Leading Icon" + swap). */
73
+ readonly leadingIcon: import("@angular/core").InputSignal<string | undefined>;
74
+ /** Shows the dismiss affordance (Figma "Dismissible"). */
75
+ readonly dismissible: import("@angular/core").InputSignal<boolean>;
76
+ /** Badge count (Figma "Badge"). Undefined = no badge. */
77
+ readonly badge: import("@angular/core").InputSignal<string | number | undefined>;
78
+ /** Accessible name for the dismiss button. */
79
+ readonly dismissLabel: import("@angular/core").InputSignal<string>;
80
+ /**
81
+ * Chips are interactive by default (ruled 2026-09-02): icon + label sit in a real
82
+ * button and `(click)` on the host is the action. `false` renders a display-only
83
+ * pill — no role, no state layer, no ripple.
84
+ */
85
+ readonly interactive: import("@angular/core").InputSignal<boolean>;
86
+ /** Disables the primary button (interactive chips only). */
87
+ readonly disabled: import("@angular/core").InputSignal<boolean>;
88
+ /** Emitted by the dismiss button. The host app removes the chip. */
89
+ readonly dismiss: import("@angular/core").OutputEmitterRef<void>;
90
+ private readonly sanitizer;
91
+ private readonly ripple;
92
+ private static nextId;
93
+ /** Links the primary button to its counter (aria-describedby). */
94
+ protected readonly badgeId: string;
95
+ constructor();
96
+ /** Leading icon px per size (Figma: 16 at sm/md, 20 at lg/xl). */
97
+ readonly iconPx: import("@angular/core").Signal<20 | 16>;
98
+ /** Dismiss "x" px per size (Figma close slot: 12 at sm/md, 16 at lg/xl). */
99
+ readonly xPx: import("@angular/core").Signal<16 | 12>;
100
+ protected readonly leadingIconSvg: import("@angular/core").Signal<SafeHtml | null>;
101
+ protected readonly dismissIconSvg: import("@angular/core").Signal<SafeHtml>;
102
+ /** Renders a sized Lucide glyph at the DS absolute stroke weight for that size. */
103
+ private iconSvg;
104
+ /** Dismiss is its own action — it must not also fire the chip's. */
105
+ protected onDismiss(event: Event): void;
106
+ static ɵfac: i0.ɵɵFactoryDeclaration<ChipComponent, never>;
107
+ static ɵcmp: i0.ɵɵComponentDeclaration<ChipComponent, "compsych-chip", never, { "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "usage": { "alias": "usage"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": true; "isSignal": true; }; "leadingIcon": { "alias": "leadingIcon"; "required": false; "isSignal": true; }; "dismissible": { "alias": "dismissible"; "required": false; "isSignal": true; }; "badge": { "alias": "badge"; "required": false; "isSignal": true; }; "dismissLabel": { "alias": "dismissLabel"; "required": false; "isSignal": true; }; "interactive": { "alias": "interactive"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, { "dismiss": "dismiss"; }, never, never, true, [{ directive: typeof i1.RippleDirective; inputs: {}; outputs: {}; }]>;
108
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@compsych-ui-components/angular",
3
- "version": "8.0.3",
3
+ "version": "8.0.5",
4
4
  "description": "Angular UI components for compsych",
5
5
  "publishConfig": {
6
6
  "access": "public",