@starasia/text 1.0.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/README.md +60 -0
- package/dist/Text.d.ts +4 -0
- package/dist/functions.d.ts +4 -0
- package/dist/index.d.ts +2 -0
- package/dist/text.es.js +2116 -0
- package/dist/text.umd.js +1790 -0
- package/dist/types.d.ts +68 -0
- package/package.json +42 -0
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
export interface TextProps extends React.HTMLAttributes<HTMLParagraphElement> {
|
|
2
|
+
fontSize?: FontSize;
|
|
3
|
+
fontWeight?: FontWeight;
|
|
4
|
+
color?: TextColor;
|
|
5
|
+
align?: TextAlign;
|
|
6
|
+
margin?: TextSpacing;
|
|
7
|
+
marginTop?: TextSpacing;
|
|
8
|
+
marginBottom?: TextSpacing;
|
|
9
|
+
marginLeft?: TextSpacing;
|
|
10
|
+
marginRight?: TextSpacing;
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
lineHeight?: LineHeight;
|
|
13
|
+
textAlign?: TextAlign;
|
|
14
|
+
fontFamily?: "Poppins" | "Montserrat";
|
|
15
|
+
currency?: boolean;
|
|
16
|
+
letterSpacing?: "0.03px" | "0.21px" | "0.252px" | "0.04px" | "0.24px" | "0.18px";
|
|
17
|
+
variant?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "sub-h1" | "sub-h2" | "sub-h3" | "body-1" | "body-2" | "body-3";
|
|
18
|
+
truncate?: boolean;
|
|
19
|
+
}
|
|
20
|
+
export declare const LineHeightConst: readonly ["leading-3", "leading-4", "leading-5", "leading-6", "leading-7", "leading-8", "leading-9", "leading-10", "leading-none", "leading-tight", "leading-snug", "leading-normal", "leading-relaxed", "leading-loose"];
|
|
21
|
+
export type LineHeight = (typeof LineHeightConst)[number];
|
|
22
|
+
export declare const TextSpacingConst: readonly ["xs", "sm", "md", "lg", "auto", "spacing-0", "spacing-1", "spacing-2", "spacing-3", "spacing-4", "spacing-5", "spacing-6", "spacing-8", "spacing-10", "spacing-12", "spacing-16", "spacing-20", "spacing-24", "spacing-32", "spacing-40", "spacing-48", "spacing-56", "spacing-64"];
|
|
23
|
+
export type TextSpacing = (typeof TextSpacingConst)[number];
|
|
24
|
+
export declare const TextAlignConst: readonly ["left", "center", "right"];
|
|
25
|
+
export type TextAlign = (typeof TextAlignConst)[number];
|
|
26
|
+
export declare const FontWeightConst: readonly ["hairline", "thin", "light", "normal", "medium", "semibold", "bold", "extrabold", "black"];
|
|
27
|
+
export type FontWeight = (typeof FontWeightConst)[number];
|
|
28
|
+
export declare const TextColorSchemeGenerator: readonly [{
|
|
29
|
+
readonly name: "brand";
|
|
30
|
+
readonly colors: readonly ["primary"];
|
|
31
|
+
}, {
|
|
32
|
+
readonly name: "state";
|
|
33
|
+
readonly colors: readonly ["default", "secondary", "tertiary", "disable", "white", "success", "success-secondary", "success-disable", "danger", "danger-secondary", "danger-disable", "brand", "brand-secondary", "info", "info-secondary", "warning", "warning-disable", "error"];
|
|
34
|
+
}, {
|
|
35
|
+
readonly name: "text";
|
|
36
|
+
readonly colors: readonly ["text", "text-light", "text-muted"];
|
|
37
|
+
}, {
|
|
38
|
+
readonly name: "gray";
|
|
39
|
+
readonly colors: readonly ["gray-50", "gray-100", "gray-200", "gray-300", "gray-400", "gray-500", "gray-600", "gray-700", "gray-800", "gray-900", "gray-950"];
|
|
40
|
+
}, {
|
|
41
|
+
readonly name: "red";
|
|
42
|
+
readonly colors: readonly ["red-50", "red-100", "red-200", "red-300", "red-400", "red-500", "red-600", "red-700", "red-800", "red-900", "red-950"];
|
|
43
|
+
}, {
|
|
44
|
+
readonly name: "orange";
|
|
45
|
+
readonly colors: readonly ["orange-50", "orange-100", "orange-200", "orange-300", "orange-400", "orange-500", "orange-600", "orange-700", "orange-800", "orange-900", "orange-950"];
|
|
46
|
+
}, {
|
|
47
|
+
readonly name: "yellow";
|
|
48
|
+
readonly colors: readonly ["yellow-50", "yellow-100", "yellow-200", "yellow-300", "yellow-400", "yellow-500", "yellow-600", "yellow-700", "yellow-800", "yellow-900", "yellow-950"];
|
|
49
|
+
}, {
|
|
50
|
+
readonly name: "green";
|
|
51
|
+
readonly colors: readonly ["green-50", "green-100", "green-200", "green-300", "green-400", "green-500", "green-600", "green-700", "green-800", "green-900", "green-950"];
|
|
52
|
+
}, {
|
|
53
|
+
readonly name: "blue";
|
|
54
|
+
readonly colors: readonly ["blue-50", "blue-100", "blue-200", "blue-300", "blue-400", "blue-500", "blue-600", "blue-700", "blue-800", "blue-900", "blue-950"];
|
|
55
|
+
}, {
|
|
56
|
+
readonly name: "purple";
|
|
57
|
+
readonly colors: readonly ["purple-50", "purple-100", "purple-200", "purple-300", "purple-400", "purple-500", "purple-600", "purple-700", "purple-800", "purple-900", "purple-950"];
|
|
58
|
+
}, {
|
|
59
|
+
readonly name: "pink";
|
|
60
|
+
readonly colors: readonly ["pink-50", "pink-100", "pink-200", "pink-300", "pink-400", "pink-500", "pink-600", "pink-700", "pink-800", "pink-900"];
|
|
61
|
+
}, {
|
|
62
|
+
readonly name: "aloha";
|
|
63
|
+
readonly colors: readonly ["aloha-50", "aloha-100", "aloha-200", "aloha-300", "aloha-400", "aloha-500", "aloha-600", "aloha-700", "aloha-800", "aloha-900"];
|
|
64
|
+
}];
|
|
65
|
+
export declare const TextColorConst: ("brand" | "primary" | "default" | "secondary" | "tertiary" | "disable" | "white" | "success" | "success-secondary" | "success-disable" | "danger" | "danger-secondary" | "danger-disable" | "brand-secondary" | "info" | "info-secondary" | "warning" | "warning-disable" | "error" | "text" | "text-light" | "text-muted" | "gray-50" | "gray-100" | "gray-200" | "gray-300" | "gray-400" | "gray-500" | "gray-600" | "gray-700" | "gray-800" | "gray-900" | "gray-950" | "red-50" | "red-100" | "red-200" | "red-300" | "red-400" | "red-500" | "red-600" | "red-700" | "red-800" | "red-900" | "red-950" | "orange-50" | "orange-100" | "orange-200" | "orange-300" | "orange-400" | "orange-500" | "orange-600" | "orange-700" | "orange-800" | "orange-900" | "orange-950" | "yellow-50" | "yellow-100" | "yellow-200" | "yellow-300" | "yellow-400" | "yellow-500" | "yellow-600" | "yellow-700" | "yellow-800" | "yellow-900" | "yellow-950" | "green-50" | "green-100" | "green-200" | "green-300" | "green-400" | "green-500" | "green-600" | "green-700" | "green-800" | "green-900" | "green-950" | "blue-50" | "blue-100" | "blue-200" | "blue-300" | "blue-400" | "blue-500" | "blue-600" | "blue-700" | "blue-800" | "blue-900" | "blue-950" | "purple-50" | "purple-100" | "purple-200" | "purple-300" | "purple-400" | "purple-500" | "purple-600" | "purple-700" | "purple-800" | "purple-900" | "purple-950" | "pink-50" | "pink-100" | "pink-200" | "pink-300" | "pink-400" | "pink-500" | "pink-600" | "pink-700" | "pink-800" | "pink-900" | "aloha-50" | "aloha-100" | "aloha-200" | "aloha-300" | "aloha-400" | "aloha-500" | "aloha-600" | "aloha-700" | "aloha-800" | "aloha-900")[];
|
|
66
|
+
export type TextColor = (typeof TextColorConst)[number];
|
|
67
|
+
export declare const FontSizeConst: readonly ["xs", "sm", "md", "lg", "xl", "2xl", "3xl", "4xl", "5xl", "6xl"];
|
|
68
|
+
export type FontSize = (typeof FontSizeConst)[number];
|
package/package.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@starasia/text",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "text component for starasia UI",
|
|
5
|
+
"author": "Prawito Hudoro",
|
|
6
|
+
"main": "dist/text.umd.js",
|
|
7
|
+
"module": "dist/text.es.js",
|
|
8
|
+
"types": "dist/index.d.ts",
|
|
9
|
+
"files": [
|
|
10
|
+
"dist/*.js",
|
|
11
|
+
"dist/*.d.ts",
|
|
12
|
+
"dist/*.map",
|
|
13
|
+
"dist/*.css"
|
|
14
|
+
],
|
|
15
|
+
"scripts": {
|
|
16
|
+
"dev": "vite --config vite.config.ts --port 3000",
|
|
17
|
+
"build": "cross-env NODE_ENV=production vite build --config vite.config.ts"
|
|
18
|
+
},
|
|
19
|
+
"keywords": [],
|
|
20
|
+
"license": "ISC",
|
|
21
|
+
"type": "module",
|
|
22
|
+
"engines": {
|
|
23
|
+
"node": ">=18.0.0"
|
|
24
|
+
},
|
|
25
|
+
"peerDependencies": {
|
|
26
|
+
"react": ">=18.3 <20",
|
|
27
|
+
"react-dom": ">=18.3 <20"
|
|
28
|
+
},
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"@types/node": "^20.17.52",
|
|
31
|
+
"@types/react": "^18.3.23",
|
|
32
|
+
"@types/react-dom": "^18.3.7",
|
|
33
|
+
"@vitejs/plugin-react": "^4.5.0",
|
|
34
|
+
"cross-env": "^7.0.3",
|
|
35
|
+
"react": "^18.3.1",
|
|
36
|
+
"react-dom": "^18.3.1",
|
|
37
|
+
"tsconfig-paths": "^4.2.0",
|
|
38
|
+
"typescript": "^5.8.3",
|
|
39
|
+
"vite": "^5.4.19",
|
|
40
|
+
"vite-plugin-dts": "^3.9.1"
|
|
41
|
+
}
|
|
42
|
+
}
|