@nadicodeai/ui 12.1.138 → 12.1.140

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.
@@ -2,7 +2,7 @@ import { type ReactElement } from "react";
2
2
  import { type EmptyScope } from "../internal/empty.js";
3
3
  import { type CopyButtonProps } from "./copy-button.js";
4
4
  import type { EmptyArt } from "./empty-art.js";
5
- import { type PageCommand } from "./page-actions.js";
5
+ import { type PageCommand, type PagePrimaryCommand } from "./page-actions.js";
6
6
  import { type ResolvedMessage } from "./product-message.js";
7
7
  /** A link that leaves for the product's documentation: a command drawn from the product's router link, so it carries `link`, never `onClick`. */
8
8
  export type EmptyStateDocsLink = Extract<PageCommand, {
@@ -23,7 +23,7 @@ export type EmptyStateProps = {
23
23
  description: string;
24
24
  picture: EmptyArt;
25
25
  /** The action that fills it, only when this viewer can add. */
26
- action?: PageCommand;
26
+ action?: PagePrimaryCommand;
27
27
  /** Where the product explains this section: the one muted link under the action. */
28
28
  docs?: EmptyStateDocsLink;
29
29
  } | {
@@ -1 +1 @@
1
- {"version":3,"file":"empty-state.d.ts","sourceRoot":"","sources":["../../src/components/empty-state.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,YAAY,EAAqC,MAAM,OAAO,CAAC;AAE7E,OAAO,EAOL,KAAK,UAAU,EAEhB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AAEjE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,KAAK,WAAW,EAAqB,MAAM,gBAAgB,CAAC;AACrE,OAAO,EAAmB,KAAK,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAE1E,iJAAiJ;AACjJ,MAAM,MAAM,kBAAkB,GAAG,OAAO,CAAC,WAAW,EAAE;IAAE,IAAI,EAAE,YAAY,CAAA;CAAE,CAAC,CAAC;AAE9E,uGAAuG;AACvG,MA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ClB,+DAA+D;IAC/D,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B,oFAAoF;IACpF,IAAI,CAAC,EAAE,kBAAkB,CAAC;CAC3B,GACD;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GACvC;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,WAAW,CAAA;CAAE,GAC1D;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GACpC;IACE,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,mEAAmE;IACnE,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,uGAAuG;IACvG,KAAK,CAAC,EAAE,OAAO,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;CAC9C,GACD;IACE,IAAI,EAAE,QAAQ,CAAC;IACf,OAAO,EAAE,eAAe,CAAC;IACzB,mHAAmH;IACnH,SAAS,CAAC,EAAE,mBAAmB,CAAC;CACjC,CACJ,CAAC;AAEF,sFAAsF;AACtF,MAAM,MAAM,cAAc,CAAC,CAAC,SAAS,eAAe,CAAC,MAAM,CAAC,IAAI,IAAI,CAClE,OAAO,CAAC,eAAe,EAAE;IAAE,IAAI,EAAE,CAAC,CAAA;CAAE,CAAC,EACrC,OAAO,GAAG,cAAc,CACzB,CAAC;AAEF;;;;;;;;;;GAUG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,+BAwFhD"}
@@ -33,8 +33,7 @@ export type PendingWord = {
33
33
  pending?: false | undefined;
34
34
  pendingLabel?: string | undefined;
35
35
  };
36
- /** A command drawn as a button: on the title row, in an empty state, in a row. Its icon leads the label. */
37
- export type PageCommand = PageCommandAction & PendingWord & {
36
+ type PageCommandFace = PendingWord & {
38
37
  label: string;
39
38
  icon?: ReactElement | undefined;
40
39
  /** Read instead of the label when the label alone does not name the target: "Sign in to Notion". */
@@ -43,6 +42,20 @@ export type PageCommand = PageCommandAction & PendingWord & {
43
42
  external?: boolean | undefined;
44
43
  disabled?: boolean | undefined;
45
44
  };
45
+ /** A command drawn as a button: on the title row, in an empty state, in a row. Its icon leads the label. */
46
+ export type PageCommand = PageCommandAction & PageCommandFace;
47
+ /**
48
+ * A page's main command that comes in a few kinds of the same job, such as Add source's folder,
49
+ * documents or web page: the button opens a menu of them, as Vercel's "Add New…" does. Only the
50
+ * page's primary and a first use's action take it.
51
+ */
52
+ export type PageChoicesCommand = PageCommandFace & {
53
+ choices: readonly [MenuCommand, MenuCommand, ...MenuCommand[]];
54
+ onClick?: never;
55
+ link?: never;
56
+ render?: never;
57
+ };
58
+ export type PagePrimaryCommand = PageCommand | PageChoicesCommand;
46
59
  /** The page's three dots, which open only for two commands or more. */
47
60
  export type PageMenu = Omit<RecordMenu, "commands"> & {
48
61
  commands: readonly [MenuCommand, MenuCommand, ...MenuCommand[]];
@@ -51,12 +64,12 @@ export type PageActionsProps = {
51
64
  /** An overview's reading period, first on the title row: a period `Select` or `DateRangeControl`. */
52
65
  period?: ReactElement | undefined;
53
66
  secondary?: PageCommand | undefined;
54
- primary?: PageCommand | undefined;
67
+ primary?: PagePrimaryCommand | undefined;
55
68
  menu?: PageMenu | undefined;
56
69
  };
57
70
  type CommandVariant = "default" | "outline" | "ghost" | "link";
58
71
  export declare function PageCommandButton({ command, shape, size, variant, }: {
59
- command: PageCommand;
72
+ command: PagePrimaryCommand;
60
73
  shape?: TextButtonProps["shape"];
61
74
  size?: TextButtonProps["size"];
62
75
  variant: CommandVariant;
@@ -85,8 +98,8 @@ export declare function PageActionsSlot(): import("react").JSX.Element;
85
98
  * @family Actions
86
99
  * @when The actions of a collection, an object or an overview page, on the title's row at its trailing edge. A Configuration page has none: each section saves from its footer.
87
100
  * @instead A row's actions are the row's one button and its `ActionMenu`. A collection toolbar holds search and filters, never a page action.
88
- * @behaviour Takes `period`, `secondary`, `primary` and `menu` and draws their order and variants itself: the period, outline, default, then the three dots last. The menu needs two commands or more; a single extra command is the secondary. A destination outside the product ends in the arrow. A running command (`pending`) keeps its place and icon, says its pending word and holds, and the type requires `pendingLabel` whenever `pending` is set. A command here is never destructive or warning: those sit in the danger zone of the page, in a card.
89
- * @words The primary is the page's main job as verb and noun: "Invite member", "New Agent". The pending word is its -ing form: "Inviting member". The menu names the page's record at its top and keeps the destructive command last, after a divider.
101
+ * @behaviour Takes `period`, `secondary`, `primary` and `menu` and draws their order and variants itself: the period, outline, default, then the three dots last. The menu needs two commands or more; a single extra command is the secondary. A primary whose job comes in a few kinds takes `choices`: its button opens a menu of them aligned to its end, each with its icon, as Vercel's "Add New…" does; a kind that needs its own fields opens its dialog from its row. A destination outside the product ends in the arrow. A running command (`pending`) keeps its place and icon, says its pending word and holds, and the type requires `pendingLabel` whenever `pending` is set. A command here is never destructive or warning: those sit in the danger zone of the page, in a card.
102
+ * @words The primary is the page's main job as verb and noun: "Invite member", "New Agent". Its choices are the kinds, as nouns: "Folder", "Documents", "Web page". The pending word is its -ing form: "Inviting member". The menu names the page's record at its top and keeps the destructive command last, after a divider.
90
103
  * @access DOM order is visual order. A command whose label does not name its target carries `accessibleName`. A running command is `aria-busy` and keeps focus. The three dots carry "More for {record}"; the menu returns focus to them when it closes.
91
104
  */
92
105
  export declare function PageActions(props: PageActionsProps): import("react").JSX.Element | null;
@@ -1 +1 @@
1
- {"version":3,"file":"page-actions.d.ts","sourceRoot":"","sources":["../../src/components/page-actions.tsx"],"names":[],"mappings":"AAGA,OAAO,EAEL,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,SAAS,EAKf,MAAM,OAAO,CAAC;AAIf,OAAO,EAAc,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AAC9E,OAAO,EAAsB,KAAK,eAAe,EAAE,MAAM,UAAU,CAAC;AAEpE,MAAM,MAAM,iBAAi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Ae,gCAS9B;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,sCAyBlD"}
@@ -4,8 +4,10 @@ import { ArrowUpRight } from "lucide-react";
4
4
  import { createContext, useContext, useEffect, useId, useState, } from "react";
5
5
  import { createPortal } from "react-dom";
6
6
  import { createStore, useStore } from "zustand";
7
+ import { MenuCommandRow } from "../internal/record-menu-items.js";
7
8
  import { ActionMenu } from "./action-menu.js";
8
9
  import { Button, ButtonLink } from "./button.js";
10
+ import { DropdownMenu, DropdownMenuContent, DropdownMenuTrigger } from "./dropdown-menu.js";
9
11
  export function PageCommandButton({ command, shape, size, variant, }) {
10
12
  const look = {
11
13
  "aria-label": command.accessibleName,
@@ -24,6 +26,9 @@ export function PageCommandButton({ command, shape, size, variant, }) {
24
26
  if (command.render) {
25
27
  return (_jsx(Button, { ...look, render: command.render, children: command.label }));
26
28
  }
29
+ if ("choices" in command && command.choices) {
30
+ return (_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { render: _jsx(Button, { ...look }), children: command.label }), _jsx(DropdownMenuContent, { align: "end", children: command.choices.map((choice) => (_jsx(MenuCommandRow, { command: choice }, choice.label))) })] }));
31
+ }
27
32
  return (_jsx(Button, { ...look, onClick: command.onClick, type: "button", children: command.label }));
28
33
  }
29
34
  /** The row of a page's actions where it stands, for a page whose header is its own card. */
@@ -69,8 +74,8 @@ export function PageActionsSlot() {
69
74
  * @family Actions
70
75
  * @when The actions of a collection, an object or an overview page, on the title's row at its trailing edge. A Configuration page has none: each section saves from its footer.
71
76
  * @instead A row's actions are the row's one button and its `ActionMenu`. A collection toolbar holds search and filters, never a page action.
72
- * @behaviour Takes `period`, `secondary`, `primary` and `menu` and draws their order and variants itself: the period, outline, default, then the three dots last. The menu needs two commands or more; a single extra command is the secondary. A destination outside the product ends in the arrow. A running command (`pending`) keeps its place and icon, says its pending word and holds, and the type requires `pendingLabel` whenever `pending` is set. A command here is never destructive or warning: those sit in the danger zone of the page, in a card.
73
- * @words The primary is the page's main job as verb and noun: "Invite member", "New Agent". The pending word is its -ing form: "Inviting member". The menu names the page's record at its top and keeps the destructive command last, after a divider.
77
+ * @behaviour Takes `period`, `secondary`, `primary` and `menu` and draws their order and variants itself: the period, outline, default, then the three dots last. The menu needs two commands or more; a single extra command is the secondary. A primary whose job comes in a few kinds takes `choices`: its button opens a menu of them aligned to its end, each with its icon, as Vercel's "Add New…" does; a kind that needs its own fields opens its dialog from its row. A destination outside the product ends in the arrow. A running command (`pending`) keeps its place and icon, says its pending word and holds, and the type requires `pendingLabel` whenever `pending` is set. A command here is never destructive or warning: those sit in the danger zone of the page, in a card.
78
+ * @words The primary is the page's main job as verb and noun: "Invite member", "New Agent". Its choices are the kinds, as nouns: "Folder", "Documents", "Web page". The pending word is its -ing form: "Inviting member". The menu names the page's record at its top and keeps the destructive command last, after a divider.
74
79
  * @access DOM order is visual order. A command whose label does not name its target carries `accessibleName`. A running command is `aria-busy` and keeps focus. The three dots carry "More for {record}"; the menu returns focus to them when it closes.
75
80
  */
76
81
  export function PageActions(props) {
@@ -296,8 +296,8 @@ export const USAGE = [
296
296
  summary: "A page's actions, drawn on its title's row. Only the page shown last owns the row: a page kept hidden for a quick return gives the row back. Outside a `PageActionsHostProvider`, they render where they stand.",
297
297
  when: "The actions of a collection, an object or an overview page, on the title's row at its trailing edge. A Configuration page has none: each section saves from its footer.",
298
298
  instead: "A row's actions are the row's one button and its `ActionMenu`. A collection toolbar holds search and filters, never a page action.",
299
- behaviour: "Takes `period`, `secondary`, `primary` and `menu` and draws their order and variants itself: the period, outline, default, then the three dots last. The menu needs two commands or more; a single extra command is the secondary. A destination outside the product ends in the arrow. A running command (`pending`) keeps its place and icon, says its pending word and holds, and the type requires `pendingLabel` whenever `pending` is set. A command here is never destructive or warning: those sit in the danger zone of the page, in a card.",
300
- words: 'The primary is the page\'s main job as verb and noun: "Invite member", "New Agent". The pending word is its -ing form: "Inviting member". The menu names the page\'s record at its top and keeps the destructive command last, after a divider.',
299
+ behaviour: 'Takes `period`, `secondary`, `primary` and `menu` and draws their order and variants itself: the period, outline, default, then the three dots last. The menu needs two commands or more; a single extra command is the secondary. A primary whose job comes in a few kinds takes `choices`: its button opens a menu of them aligned to its end, each with its icon, as Vercel\'s "Add New…" does; a kind that needs its own fields opens its dialog from its row. A destination outside the product ends in the arrow. A running command (`pending`) keeps its place and icon, says its pending word and holds, and the type requires `pendingLabel` whenever `pending` is set. A command here is never destructive or warning: those sit in the danger zone of the page, in a card.',
300
+ words: 'The primary is the page\'s main job as verb and noun: "Invite member", "New Agent". Its choices are the kinds, as nouns: "Folder", "Documents", "Web page". The pending word is its -ing form: "Inviting member". The menu names the page\'s record at its top and keeps the destructive command last, after a divider.',
301
301
  access: 'DOM order is visual order. A command whose label does not name its target carries `accessibleName`. A running command is `aria-busy` and keeps focus. The three dots carry "More for {record}"; the menu returns focus to them when it closes.',
302
302
  },
303
303
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nadicodeai/ui",
3
- "version": "12.1.138",
3
+ "version": "12.1.140",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -83,7 +83,7 @@
83
83
  "@base-ui/react": "^1.9.0",
84
84
  "@iconify-icons/logos": "^2.0.3",
85
85
  "@iconify/react": "^6.0.2",
86
- "@nadicodeai/design-system": "12.1.138",
86
+ "@nadicodeai/design-system": "12.1.140",
87
87
  "@tanstack/react-table": "^9.3.1",
88
88
  "@vgpu/wgsl": "0.6.0",
89
89
  "class-variance-authority": "^0.7.1",