highsoft-ui 1.0.136 → 1.0.138
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/CLAUDE.md +22 -0
- package/dist/{Button-CTdphXmG.js → Button-Dc8NFRWQ.js} +1 -1
- package/dist/{ButtonGroup-D5_sI3QL.js → ButtonGroup-CYmrw7gQ.js} +1 -1
- package/dist/{Checkbox-Yg8sUFcu.js → Checkbox-CErz7eBz.js} +1 -1
- package/dist/CodeBlock-DtYddgyU.js +3044 -0
- package/dist/{CookiePolicyModal-DGM4bMoR.js → CookiePolicyModal-DdXZ2d36.js} +2 -2
- package/dist/{CopyCode-DS-3fQBn.js → CopyCode-DH9Jh7PD.js} +2 -2
- package/dist/{Dropdown-CgbtoeLA.js → Dropdown-DbXr3sb-.js} +1 -1
- package/dist/{Footer-DSJzETEs.js → Footer-CcrBEAxZ.js} +7 -7
- package/dist/{FooterBottom-BHQ-77CT.js → FooterBottom-Dtttgp4F.js} +1 -1
- package/dist/{FooterHelp-B1zOPX-K.js → FooterHelp-CfoW8dhY.js} +1 -1
- package/dist/{FooterLinks-BxVVi8kz.js → FooterLinks-CSAfsyJP.js} +2 -2
- package/dist/{Header-4bkW4MNM.js → Header-Ga_hYsOa.js} +6 -6
- package/dist/{InputGrouped-RLCBTqtp.js → InputGrouped-CIokpRn5.js} +2 -2
- package/dist/{Label-gTAMwE0j.js → Label-BM4vL0vA.js} +1 -1
- package/dist/{NewsletterSignup-BawMuwkc.js → NewsletterSignup-Dw9YbhEh.js} +2 -2
- package/dist/{Notification-icY33paf.js → Notification-BgmhEw6w.js} +3 -3
- package/dist/{PrefPanel-0iwUb8OU.js → PrefPanel-BG4jW8wc.js} +2 -2
- package/dist/{RoadmapDetails-BPt5Ava0.js → RoadmapDetails-DXxJNZh9.js} +2 -2
- package/dist/{Search-CF_Qyaff.js → Search-CpJ2XTLG.js} +2 -2
- package/dist/{YoutubeModal-CiBt7a4G.js → YoutubeModal-DGj2INF0.js} +1 -1
- package/dist/components/Button/index.js +1 -1
- package/dist/components/ButtonGroup/index.js +1 -1
- package/dist/components/Checkbox/index.js +1 -1
- package/dist/components/CodeBlock/index.js +2 -0
- package/dist/components/CopyCode/index.js +1 -1
- package/dist/components/Dropdown/index.js +1 -1
- package/dist/components/Footer/CookiePolicyModal.js +1 -1
- package/dist/components/Footer/FooterBottom.js +1 -1
- package/dist/components/Footer/FooterHelp.js +1 -1
- package/dist/components/Footer/FooterLinks.js +1 -1
- package/dist/components/Footer/YoutubeModal.js +1 -1
- package/dist/components/Footer/index.js +1 -1
- package/dist/components/Header/index.js +1 -1
- package/dist/components/InputGrouped/index.js +1 -1
- package/dist/components/Label/index.js +1 -1
- package/dist/components/Modal/ModalContactFooter.js +2 -2
- package/dist/components/Modal/index.js +2 -2
- package/dist/components/NewsletterSignup/index.js +1 -1
- package/dist/components/Notification/index.js +1 -1
- package/dist/components/PrefPanel/index.js +1 -1
- package/dist/components/RoadmapDetails/index.js +1 -1
- package/dist/components/Search/index.js +1 -1
- package/dist/{esm-Co_Guu6S.js → esm-CDDjSK4f.js} +1 -1
- package/dist/highsoft-ui.css +1 -1
- package/dist/lib/components/CodeBlock/index.d.ts +48 -0
- package/dist/lib/main.d.ts +2 -0
- package/dist/main.js +31 -30
- package/dist/scss/variables.scss +22 -0
- package/package.json +4 -3
package/CLAUDE.md
CHANGED
|
@@ -248,6 +248,28 @@ Pill-shaped inline code display with integrated copy button and success state.
|
|
|
248
248
|
- **`children`:** `string` — the code text to display and copy
|
|
249
249
|
- **`duration`:** ms for success state (default: 2000)
|
|
250
250
|
|
|
251
|
+
### CodeBlock
|
|
252
|
+
Code viewer with syntax colors, a line-number gutter, diff lines and a copy button — all from plain `code`, no setup.
|
|
253
|
+
```tsx
|
|
254
|
+
<CodeBlock lang="ts" code={source} />
|
|
255
|
+
|
|
256
|
+
// Added / removed lines — mark them with [!code ++] / [!code --]:
|
|
257
|
+
<CodeBlock lang="ts" code={`const a = 1 // [!code --]
|
|
258
|
+
const a = 2 // [!code ++]`} />
|
|
259
|
+
|
|
260
|
+
// Bring your own highlighter (Shiki etc.) for a custom theme / SSR:
|
|
261
|
+
<CodeBlock lang="ts" code={source} html={preHighlightedHtml} />
|
|
262
|
+
```
|
|
263
|
+
- **`code`:** raw code (required). Lines ending with `// [!code ++]` / `// [!code --]` render as added (green) / removed (red); copy returns the resulting code with markers stripped and removed lines dropped.
|
|
264
|
+
- **`html`:** pre-highlighted HTML (e.g. Shiki) — overrides the built-in Prism highlighter; use for an exact theme or SSR.
|
|
265
|
+
- **`lang`:** `bash`, `js`, `ts`, `json`, `python`, `html`, `css`, `text`, … — drives the header icon/badge and the highlighter grammar.
|
|
266
|
+
- **`showLines`:** line-number gutter (default `true`).
|
|
267
|
+
- **`syntax`:** built-in Prism highlighting (default `true`); set `false` for plain, uncolored code.
|
|
268
|
+
- **`diff`:** parse `[!code ++]` / `[!code --]` markers (default `true`); set `false` to show code that literally contains those tokens.
|
|
269
|
+
- **`wrap`:** soft-wrap long lines (default `true`); set `false` for horizontal scrolling with a pinned line-number gutter.
|
|
270
|
+
- **`copyLabel`:** copy button label (default `'Copy code'`).
|
|
271
|
+
- Colors come from `--code-block-*` design tokens (light/dark automatic). Code renders in IBM Plex Mono — load `@fontsource/ibm-plex-mono` (or it falls back to the system monospace).
|
|
272
|
+
|
|
251
273
|
### Layout
|
|
252
274
|
```tsx
|
|
253
275
|
<Header />
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as e } from "./clsx-BWCAbrjV.js";
|
|
2
|
-
import { S as t } from "./esm-
|
|
2
|
+
import { S as t } from "./esm-CDDjSK4f.js";
|
|
3
3
|
import { createContext as n, useCallback as r, useContext as i, useEffect as a, useId as o, useRef as s, useState as c } from "react";
|
|
4
4
|
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
5
5
|
var d = {
|