@nysds/nys-select 1.19.0 → 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.
@@ -0,0 +1,116 @@
1
+ import { LitElement } from "lit";
2
+ /**
3
+ * A dropdown for selecting a single option from a list. Supports native `<option>` and `<optgroup>` elements.
4
+ * Form-associated with validation via ElementInternals.
5
+ *
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.
8
+ *
9
+ * @summary Dropdown select for choosing one option from a list.
10
+ * @element nys-select
11
+ *
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
+ * ```
37
+ */
38
+ export declare class NysSelect extends LitElement {
39
+ static styles: import("lit").CSSResult;
40
+ static shadowRootOptions: {
41
+ delegatesFocus: boolean;
42
+ clonable?: boolean;
43
+ customElementRegistry?: CustomElementRegistry;
44
+ mode: ShadowRootMode;
45
+ serializable?: boolean;
46
+ slotAssignment?: SlotAssignmentMode;
47
+ };
48
+ /** Unique identifier. Auto-generated if not provided. */
49
+ id: string;
50
+ /** Name for form submission. */
51
+ name: string;
52
+ /** Visible label text. Required for accessibility. */
53
+ label: string;
54
+ /** Helper text below label. Use slot for custom HTML. */
55
+ description: string;
56
+ /** Currently selected option value. */
57
+ value: string;
58
+ /** Prevents interaction. */
59
+ disabled: boolean;
60
+ /** Marks as required. Shows "Required" flag and validates on blur. */
61
+ required: boolean;
62
+ /** Shows "Optional" flag. Use when most fields are required. */
63
+ optional: boolean;
64
+ /** Tooltip text shown on hover/focus of info icon. */
65
+ tooltip: string;
66
+ /** Form `id` to associate with when select is outside form element. */
67
+ form: string | null;
68
+ /** Adjusts colors for dark backgrounds. */
69
+ inverted: boolean;
70
+ /** Shows error message when true. Set by validation or manually. */
71
+ showError: boolean;
72
+ /** Error message text. Shown only when `showError` is true. */
73
+ errorMessage: string;
74
+ /**
75
+ * Select width: `sm` (88px), `md` (200px), `lg` (384px), `full` (100%, default).
76
+ * @default "full"
77
+ */
78
+ width: "sm" | "md" | "lg" | "full";
79
+ private _originalErrorMessage;
80
+ private _hasUserInteracted;
81
+ private _internals;
82
+ /**
83
+ * Lifecycle methods
84
+ * --------------------------------------------------------------------------
85
+ */
86
+ static formAssociated: boolean;
87
+ constructor();
88
+ connectedCallback(): void;
89
+ disconnectedCallback(): void;
90
+ firstUpdated(): void;
91
+ private _handleSlotChange;
92
+ /**
93
+ * Form Integration
94
+ * --------------------------------------------------------------------------
95
+ */
96
+ private _setValue;
97
+ private _manageRequire;
98
+ private _setValidityMessage;
99
+ private _validate;
100
+ formResetCallback(): void;
101
+ /**
102
+ * Functions
103
+ * --------------------------------------------------------------------------
104
+ */
105
+ checkValidity(): boolean;
106
+ private _handleInvalid;
107
+ /**
108
+ * Event Handlers
109
+ * --------------------------------------------------------------------------
110
+ */
111
+ private _handleChange;
112
+ private _handleFocus;
113
+ private _handleBlur;
114
+ updated(changedProperties: Map<string, unknown>): void;
115
+ render(): import("lit-html").TemplateResult<1>;
116
+ }
@@ -6,7 +6,7 @@ import { ifDefined as b } from "lit/directives/if-defined.js";
6
6
  * █ █ █ █▄▄▄█ ▀▀▀▄▄ █ █ ▀▀▀▄▄
7
7
  * █ ▀█ █ █▄▄▄█ █▄▄▀ █▄▄▄█
8
8
  *
9
- * Select Component v1.19.0
9
+ * Select Component v1.19.2
10
10
  * Part of the New York State Design System
11
11
  * Repository: https://github.com/its-hcd/nysds
12
12
  * License: MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nysds/nys-select",
3
- "version": "1.19.0",
3
+ "version": "1.19.2",
4
4
  "description": "The Select component from the NYS Design System.",
5
5
  "module": "dist/nys-select.js",
6
6
  "exports": {
@@ -22,9 +22,9 @@
22
22
  "lit-analyze": "lit-analyzer '**/*.ts'"
23
23
  },
24
24
  "dependencies": {
25
- "@nysds/nys-icon": "^1.19.0",
26
- "@nysds/nys-label": "^1.19.0",
27
- "@nysds/nys-errormessage": "^1.19.0"
25
+ "@nysds/nys-icon": "^1.19.2",
26
+ "@nysds/nys-label": "^1.19.2",
27
+ "@nysds/nys-errormessage": "^1.19.2"
28
28
  },
29
29
  "devDependencies": {
30
30
  "lit": "^3.3.1",
@@ -42,5 +42,6 @@
42
42
  "forms"
43
43
  ],
44
44
  "author": "New York State Design System Team",
45
- "license": "MIT"
45
+ "license": "MIT",
46
+ "sideEffects": true
46
47
  }