panelui-native 0.108.0 → 0.110.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/lib/module/components/avatar-cropper/avatar-cropper-math.js +320 -0
- package/lib/module/components/avatar-cropper/avatar-cropper-math.js.map +1 -0
- package/lib/module/components/avatar-cropper/index.js +656 -0
- package/lib/module/components/avatar-cropper/index.js.map +1 -0
- package/lib/module/components/badge/index.js +85 -4
- package/lib/module/components/badge/index.js.map +1 -1
- package/lib/module/components/button/index.js +12 -0
- package/lib/module/components/button/index.js.map +1 -1
- package/lib/module/components/button-group/index.js +3 -0
- package/lib/module/components/button-group/index.js.map +1 -1
- package/lib/module/components/checkbox/index.js +54 -4
- package/lib/module/components/checkbox/index.js.map +1 -1
- package/lib/module/components/chip/index.js +23 -1
- package/lib/module/components/chip/index.js.map +1 -1
- package/lib/module/components/input/index.js +14 -0
- package/lib/module/components/input/index.js.map +1 -1
- package/lib/module/components/map/index.js +157 -5
- package/lib/module/components/map/index.js.map +1 -1
- package/lib/module/components/map/map-insets.js +174 -0
- package/lib/module/components/map/map-insets.js.map +1 -0
- package/lib/module/components/radio-group/index.js +49 -3
- package/lib/module/components/radio-group/index.js.map +1 -1
- package/lib/module/components/select/index.js +54 -2
- package/lib/module/components/select/index.js.map +1 -1
- package/lib/module/components/switch/index.js +42 -3
- package/lib/module/components/switch/index.js.map +1 -1
- package/lib/module/components/tabs/index.js +147 -1
- package/lib/module/components/tabs/index.js.map +1 -1
- package/lib/module/components/textarea/index.js +18 -0
- package/lib/module/components/textarea/index.js.map +1 -1
- package/lib/module/components/toggle-button/index.js +34 -2
- package/lib/module/components/toggle-button/index.js.map +1 -1
- package/lib/module/icons/index.js +6 -0
- package/lib/module/icons/index.js.map +1 -1
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/providers/panel-ui-provider.js +22 -10
- package/lib/module/providers/panel-ui-provider.js.map +1 -1
- package/lib/typescript/src/components/avatar-cropper/avatar-cropper-math.d.ts +98 -0
- package/lib/typescript/src/components/avatar-cropper/avatar-cropper-math.d.ts.map +1 -0
- package/lib/typescript/src/components/avatar-cropper/index.d.ts +168 -0
- package/lib/typescript/src/components/avatar-cropper/index.d.ts.map +1 -0
- package/lib/typescript/src/components/badge/index.d.ts +68 -0
- package/lib/typescript/src/components/badge/index.d.ts.map +1 -1
- package/lib/typescript/src/components/button/index.d.ts +12 -0
- package/lib/typescript/src/components/button/index.d.ts.map +1 -1
- package/lib/typescript/src/components/button-group/index.d.ts +9 -0
- package/lib/typescript/src/components/button-group/index.d.ts.map +1 -1
- package/lib/typescript/src/components/checkbox/index.d.ts +89 -0
- package/lib/typescript/src/components/checkbox/index.d.ts.map +1 -1
- package/lib/typescript/src/components/chip/index.d.ts +24 -0
- package/lib/typescript/src/components/chip/index.d.ts.map +1 -1
- package/lib/typescript/src/components/input/index.d.ts +30 -0
- package/lib/typescript/src/components/input/index.d.ts.map +1 -1
- package/lib/typescript/src/components/map/index.d.ts +67 -1
- package/lib/typescript/src/components/map/index.d.ts.map +1 -1
- package/lib/typescript/src/components/map/map-insets.d.ts +80 -0
- package/lib/typescript/src/components/map/map-insets.d.ts.map +1 -0
- package/lib/typescript/src/components/radio-group/index.d.ts +188 -1
- package/lib/typescript/src/components/radio-group/index.d.ts.map +1 -1
- package/lib/typescript/src/components/select/index.d.ts +9 -1
- package/lib/typescript/src/components/select/index.d.ts.map +1 -1
- package/lib/typescript/src/components/switch/index.d.ts +38 -0
- package/lib/typescript/src/components/switch/index.d.ts.map +1 -1
- package/lib/typescript/src/components/tabs/index.d.ts +10 -1
- package/lib/typescript/src/components/tabs/index.d.ts.map +1 -1
- package/lib/typescript/src/components/textarea/index.d.ts +18 -0
- package/lib/typescript/src/components/textarea/index.d.ts.map +1 -1
- package/lib/typescript/src/components/toggle-button/index.d.ts +24 -0
- package/lib/typescript/src/components/toggle-button/index.d.ts.map +1 -1
- package/lib/typescript/src/icons/index.d.ts +2 -0
- package/lib/typescript/src/icons/index.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +8 -7
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/providers/panel-ui-provider.d.ts.map +1 -1
- package/package.json +9 -1
- package/src/components/avatar-cropper/avatar-cropper-math.ts +311 -0
- package/src/components/avatar-cropper/index.tsx +808 -0
- package/src/components/badge/index.tsx +30 -4
- package/src/components/button/index.tsx +9 -2
- package/src/components/button-group/index.tsx +1 -0
- package/src/components/checkbox/index.tsx +47 -3
- package/src/components/chip/index.tsx +5 -1
- package/src/components/input/index.tsx +6 -0
- package/src/components/map/index.tsx +215 -5
- package/src/components/map/map-insets.ts +169 -0
- package/src/components/radio-group/index.tsx +56 -4
- package/src/components/select/index.tsx +50 -1
- package/src/components/switch/index.tsx +16 -4
- package/src/components/tabs/index.tsx +61 -0
- package/src/components/textarea/index.tsx +6 -0
- package/src/components/toggle-button/index.tsx +16 -1
- package/src/icons/index.tsx +3 -0
- package/src/index.ts +24 -3
- package/src/providers/panel-ui-provider.tsx +21 -11
|
@@ -47,21 +47,33 @@ function KeyboardPassthrough({
|
|
|
47
47
|
});
|
|
48
48
|
}
|
|
49
49
|
let keyboardProvider;
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* The controller's provider, or undefined when it cannot be used.
|
|
53
|
+
*
|
|
54
|
+
* The `require` has to stay a statement directly inside the `try` block, with
|
|
55
|
+
* the native check as an early return above it rather than an `if` around it.
|
|
56
|
+
* Metro resolves every literal `require` when it bundles, and it only lets a
|
|
57
|
+
* missing package through when the call sits directly in a `try` block — one
|
|
58
|
+
* `if` deeper and it is a hard dependency, so an app without the controller
|
|
59
|
+
* fails to build before this `catch` could ever run.
|
|
60
|
+
* `test/optional-requires.test.mjs` holds every optional peer to that.
|
|
61
|
+
*/
|
|
62
|
+
function loadKeyboardProvider() {
|
|
53
63
|
try {
|
|
54
|
-
if (TurboModuleRegistry.get('KeyboardController')
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
64
|
+
if (TurboModuleRegistry.get('KeyboardController') === null) return undefined;
|
|
65
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
66
|
+
const controller = require('react-native-keyboard-controller');
|
|
67
|
+
return controller?.KeyboardProvider;
|
|
59
68
|
} catch {
|
|
60
69
|
// Not installed, or installed without its native half. Either way the
|
|
61
70
|
// pass-through is the answer.
|
|
71
|
+
return undefined;
|
|
62
72
|
}
|
|
63
|
-
|
|
64
|
-
|
|
73
|
+
}
|
|
74
|
+
function resolveKeyboardProvider() {
|
|
75
|
+
if (!keyboardProvider) keyboardProvider = loadKeyboardProvider() ?? KeyboardPassthrough;
|
|
76
|
+
return keyboardProvider;
|
|
65
77
|
}
|
|
66
78
|
/**
|
|
67
79
|
* Root provider for PanelUI. Owns three things:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Platform","StyleSheet","TurboModuleRegistry","View","GestureHandlerRootView","PortalHost","PortalProvider","useModalIsolationActive","ToastViewport","cn","Fragment","_Fragment","jsx","_jsx","jsxs","_jsxs","KeyboardPassthrough","children","keyboardProvider","
|
|
1
|
+
{"version":3,"names":["Platform","StyleSheet","TurboModuleRegistry","View","GestureHandlerRootView","PortalHost","PortalProvider","useModalIsolationActive","ToastViewport","cn","Fragment","_Fragment","jsx","_jsx","jsxs","_jsxs","KeyboardPassthrough","children","keyboardProvider","loadKeyboardProvider","get","undefined","controller","require","KeyboardProvider","resolveKeyboardProvider","PanelUIProvider","className","background","statusBarTranslucent","navigationBarTranslucent","style","styles","root","ProviderSurface","modalActive","isolateApp","OS","collapsable","content","importantForAccessibility","create","flex"],"sourceRoot":"../../../src","sources":["providers/panel-ui-provider.tsx"],"mappings":";;AACA,SAASA,QAAQ,EAAEC,UAAU,EAAEC,mBAAmB,EAAEC,IAAI,QAAQ,cAAc;AAC9E,SAASC,sBAAsB,QAAQ,8BAA8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[]}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The geometry behind the avatar cropper, kept apart from the component.
|
|
3
|
+
*
|
|
4
|
+
* The mask stays fixed in the middle of the canvas and the photo moves under
|
|
5
|
+
* it, so everything here is one question asked different ways: where is the
|
|
6
|
+
* mask, measured in the photo's own frame? Clamping asks it to keep the mask
|
|
7
|
+
* on the photo, and the export asks it to find the same square in the photo's
|
|
8
|
+
* pixels.
|
|
9
|
+
*
|
|
10
|
+
* The photo is drawn at a base size whose short side equals the mask, then
|
|
11
|
+
* moved by `x`/`y`, turned by `rotation` and scaled by `scale` about its own
|
|
12
|
+
* centre — the order React Native applies `translate`, `rotate`, `scale` in a
|
|
13
|
+
* transform. Every function runs on the UI thread inside a gesture or an
|
|
14
|
+
* animated style, so each is a worklet, and none touches React Native, which
|
|
15
|
+
* is what lets the contract tests run them in Node.
|
|
16
|
+
*/
|
|
17
|
+
export type CropShape = 'circle' | 'squircle' | 'square';
|
|
18
|
+
export interface Size {
|
|
19
|
+
width: number;
|
|
20
|
+
height: number;
|
|
21
|
+
}
|
|
22
|
+
/** Where the photo sits under the mask. Rotation is in degrees, clockwise. */
|
|
23
|
+
export interface CropState {
|
|
24
|
+
x: number;
|
|
25
|
+
y: number;
|
|
26
|
+
scale: number;
|
|
27
|
+
rotation: number;
|
|
28
|
+
}
|
|
29
|
+
/** The fixed parts: the mask's side, and the photo's size at a scale of 1. */
|
|
30
|
+
export interface CropFrame {
|
|
31
|
+
mask: number;
|
|
32
|
+
image: Size;
|
|
33
|
+
}
|
|
34
|
+
/** A crop in the source's pixels, after the source is turned by `rotation`. */
|
|
35
|
+
export interface SourceCrop {
|
|
36
|
+
/** The rectangle to cut, in the turned image's pixels. Always square. */
|
|
37
|
+
originX: number;
|
|
38
|
+
originY: number;
|
|
39
|
+
width: number;
|
|
40
|
+
height: number;
|
|
41
|
+
/** Degrees to turn the source by first, clockwise, in (-180, 180]. */
|
|
42
|
+
rotation: number;
|
|
43
|
+
/** The size of the turned image the rectangle is measured in. */
|
|
44
|
+
canvas: Size;
|
|
45
|
+
}
|
|
46
|
+
export declare const IDENTITY: CropState;
|
|
47
|
+
export declare function clamp(value: number, min: number, max: number): number;
|
|
48
|
+
/** An angle folded into (-180, 180]. */
|
|
49
|
+
export declare function normalizeDegrees(degrees: number): number;
|
|
50
|
+
/** The photo's size at a scale of 1: its short side exactly covers the mask. */
|
|
51
|
+
export declare function baseSize(source: Size, mask: number): Size;
|
|
52
|
+
/**
|
|
53
|
+
* Half the mask's extent along the photo's axes, in screen points.
|
|
54
|
+
*
|
|
55
|
+
* A circle reaches the same distance whichever way the photo is turned. A
|
|
56
|
+
* square turned against the photo reaches further — out to its corners — and
|
|
57
|
+
* the squircle is held to its square, which contains it, so its corners can
|
|
58
|
+
* never come off the photo either.
|
|
59
|
+
*/
|
|
60
|
+
export declare function maskReach(shape: CropShape, mask: number, rotation: number): number;
|
|
61
|
+
/** The smallest scale at which the photo still covers the whole mask. */
|
|
62
|
+
export declare function minScale(shape: CropShape, rotation: number): number;
|
|
63
|
+
/** The nearest translation that keeps the mask on the photo. */
|
|
64
|
+
export declare function clampTranslation(state: CropState, shape: CropShape, frame: CropFrame): {
|
|
65
|
+
x: number;
|
|
66
|
+
y: number;
|
|
67
|
+
};
|
|
68
|
+
/** The state a gesture settles into: in range, and covering the mask. */
|
|
69
|
+
export declare function settle(state: CropState, shape: CropShape, frame: CropFrame, maxZoom: number): CropState;
|
|
70
|
+
/** An overshoot past a bound, compressed so it gives but never runs away. */
|
|
71
|
+
export declare function rubberBand(overshoot: number, dimension: number): number;
|
|
72
|
+
/**
|
|
73
|
+
* What to draw while a gesture is still going: the raw state, with anything
|
|
74
|
+
* past a bound rubber-banded back towards it. At rest the raw state is already
|
|
75
|
+
* settled and this returns it unchanged.
|
|
76
|
+
*/
|
|
77
|
+
export declare function present(state: CropState, shape: CropShape, frame: CropFrame, maxZoom: number): CropState;
|
|
78
|
+
/** Scale by `factor` about a point, given relative to the canvas centre. */
|
|
79
|
+
export declare function zoomAbout(state: CropState, factor: number, fx: number, fy: number): CropState;
|
|
80
|
+
/** Turn by `degrees` about a point, given relative to the canvas centre. */
|
|
81
|
+
export declare function rotateAbout(state: CropState, degrees: number, ax: number, ay: number): CropState;
|
|
82
|
+
/** The next quarter turn from wherever the photo is, in either direction. */
|
|
83
|
+
export declare function nextQuarterTurn(rotation: number, direction: 1 | -1): number;
|
|
84
|
+
/**
|
|
85
|
+
* The square the mask covers, in the source's pixels.
|
|
86
|
+
*
|
|
87
|
+
* The export turns the source first and cuts an upright square from the
|
|
88
|
+
* result, because a turned square cannot be cut directly. Turning grows the
|
|
89
|
+
* canvas to the turned image's bounding box with the image still centred, and
|
|
90
|
+
* a point at `p` from the source's centre lands at `R(θ)·p` from the canvas
|
|
91
|
+
* centre. The mask's centre sits at `R(−θ)·(−x, −y) / scale` in the photo, so
|
|
92
|
+
* after the turn it lands at `−(x, y) / scale` — the rotation cancels, and the
|
|
93
|
+
* crop is the mask's offset scaled into pixels.
|
|
94
|
+
*/
|
|
95
|
+
export declare function sourceCrop(state: CropState, frame: CropFrame, source: Size): SourceCrop;
|
|
96
|
+
/** The mask's outline as an SVG path, centred on (`cx`, `cy`). */
|
|
97
|
+
export declare function maskPath(shape: CropShape, cx: number, cy: number, mask: number): string;
|
|
98
|
+
//# sourceMappingURL=avatar-cropper-math.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"avatar-cropper-math.d.ts","sourceRoot":"","sources":["../../../../../src/components/avatar-cropper/avatar-cropper-math.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,UAAU,GAAG,QAAQ,CAAC;AAEzD,MAAM,WAAW,IAAI;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,8EAA8E;AAC9E,MAAM,WAAW,SAAS;IACxB,CA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|
4
|
+
*
|
|
5
|
+
* ```tsx
|
|
6
|
+
* const cropper = useRef<AvatarCropperHandle>(null);
|
|
7
|
+
*
|
|
8
|
+
* <AvatarCropper ref={cropper} source={photo} className="flex-1">
|
|
9
|
+
* <AvatarCropper.Canvas />
|
|
10
|
+
* <View className="flex-row justify-between p-4">
|
|
11
|
+
* <AvatarCropper.Reset />
|
|
12
|
+
* <AvatarCropper.Rotate />
|
|
13
|
+
* </View>
|
|
14
|
+
* </AvatarCropper>
|
|
15
|
+
*
|
|
16
|
+
* const { uri } = await cropper.current!.crop({ size: 512 });
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* ## The mask stays put; the photo moves
|
|
20
|
+
*
|
|
21
|
+
* The mask sits in the middle of the canvas and never moves. Dragging, pinching
|
|
22
|
+
* and turning all move the photo underneath it, which is what makes the result
|
|
23
|
+
* predictable: the image you get back is exactly what is inside the outline
|
|
24
|
+
* when you press Done. The photo is never allowed to leave part of the mask
|
|
25
|
+
* empty — let go past an edge, or zoom out too far, and it springs back to the
|
|
26
|
+
* nearest position that covers it. At an angle that takes extra zoom for a
|
|
27
|
+
* square mask, whose corners reach further than a circle does, so the minimum
|
|
28
|
+
* zoom follows the angle.
|
|
29
|
+
*
|
|
30
|
+
* ## One surface, three gestures at once
|
|
31
|
+
*
|
|
32
|
+
* Pan, pinch and rotation are recognised together, so a two-finger gesture can
|
|
33
|
+
* move, zoom and turn in one motion the way a photo on a table would. Zoom and
|
|
34
|
+
* turn happen about the point between the fingers, which keeps whatever is
|
|
35
|
+
* under them under them.
|
|
36
|
+
*
|
|
37
|
+
* ## The export is the same arithmetic, in pixels
|
|
38
|
+
*
|
|
39
|
+
* `crop()` turns the source by the photo's angle, cuts the square the mask
|
|
40
|
+
* covers and scales it to the size asked for, through the optional
|
|
41
|
+
* `expo-image-manipulator`. The source is redrawn upright first: a camera photo
|
|
42
|
+
* often stores its orientation as a flag rather than in its pixels, and the
|
|
43
|
+
* turn and the cut both work on the raw pixels. `getCrop()` returns the same
|
|
44
|
+
* rectangle without any dependency, for an app that crops on its server.
|
|
45
|
+
*/
|
|
46
|
+
import { type ReactNode } from 'react';
|
|
47
|
+
import { type ViewProps } from 'react-native';
|
|
48
|
+
import { type ButtonProps } from '../button/index.js';
|
|
49
|
+
import { type CropShape, type SourceCrop } from './avatar-cropper-math.js';
|
|
50
|
+
export type { CropShape as AvatarCropperShape, SourceCrop as AvatarCrop };
|
|
51
|
+
/** True when `crop()` can write an image, because `expo-image-manipulator` is installed. */
|
|
52
|
+
export declare const hasAvatarCropperExport: boolean;
|
|
53
|
+
/** A photo to crop, as the picker returns it. */
|
|
54
|
+
export interface AvatarCropperSource {
|
|
55
|
+
/** A local file or `data:` URI. */
|
|
56
|
+
uri: string;
|
|
57
|
+
/** Width in pixels, upright. Measured from the image when left out. */
|
|
58
|
+
width?: number;
|
|
59
|
+
/** Height in pixels, upright. Measured from the image when left out. */
|
|
60
|
+
height?: number;
|
|
61
|
+
}
|
|
62
|
+
export interface PickAvatarImageOptions {
|
|
63
|
+
/** Where the photo comes from. Default `'library'`. */
|
|
64
|
+
from?: 'library' | 'camera';
|
|
65
|
+
/** JPEG quality of the picked photo, 0–1. Default 1, since the crop compresses it again. */
|
|
66
|
+
quality?: number;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Let the user choose a photo or take one, ready to pass to `AvatarCropper`.
|
|
70
|
+
*
|
|
71
|
+
* Resolves `null` when the user cancels. Taking a photo asks for camera
|
|
72
|
+
* permission first and throws when it is refused, so the app can explain why
|
|
73
|
+
* nothing happened. Choosing from the library needs no permission. The
|
|
74
|
+
* picker's own editing is left off, because the cropper is the editor.
|
|
75
|
+
*
|
|
76
|
+
* Needs the optional `expo-image-picker`, and throws if it is not installed.
|
|
77
|
+
* In a development build the camera also needs the permission strings from
|
|
78
|
+
* that package's config plugin.
|
|
79
|
+
*/
|
|
80
|
+
export declare function pickAvatarImage({ from, quality, }?: PickAvatarImageOptions): Promise<Required<AvatarCropperSource> | null>;
|
|
81
|
+
export interface AvatarCropResult {
|
|
82
|
+
/** The cropped image, written to the app's cache directory. */
|
|
83
|
+
uri: string;
|
|
84
|
+
width: number;
|
|
85
|
+
height: number;
|
|
86
|
+
}
|
|
87
|
+
export interface AvatarCropOptions {
|
|
88
|
+
/**
|
|
89
|
+
* Side of the image to write, in pixels. Default 1024. A crop with fewer
|
|
90
|
+
* pixels than this is written at its own size rather than scaled up.
|
|
91
|
+
*/
|
|
92
|
+
size?: number;
|
|
93
|
+
/** Default `'jpeg'`. Use `'png'` to keep transparency out of the question entirely. */
|
|
94
|
+
format?: 'jpeg' | 'png' | 'webp';
|
|
95
|
+
/** Quality, 0–1, for JPEG and WebP. Default 0.9. */
|
|
96
|
+
compress?: number;
|
|
97
|
+
}
|
|
98
|
+
export interface AvatarCropperHandle {
|
|
99
|
+
/**
|
|
100
|
+
* Write what the mask covers to a new square image. The image is square for
|
|
101
|
+
* every shape; draw it in a round `Avatar` to show it as a circle.
|
|
102
|
+
*
|
|
103
|
+
* Needs the optional `expo-image-manipulator`, and throws if it is not
|
|
104
|
+
* installed — use `getCrop()` then.
|
|
105
|
+
*/
|
|
106
|
+
crop(options?: AvatarCropOptions): Promise<AvatarCropResult>;
|
|
107
|
+
/**
|
|
108
|
+
* The rectangle the mask covers, in the source's pixels, after turning the
|
|
109
|
+
* source by `rotation` degrees clockwise. Null until the photo has been
|
|
110
|
+
* measured and laid out.
|
|
111
|
+
*/
|
|
112
|
+
getCrop(): SourceCrop | null;
|
|
113
|
+
/** Turn a quarter clockwise, or a quarter back with `-1`. */
|
|
114
|
+
rotate(direction?: 1 | -1): void;
|
|
115
|
+
/** Back to the photo centred, unzoomed and upright. */
|
|
116
|
+
reset(): void;
|
|
117
|
+
}
|
|
118
|
+
export interface AvatarCropperProps extends ViewProps {
|
|
119
|
+
/** The photo. Changing it starts the crop again from the centre. */
|
|
120
|
+
source: AvatarCropperSource;
|
|
121
|
+
/**
|
|
122
|
+
* The outline the photo is framed in. Default `'circle'`, which is how
|
|
123
|
+
* `Avatar` draws it. The image written out is square for every shape.
|
|
124
|
+
*/
|
|
125
|
+
shape?: CropShape;
|
|
126
|
+
/** How far the photo can be zoomed past filling the mask. Default 5. */
|
|
127
|
+
maxZoom?: number;
|
|
128
|
+
/** Space between the mask and the canvas's shorter side, in points. Default 24. */
|
|
129
|
+
inset?: number;
|
|
130
|
+
className?: string;
|
|
131
|
+
/** `AvatarCropper.Canvas` and any controls. Left out, the canvas alone. */
|
|
132
|
+
children?: ReactNode;
|
|
133
|
+
}
|
|
134
|
+
export interface AvatarCropperCanvasProps extends Omit<ViewProps, 'children'> {
|
|
135
|
+
className?: string;
|
|
136
|
+
/** What a screen reader calls the canvas. Default "Photo crop". */
|
|
137
|
+
accessibilityLabel?: string;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* The photo under its mask, and the surface every gesture lands on. It fills
|
|
141
|
+
* the space it is given, and the mask is drawn as large as the shorter side
|
|
142
|
+
* allows, less the root's `inset`.
|
|
143
|
+
*/
|
|
144
|
+
declare function AvatarCropperCanvas({ className, accessibilityLabel, onLayout, ...props }: AvatarCropperCanvasProps): import("react").JSX.Element;
|
|
145
|
+
declare namespace AvatarCropperCanvas {
|
|
146
|
+
var displayName: string;
|
|
147
|
+
}
|
|
148
|
+
export interface AvatarCropperRotateProps extends Omit<ButtonProps, 'onPress'> {
|
|
149
|
+
/** Which way a press turns the photo. Default `'clockwise'`. */
|
|
150
|
+
direction?: 'clockwise' | 'counterclockwise';
|
|
151
|
+
}
|
|
152
|
+
/** A quarter turn per press, about the middle of the mask. */
|
|
153
|
+
declare function AvatarCropperRotate({ direction, variant, size, children, accessibilityLabel, ...props }: AvatarCropperRotateProps): import("react").JSX.Element;
|
|
154
|
+
declare namespace AvatarCropperRotate {
|
|
155
|
+
var displayName: string;
|
|
156
|
+
}
|
|
157
|
+
export type AvatarCropperResetProps = Omit<ButtonProps, 'onPress'>;
|
|
158
|
+
/** Back to the photo centred, unzoomed and upright. Labelled "Reset" unless given children. */
|
|
159
|
+
declare function AvatarCropperReset({ variant, size, children, ...props }: AvatarCropperResetProps): import("react").JSX.Element;
|
|
160
|
+
declare namespace AvatarCropperReset {
|
|
161
|
+
var displayName: string;
|
|
162
|
+
}
|
|
163
|
+
export declare const AvatarCropper: import("react").ForwardRefExoticComponent<AvatarCropperProps & import("react").RefAttributes<AvatarCropperHandle>> & {
|
|
164
|
+
Canvas: typeof AvatarCropperCanvas;
|
|
165
|
+
Rotate: typeof AvatarCropperRotate;
|
|
166
|
+
Reset: typeof AvatarCropperReset;
|
|
167
|
+
};
|
|
168
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/avatar-cropper/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,OAAO,EASL,KAAK,SAAS,EAEf,MAAM,OAAO,CAAC;AACf,OAAO,EAKL,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAgBtB,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,oBAAW,CAAC;AACrD,OAAO,EAYL,KAAK,SAAS,EAGd,KAAK,UAAU,EAChB,MAAM,0BAAuB,CAAC;AAE/B,YAAY,EAAE,SAAS,IAAI,kBAAkB,EAAE,UAAU,IAAI,UAAU,EAAE,CAAC;AAqE1E,4FAA4F;AAC5F,eAAO,MAAM,sBAAsB,SAA8C,CAAC;AAElF,iDAAiD;AACjD,MAAM,WAAW,mBAAmB;IAClC,mCAAmC;IACnC,GAAG,EAAE,MAAM,CAAC;IACZ,uEAAuE;IACvE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wEAAwE;IACxE,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,sBAAsB;IACrC,uDAAuD;IACvD,IAAI,CAAC,EAAE,SAAS,GA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CAAC;CACtB;AAgOD,MAAM,WAAW,wBAAyB,SAAQ,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC;IAC3E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mEAAmE;IACnE,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;GAIG;AACH,iBAAS,mBAAmB,CAAC,EAC3B,SAAS,EACT,kBAAiC,EACjC,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,wBAAwB,+BA6N1B;kBAlOQ,mBAAmB;;;AAyO5B,MAAM,WAAW,wBAAyB,SAAQ,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC;IAC5E,gEAAgE;IAChE,SAAS,CAAC,EAAE,WAAW,GAAG,kBAAkB,CAAC;CAC9C;AAED,8DAA8D;AAC9D,iBAAS,mBAAmB,CAAC,EAC3B,SAAuB,EACvB,OAAqB,EACrB,IAAa,EACb,QAAQ,EACR,kBAAkB,EAClB,GAAG,KAAK,EACT,EAAE,wBAAwB,+BAoB1B;kBA3BQ,mBAAmB;;;AA8B5B,MAAM,MAAM,uBAAuB,GAAG,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;AAEnE,+FAA+F;AAC/F,iBAAS,kBAAkB,CAAC,EAC1B,OAAiB,EACjB,IAAW,EACX,QAAkB,EAClB,GAAG,KAAK,EACT,EAAE,uBAAuB,+BAOzB;kBAZQ,kBAAkB;;;AAe3B,eAAO,MAAM,aAAa;;;;CAIxB,CAAC"}
|
|
@@ -2,6 +2,28 @@ import { type ReactNode } from 'react';
|
|
|
2
2
|
import { View, type ViewProps } from 'react-native';
|
|
3
3
|
import { type VariantProps } from 'tailwind-variants';
|
|
4
4
|
declare const badgeVariants: import("tailwind-variants").TVReturnType<{
|
|
5
|
+
size: {
|
|
6
|
+
xs: {
|
|
7
|
+
root: string;
|
|
8
|
+
label: string;
|
|
9
|
+
};
|
|
10
|
+
sm: {
|
|
11
|
+
root: string;
|
|
12
|
+
label: string;
|
|
13
|
+
};
|
|
14
|
+
md: {
|
|
15
|
+
root: string;
|
|
16
|
+
label: string;
|
|
17
|
+
};
|
|
18
|
+
lg: {
|
|
19
|
+
root: string;
|
|
20
|
+
label: string;
|
|
21
|
+
};
|
|
22
|
+
xl: {
|
|
23
|
+
root: string;
|
|
24
|
+
label: string;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
5
27
|
shape: {
|
|
6
28
|
default: {};
|
|
7
29
|
/** A bare status dot, no label. */
|
|
@@ -47,6 +69,28 @@ declare const badgeVariants: import("tailwind-variants").TVReturnType<{
|
|
|
47
69
|
root: string;
|
|
48
70
|
label: string;
|
|
49
71
|
}, undefined, {
|
|
72
|
+
size: {
|
|
73
|
+
xs: {
|
|
74
|
+
root: string;
|
|
75
|
+
label: string;
|
|
76
|
+
};
|
|
77
|
+
sm: {
|
|
78
|
+
root: string;
|
|
79
|
+
label: string;
|
|
80
|
+
};
|
|
81
|
+
md: {
|
|
82
|
+
root: string;
|
|
83
|
+
label: string;
|
|
84
|
+
};
|
|
85
|
+
lg: {
|
|
86
|
+
root: string;
|
|
87
|
+
label: string;
|
|
88
|
+
};
|
|
89
|
+
xl: {
|
|
90
|
+
root: string;
|
|
91
|
+
label: string;
|
|
92
|
+
};
|
|
93
|
+
};
|
|
50
94
|
shape: {
|
|
51
95
|
default: {};
|
|
52
96
|
/** A bare status dot, no label. */
|
|
@@ -92,6 +136,28 @@ declare const badgeVariants: import("tailwind-variants").TVReturnType<{
|
|
|
92
136
|
root: string;
|
|
93
137
|
label: string;
|
|
94
138
|
}, import("tailwind-variants").TVReturnType<{
|
|
139
|
+
size: {
|
|
140
|
+
xs: {
|
|
141
|
+
root: string;
|
|
142
|
+
label: string;
|
|
143
|
+
};
|
|
144
|
+
sm: {
|
|
145
|
+
root: string;
|
|
146
|
+
label: string;
|
|
147
|
+
};
|
|
148
|
+
md: {
|
|
149
|
+
root: string;
|
|
150
|
+
label: string;
|
|
151
|
+
};
|
|
152
|
+
lg: {
|
|
153
|
+
root: string;
|
|
154
|
+
label: string;
|
|
155
|
+
};
|
|
156
|
+
xl: {
|
|
157
|
+
root: string;
|
|
158
|
+
label: string;
|
|
159
|
+
};
|
|
160
|
+
};
|
|
95
161
|
shape: {
|
|
96
162
|
default: {};
|
|
97
163
|
/** A bare status dot, no label. */
|
|
@@ -137,6 +203,8 @@ declare const badgeVariants: import("tailwind-variants").TVReturnType<{
|
|
|
137
203
|
root: string;
|
|
138
204
|
label: string;
|
|
139
205
|
}, undefined, unknown, unknown, undefined>>;
|
|
206
|
+
/** How big a badge is. */
|
|
207
|
+
export type BadgeSize = NonNullable<VariantProps<typeof badgeVariants>['size']>;
|
|
140
208
|
export interface BadgeProps extends ViewProps, VariantProps<typeof badgeVariants> {
|
|
141
209
|
children?: ReactNode;
|
|
142
210
|
className?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/badge/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAG1D,QAAA,MAAM,aAAa
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/badge/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAG1D,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;QAoBb,mCAAmC;;;;QAEnC,+DAA+D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAF/D,mCAAmC;;;;QAEnC,+DAA+D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAF/D,mCAAmC;;;;QAEnC,+DAA+D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2CA+BnE,CAAC;AAEH,0BAA0B;AAC1B,MAAM,MAAM,SAAS,GAAG,WAAW,CAAC,YAAY,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AAKhF,MAAM,WAAW,UACf,SAAQ,SAAS,EACf,YAAY,CAAC,OAAO,aAAa,CAAC;IACpC,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,KAAK,6FA2BjB,CAAC"}
|
|
@@ -38,6 +38,10 @@ declare const buttonVariants: import("tailwind-variants").TVReturnType<{
|
|
|
38
38
|
};
|
|
39
39
|
};
|
|
40
40
|
size: {
|
|
41
|
+
xs: {
|
|
42
|
+
root: string;
|
|
43
|
+
label: string;
|
|
44
|
+
};
|
|
41
45
|
sm: {
|
|
42
46
|
root: string;
|
|
43
47
|
label: string;
|
|
@@ -107,6 +111,10 @@ declare const buttonVariants: import("tailwind-variants").TVReturnType<{
|
|
|
107
111
|
};
|
|
108
112
|
};
|
|
109
113
|
size: {
|
|
114
|
+
xs: {
|
|
115
|
+
root: string;
|
|
116
|
+
label: string;
|
|
117
|
+
};
|
|
110
118
|
sm: {
|
|
111
119
|
root: string;
|
|
112
120
|
label: string;
|
|
@@ -176,6 +184,10 @@ declare const buttonVariants: import("tailwind-variants").TVReturnType<{
|
|
|
176
184
|
};
|
|
177
185
|
};
|
|
178
186
|
size: {
|
|
187
|
+
xs: {
|
|
188
|
+
root: string;
|
|
189
|
+
label: string;
|
|
190
|
+
};
|
|
179
191
|
sm: {
|
|
180
192
|
root: string;
|
|
181
193
|
label: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/button/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAyC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC9E,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAE1D,OAAO,EAEL,KAAK,sBAAsB,EAC5B,MAAM,wCAAqC,CAAC;AAK7C,OAAO,EAAW,KAAK,YAAY,EAAE,MAAM,qBAAY,CAAC;AAExD,QAAA,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;QAqCd,6EAA6E
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/button/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAyC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC9E,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAE1D,OAAO,EAEL,KAAK,sBAAsB,EAC5B,MAAM,wCAAqC,CAAC;AAK7C,OAAO,EAAW,KAAK,YAAY,EAAE,MAAM,qBAAY,CAAC;AAExD,QAAA,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;QAqCd,6EAA6E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAA7E,6EAA6E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAA7E,6EAA6E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2CAuCjF,CAAC;AAEH,KAAK,k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,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;;;;;;;;OAUG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;;;;;;;;;;;OAaG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAoFD,eAAO,MAAM,MAAM,8FAwNlB,CAAC"}
|
|
@@ -76,6 +76,9 @@ declare const buttonGroupVariants: import("tailwind-variants").TVReturnType<{
|
|
|
76
76
|
};
|
|
77
77
|
};
|
|
78
78
|
size: {
|
|
79
|
+
xs: {
|
|
80
|
+
root: string;
|
|
81
|
+
};
|
|
79
82
|
sm: {
|
|
80
83
|
root: string;
|
|
81
84
|
};
|
|
@@ -120,6 +123,9 @@ declare const buttonGroupVariants: import("tailwind-variants").TVReturnType<{
|
|
|
120
123
|
};
|
|
121
124
|
};
|
|
122
125
|
size: {
|
|
126
|
+
xs: {
|
|
127
|
+
root: string;
|
|
128
|
+
};
|
|
123
129
|
sm: {
|
|
124
130
|
root: string;
|
|
125
131
|
};
|
|
@@ -164,6 +170,9 @@ declare const buttonGroupVariants: import("tailwind-variants").TVReturnType<{
|
|
|
164
170
|
};
|
|
165
171
|
};
|
|
166
172
|
size: {
|
|
173
|
+
xs: {
|
|
174
|
+
root: string;
|
|
175
|
+
};
|
|
167
176
|
sm: {
|
|
168
177
|
root: string;
|
|
169
178
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/button-group/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH,OAAO,EAA2C,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAChF,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAGL,KAAK,UAAU,EACf,KAA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IACnB;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAiED,eAAO,MAAM,WAAW,mGAAkB,CAAC"}
|
|
@@ -1,6 +1,35 @@
|
|
|
1
1
|
import { View } from 'react-native';
|
|
2
2
|
import { type VariantProps } from 'tailwind-variants';
|
|
3
3
|
declare const checkboxVariants: import("tailwind-variants").TVReturnType<{
|
|
4
|
+
size: {
|
|
5
|
+
xs: {
|
|
6
|
+
row: string;
|
|
7
|
+
box: string;
|
|
8
|
+
fill: string;
|
|
9
|
+
label: string;
|
|
10
|
+
description: string;
|
|
11
|
+
};
|
|
12
|
+
sm: {
|
|
13
|
+
row: string;
|
|
14
|
+
box: string;
|
|
15
|
+
fill: string;
|
|
16
|
+
label: string;
|
|
17
|
+
description: string;
|
|
18
|
+
};
|
|
19
|
+
md: {};
|
|
20
|
+
lg: {
|
|
21
|
+
row: string;
|
|
22
|
+
box: string;
|
|
23
|
+
label: string;
|
|
24
|
+
};
|
|
25
|
+
xl: {
|
|
26
|
+
row: string;
|
|
27
|
+
box: string;
|
|
28
|
+
fill: string;
|
|
29
|
+
label: string;
|
|
30
|
+
description: string;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
4
33
|
variant: {
|
|
5
34
|
default: {};
|
|
6
35
|
/**
|
|
@@ -28,6 +57,35 @@ declare const checkboxVariants: import("tailwind-variants").TVReturnType<{
|
|
|
28
57
|
label: string;
|
|
29
58
|
description: string;
|
|
30
59
|
}, undefined, {
|
|
60
|
+
size: {
|
|
61
|
+
xs: {
|
|
62
|
+
row: string;
|
|
63
|
+
box: string;
|
|
64
|
+
fill: string;
|
|
65
|
+
label: string;
|
|
66
|
+
description: string;
|
|
67
|
+
};
|
|
68
|
+
sm: {
|
|
69
|
+
row: string;
|
|
70
|
+
box: string;
|
|
71
|
+
fill: string;
|
|
72
|
+
label: string;
|
|
73
|
+
description: string;
|
|
74
|
+
};
|
|
75
|
+
md: {};
|
|
76
|
+
lg: {
|
|
77
|
+
row: string;
|
|
78
|
+
box: string;
|
|
79
|
+
label: string;
|
|
80
|
+
};
|
|
81
|
+
xl: {
|
|
82
|
+
row: string;
|
|
83
|
+
box: string;
|
|
84
|
+
fill: string;
|
|
85
|
+
label: string;
|
|
86
|
+
description: string;
|
|
87
|
+
};
|
|
88
|
+
};
|
|
31
89
|
variant: {
|
|
32
90
|
default: {};
|
|
33
91
|
/**
|
|
@@ -55,6 +113,35 @@ declare const checkboxVariants: import("tailwind-variants").TVReturnType<{
|
|
|
55
113
|
label: string;
|
|
56
114
|
description: string;
|
|
57
115
|
}, import("tailwind-variants").TVReturnType<{
|
|
116
|
+
size: {
|
|
117
|
+
xs: {
|
|
118
|
+
row: string;
|
|
119
|
+
box: string;
|
|
120
|
+
fill: string;
|
|
121
|
+
label: string;
|
|
122
|
+
description: string;
|
|
123
|
+
};
|
|
124
|
+
sm: {
|
|
125
|
+
row: string;
|
|
126
|
+
box: string;
|
|
127
|
+
fill: string;
|
|
128
|
+
label: string;
|
|
129
|
+
description: string;
|
|
130
|
+
};
|
|
131
|
+
md: {};
|
|
132
|
+
lg: {
|
|
133
|
+
row: string;
|
|
134
|
+
box: string;
|
|
135
|
+
label: string;
|
|
136
|
+
};
|
|
137
|
+
xl: {
|
|
138
|
+
row: string;
|
|
139
|
+
box: string;
|
|
140
|
+
fill: string;
|
|
141
|
+
label: string;
|
|
142
|
+
description: string;
|
|
143
|
+
};
|
|
144
|
+
};
|
|
58
145
|
variant: {
|
|
59
146
|
default: {};
|
|
60
147
|
/**
|
|
@@ -82,6 +169,8 @@ declare const checkboxVariants: import("tailwind-variants").TVReturnType<{
|
|
|
82
169
|
label: string;
|
|
83
170
|
description: string;
|
|
84
171
|
}, undefined, unknown, unknown, undefined>>;
|
|
172
|
+
/** How big a checkbox is. */
|
|
173
|
+
export type CheckboxSize = NonNullable<VariantProps<typeof checkboxVariants>['size']>;
|
|
85
174
|
export interface CheckboxProps extends VariantProps<typeof checkboxVariants> {
|
|
86
175
|
/**
|
|
87
176
|
* Styles the pressable row — layout, border, fill. It does not reach the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/checkbox/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAa,IAAI,EAAE,MAAM,cAAc,CAAC;AAO/C,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAK1D,QAAA,MAAM,gBAAgB;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/checkbox/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAa,IAAI,EAAE,MAAM,cAAc,CAAC;AAO/C,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAK1D,QAAA,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAgDhB;;;WAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAHH;;;WAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAHH;;;WAGG;;;;;;;;;;;;;;;;;;;;;2CAwBP,CAAC;AAEH,6BAA6B;AAC7B,MAAM,MAAM,YAAY,GAAG,WAAW,CAAC,YAAY,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AAKtF,MAAM,WAAW,aAAc,SAAQ,YAAY,CAAC,OAAO,gBAAgB,CAAC;IAC1E;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC7C;;;;;;OAMG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,yEAAyE;IACzE,K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