@oxyhq/bloom 0.2.2 → 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/context-menu/index.web.js +2 -2
- package/lib/commonjs/context-menu/index.web.js.map +1 -1
- package/lib/commonjs/dialog/Dialog.web.js +2 -2
- package/lib/commonjs/dialog/Dialog.web.js.map +1 -1
- 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/menu/index.web.js +2 -2
- package/lib/commonjs/menu/index.web.js.map +1 -1
- package/lib/commonjs/select/index.web.js +2 -2
- package/lib/commonjs/select/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/context-menu/index.web.js +1 -1
- package/lib/module/context-menu/index.web.js.map +1 -1
- package/lib/module/dialog/Dialog.web.js +1 -1
- package/lib/module/dialog/Dialog.web.js.map +1 -1
- 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/menu/index.web.js +1 -1
- package/lib/module/menu/index.web.js.map +1 -1
- package/lib/module/select/index.web.js +1 -1
- package/lib/module/select/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 -18
- 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/context-menu/index.web.tsx +1 -1
- package/src/dialog/Dialog.web.tsx +1 -1
- 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/menu/index.web.tsx +1 -1
- package/src/select/index.web.tsx +1 -1
- package/src/theme/BloomThemeProvider.tsx +18 -1
- package/src/typography/index.tsx +32 -3
|
@@ -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,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;AAC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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,IAAI,SAAS,EAAE,KAAK,IAAI,SAAS,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAGhG,cAAc,oBAAoB,CAAC;AACnC,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAC;AAC7C,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,cAAc,UAAU,CAAC;AACzB,cAAc,mBAAmB,CAAC;AAClC,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc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AC;AAG3C,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC;AACvC,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAG3C,OAAO,KAAK,SAAS,MAAM,cAAc,CAAC;AAC1C,OAAO,KAAK,gBAAgB,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG7C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,YAAY,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAGvE,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AAGzC,cAAc,iBAAiB,CAAC;AAGhC,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,IAAI,MAAM,kBAAkB,CAAC;AACzC,OAAO,KAAK,OAAO,MAAM,qBAAqB,CAAC;AAC/C,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAC;AAC7C,OAAO,KAAK,WAAW,MAAM,0BAA0B,CAAC;AAGxD,OAAO,KAAK,IAAI,MAAM,QAAQ,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/theme/BloomThemeProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4E,MAAM,OAAO,CAAC;AAEjG,OAAO,EAAqB,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAKvE,OAAO,KAAK,EAAE,KAAK,EAAe,SAAS,EAAE,MAAM,SAAS,CAAC;AAmB7D,kFAAkF;AAClF,wBAAgB,UAAU,CAAC,QAAQ,EAAE,YAAY,EAAE,QAAQ,EAAE,OAAO,GAAG,MAAM,EAAE,UAAU,GAAE,OAAe,GAAG,KAAK,CAuEjH;AAED,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,KAAK,CAAC;IACb,IAAI,EAAE,SAAS,CAAC;IAChB,WAAW,EAAE,YAAY,CAAC;IAC1B,OAAO,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,CAAC;IACnC,cAAc,EAAE,CAAC,MAAM,EAAE,YAAY,KAAK,IAAI,CAAC;CAChD;AAED,eAAO,MAAM,iBAAiB,8CAAqD,CAAC;AAEpF,MAAM,WAAW,uBAAuB;IACtC,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,WAAW,CAAC,EAAE,YAAY,CAAC;IAC3B,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,CAAC;IACzC,mBAAmB,CAAC,EAAE,CAAC,MAAM,EAAE,YAAY,KAAK,IAAI,CAAC;IACrD;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;;OAIG;IACH,cAAc,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACjC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,wBAAgB,kBAAkB,CAAC,EACjC,IAAI,EAAE,cAAc,EACpB,WAAW,EAAE,gBAAgB,EAC7B,YAAY,EACZ,mBAAmB,EACnB,KAAY,EACZ,cAAc,EACd,QAAQ,GACT,EAAE,uBAAuB,2CA2DzB;AAED;;;GAGG;AACH,MAAM,WAAW,oBAAoB;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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oxyhq/bloom",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Bloom UI — Oxy ecosystem component library for React Native + Expo + Web",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -514,11 +514,34 @@
|
|
|
514
514
|
"default": "./lib/commonjs/settings-list/index.js"
|
|
515
515
|
}
|
|
516
516
|
},
|
|
517
|
+
"./code": {
|
|
518
|
+
"react-native": "./src/code/index.ts",
|
|
519
|
+
"import": {
|
|
520
|
+
"types": "./lib/typescript/module/code/index.d.ts",
|
|
521
|
+
"default": "./lib/module/code/index.js"
|
|
522
|
+
},
|
|
523
|
+
"require": {
|
|
524
|
+
"types": "./lib/typescript/commonjs/code/index.d.ts",
|
|
525
|
+
"default": "./lib/commonjs/code/index.js"
|
|
526
|
+
}
|
|
527
|
+
},
|
|
528
|
+
"./fonts": {
|
|
529
|
+
"react-native": "./src/fonts/index.ts",
|
|
530
|
+
"import": {
|
|
531
|
+
"types": "./lib/typescript/module/fonts/index.d.ts",
|
|
532
|
+
"default": "./lib/module/fonts/index.js"
|
|
533
|
+
},
|
|
534
|
+
"require": {
|
|
535
|
+
"types": "./lib/typescript/commonjs/fonts/index.d.ts",
|
|
536
|
+
"default": "./lib/commonjs/fonts/index.js"
|
|
537
|
+
}
|
|
538
|
+
},
|
|
517
539
|
"./package.json": "./package.json"
|
|
518
540
|
},
|
|
519
541
|
"files": [
|
|
520
542
|
"src",
|
|
521
|
-
"lib"
|
|
543
|
+
"lib",
|
|
544
|
+
"assets"
|
|
522
545
|
],
|
|
523
546
|
"keywords": [
|
|
524
547
|
"react-native",
|
|
@@ -555,6 +578,8 @@
|
|
|
555
578
|
"tabs",
|
|
556
579
|
"checkbox",
|
|
557
580
|
"accordion",
|
|
581
|
+
"code",
|
|
582
|
+
"fonts",
|
|
558
583
|
"ai"
|
|
559
584
|
],
|
|
560
585
|
"repository": {
|
|
@@ -579,7 +604,9 @@
|
|
|
579
604
|
"@types/react": "~19.1.0",
|
|
580
605
|
"@types/react-dom": "^19.2.3",
|
|
581
606
|
"@types/react-native": "*",
|
|
607
|
+
"expo-font": "^56.0.5",
|
|
582
608
|
"jest": "^30.3.0",
|
|
609
|
+
"jest-environment-jsdom": "^30.4.1",
|
|
583
610
|
"react": "19.2.0",
|
|
584
611
|
"react-dom": "19.2.0",
|
|
585
612
|
"react-native": "0.83.2",
|
|
@@ -597,6 +624,8 @@
|
|
|
597
624
|
},
|
|
598
625
|
"peerDependencies": {
|
|
599
626
|
"@gorhom/bottom-sheet": ">=5.0.0",
|
|
627
|
+
"expo": "*",
|
|
628
|
+
"expo-font": "*",
|
|
600
629
|
"react": ">=18.0.0",
|
|
601
630
|
"react-dom": ">=18.0.0",
|
|
602
631
|
"react-native": ">=0.73.0",
|
|
@@ -611,6 +640,12 @@
|
|
|
611
640
|
"@gorhom/bottom-sheet": {
|
|
612
641
|
"optional": true
|
|
613
642
|
},
|
|
643
|
+
"expo": {
|
|
644
|
+
"optional": true
|
|
645
|
+
},
|
|
646
|
+
"expo-font": {
|
|
647
|
+
"optional": true
|
|
648
|
+
},
|
|
614
649
|
"react-dom": {
|
|
615
650
|
"optional": true
|
|
616
651
|
},
|
|
@@ -652,21 +687,5 @@
|
|
|
652
687
|
"dependencies": {
|
|
653
688
|
"nanoid": "^5.1.5",
|
|
654
689
|
"react-remove-scroll-bar": "^2.3.8"
|
|
655
|
-
},
|
|
656
|
-
"browser": {
|
|
657
|
-
"./lib/module/portal/index.js": "./lib/module/portal/index.web.js",
|
|
658
|
-
"./lib/commonjs/portal/index.js": "./lib/commonjs/portal/index.web.js",
|
|
659
|
-
"./lib/module/dialog/index.js": "./lib/module/dialog/index.web.js",
|
|
660
|
-
"./lib/commonjs/dialog/index.js": "./lib/commonjs/dialog/index.web.js",
|
|
661
|
-
"./lib/module/toast/index.js": "./lib/module/toast/index.web.js",
|
|
662
|
-
"./lib/commonjs/toast/index.js": "./lib/commonjs/toast/index.web.js",
|
|
663
|
-
"./lib/module/menu/index.js": "./lib/module/menu/index.web.js",
|
|
664
|
-
"./lib/commonjs/menu/index.js": "./lib/commonjs/menu/index.web.js",
|
|
665
|
-
"./lib/module/tooltip/index.js": "./lib/module/tooltip/index.web.js",
|
|
666
|
-
"./lib/commonjs/tooltip/index.js": "./lib/commonjs/tooltip/index.web.js",
|
|
667
|
-
"./lib/module/select/index.js": "./lib/module/select/index.web.js",
|
|
668
|
-
"./lib/commonjs/select/index.js": "./lib/commonjs/select/index.web.js",
|
|
669
|
-
"./lib/module/context-menu/index.js": "./lib/module/context-menu/index.web.js",
|
|
670
|
-
"./lib/commonjs/context-menu/index.js": "./lib/commonjs/context-menu/index.web.js"
|
|
671
690
|
}
|
|
672
691
|
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jest-environment jsdom
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import { Platform, Text } from 'react-native';
|
|
7
|
+
import { render } from '@testing-library/react-native';
|
|
8
|
+
|
|
9
|
+
import { BloomThemeProvider } from '../theme/BloomThemeProvider';
|
|
10
|
+
|
|
11
|
+
describe('BloomThemeProvider — font injection on web', () => {
|
|
12
|
+
const originalOS = Platform.OS;
|
|
13
|
+
|
|
14
|
+
beforeEach(() => {
|
|
15
|
+
document.head.innerHTML = '';
|
|
16
|
+
document.body.innerHTML = '';
|
|
17
|
+
Platform.OS = 'web';
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
afterAll(() => {
|
|
21
|
+
Platform.OS = originalOS;
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
it('injects <style id="bloom-fonts"> by default', () => {
|
|
25
|
+
expect(document.getElementById('bloom-fonts')).toBeNull();
|
|
26
|
+
render(
|
|
27
|
+
<BloomThemeProvider>
|
|
28
|
+
<Text>hi</Text>
|
|
29
|
+
</BloomThemeProvider>,
|
|
30
|
+
);
|
|
31
|
+
expect(document.getElementById('bloom-fonts')).not.toBeNull();
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it('does not inject the style tag when fonts={false}', () => {
|
|
35
|
+
render(
|
|
36
|
+
<BloomThemeProvider fonts={false}>
|
|
37
|
+
<Text>hi</Text>
|
|
38
|
+
</BloomThemeProvider>,
|
|
39
|
+
);
|
|
40
|
+
expect(document.getElementById('bloom-fonts')).toBeNull();
|
|
41
|
+
});
|
|
42
|
+
});
|
|
@@ -158,3 +158,25 @@ describe('useBloomTheme', () => {
|
|
|
158
158
|
spy.mockRestore();
|
|
159
159
|
});
|
|
160
160
|
});
|
|
161
|
+
|
|
162
|
+
describe('BloomThemeProvider font integration', () => {
|
|
163
|
+
it('still renders children when fonts default is enabled', () => {
|
|
164
|
+
const { getByTestId } = render(
|
|
165
|
+
<BloomThemeProvider>
|
|
166
|
+
<ThemeDisplay />
|
|
167
|
+
</BloomThemeProvider>,
|
|
168
|
+
);
|
|
169
|
+
// In the node test environment without document, applyFontFaces is a
|
|
170
|
+
// no-op but the FontLoader still passes children through.
|
|
171
|
+
expect(getByTestId('mode').props.children).toBe('light');
|
|
172
|
+
});
|
|
173
|
+
|
|
174
|
+
it('still renders children when fonts={false}', () => {
|
|
175
|
+
const { getByTestId } = render(
|
|
176
|
+
<BloomThemeProvider fonts={false}>
|
|
177
|
+
<ThemeDisplay />
|
|
178
|
+
</BloomThemeProvider>,
|
|
179
|
+
);
|
|
180
|
+
expect(getByTestId('mode').props.children).toBe('light');
|
|
181
|
+
});
|
|
182
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render } from '@testing-library/react-native';
|
|
3
|
+
|
|
4
|
+
import { BloomThemeProvider } from '../theme/BloomThemeProvider';
|
|
5
|
+
import { Code } from '../code';
|
|
6
|
+
|
|
7
|
+
function renderWithTheme(ui: React.ReactElement) {
|
|
8
|
+
return render(<BloomThemeProvider mode="light">{ui}</BloomThemeProvider>);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
describe('Code', () => {
|
|
12
|
+
it('renders children', () => {
|
|
13
|
+
const { getByText } = renderWithTheme(<Code>const x = 1</Code>);
|
|
14
|
+
expect(getByText('const x = 1')).toBeTruthy();
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
it('applies the Geist Mono font family on native', () => {
|
|
18
|
+
const { getByText } = renderWithTheme(<Code>foo</Code>);
|
|
19
|
+
const node = getByText('foo');
|
|
20
|
+
const flat = Array.isArray(node.props.style)
|
|
21
|
+
? Object.assign({}, ...node.props.style.filter(Boolean))
|
|
22
|
+
: node.props.style;
|
|
23
|
+
expect(flat.fontFamily).toBe('Geist Mono');
|
|
24
|
+
});
|
|
25
|
+
});
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Text } from 'react-native';
|
|
3
|
+
import { render } from '@testing-library/react-native';
|
|
4
|
+
|
|
5
|
+
type UseFontsResult = readonly [boolean, Error | null];
|
|
6
|
+
|
|
7
|
+
let mockUseFontsResult: UseFontsResult = [true, null];
|
|
8
|
+
|
|
9
|
+
jest.mock('expo-font', () => ({
|
|
10
|
+
useFonts: () => mockUseFontsResult,
|
|
11
|
+
}));
|
|
12
|
+
|
|
13
|
+
import { FontLoader } from '../fonts/FontLoader.native';
|
|
14
|
+
|
|
15
|
+
function setUseFontsResult(result: UseFontsResult): void {
|
|
16
|
+
mockUseFontsResult = result;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
describe('FontLoader (native)', () => {
|
|
20
|
+
afterEach(() => {
|
|
21
|
+
setUseFontsResult([true, null]);
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
it('renders children when fonts are loaded and enabled', () => {
|
|
25
|
+
setUseFontsResult([true, null]);
|
|
26
|
+
const { getByText, queryByText } = render(
|
|
27
|
+
<FontLoader enabled fallback={<Text>fallback</Text>}>
|
|
28
|
+
<Text>content</Text>
|
|
29
|
+
</FontLoader>,
|
|
30
|
+
);
|
|
31
|
+
expect(getByText('content')).toBeTruthy();
|
|
32
|
+
expect(queryByText('fallback')).toBeNull();
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
it('renders fallback while fonts are loading and enabled', () => {
|
|
36
|
+
setUseFontsResult([false, null]);
|
|
37
|
+
const { getByText, queryByText } = render(
|
|
38
|
+
<FontLoader enabled fallback={<Text>fallback</Text>}>
|
|
39
|
+
<Text>content</Text>
|
|
40
|
+
</FontLoader>,
|
|
41
|
+
);
|
|
42
|
+
expect(getByText('fallback')).toBeTruthy();
|
|
43
|
+
expect(queryByText('content')).toBeNull();
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
it('renders null fallback by default while loading', () => {
|
|
47
|
+
setUseFontsResult([false, null]);
|
|
48
|
+
const { queryByText } = render(
|
|
49
|
+
<FontLoader enabled>
|
|
50
|
+
<Text>content</Text>
|
|
51
|
+
</FontLoader>,
|
|
52
|
+
);
|
|
53
|
+
expect(queryByText('content')).toBeNull();
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
it('renders children when disabled, regardless of load state', () => {
|
|
57
|
+
setUseFontsResult([false, null]);
|
|
58
|
+
const { getByText } = render(
|
|
59
|
+
<FontLoader enabled={false} fallback={<Text>fallback</Text>}>
|
|
60
|
+
<Text>content</Text>
|
|
61
|
+
</FontLoader>,
|
|
62
|
+
);
|
|
63
|
+
expect(getByText('content')).toBeTruthy();
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
it('renders children when disabled even with a loaded result', () => {
|
|
67
|
+
setUseFontsResult([true, null]);
|
|
68
|
+
const { getByText } = render(
|
|
69
|
+
<FontLoader enabled={false}>
|
|
70
|
+
<Text>content</Text>
|
|
71
|
+
</FontLoader>,
|
|
72
|
+
);
|
|
73
|
+
expect(getByText('content')).toBeTruthy();
|
|
74
|
+
});
|
|
75
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render } from '@testing-library/react-native';
|
|
3
|
+
|
|
4
|
+
import { BloomThemeProvider } from '../theme/BloomThemeProvider';
|
|
5
|
+
import { Pre } from '../code';
|
|
6
|
+
|
|
7
|
+
function renderWithTheme(ui: React.ReactElement) {
|
|
8
|
+
return render(<BloomThemeProvider mode="light">{ui}</BloomThemeProvider>);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
describe('Pre', () => {
|
|
12
|
+
it('renders children', () => {
|
|
13
|
+
const { getByText } = renderWithTheme(<Pre>{`function foo() {}`}</Pre>);
|
|
14
|
+
expect(getByText('function foo() {}')).toBeTruthy();
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
it('applies the Geist Mono font family on native', () => {
|
|
18
|
+
const { getByText } = renderWithTheme(<Pre>bar</Pre>);
|
|
19
|
+
const node = getByText('bar');
|
|
20
|
+
const flat = Array.isArray(node.props.style)
|
|
21
|
+
? Object.assign({}, ...node.props.style.filter(Boolean))
|
|
22
|
+
: node.props.style;
|
|
23
|
+
expect(flat.fontFamily).toBe('Geist Mono');
|
|
24
|
+
});
|
|
25
|
+
});
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jest-environment jsdom
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { Platform } from 'react-native';
|
|
6
|
+
import { applyFontFaces } from '../fonts/apply-font-faces';
|
|
7
|
+
|
|
8
|
+
describe('applyFontFaces', () => {
|
|
9
|
+
const originalOS = Platform.OS;
|
|
10
|
+
|
|
11
|
+
beforeEach(() => {
|
|
12
|
+
document.head.innerHTML = '';
|
|
13
|
+
document.body.innerHTML = '';
|
|
14
|
+
Platform.OS = 'web';
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
afterAll(() => {
|
|
18
|
+
Platform.OS = originalOS;
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it('injects a <style id="bloom-fonts"> element on first call', () => {
|
|
22
|
+
expect(document.getElementById('bloom-fonts')).toBeNull();
|
|
23
|
+
applyFontFaces();
|
|
24
|
+
const style = document.getElementById('bloom-fonts');
|
|
25
|
+
expect(style).not.toBeNull();
|
|
26
|
+
expect(style?.tagName).toBe('STYLE');
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
it('is idempotent — calling twice does not duplicate the <style>', () => {
|
|
30
|
+
applyFontFaces();
|
|
31
|
+
applyFontFaces();
|
|
32
|
+
applyFontFaces();
|
|
33
|
+
const styles = document.querySelectorAll('style#bloom-fonts');
|
|
34
|
+
expect(styles.length).toBe(1);
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
it('emits four @font-face rules', () => {
|
|
38
|
+
applyFontFaces();
|
|
39
|
+
const cssText = document.getElementById('bloom-fonts')?.textContent ?? '';
|
|
40
|
+
const matches = cssText.match(/@font-face\s*{/g) ?? [];
|
|
41
|
+
expect(matches.length).toBe(4);
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
it('declares the three Bloom font CSS variables on :root', () => {
|
|
45
|
+
applyFontFaces();
|
|
46
|
+
const cssText = document.getElementById('bloom-fonts')?.textContent ?? '';
|
|
47
|
+
expect(cssText).toMatch(/--bloom-font-display:/);
|
|
48
|
+
expect(cssText).toMatch(/--bloom-font-sans:/);
|
|
49
|
+
expect(cssText).toMatch(/--bloom-font-mono:/);
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
it('references all four font families by name', () => {
|
|
53
|
+
applyFontFaces();
|
|
54
|
+
const cssText = document.getElementById('bloom-fonts')?.textContent ?? '';
|
|
55
|
+
expect(cssText).toMatch(/font-family: 'BlomusModernus'/);
|
|
56
|
+
expect(cssText).toMatch(/font-family: 'Inter'/);
|
|
57
|
+
expect(cssText).toMatch(/font-family: 'Geist Mono'/);
|
|
58
|
+
});
|
|
59
|
+
});
|
package/src/assets.d.ts
CHANGED
|
@@ -24,3 +24,23 @@ declare module '*.webp' {
|
|
|
24
24
|
const value: number;
|
|
25
25
|
export default value;
|
|
26
26
|
}
|
|
27
|
+
|
|
28
|
+
declare module '*.woff2' {
|
|
29
|
+
const value: string;
|
|
30
|
+
export default value;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
declare module '*.woff' {
|
|
34
|
+
const value: string;
|
|
35
|
+
export default value;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
declare module '*.ttf' {
|
|
39
|
+
const value: number;
|
|
40
|
+
export default value;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
declare module '*.otf' {
|
|
44
|
+
const value: number;
|
|
45
|
+
export default value;
|
|
46
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import React, { memo } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Text as RNText,
|
|
4
|
+
type TextProps as RNTextProps,
|
|
5
|
+
Platform,
|
|
6
|
+
type StyleProp,
|
|
7
|
+
type TextStyle,
|
|
8
|
+
} from 'react-native';
|
|
9
|
+
|
|
10
|
+
import { useTheme } from '../theme/use-theme';
|
|
11
|
+
|
|
12
|
+
export interface CodeProps extends RNTextProps {
|
|
13
|
+
style?: StyleProp<TextStyle>;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Inline monospace text — render as `<code>` on web (CSS var family) and
|
|
18
|
+
* `<Text fontFamily="Geist Mono">` on native.
|
|
19
|
+
*/
|
|
20
|
+
const CodeComponent = function Code({ children, style, ...rest }: CodeProps) {
|
|
21
|
+
const { colors } = useTheme();
|
|
22
|
+
|
|
23
|
+
if (Platform.OS === 'web') {
|
|
24
|
+
return React.createElement(
|
|
25
|
+
'code',
|
|
26
|
+
{
|
|
27
|
+
...rest,
|
|
28
|
+
style: {
|
|
29
|
+
fontFamily: 'var(--bloom-font-mono)',
|
|
30
|
+
fontSize: '0.92em',
|
|
31
|
+
color: colors.text,
|
|
32
|
+
...(style as object | undefined),
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
children,
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<RNText
|
|
41
|
+
{...rest}
|
|
42
|
+
style={[
|
|
43
|
+
{ fontFamily: 'Geist Mono', fontSize: 13, color: colors.text },
|
|
44
|
+
style,
|
|
45
|
+
]}>
|
|
46
|
+
{children}
|
|
47
|
+
</RNText>
|
|
48
|
+
);
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export const Code = memo(CodeComponent);
|
|
52
|
+
Code.displayName = 'Code';
|