@gryt/ui-native 0.11.0 → 0.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Accordion/Accordion.d.ts.map +1 -1
- package/dist/components/Accordion/Accordion.js +2 -1
- package/dist/components/Alert/Alert.d.ts.map +1 -1
- package/dist/components/Alert/Alert.js +2 -1
- package/dist/components/AlertDialog/AlertDialog.d.ts.map +1 -1
- package/dist/components/Avatar/Avatar.d.ts.map +1 -1
- package/dist/components/Avatar/Avatar.js +2 -1
- package/dist/components/Badge/Badge.d.ts.map +1 -1
- package/dist/components/Badge/Badge.js +2 -1
- package/dist/components/Button/Button.d.ts.map +1 -1
- package/dist/components/Button/Button.js +2 -1
- package/dist/components/Card/Card.d.ts.map +1 -1
- package/dist/components/Card/Card.js +2 -1
- package/dist/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/components/Checkbox/Checkbox.js +1 -1
- package/dist/components/Chip/Chip.d.ts.map +1 -1
- package/dist/components/Chip/Chip.js +2 -1
- package/dist/components/Dialog/Dialog.d.ts.map +1 -1
- package/dist/components/Dialog/Dialog.js +2 -1
- package/dist/components/Drawer/Drawer.d.ts.map +1 -1
- package/dist/components/Drawer/Drawer.js +24 -0
- package/dist/components/Menu/Menu.d.ts.map +1 -1
- package/dist/components/Menu/Menu.js +2 -1
- package/dist/components/Meter/Meter.d.ts.map +1 -1
- package/dist/components/Meter/Meter.js +2 -1
- package/dist/components/NumberField/NumberField.d.ts.map +1 -1
- package/dist/components/NumberField/NumberField.js +3 -1
- package/dist/components/OtpField/OtpField.d.ts.map +1 -1
- package/dist/components/OtpField/OtpField.js +3 -1
- package/dist/components/Select/Select.d.ts.map +1 -1
- package/dist/components/Select/Select.js +2 -1
- package/dist/components/Sheet/Sheet.d.ts.map +1 -1
- package/dist/components/Sheet/Sheet.js +2 -1
- package/dist/components/Slider/Slider.d.ts.map +1 -1
- package/dist/components/Slider/Slider.js +12 -0
- package/dist/components/Tabs/Tabs.d.ts.map +1 -1
- package/dist/components/Tabs/Tabs.js +2 -1
- package/dist/components/TextField/TextField.d.ts.map +1 -1
- package/dist/components/TextField/TextField.js +3 -1
- package/dist/components/Toast/Toast.d.ts.map +1 -1
- package/dist/components/Toast/Toast.js +2 -1
- package/dist/components/Toggle/Toggle.d.ts.map +1 -1
- package/dist/components/Toggle/Toggle.js +2 -1
- package/dist/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/components/Tooltip/Tooltip.js +2 -1
- package/dist/components/internal/ControlRow.d.ts.map +1 -1
- package/dist/components/internal/ControlRow.js +2 -1
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -0
- package/dist/internal/Text.d.ts +37 -0
- package/dist/internal/Text.d.ts.map +1 -0
- package/dist/internal/Text.js +38 -0
- package/dist/internal/TextInput.d.ts +16 -0
- package/dist/internal/TextInput.d.ts.map +1 -0
- package/dist/internal/TextInput.js +23 -0
- package/dist/theme/ThemeProvider.d.ts +10 -2
- package/dist/theme/ThemeProvider.d.ts.map +1 -1
- package/dist/theme/ThemeProvider.js +3 -3
- package/dist/theme/createNativeTheme.d.ts +70 -0
- package/dist/theme/createNativeTheme.d.ts.map +1 -1
- package/dist/theme/createNativeTheme.js +54 -0
- package/dist/theme/index.d.ts +1 -1
- package/dist/theme/index.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Accordion.d.ts","sourceRoot":"","sources":["../../../src/components/Accordion/Accordion.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAuC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC5E,OAAO,
|
|
1
|
+
{"version":3,"file":"Accordion.d.ts","sourceRoot":"","sources":["../../../src/components/Accordion/Accordion.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAuC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC5E,OAAO,EAAmB,KAAK,SAAS,EA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
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { createContext, useContext, useState } from "react";
|
|
3
|
-
import { Pressable,
|
|
3
|
+
import { Pressable, View } from "react-native";
|
|
4
|
+
import { Text } from "../../internal/Text.js";
|
|
4
5
|
import { useTheme } from "../../theme/index.js";
|
|
5
6
|
const AccordionContext = createContext(null);
|
|
6
7
|
const ItemContext = createContext(null);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Alert.d.ts","sourceRoot":"","sources":["../../../src/components/Alert/Alert.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,
|
|
1
|
+
{"version":3,"file":"Alert.d.ts","sourceRoot":"","sources":["../../../src/components/Alert/Alert.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAQ,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAKpE,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;AAErE,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AASD;;;;;;;;;GASG;AACH,wBAAgB,KAAK,CAAC,EAAE,QAAiB,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,UAAU,+BAmC9E"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { View } from "react-native";
|
|
3
|
+
import { Text } from "../../internal/Text.js";
|
|
3
4
|
import { useTheme } from "../../theme/index.js";
|
|
4
5
|
const RAMP = {
|
|
5
6
|
info: "accent",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AlertDialog.d.ts","sourceRoot":"","sources":["../../../src/components/AlertDialog/AlertDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,gBAAgB,EAAE,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEvF;;;;;;;;;;GAUG;AAIH,MAAM,MAAM,qBAAqB,GAAG,IAAI,CAAC,gBAAgB,EAAE,aAAa,CAAC,CAAC;AAE1E,iBAAS,KAAK,CAAC,KAAK,EAAE,qBAAqB,+BAE1C;AAED,MAAM,MAAM,oBAAoB,GAAG,eAAe,CAAC;AAEnD,eAAO,MAAM,WAAW;;;;
|
|
1
|
+
{"version":3,"file":"AlertDialog.d.ts","sourceRoot":"","sources":["../../../src/components/AlertDialog/AlertDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,gBAAgB,EAAE,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEvF;;;;;;;;;;GAUG;AAIH,MAAM,MAAM,qBAAqB,GAAG,IAAI,CAAC,gBAAgB,EAAE,aAAa,CAAC,CAAC;AAE1E,iBAAS,KAAK,CAAC,KAAK,EAAE,qBAAqB,+BAE1C;AAED,MAAM,MAAM,oBAAoB,GAAG,eAAe,CAAC;AAEnD,eAAO,MAAM,WAAW;;;;gBAU42B,CAAC;;;;;gBAAovK,CAAC;aAAkB,CAAC;;;gBAAiS,CAAC;aAAkB,CAAC;;;gBAAkiB,CAAC;aAAkB,CAAC;;CADv/N,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../../src/components/Avatar/Avatar.tsx"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../../src/components/Avatar/Avatar.tsx"],"names":[],"mappings":"AACA,OAAO,EAAe,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAK3E,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAU1D,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAuBD,wBAAgB,MAAM,CAAC,EAAE,IAAS,EAAE,MAAM,EAAE,IAAW,EAAE,KAAK,EAAE,EAAE,WAAW,+BA+C5E"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useState } from "react";
|
|
3
|
-
import { Image,
|
|
3
|
+
import { Image, View } from "react-native";
|
|
4
|
+
import { Text } from "../../internal/Text.js";
|
|
4
5
|
import { useTheme } from "../../theme/index.js";
|
|
5
6
|
const SIZES = {
|
|
6
7
|
xs: 20,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../../../src/components/Badge/Badge.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../../../src/components/Badge/Badge.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAKpE,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,WAAW,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAC;AAE9F,MAAM,WAAW,UAAU;IACzB,8DAA8D;IAC9D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,8EAA8E;IAC9E,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAED,wBAAgB,KAAK,CAAC,EACpB,KAAK,EACL,GAAQ,EACR,GAAW,EACX,IAAe,EACf,KAAK,GACN,EAAE,UAAU,sCA0CZ"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { View } from "react-native";
|
|
3
|
+
import { Text } from "../../internal/Text.js";
|
|
3
4
|
import { useTheme } from "../../theme/index.js";
|
|
4
5
|
export function Badge({ count, max = 99, dot = false, tone = "danger", style, }) {
|
|
5
6
|
const theme = useTheme();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAGL,KAAK,cAAc,EACnB,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAStB,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,WAAW,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,CAAC;AAClF,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;AASjE,MAAM,WAAW,WAAY,SAAQ,IAAI,CAAC,cAAc,EAAE,OAAO,GAAG,UAAU,CAAC;IAC7E,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B;;;;;;;;OAQG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAWD,wBAAgB,MAAM,CAAC,EACrB,QAAQ,EACR,IAAgB,EAChB,IAAe,EACf,SAAS,EACT,OAAO,EACP,KAAK,EACL,QAAgB,EAChB,QAAQ,EACR,GAAG,IAAI,EACR,EAAE,WAAW,+BA8Fb"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Pressable,
|
|
2
|
+
import { Pressable, View, } from "react-native";
|
|
3
|
+
import { Text } from "../../internal/Text.js";
|
|
3
4
|
import Animated from "react-native-reanimated";
|
|
4
5
|
import { grytScaleSteps } from "@gryt/theme";
|
|
5
6
|
import { useReducedMotion } from "../../hooks/useReducedMotion.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.d.ts","sourceRoot":"","sources":["../../../src/components/Card/Card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,
|
|
1
|
+
{"version":3,"file":"Card.d.ts","sourceRoot":"","sources":["../../../src/components/Card/Card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAQ,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAKpF,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAED,wBAAgB,IAAI,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,SAAS,+BAkBlD;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,qEAAqE;IACrE,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,UAAU,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CACnC;AAED,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE,eAAe,+BAkCzF;AAED,wBAAgB,WAAW,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,SAAS,+BAOzD;AAED,wBAAgB,WAAW,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,SAAS,+BAkBzD"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { View } from "react-native";
|
|
3
|
+
import { Text } from "../../internal/Text.js";
|
|
3
4
|
import { useTheme } from "../../theme/index.js";
|
|
4
5
|
export function Card({ children, style }) {
|
|
5
6
|
const theme = useTheme();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../../src/components/Checkbox/Checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAuB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC5D,OAAO,
|
|
1
|
+
{"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../../src/components/Checkbox/Checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAuB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC5D,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAU9D,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,WAAW,GAAG,SAAS,GAAG,QAAQ,CAAC;AAE1E,MAAM,WAAW,aAAa;IAC5B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,sEAAsE;IACtE,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC7C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB;;;OAGG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAID;;;;;;;;GAQG;AACH,wBAAgB,QAAQ,CAAC,EACvB,OAAO,EAAE,UAAU,EACnB,cAAsB,EACtB,aAAqB,EACrB,eAAe,EACf,QAAQ,EACR,IAAgB,EAChB,KAAK,EACL,KAAK,EACL,kBAAkB,GACnB,EAAE,aAAa,+BAiFf"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useState } from "react";
|
|
3
|
-
import { Text } from "
|
|
3
|
+
import { Text } from "../../internal/Text.js";
|
|
4
4
|
import Animated, { useAnimatedStyle, useSharedValue } from "react-native-reanimated";
|
|
5
5
|
import { grytScaleSteps } from "@gryt/theme";
|
|
6
6
|
import { springy } from "../../motion/index.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Chip.d.ts","sourceRoot":"","sources":["../../../src/components/Chip/Chip.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Chip.d.ts","sourceRoot":"","sources":["../../../src/components/Chip/Chip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAKpE,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,WAAW,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAC;AAC7F,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;AAEvD,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAED;;;;;GAKG;AACH,wBAAgB,IAAI,CAAC,EACnB,KAAK,EACL,IAAgB,EAChB,OAAgB,EAChB,KAAK,GACN,EAAE,SAAS,+BA4CX"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { View } from "react-native";
|
|
3
|
+
import { Text } from "../../internal/Text.js";
|
|
3
4
|
import { useTheme } from "../../theme/index.js";
|
|
4
5
|
/**
|
|
5
6
|
* A small status label. No interaction — that is Button's job.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../../src/components/Dialog/Dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA6B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAClE,OAAO,
|
|
1
|
+
{"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../../src/components/Dialog/Dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA6B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAClE,OAAO,EAKL,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAgB,KAAK,cAAc,EAAE,MAAM,4BAA4B,CAAC;AA2B/E,MAA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EAAE;IAAE,QAAQ,CAAC,EAAE,SAAS,CAAC;IAAC,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;CAAE,+BAY1F;AAED,iBAAS,KAAK,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE;IAAE,QAAQ,CAAC,EAAE,SAAS,CAAC;IAAC,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;CAAE,+BAOzF;AAED,eAAO,MAAM,MAAM;;;;;;;;;;CAUlB,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { createContext, useContext } from "react";
|
|
3
|
-
import { Modal, Pressable, ScrollView,
|
|
3
|
+
import { Modal, Pressable, ScrollView, View, } from "react-native";
|
|
4
|
+
import { Text } from "../../internal/Text.js";
|
|
4
5
|
import { useOpenState } from "../../overlay/useOpenState.js";
|
|
5
6
|
import { useTheme } from "../../theme/index.js";
|
|
6
7
|
const DialogContext = createContext(null);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Drawer.d.ts","sourceRoot":"","sources":["../../../src/components/Drawer/Drawer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,cAAc,EAEnB,KAAK,SAAS,EAOf,MAAM,OAAO,CAAC;AACf,OAAO,EAIL,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,QAAQ,IAAI,eAAe,EAG3B,UAAU,IAAI,iBAAiB,EAChC,MAAM,8BAA8B,CAAC;AAWtC,OAAO,EAAgB,KAAK,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAG/E,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;AA6CrD,MAAM,WAAW,eAAgB,SAAQ,cAAc;IACrD,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,iBAAS,IAAI,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,CAAC"}
|
|
@@ -111,7 +111,20 @@ function Popup({ children, side = "left", size = 0.8, dismissible = true, style
|
|
|
111
111
|
* animation has finished.
|
|
112
112
|
*/
|
|
113
113
|
const [mounted, setMounted] = useState(open);
|
|
114
|
+
/*
|
|
115
|
+
* react-hooks/set-state-in-effect is right that this is state derived from a
|
|
116
|
+
* prop, and wrong that it can be derived during render. `mounted` has to be
|
|
117
|
+
* true whenever `open` is — which a render-time `open || exiting` gives —
|
|
118
|
+
* but it also has to *stay* true after `open` goes false, until the exit
|
|
119
|
+
* animation ends. Knowing that `open` just changed is the part that needs an
|
|
120
|
+
* effect; the alternative is reading a previous-value ref during render,
|
|
121
|
+
* which react-hooks/refs forbids in the same breath.
|
|
122
|
+
*
|
|
123
|
+
* Keeping a panel mounted through its own exit is one of the cases the React
|
|
124
|
+
* docs leave to an effect, so this is the pattern working rather than a smell.
|
|
125
|
+
*/
|
|
114
126
|
useEffect(() => {
|
|
127
|
+
// eslint-disable-next-line react-hooks/set-state-in-effect
|
|
115
128
|
if (open)
|
|
116
129
|
setMounted(true);
|
|
117
130
|
}, [open]);
|
|
@@ -121,6 +134,10 @@ function Popup({ children, side = "left", size = 0.8, dismissible = true, style
|
|
|
121
134
|
if (reducedMotion) {
|
|
122
135
|
// eslint-disable-next-line react-hooks/immutability
|
|
123
136
|
progress.value = open ? 1 : 0;
|
|
137
|
+
// Same as the mount above: there is no animation to wait for here, so
|
|
138
|
+
// the unmount happens immediately, but it is still driven by `open`
|
|
139
|
+
// having changed.
|
|
140
|
+
// eslint-disable-next-line react-hooks/set-state-in-effect
|
|
124
141
|
if (!open)
|
|
125
142
|
setMounted(false);
|
|
126
143
|
return;
|
|
@@ -247,6 +264,12 @@ function Popup({ children, side = "left", size = 0.8, dismissible = true, style
|
|
|
247
264
|
if (scrollables.length > 0) {
|
|
248
265
|
gesture.simultaneousWithExternalGesture(...scrollables);
|
|
249
266
|
}
|
|
267
|
+
/* Every `drag.value = …` below runs in a worklet on the UI thread, when the
|
|
268
|
+
* finger moves — not while this memo is building the recogniser.
|
|
269
|
+
* react-hooks/immutability cannot see through the closure and reads a
|
|
270
|
+
* Reanimated shared value being assigned during render, which is also why
|
|
271
|
+
* the two `progress.value` writes further up already carry this. */
|
|
272
|
+
/* eslint-disable react-hooks/immutability */
|
|
250
273
|
return gesture
|
|
251
274
|
.onUpdate((event) => {
|
|
252
275
|
"worklet";
|
|
@@ -285,6 +308,7 @@ function Popup({ children, side = "left", size = 0.8, dismissible = true, style
|
|
|
285
308
|
if (!success)
|
|
286
309
|
drag.value = travelTo(0, { duration: durations.springSoft });
|
|
287
310
|
});
|
|
311
|
+
/* eslint-enable react-hooks/immutability */
|
|
288
312
|
}, [dismissible, drag, extent, scrollables, setOpen, side, vertical]);
|
|
289
313
|
/**
|
|
290
314
|
* Any leftover drag goes back as the panel opens, and is cleared once it is
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Menu.d.ts","sourceRoot":"","sources":["../../../src/components/Menu/Menu.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAkD,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACvF,OAAO,
|
|
1
|
+
{"version":3,"file":"Menu.d.ts","sourceRoot":"","sources":["../../../src/components/Menu/Menu.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAkD,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACvF,OAAO,EAAmB,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAI/E,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAE5D,OAAO,EAAgB,KAAK,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAkB/E,MAAM,WAAW,aAAc,SAAQ,cAAc;IACnD,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,iBAAS,IAAI,CAAC,EAAE,QAAQ,EAAE,GAAG,SAAS,EAAE,EAAE,aAAa,+BAQtD;AAED,iBAAS,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
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { createContext, useCallback, useContext, useRef } from "react";
|
|
3
|
-
import { Pressable,
|
|
3
|
+
import { Pressable, View } from "react-native";
|
|
4
|
+
import { Text } from "../../internal/Text.js";
|
|
4
5
|
import { AnchoredPopup } from "../../overlay/AnchoredPopup.js";
|
|
5
6
|
import { useAnchorMeasure } from "../../overlay/useAnchoredPosition.js";
|
|
6
7
|
import { useOpenState } from "../../overlay/useOpenState.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Meter.d.ts","sourceRoot":"","sources":["../../../src/components/Meter/Meter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,
|
|
1
|
+
{"version":3,"file":"Meter.d.ts","sourceRoot":"","sources":["../../../src/components/Meter/Meter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAQ,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAKpE,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,6DAA6D;IAC7D,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IACnC,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAED;;;;;;GAMG;AACH,wBAAgB,KAAK,CAAC,EACpB,KAAK,EACL,GAAO,EACP,GAAS,EACT,KAAK,EACL,SAAiB,EACjB,MAAM,EACN,KAAK,GACN,EAAE,UAAU,+BAmDZ"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { View } from "react-native";
|
|
3
|
+
import { Text } from "../../internal/Text.js";
|
|
3
4
|
import { useTheme } from "../../theme/index.js";
|
|
4
5
|
/**
|
|
5
6
|
* A reading, not a progress bar.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NumberField.d.ts","sourceRoot":"","sources":["../../../src/components/NumberField/NumberField.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,
|
|
1
|
+
{"version":3,"file":"NumberField.d.ts","sourceRoot":"","sources":["../../../src/components/NumberField/NumberField.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAmB,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAyC/E,MAAM,WAAW,gBAAgB;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EAAE,UAAU,EACjB,YAAgB,EAChB,aAAa,EACb,GAA8B,EAC9B,GAA8B,EAC9B,IAAQ,EACR,KAAK,EACL,QAAQ,EACR,KAAK,GACN,EAAE,gBAAgB,+BAgElB"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useState } from "react";
|
|
3
|
-
import { Pressable,
|
|
3
|
+
import { Pressable, View } from "react-native";
|
|
4
|
+
import { TextInput } from "../../internal/TextInput.js";
|
|
5
|
+
import { Text } from "../../internal/Text.js";
|
|
4
6
|
import { useTheme } from "../../theme/index.js";
|
|
5
7
|
/**
|
|
6
8
|
* Declared here rather than inside NumberField.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OtpField.d.ts","sourceRoot":"","sources":["../../../src/components/OtpField/OtpField.tsx"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"OtpField.d.ts","sourceRoot":"","sources":["../../../src/components/OtpField/OtpField.tsx"],"names":[],"mappings":"AACA,OAAO,EAAmB,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAS/E,MAAM,WAAW,aAAa;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,QAAQ,CAAC,EACvB,MAAU,EACV,KAAK,EAAE,UAAU,EACjB,aAAa,EACb,UAAU,EACV,QAAQ,EACR,SAAS,EACT,KAAK,GACN,EAAE,aAAa,+BAgEf"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useRef, useState } from "react";
|
|
3
|
-
import { Pressable,
|
|
3
|
+
import { Pressable, View } from "react-native";
|
|
4
|
+
import { TextInput } from "../../internal/TextInput.js";
|
|
5
|
+
import { Text } from "../../internal/Text.js";
|
|
4
6
|
import { useTheme } from "../../theme/index.js";
|
|
5
7
|
/**
|
|
6
8
|
* One hidden input behind a row of boxes.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../src/components/Select/Select.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACtE,OAAO,
|
|
1
|
+
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../src/components/Select/Select.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACtE,OAAO,EAAmB,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAO/E,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,SAAS,CAAC;IACjB,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,QAAQ,CAAC;AAO5C,MAAM,WAAW,WAAW;IAC1B,OAAO,CAAC,EAAE,YAAY,EAAE,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAC/B,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IACtC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,KAAK,IAAI,CAAC;IACjD,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,MAAM,CAAC,EACrB,OAAY,EACZ,KAAK,EAAE,UAAU,EACjB,YAAmB,EACnB,aAAa,EACb,KAAK,EACL,WAAuB,EACvB,IAAe,EACf,QAAQ,EACR,KAAK,GACN,EAAE,WAAW,+BAgHb"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback, useRef, useState } from "react";
|
|
3
|
-
import { Pressable,
|
|
3
|
+
import { Pressable, View } from "react-native";
|
|
4
|
+
import { Text } from "../../internal/Text.js";
|
|
4
5
|
import { AnchoredPopup } from "../../overlay/AnchoredPopup.js";
|
|
5
6
|
import { useAnchorMeasure } from "../../overlay/useAnchoredPosition.js";
|
|
6
7
|
import { useTheme } from "../../theme/index.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sheet.d.ts","sourceRoot":"","sources":["../../../src/components/Sheet/Sheet.tsx"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,cAAc,EACnB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,
|
|
1
|
+
{"version":3,"file":"Sheet.d.ts","sourceRoot":"","sources":["../../../src/components/Sheet/Sheet.tsx"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,cAAc,EACnB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAAmB,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAE/E,OAAO,EAIL,qBAAqB,EAKtB,MAAM,sBAAsB,CAAC;AAM9B,OAAO,EAAgB,KAAK,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAI/E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE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AAK,EAAE,EAAE,eAAe,+BAOlD;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAED,iBAAS,KAAK,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,eAAe,+BAiBlD;AAED,eAAO,MAAM,KAAK;;;;;;CAMhB,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { createContext, useCallback, useContext, useEffect, useMemo, useRef, } from "react";
|
|
3
|
-
import { Pressable,
|
|
3
|
+
import { Pressable, View } from "react-native";
|
|
4
|
+
import { Text } from "../../internal/Text.js";
|
|
4
5
|
import { BottomSheetBackdrop, BottomSheetModal, BottomSheetModalProvider, BottomSheetScrollView, BottomSheetView, useBottomSheetTimingConfigs, } from "@gorhom/bottom-sheet";
|
|
5
6
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
6
7
|
import { grytDrawerBleed } from "@gryt/theme";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Slider.d.ts","sourceRoot":"","sources":["../../../src/components/Slider/Slider.tsx"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAUtB,OAAO,EAAsB,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AAGrE,MAAM,MAAM,UAAU,GAAG,OAAO,CAC9B,aAAa,EACb,SAAS,GAAG,WAAW,GAAG,SAAS,GAAG,QAAQ,CAC/C,CAAC;AAEF,MAAM,WAAW,WAAW;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,+DAA+D;IAC/D,aAAa,CAAC,EAAE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,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAKD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,MAAM,CAAC,EACrB,KAAK,EAAE,UAAU,EACjB,YAAgB,EAChB,aAAa,EACb,aAAa,EACb,GAAO,EACP,GAAS,EACT,IAAQ,EACR,QAAQ,EACR,IAAgB,EAChB,KAAK,EACL,kBAAkB,EACnB,EAAE,WAAW,+BAwKb"}
|
|
@@ -79,6 +79,17 @@ export function Slider({ value: controlled, defaultValue = 0, onValueChange, onV
|
|
|
79
79
|
* clearly sideways, or every attempt to scroll past a slider moves it. `Race`
|
|
80
80
|
* lets whichever qualifies win, and only one ever does.
|
|
81
81
|
*/
|
|
82
|
+
/* Everything below runs when a finger moves, not while this memo builds the
|
|
83
|
+
* recognisers. react-hooks/refs and react-hooks/immutability cannot see
|
|
84
|
+
* through the closures: they read `state.current` and `emit.current` being
|
|
85
|
+
* touched during render, and `thumbScale.value` — a Reanimated shared value —
|
|
86
|
+
* being assigned there. Both actually happen inside gesture callbacks.
|
|
87
|
+
*
|
|
88
|
+
* The refs are deliberate and explained where they are declared: they are
|
|
89
|
+
* what lets the gesture read the live value without rebuilding itself on
|
|
90
|
+
* every render, which is the same reason the dependency list below is
|
|
91
|
+
* short. */
|
|
92
|
+
/* eslint-disable react-hooks/refs, react-hooks/immutability */
|
|
82
93
|
const gesture = useMemo(() => {
|
|
83
94
|
const seek = (x) => {
|
|
84
95
|
const s = state.current;
|
|
@@ -125,6 +136,7 @@ export function Slider({ value: controlled, defaultValue = 0, onValueChange, onV
|
|
|
125
136
|
// gesture on every render.
|
|
126
137
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
127
138
|
}, [disabled, thumbScale]);
|
|
139
|
+
/* eslint-enable react-hooks/refs, react-hooks/immutability */
|
|
128
140
|
const ratio = (value - min) / (max - min || 1);
|
|
129
141
|
return (_jsx(GestureDetector, { gesture: gesture, children: _jsxs(View, { accessibilityRole: "adjustable", accessibilityLabel: accessibilityLabel, accessibilityValue: { min, max, now: value }, onLayout: (e) => setWidth(e.nativeEvent.layout.width), style: [
|
|
130
142
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tabs.d.ts","sourceRoot":"","sources":["../../../src/components/Tabs/Tabs.tsx"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,
|
|
1
|
+
{"version":3,"file":"Tabs.d.ts","sourceRoot":"","sources":["../../../src/components/Tabs/Tabs.tsx"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAKL,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAQtB,KAAK,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAC;AAChC,MAAM,MAAM,eAAe,GAAG,YAAY,GAAG,UAAU,CAAC;AA4BxD,MAAM,WAAW,SAAS;IACxB,KAAK,CAAC,EAAE,QAAQ,CAAC;IACjB,YAAY,CAAC,EAAE,QAAQ,CAAC;IACxB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,IAAI,CAAC;IAC1C;;;;;OAKG;IACH,WAAW,CAAC,EAAE,eAAe,CAAC;IAC9B,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAED,iBAAS,IAAI,CAAC,EACZ,KAAK,EAAE,UAAU,EACjB,YAAY,EACZ,aAAa,EACb,WAA0B,EAC1B,QAAQ,EACR,KAAK,GACN,EAAE,SAAS,+BA4DX;AAID,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;;;;;;;OAQG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAED;;;;;;;;;;;;GAYG;AACH,iBAAS,IAAI,CAAC,EAAE,QAAQ,EAAE,UAAkB,EAAE,KAAK,EAAE,EAAE,aAAa,+BAmFnE;AAED,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,QAAQ,CAAC;IAChB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAED,iBAAS,GAAG,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,QAAQ,+BA2D1D;AAED,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,QAAQ,CAAC;IAChB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAED,iBAAS,KAAK,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,cAAc,sCAsBxD;AAED;;;;;;GAMG;AACH,iBAAS,SAAS,IAAI,IAAI,CAEzB;AAED,eAAO,MAAM,IAAI;;;;;CAAuD,CAAC;AACzE,OAAO,EAAE,GAAG,EAAE,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { createContext, useCallback, useContext, useMemo, useState, } from "react";
|
|
3
|
-
import { Pressable, ScrollView,
|
|
3
|
+
import { Pressable, ScrollView, View, } from "react-native";
|
|
4
|
+
import { Text } from "../../internal/Text.js";
|
|
4
5
|
import Animated, { useAnimatedStyle, useSharedValue } from "react-native-reanimated";
|
|
5
6
|
import { useReducedMotion } from "../../hooks/useReducedMotion.js";
|
|
6
7
|
import { springy } from "../../motion/index.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextField.d.ts","sourceRoot":"","sources":["../../../src/components/TextField/TextField.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,
|
|
1
|
+
{"version":3,"file":"TextField.d.ts","sourceRoot":"","sources":["../../../src/components/TextField/TextField.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAEL,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAMtB,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,QAAQ,CAAC;AAO/C,MAAM,WAAW,cAAe,SAAQ,IAAI,CAAC,cAAc,EAAE,OAAO,CAAC;IACnE,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,0EAA0E;IAC1E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAED,wBAAgB,SAAS,CAAC,EACxB,KAAK,EACL,UAAU,EACV,KAAa,EACb,IAAe,EACf,SAAiB,EACjB,OAAW,EACX,KAAK,EACL,QAAQ,EACR,GAAG,IAAI,EACR,EAAE,cAAc,+BAsEhB"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useState } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { View, } from "react-native";
|
|
4
|
+
import { TextInput } from "../../internal/TextInput.js";
|
|
5
|
+
import { Text } from "../../internal/Text.js";
|
|
4
6
|
import { useTheme } from "../../theme/index.js";
|
|
5
7
|
const SIZES = {
|
|
6
8
|
small: { minHeight: 36, fontSize: 14, paddingH: 12 },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toast.d.ts","sourceRoot":"","sources":["../../../src/components/Toast/Toast.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAuE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC5G,OAAO,
|
|
1
|
+
{"version":3,"file":"Toast.d.ts","sourceRoot":"","sources":["../../../src/components/Toast/Toast.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAuE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC5G,OAAO,EAAmB,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAU/E,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;AAErE,MAAM,WAAW,YAAY;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAMD,UAAU,iBAAiB;IACzB,IAAI,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,MAAM,CAAC;IACtC,OAAO,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CAC/B;AAID;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,aAAa,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,CAAC,EAAE,SAAS,CAAA;CAAE,+BAoBnE;AAED,wBAAgB,QAAQ,IAAI,iBAAiB,CAI5C;AAyHD,MAAM,WAAW,UAAU;IACzB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { createContext, useCallback, useContext, useEffect, useRef, useState } from "react";
|
|
3
|
-
import { Pressable,
|
|
3
|
+
import { Pressable, View } from "react-native";
|
|
4
|
+
import { Text } from "../../internal/Text.js";
|
|
4
5
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
5
6
|
import Animated, { useAnimatedStyle, useSharedValue } from "react-native-reanimated";
|
|
6
7
|
import { grytScaleSteps } from "@gryt/theme";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toggle.d.ts","sourceRoot":"","sources":["../../../src/components/Toggle/Toggle.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,
|
|
1
|
+
{"version":3,"file":"Toggle.d.ts","sourceRoot":"","sources":["../../../src/components/Toggle/Toggle.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAa,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAOzE,OAAO,EAAsB,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AAErE,MAAM,MAAM,UAAU,GAAG,OAAO,CAAC,aAAa,EAAE,SAAS,GAAG,WAAW,GAAG,SAAS,GAAG,QAAQ,CAAC,CAAC;AAChG,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;AASjE,MAAM,WAAW,WAAW;IAC1B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC7C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAaD,wBAAgB,MAAM,CAAC,EACrB,OAAO,EAAE,UAAU,EACnB,cAAsB,EACtB,eAAe,EACf,QAAQ,EACR,IAAgB,EAChB,IAAe,EACf,QAAQ,EACR,KAAK,EACL,kBAAkB,GACnB,EAAE,WAAW,+BAoDb"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useState } from "react";
|
|
3
|
-
import { Pressable
|
|
3
|
+
import { Pressable } from "react-native";
|
|
4
|
+
import { Text } from "../../internal/Text.js";
|
|
4
5
|
import Animated from "react-native-reanimated";
|
|
5
6
|
import { grytScaleSteps } from "@gryt/theme";
|
|
6
7
|
import { usePressScale } from "../../motion/index.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../../src/components/Tooltip/Tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAkD,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACvF,OAAO,
|
|
1
|
+
{"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../../src/components/Tooltip/Tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAkD,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACvF,OAAO,EAAmB,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAI/E,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAE5D,OAAO,EAAgB,KAAK,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAgC/E,MAAM,WAAW,gBAAiB,SAAQ,cAAc;IACtD,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,iBAAS,IAAI,CAAC,EAAE,QAAQ,EAAE,GAAG,SAAS,EAAE,EAAE,gBAAgB,+BAQzD;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,2EAA2E;IAC3E,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAED,iBAAS,OAAO,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,mBAAmB,+BAoBjE;AAED,iBAAS,MAAM,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,CAAC,EAAE,SAAS,CAAA;CAAE,+BAErD;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAED,iBAAS,KAAK,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,EAAE,iBAAiB,+BA8BhE;AAED,wFAAwF;AACxF,iBAAS,QAAQ,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,CAAC,EAAE,SAAS,CAAA;CAAE,+BAEvD;AAED,eAAO,MAAM,OAAO;;;;;;CAA6C,CAAC;AAClE,eAAO,MAAM,eAAe,iBAAW,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { createContext, useCallback, useContext, useRef } from "react";
|
|
3
|
-
import { Pressable
|
|
3
|
+
import { Pressable } from "react-native";
|
|
4
|
+
import { Text } from "../../internal/Text.js";
|
|
4
5
|
import { AnchoredPopup } from "../../overlay/AnchoredPopup.js";
|
|
5
6
|
import { useAnchorMeasure } from "../../overlay/useAnchoredPosition.js";
|
|
6
7
|
import { useOpenState } from "../../overlay/useOpenState.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ControlRow.d.ts","sourceRoot":"","sources":["../../../src/components/internal/ControlRow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,
|
|
1
|
+
{"version":3,"file":"ControlRow.d.ts","sourceRoot":"","sources":["../../../src/components/internal/ControlRow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAmB,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAO/E;;;;;;;;;;;;;;;GAeG;AAEH;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,gBAAgB;;;;;CAA+C,CAAC;AAE7E,MAAM,WAAW,eAAe;IAC9B,iEAAiE;IACjE,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,QAAQ,EAAE,SAAS,CAAC;IACpB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,kEAAkE;IAClE,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB,EAAE,UAAU,GAAG,OAAO,GAAG,QAAQ,CAAC;IACnD,kBAAkB,EAAE;QAAE,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;QAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;IACxE,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAED,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,UAAU,EACV,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,KAAK,GACN,EAAE,eAAe,+BAqDjB"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Pressable,
|
|
2
|
+
import { Pressable, View } from "react-native";
|
|
3
|
+
import { Text } from "../../internal/Text.js";
|
|
3
4
|
import Animated from "react-native-reanimated";
|
|
4
5
|
import { usePressScale } from "../../motion/index.js";
|
|
5
6
|
import { useTheme } from "../../theme/index.js";
|
package/dist/index.d.ts
CHANGED
|
@@ -36,6 +36,17 @@ export { Toolbar, ToolbarSeparator, type ToolbarProps, type ToolbarSeparatorProp
|
|
|
36
36
|
export { AnchoredPopup, type AnchoredPopupProps } from "./overlay/AnchoredPopup.js";
|
|
37
37
|
export { placePopup, type Align, type AnchorOptions, type AnchorRect, type PopupPlacement, type Side, } from "./overlay/placePopup.js";
|
|
38
38
|
export { useOpenState, type OpenStateProps } from "./overlay/useOpenState.js";
|
|
39
|
+
/**
|
|
40
|
+
* `Text` and `TextInput` in the theme's face.
|
|
41
|
+
*
|
|
42
|
+
* Every component in this library already draws through these. They are
|
|
43
|
+
* exported because an app's own screens have the same problem — React Native
|
|
44
|
+
* has no cascade, so a font given to the provider does not reach a `Text`
|
|
45
|
+
* written by hand — and rewriting the same wrapper in every app that uses this
|
|
46
|
+
* library would be the library not finishing its job.
|
|
47
|
+
*/
|
|
48
|
+
export { Text, type TextProps } from "./internal/Text.js";
|
|
49
|
+
export { TextInput, type TextInputProps } from "./internal/TextInput.js";
|
|
39
50
|
export { useReducedMotion } from "./hooks/useReducedMotion.js";
|
|
40
51
|
export { durations, easeSpring, easeSpringTight, fade, springy, travel, usePressScale, type PressScale } from "./motion/index.js";
|
|
41
52
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,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B,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,KAAK,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AACjF,OAAO,EACL,UAAU,EACV,KAAK,KAAK,EACV,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,IAAI,GACV,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,YAAY,EAAE,KAAK,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC3E;;;;;;;;GAQG;AACH,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EACL,SAAS,EACT,UAAU,EACV,eAAe,EACf,IAAI,EACJ,OAAO,EACP,MAAM,EACN,aAAa,EACb,KAAK,UAAU,EAChB,MAAM,mBAAmB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -36,5 +36,16 @@ export { Toolbar, ToolbarSeparator, } from "./components/Toolbar/Toolbar.js";
|
|
|
36
36
|
export { AnchoredPopup } from "./overlay/AnchoredPopup.js";
|
|
37
37
|
export { placePopup, } from "./overlay/placePopup.js";
|
|
38
38
|
export { useOpenState } from "./overlay/useOpenState.js";
|
|
39
|
+
/**
|
|
40
|
+
* `Text` and `TextInput` in the theme's face.
|
|
41
|
+
*
|
|
42
|
+
* Every component in this library already draws through these. They are
|
|
43
|
+
* exported because an app's own screens have the same problem — React Native
|
|
44
|
+
* has no cascade, so a font given to the provider does not reach a `Text`
|
|
45
|
+
* written by hand — and rewriting the same wrapper in every app that uses this
|
|
46
|
+
* library would be the library not finishing its job.
|
|
47
|
+
*/
|
|
48
|
+
export { Text } from "./internal/Text.js";
|
|
49
|
+
export { TextInput } from "./internal/TextInput.js";
|
|
39
50
|
export { useReducedMotion } from "./hooks/useReducedMotion.js";
|
|
40
51
|
export { durations, easeSpring, easeSpringTight, fade, springy, travel, usePressScale } from "./motion/index.js";
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Text as RNText, type TextProps as RNTextProps } from "react-native";
|
|
2
|
+
export interface TextProps extends RNTextProps {
|
|
3
|
+
/**
|
|
4
|
+
* Draw this in the code face.
|
|
5
|
+
*
|
|
6
|
+
* A prop rather than a second component, because the only difference is which
|
|
7
|
+
* family a weight resolves to.
|
|
8
|
+
*/
|
|
9
|
+
mono?: boolean;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* `Text`, in whatever face the theme was given.
|
|
13
|
+
*
|
|
14
|
+
* React Native has no cascade: a font set on a parent does not reach the text
|
|
15
|
+
* inside it, so there is no root rule an app can write and every `Text` has to
|
|
16
|
+
* name its own family. Every component in this library imports `Text` from
|
|
17
|
+
* here rather than from `react-native`, which is what makes
|
|
18
|
+
* `GrytThemeProvider fonts={…}` reach all of them — and what makes a component
|
|
19
|
+
* written next year get it without anybody remembering to.
|
|
20
|
+
*
|
|
21
|
+
* The alternative was spreading `theme.font()` into every style in the library.
|
|
22
|
+
* That works, and it is a rule somebody has to keep applying; this is the same
|
|
23
|
+
* rule applied once. `theme.font()` stays exported for anyone styling their own
|
|
24
|
+
* `Text` outside the library.
|
|
25
|
+
*
|
|
26
|
+
* The weight has to be read before the family can be chosen, which is why the
|
|
27
|
+
* style is flattened. `StyleSheet.flatten` handles the array form and the
|
|
28
|
+
* registered-id form, both of which components here use.
|
|
29
|
+
*
|
|
30
|
+
* **A `fontFamily` already in the style wins**, so a caller who deliberately
|
|
31
|
+
* wants one specific face is not fought by the wrapper.
|
|
32
|
+
*
|
|
33
|
+
* **A theme with no faces changes nothing.** `theme.font` hands back the bare
|
|
34
|
+
* `fontWeight` in that case, which is what the style already said.
|
|
35
|
+
*/
|
|
36
|
+
export declare const Text: import("react").ForwardRefExoticComponent<TextProps & import("react").RefAttributes<RNText>>;
|
|
37
|
+
//# sourceMappingURL=Text.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["../../src/internal/Text.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,IAAI,IAAI,MAAM,EAEd,KAAK,SAAS,IAAI,WAAW,EAE9B,MAAM,cAAc,CAAC;AAItB,MAAM,WAAW,SAAU,SAAQ,WAAW;IAC5C;;;;;OAKG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,IAAI,8FAkBf,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { Text as RNText, StyleSheet, } from "react-native";
|
|
4
|
+
import { useTheme } from "../theme/useTheme.js";
|
|
5
|
+
/**
|
|
6
|
+
* `Text`, in whatever face the theme was given.
|
|
7
|
+
*
|
|
8
|
+
* React Native has no cascade: a font set on a parent does not reach the text
|
|
9
|
+
* inside it, so there is no root rule an app can write and every `Text` has to
|
|
10
|
+
* name its own family. Every component in this library imports `Text` from
|
|
11
|
+
* here rather than from `react-native`, which is what makes
|
|
12
|
+
* `GrytThemeProvider fonts={…}` reach all of them — and what makes a component
|
|
13
|
+
* written next year get it without anybody remembering to.
|
|
14
|
+
*
|
|
15
|
+
* The alternative was spreading `theme.font()` into every style in the library.
|
|
16
|
+
* That works, and it is a rule somebody has to keep applying; this is the same
|
|
17
|
+
* rule applied once. `theme.font()` stays exported for anyone styling their own
|
|
18
|
+
* `Text` outside the library.
|
|
19
|
+
*
|
|
20
|
+
* The weight has to be read before the family can be chosen, which is why the
|
|
21
|
+
* style is flattened. `StyleSheet.flatten` handles the array form and the
|
|
22
|
+
* registered-id form, both of which components here use.
|
|
23
|
+
*
|
|
24
|
+
* **A `fontFamily` already in the style wins**, so a caller who deliberately
|
|
25
|
+
* wants one specific face is not fought by the wrapper.
|
|
26
|
+
*
|
|
27
|
+
* **A theme with no faces changes nothing.** `theme.font` hands back the bare
|
|
28
|
+
* `fontWeight` in that case, which is what the style already said.
|
|
29
|
+
*/
|
|
30
|
+
export const Text = forwardRef(function GrytText({ style, mono = false, ...props }, ref) {
|
|
31
|
+
const theme = useTheme();
|
|
32
|
+
const flat = StyleSheet.flatten(style);
|
|
33
|
+
if (flat?.fontFamily)
|
|
34
|
+
return _jsx(RNText, { ref: ref, style: style, ...props });
|
|
35
|
+
/* After the caller's style so the resolved family lands, and the weight it
|
|
36
|
+
* replaces is unset rather than left alongside — see `FontStyle`. */
|
|
37
|
+
return (_jsx(RNText, { ref: ref, style: [style, { fontWeight: undefined, ...theme.font(flat?.fontWeight, { mono }) }], ...props }));
|
|
38
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { TextInput as RNTextInput, type TextInputProps as RNTextInputProps } from "react-native";
|
|
2
|
+
export type TextInputProps = RNTextInputProps;
|
|
3
|
+
/**
|
|
4
|
+
* `TextInput`, in whatever face the theme was given.
|
|
5
|
+
*
|
|
6
|
+
* The same job the internal `Text` does, for the one other primitive that draws
|
|
7
|
+
* glyphs. Without it a field's own text stays on the platform font while its
|
|
8
|
+
* label above it changes — which is more obviously wrong than either being
|
|
9
|
+
* consistently wrong, and is the kind of thing that only shows up once
|
|
10
|
+
* somebody types.
|
|
11
|
+
*
|
|
12
|
+
* The placeholder comes along for free: React Native styles it from the same
|
|
13
|
+
* `fontFamily`.
|
|
14
|
+
*/
|
|
15
|
+
export declare const TextInput: import("react").ForwardRefExoticComponent<RNTextInputProps & import("react").RefAttributes<RNTextInput>>;
|
|
16
|
+
//# sourceMappingURL=TextInput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextInput.d.ts","sourceRoot":"","sources":["../../src/internal/TextInput.tsx"],"names":[],"mappings":"AACA,OAAO,EAEL,SAAS,IAAI,WAAW,EACxB,KAAK,cAAc,IAAI,gBAAgB,EAExC,MAAM,cAAc,CAAC;AAItB,MAAM,MAAM,cAAc,GAAG,gBAAgB,CAAC;AAE9C;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,SAAS,0GAgBpB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { StyleSheet, TextInput as RNTextInput, } from "react-native";
|
|
4
|
+
import { useTheme } from "../theme/useTheme.js";
|
|
5
|
+
/**
|
|
6
|
+
* `TextInput`, in whatever face the theme was given.
|
|
7
|
+
*
|
|
8
|
+
* The same job the internal `Text` does, for the one other primitive that draws
|
|
9
|
+
* glyphs. Without it a field's own text stays on the platform font while its
|
|
10
|
+
* label above it changes — which is more obviously wrong than either being
|
|
11
|
+
* consistently wrong, and is the kind of thing that only shows up once
|
|
12
|
+
* somebody types.
|
|
13
|
+
*
|
|
14
|
+
* The placeholder comes along for free: React Native styles it from the same
|
|
15
|
+
* `fontFamily`.
|
|
16
|
+
*/
|
|
17
|
+
export const TextInput = forwardRef(function GrytTextInput({ style, ...props }, ref) {
|
|
18
|
+
const theme = useTheme();
|
|
19
|
+
const flat = StyleSheet.flatten(style);
|
|
20
|
+
if (flat?.fontFamily)
|
|
21
|
+
return _jsx(RNTextInput, { ref: ref, style: style, ...props });
|
|
22
|
+
return (_jsx(RNTextInput, { ref: ref, style: [style, { fontWeight: undefined, ...theme.font(flat?.fontWeight) }], ...props }));
|
|
23
|
+
});
|
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
|
-
import { type GrytAppearance, type NativeThemeOptions } from "./createNativeTheme.js";
|
|
2
|
+
import { type FontFaces, type GrytAppearance, type NativeThemeOptions } from "./createNativeTheme.js";
|
|
3
3
|
export interface GrytThemeProviderProps {
|
|
4
4
|
appearance?: GrytAppearance;
|
|
5
5
|
color?: NativeThemeOptions["color"];
|
|
6
6
|
radius?: NativeThemeOptions["radius"];
|
|
7
|
+
/**
|
|
8
|
+
* The faces this app has registered, by the names React Native knows them as.
|
|
9
|
+
*
|
|
10
|
+
* The library ships no font files. Load your own and pass the names here, and
|
|
11
|
+
* every `Text` the library renders takes the right one. Leave it out and
|
|
12
|
+
* everything falls back to the platform default, exactly as before.
|
|
13
|
+
*/
|
|
14
|
+
fonts?: FontFaces;
|
|
7
15
|
/**
|
|
8
16
|
* Follow the OS setting when `appearance` is not given.
|
|
9
17
|
*
|
|
@@ -13,5 +21,5 @@ export interface GrytThemeProviderProps {
|
|
|
13
21
|
followSystemAppearance?: boolean;
|
|
14
22
|
children?: ReactNode;
|
|
15
23
|
}
|
|
16
|
-
export declare function GrytThemeProvider({ appearance, color, radius, followSystemAppearance, children, }: GrytThemeProviderProps): import("react").JSX.Element;
|
|
24
|
+
export declare function GrytThemeProvider({ appearance, color, radius, fonts, followSystemAppearance, children, }: GrytThemeProviderProps): import("react").JSX.Element;
|
|
17
25
|
//# sourceMappingURL=ThemeProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeProvider.d.ts","sourceRoot":"","sources":["../../src/theme/ThemeProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAGhD,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACxB,MAAM,qBAAqB,CAAC;AAG7B,MAAM,WAAW,sBAAsB;IACrC,UAAU,CAAC,EAAE,cAAc,CAAC;IAC5B,KAAK,CAAC,EAAE,kBAAkB,CAAC,OAAO,CAAC,CAAC;IACpC,MAAM,CAAC,EAAE,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IACtC;;;;;OAKG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,wBAAgB,iBAAiB,CAAC,EAChC,UAAU,EACV,KAAK,EACL,MAAM,EACN,sBAA8B,EAC9B,QAAQ,GACT,EAAE,sBAAsB,+BAgBxB"}
|
|
1
|
+
{"version":3,"file":"ThemeProvider.d.ts","sourceRoot":"","sources":["../../src/theme/ThemeProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAGhD,OAAO,EAEL,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACxB,MAAM,qBAAqB,CAAC;AAG7B,MAAM,WAAW,sBAAsB;IACrC,UAAU,CAAC,EAAE,cAAc,CAAC;IAC5B,KAAK,CAAC,EAAE,kBAAkB,CAAC,OAAO,CAAC,CAAC;IACpC,MAAM,CAAC,EAAE,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IACtC;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;;;;OAKG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,wBAAgB,iBAAiB,CAAC,EAChC,UAAU,EACV,KAAK,EACL,MAAM,EACN,KAAK,EACL,sBAA8B,EAC9B,QAAQ,GACT,EAAE,sBAAsB,+BAgBxB"}
|
|
@@ -3,7 +3,7 @@ import { useMemo } from "react";
|
|
|
3
3
|
import { useColorScheme } from "react-native";
|
|
4
4
|
import { createNativeTheme, } from "./createNativeTheme.js";
|
|
5
5
|
import { ThemeContext } from "./themeContext.js";
|
|
6
|
-
export function GrytThemeProvider({ appearance, color, radius, followSystemAppearance = false, children, }) {
|
|
6
|
+
export function GrytThemeProvider({ appearance, color, radius, fonts, followSystemAppearance = false, children, }) {
|
|
7
7
|
const systemScheme = useColorScheme();
|
|
8
8
|
// Named props rather than a spread options object, so the dependencies are
|
|
9
9
|
// the actual inputs. Spreading meant either a stale theme or rebuilding every
|
|
@@ -11,7 +11,7 @@ export function GrytThemeProvider({ appearance, color, radius, followSystemAppea
|
|
|
11
11
|
const theme = useMemo(() => {
|
|
12
12
|
const resolved = appearance ??
|
|
13
13
|
(followSystemAppearance && systemScheme === "light" ? "light" : undefined);
|
|
14
|
-
return createNativeTheme({ appearance: resolved, color, radius });
|
|
15
|
-
}, [appearance, color, radius, followSystemAppearance, systemScheme]);
|
|
14
|
+
return createNativeTheme({ appearance: resolved, color, radius, fonts });
|
|
15
|
+
}, [appearance, color, radius, fonts, followSystemAppearance, systemScheme]);
|
|
16
16
|
return (_jsx(ThemeContext.Provider, { value: theme, children: children }));
|
|
17
17
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { TextStyle } from "react-native";
|
|
1
2
|
import { grytTokens } from "@gryt/theme";
|
|
2
3
|
/**
|
|
3
4
|
* The same theme, without CSS.
|
|
@@ -20,6 +21,59 @@ export interface NativeThemeOptions {
|
|
|
20
21
|
color?: Partial<Record<keyof typeof grytTokens.color, string>>;
|
|
21
22
|
radius?: Partial<Record<keyof typeof grytTokens.radius, number>>;
|
|
22
23
|
appearance?: GrytAppearance;
|
|
24
|
+
fonts?: FontFaces;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* The faces an app has registered, by the names React Native knows them as.
|
|
28
|
+
*
|
|
29
|
+
* **The library ships no font files and is not going to.** A font is a
|
|
30
|
+
* megabyte-scale asset with a licence attached, and bundling one would make
|
|
31
|
+
* every consumer carry it whether they use it or not. What the library can do
|
|
32
|
+
* is stop hard-coding the platform default: an app loads its own faces —
|
|
33
|
+
* `expo-font`, `Font.loadAsync`, a native `Info.plist` entry, whichever — and
|
|
34
|
+
* passes the resulting family names in here.
|
|
35
|
+
*
|
|
36
|
+
* **One family per weight rather than one family with weights inside it.**
|
|
37
|
+
* Grouping faces under a single family name and letting `fontWeight` select
|
|
38
|
+
* between them works on iOS, where the OS reads the name table and assembles
|
|
39
|
+
* the family itself. Android does not: a custom family there wants an XML
|
|
40
|
+
* definition per weight, and a `fontWeight` it cannot satisfy is ignored rather
|
|
41
|
+
* than synthesised. Naming each face is the shape that behaves the same on both.
|
|
42
|
+
*
|
|
43
|
+
* Every field is optional. A gap falls back to the nearest lighter face that
|
|
44
|
+
* was given, and a theme with no faces at all behaves exactly as this library
|
|
45
|
+
* did before any of this existed.
|
|
46
|
+
*/
|
|
47
|
+
export interface FontFaces {
|
|
48
|
+
/** 400. The one everything else falls back to. */
|
|
49
|
+
regular?: string;
|
|
50
|
+
/** 500. */
|
|
51
|
+
medium?: string;
|
|
52
|
+
/** 600. */
|
|
53
|
+
semibold?: string;
|
|
54
|
+
/** 700. */
|
|
55
|
+
bold?: string;
|
|
56
|
+
/** 800 and up. */
|
|
57
|
+
extrabold?: string;
|
|
58
|
+
/** The code face, 400. */
|
|
59
|
+
mono?: string;
|
|
60
|
+
/** The code face, 600 and up. */
|
|
61
|
+
monoSemibold?: string;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* What a component spreads into a `Text` style to get the right face.
|
|
65
|
+
*
|
|
66
|
+
* Both halves, and never both at once. With faces configured it is a
|
|
67
|
+
* `fontFamily` and no weight; with none it is a `fontWeight` and no family.
|
|
68
|
+
*
|
|
69
|
+
* The weight is dropped deliberately once a face is chosen. The file already
|
|
70
|
+
* carries the weight, and leaving the number on asks the platform to
|
|
71
|
+
* synthesise a bolder version of an already-bold face — on Android that is a
|
|
72
|
+
* visibly smeared double-bold, and on iOS it is a subtler one.
|
|
73
|
+
*/
|
|
74
|
+
export interface FontStyle {
|
|
75
|
+
fontFamily?: string;
|
|
76
|
+
fontWeight?: TextStyle["fontWeight"];
|
|
23
77
|
}
|
|
24
78
|
/** Twelve steps, the same shape `@gryt/ui` uses. Index 0 is the page. */
|
|
25
79
|
export type Ramp = readonly string[];
|
|
@@ -75,6 +129,22 @@ export interface NativeTheme {
|
|
|
75
129
|
};
|
|
76
130
|
/** Multiples of 4, matching the Tailwind spacing the web components use. */
|
|
77
131
|
space: (steps: number) => number;
|
|
132
|
+
/**
|
|
133
|
+
* The face for a weight, as a style fragment to spread.
|
|
134
|
+
*
|
|
135
|
+
* ```tsx
|
|
136
|
+
* <Text style={{ fontSize: 16, ...theme.font("600") }}>
|
|
137
|
+
* ```
|
|
138
|
+
*
|
|
139
|
+
* Returns a `fontWeight` and nothing else when the theme has no faces, which
|
|
140
|
+
* is what makes this safe to adopt everywhere at once: a consumer who sets no
|
|
141
|
+
* fonts sees no change.
|
|
142
|
+
*/
|
|
143
|
+
font: (weight?: TextStyle["fontWeight"], options?: {
|
|
144
|
+
mono?: boolean;
|
|
145
|
+
}) => FontStyle;
|
|
146
|
+
/** The faces this theme was built with, for anything that needs the raw name. */
|
|
147
|
+
fonts: FontFaces;
|
|
78
148
|
}
|
|
79
149
|
export declare function createNativeTheme(options?: NativeThemeOptions): NativeTheme;
|
|
80
150
|
export declare const darkTheme: NativeTheme;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createNativeTheme.d.ts","sourceRoot":"","sources":["../../src/theme/createNativeTheme.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,UAAU,EAKX,MAAM,aAAa,CAAC;AAErB;;;;;;;;;;;;;;;GAeG;AAEH,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,OAAO,CAAC;AAE9C,MAAM,WAAW,kBAAkB;IACjC,KAAK,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,OAAO,UAAU,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;IAC/D,MAAM,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,OAAO,UAAU,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACjE,UAAU,CAAC,EAAE,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"createNativeTheme.d.ts","sourceRoot":"","sources":["../../src/theme/createNativeTheme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,EAGL,UAAU,EAKX,MAAM,aAAa,CAAC;AAErB;;;;;;;;;;;;;;;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O,GAAE,kBAAuB,GAAG,WAAW,CAqE/E;AA4DD,eAAO,MAAM,SAAS,aAAsB,CAAC;AAC7C,eAAO,MAAM,UAAU,aAA6C,CAAC"}
|
|
@@ -2,6 +2,7 @@ import { alphaScale, grytLightTokens, grytTokens, hueScale, hueScaleLight, neutr
|
|
|
2
2
|
const SPACE_UNIT = 4;
|
|
3
3
|
export function createNativeTheme(options = {}) {
|
|
4
4
|
const light = options.appearance === "light";
|
|
5
|
+
const fonts = options.fonts ?? {};
|
|
5
6
|
const color = {
|
|
6
7
|
...grytTokens.color,
|
|
7
8
|
...(light
|
|
@@ -59,7 +60,60 @@ export function createNativeTheme(options = {}) {
|
|
|
59
60
|
},
|
|
60
61
|
radius: { ...grytTokens.radius, ...options.radius },
|
|
61
62
|
space: (steps) => steps * SPACE_UNIT,
|
|
63
|
+
font: (weight, fontOptions) => faceFor(fonts, weight, fontOptions?.mono ?? false),
|
|
64
|
+
fonts,
|
|
62
65
|
};
|
|
63
66
|
}
|
|
67
|
+
/**
|
|
68
|
+
* A weight as a number.
|
|
69
|
+
*
|
|
70
|
+
* `"bold"` is 700 and `"normal"` is 400, per the CSS values React Native takes.
|
|
71
|
+
* `undefined` is 400 as well — an unstyled `Text` is regular.
|
|
72
|
+
*/
|
|
73
|
+
function weightNumber(weight) {
|
|
74
|
+
if (weight === undefined || weight === null || weight === "normal")
|
|
75
|
+
return 400;
|
|
76
|
+
if (weight === "bold")
|
|
77
|
+
return 700;
|
|
78
|
+
const parsed = typeof weight === "number" ? weight : Number.parseInt(weight, 10);
|
|
79
|
+
return Number.isFinite(parsed) ? parsed : 400;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* The face for a weight, or the weight itself when there is no face.
|
|
83
|
+
*
|
|
84
|
+
* Falls **down** through the configured faces rather than up: an app that gives
|
|
85
|
+
* only `regular` and `bold` should draw 600 in bold rather than in regular,
|
|
86
|
+
* because a semibold rendered at regular reads as a missing emphasis while one
|
|
87
|
+
* rendered bold reads as slightly too much. So each rung tries itself and then
|
|
88
|
+
* everything lighter, and the first rung that exists wins going down from the
|
|
89
|
+
* asked weight.
|
|
90
|
+
*
|
|
91
|
+
* Returning the bare `fontWeight` when nothing matches is the whole
|
|
92
|
+
* compatibility story: a theme built without `fonts` yields exactly the styles
|
|
93
|
+
* this library used before it had any of this.
|
|
94
|
+
*/
|
|
95
|
+
function faceFor(fonts, weight, mono) {
|
|
96
|
+
const n = weightNumber(weight);
|
|
97
|
+
if (mono) {
|
|
98
|
+
const face = n >= 600 ? (fonts.monoSemibold ?? fonts.mono) : fonts.mono;
|
|
99
|
+
return face ? { fontFamily: face } : { fontWeight: weight };
|
|
100
|
+
}
|
|
101
|
+
/* Heaviest first, so the ladder can be walked from the asked weight down. */
|
|
102
|
+
const ladder = [
|
|
103
|
+
[800, fonts.extrabold],
|
|
104
|
+
[700, fonts.bold],
|
|
105
|
+
[600, fonts.semibold],
|
|
106
|
+
[500, fonts.medium],
|
|
107
|
+
[400, fonts.regular],
|
|
108
|
+
];
|
|
109
|
+
for (const [step, face] of ladder) {
|
|
110
|
+
if (n >= step && face)
|
|
111
|
+
return { fontFamily: face };
|
|
112
|
+
}
|
|
113
|
+
/* Below every configured rung — a 200 on a theme that only set `bold`.
|
|
114
|
+
* `regular` is the right answer if it exists, and the platform default is the
|
|
115
|
+
* right answer if it does not. */
|
|
116
|
+
return fonts.regular ? { fontFamily: fonts.regular } : { fontWeight: weight };
|
|
117
|
+
}
|
|
64
118
|
export const darkTheme = createNativeTheme();
|
|
65
119
|
export const lightTheme = createNativeTheme({ appearance: "light" });
|
package/dist/theme/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { createNativeTheme, darkTheme, lightTheme, type GrytAppearance, type NativeTheme, type NativeThemeOptions, type Ramp, } from "./createNativeTheme.js";
|
|
1
|
+
export { createNativeTheme, darkTheme, lightTheme, type GrytAppearance, type NativeTheme, type NativeThemeOptions, type FontFaces, type FontStyle, type Ramp, } from "./createNativeTheme.js";
|
|
2
2
|
export { GrytThemeProvider, type GrytThemeProviderProps } from "./ThemeProvider.js";
|
|
3
3
|
export { ThemeContext } from "./themeContext.js";
|
|
4
4
|
export { toneRamp, type ComponentTone } from "./tones.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/theme/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,SAAS,EACT,UAAU,EACV,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,kBAAkB,EACvB,KAAK,IAAI,GACV,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,iBAAiB,EAAE,KAAK,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,SAAS,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/theme/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,SAAS,EACT,UAAU,EACV,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,kBAAkB,EACvB,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,IAAI,GACV,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,iBAAiB,EAAE,KAAK,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,SAAS,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gryt/ui-native",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Gryt's design system on React Native. Same tokens as @gryt/ui, a different renderer.",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"react-native-safe-area-context": ">=5.0.0"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@gryt/theme": "^0.
|
|
42
|
+
"@gryt/theme": "^0.6.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@gorhom/bottom-sheet": "^5.2.14",
|