@uniweb/kit 0.10.3 → 0.10.5

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,13 +1,14 @@
1
1
  {
2
2
  "name": "@uniweb/kit",
3
- "version": "0.10.3",
3
+ "version": "0.10.5",
4
4
  "description": "Standard component library for Uniweb foundations",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": "./src/index.js",
8
8
  "./xref": "./src/xref/index.js",
9
9
  "./theme-tokens.css": "./src/theme-tokens.css",
10
- "./prose-tokens.css": "./src/prose-tokens.css"
10
+ "./prose-tokens.css": "./src/prose-tokens.css",
11
+ "./callout-tokens.css": "./src/callout-tokens.css"
11
12
  },
12
13
  "files": [
13
14
  "src",
@@ -41,9 +42,9 @@
41
42
  "fuse.js": "^7.0.0",
42
43
  "shiki": "^3.0.0",
43
44
  "tailwind-merge": "^3.6.0",
45
+ "@uniweb/core": "0.8.0",
44
46
  "@uniweb/semantic-parser": "1.2.0",
45
- "@uniweb/scene": "0.1.2",
46
- "@uniweb/core": "0.8.0"
47
+ "@uniweb/scene": "0.1.2"
47
48
  },
48
49
  "peerDependencies": {
49
50
  "react": "^19.0.0",
@@ -0,0 +1,107 @@
1
+ /*
2
+ * Callout styling for the five standard concept tags, wired to the theme.
3
+ *
4
+ * Usage — one line, in the foundation's stylesheet, alongside the others:
5
+ *
6
+ * @import "@uniweb/kit/callout-tokens.css";
7
+ *
8
+ * OPT-IN, and that is the point. kit's render engine emits a concept block as
9
+ * a bare `<div data-concept="<tag>">` — no classes, no box, nothing decided,
10
+ * because what a callout looks like is a foundation's design. Without an
11
+ * import like this one a concept block is unstyled and reads as plain prose,
12
+ * which is the correct default for a tag nobody has designed for yet.
13
+ *
14
+ * So this file supplies the WHOLE look, not just the colours: the frame, the
15
+ * padding and the spacing as well as the tint. An earlier version set only
16
+ * `border-color` and `background-color`, which on a bare div with no border
17
+ * width and no padding rendered as a tinted band running edge to edge — the
18
+ * right hue and nothing else.
19
+ *
20
+ * ── Why five names may live here when they may not live in a component ──
21
+ *
22
+ * kit answers for no NAME: it must never render its own accordion for `faq` or
23
+ * its own Alert for a `@Alert` reference, because that shadows a foundation
24
+ * shipping its own and cannot be overridden without forking. Two things make a
25
+ * stylesheet different:
26
+ *
27
+ * 1. CSS loses to specificity. A foundation that disagrees writes one rule
28
+ * and wins, keeping kit's walk and its own look.
29
+ * 2. These five are not names we invented. `NOTE`, `TIP`, `IMPORTANT`,
30
+ * `WARNING` and `CAUTION` are GitHub's alert kinds, which content-reader
31
+ * accepts as a second spelling of a concept block. Implementing a
32
+ * published convention is the same category as shipping icon-library
33
+ * prefixes; inventing a list would be the concept registry the whole
34
+ * design forbids.
35
+ *
36
+ * ── The colours are the site's ──
37
+ *
38
+ * Every value below is a semantic token the site sets in `theme.yml` —
39
+ * `--info`, `--warning`, `--error`, `--success` and their `-subtle` surfaces.
40
+ * kit supplies the MAPPING (which tag means which token); the site supplies
41
+ * what those tokens are, and they flip with the visitor's scheme on their own.
42
+ * No fixed palette appears here, for the reason `tests/no-fixed-palettes.test.js`
43
+ * exists.
44
+ *
45
+ * ── Tags with no rule ──
46
+ *
47
+ * A concept block whose tag is not one of the five gets the neutral frame
48
+ * above and no tint. That is deliberate: an unrecognized concept should look
49
+ * unremarkable rather than borrow a severity it was never given.
50
+ */
51
+
52
+ /*
53
+ * The frame. `--border` is the neutral fallback, so a tag with no rule of its
54
+ * own below still reads as a deliberate box rather than as loose prose.
55
+ *
56
+ * The margin is stated here because the engine emits an unclassed div: a prose
57
+ * container styles the elements it knows, and this is not one of them, so
58
+ * without this a callout would sit flush against the paragraph above it and
59
+ * against the next callout.
60
+ */
61
+ [data-concept] {
62
+ border: 1px solid var(--border);
63
+ border-radius: var(--radius, 0.5rem);
64
+ padding: 1rem 1.25rem;
65
+ margin: 1.5rem 0;
66
+ }
67
+
68
+ [data-concept="note"],
69
+ [data-concept="info"] {
70
+ border-color: var(--info);
71
+ background-color: var(--info-subtle);
72
+ }
73
+
74
+ [data-concept="tip"],
75
+ [data-concept="success"] {
76
+ border-color: var(--success);
77
+ background-color: var(--success-subtle);
78
+ }
79
+
80
+ [data-concept="important"] {
81
+ border-color: var(--primary);
82
+ background-color: var(--muted);
83
+ }
84
+
85
+ [data-concept="warning"] {
86
+ border-color: var(--warning);
87
+ background-color: var(--warning-subtle);
88
+ }
89
+
90
+ [data-concept="caution"],
91
+ [data-concept="error"] {
92
+ border-color: var(--error);
93
+ background-color: var(--error-subtle);
94
+ }
95
+
96
+ /*
97
+ * A callout inside a `prose` container should not inherit the container's
98
+ * first-child/last-child margin collapsing on its own children, or the box
99
+ * gains dead space at top and bottom that its neighbours do not have.
100
+ */
101
+ [data-concept] > :first-child {
102
+ margin-top: 0;
103
+ }
104
+
105
+ [data-concept] > :last-child {
106
+ margin-bottom: 0;
107
+ }