@revolut/ui-kit-miniapp 0.0.3 → 0.0.5
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 +1 -1
- package/types/index.d.ts +268 -5
package/package.json
CHANGED
package/types/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import { Token as Token$1, IconName, ImageProps as ImageProps$1, DateRange as DateRange$1, IntlMessages, CurrencyDefinition } from '@revolut-internal/ui-kit';
|
|
3
|
+
import { Token as Token$1, IconName, ImageProps as ImageProps$1, DateRange as DateRange$1, Color, IntlMessages, CurrencyDefinition } from '@revolut-internal/ui-kit';
|
|
4
4
|
export { CurrencyDefinition, DateFormatOptions, DateRangeFormatOptions, DateTimeFormatOptions, DropdownOptions, DropdownState, IconName, IntlMessages, TimeFormatOptions, UseMoneyFormatOptions, copyToClipboard, nodeChain, useDateFormat, useDateRangeFormat, useDateTimeFormat, useDropdown, useIsRTL, useMoneyFormat, useTimeFormat } from '@revolut-internal/ui-kit';
|
|
5
5
|
|
|
6
6
|
declare namespace JSXCompat {
|
|
@@ -739,6 +739,10 @@ interface CellProps extends NativeDivProps {
|
|
|
739
739
|
* Avatar or image displayed at the start of the cell.
|
|
740
740
|
*/
|
|
741
741
|
avatar?: React.ReactNode;
|
|
742
|
+
/**
|
|
743
|
+
* Alignment for the avatar content, center by default
|
|
744
|
+
*/
|
|
745
|
+
avatarAlign?: 'start' | 'center' | 'end';
|
|
742
746
|
/**
|
|
743
747
|
* Visual variant of the cell.
|
|
744
748
|
* - 'default': Standard cell
|
|
@@ -871,7 +875,29 @@ interface CellProps extends NativeDivProps {
|
|
|
871
875
|
* }
|
|
872
876
|
* ```
|
|
873
877
|
*/
|
|
874
|
-
declare const Cell: ({ as, title, description, side, icon, avatar, variant, active, disabled, onClick, href, target, ...rest }: CellProps) => react_jsx_runtime.JSX.Element;
|
|
878
|
+
declare const Cell: ({ as, title, description, side, icon, avatar, avatarAlign, variant, active, disabled, onClick, href, target, ...rest }: CellProps) => react_jsx_runtime.JSX.Element;
|
|
879
|
+
|
|
880
|
+
/**
|
|
881
|
+
* Cell skeleton component to show a loading state.
|
|
882
|
+
*
|
|
883
|
+
* Provides a cell skeleton to be shown when UI is loading some content.
|
|
884
|
+
*
|
|
885
|
+
* @example
|
|
886
|
+
* ```tsx
|
|
887
|
+
* import { CellSkeleton, Group } from '@revolut/ui-kit-miniapp'
|
|
888
|
+
*
|
|
889
|
+
* function CellSkeletonExample() {
|
|
890
|
+
* return (
|
|
891
|
+
* <Group>
|
|
892
|
+
* <CellSkeleton />
|
|
893
|
+
* <CellSkeleton />
|
|
894
|
+
* <CellSkeleton />
|
|
895
|
+
* </Group>
|
|
896
|
+
* )
|
|
897
|
+
* }
|
|
898
|
+
* ```
|
|
899
|
+
*/
|
|
900
|
+
declare const CellSkeleton: () => react_jsx_runtime.JSX.Element;
|
|
875
901
|
|
|
876
902
|
type NativeInputProps$4 = Omit<React.InputHTMLAttributes<HTMLInputElement>, 'className' | 'style' | 'children' | 'checked' | 'defaultChecked' | 'disabled' | 'onChange' | 'type' | 'color'>;
|
|
877
903
|
/**
|
|
@@ -1697,6 +1723,61 @@ interface LinkProps extends NativeAnchorProps {
|
|
|
1697
1723
|
*/
|
|
1698
1724
|
declare const Link: ({ href, target, children, ...rest }: LinkProps) => react_jsx_runtime.JSX.Element;
|
|
1699
1725
|
|
|
1726
|
+
/**
|
|
1727
|
+
* List item definition.
|
|
1728
|
+
*/
|
|
1729
|
+
interface ListItem {
|
|
1730
|
+
/**
|
|
1731
|
+
* Icon to show at the start
|
|
1732
|
+
*/
|
|
1733
|
+
icon: IconName;
|
|
1734
|
+
/**
|
|
1735
|
+
* Text to show
|
|
1736
|
+
*/
|
|
1737
|
+
text: string;
|
|
1738
|
+
}
|
|
1739
|
+
/**
|
|
1740
|
+
* Props for the List component.
|
|
1741
|
+
*
|
|
1742
|
+
* @example
|
|
1743
|
+
* ```tsx
|
|
1744
|
+
* <List
|
|
1745
|
+
* items={[
|
|
1746
|
+
* { text: 'First item completed', icon: 'Check' },
|
|
1747
|
+
* { text: 'Second item pending', icon: 'Time' },
|
|
1748
|
+
* ]}
|
|
1749
|
+
* />
|
|
1750
|
+
* ```
|
|
1751
|
+
*/
|
|
1752
|
+
interface ListProps {
|
|
1753
|
+
/**
|
|
1754
|
+
* List items to render.
|
|
1755
|
+
*/
|
|
1756
|
+
items: ListItem[];
|
|
1757
|
+
}
|
|
1758
|
+
/**
|
|
1759
|
+
* List component for showing a list of elements.
|
|
1760
|
+
*
|
|
1761
|
+
* Provides a vertical container for showing a list of text elements with icons.
|
|
1762
|
+
*
|
|
1763
|
+
* @example
|
|
1764
|
+
* ```tsx
|
|
1765
|
+
* import { List } from '@revolut/ui-kit-miniapp'
|
|
1766
|
+
*
|
|
1767
|
+
* function ListExample() {
|
|
1768
|
+
* return (
|
|
1769
|
+
* <List
|
|
1770
|
+
* items={[
|
|
1771
|
+
* { text: 'First item completed', icon: 'Check' },
|
|
1772
|
+
* { text: 'Second item pending', icon: 'Time' },
|
|
1773
|
+
* ]}
|
|
1774
|
+
* />
|
|
1775
|
+
* )
|
|
1776
|
+
* }
|
|
1777
|
+
* ```
|
|
1778
|
+
*/
|
|
1779
|
+
declare const List: ({ items }: ListProps) => react_jsx_runtime.JSX.Element;
|
|
1780
|
+
|
|
1700
1781
|
/**
|
|
1701
1782
|
* Props for the FilterButton component.
|
|
1702
1783
|
*
|
|
@@ -1936,6 +2017,167 @@ interface HStackProps extends NativeSpanProps {
|
|
|
1936
2017
|
*/
|
|
1937
2018
|
declare const HStack: ({ align, gap, children, ...rest }: HStackProps) => react_jsx_runtime.JSX.Element;
|
|
1938
2019
|
|
|
2020
|
+
/**
|
|
2021
|
+
* Props for the Placeholder component.
|
|
2022
|
+
*
|
|
2023
|
+
* @example
|
|
2024
|
+
* ```tsx
|
|
2025
|
+
* <Placeholder
|
|
2026
|
+
* title="Nothing found"
|
|
2027
|
+
* description="Try again later"
|
|
2028
|
+
* icon="Question"
|
|
2029
|
+
* action={<Button>Try again</Button>}
|
|
2030
|
+
* />
|
|
2031
|
+
* ```
|
|
2032
|
+
*/
|
|
2033
|
+
interface PlaceholderProps {
|
|
2034
|
+
/**
|
|
2035
|
+
* Placeholder title.
|
|
2036
|
+
*/
|
|
2037
|
+
title: string;
|
|
2038
|
+
/**
|
|
2039
|
+
* Placeholder description.
|
|
2040
|
+
*/
|
|
2041
|
+
description?: string;
|
|
2042
|
+
/**
|
|
2043
|
+
* Placeholder icon.
|
|
2044
|
+
*/
|
|
2045
|
+
icon: IconName;
|
|
2046
|
+
/**
|
|
2047
|
+
* Placeholder action.
|
|
2048
|
+
*/
|
|
2049
|
+
action?: React.ReactNode;
|
|
2050
|
+
}
|
|
2051
|
+
/**
|
|
2052
|
+
* Placeholder component for showing status information.
|
|
2053
|
+
*
|
|
2054
|
+
* The component is useful for displaying of any statuses or information consist of image, title, description, and action.
|
|
2055
|
+
*
|
|
2056
|
+
* @example
|
|
2057
|
+
* ```tsx
|
|
2058
|
+
* import { Placeholder } from '@revolut/ui-kit-miniapp'
|
|
2059
|
+
*
|
|
2060
|
+
* function PlaceholderExample() {
|
|
2061
|
+
* return (
|
|
2062
|
+
* <Placeholder
|
|
2063
|
+
* title="Nothing found"
|
|
2064
|
+
* description="Try again later"
|
|
2065
|
+
* icon="Question"
|
|
2066
|
+
* action={<Button>Try again</Button>}
|
|
2067
|
+
* />
|
|
2068
|
+
* )
|
|
2069
|
+
* }
|
|
2070
|
+
* ```
|
|
2071
|
+
*/
|
|
2072
|
+
declare const Placeholder: ({ action, description, icon, title, }: PlaceholderProps) => react_jsx_runtime.JSX.Element;
|
|
2073
|
+
|
|
2074
|
+
/**
|
|
2075
|
+
* Props for the Popup component.
|
|
2076
|
+
*/
|
|
2077
|
+
interface PopupProps {
|
|
2078
|
+
/**
|
|
2079
|
+
* Whether the modal is open.
|
|
2080
|
+
*/
|
|
2081
|
+
open?: boolean;
|
|
2082
|
+
/**
|
|
2083
|
+
* Callback when the modal is closed.
|
|
2084
|
+
*/
|
|
2085
|
+
onClose?: () => void;
|
|
2086
|
+
/**
|
|
2087
|
+
* Modal content.
|
|
2088
|
+
*/
|
|
2089
|
+
children?: React.ReactNode;
|
|
2090
|
+
/**
|
|
2091
|
+
* Modal title
|
|
2092
|
+
*/
|
|
2093
|
+
title?: string;
|
|
2094
|
+
/**
|
|
2095
|
+
* Modal subtitle
|
|
2096
|
+
*/
|
|
2097
|
+
subtitle?: string;
|
|
2098
|
+
}
|
|
2099
|
+
/**
|
|
2100
|
+
* Popup component for displaying modal content with full screen size.
|
|
2101
|
+
*
|
|
2102
|
+
* @example
|
|
2103
|
+
* ```tsx
|
|
2104
|
+
* import { Button, Calendar, Popup } from '@revolut/ui-kit-miniapp'
|
|
2105
|
+
*
|
|
2106
|
+
* function MyComponent() {
|
|
2107
|
+
* const [open, setOpen] = useState(false)
|
|
2108
|
+
*
|
|
2109
|
+
* return (
|
|
2110
|
+
* <>
|
|
2111
|
+
* <Button onClick={() => setOpen(true)}>Open modal</Button>
|
|
2112
|
+
* <Popup open={open} onClose={() => setOpen(false)} title="Select date" subtitle="From 1st of January to 31th of December">
|
|
2113
|
+
* <Calendar infinite variant="date-range" />
|
|
2114
|
+
* </Popup>
|
|
2115
|
+
* </>
|
|
2116
|
+
* )
|
|
2117
|
+
* }
|
|
2118
|
+
* ```
|
|
2119
|
+
*/
|
|
2120
|
+
declare const Popup: ({ open, onClose, children, title, subtitle, }: PopupProps) => react_jsx_runtime.JSX.Element;
|
|
2121
|
+
|
|
2122
|
+
/**
|
|
2123
|
+
* Progress steps item definition.
|
|
2124
|
+
*/
|
|
2125
|
+
interface ProgressStepsItem {
|
|
2126
|
+
/**
|
|
2127
|
+
* Title to show in the step
|
|
2128
|
+
*/
|
|
2129
|
+
title: string;
|
|
2130
|
+
/**
|
|
2131
|
+
* Description to show in the step
|
|
2132
|
+
*/
|
|
2133
|
+
description: string;
|
|
2134
|
+
/**
|
|
2135
|
+
* Color of the indicator at the start of the step item
|
|
2136
|
+
*/
|
|
2137
|
+
color: Color;
|
|
2138
|
+
}
|
|
2139
|
+
/**
|
|
2140
|
+
* Props for the ProgressSteps component.
|
|
2141
|
+
*
|
|
2142
|
+
* @example
|
|
2143
|
+
* ```tsx
|
|
2144
|
+
* <ProgressSteps
|
|
2145
|
+
* items={[
|
|
2146
|
+
* { title: 'Free cancellation', description: 'Until 15th of December', color: 'success' },
|
|
2147
|
+
* { title: 'No refund', description: 'From 16th of December', color: 'red' },
|
|
2148
|
+
* ]}
|
|
2149
|
+
* />
|
|
2150
|
+
* ```
|
|
2151
|
+
*/
|
|
2152
|
+
interface ProgressStepsProps {
|
|
2153
|
+
/**
|
|
2154
|
+
* Steps items to render.
|
|
2155
|
+
*/
|
|
2156
|
+
items: ProgressStepsItem[];
|
|
2157
|
+
}
|
|
2158
|
+
/**
|
|
2159
|
+
* ProgressSteps component for showing current progress on a specific process.
|
|
2160
|
+
*
|
|
2161
|
+
* Provides a vertical container for showing a list of steps with information, description and color to highlight the status of each one.
|
|
2162
|
+
*
|
|
2163
|
+
* @example
|
|
2164
|
+
* ```tsx
|
|
2165
|
+
* import { ProgressSteps } from '@revolut/ui-kit-miniapp'
|
|
2166
|
+
*
|
|
2167
|
+
* function ProgressStepsExample() {
|
|
2168
|
+
* return (
|
|
2169
|
+
* <ProgressSteps
|
|
2170
|
+
* items={[
|
|
2171
|
+
* { title: 'Free cancellation', description: 'Until 15th of December', color: 'success' },
|
|
2172
|
+
* { title: 'No refund', description: 'From 16th of December', color: 'red' },
|
|
2173
|
+
* ]}
|
|
2174
|
+
* />
|
|
2175
|
+
* )
|
|
2176
|
+
* }
|
|
2177
|
+
* ```
|
|
2178
|
+
*/
|
|
2179
|
+
declare const ProgressSteps: ({ items }: ProgressStepsProps) => react_jsx_runtime.JSX.Element;
|
|
2180
|
+
|
|
1939
2181
|
/**
|
|
1940
2182
|
* Props for the Spacer component.
|
|
1941
2183
|
*
|
|
@@ -3130,6 +3372,23 @@ interface BottomSheetComponent extends React.FC<BottomSheetProps> {
|
|
|
3130
3372
|
*/
|
|
3131
3373
|
declare const BottomSheet: BottomSheetComponent;
|
|
3132
3374
|
|
|
3375
|
+
/**
|
|
3376
|
+
* Page header action item definition.
|
|
3377
|
+
*/
|
|
3378
|
+
interface PageHeaderActionItem {
|
|
3379
|
+
/**
|
|
3380
|
+
* Label for the action (not visible)
|
|
3381
|
+
*/
|
|
3382
|
+
label: string;
|
|
3383
|
+
/**
|
|
3384
|
+
* Icon to show
|
|
3385
|
+
*/
|
|
3386
|
+
icon: IconName;
|
|
3387
|
+
/**
|
|
3388
|
+
* Callback when the button is clicked
|
|
3389
|
+
*/
|
|
3390
|
+
onClick: () => void;
|
|
3391
|
+
}
|
|
3133
3392
|
/**
|
|
3134
3393
|
* Props for the Page.Header component.
|
|
3135
3394
|
*/
|
|
@@ -3167,8 +3426,12 @@ interface PageHeaderProps extends NativeHeadingProps {
|
|
|
3167
3426
|
* Header title content.
|
|
3168
3427
|
*/
|
|
3169
3428
|
children?: React.ReactNode;
|
|
3429
|
+
/**
|
|
3430
|
+
* Header actions.
|
|
3431
|
+
*/
|
|
3432
|
+
actions?: PageHeaderActionItem[];
|
|
3170
3433
|
}
|
|
3171
|
-
declare const PageHeader: ({ onBack, onClose, labelButtonClose, labelButtonBack, subtitle, description, loading, children, ...rest }: PageHeaderProps) => react_jsx_runtime.JSX.Element;
|
|
3434
|
+
declare const PageHeader: ({ onBack, onClose, labelButtonClose, labelButtonBack, subtitle, description, loading, children, actions, ...rest }: PageHeaderProps) => react_jsx_runtime.JSX.Element;
|
|
3172
3435
|
/**
|
|
3173
3436
|
* Props for the Page.Main component.
|
|
3174
3437
|
*/
|
|
@@ -3486,5 +3749,5 @@ declare const Token: {
|
|
|
3486
3749
|
};
|
|
3487
3750
|
};
|
|
3488
3751
|
|
|
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 };
|
|
3752
|
+
export { Action, ActionButton, Avatar, BottomSheet, Button, Calendar, Cell, CellSkeleton, Checkbox, Copyable, DetailsCell, Dropdown, FilterButton, Footnote, Group, HStack, Icon, Image, Input, Link, List, Page, Placeholder, Popup, ProgressSteps, Radio, RootProvider, Search, Spacer, Subheader, Switch, TabBar, Text, TextArea, ToggleButton, Token, VStack, VisuallyHidden, useStatusSheet };
|
|
3753
|
+
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, ListProps, PageHeaderProps, PageMainProps, PageProps, PageTabsProps, PlaceholderProps, PopupProps, ProgressStepsProps, RadioProps, RootProviderProps, SearchProps, Space, SpacerProps, StackAlignment, StatusSheetAction, StatusSheetInstance, StatusSheetOptions, StatusSheetVariant, SubheaderProps, SubheaderVariant, SwitchProps, TabBarItem, TabBarProps, TabBarVariant, TextAreaProps, TextProps, TextVariant, ThemeBackground, ThemeMode, ToggleButtonProps, VStackProps, VisuallyHiddenProps };
|