@nysds/nys-badge 1.19.1 → 1.19.2

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,68 @@
1
+ import { LitElement } from "lit";
2
+ /**
3
+ * A compact label for status, counts, or categorization. Supports semantic intents with auto-selected icons.
4
+ *
5
+ * Use badges to highlight metadata like status ("Approved"), counts ("3 new"), or categories.
6
+ * Set `intent` to apply semantic meaning. Add `prefixIcon` or `suffixIcon` as boolean for default icons,
7
+ * or pass icon name strings for custom icons.
8
+ *
9
+ * @summary Compact label for status, counts, or categorization with semantic styling.
10
+ * @element nys-badge
11
+ *
12
+ * @example Status badge
13
+ * ```html
14
+ * <nys-badge intent="success" label="Approved" prefixIcon></nys-badge>
15
+ * ```
16
+ *
17
+ * @example Count badge
18
+ * ```html
19
+ * <nys-badge prefixLabel="Messages" label="12"></nys-badge>
20
+ * ```
21
+ */
22
+ export declare class NysBadge extends LitElement {
23
+ static styles: import("lit").CSSResult;
24
+ /** Unique identifier. */
25
+ id: string;
26
+ /** Name attribute for form association. */
27
+ name: string;
28
+ /**
29
+ * Badge size: `sm` (smaller text) or `md` (default).
30
+ * @default "md"
31
+ */
32
+ size: "sm" | "md";
33
+ /**
34
+ * Semantic intent affecting color: `neutral`, `error`, `success`, or `warning`.
35
+ * @default "neutral"
36
+ */
37
+ intent: "neutral" | "error" | "success" | "warning";
38
+ /** Secondary label displayed before the main label. */
39
+ prefixLabel: string;
40
+ /** Primary label text displayed in the badge. */
41
+ label: string;
42
+ /** Screen reader text appended after the label for additional context. */
43
+ srText: string;
44
+ variant: "strong" | "";
45
+ private _prefixIcon;
46
+ get prefixIcon(): string | boolean;
47
+ set prefixIcon(value: string | boolean);
48
+ private _suffixIcon;
49
+ get suffixIcon(): string | boolean;
50
+ set suffixIcon(value: string | boolean);
51
+ /**
52
+ * Lifecycle methods
53
+ * --------------------------------------------------------------------------
54
+ */
55
+ connectedCallback(): void;
56
+ /**
57
+ * Functions
58
+ * --------------------------------------------------------------------------
59
+ */
60
+ private static readonly DEFAULT_ICONS;
61
+ /**
62
+ * Resolves which icon should be rendered.
63
+ * @param icon The icon property value (string or boolean)
64
+ * @returns Icon name or null if no icon should be rendered
65
+ */
66
+ private resolveIcon;
67
+ render(): import("lit-html").TemplateResult<1>;
68
+ }
package/dist/nys-badge.js CHANGED
@@ -5,7 +5,7 @@ import { property as r } from "lit/decorators.js";
5
5
  * █ █ █ █▄▄▄█ ▀▀▀▄▄ █ █ ▀▀▀▄▄
6
6
  * █ ▀█ █ █▄▄▄█ █▄▄▀ █▄▄▄█
7
7
  *
8
- * Badge Component v1.19.1
8
+ * Badge Component v1.19.2
9
9
  * Part of the New York State Design System
10
10
  * Repository: https://github.com/its-hcd/nysds
11
11
  * License: MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nysds/nys-badge",
3
- "version": "1.19.1",
3
+ "version": "1.19.2",
4
4
  "description": "The Badge component from the NYS Design System.",
5
5
  "module": "dist/nys-badge.js",
6
6
  "types": "dist/index.d.ts",
@@ -23,7 +23,7 @@
23
23
  "lit-analyze": "lit-analyzer '**/*.ts'"
24
24
  },
25
25
  "dependencies": {
26
- "@nysds/nys-icon": "^1.19.1"
26
+ "@nysds/nys-icon": "^1.19.2"
27
27
  },
28
28
  "devDependencies": {
29
29
  "lit": "^3.3.1",
@@ -40,5 +40,6 @@
40
40
  "forms"
41
41
  ],
42
42
  "author": "New York State Design System Team",
43
- "license": "MIT"
43
+ "license": "MIT",
44
+ "sideEffects": true
44
45
  }