@attraccess/plugins-frontend-ui 1.11.0-beta.0 → 1.11.0-beta.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.
@@ -2,5 +2,5 @@ type AlertStatus = 'default' | 'accent' | 'success' | 'warning' | 'danger';
2
2
  interface Props {
3
3
  status: AlertStatus;
4
4
  }
5
- export declare function AlertStatusIcon({ status }: Props): import("react").JSX.Element;
5
+ export declare function AlertStatusIcon({ status }: Props): import('react').JSX.Element;
6
6
  export {};
@@ -1,5 +1,5 @@
1
1
  interface Props {
2
2
  message?: string;
3
3
  }
4
- export declare function EmptyState(props: Props): import("react").JSX.Element;
4
+ export declare function EmptyState(props: Props): import('react').JSX.Element;
5
5
  export {};
@@ -7,5 +7,5 @@ export interface LabeledSwitchProps extends Omit<SwitchProps, 'children'> {
7
7
  affect, since `className` lands on the outer Switch wrapper. */
8
8
  contentClassName?: string;
9
9
  }
10
- export declare function LabeledSwitch({ children, contentClassName, ...rest }: LabeledSwitchProps): import("react").JSX.Element;
10
+ export declare function LabeledSwitch({ children, contentClassName, ...rest }: LabeledSwitchProps): import('react').JSX.Element;
11
11
  export {};
@@ -5,6 +5,6 @@ interface Props {
5
5
  multiple?: boolean;
6
6
  listClassName?: string;
7
7
  }
8
- export declare const ListboxWrapper: ({ children }: PropsWithChildren) => import("react").JSX.Element;
9
- export declare function ResourceSelector(props: Readonly<Props>): import("react").JSX.Element;
8
+ export declare const ListboxWrapper: ({ children }: PropsWithChildren) => import('react').JSX.Element;
9
+ export declare function ResourceSelector(props: Readonly<Props>): import('react').JSX.Element;
10
10
  export {};
@@ -8,5 +8,5 @@ interface Props {
8
8
  dialogProps?: Omit<DrawerDialogProps, 'children'>;
9
9
  }
10
10
  /** Render DrawerHeading for the title, or name headerless content via dialogProps['aria-label']. */
11
- export declare function StandardDrawer(props: Props): import("react").JSX.Element;
11
+ export declare function StandardDrawer(props: Props): import('react').JSX.Element;
12
12
  export {};
@@ -17,5 +17,5 @@ interface Props extends Omit<ModalProps, 'children'> {
17
17
  * Render ModalHeading for the accessible title, or provide dialogProps['aria-label']
18
18
  * when the content has no title heading. ModalHeader alone does not name the dialog.
19
19
  */
20
- export declare function StandardModal(props: Props): import("react").JSX.Element;
20
+ export declare function StandardModal(props: Props): import('react').JSX.Element;
21
21
  export {};
@@ -5,5 +5,5 @@ interface StatusAlertProps {
5
5
  children?: ReactNode;
6
6
  'data-cy'?: string;
7
7
  }
8
- export declare function StatusAlert({ status, title, children, 'data-cy': dataCy }: Readonly<StatusAlertProps>): import("react").JSX.Element;
8
+ export declare function StatusAlert({ status, title, children, 'data-cy': dataCy }: Readonly<StatusAlertProps>): import('react').JSX.Element;
9
9
  export {};
@@ -10,5 +10,5 @@ interface AttraccessUserProps {
10
10
  /** When false, render as plain display without the direct-message popover. Defaults to true. */
11
11
  interactive?: boolean;
12
12
  }
13
- export declare function AttraccessUser({ user, description, className, onStartDirectMessage, variant, interactive, }: Readonly<AttraccessUserProps>): import("react").JSX.Element;
13
+ export declare function AttraccessUser({ user, description, className, onStartDirectMessage, variant, interactive, }: Readonly<AttraccessUserProps>): import('react').JSX.Element;
14
14
  export {};
@@ -6,6 +6,6 @@ interface AttraccessUserActions {
6
6
  interface AttraccessUserActionsProviderProps extends AttraccessUserActions {
7
7
  children: ReactNode;
8
8
  }
9
- export declare function AttraccessUserActionsProvider({ children, onStartDirectMessage, }: Readonly<AttraccessUserActionsProviderProps>): import("react").JSX.Element;
9
+ export declare function AttraccessUserActionsProvider({ children, onStartDirectMessage, }: Readonly<AttraccessUserActionsProviderProps>): import('react').JSX.Element;
10
10
  export declare function useAttraccessUserActions(): AttraccessUserActions;
11
11
  export {};
@@ -1,3 +1,3 @@
1
1
  import { ButtonProps as HeroButtonProps } from '@heroui/react';
2
2
  export type ButtonProps = HeroButtonProps;
3
- export declare function Button(props: ButtonProps): import("react").JSX.Element;
3
+ export declare function Button(props: ButtonProps): import('react').JSX.Element;
@@ -3,5 +3,5 @@ interface DateTimeDisplayProps {
3
3
  date?: Date | string | number | null;
4
4
  options?: DateTimeOptions;
5
5
  }
6
- export declare function DateTimeDisplay(props: DateTimeDisplayProps & React.HTMLAttributes<HTMLSpanElement>): import("react").JSX.Element;
6
+ export declare function DateTimeDisplay(props: DateTimeDisplayProps & React.HTMLAttributes<HTMLSpanElement>): import('react').JSX.Element;
7
7
  export {};
@@ -6,5 +6,5 @@ interface DeleteConfirmationModalProps {
6
6
  isDeleting?: boolean;
7
7
  'data-cy'?: string;
8
8
  }
9
- export declare function DeleteConfirmationModal({ isOpen, onClose, onConfirm, itemName, isDeleting, 'data-cy': dataCy, }: Readonly<DeleteConfirmationModalProps>): import("react").JSX.Element;
9
+ export declare function DeleteConfirmationModal({ isOpen, onClose, onConfirm, itemName, isDeleting, 'data-cy': dataCy, }: Readonly<DeleteConfirmationModalProps>): import('react').JSX.Element;
10
10
  export {};
@@ -1,4 +1,4 @@
1
1
  /** `label` names the indicator for screen readers; it defaults to a generic "Loading". */
2
2
  export declare const TableDataLoadingIndicator: ({ label }: Readonly<{
3
3
  label?: string;
4
- }>) => import("react").JSX.Element;
4
+ }>) => import('react').JSX.Element;
@@ -0,0 +1,15 @@
1
+ import { ComponentType, PropsWithChildren, RefObject } from 'react';
2
+ export interface PageHeaderAccessoryProviderProps {
3
+ /** Rendered beside the actions of the page's main header. It decides itself whether to show anything. */
4
+ accessory: ComponentType;
5
+ }
6
+ /**
7
+ * Host only: plugins must not render this provider, or they replace the host's control on their pages.
8
+ *
9
+ * Lets the host add a page-level control, such as the dashboard pin, to every PageHeader below it, including those
10
+ * of plugin pages. Only the first header in document order shows it, so section headers on the same page never
11
+ * repeat it. Without a provider, PageHeader renders exactly as before.
12
+ */
13
+ export declare function PageHeaderAccessoryProvider({ accessory, children, }: PropsWithChildren<PageHeaderAccessoryProviderProps>): import('react').JSX.Element;
14
+ /** The host accessory for this header, or null when there is none or another header on the page shows it. */
15
+ export declare function usePageHeaderAccessory(header: RefObject<HTMLElement | null>): ComponentType | null;
@@ -35,5 +35,5 @@ interface PageHeaderActionsProps {
35
35
  maxVisible?: number;
36
36
  moreLabel?: string;
37
37
  }
38
- export declare function PageHeaderActions({ actions, maxVisible, moreLabel }: PageHeaderActionsProps): import("react").JSX.Element;
38
+ export declare function PageHeaderActions({ actions, maxVisible, moreLabel }: PageHeaderActionsProps): import('react').JSX.Element;
39
39
  export {};
@@ -2,6 +2,7 @@ import { ReactNode } from 'react';
2
2
  import { PageAction } from './actions';
3
3
  export type { PageAction, PageActionPress, PageActionRender, PageActionTriggerProps, PageActionVariant, } from './actions';
4
4
  export { PageHeaderActions } from './actions';
5
+ export { PageHeaderAccessoryProvider, type PageHeaderAccessoryProviderProps } from './accessory';
5
6
  interface PageHeaderProps {
6
7
  title: string | ReactNode;
7
8
  subtitle?: string | ReactNode;
@@ -15,4 +16,4 @@ interface PageHeaderProps {
15
16
  thumbnailSrc?: string;
16
17
  thumbnailAlt?: string;
17
18
  }
18
- export declare function PageHeader({ title, subtitle, backTo, onBack, actions, maxVisibleActions, moreActionsLabel, icon, noMargin, thumbnailSrc, thumbnailAlt, }: Readonly<PageHeaderProps>): import("react").JSX.Element;
19
+ export declare function PageHeader({ title, subtitle, backTo, onBack, actions, maxVisibleActions, moreActionsLabel, icon, noMargin, thumbnailSrc, thumbnailAlt, }: Readonly<PageHeaderProps>): import('react').JSX.Element;
@@ -29,5 +29,5 @@ interface StatusDialogProps {
29
29
  closeDataCy?: string;
30
30
  'data-cy'?: string;
31
31
  }
32
- export declare function StatusDialog(props: Readonly<StatusDialogProps>): import("react").JSX.Element;
32
+ export declare function StatusDialog(props: Readonly<StatusDialogProps>): import('react').JSX.Element;
33
33
  export {};
@@ -12,4 +12,4 @@ export interface UserSearchProps {
12
12
  afterAutocomplete?: React.ReactNode;
13
13
  afterSelection?: React.ReactNode;
14
14
  }
15
- export declare function UserSearch(props: Readonly<UserSearchProps>): import("react").JSX.Element;
15
+ export declare function UserSearch(props: Readonly<UserSearchProps>): import('react').JSX.Element;
@@ -1,6 +1,8 @@
1
1
  export * from './useDebounce';
2
+ export * from './useDateTimeFormatter';
2
3
  export * from './useFormatDateTime';
3
- export * from './useFormatDuration';
4
+ export * from './useFormatedDuration';
4
5
  export * from './useUrlQuery';
5
6
  export * from './useFormatNumber';
6
- export * from './dateTimePreferences';
7
+ export * from './useDateTimeLocale';
8
+ export * from './useDateTimePreferences';
@@ -0,0 +1,8 @@
1
+ import { ReactNode } from 'react';
2
+ export interface DateTimeOptions {
3
+ showTime?: boolean;
4
+ showDate?: boolean;
5
+ showSeconds?: boolean;
6
+ dateTimeLocale?: string | null;
7
+ }
8
+ export declare function useDateTimeFormatter(options?: DateTimeOptions): (date?: Date | string | number | null, fallback?: string | ReactNode) => ReactNode;
@@ -0,0 +1 @@
1
+ export declare function useDateTimeLocale(override?: string | null): string;
@@ -2,4 +2,3 @@ import { DateTimePreferences } from '../../../libs/shared/src/index.ts';
2
2
  export declare const useDateTimePreferences: import('zustand').UseBoundStore<import('zustand').StoreApi<DateTimePreferences & {
3
3
  userId: number | null;
4
4
  }>>;
5
- export declare function useDateTimeLocale(override?: string | null): string;
@@ -1,8 +1,2 @@
1
- export interface DateTimeOptions {
2
- showTime?: boolean;
3
- showDate?: boolean;
4
- showSeconds?: boolean;
5
- dateTimeLocale?: string | null;
6
- }
7
- export declare function useDateTimeFormatter(options?: DateTimeOptions): (date?: Date | string | number | null, fallback?: string | React.ReactNode) => import('react').ReactNode;
1
+ import { DateTimeOptions } from './useDateTimeFormatter';
8
2
  export declare function useFormatDateTime(date?: Date | string | number | null, options?: DateTimeOptions): import('react').ReactNode;
package/lib/i18n.d.ts CHANGED
@@ -11,6 +11,7 @@ interface TranslationState {
11
11
  explicitLanguage: Language | undefined;
12
12
  setLanguage: (language: Language) => void;
13
13
  }
14
+ /** Global language store: the host app and every plugin's useTranslations hook must follow the same active language. */
14
15
  export declare const useTranslationState: import('zustand').UseBoundStore<import('zustand').StoreApi<TranslationState>>;
15
16
  export type TFunction = (key: string, data?: Record<string, unknown>) => string;
16
17
  /** Retained translations stay reactive; literal API errors remain intact. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@attraccess/plugins-frontend-ui",
3
- "version": "1.11.0-beta.0",
3
+ "version": "1.11.0-beta.2",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/Attraccess/Attraccess.git",