@uniweb/kit 0.6.1 → 0.7.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,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniweb/kit",
3
- "version": "0.6.1",
3
+ "version": "0.7.1",
4
4
  "description": "Standard component library for Uniweb foundations",
5
5
  "type": "module",
6
6
  "exports": {
@@ -46,7 +46,7 @@
46
46
  "fuse.js": "^7.0.0",
47
47
  "shiki": "^3.0.0",
48
48
  "tailwind-merge": "^2.6.0",
49
- "@uniweb/core": "0.5.1"
49
+ "@uniweb/core": "0.5.2"
50
50
  },
51
51
  "peerDependencies": {
52
52
  "react": "^18.0.0 || ^19.0.0",
@@ -66,7 +66,7 @@ function renderList(items, ordered = false) {
66
66
  /**
67
67
  * Render a single content node
68
68
  */
69
- function RenderNode({ node, ...props }) {
69
+ function RenderNode({ node, block, ...props }) {
70
70
  if (!node) return null
71
71
 
72
72
  const { type, attrs, content } = node
@@ -203,7 +203,7 @@ function RenderNode({ node, ...props }) {
203
203
  return (
204
204
  <blockquote className="border-l-4 border-gray-300 pl-4 italic text-gray-600 my-4">
205
205
  {content?.map((child, i) => (
206
- <RenderNode key={i} node={child} />
206
+ <RenderNode key={i} node={child} block={block} />
207
207
  ))}
208
208
  </blockquote>
209
209
  )
@@ -239,6 +239,19 @@ function RenderNode({ node, ...props }) {
239
239
  return <Divider type={attrs?.type} className="my-6" />
240
240
  }
241
241
 
242
+ case 'inline_child_placeholder': {
243
+ const refId = attrs?.refId
244
+ if (!block || !refId) return null
245
+
246
+ const childBlock = block.getInlineChild(refId)
247
+ if (!childBlock) return null
248
+
249
+ const ChildBlocks = childBlock.getChildBlockRenderer()
250
+ if (!ChildBlocks) return null
251
+
252
+ return <ChildBlocks blocks={[childBlock]} as="div" />
253
+ }
254
+
242
255
  case 'button': {
243
256
  const href = attrs?.href || '#'
244
257
  const label = extractText(node) || attrs?.label || 'Button'
@@ -286,7 +299,7 @@ function RenderNode({ node, ...props }) {
286
299
  return (
287
300
  <>
288
301
  {content.map((child, i) => (
289
- <RenderNode key={i} node={child} />
302
+ <RenderNode key={i} node={child} block={block} />
290
303
  ))}
291
304
  </>
292
305
  )
@@ -302,7 +315,7 @@ function RenderNode({ node, ...props }) {
302
315
  * @param {Array|Object} props.content - Content to render (array of nodes or single node)
303
316
  * @param {string} [props.className] - Additional CSS classes
304
317
  */
305
- export function Render({ content, className, ...props }) {
318
+ export function Render({ content, block, className, ...props }) {
306
319
  if (!content) return null
307
320
 
308
321
  const nodes = Array.isArray(content) ? content : [content]
@@ -310,7 +323,7 @@ export function Render({ content, className, ...props }) {
310
323
  return (
311
324
  <div className={cn('space-y-4', className)} {...props}>
312
325
  {nodes.map((node, i) => (
313
- <RenderNode key={i} node={node} />
326
+ <RenderNode key={i} node={node} block={block} />
314
327
  ))}
315
328
  </div>
316
329
  )
@@ -2,7 +2,7 @@
2
2
  * Standard Theme Tokens for Tailwind v4
3
3
  *
4
4
  * Import this in your foundation's styles.css to register theme CSS variables
5
- * with Tailwind, enabling utility classes like `text-heading`, `bg-surface`, etc.
5
+ * with Tailwind, enabling utility classes like `text-heading`, `bg-section`, etc.
6
6
  *
7
7
  * Usage:
8
8
  * @import "tailwindcss";
@@ -21,24 +21,34 @@
21
21
  @theme inline {
22
22
  /* ── Semantic tokens ── */
23
23
  /* Values come from theme CSS context classes (light/medium/dark) */
24
+ --color-section: var(--section);
25
+ --color-card: var(--card);
26
+ --color-muted: var(--muted);
27
+ --color-body: var(--body);
24
28
  --color-heading: var(--heading);
25
- --color-surface: var(--bg);
26
- --color-surface-subtle: var(--bg-subtle);
27
- --color-surface-muted: var(--bg-muted);
28
- --color-body: var(--text);
29
- --color-muted: var(--text-muted);
30
- --color-subtle: var(--text-subtle);
29
+ --color-subtle: var(--subtle);
30
+ --color-border: var(--border);
31
+ --color-ring: var(--ring);
31
32
  --color-link: var(--link);
32
33
  --color-link-hover: var(--link-hover);
33
- --color-edge: var(--border);
34
- --color-edge-muted: var(--border-muted);
35
- --color-ring: var(--ring);
36
- --color-btn-primary: var(--btn-primary-bg);
37
- --color-btn-primary-text: var(--btn-primary-text);
38
- --color-btn-primary-hover: var(--btn-primary-hover);
39
- --color-btn-secondary: var(--btn-secondary-bg);
40
- --color-btn-secondary-text: var(--btn-secondary-text);
41
- --color-btn-secondary-hover: var(--btn-secondary-hover);
34
+
35
+ /* ── Action tokens ── */
36
+ --color-primary: var(--primary);
37
+ --color-primary-foreground: var(--primary-foreground);
38
+ --color-primary-hover: var(--primary-hover);
39
+ --color-secondary: var(--secondary);
40
+ --color-secondary-foreground: var(--secondary-foreground);
41
+ --color-secondary-hover: var(--secondary-hover);
42
+
43
+ /* ── Status tokens ── */
44
+ --color-success: var(--success);
45
+ --color-success-subtle: var(--success-subtle);
46
+ --color-warning: var(--warning);
47
+ --color-warning-subtle: var(--warning-subtle);
48
+ --color-error: var(--error);
49
+ --color-error-subtle: var(--error-subtle);
50
+ --color-info: var(--info);
51
+ --color-info-subtle: var(--info-subtle);
42
52
 
43
53
  /* ── Primary palette ── */
44
54
  --color-primary-50: var(--primary-50);
@@ -93,7 +103,6 @@
93
103
  --color-neutral-950: var(--neutral-950);
94
104
 
95
105
  /* ── Brand shorthands ── */
96
- --color-primary: var(--primary-500);
97
- --color-secondary: var(--secondary-500);
106
+ /* accent has no semantic token — shorthand to 500 shade */
98
107
  --color-accent: var(--accent-500);
99
108
  }