@samline/drawer 2.0.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.
Files changed (37) hide show
  1. package/LICENSE.md +22 -0
  2. package/README.md +66 -0
  3. package/dist/browser/components-client-BC8MrVsa.mjs +2107 -0
  4. package/dist/browser/components-client-BHUFVfXB.js +2133 -0
  5. package/dist/browser/index.cjs +29211 -0
  6. package/dist/browser/index.d.mts +25 -0
  7. package/dist/browser/index.d.ts +25 -0
  8. package/dist/browser/index.js +29213 -0
  9. package/dist/browser/index.mjs +29201 -0
  10. package/dist/components-client-BC8MrVsa.mjs +2107 -0
  11. package/dist/components-client-BHUFVfXB.js +2133 -0
  12. package/dist/core/index.d.mts +56 -0
  13. package/dist/core/index.d.ts +56 -0
  14. package/dist/core/index.js +69 -0
  15. package/dist/core/index.mjs +67 -0
  16. package/dist/index.d.mts +41 -0
  17. package/dist/index.d.ts +41 -0
  18. package/dist/index.js +29190 -0
  19. package/dist/index.mjs +29180 -0
  20. package/dist/react/index.d.mts +146 -0
  21. package/dist/react/index.d.ts +146 -0
  22. package/dist/react/index.js +2719 -0
  23. package/dist/react/index.mjs +2678 -0
  24. package/dist/style.css +256 -0
  25. package/dist/svelte/components-client-BC8MrVsa.mjs +2107 -0
  26. package/dist/svelte/components-client-BHUFVfXB.js +2133 -0
  27. package/dist/svelte/index.d.mts +13 -0
  28. package/dist/svelte/index.d.ts +13 -0
  29. package/dist/svelte/index.js +29226 -0
  30. package/dist/svelte/index.mjs +29216 -0
  31. package/dist/vue/components-client-BHUFVfXB.js +2133 -0
  32. package/dist/vue/components-client-rq_o2zwK.mjs +2107 -0
  33. package/dist/vue/index.d.mts +107 -0
  34. package/dist/vue/index.d.ts +107 -0
  35. package/dist/vue/index.js +29359 -0
  36. package/dist/vue/index.mjs +29351 -0
  37. package/package.json +151 -0
package/LICENSE.md ADDED
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Samuel Olvera (Samline)
4
+ Copyright (c) 2023 Emil Kowalski
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in all
14
+ copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,66 @@
1
+ # Drawer
2
+
3
+ A universal drawer package with one shared interaction runtime across React, Vue, Svelte, vanilla JS, and browser/CDN usage.
4
+
5
+ Drawer is inspired by [Vaul](https://github.com/emilkowalski/vaul). The package keeps the original drawer interaction model while making the same user-facing behavior available through different integration styles.
6
+
7
+ ## Installation
8
+
9
+ ```bash
10
+ npm install @samline/drawer
11
+ ```
12
+
13
+ ```bash
14
+ bun add @samline/drawer
15
+ ```
16
+
17
+ ## Quick Start
18
+
19
+ ```ts
20
+ import { createDrawer } from '@samline/drawer'
21
+
22
+ const drawer = createDrawer({
23
+ direction: 'bottom',
24
+ dismissible: true,
25
+ triggerText: 'Open drawer',
26
+ showHandle: true,
27
+ title: 'Drawer title',
28
+ description: 'Drawer description',
29
+ content: 'Drawer content'
30
+ })
31
+
32
+ drawer.setOpen(true)
33
+ ```
34
+
35
+ ## Entrypoints
36
+
37
+ - `@samline/drawer`: vanilla API and shared runtime helpers
38
+ - `@samline/drawer/react`: React component API
39
+ - `@samline/drawer/browser`: browser global for CDN or plain HTML
40
+ - `@samline/drawer/vue`: Vue wrapper over the shared runtime
41
+ - `@samline/drawer/svelte`: Svelte action and helpers
42
+ - `@samline/drawer/core`: controller and snapshot contracts only
43
+ - `@samline/drawer/styles.css`: shared styles
44
+
45
+ ## Full Docs
46
+
47
+ Use docs/ when you want the full API surface, lifecycle notes, runtime attributes, and framework-specific guidance.
48
+
49
+ - [docs/README.md](docs/README.md)
50
+ - [docs/api.md](docs/api.md)
51
+ - [docs/vanilla.md](docs/vanilla.md)
52
+ - [docs/browser.md](docs/browser.md)
53
+ - [docs/react.md](docs/react.md)
54
+ - [docs/vue.md](docs/vue.md)
55
+ - [docs/svelte.md](docs/svelte.md)
56
+
57
+ ## Notes
58
+
59
+ - All entrypoints target the same user-facing drawer behavior for shared options.
60
+ - When `shouldScaleBackground` is enabled, add `data-drawer-wrapper` to the app shell element that should scale.
61
+ - When a child control should not start dragging, add `data-drawer-no-drag` to that element.
62
+ - The public DOM contract uses `data-drawer-*` attributes.
63
+
64
+ ## License
65
+
66
+ MIT