@wrnrlr/prelude 0.2.19 → 0.2.20

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/deno.jsonc CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wrnrlr/prelude",
3
- "version": "0.2.19",
3
+ "version": "0.2.20",
4
4
  "exports": {
5
5
  ".": "./src/mod.ts",
6
6
  "./style.css": "./src/style.css"
@@ -126,7 +126,9 @@ label {
126
126
  border: 1px solid black;
127
127
  z-index: 10;
128
128
  white-space: nowrap;
129
- > * {}
129
+ & > .selected {
130
+ background-color: var(--yellow-200);
131
+ }
130
132
  }
131
133
  }
132
134
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@wrnrlr/prelude",
3
3
  "type": "module",
4
- "version": "0.2.19",
4
+ "version": "0.2.20",
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
@@ -54,10 +54,12 @@ export function Select(props) {
54
54
  })
55
55
  const fallback = props.placeholder ? h('span', props.placeholder) : 'nbsp'
56
56
  return h('.select', [
57
- h('button', {onClick:e=>show(s=>!s)}, h(Show, {when:()=>props.value, fallback}, ()=>props.value() || nbsp)),
57
+ h('button', {onClick:e=>show(s=>!s)},
58
+ h(Show, {when:()=>props.value, fallback}, ()=>props.value() || nbsp)),
58
59
  h(Show, {when: show}, h('.options', {style:'position:absolute'}, h(List, {each:()=>selected().options},
59
60
  (option) => h('.option', {
60
61
  onClick: (e) => { e.preventDefault(); props.value(option()); show(false) },
62
+ class: () => props.value()===option() ? 'selected' : '',
61
63
  style: 'cursor: pointer'
62
64
  }, option)
63
65
  )))