@humanforest/nuxt-layer 0.3.0 → 0.3.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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@humanforest/nuxt-layer",
3
3
  "type": "module",
4
- "version": "0.3.0",
4
+ "version": "0.3.1",
5
5
  "description": "Forest design system as a Nuxt layer — extend it to inherit the theme, colour roles, icons and brand fonts in one line.",
6
6
  "main": "./nuxt.config.ts",
7
7
  "files": [
@@ -110,12 +110,21 @@ const props = withDefaults(
110
110
  icon?: string;
111
111
  title?: string;
112
112
  meta?: string;
113
+ /**
114
+ * The box draws no padding of its own, so the child can run to its edge and supply whatever
115
+ * gutters it wants. For content that already pads itself — a UTable pads its own cells, a map
116
+ * or a chart wants every pixel — where the box's 16px would sit outside the child's and read as
117
+ * a doubled margin. This is FlushCard's argument applied one level in: same lever, the box's
118
+ * body rather than the card's.
119
+ */
120
+ flush?: boolean;
121
+
113
122
  /** Footer action label. `to` makes it a link; without one it is a button. */
114
123
  action?: string;
115
124
  to?: string;
116
125
 
117
126
  }>(),
118
- { gap: 8, outlined: true, bare: false },
127
+ { gap: 8, outlined: true, bare: false, flush: false },
119
128
  );
120
129
 
121
130
  const slots = useSlots();
@@ -131,6 +140,10 @@ if (import.meta.env.DEV) {
131
140
  watchEffect(() => {
132
141
  if (hasHeader.value && hasFooter.value)
133
142
  console.warn('[FInsetCard] `header` and `footer` together — this pattern takes one strip, not both.');
143
+ // `flush` un-pads the box; `bare` means there is no box to un-pad. Silent inertness is the kind
144
+ // of thing someone debugs for ten minutes, so say it.
145
+ if (props.bare && props.flush)
146
+ console.warn('[FInsetCard] `flush` does nothing under `bare` — bare draws no box, so there is no padding to remove.');
134
147
  });
135
148
  }
136
149
 
@@ -181,7 +194,13 @@ const rootClass = computed(() =>
181
194
  //
182
195
  // The box takes no padding of its own: UCard already pads its BODY slot, and adding p-* to the root
183
196
  // stacks on top of it for double the intended space.
184
- const boxUi = computed(() => ({ root: `bg-[var(--forest-card-inset)] ${PAD_CLASS[props.gap]}` }));
197
+ // Both breakpoints on the flush body: the card fragment re-pins `sm:p-4`, so a bare `p-0` still
198
+ // pads at ≥640px. The box keeps its own overflow-hidden either way, which is what clips a flush
199
+ // child to the rounded corner; a child that must scroll (UTable) already scrolls itself.
200
+ const boxUi = computed(() => ({
201
+ root: `bg-[var(--forest-card-inset)] ${PAD_CLASS[props.gap]}`,
202
+ ...(props.flush ? { body: 'p-0 sm:p-0' } : {}),
203
+ }));
185
204
 
186
205
  // ★ FOR `bare`, WHERE THE CHILD IS ITS OWN SURFACE (an FKpi). Exposed as a slot prop so the
187
206
  // call site passes it straight to the child's `ui` without needing to know any of this: