@yannosay/sinth 0.0.4

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.
@@ -0,0 +1,3 @@
1
+ *, *::before, *::after { box-sizing: border-box; }
2
+ body { margin: 0; font-family: system-ui, sans-serif; line-height: 1.6; }
3
+ img { max-width: 100%; display: block; }
@@ -0,0 +1,21 @@
1
+ -- Card component
2
+
3
+ component Card(title, color = "blue") {
4
+ Div(class: "card") {
5
+ Heading(level: 2) { "$title" }
6
+ Div(class: "card-body") { "$slot" }
7
+ }
8
+
9
+ style {
10
+ .card {
11
+ backgroundColor: "#f7f7f7"
12
+ borderRadius: "1rem"
13
+ padding: "1.5rem"
14
+ textAlign: "center"
15
+ marginBottom: "1rem"
16
+ }
17
+ .card-body {
18
+ marginTop: "0.75rem"
19
+ }
20
+ }
21
+ }
@@ -0,0 +1,38 @@
1
+ -- Navbar component
2
+
3
+ component Navbar {
4
+ Header {
5
+ Nav {
6
+ Link(href: "/", class: "logo") { "MySite" }
7
+ Div(class: "nav-links") {
8
+ NavLink(href: "/") { "Home" }
9
+ NavLink(href: "/about") { "About" }
10
+ }
11
+ }
12
+ }
13
+
14
+ style {
15
+ Header {
16
+ display: "flex"
17
+ alignItems: "center"
18
+ padding: "1rem 2rem"
19
+ backgroundColor: "#1a1a2e"
20
+ color: "white"
21
+ }
22
+ .logo {
23
+ fontSize: "1.5rem"
24
+ fontWeight: "700"
25
+ color: "white"
26
+ textDecoration: "none"
27
+ }
28
+ .nav-links {
29
+ marginLeft: "auto"
30
+ display: "flex"
31
+ gap: "1.5rem"
32
+ }
33
+ .nav-links a {
34
+ color: "rgba(255,255,255,0.8)"
35
+ textDecoration: "none"
36
+ }
37
+ }
38
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "my-sinth-site",
3
+ "version": "1.0.0",
4
+ "scripts": {
5
+ "build": "npx ts-node sinth.ts build",
6
+ "dev": "npx ts-node sinth.ts dev"
7
+ },
8
+ "devDependencies": {
9
+ "ts-node": "^10.0.0",
10
+ "typescript": "^5.0.0",
11
+ "sass": "^1.70.0"
12
+ }
13
+ }
@@ -0,0 +1,46 @@
1
+ -- My Sinth Site
2
+
3
+ page
4
+
5
+ import "../components/Navbar.sinth"
6
+ import css "../styles/reset.css"
7
+
8
+ title = "My Site"
9
+ fav = "assets/favicon.ico"
10
+ descr = "Built with Sinth."
11
+
12
+ Navbar
13
+
14
+ Hero {
15
+ Heading(level: 1) { "Welcome to Sinth" }
16
+ Paragraph { "A declarative, component-based web UI language." }
17
+ Button(onClick: "handleCTA") { "Get Started" }
18
+ }
19
+
20
+ Main {
21
+ Section {
22
+ Heading(level: 2) { "Features" }
23
+ CardGrid {
24
+ -- Add cards here
25
+ }
26
+ }
27
+ }
28
+
29
+ style {
30
+ Hero {
31
+ padding: "4rem 2rem"
32
+ textAlign: "center"
33
+ backgroundColor: "#f0f4ff"
34
+ }
35
+ Main {
36
+ maxWidth: "1100px"
37
+ margin: "0 auto"
38
+ padding: "2rem"
39
+ }
40
+ }
41
+
42
+ script {
43
+ function handleCTA() {
44
+ alert("Hello from Sinth!")
45
+ }
46
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "outDir": "./dist",
3
+ "libraryPaths": [
4
+ "./libraries"
5
+ ],
6
+ "minify": false
7
+ }
@@ -0,0 +1,3 @@
1
+ *, *::before, *::after { box-sizing: border-box; }
2
+ body { margin: 0; font-family: system-ui, sans-serif; line-height: 1.6; }
3
+ img { max-width: 100%; display: block; }
package/tsconfig.json ADDED
@@ -0,0 +1,23 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2020",
4
+ "module": "commonjs",
5
+ "lib": ["ES2020"],
6
+ "outDir": "./dist",
7
+ "rootDir": "./src",
8
+ "strict": false,
9
+ "esModuleInterop": true,
10
+ "skipLibCheck": true,
11
+ "noImplicitAny": false,
12
+ "strictNullChecks": false,
13
+ "types": ["node"],
14
+ "typeRoots": ["./node_modules/@types", "../node_modules/@types"]
15
+ },
16
+ "include": ["src/**/*"],
17
+ "exclude": ["node_modules", "dist"],
18
+ "ts-node": {
19
+ "compilerOptions": {
20
+ "module": "commonjs"
21
+ }
22
+ }
23
+ }