Install command
One command with a package manager switch and a copy button, plus version and size underneath. For a README header or a docs hero.
Install with
npm install @halden/sdkpnpm add @halden/sdkyarn add @halden/sdk
The code
Plain HTML and CSS on your kit's variables. Put it next to tokens/variables.css from your kit's files and it draws in your look.
<div class="ukc-code-install-command">
<div class="ins">
<input class="r r-npm" type="radio" name="ukc-code-install-command-pm" id="ukc-code-install-command-npm" checked>
<input class="r r-pnpm" type="radio" name="ukc-code-install-command-pm" id="ukc-code-install-command-pnpm">
<input class="r r-yarn" type="radio" name="ukc-code-install-command-pm" id="ukc-code-install-command-yarn">
<div class="pm"><span class="lbl">Install with</span><label class="t-npm" for="ukc-code-install-command-npm">npm</label><label class="t-pnpm" for="ukc-code-install-command-pnpm">pnpm</label><label class="t-yarn" for="ukc-code-install-command-yarn">yarn</label></div>
<div class="cmd">
<code><span class="pr" aria-hidden="true">$</span><span class="c-npm">npm install <b>@halden/sdk</b></span><span class="c-pnpm">pnpm add <b>@halden/sdk</b></span><span class="c-yarn">yarn add <b>@halden/sdk</b></span></code>
<button class="go" type="button" aria-label="Copy install command"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="8" y="8" width="12" height="12" rx="1"/><path d="M16 8V4H4v12h4"/></svg></button>
</div>
<p class="meta"><span>v3.2.0</span><span>18 kB gzipped</span><span>Node 18 and up</span></p>
</div>
</div>
.ukc-code-install-command { position: relative; font-family: var(--uk-font-body, system-ui, sans-serif); color: var(--uk-ink); font-size: 15px; line-height: 1.5;
--tint: color-mix(in srgb, var(--uk-accent) 12%, var(--uk-paper));
--tint-strong: color-mix(in srgb, var(--uk-accent) 22%, var(--uk-paper));
--accent-deep: color-mix(in srgb, var(--uk-accent) 72%, black);
--ink-soft: color-mix(in srgb, var(--uk-ink) 8%, var(--uk-paper));
--line-strong: color-mix(in srgb, var(--uk-ink) 32%, var(--uk-paper));
--danger-tint: color-mix(in srgb, var(--uk-danger) 12%, var(--uk-paper));
--high-tint: color-mix(in srgb, var(--uk-highlight) 28%, var(--uk-paper)); }
.ukc-code-install-command *, .ukc-code-install-command *::before, .ukc-code-install-command *::after { box-sizing: border-box; }
.ukc-code-install-command :where(h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote) { margin: 0; }
.ukc-code-install-command :where(ul, ol) { padding: 0; list-style: none; }
.ukc-code-install-command :where(button, input, select, textarea) { font: inherit; color: inherit; }
.ukc-code-install-command :where(a) { color: inherit; }
.ukc-code-install-command svg { flex: none; }
.ukc-code-install-command .r { position: absolute; opacity: 0; pointer-events: none; }
.ukc-code-install-command { container-type: inline-size; inline-size: 100%; }
.ukc-code-install-command .ins { position: relative; max-width: 460px; }
.ukc-code-install-command .pm { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin-bottom: 8px; font-size: 13px; }
.ukc-code-install-command .pm .lbl { color: var(--uk-muted); }
.ukc-code-install-command .pm label { padding: 1px 0; border-bottom: 2px solid transparent; color: var(--uk-muted); font-family: var(--uk-font-mono, ui-monospace, monospace); cursor: pointer; transition: color var(--uk-motion-duration) var(--uk-motion-ease), border-color var(--uk-motion-duration) var(--uk-motion-ease); }
.ukc-code-install-command .pm label:hover { color: var(--uk-ink); }
.ukc-code-install-command .r-npm:checked ~ .pm .t-npm, .ukc-code-install-command .r-pnpm:checked ~ .pm .t-pnpm, .ukc-code-install-command .r-yarn:checked ~ .pm .t-yarn { border-bottom-color: var(--uk-accent); color: var(--uk-ink); }
.ukc-code-install-command .r-npm:focus-visible ~ .pm .t-npm, .ukc-code-install-command .r-pnpm:focus-visible ~ .pm .t-pnpm, .ukc-code-install-command .r-yarn:focus-visible ~ .pm .t-yarn { outline: 2px solid var(--uk-accent); outline-offset: 3px; }
.ukc-code-install-command .cmd { display: flex; align-items: center; gap: 12px; padding: 6px 6px 6px 16px; border: var(--uk-border-width) solid var(--uk-line); border-radius: var(--uk-radius-lg); background: var(--uk-surface); box-shadow: var(--uk-card-shadow); }
.ukc-code-install-command .cmd code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; font: 15px/1.5 var(--uk-font-mono, ui-monospace, monospace); }
.ukc-code-install-command .cmd .pr { margin-right: 1ch; color: var(--uk-muted); user-select: none; }
.ukc-code-install-command .cmd b { font-weight: 600; }
.ukc-code-install-command .c-npm, .ukc-code-install-command .c-pnpm, .ukc-code-install-command .c-yarn { display: none; }
.ukc-code-install-command .r-npm:checked ~ .cmd .c-npm, .ukc-code-install-command .r-pnpm:checked ~ .cmd .c-pnpm, .ukc-code-install-command .r-yarn:checked ~ .cmd .c-yarn { display: inline; }
.ukc-code-install-command .go { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border: 0; border-radius: var(--uk-radius-sm); background: var(--uk-accent); color: var(--uk-accent-ink); cursor: pointer; transition: background-color var(--uk-motion-duration) var(--uk-motion-ease); }
.ukc-code-install-command .go:hover { background: color-mix(in srgb, var(--uk-accent) 86%, var(--uk-ink)); }
.ukc-code-install-command .go:focus-visible { outline: 2px solid var(--uk-accent); outline-offset: 2px; }
.ukc-code-install-command .meta { display: flex; flex-wrap: wrap; margin-top: 10px; color: var(--uk-muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.ukc-code-install-command .meta span + span::before { content: "·"; margin: 0 8px; }
@container (max-width: 340px) { .ukc-code-install-command .cmd { gap: 8px; padding-left: 12px; } .ukc-code-install-command .cmd code { font-size: 13.5px; } }
More code blocks
All 24- halden sync~/crews/reyes
$ halden sync --since monday Syncing 38 job sheets for Reyes Framing 31/38 ✓JS-2207Alder St refit22.5 h ✓JS-2211Garage roof, Pier Ln14.0 h !JS-2214Bathroom, Mill Lnno sign-off ✗JS-2216Back deck rebuildupload failed Uploading receipts, 4 of 9
src/totals.ts +4−1 @@ -12,3 +12,5 @@ function lineTotal export function lineTotal(l: Line) {− return l.qty * l.rate * (1 + TAX);+ const net = round(l.qty * l.rate); + const tax = round(net * l.taxRate); + return { net, tax, total: net + tax }; }@@ -24,2 +26,3 @@ export const round = (n: number) => + // To the cent, half away from zero Math.round(n * 100) / 100;- .halden.yml+4−3
Changes to .halden.yml. Version 3.1 on the left, version 3.2 on the right. v3.1 v3.2 1 invoices: 1 invoices: 2 prefix: INV 2 prefix: INV 3 − due_days: 14 3 + due_days: 30 4 rounding: line 4 rounding: line 5 − tax: 0.0825 5 + tax: 6 + rate: 0.0825 7 + labor: false 6 − legacy_pdf: true 7 reminders: on 8 reminders: on export default { crew: "reyes-framing", currency: "USD", rounding: "line", reminders: [7, 14, 30], // Sync offline sheets sync: { every: "15m" }, };TypeScriptLn 5, Col 25
- POST
/v2/invoicesCreate an invoice from a signed-off job sheet.Request
Authorization: Bearer $HALDEN_KEY Content-Type: application/json { "job": "JS-2207", "due_days": 30, "send": true }Response
{ "id": "inv_0418", "number": "INV-0418", "status": "sent", "total": 2140.00, "currency": "USD", "pdf": "/v2/invoices/inv_0418.pdf" }{ "error": "job_not_signed_off", "message": "JS-2207 has no sign-off yet", "field": "job" }201 Created · 184 ms422 Unprocessable · 61 ms
- job-sheet.json1.2 kB
{ 7 keys }
"id": "JS-2207","site": "14 Alder St","signed_off": true,"crew": [ 2 items ],
"Ines Ortega","Dana Whitfield"],"hours": { 3 keys },
"labor": 22.5,"travel": 1.5,"overtime": 0},"materials": [ 2 items ],
{ 3 keys },
"sku": "OAK-WT-30","qty": 1,"unit_cost": 41800},{ 3 keys }
"sku": "2x6-PT-12","qty": 40,"unit_cost": 1145}],"invoice": null}Path
$.materials[1].qty