unslopkit

Components / Code blocks

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

v3.2.018 kB gzippedNode 18 and up

Drawn in your kit, Plain.Change the look

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>

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

    Terminal mid-run

  • 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;

    Unified diff

  • .halden.yml+4−3
    Changes to .halden.yml. Version 3.1 on the left, version 3.2 on the right.
    v3.1v3.2
    1invoices:1invoices:
    2 prefix: INV2 prefix: INV
    3− due_days: 143+ due_days: 30
    4 rounding: line4 rounding: line
    5− tax: 0.08255+ tax:
    6+ rate: 0.0825
    7+ labor: false
    6− legacy_pdf: true
    7 reminders: on8 reminders: on

    Side-by-side diff

  • export default {
      crew: "reyes-framing",
      currency: "USD",
      rounding: "line",
      reminders: [7, 14, 30],
      // Sync offline sheets
      sync: { every: "15m" },
    };

    TypeScriptLn 5, Col 25

    File tree and editor

  • 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

    Request and response

  • 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

    Collapsible JSON