kaleido-ui 0.1.57 → 0.1.58
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/native/fonts/Satoshi-Bold.ttf +0 -0
- package/dist/native/fonts/Satoshi-Medium.ttf +0 -0
- package/dist/native/fonts/Satoshi-Regular.ttf +0 -0
- package/dist/native/fonts.cjs +64 -0
- package/dist/native/fonts.d.cts +23 -0
- package/dist/native/fonts.d.ts +23 -0
- package/dist/native/fonts.js +28 -0
- package/package.json +7 -2
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var fonts_exports = {};
|
|
30
|
+
__export(fonts_exports, {
|
|
31
|
+
kaleidoFonts: () => kaleidoFonts,
|
|
32
|
+
satoshiFamilyForWeight: () => satoshiFamilyForWeight,
|
|
33
|
+
satoshiFontFamily: () => satoshiFontFamily
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(fonts_exports);
|
|
36
|
+
var import_Satoshi_Regular = __toESM(require("./fonts/Satoshi-Regular.ttf"), 1);
|
|
37
|
+
var import_Satoshi_Medium = __toESM(require("./fonts/Satoshi-Medium.ttf"), 1);
|
|
38
|
+
var import_Satoshi_Bold = __toESM(require("./fonts/Satoshi-Bold.ttf"), 1);
|
|
39
|
+
const kaleidoFonts = {
|
|
40
|
+
"Satoshi-Regular": import_Satoshi_Regular.default,
|
|
41
|
+
"Satoshi-Medium": import_Satoshi_Medium.default,
|
|
42
|
+
"Satoshi-Bold": import_Satoshi_Bold.default
|
|
43
|
+
};
|
|
44
|
+
const satoshiFontFamily = {
|
|
45
|
+
regular: "Satoshi-Regular",
|
|
46
|
+
medium: "Satoshi-Medium",
|
|
47
|
+
/** No dedicated 600 face ships — semibold maps onto the bold cut. */
|
|
48
|
+
semibold: "Satoshi-Bold",
|
|
49
|
+
bold: "Satoshi-Bold"
|
|
50
|
+
};
|
|
51
|
+
function satoshiFamilyForWeight(weight) {
|
|
52
|
+
if (weight === "bold") return satoshiFontFamily.bold;
|
|
53
|
+
const n = typeof weight === "number" ? weight : Number(weight);
|
|
54
|
+
if (!Number.isFinite(n)) return satoshiFontFamily.regular;
|
|
55
|
+
if (n >= 600) return satoshiFontFamily.bold;
|
|
56
|
+
if (n >= 500) return satoshiFontFamily.medium;
|
|
57
|
+
return satoshiFontFamily.regular;
|
|
58
|
+
}
|
|
59
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
60
|
+
0 && (module.exports = {
|
|
61
|
+
kaleidoFonts,
|
|
62
|
+
satoshiFamilyForWeight,
|
|
63
|
+
satoshiFontFamily
|
|
64
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Asset map keyed by the family name to register the font under. Pass straight
|
|
3
|
+
* to `expo-font`'s `useFonts` / `Font.loadAsync`. Each key becomes the string
|
|
4
|
+
* you use as `fontFamily` in styles (identical on iOS and Android).
|
|
5
|
+
*/
|
|
6
|
+
declare const kaleidoFonts: Record<string, number>;
|
|
7
|
+
/** Registered Satoshi family names, by semantic weight. */
|
|
8
|
+
declare const satoshiFontFamily: {
|
|
9
|
+
readonly regular: "Satoshi-Regular";
|
|
10
|
+
readonly medium: "Satoshi-Medium";
|
|
11
|
+
/** No dedicated 600 face ships — semibold maps onto the bold cut. */
|
|
12
|
+
readonly semibold: "Satoshi-Bold";
|
|
13
|
+
readonly bold: "Satoshi-Bold";
|
|
14
|
+
};
|
|
15
|
+
type SatoshiWeightName = keyof typeof satoshiFontFamily;
|
|
16
|
+
/**
|
|
17
|
+
* Resolve the Satoshi family that best matches an RN `fontWeight` value.
|
|
18
|
+
* RN won't synthesize weight from a single custom family (especially on
|
|
19
|
+
* Android), so weight must be expressed by picking the matching face.
|
|
20
|
+
*/
|
|
21
|
+
declare function satoshiFamilyForWeight(weight?: string | number): string;
|
|
22
|
+
|
|
23
|
+
export { type SatoshiWeightName, kaleidoFonts, satoshiFamilyForWeight, satoshiFontFamily };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Asset map keyed by the family name to register the font under. Pass straight
|
|
3
|
+
* to `expo-font`'s `useFonts` / `Font.loadAsync`. Each key becomes the string
|
|
4
|
+
* you use as `fontFamily` in styles (identical on iOS and Android).
|
|
5
|
+
*/
|
|
6
|
+
declare const kaleidoFonts: Record<string, number>;
|
|
7
|
+
/** Registered Satoshi family names, by semantic weight. */
|
|
8
|
+
declare const satoshiFontFamily: {
|
|
9
|
+
readonly regular: "Satoshi-Regular";
|
|
10
|
+
readonly medium: "Satoshi-Medium";
|
|
11
|
+
/** No dedicated 600 face ships — semibold maps onto the bold cut. */
|
|
12
|
+
readonly semibold: "Satoshi-Bold";
|
|
13
|
+
readonly bold: "Satoshi-Bold";
|
|
14
|
+
};
|
|
15
|
+
type SatoshiWeightName = keyof typeof satoshiFontFamily;
|
|
16
|
+
/**
|
|
17
|
+
* Resolve the Satoshi family that best matches an RN `fontWeight` value.
|
|
18
|
+
* RN won't synthesize weight from a single custom family (especially on
|
|
19
|
+
* Android), so weight must be expressed by picking the matching face.
|
|
20
|
+
*/
|
|
21
|
+
declare function satoshiFamilyForWeight(weight?: string | number): string;
|
|
22
|
+
|
|
23
|
+
export { type SatoshiWeightName, kaleidoFonts, satoshiFamilyForWeight, satoshiFontFamily };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import SatoshiRegular from "./fonts/Satoshi-Regular.ttf";
|
|
2
|
+
import SatoshiMedium from "./fonts/Satoshi-Medium.ttf";
|
|
3
|
+
import SatoshiBold from "./fonts/Satoshi-Bold.ttf";
|
|
4
|
+
const kaleidoFonts = {
|
|
5
|
+
"Satoshi-Regular": SatoshiRegular,
|
|
6
|
+
"Satoshi-Medium": SatoshiMedium,
|
|
7
|
+
"Satoshi-Bold": SatoshiBold
|
|
8
|
+
};
|
|
9
|
+
const satoshiFontFamily = {
|
|
10
|
+
regular: "Satoshi-Regular",
|
|
11
|
+
medium: "Satoshi-Medium",
|
|
12
|
+
/** No dedicated 600 face ships — semibold maps onto the bold cut. */
|
|
13
|
+
semibold: "Satoshi-Bold",
|
|
14
|
+
bold: "Satoshi-Bold"
|
|
15
|
+
};
|
|
16
|
+
function satoshiFamilyForWeight(weight) {
|
|
17
|
+
if (weight === "bold") return satoshiFontFamily.bold;
|
|
18
|
+
const n = typeof weight === "number" ? weight : Number(weight);
|
|
19
|
+
if (!Number.isFinite(n)) return satoshiFontFamily.regular;
|
|
20
|
+
if (n >= 600) return satoshiFontFamily.bold;
|
|
21
|
+
if (n >= 500) return satoshiFontFamily.medium;
|
|
22
|
+
return satoshiFontFamily.regular;
|
|
23
|
+
}
|
|
24
|
+
export {
|
|
25
|
+
kaleidoFonts,
|
|
26
|
+
satoshiFamilyForWeight,
|
|
27
|
+
satoshiFontFamily
|
|
28
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kaleido-ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.58",
|
|
4
4
|
"description": "KaleidoSwap shared UI library — design tokens, web components (Tailwind + Radix), and React Native components extending WDK UI Kit",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -23,6 +23,11 @@
|
|
|
23
23
|
"import": "./dist/native/index.js",
|
|
24
24
|
"require": "./dist/native/index.cjs"
|
|
25
25
|
},
|
|
26
|
+
"./native/fonts": {
|
|
27
|
+
"types": "./dist/native/fonts.d.ts",
|
|
28
|
+
"import": "./dist/native/fonts.js",
|
|
29
|
+
"require": "./dist/native/fonts.cjs"
|
|
30
|
+
},
|
|
26
31
|
"./css": "./dist/css/kaleido-ui.css"
|
|
27
32
|
},
|
|
28
33
|
"files": [
|
|
@@ -33,7 +38,7 @@
|
|
|
33
38
|
"scripts": {
|
|
34
39
|
"generate:css": "node node_modules/tsx/dist/cli.mjs scripts/generate-css.ts",
|
|
35
40
|
"check:tokens": "node node_modules/tsx/dist/cli.mjs scripts/check-tokens.ts",
|
|
36
|
-
"build": "npm run generate:css && npm run check:tokens && tsup && mkdir -p dist/css && cp src/css/kaleido-ui.css dist/css/kaleido-ui.css",
|
|
41
|
+
"build": "npm run generate:css && npm run check:tokens && tsup && mkdir -p dist/css && cp src/css/kaleido-ui.css dist/css/kaleido-ui.css && mkdir -p dist/native/fonts && cp src/native/fonts/*.ttf dist/native/fonts/",
|
|
37
42
|
"dev": "tsup --watch",
|
|
38
43
|
"showcase": "vite --config showcase/vite.config.ts",
|
|
39
44
|
"showcase:build": "npm run generate:css && vite build --config showcase/vite.config.ts",
|