@loomidev/drawer 0.4.1 → 0.6.0

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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @loomidev/drawer
2
2
 
3
- `<loomi-drawer>` — a panel that slides in from the edge of the screen, with configurable
3
+ `<loomi-drawer>` - a panel that slides in from the edge of the screen, with configurable
4
4
  size, an optional backdrop, and focus management built in.
5
5
 
6
6
  ```bash
@@ -13,12 +13,12 @@ import "@loomidev/drawer";
13
13
 
14
14
  ## Default Drawer
15
15
 
16
- Drawers are usually triggered by an action — a button click, say. Every LoomiUI drawer is
16
+ Drawers are usually triggered by an action - a button click, say. Every LoomiUI drawer is
17
17
  opened and closed by its unique `name`, using the exported `showLoomiDrawer()` /
18
18
  `hideLoomiDrawer()` helpers (or the instance methods `show()`/`hide()` if you already have
19
19
  a reference to the element).
20
20
 
21
- > **Important:** give every drawer on a page a unique `name` — it's how `showLoomiDrawer()`
21
+ > **Important:** give every drawer on a page a unique `name` - it's how `showLoomiDrawer()`
22
22
  > finds the right one.
23
23
 
24
24
  The default drawer slides in from the right, shows a close button, and dismisses on
@@ -62,7 +62,7 @@ size by width; top/bottom drawers span the full width and size by height.
62
62
  <loomi-drawer size="small" title="Small" name="small-drawer">20rem wide.</loomi-drawer>
63
63
 
64
64
  <loomi-button onclick="showLoomiDrawer('medium-drawer')">Medium</loomi-button>
65
- <loomi-drawer size="medium" title="Medium" name="medium-drawer">28rem wide — the default.</loomi-drawer>
65
+ <loomi-drawer size="medium" title="Medium" name="medium-drawer">28rem wide - the default.</loomi-drawer>
66
66
 
67
67
  <loomi-button onclick="showLoomiDrawer('large-drawer')">Large</loomi-button>
68
68
  <loomi-drawer size="large" title="Large" name="large-drawer">36rem wide.</loomi-drawer>
@@ -86,12 +86,12 @@ once it overflows the drawer's height.
86
86
 
87
87
  Three independent toggles control dismissal:
88
88
 
89
- - `backdrop` (default `true`) — shows a dimmed overlay behind the panel and blocks
89
+ - `backdrop` (default `true`) - shows a dimmed overlay behind the panel and blocks
90
90
  interaction with the rest of the page while open.
91
- - `close-on-outside-click` (default `true`) — clicking outside the panel closes it. This
91
+ - `close-on-outside-click` (default `true`) - clicking outside the panel closes it. This
92
92
  works even with `backdrop="false"`, since it's just watching for clicks outside the
93
93
  panel rather than relying on the backdrop element itself.
94
- - <kbd>Esc</kbd> always closes the drawer — there's no attribute to turn that off.
94
+ - <kbd>Esc</kbd> always closes the drawer - there's no attribute to turn that off.
95
95
 
96
96
  ```html
97
97
  <!-- no dimming overlay, but the rest of the page stays inert because outside clicks
@@ -100,7 +100,7 @@ Three independent toggles control dismissal:
100
100
 
101
101
  <!-- only the close button or Escape can dismiss it -->
102
102
  <loomi-drawer name="pinned" close-on-outside-click="false">
103
- Click outside all you want — only the X (or Escape) closes me.
103
+ Click outside all you want - only the X (or Escape) closes me.
104
104
  </loomi-drawer>
105
105
  ```
106
106
 
@@ -113,7 +113,7 @@ rather than a true overlay.
113
113
 
114
114
  ## Custom Animations
115
115
 
116
- Every part of the slide animation is overridable through CSS custom properties — no
116
+ Every part of the slide animation is overridable through CSS custom properties - no
117
117
  rebuild required:
118
118
 
119
119
  | Property | Default |
@@ -148,20 +148,20 @@ selector:
148
148
  }
149
149
  ```
150
150
 
151
- `prefers-reduced-motion: reduce` is honored automatically — the animation still runs (so
151
+ `prefers-reduced-motion: reduce` is honored automatically - the animation still runs (so
152
152
  `hide()` resolves promptly) but at a near-instant duration.
153
153
 
154
154
  ## Accessibility
155
155
 
156
- For the library-wide baseline, see [Foundations — Accessibility](https://loomiui.com/foundations/#accessibility).
156
+ For the library-wide baseline, see [Foundations - Accessibility](https://loomiui.com/foundations/#accessibility).
157
157
 
158
158
  ## Responsive behavior
159
159
 
160
- For the shared container and viewport rules, see [Foundations — Responsive behavior](https://loomiui.com/foundations/#responsive-behavior).
160
+ For the shared container and viewport rules, see [Foundations - Responsive behavior](https://loomiui.com/foundations/#responsive-behavior).
161
161
 
162
162
  ## Dark mode
163
163
 
164
- For theme activation, token overrides, and contrast guidance, see [Foundations — Dark mode](https://loomiui.com/foundations/#dark-mode).
164
+ For theme activation, token overrides, and contrast guidance, see [Foundations - Dark mode](https://loomiui.com/foundations/#dark-mode).
165
165
 
166
166
  ## Attributes
167
167
 
@@ -202,7 +202,7 @@ close animation finishes and the drawer unmounts).
202
202
 
203
203
  Opening a drawer moves focus into it (the close button if shown, otherwise the first
204
204
  focusable element, otherwise the panel itself). While `backdrop` is on, <kbd>Tab</kbd> is
205
- trapped inside the panel; closing it restores focus to whatever was focused before — all
205
+ trapped inside the panel; closing it restores focus to whatever was focused before - all
206
206
  automatic, no setup needed.
207
207
 
208
208
  ## Full Example
@@ -1,5 +1,5 @@
1
1
  // Generated by @loomidev/drawer — do not edit by hand. Run `pnpm build` to regenerate.
2
2
  import { unsafeCSS } from "lit";
3
3
  /** Compiled, Shadow-DOM-scoped styles. Colors resolve via `var(--loomi-*)`. */
4
- export const componentStyles = unsafeCSS("/*! tailwindcss v4.3.2 | MIT License | https://tailwindcss.com */\n@layer theme,base,components,utilities;:host{display:none}:host([open]){display:block}.loomi-backdrop{z-index:var(--loomi-drawer-z-index,2147480000);background:#0f172a73;animation:.2s loomi-drawer-fade-in;position:fixed;inset:0}.loomi-backdrop.is-closing{animation:loomi-drawer-fade-out var(--loomi-drawer-duration,.3s) ease both}.loomi-panel{z-index:var(--loomi-drawer-z-index,2147480000);background:var(--loomi-surface);box-shadow:var(--loomi-shadow-elevated);animation-duration:var(--loomi-drawer-duration,.3s);animation-timing-function:var(--loomi-drawer-easing,cubic-bezier(.32, .72, 0, 1));outline:none;flex-direction:column;animation-fill-mode:both;display:flex;position:fixed}.placement-left,.placement-right{max-width:100vw;top:0;bottom:0}.placement-left{left:0}.placement-right{right:0}.placement-top,.placement-bottom{max-height:100vh;left:0;right:0}.placement-top{top:0}.placement-bottom{bottom:0}.placement-left.size-small,.placement-right.size-small{width:20rem}.placement-left.size-medium,.placement-right.size-medium{width:28rem}.placement-left.size-large,.placement-right.size-large{width:36rem}.placement-top.size-small,.placement-bottom.size-small{height:14rem}.placement-top.size-medium,.placement-bottom.size-medium{height:20rem}.placement-top.size-large,.placement-bottom.size-large{height:28rem}.placement-right.is-open{animation-name:var(--loomi-drawer-enter-animation,loomi-drawer-in-right)}.placement-left.is-open{animation-name:var(--loomi-drawer-enter-animation,loomi-drawer-in-left)}.placement-top.is-open{animation-name:var(--loomi-drawer-enter-animation,loomi-drawer-in-top)}.placement-bottom.is-open{animation-name:var(--loomi-drawer-enter-animation,loomi-drawer-in-bottom)}.placement-right.is-closing{animation-name:var(--loomi-drawer-exit-animation,loomi-drawer-out-right)}.placement-left.is-closing{animation-name:var(--loomi-drawer-exit-animation,loomi-drawer-out-left)}.placement-top.is-closing{animation-name:var(--loomi-drawer-exit-animation,loomi-drawer-out-top)}.placement-bottom.is-closing{animation-name:var(--loomi-drawer-exit-animation,loomi-drawer-out-bottom)}.loomi-header{border-bottom:1px solid var(--loomi-surface-border);flex:none;justify-content:space-between;align-items:flex-start;gap:.75rem;padding:1.25rem 1.5rem;display:flex}.loomi-title{color:var(--loomi-text);font-size:1.1rem;font-weight:600;line-height:1.4}.loomi-close{color:var(--loomi-text-faint);cursor:pointer;background:0 0;border:0;border-radius:.375rem;flex:none;margin:-.25rem -.25rem 0 0;padding:.25rem;line-height:0}.loomi-close:hover{color:var(--loomi-text-secondary);background:var(--loomi-surface-hover)}.loomi-close:focus-visible{outline:2px solid var(--loomi-focus-ring-color);outline-offset:2px}.loomi-body{min-height:0;color:var(--loomi-text-secondary);flex:1;padding:1.5rem;line-height:1.6;overflow-y:auto}@keyframes loomi-drawer-fade-in{0%{opacity:0}}@keyframes loomi-drawer-fade-out{to{opacity:0}}@keyframes loomi-drawer-in-left{0%{transform:translate(-100%)}}@keyframes loomi-drawer-in-right{0%{transform:translate(100%)}}@keyframes loomi-drawer-in-top{0%{transform:translateY(-100%)}}@keyframes loomi-drawer-in-bottom{0%{transform:translateY(100%)}}@keyframes loomi-drawer-out-left{to{transform:translate(-100%)}}@keyframes loomi-drawer-out-right{to{transform:translate(100%)}}@keyframes loomi-drawer-out-top{to{transform:translateY(-100%)}}@keyframes loomi-drawer-out-bottom{to{transform:translateY(100%)}}@media (max-width:30rem){.placement-left.size-small,.placement-left.size-medium,.placement-left.size-large,.placement-right.size-small,.placement-right.size-medium,.placement-right.size-large{width:100vw}.loomi-header{padding:1rem 1.25rem}.loomi-body{padding:1.25rem}}@media (prefers-reduced-motion:reduce){.loomi-panel,.loomi-backdrop{animation-duration:10ms}}");
4
+ export const componentStyles = unsafeCSS("/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n@layer theme,base,components,utilities;:host{display:none}:host([open]){display:block}.loomi-backdrop{z-index:var(--loomi-drawer-z-index,2147480000);background:#0f172a73;animation:.2s loomi-drawer-fade-in;position:fixed;inset:0}.loomi-backdrop.is-closing{animation:loomi-drawer-fade-out var(--loomi-drawer-duration,.3s) ease both}.loomi-panel{z-index:var(--loomi-drawer-z-index,2147480000);background:var(--loomi-surface);box-shadow:var(--loomi-shadow-elevated);animation-duration:var(--loomi-drawer-duration,.3s);animation-timing-function:var(--loomi-drawer-easing,cubic-bezier(.32, .72, 0, 1));outline:none;flex-direction:column;animation-fill-mode:both;display:flex;position:fixed}.placement-left,.placement-right{max-width:100vw;top:0;bottom:0}.placement-left{left:0}.placement-right{right:0}.placement-top,.placement-bottom{max-height:100vh;left:0;right:0}.placement-top{top:0}.placement-bottom{bottom:0}.placement-left.size-small,.placement-right.size-small{width:20rem}.placement-left.size-medium,.placement-right.size-medium{width:28rem}.placement-left.size-large,.placement-right.size-large{width:36rem}.placement-top.size-small,.placement-bottom.size-small{height:14rem}.placement-top.size-medium,.placement-bottom.size-medium{height:20rem}.placement-top.size-large,.placement-bottom.size-large{height:28rem}.placement-right.is-open{animation-name:var(--loomi-drawer-enter-animation,loomi-drawer-in-right)}.placement-left.is-open{animation-name:var(--loomi-drawer-enter-animation,loomi-drawer-in-left)}.placement-top.is-open{animation-name:var(--loomi-drawer-enter-animation,loomi-drawer-in-top)}.placement-bottom.is-open{animation-name:var(--loomi-drawer-enter-animation,loomi-drawer-in-bottom)}.placement-right.is-closing{animation-name:var(--loomi-drawer-exit-animation,loomi-drawer-out-right)}.placement-left.is-closing{animation-name:var(--loomi-drawer-exit-animation,loomi-drawer-out-left)}.placement-top.is-closing{animation-name:var(--loomi-drawer-exit-animation,loomi-drawer-out-top)}.placement-bottom.is-closing{animation-name:var(--loomi-drawer-exit-animation,loomi-drawer-out-bottom)}.loomi-header{border-bottom:1px solid var(--loomi-surface-border);flex:none;justify-content:space-between;align-items:flex-start;gap:.75rem;padding:1.25rem 1.5rem;display:flex}.loomi-title{color:var(--loomi-text);font-size:1.1rem;font-weight:600;line-height:1.4}.loomi-close{color:var(--loomi-text-faint);cursor:pointer;background:0 0;border:0;border-radius:.375rem;flex:none;margin:-.25rem -.25rem 0 0;padding:.25rem;line-height:0}.loomi-close:hover{color:var(--loomi-text-secondary);background:var(--loomi-surface-hover)}.loomi-close:focus-visible{outline:2px solid var(--loomi-focus-ring-color);outline-offset:2px}.loomi-body{min-height:0;color:var(--loomi-text-secondary);flex:1;padding:1.5rem;line-height:1.6;overflow-y:auto}@keyframes loomi-drawer-fade-in{0%{opacity:0}}@keyframes loomi-drawer-fade-out{to{opacity:0}}@keyframes loomi-drawer-in-left{0%{transform:translate(-100%)}}@keyframes loomi-drawer-in-right{0%{transform:translate(100%)}}@keyframes loomi-drawer-in-top{0%{transform:translateY(-100%)}}@keyframes loomi-drawer-in-bottom{0%{transform:translateY(100%)}}@keyframes loomi-drawer-out-left{to{transform:translate(-100%)}}@keyframes loomi-drawer-out-right{to{transform:translate(100%)}}@keyframes loomi-drawer-out-top{to{transform:translateY(-100%)}}@keyframes loomi-drawer-out-bottom{to{transform:translateY(100%)}}@media (max-width:30rem){.placement-left.size-small,.placement-left.size-medium,.placement-left.size-large,.placement-right.size-small,.placement-right.size-medium,.placement-right.size-large{width:100vw}.loomi-header{padding:1rem 1.25rem}.loomi-body{padding:1.25rem}}@media (prefers-reduced-motion:reduce){.loomi-panel,.loomi-backdrop{animation-duration:10ms}}");
5
5
  //# sourceMappingURL=styles.css.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loomidev/drawer",
3
- "version": "0.4.1",
3
+ "version": "0.6.0",
4
4
  "description": "<loomi-drawer> — a sliding edge panel with optional backdrop, focus trap, and customizable animations.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -30,18 +30,18 @@
30
30
  }
31
31
  },
32
32
  "dependencies": {
33
- "@loomidev/core": "^0.4.1",
34
- "@loomidev/icon": "^0.4.1"
33
+ "@loomidev/core": "^0.6.0",
34
+ "@loomidev/icon": "^0.6.0"
35
35
  },
36
36
  "peerDependencies": {
37
37
  "lit": "^3.0.0"
38
38
  },
39
39
  "devDependencies": {
40
- "@tailwindcss/cli": "^4.0.0",
40
+ "@tailwindcss/cli": "^4.3.3",
41
41
  "lit": "^3.3.3",
42
- "tailwindcss": "^4.0.0",
42
+ "tailwindcss": "^4.3.3",
43
43
  "typescript": "^5.6.3",
44
- "@loomidev/theme": "^0.4.1"
44
+ "@loomidev/theme": "^0.6.0"
45
45
  },
46
46
  "keywords": [
47
47
  "web-components",