@webority/mobile-ui 0.11.1 → 0.12.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/lib/commonjs/components/Avatar/Avatar.js +1 -1
- package/lib/commonjs/components/BottomNavigation/BottomNavigation.js +1 -1
- package/lib/commonjs/components/BottomSheet/BottomSheet.js +1 -1
- package/lib/commonjs/components/Card/Card.js +1 -1
- package/lib/commonjs/components/Chip/Chip.js +1 -1
- package/lib/commonjs/components/DatePicker/DatePicker.js +1 -1
- package/lib/commonjs/components/DateRangePicker/DateRangePicker.js +1 -1
- package/lib/commonjs/components/EmptyState/EmptyState.js +1 -1
- package/lib/commonjs/components/FileViewer/FileViewer.js +1 -1
- package/lib/commonjs/components/FileViewer/FileViewerPage.js +1 -0
- package/lib/commonjs/components/FileViewer/useFileViewerZoom.js +1 -0
- package/lib/commonjs/components/FilterChipRow/FilterChipRow.js +1 -0
- package/lib/commonjs/components/FilterChipRow/index.js +1 -0
- package/lib/commonjs/components/FloatingActionButton/FloatingActionButton.js +1 -1
- package/lib/commonjs/components/Input/Input.js +1 -1
- package/lib/commonjs/components/KeyboardAwareScrollView/KeyboardAwareScrollView.js +1 -1
- package/lib/commonjs/components/LoaderOverlay/LoaderOverlay.js +1 -1
- package/lib/commonjs/components/Menu/MenuSurface.js +1 -1
- package/lib/commonjs/components/Modal/Modal.js +1 -1
- package/lib/commonjs/components/ModalSafeArea/ModalSafeArea.js +1 -0
- package/lib/commonjs/components/OptionSheet/OptionSheet.js +1 -1
- package/lib/commonjs/components/PhoneNumberInput/PhoneNumberInput.js +1 -1
- package/lib/commonjs/components/ProfilePicker/ProfilePicker.js +1 -1
- package/lib/commonjs/components/ProgressBar/ProgressBar.js +1 -1
- package/lib/commonjs/components/SearchBar/SearchBar.js +1 -1
- package/lib/commonjs/components/SignaturePad/SignaturePad.js +1 -1
- package/lib/commonjs/components/Slider/Slider.js +1 -1
- package/lib/commonjs/components/SquircleView/SquircleView.js +1 -0
- package/lib/commonjs/components/SquircleView/index.js +1 -0
- package/lib/commonjs/components/TimePicker/TimePicker.js +1 -1
- package/lib/commonjs/components/Tooltip/Tooltip.js +1 -1
- package/lib/commonjs/components/index.js +1 -1
- package/lib/commonjs/form/useForm.js +1 -1
- package/lib/commonjs/hooks/useDragToDismiss.js +1 -1
- package/lib/commonjs/theme/tokens.js +1 -1
- package/lib/module/components/Avatar/Avatar.js +1 -1
- package/lib/module/components/BottomNavigation/BottomNavigation.js +1 -1
- package/lib/module/components/BottomSheet/BottomSheet.js +1 -1
- package/lib/module/components/Card/Card.js +1 -1
- package/lib/module/components/Chip/Chip.js +1 -1
- package/lib/module/components/DatePicker/DatePicker.js +1 -1
- package/lib/module/components/DateRangePicker/DateRangePicker.js +1 -1
- package/lib/module/components/EmptyState/EmptyState.js +1 -1
- package/lib/module/components/FileViewer/FileViewer.js +1 -1
- package/lib/module/components/FileViewer/FileViewerPage.js +1 -0
- package/lib/module/components/FileViewer/useFileViewerZoom.js +1 -0
- package/lib/module/components/FilterChipRow/FilterChipRow.js +1 -0
- package/lib/module/components/FilterChipRow/index.js +1 -0
- package/lib/module/components/FloatingActionButton/FloatingActionButton.js +1 -1
- package/lib/module/components/Input/Input.js +1 -1
- package/lib/module/components/KeyboardAwareScrollView/KeyboardAwareScrollView.js +1 -1
- package/lib/module/components/LoaderOverlay/LoaderOverlay.js +1 -1
- package/lib/module/components/Menu/MenuSurface.js +1 -1
- package/lib/module/components/Modal/Modal.js +1 -1
- package/lib/module/components/ModalSafeArea/ModalSafeArea.js +1 -0
- package/lib/module/components/OptionSheet/OptionSheet.js +1 -1
- package/lib/module/components/PhoneNumberInput/PhoneNumberInput.js +1 -1
- package/lib/module/components/ProgressBar/ProgressBar.js +1 -1
- package/lib/module/components/SearchBar/SearchBar.js +1 -1
- package/lib/module/components/SignaturePad/SignaturePad.js +1 -1
- package/lib/module/components/Slider/Slider.js +1 -1
- package/lib/module/components/SquircleView/SquircleView.js +1 -0
- package/lib/module/components/SquircleView/index.js +1 -0
- package/lib/module/components/TimePicker/TimePicker.js +1 -1
- package/lib/module/components/Tooltip/Tooltip.js +1 -1
- package/lib/module/components/index.js +1 -1
- package/lib/module/form/useForm.js +1 -1
- package/lib/module/hooks/useDragToDismiss.js +1 -1
- package/lib/module/theme/tokens.js +1 -1
- package/lib/typescript/commonjs/components/Avatar/Avatar.d.ts +25 -1
- package/lib/typescript/commonjs/components/Chip/Chip.d.ts +15 -2
- package/lib/typescript/commonjs/components/FileViewer/FileViewer.d.ts +21 -10
- package/lib/typescript/commonjs/components/FileViewer/FileViewerPage.d.ts +12 -0
- package/lib/typescript/commonjs/components/FileViewer/useFileViewerZoom.d.ts +41 -0
- package/lib/typescript/commonjs/components/FilterChipRow/FilterChipRow.d.ts +55 -0
- package/lib/typescript/commonjs/components/FilterChipRow/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/FloatingActionButton/FloatingActionButton.d.ts +8 -0
- package/lib/typescript/commonjs/components/ModalSafeArea/ModalSafeArea.d.ts +26 -0
- package/lib/typescript/commonjs/components/SignaturePad/SignaturePad.d.ts +8 -2
- package/lib/typescript/commonjs/components/SquircleView/SquircleView.d.ts +22 -0
- package/lib/typescript/commonjs/components/SquircleView/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/index.d.ts +4 -0
- package/lib/typescript/commonjs/theme/types.d.ts +4 -0
- package/lib/typescript/module/components/Avatar/Avatar.d.ts +25 -1
- package/lib/typescript/module/components/Chip/Chip.d.ts +15 -2
- package/lib/typescript/module/components/FileViewer/FileViewer.d.ts +21 -10
- package/lib/typescript/module/components/FileViewer/FileViewerPage.d.ts +12 -0
- package/lib/typescript/module/components/FileViewer/useFileViewerZoom.d.ts +41 -0
- package/lib/typescript/module/components/FilterChipRow/FilterChipRow.d.ts +55 -0
- package/lib/typescript/module/components/FilterChipRow/index.d.ts +3 -0
- package/lib/typescript/module/components/FloatingActionButton/FloatingActionButton.d.ts +8 -0
- package/lib/typescript/module/components/ModalSafeArea/ModalSafeArea.d.ts +26 -0
- package/lib/typescript/module/components/SignaturePad/SignaturePad.d.ts +8 -2
- package/lib/typescript/module/components/SquircleView/SquircleView.d.ts +22 -0
- package/lib/typescript/module/components/SquircleView/index.d.ts +3 -0
- package/lib/typescript/module/components/index.d.ts +4 -0
- package/lib/typescript/module/theme/types.d.ts +4 -0
- package/package.json +3 -3
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/** A zoom that ends at or below this counts as none and springs back to 1x. */
|
|
2
|
+
export declare const ZOOM_REST = 1.01;
|
|
3
|
+
interface UseFileViewerZoomOptions {
|
|
4
|
+
zoomEnabled: boolean;
|
|
5
|
+
maxZoom: number;
|
|
6
|
+
viewportWidth: number;
|
|
7
|
+
viewportHeight: number;
|
|
8
|
+
/** The furthest the document scrolls, so a pan carried into the scroll stops at the end. */
|
|
9
|
+
maxScroll: number;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* FileViewer's zoom: a scale and translate on the whole scroll view, so the
|
|
13
|
+
* maths stays in viewport space. Pinch zooms around the fingers, a double tap
|
|
14
|
+
* zooms in on the tap or back out, and while zoomed a one-finger drag pans and,
|
|
15
|
+
* past the zoomed page's top or bottom edge, carries on into the document's
|
|
16
|
+
* scroll. `zoomLevel` reaches React only when a gesture settles, never per frame.
|
|
17
|
+
*/
|
|
18
|
+
export declare const useFileViewerZoom: ({ zoomEnabled, maxZoom, viewportWidth, viewportHeight, maxScroll }: UseFileViewerZoomOptions) => {
|
|
19
|
+
scrollRef: import("react-native-reanimated").AnimatedRef<import("react-native").ReactNativeElement>;
|
|
20
|
+
scrollGesture: import("react-native-gesture-handler/lib/typescript/handlers/gestures/nativeGesture").NativeGesture;
|
|
21
|
+
zoomGesture: import("react-native-gesture-handler/lib/typescript/handlers/gestures/gestureComposition").SimultaneousGesture;
|
|
22
|
+
zoomStyle: import("react-native-reanimated/lib/typescript/hook/commonTypes").AnimatedStyleHandle<{
|
|
23
|
+
transform: ({
|
|
24
|
+
translateX: number;
|
|
25
|
+
translateY?: undefined;
|
|
26
|
+
scale?: undefined;
|
|
27
|
+
} | {
|
|
28
|
+
translateY: number;
|
|
29
|
+
translateX?: undefined;
|
|
30
|
+
scale?: undefined;
|
|
31
|
+
} | {
|
|
32
|
+
scale: number;
|
|
33
|
+
translateX?: undefined;
|
|
34
|
+
translateY?: undefined;
|
|
35
|
+
})[];
|
|
36
|
+
}>;
|
|
37
|
+
zoomLevel: number;
|
|
38
|
+
resetZoom: () => void;
|
|
39
|
+
};
|
|
40
|
+
export {};
|
|
41
|
+
//# sourceMappingURL=useFileViewerZoom.d.ts.map
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FilterChipRow: a horizontal row of single-choice filter chips, each with an
|
|
3
|
+
* optional count ("Open 4"), above a list.
|
|
4
|
+
*
|
|
5
|
+
* The row scrolls edge to edge: `bleed` pulls it out by the page gutter on both
|
|
6
|
+
* sides and pads its content by the same amount, so the first chip lines up
|
|
7
|
+
* with the page content and the row still runs to the screen edge. Choosing a
|
|
8
|
+
* chip scrolls the row to centre it, so one past the screen edge never stays
|
|
9
|
+
* out of sight. The first placement is not animated; later ones glide, unless
|
|
10
|
+
* the OS asks for reduced motion.
|
|
11
|
+
*
|
|
12
|
+
* Accessibility is a radiogroup of radios, like SegmentedControl and
|
|
13
|
+
* ChoiceGroup: a filter picks a value on the same data. Sections of a screen
|
|
14
|
+
* are `Tabs`, not this.
|
|
15
|
+
*/
|
|
16
|
+
import type { View as RNView, StyleProp, ViewStyle } from 'react-native';
|
|
17
|
+
import type { HapticType } from '../../utils/index.js';
|
|
18
|
+
import type { ChipSize, ChipTone, ChipVariant } from '../Chip/index.js';
|
|
19
|
+
export interface FilterChipItem {
|
|
20
|
+
/** Stable id of the chip; `value` and `onChange` carry it. */
|
|
21
|
+
key: string;
|
|
22
|
+
label: string;
|
|
23
|
+
/** Shown after the label; leave it undefined while it loads and the label shows alone. */
|
|
24
|
+
count?: number | string;
|
|
25
|
+
disabled?: boolean;
|
|
26
|
+
}
|
|
27
|
+
export interface FilterChipRowProps {
|
|
28
|
+
items: ReadonlyArray<FilterChipItem>;
|
|
29
|
+
/** Key of the selected item. */
|
|
30
|
+
value: string;
|
|
31
|
+
/** Fired with the key of a chip the person picks. Not fired for the chip that is already selected. */
|
|
32
|
+
onChange: (key: string) => void;
|
|
33
|
+
/**
|
|
34
|
+
* The page gutter in points. The row extends this far past its parent on
|
|
35
|
+
* both sides and pads its content by the same amount. The theme carries no
|
|
36
|
+
* screen gutter, so the default is 0 (the row stays inside its parent).
|
|
37
|
+
*/
|
|
38
|
+
bleed?: number;
|
|
39
|
+
size?: ChipSize;
|
|
40
|
+
variant?: ChipVariant;
|
|
41
|
+
tone?: ChipTone;
|
|
42
|
+
/** Haptic feedback for interactions. Pass false to disable; pass a HapticType to override the default. */
|
|
43
|
+
haptic?: HapticType | false;
|
|
44
|
+
/** Names the radiogroup for screen readers, e.g. "Filter by status". */
|
|
45
|
+
accessibilityLabel?: string;
|
|
46
|
+
/** Style of the outer view, applied after the bleed margin. */
|
|
47
|
+
style?: StyleProp<ViewStyle>;
|
|
48
|
+
/** Style of the scrolling content, applied after the bleed padding and the chip gap. */
|
|
49
|
+
contentContainerStyle?: StyleProp<ViewStyle>;
|
|
50
|
+
testID?: string;
|
|
51
|
+
}
|
|
52
|
+
declare const FilterChipRow: import("react").ForwardRefExoticComponent<FilterChipRowProps & import("react").RefAttributes<RNView>>;
|
|
53
|
+
export { FilterChipRow };
|
|
54
|
+
export default FilterChipRow;
|
|
55
|
+
//# sourceMappingURL=FilterChipRow.d.ts.map
|
|
@@ -8,7 +8,15 @@ export interface FloatingActionButtonProps {
|
|
|
8
8
|
/** JSX element for the icon. The FAB sizes it via the `size` prop's iconSize token. */
|
|
9
9
|
icon: React.ReactNode;
|
|
10
10
|
onPress: () => void;
|
|
11
|
+
/** Text beside the icon; makes the button extended (a pill). */
|
|
11
12
|
label?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Folds an extended button to its round icon alone (the size's diameter) with
|
|
15
|
+
* the label fading out, and unfolds it when false. Drive it from scroll state
|
|
16
|
+
* to cover less of the rows moving underneath. Does nothing without a `label`;
|
|
17
|
+
* the accessibility label is unchanged. Independent of `hideOnScroll`.
|
|
18
|
+
*/
|
|
19
|
+
collapsed?: boolean;
|
|
12
20
|
size?: FloatingActionButtonSize;
|
|
13
21
|
tone?: FloatingActionButtonTone;
|
|
14
22
|
position?: FloatingActionButtonPosition;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import { type Dispatch, type SetStateAction } from 'react';
|
|
3
|
+
export interface ModalInsets {
|
|
4
|
+
top: number;
|
|
5
|
+
bottom: number;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Top and bottom insets of the window a native Modal draws in, seeded from the
|
|
9
|
+
* app-level provider and corrected once the Modal's own provider reports.
|
|
10
|
+
* Pass the setter to `ModalSafeArea` as `onInsets`.
|
|
11
|
+
*/
|
|
12
|
+
export declare const useModalInsets: () => [ModalInsets, Dispatch<SetStateAction<ModalInsets>>];
|
|
13
|
+
/** Reports the nearest provider's top and bottom insets up; renders nothing. */
|
|
14
|
+
export declare const InsetsProbe: React.FC<{
|
|
15
|
+
onChange: Dispatch<SetStateAction<ModalInsets>>;
|
|
16
|
+
}>;
|
|
17
|
+
/**
|
|
18
|
+
* Wrap a native Modal's content in this: the app-level provider measures the
|
|
19
|
+
* app window (bottom inset 0 under Android's navigation bar when the app is
|
|
20
|
+
* not edge to edge), not the translucent Modal window the content is drawn in.
|
|
21
|
+
*/
|
|
22
|
+
export declare const ModalSafeArea: React.FC<{
|
|
23
|
+
onInsets: Dispatch<SetStateAction<ModalInsets>>;
|
|
24
|
+
children: React.ReactNode;
|
|
25
|
+
}>;
|
|
26
|
+
//# sourceMappingURL=ModalSafeArea.d.ts.map
|
|
@@ -71,9 +71,15 @@ export interface SignaturePadProps {
|
|
|
71
71
|
height?: number;
|
|
72
72
|
/** Longest typed name. Default 100. */
|
|
73
73
|
maxNameLength?: number;
|
|
74
|
-
/**
|
|
74
|
+
/**
|
|
75
|
+
* Ink of the strokes and the typed name, on the pad and in `toFile()` and `toSvg()`. With neither
|
|
76
|
+
* `inkColor` nor `paperColor` set, the pad follows the active theme (primary text on the elevated
|
|
77
|
+
* surface), while `toFile()` and `toSvg()` stay the library's dark ink on light paper in every
|
|
78
|
+
* colour scheme so the file is ready for a document. Set one and the other keeps the light
|
|
79
|
+
* theme's colour.
|
|
80
|
+
*/
|
|
75
81
|
inkColor?: string;
|
|
76
|
-
/** Ground of the pad and of the PNG.
|
|
82
|
+
/** Ground of the pad and of the PNG. See `inkColor` for the defaults. */
|
|
77
83
|
paperColor?: string;
|
|
78
84
|
/**
|
|
79
85
|
* Font family of the typed name. Default a system script face: Snell Roundhand on iOS, `cursive`
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { View as RNView, ViewProps } from 'react-native';
|
|
2
|
+
export type SquircleViewProps = ViewProps;
|
|
3
|
+
/**
|
|
4
|
+
* A `View` whose rounded corners are smooth on both platforms, for a surface
|
|
5
|
+
* the library has no component for (a photo tile, a signature pad frame).
|
|
6
|
+
* Give it `borderRadius`, and `backgroundColor` and a border in `style`.
|
|
7
|
+
*
|
|
8
|
+
* iOS draws the continuous curve natively (`borderCurve`). Android draws the
|
|
9
|
+
* fill and border as one SVG path behind the children, with the theme's
|
|
10
|
+
* `cornerSmoothing`, so it matches Box, Card and Button. The view keeps its
|
|
11
|
+
* native corner until it is measured, and where the curve cannot apply: a
|
|
12
|
+
* radius under 6, a pill, a different radius or border per corner or side, a
|
|
13
|
+
* dashed border, `overflow: 'hidden'`, `elevation`, or a colour that is not a
|
|
14
|
+
* string.
|
|
15
|
+
*
|
|
16
|
+
* Children are not clipped to the curve. Use `Card` or `Box` when the surface
|
|
17
|
+
* is a themed card or a spacing container.
|
|
18
|
+
*/
|
|
19
|
+
declare const SquircleView: import("react").ForwardRefExoticComponent<ViewProps & import("react").RefAttributes<RNView>>;
|
|
20
|
+
export { SquircleView };
|
|
21
|
+
export default SquircleView;
|
|
22
|
+
//# sourceMappingURL=SquircleView.d.ts.map
|
|
@@ -68,6 +68,8 @@ export type { FilePickerFile, FilePickerFileState, FilePickerFileStatus, FilePic
|
|
|
68
68
|
export { FilePicker, formatFileSize } from './FilePicker/index.js';
|
|
69
69
|
export type { FileViewerProps, FileViewerSource } from './FileViewer/index.js';
|
|
70
70
|
export { FileViewer } from './FileViewer/index.js';
|
|
71
|
+
export type { FilterChipItem, FilterChipRowProps } from './FilterChipRow/index.js';
|
|
72
|
+
export { FilterChipRow } from './FilterChipRow/index.js';
|
|
71
73
|
export type { FloatingActionButtonGroupAction, FloatingActionButtonGroupProps, FloatingActionButtonPosition, FloatingActionButtonProps, FloatingActionButtonSize, FloatingActionButtonTone } from './FloatingActionButton/index.js';
|
|
72
74
|
export { FloatingActionButton, FloatingActionButtonGroup } from './FloatingActionButton/index.js';
|
|
73
75
|
export type { ForceUpdateDialogProps } from './ForceUpdateDialog/index.js';
|
|
@@ -160,6 +162,8 @@ export type { SparklineProps, SparklineTone } from './Sparkline/index.js';
|
|
|
160
162
|
export { Sparkline } from './Sparkline/index.js';
|
|
161
163
|
export type { SpinnerProps, SpinnerSize, SpinnerVariant } from './Spinner/index.js';
|
|
162
164
|
export { Spinner } from './Spinner/index.js';
|
|
165
|
+
export type { SquircleViewProps } from './SquircleView/index.js';
|
|
166
|
+
export { SquircleView } from './SquircleView/index.js';
|
|
163
167
|
export type { StatTileProps, StatTileTrend } from './StatTile/index.js';
|
|
164
168
|
export { StatTile } from './StatTile/index.js';
|
|
165
169
|
export type { StatusBadgeProps, StatusBadgeSize, StatusBadgeTone, StatusBadgeVariant } from './StatusBadge/index.js';
|
|
@@ -359,6 +359,10 @@ export interface EmptyStateSizeTokens {
|
|
|
359
359
|
descriptionFontSize: keyof TypographyScale['fontSize'];
|
|
360
360
|
/** Resolves against the active theme's spacing scale. */
|
|
361
361
|
paddingVertical: keyof SpacingScale;
|
|
362
|
+
/** Space between the icon and the title; a spacing scale key. Library default: "md". */
|
|
363
|
+
titleGap?: keyof SpacingScale;
|
|
364
|
+
/** Space between the title and the description; a spacing scale key. Library default: "xs". */
|
|
365
|
+
descriptionGap?: keyof SpacingScale;
|
|
362
366
|
}
|
|
363
367
|
export interface ListItemSizeTokens {
|
|
364
368
|
/** Resolves against the active theme's spacing scale. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webority/mobile-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.1",
|
|
4
4
|
"description": "Beautiful, animated, accessible React Native components, theme and form engine for Webority projects.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-native",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
}
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
|
-
"@webority/mobile-core": ">=0.
|
|
63
|
+
"@webority/mobile-core": ">=0.12.0 <0.13.0",
|
|
64
64
|
"expo": ">=57.0.0",
|
|
65
65
|
"expo-file-system": ">=57.0.0",
|
|
66
66
|
"expo-haptics": ">=57.0.0",
|
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
]
|
|
108
108
|
},
|
|
109
109
|
"devDependencies": {
|
|
110
|
-
"@webority/mobile-core": "0.
|
|
110
|
+
"@webority/mobile-core": "0.12.1"
|
|
111
111
|
},
|
|
112
112
|
"scripts": {
|
|
113
113
|
"build": "bob build && node ../../scripts/minify-lib.mjs",
|