@nysds/nys-badge 1.13.1 → 1.14.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.
@@ -0,0 +1 @@
1
+ export * from "./nys-badge";
@@ -0,0 +1,66 @@
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
+ variant: "strong" | "";
43
+ private _prefixIcon;
44
+ get prefixIcon(): string | boolean;
45
+ set prefixIcon(value: string | boolean);
46
+ private _suffixIcon;
47
+ get suffixIcon(): string | boolean;
48
+ set suffixIcon(value: string | boolean);
49
+ /**
50
+ * Lifecycle methods
51
+ * --------------------------------------------------------------------------
52
+ */
53
+ connectedCallback(): void;
54
+ /**
55
+ * Functions
56
+ * --------------------------------------------------------------------------
57
+ */
58
+ private static readonly DEFAULT_ICONS;
59
+ /**
60
+ * Resolves which icon should be rendered.
61
+ * @param icon The icon property value (string or boolean)
62
+ * @returns Icon name or null if no icon should be rendered
63
+ */
64
+ private resolveIcon;
65
+ render(): import("lit-html").TemplateResult<1>;
66
+ }
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nysds/nys-badge",
3
- "version": "1.13.1",
3
+ "version": "1.14.0",
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,12 +23,12 @@
23
23
  "lit-analyze": "lit-analyzer '**/*.ts'"
24
24
  },
25
25
  "dependencies": {
26
- "@nysds/nys-icon": "^1.13.1"
26
+ "@nysds/nys-icon": "^1.14.0"
27
27
  },
28
28
  "devDependencies": {
29
29
  "lit": "^3.3.1",
30
30
  "typescript": "^5.9.3",
31
- "vite": "^7.1.12"
31
+ "vite": "^7.3.1"
32
32
  },
33
33
  "keywords": [
34
34
  "new-york-state",