@hzblj/kara-components 0.11.0 → 0.13.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/CHANGELOG.md +47 -0
- package/README.md +2 -1
- package/lib/module/atoms/box/box.js +3 -0
- package/lib/module/atoms/box/box.js.map +1 -1
- package/lib/module/atoms/box/index.js +0 -1
- package/lib/module/atoms/box/index.js.map +1 -1
- package/lib/module/atoms/icon/icon.android.js +1 -1
- package/lib/module/atoms/icon/icon.android.js.map +1 -1
- package/lib/module/atoms/icon/icon.ios.js +1 -1
- package/lib/module/atoms/icon/icon.ios.js.map +1 -1
- package/lib/module/atoms/index.js +1 -0
- package/lib/module/atoms/index.js.map +1 -1
- package/lib/module/atoms/pressable/pressable.js +63 -16
- package/lib/module/atoms/pressable/pressable.js.map +1 -1
- package/lib/module/atoms/rn-icon/index.js +1 -1
- package/lib/module/atoms/rn-icon/index.js.map +1 -1
- package/lib/module/atoms/rn-icon/rn-icon.js +26 -0
- package/lib/module/atoms/rn-icon/rn-icon.js.map +1 -0
- package/lib/module/atoms/rn-text/rn-text.js +66 -26
- package/lib/module/atoms/rn-text/rn-text.js.map +1 -1
- package/lib/module/atoms/segmented-control/segmented-control.android.js +1 -1
- package/lib/module/atoms/segmented-control/segmented-control.android.js.map +1 -1
- package/lib/module/atoms/skeleton/skeleton.js +3 -3
- package/lib/module/atoms/skeleton/skeleton.js.map +1 -1
- package/lib/module/atoms/slider/slider.android.js +1 -1
- package/lib/module/atoms/slider/slider.android.js.map +1 -1
- package/lib/module/atoms/stagger/index.js +5 -0
- package/lib/module/atoms/stagger/index.js.map +1 -0
- package/lib/module/atoms/stagger/stagger.js +102 -0
- package/lib/module/atoms/stagger/stagger.js.map +1 -0
- package/lib/module/atoms/stagger/stagger.types.js +4 -0
- package/lib/module/atoms/stagger/stagger.types.js.map +1 -0
- package/lib/module/atoms/switch/switch.android.js +1 -1
- package/lib/module/atoms/switch/switch.android.js.map +1 -1
- package/lib/module/glyph/rn-glyph.android.js +8 -3
- package/lib/module/glyph/rn-glyph.android.js.map +1 -1
- package/lib/module/index.js +0 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/molecules/navigation-bar/navigation-bar.android.js +1 -1
- package/lib/module/molecules/navigation-bar/navigation-bar.android.js.map +1 -1
- package/lib/module/molecules/navigation-bar/navigation-bar.ios.js +1 -1
- package/lib/module/molecules/navigation-bar/navigation-bar.ios.js.map +1 -1
- package/lib/module/molecules/scroll-edge-container/scroll-edge-container.android.js +3 -3
- package/lib/module/molecules/scroll-edge-container/scroll-edge-container.android.js.map +1 -1
- package/lib/module/organisms/context-menu/context-menu.android.js +1 -1
- package/lib/module/organisms/context-menu/context-menu.android.js.map +1 -1
- package/lib/module/organisms/context-menu/context-menu.ios.js +1 -1
- package/lib/module/organisms/context-menu/context-menu.ios.js.map +1 -1
- package/lib/module/organisms/fab-menu/fab-menu.ios.js +1 -1
- package/lib/module/organisms/fab-menu/fab-menu.ios.js.map +1 -1
- package/lib/module/organisms/snackbar/snackbar.js +32 -20
- package/lib/module/organisms/snackbar/snackbar.js.map +1 -1
- package/lib/module/organisms/swipe-actions/swipe-actions.ios.js +1 -1
- package/lib/module/organisms/swipe-actions/swipe-actions.ios.js.map +1 -1
- package/lib/typescript/atoms/box/box.d.ts +3 -0
- package/lib/typescript/atoms/box/index.d.ts +0 -1
- package/lib/typescript/atoms/icon/icon.types.d.ts +6 -15
- package/lib/typescript/atoms/index.d.ts +1 -0
- package/lib/typescript/atoms/pressable/pressable.types.d.ts +5 -4
- package/lib/typescript/atoms/rn-icon/rn-icon.d.ts +6 -1
- package/lib/typescript/atoms/rn-text/rn-text.types.d.ts +7 -4
- package/lib/typescript/atoms/stagger/index.d.ts +2 -0
- package/lib/typescript/atoms/stagger/stagger.d.ts +2 -0
- package/lib/typescript/atoms/stagger/stagger.types.d.ts +32 -0
- package/lib/typescript/index.d.ts +0 -1
- package/lib/typescript/organisms/snackbar/snackbar.types.d.ts +6 -8
- package/package.json +6 -4
- package/src/atoms/box/box.tsx +3 -0
- package/src/atoms/box/index.ts +0 -1
- package/src/atoms/icon/icon.android.tsx +1 -1
- package/src/atoms/icon/icon.ios.tsx +1 -1
- package/src/atoms/icon/icon.types.ts +6 -15
- package/src/atoms/index.ts +1 -0
- package/src/atoms/pressable/pressable.tsx +163 -107
- package/src/atoms/pressable/pressable.types.ts +5 -4
- package/src/atoms/rn-icon/rn-icon.tsx +28 -0
- package/src/atoms/rn-text/rn-text.tsx +101 -32
- package/src/atoms/rn-text/rn-text.types.ts +7 -3
- package/src/atoms/segmented-control/segmented-control.android.tsx +1 -1
- package/src/atoms/skeleton/skeleton.tsx +3 -3
- package/src/atoms/slider/slider.android.tsx +1 -1
- package/src/atoms/stagger/index.ts +2 -0
- package/src/atoms/stagger/stagger.tsx +98 -0
- package/src/atoms/stagger/stagger.types.ts +35 -0
- package/src/atoms/switch/switch.android.tsx +1 -1
- package/src/glyph/rn-glyph.android.tsx +14 -3
- package/src/index.ts +0 -1
- package/src/molecules/navigation-bar/navigation-bar.android.tsx +1 -1
- package/src/molecules/navigation-bar/navigation-bar.ios.tsx +1 -1
- package/src/molecules/scroll-edge-container/scroll-edge-container.android.tsx +3 -3
- package/src/organisms/context-menu/context-menu.android.tsx +1 -1
- package/src/organisms/context-menu/context-menu.ios.tsx +1 -1
- package/src/organisms/fab-menu/fab-menu.ios.tsx +1 -1
- package/src/organisms/snackbar/snackbar.tsx +20 -40
- package/src/organisms/snackbar/snackbar.types.ts +6 -8
- package/src/organisms/swipe-actions/swipe-actions.ios.tsx +1 -1
- package/lib/module/atoms/box/a-box.js +0 -6
- package/lib/module/atoms/box/a-box.js.map +0 -1
- package/lib/module/atoms/rn-icon/rn-icon.android.js +0 -29
- package/lib/module/atoms/rn-icon/rn-icon.android.js.map +0 -1
- package/lib/module/atoms/rn-icon/rn-icon.ios.js +0 -29
- package/lib/module/atoms/rn-icon/rn-icon.ios.js.map +0 -1
- package/lib/module/haptics/haptics.js +0 -56
- package/lib/module/haptics/haptics.js.map +0 -1
- package/lib/module/haptics/index.js +0 -5
- package/lib/module/haptics/index.js.map +0 -1
- package/lib/module/haptics/use-haptic-feedback.js +0 -33
- package/lib/module/haptics/use-haptic-feedback.js.map +0 -1
- package/lib/module/motion.js +0 -19
- package/lib/module/motion.js.map +0 -1
- package/lib/typescript/atoms/box/a-box.d.ts +0 -49
- package/lib/typescript/atoms/rn-icon/rn-icon.ios.d.ts +0 -3
- package/lib/typescript/haptics/haptics.d.ts +0 -61
- package/lib/typescript/haptics/index.d.ts +0 -2
- package/lib/typescript/haptics/use-haptic-feedback.d.ts +0 -15
- package/lib/typescript/motion.d.ts +0 -8
- package/src/atoms/box/a-box.ts +0 -5
- package/src/atoms/rn-icon/rn-icon.android.tsx +0 -28
- package/src/atoms/rn-icon/rn-icon.ios.tsx +0 -28
- package/src/haptics/haptics.ts +0 -68
- package/src/haptics/index.ts +0 -2
- package/src/haptics/use-haptic-feedback.ts +0 -36
- package/src/motion.ts +0 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,52 @@
|
|
|
1
1
|
# @hzblj/kara-components
|
|
2
2
|
|
|
3
|
+
## 0.13.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#30](https://github.com/hzblj/kara-ui/pull/30) [`5d5265a`](https://github.com/hzblj/kara-ui/commit/5d5265a5da215c3e5559ba5144b27d53d1e3690f) Thanks [@hzblj](https://github.com/hzblj)! - Haptics move to a package of their own, [`@hzblj/expo-rich-haptics`](https://github.com/hzblj/expo-rich-haptics), which kara now depends on, so any Expo app can use them. kara no longer exports `haptics`, `useHapticFeedback`, `Haptic` or `HAPTICS`: add the package to your app (`npx expo install @hzblj/expo-rich-haptics`) and import them from it. The names and calls are the same, and the components play the same haptics. The package adds patterns of your own (Android's haptic primitives on a timeline, which iOS plays through Core Haptics), plus `intensity` and a warning of its own on Android devices that have primitives. `@hzblj/kara-native` drops `playHaptic`, `prepareHaptic` and `HAPTICS`. Rebuild the native app to pick up the new module.
|
|
8
|
+
|
|
9
|
+
- [#31](https://github.com/hzblj/kara-ui/pull/31) [`4b20462`](https://github.com/hzblj/kara-ui/commit/4b204621670b6f640fc04bffa527007dda9e06a8) Thanks [@hzblj](https://github.com/hzblj)! - Icons and the zoom transition now come from two standalone packages, which work without kara too.
|
|
10
|
+
|
|
11
|
+
- **Icons: [@hzblj/expo-native-icons](https://www.npmjs.com/package/@hzblj/expo-native-icons).** The config plugin is the same (`plugins: [['@hzblj/kara-ui', {icons: {source: './assets/icons'}}]]`, the same options, `npx kara-icons` still works). The names change: the declaration is now `native-icons.d.ts` with the global `NativeIcons` (it was `kara-icons.d.ts` and `KaraIcons`), and each icon is `native_icon_<name>` natively (it was `kara_icon_<name>`). Delete the old `kara-icons.d.ts`, and run `expo prebuild --clean` once so the old assets go. `RnIcon` is now the package's `NativeIcon`: on Android it draws the drawable itself instead of hosting an `ImageView`, and remembers each icon's resource lookup, so a list of rows does less work. A glyph with a non-square viewBox no longer stretches on Android.
|
|
12
|
+
- **Zoom transition: [@hzblj/expo-zoom-transition](https://www.npmjs.com/package/@hzblj/expo-zoom-transition).** `ZoomTransition` and its helpers from `@hzblj/kara-ui/router` are unchanged: kara's tokens over the package. The native code moved out of `@hzblj/kara-native` into the package's own module, which `@hzblj/kara-native` depends on, so autolinking picks it up. A tapped context menu preview still zooms. Rebuild the native app.
|
|
13
|
+
- `iconResourceName` moved from `@hzblj/kara-native` to `@hzblj/expo-native-icons`, and `@hzblj/kara-expo-plugin` no longer exports the icon generator or `./cli`: import them from `@hzblj/expo-native-icons/plugin` and `@hzblj/expo-native-icons/cli`.
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- Updated dependencies [[`5d5265a`](https://github.com/hzblj/kara-ui/commit/5d5265a5da215c3e5559ba5144b27d53d1e3690f), [`4b20462`](https://github.com/hzblj/kara-ui/commit/4b204621670b6f640fc04bffa527007dda9e06a8)]:
|
|
18
|
+
- @hzblj/kara-native@0.13.0
|
|
19
|
+
- @hzblj/kara-sx@0.13.0
|
|
20
|
+
- @hzblj/kara-theme@0.13.0
|
|
21
|
+
|
|
22
|
+
## 0.12.0
|
|
23
|
+
|
|
24
|
+
### Minor Changes
|
|
25
|
+
|
|
26
|
+
- [#28](https://github.com/hzblj/kara-ui/pull/28) [`84ddbac`](https://github.com/hzblj/kara-ui/commit/84ddbacba9f35d578fa7dfce3e9f696ae09771f8) Thanks [@hzblj](https://github.com/hzblj)! - Motion in the engine. Every `sx` view (`Box`, `Image`, anything wrapped with `sx()`), `RnText` and `Pressable` take `entering`, `exiting`, `layout` and `animate`, and become a Reanimated view by themselves when they do, or when their `style` comes from `useAnimatedStyle`. Without them a `Box` stays a plain `View` and costs nothing more. `ABox` is gone: use `Box`, and pass `animated` to one whose animated style only arrives after it mounts.
|
|
27
|
+
|
|
28
|
+
- `entering` and `exiting` take a preset named by the way the view moves (`fade`, `fadeUp`, `fadeDown`, `scale`), a preset adjusted (`{preset: 'scale', duration: 'slow', delay: 120}`, or with a `spring`), or Reanimated's own builder. Arriving takes `fast` and leaving `quick`; with motion reduced every preset fades.
|
|
29
|
+
- `animate` carries a change of the colours, `opacity` and the transform over to the new value on the UI thread, through Reanimated's CSS transitions: `animate`, `animate="slow"`, `animate="snappy"` or a config whose `keys` can add sizes, radii and blur. On iOS the UIKit colours a transition cannot read are resolved to the values UIKit draws (`resolveSystemColor` in `@hzblj/kara-native`, a native rebuild picks it up), so a selected row blends on both platforms.
|
|
30
|
+
- `layout` moves a view into its new place on the `smooth` spring, or a spring token, a timed config or Reanimated's own transition. It snaps with motion reduced.
|
|
31
|
+
- The native views take `animate` too: SwiftUI's `.animation(_:value:)` on iOS, animated `graphicsLayer` values, a `background` animation spec and `animateContentSize` on Android, on the same tokens.
|
|
32
|
+
|
|
33
|
+
New `Stagger`: a `Box` whose children arrive one after another, a step (`interval`, `stagger` by default) apart. Only the children that arrive together take turns, so the next page of a list staggers while an item added on its own appears at once. A `Box`, `RnText` or `Pressable` child takes the motion directly; any other is wrapped in a `Box`.
|
|
34
|
+
|
|
35
|
+
Springs as tokens: `springs` in `@hzblj/kara-theme` holds SwiftUI's set (`interactive`, `smooth`, `snappy`, `bouncy`), a perceptual duration and a bounce each, and `springPhysics` turns one into the physics every platform runs, so a token is one curve in Reanimated, in a CSS transition, in SwiftUI and in Compose. `spring(name)` and `timing(size, curve)` (moved here from the components) give `withSpring` and `withTiming` configs, and `useEntering`, `useExiting` and `useLayoutTransition` hand kara's presets to a Reanimated view of your own.
|
|
36
|
+
|
|
37
|
+
`Pressable` presses on springs, down on `interactive` and back on `smooth`, so a press let go halfway eases back instead of turning on the spot. `Snackbar`'s `entering` and `exiting` take the presets too.
|
|
38
|
+
|
|
39
|
+
### Patch Changes
|
|
40
|
+
|
|
41
|
+
- [#28](https://github.com/hzblj/kara-ui/pull/28) [`84ddbac`](https://github.com/hzblj/kara-ui/commit/84ddbacba9f35d578fa7dfce3e9f696ae09771f8) Thanks [@hzblj](https://github.com/hzblj)! - Faster styling. A resolved React Native style carries only the keys a call site set, where it used to carry forty-odd more as `undefined`, each walked on every mount. Views with the same native `sx` share one resolved modifier array, as they already shared a style, and `sx()` splits its props, the motion props included, in a single walk. `RnText` reads the user's text size from one subscription at the root (`useFontScale`, provided with the breakpoint) instead of one per text, and shares its text style the way `sx` shares its own.
|
|
42
|
+
|
|
43
|
+
`RnText` no longer loses its last line on iOS when React Native lays the paragraph out a hair shorter than its lines need, which happened depending on where the text sat on the page.
|
|
44
|
+
|
|
45
|
+
- Updated dependencies [[`84ddbac`](https://github.com/hzblj/kara-ui/commit/84ddbacba9f35d578fa7dfce3e9f696ae09771f8), [`84ddbac`](https://github.com/hzblj/kara-ui/commit/84ddbacba9f35d578fa7dfce3e9f696ae09771f8), [`84ddbac`](https://github.com/hzblj/kara-ui/commit/84ddbacba9f35d578fa7dfce3e9f696ae09771f8)]:
|
|
46
|
+
- @hzblj/kara-sx@0.12.0
|
|
47
|
+
- @hzblj/kara-theme@0.12.0
|
|
48
|
+
- @hzblj/kara-native@0.12.0
|
|
49
|
+
|
|
3
50
|
## 0.11.0
|
|
4
51
|
|
|
5
52
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -22,7 +22,8 @@ The components of [Kara UI](https://www.kara.janblazej.dev), a native-first desi
|
|
|
22
22
|
- **`Screen` and `Island`**: the hosts native views render in.
|
|
23
23
|
- **The React Native tier**: `RnView`, `RnText`, `RnScrollView` and the rest are plain React Native views with the
|
|
24
24
|
same `sx` props, for long lists and for content around the native islands.
|
|
25
|
-
- **Haptics
|
|
25
|
+
- **Haptics** where the platform's own control has none, through
|
|
26
|
+
[`@hzblj/expo-rich-haptics`](https://github.com/hzblj/expo-rich-haptics).
|
|
26
27
|
|
|
27
28
|
## Documentation
|
|
28
29
|
|
|
@@ -6,6 +6,9 @@ import { View } from 'react-native';
|
|
|
6
6
|
/**
|
|
7
7
|
* A React Native `View` that takes the design system's `sx` props. The `sx()` HOC is the whole
|
|
8
8
|
* implementation — Box is just its first caller, and any other style-taking component gets the same.
|
|
9
|
+
*
|
|
10
|
+
* That includes motion: `entering`, `exiting`, `layout`, `animate` or an animated `style` make it an `Animated.View`
|
|
11
|
+
* from its first frame, and without them it stays a plain `View`.
|
|
9
12
|
*/
|
|
10
13
|
export const Box = sx(View);
|
|
11
14
|
//# sourceMappingURL=box.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["sx","View","Box"],"sourceRoot":"../../../../src","sources":["atoms/box/box.tsx"],"mappings":";;AAAA,SAAQA,EAAE,QAAO,gBAAgB;AACjC,SAAQC,IAAI,QAAO,cAAc;;AAEjC;AACA;AACA;AACA;AACA,OAAO,MAAMC,GAAG,GAAGF,EAAE,CAACC,IAAI,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["sx","View","Box"],"sourceRoot":"../../../../src","sources":["atoms/box/box.tsx"],"mappings":";;AAAA,SAAQA,EAAE,QAAO,gBAAgB;AACjC,SAAQC,IAAI,QAAO,cAAc;;AAEjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,GAAG,GAAGF,EAAE,CAACC,IAAI,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["atoms/box/index.ts"],"mappings":";;AAAA,cAAc,
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["atoms/box/index.ts"],"mappings":";;AAAA,cAAc,UAAO;AACrB,cAAc,gBAAa","ignoreList":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import { iconResourceName } from '@hzblj/
|
|
3
|
+
import { iconResourceName } from '@hzblj/expo-native-icons';
|
|
4
4
|
import { DrawableIcon } from '@hzblj/kara-native/jetpack-compose';
|
|
5
5
|
import { spacing, useAppTheme } from '@hzblj/kara-theme';
|
|
6
6
|
import { useHostGuard } from "../../host-context.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["iconResourceName","DrawableIcon","spacing","useAppTheme","useHostGuard","jsx","_jsx","Icon","accessibilityLabel","color","name","size","theme","iconColor","iconSize","resourceName"],"sourceRoot":"../../../../src","sources":["atoms/icon/icon.android.tsx"],"mappings":";;AAAA,SAAQA,gBAAgB,QAAO,
|
|
1
|
+
{"version":3,"names":["iconResourceName","DrawableIcon","spacing","useAppTheme","useHostGuard","jsx","_jsx","Icon","accessibilityLabel","color","name","size","theme","iconColor","iconSize","resourceName"],"sourceRoot":"../../../../src","sources":["atoms/icon/icon.android.tsx"],"mappings":";;AAAA,SAAQA,gBAAgB,QAAO,0BAA0B;AACzD,SAAQC,YAAY,QAAO,oCAAoC;AAC/D,SAAQC,OAAO,EAAEC,WAAW,QAAO,mBAAmB;AAEtD,SAAQC,YAAY,QAAO,uBAAoB;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAG/C;AACA,OAAO,MAAMC,IAAmB,GAAGA,CAAC;EAACC,kBAAkB;EAAEC,KAAK,GAAG,iBAAiB;EAAEC,IAAI;EAAEC,IAAI,GAAG;AAAgB,CAAC,KAAK;EACrHP,YAAY,CAAC,MAAM,CAAC;EACpB,MAAMQ,KAAK,GAAGT,WAAW,CAAC,CAAC;EAE3B,oBACEG,IAAA,CAACL,YAAY;IACXO,kBAAkB,EAAEA,kBAAmB;IACvCK,SAAS,EAAED,KAAK,CAACH,KAAK,CAACA,KAAK,CAAE;IAC9BK,QAAQ,EAAEZ,OAAO,CAACS,IAAI,CAAE;IACxBI,YAAY,EAAEf,gBAAgB,CAACU,IAAI;EAAE,CACtC,CAAC;AAEN,CAAC","ignoreList":[]}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { Image } from '@expo/ui/swift-ui';
|
|
4
4
|
import { accessibilityHidden, frame, accessibilityLabel as labelModifier, resizable } from '@expo/ui/swift-ui/modifiers';
|
|
5
|
-
import { iconResourceName } from '@hzblj/
|
|
5
|
+
import { iconResourceName } from '@hzblj/expo-native-icons';
|
|
6
6
|
import { spacing, useAppTheme } from '@hzblj/kara-theme';
|
|
7
7
|
import { useMemo } from 'react';
|
|
8
8
|
import { useHostGuard } from "../../host-context.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Image","accessibilityHidden","frame","accessibilityLabel","labelModifier","resizable","iconResourceName","spacing","useAppTheme","useMemo","useHostGuard","jsx","_jsx","Icon","color","name","size","testID","theme","side","modifiers","height","width","assetName"],"sourceRoot":"../../../../src","sources":["atoms/icon/icon.ios.tsx"],"mappings":";;AAAA,SAAQA,KAAK,QAAO,mBAAmB;AACvC,SAAQC,mBAAmB,EAAEC,KAAK,EAAEC,kBAAkB,IAAIC,aAAa,EAAEC,SAAS,QAAO,6BAA6B;AACtH,SAAQC,gBAAgB,QAAO,
|
|
1
|
+
{"version":3,"names":["Image","accessibilityHidden","frame","accessibilityLabel","labelModifier","resizable","iconResourceName","spacing","useAppTheme","useMemo","useHostGuard","jsx","_jsx","Icon","color","name","size","testID","theme","side","modifiers","height","width","assetName"],"sourceRoot":"../../../../src","sources":["atoms/icon/icon.ios.tsx"],"mappings":";;AAAA,SAAQA,KAAK,QAAO,mBAAmB;AACvC,SAAQC,mBAAmB,EAAEC,KAAK,EAAEC,kBAAkB,IAAIC,aAAa,EAAEC,SAAS,QAAO,6BAA6B;AACtH,SAAQC,gBAAgB,QAAO,0BAA0B;AACzD,SAAQC,OAAO,EAAEC,WAAW,QAAO,mBAAmB;AACtD,SAAQC,OAAO,QAAO,OAAO;AAE7B,SAAQC,YAAY,QAAO,uBAAoB;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAG/C;AACA;AACA;AACA;AACA,OAAO,MAAMC,IAAmB,GAAGA,CAAC;EAClCV,kBAAkB;EAClBW,KAAK,GAAG,iBAAiB;EACzBC,IAAI;EACJC,IAAI,GAAG,KAAK;EACZC;AACS,CAAC,KAAK;EACfP,YAAY,CAAC,MAAM,CAAC;EACpB,MAAMQ,KAAK,GAAGV,WAAW,CAAC,CAAC;EAC3B,MAAMW,IAAI,GAAGZ,OAAO,CAACS,IAAI,CAAC;EAE1B,MAAMI,SAAS,GAAGX,OAAO,CACvB,MAAM,CACJJ,SAAS,CAAC,CAAC,EACXH,KAAK,CAAC;IAACmB,MAAM,EAAEF,IAAI;IAAEG,KAAK,EAAEH;EAAI,CAAC,CAAC,EAClChB,kBAAkB,GAAGC,aAAa,CAACD,kBAAkB,CAAC,GAAGF,mBAAmB,CAAC,IAAI,CAAC,CACnF,EACD,CAACE,kBAAkB,EAAEgB,IAAI,CAC3B,CAAC;EAED,oBAAOP,IAAA,CAACZ,KAAK;IAACuB,SAAS,EAAEjB,gBAAgB,CAACS,IAAI,CAAE;IAACD,KAAK,EAAEI,KAAK,CAACJ,KAAK,CAACA,KAAK,CAAE;IAACM,SAAS,EAAEA,SAAU;IAACH,MAAM,EAAEA;EAAO,CAAE,CAAC;AACtH,CAAC","ignoreList":[]}
|
|
@@ -34,6 +34,7 @@ export * from "./segmented-control/index.js";
|
|
|
34
34
|
export * from "./skeleton/index.js";
|
|
35
35
|
export * from "./slider/index.js";
|
|
36
36
|
export * from "./spacer/index.js";
|
|
37
|
+
export * from "./stagger/index.js";
|
|
37
38
|
export * from "./surface/index.js";
|
|
38
39
|
export * from "./switch/index.js";
|
|
39
40
|
export * from "./text/index.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["atoms/index.ts"],"mappings":";;AAAA,cAAc,+BAAsB;AACpC,cAAc,mBAAU;AACxB,cAAc,kBAAS;AACvB,cAAc,sBAAa;AAC3B,cAAc,gBAAO;AACrB,cAAc,mBAAU;AACxB,cAAc,iBAAQ;AACtB,cAAc,qBAAY;AAC1B,cAAc,iBAAQ;AACtB,cAAc,yBAAgB;AAC9B,cAAc,wBAAe;AAC7B,cAAc,oBAAW;AACzB,cAAc,gBAAO;AACrB,cAAc,uBAAc;AAC5B,cAAc,oBAAW;AACzB,cAAc,iBAAQ;AACtB,cAAc,wBAAe;AAC7B,cAAc,kBAAS;AACvB,cAAc,mBAAU;AACxB,cAAc,iBAAQ;AACtB,cAAc,mBAAU;AACxB,cAAc,sBAAa;AAC3B,cAAc,qBAAY;AAC1B,cAAc,yBAAgB;AAC9B,cAAc,oBAAW;AACzB,cAAc,2BAAkB;AAChC,cAAc,4BAAmB;AACjC,cAAc,oBAAW;AACzB,cAAc,oBAAW;AACzB,cAAc,wBAAe;AAC7B,cAAc,8BAAqB;AACnC,cAAc,qBAAY;AAC1B,cAAc,mBAAU;AACxB,cAAc,mBAAU;AACxB,cAAc,oBAAW;AACzB,cAAc,mBAAU;AACxB,cAAc,iBAAQ;AACtB,cAAc,uBAAc;AAC5B,cAAc,oBAAW;AACzB,cAAc,oBAAW","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["atoms/index.ts"],"mappings":";;AAAA,cAAc,+BAAsB;AACpC,cAAc,mBAAU;AACxB,cAAc,kBAAS;AACvB,cAAc,sBAAa;AAC3B,cAAc,gBAAO;AACrB,cAAc,mBAAU;AACxB,cAAc,iBAAQ;AACtB,cAAc,qBAAY;AAC1B,cAAc,iBAAQ;AACtB,cAAc,yBAAgB;AAC9B,cAAc,wBAAe;AAC7B,cAAc,oBAAW;AACzB,cAAc,gBAAO;AACrB,cAAc,uBAAc;AAC5B,cAAc,oBAAW;AACzB,cAAc,iBAAQ;AACtB,cAAc,wBAAe;AAC7B,cAAc,kBAAS;AACvB,cAAc,mBAAU;AACxB,cAAc,iBAAQ;AACtB,cAAc,mBAAU;AACxB,cAAc,sBAAa;AAC3B,cAAc,qBAAY;AAC1B,cAAc,yBAAgB;AAC9B,cAAc,oBAAW;AACzB,cAAc,2BAAkB;AAChC,cAAc,4BAAmB;AACjC,cAAc,oBAAW;AACzB,cAAc,oBAAW;AACzB,cAAc,wBAAe;AAC7B,cAAc,8BAAqB;AACnC,cAAc,qBAAY;AAC1B,cAAc,mBAAU;AACxB,cAAc,mBAAU;AACxB,cAAc,oBAAW;AACzB,cAAc,oBAAW;AACzB,cAAc,mBAAU;AACxB,cAAc,iBAAQ;AACtB,cAAc,uBAAc;AAC5B,cAAc,oBAAW;AACzB,cAAc,oBAAW","ignoreList":[]}
|
|
@@ -1,24 +1,59 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { haptics } from '@hzblj/expo-rich-haptics';
|
|
4
|
+
import { accessibilityProps, markMotionComponent, splitAccessibility, spring, timing, useSplitSxMotion } from '@hzblj/kara-sx';
|
|
5
|
+
import { opacity, springs, useAppTheme, useReducedMotion, withOpacity } from '@hzblj/kara-theme';
|
|
5
6
|
import { useCallback, useMemo } from 'react';
|
|
6
7
|
import { Platform, Pressable as RNPressable } from 'react-native';
|
|
7
|
-
import Animated, { useAnimatedStyle, useSharedValue, withTiming } from 'react-native-reanimated';
|
|
8
|
-
import { haptics } from "../../haptics/index.js";
|
|
9
|
-
import { timing } from "../../motion.js";
|
|
8
|
+
import Animated, { useAnimatedStyle, useSharedValue, withSpring, withTiming } from 'react-native-reanimated';
|
|
10
9
|
import { splitForRipple } from "../../ripple-clip.js";
|
|
11
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
-
/**
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
/**
|
|
12
|
+
* The scale follows the finger on springs, as UIKit's own presses do: down on `interactive`, back on `smooth`, neither
|
|
13
|
+
* with a bounce (a press is not a toy). A spring keeps the speed it has, so a tap let go halfway down eases back instead
|
|
14
|
+
* of turning on the spot, which a timed curve restarted from rest cannot do.
|
|
15
|
+
*/
|
|
16
|
+
const SCALE_IN = spring('interactive');
|
|
17
|
+
const SCALE_OUT = spring('smooth');
|
|
15
18
|
|
|
16
19
|
/** A dim comes in at once and leaves a little slower, as UIKit's own highlight does. */
|
|
17
20
|
const DIM_IN = timing('micro', 'out');
|
|
18
21
|
const DIM_OUT = timing('quick', 'out');
|
|
19
22
|
const PLATFORM_EFFECT = Platform.OS === 'ios' ? 'scale' : 'none';
|
|
20
23
|
const AnimatedPressable = Animated.createAnimatedComponent(RNPressable);
|
|
21
|
-
|
|
24
|
+
|
|
25
|
+
/** What `animate` covers by default, less the transform. */
|
|
26
|
+
const VISUAL_KEYS = ['bg', 'borderColor', 'opacity'];
|
|
27
|
+
const TRANSFORM_KEYS = new Set(['offsetX', 'offsetY', 'rotate', 'scale']);
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* The press scale owns the transform, so `animate` leaves it alone: a transition on the same transform would take it
|
|
31
|
+
* back from the press at every re-render. A duration or spring token keeps its timing.
|
|
32
|
+
*/
|
|
33
|
+
const withoutTransform = animate => {
|
|
34
|
+
if (animate === undefined || animate === false) {
|
|
35
|
+
return animate;
|
|
36
|
+
}
|
|
37
|
+
if (animate === true) {
|
|
38
|
+
return {
|
|
39
|
+
keys: VISUAL_KEYS
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
if (typeof animate === 'string') {
|
|
43
|
+
return animate in springs ? {
|
|
44
|
+
keys: VISUAL_KEYS,
|
|
45
|
+
spring: animate
|
|
46
|
+
} : {
|
|
47
|
+
duration: animate,
|
|
48
|
+
keys: VISUAL_KEYS
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
return {
|
|
52
|
+
...animate,
|
|
53
|
+
keys: (animate.keys ?? VISUAL_KEYS).filter(key => !TRANSFORM_KEYS.has(key))
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
export const Pressable = markMotionComponent(({
|
|
22
57
|
children,
|
|
23
58
|
disabled = false,
|
|
24
59
|
haptic = false,
|
|
@@ -31,10 +66,14 @@ export const Pressable = ({
|
|
|
31
66
|
...props
|
|
32
67
|
}) => {
|
|
33
68
|
const [accessibility, ownProps] = splitAccessibility(props);
|
|
34
|
-
const [resolved, rest] = useSplitSx(ownProps);
|
|
35
69
|
const reduced = useReducedMotion();
|
|
36
70
|
// With motion reduced the press still shows, and nothing moves: a scale dims instead.
|
|
37
71
|
const effect = reduced && pressEffect === 'scale' ? 'opacity' : pressEffect;
|
|
72
|
+
// Always a Reanimated view (the press effect is one), so the motion props need no latch here.
|
|
73
|
+
const [resolved, motion, rest] = useSplitSxMotion(effect === 'scale' && ownProps.animate !== undefined ? {
|
|
74
|
+
...ownProps,
|
|
75
|
+
animate: withoutTransform(ownProps.animate)
|
|
76
|
+
} : ownProps);
|
|
38
77
|
// 0 at rest, 1 held: one value drives whichever effect is picked, so a change of effect needs no second animation.
|
|
39
78
|
const pressed = useSharedValue(0);
|
|
40
79
|
const feedback = haptic === true ? 'light' : haptic || undefined;
|
|
@@ -65,15 +104,17 @@ export const Pressable = ({
|
|
|
65
104
|
|
|
66
105
|
// The finger is down: the Taptic Engine has until the release to wake, so the haptic lands with the press.
|
|
67
106
|
const onPressIn = useCallback(() => {
|
|
68
|
-
if (effect
|
|
69
|
-
pressed.value =
|
|
107
|
+
if (effect === 'scale') {
|
|
108
|
+
pressed.value = withSpring(1, SCALE_IN);
|
|
109
|
+
} else if (effect === 'opacity') {
|
|
110
|
+
pressed.value = withTiming(1, DIM_IN);
|
|
70
111
|
}
|
|
71
112
|
if (feedback) {
|
|
72
113
|
haptics.prepare(feedback);
|
|
73
114
|
}
|
|
74
115
|
}, [effect, feedback, pressed]);
|
|
75
116
|
const onPressOut = useCallback(() => {
|
|
76
|
-
pressed.value =
|
|
117
|
+
pressed.value = effect === 'scale' ? withSpring(0, SCALE_OUT) : withTiming(0, DIM_OUT);
|
|
77
118
|
}, [effect, pressed]);
|
|
78
119
|
const onPressWithHaptic = useCallback(() => {
|
|
79
120
|
if (feedback) {
|
|
@@ -83,7 +124,10 @@ export const Pressable = ({
|
|
|
83
124
|
}, [feedback, onPress]);
|
|
84
125
|
if (androidStyle) {
|
|
85
126
|
return /*#__PURE__*/_jsx(Animated.View, {
|
|
86
|
-
|
|
127
|
+
entering: motion.entering,
|
|
128
|
+
exiting: motion.exiting,
|
|
129
|
+
layout: motion.layout,
|
|
130
|
+
style: [androidStyle.outer, motion.style, rStyle],
|
|
87
131
|
children: /*#__PURE__*/_jsx(RNPressable, {
|
|
88
132
|
...a11y,
|
|
89
133
|
android_ripple: ripple,
|
|
@@ -102,14 +146,17 @@ export const Pressable = ({
|
|
|
102
146
|
return /*#__PURE__*/_jsx(AnimatedPressable, {
|
|
103
147
|
...a11y,
|
|
104
148
|
disabled: disabled,
|
|
149
|
+
entering: motion.entering,
|
|
150
|
+
exiting: motion.exiting,
|
|
105
151
|
hitSlop: 8,
|
|
152
|
+
layout: motion.layout,
|
|
106
153
|
onPress: onPressWithHaptic,
|
|
107
154
|
onPressIn: onPressIn,
|
|
108
155
|
onPressOut: onPressOut,
|
|
109
|
-
style: [resolved, rStyle],
|
|
156
|
+
style: [resolved, motion.style, rStyle],
|
|
110
157
|
testID: testID,
|
|
111
158
|
...rest,
|
|
112
159
|
children: children
|
|
113
160
|
});
|
|
114
|
-
};
|
|
161
|
+
});
|
|
115
162
|
//# sourceMappingURL=pressable.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["accessibilityProps","splitAccessibility","
|
|
1
|
+
{"version":3,"names":["haptics","accessibilityProps","markMotionComponent","splitAccessibility","spring","timing","useSplitSxMotion","opacity","springs","useAppTheme","useReducedMotion","withOpacity","useCallback","useMemo","Platform","Pressable","RNPressable","Animated","useAnimatedStyle","useSharedValue","withSpring","withTiming","splitForRipple","jsx","_jsx","SCALE_IN","SCALE_OUT","DIM_IN","DIM_OUT","PLATFORM_EFFECT","OS","AnimatedPressable","createAnimatedComponent","VISUAL_KEYS","TRANSFORM_KEYS","Set","withoutTransform","animate","undefined","keys","duration","filter","key","has","children","disabled","haptic","onPress","pressEffect","pressedOpacity","pressedScale","ripple","withRipple","testID","props","accessibility","ownProps","reduced","effect","resolved","motion","rest","pressed","feedback","a11y","dimmed","theme","isAndroid","rStyle","transform","scale","value","color","String","foreground","androidStyle","onPressIn","prepare","onPressOut","onPressWithHaptic","play","View","entering","exiting","layout","style","outer","android_ripple","hitSlop","inner"],"sourceRoot":"../../../../src","sources":["atoms/pressable/pressable.tsx"],"mappings":";;AAAA,SAAQA,OAAO,QAAO,0BAA0B;AAChD,SAEEC,kBAAkB,EAClBC,mBAAmB,EAEnBC,kBAAkB,EAClBC,MAAM,EACNC,MAAM,EACNC,gBAAgB,QACX,gBAAgB;AACvB,SAAQC,OAAO,EAAmBC,OAAO,EAAEC,WAAW,EAAEC,gBAAgB,EAAEC,WAAW,QAAO,mBAAmB;AAC/G,SAAQC,WAAW,EAAEC,OAAO,QAAO,OAAO;AAC1C,SAAQC,QAAQ,EAAEC,SAAS,IAAIC,WAAW,QAAuB,cAAc;AAC/E,OAAOC,QAAQ,IAAGC,gBAAgB,EAAEC,cAAc,EAAEC,UAAU,EAAEC,UAAU,QAAO,yBAAyB;AAE1G,SAAQC,cAAc,QAAO,s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CAACO,iBAAiB;IAAA,GACZiC,IAAI;IACRnB,QAAQ,EAAEA,QAAS;IACnBqC,QAAQ,EAAEtB,MAAM,CAACsB,QAAS;IAC1BC,OAAO,EAAEvB,MAAM,CAACuB,OAAQ;IACxBK,OAAO,EAAE,CAAE;IACXJ,MAAM,EAAExB,MAAM,CAACwB,MAAO;IACtBrC,OAAO,EAAEgC,iBAAkB;IAC3BH,SAAS,EAAEA,SAAU;IACrBE,UAAU,EAAEA,UAAW;IACvBO,KAAK,EAAE,CAAC1B,QAAQ,EAAEC,MAAM,CAACyB,KAAK,EAAEjB,MAAM,CAAE;IACxCf,MAAM,EAAEA,MAAO;IAAA,GACXQ,IAAI;IAAAjB,QAAA,EAEPA;EAAQ,CACQ,CAAC;AAExB,CACF,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["atoms/rn-icon/index.ts"],"mappings":";;AAAA,cAAc,
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["atoms/rn-icon/index.ts"],"mappings":";;AAAA,cAAc,cAAW;AACzB,cAAc,oBAAiB","ignoreList":[]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { NativeIcon } from '@hzblj/expo-native-icons';
|
|
4
|
+
import { spacing, useAppTheme } from '@hzblj/kara-theme';
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
/**
|
|
7
|
+
* `@hzblj/expo-native-icons`' `NativeIcon`: a `UIImageView` over the app's asset-catalog icon on iOS, one view drawing
|
|
8
|
+
* its vector drawable on Android. What a list row wants, rather than a SwiftUI or Compose host per row.
|
|
9
|
+
*/
|
|
10
|
+
export const RnIcon = ({
|
|
11
|
+
accessibilityLabel,
|
|
12
|
+
color = 'content.primary',
|
|
13
|
+
name,
|
|
14
|
+
size = 's24',
|
|
15
|
+
testID
|
|
16
|
+
}) => {
|
|
17
|
+
const theme = useAppTheme();
|
|
18
|
+
return /*#__PURE__*/_jsx(NativeIcon, {
|
|
19
|
+
accessibilityLabel: accessibilityLabel,
|
|
20
|
+
color: theme.color(color),
|
|
21
|
+
name: name,
|
|
22
|
+
size: spacing[size],
|
|
23
|
+
testID: testID
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=rn-icon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["NativeIcon","spacing","useAppTheme","jsx","_jsx","RnIcon","accessibilityLabel","color","name","size","testID","theme"],"sourceRoot":"../../../../src","sources":["atoms/rn-icon/rn-icon.tsx"],"mappings":";;AAAA,SAAQA,UAAU,QAAO,0BAA0B;AACnD,SAAQC,OAAO,EAAEC,WAAW,QAAO,mBAAmB;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAItD;AACA;AACA;AACA;AACA,OAAO,MAAMC,MAAuB,GAAGA,CAAC;EACtCC,kBAAkB;EAClBC,KAAK,GAAG,iBAAiB;EACzBC,IAAI;EACJC,IAAI,GAAG,KAAK;EACZC;AACW,CAAC,KAAK;EACjB,MAAMC,KAAK,GAAGT,WAAW,CAAC,CAAC;EAE3B,oBACEE,IAAA,CAACJ,UAAU;IACTM,kBAAkB,EAAEA,kBAAmB;IACvCC,KAAK,EAAEI,KAAK,CAACJ,KAAK,CAACA,KAAK,CAAE;IAC1BC,IAAI,EAAEA,IAAK;IACXC,IAAI,EAAER,OAAO,CAACQ,IAAI,CAAE;IACpBC,MAAM,EAAEA;EAAO,CAChB,CAAC;AAEN,CAAC","ignoreList":[]}
|
|
@@ -1,40 +1,80 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import { MAX_FONT_SCALE, useAppTheme } from '@hzblj/kara-theme';
|
|
5
|
-
import { Text as RNText
|
|
3
|
+
import { isAnimatedStyle, markMotionComponent, themeKey, useAnimatedLatch, useSplitSxMotion } from '@hzblj/kara-sx';
|
|
4
|
+
import { MAX_FONT_SCALE, useAppTheme, useFontScale } from '@hzblj/kara-theme';
|
|
5
|
+
import { Platform, Text as RNText } from 'react-native';
|
|
6
|
+
import Animated from 'react-native-reanimated';
|
|
6
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
-
|
|
8
|
+
/**
|
|
9
|
+
* A hundredth of a point off every line on iOS, which no one can see and which keeps the last line on screen. React
|
|
10
|
+
* Native measures a paragraph and rounds the height up to the pixel grid, then draws it into the frame Yoga laid out,
|
|
11
|
+
* and that frame can come back a hair short of the exact height (`53.9998` for three 18 pt lines, depending on where
|
|
12
|
+
* the text sits on the page). With `lineHeight` fixed, the lines need exactly 54 and the text container drops the last
|
|
13
|
+
* one, cutting the line before it off mid-word. Lines a hair shorter leave the rounding room to absorb the error.
|
|
14
|
+
*/
|
|
15
|
+
const LINE_HEIGHT_SLACK = Platform.OS === 'ios' ? 0.01 : 0;
|
|
16
|
+
|
|
17
|
+
/** Variants, colours and alignments are few, so the text half of the style is shared like the `sx` half. */
|
|
18
|
+
const MAX_TEXT_STYLES = 512;
|
|
19
|
+
const textStyles = new Map();
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* The variant at the user's text size, in its colour. React Native scales `fontSize` for the user's setting but leaves
|
|
23
|
+
* `lineHeight` alone, so a grown glyph ends up in an ungrown line and clips. Scaling it here by the same factor keeps
|
|
24
|
+
* the ratio the variant was designed at, and by the same ceiling `maxFontSizeMultiplier` caps the glyph with
|
|
25
|
+
* (`useFontScale` is capped already), so the two cannot disagree.
|
|
26
|
+
*
|
|
27
|
+
* The native tiers need none of this: SwiftUI's `lineSpacing` is extra space *on top of* the font's own line
|
|
28
|
+
* height, which scales with it, and Compose reads `lineHeight` in `sp`.
|
|
29
|
+
*/
|
|
30
|
+
const textStyle = (theme, variant, color, align, fontScale) => {
|
|
31
|
+
const key = `${themeKey(theme)}|${variant}|${color}|${align}|${fontScale}`;
|
|
32
|
+
const existing = textStyles.get(key);
|
|
33
|
+
if (existing) {
|
|
34
|
+
return existing;
|
|
35
|
+
}
|
|
36
|
+
if (textStyles.size >= MAX_TEXT_STYLES) {
|
|
37
|
+
textStyles.clear();
|
|
38
|
+
}
|
|
39
|
+
const typography = theme.typography[variant];
|
|
40
|
+
const style = {
|
|
41
|
+
...typography,
|
|
42
|
+
color: theme.color(color),
|
|
43
|
+
lineHeight: typography.lineHeight * fontScale - LINE_HEIGHT_SLACK
|
|
44
|
+
};
|
|
45
|
+
if (align) {
|
|
46
|
+
style.textAlign = align;
|
|
47
|
+
}
|
|
48
|
+
textStyles.set(key, style);
|
|
49
|
+
return style;
|
|
50
|
+
};
|
|
51
|
+
export const RnText = markMotionComponent(({
|
|
8
52
|
align,
|
|
9
53
|
color = 'content.primary',
|
|
54
|
+
style,
|
|
10
55
|
variant = 'body',
|
|
11
56
|
...props
|
|
12
57
|
}) => {
|
|
13
58
|
const theme = useAppTheme();
|
|
59
|
+
const fontScale = useFontScale();
|
|
14
60
|
// A view style, which a text accepts whole — only React Native's types disagree, on `userSelect`'s width.
|
|
15
|
-
const [sx, rest] =
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
const lineHeight = style.lineHeight * Math.min(fontScale, MAX_FONT_SCALE);
|
|
30
|
-
return /*#__PURE__*/_jsx(RNText, {
|
|
61
|
+
const [sx, motion, rest] = useSplitSxMotion(props);
|
|
62
|
+
const animated = useAnimatedLatch(motion.animated || isAnimatedStyle(style), 'RnText');
|
|
63
|
+
const text = textStyle(theme, variant, color, align, fontScale);
|
|
64
|
+
if (!animated) {
|
|
65
|
+
return /*#__PURE__*/_jsx(RNText, {
|
|
66
|
+
maxFontSizeMultiplier: MAX_FONT_SCALE,
|
|
67
|
+
style: [text, sx, style],
|
|
68
|
+
...rest
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
return /*#__PURE__*/_jsx(Animated.Text, {
|
|
72
|
+
entering: motion.entering,
|
|
73
|
+
exiting: motion.exiting,
|
|
74
|
+
layout: motion.layout,
|
|
31
75
|
maxFontSizeMultiplier: MAX_FONT_SCALE,
|
|
32
|
-
style: [
|
|
33
|
-
color: theme.color(color),
|
|
34
|
-
lineHeight,
|
|
35
|
-
textAlign: align
|
|
36
|
-
}],
|
|
76
|
+
style: [text, sx, motion.style, style],
|
|
37
77
|
...rest
|
|
38
78
|
});
|
|
39
|
-
};
|
|
79
|
+
});
|
|
40
80
|
//# sourceMappingURL=rn-text.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["isAnimatedStyle","markMotionComponent","themeKey","useAnimatedLatch","useSplitSxMotion","MAX_FONT_SCALE","useAppTheme","useFontScale","Platform","Text","RNText","Animated","jsx","_jsx","LINE_HEIGHT_SLACK","OS","MAX_TEXT_STYLES","textStyles","Map","textStyle","theme","variant","color","align","fontScale","key","existing","get","size","clear","typography","style","lineHeight","textAlign","set","RnText","props","sx","motion","rest","animated","text","maxFontSizeMultiplier","entering","exiting","layout"],"sourceRoot":"../../../../src","sources":["atoms/rn-text/rn-text.tsx"],"mappings":";;AAAA,SACEA,eAAe,EACfC,mBAAmB,EAEnBC,QAAQ,EACRC,gBAAgB,EAChBC,gBAAgB,QACX,gBAAgB;AACvB,SAEEC,cAAc,EAGdC,WAAW,EACXC,YAAY,QACP,mBAAmB;AAC1B,SAAQC,QAAQ,EAAEC,IAAI,IAAIC,MAAM,QAAuC,cAAc;AACrF,OAAOC,QAAQ,MAAM,yBAAyB;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAI9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,iBAAiB,GAAGN,QAAQ,CAACO,EAAE,KAAK,KAAK,GAAG,IAAI,GAAG,CAAC;;AAE1D;AACA,MAAMC,eA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AEC,MAAM,EAAEC,IAAI,CAAC,GAAGnC,gBAAgB,CAACgC,KAAK,CAAmD;EACpG,MAAMI,QAAQ,GAAGrC,gBAAgB,CAACmC,MAAM,CAACE,QAAQ,IAAIxC,eAAe,CAAC+B,KAAK,CAAC,EAAE,QAAQ,CAAC;EACtF,MAAMU,IAAI,GAAGtB,SAAS,CAACC,KAAK,EAAEC,OAAO,EAAEC,KAAK,EAAEC,KAAK,EAAEC,SAAS,CAAC;EAE/D,IAAI,CAACgB,QAAQ,EAAE;IACb,oBACE3B,IAAA,CAACH,MAAM;MAACgC,qBAAqB,EAAErC,cAAe;MAAC0B,KAAK,EAAE,CAACU,IAAI,EAAEJ,EAAE,EAAEN,KAAK,CAA0B;MAAA,GAAKQ;IAAI,CAAG,CAAC;EAEjH;EAEA,oBACE1B,IAAA,CAACF,QAAQ,CAACF,IAAI;IACZkC,QAAQ,EAAEL,MAAM,CAACK,QAAS;IAC1BC,OAAO,EAAEN,MAAM,CAACM,OAAQ;IACxBC,MAAM,EAAEP,MAAM,CAACO,MAAO;IACtBH,qBAAqB,EAAErC,cAAe;IACtC0B,KAAK,EAAE,CAACU,IAAI,EAAEJ,EAAE,EAAEC,MAAM,CAACP,KAAK,EAAEA,KAAK,CAAE;IAAA,GACnCQ;EAAI,CACT,CAAC;AAEN,CACF,CAAC","ignoreList":[]}
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
import { Host, SegmentedButton, SingleChoiceSegmentedButtonRow, Text } from '@expo/ui/jetpack-compose';
|
|
4
4
|
import { fillMaxWidth, testID as testIdModifier, weight } from '@expo/ui/jetpack-compose/modifiers';
|
|
5
|
+
import { haptics } from '@hzblj/expo-rich-haptics';
|
|
5
6
|
import { useAppTheme } from '@hzblj/kara-theme';
|
|
6
7
|
import { useCallback, useMemo } from 'react';
|
|
7
|
-
import { haptics } from "../../haptics/index.js";
|
|
8
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
9
|
const MATCH_HEIGHT_ONLY = {
|
|
10
10
|
horizontal: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Host","SegmentedButton","SingleChoiceSegmentedButtonRow","Text","fillMaxWidth","testID","testIdModifier","weight","useAppTheme","useCallback","useMemo","
|
|
1
|
+
{"version":3,"names":["Host","SegmentedButton","SingleChoiceSegmentedButtonRow","Text","fillMaxWidth","testID","testIdModifier","weight","haptics","useAppTheme","useCallback","useMemo","jsx","_jsx","MATCH_HEIGHT_ONLY","horizontal","vertical","SEGMENT","SegmentedControl","disabled","onChange","selectedIndex","values","theme","colors","activeBorderColor","color","activeContainerColor","activeContentColor","disabledActiveBorderColor","disabledActiveContainerColor","disabledActiveContentColor","disabledInactiveBorderColor","disabledInactiveContentColor","inactiveBorderColor","inactiveContentColor","rowModifiers","select","index","selection","colorScheme","dark","matchContents","seedColor","materialSeed","children","modifiers","map","label","enabled","onClick","selected","Label","style","typography","subheadlineMedium"],"sourceRoot":"../../../../src","sources":["atoms/segmented-control/segmented-control.android.tsx"],"mappings":";;AAAA,SAAQA,IAAI,EAAEC,eAAe,EAAEC,8BAA8B,EAAEC,IAAI,QAAO,0BAA0B;AACpG,SAAQC,YAAY,EAAEC,MAAM,IAAIC,cAAc,EAAEC,MAAM,QAAO,oCAAoC;AACjG,SAAQC,OAAO,QAAO,0BAA0B;AAChD,SAAQC,WAAW,QAAO,mBAAmB;AAC7C,SAAQC,WAAW,EAAEC,OAAO,QAAO,OAAO;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAI1C,MAAMC,iBAAiB,GAAG;EAACC,UAAU,EAAE,KAAK;EAAEC,QAAQ,EAAE;AAAI,CAAC;;AAE7D;AACA,MAAMC,OAAO,GAAG,CAACV,MAAM,CAAC,CAAC,CAAC,CAAC;;AAE3B;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMW,gBAA2C,GAAGA,CAAC;EAC1DC,QAAQ,GAAG,KAAK;EAChBC,QAAQ;EACRC,aAAa;EACbhB,MAAM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,aAAa,EAAEC,MAAM,CAClC,CAAC;EAED,oBACET,IAAA,CAACb,IAAI;IAACwC,WAAW,EAAEjB,KAAK,CAACkB,IAAI,GAAG,MAAM,GAAG,OAAQ;IAACC,aAAa,EAAE5B,iBAAkB;IAAC6B,SAAS,EAAEpB,KAAK,CAACqB,YAAa;IAAAC,QAAA,eAChHhC,IAAA,CAACX,8BAA8B;MAAC4C,SAAS,EAAEV,YAAa;MAAAS,QAAA,EACrDvB,MAAM,CAACyB,GAAG,CAAC,CAACC,KAAK,EAAEV,KAAK,kBACvBzB,IAAA,CAACZ,eAAe;QACduB,MAAM,EAAEA,MAAO;QACfyB,OAAO,EAAE,CAAC9B,QAAS;QAEnB2B,SAAS,EAAE7B,OAAQ;QACnBiC,OAAO,EAAEA,CAAA,KAAMb,MAAM,CAACC,KAAK,CAAE;QAC7Ba,QAAQ,EAAEb,KAAK,KAAKjB,aAAc;QAAAwB,QAAA,eAElChC,IAAA,CAACZ,eAAe,CAACmD,KAAK;UAAAP,QAAA,eACpBhC,IAAA,CAACV,IAAI;YAACkD,KAAK,EAAE9B,KAAK,CAAC+B,UAAU,CAACC,iBAAkB;YAAAV,QAAA,EAAEG;UAAK,CAAO;QAAC,CAC1C;MAAC,GAPnBV,KAQU,CAClB;IAAC,CAC4B;EAAC,CAC7B,CAAC;AAEX,CAAC","ignoreList":[]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
import { timing } from '@hzblj/kara-sx';
|
|
3
4
|
import { duration, opacity, useReducedMotion } from '@hzblj/kara-theme';
|
|
4
5
|
import { useEffect } from 'react';
|
|
5
6
|
import { cancelAnimation, useAnimatedStyle, useSharedValue, withRepeat, withTiming } from 'react-native-reanimated';
|
|
6
|
-
import {
|
|
7
|
-
import { ABox } from "../box/index.js";
|
|
7
|
+
import { Box } from "../box/index.js";
|
|
8
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
9
|
/** A breath, not a transition, so it sits off the scale: `slow` twice each way, at constant speed. */
|
|
10
10
|
const PULSE = {
|
|
@@ -33,7 +33,7 @@ export const Skeleton = ({
|
|
|
33
33
|
const rStyle = useAnimatedStyle(() => ({
|
|
34
34
|
opacity: pulse.value
|
|
35
35
|
}), []);
|
|
36
|
-
return /*#__PURE__*/_jsx(
|
|
36
|
+
return /*#__PURE__*/_jsx(Box, {
|
|
37
37
|
"aria-hidden": true,
|
|
38
38
|
bg: "fill.quaternary",
|
|
39
39
|
borderRadius: borderRadius,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["duration","opacity","useReducedMotion","useEffect","cancelAnimation","useAnimatedStyle","useSharedValue","withRepeat","withTiming","
|
|
1
|
+
{"version":3,"names":["timing","duration","opacity","useReducedMotion","useEffect","cancelAnimation","useAnimatedStyle","useSharedValue","withRepeat","withTiming","Box","jsx","_jsx","PULSE","slow","Skeleton","borderRadius","h","testID","w","reduced","pulse","o40","value","o70","o100","rStyle","bg","style","wide","undefined"],"sourceRoot":"../../../../src","sources":["atoms/skeleton/skeleton.tsx"],"mappings":";;AAAA,SAAQA,MAAM,QAAO,gBAAgB;AACrC,SAAQC,QAAQ,EAAEC,OAAO,EAAEC,gBAAgB,QAAO,mBAAmB;AACrE,SAAQC,SAAS,QAAO,OAAO;AAC/B,SAAQC,eAAe,EAAEC,gBAAgB,EAAEC,cAAc,EAAEC,UAAU,EAAEC,UAAU,QAAO,yBAAyB;AAEjH,SAAQC,GAAG,QAAO,iBAAQ;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAG1B;AACA,MAAMC,KAAK,GAAG;EAAC,GAAGb,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC;EAAEC,QAAQ,EAAEA,QAAQ,CAACa,IAAI,GAAG;AAAC,CAAC;AAExE,OAAO,MAAMC,QAA2B,GAAGA,CAAC;EAACC,YAAY,GAAG,OAAO;EAAEC,CAAC;EAAEC,MAAM;EAAEC;AAAgB,CAAC,KAAK;EACpG,MAAMC,OAAO,GAAGjB,gBAAgB,CAAC,CAAC;EAClC,MAAMkB,KAAK,GAAGd,cAAc,CAASL,OAAO,CAACoB,GAAG,CAAC;;EAEjD;EACAlB,SAAS,CAAC,MAAM;IACd,IAAIgB,OAAO,EAAE;MACXf,eAAe,CAACgB,KAAK,CAAC;MACtBA,KAAK,CAACE,KAAK,GAAGrB,OAAO,CAACsB,GAAG;MACzB;IACF;IAEAH,KAAK,CAACE,KAAK,GAAGrB,OAAO,CAACoB,GAAG;IACzBD,KAAK,CAACE,KAAK,GAAGf,UAAU,CAACC,UAAU,CAACP,OAAO,CAACuB,IAAI,EAAEZ,KAAK,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,CAAC;EACrE,CAAC,EAAE,CAACQ,KAAK,EAAED,OAAO,CAAC,CAAC;EAEpB,MAAMM,MAAM,GAAGpB,gBAAgB,CAAC,OAAO;IAACJ,OAAO,EAAEmB,KAAK,CAACE;EAAK,CAAC,CAAC,EAAE,EAAE,CAAC;EAEnE,oBACEX,IAAA,CAACF,GAAG;IACF,mBAAW;IACXiB,EAAE,EAAC,iBAAiB;IACpBX,YAAY,EAAEA,YAAa;IAC3BC,CAAC,EAAEA,CAAE;IACLW,KAAK,EAAEF,MAAO;IACdR,MAAM,EAAEA,MAAO;IACfC,CAAC,EAAEA,CAAE;IACLU,IAAI,EAAEV,CAAC,KAAKW;EAAU,CACvB,CAAC;AAEN,CAAC","ignoreList":[]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { Slider as ComposeSlider } from '@expo/ui/jetpack-compose';
|
|
4
|
+
import { haptics } from '@hzblj/expo-rich-haptics';
|
|
4
5
|
import { useAppTheme } from '@hzblj/kara-theme';
|
|
5
6
|
import { useCallback, useEffect, useRef } from 'react';
|
|
6
|
-
import { haptics } from "../../haptics/index.js";
|
|
7
7
|
import { useHostGuard } from "../../host-context.js";
|
|
8
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
9
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Slider","ComposeSlider","useAppTheme","useCallback","useEffect","useRef","
|
|
1
|
+
{"version":3,"names":["Slider","ComposeSlider","haptics","useAppTheme","useCallback","useEffect","useRef","useHostGuard","jsx","_jsx","disabled","max","min","onValueChange","step","value","theme","steps","Math","round","stopOf","at","stop","current","onChange","next","reached","tick","colors","activeTrackColor","color","thumbColor","enabled"],"sourceRoot":"../../../../src","sources":["atoms/slider/slider.android.tsx"],"mappings":";;AAAA,SAAQA,MAAM,IAAIC,aAAa,QAAO,0BAA0B;AAChE,SAAQC,OAAO,QAAO,0BAA0B;AAChD,SAAQC,WAAW,QAAO,mBAAmB;AAC7C,SAAQC,WAAW,EAAEC,SAAS,EAAEC,MAAM,QAAO,OAAO;AAEpD,SAAQC,YAAY,QAAO,uBAAoB;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAG/C;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMT,MAAuB,GAAGA,CAAC;EACtCU,QAAQ,GAAG,KAAK;EAChBC,GAAG,GAAG,CAAC;EACPC,GAAG,GAAG,CAAC;EACPC,aAAa;EACbC,IAAI;EACJC;AACW,CAAC,KAAK;EACjBR,YAAY,CAAC,QAAQ,CAAC;EACtB,MAAMS,KAAK,GAAGb,WAAW,CAAC,CAAC;EAC3B,MAAMc,KAAK,GAAGH,IAAI,GAAGI,IAAI,CAACP,GAAG,CAAC,CAAC,EAAEO,IAAI,CAACC,KAAK,CAAC,CAACR,GAAG,GAAGC,GAAG,IAAIE,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC;;EAExE;EACA;EACA,MAAMM,MAAM,GAAGhB,WAAW,CAAEiB,EAAU,IAAMP,IAAI,GAAGI,IAAI,CAACC,KAAK,CAAC,CAACE,EAAE,GAAGT,GAAG,IAAIE,IAAI,CAAC,GAAG,CAAE,EAAE,CAACF,GAAG,EAAEE,IAAI,CAAC,CAAC;EACnG,MAAMQ,IAAI,GAAGhB,MAAM,CAACc,MAAM,CAACL,KAAK,CAAC,CAAC;EAElCV,SAAS,CAAC,MAAM;IACdiB,IAAI,CAACC,OAAO,GAAGH,MAAM,CAACL,KAAK,CAAC;EAC9B,CAAC,EAAE,CAACK,MAAM,EAAEL,KAAK,CAAC,CAAC;EAEnB,MAAMS,QAAQ,GAAGpB,WAAW,CACzBqB,IAAY,IAAK;IAChB,MAAMC,OAAO,GAAGN,MAAM,CAACK,IAAI,CAAC;IAE5B,IAAIR,KAAK,GAAG,CAAC,IAAIS,OAAO,KAAKJ,IAAI,CAACC,OAAO,EAAE;MACzCrB,OAAO,CAACyB,IAAI,CAAC,CAAC;IAChB;IAEAL,IAAI,CAACC,OAAO,GAAGG,OAAO;IACtBb,aAAa,GAAGY,IAAI,CAAC;EACvB,CAAC,EACD,CAACZ,aAAa,EAAEO,MAAM,EAAEH,KAAK,CAC/B,CAAC;EAED,oBACER,IAAA,CAACR,aAAa;IACZ2B,MAAM,EAAE;MACNC,gBAAgB,EAAEb,KAAK,CAACc,KAAK,CAAC,qBAAqB,CAAC;MACpDC,UAAU,EAAEf,KAAK,CAACc,KAAK,CAAC,qBAAqB;IAC/C,CAAE;IACFE,OAAO,EAAE,CAACtB,QAAS;IACnBC,GAAG,EAAEA,GAAI;IACTC,GAAG,EAAEA,GAAI;IACTC,aAAa,EAAEW,QAAS;IACxBP,KAAK,EAAEA,KAAM;IACbF,KAAK,EAAEA;EAAM,CACd,CAAC;AAEN,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["atoms/stagger/index.ts"],"mappings":";;AAAA,cAAc,cAAW;AACzB,cAAc,oBAAiB","ignoreList":[]}
|