asheeui 1.1.1 → 2.0.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/dist/components/centered/Centered.d.ts +49 -0
- package/dist/components/centered/Centered.d.ts.map +1 -0
- package/dist/components/centered/Centered.js +32 -0
- package/dist/components/centered/centered-config.d.ts +63 -0
- package/dist/components/centered/centered-config.d.ts.map +1 -0
- package/dist/components/centered/centered-config.js +17 -0
- package/dist/components/centered/centered-styles.d.ts +11 -0
- package/dist/components/centered/centered-styles.d.ts.map +1 -0
- package/dist/components/centered/centered-styles.js +9 -0
- package/dist/components/centered/index.d.ts +3 -0
- package/dist/components/centered/index.d.ts.map +1 -0
- package/dist/components/centered/index.js +3 -0
- package/dist/components/chip/Chip.d.ts +8 -0
- package/dist/components/chip/Chip.d.ts.map +1 -1
- package/dist/components/chip/Chip.js +15 -15
- package/dist/components/data-table/DataTable.d.ts +137 -0
- package/dist/components/data-table/DataTable.d.ts.map +1 -0
- package/dist/components/data-table/DataTable.js +101 -0
- package/dist/components/data-table/data-table-config.d.ts +75 -0
- package/dist/components/data-table/data-table-config.d.ts.map +1 -0
- package/dist/components/data-table/data-table-config.js +24 -0
- package/dist/components/data-table/data-table-styles.d.ts +25 -0
- package/dist/components/data-table/data-table-styles.d.ts.map +1 -0
- package/dist/components/data-table/data-table-styles.js +5 -0
- package/dist/components/data-table/index.d.ts +3 -0
- package/dist/components/data-table/index.d.ts.map +1 -0
- package/dist/components/data-table/index.js +3 -0
- package/dist/components/docs-layout/DocsLayout.d.ts +94 -0
- package/dist/components/docs-layout/DocsLayout.d.ts.map +1 -0
- package/dist/components/docs-layout/DocsLayout.js +62 -0
- package/dist/components/docs-layout/docs-layout-config.d.ts +61 -0
- package/dist/components/docs-layout/docs-layout-config.d.ts.map +1 -0
- package/dist/components/docs-layout/docs-layout-config.js +22 -0
- package/dist/components/docs-layout/docs-layout-styles.d.ts +31 -0
- package/dist/components/docs-layout/docs-layout-styles.d.ts.map +1 -0
- package/dist/components/docs-layout/docs-layout-styles.js +5 -0
- package/dist/components/docs-layout/index.d.ts +3 -0
- package/dist/components/docs-layout/index.d.ts.map +1 -0
- package/dist/components/docs-layout/index.js +3 -0
- package/dist/components/empty-state/EmptyState.d.ts +19 -1
- package/dist/components/empty-state/EmptyState.d.ts.map +1 -1
- package/dist/components/empty-state/EmptyState.js +10 -9
- package/dist/components/error-state/ErrorState.d.ts +98 -0
- package/dist/components/error-state/ErrorState.d.ts.map +1 -0
- package/dist/components/error-state/ErrorState.js +57 -0
- package/dist/components/error-state/error-state-config.d.ts +66 -0
- package/dist/components/error-state/error-state-config.d.ts.map +1 -0
- package/dist/components/error-state/error-state-config.js +20 -0
- package/dist/components/error-state/error-state-styles.d.ts +17 -0
- package/dist/components/error-state/error-state-styles.d.ts.map +1 -0
- package/dist/components/error-state/error-state-styles.js +5 -0
- package/dist/components/error-state/index.d.ts +3 -0
- package/dist/components/error-state/index.d.ts.map +1 -0
- package/dist/components/error-state/index.js +3 -0
- package/dist/components/file-upload/FileUpload.d.ts +112 -0
- package/dist/components/file-upload/FileUpload.d.ts.map +1 -0
- package/dist/components/file-upload/FileUpload.js +83 -0
- package/dist/components/file-upload/file-upload-config.d.ts +41 -0
- package/dist/components/file-upload/file-upload-config.d.ts.map +1 -0
- package/dist/components/file-upload/file-upload-config.js +16 -0
- package/dist/components/file-upload/file-upload-styles.d.ts +22 -0
- package/dist/components/file-upload/file-upload-styles.d.ts.map +1 -0
- package/dist/components/file-upload/file-upload-styles.js +9 -0
- package/dist/components/file-upload/file-upload.helpers.d.ts +26 -0
- package/dist/components/file-upload/file-upload.helpers.d.ts.map +1 -0
- package/dist/components/file-upload/file-upload.helpers.js +17 -0
- package/dist/components/file-upload/index.d.ts +3 -0
- package/dist/components/file-upload/index.d.ts.map +1 -0
- package/dist/components/file-upload/index.js +4 -0
- package/dist/components/loading-state/LoadingState.d.ts +57 -0
- package/dist/components/loading-state/LoadingState.d.ts.map +1 -0
- package/dist/components/loading-state/LoadingState.js +44 -0
- package/dist/components/loading-state/index.d.ts +3 -0
- package/dist/components/loading-state/index.d.ts.map +1 -0
- package/dist/components/loading-state/index.js +3 -0
- package/dist/components/loading-state/loading-state-config.d.ts +49 -0
- package/dist/components/loading-state/loading-state-config.d.ts.map +1 -0
- package/dist/components/loading-state/loading-state-config.js +18 -0
- package/dist/components/loading-state/loading-state-styles.d.ts +12 -0
- package/dist/components/loading-state/loading-state-styles.d.ts.map +1 -0
- package/dist/components/loading-state/loading-state-styles.js +9 -0
- package/dist/components/marketing-layout/MarketingLayout.d.ts +83 -0
- package/dist/components/marketing-layout/MarketingLayout.d.ts.map +1 -0
- package/dist/components/marketing-layout/MarketingLayout.js +40 -0
- package/dist/components/marketing-layout/index.d.ts +3 -0
- package/dist/components/marketing-layout/index.d.ts.map +1 -0
- package/dist/components/marketing-layout/index.js +3 -0
- package/dist/components/marketing-layout/marketing-layout-config.d.ts +60 -0
- package/dist/components/marketing-layout/marketing-layout-config.d.ts.map +1 -0
- package/dist/components/marketing-layout/marketing-layout-config.js +16 -0
- package/dist/components/marketing-layout/marketing-layout-styles.d.ts +8 -0
- package/dist/components/marketing-layout/marketing-layout-styles.d.ts.map +1 -0
- package/dist/components/marketing-layout/marketing-layout-styles.js +8 -0
- package/dist/components/search-input/SearchInput.d.ts +111 -0
- package/dist/components/search-input/SearchInput.d.ts.map +1 -0
- package/dist/components/search-input/SearchInput.js +86 -0
- package/dist/components/search-input/index.d.ts +3 -0
- package/dist/components/search-input/index.d.ts.map +1 -0
- package/dist/components/search-input/index.js +3 -0
- package/dist/components/search-input/search-input-config.d.ts +55 -0
- package/dist/components/search-input/search-input-config.d.ts.map +1 -0
- package/dist/components/search-input/search-input-config.js +20 -0
- package/dist/components/search-input/search-input-styles.d.ts +16 -0
- package/dist/components/search-input/search-input-styles.d.ts.map +1 -0
- package/dist/components/search-input/search-input-styles.js +9 -0
- package/dist/components/section-kit/ActionGroup.d.ts +8 -1
- package/dist/components/section-kit/ActionGroup.d.ts.map +1 -1
- package/dist/components/section-kit/ActionGroup.js +13 -9
- package/dist/components/section-kit/SkipLink.d.ts +50 -0
- package/dist/components/section-kit/SkipLink.d.ts.map +1 -0
- package/dist/components/section-kit/SkipLink.js +14 -0
- package/dist/components/section-kit/index.d.ts +5 -4
- package/dist/components/section-kit/index.d.ts.map +1 -1
- package/dist/components/section-kit/index.js +1 -0
- package/dist/components/sidebar-layout/SidebarLayout.d.ts.map +1 -1
- package/dist/components/sidebar-layout/SidebarLayout.js +25 -25
- package/dist/components/sidebar-layout/sidebar-layout-styles.d.ts +10 -3
- package/dist/components/sidebar-layout/sidebar-layout-styles.d.ts.map +1 -1
- package/dist/components/sidebar-layout/sidebar-layout-styles.js +2 -2
- package/dist/components/split/Split.d.ts +68 -0
- package/dist/components/split/Split.d.ts.map +1 -0
- package/dist/components/split/Split.js +36 -0
- package/dist/components/split/index.d.ts +3 -0
- package/dist/components/split/index.d.ts.map +1 -0
- package/dist/components/split/index.js +3 -0
- package/dist/components/split/split-config.d.ts +83 -0
- package/dist/components/split/split-config.d.ts.map +1 -0
- package/dist/components/split/split-config.js +20 -0
- package/dist/components/split/split-styles.d.ts +36 -0
- package/dist/components/split/split-styles.d.ts.map +1 -0
- package/dist/components/split/split-styles.js +76 -0
- package/dist/components/stepper/Stepper.d.ts +94 -0
- package/dist/components/stepper/Stepper.d.ts.map +1 -0
- package/dist/components/stepper/Stepper.js +71 -0
- package/dist/components/stepper/index.d.ts +3 -0
- package/dist/components/stepper/index.d.ts.map +1 -0
- package/dist/components/stepper/index.js +3 -0
- package/dist/components/stepper/stepper-config.d.ts +51 -0
- package/dist/components/stepper/stepper-config.d.ts.map +1 -0
- package/dist/components/stepper/stepper-config.js +16 -0
- package/dist/components/stepper/stepper-styles.d.ts +30 -0
- package/dist/components/stepper/stepper-styles.d.ts.map +1 -0
- package/dist/components/stepper/stepper-styles.js +25 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +93 -73
- package/dist/shared/spacing.d.ts +8 -0
- package/dist/shared/spacing.d.ts.map +1 -1
- package/dist/shared/spacing.js +9 -1
- package/package.json +1 -1
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DataTable component styles for AsheeUI.
|
|
3
|
+
* This file provides the static class mappings for the table composition: the
|
|
4
|
+
* wrapper, the toolbar above the table and its parts. The table itself keeps the
|
|
5
|
+
* classes the `Table` component owns.
|
|
6
|
+
*/
|
|
7
|
+
/** The wrapper. */
|
|
8
|
+
export declare const DATA_TABLE_CLASS = "flex w-full min-w-0 flex-col gap-4";
|
|
9
|
+
/** The heading above the toolbar. */
|
|
10
|
+
export declare const DATA_TABLE_HEADING_CLASS = "flex flex-col gap-1";
|
|
11
|
+
/**
|
|
12
|
+
* The toolbar above the table.
|
|
13
|
+
* The control and the count stack on a narrow screen and sit in a row from the
|
|
14
|
+
* `sm` breakpoint.
|
|
15
|
+
*/
|
|
16
|
+
export declare const DATA_TABLE_TOOLBAR_CLASS = "flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between";
|
|
17
|
+
/** The group that holds the search control and the consumer's own controls. */
|
|
18
|
+
export declare const DATA_TABLE_TOOLBAR_GROUP_CLASS = "flex w-full flex-col gap-2 sm:flex-row sm:items-center";
|
|
19
|
+
/** The region that holds the table or the empty state. */
|
|
20
|
+
export declare const DATA_TABLE_REGION_CLASS = "flex w-full min-w-0 flex-col gap-4";
|
|
21
|
+
/** The row count, which sits under the table beside the pagination. */
|
|
22
|
+
export declare const DATA_TABLE_FOOTER_CLASS = "flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between";
|
|
23
|
+
/** Width the search control takes in the toolbar. */
|
|
24
|
+
export declare const DATA_TABLE_SEARCH_CLASS = "w-full sm:max-w-sm";
|
|
25
|
+
//# sourceMappingURL=data-table-styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-table-styles.d.ts","sourceRoot":"","sources":["../../../src/components/data-table/data-table-styles.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,mBAAmB;AACnB,eAAO,MAAM,gBAAgB,uCAAuC,CAAC;AAErE,qCAAqC;AACrC,eAAO,MAAM,wBAAwB,wBAAwB,CAAC;AAE9D;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,uEACiC,CAAC;AAEvE,+EAA+E;AAC/E,eAAO,MAAM,8BAA8B,2DACe,CAAC;AAE3D,0DAA0D;AAC1D,eAAO,MAAM,uBAAuB,uCAAuC,CAAC;AAE5E,uEAAuE;AACvE,eAAO,MAAM,uBAAuB,uEACkC,CAAC;AAEvE,qDAAqD;AACrD,eAAO,MAAM,uBAAuB,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
//#region src/components/data-table/data-table-styles.ts
|
|
3
|
+
var e = "flex w-full min-w-0 flex-col gap-4", t = "flex flex-col gap-1", n = "flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between", r = "flex w-full flex-col gap-2 sm:flex-row sm:items-center", i = "flex w-full min-w-0 flex-col gap-4", a = "flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between", o = "w-full sm:max-w-sm";
|
|
4
|
+
//#endregion
|
|
5
|
+
export { e as DATA_TABLE_CLASS, a as DATA_TABLE_FOOTER_CLASS, t as DATA_TABLE_HEADING_CLASS, i as DATA_TABLE_REGION_CLASS, o as DATA_TABLE_SEARCH_CLASS, n as DATA_TABLE_TOOLBAR_CLASS, r as DATA_TABLE_TOOLBAR_GROUP_CLASS };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/data-table/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { ElementType, HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { DocsLayoutConfig } from './docs-layout-config';
|
|
3
|
+
type BaseDocsLayoutProps = DocsLayoutConfig & Omit<HTMLAttributes<HTMLDivElement>, "color">;
|
|
4
|
+
/**
|
|
5
|
+
* Props for the DocsLayout component.
|
|
6
|
+
*/
|
|
7
|
+
export interface DocsLayoutProps extends BaseDocsLayoutProps {
|
|
8
|
+
/**
|
|
9
|
+
* The documentation navigation, typically a `Sidebar` of sections and pages.
|
|
10
|
+
*/
|
|
11
|
+
navigation: ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* The table of contents of the current article.
|
|
14
|
+
* Left out, the composition is a two-column page; supplied, the contents take
|
|
15
|
+
* the third column on a large screen and are hidden below it.
|
|
16
|
+
*/
|
|
17
|
+
toc?: ReactNode;
|
|
18
|
+
/**
|
|
19
|
+
* Content above everything, typically a `Navbar` with the site's brand and
|
|
20
|
+
* search.
|
|
21
|
+
*/
|
|
22
|
+
header?: ReactNode;
|
|
23
|
+
/**
|
|
24
|
+
* Content below everything.
|
|
25
|
+
*/
|
|
26
|
+
footer?: ReactNode;
|
|
27
|
+
/**
|
|
28
|
+
* The article.
|
|
29
|
+
*/
|
|
30
|
+
children?: ReactNode;
|
|
31
|
+
/**
|
|
32
|
+
* Identifier of the article region, which the skip link points at.
|
|
33
|
+
*
|
|
34
|
+
* @default "main-content"
|
|
35
|
+
*/
|
|
36
|
+
mainId?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Element to render the page shell as.
|
|
39
|
+
* Defaults to a `div`.
|
|
40
|
+
*
|
|
41
|
+
* @default "div"
|
|
42
|
+
*/
|
|
43
|
+
as?: ElementType;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* The arrangement a documentation page is built in.
|
|
47
|
+
*
|
|
48
|
+
* The composition is a navigation column, an article and, when one is supplied,
|
|
49
|
+
* a table of contents. It composes the framework's application shell and split
|
|
50
|
+
* layout, so the behaviour a documentation page depends on (the sticky
|
|
51
|
+
* navigation, the stacked narrow-screen layout and the responsive columns) is
|
|
52
|
+
* the behaviour those primitives already provide and test.
|
|
53
|
+
*
|
|
54
|
+
* Nothing but the table of contents is hidden from a narrow screen: the
|
|
55
|
+
* navigation stays in the document above the article, so a keyboard reader
|
|
56
|
+
* reaches it without a drawer to trap focus in. The contents repeat the
|
|
57
|
+
* article's own headings, which stay in the article.
|
|
58
|
+
*
|
|
59
|
+
* @param props - DocsLayout configuration options and element attributes.
|
|
60
|
+
* @param props.navigation - The documentation navigation.
|
|
61
|
+
* @param props.toc - The table of contents of the current article.
|
|
62
|
+
* @param props.header - Content above everything.
|
|
63
|
+
* @param props.footer - Content below everything.
|
|
64
|
+
* @param props.children - The article.
|
|
65
|
+
* @param props.mainId - Identifier of the article region. Defaults to
|
|
66
|
+
* "main-content".
|
|
67
|
+
* @param props.navigationLabel - Name of the navigation landmark. Defaults to
|
|
68
|
+
* "Documentation".
|
|
69
|
+
* @param props.tocLabel - Name of the contents landmark. Defaults to "On this
|
|
70
|
+
* page".
|
|
71
|
+
* @param props.navigationWidth - Width of the navigation column from `lg`.
|
|
72
|
+
* Defaults to "md".
|
|
73
|
+
* @param props.stickyToc - Keep the contents in view. Defaults to true.
|
|
74
|
+
* @param props.skipLink - Render a skip link. Defaults to true.
|
|
75
|
+
* @param props.as - Element to render. Defaults to "div".
|
|
76
|
+
* @returns The rendered page.
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* ```tsx
|
|
80
|
+
* <DocsLayout
|
|
81
|
+
* header={<Navbar brand="AsheeUI" links={links} />}
|
|
82
|
+
* navigation={<Sidebar items={sections} activeKey="layout" />}
|
|
83
|
+
* toc={<TableOfContents items={headings} />}>
|
|
84
|
+
* <Typography role="display">Layout</Typography>
|
|
85
|
+
* <Typography role="body-md">A page is composed from the layout layer.</Typography>
|
|
86
|
+
* </DocsLayout>
|
|
87
|
+
* ```
|
|
88
|
+
*
|
|
89
|
+
* @see MarketingLayout - The marketing composition.
|
|
90
|
+
* @see SidebarLayout - The application shell the composition builds on.
|
|
91
|
+
*/
|
|
92
|
+
export declare const DocsLayout: import('react').ForwardRefExoticComponent<DocsLayoutProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
93
|
+
export {};
|
|
94
|
+
//# sourceMappingURL=DocsLayout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DocsLayout.d.ts","sourceRoot":"","sources":["../../../src/components/docs-layout/DocsLayout.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,EACL,KAAK,WAAW,EAEhB,KAAK,cAAc,EACnB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAOf,OAAO,EACL,KAAK,gBAAgB,EAEtB,MAAM,sBAAsB,CAAC;AAU9B,KAAK,mBAAmB,GAAG,gBAAgB,GACzC,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC,CAAC;AAEhD;;GAEG;AACH,MAAM,WAAW,eAAgB,SAAQ,mBAAmB;IAC1D;;OAEG;IACH,UAAU,EAAE,SAAS,CAAC;IAEtB;;;;OAIG;IACH,GAAG,CAAC,EAAE,SAAS,CAAC;IAEhB;;;OAGG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;IAEnB;;OAEG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;IAEnB;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IAErB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;;;OAKG;IACH,EAAE,CAAC,EAAE,WAAW,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,eAAO,MAAM,UAAU,4GAuFtB,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
import { cn as e } from "../../utils/cn.js";
|
|
4
|
+
import { useAsheeConfig as t } from "../../libs/context.js";
|
|
5
|
+
import { resolveConfigCascade as n } from "../../utils/resolve-token.js";
|
|
6
|
+
import { SkipLink as r } from "../section-kit/SkipLink.js";
|
|
7
|
+
import { SidebarLayout as i } from "../sidebar-layout/SidebarLayout.js";
|
|
8
|
+
import { Split as a } from "../split/Split.js";
|
|
9
|
+
import { FALLBACK_DOCS_LAYOUT_CONFIG as o } from "./docs-layout-config.js";
|
|
10
|
+
import { DOCS_LAYOUT_ARTICLE_CLASS as s, DOCS_LAYOUT_BODY_CLASS as c, DOCS_LAYOUT_CLASS as l, DOCS_LAYOUT_SHELL_CLASS as u, DOCS_LAYOUT_TOC_CLASS as d } from "./docs-layout-styles.js";
|
|
11
|
+
import { forwardRef as f } from "react";
|
|
12
|
+
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
13
|
+
//#region src/components/docs-layout/DocsLayout.tsx
|
|
14
|
+
var h = f(({ navigation: f, toc: h, header: g, footer: _, children: v, mainId: y = "main-content", navigationLabel: b, tocLabel: x, navigationWidth: S, stickyToc: C, skipLink: w, skipLinkLabel: T, as: E, className: D, ...O }, k) => {
|
|
15
|
+
let A = t(), j = n({
|
|
16
|
+
navigationLabel: b,
|
|
17
|
+
tocLabel: x,
|
|
18
|
+
navigationWidth: S,
|
|
19
|
+
stickyToc: C,
|
|
20
|
+
skipLink: w,
|
|
21
|
+
skipLinkLabel: T
|
|
22
|
+
}, A.components?.docslayout, o), M = /* @__PURE__ */ p("main", {
|
|
23
|
+
id: y,
|
|
24
|
+
tabIndex: -1,
|
|
25
|
+
className: s,
|
|
26
|
+
children: /* @__PURE__ */ p("div", {
|
|
27
|
+
className: c,
|
|
28
|
+
children: v
|
|
29
|
+
})
|
|
30
|
+
});
|
|
31
|
+
return /* @__PURE__ */ m(E ?? "div", {
|
|
32
|
+
ref: k,
|
|
33
|
+
className: e(l, D),
|
|
34
|
+
...O,
|
|
35
|
+
children: [j.skipLink && /* @__PURE__ */ p(r, {
|
|
36
|
+
targetId: y,
|
|
37
|
+
label: j.skipLinkLabel
|
|
38
|
+
}), /* @__PURE__ */ p(i, {
|
|
39
|
+
className: u,
|
|
40
|
+
header: g,
|
|
41
|
+
footer: _,
|
|
42
|
+
sidebar: f,
|
|
43
|
+
sidebarLabel: j.navigationLabel,
|
|
44
|
+
sidebarWidth: j.navigationWidth,
|
|
45
|
+
children: h ? /* @__PURE__ */ p(a, {
|
|
46
|
+
stackAt: "xl",
|
|
47
|
+
ratio: "start",
|
|
48
|
+
gap: "xl",
|
|
49
|
+
align: "start",
|
|
50
|
+
start: M,
|
|
51
|
+
end: /* @__PURE__ */ p("aside", {
|
|
52
|
+
"aria-label": j.tocLabel,
|
|
53
|
+
className: e(d, j.stickyToc && "xl:sticky xl:top-0 xl:self-start"),
|
|
54
|
+
children: h
|
|
55
|
+
})
|
|
56
|
+
}) : M
|
|
57
|
+
})]
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
h.displayName = "DocsLayout";
|
|
61
|
+
//#endregion
|
|
62
|
+
export { h as DocsLayout };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { SidebarLayoutWidth } from '../sidebar-layout/sidebar-layout-config';
|
|
2
|
+
/**
|
|
3
|
+
* Theme configuration options for the DocsLayout component.
|
|
4
|
+
*
|
|
5
|
+
* Set under `components.docslayout` in the AsheeUI config. Values feed the
|
|
6
|
+
* component-level tier of the theme cascade.
|
|
7
|
+
*/
|
|
8
|
+
export interface DocsLayoutConfig {
|
|
9
|
+
/**
|
|
10
|
+
* Name of the navigation landmark.
|
|
11
|
+
* It distinguishes the documentation navigation from the other navigation
|
|
12
|
+
* regions a page may have.
|
|
13
|
+
*
|
|
14
|
+
* @default "Documentation"
|
|
15
|
+
*/
|
|
16
|
+
navigationLabel?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Name of the table of contents landmark.
|
|
19
|
+
*
|
|
20
|
+
* @default "On this page"
|
|
21
|
+
*/
|
|
22
|
+
tocLabel?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Width of the navigation column from the `lg` breakpoint upwards.
|
|
25
|
+
*
|
|
26
|
+
* @default "md"
|
|
27
|
+
*/
|
|
28
|
+
navigationWidth?: SidebarLayoutWidth;
|
|
29
|
+
/**
|
|
30
|
+
* Whether the table of contents stays in view while the article scrolls.
|
|
31
|
+
*
|
|
32
|
+
* @default true
|
|
33
|
+
*/
|
|
34
|
+
stickyToc?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Whether the composition renders a skip link to its main region.
|
|
37
|
+
*
|
|
38
|
+
* @default true
|
|
39
|
+
*/
|
|
40
|
+
skipLink?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Wording of the skip link.
|
|
43
|
+
*
|
|
44
|
+
* @default "Skip to content"
|
|
45
|
+
*/
|
|
46
|
+
skipLinkLabel?: string;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Default config values registered for the DocsLayout component.
|
|
50
|
+
*/
|
|
51
|
+
export declare const defaultDocsLayoutConfig: DocsLayoutConfig;
|
|
52
|
+
declare module "../../libs/registry" {
|
|
53
|
+
interface ComponentTypeConfigRegistry {
|
|
54
|
+
docslayout: DocsLayoutConfig;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Hard fallback values used when no config tier provides a value.
|
|
59
|
+
*/
|
|
60
|
+
export declare const FALLBACK_DOCS_LAYOUT_CONFIG: Required<DocsLayoutConfig>;
|
|
61
|
+
//# sourceMappingURL=docs-layout-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"docs-layout-config.d.ts","sourceRoot":"","sources":["../../../src/components/docs-layout/docs-layout-config.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAElF;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;;OAIG;IACH,eAAe,CAAC,EAAE,kBAAkB,CAAC;IAErC;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,eAAO,MAAM,uBAAuB,EAAE,gBAOrC,CAAC;AAEF,OAAO,QAAQ,qBAAqB,CAAC;IACnC,UAAU,2BAA2B;QACnC,UAAU,EAAE,gBAAgB,CAAC;KAC9B;CACF;AAID;;GAEG;AACH,eAAO,MAAM,2BAA2B,EAAE,QAAQ,CAAC,gBAAgB,CAOlE,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { registerComponentDefaults as e } from "../../libs/registry.js";
|
|
3
|
+
//#region src/components/docs-layout/docs-layout-config.ts
|
|
4
|
+
var t = {
|
|
5
|
+
navigationLabel: "Documentation",
|
|
6
|
+
tocLabel: "On this page",
|
|
7
|
+
navigationWidth: "md",
|
|
8
|
+
stickyToc: !0,
|
|
9
|
+
skipLink: !0,
|
|
10
|
+
skipLinkLabel: "Skip to content"
|
|
11
|
+
};
|
|
12
|
+
e("docslayout", t);
|
|
13
|
+
var n = {
|
|
14
|
+
navigationLabel: "Documentation",
|
|
15
|
+
tocLabel: "On this page",
|
|
16
|
+
navigationWidth: "md",
|
|
17
|
+
stickyToc: !0,
|
|
18
|
+
skipLink: !0,
|
|
19
|
+
skipLinkLabel: "Skip to content"
|
|
20
|
+
};
|
|
21
|
+
//#endregion
|
|
22
|
+
export { n as FALLBACK_DOCS_LAYOUT_CONFIG, t as defaultDocsLayoutConfig };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DocsLayout component styles for AsheeUI.
|
|
3
|
+
* This file provides the static class mappings for the documentation
|
|
4
|
+
* composition: the page shell, the article column, the table of contents column
|
|
5
|
+
* and the article body's reading measure.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* The page shell.
|
|
9
|
+
* It wraps the application shell rather than replacing it, so the skip link can
|
|
10
|
+
* be the first focusable element of the page.
|
|
11
|
+
*/
|
|
12
|
+
export declare const DOCS_LAYOUT_CLASS = "flex min-h-dvh w-full flex-col bg-background";
|
|
13
|
+
/** The application shell inside the page shell. */
|
|
14
|
+
export declare const DOCS_LAYOUT_SHELL_CLASS = "flex-1";
|
|
15
|
+
/**
|
|
16
|
+
* The article column.
|
|
17
|
+
* It is the region the skip link leads to, so it takes focus when the link is
|
|
18
|
+
* followed.
|
|
19
|
+
*/
|
|
20
|
+
export declare const DOCS_LAYOUT_ARTICLE_CLASS = "flex w-full min-w-0 flex-col";
|
|
21
|
+
/**
|
|
22
|
+
* The reading measure of the article body.
|
|
23
|
+
* A documentation page is read rather than scanned, so the body keeps a readable
|
|
24
|
+
* line length while the columns around it may be wider.
|
|
25
|
+
*/
|
|
26
|
+
export declare const DOCS_LAYOUT_BODY_CLASS = "flex flex-col gap-6 max-w-3xl";
|
|
27
|
+
/** The table of contents column. */
|
|
28
|
+
export declare const DOCS_LAYOUT_TOC_CLASS = "hidden w-full xl:block xl:w-64 xl:shrink-0";
|
|
29
|
+
/** Keeps the table of contents in view while the article scrolls. */
|
|
30
|
+
export declare const DOCS_LAYOUT_TOC_STICKY_CLASS = "xl:sticky xl:top-0 xl:self-start";
|
|
31
|
+
//# sourceMappingURL=docs-layout-styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"docs-layout-styles.d.ts","sourceRoot":"","sources":["../../../src/components/docs-layout/docs-layout-styles.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,iDAAiD,CAAC;AAEhF,mDAAmD;AACnD,eAAO,MAAM,uBAAuB,WAAW,CAAC;AAEhD;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,iCAAiC,CAAC;AAExE;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,kCAAkC,CAAC;AAEtE,oCAAoC;AACpC,eAAO,MAAM,qBAAqB,+CACY,CAAC;AAE/C,qEAAqE;AACrE,eAAO,MAAM,4BAA4B,qCAAqC,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
//#region src/components/docs-layout/docs-layout-styles.ts
|
|
3
|
+
var e = "flex min-h-dvh w-full flex-col bg-background", t = "flex-1", n = "flex w-full min-w-0 flex-col", r = "flex flex-col gap-6 max-w-3xl", i = "hidden w-full xl:block xl:w-64 xl:shrink-0", a = "xl:sticky xl:top-0 xl:self-start";
|
|
4
|
+
//#endregion
|
|
5
|
+
export { n as DOCS_LAYOUT_ARTICLE_CLASS, r as DOCS_LAYOUT_BODY_CLASS, e as DOCS_LAYOUT_CLASS, t as DOCS_LAYOUT_SHELL_CLASS, i as DOCS_LAYOUT_TOC_CLASS, a as DOCS_LAYOUT_TOC_STICKY_CLASS };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/docs-layout/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC"}
|
|
@@ -30,6 +30,13 @@ export interface EmptyStateProps extends BaseEmptyStateProps {
|
|
|
30
30
|
* @default "div"
|
|
31
31
|
*/
|
|
32
32
|
as?: ElementType;
|
|
33
|
+
/**
|
|
34
|
+
* Actions that carry a React handler.
|
|
35
|
+
* A configured action describes a destination rather than a callback, so an
|
|
36
|
+
* action that runs one (a retry, a dismissal) is passed here and rendered in
|
|
37
|
+
* the same group as the configured actions.
|
|
38
|
+
*/
|
|
39
|
+
actions?: ReactNode;
|
|
33
40
|
/** Content below the actions. */
|
|
34
41
|
children?: ReactNode;
|
|
35
42
|
}
|
|
@@ -65,10 +72,21 @@ export interface EmptyStateProps extends BaseEmptyStateProps {
|
|
|
65
72
|
* icon={<SearchIcon />}
|
|
66
73
|
* title="No campaigns match that filter"
|
|
67
74
|
* description="Try a different name, or clear the filter to see everything."
|
|
68
|
-
* primaryAction={{ label: "
|
|
75
|
+
* primaryAction={{ label: "See all campaigns", href: "/campaigns" }}
|
|
69
76
|
* />
|
|
70
77
|
* ```
|
|
71
78
|
*
|
|
79
|
+
* A configured action describes a destination, so an action that runs a handler
|
|
80
|
+
* is passed as a child instead:
|
|
81
|
+
*
|
|
82
|
+
* ```tsx
|
|
83
|
+
* <EmptyState title="No campaigns match that filter">
|
|
84
|
+
* <Button variant="solid" onClick={clearFilters}>
|
|
85
|
+
* Clear filters
|
|
86
|
+
* </Button>
|
|
87
|
+
* </EmptyState>
|
|
88
|
+
* ```
|
|
89
|
+
*
|
|
72
90
|
* @see Skeleton - The loading presentation of the same region.
|
|
73
91
|
* @see Alert - An inline message that is not a whole region.
|
|
74
92
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmptyState.d.ts","sourceRoot":"","sources":["../../../src/components/empty-state/EmptyState.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,EACL,KAAK,WAAW,EAEhB,KAAK,cAAc,EACnB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAKjD,OAAO,EACL,KAAK,gBAAgB,EAEtB,MAAM,sBAAsB,CAAC;AAS9B,KAAK,mBAAmB,GAAG,gBAAgB,GACzC,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,CAAC;AAE1D;;GAEG;AACH,MAAM,WAAW,eAAgB,SAAQ,mBAAmB;IAC1D,kCAAkC;IAClC,IAAI,CAAC,EAAE,SAAS,CAAC;IAEjB,6DAA6D;IAC7D,KAAK,EAAE,SAAS,CAAC;IAEjB,uCAAuC;IACvC,WAAW,CAAC,EAAE,SAAS,CAAC;IAExB,8EAA8E;IAC9E,aAAa,CAAC,EAAE,YAAY,CAAC;IAE7B,oEAAoE;IACpE,eAAe,CAAC,EAAE,YAAY,CAAC;IAE/B;;;;;OAKG;IACH,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;IAE1B;;;;;OAKG;IACH,EAAE,CAAC,EAAE,WAAW,CAAC;IAEjB,iCAAiC;IACjC,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED
|
|
1
|
+
{"version":3,"file":"EmptyState.d.ts","sourceRoot":"","sources":["../../../src/components/empty-state/EmptyState.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,EACL,KAAK,WAAW,EAEhB,KAAK,cAAc,EACnB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAKjD,OAAO,EACL,KAAK,gBAAgB,EAEtB,MAAM,sBAAsB,CAAC;AAS9B,KAAK,mBAAmB,GAAG,gBAAgB,GACzC,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,CAAC;AAE1D;;GAEG;AACH,MAAM,WAAW,eAAgB,SAAQ,mBAAmB;IAC1D,kCAAkC;IAClC,IAAI,CAAC,EAAE,SAAS,CAAC;IAEjB,6DAA6D;IAC7D,KAAK,EAAE,SAAS,CAAC;IAEjB,uCAAuC;IACvC,WAAW,CAAC,EAAE,SAAS,CAAC;IAExB,8EAA8E;IAC9E,aAAa,CAAC,EAAE,YAAY,CAAC;IAE7B,oEAAoE;IACpE,eAAe,CAAC,EAAE,YAAY,CAAC;IAE/B;;;;;OAKG;IACH,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;IAE1B;;;;;OAKG;IACH,EAAE,CAAC,EAAE,WAAW,CAAC;IAEjB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;IAEpB,iCAAiC;IACjC,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AACH,eAAO,MAAM,UAAU,4GAwEtB,CAAC"}
|
|
@@ -10,20 +10,20 @@ import { EMPTY_STATE_CLASS as o, EMPTY_STATE_ICON_CLASS as s, EMPTY_STATE_ICON_S
|
|
|
10
10
|
import { forwardRef as u } from "react";
|
|
11
11
|
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
12
12
|
//#region src/components/empty-state/EmptyState.tsx
|
|
13
|
-
var p = u(({ icon: u, title: p, description: m, primaryAction: h, secondaryAction: g, type: _, size: v, panel: y, role: b, as: x, className: S,
|
|
14
|
-
let
|
|
13
|
+
var p = u(({ icon: u, title: p, description: m, primaryAction: h, secondaryAction: g, type: _, size: v, panel: y, role: b, as: x, className: S, actions: C, children: w, ...T }, E) => {
|
|
14
|
+
let D = t(), O = n({
|
|
15
15
|
type: _,
|
|
16
16
|
size: v,
|
|
17
17
|
panel: y
|
|
18
|
-
},
|
|
18
|
+
}, D.components?.emptystate, a);
|
|
19
19
|
return /* @__PURE__ */ f(x ?? "div", {
|
|
20
|
-
ref:
|
|
20
|
+
ref: E,
|
|
21
21
|
role: b,
|
|
22
|
-
className: e(o, l[
|
|
23
|
-
...
|
|
22
|
+
className: e(o, l[O.size], O.panel && "rounded-md border border-border bg-background", S),
|
|
23
|
+
...T,
|
|
24
24
|
children: [
|
|
25
25
|
u && /* @__PURE__ */ d("div", {
|
|
26
|
-
className: e(s[
|
|
26
|
+
className: e(s[O.type], c[O.size]),
|
|
27
27
|
children: u
|
|
28
28
|
}),
|
|
29
29
|
/* @__PURE__ */ d(r, {
|
|
@@ -35,9 +35,10 @@ var p = u(({ icon: u, title: p, description: m, primaryAction: h, secondaryActio
|
|
|
35
35
|
/* @__PURE__ */ d(i, {
|
|
36
36
|
primaryAction: h,
|
|
37
37
|
secondaryAction: g,
|
|
38
|
-
align: "center"
|
|
38
|
+
align: "center",
|
|
39
|
+
children: C
|
|
39
40
|
}),
|
|
40
|
-
|
|
41
|
+
w
|
|
41
42
|
]
|
|
42
43
|
});
|
|
43
44
|
});
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { ElementType, HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { ActionConfig } from '../../shared';
|
|
3
|
+
import { ErrorStateConfig } from './error-state-config';
|
|
4
|
+
type BaseErrorStateProps = ErrorStateConfig & Omit<HTMLAttributes<HTMLDivElement>, "color" | "title">;
|
|
5
|
+
/**
|
|
6
|
+
* Props for the ErrorState component.
|
|
7
|
+
*/
|
|
8
|
+
export interface ErrorStateProps extends BaseErrorStateProps {
|
|
9
|
+
/**
|
|
10
|
+
* What failed, in the reader's terms.
|
|
11
|
+
*/
|
|
12
|
+
title: ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* What the reader can do about it.
|
|
15
|
+
*/
|
|
16
|
+
description?: ReactNode;
|
|
17
|
+
/**
|
|
18
|
+
* The technical detail, typically the message a request returned.
|
|
19
|
+
* It is rendered inside a disclosure rather than in the open, because it is
|
|
20
|
+
* written for a developer rather than for the reader.
|
|
21
|
+
*/
|
|
22
|
+
detail?: ReactNode;
|
|
23
|
+
/**
|
|
24
|
+
* Called when the reader asks to try again.
|
|
25
|
+
* Its presence is what renders the retry control.
|
|
26
|
+
*/
|
|
27
|
+
onRetry?: () => void;
|
|
28
|
+
/**
|
|
29
|
+
* The emphasised action, when the way out is a destination rather than a
|
|
30
|
+
* retry.
|
|
31
|
+
*/
|
|
32
|
+
primaryAction?: ActionConfig;
|
|
33
|
+
/**
|
|
34
|
+
* The supporting action.
|
|
35
|
+
*/
|
|
36
|
+
secondaryAction?: ActionConfig;
|
|
37
|
+
/**
|
|
38
|
+
* Icon shown above the title.
|
|
39
|
+
* Defaults to the framework's error icon.
|
|
40
|
+
*/
|
|
41
|
+
icon?: ReactNode;
|
|
42
|
+
/**
|
|
43
|
+
* Element to render.
|
|
44
|
+
* Defaults to a `div`.
|
|
45
|
+
*
|
|
46
|
+
* @default "div"
|
|
47
|
+
*/
|
|
48
|
+
as?: ElementType;
|
|
49
|
+
/**
|
|
50
|
+
* Content below the actions.
|
|
51
|
+
*/
|
|
52
|
+
children?: ReactNode;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* A region whose content could not be loaded.
|
|
56
|
+
*
|
|
57
|
+
* The state is an `alert` by default, because it usually replaces content after
|
|
58
|
+
* a request failed and therefore has to be announced. A state that is part of
|
|
59
|
+
* the page from the start, such as a not-found page, passes `role="none"` so it
|
|
60
|
+
* is not announced as a change that just happened.
|
|
61
|
+
*
|
|
62
|
+
* A retry is a React handler rather than a configured action, because a
|
|
63
|
+
* configured action describes a destination. It is rendered in the same group as
|
|
64
|
+
* any configured actions, so the two arrangements agree.
|
|
65
|
+
*
|
|
66
|
+
* @param props - ErrorState configuration options and element attributes.
|
|
67
|
+
* @param props.title - What failed.
|
|
68
|
+
* @param props.description - What the reader can do about it.
|
|
69
|
+
* @param props.detail - The technical message, inside a disclosure.
|
|
70
|
+
* @param props.onRetry - Called when the reader asks to try again.
|
|
71
|
+
* @param props.primaryAction - The emphasised action.
|
|
72
|
+
* @param props.secondaryAction - The supporting action.
|
|
73
|
+
* @param props.size - Density. Defaults to "md".
|
|
74
|
+
* @param props.panel - Draw the state as a panel. Defaults to true.
|
|
75
|
+
* @param props.role - How the state is announced. Defaults to "alert".
|
|
76
|
+
* @param props.retryLabel - Wording of the retry control. Defaults to "Try
|
|
77
|
+
* again".
|
|
78
|
+
* @param props.detailLabel - Wording of the disclosure. Defaults to "Technical
|
|
79
|
+
* details".
|
|
80
|
+
* @param props.as - Element to render. Defaults to "div".
|
|
81
|
+
* @returns The rendered state.
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* ```tsx
|
|
85
|
+
* <ErrorState
|
|
86
|
+
* title="Invoices could not be loaded"
|
|
87
|
+
* description="The request timed out. Trying again usually works."
|
|
88
|
+
* detail={error.message}
|
|
89
|
+
* onRetry={refetch}
|
|
90
|
+
* />
|
|
91
|
+
* ```
|
|
92
|
+
*
|
|
93
|
+
* @see EmptyState - The presentation for a region that has nothing in it.
|
|
94
|
+
* @see LoadingState - The presentation for a region that has not arrived yet.
|
|
95
|
+
*/
|
|
96
|
+
export declare const ErrorState: import('react').ForwardRefExoticComponent<ErrorStateProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
97
|
+
export {};
|
|
98
|
+
//# sourceMappingURL=ErrorState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ErrorState.d.ts","sourceRoot":"","sources":["../../../src/components/error-state/ErrorState.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,EACL,KAAK,WAAW,EAEhB,KAAK,cAAc,EACnB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAGf,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAIjD,OAAO,EACL,KAAK,gBAAgB,EAEtB,MAAM,sBAAsB,CAAC;AAO9B,KAAK,mBAAmB,GAAG,gBAAgB,GACzC,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,CAAC;AAE1D;;GAEG;AACH,MAAM,WAAW,eAAgB,SAAQ,mBAAmB;IAC1D;;OAEG;IACH,KAAK,EAAE,SAAS,CAAC;IAEjB;;OAEG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IAExB;;;;OAIG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;IAEnB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAErB;;;OAGG;IACH,aAAa,CAAC,EAAE,YAAY,CAAC;IAE7B;;OAEG;IACH,eAAe,CAAC,EAAE,YAAY,CAAC;IAE/B;;;OAGG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IAEjB;;;;;OAKG;IACH,EAAE,CAAC,EAAE,WAAW,CAAC;IAEjB;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,eAAO,MAAM,UAAU,4GAwEtB,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
import { useAsheeConfig as e } from "../../libs/context.js";
|
|
4
|
+
import { resolveConfigCascade as t } from "../../utils/resolve-token.js";
|
|
5
|
+
import { ErrorIcon as n } from "../../icons/ErrorIcon.js";
|
|
6
|
+
import { Button as r } from "../button/Button.js";
|
|
7
|
+
import { EmptyState as i } from "../empty-state/EmptyState.js";
|
|
8
|
+
import { FALLBACK_ERROR_STATE_CONFIG as a } from "./error-state-config.js";
|
|
9
|
+
import "./error-state-styles.js";
|
|
10
|
+
import { forwardRef as o } from "react";
|
|
11
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
12
|
+
//#region src/components/error-state/ErrorState.tsx
|
|
13
|
+
var l = o(({ title: o, description: l, detail: u, onRetry: d, primaryAction: f, secondaryAction: p, icon: m, size: h, panel: g, role: _, retryLabel: v, detailLabel: y, as: b, className: x, children: S, ...C }, w) => {
|
|
14
|
+
let T = e(), E = t({
|
|
15
|
+
size: h,
|
|
16
|
+
panel: g,
|
|
17
|
+
role: _,
|
|
18
|
+
retryLabel: v,
|
|
19
|
+
detailLabel: y
|
|
20
|
+
}, T.components?.errorstate, a);
|
|
21
|
+
return /* @__PURE__ */ c(i, {
|
|
22
|
+
...C,
|
|
23
|
+
ref: w,
|
|
24
|
+
as: b,
|
|
25
|
+
className: x,
|
|
26
|
+
type: "error",
|
|
27
|
+
size: E.size,
|
|
28
|
+
panel: E.panel,
|
|
29
|
+
role: E.role === "none" ? void 0 : E.role,
|
|
30
|
+
icon: m ?? /* @__PURE__ */ s(n, {}),
|
|
31
|
+
title: o,
|
|
32
|
+
description: l,
|
|
33
|
+
primaryAction: f,
|
|
34
|
+
secondaryAction: p,
|
|
35
|
+
actions: d ? /* @__PURE__ */ s(r, {
|
|
36
|
+
type: "button",
|
|
37
|
+
variant: "solid",
|
|
38
|
+
color: "danger",
|
|
39
|
+
size: E.size,
|
|
40
|
+
onClick: d,
|
|
41
|
+
children: E.retryLabel
|
|
42
|
+
}) : void 0,
|
|
43
|
+
children: [u && /* @__PURE__ */ c("details", {
|
|
44
|
+
className: "w-full max-w-2xl text-left text-sm text-foreground/70",
|
|
45
|
+
children: [/* @__PURE__ */ s("summary", {
|
|
46
|
+
className: "cursor-pointer font-medium text-foreground",
|
|
47
|
+
children: E.detailLabel
|
|
48
|
+
}), /* @__PURE__ */ s("div", {
|
|
49
|
+
className: "mt-2 overflow-x-auto rounded-md border border-border bg-background p-3 font-mono text-xs",
|
|
50
|
+
children: u
|
|
51
|
+
})]
|
|
52
|
+
}), S]
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
l.displayName = "ErrorState";
|
|
56
|
+
//#endregion
|
|
57
|
+
export { l as ErrorState };
|