@fibrae/semi-ui-svelte 0.9.1 → 0.10.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 +8 -4
- package/README.zh-CN.md +8 -4
- package/dist/components/anchor/interface.d.ts +14 -0
- package/dist/components/audio-player/interface.d.ts +5 -0
- package/dist/components/auto-complete/interface.d.ts +29 -0
- package/dist/components/avatar/interface.d.ts +24 -0
- package/dist/components/backtop/interface.d.ts +2 -0
- package/dist/components/badge/interface.d.ts +7 -0
- package/dist/components/banner/interface.d.ts +7 -0
- package/dist/components/breadcrumb/interface.d.ts +10 -0
- package/dist/components/button/interface.d.ts +18 -0
- package/dist/components/calendar/interface.d.ts +16 -0
- package/dist/components/card/interface.d.ts +18 -0
- package/dist/components/carousel/interface.d.ts +16 -0
- package/dist/components/cascader/interface.d.ts +57 -0
- package/dist/components/checkbox/interface.d.ts +19 -0
- package/dist/components/code-highlight/interface.d.ts +3 -0
- package/dist/components/collapse/interface.d.ts +16 -0
- package/dist/components/collapsible/interface.d.ts +10 -0
- package/dist/components/color-picker/interface.d.ts +10 -0
- package/dist/components/config-provider/interface.d.ts +7 -0
- package/dist/components/cropper/interface.d.ts +11 -0
- package/dist/components/date-picker/interface.d.ts +47 -0
- package/dist/components/descriptions/interface.d.ts +6 -0
- package/dist/components/divider/interface.d.ts +4 -0
- package/dist/components/dropdown/interface.d.ts +8 -0
- package/dist/components/empty/interface.d.ts +7 -0
- package/dist/components/feedback/interface.d.ts +16 -0
- package/dist/components/float-button/interface.d.ts +14 -0
- package/dist/components/form/interface.d.ts +47 -0
- package/dist/components/grid/interface.d.ts +13 -0
- package/dist/components/highlight/interface.d.ts +7 -0
- package/dist/components/hot-keys/interface.d.ts +3 -0
- package/dist/components/image/interface.d.ts +59 -0
- package/dist/components/input/interface.d.ts +67 -0
- package/dist/components/input-number/interface.d.ts +24 -0
- package/dist/components/json-viewer/interface.d.ts +7 -0
- package/dist/components/layout/interface.d.ts +3 -0
- package/dist/components/list/interface.d.ts +18 -0
- package/dist/components/locale/interface.d.ts +4 -0
- package/dist/components/lottie/interface.d.ts +2 -0
- package/dist/components/markdown-render/interface.d.ts +5 -0
- package/dist/components/modal/interface.d.ts +29 -0
- package/dist/components/navigation/interface.d.ts +47 -0
- package/dist/components/overflow-list/interface.d.ts +11 -0
- package/dist/components/pagination/interface.d.ts +12 -0
- package/dist/components/pincode/interface.d.ts +8 -0
- package/dist/components/popconfirm/interface.d.ts +12 -0
- package/dist/components/popover/interface.d.ts +30 -0
- package/dist/components/progress/interface.d.ts +13 -0
- package/dist/components/radio/interface.d.ts +22 -0
- package/dist/components/rating/interface.d.ts +12 -0
- package/dist/components/resizable/interface.d.ts +30 -0
- package/dist/components/scroll-list/interface.d.ts +6 -0
- package/dist/components/select/interface.d.ts +63 -0
- package/dist/components/side-sheet/interface.d.ts +19 -0
- package/dist/components/skeleton/interface.d.ts +7 -0
- package/dist/components/slider/interface.d.ts +23 -0
- package/dist/components/space/interface.d.ts +4 -0
- package/dist/components/spin/interface.d.ts +7 -0
- package/dist/components/steps/interface.d.ts +9 -0
- package/dist/components/switch/interface.d.ts +7 -0
- package/dist/components/table/interface.d.ts +48 -0
- package/dist/components/tabs/interface.d.ts +29 -0
- package/dist/components/tag/interface.d.ts +22 -0
- package/dist/components/tag-input/interface.d.ts +29 -0
- package/dist/components/time-picker/interface.d.ts +31 -0
- package/dist/components/timeline/interface.d.ts +5 -0
- package/dist/components/tooltip/interface.d.ts +20 -0
- package/dist/components/transfer/interface.d.ts +18 -0
- package/dist/components/tree/interface.d.ts +45 -0
- package/dist/components/tree-select/interface.d.ts +55 -0
- package/dist/components/typography/interface.d.ts +33 -0
- package/dist/components/upload/interface.d.ts +64 -0
- package/dist/components/user-guide/interface.d.ts +15 -0
- package/dist/components/video-player/interface.d.ts +22 -0
- package/docs/advanced/dark-mode.md +288 -0
- package/docs/basic/button.md +605 -0
- package/docs/basic/divider.md +103 -0
- package/docs/basic/float-button.md +246 -0
- package/docs/basic/grid.md +427 -0
- package/docs/basic/layout.md +459 -0
- package/docs/basic/resizable.md +584 -0
- package/docs/basic/space.md +163 -0
- package/docs/basic/tokens.md +425 -0
- package/docs/basic/typography.md +615 -0
- package/docs/changes-from-semi.md +105 -0
- package/docs/ecosystem/tailwind.md +210 -0
- package/docs/experience/accessibility.md +82 -0
- package/docs/experience/content-guidelines.md +819 -0
- package/docs/experience/internationalization.md +7 -0
- package/docs/feedback/banner.md +198 -0
- package/docs/feedback/feedback.md +294 -0
- package/docs/feedback/notification.md +401 -0
- package/docs/feedback/popconfirm.md +243 -0
- package/docs/feedback/progress.md +389 -0
- package/docs/feedback/skeleton.md +388 -0
- package/docs/feedback/spin.md +172 -0
- package/docs/feedback/toast.md +393 -0
- package/docs/input/auto-complete.md +399 -0
- package/docs/input/cascader.md +1558 -0
- package/docs/input/checkbox.md +408 -0
- package/docs/input/color-picker.md +175 -0
- package/docs/input/date-picker.md +942 -0
- package/docs/input/form.md +2550 -0
- package/docs/input/input-number.md +451 -0
- package/docs/input/input.md +640 -0
- package/docs/input/pincode.md +191 -0
- package/docs/input/radio.md +337 -0
- package/docs/input/rating.md +214 -0
- package/docs/input/select.md +1230 -0
- package/docs/input/slider.md +347 -0
- package/docs/input/switch.md +206 -0
- package/docs/input/tag-input.md +465 -0
- package/docs/input/time-picker.md +358 -0
- package/docs/input/transfer.md +1061 -0
- package/docs/input/tree-select.md +1300 -0
- package/docs/input/upload.md +1811 -0
- package/docs/llms.txt +147 -0
- package/docs/navigation/anchor.md +377 -0
- package/docs/navigation/backtop.md +100 -0
- package/docs/navigation/breadcrumb.md +284 -0
- package/docs/navigation/navigation.md +851 -0
- package/docs/navigation/pagination.md +217 -0
- package/docs/navigation/steps.md +315 -0
- package/docs/navigation/tabs.md +754 -0
- package/docs/navigation/tree.md +1956 -0
- package/docs/other/config-provider.md +599 -0
- package/docs/other/locale.md +353 -0
- package/docs/plus/audio-player.md +155 -0
- package/docs/plus/code-highlight.md +150 -0
- package/docs/plus/drag-move.md +214 -0
- package/docs/plus/hot-keys.md +174 -0
- package/docs/plus/json-viewer.md +392 -0
- package/docs/plus/lottie.md +176 -0
- package/docs/plus/markdown-render.md +240 -0
- package/docs/plus/video-player.md +325 -0
- package/docs/show/avatar.md +475 -0
- package/docs/show/badge.md +276 -0
- package/docs/show/calendar.md +352 -0
- package/docs/show/card.md +485 -0
- package/docs/show/carousel.md +592 -0
- package/docs/show/collapse.md +289 -0
- package/docs/show/collapsible.md +216 -0
- package/docs/show/cropper.md +285 -0
- package/docs/show/descriptions.md +325 -0
- package/docs/show/dropdown.md +466 -0
- package/docs/show/empty.md +225 -0
- package/docs/show/highlight.md +144 -0
- package/docs/show/image.md +433 -0
- package/docs/show/list.md +927 -0
- package/docs/show/modal.md +517 -0
- package/docs/show/overflow-list.md +272 -0
- package/docs/show/popover.md +534 -0
- package/docs/show/scroll-list.md +156 -0
- package/docs/show/side-sheet.md +274 -0
- package/docs/show/table.md +5437 -0
- package/docs/show/tag.md +428 -0
- package/docs/show/timeline.md +277 -0
- package/docs/show/tooltip.md +442 -0
- package/docs/show/user-guide.md +419 -0
- package/docs/start/getting-started.md +234 -0
- package/docs/start/introduction.md +57 -0
- package/docs/start/overview.md +21 -0
- package/package.json +5 -4
package/README.md
CHANGED
|
@@ -4,13 +4,17 @@
|
|
|
4
4
|
|
|
5
5
|
The Svelte component library of Semi Design Next, for Svelte 5.57+ applications. It is a community fork of [Semi Design](https://github.com/DouyinFE/semi-design), unaffiliated with ByteDance and the Semi Design team, and shares the logic and styles of one foundation with the UI packages of other frameworks.
|
|
6
6
|
|
|
7
|
+
## For coding agents
|
|
8
|
+
|
|
9
|
+
This package ships documentation for coding agents that matches the installed version. Start with `node_modules/@fibrae/semi-ui-svelte/docs/llms.txt`: it lists the rules for using the library, then one Markdown page per component with props, types, defaults and runnable examples. The same docs are online at https://semi-design-next.pages.dev/en-US/svelte/llms.txt.
|
|
10
|
+
|
|
7
11
|
## Installation
|
|
8
12
|
|
|
9
13
|
```sh
|
|
10
14
|
pnpm add svelte @fibrae/semi-ui-svelte @fibrae/semi-icons-svelte
|
|
11
15
|
```
|
|
12
16
|
|
|
13
|
-
Peer dependency: `svelte` ^5.57.0. For browser, module format, Node.js and build plugin requirements, see the [requirements in Getting Started](
|
|
17
|
+
Peer dependency: `svelte` ^5.57.0. For browser, module format, Node.js and build plugin requirements, see the [requirements in Getting Started](https://semi-design-next.pages.dev/en-US/svelte/start/getting-started/#requirements).
|
|
14
18
|
|
|
15
19
|
## Usage
|
|
16
20
|
|
|
@@ -64,7 +68,7 @@ The default locale is `zh_CN`. The built-in packs `zh_CN` and `en_US` come from
|
|
|
64
68
|
</LocaleProvider>
|
|
65
69
|
```
|
|
66
70
|
|
|
67
|
-
For any other language, pass your own pack typed `LocaleInput`: `code` is required, and every text it leaves out falls back to `en_US`. For the structure of a locale pack, see [@fibrae/semi-foundation](
|
|
71
|
+
For any other language, pass your own pack typed `LocaleInput`: `code` is required, and every text it leaves out falls back to `en_US`. For the structure of a locale pack, see [@fibrae/semi-foundation](https://github.com/smile-alive/semi-design-next/blob/release/packages/shared/semi-foundation/README.md#locale-packs).
|
|
68
72
|
|
|
69
73
|
### Server rendering
|
|
70
74
|
|
|
@@ -76,7 +80,7 @@ Components output server HTML with `render` from `svelte/server` and in SvelteKi
|
|
|
76
80
|
|
|
77
81
|
### Documentation
|
|
78
82
|
|
|
79
|
-
Component docs are in [
|
|
83
|
+
Component docs are in [the documentation site](https://semi-design-next.pages.dev/en-US/svelte/start/overview/). To get started, read [Quick Start](https://semi-design-next.pages.dev/en-US/svelte/start/getting-started/).
|
|
80
84
|
|
|
81
85
|
## Related packages
|
|
82
86
|
|
|
@@ -88,4 +92,4 @@ Component docs are in [website/content](../../website/content). To get started,
|
|
|
88
92
|
|
|
89
93
|
`pnpm --filter @fibrae/semi-ui-svelte build` runs `scripts/svelte-package.ts`: `svelte-package` outputs `src` to `dist` (`.svelte` files as they are, `.ts` compiled to `.js` and `.d.ts`). The script changes style imports to the foundation's `.css`, removes `__tests__`, and writes the full `styles.css` and `tailwind.css`.
|
|
90
94
|
|
|
91
|
-
For general commands, see [CONTRIBUTING.md](
|
|
95
|
+
For general commands, see [CONTRIBUTING.md](https://github.com/smile-alive/semi-design-next/blob/release/CONTRIBUTING.md#常用命令) at the repository root. For how to write components, see [components](https://github.com/smile-alive/semi-design-next/blob/release/.agents/references/svelte/components.md). For changes relative to upstream, see [release-notes](https://github.com/smile-alive/semi-design-next/blob/release/docs/release-notes.md).
|
package/README.zh-CN.md
CHANGED
|
@@ -4,13 +4,17 @@
|
|
|
4
4
|
|
|
5
5
|
Semi Design Next 的 Svelte 组件库,面向 Svelte 5.57+ 应用。它是上游 [Semi Design](https://github.com/DouyinFE/semi-design) 的社区 fork,与字节跳动及 Semi Design 官方团队无关,与各框架的 UI 包共用同一份 foundation 的逻辑和样式。
|
|
6
6
|
|
|
7
|
+
## 给编码 agent
|
|
8
|
+
|
|
9
|
+
本包附带与安装版本一致的 agent 文档。从 `node_modules/@fibrae/semi-ui-svelte/docs/llms.txt` 读起:先是使用规则,然后每个组件一页 Markdown,列出属性、类型、默认值和可运行示例。线上版本见 https://semi-design-next.pages.dev/en-US/svelte/llms.txt。
|
|
10
|
+
|
|
7
11
|
## 安装
|
|
8
12
|
|
|
9
13
|
```sh
|
|
10
14
|
pnpm add svelte @fibrae/semi-ui-svelte @fibrae/semi-icons-svelte
|
|
11
15
|
```
|
|
12
16
|
|
|
13
|
-
peer 依赖:`svelte` ^5.57.0。浏览器、模块格式、Node.js 与构建插件的版本要求见[快速开始的环境要求](
|
|
17
|
+
peer 依赖:`svelte` ^5.57.0。浏览器、模块格式、Node.js 与构建插件的版本要求见[快速开始的环境要求](https://semi-design-next.pages.dev/zh-CN/svelte/start/getting-started/#环境要求)。
|
|
14
18
|
|
|
15
19
|
## 使用
|
|
16
20
|
|
|
@@ -64,7 +68,7 @@ peer 依赖:`svelte` ^5.57.0。浏览器、模块格式、Node.js 与构建插
|
|
|
64
68
|
</LocaleProvider>
|
|
65
69
|
```
|
|
66
70
|
|
|
67
|
-
其他语言传入自己的 `LocaleInput` 语言包:`code` 必填,没写的文案回退到 `en_US`。语言包的结构见 [@fibrae/semi-foundation](
|
|
71
|
+
其他语言传入自己的 `LocaleInput` 语言包:`code` 必填,没写的文案回退到 `en_US`。语言包的结构见 [@fibrae/semi-foundation](https://github.com/smile-alive/semi-design-next/blob/release/packages/shared/semi-foundation/README.zh-CN.md#语言包)。
|
|
68
72
|
|
|
69
73
|
### 服务端渲染
|
|
70
74
|
|
|
@@ -76,7 +80,7 @@ peer 依赖:`svelte` ^5.57.0。浏览器、模块格式、Node.js 与构建插
|
|
|
76
80
|
|
|
77
81
|
### 文档
|
|
78
82
|
|
|
79
|
-
组件文档在 [
|
|
83
|
+
组件文档在 [文档站](https://semi-design-next.pages.dev/zh-CN/svelte/start/overview/),入门见 [快速开始](https://semi-design-next.pages.dev/zh-CN/svelte/start/getting-started/)。
|
|
80
84
|
|
|
81
85
|
## 与其他包的关系
|
|
82
86
|
|
|
@@ -88,4 +92,4 @@ peer 依赖:`svelte` ^5.57.0。浏览器、模块格式、Node.js 与构建插
|
|
|
88
92
|
|
|
89
93
|
`pnpm --filter @fibrae/semi-ui-svelte build` 执行 `scripts/svelte-package.ts`:用 `svelte-package` 把 `src` 输出到 `dist`(`.svelte` 原样、`.ts` 编译为 `.js` 与 `.d.ts`),把样式导入改为 foundation 的 `.css`,去掉 `__tests__`,并写出整包 `styles.css`、`tailwind.css`。
|
|
90
94
|
|
|
91
|
-
通用命令见根目录 [CONTRIBUTING.md](
|
|
95
|
+
通用命令见根目录 [CONTRIBUTING.md](https://github.com/smile-alive/semi-design-next/blob/release/CONTRIBUTING.md#常用命令)。组件写法见 [components](https://github.com/smile-alive/semi-design-next/blob/release/.agents/references/svelte/components.md),相对上游的变化见 [release-notes](https://github.com/smile-alive/semi-design-next/blob/release/docs/release-notes.md)。
|
|
@@ -22,23 +22,37 @@ export interface AnchorTitleContext {
|
|
|
22
22
|
export interface AnchorProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title' | 'onclick' | 'onchange'> {
|
|
23
23
|
/** The links, nested through `children`; a flat or nested list is known up front, so the first frame is complete */
|
|
24
24
|
links?: AnchorLinkItem[];
|
|
25
|
+
/** Whether the next level of links is shown dynamically while scrolling. */
|
|
25
26
|
autoCollapse?: boolean;
|
|
27
|
+
/** Link highlighted by default. */
|
|
26
28
|
defaultAnchor?: string;
|
|
29
|
+
/** Returns the scrolling container, window when omitted. */
|
|
27
30
|
getContainer?: () => HTMLElement | Window | null;
|
|
31
|
+
/** max-height of the component, with a scrollbar when exceeded. A max-height in style wins. */
|
|
28
32
|
maxHeight?: string | number;
|
|
33
|
+
/** max-width of the component, truncating when exceeded. A max-width in style wins. */
|
|
29
34
|
maxWidth?: string | number;
|
|
35
|
+
/** Offset from the top of the container at which the current link switches while content scrolls. */
|
|
30
36
|
offsetTop?: number;
|
|
37
|
+
/** Position of the Tooltip when showTooltip is on, with the same values as the Tooltip position. */
|
|
31
38
|
position?: Position;
|
|
39
|
+
/** Theme of the rail: primary, tertiary or muted. */
|
|
32
40
|
railTheme?: ArrayElement<typeof strings.SLIDE_COLOR>;
|
|
41
|
+
/** Whether scrolling after a click is animated. */
|
|
33
42
|
scrollMotion?: boolean;
|
|
34
43
|
/** Passed to scroll-into-view-if-needed when a link is clicked; `scrollMotion` and `targetOffset` still apply */
|
|
35
44
|
scrollIntoViewOptions?: ScrollIntoViewOptions;
|
|
45
|
+
/** Whether a Tooltip shows when the text is truncated, with its options: type is the popup component, tooltip (default) or popover, and opts are passed to it. */
|
|
36
46
|
showTooltip?: boolean | ShowTooltip;
|
|
47
|
+
/** Size of the anchor: small or default. */
|
|
37
48
|
size?: ArrayElement<typeof strings.SIZE>;
|
|
49
|
+
/** Distance between the target and the top of the container when scrolling ends. */
|
|
38
50
|
targetOffset?: number;
|
|
51
|
+
/** Called when the highlighted link changes, with the current and the previous link. */
|
|
39
52
|
onChange?: (currentLink: string, previousLink: string) => void;
|
|
40
53
|
/** Only when a link is activated, so a click elsewhere on the root does not reach it */
|
|
41
54
|
onClick?: (event: AnchorClickEvent, currentLink: string) => void;
|
|
55
|
+
/** Snippet that renders every link's title, with the parameter `{ item, level }`; `level` is the nesting depth, 1 at the top. It takes precedence over `title` in `links`. */
|
|
42
56
|
title?: Snippet<[AnchorTitleContext]>;
|
|
43
57
|
}
|
|
44
58
|
export type { AnchorBaseState as AnchorState } from '@fibrae/semi-foundation/components/anchor/foundation';
|
|
@@ -2,10 +2,15 @@ import type { HTMLAttributes } from 'svelte/elements';
|
|
|
2
2
|
import type { AudioUrl } from '@fibrae/semi-foundation/components/audio-player/foundation';
|
|
3
3
|
export type AudioPlayerTheme = 'dark' | 'light';
|
|
4
4
|
export interface AudioPlayerProps extends HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
/** Audio address: a string, an AudioInfo object, or an array of them. An array shows the previous and next track buttons. */
|
|
5
6
|
audioUrl: AudioUrl;
|
|
7
|
+
/** Whether to play automatically. */
|
|
6
8
|
autoPlay?: boolean;
|
|
9
|
+
/** Whether to display the toolbar. */
|
|
7
10
|
showToolbar?: boolean;
|
|
11
|
+
/** Seconds skipped by each backward or forward button press. */
|
|
8
12
|
skipDuration?: number;
|
|
13
|
+
/** Player theme: dark or light. */
|
|
9
14
|
theme?: AudioPlayerTheme;
|
|
10
15
|
}
|
|
11
16
|
export interface AudioSliderProps {
|
|
@@ -41,46 +41,75 @@ type NativeKeys = 'children' | 'prefix' | 'placeholder' | 'onchange' | 'onselect
|
|
|
41
41
|
export interface AutoCompleteProps<T extends AutoCompleteItems = AutoCompleteItems> extends Omit<HTMLAttributes<HTMLDivElement>, NativeKeys>, Pick<HTMLInputAttributes, 'name'> {
|
|
42
42
|
/** Bindable; leave it out for an uncontrolled AutoComplete. `bind:value={get, set}` makes it fully controlled */
|
|
43
43
|
value?: string | number;
|
|
44
|
+
/** Data source of the candidates: an array of strings, numbers or objects. An object item uses value as the picked value and label as its text (value when label is missing); its disabled, class, style and data-* fields go to the matching row, where class takes a string, array or object and style is a string. Use the item snippet for markup. */
|
|
44
45
|
data?: T[];
|
|
46
|
+
/** Whether to focus the input after mount. */
|
|
45
47
|
autofocus?: boolean;
|
|
48
|
+
/** Whether the dropdown flips automatically when it would be clipped. */
|
|
46
49
|
autoAdjustOverflow?: boolean;
|
|
50
|
+
/** Whether the first candidate is highlighted when the panel opens, so that Enter picks it directly. */
|
|
47
51
|
defaultActiveFirstOption?: boolean;
|
|
48
52
|
/** Opens the list on mount; AutoComplete has no controlled open state */
|
|
49
53
|
defaultOpen?: boolean;
|
|
54
|
+
/** Whether the component is disabled. */
|
|
50
55
|
disabled?: boolean;
|
|
56
|
+
/** Class names of the inner parts, keyed by dropdown (the dropdown list, the role="listbox" element); values take anything class takes (string, array or object) and merge with the built-in classes. */
|
|
51
57
|
classNames?: Partial<Record<AutoCompletePart, ClassValue>>;
|
|
58
|
+
/** Whether the minimum width of the dropdown equals the width of the input. */
|
|
52
59
|
dropdownMatchSelectWidth?: boolean;
|
|
60
|
+
/** Style strings of the inner parts, keyed like classNames; dropdown is merged with maxHeight and applied to the role="listbox" element. */
|
|
53
61
|
styles?: Partial<Record<AutoCompletePart, string>>;
|
|
62
|
+
/** The id of the insetLabel element, which names the combobox and the listbox. When omitted, the component generates one while an insetLabel is rendered. */
|
|
54
63
|
insetLabelId?: string;
|
|
64
|
+
/** Whether the dropdown shows a loading spinner in place of the candidates and the empty content. */
|
|
55
65
|
loading?: boolean;
|
|
66
|
+
/** Maximum height of the dropdown list; a number is in px. */
|
|
56
67
|
maxHeight?: string | number;
|
|
68
|
+
/** Whether the dropdown animates when it shows and hides. */
|
|
57
69
|
motion?: boolean;
|
|
58
70
|
/** `onSelect` reports the data item instead of its value */
|
|
59
71
|
onSelectWithObject?: boolean;
|
|
72
|
+
/** Placeholder of the input. */
|
|
60
73
|
placeholder?: string;
|
|
74
|
+
/** Position of the dropdown; the values are those of the Tooltip position. Unset, it is bottomLeft, or bottomRight when the ConfigProvider direction is rtl. */
|
|
61
75
|
position?: Position;
|
|
62
76
|
/** The text the input shows for a picked item; it must return a string */
|
|
63
77
|
renderSelectedItem?: (option: AutoCompleteSelectedItem<T>) => string;
|
|
78
|
+
/** Whether to show the clear button when there is content. */
|
|
64
79
|
showClear?: boolean;
|
|
80
|
+
/** Size of the input. */
|
|
65
81
|
size?: Size;
|
|
82
|
+
/** Whether click, mousedown and focus in/out events on the dropdown stop propagating. */
|
|
66
83
|
stopPropagation?: boolean | string;
|
|
84
|
+
/** Validation status; it only affects the style. */
|
|
67
85
|
validateStatus?: ValidateStatus;
|
|
86
|
+
/** Called when the input text changes or a candidate is picked. */
|
|
68
87
|
onChange?: (value: string | number) => void;
|
|
88
|
+
/** Called as the user types, with the typed text. */
|
|
69
89
|
onSearch?: (inputValue: string) => void;
|
|
70
90
|
/** The item's value, or the item without internal fields with `onSelectWithObject` */
|
|
71
91
|
onSelect?: (value: string | number | AutoCompleteDataItem) => void;
|
|
92
|
+
/** Called after the clear button is used. */
|
|
72
93
|
onClear?: () => void;
|
|
73
94
|
/** Once when the focus enters the input */
|
|
74
95
|
onFocus?: (event: FocusEvent) => void;
|
|
75
96
|
/** Once when the focus leaves the input */
|
|
76
97
|
onBlur?: (event: FocusEvent) => void;
|
|
98
|
+
/** Called when the dropdown shows or hides, with its visibility. */
|
|
77
99
|
onDropdownVisibleChange?: (visible: boolean) => void;
|
|
100
|
+
/** Snippet for the prefix of the input. */
|
|
78
101
|
prefix?: Snippet;
|
|
102
|
+
/** Snippet for the suffix of the input. */
|
|
79
103
|
suffix?: Snippet;
|
|
104
|
+
/** Snippet for the inset label of the input; passing it counts as having content. It is not rendered, and does not name the component, when prefix or trigger is used. */
|
|
80
105
|
insetLabel?: Snippet;
|
|
106
|
+
/** Snippet for the custom clear icon, effective when showClear is true. */
|
|
81
107
|
clearIcon?: Snippet;
|
|
108
|
+
/** Snippet for the content shown in the dropdown when data is empty. */
|
|
82
109
|
emptyContent?: Snippet;
|
|
110
|
+
/** Snippet for the content of a candidate row, receiving `{ item, index }`: item is the data item as given and index is its position among the rendered items; without it the row shows the label. */
|
|
83
111
|
item?: Snippet<[AutoCompleteItemSnippetProps<T>]>;
|
|
112
|
+
/** Snippet that replaces the input. Its parameters are value, inputValue, placeholder, disabled, autofocus, size, validateStatus, showClear, insetLabelId, onChange (updates the input text, calls onSearch and onChange and opens the list), onClear, onFocus, onBlur and controlAttrs (the aria-* attributes given to the component, for the focusable element of the custom trigger). With it, id lands on the root element. */
|
|
84
113
|
trigger?: Snippet<[AutoCompleteTriggerSnippetProps]>;
|
|
85
114
|
}
|
|
86
115
|
export {};
|
|
@@ -21,28 +21,46 @@ export interface AvatarBottomSlot {
|
|
|
21
21
|
render?: Snippet;
|
|
22
22
|
}
|
|
23
23
|
export interface AvatarProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'children' | 'onmouseenter' | 'onmouseleave'> {
|
|
24
|
+
/** Preset background color of the avatar. */
|
|
24
25
|
color?: AvatarColor;
|
|
26
|
+
/** Avatar shape: circle or square. */
|
|
25
27
|
shape?: AvatarShape;
|
|
28
|
+
/** Avatar size, as a preset name or a valid CSS size. */
|
|
26
29
|
size?: string;
|
|
30
|
+
/** Image source URL. */
|
|
27
31
|
src?: string;
|
|
32
|
+
/** Responsive image sources. */
|
|
28
33
|
srcSet?: string;
|
|
34
|
+
/** Alternative text for the avatar image or text. */
|
|
29
35
|
alt?: string;
|
|
36
|
+
/** Space in pixels between the text and either side of the avatar. */
|
|
30
37
|
gap?: number;
|
|
38
|
+
/** Native attributes applied to the inner img element. */
|
|
31
39
|
imgAttr?: HTMLImgAttributes;
|
|
40
|
+
/** Gradient, text color, class and style string of the top badge; use the topSlotText snippet for its content. A `render` snippet replaces the whole badge. */
|
|
32
41
|
topSlot?: AvatarTopSlot;
|
|
42
|
+
/** Shape, background color, text color, class and style string of the bottom badge; use the bottomSlotText snippet for its content. A `render` snippet replaces the whole badge. */
|
|
33
43
|
bottomSlot?: AvatarBottomSlot;
|
|
44
|
+
/** Additional border, with optional color and animation. */
|
|
34
45
|
border?: boolean | {
|
|
35
46
|
color?: string;
|
|
36
47
|
motion?: boolean;
|
|
37
48
|
};
|
|
49
|
+
/** Enables animation in the avatar content area. */
|
|
38
50
|
contentMotion?: boolean;
|
|
39
51
|
/** Returning `false` keeps the broken image instead of falling back to the content */
|
|
40
52
|
onError?: (event: Event) => boolean | void;
|
|
53
|
+
/** Called when the pointer enters the avatar. */
|
|
41
54
|
onMouseEnter?: (event: MouseEvent) => void;
|
|
55
|
+
/** Called when the pointer leaves the avatar. */
|
|
42
56
|
onMouseLeave?: (event: MouseEvent) => void;
|
|
57
|
+
/** Snippet for the avatar text or custom content. */
|
|
43
58
|
children?: Snippet;
|
|
59
|
+
/** Snippet for the overlay shown on hover, with styles supplied by the caller. */
|
|
44
60
|
hoverMask?: Snippet;
|
|
61
|
+
/** Snippet for the text or nodes inside the preset top badge. */
|
|
45
62
|
topSlotText?: Snippet;
|
|
63
|
+
/** Snippet for the text or nodes inside the preset bottom badge. */
|
|
46
64
|
bottomSlotText?: Snippet;
|
|
47
65
|
}
|
|
48
66
|
export type AvatarGroupShape = AvatarShape;
|
|
@@ -59,12 +77,18 @@ export interface AvatarGroupMoreContext {
|
|
|
59
77
|
restAvatars: AvatarGroupItem[];
|
|
60
78
|
}
|
|
61
79
|
export interface AvatarGroupProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
80
|
+
/** Shape of the avatars in the group. */
|
|
62
81
|
shape?: AvatarGroupShape;
|
|
82
|
+
/** Size of the avatars in the group. */
|
|
63
83
|
size?: string;
|
|
84
|
+
/** Avatar overlap direction: start or end. */
|
|
64
85
|
overlapFrom?: AvatarGroupOverlapFrom;
|
|
86
|
+
/** Maximum number of visible avatars; overflow is shown as +N. */
|
|
65
87
|
maxCount?: number;
|
|
88
|
+
/** Data of the avatars in the group; each item holds the props of an Avatar, and the group's `size` and `shape` override the item's own. */
|
|
66
89
|
items?: AvatarGroupItem[];
|
|
67
90
|
/** Content of every avatar, taking precedence over the item's own `children` */
|
|
68
91
|
item?: Snippet<[AvatarGroupItemContext]>;
|
|
92
|
+
/** Snippet for a custom overflow label, with the parameter `{ restNumber, restAvatars }`: the remaining count and the hidden items. */
|
|
69
93
|
more?: Snippet<[AvatarGroupMoreContext]>;
|
|
70
94
|
}
|
|
@@ -5,9 +5,11 @@ export interface BackTopProps extends Omit<FloatButtonProps, 'children' | 'disab
|
|
|
5
5
|
duration?: number;
|
|
6
6
|
/** The scrolled element; defaults to the window. Read on mount and whenever the function itself changes */
|
|
7
7
|
target?: () => Window | HTMLElement | null;
|
|
8
|
+
/** Scroll distance after which the BackTop appears. */
|
|
8
9
|
visibilityHeight?: number;
|
|
9
10
|
/** Static content of the button, shown in place of the icon; must not contain interactive elements */
|
|
10
11
|
children?: Snippet;
|
|
12
|
+
/** Snippet for the button icon. Defaults to IconBackTop. */
|
|
11
13
|
icon?: Snippet;
|
|
12
14
|
}
|
|
13
15
|
export type { BackTopState } from '@fibrae/semi-foundation/components/backtop/foundation';
|
|
@@ -7,13 +7,20 @@ export type BadgePosition = 'leftTop' | 'leftBottom' | 'rightTop' | 'rightBottom
|
|
|
7
7
|
export interface BadgeProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'children'> {
|
|
8
8
|
/** Text or number shown in the badge; a snippet replaces the content together with the type and theme classes */
|
|
9
9
|
count?: number | string | Snippet | null;
|
|
10
|
+
/** Shows a small dot instead of the content. */
|
|
10
11
|
dot?: boolean;
|
|
12
|
+
/** Badge type: primary, secondary, tertiary, danger, warning or success. */
|
|
11
13
|
type?: BadgeType;
|
|
14
|
+
/** Badge theme: solid, light or inverted. */
|
|
12
15
|
theme?: BadgeTheme;
|
|
13
16
|
/** Defaults to `leftTop` in an RTL ConfigProvider and `rightTop` otherwise */
|
|
14
17
|
position?: BadgePosition;
|
|
18
|
+
/** Maximum number shown; larger numbers display as `${overflowCount}+`. Applies to numbers only, and 0 counts as unset. */
|
|
15
19
|
overflowCount?: number;
|
|
20
|
+
/** Class names of the inner parts, keyed by count; values take anything class takes (string, array or object) and merge with the built-in classes. */
|
|
16
21
|
classNames?: Partial<Record<BadgePart, ClassValue>>;
|
|
22
|
+
/** Style strings of the inner parts, keyed like classNames. */
|
|
17
23
|
styles?: Partial<Record<BadgePart, string>>;
|
|
24
|
+
/** Snippet for the element the badge is attached to. Without it the badge stands alone. */
|
|
18
25
|
children?: Snippet;
|
|
19
26
|
}
|
|
@@ -2,15 +2,22 @@ import type { Snippet } from 'svelte';
|
|
|
2
2
|
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
3
|
export type BannerType = 'info' | 'danger' | 'warning' | 'success';
|
|
4
4
|
export interface BannerProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
5
|
+
/** Whether to show a border. Only takes effect in non-full mode. */
|
|
5
6
|
bordered?: boolean;
|
|
7
|
+
/** Whether the banner is in full mode. */
|
|
6
8
|
fullMode?: boolean;
|
|
9
|
+
/** Title, a string or a snippet. */
|
|
7
10
|
title?: string | Snippet;
|
|
11
|
+
/** Type: info, success, danger or warning. */
|
|
8
12
|
type?: BannerType;
|
|
9
13
|
/** The close button's click event; the banner hides right after the callback returns */
|
|
10
14
|
onClose?: (event: MouseEvent) => void;
|
|
15
|
+
/** Snippet for the description content. */
|
|
11
16
|
description?: Snippet;
|
|
17
|
+
/** Snippet that replaces the icon of the type. Pass `null` to hide the icon. */
|
|
12
18
|
icon?: Snippet | null;
|
|
13
19
|
/** Replaces the icon of the close button; `null` removes the button */
|
|
14
20
|
closeIcon?: Snippet | null;
|
|
21
|
+
/** Custom content below the message. */
|
|
15
22
|
children?: Snippet;
|
|
16
23
|
}
|
|
@@ -33,13 +33,21 @@ export interface BreadcrumbMoreContext {
|
|
|
33
33
|
restItems: BreadcrumbRouteContext[];
|
|
34
34
|
}
|
|
35
35
|
export interface BreadcrumbProps extends HTMLAttributes<HTMLElement> {
|
|
36
|
+
/** Controlled index of the current item, counted from 0. The last item is current when omitted. */
|
|
36
37
|
activeIndex?: number;
|
|
38
|
+
/** Whether items beyond maxItemCount collapse automatically. */
|
|
37
39
|
autoCollapse?: boolean;
|
|
40
|
+
/** Whether the compact size is used. */
|
|
38
41
|
compact?: boolean;
|
|
42
|
+
/** Number of levels above which the breadcrumb collapses. */
|
|
39
43
|
maxItemCount?: number;
|
|
44
|
+
/** Built-in rendering of the ellipsis area: default or popover. The more snippet wins when it is provided. */
|
|
40
45
|
moreType?: BreadcrumbMoreType;
|
|
46
|
+
/** Route information as an array of route objects or strings. */
|
|
41
47
|
routes?: Array<BreadcrumbRoute | string>;
|
|
48
|
+
/** Separator, either text or a snippet. */
|
|
42
49
|
separator?: string | Snippet;
|
|
50
|
+
/** Whether a Tooltip shows for an overflowing title, with its options: width is the overflow width, ellipsisPos truncates at the end or in the middle, and opts are passed to the Tooltip without content, with class and style landing on the popup. */
|
|
43
51
|
showTooltip?: boolean | BreadcrumbShowTooltip;
|
|
44
52
|
/**
|
|
45
53
|
* A prop, not the nav's native click listener: whether a handler exists decides if items without href are
|
|
@@ -48,6 +56,8 @@ export interface BreadcrumbProps extends HTMLAttributes<HTMLElement> {
|
|
|
48
56
|
onClick?: BreadcrumbClick;
|
|
49
57
|
/** Custom title of every item; rendered inline, without the truncating text */
|
|
50
58
|
item?: Snippet<[BreadcrumbRouteContext]>;
|
|
59
|
+
/** Icon of each item, with the route, its index, size and class as parameters. Pass the last two to the icon. An empty result renders no icon. */
|
|
51
60
|
icon?: Snippet<[BreadcrumbIconContext]>;
|
|
61
|
+
/** Custom ellipsis area. The parameter restItems holds the collapsed items as `{ route, index }`. */
|
|
52
62
|
more?: Snippet<[BreadcrumbMoreContext]>;
|
|
53
63
|
}
|
|
@@ -12,27 +12,45 @@ export interface ButtonIconArgs {
|
|
|
12
12
|
fill?: string[];
|
|
13
13
|
}
|
|
14
14
|
export interface ButtonProps extends Omit<HTMLButtonAttributes, 'children' | 'type'> {
|
|
15
|
+
/** Renders the button as a block-level button. */
|
|
15
16
|
block?: boolean;
|
|
17
|
+
/** Class names of the inner parts, keyed by content; values take anything class takes (string, array or object) and merge with the built-in classes. */
|
|
16
18
|
classNames?: Partial<Record<ButtonPart, ClassValue>>;
|
|
19
|
+
/** Colorful button, supported for the primary and tertiary types only. Falls back to the ButtonGroup it is in, and finally to false. */
|
|
17
20
|
colorful?: boolean;
|
|
21
|
+
/** Disabled state, which takes precedence over loading. Falls back to the ButtonGroup it is in, and finally to false. */
|
|
18
22
|
disabled?: boolean;
|
|
23
|
+
/** Native type of the button: button, reset or submit. */
|
|
19
24
|
htmlType?: HtmlType;
|
|
25
|
+
/** Icon position: left or right. */
|
|
20
26
|
iconPosition?: 'left' | 'right';
|
|
27
|
+
/** Loading state. A loading button stays focusable, its onclick is not called, and a submit button does not submit its form. */
|
|
21
28
|
loading?: boolean;
|
|
22
29
|
/** Only applies to a button that shows an icon or the loading spinner. */
|
|
23
30
|
noHorizontalPadding?: boolean | HorizontalPaddingType | HorizontalPaddingType[];
|
|
31
|
+
/** Button size: large, default or small. Falls back to the ButtonGroup it is in, and finally to default. */
|
|
24
32
|
size?: Size;
|
|
33
|
+
/** Style strings of the inner parts, keyed like classNames. */
|
|
25
34
|
styles?: Partial<Record<ButtonPart, string>>;
|
|
35
|
+
/** Button theme: solid, borderless, light or outline. Falls back to the ButtonGroup it is in, and finally to light. */
|
|
26
36
|
theme?: Theme;
|
|
37
|
+
/** Button type: primary, secondary, tertiary, warning or danger. Falls back to the ButtonGroup it is in, and finally to primary. */
|
|
27
38
|
type?: Type;
|
|
39
|
+
/** Snippet for the button text. Without `children`, a button that shows an icon or is loading is treated as an icon-only button. */
|
|
28
40
|
children?: Snippet;
|
|
41
|
+
/** Snippet for the button icon, placed by iconPosition. Its argument is `{ fill }`: a colorful button supplies the fill, which has to be passed to the icon component. */
|
|
29
42
|
icon?: Snippet<[ButtonIconArgs]>;
|
|
30
43
|
}
|
|
31
44
|
export interface ButtonGroupProps extends HTMLAttributes<HTMLDivElement> {
|
|
45
|
+
/** Colorful style, used as the default of the buttons in the group. */
|
|
32
46
|
colorful?: boolean;
|
|
47
|
+
/** Disabled state, used as the default of the buttons in the group. */
|
|
33
48
|
disabled?: boolean;
|
|
49
|
+
/** Button size, used as the default of the buttons in the group. */
|
|
34
50
|
size?: Size;
|
|
51
|
+
/** Button theme, used as the default of the buttons in the group. */
|
|
35
52
|
theme?: Theme;
|
|
53
|
+
/** Button type, used as the default of the buttons in the group. */
|
|
36
54
|
type?: Type;
|
|
37
55
|
}
|
|
38
56
|
export interface SplitButtonGroupProps extends HTMLAttributes<HTMLDivElement> {
|
|
@@ -29,29 +29,45 @@ export interface CalendarAllDayEventsArgs {
|
|
|
29
29
|
events: EventObject[];
|
|
30
30
|
}
|
|
31
31
|
export interface CalendarProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'onclick' | 'onclose'> {
|
|
32
|
+
/** Display date. When omitted it is the current date and updates at midnight. */
|
|
32
33
|
displayValue?: Date;
|
|
34
|
+
/** Date range shown in range mode, left-closed and right-open. Required in range mode. */
|
|
33
35
|
range?: Date[];
|
|
36
|
+
/** Events to render, see Event Object. */
|
|
34
37
|
events?: EventObject[];
|
|
38
|
+
/** View mode: day, week, month or range. The view switches as soon as it changes. */
|
|
35
39
|
mode?: CalendarMode;
|
|
40
|
+
/** Shows the red line of the current time in the day, week and range views. */
|
|
36
41
|
showCurrTime?: boolean;
|
|
42
|
+
/** Day of the week that starts the week, 0 for Sunday, 1 for Monday and so on. Applies to the month and week views. */
|
|
37
43
|
weekStartsOn?: WeekStartsOn;
|
|
44
|
+
/** Default scroll offset of the content in the day, week and range views. */
|
|
38
45
|
scrollTop?: number;
|
|
46
|
+
/** Shows weekend columns in grey to tell them from weekdays. */
|
|
39
47
|
markWeekend?: boolean;
|
|
48
|
+
/** Minimum height in pixels of events in the day, range and week views. */
|
|
40
49
|
minEventHeight?: number;
|
|
50
|
+
/** Width of the calendar; a number is in pixels. */
|
|
41
51
|
width?: number | string;
|
|
52
|
+
/** Height of the calendar; a number is in pixels. */
|
|
42
53
|
height?: number | string;
|
|
54
|
+
/** Called when a date cell is clicked, with the event and the date of the cell. The unit is half an hour in the day, week and range views and one day in the month view. */
|
|
43
55
|
onClick?: (event: MouseEvent, value: Date) => void;
|
|
44
56
|
/**
|
|
45
57
|
* The close button's click, the Esc keydown, or `null` when a mousedown outside closes the card
|
|
46
58
|
*/
|
|
47
59
|
onClose?: (event: MouseEvent | KeyboardEvent | null) => void;
|
|
60
|
+
/** Called when a click on "N more" opens the card in the month view, with the event, the date and the number of collapsed events. It is not called when a second click closes the card. */
|
|
48
61
|
onMoreClick?: (event: MouseEvent, date: Date, remaining: number) => void;
|
|
49
62
|
/** Shown above the grid; a snippet that renders nothing still leaves its (empty) row */
|
|
50
63
|
header?: Snippet;
|
|
51
64
|
/** Content of an event, called once per place the event shows. Defaults to the event's `children` text */
|
|
52
65
|
event?: Snippet<[CalendarEventArgs]>;
|
|
66
|
+
/** Snippet for custom date text: the column titles of the week and range views and every cell of the month view. The day view does not use it. */
|
|
53
67
|
dateDisplay?: Snippet<[CalendarDateDisplayArgs]>;
|
|
68
|
+
/** Snippet for custom content of a date cell or column, with the date and its dateString (date.toString()). Use absolute positioning for elements. */
|
|
54
69
|
dateGrid?: Snippet<[CalendarDateGridArgs]>;
|
|
70
|
+
/** Snippet for custom time text in the day, week and range views; time is the hour. */
|
|
55
71
|
timeDisplay?: Snippet<[CalendarTimeDisplayArgs]>;
|
|
56
72
|
/** Replaces the all-day events of the day, week and range views; renders `li` items */
|
|
57
73
|
allDayEvents?: Snippet<[CalendarAllDayEventsArgs]>;
|
|
@@ -5,28 +5,46 @@ import type { SpaceProps } from '../space/interface.js';
|
|
|
5
5
|
export type Shadows = 'hover' | 'always';
|
|
6
6
|
export type CardGroupType = 'grid';
|
|
7
7
|
export interface CardProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
8
|
+
/** Whether the card has an outer border. */
|
|
8
9
|
bordered?: boolean;
|
|
10
|
+
/** Class names of the inner parts, keyed by header, title, extra, cover, body, actions and footer; values take anything class takes (string, array or object) and merge with the built-in classes. */
|
|
9
11
|
classNames?: Partial<Record<CardPart, ClassValue>>;
|
|
12
|
+
/** Whether there is a border between the footer and the content area. */
|
|
10
13
|
footerLine?: boolean;
|
|
14
|
+
/** Whether there is a border between the header and the content area. */
|
|
11
15
|
headerLine?: boolean;
|
|
16
|
+
/** Whether the content area shows a loading placeholder; the root element's aria-busy is true while on. */
|
|
12
17
|
loading?: boolean;
|
|
18
|
+
/** When to show the shadow: hover or always. No shadow when unset. */
|
|
13
19
|
shadows?: Shadows;
|
|
20
|
+
/** Style strings of the inner parts, keyed like classNames. */
|
|
14
21
|
styles?: Partial<Record<CardPart, string>>;
|
|
15
22
|
/** A string renders as a 6th-level title with a single-line ellipsis tooltip; a snippet renders as it is */
|
|
16
23
|
title?: string | Snippet;
|
|
24
|
+
/** Extra content to the right of the title. */
|
|
17
25
|
headerExtraContent?: Snippet;
|
|
26
|
+
/** Custom header that replaces title and headerExtraContent. */
|
|
18
27
|
header?: Snippet;
|
|
28
|
+
/** Card cover. */
|
|
19
29
|
cover?: Snippet;
|
|
30
|
+
/** Actions at the bottom of the content area, spaced 12px apart; every snippet becomes one action. */
|
|
20
31
|
actions?: Snippet[];
|
|
32
|
+
/** Custom footer. */
|
|
21
33
|
footer?: Snippet;
|
|
34
|
+
/** Card content. */
|
|
22
35
|
children?: Snippet;
|
|
23
36
|
}
|
|
24
37
|
export interface MetaProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
38
|
+
/** Title, a string or a snippet. */
|
|
25
39
|
title?: string | Snippet;
|
|
40
|
+
/** Avatar. */
|
|
26
41
|
avatar?: Snippet;
|
|
42
|
+
/** Description. */
|
|
27
43
|
description?: Snippet;
|
|
28
44
|
}
|
|
29
45
|
export interface CardGroupProps extends Omit<SpaceProps, 'spacing'> {
|
|
46
|
+
/** Spacing between cards, a number or [horizontal, vertical]; ignored when type is grid. */
|
|
30
47
|
spacing?: number | [number, number];
|
|
48
|
+
/** Set to grid for a grid layout, which overrides spacing. */
|
|
31
49
|
type?: CardGroupType;
|
|
32
50
|
}
|
|
@@ -17,22 +17,38 @@ export interface CarouselProps<T = unknown> extends Omit<HTMLAttributes<HTMLDivE
|
|
|
17
17
|
items: readonly T[];
|
|
18
18
|
/** Controlled index; `undefined` hands control back, continuing from the last controlled index */
|
|
19
19
|
activeIndex?: number;
|
|
20
|
+
/** Transition animation: slide or fade. */
|
|
20
21
|
animation?: 'slide' | 'fade';
|
|
22
|
+
/** Data for the previous and next arrow buttons: `leftArrow.props` and `rightArrow.props` hold the button attributes. `onclick` and `class` are merged with the built-in handler and classes. Use the `leftArrow` and `rightArrow` snippets for the icons. */
|
|
21
23
|
arrowProps?: ArrowProps;
|
|
24
|
+
/** When the arrows are shown: always or hover. */
|
|
22
25
|
arrowType?: 'always' | 'hover';
|
|
26
|
+
/** Whether to play automatically, or an object with interval (milliseconds between slides, default 2000) and hoverToPause (pause while hovered, default true). */
|
|
23
27
|
autoPlay?: CarouselAutoPlay;
|
|
28
|
+
/** Indicator position: left, center or right. */
|
|
24
29
|
indicatorPosition?: 'left' | 'center' | 'right';
|
|
30
|
+
/** Indicator size: small or medium. */
|
|
25
31
|
indicatorSize?: 'small' | 'medium';
|
|
32
|
+
/** Indicator type: dot, line or columnar. */
|
|
26
33
|
indicatorType?: 'dot' | 'line' | 'columnar';
|
|
34
|
+
/** Whether to show the arrows. */
|
|
27
35
|
showArrow?: boolean;
|
|
36
|
+
/** Whether to show the indicator. */
|
|
28
37
|
showIndicator?: boolean;
|
|
38
|
+
/** Slide direction when the animation is slide: left or right. */
|
|
29
39
|
slideDirection?: 'left' | 'right';
|
|
40
|
+
/** Transition duration in milliseconds. */
|
|
30
41
|
speed?: number;
|
|
42
|
+
/** Theme of the indicator and arrows: primary, light or dark. */
|
|
31
43
|
theme?: 'dark' | 'primary' | 'light';
|
|
44
|
+
/** How the indicator switches slides: click or hover. */
|
|
32
45
|
trigger?: 'click' | 'hover';
|
|
46
|
+
/** Called when the shown slide changes, with the new index and the previous index. */
|
|
33
47
|
onChange?: (activeIndex: number, preIndex: number) => void;
|
|
34
48
|
/** The content of one slide; the carousel wraps it in the element that carries the slide's classes, role and `inert` */
|
|
35
49
|
slide: Snippet<[CarouselSlideContext<T>]>;
|
|
50
|
+
/** Snippet for the icon of the previous arrow. An empty snippet leaves the button empty. */
|
|
36
51
|
leftArrow?: Snippet;
|
|
52
|
+
/** Snippet for the icon of the next arrow. An empty snippet leaves the button empty. */
|
|
37
53
|
rightArrow?: Snippet;
|
|
38
54
|
}
|