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,49 @@
|
|
|
1
|
+
import { Size, Space } from '../../shared';
|
|
2
|
+
/**
|
|
3
|
+
* Theme configuration options for the LoadingState component.
|
|
4
|
+
*
|
|
5
|
+
* Set under `components.loadingstate` in the AsheeUI config. Values feed the
|
|
6
|
+
* component-level tier of the theme cascade.
|
|
7
|
+
*/
|
|
8
|
+
export interface LoadingStateConfig {
|
|
9
|
+
/**
|
|
10
|
+
* Text announced and shown while the region loads.
|
|
11
|
+
*
|
|
12
|
+
* @default "Loading"
|
|
13
|
+
*/
|
|
14
|
+
label?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Density of the indicator and of the label.
|
|
17
|
+
*
|
|
18
|
+
* @default "md"
|
|
19
|
+
*/
|
|
20
|
+
size?: Size;
|
|
21
|
+
/**
|
|
22
|
+
* Whether the state is drawn as a panel.
|
|
23
|
+
* A panel suits a region inside a dashboard; without one the state sits
|
|
24
|
+
* directly on the page, which suits a whole-page load.
|
|
25
|
+
*
|
|
26
|
+
* @default false
|
|
27
|
+
*/
|
|
28
|
+
panel?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Room the state claims, so the page does not jump when the content arrives.
|
|
31
|
+
*
|
|
32
|
+
* @default "sm"
|
|
33
|
+
*/
|
|
34
|
+
minHeight?: Space;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Default config values registered for the LoadingState component.
|
|
38
|
+
*/
|
|
39
|
+
export declare const defaultLoadingStateConfig: LoadingStateConfig;
|
|
40
|
+
declare module "../../libs/registry" {
|
|
41
|
+
interface ComponentTypeConfigRegistry {
|
|
42
|
+
loadingstate: LoadingStateConfig;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Hard fallback values used when no config tier provides a value.
|
|
47
|
+
*/
|
|
48
|
+
export declare const FALLBACK_LOADING_STATE_CONFIG: Required<LoadingStateConfig>;
|
|
49
|
+
//# sourceMappingURL=loading-state-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loading-state-config.d.ts","sourceRoot":"","sources":["../../../src/components/loading-state/loading-state-config.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAEhD;;;;;GAKG;AACH,MAAM,WAAW,kBAAkB;IACjC;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;;OAIG;IACH,IAAI,CAAC,EAAE,IAAI,CAAC;IAEZ;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB;;;;OAIG;IACH,SAAS,CAAC,EAAE,KAAK,CAAC;CACnB;AAED;;GAEG;AACH,eAAO,MAAM,yBAAyB,EAAE,kBAKvC,CAAC;AAEF,OAAO,QAAQ,qBAAqB,CAAC;IACnC,UAAU,2BAA2B;QACnC,YAAY,EAAE,kBAAkB,CAAC;KAClC;CACF;AAID;;GAEG;AACH,eAAO,MAAM,6BAA6B,EAAE,QAAQ,CAAC,kBAAkB,CAKtE,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { registerComponentDefaults as e } from "../../libs/registry.js";
|
|
3
|
+
//#region src/components/loading-state/loading-state-config.ts
|
|
4
|
+
var t = {
|
|
5
|
+
label: "Loading",
|
|
6
|
+
size: "md",
|
|
7
|
+
panel: !1,
|
|
8
|
+
minHeight: "sm"
|
|
9
|
+
};
|
|
10
|
+
e("loadingstate", t);
|
|
11
|
+
var n = {
|
|
12
|
+
label: "Loading",
|
|
13
|
+
size: "md",
|
|
14
|
+
panel: !1,
|
|
15
|
+
minHeight: "sm"
|
|
16
|
+
};
|
|
17
|
+
//#endregion
|
|
18
|
+
export { n as FALLBACK_LOADING_STATE_CONFIG, t as defaultLoadingStateConfig };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Size } from '../../shared';
|
|
2
|
+
/** The loading region, which centres its indicator and its label. */
|
|
3
|
+
export declare const LOADING_STATE_CLASS = "flex w-full min-w-0 flex-col items-center justify-center gap-3 text-center";
|
|
4
|
+
/**
|
|
5
|
+
* The panel treatment, for a loading region inside a surface.
|
|
6
|
+
* It carries no padding of its own: the density decides the room, so a panel and
|
|
7
|
+
* a bare region of the same size agree.
|
|
8
|
+
*/
|
|
9
|
+
export declare const LOADING_STATE_PANEL_CLASS = "rounded-md border border-border bg-background";
|
|
10
|
+
/** Vertical padding for each density. */
|
|
11
|
+
export declare const LOADING_STATE_SIZE_CLASS: Record<Size, string>;
|
|
12
|
+
//# sourceMappingURL=loading-state-styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loading-state-styles.d.ts","sourceRoot":"","sources":["../../../src/components/loading-state/loading-state-styles.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,qEAAqE;AACrE,eAAO,MAAM,mBAAmB,+EAC8C,CAAC;AAE/E;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,kDACW,CAAC;AAElD,yCAAyC;AACzC,eAAO,MAAM,wBAAwB,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAIzD,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
//#region src/components/loading-state/loading-state-styles.ts
|
|
3
|
+
var e = "flex w-full min-w-0 flex-col items-center justify-center gap-3 text-center", t = "rounded-md border border-border bg-background", n = {
|
|
4
|
+
sm: "py-4",
|
|
5
|
+
md: "py-8",
|
|
6
|
+
lg: "py-12"
|
|
7
|
+
};
|
|
8
|
+
//#endregion
|
|
9
|
+
export { e as LOADING_STATE_CLASS, t as LOADING_STATE_PANEL_CLASS, n as LOADING_STATE_SIZE_CLASS };
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { ElementType, HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { MarketingLayoutConfig } from './marketing-layout-config';
|
|
3
|
+
type BaseMarketingLayoutProps = MarketingLayoutConfig & Omit<HTMLAttributes<HTMLDivElement>, "color">;
|
|
4
|
+
/**
|
|
5
|
+
* Props for the MarketingLayout component.
|
|
6
|
+
*/
|
|
7
|
+
export interface MarketingLayoutProps extends BaseMarketingLayoutProps {
|
|
8
|
+
/**
|
|
9
|
+
* The page's navigation, above the main region.
|
|
10
|
+
* The framework's `Navbar` renders a `header` landmark, so it belongs here
|
|
11
|
+
* unwrapped; a consumer's own navigation element does too.
|
|
12
|
+
*/
|
|
13
|
+
navigation?: ReactNode;
|
|
14
|
+
/**
|
|
15
|
+
* The page's footer, below the main region.
|
|
16
|
+
* The framework's `Footer` renders a `footer` landmark, so it belongs here
|
|
17
|
+
* unwrapped.
|
|
18
|
+
*/
|
|
19
|
+
footer?: ReactNode;
|
|
20
|
+
/**
|
|
21
|
+
* The page's sections, in the order they appear: a hero, then the supporting
|
|
22
|
+
* sections, then the closing call to action.
|
|
23
|
+
*/
|
|
24
|
+
children?: ReactNode;
|
|
25
|
+
/**
|
|
26
|
+
* Identifier of the main region, which the skip link points at.
|
|
27
|
+
* A page with more than one composition on it gives each one its own.
|
|
28
|
+
*
|
|
29
|
+
* @default "main-content"
|
|
30
|
+
*/
|
|
31
|
+
mainId?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Element to render the shell as.
|
|
34
|
+
* Defaults to a `div`.
|
|
35
|
+
*
|
|
36
|
+
* @default "div"
|
|
37
|
+
*/
|
|
38
|
+
as?: ElementType;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* The arrangement a marketing page is built in.
|
|
42
|
+
*
|
|
43
|
+
* The composition states the page's structure once: navigation first, then a
|
|
44
|
+
* `main` landmark holding the sections, then the footer, with a skip link as the
|
|
45
|
+
* first focusable element so a keyboard reader can pass the navigation. Which
|
|
46
|
+
* sections exist, in what order, and whether they appear at all stay the
|
|
47
|
+
* consumer's decision, because they are passed as children.
|
|
48
|
+
*
|
|
49
|
+
* The composition paints the page background and takes the viewport height. It
|
|
50
|
+
* adds no width and no rhythm of its own: `Section`, `Container` and `Grid`
|
|
51
|
+
* inside the sections decide those, which is what keeps a section usable on its
|
|
52
|
+
* own.
|
|
53
|
+
*
|
|
54
|
+
* @param props - MarketingLayout configuration options and element attributes.
|
|
55
|
+
* @param props.navigation - The navigation, above the main region.
|
|
56
|
+
* @param props.footer - The footer, below the main region.
|
|
57
|
+
* @param props.children - The sections, in order.
|
|
58
|
+
* @param props.mainId - Identifier of the main region. Defaults to
|
|
59
|
+
* "main-content".
|
|
60
|
+
* @param props.skipLink - Render a skip link. Defaults to true.
|
|
61
|
+
* @param props.skipLinkLabel - Wording of the skip link. Defaults to "Skip to
|
|
62
|
+
* content".
|
|
63
|
+
* @param props.background - Background to paint. Defaults to "default".
|
|
64
|
+
* @param props.as - Element to render. Defaults to "div".
|
|
65
|
+
* @returns The rendered page.
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```tsx
|
|
69
|
+
* <MarketingLayout
|
|
70
|
+
* navigation={<Navbar brand="Ashee" links={links} actions={actions} />}
|
|
71
|
+
* footer={<Footer brand="Ashee" groups={groups} />}>
|
|
72
|
+
* <Hero eyebrow="AsheeUI 2.0" title="A complete UI system" primaryAction={start} />
|
|
73
|
+
* <FeatureGrid title="Everything a page needs" features={features} />
|
|
74
|
+
* <CTA title="Start building" primaryAction={start} />
|
|
75
|
+
* </MarketingLayout>
|
|
76
|
+
* ```
|
|
77
|
+
*
|
|
78
|
+
* @see DocsLayout - The documentation composition.
|
|
79
|
+
* @see SidebarLayout - The application shell, for a page with a navigation column.
|
|
80
|
+
*/
|
|
81
|
+
export declare const MarketingLayout: import('react').ForwardRefExoticComponent<MarketingLayoutProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
82
|
+
export {};
|
|
83
|
+
//# sourceMappingURL=MarketingLayout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MarketingLayout.d.ts","sourceRoot":"","sources":["../../../src/components/marketing-layout/MarketingLayout.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,EACL,KAAK,WAAW,EAEhB,KAAK,cAAc,EACnB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAKf,OAAO,EAEL,KAAK,qBAAqB,EAC3B,MAAM,2BAA2B,CAAC;AAOnC,KAAK,wBAAwB,GAAG,qBAAqB,GACnD,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC,CAAC;AAEhD;;GAEG;AACH,MAAM,WAAW,oBAAqB,SAAQ,wBAAwB;IACpE;;;;OAIG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;IAEvB;;;;OAIG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;IAEnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IAErB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;;;OAKG;IACH,EAAE,CAAC,EAAE,WAAW,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,eAAO,MAAM,eAAe,iHAiD3B,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
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 { FALLBACK_MARKETING_LAYOUT_CONFIG as i } from "./marketing-layout-config.js";
|
|
8
|
+
import { MARKETING_LAYOUT_BACKGROUND_CLASS as a, MARKETING_LAYOUT_BASE_CLASS as o, MARKETING_LAYOUT_MAIN_CLASS as s } from "./marketing-layout-styles.js";
|
|
9
|
+
import { forwardRef as c } from "react";
|
|
10
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
11
|
+
//#region src/components/marketing-layout/MarketingLayout.tsx
|
|
12
|
+
var d = c(({ navigation: c, footer: d, children: f, mainId: p = "main-content", skipLink: m, skipLinkLabel: h, background: g, as: _, className: v, ...y }, b) => {
|
|
13
|
+
let x = t(), S = n({
|
|
14
|
+
skipLink: m,
|
|
15
|
+
skipLinkLabel: h,
|
|
16
|
+
background: g
|
|
17
|
+
}, x.components?.marketinglayout, i);
|
|
18
|
+
return /* @__PURE__ */ u(_ ?? "div", {
|
|
19
|
+
ref: b,
|
|
20
|
+
className: e(o, a[S.background], v),
|
|
21
|
+
...y,
|
|
22
|
+
children: [
|
|
23
|
+
S.skipLink && /* @__PURE__ */ l(r, {
|
|
24
|
+
targetId: p,
|
|
25
|
+
label: S.skipLinkLabel
|
|
26
|
+
}),
|
|
27
|
+
c,
|
|
28
|
+
/* @__PURE__ */ l("main", {
|
|
29
|
+
id: p,
|
|
30
|
+
tabIndex: -1,
|
|
31
|
+
className: s,
|
|
32
|
+
children: f
|
|
33
|
+
}),
|
|
34
|
+
d
|
|
35
|
+
]
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
d.displayName = "MarketingLayout";
|
|
39
|
+
//#endregion
|
|
40
|
+
export { d as MarketingLayout };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/marketing-layout/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MarketingLayout component configuration for AsheeUI.
|
|
3
|
+
* This file defines the configuration type and defaults for the marketing page
|
|
4
|
+
* composition: whether it renders a skip link, what that link says, and which
|
|
5
|
+
* background it paints. It registers the default configuration with the
|
|
6
|
+
* component registry and provides fallback values for the cascade resolution
|
|
7
|
+
* system.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* The background a marketing composition paints behind its content.
|
|
11
|
+
*
|
|
12
|
+
* - `default`: the theme background, for a page whose sections carry their own
|
|
13
|
+
* surfaces.
|
|
14
|
+
* - `muted`: a recessed background, for a page whose sections are cards.
|
|
15
|
+
*/
|
|
16
|
+
export type MarketingLayoutBackground = "default" | "muted";
|
|
17
|
+
/**
|
|
18
|
+
* Theme configuration options for the MarketingLayout component.
|
|
19
|
+
*
|
|
20
|
+
* Set under `components.marketinglayout` in the AsheeUI config. Values feed the
|
|
21
|
+
* component-level tier of the theme cascade.
|
|
22
|
+
*/
|
|
23
|
+
export interface MarketingLayoutConfig {
|
|
24
|
+
/**
|
|
25
|
+
* Whether the composition renders a skip link to its main region.
|
|
26
|
+
* A marketing page leads with navigation, so a keyboard reader needs to be
|
|
27
|
+
* able to pass it; the link is rendered as the first focusable element.
|
|
28
|
+
*
|
|
29
|
+
* @default true
|
|
30
|
+
*/
|
|
31
|
+
skipLink?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Wording of the skip link.
|
|
34
|
+
*
|
|
35
|
+
* @default "Skip to content"
|
|
36
|
+
*/
|
|
37
|
+
skipLinkLabel?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Background the composition paints.
|
|
40
|
+
*
|
|
41
|
+
* @default "default"
|
|
42
|
+
*/
|
|
43
|
+
background?: MarketingLayoutBackground;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Default config values registered for the MarketingLayout component.
|
|
47
|
+
* The skip link is on by default because it is the accessible choice, and it
|
|
48
|
+
* costs nothing when it is not used.
|
|
49
|
+
*/
|
|
50
|
+
export declare const defaultMarketingLayoutConfig: MarketingLayoutConfig;
|
|
51
|
+
declare module "../../libs/registry" {
|
|
52
|
+
interface ComponentTypeConfigRegistry {
|
|
53
|
+
marketinglayout: MarketingLayoutConfig;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Hard fallback values used when no config tier provides a value.
|
|
58
|
+
*/
|
|
59
|
+
export declare const FALLBACK_MARKETING_LAYOUT_CONFIG: Required<MarketingLayoutConfig>;
|
|
60
|
+
//# sourceMappingURL=marketing-layout-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"marketing-layout-config.d.ts","sourceRoot":"","sources":["../../../src/components/marketing-layout/marketing-layout-config.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH;;;;;;GAMG;AACH,MAAM,MAAM,yBAAyB,GAAG,SAAS,GAAG,OAAO,CAAC;AAE5D;;;;;GAKG;AACH,MAAM,WAAW,qBAAqB;IACpC;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;;;OAIG;IACH,UAAU,CAAC,EAAE,yBAAyB,CAAC;CACxC;AAED;;;;GAIG;AACH,eAAO,MAAM,4BAA4B,EAAE,qBAI1C,CAAC;AAEF,OAAO,QAAQ,qBAAqB,CAAC;IACnC,UAAU,2BAA2B;QACnC,eAAe,EAAE,qBAAqB,CAAC;KACxC;CACF;AAID;;GAEG;AACH,eAAO,MAAM,gCAAgC,EAAE,QAAQ,CAAC,qBAAqB,CAK1E,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { registerComponentDefaults as e } from "../../libs/registry.js";
|
|
3
|
+
//#region src/components/marketing-layout/marketing-layout-config.ts
|
|
4
|
+
var t = {
|
|
5
|
+
skipLink: !0,
|
|
6
|
+
skipLinkLabel: "Skip to content",
|
|
7
|
+
background: "default"
|
|
8
|
+
};
|
|
9
|
+
e("marketinglayout", t);
|
|
10
|
+
var n = {
|
|
11
|
+
skipLink: !0,
|
|
12
|
+
skipLinkLabel: "Skip to content",
|
|
13
|
+
background: "default"
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
16
|
+
export { n as FALLBACK_MARKETING_LAYOUT_CONFIG, t as defaultMarketingLayoutConfig };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { MarketingLayoutBackground } from './marketing-layout-config';
|
|
2
|
+
/** The page shell: a full-height column of regions. */
|
|
3
|
+
export declare const MARKETING_LAYOUT_BASE_CLASS = "flex min-h-dvh w-full flex-col";
|
|
4
|
+
/** The background the composition paints behind its sections. */
|
|
5
|
+
export declare const MARKETING_LAYOUT_BACKGROUND_CLASS: Record<MarketingLayoutBackground, string>;
|
|
6
|
+
/** The main region, which takes the height the header and footer leave. */
|
|
7
|
+
export declare const MARKETING_LAYOUT_MAIN_CLASS = "flex w-full flex-1 flex-col";
|
|
8
|
+
//# sourceMappingURL=marketing-layout-styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"marketing-layout-styles.d.ts","sourceRoot":"","sources":["../../../src/components/marketing-layout/marketing-layout-styles.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAE3E,uDAAuD;AACvD,eAAO,MAAM,2BAA2B,mCAAmC,CAAC;AAE5E,iEAAiE;AACjE,eAAO,MAAM,iCAAiC,EAAE,MAAM,CACpD,yBAAyB,EACzB,MAAM,CAIP,CAAC;AAEF,2EAA2E;AAC3E,eAAO,MAAM,2BAA2B,gCAAgC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
//#region src/components/marketing-layout/marketing-layout-styles.ts
|
|
3
|
+
var e = "flex min-h-dvh w-full flex-col", t = {
|
|
4
|
+
default: "bg-background",
|
|
5
|
+
muted: "bg-secondary/40"
|
|
6
|
+
}, n = "flex w-full flex-1 flex-col";
|
|
7
|
+
//#endregion
|
|
8
|
+
export { t as MARKETING_LAYOUT_BACKGROUND_CLASS, e as MARKETING_LAYOUT_BASE_CLASS, n as MARKETING_LAYOUT_MAIN_CLASS };
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { ChangeEventHandler, InputHTMLAttributes } from 'react';
|
|
2
|
+
import { FieldStatus } from '../field/field-config';
|
|
3
|
+
import { SearchInputConfig } from './search-input-config';
|
|
4
|
+
type BaseSearchInputProps = SearchInputConfig & Omit<InputHTMLAttributes<HTMLInputElement>, "children" | "className" | "color" | "defaultValue" | "onChange" | "size" | "type" | "value">;
|
|
5
|
+
/**
|
|
6
|
+
* Props for the SearchInput component.
|
|
7
|
+
*/
|
|
8
|
+
export interface SearchInputProps extends BaseSearchInputProps {
|
|
9
|
+
/**
|
|
10
|
+
* The current query, for a consumer that owns it.
|
|
11
|
+
*/
|
|
12
|
+
value?: string;
|
|
13
|
+
/**
|
|
14
|
+
* The initial query, for a consumer that does not.
|
|
15
|
+
*/
|
|
16
|
+
defaultValue?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Called with the native change event, which is how a form library hears
|
|
19
|
+
* about the field.
|
|
20
|
+
*/
|
|
21
|
+
onChange?: ChangeEventHandler<HTMLInputElement>;
|
|
22
|
+
/**
|
|
23
|
+
* Called with the next query whenever it changes, including when the field is
|
|
24
|
+
* emptied. It is the handler to use when the query drives a result list.
|
|
25
|
+
*/
|
|
26
|
+
onValueChange?: (value: string) => void;
|
|
27
|
+
/**
|
|
28
|
+
* Called with the query when the reader submits the field.
|
|
29
|
+
* Supplying it makes the component a form, so Enter submits and the field is
|
|
30
|
+
* announced as the page's search.
|
|
31
|
+
*/
|
|
32
|
+
onSearch?: (value: string) => void;
|
|
33
|
+
/**
|
|
34
|
+
* Supporting text under the field.
|
|
35
|
+
*/
|
|
36
|
+
description?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Validation message under the field.
|
|
39
|
+
*/
|
|
40
|
+
message?: string;
|
|
41
|
+
/**
|
|
42
|
+
* Validation status of the field.
|
|
43
|
+
*
|
|
44
|
+
* @default "default"
|
|
45
|
+
*/
|
|
46
|
+
status?: FieldStatus;
|
|
47
|
+
/**
|
|
48
|
+
* Whether a search is in progress, which the field reports as busy.
|
|
49
|
+
*
|
|
50
|
+
* @default false
|
|
51
|
+
*/
|
|
52
|
+
isLoading?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Keyboard shortcut a consumer has bound elsewhere, shown as a hint.
|
|
55
|
+
* The field only displays it: binding a global shortcut is an application
|
|
56
|
+
* concern, because the field cannot know what else the shortcut should do.
|
|
57
|
+
*/
|
|
58
|
+
shortcut?: string;
|
|
59
|
+
/**
|
|
60
|
+
* Extra classes for the search region.
|
|
61
|
+
*/
|
|
62
|
+
className?: string;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* A text field that searches.
|
|
66
|
+
*
|
|
67
|
+
* SearchInput composes the framework's text field and adds the search contract:
|
|
68
|
+
* the field is announced as a search region with a name, so a screen reader user
|
|
69
|
+
* can jump to it; the query is reported through `onValueChange` while it is typed
|
|
70
|
+
* and through `onSearch` when it is submitted; and the field can empty itself
|
|
71
|
+
* with a named control instead of requiring the reader to select the text and
|
|
72
|
+
* delete it.
|
|
73
|
+
*
|
|
74
|
+
* The component is controlled when `value` is given, and owns the query
|
|
75
|
+
* otherwise. The clear control works in both cases: it empties the field and
|
|
76
|
+
* returns focus to it, and a controlled consumer hears about the change through
|
|
77
|
+
* `onValueChange` so it can update its own state.
|
|
78
|
+
*
|
|
79
|
+
* @param props - SearchInput configuration options and input attributes.
|
|
80
|
+
* @param props.value - The query, for a controlled consumer.
|
|
81
|
+
* @param props.defaultValue - The initial query, for an uncontrolled one.
|
|
82
|
+
* @param props.onValueChange - Called with the next query.
|
|
83
|
+
* @param props.onSearch - Called with the query on submit, which is also what
|
|
84
|
+
* makes the component a form.
|
|
85
|
+
* @param props.label - Name of the region and of the field. Defaults to
|
|
86
|
+
* "Search".
|
|
87
|
+
* @param props.hideLabel - Keep the name for assistive technology only.
|
|
88
|
+
* Defaults to true.
|
|
89
|
+
* @param props.clearable - Offer a control that empties the field. Defaults to
|
|
90
|
+
* true.
|
|
91
|
+
* @param props.shortcut - Shortcut a consumer has bound, shown as a hint.
|
|
92
|
+
* @param props.isLoading - Report a search in progress. Defaults to false.
|
|
93
|
+
* @param props.size - Density of the field and its controls. Defaults to "md".
|
|
94
|
+
* @returns The rendered field.
|
|
95
|
+
*
|
|
96
|
+
* @example
|
|
97
|
+
* ```tsx
|
|
98
|
+
* <SearchInput
|
|
99
|
+
* placeholder="Search invoices"
|
|
100
|
+
* onValueChange={setQuery}
|
|
101
|
+
* onSearch={runSearch}
|
|
102
|
+
* shortcut="Command K"
|
|
103
|
+
* />
|
|
104
|
+
* ```
|
|
105
|
+
*
|
|
106
|
+
* @see Input - The text field the component composes.
|
|
107
|
+
* @see DataTable - Uses it for the search control above a table.
|
|
108
|
+
*/
|
|
109
|
+
export declare const SearchInput: import('react').ForwardRefExoticComponent<SearchInputProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
110
|
+
export {};
|
|
111
|
+
//# sourceMappingURL=SearchInput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SearchInput.d.ts","sourceRoot":"","sources":["../../../src/components/search-input/SearchInput.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,EACL,KAAK,kBAAkB,EAEvB,KAAK,mBAAmB,EAIzB,MAAM,OAAO,CAAC;AAOf,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAGzD,OAAO,EAEL,KAAK,iBAAiB,EACvB,MAAM,uBAAuB,CAAC;AAS/B,KAAK,oBAAoB,GAAG,iBAAiB,GAC3C,IAAI,CACF,mBAAmB,CAAC,gBAAgB,CAAC,EACnC,UAAU,GACV,WAAW,GACX,OAAO,GACP,cAAc,GACd,UAAU,GACV,MAAM,GACN,MAAM,GACN,OAAO,CACV,CAAC;AAEJ;;GAEG;AACH,MAAM,WAAW,gBAAiB,SAAQ,oBAAoB;IAC5D;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;OAGG;IACH,QAAQ,CAAC,EAAE,kBAAkB,CAAC,gBAAgB,CAAC,CAAC;IAEhD;;;OAGG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAExC;;;;OAIG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAEnC;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;;OAIG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;IAErB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,eAAO,MAAM,WAAW,+GA0KvB,CAAC"}
|
|
@@ -0,0 +1,86 @@
|
|
|
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 { Spinner as r } from "../spinner/spinner.js";
|
|
7
|
+
import { Button as i } from "../button/Button.js";
|
|
8
|
+
import { Input as a } from "../input/Input.js";
|
|
9
|
+
import { SearchIcon as o } from "../../icons/SearchIcon.js";
|
|
10
|
+
import { ClearIcon as s } from "../../icons/ClearIcon.js";
|
|
11
|
+
import { FALLBACK_SEARCH_INPUT_CONFIG as c } from "./search-input-config.js";
|
|
12
|
+
import { SEARCH_INPUT_HINT_SIZE_CLASS as l, SEARCH_INPUT_REGION_CLASS as u } from "./search-input-styles.js";
|
|
13
|
+
import { forwardRef as d, useId as f, useRef as p, useState as m } from "react";
|
|
14
|
+
import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
15
|
+
//#region src/components/search-input/SearchInput.tsx
|
|
16
|
+
var v = d(({ value: d, defaultValue: v, onChange: y, onValueChange: b, onSearch: x, description: S, message: C, status: w, isLoading: T, shortcut: E, label: D, hideLabel: O, clearable: k, size: A, color: j, className: M, id: N, ...P }, F) => {
|
|
17
|
+
let I = t(), L = f(), R = N ?? L, z = n({
|
|
18
|
+
size: A,
|
|
19
|
+
color: j,
|
|
20
|
+
clearable: k,
|
|
21
|
+
label: D,
|
|
22
|
+
hideLabel: O
|
|
23
|
+
}, I.components?.searchinput, c), [B, V] = m(v ?? ""), H = d ?? B, U = H.length > 0, W = p(null), G = (e) => {
|
|
24
|
+
W.current = e, typeof F == "function" ? F(e) : F && (F.current = e);
|
|
25
|
+
}, K = (e) => {
|
|
26
|
+
y?.(e), d === void 0 && V(e.target.value), b?.(e.target.value);
|
|
27
|
+
}, q = () => {
|
|
28
|
+
let e = W.current;
|
|
29
|
+
e && (e.value = "", e.focus()), d === void 0 && V(""), b?.("");
|
|
30
|
+
}, J = !!x, Y = /* @__PURE__ */ _(h, { children: [z.hideLabel && /* @__PURE__ */ g("label", {
|
|
31
|
+
htmlFor: R,
|
|
32
|
+
className: "sr-only",
|
|
33
|
+
children: z.label
|
|
34
|
+
}), /* @__PURE__ */ g(a, {
|
|
35
|
+
...P,
|
|
36
|
+
ref: G,
|
|
37
|
+
id: R,
|
|
38
|
+
type: "search",
|
|
39
|
+
value: d,
|
|
40
|
+
defaultValue: d === void 0 ? v : void 0,
|
|
41
|
+
onChange: K,
|
|
42
|
+
label: z.hideLabel ? void 0 : z.label,
|
|
43
|
+
description: S,
|
|
44
|
+
message: C,
|
|
45
|
+
status: w,
|
|
46
|
+
size: z.size,
|
|
47
|
+
color: z.color,
|
|
48
|
+
"aria-busy": T,
|
|
49
|
+
startContent: /* @__PURE__ */ g(o, {}),
|
|
50
|
+
endContent: /* @__PURE__ */ _(h, { children: [
|
|
51
|
+
E && /* @__PURE__ */ g("kbd", {
|
|
52
|
+
className: e("pointer-events-none shrink-0 rounded border border-border px-1.5 py-0.5 text-xs text-foreground/60", l[z.size]),
|
|
53
|
+
children: E
|
|
54
|
+
}),
|
|
55
|
+
T && /* @__PURE__ */ g(r, { size: "sm" }),
|
|
56
|
+
z.clearable && U && /* @__PURE__ */ g(i, {
|
|
57
|
+
icon: !0,
|
|
58
|
+
type: "button",
|
|
59
|
+
variant: "ghost",
|
|
60
|
+
size: z.size,
|
|
61
|
+
color: z.color,
|
|
62
|
+
"aria-label": "Clear search",
|
|
63
|
+
className: "shrink-0",
|
|
64
|
+
onClick: q,
|
|
65
|
+
children: /* @__PURE__ */ g(s, {})
|
|
66
|
+
})
|
|
67
|
+
] })
|
|
68
|
+
})] }), X = e(u, M);
|
|
69
|
+
return J ? /* @__PURE__ */ g("form", {
|
|
70
|
+
role: "search",
|
|
71
|
+
"aria-label": z.label,
|
|
72
|
+
className: X,
|
|
73
|
+
onSubmit: (e) => {
|
|
74
|
+
e.preventDefault(), x?.(H);
|
|
75
|
+
},
|
|
76
|
+
children: Y
|
|
77
|
+
}) : /* @__PURE__ */ g("div", {
|
|
78
|
+
role: "search",
|
|
79
|
+
"aria-label": z.label,
|
|
80
|
+
className: X,
|
|
81
|
+
children: Y
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
v.displayName = "SearchInput";
|
|
85
|
+
//#endregion
|
|
86
|
+
export { v as SearchInput };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/search-input/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { Color, Size } from '../../shared';
|
|
2
|
+
/**
|
|
3
|
+
* Theme configuration options for the SearchInput component.
|
|
4
|
+
*
|
|
5
|
+
* Set under `components.searchinput` in the AsheeUI config. Values feed the
|
|
6
|
+
* component-level tier of the theme cascade.
|
|
7
|
+
*/
|
|
8
|
+
export interface SearchInputConfig {
|
|
9
|
+
/**
|
|
10
|
+
* Density of the field and of the control that dismisses its text.
|
|
11
|
+
*
|
|
12
|
+
* @default "md"
|
|
13
|
+
*/
|
|
14
|
+
size?: Size;
|
|
15
|
+
/**
|
|
16
|
+
* Accent colour of the field's focus ring.
|
|
17
|
+
*
|
|
18
|
+
* @default "primary"
|
|
19
|
+
*/
|
|
20
|
+
color?: Color;
|
|
21
|
+
/**
|
|
22
|
+
* Whether the field offers a control that empties it.
|
|
23
|
+
*
|
|
24
|
+
* @default true
|
|
25
|
+
*/
|
|
26
|
+
clearable?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Visible label of the field.
|
|
29
|
+
* A search field is often named only for assistive technology, so the label
|
|
30
|
+
* can be hidden from view with `hideLabel`.
|
|
31
|
+
*/
|
|
32
|
+
label?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Whether the label is available to assistive technology only.
|
|
35
|
+
*
|
|
36
|
+
* @default true
|
|
37
|
+
*/
|
|
38
|
+
hideLabel?: boolean;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Default config values registered for the SearchInput component.
|
|
42
|
+
* The label is named and hidden rather than absent, because a field whose name
|
|
43
|
+
* is empty is announced as "search" and nothing else.
|
|
44
|
+
*/
|
|
45
|
+
export declare const defaultSearchInputConfig: SearchInputConfig;
|
|
46
|
+
declare module "../../libs/registry" {
|
|
47
|
+
interface ComponentTypeConfigRegistry {
|
|
48
|
+
searchinput: SearchInputConfig;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Hard fallback values used when no config tier provides a value.
|
|
53
|
+
*/
|
|
54
|
+
export declare const FALLBACK_SEARCH_INPUT_CONFIG: Required<SearchInputConfig>;
|
|
55
|
+
//# sourceMappingURL=search-input-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-input-config.d.ts","sourceRoot":"","sources":["../../../src/components/search-input/search-input-config.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEhD;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;;OAIG;IACH,IAAI,CAAC,EAAE,IAAI,CAAC;IAEZ;;;;OAIG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC;IAEd;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,EAAE,iBAMtC,CAAC;AAEF,OAAO,QAAQ,qBAAqB,CAAC;IACnC,UAAU,2BAA2B;QACnC,WAAW,EAAE,iBAAiB,CAAC;KAChC;CACF;AAID;;GAEG;AACH,eAAO,MAAM,4BAA4B,EAAE,QAAQ,CAAC,iBAAiB,CAMpE,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { registerComponentDefaults as e } from "../../libs/registry.js";
|
|
3
|
+
//#region src/components/search-input/search-input-config.ts
|
|
4
|
+
var t = {
|
|
5
|
+
size: "md",
|
|
6
|
+
color: "primary",
|
|
7
|
+
clearable: !0,
|
|
8
|
+
label: "Search",
|
|
9
|
+
hideLabel: !0
|
|
10
|
+
};
|
|
11
|
+
e("searchinput", t);
|
|
12
|
+
var n = {
|
|
13
|
+
size: "md",
|
|
14
|
+
color: "primary",
|
|
15
|
+
clearable: !0,
|
|
16
|
+
label: "Search",
|
|
17
|
+
hideLabel: !0
|
|
18
|
+
};
|
|
19
|
+
//#endregion
|
|
20
|
+
export { n as FALLBACK_SEARCH_INPUT_CONFIG, t as defaultSearchInputConfig };
|