@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,17 +1,39 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Renders SVG icons from the NYSDS icon library (Material Symbols). Decorative by default (`aria-hidden`).
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
* and
|
|
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
|
+
* ```
|
|
7
20
|
*/
|
|
8
21
|
export declare class NysIcon extends LitElement {
|
|
9
22
|
static styles: import("lit").CSSResult;
|
|
23
|
+
/** Icon name from Material Symbols library. Required. */
|
|
10
24
|
name: string;
|
|
25
|
+
/** Accessible label. When set, removes `aria-hidden` and adds `aria-label` to the SVG. */
|
|
11
26
|
ariaLabel: string;
|
|
27
|
+
/** Rotation in degrees. Applied via CSS `rotate`. */
|
|
12
28
|
rotate: string;
|
|
29
|
+
/** Flip direction: `horizontal`, `vertical`, or empty for none. */
|
|
13
30
|
flip: string;
|
|
31
|
+
/** Icon color. Accepts any CSS color value. Defaults to `currentcolor`. */
|
|
14
32
|
color: string;
|
|
33
|
+
/**
|
|
34
|
+
* Icon size. Semantic sizes: `xs`-`5xl`. Pixel sizes: `12`-`50`.
|
|
35
|
+
* @default "md"
|
|
36
|
+
*/
|
|
15
37
|
size: "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "12" | "14" | "16" | "18" | "20" | "24" | "32" | "40" | "50";
|
|
16
38
|
/**
|
|
17
39
|
* Retrieves the SVG element for the given icon name and applies
|
|
@@ -1,16 +1,28 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
3
|
+
* **Internal component.** Renders form labels with description, required/optional flag, and tooltip.
|
|
4
|
+
*
|
|
5
|
+
* Used internally by form components (textinput, select, checkbox, etc.). Not intended for direct use.
|
|
6
|
+
* Handles label association via `for`, displays asterisk for required fields, and integrates tooltips.
|
|
7
|
+
*
|
|
8
|
+
* @summary Internal label component for form fields with flag and tooltip support.
|
|
9
|
+
* @element nys-label
|
|
10
|
+
*
|
|
11
|
+
* @slot description - Custom HTML description content below the label.
|
|
6
12
|
*/
|
|
7
13
|
export declare class NysLabel extends LitElement {
|
|
8
14
|
static styles: import("lit").CSSResult;
|
|
15
|
+
/** ID of the form element this label is associated with. */
|
|
9
16
|
for: string;
|
|
17
|
+
/** Label text displayed above the form field. */
|
|
10
18
|
label: string;
|
|
19
|
+
/** Helper text displayed below the label. */
|
|
11
20
|
description: string;
|
|
21
|
+
/** Flag type: `required` shows asterisk, `optional` shows "(Optional)". */
|
|
12
22
|
flag: string;
|
|
23
|
+
/** Adjusts colors for dark backgrounds. */
|
|
13
24
|
inverted: boolean;
|
|
25
|
+
/** Tooltip text shown on hover/focus of info icon next to label. */
|
|
14
26
|
get tooltip(): string;
|
|
15
27
|
set tooltip(value: string);
|
|
16
28
|
private _tooltip;
|
|
@@ -1,23 +1,46 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* An accessible modal dialog with focus trapping, keyboard navigation, and scroll management.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
5
|
+
* Set `open` to show the modal. Content goes in the default slot; action buttons in the `actions` slot.
|
|
6
|
+
* Dismisses via close button or Escape key unless `mandatory` is set. Focus returns to trigger on close.
|
|
7
7
|
*
|
|
8
|
-
* @
|
|
9
|
-
* @
|
|
8
|
+
* @summary Accessible modal dialog with focus trap, keyboard support, and action slots.
|
|
9
|
+
* @element nys-modal
|
|
10
10
|
*
|
|
11
|
-
* @
|
|
12
|
-
* @
|
|
11
|
+
* @slot - Default slot for body content.
|
|
12
|
+
* @slot actions - Action buttons displayed in footer. Buttons auto-resize on mobile.
|
|
13
|
+
*
|
|
14
|
+
* @fires nys-open - Fired when modal opens. Detail: `{id}`.
|
|
15
|
+
* @fires nys-close - Fired when modal closes. Detail: `{id}`.
|
|
16
|
+
*
|
|
17
|
+
* @example Basic modal
|
|
18
|
+
* ```html
|
|
19
|
+
* <nys-modal id="confirm-modal" heading="Confirm action" open>
|
|
20
|
+
* <p>Are you sure you want to proceed?</p>
|
|
21
|
+
* <div slot="actions">
|
|
22
|
+
* <nys-button label="Cancel" variant="outline"></nys-button>
|
|
23
|
+
* <nys-button label="Confirm" variant="filled"></nys-button>
|
|
24
|
+
* </div>
|
|
25
|
+
* </nys-modal>
|
|
26
|
+
* ```
|
|
13
27
|
*/
|
|
14
28
|
export declare class NysModal extends LitElement {
|
|
15
29
|
static styles: import("lit").CSSResult;
|
|
30
|
+
/** Unique identifier. Auto-generated if not provided. */
|
|
16
31
|
id: string;
|
|
32
|
+
/** Modal heading text. Required for accessibility. */
|
|
17
33
|
heading: string;
|
|
34
|
+
/** Secondary heading below the main heading. */
|
|
18
35
|
subheading: string;
|
|
36
|
+
/** Controls modal visibility. Set to `true` to show. */
|
|
19
37
|
open: boolean;
|
|
38
|
+
/** Prevents dismissal via close button or Escape key. User must take an action. */
|
|
20
39
|
mandatory: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Modal width: `sm` (400px), `md` (600px), or `lg` (800px).
|
|
42
|
+
* @default "md"
|
|
43
|
+
*/
|
|
21
44
|
width: "sm" | "md" | "lg";
|
|
22
45
|
private _actionButtonSlot;
|
|
23
46
|
private _prevFocusedElement;
|
|
@@ -1,19 +1,31 @@
|
|
|
1
1
|
import { LitElement, TemplateResult } from "lit";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Page navigation with Previous/Next buttons and numbered page links. Auto-collapses with ellipses for many pages.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
* when
|
|
5
|
+
* Set `totalPages` and `currentPage` to control state. Listen to `nys-change` for page selection.
|
|
6
|
+
* Hidden automatically when `totalPages` is 1. Responsive: shows compact controls on mobile.
|
|
7
7
|
*
|
|
8
|
-
* @
|
|
9
|
-
*
|
|
8
|
+
* @summary Page navigation with numbered links, prev/next buttons, and responsive layout.
|
|
9
|
+
* @element nys-pagination
|
|
10
|
+
*
|
|
11
|
+
* @fires nys-change - Fired when page changes. Detail: `{page}`.
|
|
12
|
+
*
|
|
13
|
+
* @example Basic pagination
|
|
14
|
+
* ```html
|
|
15
|
+
* <nys-pagination currentPage="1" totalPages="10"></nys-pagination>
|
|
16
|
+
* ```
|
|
10
17
|
*/
|
|
11
18
|
export declare class NysPagination extends LitElement {
|
|
12
19
|
static styles: import("lit").CSSResult;
|
|
20
|
+
/** Unique identifier. Auto-generated if not provided. */
|
|
13
21
|
id: string;
|
|
22
|
+
/** Name attribute for form association. */
|
|
14
23
|
name: string;
|
|
24
|
+
/** Currently active page (1-indexed). Clamped to valid range. */
|
|
15
25
|
currentPage: number;
|
|
26
|
+
/** Total number of pages. Must be at least 1. */
|
|
16
27
|
totalPages: number;
|
|
28
|
+
/** Internal state for layout adjustments near the end. */
|
|
17
29
|
_twoBeforeLast: boolean;
|
|
18
30
|
/**
|
|
19
31
|
* Lifecycle Methods
|
|
@@ -1,36 +1,57 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
2
|
import "./nys-radiogroup";
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* A radio button for single selection within a `nys-radiogroup`. Only one radio with the same `name` can be selected.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* - Supports labels, descriptions, tile layout, inverted style, and size variants
|
|
9
|
-
* - Integrates with forms and dispatches `nys-change` events on selection
|
|
6
|
+
* Use within `nys-radiogroup` for 2-6 mutually exclusive options. For 7+ options, use `nys-select`.
|
|
7
|
+
* For multiple selections, use `nys-checkbox`.
|
|
10
8
|
*
|
|
11
|
-
* @
|
|
9
|
+
* @summary Radio button for single selection from mutually exclusive options.
|
|
10
|
+
* @element nys-radiobutton
|
|
12
11
|
*
|
|
13
|
-
* @
|
|
14
|
-
*
|
|
15
|
-
* @fires nys-
|
|
16
|
-
* @fires nys-
|
|
12
|
+
* @slot description - Custom HTML description content.
|
|
13
|
+
*
|
|
14
|
+
* @fires nys-change - Fired when selection changes. Detail: `{id, checked, name, value}`.
|
|
15
|
+
* @fires nys-focus - Fired when radio gains focus.
|
|
16
|
+
* @fires nys-blur - Fired when radio loses focus.
|
|
17
|
+
*
|
|
18
|
+
* @example Radio group
|
|
19
|
+
* ```html
|
|
20
|
+
* <nys-radiogroup label="Select borough" required>
|
|
21
|
+
* <nys-radiobutton name="borough" value="bronx" label="The Bronx"></nys-radiobutton>
|
|
22
|
+
* <nys-radiobutton name="borough" value="brooklyn" label="Brooklyn"></nys-radiobutton>
|
|
23
|
+
* </nys-radiogroup>
|
|
24
|
+
* ```
|
|
17
25
|
*/
|
|
18
26
|
export declare class NysRadiobutton extends LitElement {
|
|
19
27
|
static styles: import("lit").CSSResult;
|
|
28
|
+
/** Whether this radio is selected. Only one per group can be checked. */
|
|
20
29
|
checked: boolean;
|
|
30
|
+
/** Prevents interaction. */
|
|
21
31
|
disabled: boolean;
|
|
32
|
+
/** Marks group as required. Set on radiogroup, not individual radios. */
|
|
22
33
|
required: boolean;
|
|
34
|
+
/** Visible label text. Required for accessibility. */
|
|
23
35
|
label: string;
|
|
36
|
+
/** Helper text below label. Use slot for custom HTML. */
|
|
24
37
|
description: string;
|
|
38
|
+
/** Unique identifier. Auto-generated if not provided. */
|
|
25
39
|
id: string;
|
|
40
|
+
/** Group name. Radios with same name are mutually exclusive. */
|
|
26
41
|
name: string;
|
|
42
|
+
/** Value submitted when this radio is selected. */
|
|
27
43
|
value: string;
|
|
44
|
+
/** Adjusts colors for dark backgrounds. */
|
|
28
45
|
inverted: boolean;
|
|
46
|
+
/** Form `id` to associate with. */
|
|
29
47
|
form: string | null;
|
|
48
|
+
/**
|
|
49
|
+
* Radio size: `sm` (24px) or `md` (32px, default).
|
|
50
|
+
* @default "md"
|
|
51
|
+
*/
|
|
30
52
|
size: "sm" | "md";
|
|
53
|
+
/** Renders as tile with larger clickable area. */
|
|
31
54
|
tile: boolean;
|
|
32
|
-
getInputElement(): Promise<HTMLInputElement | null>;
|
|
33
|
-
formResetUpdate(): void;
|
|
34
55
|
static buttonGroup: Record<string, NysRadiobutton>;
|
|
35
56
|
/**
|
|
36
57
|
* Lifecycle methods
|
|
@@ -43,7 +64,8 @@ export declare class NysRadiobutton extends LitElement {
|
|
|
43
64
|
* Functions
|
|
44
65
|
* --------------------------------------------------------------------------
|
|
45
66
|
*/
|
|
46
|
-
|
|
67
|
+
getInputElement(): Promise<HTMLInputElement | null>;
|
|
68
|
+
formResetUpdate(): void;
|
|
47
69
|
/**
|
|
48
70
|
* Event Handlers
|
|
49
71
|
* --------------------------------------------------------------------------
|
|
@@ -1,31 +1,56 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
3
|
+
* A container for grouping `nys-radiobutton` elements as a single form control with enforced single selection.
|
|
4
|
+
* Handles keyboard navigation (arrow keys), validation, required constraints, and form integration.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
6
|
+
* Use to let users select exactly one option from 2-6 choices. Apply `tile`, `size`, and `inverted` to the group
|
|
7
|
+
* and all children inherit these styles automatically. For 7+ options, use `nys-select`.
|
|
8
8
|
*
|
|
9
|
-
* @
|
|
10
|
-
* @
|
|
9
|
+
* @summary Container for grouping radio buttons as a single form control.
|
|
10
|
+
* @element nys-radiogroup
|
|
11
11
|
*
|
|
12
|
-
* @
|
|
13
|
-
*
|
|
12
|
+
* @slot - Default slot for `nys-radiobutton` elements.
|
|
13
|
+
* @slot description - Custom HTML description content.
|
|
14
|
+
*
|
|
15
|
+
* @example Basic radio group
|
|
16
|
+
* ```html
|
|
17
|
+
* <nys-radiogroup label="Select borough" required>
|
|
18
|
+
* <nys-radiobutton name="borough" value="bronx" label="The Bronx"></nys-radiobutton>
|
|
19
|
+
* <nys-radiobutton name="borough" value="brooklyn" label="Brooklyn"></nys-radiobutton>
|
|
20
|
+
* <nys-radiobutton name="borough" value="manhattan" label="Manhattan"></nys-radiobutton>
|
|
21
|
+
* </nys-radiogroup>
|
|
22
|
+
* ```
|
|
14
23
|
*/
|
|
15
24
|
export declare class NysRadiogroup extends LitElement {
|
|
16
25
|
static styles: import("lit").CSSResult;
|
|
26
|
+
/** Unique identifier. Auto-generated if not provided. */
|
|
17
27
|
id: string;
|
|
28
|
+
/** Name for form submission. Auto-populated from child radiobuttons. */
|
|
18
29
|
name: string;
|
|
30
|
+
/** Requires a selection before form submission. */
|
|
19
31
|
required: boolean;
|
|
32
|
+
/** Shows "Optional" flag. */
|
|
20
33
|
optional: boolean;
|
|
34
|
+
/** Shows error message when true. */
|
|
21
35
|
showError: boolean;
|
|
36
|
+
/** Error message text. Shown only when `showError` is true. */
|
|
22
37
|
errorMessage: string;
|
|
38
|
+
/** Visible label text for the group. */
|
|
23
39
|
label: string;
|
|
40
|
+
/** Helper text below label. Use slot for custom HTML. */
|
|
24
41
|
description: string;
|
|
42
|
+
/** Renders all radiobuttons as tiles with larger clickable area. */
|
|
25
43
|
tile: boolean;
|
|
44
|
+
/** Tooltip text shown on hover/focus of info icon. */
|
|
26
45
|
tooltip: string;
|
|
46
|
+
/** Adjusts colors for dark backgrounds. Applied to all children. */
|
|
27
47
|
inverted: boolean;
|
|
48
|
+
/** Form `id` to associate with. Applied to all children. */
|
|
28
49
|
form: string | null;
|
|
50
|
+
/**
|
|
51
|
+
* Radio size for all children: `sm` (24px) or `md` (32px, default).
|
|
52
|
+
* @default "md"
|
|
53
|
+
*/
|
|
29
54
|
size: "sm" | "md";
|
|
30
55
|
private selectedValue;
|
|
31
56
|
private _slottedDescriptionText;
|
|
@@ -1,9 +1,33 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
|
+
/**
|
|
3
|
+
* An option item for use within `nys-select`. Wraps a native `<option>` element.
|
|
4
|
+
*
|
|
5
|
+
* Place inside `nys-select`. Set `value` for form submission and `label` for display text.
|
|
6
|
+
* Alternatively, slot text content which auto-populates the label.
|
|
7
|
+
*
|
|
8
|
+
* @summary Option item for nys-select dropdown.
|
|
9
|
+
* @element nys-option
|
|
10
|
+
*
|
|
11
|
+
* @slot - Option label text. Auto-populates the `label` prop if provided.
|
|
12
|
+
*
|
|
13
|
+
* @example Basic options
|
|
14
|
+
* ```html
|
|
15
|
+
* <nys-select>
|
|
16
|
+
* <nys-option value="ny">New York</nys-option>
|
|
17
|
+
* <nys-option value="ca" disabled>California</nys-option>
|
|
18
|
+
* </nys-select>
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
2
21
|
export declare class NysOption extends LitElement {
|
|
22
|
+
/** Prevents selection of this option. */
|
|
3
23
|
disabled: boolean;
|
|
24
|
+
/** Pre-selects this option. */
|
|
4
25
|
selected: boolean;
|
|
26
|
+
/** Value submitted when this option is selected. */
|
|
5
27
|
value: string;
|
|
28
|
+
/** Display text for the option. Auto-populated from slot content if not set. */
|
|
6
29
|
label: string;
|
|
30
|
+
/** Hides the option from the dropdown list. */
|
|
7
31
|
hidden: boolean;
|
|
8
32
|
firstUpdated(): void;
|
|
9
33
|
render(): import("lit-html").TemplateResult<1>;
|
|
@@ -1,36 +1,72 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* A dropdown for selecting a single option from a list. Supports native `<option>` and `<optgroup>` elements.
|
|
4
|
+
* Form-associated with validation via ElementInternals.
|
|
4
5
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* - Integrates with forms via ElementInternals
|
|
8
|
-
* - Handles validation, error messages, and required/optional states
|
|
9
|
-
* - Inverted style and width variants supported
|
|
6
|
+
* Use when users must choose one option from 7+ items. For fewer options, consider `nys-radiobutton`.
|
|
7
|
+
* For multiple selections, use `nys-checkbox` group instead.
|
|
10
8
|
*
|
|
11
|
-
* @
|
|
12
|
-
* @
|
|
9
|
+
* @summary Dropdown select for choosing one option from a list.
|
|
10
|
+
* @element nys-select
|
|
13
11
|
*
|
|
14
|
-
* @
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* @fires nys-
|
|
12
|
+
* @slot - Default slot for `<option>` and `<optgroup>` elements.
|
|
13
|
+
* @slot description - Custom HTML description content below the label.
|
|
14
|
+
*
|
|
15
|
+
* @fires nys-change - Fired when selection changes. Detail: `{id, value}`.
|
|
16
|
+
* @fires nys-focus - Fired when select gains focus.
|
|
17
|
+
* @fires nys-blur - Fired when select loses focus. Triggers validation.
|
|
18
|
+
*
|
|
19
|
+
* @example Basic select
|
|
20
|
+
* ```html
|
|
21
|
+
* <nys-select label="Select borough">
|
|
22
|
+
* <option value="bronx">The Bronx</option>
|
|
23
|
+
* <option value="brooklyn">Brooklyn</option>
|
|
24
|
+
* <option value="manhattan">Manhattan</option>
|
|
25
|
+
* </nys-select>
|
|
26
|
+
* ```
|
|
27
|
+
*
|
|
28
|
+
* @example With option groups
|
|
29
|
+
* ```html
|
|
30
|
+
* <nys-select label="Select service">
|
|
31
|
+
* <optgroup label="Transportation">
|
|
32
|
+
* <option value="mta">MTA</option>
|
|
33
|
+
* <option value="dmv">DMV</option>
|
|
34
|
+
* </optgroup>
|
|
35
|
+
* </nys-select>
|
|
36
|
+
* ```
|
|
18
37
|
*/
|
|
19
38
|
export declare class NysSelect extends LitElement {
|
|
20
39
|
static styles: import("lit").CSSResult;
|
|
40
|
+
/** Unique identifier. Auto-generated if not provided. */
|
|
21
41
|
id: string;
|
|
42
|
+
/** Name for form submission. */
|
|
22
43
|
name: string;
|
|
44
|
+
/** Visible label text. Required for accessibility. */
|
|
23
45
|
label: string;
|
|
46
|
+
/** Helper text below label. Use slot for custom HTML. */
|
|
24
47
|
description: string;
|
|
48
|
+
/** Currently selected option value. */
|
|
25
49
|
value: string;
|
|
50
|
+
/** Prevents interaction. */
|
|
26
51
|
disabled: boolean;
|
|
52
|
+
/** Marks as required. Shows "Required" flag and validates on blur. */
|
|
27
53
|
required: boolean;
|
|
54
|
+
/** Shows "Optional" flag. Use when most fields are required. */
|
|
28
55
|
optional: boolean;
|
|
56
|
+
/** Tooltip text shown on hover/focus of info icon. */
|
|
29
57
|
tooltip: string;
|
|
58
|
+
/** Form `id` to associate with when select is outside form element. */
|
|
30
59
|
form: string | null;
|
|
60
|
+
/** Adjusts colors for dark backgrounds. */
|
|
31
61
|
inverted: boolean;
|
|
62
|
+
/** Shows error message when true. Set by validation or manually. */
|
|
32
63
|
showError: boolean;
|
|
64
|
+
/** Error message text. Shown only when `showError` is true. */
|
|
33
65
|
errorMessage: string;
|
|
66
|
+
/**
|
|
67
|
+
* Select width: `sm` (88px), `md` (200px), `lg` (384px), `full` (100%, default).
|
|
68
|
+
* @default "full"
|
|
69
|
+
*/
|
|
34
70
|
width: "sm" | "md" | "lg" | "full";
|
|
35
71
|
private _originalErrorMessage;
|
|
36
72
|
private _hasUserInteracted;
|
|
@@ -1,16 +1,29 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
* and screen reader users to jump directly to the main content of a page.
|
|
3
|
+
* An accessible "Skip to main content" link for keyboard and screen reader users. Visually hidden until focused.
|
|
5
4
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
5
|
+
* Place as the first focusable element in the document. Links to `#main-content` by default, or specify `href`
|
|
6
|
+
* for a custom target. The target element receives focus when activated for proper screen reader announcement.
|
|
7
|
+
*
|
|
8
|
+
* @summary Skip navigation link for keyboard accessibility. Hidden until focused.
|
|
9
|
+
* @element nys-skipnav
|
|
10
|
+
*
|
|
11
|
+
* @example Default skip link
|
|
12
|
+
* ```html
|
|
13
|
+
* <nys-skipnav></nys-skipnav>
|
|
14
|
+
* <main id="main-content">...</main>
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* @example Custom target
|
|
18
|
+
* ```html
|
|
19
|
+
* <nys-skipnav href="#content-area"></nys-skipnav>
|
|
20
|
+
* ```
|
|
10
21
|
*/
|
|
11
22
|
export declare class NysSkipnav extends LitElement {
|
|
12
23
|
static styles: import("lit").CSSResult;
|
|
24
|
+
/** Unique identifier. Auto-generated if not provided. */
|
|
13
25
|
id: string;
|
|
26
|
+
/** Target element ID (with `#`). Defaults to `#main-content`. */
|
|
14
27
|
href: string;
|
|
15
28
|
constructor();
|
|
16
29
|
connectedCallback(): void;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
/**
|
|
3
|
+
* A single step within `nys-stepper`. Represents one stage in a multi-step process.
|
|
4
|
+
*
|
|
5
|
+
* Mark as `current` to indicate active progress point. Previous steps become clickable for navigation.
|
|
6
|
+
* Set `href` for page-based navigation or listen to `nys-step-click` for SPA routing.
|
|
7
|
+
*
|
|
8
|
+
* @summary Individual step for use within nys-stepper with navigation support.
|
|
9
|
+
* @element nys-step
|
|
10
|
+
*
|
|
11
|
+
* @fires nys-step-click - Fired when a navigable step is clicked. Detail: `{href, label}`. Cancelable.
|
|
12
|
+
*
|
|
13
|
+
* @example Step with navigation
|
|
14
|
+
* ```html
|
|
15
|
+
* <nys-step label="Personal Info" href="/step-1"></nys-step>
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export declare class NysStep extends LitElement {
|
|
19
|
+
static styles: import("lit").CSSResult;
|
|
20
|
+
/** Whether this step is currently being viewed. Set by parent stepper. */
|
|
21
|
+
selected: boolean;
|
|
22
|
+
/** Marks the furthest reached step. Steps before this are navigable. */
|
|
23
|
+
current: boolean;
|
|
24
|
+
/** Step label text displayed alongside the step number. */
|
|
25
|
+
label: string;
|
|
26
|
+
/** URL for page navigation when step is clicked. Optional for SPA routing. */
|
|
27
|
+
href: string;
|
|
28
|
+
/** Internal: Whether parent stepper's compact view is expanded. */
|
|
29
|
+
isCompactExpanded: boolean;
|
|
30
|
+
/** Custom click handler. Called before `nys-step-click` event. */
|
|
31
|
+
onClick?: (e: Event) => void;
|
|
32
|
+
/** Step number (1-indexed). Auto-assigned by parent stepper. */
|
|
33
|
+
stepNumber: number;
|
|
34
|
+
private _handleActivate;
|
|
35
|
+
private _handleKeydown;
|
|
36
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
37
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
import "./nys-step";
|
|
3
|
+
/**
|
|
4
|
+
* A multi-step progress indicator for forms or wizards. Manages `nys-step` children with selection and navigation.
|
|
5
|
+
*
|
|
6
|
+
* Add `nys-step` elements as children. Mark one step as `current` to indicate progress; previous steps become
|
|
7
|
+
* navigable. Compact view on mobile expands to show all steps. Use `actions` slot for navigation buttons.
|
|
8
|
+
*
|
|
9
|
+
* @summary Multi-step progress indicator with navigation and mobile-friendly compact view.
|
|
10
|
+
* @element nys-stepper
|
|
11
|
+
*
|
|
12
|
+
* @slot - Default slot for `nys-step` elements.
|
|
13
|
+
* @slot actions - Navigation buttons (e.g., Back, Continue). Must be wrapped in a `<div>`.
|
|
14
|
+
*
|
|
15
|
+
* @example Basic stepper
|
|
16
|
+
* ```html
|
|
17
|
+
* <nys-stepper label="Application Progress">
|
|
18
|
+
* <nys-step label="Personal Info" current></nys-step>
|
|
19
|
+
* <nys-step label="Contact Details"></nys-step>
|
|
20
|
+
* <nys-step label="Review"></nys-step>
|
|
21
|
+
* </nys-stepper>
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export declare class NysStepper extends LitElement {
|
|
25
|
+
static styles: import("lit").CSSResult;
|
|
26
|
+
/** Unique identifier. */
|
|
27
|
+
id: string;
|
|
28
|
+
/** Name attribute for form association. */
|
|
29
|
+
name: string;
|
|
30
|
+
/** Title displayed above the step counter. */
|
|
31
|
+
label: string;
|
|
32
|
+
/** Progress text (e.g., "Step 2 of 5"). Auto-updated based on selection. */
|
|
33
|
+
counterText: string;
|
|
34
|
+
/** Whether compact mobile view is expanded to show all steps. */
|
|
35
|
+
isCompactExpanded: boolean;
|
|
36
|
+
private _stepsNumbered;
|
|
37
|
+
constructor();
|
|
38
|
+
connectedCallback(): void;
|
|
39
|
+
disconnectedCallback(): void;
|
|
40
|
+
private _validateSteps;
|
|
41
|
+
private _validateButtonSlot;
|
|
42
|
+
private _onStepClick;
|
|
43
|
+
private _updateCounter;
|
|
44
|
+
willUpdate(): void;
|
|
45
|
+
private _toggleCompact;
|
|
46
|
+
private _handleCounterKeydown;
|
|
47
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
48
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -26,7 +26,8 @@ export declare class NysTable extends LitElement {
|
|
|
26
26
|
/******************** Functions ********************/
|
|
27
27
|
firstUpdated(): void;
|
|
28
28
|
_handleSlotChange(): void;
|
|
29
|
-
|
|
29
|
+
_normalizeTableDOM(table: HTMLTableElement): void;
|
|
30
|
+
willUpdate(): void;
|
|
30
31
|
_addSortIcons(table: HTMLTableElement): void;
|
|
31
32
|
_updateSortIcons(table: HTMLTableElement): void;
|
|
32
33
|
_onSortClick(columnIndex: number, table: HTMLTableElement): void;
|