tguikit 0.1.0 → 0.2.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 +1 -6
- package/dist/index.d.ts +111 -3
- package/dist/index.js +861 -496
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
React 19 component library for Telegram Mini Apps — a modern reimplementation of [`@telegram-apps/telegram-ui`](https://github.com/telegram-mini-apps-dev/TelegramUI).
|
|
4
4
|
|
|
5
|
-
**[Storybook →](https://alwaysgladtobethefirst.github.io/tgui/)**
|
|
6
|
-
|
|
7
5
|
> Pre-release. The API is still moving before `1.0`.
|
|
8
6
|
|
|
9
7
|
## Install
|
|
@@ -44,10 +42,7 @@ bun install
|
|
|
44
42
|
bun run storybook
|
|
45
43
|
```
|
|
46
44
|
|
|
47
|
-
Storybook is the workbench — every component has a story.
|
|
48
|
-
[alwaysgladtobethefirst.github.io/tgui](https://alwaysgladtobethefirst.github.io/tgui/).
|
|
49
|
-
|
|
50
|
-
See [`CONTRIBUTING.md`](./CONTRIBUTING.md).
|
|
45
|
+
Storybook is the workbench — every component has a story. See [`CONTRIBUTING.md`](./CONTRIBUTING.md).
|
|
51
46
|
|
|
52
47
|
## License
|
|
53
48
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { HTMLAttributes, Ref, ReactNode, AllHTMLAttributes, ElementType, InputHTMLAttributes, SelectHTMLAttributes, ButtonHTMLAttributes, TextareaHTMLAttributes } from 'react';
|
|
3
|
+
|
|
4
|
+
type AvatarSize = 20 | 24 | 28 | 40 | 48 | 96;
|
|
5
|
+
|
|
6
|
+
interface AvatarProps extends HTMLAttributes<HTMLSpanElement> {
|
|
7
|
+
ref?: Ref<HTMLSpanElement>;
|
|
8
|
+
size?: AvatarSize;
|
|
9
|
+
src?: string;
|
|
10
|
+
alt?: string;
|
|
11
|
+
acronym?: string;
|
|
12
|
+
fallbackIcon?: ReactNode;
|
|
13
|
+
}
|
|
14
|
+
declare function Avatar({ ref, size, src, alt, acronym, fallbackIcon, className, children, ...rest }: AvatarProps): react.JSX.Element;
|
|
15
|
+
declare namespace Avatar {
|
|
16
|
+
var displayName: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
type BadgeType = 'number' | 'dot';
|
|
20
|
+
type BadgeMode = 'primary' | 'critical' | 'secondary' | 'gray' | 'white';
|
|
21
|
+
|
|
22
|
+
interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {
|
|
23
|
+
ref?: Ref<HTMLSpanElement>;
|
|
24
|
+
type?: BadgeType;
|
|
25
|
+
mode?: BadgeMode;
|
|
26
|
+
large?: boolean;
|
|
27
|
+
children?: ReactNode;
|
|
28
|
+
}
|
|
29
|
+
declare function Badge({ ref, type, mode, large, className, children, ...rest }: BadgeProps): react.JSX.Element;
|
|
30
|
+
declare namespace Badge {
|
|
31
|
+
var displayName: string;
|
|
32
|
+
}
|
|
3
33
|
|
|
4
34
|
type TguiPlatform = 'ios' | 'base';
|
|
5
35
|
type Appearance = 'light' | 'dark';
|
|
@@ -106,6 +136,18 @@ declare namespace Checkbox {
|
|
|
106
136
|
var displayName: string;
|
|
107
137
|
}
|
|
108
138
|
|
|
139
|
+
type CircularProgressSize = 's' | 'm' | 'l';
|
|
140
|
+
|
|
141
|
+
interface CircularProgressProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'size'> {
|
|
142
|
+
ref?: Ref<HTMLSpanElement>;
|
|
143
|
+
value?: number;
|
|
144
|
+
size?: CircularProgressSize;
|
|
145
|
+
}
|
|
146
|
+
declare function CircularProgress({ ref, value, size, className, ...rest }: CircularProgressProps): react.JSX.Element;
|
|
147
|
+
declare namespace CircularProgress {
|
|
148
|
+
var displayName: string;
|
|
149
|
+
}
|
|
150
|
+
|
|
109
151
|
interface DividerProps extends HTMLAttributes<HTMLHRElement> {
|
|
110
152
|
ref?: Ref<HTMLHRElement>;
|
|
111
153
|
}
|
|
@@ -122,6 +164,21 @@ declare namespace Headline {
|
|
|
122
164
|
var displayName: string;
|
|
123
165
|
}
|
|
124
166
|
|
|
167
|
+
type IconButtonMode = 'bezeled' | 'plain' | 'gray' | 'outline';
|
|
168
|
+
type IconButtonSize = 's' | 'm' | 'l';
|
|
169
|
+
|
|
170
|
+
interface IconButtonProps extends Omit<AllHTMLAttributes<HTMLElement>, 'size'> {
|
|
171
|
+
ref?: Ref<HTMLElement>;
|
|
172
|
+
Component?: ElementType;
|
|
173
|
+
mode?: IconButtonMode;
|
|
174
|
+
size?: IconButtonSize;
|
|
175
|
+
circle?: boolean;
|
|
176
|
+
}
|
|
177
|
+
declare function IconButton({ ref, Component, mode, size, circle, type, className, children, ...rest }: IconButtonProps): react.JSX.Element;
|
|
178
|
+
declare namespace IconButton {
|
|
179
|
+
var displayName: string;
|
|
180
|
+
}
|
|
181
|
+
|
|
125
182
|
type InputStatus = 'default' | 'error' | 'focused';
|
|
126
183
|
interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
127
184
|
ref?: Ref<HTMLInputElement>;
|
|
@@ -164,6 +221,23 @@ declare namespace Placeholder {
|
|
|
164
221
|
var displayName: string;
|
|
165
222
|
}
|
|
166
223
|
|
|
224
|
+
interface ProgressProps extends HTMLAttributes<HTMLDivElement> {
|
|
225
|
+
ref?: Ref<HTMLDivElement>;
|
|
226
|
+
value?: number;
|
|
227
|
+
}
|
|
228
|
+
declare function Progress({ ref, value, className, ...rest }: ProgressProps): react.JSX.Element;
|
|
229
|
+
declare namespace Progress {
|
|
230
|
+
var displayName: string;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
interface RadioProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
234
|
+
ref?: Ref<HTMLInputElement>;
|
|
235
|
+
}
|
|
236
|
+
declare function Radio({ ref, disabled, className, style, ...rest }: RadioProps): react.JSX.Element;
|
|
237
|
+
declare namespace Radio {
|
|
238
|
+
var displayName: string;
|
|
239
|
+
}
|
|
240
|
+
|
|
167
241
|
interface SectionFooterProps extends HTMLAttributes<HTMLElement> {
|
|
168
242
|
ref?: Ref<HTMLElement>;
|
|
169
243
|
centered?: boolean;
|
|
@@ -204,6 +278,27 @@ declare namespace Select {
|
|
|
204
278
|
var displayName: string;
|
|
205
279
|
}
|
|
206
280
|
|
|
281
|
+
interface SkeletonProps extends HTMLAttributes<HTMLDivElement> {
|
|
282
|
+
ref?: Ref<HTMLDivElement>;
|
|
283
|
+
visible?: boolean;
|
|
284
|
+
children?: ReactNode;
|
|
285
|
+
}
|
|
286
|
+
declare function Skeleton({ ref, visible, className, children, ...rest }: SkeletonProps): react.JSX.Element;
|
|
287
|
+
declare namespace Skeleton {
|
|
288
|
+
var displayName: string;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
type SpinnerSize = 's' | 'm' | 'l';
|
|
292
|
+
|
|
293
|
+
interface SpinnerProps extends HTMLAttributes<HTMLSpanElement> {
|
|
294
|
+
ref?: Ref<HTMLSpanElement>;
|
|
295
|
+
size?: SpinnerSize;
|
|
296
|
+
}
|
|
297
|
+
declare function Spinner({ ref, size, className, ...rest }: SpinnerProps): react.JSX.Element;
|
|
298
|
+
declare namespace Spinner {
|
|
299
|
+
var displayName: string;
|
|
300
|
+
}
|
|
301
|
+
|
|
207
302
|
type SubheadlineLevel = '1' | '2';
|
|
208
303
|
|
|
209
304
|
interface SubheadlineProps extends TypographyProps {
|
|
@@ -251,6 +346,19 @@ declare namespace Text {
|
|
|
251
346
|
var displayName: string;
|
|
252
347
|
}
|
|
253
348
|
|
|
349
|
+
type TextareaStatus = 'default' | 'error' | 'focused';
|
|
350
|
+
interface TextareaProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
351
|
+
ref?: Ref<HTMLTextAreaElement>;
|
|
352
|
+
header?: ReactNode;
|
|
353
|
+
status?: TextareaStatus;
|
|
354
|
+
autoGrow?: boolean;
|
|
355
|
+
maxRows?: number;
|
|
356
|
+
}
|
|
357
|
+
declare function Textarea({ ref, header, status, autoGrow, maxRows, rows, disabled, className, value, defaultValue, onFocus, onBlur, onChange, ...rest }: TextareaProps): react.JSX.Element;
|
|
358
|
+
declare namespace Textarea {
|
|
359
|
+
var displayName: string;
|
|
360
|
+
}
|
|
361
|
+
|
|
254
362
|
interface TguiProviderProps extends HTMLAttributes<HTMLDivElement> {
|
|
255
363
|
ref?: Ref<HTMLDivElement>;
|
|
256
364
|
platform?: TguiPlatform;
|
|
@@ -275,5 +383,5 @@ declare namespace Title {
|
|
|
275
383
|
var displayName: string;
|
|
276
384
|
}
|
|
277
385
|
|
|
278
|
-
export { Button, Caption, Card, CardCell, Cell, Checkbox, Divider, Headline, Input, LargeTitle, List, Placeholder, Section, SectionFooter, SectionHeader, Select, Subheadline, Switch, TabBar, TabBarItem, Tappable, Text, TguiProvider, Title, Typography, useTgui };
|
|
279
|
-
export type { ButtonMode, ButtonProps, ButtonSize, CaptionProps, CardCellProps, CardProps, CardType, CellProps, CheckboxProps, DividerProps, HeadlineProps, InputProps, InputStatus, LargeTitleProps, ListProps, PlaceholderProps, SectionFooterProps, SectionHeaderProps, SectionProps, SelectProps, SubheadlineProps, SwitchProps, TabBarItemProps, TabBarProps, TappableProps, TextProps, TguiProviderProps, TitleProps, TypographyProps };
|
|
386
|
+
export { Avatar, Badge, Button, Caption, Card, CardCell, Cell, Checkbox, CircularProgress, Divider, Headline, IconButton, Input, LargeTitle, List, Placeholder, Progress, Radio, Section, SectionFooter, SectionHeader, Select, Skeleton, Spinner, Subheadline, Switch, TabBar, TabBarItem, Tappable, Text, Textarea, TguiProvider, Title, Typography, useTgui };
|
|
387
|
+
export type { AvatarProps, AvatarSize, BadgeMode, BadgeProps, BadgeType, ButtonMode, ButtonProps, ButtonSize, CaptionProps, CardCellProps, CardProps, CardType, CellProps, CheckboxProps, CircularProgressProps, CircularProgressSize, DividerProps, HeadlineProps, IconButtonMode, IconButtonProps, IconButtonSize, InputProps, InputStatus, LargeTitleProps, ListProps, PlaceholderProps, ProgressProps, RadioProps, SectionFooterProps, SectionHeaderProps, SectionProps, SelectProps, SkeletonProps, SpinnerProps, SpinnerSize, SubheadlineProps, SwitchProps, TabBarItemProps, TabBarProps, TappableProps, TextProps, TextareaProps, TextareaStatus, TguiProviderProps, TitleProps, TypographyProps };
|