@e280/shiny 0.1.0-17 → 0.1.0-18

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@e280/shiny",
3
- "version": "0.1.0-17",
3
+ "version": "0.1.0-18",
4
4
  "description": "✨ web ui library",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -13,6 +13,7 @@ export default css`@layer view {
13
13
  flex-direction: column;
14
14
  background: #0003;
15
15
  border-radius: var(--rounded);
16
+ backdrop-filter: blur(0.5em);
16
17
  }
17
18
 
18
19
  header {
@@ -35,8 +36,9 @@ header {
35
36
  code {
36
37
  padding: calc(var(--padding) / 4) var(--padding);
37
38
  color: var(--code);
38
- white-space: pre-wrap;
39
+ white-space: pre;
39
40
  tab-size: 2;
41
+ overflow-x: auto;
40
42
  }
41
43
 
42
44
  }`
@@ -4,19 +4,15 @@ export default css`@layer view {
4
4
 
5
5
  section.showcase {
6
6
  position: relative;
7
-
8
7
  display: flex;
9
8
  flex-direction: column;
10
-
11
9
  padding: 1em;
12
- border-radius: var(--rounded);
13
10
  gap: var(--padding);
14
11
 
15
12
  background: linear-gradient(to right top, #252dd985, #aa6affbd);
16
- backdrop-filter: blur(0.5em);
17
-
18
13
  box-shadow: 0 0 5em #5d1fadaa;
19
14
  border-top: 2px solid #fff4;
15
+ border-radius: var(--rounded);
20
16
 
21
17
  &::before {
22
18
  z-index: 0;
@@ -56,8 +52,8 @@ header {
56
52
 
57
53
  > * {
58
54
  flex: 1 1 0;
55
+ min-width: 0;
59
56
  }
60
-
61
57
  }
62
58
 
63
59
  .codezone {
@@ -7,6 +7,7 @@ import {themeCss} from "../../theme/theme.css.js"
7
7
 
8
8
  export const ShinyButton = shadow((content?: Content, options: {
9
9
  vibe?: "calm" | "lame" | "happy" | "sad" | "angry" | "zesty" | "quirky"
10
+ onClick?: (event: PointerEvent) => void
10
11
  } = {}) => {
11
12
 
12
13
  useName("shiny-button")
@@ -22,7 +23,8 @@ export const ShinyButton = shadow((content?: Content, options: {
22
23
  part=button
23
24
  data-vibe="${options.vibe ?? "calm"}"
24
25
  ?disabled="${attrs.disabled}"
25
- ?hidden="${attrs.hidden}">
26
+ ?hidden="${attrs.hidden}"
27
+ @click="${options.onClick}">
26
28
  <slot>${content}</slot>
27
29
  </button>
28
30
  `
@@ -22,7 +22,7 @@ export const tabsShowcase = () => Showcase("ShinyTabs", [
22
22
  `,
23
23
  }),
24
24
  styleboxCss: css`
25
- [view="shiny-button"] { font-size: 1.5em; }
25
+ [view="shiny-button"] { font-size: 1.2em; }
26
26
  p { margin-top: var(--padding); }
27
27
  `,
28
28
  js: `
@@ -139,19 +139,15 @@ ${es}
139
139
 
140
140
  section.showcase {
141
141
  position: relative;
142
-
143
142
  display: flex;
144
143
  flex-direction: column;
145
-
146
144
  padding: 1em;
147
- border-radius: var(--rounded);
148
145
  gap: var(--padding);
149
146
 
150
147
  background: linear-gradient(to right top, #252dd985, #aa6affbd);
151
- backdrop-filter: blur(0.5em);
152
-
153
148
  box-shadow: 0 0 5em #5d1fadaa;
154
149
  border-top: 2px solid #fff4;
150
+ border-radius: var(--rounded);
155
151
 
156
152
  &::before {
157
153
  z-index: 0;
@@ -191,8 +187,8 @@ header {
191
187
 
192
188
  > * {
193
189
  flex: 1 1 0;
190
+ min-width: 0;
194
191
  }
195
-
196
192
  }
197
193
 
198
194
  .codezone {
@@ -228,6 +224,7 @@ header {
228
224
  flex-direction: column;
229
225
  background: #0003;
230
226
  border-radius: var(--rounded);
227
+ backdrop-filter: blur(0.5em);
231
228
  }
232
229
 
233
230
  header {
@@ -250,8 +247,9 @@ header {
250
247
  code {
251
248
  padding: calc(var(--padding) / 4) var(--padding);
252
249
  color: var(--code);
253
- white-space: pre-wrap;
250
+ white-space: pre;
254
251
  tab-size: 2;
252
+ overflow-x: auto;
255
253
  }
256
254
 
257
255
  }`;function ls(){return F(()=>{let r=document.head.querySelector("[data-prism]");if(!r)throw new Error("failed to find [data-prism] stylesheet");let t=new CSSStyleSheet;return t.replaceSync(r.textContent),t})}var ee=class extends zt{constructor(t){if(super(t),this.it=R,t.type!==Le.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===R||t==null)return this._t=void 0,this.it=t;if(t===rt)return t;if(typeof t!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;let e=[t];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}};ee.directiveName="unsafeHTML",ee.resultType=1;var cs=Pt(ee);var dr=j((r,t,e)=>{let s=ls();I(N,s,as),e=qr(e).trim();let o=Ue.default.highlight(e,t==="js"?Ue.default.languages.javascript:Ue.default.languages.css,t);return C`
@@ -423,7 +421,8 @@ button {
423
421
  part=button
424
422
  data-vibe="${t.vibe??"calm"}"
425
423
  ?disabled="${e.disabled}"
426
- ?hidden="${e.hidden}">
424
+ ?hidden="${e.hidden}"
425
+ @click="${t.onClick}">
427
426
  <slot>${r}</slot>
428
427
  </button>
429
428
  `});var ht=j((r,t)=>{D("showcase"),I(N,ns);let e=F(()=>new Dt),s=t.at(e.index);return C`
@@ -486,7 +485,7 @@ button {
486
485
  <p slot=panel>${V.takeFirst()}</p>
487
486
  <p slot=panel>${V.takeFirst()}</p>
488
487
  `}),styleboxCss:S`
489
- [view="shiny-button"] { font-size: 1.5em; }
488
+ [view="shiny-button"] { font-size: 1.2em; }
490
489
  p { margin-top: var(--padding); }
491
490
  `,js:`
492
491
  ShinyTabs.with({