@fluxus-ui/native 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +61 -2
- package/lib/module/Avatar.js +58 -0
- package/lib/module/Avatar.js.map +1 -0
- package/lib/module/Badge.js +72 -0
- package/lib/module/Badge.js.map +1 -0
- package/lib/module/BottomSheet.js +159 -0
- package/lib/module/BottomSheet.js.map +1 -0
- package/lib/module/Button.js +133 -0
- package/lib/module/Button.js.map +1 -0
- package/lib/module/Card.js +71 -0
- package/lib/module/Card.js.map +1 -0
- package/lib/module/Dialog.js +137 -0
- package/lib/module/Dialog.js.map +1 -0
- package/lib/module/Disclosure.js +153 -0
- package/lib/module/Disclosure.js.map +1 -0
- package/lib/module/EmptyState.js +43 -0
- package/lib/module/EmptyState.js.map +1 -0
- package/lib/module/ListItem.js +83 -0
- package/lib/module/ListItem.js.map +1 -0
- package/lib/module/Menu.js +76 -0
- package/lib/module/Menu.js.map +1 -0
- package/lib/module/Message.js +51 -0
- package/lib/module/Message.js.map +1 -0
- package/lib/module/Popover.js +153 -0
- package/lib/module/Popover.js.map +1 -0
- package/lib/module/Progress.js +54 -0
- package/lib/module/Progress.js.map +1 -0
- package/lib/module/Select.js +146 -0
- package/lib/module/Select.js.map +1 -0
- package/lib/module/Skeleton.js +39 -0
- package/lib/module/Skeleton.js.map +1 -0
- package/lib/module/Slider.js +137 -0
- package/lib/module/Slider.js.map +1 -0
- package/lib/module/Spinner.js +30 -0
- package/lib/module/Spinner.js.map +1 -0
- package/lib/module/Swap.js +87 -0
- package/lib/module/Swap.js.map +1 -0
- package/lib/module/Tabs.js +118 -0
- package/lib/module/Tabs.js.map +1 -0
- package/lib/module/Text.js +47 -0
- package/lib/module/Text.js.map +1 -0
- package/lib/module/TextField.js +190 -0
- package/lib/module/TextField.js.map +1 -0
- package/lib/module/Toast.js +108 -0
- package/lib/module/Toast.js.map +1 -0
- package/lib/module/blur.js +55 -0
- package/lib/module/blur.js.map +1 -0
- package/lib/module/controls.js +259 -0
- package/lib/module/controls.js.map +1 -0
- package/lib/module/generated/tokens.js +484 -0
- package/lib/module/generated/tokens.js.map +1 -0
- package/lib/module/icon.js +51 -0
- package/lib/module/icon.js.map +1 -0
- package/lib/module/index.js +33 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/layout.js +75 -0
- package/lib/module/layout.js.map +1 -0
- package/lib/module/motion.js +28 -0
- package/lib/module/motion.js.map +1 -0
- package/lib/module/overlay.js +99 -0
- package/lib/module/overlay.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/pending.js +177 -0
- package/lib/module/pending.js.map +1 -0
- package/lib/module/presence.js +68 -0
- package/lib/module/presence.js.map +1 -0
- package/lib/module/press.js +32 -0
- package/lib/module/press.js.map +1 -0
- package/lib/module/screen.js +45 -0
- package/lib/module/screen.js.map +1 -0
- package/lib/module/theme.js +41 -0
- package/lib/module/theme.js.map +1 -0
- package/lib/typescript/Avatar.d.ts +17 -0
- package/lib/typescript/Avatar.d.ts.map +1 -0
- package/lib/typescript/Badge.d.ts +21 -0
- package/lib/typescript/Badge.d.ts.map +1 -0
- package/lib/typescript/BottomSheet.d.ts +27 -0
- package/lib/typescript/BottomSheet.d.ts.map +1 -0
- package/lib/typescript/Button.d.ts +27 -0
- package/lib/typescript/Button.d.ts.map +1 -0
- package/lib/typescript/Card.d.ts +17 -0
- package/lib/typescript/Card.d.ts.map +1 -0
- package/lib/typescript/Dialog.d.ts +34 -0
- package/lib/typescript/Dialog.d.ts.map +1 -0
- package/lib/typescript/Disclosure.d.ts +39 -0
- package/lib/typescript/Disclosure.d.ts.map +1 -0
- package/lib/typescript/EmptyState.d.ts +12 -0
- package/lib/typescript/EmptyState.d.ts.map +1 -0
- package/lib/typescript/ListItem.d.ts +20 -0
- package/lib/typescript/ListItem.d.ts.map +1 -0
- package/lib/typescript/Menu.d.ts +23 -0
- package/lib/typescript/Menu.d.ts.map +1 -0
- package/lib/typescript/Message.d.ts +14 -0
- package/lib/typescript/Message.d.ts.map +1 -0
- package/lib/typescript/Popover.d.ts +71 -0
- package/lib/typescript/Popover.d.ts.map +1 -0
- package/lib/typescript/Progress.d.ts +12 -0
- package/lib/typescript/Progress.d.ts.map +1 -0
- package/lib/typescript/Select.d.ts +30 -0
- package/lib/typescript/Select.d.ts.map +1 -0
- package/lib/typescript/Skeleton.d.ts +13 -0
- package/lib/typescript/Skeleton.d.ts.map +1 -0
- package/lib/typescript/Slider.d.ts +21 -0
- package/lib/typescript/Slider.d.ts.map +1 -0
- package/lib/typescript/Spinner.d.ts +12 -0
- package/lib/typescript/Spinner.d.ts.map +1 -0
- package/lib/typescript/Swap.d.ts +25 -0
- package/lib/typescript/Swap.d.ts.map +1 -0
- package/lib/typescript/Tabs.d.ts +18 -0
- package/lib/typescript/Tabs.d.ts.map +1 -0
- package/lib/typescript/Text.d.ts +20 -0
- package/lib/typescript/Text.d.ts.map +1 -0
- package/lib/typescript/TextField.d.ts +36 -0
- package/lib/typescript/TextField.d.ts.map +1 -0
- package/lib/typescript/Toast.d.ts +25 -0
- package/lib/typescript/Toast.d.ts.map +1 -0
- package/lib/typescript/blur.d.ts +4 -0
- package/lib/typescript/blur.d.ts.map +1 -0
- package/lib/typescript/controls.d.ts +37 -0
- package/lib/typescript/controls.d.ts.map +1 -0
- package/lib/typescript/generated/tokens.d.ts +499 -0
- package/lib/typescript/generated/tokens.d.ts.map +1 -0
- package/lib/typescript/icon.d.ts +25 -0
- package/lib/typescript/icon.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +31 -0
- package/lib/typescript/index.d.ts.map +1 -0
- package/lib/typescript/layout.d.ts +24 -0
- package/lib/typescript/layout.d.ts.map +1 -0
- package/lib/typescript/motion.d.ts +7 -0
- package/lib/typescript/motion.d.ts.map +1 -0
- package/lib/typescript/overlay.d.ts +33 -0
- package/lib/typescript/overlay.d.ts.map +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/pending.d.ts +25 -0
- package/lib/typescript/pending.d.ts.map +1 -0
- package/lib/typescript/presence.d.ts +37 -0
- package/lib/typescript/presence.d.ts.map +1 -0
- package/lib/typescript/press.d.ts +12 -0
- package/lib/typescript/press.d.ts.map +1 -0
- package/lib/typescript/screen.d.ts +16 -0
- package/lib/typescript/screen.d.ts.map +1 -0
- package/lib/typescript/theme.d.ts +32 -0
- package/lib/typescript/theme.d.ts.map +1 -0
- package/package.json +100 -3
- package/src/Avatar.tsx +44 -0
- package/src/Badge.tsx +45 -0
- package/src/BottomSheet.tsx +109 -0
- package/src/Button.tsx +117 -0
- package/src/Card.tsx +65 -0
- package/src/Dialog.tsx +93 -0
- package/src/Disclosure.tsx +108 -0
- package/src/EmptyState.tsx +32 -0
- package/src/ListItem.tsx +73 -0
- package/src/Menu.tsx +57 -0
- package/src/Message.tsx +43 -0
- package/src/Popover.tsx +145 -0
- package/src/Progress.tsx +33 -0
- package/src/Select.tsx +118 -0
- package/src/Skeleton.tsx +27 -0
- package/src/Slider.tsx +107 -0
- package/src/Spinner.tsx +18 -0
- package/src/Swap.tsx +74 -0
- package/src/Tabs.tsx +84 -0
- package/src/Text.tsx +44 -0
- package/src/TextField.tsx +137 -0
- package/src/Toast.tsx +94 -0
- package/src/blur.tsx +33 -0
- package/src/controls.tsx +196 -0
- package/src/generated/tokens.ts +653 -0
- package/src/icon.tsx +39 -0
- package/src/index.ts +30 -0
- package/src/layout.tsx +40 -0
- package/src/motion.ts +22 -0
- package/src/overlay.tsx +77 -0
- package/src/pending.tsx +131 -0
- package/src/presence.tsx +65 -0
- package/src/press.ts +23 -0
- package/src/screen.tsx +32 -0
- package/src/theme.tsx +49 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Jhony0709
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,62 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @fluxus-ui/native
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Fluxus for React Native: the same tokens and motion vocabulary as the web, on Reanimated. Design and decisions: `SPEC.md` §15.
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
npx expo install @fluxus-ui/native react-native-reanimated react-native-worklets
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
It needs the New Architecture (Reanimated 4 does). Peer dependencies: `react`, `react-native`, `react-native-reanimated`, `react-native-worklets`.
|
|
10
|
+
|
|
11
|
+
With Expo, `babel-preset-expo` already adds the worklets plugin. Without Expo, add it to the app's Babel config, last in the list:
|
|
12
|
+
|
|
13
|
+
```js
|
|
14
|
+
module.exports = { presets: ['module:@react-native/babel-preset'], plugins: ['react-native-worklets/plugin'] };
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Inside a monorepo, the app must run one copy of React and of Reanimated: see `examples/native/metro.config.js`.
|
|
18
|
+
|
|
19
|
+
```tsx
|
|
20
|
+
import { Button, Text, ThemeProvider, themes } from '@fluxus-ui/native';
|
|
21
|
+
|
|
22
|
+
export default function App() {
|
|
23
|
+
return (
|
|
24
|
+
<ThemeProvider theme={themes.base}>
|
|
25
|
+
<Text variant="title">Lecciones</Text>
|
|
26
|
+
<Button variant="primary" onPress={() => {}}>
|
|
27
|
+
Entrar
|
|
28
|
+
</Button>
|
|
29
|
+
</ThemeProvider>
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
`src/generated/tokens.ts` is written by `pnpm --filter @fluxus-ui/ui tokens:native` from `packages/ui/tokens/*.tokens.json`: a theme is the same file for the web and for here.
|
|
35
|
+
|
|
36
|
+
Two pieces need a library of their own, and live in their own entry so that nobody else installs it:
|
|
37
|
+
|
|
38
|
+
```tsx
|
|
39
|
+
import { Icon } from '@fluxus-ui/native/icon'; // react-native-svg
|
|
40
|
+
import { Screen } from '@fluxus-ui/native/screen'; // react-native-safe-area-context
|
|
41
|
+
import { Swap } from '@fluxus-ui/native/blur'; // expo-blur: the Swap that loses focus on a phone too
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
What is pressed can wait: if `onPress` of a `Button`, a `Card` or a `ListItem`, or `onChange` of `Tabs`, returns a promise, it fills from where it was pressed until the promise settles. If the promise is rejected, the fill goes back to the finger: the app says why, in its own `catch`. `<Swap id={what}>` makes what is shown give way to what comes.
|
|
45
|
+
|
|
46
|
+
Forms: `TextField` (with `reveal` for a password, `rows` for several lines), `TextArea`, `SearchField`, `Checkbox`, `Switch`, `RadioGroup` and `Slider`. The slider takes the touch with React Native's own responder: it needs no gesture library.
|
|
47
|
+
|
|
48
|
+
What opens above: `BottomSheet` and `Dialog` (with `ConfirmDialog`) take `open` and `onClose`; `Menu` and `Popover` take a `trigger`; `Select` is a field that opens a sheet. They are a `Modal` of React Native with nothing of its own: no library. Back on Android always closes. If what is chosen or confirmed returns a promise, what was pressed waits and the window closes once it is fulfilled; if it fails, it stays open. `BottomSheet` and `Select` take `inset`: the safe area at the bottom, which the app knows (`useSafeAreaInsets().bottom`).
|
|
49
|
+
|
|
50
|
+
A notice of `useToast` called while one of them is open is painted inside it too: behind the window nobody would see it. A window of the app's own (`Modal`) gets them with `<ToastLayer />`.
|
|
51
|
+
|
|
52
|
+
`Disclosure` and `Accordion` show and hide what is under a title. It is the one piece that animates a height: what is below travels with it.
|
|
53
|
+
|
|
54
|
+
The app's own font, loaded with `expo-font`: `<ThemeProvider fonts={{ regular: 'Atkinson-Regular', medium: 'Atkinson-Medium', bold: 'Atkinson-Bold' }}>`. Without it, the font of the system.
|
|
55
|
+
|
|
56
|
+
Nothing jumps: `<Appear>` is a view that comes rising, goes fading and glides to a new place; `presence()` gives the three props for any `Animated.View`. In a browser they are off.
|
|
57
|
+
|
|
58
|
+
An app's own theme: `npx fluxus-native-theme --theme its.tokens.json --out its-theme.ts` (the command of `@fluxus-ui/ui`, a dev dependency of the app), then `<ThemeProvider theme={theme}>`. `examples/native` does it with an example of ALBA.
|
|
59
|
+
|
|
60
|
+
A theme may add the tokens of its app under the group `app` (`app.surface.note`), with their `$type`; nothing else can be added. `useTheme<typeof theme>()` gives them by name, and a wrong name does not compile.
|
|
61
|
+
|
|
62
|
+
Checked by `node verify-native.mjs` (types and Jest). Jest runs no native code and paints nothing: how it looks and moves is checked on a phone.
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { Image, View } from 'react-native';
|
|
4
|
+
import { Text } from "./Text.js";
|
|
5
|
+
import { useTheme } from "./theme.js";
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
/** As the web: the first letter of the first two words that start with a letter or a figure. */
|
|
8
|
+
export const initials = name => name.trim().split(/\s+/).filter(w => /^[\p{L}\p{N}]/u.test(w)).slice(0, 2).map(w => Array.from(w)[0] ?? '').join('').toUpperCase();
|
|
9
|
+
|
|
10
|
+
/** Who someone is, in a circle: the picture, or the initials. */
|
|
11
|
+
export function Avatar({
|
|
12
|
+
name,
|
|
13
|
+
src,
|
|
14
|
+
label,
|
|
15
|
+
size = 'md',
|
|
16
|
+
style,
|
|
17
|
+
...rest
|
|
18
|
+
}) {
|
|
19
|
+
const theme = useTheme();
|
|
20
|
+
const side = theme.size[`control.h.${size}`];
|
|
21
|
+
const a11y = label ? {
|
|
22
|
+
accessible: true,
|
|
23
|
+
role: 'img',
|
|
24
|
+
'aria-label': label
|
|
25
|
+
} : {
|
|
26
|
+
'aria-hidden': true,
|
|
27
|
+
importantForAccessibility: 'no-hide-descendants'
|
|
28
|
+
};
|
|
29
|
+
return /*#__PURE__*/_jsx(View, {
|
|
30
|
+
...a11y,
|
|
31
|
+
...rest,
|
|
32
|
+
style: [{
|
|
33
|
+
width: side,
|
|
34
|
+
height: side,
|
|
35
|
+
borderRadius: side,
|
|
36
|
+
alignItems: 'center',
|
|
37
|
+
justifyContent: 'center',
|
|
38
|
+
overflow: 'hidden',
|
|
39
|
+
backgroundColor: theme.color['accent.subtle']
|
|
40
|
+
}, style],
|
|
41
|
+
children: src ? /*#__PURE__*/_jsx(Image, {
|
|
42
|
+
source: {
|
|
43
|
+
uri: src
|
|
44
|
+
},
|
|
45
|
+
style: {
|
|
46
|
+
width: side,
|
|
47
|
+
height: side
|
|
48
|
+
}
|
|
49
|
+
}) : /*#__PURE__*/_jsx(Text, {
|
|
50
|
+
variant: size === 'sm' ? 'caption' : 'label',
|
|
51
|
+
weight: "medium",
|
|
52
|
+
tone: "accent",
|
|
53
|
+
allowFontScaling: false,
|
|
54
|
+
children: initials(name)
|
|
55
|
+
})
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=Avatar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Image","View","Text","useTheme","jsx","_jsx","initials","name","trim","split","filter","w","test","slice","map","Array","from","join","toUpperCase","Avatar","src","label","size","style","rest","theme","side","a11y","accessible","role","importantForAccessibility","width","height","borderRadius","alignItems","justifyContent","overflow","backgroundColor","color","children","source","uri","variant","weight","tone","allowFontScaling"],"sourceRoot":"../../src","sources":["Avatar.tsx"],"mappings":";;AAAA,SAASA,KAAK,EAAEC,IAAI,QAAwD,cAAc;AAC1F,SAASC,IAAI,QAAQ,WAAQ;AAC7B,SAASC,QAAQ,QAAQ,YAAS;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAcnC;AACA,OAAO,MAAMC,QAAQ,GAAIC,IAAY,IACnCA,IAAI,CACDC,IAAI,CAAC,CAAC,CACNC,KAAK,CAAC,KAAK,CAAC,CACZC,MAAM,CAAEC,CAAC,IAAK,gBAAgB,CAACC,IAAI,CAACD,CAAC,CAAC,CAAC,CACvCE,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CACXC,GAAG,CAAEH,CAAC,IAAKI,KAAK,CAACC,IAAI,CAACL,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAClCM,IAAI,CAAC,EAAE,CAAC,CACRC,WAAW,CAAC,CAAC;;AAElB;AACA,OAAO,SAASC,MAAMA,CAAC;EAAEZ,IAAI;EAAEa,GAAG;EAAEC,KAAK;EAAEC,IAAI,GAAG,IAAI;EAAEC,KAAK;EAAE,GAAGC;AAAkB,CAAC,EAAE;EACrF,MAAMC,KAAK,GAAGtB,QAAQ,CAAC,CAAC;EACxB,MAAMuB,IAAI,GAAGD,KAAK,CAACH,IAAI,CAAC,aAAaA,IAAI,EAAE,CAAC;EAC5C,MAAMK,IAAI,GAAGN,KAAK,GAAI;IAAEO,UAAU,EAAE,IAAI;IAAEC,IAAI,EAAE,KAAK;IAAE,YAAY,EAAER;EAAM,CAAC,GAAc;IAAE,aAAa,EAAE,IAAI;IAAES,yBAAyB,EAAE;EAAsB,CAAW;EAC7K,oBACEzB,IAAA,CAACJ,IAAI;IAAA,GAAK0B,IAAI;IAAA,GAAMH,IAAI;IAAED,KAAK,EAAE,CAAC;MAAEQ,KAAK,EAAEL,IAAI;MAAEM,MAAM,EAAEN,IAAI;MAAEO,YAAY,EAAEP,IAAI;MAAEQ,UAAU,EAAE,QAAQ;MAAEC,cAAc,EAAE,QAAQ;MAAEC,QAAQ,EAAE,QAAQ;MAAEC,eAAe,EAAEZ,KAAK,CAACa,KAAK,CAAC,eAAe;IAAE,CAAC,EAAEf,KAAK,CAAE;IAAAgB,QAAA,EAC5MnB,GAAG,gBACFf,IAAA,CAACL,KAAK;MAACwC,MAAM,EAAE;QAAEC,GAAG,EAAErB;MAAI,CAAE;MAACG,KAAK,EAAE;QAAEQ,KAAK,EAAEL,IAAI;QAAEM,MAAM,EAAEN;MAAK;IAAE,CAAE,CAAC,gBAErErB,IAAA,CAACH,IAAI;MAACwC,OAAO,EAAEpB,IAAI,KAAK,IAAI,GAAG,SAAS,GAAG,OAAQ;MAACqB,MAAM,EAAC,QAAQ;MAACC,IAAI,EAAC,QAAQ;MAACC,gBAAgB,EAAE,KAAM;MAAAN,QAAA,EACvGjC,QAAQ,CAACC,IAAI;IAAC,CACX;EACP,CACG,CAAC;AAEX","ignoreList":[]}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { View } from 'react-native';
|
|
4
|
+
import { Text } from "./Text.js";
|
|
5
|
+
import { useTheme } from "./theme.js";
|
|
6
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
+
/** The ground, the ink and the solid colour of a tone. */
|
|
8
|
+
export function toneColors(theme, tone = 'neutral') {
|
|
9
|
+
const c = theme.color;
|
|
10
|
+
if (tone === 'neutral') return {
|
|
11
|
+
subtle: c['surface.sunken'],
|
|
12
|
+
ink: c['text.muted'],
|
|
13
|
+
solid: c['text.muted']
|
|
14
|
+
};
|
|
15
|
+
if (tone === 'accent') return {
|
|
16
|
+
subtle: c['accent.subtle'],
|
|
17
|
+
ink: c['text.accent'],
|
|
18
|
+
solid: c['accent.default']
|
|
19
|
+
};
|
|
20
|
+
return {
|
|
21
|
+
subtle: c[`state.${tone}.subtle`],
|
|
22
|
+
ink: c[`state.${tone}.text`],
|
|
23
|
+
solid: c[`state.${tone}.solid`]
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** A state in a word. The tone is never the only thing that says it: the text does. */
|
|
28
|
+
export function Badge({
|
|
29
|
+
children,
|
|
30
|
+
tone = 'neutral',
|
|
31
|
+
look = 'tint',
|
|
32
|
+
style,
|
|
33
|
+
...rest
|
|
34
|
+
}) {
|
|
35
|
+
const theme = useTheme();
|
|
36
|
+
const {
|
|
37
|
+
subtle,
|
|
38
|
+
ink,
|
|
39
|
+
solid
|
|
40
|
+
} = toneColors(theme, tone);
|
|
41
|
+
const dot = look === 'dot';
|
|
42
|
+
const size = theme.size['space.2'];
|
|
43
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
44
|
+
...rest,
|
|
45
|
+
style: [{
|
|
46
|
+
flexDirection: 'row',
|
|
47
|
+
alignItems: 'center',
|
|
48
|
+
alignSelf: 'flex-start',
|
|
49
|
+
gap: theme.size['space.1'],
|
|
50
|
+
paddingHorizontal: theme.size['space.2'],
|
|
51
|
+
paddingVertical: theme.size['space.1'] / 2,
|
|
52
|
+
borderRadius: theme.size['radius.pill'],
|
|
53
|
+
backgroundColor: dot ? theme.color['surface.sunken'] : subtle
|
|
54
|
+
}, style],
|
|
55
|
+
children: [dot && /*#__PURE__*/_jsx(View, {
|
|
56
|
+
style: {
|
|
57
|
+
width: size,
|
|
58
|
+
height: size,
|
|
59
|
+
borderRadius: size,
|
|
60
|
+
backgroundColor: solid
|
|
61
|
+
}
|
|
62
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
63
|
+
variant: "caption",
|
|
64
|
+
weight: "medium",
|
|
65
|
+
style: {
|
|
66
|
+
color: dot ? theme.color['text.default'] : ink
|
|
67
|
+
},
|
|
68
|
+
children: children
|
|
69
|
+
})]
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=Badge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["View","Text","useTheme","jsx","_jsx","jsxs","_jsxs","toneColors","theme","tone","c","color","subtle","ink","solid","Badge","children","look","style","rest","dot","size","flexDirection","alignItems","alignSelf","gap","paddingHorizontal","paddingVertical","borderRadius","backgroundColor","width","height","variant","weight"],"sourceRoot":"../../src","sources":["Badge.tsx"],"mappings":";;AACA,SAASA,IAAI,QAAwD,cAAc;AACnF,SAASC,IAAI,QAAQ,WAAQ;AAC7B,SAASC,QAAQ,QAAoB,YAAS;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAa/C;AACA,OAAO,SAASC,UAAUA,CAACC,KAAY,EAAEC,IAAU,GAAG,SAAS,EAAkD;EAC/G,MAAMC,CAAC,GAAGF,KAAK,CAACG,KAAK;EACrB,IAAIF,IAAI,KAAK,SAAS,EAAE,OAAO;IAAEG,MAAM,EAAEF,CAAC,CAAC,gBAAgB,CAAC;IAAEG,GAAG,EAAEH,CAAC,CAAC,YAAY,CAAC;IAAEI,KAAK,EAAEJ,CAAC,CAAC,YAAY;EAAE,CAAC;EAC5G,IAAID,IAAI,KAAK,QAAQ,EAAE,OAAO;IAAEG,MAAM,EAAEF,CAAC,CAAC,eAAe,CAAC;IAAEG,GAAG,EAAEH,CAAC,CAAC,aAAa,CAAC;IAAEI,KAAK,EAAEJ,CAAC,CAAC,gBAAgB;EAAE,CAAC;EAC/G,OAAO;IAAEE,MAAM,EAAEF,CAAC,CAAC,SAASD,IAAI,SAAS,CAAC;IAAEI,GAAG,EAAEH,CAAC,CAAC,SAASD,IAAI,OAAO,CAAC;IAAEK,KAAK,EAAEJ,CAAC,CAA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f,KAAK,EAAE;QAAEP,KAAK,EAAES,GAAG,GAAGZ,KAAK,CAACG,KAAK,CAAC,cAAc,CAAC,GAAGE;MAAI,CAAE;MAAAG,QAAA,EAC/FA;IAAQ,CACL,CAAC;EAAA,CACH,CAAC;AAEX","ignoreList":[]}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A sheet that rises from the bottom, moved only by its transform. As tall as what it holds, up to nine tenths
|
|
5
|
+
* of the screen. Dragged down from its header, it goes; so it does with its handle, which is a button with a
|
|
6
|
+
* name for whoever cannot drag. (SPEC §15.8)
|
|
7
|
+
*/
|
|
8
|
+
import { useRef, useState } from 'react';
|
|
9
|
+
import { PanResponder, Pressable, ScrollView, useWindowDimensions, View } from 'react-native';
|
|
10
|
+
import Animated, { useAnimatedStyle, useSharedValue } from 'react-native-reanimated';
|
|
11
|
+
import { spring } from "./motion.js";
|
|
12
|
+
import { floating, focusOn, Overlay } from "./overlay.js";
|
|
13
|
+
import { Text } from "./Text.js";
|
|
14
|
+
import { useTheme } from "./theme.js";
|
|
15
|
+
|
|
16
|
+
/** How much of the screen it may take, how far down it must be let go to close, and how fast a flick is. */
|
|
17
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
18
|
+
const TALLEST = 0.9;
|
|
19
|
+
const CLOSE_AT = 0.3;
|
|
20
|
+
const FLICK = 0.8;
|
|
21
|
+
function Sheet({
|
|
22
|
+
t,
|
|
23
|
+
onClose,
|
|
24
|
+
title,
|
|
25
|
+
titleHidden,
|
|
26
|
+
children,
|
|
27
|
+
inset,
|
|
28
|
+
closeLabel = 'Close',
|
|
29
|
+
dismissible = true,
|
|
30
|
+
scroll = true,
|
|
31
|
+
testID,
|
|
32
|
+
heading
|
|
33
|
+
}) {
|
|
34
|
+
const theme = useTheme();
|
|
35
|
+
const {
|
|
36
|
+
height: screen
|
|
37
|
+
} = useWindowDimensions();
|
|
38
|
+
const [height, setHeight] = useState(0);
|
|
39
|
+
const drag = useSharedValue(0);
|
|
40
|
+
// Until it is measured it waits below the screen, wherever that is.
|
|
41
|
+
const far = height || screen;
|
|
42
|
+
const rise = useAnimatedStyle(() => ({
|
|
43
|
+
transform: [{
|
|
44
|
+
translateY: (1 - t.value) * far + drag.value
|
|
45
|
+
}]
|
|
46
|
+
}));
|
|
47
|
+
const latest = useRef({
|
|
48
|
+
height,
|
|
49
|
+
onClose
|
|
50
|
+
});
|
|
51
|
+
latest.current = {
|
|
52
|
+
height,
|
|
53
|
+
onClose
|
|
54
|
+
};
|
|
55
|
+
const [pan] = useState(() => PanResponder.create({
|
|
56
|
+
// Only a drag down, and only from the header: what it holds may scroll.
|
|
57
|
+
onMoveShouldSetPanResponder: (_, g) => g.dy > 4 && g.dy > Math.abs(g.dx),
|
|
58
|
+
onPanResponderMove: (_, g) => {
|
|
59
|
+
drag.value = Math.max(0, g.dy);
|
|
60
|
+
},
|
|
61
|
+
onPanResponderRelease: (_, g) => {
|
|
62
|
+
if (g.dy > latest.current.height * CLOSE_AT || g.vy > FLICK) latest.current.onClose();else drag.value = spring(0, 'snappy');
|
|
63
|
+
},
|
|
64
|
+
onPanResponderTerminate: () => {
|
|
65
|
+
drag.value = spring(0, 'snappy');
|
|
66
|
+
}
|
|
67
|
+
}));
|
|
68
|
+
const radius = theme.size['radius.card'];
|
|
69
|
+
const pad = theme.size['space.4'];
|
|
70
|
+
const body = /*#__PURE__*/_jsx(View, {
|
|
71
|
+
style: {
|
|
72
|
+
paddingInline: pad,
|
|
73
|
+
paddingBottom: pad + (inset ?? 0)
|
|
74
|
+
},
|
|
75
|
+
children: children
|
|
76
|
+
});
|
|
77
|
+
return /*#__PURE__*/_jsxs(Animated.View, {
|
|
78
|
+
role: "dialog",
|
|
79
|
+
"aria-modal": true,
|
|
80
|
+
accessibilityViewIsModal: true,
|
|
81
|
+
"aria-label": title,
|
|
82
|
+
testID: testID,
|
|
83
|
+
onLayout: e => setHeight(e.nativeEvent.layout.height),
|
|
84
|
+
style: [floating(theme), {
|
|
85
|
+
position: 'absolute',
|
|
86
|
+
start: 0,
|
|
87
|
+
end: 0,
|
|
88
|
+
bottom: 0,
|
|
89
|
+
maxHeight: screen * TALLEST,
|
|
90
|
+
borderBottomWidth: 0,
|
|
91
|
+
borderBottomStartRadius: 0,
|
|
92
|
+
borderBottomEndRadius: 0,
|
|
93
|
+
borderTopStartRadius: radius,
|
|
94
|
+
borderTopEndRadius: radius
|
|
95
|
+
}, rise],
|
|
96
|
+
children: [/*#__PURE__*/_jsxs(View, {
|
|
97
|
+
...(dismissible ? pan.panHandlers : null),
|
|
98
|
+
style: {
|
|
99
|
+
paddingInline: pad,
|
|
100
|
+
paddingBottom: theme.size['space.3']
|
|
101
|
+
},
|
|
102
|
+
children: [dismissible && /*#__PURE__*/_jsx(Pressable, {
|
|
103
|
+
role: "button",
|
|
104
|
+
"aria-label": closeLabel,
|
|
105
|
+
onPress: onClose,
|
|
106
|
+
hitSlop: theme.size['space.3'],
|
|
107
|
+
style: {
|
|
108
|
+
alignSelf: 'center',
|
|
109
|
+
paddingBlock: theme.size['space.2']
|
|
110
|
+
},
|
|
111
|
+
children: /*#__PURE__*/_jsx(View, {
|
|
112
|
+
style: {
|
|
113
|
+
width: theme.size['space.10'],
|
|
114
|
+
height: theme.size['space.1'],
|
|
115
|
+
borderRadius: theme.size['space.1'],
|
|
116
|
+
backgroundColor: theme.color['border.strong']
|
|
117
|
+
}
|
|
118
|
+
})
|
|
119
|
+
}), !titleHidden &&
|
|
120
|
+
/*#__PURE__*/
|
|
121
|
+
// Not selectable: in a browser, a drag that selects text is not a drag of the sheet.
|
|
122
|
+
_jsx(Text, {
|
|
123
|
+
ref: heading,
|
|
124
|
+
variant: "title",
|
|
125
|
+
selectable: false,
|
|
126
|
+
style: dismissible ? null : {
|
|
127
|
+
paddingTop: pad
|
|
128
|
+
},
|
|
129
|
+
children: title
|
|
130
|
+
})]
|
|
131
|
+
}), scroll ? /*#__PURE__*/_jsx(ScrollView, {
|
|
132
|
+
bounces: false,
|
|
133
|
+
keyboardShouldPersistTaps: "handled",
|
|
134
|
+
children: body
|
|
135
|
+
}) : body]
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
export function BottomSheet({
|
|
139
|
+
open,
|
|
140
|
+
onClose,
|
|
141
|
+
dismissible = true,
|
|
142
|
+
...rest
|
|
143
|
+
}) {
|
|
144
|
+
const heading = useRef(null);
|
|
145
|
+
return /*#__PURE__*/_jsx(Overlay, {
|
|
146
|
+
open: open,
|
|
147
|
+
onClose: onClose,
|
|
148
|
+
dismissible: dismissible,
|
|
149
|
+
onShow: () => focusOn(heading.current),
|
|
150
|
+
children: t => /*#__PURE__*/_jsx(Sheet, {
|
|
151
|
+
t: t,
|
|
152
|
+
onClose: onClose,
|
|
153
|
+
dismissible: dismissible,
|
|
154
|
+
heading: heading,
|
|
155
|
+
...rest
|
|
156
|
+
})
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
//# sourceMappingURL=BottomSheet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useRef","useState","PanResponder","Pressable","ScrollView","useWindowDimensions","View","Animated","useAnimatedStyle","useSharedValue","spring","floating","focusOn","Overlay","Text","useTheme","jsx","_jsx","jsxs","_jsxs","TALLEST","CLOSE_AT","FLICK","Sheet","t","onClose","title","titleHidden","children","inset","closeLabel","dismissible","scroll","testID","heading","theme","height","screen","setHeight","drag","far","rise","transform","translateY","value","latest","current","pan","create","onMoveShouldSetPanResponder","_","g","dy","Math","abs","dx","onPanResponderMove","max","onPanResponderRelease","vy","onPanResponderTerminate","radius","size","pad","body","style","paddingInline","paddingBottom","role","accessibilityViewIsModal","onLayout","e","nativeEvent","layout","position","start","end","bottom","maxHeight","borderBottomWidth","borderBottomStartRadius","borderBottomEndRadius","borderTopStartRadius","borderTopEndRadius","panHandlers","onPress","hitSlop","alignSelf","paddingBlock","width","borderRadius","backgroundColor","color","ref","variant","selectable","paddingTop","bounces","keyboardShouldPersistTaps","BottomSheet","open","rest","onShow"],"sourceRoot":"../../src","sources":["BottomSheet.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA,SAASA,MAAM,EAAEC,QAAQ,QAA2D,OAAO;AAC3F,SAASC,YAAY,EAAEC,SAAS,EAAEC,UAAU,EAAsBC,mBAAmB,EAAEC,IAAI,QAAQ,cAAc;AACjH,OAAOC,QAAQ,IAAIC,gBAAgB,EAAEC,cAAc,QAA0B,yBAAyB;AACtG,SAASC,MAAM,QAAQ,aAAU;AACjC,SAASC,QAAQ,EAAEC,OAAO,EAAEC,OAAO,QAAQ,cAAW;AACtD,SAASC,IAAI,QAAQ,WAAQ;AAC7B,SAASC,QAAQ,QAAQ,YAAS;;AAElC;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AACA,MAAMC,OAAO,GAAG,GAAG;AACnB,MAAMC,QAAQ,GAAG,GAAG;AACpB,MAAMC,KAAK,GAAG,GAAG;AAsBjB,SAASC,KAAKA,CAAC;EAAEC,CAAC;EAAEC,OAAO;EAAEC,KAAK;EAAEC,WAAW;EAAEC,QAAQ;EAAEC,KAAK;EAAEC,UAAU,GAAG,OAAO;EAAEC,WAAW,GAAG,IAAI;EAAEC,MAAM,GAAG,IAAI;EAAEC,MAAM;EAAEC;AAAiI,CAAC,EAAE;EACrQ,MAAMC,KAAK,GAAGpB,QAAQ,CAAC,CAAC;EACxB,MAAM;IAAEqB,MAAM,EAAEC;EAAO,CAAC,GAAGhC,mBAAmB,CAAC,CAAC;EAChD,MAAM,CAAC+B,MAAM,EAAEE,SAAS,CAAC,GAAGrC,QAAQ,CAAC,CAAC,CAAC;EACvC,MAAMsC,IAAI,GAAG9B,cAAc,CAAC,CAAC,CAAC;EAC9B;EACA,MAAM+B,GAAG,GAAGJ,MAAM,IAAIC,MAAM;EAC5B,MAAMI,IAAI,GAAGjC,gBAAgB,CAAC,OAAO;IAAEkC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AACuE,MAAM,EAAEA,CAAA,KAAM1F,OAAO,CAACsB,OAAO,CAACY,OAAO,CAAE;IAAAlB,QAAA,EACpGJ,CAAC,iBAAKP,IAAA,CAACM,KAAK;MAACC,CAAC,EAAEA,CAAE;MAACC,OAAO,EAAEA,OAAQ;MAACM,WAAW,EAAEA,WAAY;MAACG,OAAO,EAAEA,OAAQ;MAAA,GAAKmE;IAAI,CAAG;EAAC,CACxF,CAAC;AAEd","ignoreList":[]}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useState } from 'react';
|
|
4
|
+
import { ActivityIndicator, Pressable } from 'react-native';
|
|
5
|
+
import Animated from 'react-native-reanimated';
|
|
6
|
+
import { useAsyncPress, usePending } from "./pending.js";
|
|
7
|
+
import { presence } from "./presence.js";
|
|
8
|
+
import { usePress } from "./press.js";
|
|
9
|
+
import { Text } from "./Text.js";
|
|
10
|
+
import { useTheme } from "./theme.js";
|
|
11
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
|
+
const AnimatedPressable = Animated.createAnimatedComponent(Pressable);
|
|
13
|
+
|
|
14
|
+
/** The surface, the ink and the edge of a variant, and the box of a size: only tokens. */
|
|
15
|
+
export function buttonStyle(theme, variant = 'secondary', size = 'md') {
|
|
16
|
+
const c = theme.color;
|
|
17
|
+
const [surface, ink, edge] = {
|
|
18
|
+
primary: [c['button.bg'], c['button.fg'], 'transparent'],
|
|
19
|
+
secondary: [c['surface.raised'], c['text.default'], c['border.control']],
|
|
20
|
+
ghost: ['transparent', c['text.default'], 'transparent'],
|
|
21
|
+
danger: [c['state.danger.subtle'], c['state.danger.text'], 'transparent']
|
|
22
|
+
}[variant];
|
|
23
|
+
const height = theme.size[`control.h.${size}`];
|
|
24
|
+
return {
|
|
25
|
+
box: {
|
|
26
|
+
// A minimum, not a height: the text grows with the system's text size.
|
|
27
|
+
minHeight: height,
|
|
28
|
+
flexDirection: 'row',
|
|
29
|
+
alignItems: 'center',
|
|
30
|
+
justifyContent: 'center',
|
|
31
|
+
gap: theme.size['space.2'],
|
|
32
|
+
paddingHorizontal: theme.size['pad.control-x'],
|
|
33
|
+
borderWidth: 1,
|
|
34
|
+
borderColor: edge,
|
|
35
|
+
borderRadius: theme.size['button.radius'],
|
|
36
|
+
backgroundColor: surface
|
|
37
|
+
},
|
|
38
|
+
ink,
|
|
39
|
+
// A small button is still a target of target.min: the rest is around it.
|
|
40
|
+
slop: Math.max(0, (theme.size['target.min'] - height) / 2)
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/** A button with the variants and sizes of the web; pressed, it gives on the snappy spring. */
|
|
45
|
+
export function Button({
|
|
46
|
+
children,
|
|
47
|
+
variant = 'secondary',
|
|
48
|
+
size = 'md',
|
|
49
|
+
busy = false,
|
|
50
|
+
disabled,
|
|
51
|
+
style,
|
|
52
|
+
onPress,
|
|
53
|
+
onPressIn,
|
|
54
|
+
onPressOut,
|
|
55
|
+
onLayout,
|
|
56
|
+
onFocus,
|
|
57
|
+
onBlur,
|
|
58
|
+
...rest
|
|
59
|
+
}) {
|
|
60
|
+
const theme = useTheme();
|
|
61
|
+
const {
|
|
62
|
+
box,
|
|
63
|
+
ink,
|
|
64
|
+
slop
|
|
65
|
+
} = buttonStyle(theme, variant, size);
|
|
66
|
+
const [waiting, run, failed] = useAsyncPress(onPress);
|
|
67
|
+
const pending = usePending(waiting, ink, failed);
|
|
68
|
+
const off = !!disabled || busy || waiting;
|
|
69
|
+
const press = usePress({
|
|
70
|
+
onPressIn,
|
|
71
|
+
onPressOut
|
|
72
|
+
});
|
|
73
|
+
const {
|
|
74
|
+
layout,
|
|
75
|
+
...coming
|
|
76
|
+
} = presence();
|
|
77
|
+
// With a keyboard or a remote: a ring around it, drawn outside so that nothing moves.
|
|
78
|
+
const [focused, setFocused] = useState(false);
|
|
79
|
+
const ring = focused ? {
|
|
80
|
+
outlineStyle: 'solid',
|
|
81
|
+
outlineWidth: theme.size['focus.width'],
|
|
82
|
+
outlineOffset: theme.size['focus.offset'],
|
|
83
|
+
outlineColor: theme.color['focus.ring']
|
|
84
|
+
} : null;
|
|
85
|
+
return /*#__PURE__*/_jsxs(AnimatedPressable, {
|
|
86
|
+
role: "button",
|
|
87
|
+
hitSlop: slop,
|
|
88
|
+
...rest,
|
|
89
|
+
disabled: off,
|
|
90
|
+
"aria-disabled": off,
|
|
91
|
+
"aria-busy": busy || waiting,
|
|
92
|
+
onPress: run,
|
|
93
|
+
onLayout: e => {
|
|
94
|
+
pending.onLayout(e);
|
|
95
|
+
onLayout?.(e);
|
|
96
|
+
},
|
|
97
|
+
onPressIn: e => {
|
|
98
|
+
pending.onPressIn(e);
|
|
99
|
+
press.onPressIn(e);
|
|
100
|
+
},
|
|
101
|
+
onPressOut: press.onPressOut,
|
|
102
|
+
onFocus: e => {
|
|
103
|
+
setFocused(true);
|
|
104
|
+
onFocus?.(e);
|
|
105
|
+
},
|
|
106
|
+
onBlur: e => {
|
|
107
|
+
setFocused(false);
|
|
108
|
+
onBlur?.(e);
|
|
109
|
+
},
|
|
110
|
+
style: [box, {
|
|
111
|
+
overflow: 'hidden'
|
|
112
|
+
}, disabled ? {
|
|
113
|
+
opacity: 0.5
|
|
114
|
+
} : null, ring, style, press.style],
|
|
115
|
+
children: [pending.fill, busy && /*#__PURE__*/_jsx(Animated.View, {
|
|
116
|
+
...coming,
|
|
117
|
+
children: /*#__PURE__*/_jsx(ActivityIndicator, {
|
|
118
|
+
size: "small",
|
|
119
|
+
color: ink
|
|
120
|
+
})
|
|
121
|
+
}), /*#__PURE__*/_jsx(Animated.View, {
|
|
122
|
+
layout: layout,
|
|
123
|
+
children: typeof children === 'string' ? /*#__PURE__*/_jsx(Text, {
|
|
124
|
+
variant: "label",
|
|
125
|
+
style: {
|
|
126
|
+
color: ink
|
|
127
|
+
},
|
|
128
|
+
children: children
|
|
129
|
+
}) : children
|
|
130
|
+
})]
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
//# sourceMappingURL=Button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useState","ActivityIndicator","Pressable","Animated","useAsyncPress","usePending","presence","usePress","Text","useTheme","jsx","_jsx","jsxs","_jsxs","AnimatedPressable","createAnimatedComponent","buttonStyle","theme","variant","size","c","color","surface","ink","edge","primary","secondary","ghost","danger","height","box","minHeight","flexDirection","alignItems","justifyContent","gap","paddingHorizontal","borderWidth","borderColor","borderRadius","backgroundColor","slop","Math","max","Button","children","busy","disabled","style","onPress","onPressIn","onPressOut","onLayout","onFocus","onBlur","rest","waiting","run","failed","pending","off","press","layout","coming","focused","setFocused","ring","outlineStyle","outlineWidth","outlineOffset","outlineColor","role","hitSlop","e","overflow","opacity","fill","View"],"sourceRoot":"../../src","sources":["Button.tsx"],"mappings":";;AAAA,SAASA,QAAQ,QAAqD,OAAO;AAC7E,SAASC,iBAAiB,EAAEC,SAAS,QAAyF,cAAc;AAC5I,OAAOC,QAAQ,MAAM,yBAAyB;AAC9C,SAASC,aAAa,EAAEC,UAAU,QAAQ,cAAW;AACrD,SAASC,QAAQ,QAAQ,eAAY;AACrC,SAASC,QAAQ,QAAQ,YAAS;AAClC,SAASC,IAAI,QAAQ,WAAQ;AAC7B,SAASC,QAAQ,QAAoB,YAAS;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAmB/C,MAAMC,iBAAiB,GAAGX,QAAQ,CAACY,uBAAuB,CAACb,SAAS,CAAC;;AAErE;AACA,OAAO,SAASc,WAAWA,CAACC,KAAY,EAAEC,OAAsB,GAAG,WAAW,EAAEC,IAAgB,GAAG,IAAI,EAAiD;EACtJ,MAAMC,CAAC,GAAGH,KAAK,CAACI,KAAK;EACrB,MAAM,CAACC,OAAO,EAAEC,GAAG,EAAEC,IAAI,CAAC,GAAG;IAC3BC,OAAO,EAAE,CAACL,CAAC,CAAC,WAAW,CAAC,EAAEA,CAAC,CAAC,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|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { Pressable, View } from 'react-native';
|
|
4
|
+
import Animated from 'react-native-reanimated';
|
|
5
|
+
import { useAsyncPress, usePending } from "./pending.js";
|
|
6
|
+
import { usePress } from "./press.js";
|
|
7
|
+
import { useTheme } from "./theme.js";
|
|
8
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
+
const AnimatedPressable = Animated.createAnimatedComponent(Pressable);
|
|
10
|
+
export const cardStyle = theme => ({
|
|
11
|
+
padding: theme.size['card.pad'],
|
|
12
|
+
borderWidth: 1,
|
|
13
|
+
borderColor: theme.color['card.border'],
|
|
14
|
+
borderRadius: theme.size['card.radius'],
|
|
15
|
+
backgroundColor: theme.color['card.bg']
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* A surface. With `onPress` it is one button that gives when pressed, and a screen reader reads it whole.
|
|
20
|
+
* Without, it is a plain view: what it holds is reached piece by piece.
|
|
21
|
+
*/
|
|
22
|
+
export function Card({
|
|
23
|
+
children,
|
|
24
|
+
style,
|
|
25
|
+
onPress,
|
|
26
|
+
onPressIn,
|
|
27
|
+
onPressOut,
|
|
28
|
+
onLayout,
|
|
29
|
+
...rest
|
|
30
|
+
}) {
|
|
31
|
+
const theme = useTheme();
|
|
32
|
+
const press = usePress({
|
|
33
|
+
onPressIn,
|
|
34
|
+
onPressOut
|
|
35
|
+
});
|
|
36
|
+
const [waiting, run, failed] = useAsyncPress(onPress);
|
|
37
|
+
const pending = usePending(waiting, theme.color['text.default'], failed);
|
|
38
|
+
if (!onPress) {
|
|
39
|
+
const {
|
|
40
|
+
ref,
|
|
41
|
+
testID
|
|
42
|
+
} = rest;
|
|
43
|
+
return /*#__PURE__*/_jsx(View, {
|
|
44
|
+
ref: ref,
|
|
45
|
+
testID: testID,
|
|
46
|
+
style: [cardStyle(theme), style],
|
|
47
|
+
children: children
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
return /*#__PURE__*/_jsxs(AnimatedPressable, {
|
|
51
|
+
role: "button",
|
|
52
|
+
...rest,
|
|
53
|
+
disabled: !!rest.disabled || waiting,
|
|
54
|
+
"aria-busy": waiting,
|
|
55
|
+
onPress: run,
|
|
56
|
+
onLayout: e => {
|
|
57
|
+
pending.onLayout(e);
|
|
58
|
+
onLayout?.(e);
|
|
59
|
+
},
|
|
60
|
+
onPressIn: e => {
|
|
61
|
+
pending.onPressIn(e);
|
|
62
|
+
press.onPressIn(e);
|
|
63
|
+
},
|
|
64
|
+
onPressOut: press.onPressOut,
|
|
65
|
+
style: [cardStyle(theme), {
|
|
66
|
+
overflow: 'hidden'
|
|
67
|
+
}, style, press.style],
|
|
68
|
+
children: [pending.fill, children]
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=Card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Pressable","View","Animated","useAsyncPress","usePending","usePress","useTheme","jsx","_jsx","jsxs","_jsxs","AnimatedPressable","createAnimatedComponent","cardStyle","theme","padding","size","borderWidth","borderColor","color","borderRadius","backgroundColor","Card","children","style","onPress","onPressIn","onPressOut","onLayout","rest","press","waiting","run","failed","pending","ref","testID","role","disabled","e","overflow","fill"],"sourceRoot":"../../src","sources":["Card.tsx"],"mappings":";;AACA,SAASA,SAAS,EAAEC,IAAI,QAAyF,cAAc;AAC/H,OAAOC,QAAQ,MAAM,yBAAyB;AAC9C,SAASC,aAAa,EAAEC,UAAU,QAAQ,cAAW;AACrD,SAASC,QAAQ,QAAQ,YAAS;AAClC,SAASC,QAAQ,QAAoB,YAAS;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAU/C,MAAMC,iBAAiB,GAAGT,QAAQ,CAACU,uBAAuB,CAACZ,SAAS,CAAC;AAErE,OAAO,MAAMa,SAAS,GAAIC,KAAY,KAAiB;EACrDC,OAAO,EAAED,KAAK,CAACE,IAA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