akanjs 3.0.0-alpha.109 → 3.0.0-alpha.110

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.
Files changed (69) hide show
  1. package/local/apps/serverLifecycle/serverLifecycle-local.db-shm +0 -0
  2. package/local/apps/serverLifecycle/serverLifecycle-local_solid.db-shm +0 -0
  3. package/package.json +1 -1
  4. package/types/ui/BottomSheet.d.ts +15 -2
  5. package/types/ui/Data/ListContainer.d.ts +1 -1
  6. package/types/ui/Dialog/Modal.d.ts +3 -1
  7. package/types/ui/Dialog/index.d.ts +1 -1
  8. package/types/ui/Dropdown.d.ts +5 -3
  9. package/types/ui/Empty.d.ts +3 -1
  10. package/types/ui/Field/Label.d.ts +4 -3
  11. package/types/ui/Field/index.d.ts +2 -2
  12. package/types/ui/InfiniteScroll.d.ts +4 -1
  13. package/types/ui/Layout/BottomTab.d.ts +4 -2
  14. package/types/ui/Layout/LeftSider.d.ts +3 -1
  15. package/types/ui/Layout/RightSider.d.ts +4 -2
  16. package/types/ui/Layout/Sider.d.ts +7 -1
  17. package/types/ui/Layout/index.d.ts +4 -4
  18. package/types/ui/Load/Units.d.ts +3 -1
  19. package/types/ui/Load/View.d.ts +3 -1
  20. package/types/ui/Loading/Area.d.ts +9 -1
  21. package/types/ui/Menu.d.ts +3 -1
  22. package/types/ui/Modal.d.ts +3 -1
  23. package/types/ui/Model/Edit.d.ts +2 -4
  24. package/types/ui/Model/EditModal.d.ts +1 -1
  25. package/types/ui/Model/New.d.ts +2 -4
  26. package/types/ui/Model/Remove.d.ts +7 -1
  27. package/types/ui/Model/SureToRemove.d.ts +10 -1
  28. package/types/ui/Model/ViewEditModal.d.ts +7 -1
  29. package/types/ui/Pagination.d.ts +10 -2
  30. package/types/ui/Popconfirm.d.ts +8 -4
  31. package/types/ui/Select.d.ts +4 -2
  32. package/types/ui/Tab/Menu.d.ts +1 -1
  33. package/types/ui/Table.d.ts +9 -1
  34. package/types/ui/ToggleSelect.d.ts +11 -1
  35. package/types/ui/Unauthorized.d.ts +3 -1
  36. package/types/ui/index.d.ts +1 -0
  37. package/types/ui/triggerSlot.d.ts +24 -0
  38. package/ui/BottomSheet.tsx +72 -26
  39. package/ui/Data/ListContainer.tsx +1 -1
  40. package/ui/Dialog/Modal.tsx +18 -9
  41. package/ui/Dropdown.tsx +21 -12
  42. package/ui/Empty.tsx +4 -2
  43. package/ui/Field/Label.tsx +5 -4
  44. package/ui/Field/index.tsx +2 -2
  45. package/ui/InfiniteScroll.tsx +6 -4
  46. package/ui/Layout/BottomTab.tsx +20 -12
  47. package/ui/Layout/LeftSider.tsx +17 -9
  48. package/ui/Layout/RightSider.tsx +18 -14
  49. package/ui/Layout/Sider.tsx +30 -23
  50. package/ui/Load/Units.tsx +14 -3
  51. package/ui/Load/View.tsx +8 -3
  52. package/ui/Loading/Area.tsx +19 -5
  53. package/ui/Menu.tsx +21 -14
  54. package/ui/Modal.tsx +13 -2
  55. package/ui/Model/Edit.tsx +12 -26
  56. package/ui/Model/EditModal.tsx +1 -1
  57. package/ui/Model/New.tsx +12 -21
  58. package/ui/Model/Remove.tsx +39 -16
  59. package/ui/Model/SureToRemove.tsx +45 -30
  60. package/ui/Model/ViewEditModal.tsx +34 -21
  61. package/ui/Pagination.tsx +18 -5
  62. package/ui/Popconfirm.tsx +30 -20
  63. package/ui/Select.tsx +42 -39
  64. package/ui/Tab/Menu.tsx +1 -1
  65. package/ui/Table.tsx +16 -2
  66. package/ui/ToggleSelect.tsx +15 -6
  67. package/ui/Unauthorized.tsx +10 -2
  68. package/ui/index.ts +2 -0
  69. package/ui/triggerSlot.tsx +52 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "akanjs",
3
- "version": "3.0.0-alpha.109",
3
+ "version": "3.0.0-alpha.110",
4
4
  "sourceType": "module",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -1,7 +1,20 @@
1
1
  import { type ReactNode } from "react";
2
2
  interface BottomSheetProps {
3
- open: boolean;
4
- onCancel: () => void;
3
+ /** Additional classes for the sheet surface. */
4
+ className?: string;
5
+ /** Additional classes for the scrolling body. */
6
+ bodyClassName?: string;
7
+ /** Controlled open state. Left out, the sheet opens from its own trigger and handle. */
8
+ open?: boolean;
9
+ onCancel?: () => void;
10
+ /** Element that opens the sheet. */
11
+ trigger?: ReactNode;
12
+ /** Whole top row of the sheet, replacing the drag handle or the close row. */
13
+ header?: ReactNode;
14
+ /** The grab handle a `half` sheet draws. */
15
+ handle?: ReactNode;
16
+ /** Element that closes a `full` sheet, inside the default header row. */
17
+ close?: ReactNode;
5
18
  children: ReactNode;
6
19
  type: "full" | "half";
7
20
  }
@@ -25,7 +25,7 @@ export interface ListContainerProps<T extends string, State, Input, Full extends
25
25
  /** Show create/new-model controls. */
26
26
  create?: boolean;
27
27
  /** Optional list title. */
28
- title?: string;
28
+ title?: ReactNode;
29
29
  /** Initial sort value. */
30
30
  sort?: unknown;
31
31
  /** Table/list columns. */
@@ -3,7 +3,9 @@ export interface ModalProps {
3
3
  className?: string;
4
4
  bodyClassName?: string;
5
5
  confirmClose?: boolean;
6
+ /** The dismiss control, drawn in the corner slot that closes the dialog. `false` draws none. */
7
+ closeButton?: ReactNode | false;
6
8
  children?: ReactNode;
7
9
  onCancel?: () => void;
8
10
  }
9
- export declare const Modal: ({ className, bodyClassName, confirmClose, children, onCancel }: ModalProps) => import("react").ReactPortal | null;
11
+ export declare const Modal: ({ className, bodyClassName, confirmClose, closeButton, children, onCancel }: ModalProps) => import("react").ReactPortal | null;
@@ -1,7 +1,7 @@
1
1
  import { type ProviderProps } from "./Provider.d.ts";
2
2
  export declare const Dialog: {
3
3
  ({ children, ...props }: ProviderProps): import("react/jsx-runtime").JSX.Element;
4
- Modal: ({ className, bodyClassName, confirmClose, children, onCancel }: import("./Modal.d.ts").ModalProps) => import("react").ReactPortal | null;
4
+ Modal: ({ className, bodyClassName, confirmClose, closeButton, children, onCancel }: import("./Modal.d.ts").ModalProps) => import("react").ReactPortal | null;
5
5
  LegacyModal: ({ className, bodyClassName, confirmClose, children, onCancel }: import("./LegacyModal.d.ts").LegacyModalProps) => import("react").ReactPortal | null;
6
6
  Title: ({ children }: import("./Title.d.ts").TitleProps) => null;
7
7
  Action: ({ children }: import("./Action.d.ts").ActionProps) => null;
@@ -2,8 +2,10 @@ import { type ReactNode } from "react";
2
2
  /** Put this on a menu item that runs its own interaction (a switch, a copy button) to keep the menu open. */
3
3
  export declare const DROPDOWN_KEEP_OPEN_ATTR = "data-dropdown-keep-open";
4
4
  export interface DropdownProps {
5
- /** Button/trigger content. */
6
- value: ReactNode;
5
+ /** Trigger content, drawn inside the framework's own ghost button. */
6
+ value?: ReactNode;
7
+ /** Whole trigger element, drawn instead of that button. The menu's click and aria state land on it. */
8
+ trigger?: ReactNode;
7
9
  /** Dropdown menu content. */
8
10
  content: ReactNode;
9
11
  /** Additional classes for the dropdown wrapper. */
@@ -17,7 +19,7 @@ export interface DropdownProps {
17
19
  /** Names this dropdown for the in-page agent. Without it the menu publishes nothing — two on one screen would share a name. */
18
20
  namespace?: string;
19
21
  }
20
- export declare const DefaultDropdown: ({ value, content, className, buttonClassName, dropdownClassName, align, namespace, }: DropdownProps) => import("react/jsx-runtime").JSX.Element;
22
+ export declare const DefaultDropdown: ({ value, trigger, content, className, buttonClassName, dropdownClassName, align, namespace, }: DropdownProps) => import("react/jsx-runtime").JSX.Element;
21
23
  /**
22
24
  * Dropdown. Resolves to a route-scoped override when a `page/**\/_overrides.tsx`
23
25
  * in the route's ancestry declares one, otherwise renders {@link DefaultDropdown}.
@@ -2,6 +2,8 @@ import type { ReactNode } from "react";
2
2
  export interface EmptyProps {
3
3
  /** Additional classes for the empty-state body. */
4
4
  className?: string;
5
+ /** The mark above the description. */
6
+ icon?: ReactNode;
5
7
  /** Custom description. Defaults to the localized base.noData label. */
6
8
  description?: ReactNode;
7
9
  /** Optional content rendered below the empty-state body. */
@@ -9,7 +11,7 @@ export interface EmptyProps {
9
11
  /** Minimum empty-state height in pixels. */
10
12
  minHeight?: number;
11
13
  }
12
- export declare const DefaultEmpty: ({ className, description, children, minHeight }: EmptyProps) => import("react/jsx-runtime").JSX.Element;
14
+ export declare const DefaultEmpty: ({ className, icon, description, children, minHeight }: EmptyProps) => import("react/jsx-runtime").JSX.Element;
13
15
  /**
14
16
  * Empty-state placeholder. Resolves to a route-scoped override when a
15
17
  * `page/**\/_overrides.tsx` in the route's ancestry declares one, otherwise
@@ -1,8 +1,9 @@
1
+ import type { ReactNode } from "react";
1
2
  export interface LabelProps {
2
3
  className?: string;
3
- label: string;
4
- desc?: string;
5
- unit?: string;
4
+ label: ReactNode;
5
+ desc?: ReactNode;
6
+ unit?: ReactNode;
6
7
  nullable?: boolean;
7
8
  mode?: "view" | "edit";
8
9
  }
@@ -5,9 +5,9 @@ export interface FieldProps {
5
5
  containerClassName?: string;
6
6
  labelClassName?: string;
7
7
  /** Section label shown above the controls. */
8
- label?: string;
8
+ label?: ReactNode;
9
9
  /** Optional help text shown in the label tooltip. */
10
- desc?: string;
10
+ desc?: ReactNode;
11
11
  /** Marks the field as optional in the label. */
12
12
  nullable?: boolean;
13
13
  /** Field control content. */
@@ -1,3 +1,4 @@
1
+ import { type ReactNode } from "react";
1
2
  export interface InfiniteScrollProps {
2
3
  hasMore: boolean;
3
4
  onLoadMore: () => Promise<void>;
@@ -8,5 +9,7 @@ export interface InfiniteScrollProps {
8
9
  * itself — and until it does, the sentinel is on screen and loads one window unasked.
9
10
  */
10
11
  reverse?: boolean;
12
+ /** The mark shown while the next window is loading. */
13
+ loading?: ReactNode;
11
14
  }
12
- export declare const InfiniteScroll: ({ hasMore, onLoadMore, children, reverse }: InfiniteScrollProps) => import("react/jsx-runtime").JSX.Element;
15
+ export declare const InfiniteScroll: ({ hasMore, onLoadMore, children, reverse, loading }: InfiniteScrollProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import type { ReactNode } from "react";
2
2
  interface TabType {
3
- name: string;
3
+ name: ReactNode;
4
4
  icon: ReactNode;
5
5
  activeIcon?: ReactNode;
6
6
  notiCount?: number;
@@ -10,6 +10,8 @@ export interface BottomTabProps {
10
10
  className?: string;
11
11
  tabs: TabType[];
12
12
  height?: number;
13
+ /** Draws one tab inside its link. The link, the route match, and the badge placement stay the framework's. */
14
+ renderTab?: (tab: TabType, active: boolean) => ReactNode;
13
15
  }
14
- export declare const BottomTab: ({ className, tabs, height }: BottomTabProps) => import("react/jsx-runtime").JSX.Element;
16
+ export declare const BottomTab: ({ className, tabs, height, renderTab }: BottomTabProps) => import("react/jsx-runtime").JSX.Element;
15
17
  export {};
@@ -4,6 +4,8 @@ export interface LeftSiderProps {
4
4
  children: ReactNode;
5
5
  open: boolean;
6
6
  width?: number | string;
7
+ /** Element that closes the drawer. `false` draws none. */
8
+ close?: ReactNode | false;
7
9
  onCancel: () => void;
8
10
  }
9
- export declare const LeftSider: ({ className, children, open, width, onCancel }: LeftSiderProps) => import("react/jsx-runtime").JSX.Element;
11
+ export declare const LeftSider: ({ className, children, open, width, close, onCancel }: LeftSiderProps) => import("react/jsx-runtime").JSX.Element;
@@ -3,8 +3,10 @@ export interface RightSiderProps {
3
3
  className?: string;
4
4
  children: ReactNode;
5
5
  open: boolean;
6
- title?: string;
6
+ title?: ReactNode;
7
7
  width?: number | string;
8
+ /** The mark inside the drawer's close control. `false` draws no control. */
9
+ close?: ReactNode | false;
8
10
  onCancel: () => void;
9
11
  }
10
- export declare const RightSider: ({ className, children, open, title, width, onCancel }: RightSiderProps) => import("react/jsx-runtime").JSX.Element;
12
+ export declare const RightSider: ({ className, children, open, title, width, close, onCancel }: RightSiderProps) => import("react/jsx-runtime").JSX.Element;
@@ -2,6 +2,12 @@ import { type ReactNode } from "react";
2
2
  export interface SiderProps {
3
3
  className?: string;
4
4
  bgClassName?: string;
5
+ /** Element that opens the drawer. Defaults to the framework's hamburger button. */
6
+ trigger?: ReactNode;
7
+ /** Whole top row of the drawer, replacing the row the close button sits in. */
8
+ header?: ReactNode;
9
+ /** Element that closes the drawer, inside the default header row. */
10
+ close?: ReactNode;
5
11
  children?: ReactNode;
6
12
  }
7
- export declare const Sider: ({ className, bgClassName, children }: SiderProps) => import("react/jsx-runtime").JSX.Element;
13
+ export declare const Sider: ({ className, bgClassName, trigger, header, close, children }: SiderProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,15 +1,15 @@
1
1
  export declare const Layout: {
2
2
  Header: ({ className, type, children, height }: import("./Header.d.ts").HeaderProps) => import("react/jsx-runtime").JSX.Element;
3
- Sider: ({ className, bgClassName, children }: import("./Sider.d.ts").SiderProps) => import("react/jsx-runtime").JSX.Element;
3
+ Sider: ({ className, bgClassName, trigger, header, close, children }: import("./Sider.d.ts").SiderProps) => import("react/jsx-runtime").JSX.Element;
4
4
  Navbar: ({ back, className, height, children, title, left, right }: import("./Navbar.d.ts").NavbarProps) => import("react/jsx-runtime").JSX.Element;
5
5
  TopInset: ({ className, children, estimatedHeight }: import("./TopInset.d.ts").TopInsetProps) => import("react/jsx-runtime").JSX.Element;
6
- BottomTab: ({ className, tabs, height }: import("./BottomTab.d.ts").BottomTabProps) => import("react/jsx-runtime").JSX.Element;
6
+ BottomTab: ({ className, tabs, height, renderTab }: import("./BottomTab.d.ts").BottomTabProps) => import("react/jsx-runtime").JSX.Element;
7
7
  BottomInset: ({ className, children, keyboardSticky, contentAnchor, role, estimatedHeight, frameScope, frameSource, frameCache, }: import("./BottomInset.d.ts").BottomInsetProps) => import("react/jsx-runtime").JSX.Element;
8
8
  Template: ({ className, children }: import("./Template.d.ts").TemplateProps) => import("react/jsx-runtime").JSX.Element;
9
9
  Unit: ({ className, children, href }: import("./Unit.d.ts").UnitProps) => import("react/jsx-runtime").JSX.Element;
10
10
  View: ({ className, children }: import("./View.d.ts").ViewProps) => import("react/jsx-runtime").JSX.Element;
11
11
  Zone: ({ className, children }: import("./Zone.d.ts").ZoneProps) => import("react/jsx-runtime").JSX.Element;
12
12
  TopLeftAction: ({ className, children }: import("./TopLeftAction.d.ts").TopLeftActionProps) => import("react/jsx-runtime").JSX.Element | null;
13
- LeftSider: ({ className, children, open, width, onCancel }: import("./LeftSider.d.ts").LeftSiderProps) => import("react/jsx-runtime").JSX.Element;
14
- RightSider: ({ className, children, open, title, width, onCancel }: import("./RightSider.d.ts").RightSiderProps) => import("react/jsx-runtime").JSX.Element;
13
+ LeftSider: ({ className, children, open, width, close, onCancel }: import("./LeftSider.d.ts").LeftSiderProps) => import("react/jsx-runtime").JSX.Element;
14
+ RightSider: ({ className, children, open, title, width, close, onCancel }: import("./RightSider.d.ts").RightSiderProps) => import("react/jsx-runtime").JSX.Element;
15
15
  };
@@ -13,6 +13,8 @@ interface DefaultProps<L extends {
13
13
  loading?: ReactNode;
14
14
  filter?: (item: L, idx: number) => boolean;
15
15
  sort?: (a: L, b: L) => number;
16
+ /** Placeholder for a slice with no rows. Takes precedence over `renderEmpty`. */
17
+ empty?: ReactNode;
16
18
  renderEmpty?: null | (() => ReactNode) | false;
17
19
  renderItem?: (item: L, idx: number) => ReactNode;
18
20
  renderList?: (list: DataList<L>) => ReactNode;
@@ -28,5 +30,5 @@ interface UnitsProps<RefName extends string, Light extends {
28
30
  }
29
31
  export default function Units<RefName extends string, Light extends {
30
32
  id: string;
31
- }>({ containerRef, className, init, noDiv, from, to, loading, renderItem, renderList, renderEmpty, filter, sort, reverse, style, pagination, staleTime, }: UnitsProps<RefName, Light>): import("react/jsx-runtime").JSX.Element;
33
+ }>({ containerRef, className, init, noDiv, from, to, loading, empty, renderItem, renderList, renderEmpty, filter, sort, reverse, style, pagination, staleTime, }: UnitsProps<RefName, Light>): import("react/jsx-runtime").JSX.Element;
32
34
  export {};
@@ -7,6 +7,8 @@ interface DefaultProps<T extends string, M> {
7
7
  noDiv?: boolean;
8
8
  /** Custom fallback shown while the client view is loading. */
9
9
  loading?: ReactNode;
10
+ /** Placeholder for a view whose model came back empty. */
11
+ empty?: ReactNode;
10
12
  /** Render callback invoked with the loaded full model. */
11
13
  renderView: (model: M) => ReactNode;
12
14
  }
@@ -18,5 +20,5 @@ interface ViewProps<T extends string, Full extends {
18
20
  }
19
21
  export default function View<T extends string, Full extends {
20
22
  id: string;
21
- }>({ className, view, noDiv, loading, renderView, }: ViewProps<T, Full>): import("react/jsx-runtime").JSX.Element;
23
+ }>({ className, view, noDiv, loading, empty, renderView, }: ViewProps<T, Full>): import("react/jsx-runtime").JSX.Element;
22
24
  export {};
@@ -1 +1,9 @@
1
- export declare const Area: () => import("react/jsx-runtime").JSX.Element;
1
+ import type { ReactNode } from "react";
2
+ export interface AreaProps {
3
+ className?: string;
4
+ /** The mark above the message. */
5
+ indicator?: ReactNode;
6
+ /** The message under the mark. */
7
+ children?: ReactNode;
8
+ }
9
+ export declare const Area: ({ className, indicator, children }: AreaProps) => import("react/jsx-runtime").JSX.Element;
@@ -21,8 +21,10 @@ export interface MenuProps {
21
21
  inlineCollapsed?: boolean;
22
22
  onMouseOver?: () => void;
23
23
  onMouseLeave?: () => void;
24
+ /** Draws one item's body. The row, its click, and any submenu stay the framework's. */
25
+ renderItem?: (item: MenuItem, active: boolean) => ReactNode;
24
26
  }
25
- export declare const DefaultMenu: ({ items, onClick, selectedKeys, labelClassName, defaultSelectedKeys, className, ulClassName, liClassName, style, mode, activeStyle, inlineCollapsed, onMouseOver, onMouseLeave, }: MenuProps) => import("react/jsx-runtime").JSX.Element;
27
+ export declare const DefaultMenu: ({ items, onClick, selectedKeys, labelClassName, defaultSelectedKeys, className, ulClassName, liClassName, style, mode, activeStyle, inlineCollapsed, onMouseOver, onMouseLeave, renderItem, }: MenuProps) => import("react/jsx-runtime").JSX.Element;
26
28
  /**
27
29
  * Navigation menu. Resolves to a route-scoped override when a
28
30
  * `page/**\/_overrides.tsx` in the route's ancestry declares one, otherwise
@@ -8,6 +8,8 @@ export interface ModalProps {
8
8
  title?: string | ReactNode;
9
9
  /** Optional action area, usually footer buttons. */
10
10
  action?: ReactNode;
11
+ /** The dismiss control. `false` draws none. */
12
+ closeButton?: ReactNode | false;
11
13
  /** Controlled open state. */
12
14
  open?: boolean;
13
15
  /** Called when the modal requests closing. */
@@ -22,7 +24,7 @@ export interface ModalProps {
22
24
  * Default akanjs modal skin. Kept as the fallback implementation; apps replace
23
25
  * it per-route through a `page/**\/_overrides.tsx` manifest.
24
26
  */
25
- export declare const DefaultModal: ({ className, trigger, title, action, open, onCancel, bodyClassName, children, confirmClose, }: ModalProps) => import("react/jsx-runtime").JSX.Element;
27
+ export declare const DefaultModal: ({ className, trigger, title, action, closeButton, open, onCancel, bodyClassName, children, confirmClose, }: ModalProps) => import("react/jsx-runtime").JSX.Element;
26
28
  /**
27
29
  * Public Modal. Resolves to a route-scoped override when a `_overrides.tsx` in
28
30
  * the route's ancestry declares one, otherwise renders {@link DefaultModal}.
@@ -2,9 +2,7 @@ import type { SliceMeta } from "akanjs/fetch";
2
2
  import type { ReactNode } from "react";
3
3
  import type { DraftProp } from "./draftScope.d.ts";
4
4
  interface EditProps {
5
- type?: "icon" | "button";
6
- className?: string;
7
- wrapperClassName?: string;
5
+ trigger?: ReactNode;
8
6
  children: ReactNode;
9
7
  slice: SliceMeta;
10
8
  modelId: string;
@@ -15,5 +13,5 @@ interface EditProps {
15
13
  /** Draft recovery for the form this opens. `false` turns it off; a string names the scope explicitly. */
16
14
  draft?: DraftProp;
17
15
  }
18
- export default function Edit({ className, wrapperClassName, type, children, slice, modelId, modal, renderTitle, draft, }: EditProps): import("react/jsx-runtime").JSX.Element;
16
+ export default function Edit({ trigger, children, slice, modelId, modal, renderTitle, draft }: EditProps): import("react/jsx-runtime").JSX.Element;
19
17
  export {};
@@ -42,7 +42,7 @@ interface EditModalProps<Full extends {
42
42
  /** Modal title or title renderer receiving the current model. */
43
43
  renderTitle?: ((model: Full) => string | ReactNode) | string;
44
44
  /** Submit button label. */
45
- submitText?: string;
45
+ submitText?: ReactNode;
46
46
  /** Additional classes for the submit button. */
47
47
  submitClassName?: string;
48
48
  /** Store submit options passed to the generated submit action. */
@@ -2,9 +2,7 @@ import type { SliceMeta } from "akanjs/fetch";
2
2
  import type { ReactNode } from "react";
3
3
  import type { DraftProp } from "./draftScope.d.ts";
4
4
  interface NewProps<Full = any> {
5
- type?: "icon" | "button";
6
- className?: string;
7
- wrapperClassName?: string;
5
+ trigger?: ReactNode;
8
6
  children: ReactNode;
9
7
  slice: SliceMeta;
10
8
  modal?: string | null;
@@ -17,5 +15,5 @@ interface NewProps<Full = any> {
17
15
  /** Draft recovery for the form. `false` turns it off; a string names the scope explicitly. */
18
16
  draft?: DraftProp;
19
17
  }
20
- export default function New({ className, wrapperClassName, type, children, slice, modal, partial, renderTitle, namespace, draft, }: NewProps): import("react/jsx-runtime").JSX.Element;
18
+ export default function New({ trigger, children, slice, modal, partial, renderTitle, namespace, draft }: NewProps): import("react/jsx-runtime").JSX.Element;
21
19
  export {};
@@ -7,7 +7,13 @@ interface RemoveProps {
7
7
  slice: SliceMeta;
8
8
  modal?: string | null;
9
9
  redirect?: string;
10
+ /** Confirmation heading. */
11
+ title?: ReactNode;
12
+ /** Confirmation body. */
13
+ description?: ReactNode;
14
+ /** Confirmation footer. Replacing it takes over the removal — call nothing else and the record stays. */
15
+ action?: ReactNode;
10
16
  children: ReactNode;
11
17
  }
12
- export default function Remove({ className, name, modelId, slice, modal, redirect, children }: RemoveProps): import("react/jsx-runtime").JSX.Element;
18
+ export default function Remove({ className, name, modelId, slice, modal, redirect, title, description, action, children, }: RemoveProps): import("react/jsx-runtime").JSX.Element;
13
19
  export {};
@@ -1,4 +1,5 @@
1
1
  import type { SliceMeta } from "akanjs/fetch";
2
+ import { type ReactNode } from "react";
2
3
  interface SureToRemoveProps {
3
4
  className?: string;
4
5
  modelId: string;
@@ -6,6 +7,14 @@ interface SureToRemoveProps {
6
7
  slice: SliceMeta;
7
8
  redirect?: string;
8
9
  typeNameToRemove?: boolean;
10
+ /** Element that opens the confirmation. Defaults to the framework's delete label. */
11
+ trigger?: ReactNode;
12
+ /** Confirmation heading. */
13
+ title?: ReactNode;
14
+ /** Confirmation body above the name field. */
15
+ description?: ReactNode;
16
+ /** Label of the button that performs the removal. */
17
+ confirmLabel?: ReactNode;
9
18
  }
10
- export default function SureToRemove({ className, modelId, name, slice, redirect, typeNameToRemove, }: SureToRemoveProps): import("react/jsx-runtime").JSX.Element;
19
+ export default function SureToRemove({ className, modelId, name, slice, redirect, typeNameToRemove, trigger, title, description, confirmLabel, }: SureToRemoveProps): import("react/jsx-runtime").JSX.Element;
11
20
  export {};
@@ -7,6 +7,12 @@ interface ViewEditModalProps {
7
7
  renderTitle?: (model: any) => ReactNode | string;
8
8
  renderView: (model: any) => ReactNode | null;
9
9
  renderTemplate: () => ReactNode | null;
10
+ /** The kebab menu beside the title. `false` draws none, which also takes the remove entry off the modal. */
11
+ menu?: ReactNode | false;
12
+ /** Label of the button that turns the detail view into the form. */
13
+ editLabel?: ReactNode;
14
+ /** Label of the button that saves the form. */
15
+ saveLabel?: ReactNode;
10
16
  }
11
- export default function ViewEditModal({ modalClassName, viewClassName, slice, renderTitle, renderView, renderTemplate, }: ViewEditModalProps): import("react/jsx-runtime").JSX.Element;
17
+ export default function ViewEditModal({ modalClassName, viewClassName, slice, renderTitle, renderView, renderTemplate, menu, editLabel, saveLabel, }: ViewEditModalProps): import("react/jsx-runtime").JSX.Element;
12
18
  export {};
@@ -8,8 +8,16 @@ export interface PaginationProps {
8
8
  onPageSelect: (page: number) => void;
9
9
  /** Number of items per page. Used to calculate total pages. */
10
10
  itemsPerPage: number;
11
- /** Optional custom content when there is no data. */
11
+ /** Placeholder for a pager with no pages. */
12
+ empty?: ReactNode;
13
+ /** @deprecated Renamed to `empty` — it is a node, not a render function. */
12
14
  renderEmpty?: ReactNode;
15
+ /** The mark inside the step-back control. The button, its disabled state and its label stay the framework's. */
16
+ prev?: ReactNode;
17
+ /** The mark inside the step-forward control. */
18
+ next?: ReactNode;
19
+ /** The mark standing in for the pages a long pager skips. */
20
+ ellipsis?: ReactNode;
13
21
  /** Class overrides for wrapper and page buttons. */
14
22
  classNames?: {
15
23
  className?: string;
@@ -17,7 +25,7 @@ export interface PaginationProps {
17
25
  pageNumClassName?: string;
18
26
  };
19
27
  }
20
- export declare const DefaultPagination: ({ currentPage, total, onPageSelect, itemsPerPage, renderEmpty, classNames, }: PaginationProps) => import("react/jsx-runtime").JSX.Element | null;
28
+ export declare const DefaultPagination: ({ currentPage, total, onPageSelect, itemsPerPage, empty, renderEmpty, prev, next, ellipsis, classNames, }: PaginationProps) => import("react/jsx-runtime").JSX.Element | null;
21
29
  /**
22
30
  * Pager. Resolves to a route-scoped override when a `page/**\/_overrides.tsx` in
23
31
  * the route's ancestry declares one, otherwise renders {@link DefaultPagination}.
@@ -4,9 +4,13 @@ type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {
4
4
  };
5
5
  export interface PopconfirmProps {
6
6
  /** Confirmation title. */
7
- title: string;
7
+ title: ReactNode;
8
8
  /** Optional detailed confirmation message. */
9
9
  description?: ReactNode;
10
+ /** The mark beside the message. `false` draws none. */
11
+ icon?: ReactNode | false;
12
+ /** The whole footer, replacing both buttons. A replacement owns the confirm and the dismiss. */
13
+ actions?: ReactNode;
10
14
  /** Called when the user confirms. */
11
15
  onConfirm?: () => void;
12
16
  /** Props forwarded to the OK button. */
@@ -14,9 +18,9 @@ export interface PopconfirmProps {
14
18
  /** Props forwarded to the cancel button. */
15
19
  cancelButtonProps?: ButtonProps;
16
20
  /** Custom OK button text. */
17
- okText?: string;
21
+ okText?: ReactNode;
18
22
  /** Custom cancel button text. */
19
- cancelText?: string;
23
+ cancelText?: ReactNode;
20
24
  /** Trigger content. */
21
25
  children?: ReactNode;
22
26
  /** Additional classes for the trigger wrapper. */
@@ -24,7 +28,7 @@ export interface PopconfirmProps {
24
28
  /** Additional classes for the popover arrow/decorator. */
25
29
  decoClassName?: string;
26
30
  }
27
- export declare const DefaultPopconfirm: ({ title, description, onConfirm, okButtonProps, cancelButtonProps, okText, cancelText, children, triggerClassName, decoClassName, }: PopconfirmProps) => import("react/jsx-runtime").JSX.Element;
31
+ export declare const DefaultPopconfirm: ({ title, description, icon, actions, onConfirm, okButtonProps, cancelButtonProps, okText, cancelText, children, triggerClassName, decoClassName, }: PopconfirmProps) => import("react/jsx-runtime").JSX.Element;
28
32
  /**
29
33
  * Confirmation popover. Resolves to a route-scoped override when a
30
34
  * `page/**\/_overrides.tsx` in the route's ancestry declares one, otherwise
@@ -7,9 +7,9 @@ interface LabelOption<T> {
7
7
  type Options<T> = T[] | LabelOption<T>[] | EnumInstance<string, T>;
8
8
  export interface SelectProps<T extends string | number | boolean | null | undefined, Multiple extends boolean = false, Searchable extends boolean = false, Option extends Options<T> = Options<T>> {
9
9
  /** Optional label shown above the selector. */
10
- label?: string;
10
+ label?: ReactNode;
11
11
  /** Optional tooltip/help description next to the label. */
12
- desc?: string;
12
+ desc?: ReactNode;
13
13
  labelClassName?: string;
14
14
  className?: string;
15
15
  /** Controlled selected value, or selected values when multiple is true. */
@@ -34,6 +34,8 @@ export interface SelectProps<T extends string | number | boolean | null | undefi
34
34
  onChange: Multiple extends true ? (value: T[], prev: T[]) => void : (value: T, prev: T) => void;
35
35
  /** Optional remote/local search callback. */
36
36
  onSearch?: (text: string) => void;
37
+ /** Placeholder for a selector with no options to offer. */
38
+ empty?: ReactNode;
37
39
  /** Custom option renderer. */
38
40
  renderOption?: (value: T) => ReactNode;
39
41
  /** Custom selected value renderer. */
@@ -7,6 +7,6 @@ export interface MenuProps {
7
7
  menu: string;
8
8
  children: ReactNode;
9
9
  scrollToTop?: boolean;
10
- tooltip?: string;
10
+ tooltip?: ReactNode;
11
11
  }
12
12
  export declare const Menu: ({ className, activeClassName, disabledClassName, disabled, menu, children, scrollToTop, tooltip, }: MenuProps) => import("react/jsx-runtime").JSX.Element;
@@ -37,8 +37,16 @@ export interface TableProps {
37
37
  rowClassName?: string | ((record: any, index: number) => string) | undefined;
38
38
  /** Custom row key resolver. */
39
39
  rowKey?: (model: any) => string;
40
+ /** Content drawn above the table. */
41
+ header?: ReactNode;
42
+ /** Content drawn below the table, under the pager. */
43
+ footer?: ReactNode;
44
+ /** Placeholder for a table with no rows. */
45
+ empty?: ReactNode;
46
+ /** The mark shown over the rows while `loading`. */
47
+ loadingIndicator?: ReactNode;
40
48
  }
41
- export declare const DefaultTable: ({ columns, dataSource, loading, size, bordered, pagination, showHeader, onRow, rowClassName, rowKey, }: TableProps) => import("react/jsx-runtime").JSX.Element;
49
+ export declare const DefaultTable: ({ columns, dataSource, loading, size, bordered, pagination, showHeader, onRow, rowClassName, rowKey, header, footer, empty, loadingIndicator, }: TableProps) => import("react/jsx-runtime").JSX.Element;
42
50
  /**
43
51
  * Data table. Resolves to a route-scoped override when a `page/**\/_overrides.tsx`
44
52
  * in the route's ancestry declares one, otherwise renders {@link DefaultTable}.
@@ -1,4 +1,4 @@
1
- import { type ComponentType } from "react";
1
+ import { type ComponentType, type ReactNode } from "react";
2
2
  export interface ToggleSelectProps<I extends string | number | boolean | null> {
3
3
  className?: string;
4
4
  btnClassName?: string;
@@ -13,6 +13,16 @@ export interface ToggleSelectProps<I extends string | number | boolean | null> {
13
13
  onChange: (value: I, idx: number) => void;
14
14
  onClear?: () => void;
15
15
  disabled?: boolean;
16
+ /** Draws one cell. `onToggle` is the cell's own action — put it on whatever the cell renders. */
17
+ renderItem?: (item: {
18
+ label: string;
19
+ value: I;
20
+ disabled?: boolean;
21
+ }, state: {
22
+ selected: boolean;
23
+ disabled: boolean;
24
+ onToggle: () => void;
25
+ }) => ReactNode;
16
26
  }
17
27
  export interface MultiProps {
18
28
  className?: string;
@@ -1,11 +1,13 @@
1
1
  import type { ReactNode } from "react";
2
2
  export interface UnauthorizedProps {
3
3
  className?: string;
4
+ /** The mark above the description. */
5
+ icon?: ReactNode;
4
6
  description?: ReactNode;
5
7
  children?: ReactNode;
6
8
  minHeight?: number;
7
9
  }
8
- export declare const DefaultUnauthorized: ({ className, description, children, minHeight }: UnauthorizedProps) => import("react/jsx-runtime").JSX.Element;
10
+ export declare const DefaultUnauthorized: ({ className, icon, description, children, minHeight, }: UnauthorizedProps) => import("react/jsx-runtime").JSX.Element;
9
11
  /**
10
12
  * Unauthorized-state placeholder. Resolves to a route-scoped override when a
11
13
  * `page/**\/_overrides.tsx` in the route's ancestry declares one, otherwise
@@ -70,5 +70,6 @@ export { Table } from "./Table.d.ts";
70
70
  export { DefaultToast, DefaultToastItem, Toast, type ToastItemProps, type ToastMessage, type ToastProps, type ToastType, } from "./Toast.d.ts";
71
71
  export { ToggleSelect } from "./ToggleSelect.d.ts";
72
72
  export { Tooltip, type TooltipProps } from "./Tooltip.d.ts";
73
+ export { triggerSlot } from "./triggerSlot.d.ts";
73
74
  export { type AkanModalComponent, type AkanUiOverrideManifest, type AkanUiOverrideName, type AkanUiOverrides, type AkanUiRecipes, createOverridable, override, UiOverrideProvider, type UiOverrideProviderProps, useUiOverride, useUiRecipe, } from "./UiOverride.d.ts";
74
75
  export { Unauthorized } from "./Unauthorized.d.ts";
@@ -0,0 +1,24 @@
1
+ import { type MouseEvent, type ReactNode } from "react";
2
+ type TriggerHandler = (event: MouseEvent<HTMLElement>) => void;
3
+ interface TriggerSlotOptions {
4
+ className?: string;
5
+ onClick?: TriggerHandler;
6
+ /** Host element for a trigger that cannot be cloned — a string, a fragment, several children. */
7
+ as?: "div" | "span";
8
+ }
9
+ /**
10
+ * Puts a disclosure's click and aria state onto the element the caller handed in, rather than wrapping it.
11
+ *
12
+ * Reach for this **only when an attribute has to ride the caller's own control** — `aria-expanded` /
13
+ * `aria-haspopup` on a wrapper names a box rather than the button a screen reader activates. Everywhere else
14
+ * the framework wraps instead: a wrapper works with any node, and a clone is silently inert on a component
15
+ * that does not forward `className` / `onClick` (every `ModelProps` component, whose `onClick` takes the model
16
+ * rather than the event).
17
+ *
18
+ * The caller's own `onClick` runs first and can call `preventDefault()` to stop the surface from acting. A
19
+ * trigger that is not a single element has nothing to clone onto, so it keeps a host element.
20
+ */
21
+ export declare const triggerSlot: (trigger: ReactNode, { className, onClick, as: Host, ...attrs }: TriggerSlotOptions & {
22
+ [key: string]: unknown;
23
+ }) => import("react/jsx-runtime").JSX.Element;
24
+ export {};