@nysds/components 1.12.0 → 1.13.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.
- package/README.md +3 -1
- package/dist/.vscode/vscode.html-custom-data.json +71 -30
- package/dist/custom-elements.json +1524 -300
- package/dist/nysds.es.js +3237 -1540
- package/dist/nysds.es.js.map +1 -1
- package/dist/nysds.js +262 -158
- package/dist/nysds.js.map +1 -1
- package/dist/packages/nys-accordion/src/nys-accordion.d.ts +20 -3
- package/dist/packages/nys-accordion/src/nys-accordionitem.d.ts +20 -0
- package/dist/packages/nys-alert/src/nys-alert.d.ts +39 -1
- package/dist/packages/nys-avatar/src/nys-avatar.d.ts +25 -0
- package/dist/packages/nys-backtotop/src/nys-backtotop.d.ts +19 -0
- package/dist/packages/nys-badge/src/nys-badge.d.ts +20 -0
- package/dist/packages/nys-button/src/nys-button.d.ts +24 -0
- package/dist/packages/nys-checkbox/src/nys-checkbox.d.ts +33 -1
- package/dist/packages/nys-checkbox/src/nys-checkboxgroup.d.ts +29 -0
- package/dist/packages/nys-datepicker/src/index.d.ts +1 -0
- package/dist/packages/nys-datepicker/src/nys-datepicker.d.ts +116 -0
- package/dist/packages/nys-datepicker/src/nys-datepicker.figma.d.ts +1 -0
- package/dist/packages/nys-divider/src/nys-divider.d.ts +4 -0
- package/dist/packages/nys-errormessage/src/nys-errormessage.d.ts +9 -0
- package/dist/packages/nys-fileinput/src/nys-fileinput.d.ts +33 -0
- package/dist/packages/nys-fileinput/src/nys-fileitem.d.ts +4 -0
- package/dist/packages/nys-globalfooter/src/nys-globalfooter.d.ts +20 -0
- package/dist/packages/nys-globalheader/src/nys-global.logo.d.ts +2 -0
- package/dist/packages/nys-globalheader/src/nys-globalheader.d.ts +26 -5
- package/dist/packages/nys-icon/src/nys-icon.d.ts +11 -0
- package/dist/packages/nys-label/src/nys-label.d.ts +5 -0
- package/dist/packages/nys-modal/src/nys-modal.d.ts +24 -0
- package/dist/packages/nys-pagination/src/nys-pagination.d.ts +21 -0
- package/dist/packages/nys-radiobutton/src/nys-radiobutton.d.ts +27 -0
- package/dist/packages/nys-radiobutton/src/nys-radiogroup.d.ts +30 -1
- package/dist/packages/nys-select/src/nys-select.d.ts +34 -1
- package/dist/packages/nys-skipnav/src/nys-skipnav.d.ts +13 -0
- package/dist/packages/nys-table/src/index.d.ts +1 -0
- package/dist/packages/nys-table/src/nys-table.d.ts +38 -0
- package/dist/packages/nys-table/src/nys-table.figma.d.ts +1 -0
- package/dist/packages/nys-textarea/src/nys-textarea.d.ts +29 -1
- package/dist/packages/nys-textinput/src/nys-textinput.d.ts +30 -1
- package/dist/packages/nys-toggle/src/nys-toggle.d.ts +23 -0
- package/dist/packages/nys-tooltip/src/nys-tooltip.d.ts +28 -0
- package/dist/packages/nys-unavfooter/src/nys-unavfooter.d.ts +12 -0
- package/dist/packages/nys-unavheader/src/nys-unavheader.d.ts +20 -2
- package/dist/src/index.d.ts +2 -0
- package/package.json +12 -9
|
@@ -1,19 +1,36 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
2
|
import "./nys-accordionitem";
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* `<nys-accordion>` groups one or more `<nys-accordionitem>` elements.
|
|
5
|
+
*
|
|
6
|
+
* Features:
|
|
7
|
+
* - Optionally enforces single-expanded-item behavior via `singleSelect`.
|
|
8
|
+
* - Propagates shared visual `bordered` property to child items.
|
|
9
|
+
* - Generates a stable unique identifier if none is provided.
|
|
10
|
+
*
|
|
11
|
+
* @slot default - Place one or more `<nys-accordionitem>` components here.
|
|
12
|
+
*
|
|
13
|
+
* @fires nys-accordionitem-toggle - Fired when a child `<nys-accordionitem>` is toggled.
|
|
14
|
+
* Event detail includes `{ id: string, heading: string, expanded: boolean }`.
|
|
6
15
|
*/
|
|
7
16
|
export declare class NysAccordion extends LitElement {
|
|
8
17
|
static styles: import("lit").CSSResult;
|
|
9
18
|
id: string;
|
|
10
19
|
singleSelect: boolean;
|
|
11
20
|
bordered: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Lifecycle methods
|
|
23
|
+
* --------------------------------------------------------------------------
|
|
24
|
+
*/
|
|
12
25
|
constructor();
|
|
13
26
|
connectedCallback(): void;
|
|
14
27
|
updated(changedProperties: Map<string, any>): void;
|
|
28
|
+
/**
|
|
29
|
+
* Functions
|
|
30
|
+
* --------------------------------------------------------------------------
|
|
31
|
+
*/
|
|
15
32
|
private _generateUniqueId;
|
|
16
|
-
private
|
|
33
|
+
private _getAccordionItems;
|
|
17
34
|
private _onAccordionToggle;
|
|
18
35
|
private _applyBordered;
|
|
19
36
|
render(): import("lit-html").TemplateResult<1>;
|
|
@@ -1,14 +1,34 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
|
+
/**
|
|
3
|
+
* `<nys-accordionitem>` represents a single collapsible item inside a `<nys-accordion>`.
|
|
4
|
+
*
|
|
5
|
+
* @slot - Default slot for the content inside the accordion panel.
|
|
6
|
+
*
|
|
7
|
+
* @event nys-accordionitem-toggle - Fired when the item is expanded or collapsed.
|
|
8
|
+
* @type {CustomEvent<{id: string, heading: string, expanded: boolean}>}
|
|
9
|
+
*
|
|
10
|
+
* Features:
|
|
11
|
+
* - Click or keyboard (Enter/Space) toggles expansion.
|
|
12
|
+
* - Animates height changes when expanding/collapsing.
|
|
13
|
+
*/
|
|
2
14
|
export declare class NysAccordionItem extends LitElement {
|
|
3
15
|
static styles: import("lit").CSSResult;
|
|
4
16
|
id: string;
|
|
5
17
|
heading: string;
|
|
6
18
|
expanded: boolean;
|
|
7
19
|
bordered: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Lifecycle methods
|
|
22
|
+
* --------------------------------------------------------------------------
|
|
23
|
+
*/
|
|
8
24
|
constructor();
|
|
9
25
|
connectedCallback(): void;
|
|
10
26
|
firstUpdated(): void;
|
|
11
27
|
updated(changedProperties: Map<string, any>): void;
|
|
28
|
+
/**
|
|
29
|
+
* Functions
|
|
30
|
+
* --------------------------------------------------------------------------
|
|
31
|
+
*/
|
|
12
32
|
private _generateUniqueId;
|
|
13
33
|
private _dispatchEvent;
|
|
14
34
|
private _handleExpand;
|
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
|
+
/**
|
|
3
|
+
* `<nys-alert>` renders an informational, success, warning, or error alert.
|
|
4
|
+
*
|
|
5
|
+
* @slot - Default slot for additional alert content.
|
|
6
|
+
*
|
|
7
|
+
* @event nys-close - Fired when alert is dismissed (manual or timeout).
|
|
8
|
+
* @type {CustomEvent<{id: string, type: string, label: string}>}
|
|
9
|
+
*
|
|
10
|
+
* Features:
|
|
11
|
+
* - Accessible ARIA roles and live-region announcements.
|
|
12
|
+
* - Auto-close via `duration`.
|
|
13
|
+
* - Handles default slot content or fallback `text`.
|
|
14
|
+
* - Optional dismiss button.
|
|
15
|
+
*/
|
|
2
16
|
export declare class NysAlert extends LitElement {
|
|
3
17
|
static styles: import("lit").CSSResult;
|
|
4
18
|
id: string;
|
|
@@ -14,18 +28,42 @@ export declare class NysAlert extends LitElement {
|
|
|
14
28
|
type: "base" | "info" | "success" | "warning" | "danger" | "emergency";
|
|
15
29
|
private _alertClosed;
|
|
16
30
|
private _slotHasContent;
|
|
31
|
+
/**
|
|
32
|
+
* Returns ARIA role and label based on alert type.
|
|
33
|
+
* - 'alert' => assertive live region (implied)
|
|
34
|
+
* - 'status' => polite live region
|
|
35
|
+
* - 'region' => generic, requires aria-label
|
|
36
|
+
*/
|
|
17
37
|
get ariaAttributes(): {
|
|
18
38
|
role: "alert" | "status" | "region";
|
|
19
39
|
ariaLabel: string;
|
|
20
40
|
};
|
|
41
|
+
/**
|
|
42
|
+
* Returns live-region type for screen readers if applicable.
|
|
43
|
+
* - 'polite' for status role
|
|
44
|
+
* - undefined for alert (since it's implicitly assertive) or region
|
|
45
|
+
*/
|
|
46
|
+
get liveRegion(): "polite" | undefined;
|
|
47
|
+
/**
|
|
48
|
+
* Lifecycle methods
|
|
49
|
+
* --------------------------------------------------------------------------
|
|
50
|
+
*/
|
|
21
51
|
private _timeoutId;
|
|
22
52
|
connectedCallback(): void;
|
|
23
53
|
disconnectedCallback(): void;
|
|
24
54
|
firstUpdated(): void;
|
|
55
|
+
/**
|
|
56
|
+
* Functions
|
|
57
|
+
* --------------------------------------------------------------------------
|
|
58
|
+
*/
|
|
25
59
|
private _generateUniqueId;
|
|
26
|
-
private
|
|
60
|
+
private _resolveIconName;
|
|
27
61
|
private _checkAltNaming;
|
|
28
62
|
private _closeAlert;
|
|
63
|
+
/**
|
|
64
|
+
* Checks whether the default slot has content.
|
|
65
|
+
* Updates `_slotHasContent` accordingly.
|
|
66
|
+
*/
|
|
29
67
|
private _checkSlotContent;
|
|
30
68
|
render(): import("lit-html").TemplateResult<1>;
|
|
31
69
|
}
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
|
+
/**
|
|
3
|
+
* `<nys-avatar>` displays a user avatar as an image, initials, or icon.
|
|
4
|
+
*
|
|
5
|
+
* @slot - Default slot for custom icon content. Fallback icon is used if slot is empty.
|
|
6
|
+
*
|
|
7
|
+
* Features:
|
|
8
|
+
* - Computes foreground color for sufficient contrast based on background.
|
|
9
|
+
* - Supports interactive avatars with button role.
|
|
10
|
+
* - Fallback to icon when image or initials are missing.
|
|
11
|
+
* - Lazy loading for performance optimization.
|
|
12
|
+
*/
|
|
2
13
|
export declare class NysAvatar extends LitElement {
|
|
3
14
|
static styles: import("lit").CSSResult;
|
|
4
15
|
id: string;
|
|
@@ -11,8 +22,22 @@ export declare class NysAvatar extends LitElement {
|
|
|
11
22
|
disabled: boolean;
|
|
12
23
|
lazy: boolean;
|
|
13
24
|
private _slotHasContent;
|
|
25
|
+
/**
|
|
26
|
+
* Lifecycle methods
|
|
27
|
+
* --------------------------------------------------------------------------
|
|
28
|
+
*/
|
|
14
29
|
connectedCallback(): void;
|
|
15
30
|
private _handleSlotChange;
|
|
31
|
+
/**
|
|
32
|
+
* Functions
|
|
33
|
+
* --------------------------------------------------------------------------
|
|
34
|
+
*/
|
|
35
|
+
/**
|
|
36
|
+
* Computes the appropriate foreground color (icon or initials)
|
|
37
|
+
* based on the avatar's background color for sufficient contrast.
|
|
38
|
+
*
|
|
39
|
+
* @returns CSS color string for foreground
|
|
40
|
+
*/
|
|
16
41
|
private getContrastForeground;
|
|
17
42
|
render(): import("lit-html").TemplateResult<1>;
|
|
18
43
|
}
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
|
+
/**
|
|
3
|
+
* `<nys-backtotop>` renders a button that scrolls the page to the top.
|
|
4
|
+
*
|
|
5
|
+
* Features:
|
|
6
|
+
* - Automatically appears after scrolling past 1.5 viewport heights
|
|
7
|
+
* if the page is at least 4 screens tall.
|
|
8
|
+
* - Adapts to mobile screens (renders as a circle button when narrow).
|
|
9
|
+
* - Can be explicitly shown with the `visible` attribute.
|
|
10
|
+
*
|
|
11
|
+
* @fires nys-click - Fired when the button is clicked (scrolls page to top).
|
|
12
|
+
*/
|
|
2
13
|
export declare class NysBacktotop extends LitElement {
|
|
3
14
|
static styles: import("lit").CSSResult;
|
|
4
15
|
position: string;
|
|
@@ -6,9 +17,17 @@ export declare class NysBacktotop extends LitElement {
|
|
|
6
17
|
private isMobile;
|
|
7
18
|
private forceVisible;
|
|
8
19
|
private mediaQuery;
|
|
20
|
+
/**
|
|
21
|
+
* Lifecycle methods
|
|
22
|
+
* --------------------------------------------------------------------------
|
|
23
|
+
*/
|
|
9
24
|
constructor();
|
|
10
25
|
connectedCallback(): void;
|
|
11
26
|
disconnectedCallback(): void;
|
|
27
|
+
/**
|
|
28
|
+
* Functions
|
|
29
|
+
* --------------------------------------------------------------------------
|
|
30
|
+
*/
|
|
12
31
|
private _handleScroll;
|
|
13
32
|
private _scrollToTop;
|
|
14
33
|
private _handleResize;
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
|
+
/**
|
|
3
|
+
* `<nys-badge>` displays a badge with optional prefix/suffix icons and labels.
|
|
4
|
+
*
|
|
5
|
+
* Features:
|
|
6
|
+
* - Conveys an intent (`neutral`, `error`, `success`, `warning`) which affects default icons and styling.
|
|
7
|
+
* - Supports custom prefix and suffix icons.
|
|
8
|
+
*/
|
|
2
9
|
export declare class NysBadge extends LitElement {
|
|
3
10
|
static styles: import("lit").CSSResult;
|
|
4
11
|
id: string;
|
|
@@ -13,8 +20,21 @@ export declare class NysBadge extends LitElement {
|
|
|
13
20
|
private _suffixIcon;
|
|
14
21
|
get suffixIcon(): string | boolean;
|
|
15
22
|
set suffixIcon(value: string | boolean);
|
|
23
|
+
/**
|
|
24
|
+
* Lifecycle methods
|
|
25
|
+
* --------------------------------------------------------------------------
|
|
26
|
+
*/
|
|
16
27
|
connectedCallback(): void;
|
|
28
|
+
/**
|
|
29
|
+
* Functions
|
|
30
|
+
* --------------------------------------------------------------------------
|
|
31
|
+
*/
|
|
17
32
|
private static readonly DEFAULT_ICONS;
|
|
33
|
+
/**
|
|
34
|
+
* Resolves which icon should be rendered.
|
|
35
|
+
* @param icon The icon property value (string or boolean)
|
|
36
|
+
* @returns Icon name or null if no icon should be rendered
|
|
37
|
+
*/
|
|
18
38
|
private resolveIcon;
|
|
19
39
|
render(): import("lit-html").TemplateResult<1>;
|
|
20
40
|
}
|
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
|
+
/**
|
|
3
|
+
* `<nys-button>` is a versatile button component supporting:
|
|
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`)
|
|
9
|
+
*
|
|
10
|
+
* @fires nys-click - Fired on button click
|
|
11
|
+
* @fires nys-focus - Fired when button receives focus
|
|
12
|
+
* @fires nys-blur - Fired when button loses focus
|
|
13
|
+
*/
|
|
2
14
|
export declare class NysButton extends LitElement {
|
|
3
15
|
static styles: import("lit").CSSResult;
|
|
4
16
|
id: string;
|
|
@@ -24,11 +36,23 @@ export declare class NysButton extends LitElement {
|
|
|
24
36
|
target: "_self" | "_blank" | "_parent" | "_top" | "framename";
|
|
25
37
|
getButtonElement(): Promise<HTMLElement | null>;
|
|
26
38
|
private _internals;
|
|
39
|
+
/**
|
|
40
|
+
* Lifecycle methods
|
|
41
|
+
* --------------------------------------------------------------------------
|
|
42
|
+
*/
|
|
27
43
|
static formAssociated: boolean;
|
|
28
44
|
constructor();
|
|
29
45
|
connectedCallback(): void;
|
|
46
|
+
/**
|
|
47
|
+
* Functions
|
|
48
|
+
* --------------------------------------------------------------------------
|
|
49
|
+
*/
|
|
30
50
|
private _generateUniqueId;
|
|
31
51
|
private _manageFormAction;
|
|
52
|
+
/**
|
|
53
|
+
* Event Handlers
|
|
54
|
+
* --------------------------------------------------------------------------
|
|
55
|
+
*/
|
|
32
56
|
private _handleFocus;
|
|
33
57
|
private _handleBlur;
|
|
34
58
|
private _handleClick;
|
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
2
|
import "./nys-checkboxgroup";
|
|
3
|
+
/**
|
|
4
|
+
* `<nys-checkbox>` is an accessible, form-associated checkbox component.
|
|
5
|
+
* Can be used standalone or within a `<nys-checkboxgroup>`.
|
|
6
|
+
*
|
|
7
|
+
* Features:
|
|
8
|
+
* - Supports labels, descriptions, and tooltips
|
|
9
|
+
* - Displays error messages with `showError` and `errorMessage`
|
|
10
|
+
* - Keyboard interaction with spacebar toggle
|
|
11
|
+
* - Form integration via ElementInternals (`checked` value submitted)
|
|
12
|
+
*
|
|
13
|
+
* @fires nys-change - Fired when checkbox value changes
|
|
14
|
+
* @fires nys-focus - Fired on focus
|
|
15
|
+
* @fires nys-blur - Fired on blur
|
|
16
|
+
*
|
|
17
|
+
* @slot description - Slot to provide a custom description element
|
|
18
|
+
*/
|
|
3
19
|
export declare class NysCheckbox extends LitElement {
|
|
4
20
|
static styles: import("lit").CSSResult;
|
|
5
21
|
checked: boolean;
|
|
@@ -20,19 +36,35 @@ export declare class NysCheckbox extends LitElement {
|
|
|
20
36
|
size: "sm" | "md";
|
|
21
37
|
getInputElement(): Promise<HTMLInputElement | null>;
|
|
22
38
|
private _internals;
|
|
39
|
+
/**
|
|
40
|
+
* Lifecycle methods
|
|
41
|
+
* --------------------------------------------------------------------------
|
|
42
|
+
*/
|
|
23
43
|
static formAssociated: boolean;
|
|
24
44
|
constructor();
|
|
25
45
|
connectedCallback(): void;
|
|
26
46
|
disconnectedCallback(): void;
|
|
27
47
|
firstUpdated(): void;
|
|
28
|
-
|
|
48
|
+
/**
|
|
49
|
+
* Form Integration
|
|
50
|
+
* --------------------------------------------------------------------------
|
|
51
|
+
*/
|
|
29
52
|
private _setValue;
|
|
30
53
|
private _manageRequire;
|
|
31
54
|
private _setValidityMessage;
|
|
32
55
|
private _validate;
|
|
56
|
+
formResetCallback(): void;
|
|
57
|
+
/**
|
|
58
|
+
* Functions
|
|
59
|
+
* --------------------------------------------------------------------------
|
|
60
|
+
*/
|
|
33
61
|
checkValidity(): boolean;
|
|
34
62
|
private _handleInvalid;
|
|
35
63
|
private _manageLabelClick;
|
|
64
|
+
/**
|
|
65
|
+
* Event Handlers
|
|
66
|
+
* --------------------------------------------------------------------------
|
|
67
|
+
*/
|
|
36
68
|
private _emitChangeEvent;
|
|
37
69
|
private _handleChange;
|
|
38
70
|
private _handleFocus;
|
|
@@ -1,4 +1,21 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
|
+
/**
|
|
3
|
+
* `<nys-checkboxgroup>` is a form-associated container for multiple `<nys-checkbox>` components.
|
|
4
|
+
* Handles grouping, validation, required constraints, form submission, and accessibility.
|
|
5
|
+
*
|
|
6
|
+
* Features:
|
|
7
|
+
* - Manages multiple checkboxes as a single form field
|
|
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
|
|
11
|
+
*
|
|
12
|
+
* @slot default - Slot for child `<nys-checkbox>` elements
|
|
13
|
+
* @slot description - Slot for custom description content
|
|
14
|
+
*
|
|
15
|
+
* @fires nys-change - Fired when any child checkbox changes
|
|
16
|
+
* @fires nys-focus - Fired when any child checkbox gains focus
|
|
17
|
+
* @fires nys-blur - Fired when any child checkbox loses focus
|
|
18
|
+
*/
|
|
2
19
|
export declare class NysCheckboxgroup extends LitElement {
|
|
3
20
|
static styles: import("lit").CSSResult;
|
|
4
21
|
id: string;
|
|
@@ -16,12 +33,20 @@ export declare class NysCheckboxgroup extends LitElement {
|
|
|
16
33
|
size: "sm" | "md";
|
|
17
34
|
private _slottedDescriptionText;
|
|
18
35
|
private _internals;
|
|
36
|
+
/**
|
|
37
|
+
* Lifecycle methods
|
|
38
|
+
* --------------------------------------------------------------------------
|
|
39
|
+
*/
|
|
19
40
|
static formAssociated: boolean;
|
|
20
41
|
constructor();
|
|
21
42
|
connectedCallback(): void;
|
|
22
43
|
disconnectedCallback(): void;
|
|
23
44
|
firstUpdated(): void;
|
|
24
45
|
updated(changedProperties: Map<string | symbol, unknown>): void;
|
|
46
|
+
/**
|
|
47
|
+
* Functions
|
|
48
|
+
* --------------------------------------------------------------------------
|
|
49
|
+
*/
|
|
25
50
|
private _setGroupExist;
|
|
26
51
|
private _setupCheckboxRequired;
|
|
27
52
|
private _manageRequire;
|
|
@@ -32,6 +57,10 @@ export declare class NysCheckboxgroup extends LitElement {
|
|
|
32
57
|
private _updateCheckboxForm;
|
|
33
58
|
private _getSlotDescriptionForAria;
|
|
34
59
|
private _handleInvalid;
|
|
60
|
+
/**
|
|
61
|
+
* Event Handlers
|
|
62
|
+
* --------------------------------------------------------------------------
|
|
63
|
+
*/
|
|
35
64
|
private _handleCheckboxChange;
|
|
36
65
|
render(): import("lit-html").TemplateResult<1>;
|
|
37
66
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./nys-datepicker";
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
/**
|
|
3
|
+
* `<nys-datepicker>` is a form-associated, accessible date picker component.
|
|
4
|
+
* Optionally wraps a `<wc-datepicker>` for custom calendar UI.
|
|
5
|
+
*
|
|
6
|
+
* Events:
|
|
7
|
+
* @fires nys-blur - Dispatched when input or calendar loses focus
|
|
8
|
+
* @fires nys-input - Dispatched when user selects or types a valid date
|
|
9
|
+
*
|
|
10
|
+
* Notes:
|
|
11
|
+
* - Uses native date input on Safari or mobile devices (custom calendar removed for these scenarios)
|
|
12
|
+
*/
|
|
13
|
+
export declare class NysDatepicker extends LitElement {
|
|
14
|
+
static styles: import("lit").CSSResult;
|
|
15
|
+
id: string;
|
|
16
|
+
name: string;
|
|
17
|
+
width: "md" | "lg" | "full";
|
|
18
|
+
hideTodayButton: boolean;
|
|
19
|
+
hideClearButton: boolean;
|
|
20
|
+
disabled: boolean;
|
|
21
|
+
required: boolean;
|
|
22
|
+
optional: boolean;
|
|
23
|
+
showError: boolean;
|
|
24
|
+
errorMessage: string;
|
|
25
|
+
form: string | null;
|
|
26
|
+
tooltip: string;
|
|
27
|
+
type: string;
|
|
28
|
+
label: string;
|
|
29
|
+
description: string;
|
|
30
|
+
startDate: string;
|
|
31
|
+
inverted: boolean;
|
|
32
|
+
value: string | Date | undefined;
|
|
33
|
+
private _hasUserInteracted;
|
|
34
|
+
private _internals;
|
|
35
|
+
/**
|
|
36
|
+
* Lifecycle methods
|
|
37
|
+
* --------------------------------------------------------------------------
|
|
38
|
+
*/
|
|
39
|
+
static formAssociated: boolean;
|
|
40
|
+
constructor();
|
|
41
|
+
connectedCallback(): void;
|
|
42
|
+
disconnectedCallback(): void;
|
|
43
|
+
firstUpdated(): Promise<void>;
|
|
44
|
+
private _whenWcDatepickerReady;
|
|
45
|
+
/**
|
|
46
|
+
* Form Integration
|
|
47
|
+
* --------------------------------------------------------------------------
|
|
48
|
+
*/
|
|
49
|
+
/**
|
|
50
|
+
* Form helper methods:
|
|
51
|
+
* - _setValue: set internal value and trigger validation
|
|
52
|
+
* - _manageRequire: handle required state
|
|
53
|
+
* - _validate: actively validate and show errors
|
|
54
|
+
* - checkValidity: passive boolean check without UI
|
|
55
|
+
* - _setValidityMessage: sync validation message with UI and internals
|
|
56
|
+
* - _handleInvalid: handle form invalid event and focus first invalid field
|
|
57
|
+
*/
|
|
58
|
+
private _setValue;
|
|
59
|
+
private _manageRequire;
|
|
60
|
+
/**
|
|
61
|
+
* Actively validates the component:
|
|
62
|
+
* - Updates internal validity state
|
|
63
|
+
* - Updates UI (e.g. showError)
|
|
64
|
+
* - Called on blur/change or form submission
|
|
65
|
+
*/
|
|
66
|
+
private _validate;
|
|
67
|
+
/**
|
|
68
|
+
* Passive check of validity:
|
|
69
|
+
* - Returns true/false
|
|
70
|
+
* - Does NOT update UI or show errors
|
|
71
|
+
* - Used in form submission checks
|
|
72
|
+
*/
|
|
73
|
+
checkValidity(): boolean;
|
|
74
|
+
private _setValidityMessage;
|
|
75
|
+
private _handleInvalid;
|
|
76
|
+
/**
|
|
77
|
+
* Functions
|
|
78
|
+
* --------------------------------------------------------------------------
|
|
79
|
+
*/
|
|
80
|
+
/**
|
|
81
|
+
* Replaces the default wc-datepicker month navigation buttons
|
|
82
|
+
* with NYS icon components for previous and next month.
|
|
83
|
+
*/
|
|
84
|
+
private _replaceButtonSVG;
|
|
85
|
+
private _addMonthDropdownIcon;
|
|
86
|
+
private _parseLocalDate;
|
|
87
|
+
/**
|
|
88
|
+
* Event Handlers
|
|
89
|
+
* --------------------------------------------------------------------------
|
|
90
|
+
*/
|
|
91
|
+
private _handleInputKeydown;
|
|
92
|
+
private _handleBlur;
|
|
93
|
+
private _onDocumentClick;
|
|
94
|
+
private _toggleDatepicker;
|
|
95
|
+
private _openDatepicker;
|
|
96
|
+
private _handleDateChange;
|
|
97
|
+
private _handleTodayClick;
|
|
98
|
+
private _handleClearClick;
|
|
99
|
+
private _handleInputChange;
|
|
100
|
+
private _getValidDateFromInput;
|
|
101
|
+
private _isSafari;
|
|
102
|
+
/**
|
|
103
|
+
* Determines whether the current device uses a coarse pointer.
|
|
104
|
+
* A coarse pointer usually means touch-based input where precise pointing
|
|
105
|
+
* is not expected, such as fingers on phones and most tablets.
|
|
106
|
+
*
|
|
107
|
+
* Note: This is not a guarantee of a mobile device.
|
|
108
|
+
* Some non-mobile devices may also report a coarse pointer,
|
|
109
|
+
* and some mobile devices may not.
|
|
110
|
+
*
|
|
111
|
+
* @returns `true` if the device reports a coarse pointer, otherwise `false`.
|
|
112
|
+
*/
|
|
113
|
+
private _isMobile;
|
|
114
|
+
private _shouldUseNativeDatepicker;
|
|
115
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
116
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
|
+
/**
|
|
3
|
+
* `<nys-divider>` renders a horizontal rule `<hr>` element with optional styling.
|
|
4
|
+
* Can be inverted for dark backgrounds.
|
|
5
|
+
*/
|
|
2
6
|
export declare class NysDivider extends LitElement {
|
|
3
7
|
static styles: import("lit").CSSResult;
|
|
4
8
|
inverted: boolean;
|
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
|
+
/**
|
|
3
|
+
* THIS IS A PRIVATE COMPONENT!
|
|
4
|
+
* `<nys-errormessage>` displays an error message for form elements.
|
|
5
|
+
* Can optionally show a divider and supports native form validation messages.
|
|
6
|
+
*/
|
|
2
7
|
export declare class NysErrorMessage extends LitElement {
|
|
3
8
|
static styles: import("lit").CSSResult;
|
|
4
9
|
showError: boolean;
|
|
5
10
|
errorMessage: string;
|
|
6
11
|
showDivider: boolean;
|
|
7
12
|
private _internals;
|
|
13
|
+
/**
|
|
14
|
+
* Lifecycle methods
|
|
15
|
+
* --------------------------------------------------------------------------
|
|
16
|
+
*/
|
|
8
17
|
static formAssociated: boolean;
|
|
9
18
|
constructor();
|
|
10
19
|
render(): import("lit-html").TemplateResult<1>;
|
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
2
|
import "./nys-fileitem";
|
|
3
|
+
/**
|
|
4
|
+
* `<nys-fileinput>` provides accessible file selection with optional
|
|
5
|
+
* drag-and-drop support, progress tracking, validation, and form submission.
|
|
6
|
+
*
|
|
7
|
+
* Features:
|
|
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
|
|
13
|
+
*
|
|
14
|
+
* @slot description - Custom description content under the label
|
|
15
|
+
*
|
|
16
|
+
* @fires nys-change - Fired when files are added or removed
|
|
17
|
+
*
|
|
18
|
+
* @returns {boolean} checkValidity - Returns validity state for form validation
|
|
19
|
+
*/
|
|
3
20
|
export declare class NysFileinput extends LitElement {
|
|
4
21
|
static styles: import("lit").CSSResult;
|
|
5
22
|
id: string;
|
|
@@ -25,23 +42,39 @@ export declare class NysFileinput extends LitElement {
|
|
|
25
42
|
private get _buttonAriaDescription();
|
|
26
43
|
private get _innerNysButton();
|
|
27
44
|
private _internals;
|
|
45
|
+
/**
|
|
46
|
+
* Lifecycle methods
|
|
47
|
+
* --------------------------------------------------------------------------
|
|
48
|
+
*/
|
|
28
49
|
static formAssociated: boolean;
|
|
29
50
|
constructor();
|
|
30
51
|
connectedCallback(): void;
|
|
31
52
|
disconnectedCallback(): void;
|
|
32
53
|
firstUpdated(): void;
|
|
54
|
+
/**
|
|
55
|
+
* Form Integration
|
|
56
|
+
* --------------------------------------------------------------------------
|
|
57
|
+
*/
|
|
33
58
|
private _setValue;
|
|
34
59
|
private _manageRequire;
|
|
35
60
|
private _setValidityMessage;
|
|
36
61
|
private _validate;
|
|
37
62
|
checkValidity(): boolean;
|
|
38
63
|
private _handleInvalid;
|
|
64
|
+
/**
|
|
65
|
+
* Functions
|
|
66
|
+
* --------------------------------------------------------------------------
|
|
67
|
+
*/
|
|
39
68
|
private _saveSelectedFiles;
|
|
40
69
|
private _processFile;
|
|
41
70
|
private _dispatchChangeEvent;
|
|
42
71
|
private _openFileDialog;
|
|
43
72
|
private _handlePostFileSelectionFocus;
|
|
44
73
|
private _focusFirstFileItemIfSingleMode;
|
|
74
|
+
/**
|
|
75
|
+
* Event Handlers
|
|
76
|
+
* --------------------------------------------------------------------------
|
|
77
|
+
*/
|
|
45
78
|
private _handleFileChange;
|
|
46
79
|
private _handleFileRemove;
|
|
47
80
|
private _onDragOver;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
|
+
/**
|
|
3
|
+
* `<nys-fileitem>` displays an individual file in a file input component.
|
|
4
|
+
* It shows the file name, upload status, progress bar, and error messages.
|
|
5
|
+
*/
|
|
2
6
|
export declare class NysFileItem extends LitElement {
|
|
3
7
|
static styles: import("lit").CSSResult;
|
|
4
8
|
filename: string;
|
|
@@ -1,10 +1,30 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
|
+
/**
|
|
3
|
+
* `<nys-globalfooter>` renders a New York State–style global footer.
|
|
4
|
+
*
|
|
5
|
+
* Displays an agency name with an optional homepage link and supports
|
|
6
|
+
* structured footer content via slots.
|
|
7
|
+
*
|
|
8
|
+
* @slot default - Footer content such as headings, links, or groups
|
|
9
|
+
*
|
|
10
|
+
* Layout behavior:
|
|
11
|
+
* - Multiple `<h4>` elements trigger a multi-column layout
|
|
12
|
+
* - Single group content renders in a compact layout
|
|
13
|
+
*/
|
|
2
14
|
export declare class NysGlobalFooter extends LitElement {
|
|
3
15
|
static styles: import("lit").CSSResult;
|
|
4
16
|
agencyName: string;
|
|
5
17
|
homepageLink: string;
|
|
6
18
|
private slotHasContent;
|
|
19
|
+
/**
|
|
20
|
+
* Lifecycle Methods
|
|
21
|
+
* --------------------------------------------------------------------------
|
|
22
|
+
*/
|
|
7
23
|
firstUpdated(): void;
|
|
24
|
+
/**
|
|
25
|
+
* Functions
|
|
26
|
+
* --------------------------------------------------------------------------
|
|
27
|
+
*/
|
|
8
28
|
private _handleSlotChange;
|
|
9
29
|
render(): import("lit-html").TemplateResult<1>;
|
|
10
30
|
}
|