zikofy 0.0.0 → 0.2.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.
@@ -0,0 +1,18 @@
1
+ {
2
+ "name": "solidjs",
3
+ "private": true,
4
+ "version": "0.0.0",
5
+ "type": "module",
6
+ "scripts": {
7
+ "dev": "vite",
8
+ "build": "vite build",
9
+ "preview": "vite preview"
10
+ },
11
+ "dependencies": {
12
+ "solid-js": "^1.9.10"
13
+ },
14
+ "devDependencies": {
15
+ "vite": "^7.2.4",
16
+ "vite-plugin-solid": "^2.11.10"
17
+ }
18
+ }
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
@@ -0,0 +1,27 @@
1
+ #root {
2
+ max-width: 1280px;
3
+ margin: 0 auto;
4
+ padding: 2rem;
5
+ text-align: center;
6
+ }
7
+
8
+ .logo {
9
+ height: 6em;
10
+ padding: 1.5em;
11
+ will-change: filter;
12
+ transition: filter 300ms;
13
+ }
14
+ .logo:hover {
15
+ filter: drop-shadow(0 0 2em #646cffaa);
16
+ }
17
+ .logo.solid:hover {
18
+ filter: drop-shadow(0 0 2em #61dafbaa);
19
+ }
20
+
21
+ .card {
22
+ padding: 2em;
23
+ }
24
+
25
+ .read-the-docs {
26
+ color: #888;
27
+ }
@@ -0,0 +1,35 @@
1
+ import { createSignal } from 'solid-js'
2
+ import solidLogo from './assets/solid.svg'
3
+ import viteLogo from '/vite.svg'
4
+ import './App.css'
5
+
6
+ function App() {
7
+ const [count, setCount] = createSignal(0)
8
+
9
+ return (
10
+ <>
11
+ <div>
12
+ <a href="https://vite.dev" target="_blank">
13
+ <img src={viteLogo} class="logo" alt="Vite logo" />
14
+ </a>
15
+ <a href="https://solidjs.com" target="_blank">
16
+ <img src={solidLogo} class="logo solid" alt="Solid logo" />
17
+ </a>
18
+ </div>
19
+ <h1>Vite + Solid</h1>
20
+ <div class="card">
21
+ <button onClick={() => setCount((count) => count + 1)}>
22
+ count is {count()}
23
+ </button>
24
+ <p>
25
+ Edit <code>src/App.jsx</code> and save to test HMR
26
+ </p>
27
+ </div>
28
+ <p class="read-the-docs">
29
+ Click on the Vite and Solid logos to learn more
30
+ </p>
31
+ </>
32
+ )
33
+ }
34
+
35
+ export default App
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 166 155.3"><path d="M163 35S110-4 69 5l-3 1c-6 2-11 5-14 9l-2 3-15 26 26 5c11 7 25 10 38 7l46 9 18-30z" fill="#76b3e1"/><linearGradient id="a" gradientUnits="userSpaceOnUse" x1="27.5" y1="3" x2="152" y2="63.5"><stop offset=".1" stop-color="#76b3e1"/><stop offset=".3" stop-color="#dcf2fd"/><stop offset="1" stop-color="#76b3e1"/></linearGradient><path d="M163 35S110-4 69 5l-3 1c-6 2-11 5-14 9l-2 3-15 26 26 5c11 7 25 10 38 7l46 9 18-30z" opacity=".3" fill="url(#a)"/><path d="M52 35l-4 1c-17 5-22 21-13 35 10 13 31 20 48 15l62-21S92 26 52 35z" fill="#518ac8"/><linearGradient id="b" gradientUnits="userSpaceOnUse" x1="95.8" y1="32.6" x2="74" y2="105.2"><stop offset="0" stop-color="#76b3e1"/><stop offset=".5" stop-color="#4377bb"/><stop offset="1" stop-color="#1f3b77"/></linearGradient><path d="M52 35l-4 1c-17 5-22 21-13 35 10 13 31 20 48 15l62-21S92 26 52 35z" opacity=".3" fill="url(#b)"/><linearGradient id="c" gradientUnits="userSpaceOnUse" x1="18.4" y1="64.2" x2="144.3" y2="149.8"><stop offset="0" stop-color="#315aa9"/><stop offset=".5" stop-color="#518ac8"/><stop offset="1" stop-color="#315aa9"/></linearGradient><path d="M134 80a45 45 0 00-48-15L24 85 4 120l112 19 20-36c4-7 3-15-2-23z" fill="url(#c)"/><linearGradient id="d" gradientUnits="userSpaceOnUse" x1="75.2" y1="74.5" x2="24.4" y2="260.8"><stop offset="0" stop-color="#4377bb"/><stop offset=".5" stop-color="#1a336b"/><stop offset="1" stop-color="#1a336b"/></linearGradient><path d="M114 115a45 45 0 00-48-15L4 120s53 40 94 30l3-1c17-5 23-21 13-34z" fill="url(#d)"/></svg>
@@ -0,0 +1,68 @@
1
+ :root {
2
+ font-family: system-ui, Avenir, Helvetica, Arial, sans-serif;
3
+ line-height: 1.5;
4
+ font-weight: 400;
5
+
6
+ color-scheme: light dark;
7
+ color: rgba(255, 255, 255, 0.87);
8
+ background-color: #242424;
9
+
10
+ font-synthesis: none;
11
+ text-rendering: optimizeLegibility;
12
+ -webkit-font-smoothing: antialiased;
13
+ -moz-osx-font-smoothing: grayscale;
14
+ }
15
+
16
+ a {
17
+ font-weight: 500;
18
+ color: #646cff;
19
+ text-decoration: inherit;
20
+ }
21
+ a:hover {
22
+ color: #535bf2;
23
+ }
24
+
25
+ body {
26
+ margin: 0;
27
+ display: flex;
28
+ place-items: center;
29
+ min-width: 320px;
30
+ min-height: 100vh;
31
+ }
32
+
33
+ h1 {
34
+ font-size: 3.2em;
35
+ line-height: 1.1;
36
+ }
37
+
38
+ button {
39
+ border-radius: 8px;
40
+ border: 1px solid transparent;
41
+ padding: 0.6em 1.2em;
42
+ font-size: 1em;
43
+ font-weight: 500;
44
+ font-family: inherit;
45
+ background-color: #1a1a1a;
46
+ cursor: pointer;
47
+ transition: border-color 0.25s;
48
+ }
49
+ button:hover {
50
+ border-color: #646cff;
51
+ }
52
+ button:focus,
53
+ button:focus-visible {
54
+ outline: 4px auto -webkit-focus-ring-color;
55
+ }
56
+
57
+ @media (prefers-color-scheme: light) {
58
+ :root {
59
+ color: #213547;
60
+ background-color: #ffffff;
61
+ }
62
+ a:hover {
63
+ color: #747bff;
64
+ }
65
+ button {
66
+ background-color: #f9f9f9;
67
+ }
68
+ }
@@ -0,0 +1,11 @@
1
+ /* @refresh reload */
2
+ import { render } from 'solid-js/web'
3
+ import './index.css'
4
+ import App from './App.jsx'
5
+ import { domify, zikofy } from 'zikofy/solid'
6
+
7
+ globalThis.app = zikofy(App)
8
+
9
+ const root = document.getElementById('root')
10
+ globalThis.root = root
11
+ // render(() => <App />, root)
@@ -0,0 +1,6 @@
1
+ import { defineConfig } from 'vite'
2
+ import solid from 'vite-plugin-solid'
3
+
4
+ export default defineConfig({
5
+ plugins: [solid()],
6
+ })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zikofy",
3
- "version": "0.0.0",
3
+ "version": "0.2.0",
4
4
  "description": "",
5
5
  "exports" : {
6
6
  "./*" : {
@@ -10,7 +10,10 @@
10
10
  },
11
11
  "keywords": [
12
12
  "ziko",
13
- "zikojs"
13
+ "zikojs",
14
+ "react",
15
+ "preact",
16
+ "solid"
14
17
  ],
15
18
  "homepage": "https://github.com/zakarialaoui10/zikofy#readme",
16
19
  "bugs": {
@@ -0,0 +1,11 @@
1
+ import { render, h } from 'preact';
2
+
3
+ export function domify(Component, props) {
4
+ const container = document.createElement('div')
5
+ render(
6
+ h(Component, props),
7
+ container
8
+ )
9
+ if(container.children.length === 1) return container.firstChild;
10
+ return [...container.children];
11
+ }
@@ -0,0 +1,12 @@
1
+ import { ComponentType, JSX } from 'preact';
2
+
3
+ export declare function domify<P = {}>(
4
+ Component: ComponentType<P> | JSX.Element,
5
+ props?: P
6
+ ): HTMLElement | null;
7
+
8
+ export declare function zikofy<P = {}>(
9
+ Component: ComponentType<P> | JSX.Element,
10
+ props?: P
11
+ ): UIElement;
12
+
@@ -0,0 +1,2 @@
1
+ export * from './domify.js';
2
+ export * from './zikofy.js';
@@ -0,0 +1,10 @@
1
+ import { UIElement } from 'ziko/ui';
2
+ import { domify } from './domify.js';
3
+
4
+ export function zikofy(Component, props) {
5
+ const DOMIFIED = domify(Component, props)
6
+ return Array.isArray(DOMIFIED)
7
+ ? DOMIFIED.map( el => new UIElement({ element : el }))
8
+ : new UIElement({ element : DOMIFIED })
9
+ }
10
+
@@ -1,7 +1,10 @@
1
- import { UIElement } from "ziko/ui";
2
- import { domify } from "./domify.js"
1
+ import { UIElement } from 'ziko/ui';
2
+ import { domify } from './domify.js';
3
+
4
+ export function zikofy(Component, props) {
5
+ const DOMIFIED = domify(Component, props)
6
+ return Array.isArray(DOMIFIED)
7
+ ? DOMIFIED.map( el => new UIElement({ element : el }))
8
+ : new UIElement({ element : DOMIFIED })
9
+ }
3
10
 
4
- export const zikofy = (Component, props = {}) => {
5
- const el = domify(Component, props)
6
- return new UIElement({ element : el})
7
- };
@@ -0,0 +1,16 @@
1
+ import { render } from "solid-js/web";
2
+
3
+ export function domify(Component, props = {}) {
4
+ const container = document.createElement("div");
5
+
6
+ render(() => {
7
+ if (typeof Component === "function") {
8
+ return Component(props);
9
+ }
10
+ return Component;
11
+ }, container);
12
+
13
+ if(container.children.length === 1) return container.firstChild;
14
+ return [...container.children];
15
+
16
+ }
@@ -0,0 +1,12 @@
1
+ import { JSX } from "solid-js";
2
+ import { UIElement } from "ziko/ui";
3
+
4
+ export declare function domify<P = {}>(
5
+ Component: ((props: P) => JSX.Element) | JSX.Element,
6
+ props?: P
7
+ ): HTMLElement | null;
8
+
9
+ export declare function zikofy<P = {}>(
10
+ Component: ((props: P) => JSX.Element) | JSX.Element,
11
+ props?: P
12
+ ): UIElement;
@@ -0,0 +1,2 @@
1
+ export * from './domify.js';
2
+ export * from './zikofy.js';
@@ -0,0 +1,10 @@
1
+ import { UIElement } from 'ziko/ui';
2
+ import { domify } from './domify.js';
3
+
4
+ export function zikofy(Component, props) {
5
+ const DOMIFIED = domify(Component, props)
6
+ return Array.isArray(DOMIFIED)
7
+ ? DOMIFIED.map( el => new UIElement({ element : el }))
8
+ : new UIElement({ element : DOMIFIED })
9
+ }
10
+