@oxyhq/bloom 0.2.3 → 0.3.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/assets/fonts/BlomusModernus-Bold.ttf +0 -0
- package/assets/fonts/BlomusModernus-Bold.woff2 +0 -0
- package/assets/fonts/BlomusModernus-Regular.ttf +0 -0
- package/assets/fonts/BlomusModernus-Regular.woff2 +0 -0
- package/assets/fonts/GeistMono-Variable.ttf +0 -0
- package/assets/fonts/GeistMono-Variable.woff2 +0 -0
- package/assets/fonts/InterVariable.ttf +0 -0
- package/assets/fonts/InterVariable.woff2 +0 -0
- package/lib/commonjs/code/Code.js +47 -0
- package/lib/commonjs/code/Code.js.map +1 -0
- package/lib/commonjs/code/Pre.js +61 -0
- package/lib/commonjs/code/Pre.js.map +1 -0
- package/lib/commonjs/code/index.js +20 -0
- package/lib/commonjs/code/index.js.map +1 -0
- package/lib/commonjs/fonts/FontLoader.js +35 -0
- package/lib/commonjs/fonts/FontLoader.js.map +1 -0
- package/lib/commonjs/fonts/FontLoader.native.js +36 -0
- package/lib/commonjs/fonts/FontLoader.native.js.map +1 -0
- package/lib/commonjs/fonts/apply-font-faces.js +47 -0
- package/lib/commonjs/fonts/apply-font-faces.js.map +1 -0
- package/lib/commonjs/fonts/font-assets.js +23 -0
- package/lib/commonjs/fonts/font-assets.js.map +1 -0
- package/lib/commonjs/fonts/index.js +40 -0
- package/lib/commonjs/fonts/index.js.map +1 -0
- package/lib/commonjs/fonts/tokens.js +27 -0
- package/lib/commonjs/fonts/tokens.js.map +1 -0
- package/lib/commonjs/index.js +9 -3
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/index.web.js +9 -3
- package/lib/commonjs/index.web.js.map +1 -1
- package/lib/commonjs/theme/BloomThemeProvider.js +8 -1
- package/lib/commonjs/theme/BloomThemeProvider.js.map +1 -1
- package/lib/commonjs/typography/index.js +41 -3
- package/lib/commonjs/typography/index.js.map +1 -1
- package/lib/module/code/Code.js +42 -0
- package/lib/module/code/Code.js.map +1 -0
- package/lib/module/code/Pre.js +56 -0
- package/lib/module/code/Pre.js.map +1 -0
- package/lib/module/code/index.js +5 -0
- package/lib/module/code/index.js.map +1 -0
- package/lib/module/fonts/FontLoader.js +30 -0
- package/lib/module/fonts/FontLoader.js.map +1 -0
- package/lib/module/fonts/FontLoader.native.js +31 -0
- package/lib/module/fonts/FontLoader.native.js.map +1 -0
- package/lib/module/fonts/apply-font-faces.js +42 -0
- package/lib/module/fonts/apply-font-faces.js.map +1 -0
- package/lib/module/fonts/font-assets.js +19 -0
- package/lib/module/fonts/font-assets.js.map +1 -0
- package/lib/module/fonts/index.js +7 -0
- package/lib/module/fonts/index.js.map +1 -0
- package/lib/module/fonts/tokens.js +23 -0
- package/lib/module/fonts/tokens.js.map +1 -0
- package/lib/module/index.js +6 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/index.web.js +6 -0
- package/lib/module/index.web.js.map +1 -1
- package/lib/module/theme/BloomThemeProvider.js +8 -1
- package/lib/module/theme/BloomThemeProvider.js.map +1 -1
- package/lib/module/typography/index.js +36 -3
- package/lib/module/typography/index.js.map +1 -1
- package/lib/typescript/commonjs/__tests__/BloomThemeProvider.fonts-web.test.d.ts +5 -0
- package/lib/typescript/commonjs/__tests__/BloomThemeProvider.fonts-web.test.d.ts.map +1 -0
- package/lib/typescript/commonjs/__tests__/Code.test.d.ts +2 -0
- package/lib/typescript/commonjs/__tests__/Code.test.d.ts.map +1 -0
- package/lib/typescript/commonjs/__tests__/FontLoader.native.test.d.ts +2 -0
- package/lib/typescript/commonjs/__tests__/FontLoader.native.test.d.ts.map +1 -0
- package/lib/typescript/commonjs/__tests__/Pre.test.d.ts +2 -0
- package/lib/typescript/commonjs/__tests__/Pre.test.d.ts.map +1 -0
- package/lib/typescript/commonjs/__tests__/apply-font-faces.test.d.ts +5 -0
- package/lib/typescript/commonjs/__tests__/apply-font-faces.test.d.ts.map +1 -0
- package/lib/typescript/commonjs/code/Code.d.ts +7 -0
- package/lib/typescript/commonjs/code/Code.d.ts.map +1 -0
- package/lib/typescript/commonjs/code/Pre.d.ts +8 -0
- package/lib/typescript/commonjs/code/Pre.d.ts.map +1 -0
- package/lib/typescript/commonjs/code/index.d.ts +5 -0
- package/lib/typescript/commonjs/code/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/fonts/FontLoader.d.ts +28 -0
- package/lib/typescript/commonjs/fonts/FontLoader.d.ts.map +1 -0
- package/lib/typescript/commonjs/fonts/FontLoader.native.d.ts +22 -0
- package/lib/typescript/commonjs/fonts/FontLoader.native.d.ts.map +1 -0
- package/lib/typescript/commonjs/fonts/apply-font-faces.d.ts +15 -0
- package/lib/typescript/commonjs/fonts/apply-font-faces.d.ts.map +1 -0
- package/lib/typescript/commonjs/fonts/font-assets.d.ts +7 -0
- package/lib/typescript/commonjs/fonts/font-assets.d.ts.map +1 -0
- package/lib/typescript/commonjs/fonts/index.d.ts +7 -0
- package/lib/typescript/commonjs/fonts/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/fonts/tokens.d.ts +21 -0
- package/lib/typescript/commonjs/fonts/tokens.d.ts.map +1 -0
- package/lib/typescript/commonjs/icons/common.d.ts +1 -1
- package/lib/typescript/commonjs/index.d.ts +2 -0
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/index.web.d.ts +2 -0
- package/lib/typescript/commonjs/index.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/theme/BloomThemeProvider.d.ts +13 -1
- package/lib/typescript/commonjs/theme/BloomThemeProvider.d.ts.map +1 -1
- package/lib/typescript/commonjs/toast/index.d.ts +7 -7
- package/lib/typescript/commonjs/typography/index.d.ts +2 -0
- package/lib/typescript/commonjs/typography/index.d.ts.map +1 -1
- package/lib/typescript/module/__tests__/BloomThemeProvider.fonts-web.test.d.ts +5 -0
- package/lib/typescript/module/__tests__/BloomThemeProvider.fonts-web.test.d.ts.map +1 -0
- package/lib/typescript/module/__tests__/Code.test.d.ts +2 -0
- package/lib/typescript/module/__tests__/Code.test.d.ts.map +1 -0
- package/lib/typescript/module/__tests__/FontLoader.native.test.d.ts +2 -0
- package/lib/typescript/module/__tests__/FontLoader.native.test.d.ts.map +1 -0
- package/lib/typescript/module/__tests__/Pre.test.d.ts +2 -0
- package/lib/typescript/module/__tests__/Pre.test.d.ts.map +1 -0
- package/lib/typescript/module/__tests__/apply-font-faces.test.d.ts +5 -0
- package/lib/typescript/module/__tests__/apply-font-faces.test.d.ts.map +1 -0
- package/lib/typescript/module/code/Code.d.ts +7 -0
- package/lib/typescript/module/code/Code.d.ts.map +1 -0
- package/lib/typescript/module/code/Pre.d.ts +8 -0
- package/lib/typescript/module/code/Pre.d.ts.map +1 -0
- package/lib/typescript/module/code/index.d.ts +5 -0
- package/lib/typescript/module/code/index.d.ts.map +1 -0
- package/lib/typescript/module/fonts/FontLoader.d.ts +28 -0
- package/lib/typescript/module/fonts/FontLoader.d.ts.map +1 -0
- package/lib/typescript/module/fonts/FontLoader.native.d.ts +22 -0
- package/lib/typescript/module/fonts/FontLoader.native.d.ts.map +1 -0
- package/lib/typescript/module/fonts/apply-font-faces.d.ts +15 -0
- package/lib/typescript/module/fonts/apply-font-faces.d.ts.map +1 -0
- package/lib/typescript/module/fonts/font-assets.d.ts +7 -0
- package/lib/typescript/module/fonts/font-assets.d.ts.map +1 -0
- package/lib/typescript/module/fonts/index.d.ts +7 -0
- package/lib/typescript/module/fonts/index.d.ts.map +1 -0
- package/lib/typescript/module/fonts/tokens.d.ts +21 -0
- package/lib/typescript/module/fonts/tokens.d.ts.map +1 -0
- package/lib/typescript/module/icons/common.d.ts +1 -1
- package/lib/typescript/module/index.d.ts +2 -0
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/index.web.d.ts +2 -0
- package/lib/typescript/module/index.web.d.ts.map +1 -1
- package/lib/typescript/module/theme/BloomThemeProvider.d.ts +13 -1
- package/lib/typescript/module/theme/BloomThemeProvider.d.ts.map +1 -1
- package/lib/typescript/module/toast/index.d.ts +7 -7
- package/lib/typescript/module/typography/index.d.ts +2 -0
- package/lib/typescript/module/typography/index.d.ts.map +1 -1
- package/package.json +37 -2
- package/src/__tests__/BloomThemeProvider.fonts-web.test.tsx +42 -0
- package/src/__tests__/BloomThemeProvider.test.tsx +22 -0
- package/src/__tests__/Code.test.tsx +25 -0
- package/src/__tests__/FontLoader.native.test.tsx +75 -0
- package/src/__tests__/Pre.test.tsx +25 -0
- package/src/__tests__/apply-font-faces.test.ts +59 -0
- package/src/assets.d.ts +20 -0
- package/src/code/Code.tsx +52 -0
- package/src/code/Pre.tsx +76 -0
- package/src/code/index.ts +4 -0
- package/src/fonts/FontLoader.native.tsx +30 -0
- package/src/fonts/FontLoader.tsx +37 -0
- package/src/fonts/apply-font-faces.ts +41 -0
- package/src/fonts/font-assets.ts +16 -0
- package/src/fonts/index.ts +6 -0
- package/src/fonts/tokens.ts +23 -0
- package/src/index.ts +6 -0
- package/src/index.web.ts +6 -0
- package/src/theme/BloomThemeProvider.tsx +18 -1
- package/src/typography/index.tsx +32 -3
|
@@ -3,9 +3,36 @@
|
|
|
3
3
|
import React, { memo } from 'react';
|
|
4
4
|
import { Text as RNText, Platform } from 'react-native';
|
|
5
5
|
import { useTheme } from "../theme/use-theme.js";
|
|
6
|
+
import { fontFamilies } from "../fonts/tokens.js";
|
|
6
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
8
|
/**
|
|
8
|
-
*
|
|
9
|
+
* Platform-aware font-family value. On web we resolve to the CSS custom
|
|
10
|
+
* property set by `applyFontFaces` so consumer apps can re-skin Bloom by
|
|
11
|
+
* overriding `--bloom-font-*` at any subtree. On native we use the literal
|
|
12
|
+
* family name registered by `expo-font`'s `useFonts(FONT_ASSETS)`.
|
|
13
|
+
*/
|
|
14
|
+
function fontFamilyStyle(kind) {
|
|
15
|
+
if (Platform.OS === 'web') {
|
|
16
|
+
return {
|
|
17
|
+
fontFamily: `var(--bloom-font-${kind})`
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
if (kind === 'display') return {
|
|
21
|
+
fontFamily: 'BlomusModernus'
|
|
22
|
+
};
|
|
23
|
+
if (kind === 'mono') return {
|
|
24
|
+
fontFamily: 'Geist Mono'
|
|
25
|
+
};
|
|
26
|
+
return {
|
|
27
|
+
fontFamily: 'Inter'
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
const SANS_FONT_FAMILY = fontFamilyStyle('sans');
|
|
31
|
+
const DISPLAY_FONT_FAMILY = fontFamilyStyle('display');
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Base text component with theme-aware default color and the Bloom sans
|
|
35
|
+
* font family applied.
|
|
9
36
|
*/
|
|
10
37
|
const TextComponent = function Text({
|
|
11
38
|
children,
|
|
@@ -19,7 +46,8 @@ const TextComponent = function Text({
|
|
|
19
46
|
...rest,
|
|
20
47
|
style: [{
|
|
21
48
|
fontSize: 13,
|
|
22
|
-
color: colors.text
|
|
49
|
+
color: colors.text,
|
|
50
|
+
...SANS_FONT_FAMILY
|
|
23
51
|
}, style],
|
|
24
52
|
children: children
|
|
25
53
|
});
|
|
@@ -27,6 +55,10 @@ const TextComponent = function Text({
|
|
|
27
55
|
export const Text = /*#__PURE__*/memo(TextComponent);
|
|
28
56
|
Text.displayName = 'Text';
|
|
29
57
|
export { Text as Span };
|
|
58
|
+
const HEADING_STYLE = {
|
|
59
|
+
...DISPLAY_FONT_FAMILY,
|
|
60
|
+
fontWeight: '700'
|
|
61
|
+
};
|
|
30
62
|
function createHeadingElement({
|
|
31
63
|
level
|
|
32
64
|
}) {
|
|
@@ -41,7 +73,7 @@ function createHeadingElement({
|
|
|
41
73
|
return /*#__PURE__*/_jsx(Text, {
|
|
42
74
|
...extraProps,
|
|
43
75
|
...rest,
|
|
44
|
-
style: style
|
|
76
|
+
style: [HEADING_STYLE, style]
|
|
45
77
|
});
|
|
46
78
|
};
|
|
47
79
|
}
|
|
@@ -86,4 +118,5 @@ export function P({
|
|
|
86
118
|
});
|
|
87
119
|
}
|
|
88
120
|
P.displayName = 'P';
|
|
121
|
+
export { fontFamilies };
|
|
89
122
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","memo","Text","RNText","Platform","useTheme","jsx","_jsx","TextComponent","children","style","rest","colors","fontSize","color","text","displayName","Span","createHeadingElement","level","HeadingElement","extraProps","
|
|
1
|
+
{"version":3,"names":["React","memo","Text","RNText","Platform","useTheme","fontFamilies","jsx","_jsx","fontFamilyStyle","kind","OS","fontFamily","SANS_FONT_FAMILY","DISPLAY_FONT_FAMILY","TextComponent","children","style","rest","colors","fontSize","color","text","displayName","Span","HEADING_STYLE","fontWeight","createHeadingElement","level","HeadingElement","extraProps","role","H1","H2","H3","H4","H5","H6","P","lineHeight"],"sourceRoot":"../../../src","sources":["typography/index.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,IAAI,QAAQ,OAAO;AACnC,SACEC,IAAI,IAAIC,MAAM,EAEdC,QAAQ,QAGH,cAAc;AAErB,SAASC,QAAQ,QAAQ,uBAAoB;AAC7C,SAASC,YAAY,QAAQ,oBAAiB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAI/C;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,eAAeA,CACtBC,IAAiC,EACT;EACxB,IAAIN,QAAQ,CAACO,EAAE,KAAK,KAAK,EAAE;IACzB,OAAO;MAAEC,UAAU,EAAE,oBAAoBF,IAAI;IAAI,CAAC;EACpD;EACA,IAAIA,IAAI,KAAK,SAAS,EAAE,OAAO;IAAEE,UAAU,EAAE;EAAiB,CAAC;EAC/D,IAAIF,IAAI,KAAK,MAAM,EAAE,OAAO;IAAEE,UAAU,EAAE;EAAa,CAAC;EACxD,OAAO;IAAEA,UAAU,EAAE;EAAQ,CAAC;AAChC;AAEA,MAAMC,gBAAgB,GAAGJ,eAAe,CAAC,MAAM,CAAC;AAChD,MAAMK,mBAAmB,GAAGL,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AAGN,oBAAoB,CAAC;EAAEC,KAAK,EAAE;AAAE,CAAC,CAAC;AACpDK,EAAE,CAACV,WAAW,GAAG,IAAI;AACrB,OAAO,MAAMW,EAAE,GAAGP,oBAAoB,CAAC;EAAEC,KAAK,EAAE;AAAE,CAAC,CAAC;AACpDM,EAAE,CAACX,WAAW,GAAG,IAAI;AACrB,OAAO,MAAMY,EAAE,GAAGR,oBAAoB,CAAC;EAAEC,KAAK,EAAE;AAAE,CAAC,CAAC;AACpDO,EAAE,CAACZ,WAAW,GAAG,IAAI;AACrB,OAAO,MAAMa,EAAE,GAAGT,oBAAoB,CAAC;EAAEC,KAAK,EAAE;AAAE,CAAC,CAAC;AACpDQ,EAAE,CAACb,WAAW,GAAG,IAAI;AACrB,OAAO,MAAMc,EAAE,GAAGV,oBAAoB,CAAC;EAAEC,KAAK,EAAE;AAAE,CAAC,CAAC;AACpDS,EAAE,CAACd,WAAW,GAAG,IAAI;AAErB,OAAO,SAASe,CAACA,CAAC;EAAErB,KAAK;EAAE,GAAGC;AAAgB,CAAC,EAAE;EAC/C,MAAMY,UAAmC,GACvC1B,QAAQ,CAACO,EAAE,KAAK,KAAK,GAAG;IAAEoB,IAAI,EAAE;EAAY,CAAC,GAAG,CAAC,CAAC;EACpD,oBACEvB,IAAA,CAACN,IAAI;IAAA,GACC4B,UAAU;IAAA,GACVZ,IAAI;IACRD,KAAK,EAAE,CAAC;MAAEG,QAAQ,EAAE,EAAE;MAAEmB,UAAU,EAAE,EAAE,GAAG;IAAM,CAAC,EAAEtB,KAAK;EAAE,CAC1D,CAAC;AAEN;AACAqB,CAAC,CAACf,WAAW,GAAG,GAAG;AAEnB,SAASjB,YAAY","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BloomThemeProvider.fonts-web.test.d.ts","sourceRoot":"","sources":["../../../../src/__tests__/BloomThemeProvider.fonts-web.test.tsx"],"names":[],"mappings":"AAAA;;GAEG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Code.test.d.ts","sourceRoot":"","sources":["../../../../src/__tests__/Code.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FontLoader.native.test.d.ts","sourceRoot":"","sources":["../../../../src/__tests__/FontLoader.native.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Pre.test.d.ts","sourceRoot":"","sources":["../../../../src/__tests__/Pre.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apply-font-faces.test.d.ts","sourceRoot":"","sources":["../../../../src/__tests__/apply-font-faces.test.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type TextProps as RNTextProps, type StyleProp, type TextStyle } from 'react-native';
|
|
3
|
+
export interface CodeProps extends RNTextProps {
|
|
4
|
+
style?: StyleProp<TextStyle>;
|
|
5
|
+
}
|
|
6
|
+
export declare const Code: React.MemoExoticComponent<({ children, style, ...rest }: CodeProps) => import("react/jsx-runtime").JSX.Element>;
|
|
7
|
+
//# sourceMappingURL=Code.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Code.d.ts","sourceRoot":"","sources":["../../../../src/code/Code.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAe,MAAM,OAAO,CAAC;AACpC,OAAO,EAEL,KAAK,SAAS,IAAI,WAAW,EAE7B,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAItB,MAAM,WAAW,SAAU,SAAQ,WAAW;IAC5C,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAqCD,eAAO,MAAM,IAAI,2DA/BiD,SAAS,6CA+BpC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type TextProps as RNTextProps, type StyleProp, type ViewStyle, type TextStyle } from 'react-native';
|
|
3
|
+
export interface PreProps extends Omit<RNTextProps, 'style'> {
|
|
4
|
+
containerStyle?: StyleProp<ViewStyle>;
|
|
5
|
+
style?: StyleProp<TextStyle>;
|
|
6
|
+
}
|
|
7
|
+
export declare const Pre: React.MemoExoticComponent<({ children, containerStyle, style, ...rest }: PreProps) => import("react/jsx-runtime").JSX.Element>;
|
|
8
|
+
//# sourceMappingURL=Pre.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Pre.d.ts","sourceRoot":"","sources":["../../../../src/code/Pre.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAe,MAAM,OAAO,CAAC;AACpC,OAAO,EAGL,KAAK,SAAS,IAAI,WAAW,EAE7B,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAItB,MAAM,WAAW,QAAS,SAAQ,IAAI,CAAC,WAAW,EAAE,OAAO,CAAC;IAC1D,cAAc,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACtC,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AA0DD,eAAO,MAAM,GAAG,2EA/Cb,QAAQ,6CA+C0B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/code/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,YAAY,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5B,YAAY,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface FontLoaderProps {
|
|
3
|
+
/**
|
|
4
|
+
* Whether to load and inject the Bloom font system. When false, this
|
|
5
|
+
* component is a pass-through. Default true (set by `BloomThemeProvider`).
|
|
6
|
+
*/
|
|
7
|
+
enabled: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Rendered while native fonts load. Ignored on web — the web variant
|
|
10
|
+
* applies CSS `@font-face` rules synchronously and uses `font-display: swap`
|
|
11
|
+
* to handle the FOUT period.
|
|
12
|
+
*/
|
|
13
|
+
fallback?: React.ReactNode;
|
|
14
|
+
children: React.ReactNode;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Web font loader. Applies the Bloom `@font-face` rules and CSS variables
|
|
18
|
+
* to `:root` on first render, before the first paint, using the same
|
|
19
|
+
* `useRef`-during-render pattern as `BloomThemeProvider`'s color application.
|
|
20
|
+
*
|
|
21
|
+
* No `useEffect`: the side effect runs synchronously inside the render phase,
|
|
22
|
+
* gated by a ref so it only executes once. Subsequent renders short-circuit.
|
|
23
|
+
*
|
|
24
|
+
* Native consumers resolve `FontLoader.native.tsx` via the React Native /
|
|
25
|
+
* Metro bundler's platform extension resolution — they never load this file.
|
|
26
|
+
*/
|
|
27
|
+
export declare function FontLoader({ enabled, children }: FontLoaderProps): import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
//# sourceMappingURL=FontLoader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FontLoader.d.ts","sourceRoot":"","sources":["../../../../src/fonts/FontLoader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiB,MAAM,OAAO,CAAC;AAGtC,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,UAAU,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,eAAe,2CAOhE"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface FontLoaderProps {
|
|
3
|
+
/**
|
|
4
|
+
* Whether to gate rendering on fonts being loaded. When false the
|
|
5
|
+
* component is a pass-through that still calls `useFonts` (the hook must
|
|
6
|
+
* run unconditionally per the Rules of Hooks).
|
|
7
|
+
*/
|
|
8
|
+
enabled: boolean;
|
|
9
|
+
/** Rendered while native fonts load. Defaults to `null`. */
|
|
10
|
+
fallback?: React.ReactNode;
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Native font loader. Calls `expo-font`'s `useFonts` with the Bloom font
|
|
15
|
+
* asset map and gates `children` on the load result. The hook is invoked
|
|
16
|
+
* unconditionally — `enabled` only affects what's rendered, not whether
|
|
17
|
+
* fonts get loaded. This keeps Hook order stable across renders and means
|
|
18
|
+
* `<BloomThemeProvider fonts={false}>` still gets fonts pre-loaded if the
|
|
19
|
+
* provider tree ever flips `fonts` back on.
|
|
20
|
+
*/
|
|
21
|
+
export declare function FontLoader({ enabled, fallback, children }: FontLoaderProps): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
//# sourceMappingURL=FontLoader.native.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FontLoader.native.d.ts","sourceRoot":"","sources":["../../../../src/fonts/FontLoader.native.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,MAAM,WAAW,eAAe;IAC9B;;;;OAIG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,eAAe,2CAK1E"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Inject @font-face rules and font CSS variables onto :root.
|
|
3
|
+
*
|
|
4
|
+
* No-op on native and when `document` is unavailable (SSR). Idempotent —
|
|
5
|
+
* safe to call multiple times; subsequent calls early-return after the
|
|
6
|
+
* `<style id="bloom-fonts">` tag has been mounted.
|
|
7
|
+
*
|
|
8
|
+
* Follows the same shape as `applyDarkClass` / `applyColorPresetVars`: a
|
|
9
|
+
* single file with an internal `Platform.OS` check rather than a `.web.ts` /
|
|
10
|
+
* `.native.ts` split. Bundlers strip the unreachable web import code path
|
|
11
|
+
* on native because the function body short-circuits before referencing the
|
|
12
|
+
* woff2 URLs.
|
|
13
|
+
*/
|
|
14
|
+
export declare function applyFontFaces(): void;
|
|
15
|
+
//# sourceMappingURL=apply-font-faces.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apply-font-faces.d.ts","sourceRoot":"","sources":["../../../../src/fonts/apply-font-faces.ts"],"names":[],"mappings":"AASA;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,IAAI,IAAI,CAkBrC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"font-assets.d.ts","sourceRoot":"","sources":["../../../../src/fonts/font-assets.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,WAAW;;;;;CAKd,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { fontFamilies, fontCssVars } from './tokens';
|
|
2
|
+
export type { FontFamilyName } from './tokens';
|
|
3
|
+
export { applyFontFaces } from './apply-font-faces';
|
|
4
|
+
export { FONT_ASSETS } from './font-assets';
|
|
5
|
+
export { FontLoader } from './FontLoader';
|
|
6
|
+
export type { FontLoaderProps } from './FontLoader';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/fonts/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACrD,YAAY,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Font family tokens for the Bloom design system.
|
|
3
|
+
*
|
|
4
|
+
* `fontFamilies` resolves to CSS-style stacks (with system fallbacks) and is
|
|
5
|
+
* used to populate the `:root` custom properties on web and as the literal
|
|
6
|
+
* `fontFamily` string source on native.
|
|
7
|
+
*
|
|
8
|
+
* `fontCssVars` is the inverse map: name -> CSS custom property name.
|
|
9
|
+
*/
|
|
10
|
+
export declare const fontFamilies: {
|
|
11
|
+
readonly display: "BlomusModernus, Georgia, \"Times New Roman\", serif";
|
|
12
|
+
readonly sans: "Inter, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif";
|
|
13
|
+
readonly mono: "\"Geist Mono\", ui-monospace, SFMono-Regular, Menlo, monospace";
|
|
14
|
+
};
|
|
15
|
+
export declare const fontCssVars: {
|
|
16
|
+
readonly display: "--bloom-font-display";
|
|
17
|
+
readonly sans: "--bloom-font-sans";
|
|
18
|
+
readonly mono: "--bloom-font-mono";
|
|
19
|
+
};
|
|
20
|
+
export type FontFamilyName = keyof typeof fontFamilies;
|
|
21
|
+
//# sourceMappingURL=tokens.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../../../../src/fonts/tokens.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,eAAO,MAAM,YAAY;;;;CAIf,CAAC;AAEX,eAAO,MAAM,WAAW;;;;CAId,CAAC;AAEX,MAAM,MAAM,cAAc,GAAG,MAAM,OAAO,YAAY,CAAC"}
|
|
@@ -34,6 +34,7 @@ export declare const sizes: {
|
|
|
34
34
|
};
|
|
35
35
|
export declare function useCommonSVGProps(props: Props): {
|
|
36
36
|
style: false | "" | IconStyle | import("react-native").RecursiveArray<import("react-native").Falsy | IconStyle> | null;
|
|
37
|
+
title?: string | undefined;
|
|
37
38
|
children?: React.ReactNode;
|
|
38
39
|
filter?: string | undefined;
|
|
39
40
|
pointerEvents?: "box-none" | "none" | "box-only" | "auto" | undefined;
|
|
@@ -142,7 +143,6 @@ export declare function useCommonSVGProps(props: Props): {
|
|
|
142
143
|
height?: import("react-native-svg").NumberProp | undefined;
|
|
143
144
|
viewBox?: string | undefined;
|
|
144
145
|
preserveAspectRatio?: string | undefined;
|
|
145
|
-
title?: string | undefined;
|
|
146
146
|
opacity?: import("react-native-svg").NumberProp | undefined;
|
|
147
147
|
fillOpacity?: import("react-native-svg").NumberProp | undefined;
|
|
148
148
|
fillRule?: import("react-native-svg").FillRule | undefined;
|
|
@@ -45,4 +45,6 @@ export * as Menu from './menu';
|
|
|
45
45
|
export * as Tooltip from './tooltip';
|
|
46
46
|
export * as Select from './select';
|
|
47
47
|
export * as ContextMenu from './context-menu';
|
|
48
|
+
export * as Code from './code';
|
|
49
|
+
export * as Fonts from './fonts';
|
|
48
50
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AACA,cAAc,SAAS,CAAC;AAGxB,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1C,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC7D,OAAO,KAAK,MAAM,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAA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,aAAa,CAAC;AAGzC,cAAc,iBAAiB,CAAC;AAGhC,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,WAAW,MAAM,gBAAgB,CAAC;AAG9C,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAG/B,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC"}
|
|
@@ -45,4 +45,6 @@ export * as Menu from './menu/index.web';
|
|
|
45
45
|
export * as Tooltip from './tooltip/index.web';
|
|
46
46
|
export * as Select from './select/index.web';
|
|
47
47
|
export * as ContextMenu from './context-menu/index.web';
|
|
48
|
+
export * as Code from './code';
|
|
49
|
+
export * as Fonts from './fonts';
|
|
48
50
|
//# sourceMappingURL=index.web.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.web.d.ts","sourceRoot":"","sources":["../../../src/index.web.ts"],"names":[],"mappings":"AAMA,cAAc,SAAS,CAAC;AAGxB,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1C,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC7D,OAAO,KAAK,MAAM,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAGhF,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAG9D,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,KAAK,KAAK,IA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,CAAC;AAG/B,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC"}
|
|
@@ -16,9 +16,21 @@ export interface BloomThemeProviderProps {
|
|
|
16
16
|
colorPreset?: AppColorName;
|
|
17
17
|
onModeChange?: (mode: ThemeMode) => void;
|
|
18
18
|
onColorPresetChange?: (preset: AppColorName) => void;
|
|
19
|
+
/**
|
|
20
|
+
* Load and inject the Bloom font system (BlomusModernus + Inter Variable
|
|
21
|
+
* + Geist Mono Variable). Default true. Set to false to opt out — e.g.
|
|
22
|
+
* apps that already ship their own font loader.
|
|
23
|
+
*/
|
|
24
|
+
fonts?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Rendered while native fonts load. Ignored on web. Useful for matching
|
|
27
|
+
* an app-level splash screen so consumers don't see a system-font flash
|
|
28
|
+
* before the bundled fonts resolve.
|
|
29
|
+
*/
|
|
30
|
+
onFontsLoading?: React.ReactNode;
|
|
19
31
|
children: React.ReactNode;
|
|
20
32
|
}
|
|
21
|
-
export declare function BloomThemeProvider({ mode: controlledMode, colorPreset: controlledPreset, onModeChange, onColorPresetChange, children, }: BloomThemeProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
export declare function BloomThemeProvider({ mode: controlledMode, colorPreset: controlledPreset, onModeChange, onColorPresetChange, fonts, onFontsLoading, children, }: BloomThemeProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
22
34
|
/**
|
|
23
35
|
* Scoped color override for a subtree.
|
|
24
36
|
* Inherits mode/dark from the parent BloomThemeProvider but overrides the color preset.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BloomThemeProvider.d.ts","sourceRoot":"","sources":["../../../../src/theme/BloomThemeProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4E,MAAM,OAAO,CAAC;AAEjG,OAAO,EAAqB,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"BloomThemeProvider.d.ts","sourceRoot":"","sources":["../../../../src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B;IACnC,WAAW,EAAE,YAAY,CAAC;IAC1B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,wBAAgB,eAAe,CAAC,EAAE,WAAW,EAAE,QAAQ,EAAE,EAAE,oBAAoB,2CAoB9E"}
|
|
@@ -11,22 +11,22 @@ export declare function ToastOutlet(): import("react/jsx-runtime").JSX.Element;
|
|
|
11
11
|
/**
|
|
12
12
|
* Access the full Sonner API
|
|
13
13
|
*/
|
|
14
|
-
export declare const api: ((message: string, data?: Omit<import("sonner-native").ToastProps, "
|
|
14
|
+
export declare const api: ((message: string, data?: Omit<import("sonner-native").ToastProps, "title" | "id" | "type" | "variant" | "jsx" | "promise"> & {
|
|
15
15
|
id?: string | number;
|
|
16
16
|
}) => string | number) & {
|
|
17
|
-
success: (message: string, data?: Omit<import("sonner-native").ToastProps, "
|
|
17
|
+
success: (message: string, data?: Omit<import("sonner-native").ToastProps, "title" | "id" | "type" | "variant" | "jsx" | "promise"> & {
|
|
18
18
|
id?: string | number;
|
|
19
19
|
}) => string | number;
|
|
20
|
-
info: (message: string, data?: Omit<import("sonner-native").ToastProps, "
|
|
20
|
+
info: (message: string, data?: Omit<import("sonner-native").ToastProps, "title" | "id" | "type" | "variant" | "jsx" | "promise"> & {
|
|
21
21
|
id?: string | number;
|
|
22
22
|
}) => string | number;
|
|
23
|
-
error: (message: string, data?: Omit<import("sonner-native").ToastProps, "
|
|
23
|
+
error: (message: string, data?: Omit<import("sonner-native").ToastProps, "title" | "id" | "type" | "variant" | "jsx" | "promise"> & {
|
|
24
24
|
id?: string | number;
|
|
25
25
|
}) => string | number;
|
|
26
|
-
warning: (message: string, data?: Omit<import("sonner-native").ToastProps, "
|
|
26
|
+
warning: (message: string, data?: Omit<import("sonner-native").ToastProps, "title" | "id" | "type" | "variant" | "jsx" | "promise"> & {
|
|
27
27
|
id?: string | number;
|
|
28
28
|
}) => string | number;
|
|
29
|
-
custom: (jsx: React.ReactElement, data?: Omit<import("sonner-native").ToastProps, "
|
|
29
|
+
custom: (jsx: React.ReactElement, data?: Omit<import("sonner-native").ToastProps, "title" | "id" | "type" | "variant" | "jsx" | "promise"> & {
|
|
30
30
|
id?: string | number;
|
|
31
31
|
}) => string | number;
|
|
32
32
|
promise: <T>(promise: Promise<T>, options: Omit<{
|
|
@@ -40,7 +40,7 @@ export declare const api: ((message: string, data?: Omit<import("sonner-native")
|
|
|
40
40
|
error?: import("sonner-native").ToastStyles;
|
|
41
41
|
};
|
|
42
42
|
}, "promise">) => string | number;
|
|
43
|
-
loading: (message: string, data?: Omit<import("sonner-native").ToastProps, "
|
|
43
|
+
loading: (message: string, data?: Omit<import("sonner-native").ToastProps, "title" | "id" | "type" | "variant" | "jsx" | "promise"> & {
|
|
44
44
|
id?: string | number;
|
|
45
45
|
}) => string | number;
|
|
46
46
|
dismiss: (id?: string | number) => string | number | undefined;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type TextProps as RNTextProps } from 'react-native';
|
|
3
|
+
import { fontFamilies } from '../fonts/tokens';
|
|
3
4
|
export type TextProps = RNTextProps;
|
|
4
5
|
export declare const Text: React.MemoExoticComponent<({ children, style, ...rest }: TextProps) => import("react/jsx-runtime").JSX.Element>;
|
|
5
6
|
export { Text as Span };
|
|
@@ -13,4 +14,5 @@ export declare function P({ style, ...rest }: TextProps): import("react/jsx-runt
|
|
|
13
14
|
export declare namespace P {
|
|
14
15
|
var displayName: string;
|
|
15
16
|
}
|
|
17
|
+
export { fontFamilies };
|
|
16
18
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/typography/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAe,MAAM,OAAO,CAAC;AACpC,OAAO,EAEL,KAAK,SAAS,IAAI,WAAW,EAI9B,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/typography/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAe,MAAM,OAAO,CAAC;AACpC,OAAO,EAEL,KAAK,SAAS,IAAI,WAAW,EAI9B,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,MAAM,MAAM,SAAS,GAAG,WAAW,CAAC;AAsCpC,eAAO,MAAM,IAAI,2DAZiD,SAAS,6CAYpC,CAAC;AAGxC,OAAO,EAAE,IAAI,IAAI,IAAI,EAAE,CAAC;AAiBxB,eAAO,MAAM,EAAE,uBAAqC,CAAC;AAErD,eAAO,MAAM,EAAE,uBAAqC,CAAC;AAErD,eAAO,MAAM,EAAE,uBAAqC,CAAC;AAErD,eAAO,MAAM,EAAE,uBAAqC,CAAC;AAErD,eAAO,MAAM,EAAE,uBAAqC,CAAC;AAErD,eAAO,MAAM,EAAE,uBAAqC,CAAC;AAGrD,wBAAgB,CAAC,CAAC,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,EAAE,SAAS,2CAU9C;yBAVe,CAAC;;;AAajB,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BloomThemeProvider.fonts-web.test.d.ts","sourceRoot":"","sources":["../../../../src/__tests__/BloomThemeProvider.fonts-web.test.tsx"],"names":[],"mappings":"AAAA;;GAEG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Code.test.d.ts","sourceRoot":"","sources":["../../../../src/__tests__/Code.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FontLoader.native.test.d.ts","sourceRoot":"","sources":["../../../../src/__tests__/FontLoader.native.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Pre.test.d.ts","sourceRoot":"","sources":["../../../../src/__tests__/Pre.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apply-font-faces.test.d.ts","sourceRoot":"","sources":["../../../../src/__tests__/apply-font-faces.test.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type TextProps as RNTextProps, type StyleProp, type TextStyle } from 'react-native';
|
|
3
|
+
export interface CodeProps extends RNTextProps {
|
|
4
|
+
style?: StyleProp<TextStyle>;
|
|
5
|
+
}
|
|
6
|
+
export declare const Code: React.MemoExoticComponent<({ children, style, ...rest }: CodeProps) => import("react/jsx-runtime").JSX.Element>;
|
|
7
|
+
//# sourceMappingURL=Code.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Code.d.ts","sourceRoot":"","sources":["../../../../src/code/Code.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAe,MAAM,OAAO,CAAC;AACpC,OAAO,EAEL,KAAK,SAAS,IAAI,WAAW,EAE7B,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAItB,MAAM,WAAW,SAAU,SAAQ,WAAW;IAC5C,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAqCD,eAAO,MAAM,IAAI,2DA/BiD,SAAS,6CA+BpC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type TextProps as RNTextProps, type StyleProp, type ViewStyle, type TextStyle } from 'react-native';
|
|
3
|
+
export interface PreProps extends Omit<RNTextProps, 'style'> {
|
|
4
|
+
containerStyle?: StyleProp<ViewStyle>;
|
|
5
|
+
style?: StyleProp<TextStyle>;
|
|
6
|
+
}
|
|
7
|
+
export declare const Pre: React.MemoExoticComponent<({ children, containerStyle, style, ...rest }: PreProps) => import("react/jsx-runtime").JSX.Element>;
|
|
8
|
+
//# sourceMappingURL=Pre.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Pre.d.ts","sourceRoot":"","sources":["../../../../src/code/Pre.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAe,MAAM,OAAO,CAAC;AACpC,OAAO,EAGL,KAAK,SAAS,IAAI,WAAW,EAE7B,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAItB,MAAM,WAAW,QAAS,SAAQ,IAAI,CAAC,WAAW,EAAE,OAAO,CAAC;IAC1D,cAAc,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACtC,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AA0DD,eAAO,MAAM,GAAG,2EA/Cb,QAAQ,6CA+C0B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/code/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,YAAY,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5B,YAAY,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface FontLoaderProps {
|
|
3
|
+
/**
|
|
4
|
+
* Whether to load and inject the Bloom font system. When false, this
|
|
5
|
+
* component is a pass-through. Default true (set by `BloomThemeProvider`).
|
|
6
|
+
*/
|
|
7
|
+
enabled: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Rendered while native fonts load. Ignored on web — the web variant
|
|
10
|
+
* applies CSS `@font-face` rules synchronously and uses `font-display: swap`
|
|
11
|
+
* to handle the FOUT period.
|
|
12
|
+
*/
|
|
13
|
+
fallback?: React.ReactNode;
|
|
14
|
+
children: React.ReactNode;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Web font loader. Applies the Bloom `@font-face` rules and CSS variables
|
|
18
|
+
* to `:root` on first render, before the first paint, using the same
|
|
19
|
+
* `useRef`-during-render pattern as `BloomThemeProvider`'s color application.
|
|
20
|
+
*
|
|
21
|
+
* No `useEffect`: the side effect runs synchronously inside the render phase,
|
|
22
|
+
* gated by a ref so it only executes once. Subsequent renders short-circuit.
|
|
23
|
+
*
|
|
24
|
+
* Native consumers resolve `FontLoader.native.tsx` via the React Native /
|
|
25
|
+
* Metro bundler's platform extension resolution — they never load this file.
|
|
26
|
+
*/
|
|
27
|
+
export declare function FontLoader({ enabled, children }: FontLoaderProps): import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
//# sourceMappingURL=FontLoader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FontLoader.d.ts","sourceRoot":"","sources":["../../../../src/fonts/FontLoader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiB,MAAM,OAAO,CAAC;AAGtC,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,UAAU,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,eAAe,2CAOhE"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface FontLoaderProps {
|
|
3
|
+
/**
|
|
4
|
+
* Whether to gate rendering on fonts being loaded. When false the
|
|
5
|
+
* component is a pass-through that still calls `useFonts` (the hook must
|
|
6
|
+
* run unconditionally per the Rules of Hooks).
|
|
7
|
+
*/
|
|
8
|
+
enabled: boolean;
|
|
9
|
+
/** Rendered while native fonts load. Defaults to `null`. */
|
|
10
|
+
fallback?: React.ReactNode;
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Native font loader. Calls `expo-font`'s `useFonts` with the Bloom font
|
|
15
|
+
* asset map and gates `children` on the load result. The hook is invoked
|
|
16
|
+
* unconditionally — `enabled` only affects what's rendered, not whether
|
|
17
|
+
* fonts get loaded. This keeps Hook order stable across renders and means
|
|
18
|
+
* `<BloomThemeProvider fonts={false}>` still gets fonts pre-loaded if the
|
|
19
|
+
* provider tree ever flips `fonts` back on.
|
|
20
|
+
*/
|
|
21
|
+
export declare function FontLoader({ enabled, fallback, children }: FontLoaderProps): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
//# sourceMappingURL=FontLoader.native.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FontLoader.native.d.ts","sourceRoot":"","sources":["../../../../src/fonts/FontLoader.native.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,MAAM,WAAW,eAAe;IAC9B;;;;OAIG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,eAAe,2CAK1E"}
|