@e280/shiny 0.1.0-4 → 0.1.0-5

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/x/index.html CHANGED
@@ -128,7 +128,7 @@ body > section {
128
128
  }
129
129
 
130
130
  </style>
131
- <script type=module src="demo/demo.bundle.min.js?v=e660a693aefe"></script>
131
+ <script type=module src="demo/demo.bundle.min.js?v=efa1e1272af5"></script>
132
132
  <link rel="icon" href="assets/favicon.png?v=0414eeb5fcc2"/>
133
133
 
134
134
  <meta name="theme-color" content="#d068ff">
@@ -145,7 +145,7 @@ body > section {
145
145
 
146
146
  <h1>
147
147
  <strong>✨shiny✨</strong>
148
- <small>v0.1.0-4</small>
148
+ <small>v0.1.0-5</small>
149
149
  </h1>
150
150
 
151
151
  <section>
@@ -0,0 +1,5 @@
1
+ import { dom } from "@e280/sly";
2
+ import { shiny } from "../shiny.js";
3
+ import { basic } from "../themes/basic.css.js";
4
+ dom.register(shiny({ theme: basic }).components);
5
+ //# sourceMappingURL=basic.bundle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"basic.bundle.js","sourceRoot":"","sources":["../../s/install/basic.bundle.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,GAAG,EAAC,MAAM,WAAW,CAAA;AAC7B,OAAO,EAAC,KAAK,EAAC,MAAM,aAAa,CAAA;AACjC,OAAO,EAAC,KAAK,EAAC,MAAM,wBAAwB,CAAA;AAE5C,GAAG,CAAC,QAAQ,CACX,KAAK,CAAC,EAAC,KAAK,EAAE,KAAK,EAAC,CAAC,CAAC,UAAU,CAChC,CAAA"}
@@ -175,6 +175,17 @@ ${q}
175
175
  }
176
176
  }
177
177
 
178
+ &[data-side="right"] {
179
+ [part="tray"] {
180
+ right: 0;
181
+ transform: translateX(100%);
182
+ > button {
183
+ left: unset;
184
+ right: 100%;
185
+ }
186
+ }
187
+ }
188
+
178
189
  slot[name="plate"] {
179
190
  display: block;
180
191
  width: 100%;
@@ -192,19 +203,19 @@ ${q}
192
203
  }
193
204
  }
194
205
 
195
- `;var Xe=_`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-x"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 6l-12 12" /><path d="M6 6l12 12" /></svg>`;var Ye=_`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-menu-2"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M4 6l16 0" /><path d="M4 12l16 0" /><path d="M4 18l16 0" /></svg>`;var Wt=class extends v(t=>(e,s={})=>{t.name("shiny-drawer"),t.styles(e.theme,Fe);let o=s.button??!0,i=t.once(()=>s.drawer??new dt);return t.mount(()=>u.events(window,{keydown:n=>{n.code==="Escape"&&i.close()}})),u.attrs(t.element).booleans.open=i.isOpen,x`
196
- <div class=shell ?data-open="${i.isOpen}">
197
- <slot name=plate ?inert="${i.isOpen}"></slot>
206
+ `;var Xe=_`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-x"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 6l-12 12" /><path d="M6 6l12 12" /></svg>`;var Ye=_`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-menu-2"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M4 6l16 0" /><path d="M4 12l16 0" /><path d="M4 18l16 0" /></svg>`;var Wt=class extends v(t=>(e,s)=>{t.name("shiny-drawer"),t.styles(e.theme,Fe);let o=s.button,i=s.side??"left",n=t.once(()=>s.drawer??new dt);return t.mount(()=>u.events(window,{keydown:c=>{c.code==="Escape"&&n.close()}})),u.attrs(t.element).booleans.open=n.isOpen,x`
207
+ <div class=shell ?data-open="${n.isOpen}" data-side="${i}">
208
+ <slot name=plate ?inert="${n.isOpen}"></slot>
198
209
 
199
210
  <div class=clipper>
200
- <div part=blanket @click="${i.close}" ?inert="${!i.isOpen}"></div>
211
+ <div part=blanket @click="${n.close}" ?inert="${!n.isOpen}"></div>
201
212
 
202
213
  <div part=tray>
203
- <slot ?inert="${!i.isOpen}"></slot>
214
+ <slot ?inert="${!n.isOpen}"></slot>
204
215
 
205
216
  ${o?x`
206
- <button @click="${i.toggle}">
207
- ${i.isOpen?x`
217
+ <button @click="${n.toggle}">
218
+ ${n.isOpen?x`
208
219
  <slot name=button-x>
209
220
  ${Xe}
210
221
  </slot>
@@ -218,7 +229,7 @@ ${q}
218
229
  </div>
219
230
  </div>
220
231
  </div>
221
- `}).component(class extends O{attrs=u.attrs(this).spec({open:Boolean,button:Boolean});drawer=new dt(this.attrs.open);get isOpen(){return this.drawer.isOpen}get toggle(){return this.drawer.toggle}get open(){return this.drawer.open}get close(){return this.drawer.close}}).props(t=>[t.context,{drawer:t.drawer,button:t.attrs.button}]){};var Ze=w`
232
+ `}).component(class extends O{attrs=u.attrs(this).spec({open:Boolean,button:Boolean,side:String});drawer=new dt(this.attrs.open);get isOpen(){return this.drawer.isOpen}get toggle(){return this.drawer.toggle}get open(){return this.drawer.open}get close(){return this.drawer.close}}).props(t=>[t.context,{drawer:t.drawer,button:t.attrs.button,side:t.attrs.side==="right"?"right":"left"}]){};var Ze=w`
222
233
 
223
234
  button {
224
235
  padding: 1em;
@@ -264,4 +275,4 @@ lit-html/directive-helpers.js:
264
275
  * SPDX-License-Identifier: BSD-3-Clause
265
276
  *)
266
277
  */
267
- //# sourceMappingURL=install.bundle.min.js.map
278
+ //# sourceMappingURL=basic.bundle.min.js.map