@iyulab/desktop-patterns 0.1.0 → 0.1.1

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.
Files changed (2) hide show
  1. package/dist/shell.js +27 -18
  2. package/package.json +18 -2
package/dist/shell.js CHANGED
@@ -1,22 +1,22 @@
1
- import { css as c, LitElement as p, nothing as b, html as a } from "lit";
2
- import { property as f, customElement as m } from "lit/decorators.js";
3
- var v = Object.defineProperty, u = Object.getOwnPropertyDescriptor, d = (r, o, t, s) => {
4
- for (var e = s > 1 ? void 0 : s ? u(o, t) : o, l = r.length - 1, n; l >= 0; l--)
5
- (n = r[l]) && (e = (s ? n(o, t, e) : n(e)) || e);
6
- return s && e && v(o, t, e), e;
1
+ import { css as p, LitElement as c, nothing as b, html as l } from "lit";
2
+ import { property as h, customElement as f } from "lit/decorators.js";
3
+ var m = Object.defineProperty, u = Object.getOwnPropertyDescriptor, d = (s, o, t, i) => {
4
+ for (var e = i > 1 ? void 0 : i ? u(o, t) : o, a = s.length - 1, n; a >= 0; a--)
5
+ (n = s[a]) && (e = (i ? n(o, t, e) : n(e)) || e);
6
+ return i && e && m(o, t, e), e;
7
7
  };
8
- class h extends Event {
8
+ class v extends Event {
9
9
  constructor() {
10
10
  super("dp-shell-sidebar-close", { bubbles: !0, composed: !0 });
11
11
  }
12
12
  }
13
- let i = class extends p {
13
+ let r = class extends c {
14
14
  constructor() {
15
15
  super(...arguments), this.sidebarOpen = !1;
16
16
  }
17
17
  render() {
18
- return a`
19
- ${this.sidebarOpen ? a`<div class="backdrop" @click=${() => this.dispatchEvent(new h())}></div>` : b}
18
+ return l`
19
+ ${this.sidebarOpen ? l`<div class="backdrop" @click=${() => this.dispatchEvent(new v())}></div>` : b}
20
20
  <div class="sidebar-region"><slot name="sidebar"></slot></div>
21
21
  <div class="main-column">
22
22
  <div class="toolbar-row">
@@ -28,7 +28,7 @@ let i = class extends p {
28
28
  `;
29
29
  }
30
30
  };
31
- i.styles = c`
31
+ r.styles = p`
32
32
  :host {
33
33
  display: flex;
34
34
  width: 100vw;
@@ -57,6 +57,15 @@ i.styles = c`
57
57
  z-index: 40;
58
58
  }
59
59
  @media (min-width: 1024px) {
60
+ /* Must match (or exceed) \`:host([sidebar-open]) .sidebar-region\`'s
61
+ specificity above (0,3,0) — a bare \`.sidebar-region\` here is only
62
+ (0,1,0), so on equal-or-narrower cascades the desktop override would
63
+ lose to the sidebar-open rule regardless of this media query
64
+ matching, leaving the sidebar permanently \`position: fixed\` (full-
65
+ height overlay) at any width once \`sidebar-open\` is set. Repeating
66
+ the \`:host([sidebar-open])\` prefix here, rather than only the bare
67
+ selector, is what actually lets desktop width win. */
68
+ :host([sidebar-open]) .sidebar-region,
60
69
  .sidebar-region {
61
70
  display: block;
62
71
  position: relative;
@@ -82,12 +91,12 @@ i.styles = c`
82
91
  }
83
92
  `;
84
93
  d([
85
- f({ type: Boolean, reflect: !0, attribute: "sidebar-open" })
86
- ], i.prototype, "sidebarOpen", 2);
87
- i = d([
88
- m("dp-shell")
89
- ], i);
94
+ h({ type: Boolean, reflect: !0, attribute: "sidebar-open" })
95
+ ], r.prototype, "sidebarOpen", 2);
96
+ r = d([
97
+ f("dp-shell")
98
+ ], r);
90
99
  export {
91
- i as DpShell,
92
- h as DpShellSidebarCloseEvent
100
+ r as DpShell,
101
+ v as DpShellSidebarCloseEvent
93
102
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iyulab/desktop-patterns",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -22,6 +22,22 @@
22
22
  "types": "./dist/components/page/dp-page.d.ts",
23
23
  "import": "./dist/page.js"
24
24
  },
25
+ "./sidebar": {
26
+ "types": "./dist/components/sidebar/dp-sidebar.d.ts",
27
+ "import": "./dist/sidebar.js"
28
+ },
29
+ "./toolbar": {
30
+ "types": "./dist/components/toolbar/dp-toolbar.d.ts",
31
+ "import": "./dist/toolbar.js"
32
+ },
33
+ "./shell": {
34
+ "types": "./dist/components/shell/dp-shell.d.ts",
35
+ "import": "./dist/shell.js"
36
+ },
37
+ "./shortcut-overlay": {
38
+ "types": "./dist/components/shortcut-overlay/dp-shortcut-overlay.d.ts",
39
+ "import": "./dist/shortcut-overlay.js"
40
+ },
25
41
  "./tokens.css": "./tokens.css"
26
42
  },
27
43
  "scripts": {
@@ -35,7 +51,7 @@
35
51
  "build-storybook": "storybook build"
36
52
  },
37
53
  "dependencies": {
38
- "@iyulab/desktop-compact": "^0.1.0",
54
+ "@iyulab/desktop-compact": "^0.2.0",
39
55
  "lit": "^3.2.1"
40
56
  },
41
57
  "devDependencies": {