orizon 0.2.0 → 0.2.2
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 +45 -7
- package/bin/cli.mjs +53 -16
- package/bin/init.mjs +541 -156
- package/dist/components/affix/Affix.d.ts +19 -0
- package/dist/components/affix/Affix.stories.d.ts +9 -0
- package/dist/components/affix/index.d.ts +23 -0
- package/dist/components/alert/Alert.d.ts +21 -0
- package/dist/components/alert/Alert.stories.d.ts +13 -0
- package/dist/components/alert/ErrorBoundary.d.ts +10 -0
- package/dist/components/alert/index.d.ts +20 -0
- package/dist/components/anchor/Anchor.d.ts +23 -0
- package/dist/components/anchor/Anchor.stories.d.ts +9 -0
- package/dist/components/anchor/index.d.ts +24 -0
- package/dist/components/app/App.d.ts +25 -0
- package/dist/components/app/App.stories.d.ts +8 -0
- package/dist/components/app/index.d.ts +18 -0
- package/dist/components/auto-complete/AutoComplete.d.ts +22 -0
- package/dist/components/auto-complete/AutoComplete.stories.d.ts +12 -0
- package/dist/components/auto-complete/index.d.ts +22 -0
- package/dist/components/avatar/Avatar.d.ts +24 -0
- package/dist/components/avatar/Avatar.stories.d.ts +10 -0
- package/dist/components/avatar/index.d.ts +21 -0
- package/dist/components/badge/Badge.d.ts +19 -0
- package/dist/components/badge/Badge.stories.d.ts +12 -0
- package/dist/components/badge/index.d.ts +19 -0
- package/dist/components/breadcrumb/Breadcrumb.d.ts +24 -0
- package/dist/components/breadcrumb/Breadcrumb.stories.d.ts +9 -0
- package/dist/components/breadcrumb/index.d.ts +25 -0
- package/dist/components/button/Button.d.ts +24 -0
- package/dist/components/button/Button.stories.d.ts +20 -0
- package/dist/components/button/ButtonGroup.d.ts +23 -0
- package/dist/components/button/index.d.ts +33 -0
- package/dist/components/button/types.d.ts +87 -11
- package/dist/components/calendar/Calendar.d.ts +21 -0
- package/dist/components/calendar/Calendar.stories.d.ts +10 -0
- package/dist/components/calendar/index.d.ts +19 -0
- package/dist/components/card/Card.d.ts +21 -0
- package/dist/components/card/Card.stories.d.ts +14 -0
- package/dist/components/card/index.d.ts +25 -0
- package/dist/components/carousel/Carousel.d.ts +23 -0
- package/dist/components/carousel/Carousel.stories.d.ts +11 -0
- package/dist/components/carousel/index.d.ts +25 -0
- package/dist/components/cascader/Cascader.d.ts +26 -0
- package/dist/components/cascader/Cascader.stories.d.ts +11 -0
- package/dist/components/cascader/index.d.ts +25 -0
- package/dist/components/checkbox/Checkbox.d.ts +21 -0
- package/dist/components/checkbox/Checkbox.stories.d.ts +11 -0
- package/dist/components/checkbox/CheckboxGroup.d.ts +10 -0
- package/dist/components/checkbox/index.d.ts +19 -0
- package/dist/components/collapse/Collapse.d.ts +25 -0
- package/dist/components/collapse/Collapse.stories.d.ts +12 -0
- package/dist/components/collapse/index.d.ts +26 -0
- package/dist/components/color-picker/ColorPicker.d.ts +22 -0
- package/dist/components/color-picker/ColorPicker.stories.d.ts +11 -0
- package/dist/components/color-picker/index.d.ts +22 -0
- package/dist/components/date-picker/DatePicker.d.ts +20 -0
- package/dist/components/date-picker/DatePicker.stories.d.ts +12 -0
- package/dist/components/date-picker/RangePicker.d.ts +12 -0
- package/dist/components/date-picker/index.d.ts +21 -0
- package/dist/components/descriptions/Descriptions.d.ts +25 -0
- package/dist/components/descriptions/Descriptions.stories.d.ts +12 -0
- package/dist/components/descriptions/index.d.ts +25 -0
- package/dist/components/divider/Divider.stories.d.ts +12 -0
- package/dist/components/divider/index.d.ts +10 -0
- package/dist/components/drawer/Drawer.stories.d.ts +10 -0
- package/dist/components/drawer/index.d.ts +13 -0
- package/dist/components/dropdown/Dropdown.stories.d.ts +12 -0
- package/dist/components/dropdown/index.d.ts +14 -0
- package/dist/components/empty/Empty.stories.d.ts +11 -0
- package/dist/components/empty/index.d.ts +14 -0
- package/dist/components/flex/Flex.stories.d.ts +12 -0
- package/dist/components/flex/index.d.ts +15 -0
- package/dist/components/float-button/FloatButton.stories.d.ts +12 -0
- package/dist/components/float-button/index.d.ts +15 -0
- package/dist/components/form/Form.stories.d.ts +10 -0
- package/dist/components/form/index.d.ts +17 -0
- package/dist/components/grid/Grid.stories.d.ts +11 -0
- package/dist/components/grid/index.d.ts +20 -0
- package/dist/components/image/Image.stories.d.ts +11 -0
- package/dist/components/image/index.d.ts +14 -0
- package/dist/components/input/Input.stories.d.ts +14 -0
- package/dist/components/input/index.d.ts +15 -0
- package/dist/components/input-number/InputNumber.stories.d.ts +13 -0
- package/dist/components/input-number/index.d.ts +10 -0
- package/dist/components/layout/Layout.stories.d.ts +9 -0
- package/dist/components/layout/index.d.ts +17 -0
- package/dist/components/list/List.stories.d.ts +13 -0
- package/dist/components/list/index.d.ts +18 -0
- package/dist/components/masonry/Masonry.stories.d.ts +11 -0
- package/dist/components/masonry/index.d.ts +12 -0
- package/dist/components/mentions/Mentions.stories.d.ts +12 -0
- package/dist/components/mentions/index.d.ts +11 -0
- package/dist/components/menu/Menu.stories.d.ts +12 -0
- package/dist/components/menu/index.d.ts +15 -0
- package/dist/components/message/Message.stories.d.ts +8 -0
- package/dist/components/message/index.d.ts +16 -0
- package/dist/components/modal/Modal.stories.d.ts +12 -0
- package/dist/components/modal/index.d.ts +17 -0
- package/dist/components/notification/Notification.stories.d.ts +10 -0
- package/dist/components/notification/index.d.ts +14 -0
- package/dist/components/pagination/Pagination.stories.d.ts +13 -0
- package/dist/components/pagination/index.d.ts +13 -0
- package/dist/components/popconfirm/Popconfirm.stories.d.ts +11 -0
- package/dist/components/popconfirm/index.d.ts +13 -0
- package/dist/components/popover/Popover.stories.d.ts +10 -0
- package/dist/components/popover/index.d.ts +10 -0
- package/dist/components/progress/Progress.stories.d.ts +13 -0
- package/dist/components/progress/index.d.ts +10 -0
- package/dist/components/qrcode/QRCode.stories.d.ts +11 -0
- package/dist/components/qrcode/index.d.ts +9 -0
- package/dist/components/radio/Radio.stories.d.ts +13 -0
- package/dist/components/radio/index.d.ts +17 -0
- package/dist/components/rate/Rate.stories.d.ts +12 -0
- package/dist/components/rate/index.d.ts +13 -0
- package/dist/components/result/Result.stories.d.ts +12 -0
- package/dist/components/result/index.d.ts +9 -0
- package/dist/components/segmented/Segmented.stories.d.ts +12 -0
- package/dist/components/segmented/index.d.ts +9 -0
- package/dist/components/select/Select.stories.d.ts +14 -0
- package/dist/components/select/index.d.ts +10 -0
- package/dist/components/skeleton/Skeleton.stories.d.ts +12 -0
- package/dist/components/skeleton/index.d.ts +15 -0
- package/dist/components/slider/Slider.stories.d.ts +13 -0
- package/dist/components/slider/index.d.ts +10 -0
- package/dist/components/space/Space.stories.d.ts +13 -0
- package/dist/components/space/index.d.ts +18 -0
- package/dist/components/spin/Spin.stories.d.ts +13 -0
- package/dist/components/spin/index.d.ts +14 -0
- package/dist/components/splitter/Splitter.stories.d.ts +12 -0
- package/dist/components/splitter/index.d.ts +18 -0
- package/dist/components/statistic/Statistic.stories.d.ts +10 -0
- package/dist/components/statistic/index.d.ts +17 -0
- package/dist/components/steps/Steps.stories.d.ts +11 -0
- package/dist/components/steps/index.d.ts +15 -0
- package/dist/components/switch/Switch.stories.d.ts +10 -0
- package/dist/components/switch/index.d.ts +12 -0
- package/dist/components/table/Table.stories.d.ts +12 -0
- package/dist/components/table/index.d.ts +12 -0
- package/dist/components/tabs/Tabs.stories.d.ts +11 -0
- package/dist/components/tabs/index.d.ts +16 -0
- package/dist/components/tag/Tag.stories.d.ts +11 -0
- package/dist/components/tag/index.d.ts +14 -0
- package/dist/components/time-picker/TimePicker.stories.d.ts +10 -0
- package/dist/components/time-picker/index.d.ts +13 -0
- package/dist/components/timeline/Timeline.stories.d.ts +10 -0
- package/dist/components/timeline/index.d.ts +15 -0
- package/dist/components/tooltip/Tooltip.stories.d.ts +8 -0
- package/dist/components/tooltip/index.d.ts +10 -0
- package/dist/components/tour/Tour.stories.d.ts +8 -0
- package/dist/components/tour/index.d.ts +16 -0
- package/dist/components/transfer/Transfer.stories.d.ts +9 -0
- package/dist/components/transfer/index.d.ts +15 -0
- package/dist/components/tree/Tree.stories.d.ts +10 -0
- package/dist/components/tree/index.d.ts +18 -0
- package/dist/components/tree-select/TreeSelect.stories.d.ts +9 -0
- package/dist/components/tree-select/index.d.ts +16 -0
- package/dist/components/typography/Typography.stories.d.ts +11 -0
- package/dist/components/typography/index.d.ts +14 -0
- package/dist/components/upload/Upload.stories.d.ts +10 -0
- package/dist/components/upload/index.d.ts +17 -0
- package/dist/components/watermark/Watermark.stories.d.ts +9 -0
- package/dist/components/watermark/index.d.ts +11 -0
- package/dist/orizon.cjs.js +101 -101
- package/dist/orizon.es.js +26200 -25378
- package/dist/preset.css +4 -4
- package/dist/themes/corporate.css +169 -0
- package/package.json +16 -3
|
@@ -1,4 +1,23 @@
|
|
|
1
1
|
import { AffixProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* @file Affix Component
|
|
4
|
+
*
|
|
5
|
+
* Pins its children to the viewport when the scroll position crosses
|
|
6
|
+
* a configurable offset. Supports both top and bottom pinning, and
|
|
7
|
+
* a custom scroll container via the `target` prop.
|
|
8
|
+
*
|
|
9
|
+
* Key props: `offsetTop`, `offsetBottom`, `target`, `onChange`.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* <Affix offsetTop={80}>
|
|
14
|
+
* <nav>Sticky toolbar</nav>
|
|
15
|
+
* </Affix>
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* @see {@link ./types.ts} — prop definitions
|
|
19
|
+
* @see {@link ./index.ts} — barrel export
|
|
20
|
+
*/
|
|
2
21
|
import * as React from "react";
|
|
3
22
|
declare const Affix: React.FC<AffixProps>;
|
|
4
23
|
export { Affix };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { Affix } from './index';
|
|
3
|
+
declare const meta: Meta<typeof Affix>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Affix>;
|
|
6
|
+
export declare const Playground: Story;
|
|
7
|
+
export declare const OffsetTop: Story;
|
|
8
|
+
export declare const OffsetBottom: Story;
|
|
9
|
+
export declare const OnChange: Story;
|
|
@@ -1,2 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Affix — Public Barrel Export
|
|
3
|
+
*
|
|
4
|
+
* Re-exports the `<Affix>` component that pins content to the viewport
|
|
5
|
+
* on scroll.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Affix component that pins its children to the viewport when scrolling.
|
|
9
|
+
*
|
|
10
|
+
* Supports `offsetTop` / `offsetBottom` for threshold control, a custom
|
|
11
|
+
* `target` scroll container, and an `onChange` callback.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* <Affix offsetTop={64}>
|
|
16
|
+
* <div>I stick 64px from top</div>
|
|
17
|
+
* </Affix>
|
|
18
|
+
*
|
|
19
|
+
* <Affix offsetBottom={20}>
|
|
20
|
+
* <button>Floating action</button>
|
|
21
|
+
* </Affix>
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
1
24
|
export { Affix } from './Affix';
|
|
2
25
|
export type { AffixProps } from './types';
|
|
@@ -1,4 +1,25 @@
|
|
|
1
1
|
import { AlertProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* @file Alert Component
|
|
4
|
+
*
|
|
5
|
+
* Renders a feedback alert banner with semantic colouring for
|
|
6
|
+
* success, info, warning, and error states. Supports closable
|
|
7
|
+
* behaviour (with animation), an action slot, custom icons,
|
|
8
|
+
* and a full-width banner mode.
|
|
9
|
+
*
|
|
10
|
+
* Key props: `type`, `message`, `description`, `closable`, `showIcon`,
|
|
11
|
+
* `banner`, `action`.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* <Alert type="success" message="Saved!" showIcon />
|
|
16
|
+
* <Alert type="error" message="Failed" description="Details..." closable />
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* @see {@link ./types.ts} — prop definitions
|
|
20
|
+
* @see {@link ./ErrorBoundary.tsx} — error boundary sub-component
|
|
21
|
+
* @see {@link ./index.ts} — barrel export
|
|
22
|
+
*/
|
|
2
23
|
import * as React from "react";
|
|
3
24
|
declare const InternalAlert: React.ForwardRefExoticComponent<AlertProps & React.RefAttributes<HTMLDivElement>>;
|
|
4
25
|
export { InternalAlert };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { Alert } from './index';
|
|
3
|
+
declare const meta: Meta<typeof Alert>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Alert>;
|
|
6
|
+
export declare const Playground: Story;
|
|
7
|
+
export declare const Types: Story;
|
|
8
|
+
export declare const WithIcon: Story;
|
|
9
|
+
export declare const Closable: Story;
|
|
10
|
+
export declare const Description: Story;
|
|
11
|
+
export declare const Banner: Story;
|
|
12
|
+
export declare const Actions: Story;
|
|
13
|
+
export declare const ErrorBoundaryStory: Story;
|
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
import { AlertErrorBoundaryProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* @file Alert Error Boundary
|
|
4
|
+
*
|
|
5
|
+
* A React class-based error boundary that catches render errors
|
|
6
|
+
* in its children and displays them as an error `<Alert>`. Used
|
|
7
|
+
* via `Alert.ErrorBoundary`.
|
|
8
|
+
*
|
|
9
|
+
* @see {@link ./Alert.tsx} — main Alert component
|
|
10
|
+
* @see {@link ./types.ts} — prop definitions
|
|
11
|
+
*/
|
|
2
12
|
import * as React from "react";
|
|
3
13
|
interface ErrorBoundaryState {
|
|
4
14
|
hasError: boolean;
|
|
@@ -3,6 +3,26 @@ import { AlertErrorBoundary } from './ErrorBoundary';
|
|
|
3
3
|
type AlertComponent = typeof InternalAlert & {
|
|
4
4
|
ErrorBoundary: typeof AlertErrorBoundary;
|
|
5
5
|
};
|
|
6
|
+
/**
|
|
7
|
+
* Alert component for feedback messages.
|
|
8
|
+
*
|
|
9
|
+
* Supports `type` (success / info / warning / error), `closable`,
|
|
10
|
+
* `banner` mode, custom `icon`, and an `action` slot.
|
|
11
|
+
*
|
|
12
|
+
* Use `Alert.ErrorBoundary` to catch React errors and display
|
|
13
|
+
* them as an alert.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```tsx
|
|
17
|
+
* <Alert type="success" message="Done!" />
|
|
18
|
+
* <Alert type="warning" message="Watch out" description="Details here" closable />
|
|
19
|
+
* <Alert type="info" message="Tip" showIcon banner />
|
|
20
|
+
*
|
|
21
|
+
* <Alert.ErrorBoundary message="Oops">
|
|
22
|
+
* <SomeComponent />
|
|
23
|
+
* </Alert.ErrorBoundary>
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
6
26
|
declare const Alert: AlertComponent;
|
|
7
27
|
export { Alert };
|
|
8
28
|
export type { AlertProps, AlertType, AlertClosableConfig, AlertErrorBoundaryProps, } from './types';
|
|
@@ -1,4 +1,27 @@
|
|
|
1
1
|
import { AnchorProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* @file Anchor Component
|
|
4
|
+
*
|
|
5
|
+
* A scroll-spy navigation component that highlights the current
|
|
6
|
+
* section in view and smooth-scrolls to anchor targets on click.
|
|
7
|
+
* Supports vertical / horizontal layout, nested items, affix
|
|
8
|
+
* (sticky) positioning, and a sliding active indicator.
|
|
9
|
+
*
|
|
10
|
+
* Key props: `items`, `direction`, `affix`, `targetOffset`, `onChange`.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* <Anchor
|
|
15
|
+
* items={[
|
|
16
|
+
* { key: "1", href: "#section-1", title: "Introduction" },
|
|
17
|
+
* { key: "2", href: "#section-2", title: "Usage" },
|
|
18
|
+
* ]}
|
|
19
|
+
* />
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* @see {@link ./types.ts} — prop definitions
|
|
23
|
+
* @see {@link ./index.ts} — barrel export
|
|
24
|
+
*/
|
|
2
25
|
import * as React from "react";
|
|
3
26
|
declare const Anchor: React.ForwardRefExoticComponent<AnchorProps & React.RefAttributes<HTMLDivElement>>;
|
|
4
27
|
export { Anchor };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { Anchor } from './index';
|
|
3
|
+
declare const meta: Meta<typeof Anchor>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Anchor>;
|
|
6
|
+
export declare const Playground: Story;
|
|
7
|
+
export declare const Vertical: Story;
|
|
8
|
+
export declare const Horizontal: Story;
|
|
9
|
+
export declare const NestedItems: Story;
|
|
@@ -1,2 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Anchor — Public Barrel Export
|
|
3
|
+
*
|
|
4
|
+
* Re-exports the `<Anchor>` scroll-spy navigation component.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Anchor component for scroll-spy navigation.
|
|
8
|
+
*
|
|
9
|
+
* Highlights the active section as the user scrolls and smooth-scrolls
|
|
10
|
+
* to targets on click. Supports `direction` (vertical / horizontal),
|
|
11
|
+
* `affix` mode, nested `items`, and custom `getContainer`.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* <Anchor
|
|
16
|
+
* items={[
|
|
17
|
+
* { key: "intro", href: "#intro", title: "Introduction" },
|
|
18
|
+
* { key: "api", href: "#api", title: "API" },
|
|
19
|
+
* ]}
|
|
20
|
+
* direction="vertical"
|
|
21
|
+
* offsetTop={80}
|
|
22
|
+
* />
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
1
25
|
export { Anchor } from './Anchor';
|
|
2
26
|
export type { AnchorProps, AnchorItem, AnchorDirection } from './types';
|
|
@@ -2,6 +2,31 @@ import { MessageAPI } from '../message/types';
|
|
|
2
2
|
import { NotificationAPI } from '../notification/types';
|
|
3
3
|
import { ModalHookAPI } from '../modal/types';
|
|
4
4
|
import { AppProps } from './types';
|
|
5
|
+
/**
|
|
6
|
+
* @file App Component
|
|
7
|
+
*
|
|
8
|
+
* Top-level provider that makes imperative `message`, `notification`,
|
|
9
|
+
* and `modal` APIs available via `App.useApp()`. Wrap your application
|
|
10
|
+
* (or a subtree) with `<App>` and call `const { message } = App.useApp()`
|
|
11
|
+
* to show feedback without prop-drilling.
|
|
12
|
+
*
|
|
13
|
+
* Key props: `children`, `component`, `className`, `style`.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```tsx
|
|
17
|
+
* <App>
|
|
18
|
+
* <MyPage />
|
|
19
|
+
* </App>
|
|
20
|
+
*
|
|
21
|
+
* function MyPage() {
|
|
22
|
+
* const { message } = App.useApp();
|
|
23
|
+
* return <button onClick={() => message.success("Saved!")}>Save</button>;
|
|
24
|
+
* }
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* @see {@link ./types.ts} — prop definitions
|
|
28
|
+
* @see {@link ./index.ts} — barrel export
|
|
29
|
+
*/
|
|
5
30
|
import * as React from "react";
|
|
6
31
|
interface AppContextValue {
|
|
7
32
|
message: MessageAPI;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { App } from './index';
|
|
3
|
+
declare const meta: Meta<typeof App>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof App>;
|
|
6
|
+
export declare const Playground: Story;
|
|
7
|
+
export declare const CustomComponent: Story;
|
|
8
|
+
export declare const NoWrapper: Story;
|
|
@@ -2,6 +2,24 @@ import { InternalApp, useApp } from './App';
|
|
|
2
2
|
type AppComponent = typeof InternalApp & {
|
|
3
3
|
useApp: typeof useApp;
|
|
4
4
|
};
|
|
5
|
+
/**
|
|
6
|
+
* App provider component for imperative feedback APIs.
|
|
7
|
+
*
|
|
8
|
+
* Wrap your application with `<App>` to gain access to
|
|
9
|
+
* `message`, `notification`, and `modal` via the `App.useApp()` hook.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* <App>
|
|
14
|
+
* <MyPage />
|
|
15
|
+
* </App>
|
|
16
|
+
*
|
|
17
|
+
* function MyPage() {
|
|
18
|
+
* const { message, notification, modal } = App.useApp();
|
|
19
|
+
* return <button onClick={() => message.info("Hello!")}>Greet</button>;
|
|
20
|
+
* }
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
5
23
|
declare const App: AppComponent;
|
|
6
24
|
export { App };
|
|
7
25
|
export type { AppProps } from './types';
|
|
@@ -1,4 +1,26 @@
|
|
|
1
1
|
import { AutoCompleteProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* @file AutoComplete Component
|
|
4
|
+
*
|
|
5
|
+
* An input field with a filterable dropdown suggestion list.
|
|
6
|
+
* Supports keyboard navigation, controlled / uncontrolled value,
|
|
7
|
+
* custom filter functions, backfill, allow-clear, and three
|
|
8
|
+
* visual variants (outlined, borderless, filled).
|
|
9
|
+
*
|
|
10
|
+
* Key props: `options`, `value`, `onChange`, `onSelect`, `onSearch`,
|
|
11
|
+
* `filterOption`, `size`, `status`, `variant`, `allowClear`.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* <AutoComplete
|
|
16
|
+
* options={[{ value: "React" }, { value: "Vue" }, { value: "Angular" }]}
|
|
17
|
+
* placeholder="Search frameworks"
|
|
18
|
+
* />
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* @see {@link ./types.ts} — prop definitions
|
|
22
|
+
* @see {@link ./index.ts} — barrel export
|
|
23
|
+
*/
|
|
2
24
|
import * as React from "react";
|
|
3
25
|
declare const InternalAutoComplete: React.ForwardRefExoticComponent<AutoCompleteProps & React.RefAttributes<HTMLDivElement>>;
|
|
4
26
|
export { InternalAutoComplete };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { AutoComplete } from './index';
|
|
3
|
+
declare const meta: Meta<typeof AutoComplete>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof AutoComplete>;
|
|
6
|
+
export declare const Playground: Story;
|
|
7
|
+
export declare const Sizes: Story;
|
|
8
|
+
export declare const Variants: Story;
|
|
9
|
+
export declare const Status: Story;
|
|
10
|
+
export declare const AllowClear: Story;
|
|
11
|
+
export declare const Disabled: Story;
|
|
12
|
+
export declare const CustomFilter: Story;
|
|
@@ -1,3 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file AutoComplete — Public Barrel Export
|
|
3
|
+
*
|
|
4
|
+
* Re-exports the `<AutoComplete>` input component with dropdown
|
|
5
|
+
* suggestions.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* AutoComplete input with filterable dropdown suggestions.
|
|
9
|
+
*
|
|
10
|
+
* Supports `options`, controlled / uncontrolled `value`, custom
|
|
11
|
+
* `filterOption`, `allowClear`, `size`, `status`, and `variant`.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* <AutoComplete
|
|
16
|
+
* options={[{ value: "React" }, { value: "Vue" }]}
|
|
17
|
+
* placeholder="Search..."
|
|
18
|
+
* onSelect={(val) => console.log(val)}
|
|
19
|
+
* />
|
|
20
|
+
* <AutoComplete size="large" variant="filled" allowClear />
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
1
23
|
declare const AutoComplete: import('react').ForwardRefExoticComponent<import('./types').AutoCompleteProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
2
24
|
export { AutoComplete };
|
|
3
25
|
export type { AutoCompleteProps, AutoCompleteOption, AutoCompleteSize, AutoCompleteStatus, AutoCompleteVariant, } from './types';
|
|
@@ -1,4 +1,28 @@
|
|
|
1
1
|
import { AvatarProps, AvatarGroupProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* @file Avatar Component
|
|
4
|
+
*
|
|
5
|
+
* Renders a user avatar as an image, icon, or auto-scaled text
|
|
6
|
+
* initials. Supports circle / square shapes, three preset sizes
|
|
7
|
+
* (plus custom numeric), and grouped display via `Avatar.Group`.
|
|
8
|
+
*
|
|
9
|
+
* Key props: `src`, `size`, `shape`, `icon`, `alt`, `gap`.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* <Avatar src="/user.jpg" alt="Jane" />
|
|
14
|
+
* <Avatar icon={<UserIcon />} shape="square" size="large" />
|
|
15
|
+
* <Avatar.Group max={{ count: 3 }}>
|
|
16
|
+
* <Avatar src="/a.jpg" />
|
|
17
|
+
* <Avatar src="/b.jpg" />
|
|
18
|
+
* <Avatar src="/c.jpg" />
|
|
19
|
+
* <Avatar src="/d.jpg" />
|
|
20
|
+
* </Avatar.Group>
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* @see {@link ./types.ts} — prop definitions
|
|
24
|
+
* @see {@link ./index.ts} — barrel export
|
|
25
|
+
*/
|
|
2
26
|
import * as React from "react";
|
|
3
27
|
declare const InternalAvatar: React.ForwardRefExoticComponent<AvatarProps & React.RefAttributes<HTMLSpanElement>>;
|
|
4
28
|
declare const InternalAvatarGroup: React.FC<AvatarGroupProps>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { Avatar } from './index';
|
|
3
|
+
declare const meta: Meta<typeof Avatar>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Avatar>;
|
|
6
|
+
export declare const Playground: Story;
|
|
7
|
+
export declare const Sizes: Story;
|
|
8
|
+
export declare const Shapes: Story;
|
|
9
|
+
export declare const Fallbacks: Story;
|
|
10
|
+
export declare const Group: Story;
|
|
@@ -2,6 +2,27 @@ import { InternalAvatar, InternalAvatarGroup } from './Avatar';
|
|
|
2
2
|
type AvatarComponent = typeof InternalAvatar & {
|
|
3
3
|
Group: typeof InternalAvatarGroup;
|
|
4
4
|
};
|
|
5
|
+
/**
|
|
6
|
+
* Avatar component for user profile images, icons, or text initials.
|
|
7
|
+
*
|
|
8
|
+
* Supports `src` image, `icon` fallback, text `children` with
|
|
9
|
+
* auto-scaling, `shape` (circle / square), and `size`.
|
|
10
|
+
*
|
|
11
|
+
* Use `Avatar.Group` to display a stacked group with overflow count.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* <Avatar src="/photo.jpg" alt="User" />
|
|
16
|
+
* <Avatar shape="square" size={48}>AB</Avatar>
|
|
17
|
+
*
|
|
18
|
+
* <Avatar.Group max={{ count: 3 }}>
|
|
19
|
+
* <Avatar src="/a.jpg" />
|
|
20
|
+
* <Avatar src="/b.jpg" />
|
|
21
|
+
* <Avatar src="/c.jpg" />
|
|
22
|
+
* <Avatar src="/d.jpg" />
|
|
23
|
+
* </Avatar.Group>
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
5
26
|
declare const Avatar: AvatarComponent;
|
|
6
27
|
export { Avatar };
|
|
7
28
|
export type { AvatarProps, AvatarGroupProps, AvatarSize, AvatarShape, AvatarGroupMaxConfig } from './types';
|
|
@@ -1,4 +1,23 @@
|
|
|
1
1
|
import { BadgeProps, BadgeRibbonProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* @file Badge Component
|
|
4
|
+
*
|
|
5
|
+
* Displays a numeric count, dot, or status indicator on its children.
|
|
6
|
+
* Includes `Badge.Ribbon` for corner ribbon decorations on cards.
|
|
7
|
+
*
|
|
8
|
+
* Key props: `count`, `dot`, `status`, `color`, `size`, `overflowCount`,
|
|
9
|
+
* `showZero`, `offset`.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* <Badge count={5}><Avatar /></Badge>
|
|
14
|
+
* <Badge dot status="success" />
|
|
15
|
+
* <Badge.Ribbon text="New"><Card>...</Card></Badge.Ribbon>
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* @see {@link ./types.ts} — prop definitions
|
|
19
|
+
* @see {@link ./index.ts} — barrel export
|
|
20
|
+
*/
|
|
2
21
|
import * as React from "react";
|
|
3
22
|
declare const InternalBadge: React.ForwardRefExoticComponent<BadgeProps & React.RefAttributes<HTMLSpanElement>>;
|
|
4
23
|
declare const BadgeRibbon: React.FC<BadgeRibbonProps>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { Badge } from './index';
|
|
3
|
+
declare const meta: Meta<typeof Badge>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Badge>;
|
|
6
|
+
export declare const Playground: Story;
|
|
7
|
+
export declare const Count: Story;
|
|
8
|
+
export declare const Dot: Story;
|
|
9
|
+
export declare const StatusBadges: Story;
|
|
10
|
+
export declare const Colors: Story;
|
|
11
|
+
export declare const Overflow: Story;
|
|
12
|
+
export declare const Ribbon: Story;
|
|
@@ -2,6 +2,25 @@ import { InternalBadge, BadgeRibbon } from './Badge';
|
|
|
2
2
|
type BadgeComponent = typeof InternalBadge & {
|
|
3
3
|
Ribbon: typeof BadgeRibbon;
|
|
4
4
|
};
|
|
5
|
+
/**
|
|
6
|
+
* Badge component for numeric counts, dots, and status indicators.
|
|
7
|
+
*
|
|
8
|
+
* Supports `count`, `dot`, `status`, preset / custom `color`,
|
|
9
|
+
* `overflowCount`, `size`, and `showZero`.
|
|
10
|
+
*
|
|
11
|
+
* Use `Badge.Ribbon` for corner ribbon decorations on cards.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* <Badge count={5}><button>Notifications</button></Badge>
|
|
16
|
+
* <Badge dot status="processing"><span>Online</span></Badge>
|
|
17
|
+
* <Badge status="success" text="Completed" />
|
|
18
|
+
*
|
|
19
|
+
* <Badge.Ribbon text="Hot" color="red">
|
|
20
|
+
* <Card>Content</Card>
|
|
21
|
+
* </Badge.Ribbon>
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
5
24
|
declare const Badge: BadgeComponent;
|
|
6
25
|
export { Badge };
|
|
7
26
|
export type { BadgeProps, BadgeRibbonProps, BadgeStatus, BadgeSize, PresetColor, RibbonPlacement, } from './types';
|
|
@@ -1,4 +1,28 @@
|
|
|
1
1
|
import { BreadcrumbProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* @file Breadcrumb Component
|
|
4
|
+
*
|
|
5
|
+
* Renders a breadcrumb trail from an `items` array. Each item can
|
|
6
|
+
* optionally include an `href` for linking, a dropdown `menu` for
|
|
7
|
+
* sub-navigation, and an `onClick` handler. The last item is
|
|
8
|
+
* automatically rendered as the current page.
|
|
9
|
+
*
|
|
10
|
+
* Key props: `items`, `separator`.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* <Breadcrumb
|
|
15
|
+
* items={[
|
|
16
|
+
* { title: "Home", href: "/" },
|
|
17
|
+
* { title: "Products", href: "/products" },
|
|
18
|
+
* { title: "Widget" },
|
|
19
|
+
* ]}
|
|
20
|
+
* />
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* @see {@link ./types.ts} — prop definitions
|
|
24
|
+
* @see {@link ./index.ts} — barrel export
|
|
25
|
+
*/
|
|
2
26
|
import * as React from "react";
|
|
3
27
|
declare const Breadcrumb: React.ForwardRefExoticComponent<BreadcrumbProps & React.RefAttributes<HTMLElement>>;
|
|
4
28
|
export { Breadcrumb };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { Breadcrumb } from './index';
|
|
3
|
+
declare const meta: Meta<typeof Breadcrumb>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Breadcrumb>;
|
|
6
|
+
export declare const Playground: Story;
|
|
7
|
+
export declare const Basic: Story;
|
|
8
|
+
export declare const CustomSeparator: Story;
|
|
9
|
+
export declare const WithMenu: Story;
|
|
@@ -1,2 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Breadcrumb — Public Barrel Export
|
|
3
|
+
*
|
|
4
|
+
* Re-exports the `<Breadcrumb>` navigation component.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Breadcrumb navigation trail.
|
|
8
|
+
*
|
|
9
|
+
* Renders a list of `items` as linked crumbs with an automatic
|
|
10
|
+
* separator. Supports dropdown `menu` per item and a custom
|
|
11
|
+
* `separator` node.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* <Breadcrumb
|
|
16
|
+
* items={[
|
|
17
|
+
* { title: "Home", href: "/" },
|
|
18
|
+
* { title: "Settings", href: "/settings" },
|
|
19
|
+
* { title: "Profile" },
|
|
20
|
+
* ]}
|
|
21
|
+
* />
|
|
22
|
+
*
|
|
23
|
+
* <Breadcrumb separator=">" items={[{ title: "A" }, { title: "B" }]} />
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
1
26
|
export { Breadcrumb } from './Breadcrumb';
|
|
2
27
|
export type { BreadcrumbProps, BreadcrumbItemType, BreadcrumbMenuItemType } from './types';
|
|
@@ -1,4 +1,28 @@
|
|
|
1
1
|
import { ButtonProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* @file Button Component
|
|
4
|
+
*
|
|
5
|
+
* Public `<Button>` with an Ant-Design-compatible API.
|
|
6
|
+
* Wraps the low-level `primitives/button` and maps friendly props
|
|
7
|
+
* (`type`, `danger`, `ghost`, `loading`, `shape`, `hint`, …) onto
|
|
8
|
+
* CVA variant classes.
|
|
9
|
+
*
|
|
10
|
+
* Ant-Design `type` → Primitive `variant` mapping:
|
|
11
|
+
* primary → "default" (solid primary bg)
|
|
12
|
+
* default → "outline" (bordered)
|
|
13
|
+
* dashed → "outline" + border-dashed class
|
|
14
|
+
* text → "ghost" (transparent)
|
|
15
|
+
* link → "link" (underline on hover)
|
|
16
|
+
*
|
|
17
|
+
* When `danger` is true the variant is overridden to "destructive".
|
|
18
|
+
*
|
|
19
|
+
* Tooltip: pass a `hint` string and the button is automatically
|
|
20
|
+
* wrapped in a `<TooltipProvider> → <Tooltip> → <TooltipTrigger>`.
|
|
21
|
+
*
|
|
22
|
+
* @see {@link ../../primitives/button.tsx} — underlying styled primitive
|
|
23
|
+
* @see {@link ./types.ts} — prop definitions
|
|
24
|
+
* @see {@link ./ButtonGroup.tsx} — grouped buttons
|
|
25
|
+
*/
|
|
2
26
|
import * as React from "react";
|
|
3
27
|
declare const InternalButton: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
4
28
|
export { InternalButton };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { Button } from './index';
|
|
3
|
+
declare const meta: Meta<typeof Button>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Button>;
|
|
6
|
+
export declare const Playground: Story;
|
|
7
|
+
export declare const AllTypes: Story;
|
|
8
|
+
export declare const AllSizes: Story;
|
|
9
|
+
export declare const AllShapes: Story;
|
|
10
|
+
export declare const WithIcons: Story;
|
|
11
|
+
export declare const Danger: Story;
|
|
12
|
+
export declare const Ghost: Story;
|
|
13
|
+
export declare const Loading: Story;
|
|
14
|
+
export declare const Disabled: Story;
|
|
15
|
+
export declare const Block: Story;
|
|
16
|
+
export declare const HoverActiveTest: Story;
|
|
17
|
+
export declare const CompleteMatrix: Story;
|
|
18
|
+
export declare const Hint: Story;
|
|
19
|
+
export declare const IconOnlySizes: Story;
|
|
20
|
+
export declare const Group: Story;
|
|
@@ -1,4 +1,27 @@
|
|
|
1
1
|
import { ButtonGroupProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* @file ButtonGroup Component
|
|
4
|
+
*
|
|
5
|
+
* Renders adjacent `<Button>` children as a visually connected group:
|
|
6
|
+
* - Collapsed borders via `-ml-px` on non-first children
|
|
7
|
+
* - First child keeps left rounding, last child keeps right rounding,
|
|
8
|
+
* middle children have no rounding
|
|
9
|
+
* - Hovered / focused children are promoted via `z-10` so their
|
|
10
|
+
* border/ring sits above neighbours
|
|
11
|
+
*
|
|
12
|
+
* An optional `size` prop overrides every child button's size.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```tsx
|
|
16
|
+
* <Button.Group size="small">
|
|
17
|
+
* <Button>Left</Button>
|
|
18
|
+
* <Button>Center</Button>
|
|
19
|
+
* <Button>Right</Button>
|
|
20
|
+
* </Button.Group>
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* @see {@link ./types.ts} — `ButtonGroupProps`
|
|
24
|
+
*/
|
|
2
25
|
import * as React from "react";
|
|
3
26
|
declare const ButtonGroup: React.FC<ButtonGroupProps>;
|
|
4
27
|
export { ButtonGroup };
|