@nysds/components 1.22.0 → 1.22.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.
@@ -46,6 +46,32 @@ type Position = "bottom-start" | "bottom-end" | "top-start" | "top-end";
46
46
  * </nys-dropdownmenu>
47
47
  * </div>
48
48
  * ```
49
+ *
50
+ * @example Prefix & Suffix Icon
51
+ * ```html
52
+ * <div>
53
+ * <nys-button id="my-trigger-id" label="Open Menu"></nys-button>
54
+ * <nys-dropdownmenu id="my-dropdownmenu" for="my-trigger-id">
55
+ * <nys-dropdownmenuitem label="Profile" href="/profile" prefixIcon="account_circle"></nys-dropdownmenuitem>
56
+ * <nys-dropdownmenuitem label="Repositories & Github Pages" href="/repos" prefixIcon="drive_folder_upload" suffixIcon="open_in_new"></nys-dropdownmenuitem>
57
+ * <nys-dropdownmenuitem label="Organizations" href="/organizations" prefixIcon="account_balance_filled" suffixIcon="chevron_right"></nys-dropdownmenuitem>
58
+ * <nys-dropdownmenuitem label="Sign out" href="/logout" suffixIcon="lock_filled"></nys-dropdownmenuitem>
59
+ * </nys-dropdownmenu>
60
+ * </div>
61
+ * ```
62
+ *
63
+ * @render Prefix & Suffix Icon
64
+ * ```html
65
+ * <div style="margin: 200px; display: flex; justify-content: center; align-items: center;">
66
+ * <nys-button id="my-trigger-id" label="Open Menu"></nys-button>
67
+ * <nys-dropdownmenu id="my-dropdownmenu" for="my-trigger-id">
68
+ * <nys-dropdownmenuitem label="Profile" href="/profile" prefixIcon="account_circle"></nys-dropdownmenuitem>
69
+ * <nys-dropdownmenuitem label="Repositories & Github Pages" href="/repos" prefixIcon="drive_folder_upload" suffixIcon="open_in_new"></nys-dropdownmenuitem>
70
+ * <nys-dropdownmenuitem label="Organizations" href="/organizations" prefixIcon="account_balance_filled" suffixIcon="chevron_right"></nys-dropdownmenuitem>
71
+ * <nys-dropdownmenuitem label="Sign out" href="/logout" suffixIcon="lock_filled"></nys-dropdownmenuitem>
72
+ * </nys-dropdownmenu>
73
+ * </div>
74
+ * ```
49
75
  */
50
76
  export declare class NysDropdownMenu extends NysElement {
51
77
  static styles: import("lit").CSSResult;
@@ -29,13 +29,23 @@ export declare class NysDropdownMenuItem extends NysElement {
29
29
  serializable?: boolean;
30
30
  slotAssignment?: SlotAssignmentMode;
31
31
  };
32
+ /** Text shown in the item. Also the accessible name and the `nys-click` detail label. */
32
33
  label: string;
34
+ /** Link URL. Renders a link when set, a button when empty. */
33
35
  href: string;
36
+ /** Disables the item. No `nys-click` event and no link navigation. */
34
37
  disabled: boolean;
38
+ /** Where the link opens (e.g. `_self`, `_blank`). Only used with `href`. */
35
39
  target: string;
40
+ /** Icon name shown before the label. */
36
41
  prefixIcon: string;
37
- divider: string;
42
+ /** Icon name shown after the label. */
43
+ suffixIcon: string;
44
+ /** Divider setting for the item.
45
+ * Update: commenting out, perhaps implementing at a future date.
46
+ */
38
47
  connectedCallback(): void;
39
48
  private _handleClick;
49
+ private _renderIcon;
40
50
  render(): import("lit-html").TemplateResult<1>;
41
51
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nysds/components",
3
- "version": "1.22.0",
3
+ "version": "1.22.1",
4
4
  "description": "New York State's design system and code component library.",
5
5
  "type": "module",
6
6
  "workspaces": [
@@ -25,15 +25,15 @@
25
25
  "customElements": "custom-elements.json",
26
26
  "scripts": {
27
27
  "dev": "vite",
28
- "gen": "plop",
29
- "gen-stories": "node src/scripts/generate-stories.mjs",
30
- "gen-stories:component": "sh -c 'node src/scripts/generate-stories.mjs \"$@\" && npm run lint:fix' --",
28
+ "gen:new-comp": "plop && npm i",
29
+ "gen:stories": "npm run cem && node src/scripts/generate-stories.mjs",
30
+ "gen:stories:component": "sh -c 'node src/scripts/generate-stories.mjs \"$@\" && npm run lint:fix' --",
31
31
  "build": "tsc --emitDeclarationOnly && vite build",
32
32
  "build:umd": "cross-env BUILD_FORMAT=umd vite build",
33
33
  "tsc:packages": "tsc -b tsconfig.build.json",
34
34
  "build:packages": "npm run tsc:packages && turbo run build --filter='./packages/*' --filter='!@nysds/codegen' --filter='!@nysds/react' --filter='!@nysds/angular' --filter='!@nysds/vue' --log-order=grouped",
35
35
  "build:root": "cross-env NODE_ENV=production npm run build && cross-env NODE_ENV=production npm run build:umd",
36
- "build:all": "npm run clean:dist && npm run lit-analyze || true && cross-env NODE_ENV=production npm run build:packages && npm run build:root && npm run cem && npm run build:frameworks && npm run gen-stories && npm run build:mcp && npm run lint:fix",
36
+ "build:all": "npm run clean:dist && npm run lit-analyze || true && cross-env NODE_ENV=production npm run build:packages && npm run build:root && npm run cem && npm run build:frameworks && node src/scripts/generate-stories.mjs && npm run build:mcp && npm run lint:fix",
37
37
  "build:frameworks": "cross-env NODE_ENV=production turbo run build --filter=@nysds/codegen --filter=@nysds/react --filter=@nysds/angular --filter=@nysds/vue --only",
38
38
  "build:examples": "npm run build -w framework-examples/react-vite -w framework-examples/vue-vite -w framework-examples/next-app -w framework-examples/angular-app -w framework-examples/angular-ngmodule",
39
39
  "build:mcp": "cross-env NODE_ENV=production npm run build -w @nysds/mcp-server",