@nysds/components 1.13.0 → 1.13.1
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/custom-elements.json +10506 -0
- package/dist/.vscode/vscode.css-custom-data.json +47 -1
- package/dist/.vscode/vscode.html-custom-data.json +1248 -275
- package/dist/custom-elements.json +829 -202
- package/dist/nys-stepper/newsletter.html +4 -0
- package/dist/nys-stepper/personal.html +6 -0
- package/dist/nys-stepper/survey.html +5 -0
- package/dist/nys-stepper/team.html +6 -0
- package/dist/nysds.es.js +623 -559
- package/dist/nysds.es.js.map +1 -1
- package/dist/nysds.js +59 -47
- package/dist/nysds.js.map +1 -1
- package/dist/packages/mcp-server/src/index.d.ts +8 -0
- package/dist/packages/mcp-server/src/lib/cem-parser.d.ts +95 -0
- package/dist/packages/mcp-server/src/lib/search.d.ts +19 -0
- package/dist/packages/mcp-server/src/lib/token-parser.d.ts +139 -0
- package/dist/packages/mcp-server/src/prompts/nysds-mode.d.ts +7 -0
- package/dist/packages/mcp-server/src/resources/components.d.ts +11 -0
- package/dist/packages/mcp-server/src/resources/guides.d.ts +10 -0
- package/dist/packages/mcp-server/src/resources/index.d.ts +7 -0
- package/dist/packages/mcp-server/src/resources/tokens.d.ts +16 -0
- package/dist/packages/mcp-server/src/server.d.ts +10 -0
- package/dist/packages/mcp-server/src/tools/component-tools.d.ts +13 -0
- package/dist/packages/mcp-server/src/tools/index.d.ts +7 -0
- package/dist/packages/mcp-server/src/tools/token-tools.d.ts +16 -0
- package/dist/packages/mcp-server/src/tools/validation-tools.d.ts +11 -0
- package/dist/packages/nys-accordion/src/nys-accordion.d.ts +25 -8
- package/dist/packages/nys-accordion/src/nys-accordionitem.d.ts +19 -7
- package/dist/packages/nys-alert/src/nys-alert.d.ts +32 -9
- package/dist/packages/nys-avatar/src/nys-avatar.d.ts +26 -7
- package/dist/packages/nys-backtotop/src/nys-backtotop.d.ts +17 -7
- package/dist/packages/nys-badge/src/nys-badge.d.ts +30 -4
- package/dist/packages/nys-button/src/nys-button.d.ts +126 -9
- package/dist/packages/nys-checkbox/src/nys-checkbox.d.ts +43 -11
- package/dist/packages/nys-checkbox/src/nys-checkboxgroup.d.ts +33 -12
- package/dist/packages/nys-divider/src/nys-divider.d.ts +20 -2
- package/dist/packages/nys-errormessage/src/nys-errormessage.d.ts +10 -3
- package/dist/packages/nys-fileinput/src/nys-fileinput.d.ts +37 -11
- package/dist/packages/nys-fileinput/src/nys-fileitem.d.ts +16 -2
- package/dist/packages/nys-globalfooter/src/nys-globalfooter.d.ts +16 -7
- package/dist/packages/nys-globalheader/src/nys-globalheader.d.ts +16 -10
- package/dist/packages/nys-icon/src/nys-icon.d.ts +25 -3
- package/dist/packages/nys-label/src/nys-label.d.ts +15 -3
- package/dist/packages/nys-modal/src/nys-modal.d.ts +30 -7
- package/dist/packages/nys-pagination/src/nys-pagination.d.ts +17 -5
- package/dist/packages/nys-radiobutton/src/nys-radiobutton.d.ts +35 -13
- package/dist/packages/nys-radiobutton/src/nys-radiogroup.d.ts +33 -8
- package/dist/packages/nys-select/src/nys-option.d.ts +24 -0
- package/dist/packages/nys-select/src/nys-select.d.ts +48 -12
- package/dist/packages/nys-skipnav/src/nys-skipnav.d.ts +19 -6
- package/dist/packages/nys-stepper/src/index.d.ts +2 -0
- package/dist/packages/nys-stepper/src/nys-step.d.ts +37 -0
- package/dist/packages/nys-stepper/src/nys-stepper.d.ts +48 -0
- package/dist/packages/nys-stepper/src/nys-stepper.figma.d.ts +1 -0
- package/dist/packages/nys-table/src/nys-table.d.ts +2 -1
- package/dist/packages/nys-textarea/src/nys-textarea.d.ts +51 -8
- package/dist/packages/nys-textinput/src/nys-textinput.d.ts +64 -9
- package/dist/packages/nys-toggle/src/nys-toggle.d.ts +35 -6
- package/dist/packages/nys-tooltip/src/nys-tooltip.d.ts +24 -11
- package/dist/packages/nys-unavfooter/src/nys-unavfooter.d.ts +12 -5
- package/dist/packages/nys-unavheader/src/nys-unavheader.d.ts +25 -7
- package/package.json +12 -10
|
@@ -1,19 +1,45 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* A compact label for status, counts, or categorization. Supports semantic intents with auto-selected icons.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
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
|
+
* ```
|
|
8
21
|
*/
|
|
9
22
|
export declare class NysBadge extends LitElement {
|
|
10
23
|
static styles: import("lit").CSSResult;
|
|
24
|
+
/** Unique identifier. */
|
|
11
25
|
id: string;
|
|
26
|
+
/** Name attribute for form association. */
|
|
12
27
|
name: string;
|
|
28
|
+
/**
|
|
29
|
+
* Badge size: `sm` (smaller text) or `md` (default).
|
|
30
|
+
* @default "md"
|
|
31
|
+
*/
|
|
13
32
|
size: "sm" | "md";
|
|
33
|
+
/**
|
|
34
|
+
* Semantic intent affecting color: `neutral`, `error`, `success`, or `warning`.
|
|
35
|
+
* @default "neutral"
|
|
36
|
+
*/
|
|
14
37
|
intent: "neutral" | "error" | "success" | "warning";
|
|
38
|
+
/** Secondary label displayed before the main label. */
|
|
15
39
|
prefixLabel: string;
|
|
40
|
+
/** Primary label text displayed in the badge. */
|
|
16
41
|
label: string;
|
|
42
|
+
variant: "strong" | "";
|
|
17
43
|
private _prefixIcon;
|
|
18
44
|
get prefixIcon(): string | boolean;
|
|
19
45
|
set prefixIcon(value: string | boolean);
|
|
@@ -1,38 +1,155 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
* - Multiple variants (`filled`, `outline`, `ghost`, `text`)
|
|
5
|
-
* - Sizes (`sm`, `md`, `lg`) and full-width layout
|
|
6
|
-
* - Icons (prefix, suffix, or circle) and optional labels
|
|
7
|
-
* - Native `<button>` or link `<a>` behavior with form association
|
|
8
|
-
* - Keyboard and accessibility support (`aria-label`, `aria-controls`, `aria-description`)
|
|
3
|
+
* A button for actions like saving, submitting, or navigating. Form-associated with full keyboard support.
|
|
9
4
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
5
|
+
* Use `filled` for primary actions (one per section), `outline` for secondary, `ghost` for tertiary,
|
|
6
|
+
* `text` for inline. Set `href` to render as a navigation link.
|
|
7
|
+
*
|
|
8
|
+
* @summary Button for actions and CTAs with variants, sizes, and icon support.
|
|
9
|
+
* @element nys-button
|
|
10
|
+
*
|
|
11
|
+
* @slot prefix-icon - Icon before label. Not shown for `text` variant.
|
|
12
|
+
* @slot suffix-icon - Icon after label. Not shown for `text` variant.
|
|
13
|
+
* @slot circle-icon - Icon for circle mode. Overrides `icon` prop.
|
|
14
|
+
*
|
|
15
|
+
* @cssprop [--nys-button-color] - Text color of the button label.
|
|
16
|
+
* @cssprop [--nys-button-color--hover] - Text color when hovered.
|
|
17
|
+
* @cssprop [--nys-button-color--active] - Text color when active/pressed.
|
|
18
|
+
* @cssprop [--nys-button-background-color] - Background color of the button.
|
|
19
|
+
* @cssprop [--nys-button-background-color--hover] - Background color when hovered.
|
|
20
|
+
* @cssprop [--nys-button-background-color--active] - Background color when active/pressed.
|
|
21
|
+
* @cssprop [--nys-button-border-color] - Border color of the button.
|
|
22
|
+
* @cssprop [--nys-button-border-color--hover] - Border color when hovered.
|
|
23
|
+
* @cssprop [--nys-button-border-color--active] - Border color when active/pressed.
|
|
24
|
+
*
|
|
25
|
+
* @fires nys-click - Fired when the button is clicked (mouse or keyboard). Not fired when disabled.
|
|
26
|
+
* @fires nys-focus - Fired when the button receives focus.
|
|
27
|
+
* @fires nys-blur - Fired when the button loses focus.
|
|
28
|
+
*
|
|
29
|
+
* @example Basic filled button
|
|
30
|
+
* ```html
|
|
31
|
+
* <nys-button label="Submit" variant="filled"></nys-button>
|
|
32
|
+
* ```
|
|
33
|
+
*
|
|
34
|
+
* @example Secondary outline button
|
|
35
|
+
* ```html
|
|
36
|
+
* <nys-button label="Cancel" variant="outline"></nys-button>
|
|
37
|
+
* ```
|
|
38
|
+
*
|
|
39
|
+
* @example Button with icons
|
|
40
|
+
* ```html
|
|
41
|
+
* <nys-button label="Previous" prefixIcon="chevron_left"></nys-button>
|
|
42
|
+
* <nys-button label="Next" suffixIcon="chevron_right"></nys-button>
|
|
43
|
+
* ```
|
|
44
|
+
*
|
|
45
|
+
* @example Circle icon button
|
|
46
|
+
* ```html
|
|
47
|
+
* <nys-button circle icon="close" label="Close dialog"></nys-button>
|
|
48
|
+
* ```
|
|
49
|
+
*
|
|
50
|
+
* @example Link-style button for navigation
|
|
51
|
+
* ```html
|
|
52
|
+
* <nys-button label="Visit NY.gov" href="https://www.ny.gov/" target="_blank" suffixIcon="open_in_new"></nys-button>
|
|
53
|
+
* ```
|
|
54
|
+
*
|
|
55
|
+
* @example Form submit button
|
|
56
|
+
* ```html
|
|
57
|
+
* <nys-button type="submit" label="Save Changes" variant="filled"></nys-button>
|
|
58
|
+
* ```
|
|
13
59
|
*/
|
|
14
60
|
export declare class NysButton extends LitElement {
|
|
15
61
|
static styles: import("lit").CSSResult;
|
|
62
|
+
/**
|
|
63
|
+
* Unique identifier. Auto-generated if not provided.
|
|
64
|
+
*/
|
|
16
65
|
id: string;
|
|
66
|
+
/**
|
|
67
|
+
* Name for form submission.
|
|
68
|
+
*/
|
|
17
69
|
name: string;
|
|
70
|
+
/**
|
|
71
|
+
* Button height: `sm` (40px) for dense UIs, `md` (48px, default) for standard use, `lg` (56px) for prominent CTAs.
|
|
72
|
+
* @default "md"
|
|
73
|
+
*/
|
|
18
74
|
size: "sm" | "md" | "lg";
|
|
75
|
+
/**
|
|
76
|
+
* Expands button to fill container width. Use for mobile layouts or stacked button groups.
|
|
77
|
+
* @default false
|
|
78
|
+
*/
|
|
19
79
|
fullWidth: boolean;
|
|
80
|
+
/**
|
|
81
|
+
* Visual style: `filled` for primary (one per section), `outline` for secondary, `ghost` for tertiary, `text` for inline actions. Avoid `text` for navigation.
|
|
82
|
+
* @default "filled"
|
|
83
|
+
*/
|
|
20
84
|
variant: "filled" | "outline" | "ghost" | "text";
|
|
85
|
+
/**
|
|
86
|
+
* Adjusts colors for dark backgrounds.
|
|
87
|
+
* @default false
|
|
88
|
+
*/
|
|
21
89
|
inverted: boolean;
|
|
90
|
+
/**
|
|
91
|
+
* Visible button text. Use sentence case, action-oriented text (e.g., "Save Draft"). Becomes aria-label in `circle` mode.
|
|
92
|
+
*/
|
|
22
93
|
label: string;
|
|
94
|
+
/**
|
|
95
|
+
* Screen reader label. Required for icon-only buttons if `label` is not set.
|
|
96
|
+
*/
|
|
23
97
|
ariaLabel: string;
|
|
98
|
+
/**
|
|
99
|
+
* ID of controlled element (e.g., dropdown or modal). Sets `aria-controls`.
|
|
100
|
+
*/
|
|
24
101
|
ariaControls: string;
|
|
102
|
+
/**
|
|
103
|
+
* Material Symbol icon before label. Not shown for `text` variant or `circle` mode.
|
|
104
|
+
*/
|
|
25
105
|
prefixIcon: string;
|
|
106
|
+
/**
|
|
107
|
+
* Material Symbol icon after label. Use `chevron_down` for dropdowns, `open_in_new` for external links. Not shown for `text` variant or `circle` mode.
|
|
108
|
+
*/
|
|
26
109
|
suffixIcon: string;
|
|
110
|
+
/**
|
|
111
|
+
* Renders circular icon-only button. Requires `icon` prop. `label` becomes aria-label.
|
|
112
|
+
* @default false
|
|
113
|
+
*/
|
|
27
114
|
circle: boolean;
|
|
115
|
+
/**
|
|
116
|
+
* Icon for circle mode. Required when `circle` is true. Scales with size (sm=24px, md=32px, lg=40px).
|
|
117
|
+
*/
|
|
28
118
|
icon: string;
|
|
119
|
+
/**
|
|
120
|
+
* Prevents interaction. Avoid disabling without explanation—show validation errors instead.
|
|
121
|
+
* @default false
|
|
122
|
+
*/
|
|
29
123
|
disabled: boolean;
|
|
124
|
+
/**
|
|
125
|
+
* Form `id` to associate with. Use when button is outside the form element.
|
|
126
|
+
*/
|
|
30
127
|
form: string | null;
|
|
128
|
+
/**
|
|
129
|
+
* Value submitted with form data. Only used when `type="submit"`.
|
|
130
|
+
*/
|
|
31
131
|
value: string;
|
|
132
|
+
/**
|
|
133
|
+
* Additional screen reader description. Sets `aria-description`.
|
|
134
|
+
*/
|
|
32
135
|
ariaDescription: string;
|
|
136
|
+
/**
|
|
137
|
+
* Form behavior: `button` (default, no form action), `submit` (submits form), `reset` (resets form). Always set explicitly to avoid unintended submissions.
|
|
138
|
+
* @default "button"
|
|
139
|
+
*/
|
|
33
140
|
type: "submit" | "reset" | "button";
|
|
141
|
+
/**
|
|
142
|
+
* Click handler. Use instead of `@click` to ensure keyboard accessibility.
|
|
143
|
+
*/
|
|
34
144
|
onClick: ((event: Event) => void) | null;
|
|
145
|
+
/**
|
|
146
|
+
* URL to navigate to. Renders as `<a>` tag. Omit for action buttons.
|
|
147
|
+
*/
|
|
35
148
|
href: string;
|
|
149
|
+
/**
|
|
150
|
+
* Link target: `_self` (same tab), `_blank` (new tab—add `suffixIcon="open_in_new"`), `_parent`, `_top`, or frame name.
|
|
151
|
+
* @default "_self"
|
|
152
|
+
*/
|
|
36
153
|
target: "_self" | "_blank" | "_parent" | "_top" | "framename";
|
|
37
154
|
getButtonElement(): Promise<HTMLElement | null>;
|
|
38
155
|
private _internals;
|
|
@@ -1,38 +1,70 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
2
|
import "./nys-checkboxgroup";
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* A checkbox input for binary choices or multi-select lists. Can be used standalone or in a `nys-checkboxgroup`.
|
|
5
|
+
* Form-associated with validation via ElementInternals.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
|
-
* -
|
|
9
|
-
* - Displays error messages with `showError` and `errorMessage`
|
|
10
|
-
* - Keyboard interaction with spacebar toggle
|
|
11
|
-
* - Form integration via ElementInternals (`checked` value submitted)
|
|
7
|
+
* Use for binary decisions (agree/disagree) or selecting multiple options from a list.
|
|
8
|
+
* For single selection from 2-6 options, use `nys-radiobutton`. For immediate state changes, use `nys-toggle`.
|
|
12
9
|
*
|
|
13
|
-
* @
|
|
14
|
-
* @
|
|
15
|
-
* @fires nys-blur - Fired on blur
|
|
10
|
+
* @summary Checkbox for binary choices or multi-select options.
|
|
11
|
+
* @element nys-checkbox
|
|
16
12
|
*
|
|
17
|
-
* @slot description -
|
|
13
|
+
* @slot description - Custom HTML description content.
|
|
14
|
+
*
|
|
15
|
+
* @fires nys-change - Fired when checked state changes. Detail: `{id, checked, name, value}`.
|
|
16
|
+
* @fires nys-focus - Fired when checkbox gains focus.
|
|
17
|
+
* @fires nys-blur - Fired when checkbox loses focus.
|
|
18
|
+
*
|
|
19
|
+
* @example Single checkbox
|
|
20
|
+
* ```html
|
|
21
|
+
* <nys-checkbox label="I agree to the terms" name="terms" required></nys-checkbox>
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @example Checkbox group
|
|
25
|
+
* ```html
|
|
26
|
+
* <nys-checkboxgroup label="Select landmarks">
|
|
27
|
+
* <nys-checkbox name="landmarks" value="adirondacks" label="Adirondacks"></nys-checkbox>
|
|
28
|
+
* <nys-checkbox name="landmarks" value="niagara" label="Niagara Falls"></nys-checkbox>
|
|
29
|
+
* </nys-checkboxgroup>
|
|
30
|
+
* ```
|
|
18
31
|
*/
|
|
19
32
|
export declare class NysCheckbox extends LitElement {
|
|
20
33
|
static styles: import("lit").CSSResult;
|
|
34
|
+
/** Whether checkbox is checked. */
|
|
21
35
|
checked: boolean;
|
|
36
|
+
/** Prevents interaction. */
|
|
22
37
|
disabled: boolean;
|
|
38
|
+
/** Marks as required. Validates that checkbox is checked. */
|
|
23
39
|
required: boolean;
|
|
40
|
+
/** Visible label text. Required for accessibility. */
|
|
24
41
|
label: string;
|
|
42
|
+
/** Helper text below label. Use slot for custom HTML. */
|
|
25
43
|
description: string;
|
|
44
|
+
/** Unique identifier. Auto-generated if not provided. */
|
|
26
45
|
id: string;
|
|
46
|
+
/** Name for form submission. Use same name for grouped checkboxes. */
|
|
27
47
|
name: string;
|
|
48
|
+
/** Value submitted when checked. */
|
|
28
49
|
value: string;
|
|
50
|
+
/** Form `id` to associate with when checkbox is outside form element. */
|
|
29
51
|
form: string | null;
|
|
52
|
+
/** Shows error message when true. */
|
|
30
53
|
showError: boolean;
|
|
54
|
+
/** Error message text. Shown only when `showError` is true. */
|
|
31
55
|
errorMessage: string;
|
|
56
|
+
/** Internal: Set by parent checkboxgroup. Do not set manually. */
|
|
32
57
|
groupExist: boolean;
|
|
58
|
+
/** Renders as tile with larger clickable area. Apply to group for consistency. */
|
|
33
59
|
tile: boolean;
|
|
60
|
+
/** Adjusts colors for dark backgrounds. */
|
|
34
61
|
inverted: boolean;
|
|
62
|
+
/** Tooltip text shown on hover/focus of info icon. */
|
|
35
63
|
tooltip: string;
|
|
64
|
+
/**
|
|
65
|
+
* Checkbox size: `sm` (24px) or `md` (32px, default).
|
|
66
|
+
* @default "md"
|
|
67
|
+
*/
|
|
36
68
|
size: "sm" | "md";
|
|
37
69
|
getInputElement(): Promise<HTMLInputElement | null>;
|
|
38
70
|
private _internals;
|
|
@@ -1,35 +1,55 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
* Handles
|
|
3
|
+
* A container for grouping multiple `nys-checkbox` components as a single form control.
|
|
4
|
+
* Handles validation, required constraints, and submits comma-separated values.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* - Supports required/optional flags and error messages
|
|
9
|
-
* - Propagates size, tile, and inverted styling to child checkboxes
|
|
10
|
-
* - Keyboard and screen reader accessible via fieldset/legend
|
|
6
|
+
* Use to allow users to select multiple options from a list. Apply `tile`, `size`, and `inverted` to the group
|
|
7
|
+
* and all children inherit these styles automatically.
|
|
11
8
|
*
|
|
12
|
-
* @
|
|
13
|
-
* @
|
|
9
|
+
* @summary Container for grouping checkboxes as a single form control.
|
|
10
|
+
* @element nys-checkboxgroup
|
|
14
11
|
*
|
|
15
|
-
* @
|
|
16
|
-
* @
|
|
17
|
-
*
|
|
12
|
+
* @slot - Default slot for `nys-checkbox` elements.
|
|
13
|
+
* @slot description - Custom HTML description content.
|
|
14
|
+
*
|
|
15
|
+
* @example Basic checkbox group
|
|
16
|
+
* ```html
|
|
17
|
+
* <nys-checkboxgroup label="Select landmarks" required>
|
|
18
|
+
* <nys-checkbox name="landmarks" value="adirondacks" label="Adirondacks"></nys-checkbox>
|
|
19
|
+
* <nys-checkbox name="landmarks" value="niagara" label="Niagara Falls"></nys-checkbox>
|
|
20
|
+
* </nys-checkboxgroup>
|
|
21
|
+
* ```
|
|
18
22
|
*/
|
|
19
23
|
export declare class NysCheckboxgroup extends LitElement {
|
|
20
24
|
static styles: import("lit").CSSResult;
|
|
25
|
+
/** Unique identifier. Auto-generated if not provided. */
|
|
21
26
|
id: string;
|
|
27
|
+
/** Name for form submission. Set on group, not individual checkboxes. */
|
|
22
28
|
name: string;
|
|
29
|
+
/** Requires at least one checkbox to be checked. */
|
|
23
30
|
required: boolean;
|
|
31
|
+
/** Shows "Optional" flag. */
|
|
24
32
|
optional: boolean;
|
|
33
|
+
/** Shows error message when true. */
|
|
25
34
|
showError: boolean;
|
|
35
|
+
/** Error message text. Shown only when `showError` is true. */
|
|
26
36
|
errorMessage: string;
|
|
37
|
+
/** Visible label text for the group. */
|
|
27
38
|
label: string;
|
|
39
|
+
/** Helper text below label. Use slot for custom HTML. */
|
|
28
40
|
description: string;
|
|
41
|
+
/** Renders all checkboxes as tiles with larger clickable area. */
|
|
29
42
|
tile: boolean;
|
|
43
|
+
/** Tooltip text shown on hover/focus of info icon. */
|
|
30
44
|
tooltip: string;
|
|
45
|
+
/** Adjusts colors for dark backgrounds. Applied to all children. */
|
|
31
46
|
inverted: boolean;
|
|
47
|
+
/** Form `id` to associate with. Applied to all children. */
|
|
32
48
|
form: string | null;
|
|
49
|
+
/**
|
|
50
|
+
* Checkbox size for all children: `sm` (24px) or `md` (32px, default).
|
|
51
|
+
* @default "md"
|
|
52
|
+
*/
|
|
33
53
|
size: "sm" | "md";
|
|
34
54
|
private _slottedDescriptionText;
|
|
35
55
|
private _internals;
|
|
@@ -56,6 +76,7 @@ export declare class NysCheckboxgroup extends LitElement {
|
|
|
56
76
|
private _updateCheckboxShowError;
|
|
57
77
|
private _updateCheckboxForm;
|
|
58
78
|
private _getSlotDescriptionForAria;
|
|
79
|
+
formResetCallback(): void;
|
|
59
80
|
private _handleInvalid;
|
|
60
81
|
/**
|
|
61
82
|
* Event Handlers
|
|
@@ -1,11 +1,29 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
3
|
+
* A horizontal rule for visual separation between content sections. Renders a semantic `<hr>` element.
|
|
4
|
+
*
|
|
5
|
+
* Use to separate distinct content areas within a page. Set `inverted` for use on dark backgrounds.
|
|
6
|
+
*
|
|
7
|
+
* @summary Horizontal divider for visual separation of content sections.
|
|
8
|
+
* @element nys-divider
|
|
9
|
+
*
|
|
10
|
+
* @example Basic divider
|
|
11
|
+
* ```html
|
|
12
|
+
* <p>Section one content</p>
|
|
13
|
+
* <nys-divider></nys-divider>
|
|
14
|
+
* <p>Section two content</p>
|
|
15
|
+
* ```
|
|
5
16
|
*/
|
|
6
17
|
export declare class NysDivider extends LitElement {
|
|
7
18
|
static styles: import("lit").CSSResult;
|
|
19
|
+
/** Adjusts colors for dark backgrounds. */
|
|
8
20
|
inverted: boolean;
|
|
9
21
|
constructor();
|
|
22
|
+
connectedCallback(): void;
|
|
23
|
+
/**
|
|
24
|
+
* Functions
|
|
25
|
+
* --------------------------------------------------------------------------
|
|
26
|
+
*/
|
|
27
|
+
private _generateUniqueId;
|
|
10
28
|
render(): import("lit-html").TemplateResult<1>;
|
|
11
29
|
}
|
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
3
|
+
* **Internal component.** Displays error messages for form validation with icon and ARIA alert role.
|
|
4
|
+
*
|
|
5
|
+
* Used internally by form components. Not intended for direct use. Shows error icon and message
|
|
6
|
+
* when `showError` is true. Integrates with ElementInternals for native form validation messages.
|
|
7
|
+
*
|
|
8
|
+
* @summary Internal error message display with icon and ARIA alert support.
|
|
9
|
+
* @element nys-errormessage
|
|
6
10
|
*/
|
|
7
11
|
export declare class NysErrorMessage extends LitElement {
|
|
8
12
|
static styles: import("lit").CSSResult;
|
|
13
|
+
/** Whether to display the error message. */
|
|
9
14
|
showError: boolean;
|
|
15
|
+
/** Error text to display. Falls back to native validation message if available. */
|
|
10
16
|
errorMessage: string;
|
|
17
|
+
/** Shows a divider line above the error message. */
|
|
11
18
|
showDivider: boolean;
|
|
12
19
|
private _internals;
|
|
13
20
|
/**
|
|
@@ -1,39 +1,64 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
2
|
import "./nys-fileitem";
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* A file input for uploading files with support for multiple files, drag-and-drop, and progress tracking.
|
|
5
|
+
* Validates file types via magic bytes (not just extension). Form-associated via ElementInternals.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
|
-
* - Supports single or multiple file uploads
|
|
9
|
-
* - Optional drag-and-drop dropzone
|
|
10
|
-
* - File type validation and upload progress
|
|
11
|
-
* - Form-associated with native validation behavior
|
|
12
|
-
* - Keyboard and screen reader accessible
|
|
7
|
+
* Use for document uploads, image uploads, or any file submission. Enable `dropzone` for drag-and-drop UI.
|
|
13
8
|
*
|
|
14
|
-
* @
|
|
9
|
+
* @summary File input with drag-and-drop, validation, and progress tracking.
|
|
10
|
+
* @element nys-fileinput
|
|
15
11
|
*
|
|
16
|
-
* @
|
|
12
|
+
* @slot description - Custom HTML description content.
|
|
17
13
|
*
|
|
18
|
-
* @
|
|
14
|
+
* @fires nys-change - Fired when files are added or removed. Detail: `{id, files}`.
|
|
15
|
+
*
|
|
16
|
+
* @example Single file upload
|
|
17
|
+
* ```html
|
|
18
|
+
* <nys-fileinput label="Upload document" accept=".pdf,.doc" required></nys-fileinput>
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* @example Multiple files with dropzone
|
|
22
|
+
* ```html
|
|
23
|
+
* <nys-fileinput label="Upload images" accept="image/*" multiple dropzone></nys-fileinput>
|
|
24
|
+
* ```
|
|
19
25
|
*/
|
|
20
26
|
export declare class NysFileinput extends LitElement {
|
|
21
27
|
static styles: import("lit").CSSResult;
|
|
28
|
+
/** Unique identifier. Auto-generated if not provided. */
|
|
22
29
|
id: string;
|
|
30
|
+
/** Name for form submission. */
|
|
23
31
|
name: string;
|
|
32
|
+
/** Visible label text. */
|
|
24
33
|
label: string;
|
|
34
|
+
/** Helper text below label. Use slot for custom HTML. */
|
|
25
35
|
description: string;
|
|
36
|
+
/** Allows selecting multiple files. */
|
|
26
37
|
multiple: boolean;
|
|
38
|
+
/** Form `id` to associate with. */
|
|
27
39
|
form: string | null;
|
|
40
|
+
/** Tooltip text shown on hover/focus of info icon. */
|
|
28
41
|
tooltip: string;
|
|
42
|
+
/** Accepted file types. Use MIME types (`image/*`) or extensions (`.pdf`). Validated via magic bytes. */
|
|
29
43
|
accept: string;
|
|
44
|
+
/** Prevents interaction. */
|
|
30
45
|
disabled: boolean;
|
|
46
|
+
/** Requires at least one file to be uploaded. */
|
|
31
47
|
required: boolean;
|
|
48
|
+
/** Shows "Optional" flag. */
|
|
32
49
|
optional: boolean;
|
|
50
|
+
/** Shows error message when true. */
|
|
33
51
|
showError: boolean;
|
|
52
|
+
/** Error message text. Shown only when `showError` is true. */
|
|
34
53
|
errorMessage: string;
|
|
54
|
+
/** Enables drag-and-drop zone UI. */
|
|
35
55
|
dropzone: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Component width: `lg` (384px) or `full` (100%, default).
|
|
58
|
+
* @default "full"
|
|
59
|
+
*/
|
|
36
60
|
width: "lg" | "full";
|
|
61
|
+
/** Adjusts colors for dark backgrounds. */
|
|
37
62
|
inverted: boolean;
|
|
38
63
|
private _selectedFiles;
|
|
39
64
|
private _dragActive;
|
|
@@ -60,6 +85,7 @@ export declare class NysFileinput extends LitElement {
|
|
|
60
85
|
private _setValidityMessage;
|
|
61
86
|
private _validate;
|
|
62
87
|
checkValidity(): boolean;
|
|
88
|
+
formResetCallback(): void;
|
|
63
89
|
private _handleInvalid;
|
|
64
90
|
/**
|
|
65
91
|
* Functions
|
|
@@ -1,13 +1,27 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
3
|
+
* **Internal component.** Displays an individual file within `nys-fileinput` with status and progress.
|
|
4
|
+
*
|
|
5
|
+
* Rendered automatically by `nys-fileinput` for each selected file. Shows filename, upload status
|
|
6
|
+
* (pending/processing/done/error), progress bar during upload, and error messages. Remove button emits event.
|
|
7
|
+
*
|
|
8
|
+
* @summary Internal file item display with status, progress bar, and remove action.
|
|
9
|
+
* @element nys-fileitem
|
|
10
|
+
*
|
|
11
|
+
* @fires nys-fileRemove - Fired when remove button is clicked. Detail: `{filename}`.
|
|
5
12
|
*/
|
|
6
13
|
export declare class NysFileItem extends LitElement {
|
|
7
14
|
static styles: import("lit").CSSResult;
|
|
15
|
+
/** Name of the file being displayed. */
|
|
8
16
|
filename: string;
|
|
17
|
+
/**
|
|
18
|
+
* Upload status: `pending` (queued), `processing` (uploading), `done` (complete), `error` (failed).
|
|
19
|
+
* @default "pending"
|
|
20
|
+
*/
|
|
9
21
|
status: "pending" | "processing" | "done" | "error";
|
|
22
|
+
/** Upload progress percentage (0-100). Only shown when status is `processing`. */
|
|
10
23
|
progress: number;
|
|
24
|
+
/** Error message displayed when status is `error`. */
|
|
11
25
|
errorMessage: string;
|
|
12
26
|
private _handleRemove;
|
|
13
27
|
private splitFilename;
|
|
@@ -1,19 +1,28 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Agency-branded footer with agency name and slotted content sections. Auto-layouts based on content structure.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
5
|
+
* Place above `nys-unavfooter`. Slot contact info, links, or other content. Use `<h4>` elements
|
|
6
|
+
* to create multi-column layouts; without `<h4>`, renders as compact single section.
|
|
7
7
|
*
|
|
8
|
-
* @
|
|
8
|
+
* @summary Agency footer with auto-layout for contact info and link sections.
|
|
9
|
+
* @element nys-globalfooter
|
|
9
10
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
11
|
+
* @slot - Footer content (links, contact info). Use `<h4>` for column headings.
|
|
12
|
+
*
|
|
13
|
+
* @example Simple footer
|
|
14
|
+
* ```html
|
|
15
|
+
* <nys-globalfooter agencyName="Department of Health" homepageLink="/">
|
|
16
|
+
* <span>123 Main St, Albany NY</span>
|
|
17
|
+
* <span>info@health.ny.gov</span>
|
|
18
|
+
* </nys-globalfooter>
|
|
19
|
+
* ```
|
|
13
20
|
*/
|
|
14
21
|
export declare class NysGlobalFooter extends LitElement {
|
|
15
22
|
static styles: import("lit").CSSResult;
|
|
23
|
+
/** Agency name displayed as the footer heading. */
|
|
16
24
|
agencyName: string;
|
|
25
|
+
/** URL for the agency name link. If empty, name is not clickable. */
|
|
17
26
|
homepageLink: string;
|
|
18
27
|
private slotHasContent;
|
|
19
28
|
/**
|
|
@@ -1,23 +1,29 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Agency-branded header with app/agency name, navigation, and responsive mobile menu.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* and a responsive mobile menu.
|
|
5
|
+
* Place below `nys-unavheader`. Slot navigation links as `<ul><li><a>` elements; active links
|
|
6
|
+
* are auto-highlighted based on current URL. Mobile menu toggles automatically on narrow screens.
|
|
8
7
|
*
|
|
9
|
-
* @
|
|
10
|
-
* @
|
|
8
|
+
* @summary Agency header with navigation, mobile menu, and active link highlighting.
|
|
9
|
+
* @element nys-globalheader
|
|
11
10
|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
11
|
+
* @slot - Navigation content (typically `<ul>` with `<li><a>` links). Auto-sanitized.
|
|
12
|
+
*
|
|
13
|
+
* @example Basic header
|
|
14
|
+
* ```html
|
|
15
|
+
* <nys-globalheader appName="My App" agencyName="Department of Health" homepageLink="/">
|
|
16
|
+
* <ul><li><a href="/about">About</a></li><li><a href="/contact">Contact</a></li></ul>
|
|
17
|
+
* </nys-globalheader>
|
|
18
|
+
* ```
|
|
16
19
|
*/
|
|
17
20
|
export declare class NysGlobalHeader extends LitElement {
|
|
18
21
|
static styles: import("lit").CSSResult;
|
|
22
|
+
/** Application name displayed prominently. */
|
|
19
23
|
appName: string;
|
|
24
|
+
/** Agency name displayed below app name (or as main title if no appName). */
|
|
20
25
|
agencyName: string;
|
|
26
|
+
/** URL for the header title link. If empty, title is not clickable. */
|
|
21
27
|
homepageLink: string;
|
|
22
28
|
private isMobileMenuOpen;
|
|
23
29
|
private hasLinkContent;
|