tguikit 0.4.0 → 0.5.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/MIGRATION.md +67 -0
- package/README.md +8 -3
- package/dist/index.d.ts +219 -36
- package/dist/index.js +3088 -1577
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +10 -3
package/MIGRATION.md
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# Migrating from 0.4 to 0.5
|
|
2
|
+
|
|
3
|
+
0.5 rebuilds the token system on Apple's HIG and standardises the component API. It is a hard break — no compatibility layer. This guide lists every change that can affect your code.
|
|
4
|
+
|
|
5
|
+
## Tokens
|
|
6
|
+
|
|
7
|
+
Every `--tgui--*_color` / `--tgui--*_*` custom property was renamed to a hyphenated, HIG-semantic name. If you read `--tgui--*` variables in your own CSS or inline styles, remap them:
|
|
8
|
+
|
|
9
|
+
| 0.4 | 0.5 |
|
|
10
|
+
| --- | --- |
|
|
11
|
+
| `--tgui--bg_color` | `--tgui--bg` |
|
|
12
|
+
| `--tgui--secondary_bg_color` | `--tgui--bg-secondary` |
|
|
13
|
+
| `--tgui--tertiary_bg_color` | `--tgui--fill` (no direct equivalent) |
|
|
14
|
+
| `--tgui--section_bg_color` / `--tgui--card_bg_color` / `--tgui--header_bg_color` | `--tgui--bg-elevated` |
|
|
15
|
+
| `--tgui--text_color` | `--tgui--label` |
|
|
16
|
+
| `--tgui--hint_color` | `--tgui--label-secondary` |
|
|
17
|
+
| `--tgui--secondary_hint_color` / `--tgui--subtitle_text_color` | `--tgui--label-tertiary` |
|
|
18
|
+
| `--tgui--section_header_text_color` | `--tgui--label-secondary` |
|
|
19
|
+
| `--tgui--link_color` | `--tgui--link` |
|
|
20
|
+
| `--tgui--button_color` | `--tgui--accent` |
|
|
21
|
+
| `--tgui--button_text_color` / `--tgui--accent_text_color` | `--tgui--accent-label` |
|
|
22
|
+
| `--tgui--destructive_text_color` | `--tgui--destructive` |
|
|
23
|
+
| `--tgui--destructive_background` | `--tgui--destructive` |
|
|
24
|
+
| `--tgui--outline` / `--tgui--divider` | `--tgui--separator` |
|
|
25
|
+
| `--tgui--border--width` | `--tgui--hairline` |
|
|
26
|
+
| `--tgui--green` | `--tgui--success` |
|
|
27
|
+
| `--tgui--secondary_fill` | `--tgui--fill-secondary` |
|
|
28
|
+
| `--tgui--field_radius` / `--tgui--field_gap` / `--tgui--field_padding_x` … | `--tgui--field-radius` / `--tgui--field-gap` / `--tgui--field-padding-x` … |
|
|
29
|
+
| `--tgui--z-index--overlay` / `--z-index--simple` / `--z-index--skeleton` | `--tgui--z-overlay` / `--tgui--z-raised` / `--tgui--z-base` |
|
|
30
|
+
| `--tgui--headline--font_size`, `--tgui--text--line_height`, `--tgui--title`, `--tgui--caption`, … (the per-style type tokens) | removed — the type scale now lives inside the typography components; use `<Headline>`, `<Text>`, `<Caption>` etc. rather than the raw values |
|
|
31
|
+
| `--tgui--segmented_control_active_bg` | removed — `SegmentedControl` owns its pill |
|
|
32
|
+
| `--tgui--skeleton`, `--tgui--*_code_highlight`, `--tgui--surface_*`, `--tgui--tooltip_background_dark`, `--tgui--toast_accent_color`, `--tgui--plain_*` | removed |
|
|
33
|
+
|
|
34
|
+
New in 0.5: `--tgui--accent-strong` / `--tgui--link-strong` / `--tgui--destructive-strong` (WCAG-AA-safe variants of the accent hues), `--tgui--focus-ring` / `--tgui--focus-ring-offset` / `--tgui--focus-ring-shadow`, `--tgui--bg-elevated`, the `--tgui--fill-*` ladder, `--tgui--material-*`, `--tgui--surface-bg` (one background for every raised surface — cards, sections, tab bar, and every floating overlay) + `--tgui--overlay-shadow` (the floating elevation, worn only by overlays), `--tgui--radius` + derivatives, motion duration/easing tokens.
|
|
35
|
+
|
|
36
|
+
### `--tgui--focus-ring` changed shape
|
|
37
|
+
|
|
38
|
+
It was a `box-shadow` value; it is now an `outline` value (`2px solid var(--tgui--accent)`). If you applied it as `box-shadow: var(--tgui--focus-ring)`, switch to `outline: var(--tgui--focus-ring); outline-offset: var(--tgui--focus-ring-offset)`.
|
|
39
|
+
|
|
40
|
+
## Component API
|
|
41
|
+
|
|
42
|
+
| Component | 0.4 | 0.5 |
|
|
43
|
+
| --- | --- | --- |
|
|
44
|
+
| `Accordion`, `Slider`, `PinInput`, `Rating`, `Stepper` | `onChange` | `onValueChange` |
|
|
45
|
+
| `Stepper` | `value` + `onChange` required | `value` / `defaultValue` / `onValueChange` all optional (works uncontrolled) |
|
|
46
|
+
| `SegmentedControl` | manual `<SegmentedControlItem selected onClick>` per item | `<SegmentedControl value onValueChange>` + `<SegmentedControlItem value="…">` (the old per-item props still work) |
|
|
47
|
+
| `Sheet` | `onClose: () => void` | `onOpenChange: (open: boolean) => void` |
|
|
48
|
+
| `Spoiler` | `revealed` / `defaultRevealed` / `onRevealedChange` | `open` / `defaultOpen` / `onOpenChange` |
|
|
49
|
+
| `Tooltip` | `open` / `onOpenChange` | unchanged, gains `defaultOpen` |
|
|
50
|
+
|
|
51
|
+
Every stateful component now follows one of two prop triads: `value` / `defaultValue` / `onValueChange`, or `open` / `defaultOpen` / `onOpenChange`.
|
|
52
|
+
|
|
53
|
+
## Styling hooks
|
|
54
|
+
|
|
55
|
+
Every component now emits `data-slot="<component>"` on its root and `data-slot="<component>-<part>"` on sub-parts. Visual state is exposed via `data-state`, `data-disabled`, `data-loading`, `data-selected`, `aria-*` — not internal class names. Prefer these over targeting hashed CSS-module classes.
|
|
56
|
+
|
|
57
|
+
## Semantics
|
|
58
|
+
|
|
59
|
+
- `Button`, `Cell`, `SectionFooter` labels render as `<span>`, not `<h6>`.
|
|
60
|
+
- `FormField` / `Select` headers now sit inside the `<label>` (visually hidden on iOS) so they always name the control.
|
|
61
|
+
- `Progress`, `CircularProgress`, `Steps` carry a default `aria-label` on the `progressbar` role — pass `aria-label` to override.
|
|
62
|
+
- `HorizontalScroll` scroll region is keyboard-focusable; name it with the `scrollLabel` prop.
|
|
63
|
+
|
|
64
|
+
## New
|
|
65
|
+
|
|
66
|
+
- `Popover` (`Popover` / `Popover.Trigger` / `Popover.Content`).
|
|
67
|
+
- `Footnote`, `Callout` typography components.
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# tguikit
|
|
2
2
|
|
|
3
|
-
React 19 component library for Telegram Mini Apps
|
|
3
|
+
React 19 component library for Telegram Mini Apps. Telegram's iOS design language, bound to the user's theme, SSR-safe, one stylesheet.
|
|
4
4
|
|
|
5
5
|
> Pre-release. The API is still moving before `1.0`.
|
|
6
6
|
|
|
@@ -31,9 +31,14 @@ export function App() {
|
|
|
31
31
|
|
|
32
32
|
`TguiProvider` supplies the theme and platform. It follows the Telegram / system light–dark theme automatically; pass `appearance` or `platform` to pin them.
|
|
33
33
|
|
|
34
|
-
##
|
|
34
|
+
## Principles
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
- `ref` is a plain prop on every component — React 19 baseline, no `forwardRef`.
|
|
37
|
+
- Consumer `className` and `style` always win; components merge, never replace.
|
|
38
|
+
- Every colour is a `--tgui--*` token bound to a `--tg-theme-*` variable — components follow the user's Telegram theme and custom themes.
|
|
39
|
+
- Touch-safe: `:hover` is gated behind `(hover: hover)`.
|
|
40
|
+
- SSR-safe: platform and theme detection is `typeof window` guarded, tokens scoped to the provider — no hydration flash.
|
|
41
|
+
- One stylesheet, React externalised as a peer, `publint` + `arethetypeswrong` clean.
|
|
37
42
|
|
|
38
43
|
## Develop
|
|
39
44
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { HTMLAttributes, Ref, ReactNode, BlockquoteHTMLAttributes, AllHTMLAttributes, ElementType, InputHTMLAttributes,
|
|
2
|
+
import { HTMLAttributes, Ref, ReactNode, BlockquoteHTMLAttributes, AllHTMLAttributes, ElementType, InputHTMLAttributes, ButtonHTMLAttributes, ReactElement, ImgHTMLAttributes, AnchorHTMLAttributes, SelectHTMLAttributes, TextareaHTMLAttributes } from 'react';
|
|
3
3
|
|
|
4
4
|
interface AccordionProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {
|
|
5
5
|
ref?: Ref<HTMLDivElement>;
|
|
6
6
|
multiple?: boolean;
|
|
7
7
|
value?: string | string[];
|
|
8
8
|
defaultValue?: string | string[];
|
|
9
|
-
|
|
9
|
+
onValueChange?: (value: string[]) => void;
|
|
10
10
|
}
|
|
11
|
-
declare function Accordion({ ref, multiple, value: valueProp, defaultValue,
|
|
11
|
+
declare function Accordion({ ref, multiple, value: valueProp, defaultValue, onValueChange, className, children, ...rest }: AccordionProps): react.JSX.Element;
|
|
12
12
|
declare namespace Accordion {
|
|
13
13
|
var displayName: string;
|
|
14
14
|
}
|
|
@@ -112,6 +112,7 @@ interface TguiContextValue {
|
|
|
112
112
|
platform: TguiPlatform;
|
|
113
113
|
appearance: Appearance;
|
|
114
114
|
portalContainer: HTMLElement | null;
|
|
115
|
+
haptics: boolean;
|
|
115
116
|
}
|
|
116
117
|
|
|
117
118
|
type ButtonMode = 'filled' | 'bezeled' | 'plain' | 'gray' | 'outline' | 'white';
|
|
@@ -143,6 +144,14 @@ declare namespace Typography {
|
|
|
143
144
|
var displayName: string;
|
|
144
145
|
}
|
|
145
146
|
|
|
147
|
+
interface CalloutProps extends TypographyProps {
|
|
148
|
+
ref?: Ref<HTMLElement>;
|
|
149
|
+
}
|
|
150
|
+
declare function Callout({ ref, className, Component, ...rest }: CalloutProps): react.JSX.Element;
|
|
151
|
+
declare namespace Callout {
|
|
152
|
+
var displayName: string;
|
|
153
|
+
}
|
|
154
|
+
|
|
146
155
|
type CaptionLevel = '1' | '2';
|
|
147
156
|
|
|
148
157
|
interface CaptionProps extends TypographyProps {
|
|
@@ -159,7 +168,7 @@ type CardType = 'plain' | 'ambient';
|
|
|
159
168
|
interface TappableProps extends AllHTMLAttributes<HTMLElement> {
|
|
160
169
|
ref?: Ref<HTMLElement>;
|
|
161
170
|
Component?: ElementType;
|
|
162
|
-
interactiveAnimation?: 'background' | 'opacity';
|
|
171
|
+
interactiveAnimation?: 'background' | 'opacity' | 'none';
|
|
163
172
|
}
|
|
164
173
|
declare function Tappable({ ref, Component, interactiveAnimation, className, children, onPointerDown, onPointerCancel, ...rest }: TappableProps): react.JSX.Element;
|
|
165
174
|
declare namespace Tappable {
|
|
@@ -206,7 +215,7 @@ interface CheckboxProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
|
206
215
|
ref?: Ref<HTMLInputElement>;
|
|
207
216
|
indeterminate?: boolean;
|
|
208
217
|
}
|
|
209
|
-
declare function Checkbox({ ref, indeterminate, disabled, className, style, ...rest }: CheckboxProps): react.JSX.Element;
|
|
218
|
+
declare function Checkbox({ ref, indeterminate, disabled, className, style, onChange, ...rest }: CheckboxProps): react.JSX.Element;
|
|
210
219
|
declare namespace Checkbox {
|
|
211
220
|
var displayName: string;
|
|
212
221
|
}
|
|
@@ -235,11 +244,31 @@ interface CircularProgressProps extends Omit<HTMLAttributes<HTMLSpanElement>, 's
|
|
|
235
244
|
value?: number;
|
|
236
245
|
size?: CircularProgressSize;
|
|
237
246
|
}
|
|
238
|
-
declare function CircularProgress({ ref, value, size, className, ...rest }: CircularProgressProps): react.JSX.Element;
|
|
247
|
+
declare function CircularProgress({ ref, value, size, className, 'aria-label': ariaLabel, ...rest }: CircularProgressProps): react.JSX.Element;
|
|
239
248
|
declare namespace CircularProgress {
|
|
240
249
|
var displayName: string;
|
|
241
250
|
}
|
|
242
251
|
|
|
252
|
+
type DialogActionRole = 'default' | 'cancel' | 'destructive';
|
|
253
|
+
interface DialogAction {
|
|
254
|
+
label: ReactNode;
|
|
255
|
+
onClick?: () => void;
|
|
256
|
+
role?: DialogActionRole;
|
|
257
|
+
}
|
|
258
|
+
interface DialogProps {
|
|
259
|
+
open: boolean;
|
|
260
|
+
onOpenChange: (open: boolean) => void;
|
|
261
|
+
title: ReactNode;
|
|
262
|
+
description?: ReactNode;
|
|
263
|
+
actions: DialogAction[];
|
|
264
|
+
cancelLabel?: string;
|
|
265
|
+
container?: Element | DocumentFragment | null;
|
|
266
|
+
}
|
|
267
|
+
declare function Dialog({ open, onOpenChange, title, description, actions, cancelLabel, container, }: DialogProps): react.JSX.Element | null;
|
|
268
|
+
declare namespace Dialog {
|
|
269
|
+
var displayName: string;
|
|
270
|
+
}
|
|
271
|
+
|
|
243
272
|
interface DividerProps extends HTMLAttributes<HTMLHRElement> {
|
|
244
273
|
ref?: Ref<HTMLHRElement>;
|
|
245
274
|
}
|
|
@@ -248,6 +277,107 @@ declare namespace Divider {
|
|
|
248
277
|
var displayName: string;
|
|
249
278
|
}
|
|
250
279
|
|
|
280
|
+
interface DropdownMenuCheckboxItemProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'onChange'> {
|
|
281
|
+
ref?: Ref<HTMLButtonElement>;
|
|
282
|
+
checked?: boolean;
|
|
283
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
284
|
+
}
|
|
285
|
+
declare function DropdownMenuCheckboxItem({ ref, checked, onCheckedChange, disabled, className, children, onClick, ...rest }: DropdownMenuCheckboxItemProps): react.JSX.Element;
|
|
286
|
+
declare namespace DropdownMenuCheckboxItem {
|
|
287
|
+
var displayName: string;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
type FloatingSide = 'top' | 'bottom' | 'left' | 'right';
|
|
291
|
+
type FloatingPlacement = FloatingSide | `${FloatingSide}-start` | `${FloatingSide}-end`;
|
|
292
|
+
|
|
293
|
+
interface DropdownMenuContentProps extends Omit<HTMLAttributes<HTMLDivElement>, 'className'> {
|
|
294
|
+
ref?: Ref<HTMLDivElement>;
|
|
295
|
+
placement?: FloatingPlacement;
|
|
296
|
+
gap?: number;
|
|
297
|
+
container?: Element | DocumentFragment | null;
|
|
298
|
+
className?: string;
|
|
299
|
+
}
|
|
300
|
+
declare function DropdownMenuContent({ ref, placement, gap, container, className, children, onKeyDown, ...rest }: DropdownMenuContentProps): react.JSX.Element | null;
|
|
301
|
+
declare namespace DropdownMenuContent {
|
|
302
|
+
var displayName: string;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
interface DropdownMenuItemProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'onSelect'> {
|
|
306
|
+
ref?: Ref<HTMLButtonElement>;
|
|
307
|
+
icon?: ReactNode;
|
|
308
|
+
destructive?: boolean;
|
|
309
|
+
onSelect?: (event: {
|
|
310
|
+
preventDefault: () => void;
|
|
311
|
+
}) => void;
|
|
312
|
+
}
|
|
313
|
+
declare function DropdownMenuItem({ ref, icon, destructive, disabled, className, children, onSelect, onClick, ...rest }: DropdownMenuItemProps): react.JSX.Element;
|
|
314
|
+
declare namespace DropdownMenuItem {
|
|
315
|
+
var displayName: string;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
interface DropdownMenuLabelProps extends HTMLAttributes<HTMLDivElement> {
|
|
319
|
+
ref?: Ref<HTMLDivElement>;
|
|
320
|
+
}
|
|
321
|
+
declare function DropdownMenuLabel({ ref, className, ...rest }: DropdownMenuLabelProps): react.JSX.Element;
|
|
322
|
+
declare namespace DropdownMenuLabel {
|
|
323
|
+
var displayName: string;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
interface DropdownMenuRadioGroupProps {
|
|
327
|
+
value?: string;
|
|
328
|
+
defaultValue?: string;
|
|
329
|
+
onValueChange?: (value: string) => void;
|
|
330
|
+
children: ReactNode;
|
|
331
|
+
}
|
|
332
|
+
declare function DropdownMenuRadioGroup({ value: valueProp, defaultValue, onValueChange, children, }: DropdownMenuRadioGroupProps): react.JSX.Element;
|
|
333
|
+
declare namespace DropdownMenuRadioGroup {
|
|
334
|
+
var displayName: string;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
interface DropdownMenuRadioItemProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'value'> {
|
|
338
|
+
ref?: Ref<HTMLButtonElement>;
|
|
339
|
+
value: string;
|
|
340
|
+
}
|
|
341
|
+
declare function DropdownMenuRadioItem({ ref, value, disabled, className, children, onClick, ...rest }: DropdownMenuRadioItemProps): react.JSX.Element;
|
|
342
|
+
declare namespace DropdownMenuRadioItem {
|
|
343
|
+
var displayName: string;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
interface DropdownMenuSeparatorProps extends HTMLAttributes<HTMLHRElement> {
|
|
347
|
+
ref?: Ref<HTMLHRElement>;
|
|
348
|
+
}
|
|
349
|
+
declare function DropdownMenuSeparator({ ref, className, ...rest }: DropdownMenuSeparatorProps): react.JSX.Element;
|
|
350
|
+
declare namespace DropdownMenuSeparator {
|
|
351
|
+
var displayName: string;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
interface DropdownMenuTriggerProps {
|
|
355
|
+
children: ReactElement;
|
|
356
|
+
}
|
|
357
|
+
declare function DropdownMenuTrigger({ children }: DropdownMenuTriggerProps): ReactElement<unknown, string | react.JSXElementConstructor<any>>;
|
|
358
|
+
declare namespace DropdownMenuTrigger {
|
|
359
|
+
var displayName: string;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
interface DropdownMenuProps {
|
|
363
|
+
open?: boolean;
|
|
364
|
+
defaultOpen?: boolean;
|
|
365
|
+
onOpenChange?: (open: boolean) => void;
|
|
366
|
+
children: ReactNode;
|
|
367
|
+
}
|
|
368
|
+
declare function DropdownMenu({ open: openProp, defaultOpen, onOpenChange, children, }: DropdownMenuProps): react.JSX.Element;
|
|
369
|
+
declare namespace DropdownMenu {
|
|
370
|
+
var displayName: string;
|
|
371
|
+
var Trigger: typeof DropdownMenuTrigger;
|
|
372
|
+
var Content: typeof DropdownMenuContent;
|
|
373
|
+
var Item: typeof DropdownMenuItem;
|
|
374
|
+
var CheckboxItem: typeof DropdownMenuCheckboxItem;
|
|
375
|
+
var RadioGroup: typeof DropdownMenuRadioGroup;
|
|
376
|
+
var RadioItem: typeof DropdownMenuRadioItem;
|
|
377
|
+
var Separator: typeof DropdownMenuSeparator;
|
|
378
|
+
var Label: typeof DropdownMenuLabel;
|
|
379
|
+
}
|
|
380
|
+
|
|
251
381
|
interface FixedLayoutProps extends HTMLAttributes<HTMLDivElement> {
|
|
252
382
|
ref?: Ref<HTMLDivElement>;
|
|
253
383
|
vertical?: 'top' | 'bottom';
|
|
@@ -257,6 +387,14 @@ declare namespace FixedLayout {
|
|
|
257
387
|
var displayName: string;
|
|
258
388
|
}
|
|
259
389
|
|
|
390
|
+
interface FootnoteProps extends TypographyProps {
|
|
391
|
+
ref?: Ref<HTMLElement>;
|
|
392
|
+
}
|
|
393
|
+
declare function Footnote({ ref, className, Component, ...rest }: FootnoteProps): react.JSX.Element;
|
|
394
|
+
declare namespace Footnote {
|
|
395
|
+
var displayName: string;
|
|
396
|
+
}
|
|
397
|
+
|
|
260
398
|
interface HeadlineProps extends TypographyProps {
|
|
261
399
|
ref?: Ref<HTMLElement>;
|
|
262
400
|
}
|
|
@@ -269,8 +407,9 @@ interface HorizontalScrollProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
269
407
|
ref?: Ref<HTMLDivElement>;
|
|
270
408
|
snap?: boolean;
|
|
271
409
|
fade?: boolean;
|
|
410
|
+
scrollLabel?: string;
|
|
272
411
|
}
|
|
273
|
-
declare function HorizontalScroll({ ref, snap, fade, className, children, ...rest }: HorizontalScrollProps): react.JSX.Element;
|
|
412
|
+
declare function HorizontalScroll({ ref, snap, fade, scrollLabel, className, children, ...rest }: HorizontalScrollProps): react.JSX.Element;
|
|
274
413
|
declare namespace HorizontalScroll {
|
|
275
414
|
var displayName: string;
|
|
276
415
|
}
|
|
@@ -396,7 +535,7 @@ interface PinInputProps {
|
|
|
396
535
|
length?: number;
|
|
397
536
|
value?: string;
|
|
398
537
|
defaultValue?: string;
|
|
399
|
-
|
|
538
|
+
onValueChange?: (value: string) => void;
|
|
400
539
|
onComplete?: (value: string) => void;
|
|
401
540
|
type?: 'numeric' | 'alphanumeric';
|
|
402
541
|
mask?: boolean;
|
|
@@ -406,7 +545,7 @@ interface PinInputProps {
|
|
|
406
545
|
'aria-label'?: string;
|
|
407
546
|
className?: string;
|
|
408
547
|
}
|
|
409
|
-
declare function PinInput({ ref, length, value: valueProp, defaultValue,
|
|
548
|
+
declare function PinInput({ ref, length, value: valueProp, defaultValue, onValueChange, onComplete, type, mask, disabled, invalid, name, 'aria-label': ariaLabel, className, }: PinInputProps): react.JSX.Element;
|
|
410
549
|
declare namespace PinInput {
|
|
411
550
|
var displayName: string;
|
|
412
551
|
}
|
|
@@ -423,6 +562,39 @@ declare namespace Placeholder {
|
|
|
423
562
|
var displayName: string;
|
|
424
563
|
}
|
|
425
564
|
|
|
565
|
+
interface PopoverContentProps extends Omit<HTMLAttributes<HTMLDivElement>, 'className'> {
|
|
566
|
+
ref?: Ref<HTMLDivElement>;
|
|
567
|
+
placement?: FloatingPlacement;
|
|
568
|
+
gap?: number;
|
|
569
|
+
container?: Element | DocumentFragment | null;
|
|
570
|
+
className?: string;
|
|
571
|
+
}
|
|
572
|
+
declare function PopoverContent({ ref, placement, gap, container, className, children, ...rest }: PopoverContentProps): react.JSX.Element;
|
|
573
|
+
declare namespace PopoverContent {
|
|
574
|
+
var displayName: string;
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
interface PopoverTriggerProps {
|
|
578
|
+
children: ReactElement;
|
|
579
|
+
}
|
|
580
|
+
declare function PopoverTrigger({ children }: PopoverTriggerProps): ReactElement<Record<string, unknown>, string | react.JSXElementConstructor<any>>;
|
|
581
|
+
declare namespace PopoverTrigger {
|
|
582
|
+
var displayName: string;
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
interface PopoverProps {
|
|
586
|
+
open?: boolean;
|
|
587
|
+
defaultOpen?: boolean;
|
|
588
|
+
onOpenChange?: (open: boolean) => void;
|
|
589
|
+
children: ReactNode;
|
|
590
|
+
}
|
|
591
|
+
declare function Popover({ open: openProp, defaultOpen, onOpenChange, children, }: PopoverProps): react.JSX.Element;
|
|
592
|
+
declare namespace Popover {
|
|
593
|
+
var displayName: string;
|
|
594
|
+
var Trigger: typeof PopoverTrigger;
|
|
595
|
+
var Content: typeof PopoverContent;
|
|
596
|
+
}
|
|
597
|
+
|
|
426
598
|
interface PortalProps {
|
|
427
599
|
children?: ReactNode;
|
|
428
600
|
container?: Element | DocumentFragment | null;
|
|
@@ -436,7 +608,7 @@ interface ProgressProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
436
608
|
ref?: Ref<HTMLDivElement>;
|
|
437
609
|
value?: number;
|
|
438
610
|
}
|
|
439
|
-
declare function Progress({ ref, value, className, ...rest }: ProgressProps): react.JSX.Element;
|
|
611
|
+
declare function Progress({ ref, value, className, 'aria-label': ariaLabel, ...rest }: ProgressProps): react.JSX.Element;
|
|
440
612
|
declare namespace Progress {
|
|
441
613
|
var displayName: string;
|
|
442
614
|
}
|
|
@@ -444,7 +616,7 @@ declare namespace Progress {
|
|
|
444
616
|
interface RadioProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
445
617
|
ref?: Ref<HTMLInputElement>;
|
|
446
618
|
}
|
|
447
|
-
declare function Radio({ ref, disabled, className, style, ...rest }: RadioProps): react.JSX.Element;
|
|
619
|
+
declare function Radio({ ref, disabled, className, style, onChange, ...rest }: RadioProps): react.JSX.Element;
|
|
448
620
|
declare namespace Radio {
|
|
449
621
|
var displayName: string;
|
|
450
622
|
}
|
|
@@ -453,7 +625,7 @@ interface RatingProps {
|
|
|
453
625
|
ref?: Ref<HTMLDivElement>;
|
|
454
626
|
value?: number;
|
|
455
627
|
defaultValue?: number;
|
|
456
|
-
|
|
628
|
+
onValueChange?: (value: number) => void;
|
|
457
629
|
count?: number;
|
|
458
630
|
readOnly?: boolean;
|
|
459
631
|
disabled?: boolean;
|
|
@@ -462,7 +634,7 @@ interface RatingProps {
|
|
|
462
634
|
'aria-label'?: string;
|
|
463
635
|
className?: string;
|
|
464
636
|
}
|
|
465
|
-
declare function Rating({ ref, value: valueProp, defaultValue,
|
|
637
|
+
declare function Rating({ ref, value: valueProp, defaultValue, onValueChange, count, readOnly, disabled, icon, name, 'aria-label': ariaLabel, className, }: RatingProps): react.JSX.Element;
|
|
466
638
|
declare namespace Rating {
|
|
467
639
|
var displayName: string;
|
|
468
640
|
}
|
|
@@ -510,19 +682,23 @@ declare namespace Section {
|
|
|
510
682
|
var Footer: typeof SectionFooter;
|
|
511
683
|
}
|
|
512
684
|
|
|
513
|
-
interface SegmentedControlProps extends HTMLAttributes<HTMLDivElement> {
|
|
685
|
+
interface SegmentedControlProps extends Omit<HTMLAttributes<HTMLDivElement>, 'defaultValue'> {
|
|
514
686
|
ref?: Ref<HTMLDivElement>;
|
|
687
|
+
value?: string;
|
|
688
|
+
defaultValue?: string;
|
|
689
|
+
onValueChange?: (value: string) => void;
|
|
515
690
|
}
|
|
516
|
-
declare function SegmentedControl({ ref, className, children, onKeyDown, ...rest }: SegmentedControlProps): react.JSX.Element;
|
|
691
|
+
declare function SegmentedControl({ ref, value: valueProp, defaultValue, onValueChange, className, children, onKeyDown, ...rest }: SegmentedControlProps): react.JSX.Element;
|
|
517
692
|
declare namespace SegmentedControl {
|
|
518
693
|
var displayName: string;
|
|
519
694
|
}
|
|
520
695
|
|
|
521
|
-
interface SegmentedControlItemProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
696
|
+
interface SegmentedControlItemProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'value'> {
|
|
522
697
|
ref?: Ref<HTMLButtonElement>;
|
|
698
|
+
value?: string;
|
|
523
699
|
selected?: boolean;
|
|
524
700
|
}
|
|
525
|
-
declare function SegmentedControlItem({ ref, selected, className, ...rest }: SegmentedControlItemProps): react.JSX.Element;
|
|
701
|
+
declare function SegmentedControlItem({ ref, value, selected: selectedProp, className, onClick, ...rest }: SegmentedControlItemProps): react.JSX.Element;
|
|
526
702
|
declare namespace SegmentedControlItem {
|
|
527
703
|
var displayName: string;
|
|
528
704
|
}
|
|
@@ -540,7 +716,7 @@ declare namespace Select {
|
|
|
540
716
|
interface SheetProps {
|
|
541
717
|
ref?: Ref<HTMLDivElement>;
|
|
542
718
|
open: boolean;
|
|
543
|
-
|
|
719
|
+
onOpenChange: (open: boolean) => void;
|
|
544
720
|
header?: ReactNode;
|
|
545
721
|
children?: ReactNode;
|
|
546
722
|
dismissable?: boolean;
|
|
@@ -548,7 +724,7 @@ interface SheetProps {
|
|
|
548
724
|
className?: string;
|
|
549
725
|
container?: Element | DocumentFragment | null;
|
|
550
726
|
}
|
|
551
|
-
declare function Sheet({ ref, open,
|
|
727
|
+
declare function Sheet({ ref, open, onOpenChange, header, children, dismissable, closeLabel, className, container, }: SheetProps): react.JSX.Element | null;
|
|
552
728
|
declare namespace Sheet {
|
|
553
729
|
var displayName: string;
|
|
554
730
|
}
|
|
@@ -567,14 +743,14 @@ interface SliderProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'value
|
|
|
567
743
|
ref?: Ref<HTMLInputElement>;
|
|
568
744
|
value?: number;
|
|
569
745
|
defaultValue?: number;
|
|
570
|
-
|
|
746
|
+
onValueChange?: (value: number) => void;
|
|
571
747
|
min?: number;
|
|
572
748
|
max?: number;
|
|
573
749
|
step?: number;
|
|
574
750
|
before?: ReactNode;
|
|
575
751
|
after?: ReactNode;
|
|
576
752
|
}
|
|
577
|
-
declare function Slider({ ref, value: valueProp, defaultValue,
|
|
753
|
+
declare function Slider({ ref, value: valueProp, defaultValue, onValueChange, min, max, step, before, after, disabled, className, ...rest }: SliderProps): react.JSX.Element;
|
|
578
754
|
declare namespace Slider {
|
|
579
755
|
var displayName: string;
|
|
580
756
|
}
|
|
@@ -619,30 +795,31 @@ declare namespace Spinner {
|
|
|
619
795
|
|
|
620
796
|
interface SpoilerProps extends HTMLAttributes<HTMLSpanElement> {
|
|
621
797
|
ref?: Ref<HTMLSpanElement>;
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
798
|
+
open?: boolean;
|
|
799
|
+
defaultOpen?: boolean;
|
|
800
|
+
onOpenChange?: (open: boolean) => void;
|
|
625
801
|
revealOn?: 'click' | 'hover';
|
|
626
802
|
accentColor?: string;
|
|
627
803
|
density?: number;
|
|
628
804
|
fps?: number;
|
|
629
805
|
revealLabel?: string;
|
|
630
806
|
}
|
|
631
|
-
declare function Spoiler({ ref,
|
|
807
|
+
declare function Spoiler({ ref, open: openProp, defaultOpen, onOpenChange, revealOn, accentColor, density, fps, revealLabel, className, style, children, onClick, onKeyDown, onMouseEnter, onMouseLeave, ...rest }: SpoilerProps): react.JSX.Element;
|
|
632
808
|
declare namespace Spoiler {
|
|
633
809
|
var displayName: string;
|
|
634
810
|
}
|
|
635
811
|
|
|
636
|
-
interface StepperProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {
|
|
812
|
+
interface StepperProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> {
|
|
637
813
|
ref?: Ref<HTMLDivElement>;
|
|
638
|
-
value
|
|
639
|
-
|
|
814
|
+
value?: number;
|
|
815
|
+
defaultValue?: number;
|
|
816
|
+
onValueChange?: (value: number) => void;
|
|
640
817
|
min?: number;
|
|
641
818
|
max?: number;
|
|
642
819
|
step?: number;
|
|
643
820
|
disabled?: boolean;
|
|
644
821
|
}
|
|
645
|
-
declare function Stepper({ ref, value,
|
|
822
|
+
declare function Stepper({ ref, value: valueProp, defaultValue, onValueChange, min, max, step, disabled, className, ...rest }: StepperProps): react.JSX.Element;
|
|
646
823
|
declare namespace Stepper {
|
|
647
824
|
var displayName: string;
|
|
648
825
|
}
|
|
@@ -652,7 +829,7 @@ interface StepsProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
652
829
|
count: number;
|
|
653
830
|
progress: number;
|
|
654
831
|
}
|
|
655
|
-
declare function Steps({ ref, count, progress, className, ...rest }: StepsProps): react.JSX.Element;
|
|
832
|
+
declare function Steps({ ref, count, progress, className, 'aria-label': ariaLabel, ...rest }: StepsProps): react.JSX.Element;
|
|
656
833
|
declare namespace Steps {
|
|
657
834
|
var displayName: string;
|
|
658
835
|
}
|
|
@@ -671,7 +848,7 @@ declare namespace Subheadline {
|
|
|
671
848
|
interface SwitchProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
672
849
|
ref?: Ref<HTMLInputElement>;
|
|
673
850
|
}
|
|
674
|
-
declare function Switch({ ref, disabled, className, style, ...rest }: SwitchProps): react.JSX.Element;
|
|
851
|
+
declare function Switch({ ref, disabled, className, style, onChange, ...rest }: SwitchProps): react.JSX.Element;
|
|
675
852
|
declare namespace Switch {
|
|
676
853
|
var displayName: string;
|
|
677
854
|
}
|
|
@@ -722,12 +899,17 @@ interface TguiProviderProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
722
899
|
platform?: TguiPlatform;
|
|
723
900
|
appearance?: Appearance;
|
|
724
901
|
portalContainer?: HTMLElement | null;
|
|
902
|
+
haptics?: boolean;
|
|
725
903
|
}
|
|
726
|
-
declare function TguiProvider({ ref, platform: platformProp, appearance: appearanceProp, portalContainer: portalContainerProp, className, children, ...rest }: TguiProviderProps): react.JSX.Element;
|
|
904
|
+
declare function TguiProvider({ ref, platform: platformProp, appearance: appearanceProp, portalContainer: portalContainerProp, haptics, className, children, ...rest }: TguiProviderProps): react.JSX.Element;
|
|
727
905
|
declare namespace TguiProvider {
|
|
728
906
|
var displayName: string;
|
|
729
907
|
}
|
|
730
908
|
|
|
909
|
+
type HapticIntent = 'tap' | 'press' | 'select' | 'success' | 'warning' | 'error';
|
|
910
|
+
|
|
911
|
+
declare function useHaptic(): (intent: HapticIntent) => void;
|
|
912
|
+
|
|
731
913
|
declare function useTgui(): TguiContextValue;
|
|
732
914
|
|
|
733
915
|
interface TimelineProps extends HTMLAttributes<HTMLOListElement> {
|
|
@@ -756,7 +938,7 @@ interface TitleProps extends TypographyProps {
|
|
|
756
938
|
ref?: Ref<HTMLElement>;
|
|
757
939
|
level?: TitleLevel;
|
|
758
940
|
}
|
|
759
|
-
declare function Title({ ref, level, Component, className, ...rest }: TitleProps): react.JSX.Element;
|
|
941
|
+
declare function Title({ ref, level, weight, Component, className, ...rest }: TitleProps): react.JSX.Element;
|
|
760
942
|
declare namespace Title {
|
|
761
943
|
var displayName: string;
|
|
762
944
|
}
|
|
@@ -768,13 +950,14 @@ interface TooltipProps {
|
|
|
768
950
|
content: ReactNode;
|
|
769
951
|
placement?: TooltipPlacement;
|
|
770
952
|
open?: boolean;
|
|
953
|
+
defaultOpen?: boolean;
|
|
771
954
|
onOpenChange?: (open: boolean) => void;
|
|
772
955
|
className?: string;
|
|
773
956
|
}
|
|
774
|
-
declare function Tooltip({ ref, children, content, placement, open: openProp, onOpenChange, className, }: TooltipProps): react.JSX.Element;
|
|
957
|
+
declare function Tooltip({ ref, children, content, placement, open: openProp, defaultOpen, onOpenChange, className, }: TooltipProps): react.JSX.Element;
|
|
775
958
|
declare namespace Tooltip {
|
|
776
959
|
var displayName: string;
|
|
777
960
|
}
|
|
778
961
|
|
|
779
|
-
export { Accordion, AccordionItem, Avatar, AvatarStack, Badge, Banner, Blockquote, Breadcrumbs, Button, Caption, Card, CardCell, Cell, Checkbox, Chip, CircularProgress, CompactPagination, Divider, FixedLayout, Headline, HorizontalScroll, IconButton, Image, InlineButtons, InlineButtonsItem, Input, LargeTitle, Link, List, Pagination, PinInput, Placeholder, Portal, Progress, Radio, Rating, SearchBar, Section, SectionFooter, SectionHeader, SegmentedControl, SegmentedControlItem, Select, Sheet, Skeleton, Slider, SnackbarProvider, Spinner, Spoiler, Stepper, Steps, Subheadline, Switch, TabBar, TabBarItem, Tappable, Text, Textarea, TguiProvider, Timeline, TimelineItem, Title, Tooltip, Typography, useSnackbar, useTgui };
|
|
780
|
-
export type { AccordionItemProps, AccordionProps, AvatarProps, AvatarSize, AvatarStackProps, BadgeMode, BadgeProps, BadgeType, BannerProps, BannerType, BlockquoteProps, BreadcrumbItem, BreadcrumbsProps, ButtonMode, ButtonProps, ButtonSize, CaptionProps, CardCellProps, CardProps, CardType, CellProps, CheckboxProps, ChipMode, ChipProps, CircularProgressProps, CircularProgressSize, CompactPaginationProps, DividerProps, FixedLayoutProps, HeadlineProps, HorizontalScrollProps, IconButtonMode, IconButtonProps, IconButtonSize, ImageProps, InlineButtonsItemProps, InlineButtonsMode, InlineButtonsProps, InputProps, InputStatus, LargeTitleProps, LinkProps, ListProps, PaginationProps, PinInputProps, PlaceholderProps, PortalProps, ProgressProps, RadioProps, RatingProps, SearchBarProps, SectionFooterProps, SectionHeaderProps, SectionProps, SegmentedControlItemProps, SegmentedControlProps, SelectProps, SheetProps, SkeletonProps, SliderProps, SnackbarApi, SnackbarOptions, SnackbarProviderProps, SpinnerProps, SpinnerSize, SpoilerProps, StepperProps, StepsProps, SubheadlineProps, SwitchProps, TabBarItemProps, TabBarProps, TappableProps, TextProps, TextareaProps, TextareaStatus, TguiProviderProps, TimelineItemProps, TimelineProps, TitleProps, TooltipPlacement, TooltipProps, TypographyProps };
|
|
962
|
+
export { Accordion, AccordionItem, Avatar, AvatarStack, Badge, Banner, Blockquote, Breadcrumbs, Button, Callout, Caption, Card, CardCell, Cell, Checkbox, Chip, CircularProgress, CompactPagination, Dialog, Divider, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuTrigger, FixedLayout, Footnote, Headline, HorizontalScroll, IconButton, Image, InlineButtons, InlineButtonsItem, Input, LargeTitle, Link, List, Pagination, PinInput, Placeholder, Popover, PopoverContent, PopoverTrigger, Portal, Progress, Radio, Rating, SearchBar, Section, SectionFooter, SectionHeader, SegmentedControl, SegmentedControlItem, Select, Sheet, Skeleton, Slider, SnackbarProvider, Spinner, Spoiler, Stepper, Steps, Subheadline, Switch, TabBar, TabBarItem, Tappable, Text, Textarea, TguiProvider, Timeline, TimelineItem, Title, Tooltip, Typography, useHaptic, useSnackbar, useTgui };
|
|
963
|
+
export type { AccordionItemProps, AccordionProps, AvatarProps, AvatarSize, AvatarStackProps, BadgeMode, BadgeProps, BadgeType, BannerProps, BannerType, BlockquoteProps, BreadcrumbItem, BreadcrumbsProps, ButtonMode, ButtonProps, ButtonSize, CalloutProps, CaptionProps, CardCellProps, CardProps, CardType, CellProps, CheckboxProps, ChipMode, ChipProps, CircularProgressProps, CircularProgressSize, CompactPaginationProps, DialogAction, DialogActionRole, DialogProps, DividerProps, DropdownMenuCheckboxItemProps, DropdownMenuContentProps, DropdownMenuItemProps, DropdownMenuLabelProps, DropdownMenuProps, DropdownMenuRadioGroupProps, DropdownMenuRadioItemProps, DropdownMenuSeparatorProps, DropdownMenuTriggerProps, FixedLayoutProps, FootnoteProps, HeadlineProps, HorizontalScrollProps, IconButtonMode, IconButtonProps, IconButtonSize, ImageProps, InlineButtonsItemProps, InlineButtonsMode, InlineButtonsProps, InputProps, InputStatus, LargeTitleProps, LinkProps, ListProps, PaginationProps, PinInputProps, PlaceholderProps, PopoverContentProps, PopoverProps, PopoverTriggerProps, PortalProps, ProgressProps, RadioProps, RatingProps, SearchBarProps, SectionFooterProps, SectionHeaderProps, SectionProps, SegmentedControlItemProps, SegmentedControlProps, SelectProps, SheetProps, SkeletonProps, SliderProps, SnackbarApi, SnackbarOptions, SnackbarProviderProps, SpinnerProps, SpinnerSize, SpoilerProps, StepperProps, StepsProps, SubheadlineProps, SwitchProps, TabBarItemProps, TabBarProps, TappableProps, TextProps, TextareaProps, TextareaStatus, TguiProviderProps, TimelineItemProps, TimelineProps, TitleProps, TooltipPlacement, TooltipProps, TypographyProps };
|