@karyl-chan/ui 0.2.0 → 0.3.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@karyl-chan/ui",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "Shared Vue UI primitives, composables, and design tokens used by karyl-chan's bot frontend and plugin webuis.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -85,11 +85,9 @@ const emit = defineEmits<{
85
85
  </template>
86
86
 
87
87
  <style scoped>
88
- /* Inner wrapper: provides padding + flex-column layout + gap.
89
- AppModal's body slots are structural-only (no padding), so each leaf
90
- component is responsible for its own spacing. */
88
+ /* Inner wrapper: flex-column layout + gap. Padding comes from
89
+ AppModal's body default. */
91
90
  .acd-body {
92
- padding: 0.9rem 1rem 0.75rem;
93
91
  display: flex;
94
92
  flex-direction: column;
95
93
  gap: 0.75rem;
@@ -13,7 +13,11 @@ import { useDrawer } from '../composables/use-drawer';
13
13
  * The caller owns everything inside the slot — typical usage is to drop
14
14
  * a `<form @submit.prevent>` containing fields + an actions footer
15
15
  * directly into the default slot. AppModal supplies the chrome (backdrop,
16
- * panel, optional title header, close button) only.
16
+ * panel, optional title header, close button) and pads the body with
17
+ * `padding` (default `0.8rem 0.9rem`, both viewport branches). Slot
18
+ * content therefore needs no padding of its own; pass `padding="0"` for
19
+ * full-bleed content (tables, pickers, croppers) that manages its own
20
+ * edges.
17
21
  *
18
22
  * `closeOnBackdrop` / `closeOnEscape` default to true. Escape closure on
19
23
  * desktop is wired locally; on mobile it's handled by useDrawer's escape
@@ -27,11 +31,17 @@ const props = withDefaults(defineProps<{
27
31
  closeOnEscape?: boolean;
28
32
  /** Width of the desktop panel; mobile drawer ignores this. */
29
33
  width?: string;
34
+ /**
35
+ * CSS padding of the scrollable body around the default slot. Use
36
+ * `'0'` for full-bleed content that manages its own edges.
37
+ */
38
+ padding?: string;
30
39
  }>(), {
31
40
  title: '',
32
41
  closeOnBackdrop: true,
33
42
  closeOnEscape: true,
34
- width: 'min(440px, 92vw)'
43
+ width: 'min(440px, 92vw)',
44
+ padding: '0.8rem 0.9rem'
35
45
  });
36
46
 
37
47
  const emit = defineEmits<{
@@ -101,7 +111,7 @@ function onBackdropClick() {
101
111
  <Icon icon="material-symbols:close-rounded" width="18" height="18" />
102
112
  </button>
103
113
  </header>
104
- <div class="app-modal-body">
114
+ <div class="app-modal-body" :style="{ padding }">
105
115
  <slot />
106
116
  </div>
107
117
  </div>
@@ -141,7 +151,7 @@ function onBackdropClick() {
141
151
  <Icon icon="material-symbols:close-rounded" width="18" height="18" />
142
152
  </button>
143
153
  </header>
144
- <div class="app-modal-drawer-body">
154
+ <div class="app-modal-drawer-body" :style="{ padding }">
145
155
  <slot />
146
156
  </div>
147
157
  </div>
@@ -245,9 +255,8 @@ function onBackdropClick() {
245
255
 
246
256
  /* ── Desktop body wrapper ───────────────────────────────────────── */
247
257
  /* Structural wrapper that matches the mobile .app-modal-drawer-body.
248
- Padding is intentionally 0 — callers are responsible for spacing
249
- their slot content. AppConfirmDialog and similar leaf components
250
- supply their own inner padding. */
258
+ Padding comes from the `padding` prop (inline style) on both
259
+ branches so slot content needs none of its own. */
251
260
  .app-modal-body {
252
261
  flex: 1;
253
262
  min-height: 0;