@takumi-rs/template 0.29.3
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 +20 -0
- package/dist/docs-template-v1.cjs +1 -0
- package/dist/docs-template-v1.d.cts +13 -0
- package/dist/docs-template-v1.d.ts +13 -0
- package/dist/docs-template-v1.js +1 -0
- package/package.json +38 -0
- package/tsconfig.json +29 -0
package/README.md
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# @takumi-rs/template
|
|
2
|
+
|
|
3
|
+
Template library for Takumi, it provides some pre-defined templates primarily for Takumi, but it could also be used in other libraries like satori.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import DocsTemplateV1 from "@takumi-rs/template/docs-template-v1";
|
|
9
|
+
import { fromJsx } from "@takumi-rs/helpers/jsx";
|
|
10
|
+
import { Renderer } from "@takumi-rs/core";
|
|
11
|
+
|
|
12
|
+
const render = new Renderer();
|
|
13
|
+
|
|
14
|
+
const node = await fromJsx(<DocsTemplateV1 />);
|
|
15
|
+
const buffer = await render.renderAsync(node, {
|
|
16
|
+
width: 1200,
|
|
17
|
+
height: 630,
|
|
18
|
+
format: "webp",
|
|
19
|
+
});
|
|
20
|
+
```
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var a=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var s=(t,e)=>{for(var r in e)a(t,r,{get:e[r],enumerable:!0})},f=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of d(e))!g.call(t,o)&&o!==r&&a(t,o,{get:()=>e[o],enumerable:!(n=p(e,o))||n.enumerable});return t};var y=t=>f(a({},"__esModule",{value:!0}),t);var m={};s(m,{default:()=>l});module.exports=y(m);var i=require("react/jsx-runtime");function l({title:t,description:e,icon:r,primaryColor:n,primaryTextColor:o,site:c}){return(0,i.jsxs)("div",{style:{display:"flex",flexDirection:"column",width:"100%",height:"100%",color:"white",padding:"4rem",backgroundColor:"#0c0c0c",backgroundImage:`linear-gradient(to top right, ${n}, transparent), noise-v1(opacity(0.3) frequency(1.0) octaves(4))`},children:[(0,i.jsxs)("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"16px",marginBottom:"12px",color:o},children:[r,(0,i.jsx)("p",{style:{fontSize:56,fontWeight:600},children:c})]}),(0,i.jsx)("p",{style:{fontWeight:800,fontSize:84},children:t}),(0,i.jsx)("p",{style:{fontSize:48,color:"rgba(240,240,240,0.8)",fontWeight:500,lineClamp:2},children:e})]})}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
declare function DocsTemplateV1({ title, description, icon, primaryColor, primaryTextColor, site, }: {
|
|
5
|
+
title: ReactNode;
|
|
6
|
+
description: ReactNode;
|
|
7
|
+
icon: ReactNode;
|
|
8
|
+
primaryColor: string;
|
|
9
|
+
primaryTextColor: string;
|
|
10
|
+
site: ReactNode;
|
|
11
|
+
}): react_jsx_runtime.JSX.Element;
|
|
12
|
+
|
|
13
|
+
export { DocsTemplateV1 as default };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
declare function DocsTemplateV1({ title, description, icon, primaryColor, primaryTextColor, site, }: {
|
|
5
|
+
title: ReactNode;
|
|
6
|
+
description: ReactNode;
|
|
7
|
+
icon: ReactNode;
|
|
8
|
+
primaryColor: string;
|
|
9
|
+
primaryTextColor: string;
|
|
10
|
+
site: ReactNode;
|
|
11
|
+
}): react_jsx_runtime.JSX.Element;
|
|
12
|
+
|
|
13
|
+
export { DocsTemplateV1 as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e,jsxs as t}from"react/jsx-runtime";function c({title:o,description:i,icon:r,primaryColor:n,primaryTextColor:a,site:l}){return t("div",{style:{display:"flex",flexDirection:"column",width:"100%",height:"100%",color:"white",padding:"4rem",backgroundColor:"#0c0c0c",backgroundImage:`linear-gradient(to top right, ${n}, transparent), noise-v1(opacity(0.3) frequency(1.0) octaves(4))`},children:[t("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"16px",marginBottom:"12px",color:a},children:[r,e("p",{style:{fontSize:56,fontWeight:600},children:l})]}),e("p",{style:{fontWeight:800,fontSize:84},children:o}),e("p",{style:{fontSize:48,color:"rgba(240,240,240,0.8)",fontWeight:500,lineClamp:2},children:i})]})}export{c as default};
|
package/package.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@takumi-rs/template",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "0.29.3",
|
|
5
|
+
"author": {
|
|
6
|
+
"email": "me@kane.tw",
|
|
7
|
+
"name": "Kane Wang",
|
|
8
|
+
"url": "https://kane.tw"
|
|
9
|
+
},
|
|
10
|
+
"repository": {
|
|
11
|
+
"url": "git+https://github.com/kane50613/takumi.git"
|
|
12
|
+
},
|
|
13
|
+
"devDependencies": {
|
|
14
|
+
"@takumi-rs/core": "workspace:*",
|
|
15
|
+
"@takumi-rs/helpers": "workspace:*",
|
|
16
|
+
"@types/bun": "catalog:",
|
|
17
|
+
"react": "^19.1.1",
|
|
18
|
+
"react-dom": "^19.1.1",
|
|
19
|
+
"typescript": "catalog:"
|
|
20
|
+
},
|
|
21
|
+
"scripts": {
|
|
22
|
+
"build": "tsup-node src/templates/*.tsx --minify --dts --format esm,cjs --no-splitting"
|
|
23
|
+
},
|
|
24
|
+
"files": [
|
|
25
|
+
"dist",
|
|
26
|
+
"package.json",
|
|
27
|
+
"README.md",
|
|
28
|
+
"tsconfig.json"
|
|
29
|
+
],
|
|
30
|
+
"exports": {
|
|
31
|
+
"./*": {
|
|
32
|
+
"types": "./dist/*.d.ts",
|
|
33
|
+
"import": "./dist/*.js",
|
|
34
|
+
"require": "./dist/*.cjs",
|
|
35
|
+
"default": "./dist/*.js"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
// Environment setup & latest features
|
|
4
|
+
"lib": ["ESNext"],
|
|
5
|
+
"target": "ESNext",
|
|
6
|
+
"module": "Preserve",
|
|
7
|
+
"moduleDetection": "force",
|
|
8
|
+
"jsx": "react-jsx",
|
|
9
|
+
"allowJs": true,
|
|
10
|
+
|
|
11
|
+
// Bundler mode
|
|
12
|
+
"moduleResolution": "bundler",
|
|
13
|
+
"allowImportingTsExtensions": true,
|
|
14
|
+
"verbatimModuleSyntax": true,
|
|
15
|
+
"noEmit": true,
|
|
16
|
+
|
|
17
|
+
// Best practices
|
|
18
|
+
"strict": true,
|
|
19
|
+
"skipLibCheck": true,
|
|
20
|
+
"noFallthroughCasesInSwitch": true,
|
|
21
|
+
"noUncheckedIndexedAccess": true,
|
|
22
|
+
"noImplicitOverride": true,
|
|
23
|
+
|
|
24
|
+
// Some stricter flags (disabled by default)
|
|
25
|
+
"noUnusedLocals": false,
|
|
26
|
+
"noUnusedParameters": false,
|
|
27
|
+
"noPropertyAccessFromIndexSignature": false
|
|
28
|
+
}
|
|
29
|
+
}
|