@nysds/nys-icon 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-icon";
@@ -0,0 +1,45 @@
1
+ import { LitElement } from "lit";
2
+ /**
3
+ * Renders SVG icons from the NYSDS icon library (Material Symbols). Decorative by default (`aria-hidden`).
4
+ *
5
+ * Pass `name` to select an icon from the library. Use `ariaLabel` to make the icon accessible
6
+ * (removes `aria-hidden`). Supports size presets, rotation, flipping, and custom colors.
7
+ *
8
+ * @summary SVG icon from Material Symbols library with size, rotation, and color options.
9
+ * @element nys-icon
10
+ *
11
+ * @example Basic icon
12
+ * ```html
13
+ * <nys-icon name="check_circle" size="lg"></nys-icon>
14
+ * ```
15
+ *
16
+ * @example Accessible icon with label
17
+ * ```html
18
+ * <nys-icon name="warning" ariaLabel="Warning" color="var(--nys-color-warning)"></nys-icon>
19
+ * ```
20
+ */
21
+ export declare class NysIcon extends LitElement {
22
+ static styles: import("lit").CSSResult;
23
+ /** Icon name from Material Symbols library. Required. */
24
+ name: string;
25
+ /** Accessible label. When set, removes `aria-hidden` and adds `aria-label` to the SVG. */
26
+ ariaLabel: string;
27
+ /** Rotation in degrees. Applied via CSS `rotate`. */
28
+ rotate: string;
29
+ /** Flip direction: `horizontal`, `vertical`, or empty for none. */
30
+ flip: string;
31
+ /** Icon color. Accepts any CSS color value. Defaults to `currentcolor`. */
32
+ color: string;
33
+ /**
34
+ * Icon size. Semantic sizes: `xs`-`5xl`. Pixel sizes: `12`-`50`.
35
+ * @default "md"
36
+ */
37
+ size: "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "12" | "14" | "16" | "18" | "20" | "24" | "32" | "40" | "50";
38
+ /**
39
+ * Retrieves the SVG element for the given icon name and applies
40
+ * accessibility, rotation, flip, color, and size classes.
41
+ * @returns SVGElement | null
42
+ */
43
+ private getIcon;
44
+ render(): import("lit-html").TemplateResult<1> | null;
45
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ declare const iconLibrary: Record<string, string>;
2
+ export default iconLibrary;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nysds/nys-icon",
3
- "version": "1.13.1",
3
+ "version": "1.14.0",
4
4
  "description": "The Icon component from the NYS Design System.",
5
5
  "module": "dist/nys-icon.js",
6
6
  "types": "dist/index.d.ts",
@@ -25,7 +25,7 @@
25
25
  "devDependencies": {
26
26
  "lit": "^3.3.1",
27
27
  "typescript": "^5.9.3",
28
- "vite": "^7.1.12"
28
+ "vite": "^7.3.1"
29
29
  },
30
30
  "keywords": [
31
31
  "new-york-state",