@nysds/nys-icon 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.
- package/dist/icons/location_on.svg +8 -0
- package/dist/icons/manifest.json +2 -0
- package/dist/icons/schedule.svg +8 -0
- package/dist/nys-icon.d.ts +74 -0
- package/dist/nys-icon.js +674 -507
- package/dist/nys-icon.js.map +1 -1
- package/package.json +3 -2
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
|
2
|
+
<mask id="mask0_28075_337" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="24" height="24">
|
|
3
|
+
<rect width="24" height="24" fill="#D9D9D9"/>
|
|
4
|
+
</mask>
|
|
5
|
+
<g mask="url(#mask0_28075_337)">
|
|
6
|
+
<path d="M12 19.35C14.0333 17.4833 15.5417 15.7875 16.525 14.2625C17.5083 12.7375 18 11.3833 18 10.2C18 8.38333 17.4208 6.89583 16.2625 5.7375C15.1042 4.57917 13.6833 4 12 4C10.3167 4 8.89583 4.57917 7.7375 5.7375C6.57917 6.89583 6 8.38333 6 10.2C6 11.3833 6.49167 12.7375 7.475 14.2625C8.45833 15.7875 9.96667 17.4833 12 19.35ZM11.3 21.2C11.0667 21.1167 10.8583 20.9917 10.675 20.825C9.59167 19.825 8.63333 18.85 7.8 17.9C6.96667 16.95 6.27083 16.0292 5.7125 15.1375C5.15417 14.2458 4.72917 13.3875 4.4375 12.5625C4.14583 11.7375 4 10.95 4 10.2C4 7.7 4.80417 5.70833 6.4125 4.225C8.02083 2.74167 9.88333 2 12 2C14.1167 2 15.9792 2.74167 17.5875 4.225C19.1958 5.70833 20 7.7 20 10.2C20 10.95 19.8542 11.7375 19.5625 12.5625C19.2708 13.3875 18.8458 14.2458 18.2875 15.1375C17.7292 16.0292 17.0333 16.95 16.2 17.9C15.3667 18.85 14.4083 19.825 13.325 20.825C13.1417 20.9917 12.9333 21.1167 12.7 21.2C12.4667 21.2833 12.2333 21.325 12 21.325C11.7667 21.325 11.5333 21.2833 11.3 21.2ZM13.4125 11.4125C13.8042 11.0208 14 10.55 14 10C14 9.45 13.8042 8.97917 13.4125 8.5875C13.0208 8.19583 12.55 8 12 8C11.45 8 10.9792 8.19583 10.5875 8.5875C10.1958 8.97917 10 9.45 10 10C10 10.55 10.1958 11.0208 10.5875 11.4125C10.9792 11.8042 11.45 12 12 12C12.55 12 13.0208 11.8042 13.4125 11.4125Z" fill="var(--nys-icon-color, currentcolor)"/>
|
|
7
|
+
</g>
|
|
8
|
+
</svg>
|
package/dist/icons/manifest.json
CHANGED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
|
2
|
+
<mask id="mask0_28075_579" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="24" height="24">
|
|
3
|
+
<rect width="24" height="24" fill="#D9D9D9"/>
|
|
4
|
+
</mask>
|
|
5
|
+
<g mask="url(#mask0_28075_579)">
|
|
6
|
+
<path d="M13 11.6V8C13 7.71667 12.9042 7.47917 12.7125 7.2875C12.5208 7.09583 12.2833 7 12 7C11.7167 7 11.4792 7.09583 11.2875 7.2875C11.0958 7.47917 11 7.71667 11 8V11.975C11 12.1083 11.025 12.2375 11.075 12.3625C11.125 12.4875 11.2 12.6 11.3 12.7L14.6 16C14.7833 16.1833 15.0167 16.275 15.3 16.275C15.5833 16.275 15.8167 16.1833 16 16C16.1833 15.8167 16.275 15.5833 16.275 15.3C16.275 15.0167 16.1833 14.7833 16 14.6L13 11.6ZM12 22C10.6167 22 9.31667 21.7375 8.1 21.2125C6.88333 20.6875 5.825 19.975 4.925 19.075C4.025 18.175 3.3125 17.1167 2.7875 15.9C2.2625 14.6833 2 13.3833 2 12C2 10.6167 2.2625 9.31667 2.7875 8.1C3.3125 6.88333 4.025 5.825 4.925 4.925C5.825 4.025 6.88333 3.3125 8.1 2.7875C9.31667 2.2625 10.6167 2 12 2C13.3833 2 14.6833 2.2625 15.9 2.7875C17.1167 3.3125 18.175 4.025 19.075 4.925C19.975 5.825 20.6875 6.88333 21.2125 8.1C21.7375 9.31667 22 10.6167 22 12C22 13.3833 21.7375 14.6833 21.2125 15.9C20.6875 17.1167 19.975 18.175 19.075 19.075C18.175 19.975 17.1167 20.6875 15.9 21.2125C14.6833 21.7375 13.3833 22 12 22ZM12 20C14.2167 20 16.1042 19.2208 17.6625 17.6625C19.2208 16.1042 20 14.2167 20 12C20 9.78333 19.2208 7.89583 17.6625 6.3375C16.1042 4.77917 14.2167 4 12 4C9.78333 4 7.89583 4.77917 6.3375 6.3375C4.77917 7.89583 4 9.78333 4 12C4 14.2167 4.77917 16.1042 6.3375 17.6625C7.89583 19.2208 9.78333 20 12 20Z" fill="var(--nys-icon-color, currentcolor)"/>
|
|
7
|
+
</g>
|
|
8
|
+
</svg>
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
import { NysIconWatcher } from "./icon-library-registry";
|
|
3
|
+
/**
|
|
4
|
+
* Renders SVG icons from a registered icon library. The built-in NYSDS icon
|
|
5
|
+
* library (Material Symbols) is the default. Custom libraries (Font Awesome,
|
|
6
|
+
* Material Icons, etc.) can be registered via `registerIconLibrary()`.
|
|
7
|
+
*
|
|
8
|
+
* Pass `name` to select an icon. Use `library` to choose a registered library
|
|
9
|
+
* (defaults to `"default"` for NYSDS icons). Use `ariaLabel` to make the icon
|
|
10
|
+
* accessible (removes `aria-hidden`). Supports size presets, rotation,
|
|
11
|
+
* flipping, and custom colors.
|
|
12
|
+
*
|
|
13
|
+
* @summary SVG icon with swappable library support, size, rotation, and color options.
|
|
14
|
+
* @element nys-icon
|
|
15
|
+
*
|
|
16
|
+
* @example Basic icon (default NYSDS library)
|
|
17
|
+
* ```html
|
|
18
|
+
* <nys-icon name="check_circle" size="lg"></nys-icon>
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* @example Font Awesome icon
|
|
22
|
+
* ```html
|
|
23
|
+
* <nys-icon name="house" library="fa" size="lg"></nys-icon>
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* @example Accessible icon with label
|
|
27
|
+
* ```html
|
|
28
|
+
* <nys-icon name="warning" ariaLabel="Warning" color="var(--nys-color-warning)"></nys-icon>
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
export declare class NysIcon extends LitElement implements NysIconWatcher {
|
|
32
|
+
static styles: import("lit").CSSResult;
|
|
33
|
+
/** Icon name to resolve from the selected library. Required. */
|
|
34
|
+
name: string;
|
|
35
|
+
/** Which registered icon library to use. Defaults to the built-in NYSDS library. */
|
|
36
|
+
library: string;
|
|
37
|
+
/** Accessible label. When set, removes `aria-hidden` and adds `aria-label` to the SVG. */
|
|
38
|
+
ariaLabel: string;
|
|
39
|
+
/** Rotation in degrees. Applied via CSS `rotate`. */
|
|
40
|
+
rotate: string;
|
|
41
|
+
/** Flip direction: `horizontal`, `vertical`, or empty for none. */
|
|
42
|
+
flip: string;
|
|
43
|
+
/** Icon color. Accepts any CSS color value. Defaults to `currentcolor`. */
|
|
44
|
+
color: string;
|
|
45
|
+
/**
|
|
46
|
+
* Icon size. Semantic sizes: `xs`-`5xl`. Pixel sizes: `12`-`50`.
|
|
47
|
+
* @default "md"
|
|
48
|
+
*/
|
|
49
|
+
size: "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "12" | "14" | "16" | "18" | "20" | "24" | "32" | "40" | "50";
|
|
50
|
+
private _svg;
|
|
51
|
+
/** Monotonically increasing token so stale async fetches are discarded. */
|
|
52
|
+
private _loadSeq;
|
|
53
|
+
/** Promise for the in-flight icon load. */
|
|
54
|
+
private _loadPromise;
|
|
55
|
+
/** Resolves when the current icon load (if any) is complete. */
|
|
56
|
+
get updateComplete(): Promise<boolean>;
|
|
57
|
+
connectedCallback(): void;
|
|
58
|
+
disconnectedCallback(): void;
|
|
59
|
+
/** Called by the icon library registry when the current library changes. */
|
|
60
|
+
redraw(): void;
|
|
61
|
+
/**
|
|
62
|
+
* Lit calls firstUpdated after the first render, once all reactive
|
|
63
|
+
* properties (including those set from the template) are resolved.
|
|
64
|
+
* This guarantees the initial _loadIcon runs with the correct name
|
|
65
|
+
* and library values, avoiding the race where updated() might not
|
|
66
|
+
* fire for properties that equal their defaults.
|
|
67
|
+
*/
|
|
68
|
+
firstUpdated(): void;
|
|
69
|
+
private static _validName;
|
|
70
|
+
updated(changedProps: Map<string, unknown>): void;
|
|
71
|
+
private _loadIcon;
|
|
72
|
+
private _applyAttributes;
|
|
73
|
+
render(): import("lit-html").TemplateResult<1> | null;
|
|
74
|
+
}
|