@wrnrlr/prelude 0.2.18 → 0.2.19

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.
@@ -15,7 +15,7 @@ jobs:
15
15
  deno-version: v2.x
16
16
  - run: deno install
17
17
  # - run: deno lint
18
- - run: deno task test --no-check
18
+ - run: deno task test
19
19
 
20
20
  # Moving artifacts, website and docs into their own project...
21
21
  # - name: Setup Pages
package/deno.jsonc CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wrnrlr/prelude",
3
- "version": "0.2.18",
3
+ "version": "0.2.19",
4
4
  "exports": {
5
5
  ".": "./src/mod.ts",
6
6
  "./style.css": "./src/style.css"
package/example/style.css CHANGED
@@ -1,10 +1,8 @@
1
- @import('./reset.css')
1
+ @import url("./reset.css");
2
2
 
3
3
  .select {}
4
4
 
5
5
  .option {
6
- cursor: pointer;
7
- background-color: var(--bg, white);
8
6
  }
9
7
 
10
8
  .multiselect {}
@@ -95,12 +95,12 @@ import { h, signal, memo, render, Select } from "../src/mod.ts"
95
95
  function SelectCar() {
96
96
  const cars = { 'Audi': ['A1','A6'], 'BMW': ['B5', 'BX'] }
97
97
  const companies = Object.keys(cars)
98
- const company = signal()
98
+ const company = signal('Audi')
99
99
  const model = signal('')
100
100
  const models = memo(() => cars[company()] || null)
101
101
  return [
102
- '', h(Select, {options:companies, value:()=>company}),
103
- '', h(Select, {options:models, value:()=>model})
102
+ h('label', ['Brand', h(Select, {options:companies, value:()=>company})]),
103
+ h('label', ['Model', h(Select, {options:models, value:()=>model})])
104
104
  ]
105
105
  }
106
106
 
@@ -109,4 +109,25 @@ render(SelectCar, document.getElementById('select_car'))
109
109
 
110
110
  <style>
111
111
 
112
+ label {
113
+ display: inline flex;
114
+ flex-direction: row;
115
+ }
116
+
117
+ .select {
118
+ display: block;
119
+ position: relative;
120
+ & > button {
121
+ background-color: var(--neutral-200);
122
+ }
123
+ & > .options {
124
+ cursor: pointer;
125
+ position: absolute;
126
+ border: 1px solid black;
127
+ z-index: 10;
128
+ white-space: nowrap;
129
+ > * {}
130
+ }
131
+ }
132
+
112
133
  </style>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@wrnrlr/prelude",
3
3
  "type": "module",
4
- "version": "0.2.18",
4
+ "version": "0.2.19",
5
5
  "author": "Werner Laurensse",
6
6
  "description": "A signal based frontend library with fine-grained reactivity",
7
7
  "main": "./src/mod.ts",
package/src/form.js CHANGED
@@ -57,7 +57,7 @@ export function Select(props) {
57
57
  h('button', {onClick:e=>show(s=>!s)}, h(Show, {when:()=>props.value, fallback}, ()=>props.value() || nbsp)),
58
58
  h(Show, {when: show}, h('.options', {style:'position:absolute'}, h(List, {each:()=>selected().options},
59
59
  (option) => h('.option', {
60
- onClick: (_) => { props.value(option()); show(false) },
60
+ onClick: (e) => { e.preventDefault(); props.value(option()); show(false) },
61
61
  style: 'cursor: pointer'
62
62
  }, option)
63
63
  )))
@@ -1,17 +0,0 @@
1
- import { defineConfig } from 'vite'
2
- import path from 'node:path'
3
-
4
- export default defineConfig({
5
- root: path.resolve(__dirname),
6
- plugins: [],
7
- resolve: {
8
- alias: {
9
- '@src': path.resolve(__dirname, '../src')
10
- },
11
- },
12
- server: {
13
- fs: {
14
- allow: ['..'] // Allow Vite to access parent directories
15
- }
16
- }
17
- })