@iquji-web/web-component 0.0.0-stage → 0.1.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.
Files changed (44) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +135 -2
  3. package/dist/calendar.d.ts +27 -0
  4. package/dist/color-picker.d.ts +24 -0
  5. package/dist/confirmation.d.ts +12 -0
  6. package/dist/data-table.d.ts +16 -0
  7. package/dist/date-picker.d.ts +37 -0
  8. package/dist/desktop-account.d.ts +45 -0
  9. package/dist/desktop-rail.d.ts +21 -0
  10. package/dist/desktop-shell.d.ts +9 -0
  11. package/dist/desktop-tabs.d.ts +24 -0
  12. package/dist/desktop-titlebar.d.ts +17 -0
  13. package/dist/drawer.d.ts +24 -0
  14. package/dist/emoji-picker.d.ts +21 -0
  15. package/dist/feedback.d.ts +27 -0
  16. package/dist/floating.d.ts +66 -0
  17. package/dist/form-dialog-resize.d.ts +24 -0
  18. package/dist/form-dialog.d.ts +9 -0
  19. package/dist/form-steps.d.ts +18 -0
  20. package/dist/forms.d.ts +77 -0
  21. package/dist/index.d.ts +139 -0
  22. package/dist/index.js +4920 -0
  23. package/dist/layout.d.ts +15 -0
  24. package/dist/multi-select.d.ts +24 -0
  25. package/dist/navigation.d.ts +17 -0
  26. package/dist/notification.d.ts +27 -0
  27. package/dist/overlay-focus.d.ts +8 -0
  28. package/dist/overlay-layer.d.ts +32 -0
  29. package/dist/overlay-presence.d.ts +6 -0
  30. package/dist/overlay-scope.d.ts +8 -0
  31. package/dist/overlays.d.ts +22 -0
  32. package/dist/pagination.d.ts +13 -0
  33. package/dist/progress-bar.d.ts +12 -0
  34. package/dist/scroll-area.d.ts +10 -0
  35. package/dist/search-dialog.d.ts +26 -0
  36. package/dist/settings-layout.d.ts +24 -0
  37. package/dist/settings-nav.d.ts +31 -0
  38. package/dist/settings-rows.d.ts +53 -0
  39. package/dist/styles.css +4426 -0
  40. package/dist/timeline.d.ts +17 -0
  41. package/dist/tooltip.d.ts +12 -0
  42. package/dist/utils.d.ts +1 -0
  43. package/dist/workbench.d.ts +32 -0
  44. package/package.json +43 -4
@@ -0,0 +1,15 @@
1
+ import type { HTMLAttributes, ReactNode } from "react";
2
+ export type IqujiPageHeaderProps = HTMLAttributes<HTMLElement> & {
3
+ title: ReactNode;
4
+ eyebrow?: ReactNode;
5
+ description?: ReactNode;
6
+ actions?: ReactNode;
7
+ titleId?: string;
8
+ };
9
+ export declare function IqujiPageHeader({ actions, className, description, eyebrow, title, titleId, ...headerProps }: IqujiPageHeaderProps): import("react/jsx-runtime").JSX.Element;
10
+ export type IqujiTableFrameProps = HTMLAttributes<HTMLDivElement> & {
11
+ label: string;
12
+ busy?: boolean;
13
+ toolbar?: ReactNode;
14
+ };
15
+ export declare function IqujiTableFrame({ busy, children, className, label, toolbar, ...divProps }: IqujiTableFrameProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,24 @@
1
+ import type { ReactNode } from "react";
2
+ export type IqujiMultiSelectOption<Value extends string> = {
3
+ value: Value;
4
+ label: ReactNode;
5
+ description?: ReactNode;
6
+ disabled?: boolean;
7
+ };
8
+ export type IqujiMultiSelectProps<Value extends string> = {
9
+ label: string;
10
+ options: readonly IqujiMultiSelectOption<Value>[];
11
+ value: readonly Value[];
12
+ onChange: (value: Value[]) => void;
13
+ placeholder?: string;
14
+ disabled?: boolean;
15
+ searchable?: boolean;
16
+ searchLabel?: string;
17
+ emptyLabel?: string;
18
+ selectAllLabel?: string;
19
+ clearLabel?: string;
20
+ clearOptionLabel?: string;
21
+ variant?: "select" | "tags" | "checkbox";
22
+ className?: string;
23
+ };
24
+ export declare function IqujiMultiSelect<Value extends string>({ className, clearLabel, clearOptionLabel, disabled, emptyLabel, label, onChange, options, placeholder, searchable, searchLabel, selectAllLabel, value, variant, }: IqujiMultiSelectProps<Value>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,17 @@
1
+ import { type ReactNode } from "react";
2
+ export type IqujiTab<Value extends string> = {
3
+ label: ReactNode;
4
+ value: Value;
5
+ disabled?: boolean;
6
+ };
7
+ export type IqujiTabsProps<Value extends string> = {
8
+ id?: string;
9
+ label: string;
10
+ tabs: readonly IqujiTab<Value>[];
11
+ value: Value;
12
+ onChange: (value: Value) => void;
13
+ className?: string;
14
+ panelId?: string;
15
+ variant?: "underline" | "segmented";
16
+ };
17
+ export declare function IqujiTabs<Value extends string>({ id, className, label, onChange, panelId, tabs, value, variant, }: IqujiTabsProps<Value>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,27 @@
1
+ import { type ReactNode } from "react";
2
+ import type { IqujiTone } from "./feedback.js";
3
+ export type IqujiNotificationPlacement = "topLeft" | "topRight" | "bottomLeft" | "bottomRight";
4
+ export type IqujiNotificationOptions = {
5
+ key?: string;
6
+ title: ReactNode;
7
+ description?: ReactNode;
8
+ tone?: Exclude<IqujiTone, "neutral">;
9
+ /** 自动关闭时间,单位毫秒;0 表示保持显示。默认 5000ms。 */
10
+ duration?: number;
11
+ actions?: ReactNode;
12
+ onClose?: () => void;
13
+ };
14
+ export type IqujiNotificationApi = {
15
+ open(options: IqujiNotificationOptions): string;
16
+ close(key?: string): void;
17
+ };
18
+ export type IqujiNotificationProviderProps = {
19
+ children: ReactNode;
20
+ closeLabel: string;
21
+ label?: string;
22
+ placement?: IqujiNotificationPlacement;
23
+ duration?: number;
24
+ maxCount?: number;
25
+ };
26
+ export declare function IqujiNotificationProvider({ children, closeLabel, label, placement, duration, maxCount, }: IqujiNotificationProviderProps): import("react/jsx-runtime").JSX.Element;
27
+ export declare function useIqujiNotification(): IqujiNotificationApi;
@@ -0,0 +1,8 @@
1
+ import { type RefObject } from "react";
2
+ export declare function resolveIqujiOverlayInitialFocus(ref: RefObject<HTMLElement | null> | undefined): (() => true | HTMLElement) | undefined;
3
+ export declare function useIqujiFloatingTriggerRefs(): {
4
+ triggerRef: (element: HTMLElement | null) => void;
5
+ popupRef: (element: HTMLDivElement | null) => void;
6
+ };
7
+ export declare function restoreIqujiOverlayFocus(resolveTarget: () => HTMLElement | boolean): void;
8
+ export declare function useIqujiOverlayReturnFocus(open: boolean | undefined): () => boolean | HTMLElement;
@@ -0,0 +1,32 @@
1
+ import { type FocusEvent, type ReactNode } from "react";
2
+ export declare function useIqujiOverlayModal(open: boolean, isTopLayer: boolean): {
3
+ modal: false | "trap-focus";
4
+ onFocusCapture(event: FocusEvent<HTMLElement>): void;
5
+ };
6
+ type Layer = {
7
+ id: string;
8
+ kind: "drawer" | "dialog";
9
+ order: number;
10
+ ancestors: readonly string[];
11
+ container: HTMLElement | null;
12
+ open: boolean;
13
+ };
14
+ export declare function IqujiOverlayAncestry({ id, children, }: {
15
+ id: string;
16
+ children: ReactNode;
17
+ }): import("react/jsx-runtime").JSX.Element;
18
+ export declare function IqujiOverlayProvider({ children }: {
19
+ children: ReactNode;
20
+ }): import("react/jsx-runtime").JSX.Element;
21
+ export declare function IqujiOverlayBoundary({ children }: {
22
+ children: ReactNode;
23
+ }): string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null | undefined;
24
+ export declare function useIqujiOverlayLayer(id: string, kind: Layer["kind"], active: boolean, open: boolean, container: HTMLElement | null): {
25
+ registered: boolean;
26
+ isTopLayer: boolean;
27
+ backdrop: number;
28
+ surface: number;
29
+ floating: number;
30
+ };
31
+ export declare function useIqujiNotificationContainer(): HTMLElement | undefined;
32
+ export {};
@@ -0,0 +1,6 @@
1
+ export declare function useIqujiOverlayPresence(open: boolean, onCloseComplete?: () => void): {
2
+ active: boolean;
3
+ complete: (nextOpen: boolean) => void;
4
+ notify: () => void;
5
+ };
6
+ export declare function useIqujiOverlayCompletion(presence: ReturnType<typeof useIqujiOverlayPresence>, registered: boolean, finalFocus: () => HTMLElement | boolean): void;
@@ -0,0 +1,8 @@
1
+ import { type ReactNode, type RefObject } from "react";
2
+ export type IqujiOverlayContainer = HTMLElement | ShadowRoot | RefObject<HTMLElement | ShadowRoot | null> | null;
3
+ export type IqujiOverlayScopeProviderProps = {
4
+ children: ReactNode;
5
+ container: IqujiOverlayContainer;
6
+ };
7
+ export declare function IqujiOverlayScopeProvider({ children, container, }: IqujiOverlayScopeProviderProps): import("react/jsx-runtime").JSX.Element;
8
+ export declare function useIqujiOverlayContainer(): IqujiOverlayContainer | undefined;
@@ -0,0 +1,22 @@
1
+ import { type CSSProperties, type HTMLAttributes, type ReactNode, type Ref, type RefObject } from "react";
2
+ export type IqujiDialogProps = Omit<HTMLAttributes<HTMLDivElement>, "children" | "title" | "onClose" | "onCancel"> & {
3
+ open: boolean;
4
+ onOpenChange?: ((open: boolean) => void) | undefined;
5
+ onCloseComplete?: (() => void) | undefined;
6
+ title?: ReactNode;
7
+ description?: ReactNode;
8
+ heading?: ReactNode;
9
+ headerActions?: ReactNode;
10
+ closeLabel?: string | undefined;
11
+ children?: ReactNode;
12
+ actions?: ReactNode;
13
+ initialFocusRef?: RefObject<HTMLElement | null> | undefined;
14
+ popupRef?: Ref<HTMLDivElement> | undefined;
15
+ mandatory?: boolean | undefined;
16
+ destroyOnClose?: boolean | undefined;
17
+ size?: "sm" | "md" | "lg" | undefined;
18
+ surface?: "panel" | "glass" | undefined;
19
+ layout?: "standard" | "compact" | undefined;
20
+ width?: CSSProperties["width"] | undefined;
21
+ };
22
+ export declare function IqujiDialog(props: IqujiDialogProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,13 @@
1
+ import type { ReactNode } from "react";
2
+ export type IqujiPaginationProps = {
3
+ page: number;
4
+ pageSize: number;
5
+ total: number;
6
+ label: string;
7
+ previousLabel: string;
8
+ nextLabel: string;
9
+ summary?: (total: number, range: [number, number]) => ReactNode;
10
+ onPageChange?: (page: number, pageSize: number) => void;
11
+ className?: string;
12
+ };
13
+ export declare function IqujiPagination({ page, pageSize, total, label, previousLabel, nextLabel, summary, onPageChange, className, }: IqujiPaginationProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,12 @@
1
+ import type { HTMLAttributes, ReactNode } from "react";
2
+ export type IqujiProgressTone = "neutral" | "info" | "success" | "warning" | "danger";
3
+ export type IqujiProgressBarProps = Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
4
+ label: string;
5
+ value?: number;
6
+ max?: number;
7
+ tone?: IqujiProgressTone;
8
+ indeterminate?: boolean;
9
+ showValue?: boolean;
10
+ formatValue?: (value: number, max: number) => ReactNode;
11
+ };
12
+ export declare function IqujiProgressBar({ className, formatValue, indeterminate, label, max, showValue, tone, value, ...divProps }: IqujiProgressBarProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import type { HTMLAttributes, ReactNode } from "react";
2
+ export type IqujiScrollAreaProps = Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
3
+ label: string;
4
+ children?: ReactNode;
5
+ height?: number | string;
6
+ maxHeight?: number | string;
7
+ orientation?: "vertical" | "horizontal" | "both";
8
+ tabIndex?: number;
9
+ };
10
+ export declare function IqujiScrollArea({ children, className, height, label, maxHeight, orientation, style, tabIndex, ...divProps }: IqujiScrollAreaProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,26 @@
1
+ import { type ReactNode } from "react";
2
+ export type IqujiSearchDialogItem = {
3
+ id: string;
4
+ title: string;
5
+ description?: string | undefined;
6
+ metadata?: ReactNode;
7
+ icon?: ReactNode;
8
+ keywords?: string | undefined;
9
+ disabled?: boolean | undefined;
10
+ };
11
+ export type IqujiSearchDialogGroup = {
12
+ id: string;
13
+ label: string;
14
+ items: readonly IqujiSearchDialogItem[];
15
+ };
16
+ export type IqujiSearchDialogProps = {
17
+ open: boolean;
18
+ onOpenChange(open: boolean): void;
19
+ title: string;
20
+ placeholder: string;
21
+ emptyLabel: string;
22
+ closeLabel: string;
23
+ groups: readonly IqujiSearchDialogGroup[];
24
+ onSelect(id: string): void;
25
+ };
26
+ export declare function IqujiSearchDialog({ open, onOpenChange, title, placeholder, emptyLabel, closeLabel, groups, onSelect, }: IqujiSearchDialogProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,24 @@
1
+ import { type HTMLAttributes, type ReactNode } from "react";
2
+ export type IqujiSettingsLayoutProps = Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
3
+ navigation: ReactNode;
4
+ children: ReactNode;
5
+ navigationClassName?: string | undefined;
6
+ contentClassName?: string | undefined;
7
+ };
8
+ export declare function IqujiSettingsLayout({ navigation, children, className, navigationClassName, contentClassName, ...divProps }: IqujiSettingsLayoutProps): import("react/jsx-runtime").JSX.Element;
9
+ export type IqujiSettingsContentProps = Omit<HTMLAttributes<HTMLElement>, "children" | "title"> & {
10
+ title: ReactNode;
11
+ titleId?: string | undefined;
12
+ description?: ReactNode;
13
+ actions?: ReactNode;
14
+ children?: ReactNode;
15
+ };
16
+ export declare function IqujiSettingsContent({ actions, children, className, description, title, titleId, ...sectionProps }: IqujiSettingsContentProps): import("react/jsx-runtime").JSX.Element;
17
+ export type IqujiSettingsSectionProps = Omit<HTMLAttributes<HTMLElement>, "children" | "title"> & {
18
+ title: ReactNode;
19
+ titleId?: string | undefined;
20
+ description?: ReactNode;
21
+ actions?: ReactNode;
22
+ children?: ReactNode;
23
+ };
24
+ export declare function IqujiSettingsSection({ actions, children, className, description, title, titleId, ...sectionProps }: IqujiSettingsSectionProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,31 @@
1
+ import type { ReactNode } from "react";
2
+ export type IqujiSettingsNavItem = {
3
+ key: string;
4
+ label: ReactNode;
5
+ icon?: ReactNode;
6
+ active?: boolean;
7
+ disabled?: boolean;
8
+ href?: string;
9
+ onSelect?: (() => void) | undefined;
10
+ trailing?: ReactNode;
11
+ };
12
+ export type IqujiSettingsNavGroup = {
13
+ key: string;
14
+ label?: ReactNode;
15
+ items: readonly IqujiSettingsNavItem[];
16
+ };
17
+ export type IqujiSettingsNavSearch = {
18
+ label: string;
19
+ placeholder?: string;
20
+ value: string;
21
+ onChange: (value: string) => void;
22
+ };
23
+ export type IqujiSettingsNavProps = {
24
+ label: string;
25
+ groups: readonly IqujiSettingsNavGroup[];
26
+ header?: ReactNode;
27
+ search?: IqujiSettingsNavSearch;
28
+ emptyLabel?: ReactNode;
29
+ className?: string | undefined;
30
+ };
31
+ export declare function IqujiSettingsNav({ label, groups, header, search, emptyLabel, className, }: IqujiSettingsNavProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,53 @@
1
+ import type { ReactNode } from "react";
2
+ import { type IqujiSelectOption, type IqujiSelectOptionGroup, type IqujiSwitchProps } from "./forms.js";
3
+ export type IqujiSettingsRowProps = {
4
+ label: ReactNode;
5
+ description?: ReactNode;
6
+ control: ReactNode;
7
+ htmlFor?: string | undefined;
8
+ labelId?: string | undefined;
9
+ descriptionId?: string | undefined;
10
+ align?: "center" | "start" | undefined;
11
+ disabled?: boolean | undefined;
12
+ className?: string | undefined;
13
+ labelClassName?: string | undefined;
14
+ controlClassName?: string | undefined;
15
+ };
16
+ export declare function IqujiSettingsRow({ label, description, control, htmlFor, labelId, descriptionId, align, disabled, className, labelClassName, controlClassName, }: IqujiSettingsRowProps): import("react/jsx-runtime").JSX.Element;
17
+ export type IqujiSettingsSwitchRowProps = Omit<IqujiSwitchProps, "className"> & {
18
+ className?: string | undefined;
19
+ };
20
+ export declare function IqujiSettingsSwitchRow({ className, ...props }: IqujiSettingsSwitchRowProps): import("react/jsx-runtime").JSX.Element;
21
+ export type IqujiSettingsSelectRowProps<Value> = {
22
+ label: ReactNode;
23
+ description?: ReactNode;
24
+ options: readonly IqujiSelectOption<Value>[];
25
+ groups?: readonly IqujiSelectOptionGroup<Value>[] | undefined;
26
+ value?: Value | null | undefined;
27
+ defaultValue?: Value | null | undefined;
28
+ onValueChange?: ((value: Value | null) => void) | undefined;
29
+ placeholder?: ReactNode;
30
+ disabled?: boolean | undefined;
31
+ invalid?: boolean | undefined;
32
+ required?: boolean | undefined;
33
+ compact?: boolean | undefined;
34
+ name?: string | undefined;
35
+ id?: string | undefined;
36
+ align?: "center" | "start" | undefined;
37
+ className?: string | undefined;
38
+ labelClassName?: string | undefined;
39
+ controlClassName?: string | undefined;
40
+ };
41
+ export declare function IqujiSettingsSelectRow<Value>({ label, description, options, groups, value, defaultValue, onValueChange, placeholder, disabled, invalid, required, compact, name, id, align, className, labelClassName, controlClassName, }: IqujiSettingsSelectRowProps<Value>): import("react/jsx-runtime").JSX.Element;
42
+ export type IqujiSettingsActionRowProps = {
43
+ label: ReactNode;
44
+ description?: ReactNode;
45
+ value?: ReactNode;
46
+ action?: ReactNode;
47
+ disabled?: boolean | undefined;
48
+ align?: "center" | "start" | undefined;
49
+ className?: string | undefined;
50
+ valueClassName?: string | undefined;
51
+ controlClassName?: string | undefined;
52
+ };
53
+ export declare function IqujiSettingsActionRow({ label, description, value, action, disabled, align, className, valueClassName, controlClassName, }: IqujiSettingsActionRowProps): import("react/jsx-runtime").JSX.Element;