asheeui 1.0.0 → 1.1.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 +61 -166
- package/dist/components/alert/Alert.d.ts.map +1 -1
- package/dist/components/alert/Alert.js +6 -6
- package/dist/components/auth-layout/AuthLayout.d.ts +79 -0
- package/dist/components/auth-layout/AuthLayout.d.ts.map +1 -0
- package/dist/components/auth-layout/AuthLayout.js +54 -0
- package/dist/components/auth-layout/auth-layout-config.d.ts +41 -0
- package/dist/components/auth-layout/auth-layout-config.d.ts.map +1 -0
- package/dist/components/auth-layout/auth-layout-config.js +18 -0
- package/dist/components/auth-layout/auth-layout-styles.d.ts +25 -0
- package/dist/components/auth-layout/auth-layout-styles.d.ts.map +1 -0
- package/dist/components/auth-layout/auth-layout-styles.js +11 -0
- package/dist/components/auth-layout/index.d.ts +3 -0
- package/dist/components/auth-layout/index.d.ts.map +1 -0
- package/dist/components/auth-layout/index.js +3 -0
- package/dist/components/autocomplete/Autocomplete.d.ts.map +1 -1
- package/dist/components/avatar/Avatar.d.ts.map +1 -1
- package/dist/components/avatar/Avatar.js +7 -7
- package/dist/components/badge/Badge.d.ts.map +1 -1
- package/dist/components/badge/Badge.js +3 -3
- package/dist/components/breadcrumb/Breadcrumb.d.ts.map +1 -1
- package/dist/components/breadcrumb/Breadcrumb.js +6 -6
- package/dist/components/calendar/Calendar.d.ts.map +1 -1
- package/dist/components/calendar/Calendar.js +4 -4
- package/dist/components/calendar/DateGrid.d.ts.map +1 -1
- package/dist/components/calendar/DateGrid.js +87 -87
- package/dist/components/clipboard/Clipboard.d.ts +75 -0
- package/dist/components/clipboard/Clipboard.d.ts.map +1 -0
- package/dist/components/clipboard/Clipboard.js +53 -0
- package/dist/components/clipboard/CopyButton.d.ts +64 -0
- package/dist/components/clipboard/CopyButton.d.ts.map +1 -0
- package/dist/components/clipboard/CopyButton.js +44 -0
- package/dist/components/clipboard/clipboard-config.d.ts +42 -0
- package/dist/components/clipboard/clipboard-config.d.ts.map +1 -0
- package/dist/components/clipboard/clipboard-config.js +23 -0
- package/dist/components/clipboard/clipboard-styles.d.ts +11 -0
- package/dist/components/clipboard/clipboard-styles.d.ts.map +1 -0
- package/dist/components/clipboard/clipboard-styles.js +5 -0
- package/dist/components/clipboard/index.d.ts +4 -0
- package/dist/components/clipboard/index.d.ts.map +1 -0
- package/dist/components/clipboard/index.js +4 -0
- package/dist/components/container/Container.d.ts +51 -0
- package/dist/components/container/Container.d.ts.map +1 -0
- package/dist/components/container/Container.js +21 -0
- package/dist/components/container/container-config.d.ts +61 -0
- package/dist/components/container/container-config.d.ts.map +1 -0
- package/dist/components/container/container-config.js +16 -0
- package/dist/components/container/container-styles.d.ts +18 -0
- package/dist/components/container/container-styles.d.ts.map +1 -0
- package/dist/components/container/container-styles.js +12 -0
- package/dist/components/container/index.d.ts +3 -0
- package/dist/components/container/index.d.ts.map +1 -0
- package/dist/components/container/index.js +3 -0
- package/dist/components/cta/CTA.d.ts +81 -0
- package/dist/components/cta/CTA.d.ts.map +1 -0
- package/dist/components/cta/CTA.js +60 -0
- package/dist/components/cta/cta-config.d.ts +69 -0
- package/dist/components/cta/cta-config.d.ts.map +1 -0
- package/dist/components/cta/cta-config.js +22 -0
- package/dist/components/cta/cta-styles.d.ts +8 -0
- package/dist/components/cta/cta-styles.d.ts.map +1 -0
- package/dist/components/cta/cta-styles.js +9 -0
- package/dist/components/cta/index.d.ts +3 -0
- package/dist/components/cta/index.d.ts.map +1 -0
- package/dist/components/cta/index.js +3 -0
- package/dist/components/dropmenu/Dropmenu.d.ts.map +1 -1
- package/dist/components/empty-state/EmptyState.d.ts +77 -0
- package/dist/components/empty-state/EmptyState.d.ts.map +1 -0
- package/dist/components/empty-state/EmptyState.js +46 -0
- package/dist/components/empty-state/empty-state-config.d.ts +44 -0
- package/dist/components/empty-state/empty-state-config.d.ts.map +1 -0
- package/dist/components/empty-state/empty-state-config.js +16 -0
- package/dist/components/empty-state/empty-state-styles.d.ts +13 -0
- package/dist/components/empty-state/empty-state-styles.d.ts.map +1 -0
- package/dist/components/empty-state/empty-state-styles.js +18 -0
- package/dist/components/empty-state/index.d.ts +3 -0
- package/dist/components/empty-state/index.d.ts.map +1 -0
- package/dist/components/empty-state/index.js +3 -0
- package/dist/components/feature-grid/FeatureGrid.d.ts +107 -0
- package/dist/components/feature-grid/FeatureGrid.d.ts.map +1 -0
- package/dist/components/feature-grid/FeatureGrid.js +94 -0
- package/dist/components/feature-grid/feature-grid-config.d.ts +80 -0
- package/dist/components/feature-grid/feature-grid-config.d.ts.map +1 -0
- package/dist/components/feature-grid/feature-grid-config.js +28 -0
- package/dist/components/feature-grid/feature-grid-styles.d.ts +11 -0
- package/dist/components/feature-grid/feature-grid-styles.d.ts.map +1 -0
- package/dist/components/feature-grid/feature-grid-styles.js +5 -0
- package/dist/components/feature-grid/index.d.ts +3 -0
- package/dist/components/feature-grid/index.d.ts.map +1 -0
- package/dist/components/feature-grid/index.js +3 -0
- package/dist/components/footer/Footer.d.ts +73 -0
- package/dist/components/footer/Footer.d.ts.map +1 -0
- package/dist/components/footer/Footer.js +112 -0
- package/dist/components/footer/footer-config.d.ts +40 -0
- package/dist/components/footer/footer-config.d.ts.map +1 -0
- package/dist/components/footer/footer-config.js +18 -0
- package/dist/components/footer/footer-styles.d.ts +22 -0
- package/dist/components/footer/footer-styles.d.ts.map +1 -0
- package/dist/components/footer/footer-styles.js +9 -0
- package/dist/components/footer/index.d.ts +3 -0
- package/dist/components/footer/index.d.ts.map +1 -0
- package/dist/components/footer/index.js +3 -0
- package/dist/components/form/Form.d.ts.map +1 -1
- package/dist/components/grid/Grid.d.ts +71 -0
- package/dist/components/grid/Grid.d.ts.map +1 -0
- package/dist/components/grid/Grid.js +23 -0
- package/dist/components/grid/grid-config.d.ts +63 -0
- package/dist/components/grid/grid-config.d.ts.map +1 -0
- package/dist/components/grid/grid-config.js +16 -0
- package/dist/components/grid/grid-styles.d.ts +12 -0
- package/dist/components/grid/grid-styles.d.ts.map +1 -0
- package/dist/components/grid/grid-styles.js +31 -0
- package/dist/components/grid/index.d.ts +3 -0
- package/dist/components/grid/index.d.ts.map +1 -0
- package/dist/components/grid/index.js +3 -0
- package/dist/components/hero/Hero.d.ts +90 -0
- package/dist/components/hero/Hero.d.ts.map +1 -0
- package/dist/components/hero/Hero.js +63 -0
- package/dist/components/hero/hero-config.d.ts +71 -0
- package/dist/components/hero/hero-config.d.ts.map +1 -0
- package/dist/components/hero/hero-config.js +22 -0
- package/dist/components/hero/hero-styles.d.ts +19 -0
- package/dist/components/hero/hero-styles.d.ts.map +1 -0
- package/dist/components/hero/hero-styles.js +5 -0
- package/dist/components/hero/index.d.ts +3 -0
- package/dist/components/hero/index.d.ts.map +1 -0
- package/dist/components/hero/index.js +3 -0
- package/dist/components/multi-select/MultiSelect.d.ts.map +1 -1
- package/dist/components/navbar/Navbar.d.ts +87 -0
- package/dist/components/navbar/Navbar.d.ts.map +1 -0
- package/dist/components/navbar/Navbar.js +117 -0
- package/dist/components/navbar/index.d.ts +3 -0
- package/dist/components/navbar/index.d.ts.map +1 -0
- package/dist/components/navbar/index.js +3 -0
- package/dist/components/navbar/navbar-config.d.ts +52 -0
- package/dist/components/navbar/navbar-config.d.ts.map +1 -0
- package/dist/components/navbar/navbar-config.js +20 -0
- package/dist/components/navbar/navbar-styles.d.ts +28 -0
- package/dist/components/navbar/navbar-styles.d.ts.map +1 -0
- package/dist/components/navbar/navbar-styles.js +9 -0
- package/dist/components/page/Page.d.ts +166 -0
- package/dist/components/page/Page.d.ts.map +1 -0
- package/dist/components/page/Page.js +90 -0
- package/dist/components/page/index.d.ts +3 -0
- package/dist/components/page/index.d.ts.map +1 -0
- package/dist/components/page/index.js +3 -0
- package/dist/components/page/page-config.d.ts +57 -0
- package/dist/components/page/page-config.d.ts.map +1 -0
- package/dist/components/page/page-config.js +20 -0
- package/dist/components/page/page-styles.d.ts +25 -0
- package/dist/components/page/page-styles.d.ts.map +1 -0
- package/dist/components/page/page-styles.js +5 -0
- package/dist/components/pagination/Pagination.d.ts.map +1 -1
- package/dist/components/pagination/Pagination.js +8 -8
- package/dist/components/pin-input/PinInput.d.ts +109 -0
- package/dist/components/pin-input/PinInput.d.ts.map +1 -0
- package/dist/components/pin-input/PinInput.js +124 -0
- package/dist/components/pin-input/index.d.ts +3 -0
- package/dist/components/pin-input/index.d.ts.map +1 -0
- package/dist/components/pin-input/index.js +3 -0
- package/dist/components/pin-input/pin-input-config.d.ts +82 -0
- package/dist/components/pin-input/pin-input-config.d.ts.map +1 -0
- package/dist/components/pin-input/pin-input-config.js +23 -0
- package/dist/components/pin-input/pin-input-styles.d.ts +16 -0
- package/dist/components/pin-input/pin-input-styles.d.ts.map +1 -0
- package/dist/components/pin-input/pin-input-styles.js +9 -0
- package/dist/components/pricing-card/PricingCard.d.ts +87 -0
- package/dist/components/pricing-card/PricingCard.d.ts.map +1 -0
- package/dist/components/pricing-card/PricingCard.js +79 -0
- package/dist/components/pricing-card/index.d.ts +3 -0
- package/dist/components/pricing-card/index.d.ts.map +1 -0
- package/dist/components/pricing-card/index.js +3 -0
- package/dist/components/pricing-card/pricing-card-config.d.ts +35 -0
- package/dist/components/pricing-card/pricing-card-config.d.ts.map +1 -0
- package/dist/components/pricing-card/pricing-card-config.js +16 -0
- package/dist/components/pricing-card/pricing-card-styles.d.ts +21 -0
- package/dist/components/pricing-card/pricing-card-styles.d.ts.map +1 -0
- package/dist/components/pricing-card/pricing-card-styles.js +5 -0
- package/dist/components/radio/RadioGroup.d.ts.map +1 -1
- package/dist/components/section/Section.d.ts +56 -0
- package/dist/components/section/Section.d.ts.map +1 -0
- package/dist/components/section/Section.js +27 -0
- package/dist/components/section/index.d.ts +3 -0
- package/dist/components/section/index.d.ts.map +1 -0
- package/dist/components/section/index.js +3 -0
- package/dist/components/section/section-config.d.ts +64 -0
- package/dist/components/section/section-config.d.ts.map +1 -0
- package/dist/components/section/section-config.js +20 -0
- package/dist/components/section/section-styles.d.ts +8 -0
- package/dist/components/section/section-styles.d.ts.map +1 -0
- package/dist/components/section/section-styles.js +9 -0
- package/dist/components/section-kit/ActionGroup.d.ts +47 -0
- package/dist/components/section-kit/ActionGroup.d.ts.map +1 -0
- package/dist/components/section-kit/ActionGroup.js +35 -0
- package/dist/components/section-kit/SectionHeading.d.ts +65 -0
- package/dist/components/section-kit/SectionHeading.d.ts.map +1 -0
- package/dist/components/section-kit/SectionHeading.js +34 -0
- package/dist/components/section-kit/index.d.ts +12 -0
- package/dist/components/section-kit/index.d.ts.map +1 -0
- package/dist/components/section-kit/index.js +2 -0
- package/dist/components/sidebar-layout/SidebarLayout.d.ts +67 -0
- package/dist/components/sidebar-layout/SidebarLayout.d.ts.map +1 -0
- package/dist/components/sidebar-layout/SidebarLayout.js +40 -0
- package/dist/components/sidebar-layout/index.d.ts +3 -0
- package/dist/components/sidebar-layout/index.d.ts.map +1 -0
- package/dist/components/sidebar-layout/index.js +3 -0
- package/dist/components/sidebar-layout/sidebar-layout-config.d.ts +49 -0
- package/dist/components/sidebar-layout/sidebar-layout-config.d.ts.map +1 -0
- package/dist/components/sidebar-layout/sidebar-layout-config.js +16 -0
- package/dist/components/sidebar-layout/sidebar-layout-styles.d.ts +21 -0
- package/dist/components/sidebar-layout/sidebar-layout-styles.d.ts.map +1 -0
- package/dist/components/sidebar-layout/sidebar-layout-styles.js +9 -0
- package/dist/components/skeleton/Skeleton.d.ts.map +1 -1
- package/dist/components/stack/Stack.d.ts +107 -0
- package/dist/components/stack/Stack.d.ts.map +1 -0
- package/dist/components/stack/Stack.js +36 -0
- package/dist/components/stack/index.d.ts +3 -0
- package/dist/components/stack/index.d.ts.map +1 -0
- package/dist/components/stack/index.js +3 -0
- package/dist/components/stack/stack-config.d.ts +68 -0
- package/dist/components/stack/stack-config.d.ts.map +1 -0
- package/dist/components/stack/stack-config.js +20 -0
- package/dist/components/stack/stack-styles.d.ts +10 -0
- package/dist/components/stack/stack-styles.d.ts.map +1 -0
- package/dist/components/stack/stack-styles.js +21 -0
- package/dist/components/testimonials/Testimonials.d.ts +78 -0
- package/dist/components/testimonials/Testimonials.d.ts.map +1 -0
- package/dist/components/testimonials/Testimonials.js +96 -0
- package/dist/components/testimonials/index.d.ts +3 -0
- package/dist/components/testimonials/index.d.ts.map +1 -0
- package/dist/components/testimonials/index.js +3 -0
- package/dist/components/testimonials/testimonials-config.d.ts +44 -0
- package/dist/components/testimonials/testimonials-config.d.ts.map +1 -0
- package/dist/components/testimonials/testimonials-config.js +28 -0
- package/dist/components/testimonials/testimonials-styles.d.ts +11 -0
- package/dist/components/testimonials/testimonials-styles.d.ts.map +1 -0
- package/dist/components/testimonials/testimonials-styles.js +5 -0
- package/dist/components/typography/typography-styles.d.ts.map +1 -1
- package/dist/config/validate-config.d.ts.map +1 -1
- package/dist/icons/CopyIcon.d.ts +3 -0
- package/dist/icons/CopyIcon.d.ts.map +1 -0
- package/dist/icons/CopyIcon.js +24 -0
- package/dist/index.d.ts +19 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +107 -72
- package/dist/puck/adapters.d.ts +41 -0
- package/dist/puck/adapters.d.ts.map +1 -0
- package/dist/puck/adapters.js +30 -0
- package/dist/puck/blocks/content.d.ts +32 -0
- package/dist/puck/blocks/content.d.ts.map +1 -0
- package/dist/puck/blocks/content.js +54 -0
- package/dist/puck/blocks/layout.d.ts +44 -0
- package/dist/puck/blocks/layout.d.ts.map +1 -0
- package/dist/puck/blocks/layout.js +69 -0
- package/dist/puck/blocks/navigation.d.ts +66 -0
- package/dist/puck/blocks/navigation.d.ts.map +1 -0
- package/dist/puck/blocks/navigation.js +122 -0
- package/dist/puck/blocks/sections.d.ts +134 -0
- package/dist/puck/blocks/sections.d.ts.map +1 -0
- package/dist/puck/blocks/sections.js +232 -0
- package/dist/puck/blocks/utility.d.ts +22 -0
- package/dist/puck/blocks/utility.d.ts.map +1 -0
- package/dist/puck/blocks/utility.js +49 -0
- package/dist/puck/config.d.ts +63 -0
- package/dist/puck/config.d.ts.map +1 -0
- package/dist/puck/config.js +79 -0
- package/dist/puck/fields.d.ts +94 -0
- package/dist/puck/fields.d.ts.map +1 -0
- package/dist/puck/fields.js +116 -0
- package/dist/puck/index.d.ts +21 -0
- package/dist/puck/index.d.ts.map +1 -0
- package/dist/puck/index.js +10 -0
- package/dist/shared/action.d.ts +52 -0
- package/dist/shared/action.d.ts.map +1 -0
- package/dist/shared/index.d.ts +2 -0
- package/dist/shared/index.d.ts.map +1 -1
- package/dist/shared/spacing.d.ts +38 -0
- package/dist/shared/spacing.d.ts.map +1 -0
- package/dist/shared/spacing.js +29 -0
- package/dist/shared/typography.d.ts.map +1 -1
- package/dist/utils/resolve-token.d.ts +32 -7
- package/dist/utils/resolve-token.d.ts.map +1 -1
- package/dist/utils/resolve-token.js +9 -1
- package/package.json +14 -2
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import { ElementType, HTMLAttributes } from 'react';
|
|
2
|
+
import { Space } from '../../shared';
|
|
3
|
+
import { PageConfig } from './page-config';
|
|
4
|
+
type BasePageProps = PageConfig & Omit<HTMLAttributes<HTMLElement>, "color">;
|
|
5
|
+
/**
|
|
6
|
+
* Props for the Page component.
|
|
7
|
+
*/
|
|
8
|
+
export interface PageProps extends BasePageProps {
|
|
9
|
+
/**
|
|
10
|
+
* Element to render.
|
|
11
|
+
* Defaults to a `div`. A page whose shell is the document body may render
|
|
12
|
+
* `main` here, but a `main` element is usually `PageContent`.
|
|
13
|
+
*
|
|
14
|
+
* @default "div"
|
|
15
|
+
*/
|
|
16
|
+
as?: ElementType;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* The application-page shell.
|
|
20
|
+
*
|
|
21
|
+
* Page is a full-height column that applies the theme background to everything
|
|
22
|
+
* inside it. It adds no width, no gutter and no rhythm of its own: those belong
|
|
23
|
+
* to `Container`, `PageContent` and `Section`.
|
|
24
|
+
*
|
|
25
|
+
* @param props - Page configuration options and element attributes.
|
|
26
|
+
* @param props.as - Element to render. Defaults to "div".
|
|
27
|
+
* @returns The rendered page shell.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```tsx
|
|
31
|
+
* <Page>
|
|
32
|
+
* <PageHeader>Invoices</PageHeader>
|
|
33
|
+
* <PageContent>...</PageContent>
|
|
34
|
+
* <PageFooter>Ashee Softworks</PageFooter>
|
|
35
|
+
* </Page>
|
|
36
|
+
* ```
|
|
37
|
+
*
|
|
38
|
+
* @see SidebarLayout - A shell that adds a persistent navigation column.
|
|
39
|
+
*/
|
|
40
|
+
export declare const Page: import('react').ForwardRefExoticComponent<PageProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
41
|
+
/**
|
|
42
|
+
* Props for the PageHeader component.
|
|
43
|
+
*/
|
|
44
|
+
export interface PageHeaderProps extends BasePageProps {
|
|
45
|
+
/**
|
|
46
|
+
* Element to render.
|
|
47
|
+
* Defaults to `header`.
|
|
48
|
+
*
|
|
49
|
+
* @default "header"
|
|
50
|
+
*/
|
|
51
|
+
as?: ElementType;
|
|
52
|
+
/**
|
|
53
|
+
* Whether the header sticks to the top of the viewport while the content
|
|
54
|
+
* scrolls. Resolved through the standard cascade, so an application can turn
|
|
55
|
+
* it off for every page in configuration.
|
|
56
|
+
*
|
|
57
|
+
* @default true
|
|
58
|
+
*/
|
|
59
|
+
sticky?: boolean;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* The bar at the top of a page.
|
|
63
|
+
*
|
|
64
|
+
* PageHeader keeps a page title, a breadcrumb, a search field or a set of
|
|
65
|
+
* actions visible while the content scrolls. It is a `header` landmark by
|
|
66
|
+
* default and is contained by default, so a consumer adds the content and gets
|
|
67
|
+
* the framework's width and gutter.
|
|
68
|
+
*
|
|
69
|
+
* @param props - Page configuration options and element attributes.
|
|
70
|
+
* @param props.sticky - Stick to the top while scrolling. Defaults to true.
|
|
71
|
+
* @param props.contained - Wrap the content in a Container. Defaults to true.
|
|
72
|
+
* @param props.containerSize - Container width when contained. Defaults to "lg".
|
|
73
|
+
* @param props.divider - Draw a separator below the header. Defaults to true.
|
|
74
|
+
* @param props.as - Element to render. Defaults to "header".
|
|
75
|
+
* @returns The rendered header.
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* ```tsx
|
|
79
|
+
* <PageHeader sticky>
|
|
80
|
+
* <Typography role="heading-md">Invoices</Typography>
|
|
81
|
+
* <Button size="sm">New invoice</Button>
|
|
82
|
+
* </PageHeader>
|
|
83
|
+
* ```
|
|
84
|
+
*/
|
|
85
|
+
export declare const PageHeader: import('react').ForwardRefExoticComponent<PageHeaderProps & import('react').RefAttributes<HTMLElement>>;
|
|
86
|
+
/**
|
|
87
|
+
* Props for the PageContent component.
|
|
88
|
+
*/
|
|
89
|
+
export interface PageContentProps extends BasePageProps {
|
|
90
|
+
/**
|
|
91
|
+
* Element to render.
|
|
92
|
+
* Defaults to `main`, which is the landmark assistive technology jumps to
|
|
93
|
+
* when a reader skips the navigation.
|
|
94
|
+
*
|
|
95
|
+
* @default "main"
|
|
96
|
+
*/
|
|
97
|
+
as?: ElementType;
|
|
98
|
+
/**
|
|
99
|
+
* Vertical rhythm of the content area.
|
|
100
|
+
* Resolved through the standard cascade: prop, then
|
|
101
|
+
* `components.page.spacing`, then the framework fallback.
|
|
102
|
+
*
|
|
103
|
+
* @default "md"
|
|
104
|
+
*/
|
|
105
|
+
spacing?: Space;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* The area that fills the space between the header and the footer.
|
|
109
|
+
*
|
|
110
|
+
* PageContent is the `main` landmark of the document and is contained by
|
|
111
|
+
* default, so an application page gets the framework's maximum width and gutter
|
|
112
|
+
* without any extra markup.
|
|
113
|
+
*
|
|
114
|
+
* @param props - Page configuration options and element attributes.
|
|
115
|
+
* @param props.spacing - Vertical padding. Defaults to "md".
|
|
116
|
+
* @param props.contained - Wrap the content in a Container. Defaults to true.
|
|
117
|
+
* @param props.containerSize - Container width when contained. Defaults to "lg".
|
|
118
|
+
* @param props.as - Element to render. Defaults to "main".
|
|
119
|
+
* @returns The rendered content area.
|
|
120
|
+
*
|
|
121
|
+
* @example
|
|
122
|
+
* ```tsx
|
|
123
|
+
* <PageContent spacing="lg">
|
|
124
|
+
* <Grid columns={1} columnsLg={3} gap="lg">...</Grid>
|
|
125
|
+
* </PageContent>
|
|
126
|
+
* ```
|
|
127
|
+
*/
|
|
128
|
+
export declare const PageContent: import('react').ForwardRefExoticComponent<PageContentProps & import('react').RefAttributes<HTMLElement>>;
|
|
129
|
+
/**
|
|
130
|
+
* Props for the PageFooter component.
|
|
131
|
+
*/
|
|
132
|
+
export interface PageFooterProps extends BasePageProps {
|
|
133
|
+
/**
|
|
134
|
+
* Element to render.
|
|
135
|
+
* Defaults to `footer`.
|
|
136
|
+
*
|
|
137
|
+
* @default "footer"
|
|
138
|
+
*/
|
|
139
|
+
as?: ElementType;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* The bar at the bottom of an application page.
|
|
143
|
+
*
|
|
144
|
+
* PageFooter is the application counterpart of the marketing {@link Footer}. It
|
|
145
|
+
* carries a short legal line, a build identifier or a status summary rather than
|
|
146
|
+
* navigation groups, and it is the last element of a page shell.
|
|
147
|
+
*
|
|
148
|
+
* @param props - Page configuration options and element attributes.
|
|
149
|
+
* @param props.contained - Wrap the content in a Container. Defaults to true.
|
|
150
|
+
* @param props.containerSize - Container width when contained. Defaults to "lg".
|
|
151
|
+
* @param props.divider - Draw a separator above the footer. Defaults to true.
|
|
152
|
+
* @param props.as - Element to render. Defaults to "footer".
|
|
153
|
+
* @returns The rendered footer.
|
|
154
|
+
*
|
|
155
|
+
* @example
|
|
156
|
+
* ```tsx
|
|
157
|
+
* <PageFooter>
|
|
158
|
+
* <Typography role="caption" tone="muted">Version 1.1.0</Typography>
|
|
159
|
+
* </PageFooter>
|
|
160
|
+
* ```
|
|
161
|
+
*
|
|
162
|
+
* @see Footer - The marketing footer, with navigation groups and social links.
|
|
163
|
+
*/
|
|
164
|
+
export declare const PageFooter: import('react').ForwardRefExoticComponent<PageFooterProps & import('react').RefAttributes<HTMLElement>>;
|
|
165
|
+
export {};
|
|
166
|
+
//# sourceMappingURL=Page.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Page.d.ts","sourceRoot":"","sources":["../../../src/components/page/Page.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,EAAE,KAAK,WAAW,EAAc,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAE1E,OAAO,EAAyB,KAAK,KAAK,EAAE,MAAM,cAAc,CAAC;AAKjE,OAAO,EAAwB,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AAatE,KAAK,aAAa,GAAG,UAAU,GAAG,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC,CAAC;AAiD7E;;GAEG;AACH,MAAM,WAAW,SAAU,SAAQ,aAAa;IAC9C;;;;;;OAMG;IACH,EAAE,CAAC,EAAE,WAAW,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,IAAI,sGAUhB,CAAC;AAIF;;GAEG;AACH,MAAM,WAAW,eAAgB,SAAQ,aAAa;IACpD;;;;;OAKG;IACH,EAAE,CAAC,EAAE,WAAW,CAAC;IAEjB;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,UAAU,yGAsCtB,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,gBAAiB,SAAQ,aAAa;IACrD;;;;;;OAMG;IACH,EAAE,CAAC,EAAE,WAAW,CAAC;IAEjB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC;CACjB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,WAAW,0GA8BvB,CAAC;AAIF;;GAEG;AACH,MAAM,WAAW,eAAgB,SAAQ,aAAa;IACpD;;;;;OAKG;IACH,EAAE,CAAC,EAAE,WAAW,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,UAAU,yGA4BtB,CAAC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
import { cn as e } from "../../utils/cn.js";
|
|
4
|
+
import { SPACE_PADDING_Y_CLASS as t } from "../../shared/spacing.js";
|
|
5
|
+
import { useAsheeConfig as n } from "../../libs/context.js";
|
|
6
|
+
import { resolveCascade as r } from "../../utils/resolve-token.js";
|
|
7
|
+
import { Container as i } from "../container/Container.js";
|
|
8
|
+
import { FALLBACK_PAGE_CONFIG as a } from "./page-config.js";
|
|
9
|
+
import { PAGE_CLASS as o, PAGE_CONTENT_CLASS as s, PAGE_FOOTER_CLASS as c, PAGE_FOOTER_INNER_CLASS as l, PAGE_HEADER_CLASS as u, PAGE_HEADER_INNER_CLASS as d } from "./page-styles.js";
|
|
10
|
+
import { forwardRef as f } from "react";
|
|
11
|
+
import { jsx as p } from "react/jsx-runtime";
|
|
12
|
+
//#region src/components/page/Page.tsx
|
|
13
|
+
function m(e) {
|
|
14
|
+
let t = n().components?.page;
|
|
15
|
+
return {
|
|
16
|
+
contained: r(e.contained, t?.contained, void 0, a.contained),
|
|
17
|
+
containerSize: r(e.containerSize, t?.containerSize, void 0, a.containerSize),
|
|
18
|
+
spacing: r(e.spacing, t?.spacing, void 0, a.spacing),
|
|
19
|
+
sticky: r(e.sticky, t?.sticky, void 0, a.sticky),
|
|
20
|
+
divider: r(e.divider, t?.divider, void 0, a.divider)
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
var h = f(({ as: t, className: n, children: r, ...i }, a) => /* @__PURE__ */ p(t ?? "div", {
|
|
24
|
+
ref: a,
|
|
25
|
+
className: e(o, n),
|
|
26
|
+
...i,
|
|
27
|
+
children: r
|
|
28
|
+
}));
|
|
29
|
+
h.displayName = "Page";
|
|
30
|
+
var g = f(({ as: t, sticky: n, contained: r, containerSize: a, divider: o, className: s, children: c, ...l }, f) => {
|
|
31
|
+
let h = m({
|
|
32
|
+
sticky: n,
|
|
33
|
+
contained: r,
|
|
34
|
+
containerSize: a,
|
|
35
|
+
divider: o
|
|
36
|
+
}), g = t ?? "header", _ = /* @__PURE__ */ p("div", {
|
|
37
|
+
className: d,
|
|
38
|
+
children: c
|
|
39
|
+
});
|
|
40
|
+
return /* @__PURE__ */ p(g, {
|
|
41
|
+
ref: f,
|
|
42
|
+
className: e(u, h.sticky && "sticky top-0 z-10", h.divider && "border-b border-border", s),
|
|
43
|
+
...l,
|
|
44
|
+
children: h.contained ? /* @__PURE__ */ p(i, {
|
|
45
|
+
size: h.containerSize,
|
|
46
|
+
children: _
|
|
47
|
+
}) : _
|
|
48
|
+
});
|
|
49
|
+
}), _ = f(({ as: n, contained: r, containerSize: a, spacing: o, className: c, children: l, ...u }, d) => {
|
|
50
|
+
let f = m({
|
|
51
|
+
contained: r,
|
|
52
|
+
containerSize: a,
|
|
53
|
+
spacing: o
|
|
54
|
+
}), h = n ?? "main", g = /* @__PURE__ */ p("div", {
|
|
55
|
+
className: e(t[f.spacing], "flex w-full flex-col", c),
|
|
56
|
+
children: l
|
|
57
|
+
});
|
|
58
|
+
return /* @__PURE__ */ p(h, {
|
|
59
|
+
ref: d,
|
|
60
|
+
className: s,
|
|
61
|
+
...u,
|
|
62
|
+
children: f.contained ? /* @__PURE__ */ p(i, {
|
|
63
|
+
size: f.containerSize,
|
|
64
|
+
children: g
|
|
65
|
+
}) : g
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
_.displayName = "PageContent";
|
|
69
|
+
var v = f(({ as: t, contained: n, containerSize: r, divider: a, className: o, children: s, ...u }, d) => {
|
|
70
|
+
let f = m({
|
|
71
|
+
contained: n,
|
|
72
|
+
containerSize: r,
|
|
73
|
+
divider: a
|
|
74
|
+
}), h = t ?? "footer", g = /* @__PURE__ */ p("div", {
|
|
75
|
+
className: l,
|
|
76
|
+
children: s
|
|
77
|
+
});
|
|
78
|
+
return /* @__PURE__ */ p(h, {
|
|
79
|
+
ref: d,
|
|
80
|
+
className: e(c, f.divider && "border-t border-border", o),
|
|
81
|
+
...u,
|
|
82
|
+
children: f.contained ? /* @__PURE__ */ p(i, {
|
|
83
|
+
size: f.containerSize,
|
|
84
|
+
children: g
|
|
85
|
+
}) : g
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
v.displayName = "PageFooter", g.displayName = "PageHeader";
|
|
89
|
+
//#endregion
|
|
90
|
+
export { h as Page, _ as PageContent, v as PageFooter, g as PageHeader };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/page/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { Space } from '../../shared';
|
|
2
|
+
import { ContainerSize } from '../container/container-config';
|
|
3
|
+
/**
|
|
4
|
+
* Theme configuration options shared by the page parts.
|
|
5
|
+
*
|
|
6
|
+
* Set under `components.page` in the AsheeUI config. Values feed the
|
|
7
|
+
* component-level fallback tier of the theme cascade for all four parts, so an
|
|
8
|
+
* application can set its page shell once.
|
|
9
|
+
*/
|
|
10
|
+
export interface PageConfig {
|
|
11
|
+
/**
|
|
12
|
+
* Whether a part wraps its content in a {@link Container}.
|
|
13
|
+
*
|
|
14
|
+
* @default true
|
|
15
|
+
*/
|
|
16
|
+
contained?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Maximum content width used when a part is contained.
|
|
19
|
+
*
|
|
20
|
+
* @default "lg"
|
|
21
|
+
*/
|
|
22
|
+
containerSize?: ContainerSize;
|
|
23
|
+
/**
|
|
24
|
+
* Vertical rhythm of the content area.
|
|
25
|
+
*
|
|
26
|
+
* @default "md"
|
|
27
|
+
*/
|
|
28
|
+
spacing?: Space;
|
|
29
|
+
/**
|
|
30
|
+
* Whether the header stays at the top of the viewport while the content
|
|
31
|
+
* scrolls.
|
|
32
|
+
*
|
|
33
|
+
* @default true
|
|
34
|
+
*/
|
|
35
|
+
sticky?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Whether the header and the footer draw a separator line against the
|
|
38
|
+
* content.
|
|
39
|
+
*
|
|
40
|
+
* @default true
|
|
41
|
+
*/
|
|
42
|
+
divider?: boolean;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Default config values registered for the page parts.
|
|
46
|
+
*/
|
|
47
|
+
export declare const defaultPageConfig: PageConfig;
|
|
48
|
+
declare module "../../libs/registry" {
|
|
49
|
+
interface ComponentTypeConfigRegistry {
|
|
50
|
+
page: PageConfig;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Hard fallback values used when no config tier provides a value.
|
|
55
|
+
*/
|
|
56
|
+
export declare const FALLBACK_PAGE_CONFIG: Required<PageConfig>;
|
|
57
|
+
//# sourceMappingURL=page-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page-config.d.ts","sourceRoot":"","sources":["../../../src/components/page/page-config.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAEnE;;;;;;GAMG;AACH,MAAM,WAAW,UAAU;IACzB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;;OAIG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC;IAE9B;;;;OAIG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC;IAEhB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;GAEG;AACH,eAAO,MAAM,iBAAiB,EAAE,UAM/B,CAAC;AAEF,OAAO,QAAQ,qBAAqB,CAAC;IACnC,UAAU,2BAA2B;QACnC,IAAI,EAAE,UAAU,CAAC;KAClB;CACF;AAID;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,UAAU,CAMrD,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { registerComponentDefaults as e } from "../../libs/registry.js";
|
|
3
|
+
//#region src/components/page/page-config.ts
|
|
4
|
+
var t = {
|
|
5
|
+
contained: !0,
|
|
6
|
+
containerSize: "lg",
|
|
7
|
+
spacing: "md",
|
|
8
|
+
sticky: !0,
|
|
9
|
+
divider: !0
|
|
10
|
+
};
|
|
11
|
+
e("page", t);
|
|
12
|
+
var n = {
|
|
13
|
+
contained: !0,
|
|
14
|
+
containerSize: "lg",
|
|
15
|
+
spacing: "md",
|
|
16
|
+
sticky: !0,
|
|
17
|
+
divider: !0
|
|
18
|
+
};
|
|
19
|
+
//#endregion
|
|
20
|
+
export { n as FALLBACK_PAGE_CONFIG, t as defaultPageConfig };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Page component styles for AsheeUI.
|
|
3
|
+
* This file provides the static class mappings for the four page parts: the
|
|
4
|
+
* shell, the header, the content area and the footer.
|
|
5
|
+
*/
|
|
6
|
+
/** The page shell: a full-height column that owns the theme background. */
|
|
7
|
+
export declare const PAGE_CLASS = "flex min-h-dvh w-full flex-col bg-background";
|
|
8
|
+
/** Shared base classes for the page header. */
|
|
9
|
+
export declare const PAGE_HEADER_CLASS = "w-full bg-background/95 backdrop-blur";
|
|
10
|
+
/** Header classes applied while the header sticks to the top of the viewport. */
|
|
11
|
+
export declare const PAGE_HEADER_STICKY_CLASS = "sticky top-0 z-10";
|
|
12
|
+
/** Inner padding of the header, applied inside its container. */
|
|
13
|
+
export declare const PAGE_HEADER_INNER_CLASS = "flex w-full items-center gap-4 py-3";
|
|
14
|
+
/** Shared base classes for the content area: it fills the space between the
|
|
15
|
+
* header and the footer. */
|
|
16
|
+
export declare const PAGE_CONTENT_CLASS = "flex w-full flex-1 flex-col";
|
|
17
|
+
/** Shared base classes for the page footer. */
|
|
18
|
+
export declare const PAGE_FOOTER_CLASS = "w-full bg-secondary/30";
|
|
19
|
+
/** Inner padding of the footer, applied inside its container. */
|
|
20
|
+
export declare const PAGE_FOOTER_INNER_CLASS = "flex w-full flex-col gap-2 py-6";
|
|
21
|
+
/** Separator drawn between the header and the content area. */
|
|
22
|
+
export declare const PAGE_DIVIDER_CLASS = "border-b border-border";
|
|
23
|
+
/** Separator drawn between the content area and the footer. */
|
|
24
|
+
export declare const PAGE_FOOTER_DIVIDER_CLASS = "border-t border-border";
|
|
25
|
+
//# sourceMappingURL=page-styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page-styles.d.ts","sourceRoot":"","sources":["../../../src/components/page/page-styles.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,2EAA2E;AAC3E,eAAO,MAAM,UAAU,iDAAiD,CAAC;AAEzE,+CAA+C;AAC/C,eAAO,MAAM,iBAAiB,0CAA0C,CAAC;AAEzE,iFAAiF;AACjF,eAAO,MAAM,wBAAwB,sBAAsB,CAAC;AAE5D,iEAAiE;AACjE,eAAO,MAAM,uBAAuB,wCAAwC,CAAC;AAE7E;4BAC4B;AAC5B,eAAO,MAAM,kBAAkB,gCAAgC,CAAC;AAEhE,+CAA+C;AAC/C,eAAO,MAAM,iBAAiB,2BAA2B,CAAC;AAE1D,iEAAiE;AACjE,eAAO,MAAM,uBAAuB,oCAAoC,CAAC;AAEzE,+DAA+D;AAC/D,eAAO,MAAM,kBAAkB,2BAA2B,CAAC;AAE3D,+DAA+D;AAC/D,eAAO,MAAM,yBAAyB,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
//#region src/components/page/page-styles.ts
|
|
3
|
+
var e = "flex min-h-dvh w-full flex-col bg-background", t = "w-full bg-background/95 backdrop-blur", n = "sticky top-0 z-10", r = "flex w-full items-center gap-4 py-3", i = "flex w-full flex-1 flex-col", a = "w-full bg-secondary/30", o = "flex w-full flex-col gap-2 py-6", s = "border-b border-border", c = "border-t border-border";
|
|
4
|
+
//#endregion
|
|
5
|
+
export { e as PAGE_CLASS, i as PAGE_CONTENT_CLASS, s as PAGE_DIVIDER_CLASS, a as PAGE_FOOTER_CLASS, c as PAGE_FOOTER_DIVIDER_CLASS, o as PAGE_FOOTER_INNER_CLASS, t as PAGE_HEADER_CLASS, r as PAGE_HEADER_INNER_CLASS, n as PAGE_HEADER_STICKY_CLASS };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pagination.d.ts","sourceRoot":"","sources":["../../../src/components/pagination/Pagination.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,
|
|
1
|
+
{"version":3,"file":"Pagination.d.ts","sourceRoot":"","sources":["../../../src/components/pagination/Pagination.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAc,KAAK,cAAc,EAAkB,MAAM,OAAO,CAAC;AAWxE,OAAO,EAEL,KAAK,gBAAgB,EACtB,MAAM,qBAAqB,CAAC;AAO7B,KAAK,mBAAmB,GAAG,gBAAgB,GACzC,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC,CAAC;AAE1D;;GAEG;AACH,MAAM,WAAW,eAAgB,SAAQ,mBAAmB;IAC1D;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;;OAGG;IACH,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAEtC;;;;;;;OAOG;IACH,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;IAEvC;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,eAAO,MAAM,UAAU,yGAqMtB,CAAC"}
|
|
@@ -9,14 +9,14 @@ import { Button as o } from "../button/Button.js";
|
|
|
9
9
|
import { ChevronRightIcon as s } from "../../icons/ChevronRightIcon.js";
|
|
10
10
|
import { Link as c } from "../link/Link.js";
|
|
11
11
|
import { ChevronLeftIcon as l } from "../../icons/ChevronLeftIcon.js";
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
12
|
+
import { getPaginationRange as u } from "./pagination.helpers.js";
|
|
13
|
+
import { FALLBACK_PAGINATION_CONFIG as d } from "./pagination-config.js";
|
|
14
|
+
import { PAGINATION_BASE_CLASS as f, PAGINATION_GAP_CLASS as p, PAGINATION_LIST_CLASS as m } from "./pagination-styles.js";
|
|
15
15
|
import { forwardRef as h } from "react";
|
|
16
16
|
import { jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
17
17
|
//#region src/components/pagination/Pagination.tsx
|
|
18
18
|
var v = h(({ page: h, pageCount: v, onPageChange: y, hrefForPage: b, label: x = "Pagination", size: S, variant: C, color: w, radius: T, siblingCount: E, showEdges: D, isDisabled: O = !1, className: k, ...A }, j) => {
|
|
19
|
-
let M = r(), N = M.components?.pagination, P = i(S, N?.size, void 0,
|
|
19
|
+
let M = r(), N = M.components?.pagination, P = i(S, N?.size, void 0, d.size), F = i(C, N?.variant, M.defaultVariant, d.variant), I = i(w, N?.color, M.defaultColor, d.color), L = a(T, N?.radius, M.defaultRadius, d.radius), R = i(E, N?.siblingCount, void 0, d.siblingCount), z = i(D, N?.showEdges, void 0, d.showEdges), B = Math.min(Math.max(h, 1), Math.max(v, 1)), V = Math.max(v, 1), H = (e) => {
|
|
20
20
|
e === B || e < 1 || e > v || y?.(e);
|
|
21
21
|
}, U = (r, i, a, s = !1) => {
|
|
22
22
|
let l = r < 1 || r > v;
|
|
@@ -39,20 +39,20 @@ var v = h(({ page: h, pageCount: v, onPageChange: y, hrefForPage: b, label: x =
|
|
|
39
39
|
onClick: () => H(r),
|
|
40
40
|
children: a
|
|
41
41
|
});
|
|
42
|
-
}, W =
|
|
42
|
+
}, W = u(B, v, R);
|
|
43
43
|
return /* @__PURE__ */ g("nav", {
|
|
44
44
|
ref: j,
|
|
45
45
|
"aria-label": x,
|
|
46
|
-
className: e(
|
|
46
|
+
className: e(f, k),
|
|
47
47
|
...A,
|
|
48
48
|
children: /* @__PURE__ */ _("ul", {
|
|
49
|
-
className:
|
|
49
|
+
className: m,
|
|
50
50
|
children: [
|
|
51
51
|
z && /* @__PURE__ */ g("li", { children: U(1, "First page", /* @__PURE__ */ g(l, { "aria-hidden": "true" })) }),
|
|
52
52
|
/* @__PURE__ */ g("li", { children: U(B - 1, "Previous page", /* @__PURE__ */ g(l, { "aria-hidden": "true" })) }),
|
|
53
53
|
W.map((e, t) => e === "ellipsis" ? /* @__PURE__ */ g("li", { children: /* @__PURE__ */ g("span", {
|
|
54
54
|
"aria-hidden": "true",
|
|
55
|
-
className:
|
|
55
|
+
className: p,
|
|
56
56
|
children: "…"
|
|
57
57
|
}) }, `gap-${t}`) : /* @__PURE__ */ g("li", { children: U(e, `Page ${e}`, e, e === B) }, e)),
|
|
58
58
|
/* @__PURE__ */ g("li", { children: U(B + 1, "Next page", /* @__PURE__ */ g(s, { "aria-hidden": "true" })) }),
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { InputHTMLAttributes } from 'react';
|
|
2
|
+
import { FieldStatus, LabelAlign } from '../field/field-config';
|
|
3
|
+
import { PinInputConfig, PinInputMode } from './pin-input-config';
|
|
4
|
+
/**
|
|
5
|
+
* Keep only the characters a mode accepts.
|
|
6
|
+
*
|
|
7
|
+
* @param raw - The text to filter.
|
|
8
|
+
* @param mode - The characters the field accepts.
|
|
9
|
+
* @returns The filtered text.
|
|
10
|
+
*/
|
|
11
|
+
export declare function sanitizePinValue(raw: string, mode: PinInputMode): string;
|
|
12
|
+
type BasePinInputProps = PinInputConfig & Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "value" | "defaultValue" | "onChange" | "color" | "type" | "children" | "autoFocus">;
|
|
13
|
+
/**
|
|
14
|
+
* Props for the PinInput component.
|
|
15
|
+
*/
|
|
16
|
+
export interface PinInputProps extends BasePinInputProps {
|
|
17
|
+
/** The code, for a consumer that owns the value. */
|
|
18
|
+
value?: string;
|
|
19
|
+
/** The initial code, for a consumer that does not. */
|
|
20
|
+
defaultValue?: string;
|
|
21
|
+
/** Called with the whole code whenever it changes. */
|
|
22
|
+
onValueChange?: (value: string) => void;
|
|
23
|
+
/**
|
|
24
|
+
* Called once when the code reaches its full length.
|
|
25
|
+
* It fires once per completion, not on every keystroke, so a consumer can
|
|
26
|
+
* submit from it.
|
|
27
|
+
*/
|
|
28
|
+
onComplete?: (value: string) => void;
|
|
29
|
+
/** Label of the field, shown above the boxes. */
|
|
30
|
+
label?: string;
|
|
31
|
+
/** Alignment of the label. @default "left" */
|
|
32
|
+
labelAlign?: LabelAlign;
|
|
33
|
+
/** Description under the label. */
|
|
34
|
+
description?: string;
|
|
35
|
+
/** Validation message under the boxes. */
|
|
36
|
+
message?: string;
|
|
37
|
+
/** Validation status, which colours the message. @default "default" */
|
|
38
|
+
status?: FieldStatus;
|
|
39
|
+
/** Whether the field is required. @default false */
|
|
40
|
+
required?: boolean;
|
|
41
|
+
/** Whether the label shows a pending state. @default false */
|
|
42
|
+
isLoading?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Accessible name of the group of boxes.
|
|
45
|
+
* Used when the field has no visible label.
|
|
46
|
+
*
|
|
47
|
+
* @default "Verification code"
|
|
48
|
+
*/
|
|
49
|
+
groupLabel?: string;
|
|
50
|
+
/**
|
|
51
|
+
* Draw a separator after this many boxes.
|
|
52
|
+
* Purely presentational grouping, hidden from assistive technology.
|
|
53
|
+
*/
|
|
54
|
+
separatorAfter?: number;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* A field that collects a code one character at a time.
|
|
58
|
+
*
|
|
59
|
+
* PinInput accepts a dense code string: the characters are always packed
|
|
60
|
+
* left to right, so deleting a character in the middle moves the characters
|
|
61
|
+
* after it left rather than leaving a gap. A consumer therefore never has to
|
|
62
|
+
* reason about positions when it reads `value`.
|
|
63
|
+
*
|
|
64
|
+
* Typing a character moves focus to the next box, Backspace clears the box
|
|
65
|
+
* behind the caret, the arrow keys move between boxes, Home and End jump to the
|
|
66
|
+
* ends, and a pasted code fills the boxes from the caret. Because the value is
|
|
67
|
+
* dense, a caret beyond the characters that are already filled pastes at the end
|
|
68
|
+
* of them, which is where the next character would have gone. The code is
|
|
69
|
+
* reported through `onValueChange` on every change and through `onComplete` when
|
|
70
|
+
* it becomes complete, so a consumer can submit from either.
|
|
71
|
+
*
|
|
72
|
+
* The boxes are one named group element (a `fieldset`), because the value is one
|
|
73
|
+
* value even though it is typed in several places. The component never focuses
|
|
74
|
+
* itself: a consumer that moves the reader to the field (after sending a code,
|
|
75
|
+
* for example) does so through the ref, which is the group element, so the
|
|
76
|
+
* decision to move focus stays with the screen that knows why.
|
|
77
|
+
*
|
|
78
|
+
* @param props - PinInput configuration options and field props.
|
|
79
|
+
* @param props.length - Number of characters. Defaults to 4.
|
|
80
|
+
* @param props.mode - Accepted characters. Defaults to "numeric".
|
|
81
|
+
* @param props.size - Density of the boxes. Defaults to "md".
|
|
82
|
+
* @param props.masked - Hide the typed characters. Defaults to false.
|
|
83
|
+
* @param props.value - Controlled value.
|
|
84
|
+
* @param props.defaultValue - Initial value.
|
|
85
|
+
* @param props.onValueChange - Called with the code on every change.
|
|
86
|
+
* @param props.onComplete - Called when the code becomes complete.
|
|
87
|
+
* @param props.label - Label of the field.
|
|
88
|
+
* @param props.description - Description under the label.
|
|
89
|
+
* @param props.message - Validation message under the boxes.
|
|
90
|
+
* @param props.status - Validation status.
|
|
91
|
+
* @param props.isDisabled - Disable the field. Defaults to false.
|
|
92
|
+
* @param props.isInvalid - Mark the value invalid. Defaults to false.
|
|
93
|
+
* @returns The rendered field.
|
|
94
|
+
*
|
|
95
|
+
* @example
|
|
96
|
+
* ```tsx
|
|
97
|
+
* <PinInput
|
|
98
|
+
* label="Verification code"
|
|
99
|
+
* length={6}
|
|
100
|
+
* description="The six digits we sent to your phone."
|
|
101
|
+
* onComplete={verify}
|
|
102
|
+
* />
|
|
103
|
+
* ```
|
|
104
|
+
*
|
|
105
|
+
* @see Input - The single-value field.
|
|
106
|
+
*/
|
|
107
|
+
export declare const PinInput: import('react').ForwardRefExoticComponent<PinInputProps & import('react').RefAttributes<HTMLFieldSetElement>>;
|
|
108
|
+
export {};
|
|
109
|
+
//# sourceMappingURL=PinInput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PinInput.d.ts","sourceRoot":"","sources":["../../../src/components/pin-input/PinInput.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,EAIL,KAAK,mBAAmB,EAKzB,MAAM,OAAO,CAAC;AAUf,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,YAAY,EAClB,MAAM,oBAAoB,CAAC;AAW5B;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,GAAG,MAAM,CAQxE;AAED,KAAK,iBAAiB,GAAG,cAAc,GACrC,IAAI,CACF,mBAAmB,CAAC,gBAAgB,CAAC,EACnC,MAAM,GACN,OAAO,GACP,cAAc,GACd,UAAU,GACV,OAAO,GACP,MAAM,GACN,UAAU,GACV,WAAW,CACd,CAAC;AAEJ;;GAEG;AACH,MAAM,WAAW,aAAc,SAAQ,iBAAiB;IACtD,oDAAoD;IACpD,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,sDAAsD;IACtD,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,sDAAsD;IACtD,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAExC;;;;OAIG;IACH,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAErC,iDAAiD;IACjD,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,8CAA8C;IAC9C,UAAU,CAAC,EAAE,UAAU,CAAC;IAExB,mCAAmC;IACnC,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,0CAA0C;IAC1C,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,uEAAuE;IACvE,MAAM,CAAC,EAAE,WAAW,CAAC;IAErB,oDAAoD;IACpD,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,8DAA8D;IAC9D,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AAEH,eAAO,MAAM,QAAQ,+GA2QpB,CAAC"}
|