@mechane-ai/elements 0.4.0 → 0.5.0
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.
- package/README.md +41 -29
- package/dist/ai.js +6 -6
- package/dist/assets/stylex.css +92 -0
- package/dist/{categorical-values-cMX7Mykq.js → categorical-values-BfAEQUd0.js} +1 -1
- package/dist/{chart-input-qnM44oen.js → chart-input--VSrlMl-.js} +1 -1
- package/dist/charts/cartesian.js +49 -49
- package/dist/charts/distribution.js +1 -1
- package/dist/charts/graph.js +1 -1
- package/dist/charts/hierarchy.js +2 -2
- package/dist/charts/matrix.js +1 -1
- package/dist/collections.js +439 -214
- package/dist/content/diff.js +13 -11
- package/dist/content/markdown.js +151 -80
- package/dist/content/tree.js +1 -1
- package/dist/csp.js +1 -0
- package/dist/feedback.js +1 -1
- package/dist/forms.js +1 -1
- package/dist/layout.js +210 -136
- package/dist/navigation/commands.js +1 -1
- package/dist/navigation.js +36 -11
- package/dist/packages/collections/src/collection-scroll.d.ts +19 -0
- package/dist/packages/collections/src/data-table.d.ts +20 -3
- package/dist/packages/collections/src/index.d.ts +3 -1
- package/dist/packages/collections/src/use-end-reached.d.ts +9 -0
- package/dist/packages/content/src/markdown/index.d.ts +2 -0
- package/dist/packages/content/src/markdown/markdown-options.d.ts +2 -0
- package/dist/packages/content/src/markdown/markdown-preview.d.ts +5 -0
- package/dist/packages/content/src/markdown/markdown.d.ts +4 -1
- package/dist/packages/feedback/src/async-region.d.ts +17 -0
- package/dist/packages/feedback/src/index.d.ts +2 -0
- package/dist/packages/feedback/src/skeleton.d.ts +4 -3
- package/dist/packages/forms/src/index.d.ts +2 -0
- package/dist/packages/forms/src/settings-section.d.ts +7 -0
- package/dist/packages/foundations/src/csp/index.d.ts +2 -0
- package/dist/packages/layout/src/app-shell.d.ts +2 -1
- package/dist/packages/layout/src/frame.stylex.d.ts +2 -0
- package/dist/packages/layout/src/index.d.ts +2 -0
- package/dist/packages/layout/src/record-page.d.ts +42 -0
- package/dist/packages/layout/src/sidebar.d.ts +1 -0
- package/dist/packages/navigation/src/index.d.ts +2 -0
- package/dist/packages/navigation/src/page-navigation.d.ts +14 -0
- package/dist/{pierre-tree-qZVvI5c1.js → pierre-tree-LY7PGy-7.js} +1 -1
- package/dist/src-CbJTK9oP.js +360 -0
- package/dist/{src-CvpS9XIR.js → src-CjnbzSgq.js} +353 -336
- package/package.json +5 -1
- package/dist/src-BfvOOeA3.js +0 -272
|
@@ -6,6 +6,8 @@ export type DataTableColumn<Row> = {
|
|
|
6
6
|
readonly cell: (row: Row) => ReactNode;
|
|
7
7
|
readonly align?: ColumnAlignment;
|
|
8
8
|
readonly width?: number;
|
|
9
|
+
readonly secondary?: boolean;
|
|
10
|
+
readonly truncate?: boolean;
|
|
9
11
|
readonly sortable?: boolean;
|
|
10
12
|
};
|
|
11
13
|
export type DataTableSort = {
|
|
@@ -13,9 +15,18 @@ export type DataTableSort = {
|
|
|
13
15
|
readonly direction: 'ascending' | 'descending';
|
|
14
16
|
};
|
|
15
17
|
export type DataTableWindow = {
|
|
16
|
-
readonly height: number;
|
|
18
|
+
readonly height: number | 'fill';
|
|
17
19
|
readonly estimatedRowHeight?: number;
|
|
18
20
|
};
|
|
21
|
+
export type DataTableRowAction<Row> = {
|
|
22
|
+
readonly label?: (row: Row) => string;
|
|
23
|
+
} & ({
|
|
24
|
+
readonly href: (row: Row) => string;
|
|
25
|
+
readonly onActivate?: (row: Row) => void;
|
|
26
|
+
} | {
|
|
27
|
+
readonly href?: never;
|
|
28
|
+
readonly onActivate: (row: Row) => void;
|
|
29
|
+
});
|
|
19
30
|
type SortProperties<Row> = {
|
|
20
31
|
readonly columns: ReadonlyArray<DataTableColumn<Row>>;
|
|
21
32
|
readonly sort: DataTableSort | undefined;
|
|
@@ -41,9 +52,15 @@ export type DataTableProps<Row> = SortProperties<Row> & OptionalSelection<Row> &
|
|
|
41
52
|
readonly rows: ReadonlyArray<Row>;
|
|
42
53
|
readonly getRowId: (row: Row) => string;
|
|
43
54
|
readonly caption: string;
|
|
44
|
-
readonly empty:
|
|
55
|
+
readonly empty: ReactNode;
|
|
56
|
+
readonly rowAction?: DataTableRowAction<Row>;
|
|
57
|
+
readonly activeRowId?: string;
|
|
58
|
+
readonly hideCaption?: boolean;
|
|
59
|
+
readonly hideHeaders?: boolean;
|
|
45
60
|
readonly window?: DataTableWindow;
|
|
61
|
+
readonly endContent?: ReactNode;
|
|
62
|
+
readonly onEndReached?: () => void;
|
|
46
63
|
readonly footer?: ReactNode;
|
|
47
64
|
};
|
|
48
|
-
export declare function DataTable<Row extends object>({ rows, columns, getRowId, caption, empty, sort, onSortChange, selectedIds, onSelectionChange, selectionLabel, window, footer, }: DataTableProps<Row>): ReactNode;
|
|
65
|
+
export declare function DataTable<Row extends object>({ rows, columns, getRowId, caption, empty, sort, onSortChange, selectedIds, onSelectionChange, selectionLabel, rowAction, activeRowId, hideCaption, hideHeaders, window, endContent, onEndReached, footer, }: DataTableProps<Row>): ReactNode;
|
|
49
66
|
export {};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
export type { CollectionToolbarProps, FilterChip, FilterChipsProps, ColumnChoice, ColumnControlsProps, CollectionPaginationProps, } from './collection-controls.tsx';
|
|
2
2
|
export { CollectionToolbar, FilterChips, ColumnControls, CollectionPagination } from './collection-controls.tsx';
|
|
3
|
-
export type { DataTableColumn, DataTableSort, DataTableWindow, DataTableProps } from './data-table.tsx';
|
|
3
|
+
export type { DataTableColumn, DataTableSort, DataTableWindow, DataTableProps, DataTableRowAction, } from './data-table.tsx';
|
|
4
4
|
export { DataTable } from './data-table.tsx';
|
|
5
|
+
export type { CollectionEndProps, CollectionScrollProps } from './collection-scroll.tsx';
|
|
6
|
+
export { CollectionEnd, CollectionScroll } from './collection-scroll.tsx';
|
|
5
7
|
export { Inspector, Details } from './inspector.tsx';
|
|
6
8
|
export { ListFooter } from './list-footer.tsx';
|
|
7
9
|
export { MetricGrid, Metric } from './metrics.tsx';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { RefObject } from 'react';
|
|
2
|
+
type EndReachedOptions = {
|
|
3
|
+
readonly end: RefObject<HTMLElement | null>;
|
|
4
|
+
readonly viewport?: RefObject<HTMLElement | null> | undefined;
|
|
5
|
+
readonly onEndReached?: (() => void) | undefined;
|
|
6
|
+
readonly content: unknown;
|
|
7
|
+
};
|
|
8
|
+
export declare function useEndReached({ end, viewport, onEndReached, content }: EndReachedOptions): void;
|
|
9
|
+
export {};
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
+
type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
|
|
2
3
|
export type MarkdownProps = {
|
|
3
4
|
readonly children: string;
|
|
4
5
|
readonly streaming?: boolean;
|
|
5
6
|
readonly label?: string;
|
|
7
|
+
readonly headingLevel?: HeadingLevel;
|
|
6
8
|
};
|
|
7
|
-
export declare function Markdown({ children, streaming, label }: MarkdownProps): ReactNode;
|
|
9
|
+
export declare function Markdown({ children, streaming, label, headingLevel }: MarkdownProps): ReactNode;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export type ContentRevealProps = {
|
|
3
|
+
readonly enter: boolean;
|
|
4
|
+
readonly fill?: boolean | undefined;
|
|
5
|
+
readonly children: ReactNode;
|
|
6
|
+
};
|
|
7
|
+
export declare function ContentReveal({ enter, fill, children }: ContentRevealProps): ReactNode;
|
|
8
|
+
export type AsyncRegionProps = {
|
|
9
|
+
readonly pending: boolean;
|
|
10
|
+
readonly label: string;
|
|
11
|
+
readonly placeholder: ReactNode;
|
|
12
|
+
readonly children?: ReactNode;
|
|
13
|
+
readonly fill?: boolean | undefined;
|
|
14
|
+
readonly startedAt?: number | undefined;
|
|
15
|
+
readonly delayMs?: number | undefined;
|
|
16
|
+
};
|
|
17
|
+
export declare function AsyncRegion({ pending, label, placeholder, children, fill, startedAt, delayMs, }: AsyncRegionProps): ReactNode;
|
|
@@ -5,3 +5,5 @@ export { Progress, Meter } from './progress.tsx';
|
|
|
5
5
|
export type { SkeletonProps, SkeletonTextProps, SpinnerProps } from './skeleton.tsx';
|
|
6
6
|
export { Skeleton, SkeletonText, Spinner } from './skeleton.tsx';
|
|
7
7
|
export { Toast } from './toast.tsx';
|
|
8
|
+
export type { AsyncRegionProps, ContentRevealProps } from './async-region.tsx';
|
|
9
|
+
export { AsyncRegion, ContentReveal } from './async-region.tsx';
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
type SkeletonShape = 'rectangle' | 'circle';
|
|
3
3
|
export type SkeletonProps = {
|
|
4
|
-
readonly width?: number |
|
|
5
|
-
readonly height?: number;
|
|
4
|
+
readonly width?: number | string;
|
|
5
|
+
readonly height?: number | string;
|
|
6
6
|
readonly shape?: SkeletonShape;
|
|
7
7
|
};
|
|
8
8
|
export type SkeletonTextProps = {
|
|
9
9
|
readonly lines?: number;
|
|
10
|
+
readonly width?: number | string;
|
|
10
11
|
};
|
|
11
12
|
export type SpinnerProps = {
|
|
12
13
|
readonly label: string;
|
|
13
14
|
readonly showLabel?: boolean;
|
|
14
15
|
};
|
|
15
16
|
export declare function Skeleton({ width, height, shape }: SkeletonProps): ReactNode;
|
|
16
|
-
export declare function SkeletonText({ lines }: SkeletonTextProps): ReactNode;
|
|
17
|
+
export declare function SkeletonText({ lines, width }: SkeletonTextProps): ReactNode;
|
|
17
18
|
export declare function Spinner({ label, showLabel }: SpinnerProps): ReactNode;
|
|
18
19
|
export {};
|
|
@@ -5,3 +5,5 @@ export { Select } from './select.tsx';
|
|
|
5
5
|
export { Checkbox, RadioGroup, Switch, ToggleGroup } from './selection.tsx';
|
|
6
6
|
export type { SettingsRowProps } from './settings-row.tsx';
|
|
7
7
|
export { SettingsRow } from './settings-row.tsx';
|
|
8
|
+
export type { SettingsSectionProps } from './settings-section.tsx';
|
|
9
|
+
export { SettingsSection } from './settings-section.tsx';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export type SettingsSectionProps = {
|
|
3
|
+
readonly title: string;
|
|
4
|
+
readonly description?: string;
|
|
5
|
+
readonly children: ReactNode;
|
|
6
|
+
};
|
|
7
|
+
export declare function SettingsSection({ title, description, children }: SettingsSectionProps): ReactNode;
|
|
@@ -4,6 +4,7 @@ type AppShellProps = {
|
|
|
4
4
|
readonly sidebar: ReactNode;
|
|
5
5
|
readonly footer?: ReactNode;
|
|
6
6
|
readonly children: ReactNode;
|
|
7
|
+
readonly mainId?: string;
|
|
7
8
|
};
|
|
8
|
-
export declare function AppShell({ sidebarHeader, sidebar, footer, children }: AppShellProps): ReactNode;
|
|
9
|
+
export declare function AppShell({ sidebarHeader, sidebar, footer, children, mainId }: AppShellProps): ReactNode;
|
|
9
10
|
export {};
|
|
@@ -13,6 +13,8 @@ export declare const frame: stylex.VarGroup<Readonly<{
|
|
|
13
13
|
detailBottom: string;
|
|
14
14
|
detailMobileTop: string;
|
|
15
15
|
detailMobileBottom: string;
|
|
16
|
+
recordContentWidth: string;
|
|
17
|
+
recordAsideWidth: string;
|
|
16
18
|
}>, symbol>;
|
|
17
19
|
export declare const frameConditions: {
|
|
18
20
|
sidebarMobile: string;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export { AppShell } from './app-shell.tsx';
|
|
2
2
|
export { DetailPage } from './detail-page.tsx';
|
|
3
3
|
export { PageToolbar, ToolbarAction } from './page-toolbar.tsx';
|
|
4
|
+
export type { RecordPageRootProps, RecordPageToolbarProps, RecordPageBodyProps, RecordPageHeaderProps, RecordPageContentProps, RecordPageAsideProps, } from './record-page.tsx';
|
|
5
|
+
export { RecordPage } from './record-page.tsx';
|
|
4
6
|
export type { ResizableRootProps, ResizablePaneProps, ResizableHandleProps } from './resizable.tsx';
|
|
5
7
|
export { Resizable } from './resizable.tsx';
|
|
6
8
|
export { Navigation, NavigationItem, NavigationLink, SidebarLabel, SidebarFooter } from './sidebar.tsx';
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { ReactNode, Ref } from 'react';
|
|
2
|
+
export type RecordPageRootProps = {
|
|
3
|
+
readonly children: ReactNode;
|
|
4
|
+
};
|
|
5
|
+
export type RecordPageBodyProps = {
|
|
6
|
+
readonly children: ReactNode;
|
|
7
|
+
};
|
|
8
|
+
export type RecordPageContentProps = {
|
|
9
|
+
readonly children: ReactNode;
|
|
10
|
+
};
|
|
11
|
+
export type RecordPageToolbarProps = {
|
|
12
|
+
readonly backLabel: string;
|
|
13
|
+
readonly backHref: string;
|
|
14
|
+
readonly onBack?: () => void;
|
|
15
|
+
readonly actions?: ReactNode;
|
|
16
|
+
readonly navigation?: boolean;
|
|
17
|
+
};
|
|
18
|
+
export type RecordPageHeaderProps = {
|
|
19
|
+
readonly title: ReactNode;
|
|
20
|
+
readonly description?: ReactNode;
|
|
21
|
+
readonly icon?: ReactNode;
|
|
22
|
+
readonly titleRef?: Ref<HTMLHeadingElement>;
|
|
23
|
+
};
|
|
24
|
+
export type RecordPageAsideProps = {
|
|
25
|
+
readonly children: ReactNode;
|
|
26
|
+
readonly label?: string;
|
|
27
|
+
};
|
|
28
|
+
declare function RecordPageRoot({ children }: RecordPageRootProps): ReactNode;
|
|
29
|
+
declare function RecordPageToolbar({ backLabel, backHref, onBack, actions, navigation, }: RecordPageToolbarProps): ReactNode;
|
|
30
|
+
declare function RecordPageBody({ children }: RecordPageBodyProps): ReactNode;
|
|
31
|
+
declare function RecordPageContent({ children }: RecordPageContentProps): ReactNode;
|
|
32
|
+
declare function RecordPageHeader({ title, description, icon, titleRef }: RecordPageHeaderProps): ReactNode;
|
|
33
|
+
declare function RecordPageAside({ children, label }: RecordPageAsideProps): ReactNode;
|
|
34
|
+
export declare const RecordPage: {
|
|
35
|
+
Root: typeof RecordPageRoot;
|
|
36
|
+
Toolbar: typeof RecordPageToolbar;
|
|
37
|
+
Body: typeof RecordPageBody;
|
|
38
|
+
Content: typeof RecordPageContent;
|
|
39
|
+
Header: typeof RecordPageHeader;
|
|
40
|
+
Aside: typeof RecordPageAside;
|
|
41
|
+
};
|
|
42
|
+
export {};
|
|
@@ -6,6 +6,7 @@ type SidebarState = {
|
|
|
6
6
|
readonly sidebarId: string;
|
|
7
7
|
readonly drawerHandle: ReturnType<typeof Drawer.createHandle>;
|
|
8
8
|
readonly navigationToggleRef: RefObject<HTMLButtonElement | null>;
|
|
9
|
+
readonly mobileNavigationToggleRef: RefObject<HTMLButtonElement | null>;
|
|
9
10
|
readonly onToggle: () => void;
|
|
10
11
|
readonly onNavigate: () => void;
|
|
11
12
|
};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
export { Kbd, Breadcrumb } from './navigation.tsx';
|
|
2
|
+
export type { PageNavigationItem, PageNavigationProps } from './page-navigation.tsx';
|
|
3
|
+
export { PageNavigation } from './page-navigation.tsx';
|
|
2
4
|
export { SkipLink } from './skip-link.tsx';
|
|
3
5
|
export { Tabs } from './tabs.tsx';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export type PageNavigationItem<ItemId extends string = string> = {
|
|
3
|
+
readonly id: ItemId;
|
|
4
|
+
readonly label: string;
|
|
5
|
+
readonly href: string;
|
|
6
|
+
};
|
|
7
|
+
export type PageNavigationProps<ItemId extends string = string> = {
|
|
8
|
+
readonly items: ReadonlyArray<PageNavigationItem<ItemId>>;
|
|
9
|
+
readonly selectedId: ItemId;
|
|
10
|
+
readonly onNavigate?: (id: ItemId) => void;
|
|
11
|
+
readonly label?: string;
|
|
12
|
+
readonly embedded?: boolean;
|
|
13
|
+
};
|
|
14
|
+
export declare function PageNavigation<ItemId extends string>({ items, selectedId, onNavigate, label, embedded, }: PageNavigationProps<ItemId>): ReactNode;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { c as e } from "./src-CbYaLvhD.js";
|
|
2
|
-
import {
|
|
2
|
+
import { l as t } from "./src-CjnbzSgq.js";
|
|
3
3
|
import { conditions as n } from "./tokens.js";
|
|
4
4
|
import { r } from "./pierre-theme-BpESNIsV.js";
|
|
5
5
|
import * as i from "@stylexjs/stylex";
|
|
@@ -0,0 +1,360 @@
|
|
|
1
|
+
import { i as e, s as t } from "./src-CbYaLvhD.js";
|
|
2
|
+
import { t as n } from "./accessibility-C-aIZ1Yx.js";
|
|
3
|
+
import { n as r, t as i } from "./popup-styles-CvtZDE2t.js";
|
|
4
|
+
import { t as a } from "./style-composition-uYlczSsB.js";
|
|
5
|
+
import { mergeProps as o } from "@base-ui/react/merge-props";
|
|
6
|
+
import * as s from "@stylexjs/stylex";
|
|
7
|
+
import { createContext as c, useContext as l, useEffect as u, useState as d } from "react";
|
|
8
|
+
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
9
|
+
import { Box as m, LoaderCircle as h } from "lucide-react";
|
|
10
|
+
import { Meter as g } from "@base-ui/react/meter";
|
|
11
|
+
import { Progress as _ } from "@base-ui/react/progress";
|
|
12
|
+
import { Toast as v } from "@base-ui/react/toast";
|
|
13
|
+
// packages/feedback/src/feedback.tsx
|
|
14
|
+
function y({ title: n, children: r, action: i, ...a }) {
|
|
15
|
+
return /* @__PURE__ */ p("div", {
|
|
16
|
+
...o({ className: "x78zum5 xdt5ytf x6s0dn4 xl56j7k x2b8uid x1iefggq xnx3t7k x1n8ia3y x1hz01jw xvmahel" }, a),
|
|
17
|
+
children: [
|
|
18
|
+
/* @__PURE__ */ f(m, {
|
|
19
|
+
size: 22,
|
|
20
|
+
"aria-hidden": !0,
|
|
21
|
+
className: "x153jb6y x1kk91vl"
|
|
22
|
+
}),
|
|
23
|
+
/* @__PURE__ */ f(t, { children: n }),
|
|
24
|
+
/* @__PURE__ */ f(e, { children: r }),
|
|
25
|
+
i
|
|
26
|
+
]
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
function b({ error: e = !1, ...t }) {
|
|
30
|
+
return /* @__PURE__ */ f("div", { ...o({ role: e ? "alert" : "status" }, {
|
|
31
|
+
0: { className: "xp59q4u x1doqdfy x1ok0vyi x1hz01jw xvmahel xtqrqnz x1778rvt x1dqe72f x1f9ixgr xj0a0fe" },
|
|
32
|
+
1: { className: "xp59q4u x1doqdfy x1ok0vyi x1hz01jw xvmahel xtqrqnz x1778rvt xj0a0fe xr5kp14 xcqwzn" }
|
|
33
|
+
}[!!e | 0], t) });
|
|
34
|
+
}
|
|
35
|
+
// packages/feedback/src/skeleton.tsx
|
|
36
|
+
var x = {
|
|
37
|
+
skeleton: {
|
|
38
|
+
k1xSpc: "x1lliihq",
|
|
39
|
+
ks0D6T: "x193iq5w",
|
|
40
|
+
kWkggS: "x1r7kqkb",
|
|
41
|
+
kaIpWk: "x1ok0vyi",
|
|
42
|
+
kmuXW: "x2lah0s",
|
|
43
|
+
$$css: !0
|
|
44
|
+
},
|
|
45
|
+
dimensions: (e, t) => [{
|
|
46
|
+
kzqmXN: e == null ? e : "x5lhr3w",
|
|
47
|
+
kZKoxP: t == null ? t : "x16ye13r",
|
|
48
|
+
$$css: !0
|
|
49
|
+
}, {
|
|
50
|
+
"--x-width": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(e),
|
|
51
|
+
"--x-height": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(t)
|
|
52
|
+
}],
|
|
53
|
+
width: (e) => [{
|
|
54
|
+
kzqmXN: e == null ? e : "x5lhr3w",
|
|
55
|
+
$$css: !0
|
|
56
|
+
}, { "--x-width": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(e) }],
|
|
57
|
+
circle: {
|
|
58
|
+
kaIpWk: "x16rqkct",
|
|
59
|
+
$$css: !0
|
|
60
|
+
},
|
|
61
|
+
rectangle: { $$css: !0 },
|
|
62
|
+
text: {
|
|
63
|
+
k1xSpc: "x3nfvp2",
|
|
64
|
+
kXwgrk: "xdt5ytf",
|
|
65
|
+
ks0D6T: "x193iq5w",
|
|
66
|
+
kXLuUW: "x16dsc37",
|
|
67
|
+
$$css: !0
|
|
68
|
+
}
|
|
69
|
+
}, S = {
|
|
70
|
+
rectangle: x.rectangle,
|
|
71
|
+
circle: x.circle
|
|
72
|
+
};
|
|
73
|
+
function C({ width: e = "100%", height: t = 8, shape: n = "rectangle" }) {
|
|
74
|
+
return /* @__PURE__ */ f("span", {
|
|
75
|
+
"aria-hidden": !0,
|
|
76
|
+
...s.props(x.skeleton, x.dimensions(e, t), S[n])
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
function w({ lines: e = 1, width: t = "100%" }) {
|
|
80
|
+
return /* @__PURE__ */ f("span", {
|
|
81
|
+
"aria-hidden": !0,
|
|
82
|
+
...s.props(x.text, x.width(t)),
|
|
83
|
+
children: Array.from({ length: e }, (t, n) => /* @__PURE__ */ f("span", {
|
|
84
|
+
className: "x78zum5 x6s0dn4 xg2ss61",
|
|
85
|
+
children: /* @__PURE__ */ f(C, {
|
|
86
|
+
width: e > 1 && n === e - 1 ? "65%" : "100%",
|
|
87
|
+
height: "0.6em"
|
|
88
|
+
})
|
|
89
|
+
}, `placeholder-${n}`))
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
function T({ label: e, showLabel: t = !1 }) {
|
|
93
|
+
return /* @__PURE__ */ p("span", {
|
|
94
|
+
role: "status",
|
|
95
|
+
className: "x3nfvp2 x1n2onr6 x6s0dn4 x1hnptsi x153jb6y x1hz01jw xtqrqnz x1778rvt",
|
|
96
|
+
children: [/* @__PURE__ */ f(h, {
|
|
97
|
+
"aria-hidden": !0,
|
|
98
|
+
className: "xtwnzbg x18utl2x x2lah0s"
|
|
99
|
+
}), /* @__PURE__ */ f("span", {
|
|
100
|
+
...s.props(!t && n.hidden),
|
|
101
|
+
children: e
|
|
102
|
+
})]
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
// packages/feedback/src/loading.tsx
|
|
106
|
+
function E({ label: e, shape: t = "rows" }) {
|
|
107
|
+
return /* @__PURE__ */ p("div", {
|
|
108
|
+
role: "status",
|
|
109
|
+
className: "xeuugli x1n2onr6",
|
|
110
|
+
children: [/* @__PURE__ */ f("span", {
|
|
111
|
+
...s.props(n.hidden),
|
|
112
|
+
children: e
|
|
113
|
+
}), t === "rows" ? /* @__PURE__ */ p("div", {
|
|
114
|
+
"aria-hidden": !0,
|
|
115
|
+
children: [/* @__PURE__ */ f("div", {
|
|
116
|
+
className: "xrvj5dj x18zg5m9 x18hwk67 x6s0dn4 x1m92p3w xu0aao5 xso031l x1q0q8m5 x1qndepd",
|
|
117
|
+
children: /* @__PURE__ */ f(C, { width: 54 })
|
|
118
|
+
}), [
|
|
119
|
+
0,
|
|
120
|
+
1,
|
|
121
|
+
2
|
|
122
|
+
].map((e) => /* @__PURE__ */ p("div", {
|
|
123
|
+
className: "xrvj5dj x18zg5m9 x18hwk67 x6s0dn4 xse5ku5 x1m92p3w",
|
|
124
|
+
children: [
|
|
125
|
+
/* @__PURE__ */ f(C, { width: e === 1 ? 108 : 174 }),
|
|
126
|
+
/* @__PURE__ */ f(C, { width: 54 }),
|
|
127
|
+
/* @__PURE__ */ f(C, { width: 108 })
|
|
128
|
+
]
|
|
129
|
+
}, e))]
|
|
130
|
+
}) : /* @__PURE__ */ p("div", {
|
|
131
|
+
"aria-hidden": !0,
|
|
132
|
+
className: "xrvj5dj x1c1vhfx x1xn8qrt",
|
|
133
|
+
children: [
|
|
134
|
+
/* @__PURE__ */ f(C, {
|
|
135
|
+
width: 216,
|
|
136
|
+
height: 24
|
|
137
|
+
}),
|
|
138
|
+
/* @__PURE__ */ f(C, { width: 174 }),
|
|
139
|
+
/* @__PURE__ */ f(C, { width: 108 })
|
|
140
|
+
]
|
|
141
|
+
})]
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
// packages/feedback/src/progress.tsx
|
|
145
|
+
function D({ label: e, value: t, max: n, valueLabel: r }) {
|
|
146
|
+
return /* @__PURE__ */ p(_.Root, {
|
|
147
|
+
value: t,
|
|
148
|
+
max: n,
|
|
149
|
+
locale: "en-US",
|
|
150
|
+
getAriaValueText: () => r,
|
|
151
|
+
className: "x78zum5 xdt5ytf x1hnptsi xh8yej3 xeuugli x1hz01jw xtqrqnz x1778rvt xbixft",
|
|
152
|
+
children: [/* @__PURE__ */ p("div", {
|
|
153
|
+
className: "x78zum5 x1pha0wt x1qughib x1n8ia3y x1a02dak",
|
|
154
|
+
children: [/* @__PURE__ */ f(_.Label, { children: e }), /* @__PURE__ */ f("span", {
|
|
155
|
+
className: "x153jb6y xss6m8b",
|
|
156
|
+
children: r
|
|
157
|
+
})]
|
|
158
|
+
}), /* @__PURE__ */ f(_.Track, {
|
|
159
|
+
...{
|
|
160
|
+
0: { className: "xqu0tyb xh8yej3 x1ok0vyi x1fa40ue xb3r6kr" },
|
|
161
|
+
1: { className: "xqu0tyb xh8yej3 x1ok0vyi xb3r6kr x1r7kqkb xmkeg23 xbsl7fq xqrc7c3 x9f619" }
|
|
162
|
+
}[t === null | 0],
|
|
163
|
+
children: t !== null && /* @__PURE__ */ f(_.Indicator, { className: "x5yr21d x1pt885t x1ok0vyi" })
|
|
164
|
+
})]
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
function O({ label: e, value: t, max: n, valueLabel: r }) {
|
|
168
|
+
return t === null ? /* @__PURE__ */ p("div", {
|
|
169
|
+
className: "x78zum5 xdt5ytf x1hnptsi xh8yej3 xeuugli x1hz01jw xtqrqnz x1778rvt xbixft",
|
|
170
|
+
children: [/* @__PURE__ */ p("div", {
|
|
171
|
+
className: "x78zum5 x1pha0wt x1qughib x1n8ia3y x1a02dak",
|
|
172
|
+
children: [/* @__PURE__ */ f("span", { children: e }), /* @__PURE__ */ f("span", {
|
|
173
|
+
className: "x153jb6y xss6m8b",
|
|
174
|
+
children: r
|
|
175
|
+
})]
|
|
176
|
+
}), /* @__PURE__ */ f("div", {
|
|
177
|
+
"aria-hidden": !0,
|
|
178
|
+
className: "xqu0tyb xh8yej3 x1ok0vyi xb3r6kr x1r7kqkb xmkeg23 xbsl7fq xqrc7c3 x9f619"
|
|
179
|
+
})]
|
|
180
|
+
}) : /* @__PURE__ */ p(g.Root, {
|
|
181
|
+
value: t,
|
|
182
|
+
max: n,
|
|
183
|
+
locale: "en-US",
|
|
184
|
+
getAriaValueText: () => r,
|
|
185
|
+
className: "x78zum5 xdt5ytf x1hnptsi xh8yej3 xeuugli x1hz01jw xtqrqnz x1778rvt xbixft",
|
|
186
|
+
children: [/* @__PURE__ */ p("div", {
|
|
187
|
+
className: "x78zum5 x1pha0wt x1qughib x1n8ia3y x1a02dak",
|
|
188
|
+
children: [/* @__PURE__ */ f(g.Label, { children: e }), /* @__PURE__ */ f("span", {
|
|
189
|
+
className: "x153jb6y xss6m8b",
|
|
190
|
+
children: r
|
|
191
|
+
})]
|
|
192
|
+
}), /* @__PURE__ */ f(g.Track, {
|
|
193
|
+
className: "xqu0tyb xh8yej3 x1ok0vyi x1fa40ue xb3r6kr",
|
|
194
|
+
children: /* @__PURE__ */ f(g.Indicator, { className: "x5yr21d x1pt885t x1ok0vyi" })
|
|
195
|
+
})]
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
// packages/feedback/src/toast.tsx
|
|
199
|
+
var k = {
|
|
200
|
+
focus: {
|
|
201
|
+
kPJHz1: "x13qnu6",
|
|
202
|
+
k7shQP: "x9v5kkp",
|
|
203
|
+
kZs9gx: "x19rmrnh",
|
|
204
|
+
kiEn40: "x1bqaal",
|
|
205
|
+
$$css: !0
|
|
206
|
+
},
|
|
207
|
+
root: {
|
|
208
|
+
kzqmXN: "xh8yej3",
|
|
209
|
+
kmVPX3: "x1c8xbx5",
|
|
210
|
+
k3aq6I: "x1j8b0r",
|
|
211
|
+
kOpbMr: "xmeywwb",
|
|
212
|
+
$$css: !0
|
|
213
|
+
},
|
|
214
|
+
title: {
|
|
215
|
+
kGuDYH: "xtqrqnz",
|
|
216
|
+
kLWn49: "x1778rvt",
|
|
217
|
+
k63SB2: "xk50ysn",
|
|
218
|
+
$$css: !0
|
|
219
|
+
}
|
|
220
|
+
};
|
|
221
|
+
function A({ className: e, style: t, ...n }) {
|
|
222
|
+
return /* @__PURE__ */ f(v.Viewport, {
|
|
223
|
+
...n,
|
|
224
|
+
...a({
|
|
225
|
+
className: e,
|
|
226
|
+
style: t,
|
|
227
|
+
styles: { className: "xixxii4 x640wxr xsygj64 xb912zn x78zum5 xdt5ytf x1hnptsi x147k7ee xy2oaap x1odjw0f xish69e x1k57tk5 x13qnu6 x9v5kkp x19rmrnh x1bqaal" }
|
|
228
|
+
})
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
function j({ className: e, style: t, ...n }) {
|
|
232
|
+
return /* @__PURE__ */ f(v.Root, {
|
|
233
|
+
...n,
|
|
234
|
+
...a({
|
|
235
|
+
className: e,
|
|
236
|
+
style: t,
|
|
237
|
+
styles: s.props(i.surface, k.root, k.focus)
|
|
238
|
+
})
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
function M({ className: e, style: t, ...n }) {
|
|
242
|
+
return /* @__PURE__ */ f(v.Content, {
|
|
243
|
+
...n,
|
|
244
|
+
...a({
|
|
245
|
+
className: e,
|
|
246
|
+
style: t,
|
|
247
|
+
styles: { className: "x78zum5 xdt5ytf x1hnptsi" }
|
|
248
|
+
})
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
function N({ className: e, style: t, ...n }) {
|
|
252
|
+
return /* @__PURE__ */ f(v.Title, {
|
|
253
|
+
...n,
|
|
254
|
+
...a({
|
|
255
|
+
className: e,
|
|
256
|
+
style: t,
|
|
257
|
+
styles: s.props(r.title, k.title)
|
|
258
|
+
})
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
function P({ className: e, style: t, ...n }) {
|
|
262
|
+
return /* @__PURE__ */ f(v.Description, {
|
|
263
|
+
...n,
|
|
264
|
+
...a({
|
|
265
|
+
className: e,
|
|
266
|
+
style: t,
|
|
267
|
+
styles: s.props(r.description)
|
|
268
|
+
})
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
function F(e) {
|
|
272
|
+
return /* @__PURE__ */ f(v.Close, {
|
|
273
|
+
"aria-hidden": !1,
|
|
274
|
+
...e
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
var I = {
|
|
278
|
+
Provider: v.Provider,
|
|
279
|
+
Portal: v.Portal,
|
|
280
|
+
Viewport: A,
|
|
281
|
+
Root: j,
|
|
282
|
+
Content: M,
|
|
283
|
+
Title: N,
|
|
284
|
+
Description: P,
|
|
285
|
+
Close: F,
|
|
286
|
+
Action: v.Action,
|
|
287
|
+
useManager: v.useToastManager,
|
|
288
|
+
createManager: v.createToastManager
|
|
289
|
+
}, L = c(!1);
|
|
290
|
+
function R({ enter: e, fill: t = !1, children: n }) {
|
|
291
|
+
let r = l(L), [i] = d(e && !r), [a, o] = d(i);
|
|
292
|
+
return u(() => {
|
|
293
|
+
let e = requestAnimationFrame(() => o(!1));
|
|
294
|
+
return () => cancelAnimationFrame(e);
|
|
295
|
+
}, []), /* @__PURE__ */ f("div", {
|
|
296
|
+
...{
|
|
297
|
+
0: {},
|
|
298
|
+
2: { className: "x98rzlu x2lwn1j x78zum5 xdt5ytf" },
|
|
299
|
+
1: { className: "xqcmdr3 xcgnenq xwkv4th x1c3o69q" },
|
|
300
|
+
3: { className: "x98rzlu x2lwn1j x78zum5 xdt5ytf xqcmdr3 xcgnenq xwkv4th x1c3o69q" }
|
|
301
|
+
}[!!t << 1 | !!i],
|
|
302
|
+
children: /* @__PURE__ */ f(L, {
|
|
303
|
+
value: a,
|
|
304
|
+
children: n
|
|
305
|
+
})
|
|
306
|
+
});
|
|
307
|
+
}
|
|
308
|
+
function z({ label: e, placeholder: t, fill: r = !1, startedAt: i, delayMs: a = 0 }) {
|
|
309
|
+
let [o] = d(() => i ?? Date.now()), [c, l] = d(a <= 0);
|
|
310
|
+
return u(() => {
|
|
311
|
+
let e = Math.max(0, a - (Date.now() - o)), t = setTimeout(() => l(!0), e);
|
|
312
|
+
return () => clearTimeout(t);
|
|
313
|
+
}, [o, a]), /* @__PURE__ */ p("div", {
|
|
314
|
+
...{
|
|
315
|
+
0: {},
|
|
316
|
+
4: { className: "x98rzlu x2lwn1j x78zum5 xdt5ytf" },
|
|
317
|
+
2: { className: "xlshs6z" },
|
|
318
|
+
6: { className: "x98rzlu x2lwn1j x78zum5 xdt5ytf xlshs6z" },
|
|
319
|
+
1: { className: "xqcmdr3 xcgnenq xwkv4th x1c3o69q" },
|
|
320
|
+
5: { className: "x98rzlu x2lwn1j x78zum5 xdt5ytf xqcmdr3 xcgnenq xwkv4th x1c3o69q" },
|
|
321
|
+
3: { className: "xlshs6z xqcmdr3 xcgnenq xwkv4th x1c3o69q" },
|
|
322
|
+
7: { className: "x98rzlu x2lwn1j x78zum5 xdt5ytf xlshs6z xqcmdr3 xcgnenq xwkv4th x1c3o69q" }
|
|
323
|
+
}[!!r << 2 | !c << 1 | !!c],
|
|
324
|
+
children: [c && /* @__PURE__ */ f("span", {
|
|
325
|
+
role: "status",
|
|
326
|
+
...s.props(n.hidden),
|
|
327
|
+
children: e
|
|
328
|
+
}), /* @__PURE__ */ f("div", {
|
|
329
|
+
"aria-hidden": "true",
|
|
330
|
+
inert: !0,
|
|
331
|
+
...{
|
|
332
|
+
0: {},
|
|
333
|
+
1: { className: "x98rzlu x2lwn1j x78zum5 xdt5ytf" }
|
|
334
|
+
}[!!r | 0],
|
|
335
|
+
children: t
|
|
336
|
+
})]
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
function B({ pending: e, label: t, placeholder: n, children: r, fill: i = !1, startedAt: a, delayMs: o }) {
|
|
340
|
+
let [s, c] = d(e);
|
|
341
|
+
return e && !s && c(!0), /* @__PURE__ */ f("div", {
|
|
342
|
+
"aria-busy": e,
|
|
343
|
+
...{
|
|
344
|
+
0: { className: "x1n2onr6 xeuugli" },
|
|
345
|
+
1: { className: "x1n2onr6 xeuugli x98rzlu x2lwn1j x78zum5 xdt5ytf" }
|
|
346
|
+
}[!!i | 0],
|
|
347
|
+
children: e ? /* @__PURE__ */ f(z, {
|
|
348
|
+
label: t,
|
|
349
|
+
placeholder: n,
|
|
350
|
+
fill: i,
|
|
351
|
+
startedAt: a,
|
|
352
|
+
delayMs: o
|
|
353
|
+
}, a) : /* @__PURE__ */ f(R, {
|
|
354
|
+
enter: s,
|
|
355
|
+
fill: i,
|
|
356
|
+
children: r
|
|
357
|
+
})
|
|
358
|
+
});
|
|
359
|
+
}
|
|
360
|
+
export { D as a, w as c, b as d, O as i, T as l, R as n, E as o, I as r, C as s, B as t, y as u };
|