@mediaradar/design-components 0.5.1 → 0.6.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/README.md +32 -0
- package/dist/index.cjs +5 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/package.json +13 -5
- package/scripts/check-tailwind-coverage.mjs +51 -0
- package/scripts/tailwind-coverage.mjs +93 -0
package/README.md
CHANGED
|
@@ -78,3 +78,35 @@ use Tailwind class names that only resolve correctly once a consuming app
|
|
|
78
78
|
already has that package's Tailwind theme wired up. Declaring it as a peer
|
|
79
79
|
(rather than not declaring it at all) means `npm install` at least warns if
|
|
80
80
|
it's missing, instead of the component silently rendering unstyled.
|
|
81
|
+
|
|
82
|
+
The minimum version in that range is enforced, not guessed: this package's
|
|
83
|
+
CI (`npm run check:token-compat`) compiles the built bundle with real
|
|
84
|
+
Tailwind against the minimum allowed `@mediaradar/design-tokens` and the
|
|
85
|
+
latest published one, and fails if any class generates no CSS. If a
|
|
86
|
+
component needs a newer token, raise the minimum in the same PR.
|
|
87
|
+
|
|
88
|
+
## Consuming app setup
|
|
89
|
+
|
|
90
|
+
Tailwind v4 skips `node_modules` when scanning for classes, so a class used
|
|
91
|
+
only inside this package compiles to nothing, with no build error. Point
|
|
92
|
+
Tailwind at the compiled bundle, after the app's last `@import`:
|
|
93
|
+
|
|
94
|
+
```css
|
|
95
|
+
@source '../node_modules/@mediaradar/design-components/dist/index.js';
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
(Tailwind v3 / `@config` apps: add
|
|
99
|
+
`./node_modules/@mediaradar/design-components/dist/*.{js,cjs}` to the
|
|
100
|
+
`content` array instead.)
|
|
101
|
+
|
|
102
|
+
Then verify it in CI, after the app's production build:
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
npx design-components-check-coverage --css-dir dist # Vite
|
|
106
|
+
npx design-components-check-coverage --css-dir .next/static # Next.js
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
It fails if any class the installed version of this package uses is
|
|
110
|
+
missing from the app's compiled CSS — whether because Tailwind isn't
|
|
111
|
+
scanning the package, or because the app's `@mediaradar/design-tokens` is
|
|
112
|
+
older than this package's peer range.
|
package/dist/index.cjs
CHANGED
|
@@ -115,7 +115,7 @@ function InfoTip({ text, size = 11, label = "More information", trigger = "click
|
|
|
115
115
|
{
|
|
116
116
|
role: "tooltip",
|
|
117
117
|
style: { position: "fixed", top: pos.top, left: pos.left, width: pos.width },
|
|
118
|
-
className: "z-[90] rounded-control border border-border bg-surface px-3 py-2 text-[12px] font-normal not-italic normal-case leading-relaxed tracking-normal text-text-secondary shadow-overlay",
|
|
118
|
+
className: "z-[90] rounded-control border border-border-default bg-surface px-3 py-2 text-[12px] font-normal not-italic normal-case leading-relaxed tracking-normal text-text-secondary shadow-overlay",
|
|
119
119
|
children: text
|
|
120
120
|
}
|
|
121
121
|
),
|
|
@@ -1137,7 +1137,7 @@ function SectionRail({
|
|
|
1137
1137
|
type: "button",
|
|
1138
1138
|
onClick: () => scroll(-1),
|
|
1139
1139
|
"aria-label": "Previous",
|
|
1140
|
-
className: "hidden h-10 w-10 items-center justify-center rounded-control border border-border text-text-secondary transition-colors hover:bg-subtle hover:text-text-primary sm:flex lg:hidden",
|
|
1140
|
+
className: "hidden h-10 w-10 items-center justify-center rounded-control border border-border-default text-text-secondary transition-colors hover:bg-subtle hover:text-text-primary sm:flex lg:hidden",
|
|
1141
1141
|
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react7.ChevronLeft, { size: 16 })
|
|
1142
1142
|
}
|
|
1143
1143
|
),
|
|
@@ -1147,7 +1147,7 @@ function SectionRail({
|
|
|
1147
1147
|
type: "button",
|
|
1148
1148
|
onClick: () => scroll(1),
|
|
1149
1149
|
"aria-label": "Next",
|
|
1150
|
-
className: "hidden h-10 w-10 items-center justify-center rounded-control border border-border text-text-secondary transition-colors hover:bg-subtle hover:text-text-primary sm:flex lg:hidden",
|
|
1150
|
+
className: "hidden h-10 w-10 items-center justify-center rounded-control border border-border-default text-text-secondary transition-colors hover:bg-subtle hover:text-text-primary sm:flex lg:hidden",
|
|
1151
1151
|
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react7.ChevronRight, { size: 16 })
|
|
1152
1152
|
}
|
|
1153
1153
|
)
|
|
@@ -1498,7 +1498,7 @@ function cx5(...parts) {
|
|
|
1498
1498
|
return parts.filter(Boolean).join(" ");
|
|
1499
1499
|
}
|
|
1500
1500
|
function WorkspaceSelectedCard({ groups, testIdPrefix }) {
|
|
1501
|
-
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("aside", { className: "sticky top-4 flex min-w-0 flex-col gap-4 self-start rounded-card border border-border bg-surface px-5 pb-5 pt-4 shadow-raised sm:px-6 sm:pb-6", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "flex flex-col divide-y divide-border", children: groups.map((g) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SummaryGroupItem, { group: g, testIdPrefix }, g.id)) }) });
|
|
1501
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("aside", { className: "sticky top-4 flex min-w-0 flex-col gap-4 self-start rounded-card border border-border-default bg-surface px-5 pb-5 pt-4 shadow-raised sm:px-6 sm:pb-6", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "flex flex-col divide-y divide-border-default", children: groups.map((g) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SummaryGroupItem, { group: g, testIdPrefix }, g.id)) }) });
|
|
1502
1502
|
}
|
|
1503
1503
|
function SummaryGroupItem({
|
|
1504
1504
|
group,
|
|
@@ -1543,7 +1543,7 @@ function SummaryGroupItem({
|
|
|
1543
1543
|
group.items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
1544
1544
|
"div",
|
|
1545
1545
|
{
|
|
1546
|
-
className: "flex items-center justify-between gap-2 rounded-control border border-border bg-canvas px-2 py-1",
|
|
1546
|
+
className: "flex items-center justify-between gap-2 rounded-control border border-border-default bg-canvas px-2 py-1",
|
|
1547
1547
|
children: [
|
|
1548
1548
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { className: "min-w-0 flex-1", children: [
|
|
1549
1549
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "block truncate text-[12px] text-text-primary", children: item.name }),
|