@revolut/ui-kit-miniapp 0.0.2 → 0.0.3
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/package.json +2 -1
- package/types/index.d.ts +98 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@revolut/ui-kit-miniapp",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"main": "",
|
|
6
6
|
"types": "types/index.d.ts",
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
],
|
|
21
21
|
"scripts": {
|
|
22
22
|
"prebuild": "rimraf types",
|
|
23
|
+
"prepublishOnly": "yarn build",
|
|
23
24
|
"build": "mkdir -p types && cp ../ui-kit-miniapp/dist/index.d.ts ./types/index.d.ts"
|
|
24
25
|
},
|
|
25
26
|
"peerDependencies": {
|
package/types/index.d.ts
CHANGED
|
@@ -592,6 +592,10 @@ interface CalendarDateProps {
|
|
|
592
592
|
* Label for the next month button.
|
|
593
593
|
*/
|
|
594
594
|
labelNext?: string;
|
|
595
|
+
/**
|
|
596
|
+
* Whether the calendar navigates with infinite scroll
|
|
597
|
+
*/
|
|
598
|
+
infinite?: boolean;
|
|
595
599
|
}
|
|
596
600
|
/**
|
|
597
601
|
* Props for the Calendar component when variant is 'range'.
|
|
@@ -630,6 +634,10 @@ interface CalendarRangeProps {
|
|
|
630
634
|
* Label for the next month button.
|
|
631
635
|
*/
|
|
632
636
|
labelNext?: string;
|
|
637
|
+
/**
|
|
638
|
+
* Whether the calendar navigates with infinite scroll
|
|
639
|
+
*/
|
|
640
|
+
infinite?: boolean;
|
|
633
641
|
}
|
|
634
642
|
type CalendarProps = CalendarDateProps | CalendarRangeProps;
|
|
635
643
|
/**
|
|
@@ -1162,6 +1170,65 @@ interface DetailsCellProps extends NativeDivProps {
|
|
|
1162
1170
|
*/
|
|
1163
1171
|
declare const DetailsCell: ({ title, content, note, ...rest }: DetailsCellProps) => react_jsx_runtime.JSX.Element;
|
|
1164
1172
|
|
|
1173
|
+
/**
|
|
1174
|
+
* Props for the Dropdown component.
|
|
1175
|
+
*
|
|
1176
|
+
* @example
|
|
1177
|
+
* ```tsx
|
|
1178
|
+
* <Dropdown anchorRef={ref} onClose={handleClose} open>
|
|
1179
|
+
* Dropdown content
|
|
1180
|
+
* </Dropdown>
|
|
1181
|
+
* ```
|
|
1182
|
+
*/
|
|
1183
|
+
interface DropdownProps extends NativeDivProps {
|
|
1184
|
+
/**
|
|
1185
|
+
* Element ref where the tooltip is anchored.
|
|
1186
|
+
*/
|
|
1187
|
+
anchorRef: React.RefObject<HTMLElement | null>;
|
|
1188
|
+
/**
|
|
1189
|
+
* Callback triggered when the dropdown is closed.
|
|
1190
|
+
*/
|
|
1191
|
+
onClose: () => void;
|
|
1192
|
+
/**
|
|
1193
|
+
* Whether the dropdown is shown.
|
|
1194
|
+
*/
|
|
1195
|
+
open: boolean;
|
|
1196
|
+
/**
|
|
1197
|
+
* Dropdown content.
|
|
1198
|
+
*/
|
|
1199
|
+
children: React.ReactNode;
|
|
1200
|
+
}
|
|
1201
|
+
/**
|
|
1202
|
+
* Dropdown component for displaying content anchored to an element.
|
|
1203
|
+
*
|
|
1204
|
+
* @example
|
|
1205
|
+
* ```tsx
|
|
1206
|
+
* import { Button, Dropdown } from '@revolut/ui-kit-miniapp'
|
|
1207
|
+
*
|
|
1208
|
+
* // Basic usage
|
|
1209
|
+
* function BasicExample() {
|
|
1210
|
+
* const ref = useRef(null)
|
|
1211
|
+
* const [open, setOpen] = useState(false)
|
|
1212
|
+
*
|
|
1213
|
+
* return (
|
|
1214
|
+
* <>
|
|
1215
|
+
* <Button onClick={() => setOpen(false)} ref={ref}>
|
|
1216
|
+
* Click me to show dropdown!
|
|
1217
|
+
* </Button>
|
|
1218
|
+
* <Dropdown
|
|
1219
|
+
* anchorRef={ref}
|
|
1220
|
+
* onClose={() => setOpen(false)}
|
|
1221
|
+
* open={open}
|
|
1222
|
+
* >
|
|
1223
|
+
* Dropdown content
|
|
1224
|
+
* </Dropdown>
|
|
1225
|
+
* </>
|
|
1226
|
+
* )
|
|
1227
|
+
* }
|
|
1228
|
+
* ```
|
|
1229
|
+
*/
|
|
1230
|
+
declare const Dropdown: ({ anchorRef, onClose, open, children, }: DropdownProps) => react_jsx_runtime.JSX.Element;
|
|
1231
|
+
|
|
1165
1232
|
/**
|
|
1166
1233
|
* Props for the Footnote component.
|
|
1167
1234
|
*
|
|
@@ -1369,7 +1436,7 @@ type NativeInputProps$3 = Omit<React.InputHTMLAttributes<HTMLInputElement>, 'cla
|
|
|
1369
1436
|
/**
|
|
1370
1437
|
* Input type options.
|
|
1371
1438
|
*/
|
|
1372
|
-
type InputType = 'text' | 'email' | 'password' | 'tel' | 'url' | 'number' | 'search';
|
|
1439
|
+
type InputType = 'button' | 'text' | 'email' | 'password' | 'tel' | 'url' | 'number' | 'search';
|
|
1373
1440
|
/**
|
|
1374
1441
|
* Props for the Input component.
|
|
1375
1442
|
*
|
|
@@ -1440,6 +1507,14 @@ interface InputProps extends NativeInputProps$3 {
|
|
|
1440
1507
|
* Callback fired when the clear button is clicked.
|
|
1441
1508
|
*/
|
|
1442
1509
|
onClear?: () => void;
|
|
1510
|
+
/**
|
|
1511
|
+
* Icon to render at the start of the input content.
|
|
1512
|
+
*/
|
|
1513
|
+
icon?: IconName;
|
|
1514
|
+
/**
|
|
1515
|
+
* Icon to render at the end of the input content.
|
|
1516
|
+
*/
|
|
1517
|
+
endIcon?: IconName;
|
|
1443
1518
|
}
|
|
1444
1519
|
/**
|
|
1445
1520
|
* Input component for text entry.
|
|
@@ -1502,6 +1577,25 @@ interface InputProps extends NativeInputProps$3 {
|
|
|
1502
1577
|
*
|
|
1503
1578
|
* @example
|
|
1504
1579
|
* ```tsx
|
|
1580
|
+
* import { Input } from '@revolut/ui-kit-miniapp'
|
|
1581
|
+
*
|
|
1582
|
+
* // Button variant
|
|
1583
|
+
* function FormExample() {
|
|
1584
|
+
* const [value, setValue] = useState('')
|
|
1585
|
+
* return (
|
|
1586
|
+
* <Input
|
|
1587
|
+
* label="Airport"
|
|
1588
|
+
* icon="AirplaneDeparture"
|
|
1589
|
+
* type="button"
|
|
1590
|
+
* onClick={() => openPopup()}
|
|
1591
|
+
* value={value}
|
|
1592
|
+
* />
|
|
1593
|
+
* )
|
|
1594
|
+
* }
|
|
1595
|
+
* ```
|
|
1596
|
+
*
|
|
1597
|
+
* @example
|
|
1598
|
+
* ```tsx
|
|
1505
1599
|
* import { Input, VStack } from '@revolut/ui-kit-miniapp'
|
|
1506
1600
|
*
|
|
1507
1601
|
* // Form layout
|
|
@@ -1516,7 +1610,7 @@ interface InputProps extends NativeInputProps$3 {
|
|
|
1516
1610
|
* }
|
|
1517
1611
|
* ```
|
|
1518
1612
|
*/
|
|
1519
|
-
declare const Input: ({ value, defaultValue, onChange, label, placeholder, type, disabled, readOnly, invalid, description, errorMessage, labelButtonClear, onClear, ...rest }: InputProps) => react_jsx_runtime.JSX.Element;
|
|
1613
|
+
declare const Input: ({ value, defaultValue, onChange, label, placeholder, type, disabled, readOnly, invalid, description, errorMessage, labelButtonClear, onClear, icon, endIcon, ...rest }: InputProps) => react_jsx_runtime.JSX.Element;
|
|
1520
1614
|
|
|
1521
1615
|
type NativeAnchorProps = Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'className' | 'style'>;
|
|
1522
1616
|
/**
|
|
@@ -3392,5 +3486,5 @@ declare const Token: {
|
|
|
3392
3486
|
};
|
|
3393
3487
|
};
|
|
3394
3488
|
|
|
3395
|
-
export { Action, ActionButton, Avatar, BottomSheet, Button, Calendar, Cell, Checkbox, Copyable, DetailsCell, FilterButton, Footnote, Group, HStack, Icon, Image, Input, Link, Page, Radio, RootProvider, Search, Spacer, Subheader, Switch, TabBar, Text, TextArea, ToggleButton, Token, VStack, VisuallyHidden, useStatusSheet };
|
|
3396
|
-
export type { ActionButtonProps, ActionButtonVariant, ActionProps, AvatarProps, AvatarSize, BottomSheetActionsProps, BottomSheetContentProps, BottomSheetHeaderProps, BottomSheetProps, ButtonProps, ButtonVariant, CalendarDateProps, CalendarProps, CalendarRangeProps, CalendarVariant, CellProps, CellVariant, CheckboxProps, CopyableProps, DateRange, DetailsCellProps, FilterButtonProps, FootnoteProps, GroupProps, GroupVariant, HStackProps, IconProps, ImageFit, ImageProp, ImageProps, InputProps, InputType, LinkProps, PageHeaderProps, PageMainProps, PageProps, PageTabsProps, RadioProps, RootProviderProps, SearchProps, Space, SpacerProps, StackAlignment, StatusSheetAction, StatusSheetInstance, StatusSheetOptions, StatusSheetVariant, SubheaderProps, SubheaderVariant, SwitchProps, TabBarItem, TabBarProps, TabBarVariant, TextAreaProps, TextProps, TextVariant, ThemeBackground, ThemeMode, ToggleButtonProps, VStackProps, VisuallyHiddenProps };
|
|
3489
|
+
export { Action, ActionButton, Avatar, BottomSheet, Button, Calendar, Cell, Checkbox, Copyable, DetailsCell, Dropdown, FilterButton, Footnote, Group, HStack, Icon, Image, Input, Link, Page, Radio, RootProvider, Search, Spacer, Subheader, Switch, TabBar, Text, TextArea, ToggleButton, Token, VStack, VisuallyHidden, useStatusSheet };
|
|
3490
|
+
export type { ActionButtonProps, ActionButtonVariant, ActionProps, AvatarProps, AvatarSize, BottomSheetActionsProps, BottomSheetContentProps, BottomSheetHeaderProps, BottomSheetProps, ButtonProps, ButtonVariant, CalendarDateProps, CalendarProps, CalendarRangeProps, CalendarVariant, CellProps, CellVariant, CheckboxProps, CopyableProps, DateRange, DetailsCellProps, DropdownProps, FilterButtonProps, FootnoteProps, GroupProps, GroupVariant, HStackProps, IconProps, ImageFit, ImageProp, ImageProps, InputProps, InputType, LinkProps, PageHeaderProps, PageMainProps, PageProps, PageTabsProps, RadioProps, RootProviderProps, SearchProps, Space, SpacerProps, StackAlignment, StatusSheetAction, StatusSheetInstance, StatusSheetOptions, StatusSheetVariant, SubheaderProps, SubheaderVariant, SwitchProps, TabBarItem, TabBarProps, TabBarVariant, TextAreaProps, TextProps, TextVariant, ThemeBackground, ThemeMode, ToggleButtonProps, VStackProps, VisuallyHiddenProps };
|