@max-ts/svelte 0.1.1
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 +161 -0
- package/lib/components/Accordion/Content/index.d.ts +1 -0
- package/lib/components/Accordion/Content/styles.css.d.ts +5 -0
- package/lib/components/Accordion/Item/index.d.ts +1 -0
- package/lib/components/Accordion/Item/styles.css.d.ts +4 -0
- package/lib/components/Accordion/Trigger/index.d.ts +1 -0
- package/lib/components/Accordion/Trigger/styles.css.d.ts +6 -0
- package/lib/components/Accordion/index.d.ts +7 -0
- package/lib/components/Button/index.d.ts +3 -0
- package/lib/components/Button/styles.css.d.ts +9 -0
- package/lib/components/Button/types.d.ts +12 -0
- package/lib/components/Calendar/Caption/index.d.ts +1 -0
- package/lib/components/Calendar/Cell/index.d.ts +1 -0
- package/lib/components/Calendar/Cell/styles.css.d.ts +4 -0
- package/lib/components/Calendar/Day/index.d.ts +1 -0
- package/lib/components/Calendar/Day/styles.css.d.ts +4 -0
- package/lib/components/Calendar/Grid/index.d.ts +1 -0
- package/lib/components/Calendar/Grid/styles.css.d.ts +4 -0
- package/lib/components/Calendar/GridBody/index.d.ts +1 -0
- package/lib/components/Calendar/GridHead/index.d.ts +1 -0
- package/lib/components/Calendar/GridRow/index.d.ts +1 -0
- package/lib/components/Calendar/GridRow/styles.css.d.ts +4 -0
- package/lib/components/Calendar/HeadCell/index.d.ts +1 -0
- package/lib/components/Calendar/HeadCell/styles.css.d.ts +4 -0
- package/lib/components/Calendar/Header/index.d.ts +1 -0
- package/lib/components/Calendar/Header/styles.css.d.ts +4 -0
- package/lib/components/Calendar/Heading/index.d.ts +1 -0
- package/lib/components/Calendar/Heading/styles.css.d.ts +4 -0
- package/lib/components/Calendar/Month/index.d.ts +1 -0
- package/lib/components/Calendar/MonthSelect/index.d.ts +1 -0
- package/lib/components/Calendar/MonthSelect/styles.css.d.ts +6 -0
- package/lib/components/Calendar/Months/index.d.ts +1 -0
- package/lib/components/Calendar/Months/styles.css.d.ts +4 -0
- package/lib/components/Calendar/Nav/index.d.ts +1 -0
- package/lib/components/Calendar/Nav/styles.css.d.ts +4 -0
- package/lib/components/Calendar/NextButton/index.d.ts +1 -0
- package/lib/components/Calendar/NextButton/styles.css.d.ts +4 -0
- package/lib/components/Calendar/PrevButton/index.d.ts +1 -0
- package/lib/components/Calendar/PrevButton/styles.css.d.ts +4 -0
- package/lib/components/Calendar/YearSelect/index.d.ts +1 -0
- package/lib/components/Calendar/YearSelect/styles.css.d.ts +6 -0
- package/lib/components/Calendar/index.d.ts +1 -0
- package/lib/components/Calendar/styles.css.d.ts +6 -0
- package/lib/components/Checkbox/index.d.ts +2 -0
- package/lib/components/Checkbox/styles.css.d.ts +5 -0
- package/lib/components/CircularProgress/index.d.ts +3 -0
- package/lib/components/CircularProgress/styles.css.d.ts +9 -0
- package/lib/components/CircularProgress/types.d.ts +8 -0
- package/lib/components/DataGrid/Body/index.d.ts +3 -0
- package/lib/components/DataGrid/Body/styles.css.d.ts +4 -0
- package/lib/components/DataGrid/Body/types.d.ts +4 -0
- package/lib/components/DataGrid/Cell/index.d.ts +3 -0
- package/lib/components/DataGrid/Cell/styles.css.d.ts +5 -0
- package/lib/components/DataGrid/Cell/types.d.ts +7 -0
- package/lib/components/DataGrid/Footer/index.d.ts +2 -0
- package/lib/components/DataGrid/Footer/styles.css.d.ts +4 -0
- package/lib/components/DataGrid/Header/index.d.ts +3 -0
- package/lib/components/DataGrid/Header/styles.css.d.ts +4 -0
- package/lib/components/DataGrid/Header/types.d.ts +6 -0
- package/lib/components/DataGrid/HeaderCell/index.d.ts +3 -0
- package/lib/components/DataGrid/HeaderCell/styles.css.d.ts +4 -0
- package/lib/components/DataGrid/HeaderCell/types.d.ts +6 -0
- package/lib/components/DataGrid/Row/index.d.ts +3 -0
- package/lib/components/DataGrid/Row/styles.css.d.ts +5 -0
- package/lib/components/DataGrid/Row/types.d.ts +9 -0
- package/lib/components/DataGrid/State/index.d.ts +3 -0
- package/lib/components/DataGrid/State/styles.css.d.ts +5 -0
- package/lib/components/DataGrid/State/types.d.ts +10 -0
- package/lib/components/DataGrid/constants.d.ts +1 -0
- package/lib/components/DataGrid/index.d.ts +2 -0
- package/lib/components/DataGrid/styles.css.d.ts +9 -0
- package/lib/components/DataGrid/types.d.ts +45 -0
- package/lib/components/DataGridSortHeader/index.d.ts +2 -0
- package/lib/components/DataGridSortHeader/styles.css.d.ts +7 -0
- package/lib/components/DataGridSortHeader/types.d.ts +11 -0
- package/lib/components/DropdownMenu/CheckboxGroup/index.d.ts +1 -0
- package/lib/components/DropdownMenu/CheckboxItem/index.d.ts +1 -0
- package/lib/components/DropdownMenu/CheckboxItem/styles.css.d.ts +6 -0
- package/lib/components/DropdownMenu/Content/index.d.ts +1 -0
- package/lib/components/DropdownMenu/Content/styles.css.d.ts +4 -0
- package/lib/components/DropdownMenu/Group/index.d.ts +1 -0
- package/lib/components/DropdownMenu/GroupHeading/index.d.ts +1 -0
- package/lib/components/DropdownMenu/GroupHeading/styles.css.d.ts +4 -0
- package/lib/components/DropdownMenu/Item/index.d.ts +1 -0
- package/lib/components/DropdownMenu/Item/styles.css.d.ts +4 -0
- package/lib/components/DropdownMenu/Label/index.d.ts +1 -0
- package/lib/components/DropdownMenu/Label/styles.css.d.ts +1 -0
- package/lib/components/DropdownMenu/Portal/index.d.ts +1 -0
- package/lib/components/DropdownMenu/RadioGroup/index.d.ts +1 -0
- package/lib/components/DropdownMenu/RadioItem/index.d.ts +1 -0
- package/lib/components/DropdownMenu/RadioItem/styles.css.d.ts +6 -0
- package/lib/components/DropdownMenu/Separator/index.d.ts +1 -0
- package/lib/components/DropdownMenu/Separator/styles.css.d.ts +4 -0
- package/lib/components/DropdownMenu/Shortcut/index.d.ts +1 -0
- package/lib/components/DropdownMenu/Shortcut/styles.css.d.ts +4 -0
- package/lib/components/DropdownMenu/Sub/index.d.ts +1 -0
- package/lib/components/DropdownMenu/SubContent/index.d.ts +1 -0
- package/lib/components/DropdownMenu/SubContent/styles.css.d.ts +4 -0
- package/lib/components/DropdownMenu/SubTrigger/index.d.ts +1 -0
- package/lib/components/DropdownMenu/SubTrigger/styles.css.d.ts +5 -0
- package/lib/components/DropdownMenu/Trigger/index.d.ts +1 -0
- package/lib/components/DropdownMenu/index.d.ts +20 -0
- package/lib/components/Field/Content/index.d.ts +1 -0
- package/lib/components/Field/Content/styles.css.d.ts +4 -0
- package/lib/components/Field/Description/index.d.ts +1 -0
- package/lib/components/Field/Description/styles.css.d.ts +4 -0
- package/lib/components/Field/FieldError/index.d.ts +1 -0
- package/lib/components/Field/FieldError/styles.css.d.ts +4 -0
- package/lib/components/Field/FieldSet/index.d.ts +1 -0
- package/lib/components/Field/FieldSet/styles.css.d.ts +4 -0
- package/lib/components/Field/Group/index.d.ts +1 -0
- package/lib/components/Field/Group/styles.css.d.ts +4 -0
- package/lib/components/Field/Label/index.d.ts +1 -0
- package/lib/components/Field/Label/styles.css.d.ts +4 -0
- package/lib/components/Field/Legend/index.d.ts +1 -0
- package/lib/components/Field/Legend/styles.css.d.ts +4 -0
- package/lib/components/Field/Separator/index.d.ts +1 -0
- package/lib/components/Field/Separator/styles.css.d.ts +6 -0
- package/lib/components/Field/Title/index.d.ts +1 -0
- package/lib/components/Field/Title/styles.css.d.ts +4 -0
- package/lib/components/Field/index.d.ts +14 -0
- package/lib/components/Field/styles.css.d.ts +5 -0
- package/lib/components/Field/types.d.ts +3 -0
- package/lib/components/Input/index.d.ts +2 -0
- package/lib/components/Input/styles.css.d.ts +6 -0
- package/lib/components/Input/types.d.ts +12 -0
- package/lib/components/Label/index.d.ts +2 -0
- package/lib/components/Label/styles.css.d.ts +4 -0
- package/lib/components/Placeholder/Image/index.d.ts +3 -0
- package/lib/components/Placeholder/Image/styles.css.d.ts +6 -0
- package/lib/components/Placeholder/Image/types.d.ts +9 -0
- package/lib/components/Placeholder/constants.d.ts +22 -0
- package/lib/components/Placeholder/index.d.ts +3 -0
- package/lib/components/Placeholder/styles.css.d.ts +9 -0
- package/lib/components/Placeholder/types.d.ts +18 -0
- package/lib/components/Select/Content/index.d.ts +1 -0
- package/lib/components/Select/Content/styles.css.d.ts +5 -0
- package/lib/components/Select/Group/index.d.ts +1 -0
- package/lib/components/Select/GroupHeading/index.d.ts +1 -0
- package/lib/components/Select/GroupHeading/styles.css.d.ts +4 -0
- package/lib/components/Select/Item/index.d.ts +1 -0
- package/lib/components/Select/Item/styles.css.d.ts +5 -0
- package/lib/components/Select/Label/index.d.ts +1 -0
- package/lib/components/Select/Label/styles.css.d.ts +4 -0
- package/lib/components/Select/Portal/index.d.ts +1 -0
- package/lib/components/Select/ScrollDownButton/index.d.ts +1 -0
- package/lib/components/Select/ScrollDownButton/styles.css.d.ts +4 -0
- package/lib/components/Select/ScrollUpButton/index.d.ts +1 -0
- package/lib/components/Select/ScrollUpButton/styles.css.d.ts +5 -0
- package/lib/components/Select/Separator/index.d.ts +1 -0
- package/lib/components/Select/Separator/styles.css.d.ts +4 -0
- package/lib/components/Select/Trigger/index.d.ts +1 -0
- package/lib/components/Select/Trigger/styles.css.d.ts +5 -0
- package/lib/components/Select/index.d.ts +14 -0
- package/lib/components/Separator/index.d.ts +2 -0
- package/lib/components/Separator/styles.css.d.ts +4 -0
- package/lib/components/Separator/types.d.ts +2 -0
- package/lib/components/Tooltip/Content/index.d.ts +1 -0
- package/lib/components/Tooltip/Content/styles.css.d.ts +5 -0
- package/lib/components/Tooltip/Portal/index.d.ts +2 -0
- package/lib/components/Tooltip/Provider/index.d.ts +2 -0
- package/lib/components/Tooltip/Trigger/index.d.ts +1 -0
- package/lib/components/Tooltip/index.d.ts +2 -0
- package/lib/components/Tooltip/types.d.ts +11 -0
- package/lib/components/Typography/index.d.ts +4 -0
- package/lib/components/Typography/styles.css.d.ts +9 -0
- package/lib/components/Typography/types.d.ts +4 -0
- package/lib/components/index.d.ts +16 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +1 -0
- package/lib/rslib-runtime.js +1 -0
- package/lib/styles/index.d.ts +5 -0
- package/lib/styles/reset.css.d.ts +1 -0
- package/lib/styles/theme.css.d.ts +85 -0
- package/lib/styles/types.d.ts +11 -0
- package/lib/styles/utils.d.ts +6 -0
- package/lib/styles.css +1 -0
- package/package.json +53 -0
- package/src/index.ts +2 -0
package/README.md
ADDED
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
# @max-ts/svelte
|
|
2
|
+
|
|
3
|
+
Svelte UI-kit with vanilla-extract CSS-in-JS styling.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @max-ts/svelte
|
|
9
|
+
# or
|
|
10
|
+
pnpm add @max-ts/svelte
|
|
11
|
+
# or
|
|
12
|
+
yarn add @max-ts/svelte
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
```svelte
|
|
18
|
+
<script>
|
|
19
|
+
import { Button } from '@max-ts/svelte';
|
|
20
|
+
import '@max-ts/svelte/styles.css';
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<Button variant="default" size="md">
|
|
24
|
+
{#snippet children()}
|
|
25
|
+
Click me!
|
|
26
|
+
{/snippet}
|
|
27
|
+
</Button>
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Components
|
|
31
|
+
|
|
32
|
+
### Button
|
|
33
|
+
|
|
34
|
+
A versatile button component with multiple variants and sizes.
|
|
35
|
+
|
|
36
|
+
#### Props
|
|
37
|
+
|
|
38
|
+
- `variant?: 'default' | 'destructive' | 'outline' | 'ghost' | 'link'` - Button style variant (default: 'default')
|
|
39
|
+
- `size?: 'sm' | 'md' | 'lg' | 'icon' | 'iconSm'` - Button size (default: 'md')
|
|
40
|
+
- `isLoading?: boolean` - Show loading spinner (default: false)
|
|
41
|
+
- `fullWidth?: boolean` - Make button full width (default: false)
|
|
42
|
+
- `disabled?: boolean` - Disable button (default: false)
|
|
43
|
+
- `type?: 'button' | 'submit' | 'reset'` - Button type (default: 'button')
|
|
44
|
+
- `class?: string` - Additional CSS classes
|
|
45
|
+
- `onclick?: () => void` - Click handler
|
|
46
|
+
- `children?: Snippet` - Button content (Svelte 5 snippet)
|
|
47
|
+
- `startAdornment?: Snippet` - Content before button text
|
|
48
|
+
- `endAdornment?: Snippet` - Content after button text
|
|
49
|
+
|
|
50
|
+
#### Examples
|
|
51
|
+
|
|
52
|
+
```svelte
|
|
53
|
+
<!-- Basic usage -->
|
|
54
|
+
<Button>
|
|
55
|
+
{#snippet children()}Default Button{/snippet}
|
|
56
|
+
</Button>
|
|
57
|
+
|
|
58
|
+
<!-- Different variants -->
|
|
59
|
+
<Button variant="destructive">
|
|
60
|
+
{#snippet children()}Delete{/snippet}
|
|
61
|
+
</Button>
|
|
62
|
+
|
|
63
|
+
<Button variant="outline">
|
|
64
|
+
{#snippet children()}Outline{/snippet}
|
|
65
|
+
</Button>
|
|
66
|
+
|
|
67
|
+
<Button variant="ghost">
|
|
68
|
+
{#snippet children()}Ghost{/snippet}
|
|
69
|
+
</Button>
|
|
70
|
+
|
|
71
|
+
<Button variant="link">
|
|
72
|
+
{#snippet children()}Link{/snippet}
|
|
73
|
+
</Button>
|
|
74
|
+
|
|
75
|
+
<!-- Different sizes -->
|
|
76
|
+
<Button size="sm">
|
|
77
|
+
{#snippet children()}Small{/snippet}
|
|
78
|
+
</Button>
|
|
79
|
+
|
|
80
|
+
<Button size="lg">
|
|
81
|
+
{#snippet children()}Large{/snippet}
|
|
82
|
+
</Button>
|
|
83
|
+
|
|
84
|
+
<!-- Icon button -->
|
|
85
|
+
<Button size="icon" variant="outline">
|
|
86
|
+
{#snippet children()}🔍{/snippet}
|
|
87
|
+
</Button>
|
|
88
|
+
|
|
89
|
+
<!-- Loading state -->
|
|
90
|
+
<Button isLoading={true}>
|
|
91
|
+
{#snippet children()}Loading...{/snippet}
|
|
92
|
+
</Button>
|
|
93
|
+
|
|
94
|
+
<!-- With adornments -->
|
|
95
|
+
<Button>
|
|
96
|
+
{#snippet startAdornment()}📧{/snippet}
|
|
97
|
+
{#snippet children()}Send Email{/snippet}
|
|
98
|
+
</Button>
|
|
99
|
+
|
|
100
|
+
<!-- Full width -->
|
|
101
|
+
<Button fullWidth={true}>
|
|
102
|
+
{#snippet children()}Full Width{/snippet}
|
|
103
|
+
</Button>
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## Styling
|
|
107
|
+
|
|
108
|
+
This package uses vanilla-extract for type-safe CSS-in-JS. The theme tokens are shared with `@max-ts/kit` package, ensuring consistent design across React and Svelte components.
|
|
109
|
+
|
|
110
|
+
### Theme tokens
|
|
111
|
+
|
|
112
|
+
The package includes theme tokens for:
|
|
113
|
+
- Colors (primary, secondary, error, success, warning, info, text, background)
|
|
114
|
+
- Spacing (1-20 scale)
|
|
115
|
+
- Font sizes (xs, sm, base, lg, xl, 2xl, 3xl, 4xl)
|
|
116
|
+
- Font weights (normal, medium, semibold, bold)
|
|
117
|
+
- Border radius (sm, md, lg)
|
|
118
|
+
- Elevation (shadows 1-6)
|
|
119
|
+
|
|
120
|
+
### Custom styling
|
|
121
|
+
|
|
122
|
+
You can override styles using CSS classes:
|
|
123
|
+
|
|
124
|
+
```svelte
|
|
125
|
+
<Button class="my-custom-button">
|
|
126
|
+
{#snippet children()}Custom{/snippet}
|
|
127
|
+
</Button>
|
|
128
|
+
|
|
129
|
+
<style>
|
|
130
|
+
:global(.my-custom-button) {
|
|
131
|
+
/* Your custom styles */
|
|
132
|
+
}
|
|
133
|
+
</style>
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
## Development
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
# Build the package
|
|
140
|
+
pnpm build
|
|
141
|
+
|
|
142
|
+
# Watch mode for development
|
|
143
|
+
pnpm dev
|
|
144
|
+
|
|
145
|
+
# Run Storybook
|
|
146
|
+
pnpm storybook
|
|
147
|
+
|
|
148
|
+
# Type checking
|
|
149
|
+
pnpm lint:types
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
## Architecture
|
|
153
|
+
|
|
154
|
+
- **Svelte 5**: Uses modern Svelte 5 syntax with runes and snippets
|
|
155
|
+
- **vanilla-extract**: Type-safe CSS-in-JS with zero runtime
|
|
156
|
+
- **Vite**: Fast build tool for library bundling
|
|
157
|
+
- **Native Svelte features**: Uses Svelte's `class:` directive instead of external class utilities
|
|
158
|
+
|
|
159
|
+
## License
|
|
160
|
+
|
|
161
|
+
MIT
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Content } from './Content.svelte';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Item } from './Item.svelte';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Trigger } from './Trigger.svelte';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
declare const Accordion: {
|
|
2
|
+
Trigger: import("svelte/legacy").LegacyComponentType;
|
|
3
|
+
Item: import("svelte/legacy").LegacyComponentType;
|
|
4
|
+
Content: import("svelte/legacy").LegacyComponentType;
|
|
5
|
+
Root: import("svelte/legacy").LegacyComponentType;
|
|
6
|
+
};
|
|
7
|
+
export { Accordion };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ButtonSize, ButtonVariant } from './types';
|
|
2
|
+
export declare const buttonVariants: Record<ButtonVariant, string>;
|
|
3
|
+
declare const _default: {
|
|
4
|
+
buttonSizes: Record<ButtonSize, string>;
|
|
5
|
+
buttonVariants: Record<ButtonVariant, string>;
|
|
6
|
+
fullWidth: string;
|
|
7
|
+
loading: string;
|
|
8
|
+
};
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { HTMLButtonAttributes } from 'svelte/elements';
|
|
2
|
+
export type ButtonVariant = 'default' | 'destructive' | 'outline' | 'ghost' | 'link';
|
|
3
|
+
export type ButtonSize = 'medium' | 'small' | 'large' | 'icon' | 'iconSmall';
|
|
4
|
+
export type ButtonProps = HTMLButtonAttributes & {
|
|
5
|
+
variant?: ButtonVariant;
|
|
6
|
+
loading?: boolean;
|
|
7
|
+
fullWidth?: boolean;
|
|
8
|
+
size?: ButtonSize;
|
|
9
|
+
label?: string;
|
|
10
|
+
href?: string;
|
|
11
|
+
ref?: HTMLElement | null;
|
|
12
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Caption } from './Caption.svelte';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Cell } from './Cell.svelte';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Day } from './Day.svelte';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Grid } from './Grid.svelte';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as GridBody } from './GridBody.svelte';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as GridHead } from './GridHead.svelte';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as GridRow } from './GridRow.svelte';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as HeadCell } from './HeadCell.svelte';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Header } from './Header.svelte';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Heading } from './Heading.svelte';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Month } from './Month.svelte';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as MonthSelect } from './MonthSelect.svelte';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Months } from './Months.svelte';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Nav } from './Nav.svelte';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as NextButton } from './NextButton.svelte';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as PrevButton } from './PrevButton.svelte';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as YearSelect } from './YearSelect.svelte';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Calendar } from './Calendar.svelte';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const colors: Record<"primary" | "secondary" | "inherit", string>;
|
|
2
|
+
declare const _default: {
|
|
3
|
+
root: string;
|
|
4
|
+
svg: string;
|
|
5
|
+
circle: string;
|
|
6
|
+
variants: Record<"indeterminate" | "determinate", string>;
|
|
7
|
+
colors: Record<"primary" | "secondary" | "inherit", string>;
|
|
8
|
+
};
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ROW_HEIGHT = 40;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
export type DataGridColumn<TRow> = {
|
|
3
|
+
title: string;
|
|
4
|
+
field?: keyof TRow;
|
|
5
|
+
width?: number | string;
|
|
6
|
+
align?: 'left' | 'center' | 'right' | 'justify';
|
|
7
|
+
isDisabled?: boolean;
|
|
8
|
+
color?: string;
|
|
9
|
+
headerCell?: Snippet<[
|
|
10
|
+
Omit<DataGridColumn<TRow>, 'headerCell' | 'cell' | 'format' | 'cellClassName' | 'cellColor'>
|
|
11
|
+
]>;
|
|
12
|
+
cell?: Snippet<[TRow, number]>;
|
|
13
|
+
format?: (row: TRow) => string | number | null | undefined;
|
|
14
|
+
cellClassName?: (row: TRow) => string;
|
|
15
|
+
cellColor?: (row: TRow) => string;
|
|
16
|
+
};
|
|
17
|
+
export type DataGridColumns<TRow> = DataGridColumn<TRow>[];
|
|
18
|
+
export type AlignVariant = 'left' | 'center' | 'right' | 'justify';
|
|
19
|
+
export type DataGridState = {
|
|
20
|
+
text: string;
|
|
21
|
+
imgSrc?: string;
|
|
22
|
+
imgAlt?: string;
|
|
23
|
+
actions?: Snippet;
|
|
24
|
+
errorList?: string[];
|
|
25
|
+
onRetry?: () => void;
|
|
26
|
+
};
|
|
27
|
+
export type DataGridProps<TRow> = {
|
|
28
|
+
rows: TRow[];
|
|
29
|
+
columns: DataGridColumn<TRow>[];
|
|
30
|
+
class?: string;
|
|
31
|
+
height?: string | number;
|
|
32
|
+
rowHeight?: number;
|
|
33
|
+
headerHeight?: number;
|
|
34
|
+
keyId: keyof TRow;
|
|
35
|
+
isLoading?: boolean;
|
|
36
|
+
isDisabled?: boolean;
|
|
37
|
+
isError?: boolean;
|
|
38
|
+
stickyHeader?: boolean;
|
|
39
|
+
emptyState?: DataGridState;
|
|
40
|
+
errorState?: DataGridState;
|
|
41
|
+
onRowClick?: (row: TRow) => void;
|
|
42
|
+
onRetry?: () => void;
|
|
43
|
+
title?: string;
|
|
44
|
+
footer?: Snippet<[]>;
|
|
45
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const wrapper: string;
|
|
2
|
+
export declare const alignments: Record<"left" | "right" | "center" | "justify", string>;
|
|
3
|
+
declare const _default: {
|
|
4
|
+
wrapper: string;
|
|
5
|
+
alignments: Record<"left" | "right" | "center" | "justify", string>;
|
|
6
|
+
};
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { DataGridColumn } from '../DataGrid/types';
|
|
2
|
+
export type DataGridSorting<TData> = {
|
|
3
|
+
key: keyof TData;
|
|
4
|
+
order: 'asc' | 'desc';
|
|
5
|
+
};
|
|
6
|
+
export type DataGridSortHeaderProps<TData> = {
|
|
7
|
+
column: DataGridColumn<TData>;
|
|
8
|
+
sorting: DataGridSorting<TData>;
|
|
9
|
+
setSorting: (sorting: DataGridSorting<TData>) => void;
|
|
10
|
+
class?: string;
|
|
11
|
+
};
|