@tollerud/ui 1.1.5 → 3.0.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/AGENTS.md +34 -11
- package/CHANGELOG.md +376 -0
- package/COMPONENTS.md +951 -0
- package/GETTING_STARTED.md +159 -0
- package/README.md +51 -43
- package/SKILL.md +55 -21
- package/components.json +18 -0
- package/dist/accordion.d.ts +20 -0
- package/dist/accordion.js +5 -0
- package/dist/accordion.js.map +1 -0
- package/dist/action-diff.d.ts +26 -0
- package/dist/action-diff.js +5 -0
- package/dist/action-diff.js.map +1 -0
- package/dist/action-row.d.ts +36 -0
- package/dist/action-row.js +6 -0
- package/dist/action-row.js.map +1 -0
- package/dist/alert-inbox.d.ts +23 -0
- package/dist/alert-inbox.js +6 -0
- package/dist/alert-inbox.js.map +1 -0
- package/dist/alert.d.ts +33 -0
- package/dist/alert.js +5 -0
- package/dist/alert.js.map +1 -0
- package/dist/approval-card.d.ts +27 -0
- package/dist/approval-card.js +5 -0
- package/dist/approval-card.js.map +1 -0
- package/dist/area-chart.d.ts +10 -0
- package/dist/area-chart.js +5 -0
- package/dist/area-chart.js.map +1 -0
- package/dist/avatar.d.ts +27 -0
- package/dist/avatar.js +5 -0
- package/dist/avatar.js.map +1 -0
- package/dist/backup-status-panel.d.ts +25 -0
- package/dist/backup-status-panel.js +6 -0
- package/dist/backup-status-panel.js.map +1 -0
- package/dist/badge.d.ts +17 -0
- package/dist/badge.js +5 -0
- package/dist/badge.js.map +1 -0
- package/dist/bar-chart.d.ts +15 -0
- package/dist/bar-chart.js +5 -0
- package/dist/bar-chart.js.map +1 -0
- package/dist/bento-dashboard.d.ts +30 -0
- package/dist/bento-dashboard.js +5 -0
- package/dist/bento-dashboard.js.map +1 -0
- package/dist/breadcrumb.d.ts +16 -0
- package/dist/breadcrumb.js +5 -0
- package/dist/breadcrumb.js.map +1 -0
- package/dist/button.d.ts +29 -0
- package/dist/button.js +5 -0
- package/dist/button.js.map +1 -0
- package/dist/card.d.ts +10 -0
- package/dist/card.js +5 -0
- package/dist/card.js.map +1 -0
- package/dist/checkbox.d.ts +9 -0
- package/dist/checkbox.js +5 -0
- package/dist/checkbox.js.map +1 -0
- package/dist/chunk-2QWKOCWF.js +79 -0
- package/dist/chunk-2QWKOCWF.js.map +1 -0
- package/dist/chunk-3TGMGBKM.js +393 -0
- package/dist/chunk-3TGMGBKM.js.map +1 -0
- package/dist/chunk-3XTZPDNV.js +94 -0
- package/dist/chunk-3XTZPDNV.js.map +1 -0
- package/dist/chunk-435JHF7G.js +65 -0
- package/dist/chunk-435JHF7G.js.map +1 -0
- package/dist/chunk-4PA2ACNF.js +52 -0
- package/dist/chunk-4PA2ACNF.js.map +1 -0
- package/dist/chunk-5GWHUJ5D.js +29 -0
- package/dist/chunk-5GWHUJ5D.js.map +1 -0
- package/dist/chunk-6FUKJD3W.js +123 -0
- package/dist/chunk-6FUKJD3W.js.map +1 -0
- package/dist/chunk-6IS2AYYG.js +106 -0
- package/dist/chunk-6IS2AYYG.js.map +1 -0
- package/dist/chunk-6PZKU6ZL.js +78 -0
- package/dist/chunk-6PZKU6ZL.js.map +1 -0
- package/dist/chunk-6SKTH45H.js +75 -0
- package/dist/chunk-6SKTH45H.js.map +1 -0
- package/dist/chunk-6UXW5YUC.js +77 -0
- package/dist/chunk-6UXW5YUC.js.map +1 -0
- package/dist/chunk-7EP2T3OW.js +52 -0
- package/dist/chunk-7EP2T3OW.js.map +1 -0
- package/dist/chunk-7J5QXUQN.js +38 -0
- package/dist/chunk-7J5QXUQN.js.map +1 -0
- package/dist/chunk-7TOT5ME3.js +53 -0
- package/dist/chunk-7TOT5ME3.js.map +1 -0
- package/dist/chunk-A6L5C3IJ.js +47 -0
- package/dist/chunk-A6L5C3IJ.js.map +1 -0
- package/dist/chunk-ANW6J6PV.js +42 -0
- package/dist/chunk-ANW6J6PV.js.map +1 -0
- package/dist/chunk-APFFKNPS.js +80 -0
- package/dist/chunk-APFFKNPS.js.map +1 -0
- package/dist/chunk-AZADSX4Z.js +85 -0
- package/dist/chunk-AZADSX4Z.js.map +1 -0
- package/dist/chunk-BPCH5LJ3.js +36 -0
- package/dist/chunk-BPCH5LJ3.js.map +1 -0
- package/dist/chunk-CBQ63EBL.js +85 -0
- package/dist/chunk-CBQ63EBL.js.map +1 -0
- package/dist/chunk-CDI7353B.js +40 -0
- package/dist/chunk-CDI7353B.js.map +1 -0
- package/dist/chunk-CKNWXYMA.js +53 -0
- package/dist/chunk-CKNWXYMA.js.map +1 -0
- package/dist/chunk-DFM7UUKB.js +79 -0
- package/dist/chunk-DFM7UUKB.js.map +1 -0
- package/dist/chunk-DGCRHVWW.js +84 -0
- package/dist/chunk-DGCRHVWW.js.map +1 -0
- package/dist/chunk-DNJI65VQ.js +22 -0
- package/dist/chunk-DNJI65VQ.js.map +1 -0
- package/dist/chunk-DOUDJU4P.js +63 -0
- package/dist/chunk-DOUDJU4P.js.map +1 -0
- package/dist/chunk-DRCMGIQ6.js +64 -0
- package/dist/chunk-DRCMGIQ6.js.map +1 -0
- package/dist/chunk-DZOBXK2S.js +28 -0
- package/dist/chunk-DZOBXK2S.js.map +1 -0
- package/dist/chunk-EN4OJCEF.js +54 -0
- package/dist/chunk-EN4OJCEF.js.map +1 -0
- package/dist/chunk-EVHZFYWX.js +33 -0
- package/dist/chunk-EVHZFYWX.js.map +1 -0
- package/dist/chunk-FGXOV2QH.js +23 -0
- package/dist/chunk-FGXOV2QH.js.map +1 -0
- package/dist/chunk-G2VKWNZA.js +53 -0
- package/dist/chunk-G2VKWNZA.js.map +1 -0
- package/dist/chunk-GTM2DE4C.js +156 -0
- package/dist/chunk-GTM2DE4C.js.map +1 -0
- package/dist/chunk-H3ZVGTJM.js +165 -0
- package/dist/chunk-H3ZVGTJM.js.map +1 -0
- package/dist/chunk-HWAWUEHC.js +28 -0
- package/dist/chunk-HWAWUEHC.js.map +1 -0
- package/dist/chunk-HWJVRTWO.js +36 -0
- package/dist/chunk-HWJVRTWO.js.map +1 -0
- package/dist/chunk-HYQGOC2E.js +79 -0
- package/dist/chunk-HYQGOC2E.js.map +1 -0
- package/dist/chunk-ILADNTUB.js +77 -0
- package/dist/chunk-ILADNTUB.js.map +1 -0
- package/dist/chunk-ISHZ6ZPJ.js +31 -0
- package/dist/chunk-ISHZ6ZPJ.js.map +1 -0
- package/dist/chunk-JRFSUVSO.js +66 -0
- package/dist/chunk-JRFSUVSO.js.map +1 -0
- package/dist/chunk-KI6OTVID.js +91 -0
- package/dist/chunk-KI6OTVID.js.map +1 -0
- package/dist/chunk-LUM2YJBH.js +73 -0
- package/dist/chunk-LUM2YJBH.js.map +1 -0
- package/dist/chunk-NHPISZWS.js +71 -0
- package/dist/chunk-NHPISZWS.js.map +1 -0
- package/dist/chunk-NOLWJJHT.js +52 -0
- package/dist/chunk-NOLWJJHT.js.map +1 -0
- package/dist/chunk-NPVINX3Q.js +20 -0
- package/dist/chunk-NPVINX3Q.js.map +1 -0
- package/dist/chunk-NSMU66ZX.js +47 -0
- package/dist/chunk-NSMU66ZX.js.map +1 -0
- package/dist/chunk-O57QMLNI.js +68 -0
- package/dist/chunk-O57QMLNI.js.map +1 -0
- package/dist/chunk-O5SWPHUQ.js +79 -0
- package/dist/chunk-O5SWPHUQ.js.map +1 -0
- package/dist/chunk-OGVSZ7NV.js +53 -0
- package/dist/chunk-OGVSZ7NV.js.map +1 -0
- package/dist/chunk-OONIUDST.js +48 -0
- package/dist/chunk-OONIUDST.js.map +1 -0
- package/dist/chunk-PLF3BBQI.js +139 -0
- package/dist/chunk-PLF3BBQI.js.map +1 -0
- package/dist/chunk-Q74VRQEX.js +26 -0
- package/dist/chunk-Q74VRQEX.js.map +1 -0
- package/dist/chunk-QEHTPQHL.js +35 -0
- package/dist/chunk-QEHTPQHL.js.map +1 -0
- package/dist/chunk-RJTDQOT2.js +73 -0
- package/dist/chunk-RJTDQOT2.js.map +1 -0
- package/dist/chunk-RQ3RXKAZ.js +203 -0
- package/dist/chunk-RQ3RXKAZ.js.map +1 -0
- package/dist/chunk-RWJELAS6.js +46 -0
- package/dist/chunk-RWJELAS6.js.map +1 -0
- package/dist/chunk-RZK2S2OO.js +126 -0
- package/dist/chunk-RZK2S2OO.js.map +1 -0
- package/dist/chunk-SAP7JSSO.js +106 -0
- package/dist/chunk-SAP7JSSO.js.map +1 -0
- package/dist/chunk-T3TQPOVM.js +79 -0
- package/dist/chunk-T3TQPOVM.js.map +1 -0
- package/dist/chunk-T56TTOI6.js +53 -0
- package/dist/chunk-T56TTOI6.js.map +1 -0
- package/dist/chunk-T7EFDE2L.js +36 -0
- package/dist/chunk-T7EFDE2L.js.map +1 -0
- package/dist/chunk-V3P5QLLX.js +154 -0
- package/dist/chunk-V3P5QLLX.js.map +1 -0
- package/dist/chunk-VTRUUT5K.js +31 -0
- package/dist/chunk-VTRUUT5K.js.map +1 -0
- package/dist/chunk-WDANALHD.js +95 -0
- package/dist/chunk-WDANALHD.js.map +1 -0
- package/dist/chunk-WSQNPRGN.js +12 -0
- package/dist/chunk-WSQNPRGN.js.map +1 -0
- package/dist/chunk-XR5QBVEV.js +56 -0
- package/dist/chunk-XR5QBVEV.js.map +1 -0
- package/dist/chunk-YYWODLER.js +111 -0
- package/dist/chunk-YYWODLER.js.map +1 -0
- package/dist/chunk-ZOXO3G3I.js +50 -0
- package/dist/chunk-ZOXO3G3I.js.map +1 -0
- package/dist/code-block.d.ts +14 -0
- package/dist/code-block.js +5 -0
- package/dist/code-block.js.map +1 -0
- package/dist/combobox.d.ts +26 -0
- package/dist/combobox.js +5 -0
- package/dist/combobox.js.map +1 -0
- package/dist/command-menu.d.ts +52 -0
- package/dist/command-menu.js +7 -0
- package/dist/command-menu.js.map +1 -0
- package/dist/container.d.ts +9 -0
- package/dist/container.js +5 -0
- package/dist/container.js.map +1 -0
- package/dist/cta-band.d.ts +12 -0
- package/dist/cta-band.js +5 -0
- package/dist/cta-band.js.map +1 -0
- package/dist/data-table.d.ts +58 -0
- package/dist/data-table.js +12 -0
- package/dist/data-table.js.map +1 -0
- package/dist/date-picker.d.ts +20 -0
- package/dist/date-picker.js +5 -0
- package/dist/date-picker.js.map +1 -0
- package/dist/dialog.d.ts +21 -0
- package/dist/dialog.js +5 -0
- package/dist/dialog.js.map +1 -0
- package/dist/divider.d.ts +12 -0
- package/dist/divider.js +5 -0
- package/dist/divider.js.map +1 -0
- package/dist/docker-stack-card.d.ts +21 -0
- package/dist/docker-stack-card.js +6 -0
- package/dist/docker-stack-card.js.map +1 -0
- package/dist/donut.d.ts +15 -0
- package/dist/donut.js +5 -0
- package/dist/donut.js.map +1 -0
- package/dist/dropdown-menu.d.ts +15 -0
- package/dist/dropdown-menu.js +5 -0
- package/dist/dropdown-menu.js.map +1 -0
- package/dist/empty.d.ts +12 -0
- package/dist/empty.js +5 -0
- package/dist/empty.js.map +1 -0
- package/dist/feature-card.d.ts +11 -0
- package/dist/feature-card.js +6 -0
- package/dist/feature-card.js.map +1 -0
- package/dist/file-upload.d.ts +20 -0
- package/dist/file-upload.js +5 -0
- package/dist/file-upload.js.map +1 -0
- package/dist/footer.d.ts +35 -0
- package/dist/footer.js +5 -0
- package/dist/footer.js.map +1 -0
- package/dist/form-row.d.ts +15 -0
- package/dist/form-row.js +5 -0
- package/dist/form-row.js.map +1 -0
- package/dist/glow-card.d.ts +14 -0
- package/dist/glow-card.js +5 -0
- package/dist/glow-card.js.map +1 -0
- package/dist/hero-block.d.ts +16 -0
- package/dist/hero-block.js +7 -0
- package/dist/hero-block.js.map +1 -0
- package/dist/host-card.d.ts +27 -0
- package/dist/host-card.js +6 -0
- package/dist/host-card.js.map +1 -0
- package/dist/incident-card.d.ts +23 -0
- package/dist/incident-card.js +5 -0
- package/dist/incident-card.js.map +1 -0
- package/dist/index.d.ts +76 -960
- package/dist/index.js +68 -3812
- package/dist/index.js.map +1 -1
- package/dist/input.d.ts +10 -0
- package/dist/input.js +5 -0
- package/dist/input.js.map +1 -0
- package/dist/kbd.d.ts +24 -0
- package/dist/kbd.js +5 -0
- package/dist/kbd.js.map +1 -0
- package/dist/log-viewer.d.ts +35 -0
- package/dist/log-viewer.js +5 -0
- package/dist/log-viewer.js.map +1 -0
- package/dist/meter.d.ts +23 -0
- package/dist/meter.js +5 -0
- package/dist/meter.js.map +1 -0
- package/dist/noir-glow-background.d.ts +50 -0
- package/dist/noir-glow-background.js +4 -0
- package/dist/noir-glow-background.js.map +1 -0
- package/dist/pagination.d.ts +16 -0
- package/dist/pagination.js +5 -0
- package/dist/pagination.js.map +1 -0
- package/dist/panel.d.ts +12 -0
- package/dist/panel.js +5 -0
- package/dist/panel.js.map +1 -0
- package/dist/password-input.d.ts +10 -0
- package/dist/password-input.js +5 -0
- package/dist/password-input.js.map +1 -0
- package/dist/pill.d.ts +14 -0
- package/dist/pill.js +5 -0
- package/dist/pill.js.map +1 -0
- package/dist/pricing-card.d.ts +20 -0
- package/dist/pricing-card.js +6 -0
- package/dist/pricing-card.js.map +1 -0
- package/dist/progress.d.ts +6 -0
- package/dist/progress.js +5 -0
- package/dist/progress.js.map +1 -0
- package/dist/radio-group.d.ts +18 -0
- package/dist/radio-group.js +5 -0
- package/dist/radio-group.js.map +1 -0
- package/dist/rollback-plan.d.ts +23 -0
- package/dist/rollback-plan.js +5 -0
- package/dist/rollback-plan.js.map +1 -0
- package/dist/segmented.d.ts +17 -0
- package/dist/segmented.js +5 -0
- package/dist/segmented.js.map +1 -0
- package/dist/select.d.ts +18 -0
- package/dist/select.js +5 -0
- package/dist/select.js.map +1 -0
- package/dist/service-health-card.d.ts +21 -0
- package/dist/service-health-card.js +6 -0
- package/dist/service-health-card.js.map +1 -0
- package/dist/sheet.d.ts +25 -0
- package/dist/sheet.js +5 -0
- package/dist/sheet.js.map +1 -0
- package/dist/skeleton.d.ts +5 -0
- package/dist/skeleton.js +5 -0
- package/dist/skeleton.js.map +1 -0
- package/dist/slider.d.ts +12 -0
- package/dist/slider.js +5 -0
- package/dist/slider.js.map +1 -0
- package/dist/sparkline.d.ts +16 -0
- package/dist/sparkline.js +5 -0
- package/dist/sparkline.js.map +1 -0
- package/dist/stat-card.d.ts +15 -0
- package/dist/stat-card.js +5 -0
- package/dist/stat-card.js.map +1 -0
- package/dist/status-dot.d.ts +13 -0
- package/dist/status-dot.js +5 -0
- package/dist/status-dot.js.map +1 -0
- package/dist/stepper.d.ts +16 -0
- package/dist/stepper.js +5 -0
- package/dist/stepper.js.map +1 -0
- package/dist/switch.d.ts +9 -0
- package/dist/switch.js +5 -0
- package/dist/switch.js.map +1 -0
- package/dist/tabs.d.ts +9 -0
- package/dist/tabs.js +5 -0
- package/dist/tabs.js.map +1 -0
- package/dist/tag-input.d.ts +20 -0
- package/dist/tag-input.js +5 -0
- package/dist/tag-input.js.map +1 -0
- package/dist/textarea.d.ts +10 -0
- package/dist/textarea.js +5 -0
- package/dist/textarea.js.map +1 -0
- package/dist/timeline.d.ts +30 -0
- package/dist/timeline.js +5 -0
- package/dist/timeline.js.map +1 -0
- package/dist/toaster.d.ts +10 -0
- package/dist/toaster.js +4 -0
- package/dist/toaster.js.map +1 -0
- package/dist/tooltip.d.ts +12 -0
- package/dist/tooltip.js +5 -0
- package/dist/tooltip.js.map +1 -0
- package/dist/utils.d.ts +5 -0
- package/dist/utils.js +4 -0
- package/dist/utils.js.map +1 -0
- package/globals-layers.css +935 -0
- package/globals-v3.css +17 -0
- package/globals-v4.css +2 -0
- package/globals.css +12 -939
- package/package.json +82 -16
- package/registry.json +920 -0
- package/tailwind.css +9 -0
- package/dist/index.cjs +0 -3938
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -960
package/dist/index.cjs
DELETED
|
@@ -1,3938 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
var clsx = require('clsx');
|
|
5
|
-
var tailwindMerge = require('tailwind-merge');
|
|
6
|
-
var React2 = require('react');
|
|
7
|
-
var reactSlot = require('@radix-ui/react-slot');
|
|
8
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
9
|
-
var framerMotion = require('framer-motion');
|
|
10
|
-
var DialogPrimitive = require('@radix-ui/react-dialog');
|
|
11
|
-
var lucideReact = require('lucide-react');
|
|
12
|
-
var TooltipPrimitive = require('@radix-ui/react-tooltip');
|
|
13
|
-
var TabsPrimitive = require('@radix-ui/react-tabs');
|
|
14
|
-
var ProgressPrimitive = require('@radix-ui/react-progress');
|
|
15
|
-
var sonner = require('sonner');
|
|
16
|
-
var DropdownMenuPrimitive = require('@radix-ui/react-dropdown-menu');
|
|
17
|
-
|
|
18
|
-
function _interopNamespace(e) {
|
|
19
|
-
if (e && e.__esModule) return e;
|
|
20
|
-
var n = Object.create(null);
|
|
21
|
-
if (e) {
|
|
22
|
-
Object.keys(e).forEach(function (k) {
|
|
23
|
-
if (k !== 'default') {
|
|
24
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
25
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
26
|
-
enumerable: true,
|
|
27
|
-
get: function () { return e[k]; }
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
n.default = e;
|
|
33
|
-
return Object.freeze(n);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
var React2__namespace = /*#__PURE__*/_interopNamespace(React2);
|
|
37
|
-
var DialogPrimitive__namespace = /*#__PURE__*/_interopNamespace(DialogPrimitive);
|
|
38
|
-
var TooltipPrimitive__namespace = /*#__PURE__*/_interopNamespace(TooltipPrimitive);
|
|
39
|
-
var TabsPrimitive__namespace = /*#__PURE__*/_interopNamespace(TabsPrimitive);
|
|
40
|
-
var ProgressPrimitive__namespace = /*#__PURE__*/_interopNamespace(ProgressPrimitive);
|
|
41
|
-
var DropdownMenuPrimitive__namespace = /*#__PURE__*/_interopNamespace(DropdownMenuPrimitive);
|
|
42
|
-
|
|
43
|
-
// lib/utils.ts
|
|
44
|
-
function cn(...inputs) {
|
|
45
|
-
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
46
|
-
}
|
|
47
|
-
var variants = {
|
|
48
|
-
primary: "bg-tollerud-yellow text-tollerud-black border-tollerud-yellow hover:bg-tollerud-yellow hover:shadow-tollerud-glow",
|
|
49
|
-
secondary: "bg-transparent text-tollerud-text-primary border-tollerud-border hover:border-tollerud-text-secondary hover:bg-tollerud-surface-hover",
|
|
50
|
-
ghost: "bg-transparent text-tollerud-text-secondary border-transparent hover:text-tollerud-text-primary hover:bg-tollerud-surface-hover",
|
|
51
|
-
destructive: "bg-tollerud-error text-white border-tollerud-error hover:shadow-[0_0_12px_rgba(239,68,68,0.3)]",
|
|
52
|
-
terminal: 'font-mono text-tollerud-yellow border-[rgba(255,255,0,0.25)] bg-transparent before:content-["\u276F_"] before:opacity-70 hover:border-tollerud-yellow hover:shadow-tollerud-glow hover:bg-[rgba(255,255,0,0.05)]'
|
|
53
|
-
};
|
|
54
|
-
var sizes = {
|
|
55
|
-
sm: "px-3 py-1 text-sm",
|
|
56
|
-
md: "px-4 py-2 text-base",
|
|
57
|
-
lg: "px-6 py-3 text-lg"
|
|
58
|
-
};
|
|
59
|
-
function buttonVariants({ variant = "secondary", size = "md", className } = {}) {
|
|
60
|
-
return cn(
|
|
61
|
-
"inline-flex items-center justify-center gap-2 font-semibold rounded transition-all duration-[150ms] focus-visible:outline-2 focus-visible:outline-tollerud-yellow focus-visible:outline-offset-2",
|
|
62
|
-
"border cursor-pointer",
|
|
63
|
-
"disabled:opacity-50 disabled:pointer-events-none",
|
|
64
|
-
variants[variant],
|
|
65
|
-
sizes[size],
|
|
66
|
-
className
|
|
67
|
-
);
|
|
68
|
-
}
|
|
69
|
-
var Button = React2.forwardRef(
|
|
70
|
-
({ className, variant = "secondary", size = "md", asChild = false, ...props }, ref) => {
|
|
71
|
-
const Comp = asChild ? reactSlot.Slot : "button";
|
|
72
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
73
|
-
Comp,
|
|
74
|
-
{
|
|
75
|
-
ref,
|
|
76
|
-
className: buttonVariants({ variant, size, className }),
|
|
77
|
-
...props
|
|
78
|
-
}
|
|
79
|
-
);
|
|
80
|
-
}
|
|
81
|
-
);
|
|
82
|
-
Button.displayName = "Button";
|
|
83
|
-
var toneStyles = {
|
|
84
|
-
default: { wrapper: "border-tollerud-border bg-tollerud-surface-raised", icon: "text-tollerud-text-muted" },
|
|
85
|
-
accent: { wrapper: "border-tollerud-yellow/30 bg-tollerud-yellow/5", icon: "text-tollerud-yellow" },
|
|
86
|
-
info: { wrapper: "border-blue-500/30 bg-blue-500/5", icon: "text-blue-400" },
|
|
87
|
-
success: { wrapper: "border-green-500/30 bg-green-500/5", icon: "text-green-400" },
|
|
88
|
-
error: { wrapper: "border-red-500/30 bg-red-500/5", icon: "text-red-400" }
|
|
89
|
-
};
|
|
90
|
-
var Alert = React2.forwardRef(
|
|
91
|
-
({ className, tone = "default", title, icon, children, ...props }, ref) => {
|
|
92
|
-
const styles = toneStyles[tone];
|
|
93
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
94
|
-
"div",
|
|
95
|
-
{
|
|
96
|
-
ref,
|
|
97
|
-
role: "alert",
|
|
98
|
-
className: cn(
|
|
99
|
-
"flex gap-3 rounded-md border p-4",
|
|
100
|
-
styles.wrapper,
|
|
101
|
-
className
|
|
102
|
-
),
|
|
103
|
-
...props,
|
|
104
|
-
children: [
|
|
105
|
-
icon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn("mt-0.5 flex-shrink-0 w-[18px] h-[18px]", styles.icon), children: icon }),
|
|
106
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0", children: [
|
|
107
|
-
title && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-semibold text-tollerud-text-primary leading-snug", children: title }),
|
|
108
|
-
children && /* @__PURE__ */ jsxRuntime.jsx("p", { className: cn("text-sm text-tollerud-text-secondary leading-relaxed", title && "mt-1"), children })
|
|
109
|
-
] })
|
|
110
|
-
]
|
|
111
|
-
}
|
|
112
|
-
);
|
|
113
|
-
}
|
|
114
|
-
);
|
|
115
|
-
Alert.displayName = "Alert";
|
|
116
|
-
var Card = React2.forwardRef(
|
|
117
|
-
({ className, accent, density, ...props }, ref) => {
|
|
118
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
119
|
-
"div",
|
|
120
|
-
{
|
|
121
|
-
ref,
|
|
122
|
-
"data-density": density ?? void 0,
|
|
123
|
-
className: cn(
|
|
124
|
-
"rounded-lg border bg-tollerud-surface-raised p-6 transition-[border-color] duration-[150ms]",
|
|
125
|
-
accent ? "border-tollerud-yellow/25" : "border-tollerud-border",
|
|
126
|
-
"hover:border-tollerud-noir-500",
|
|
127
|
-
className
|
|
128
|
-
),
|
|
129
|
-
...props
|
|
130
|
-
}
|
|
131
|
-
);
|
|
132
|
-
}
|
|
133
|
-
);
|
|
134
|
-
Card.displayName = "Card";
|
|
135
|
-
var badgeVariants = {
|
|
136
|
-
default: "bg-tollerud-noir-700 text-tollerud-text-secondary",
|
|
137
|
-
accent: "bg-tollerud-yellow/15 text-tollerud-yellow",
|
|
138
|
-
success: "bg-tollerud-success/15 text-tollerud-success",
|
|
139
|
-
error: "bg-tollerud-error/15 text-tollerud-error",
|
|
140
|
-
info: "bg-tollerud-info/15 text-tollerud-info",
|
|
141
|
-
warning: "bg-tollerud-yellow/15 text-tollerud-warning"
|
|
142
|
-
};
|
|
143
|
-
var Badge = React2.forwardRef(
|
|
144
|
-
({ className, variant = "default", ...props }, ref) => {
|
|
145
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
146
|
-
"span",
|
|
147
|
-
{
|
|
148
|
-
ref,
|
|
149
|
-
className: cn(
|
|
150
|
-
"inline-flex items-center px-2 py-0.5 text-xs font-medium rounded",
|
|
151
|
-
"tracking-wide",
|
|
152
|
-
badgeVariants[variant],
|
|
153
|
-
className
|
|
154
|
-
),
|
|
155
|
-
...props
|
|
156
|
-
}
|
|
157
|
-
);
|
|
158
|
-
}
|
|
159
|
-
);
|
|
160
|
-
Badge.displayName = "Badge";
|
|
161
|
-
var statusColors = {
|
|
162
|
-
online: "bg-tollerud-success",
|
|
163
|
-
offline: "bg-tollerud-error",
|
|
164
|
-
warning: "bg-tollerud-yellow",
|
|
165
|
-
idle: "bg-tollerud-noir-400"
|
|
166
|
-
};
|
|
167
|
-
var pulseColors = {
|
|
168
|
-
online: "rgba(34,197,94,0.5)",
|
|
169
|
-
warning: "rgba(232,213,0,0.45)",
|
|
170
|
-
offline: "rgba(239,68,68,0.5)"
|
|
171
|
-
};
|
|
172
|
-
var animationKeyframes = `
|
|
173
|
-
@keyframes tollerud-dot-pulse {
|
|
174
|
-
0%, 100% { box-shadow: 0 0 0 0 var(--pulse-color, rgba(34,197,94,0.5)); }
|
|
175
|
-
50% { box-shadow: 0 0 0 5px var(--pulse-color, rgba(34,197,94,0)); }
|
|
176
|
-
}
|
|
177
|
-
`;
|
|
178
|
-
var StatusDot = React2.forwardRef(
|
|
179
|
-
({ className, status = "idle", label, noPulse, ...props }, ref) => {
|
|
180
|
-
const shouldPulse = !noPulse && (status === "online" || status === "warning" || status === "offline");
|
|
181
|
-
const pulseColor = pulseColors[status];
|
|
182
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
183
|
-
"span",
|
|
184
|
-
{
|
|
185
|
-
ref,
|
|
186
|
-
className: cn("inline-flex items-center gap-1.5 text-xs font-medium", className),
|
|
187
|
-
...props,
|
|
188
|
-
children: [
|
|
189
|
-
/* @__PURE__ */ jsxRuntime.jsx("style", { children: animationKeyframes }),
|
|
190
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
191
|
-
framerMotion.motion.span,
|
|
192
|
-
{
|
|
193
|
-
layout: true,
|
|
194
|
-
animate: {
|
|
195
|
-
scaleX: [1, 1.6, 1],
|
|
196
|
-
scaleY: [1, 0.6, 1]
|
|
197
|
-
},
|
|
198
|
-
transition: {
|
|
199
|
-
duration: 0.4,
|
|
200
|
-
ease: "easeOut",
|
|
201
|
-
times: [0, 0.3, 1]
|
|
202
|
-
},
|
|
203
|
-
className: cn(
|
|
204
|
-
"inline-block w-2 h-2 rounded-full",
|
|
205
|
-
statusColors[status],
|
|
206
|
-
shouldPulse && "animate-tollerud-dot-pulse"
|
|
207
|
-
),
|
|
208
|
-
style: {
|
|
209
|
-
...shouldPulse && pulseColor ? { "--pulse-color": pulseColor } : {},
|
|
210
|
-
animation: shouldPulse ? "tollerud-dot-pulse 2s ease-in-out infinite" : void 0
|
|
211
|
-
}
|
|
212
|
-
},
|
|
213
|
-
status
|
|
214
|
-
),
|
|
215
|
-
label && /* @__PURE__ */ jsxRuntime.jsx("span", { children: label })
|
|
216
|
-
]
|
|
217
|
-
}
|
|
218
|
-
);
|
|
219
|
-
}
|
|
220
|
-
);
|
|
221
|
-
StatusDot.displayName = "StatusDot";
|
|
222
|
-
var Input = React2.forwardRef(
|
|
223
|
-
({ className, label, error, id, ...props }, ref) => {
|
|
224
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
225
|
-
label && /* @__PURE__ */ jsxRuntime.jsx("label", { htmlFor: id, className: "text-xs font-medium text-tollerud-text-muted", children: label }),
|
|
226
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
227
|
-
"input",
|
|
228
|
-
{
|
|
229
|
-
ref,
|
|
230
|
-
id,
|
|
231
|
-
className: cn(
|
|
232
|
-
"font-sans text-base px-3 py-2 rounded",
|
|
233
|
-
"bg-tollerud-surface-raised border",
|
|
234
|
-
"text-tollerud-text-primary",
|
|
235
|
-
"placeholder:text-tollerud-text-muted",
|
|
236
|
-
"transition-[border-color] duration-[150ms]",
|
|
237
|
-
"focus:outline-none focus:border-tollerud-yellow focus:shadow-[0_0_0_1px_#E8D500]",
|
|
238
|
-
error ? "border-tollerud-error" : "border-tollerud-border",
|
|
239
|
-
className
|
|
240
|
-
),
|
|
241
|
-
...props
|
|
242
|
-
}
|
|
243
|
-
),
|
|
244
|
-
error && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-tollerud-error mt-0.5", children: error })
|
|
245
|
-
] });
|
|
246
|
-
}
|
|
247
|
-
);
|
|
248
|
-
Input.displayName = "Input";
|
|
249
|
-
var CodeBlock = React2.forwardRef(
|
|
250
|
-
({ className, children, code, promptPrefix, showCopy = true, ...props }, ref) => {
|
|
251
|
-
const [copied, setCopied] = React2.useState(false);
|
|
252
|
-
const content = code ? /* @__PURE__ */ jsxRuntime.jsx("code", { className: "text-tollerud-noir-200", children: code }) : children;
|
|
253
|
-
const handleCopy = React2.useCallback(async () => {
|
|
254
|
-
const text = code ?? (typeof children === "string" ? children : "");
|
|
255
|
-
if (!text) return;
|
|
256
|
-
try {
|
|
257
|
-
await navigator.clipboard.writeText(text);
|
|
258
|
-
} catch {
|
|
259
|
-
const textarea = document.createElement("textarea");
|
|
260
|
-
textarea.value = text;
|
|
261
|
-
textarea.style.position = "fixed";
|
|
262
|
-
textarea.style.opacity = "0";
|
|
263
|
-
document.body.appendChild(textarea);
|
|
264
|
-
textarea.select();
|
|
265
|
-
document.execCommand("copy");
|
|
266
|
-
document.body.removeChild(textarea);
|
|
267
|
-
}
|
|
268
|
-
setCopied(true);
|
|
269
|
-
setTimeout(() => setCopied(false), 1500);
|
|
270
|
-
}, [code, children]);
|
|
271
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative group", children: [
|
|
272
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
273
|
-
"pre",
|
|
274
|
-
{
|
|
275
|
-
ref,
|
|
276
|
-
className: cn(
|
|
277
|
-
"font-mono text-sm leading-relaxed overflow-x-auto rounded border p-4",
|
|
278
|
-
"bg-tollerud-noir-900 border-tollerud-border text-tollerud-noir-200",
|
|
279
|
-
className
|
|
280
|
-
),
|
|
281
|
-
...props,
|
|
282
|
-
children: content
|
|
283
|
-
}
|
|
284
|
-
),
|
|
285
|
-
showCopy && /* @__PURE__ */ jsxRuntime.jsx(
|
|
286
|
-
"button",
|
|
287
|
-
{
|
|
288
|
-
onClick: handleCopy,
|
|
289
|
-
className: cn(
|
|
290
|
-
"absolute top-2 right-2 px-2 py-1 rounded text-xs font-medium",
|
|
291
|
-
"opacity-0 group-hover:opacity-100 transition-all",
|
|
292
|
-
"bg-tollerud-noir-800 border border-tollerud-border/30 text-tollerud-text-muted",
|
|
293
|
-
"hover:bg-tollerud-surface-raised hover:text-tollerud-text-primary",
|
|
294
|
-
copied && "opacity-100 bg-tollerud-success/15 text-tollerud-success border-tollerud-success/40"
|
|
295
|
-
),
|
|
296
|
-
"aria-label": copied ? "Copied" : "Copy code",
|
|
297
|
-
children: copied ? "\u2713 Copied" : "Copy"
|
|
298
|
-
}
|
|
299
|
-
)
|
|
300
|
-
] });
|
|
301
|
-
}
|
|
302
|
-
);
|
|
303
|
-
CodeBlock.displayName = "CodeBlock";
|
|
304
|
-
var StatCard = React2.forwardRef(
|
|
305
|
-
({ className, label, value, change, accent, ...props }, ref) => {
|
|
306
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
307
|
-
"div",
|
|
308
|
-
{
|
|
309
|
-
ref,
|
|
310
|
-
className: cn(
|
|
311
|
-
"group relative rounded-lg border p-4",
|
|
312
|
-
"bg-tollerud-surface-raised",
|
|
313
|
-
"transition-all duration-200 ease-out",
|
|
314
|
-
"hover:translate-y-[-1px]",
|
|
315
|
-
accent ? "border-tollerud-yellow/20 hover:border-tollerud-yellow/40 hover:shadow-[0_0_20px_rgba(232,213,0,0.08)]" : "border-tollerud-border hover:border-tollerud-noir-500 hover:shadow-[0_4px_12px_rgba(0,0,0,0.3)]",
|
|
316
|
-
className
|
|
317
|
-
),
|
|
318
|
-
...props,
|
|
319
|
-
children: [
|
|
320
|
-
accent && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute top-0 left-4 right-4 h-px bg-gradient-to-r from-transparent via-tollerud-yellow/60 to-transparent" }),
|
|
321
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-2", children: [
|
|
322
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs font-medium uppercase tracking-wider text-tollerud-text-muted", children: label }),
|
|
323
|
-
change && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
324
|
-
"span",
|
|
325
|
-
{
|
|
326
|
-
className: cn(
|
|
327
|
-
"inline-flex items-center gap-0.5 text-[11px] font-semibold whitespace-nowrap",
|
|
328
|
-
change.direction === "up" ? "text-tollerud-success" : "text-tollerud-error"
|
|
329
|
-
),
|
|
330
|
-
children: [
|
|
331
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
332
|
-
"svg",
|
|
333
|
-
{
|
|
334
|
-
className: cn(
|
|
335
|
-
"w-3 h-3",
|
|
336
|
-
change.direction === "down" && "rotate-180"
|
|
337
|
-
),
|
|
338
|
-
viewBox: "0 0 24 24",
|
|
339
|
-
fill: "none",
|
|
340
|
-
stroke: "currentColor",
|
|
341
|
-
strokeWidth: 2.5,
|
|
342
|
-
strokeLinecap: "round",
|
|
343
|
-
strokeLinejoin: "round",
|
|
344
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 5v14M5 12l7 7 7-7" })
|
|
345
|
-
}
|
|
346
|
-
),
|
|
347
|
-
change.value
|
|
348
|
-
]
|
|
349
|
-
}
|
|
350
|
-
)
|
|
351
|
-
] }),
|
|
352
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
353
|
-
"p",
|
|
354
|
-
{
|
|
355
|
-
className: cn(
|
|
356
|
-
"text-2xl font-bold tracking-tight mt-1",
|
|
357
|
-
accent ? "text-tollerud-yellow" : "text-tollerud-text-primary"
|
|
358
|
-
),
|
|
359
|
-
children: value
|
|
360
|
-
}
|
|
361
|
-
)
|
|
362
|
-
]
|
|
363
|
-
}
|
|
364
|
-
);
|
|
365
|
-
}
|
|
366
|
-
);
|
|
367
|
-
StatCard.displayName = "StatCard";
|
|
368
|
-
var Container = React2.forwardRef(
|
|
369
|
-
({ className, as: Tag = "div", ...props }, ref) => {
|
|
370
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
371
|
-
Tag,
|
|
372
|
-
{
|
|
373
|
-
ref,
|
|
374
|
-
className: cn("mx-auto w-full max-w-[1100px] px-6", className),
|
|
375
|
-
...props
|
|
376
|
-
}
|
|
377
|
-
);
|
|
378
|
-
}
|
|
379
|
-
);
|
|
380
|
-
Container.displayName = "Container";
|
|
381
|
-
var GrainGradient = React2.lazy(
|
|
382
|
-
() => import('@paper-design/shaders-react').then((module) => ({
|
|
383
|
-
default: module.GrainGradient
|
|
384
|
-
}))
|
|
385
|
-
);
|
|
386
|
-
var intensityMap = {
|
|
387
|
-
subtle: 0.24,
|
|
388
|
-
medium: 0.45,
|
|
389
|
-
loud: 0.68
|
|
390
|
-
};
|
|
391
|
-
var speedMap = {
|
|
392
|
-
still: 0,
|
|
393
|
-
slow: 0.45,
|
|
394
|
-
medium: 1,
|
|
395
|
-
fast: 1.8
|
|
396
|
-
};
|
|
397
|
-
var grainMap = {
|
|
398
|
-
none: 0,
|
|
399
|
-
soft: 0.12,
|
|
400
|
-
high: 0.28
|
|
401
|
-
};
|
|
402
|
-
function cx(...classes) {
|
|
403
|
-
return classes.filter(Boolean).join(" ");
|
|
404
|
-
}
|
|
405
|
-
function CssFallback({ preserveCenter = true, noiseOverlay = true }) {
|
|
406
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
407
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "tollerud-noir-glow-bg", "aria-hidden": "true" }),
|
|
408
|
-
preserveCenter && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tollerud-noir-glow-vignette", "aria-hidden": "true" }),
|
|
409
|
-
noiseOverlay && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tollerud-noir-noise", "aria-hidden": "true" })
|
|
410
|
-
] });
|
|
411
|
-
}
|
|
412
|
-
function NoirGlowBackground({
|
|
413
|
-
className,
|
|
414
|
-
style,
|
|
415
|
-
shape = "corners",
|
|
416
|
-
intensity = "medium",
|
|
417
|
-
speed = "medium",
|
|
418
|
-
grain = "none",
|
|
419
|
-
softness = 0.76,
|
|
420
|
-
colorBack = "hsl(0, 0%, 0%)",
|
|
421
|
-
colors = ["hsl(54, 85%, 66%)", "hsl(56, 100%, 80%)", "hsl(56, 100%, 50%)"],
|
|
422
|
-
preserveCenter = false,
|
|
423
|
-
noiseOverlay = false,
|
|
424
|
-
forceCssFallback = false,
|
|
425
|
-
inert = true
|
|
426
|
-
}) {
|
|
427
|
-
const wrapperClassName = cx(
|
|
428
|
-
"tollerud-noir-glow-root absolute inset-0 z-0 overflow-hidden",
|
|
429
|
-
inert && "pointer-events-none",
|
|
430
|
-
className
|
|
431
|
-
);
|
|
432
|
-
if (forceCssFallback) {
|
|
433
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: wrapperClassName, style, "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx(CssFallback, { preserveCenter, noiseOverlay }) });
|
|
434
|
-
}
|
|
435
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: wrapperClassName, style, "aria-hidden": "true", children: [
|
|
436
|
-
/* @__PURE__ */ jsxRuntime.jsx(React2.Suspense, { fallback: /* @__PURE__ */ jsxRuntime.jsx(CssFallback, { preserveCenter, noiseOverlay }), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
437
|
-
GrainGradient,
|
|
438
|
-
{
|
|
439
|
-
style: { height: "100%", width: "100%" },
|
|
440
|
-
colorBack,
|
|
441
|
-
softness,
|
|
442
|
-
intensity: intensityMap[intensity],
|
|
443
|
-
noise: grainMap[grain],
|
|
444
|
-
shape,
|
|
445
|
-
offsetX: 0,
|
|
446
|
-
offsetY: 0,
|
|
447
|
-
scale: 1,
|
|
448
|
-
rotation: 0,
|
|
449
|
-
speed: speedMap[speed],
|
|
450
|
-
colors
|
|
451
|
-
}
|
|
452
|
-
) }),
|
|
453
|
-
preserveCenter && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tollerud-noir-glow-vignette", "aria-hidden": "true" }),
|
|
454
|
-
noiseOverlay && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tollerud-noir-noise", "aria-hidden": "true" })
|
|
455
|
-
] });
|
|
456
|
-
}
|
|
457
|
-
var Kbd = React2.forwardRef(
|
|
458
|
-
({ className, keys, size = "md", ...props }, ref) => {
|
|
459
|
-
const keyArray = typeof keys === "string" ? [keys] : keys;
|
|
460
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
461
|
-
"span",
|
|
462
|
-
{
|
|
463
|
-
ref,
|
|
464
|
-
className: cn(
|
|
465
|
-
"tollerud-kbd",
|
|
466
|
-
size === "sm" && "tollerud-kbd--sm",
|
|
467
|
-
className
|
|
468
|
-
),
|
|
469
|
-
...props,
|
|
470
|
-
children: keyArray.map((key, i) => /* @__PURE__ */ jsxRuntime.jsx("span", { className: "tollerud-kbd__key", children: key }, i))
|
|
471
|
-
}
|
|
472
|
-
);
|
|
473
|
-
}
|
|
474
|
-
);
|
|
475
|
-
Kbd.displayName = "Kbd";
|
|
476
|
-
var ActionRow = React2.forwardRef(
|
|
477
|
-
({
|
|
478
|
-
action,
|
|
479
|
-
highlighted = false,
|
|
480
|
-
showShortcut = true,
|
|
481
|
-
className,
|
|
482
|
-
disabled,
|
|
483
|
-
onClick,
|
|
484
|
-
...props
|
|
485
|
-
}, ref) => {
|
|
486
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
487
|
-
"button",
|
|
488
|
-
{
|
|
489
|
-
ref,
|
|
490
|
-
type: "button",
|
|
491
|
-
disabled: disabled ?? action.disabled,
|
|
492
|
-
onClick: (e) => {
|
|
493
|
-
onClick?.(e);
|
|
494
|
-
action.onSelect?.();
|
|
495
|
-
},
|
|
496
|
-
className: cn(
|
|
497
|
-
"tollerud-action-row",
|
|
498
|
-
highlighted && "tollerud-action-row--highlighted",
|
|
499
|
-
(disabled ?? action.disabled) && "tollerud-action-row--disabled",
|
|
500
|
-
className
|
|
501
|
-
),
|
|
502
|
-
role: "option",
|
|
503
|
-
"aria-selected": highlighted,
|
|
504
|
-
"aria-disabled": disabled ?? action.disabled,
|
|
505
|
-
...props,
|
|
506
|
-
children: [
|
|
507
|
-
action.icon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "tollerud-action-row__icon", children: action.icon }),
|
|
508
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "tollerud-action-row__content", children: [
|
|
509
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "tollerud-action-row__label", children: action.label }),
|
|
510
|
-
action.description && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "tollerud-action-row__description", children: action.description })
|
|
511
|
-
] }),
|
|
512
|
-
showShortcut && action.shortcut && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "tollerud-action-row__shortcut", children: /* @__PURE__ */ jsxRuntime.jsx(Kbd, { keys: action.shortcut, size: "sm" }) })
|
|
513
|
-
]
|
|
514
|
-
}
|
|
515
|
-
);
|
|
516
|
-
}
|
|
517
|
-
);
|
|
518
|
-
ActionRow.displayName = "ActionRow";
|
|
519
|
-
var CommandMenu = React2.forwardRef(
|
|
520
|
-
({
|
|
521
|
-
open,
|
|
522
|
-
onOpenChange,
|
|
523
|
-
groups,
|
|
524
|
-
placeholder = "Type a command\u2026",
|
|
525
|
-
emptyMessage = "No matching commands",
|
|
526
|
-
className,
|
|
527
|
-
filter: customFilter,
|
|
528
|
-
onAction
|
|
529
|
-
}, ref) => {
|
|
530
|
-
const [query, setQuery] = React2.useState("");
|
|
531
|
-
const [selectedIndex, setSelectedIndex] = React2.useState(0);
|
|
532
|
-
const inputRef = React2.useRef(null);
|
|
533
|
-
const listRef = React2.useRef(null);
|
|
534
|
-
const flatItems = groups.flatMap((g) => g.items);
|
|
535
|
-
const handleKeyDown = React2.useCallback(
|
|
536
|
-
(e) => {
|
|
537
|
-
if (e.key === "Escape") {
|
|
538
|
-
e.preventDefault();
|
|
539
|
-
onOpenChange(false);
|
|
540
|
-
return;
|
|
541
|
-
}
|
|
542
|
-
if (e.key === "ArrowDown") {
|
|
543
|
-
e.preventDefault();
|
|
544
|
-
setSelectedIndex(
|
|
545
|
-
(prev) => prev < flatItems.length - 1 ? prev + 1 : 0
|
|
546
|
-
);
|
|
547
|
-
return;
|
|
548
|
-
}
|
|
549
|
-
if (e.key === "ArrowUp") {
|
|
550
|
-
e.preventDefault();
|
|
551
|
-
setSelectedIndex(
|
|
552
|
-
(prev) => prev > 0 ? prev - 1 : flatItems.length - 1
|
|
553
|
-
);
|
|
554
|
-
return;
|
|
555
|
-
}
|
|
556
|
-
if (e.key === "Enter") {
|
|
557
|
-
e.preventDefault();
|
|
558
|
-
const item = flatItems[selectedIndex];
|
|
559
|
-
if (item && !item.disabled) {
|
|
560
|
-
item.onSelect?.();
|
|
561
|
-
onAction?.(item);
|
|
562
|
-
onOpenChange(false);
|
|
563
|
-
}
|
|
564
|
-
return;
|
|
565
|
-
}
|
|
566
|
-
},
|
|
567
|
-
[flatItems, selectedIndex, onOpenChange, onAction]
|
|
568
|
-
);
|
|
569
|
-
React2.useEffect(() => {
|
|
570
|
-
function handleGlobalKey(e) {
|
|
571
|
-
if ((e.metaKey || e.ctrlKey) && e.key.toLowerCase() === "k") {
|
|
572
|
-
e.preventDefault();
|
|
573
|
-
onOpenChange(!open);
|
|
574
|
-
}
|
|
575
|
-
}
|
|
576
|
-
document.addEventListener("keydown", handleGlobalKey);
|
|
577
|
-
return () => document.removeEventListener("keydown", handleGlobalKey);
|
|
578
|
-
}, [open, onOpenChange]);
|
|
579
|
-
React2.useEffect(() => {
|
|
580
|
-
if (open) {
|
|
581
|
-
setQuery("");
|
|
582
|
-
setSelectedIndex(0);
|
|
583
|
-
const timer = setTimeout(() => inputRef.current?.focus(), 50);
|
|
584
|
-
return () => clearTimeout(timer);
|
|
585
|
-
}
|
|
586
|
-
}, [open]);
|
|
587
|
-
React2.useEffect(() => {
|
|
588
|
-
if (open) {
|
|
589
|
-
document.body.style.overflow = "hidden";
|
|
590
|
-
} else {
|
|
591
|
-
document.body.style.overflow = "";
|
|
592
|
-
}
|
|
593
|
-
return () => {
|
|
594
|
-
document.body.style.overflow = "";
|
|
595
|
-
};
|
|
596
|
-
}, [open]);
|
|
597
|
-
const filteredGroups = customFilter ? customFilter(query, groups) : query.trim() ? groups.map((g) => ({
|
|
598
|
-
...g,
|
|
599
|
-
items: g.items.filter(
|
|
600
|
-
(item) => item.label.toLowerCase().includes(query.toLowerCase()) || item.description?.toLowerCase().includes(query.toLowerCase()) || item.group?.toLowerCase().includes(query.toLowerCase())
|
|
601
|
-
)
|
|
602
|
-
})).filter((g) => g.items.length > 0) : groups;
|
|
603
|
-
const currentFlat = filteredGroups.flatMap((g) => g.items);
|
|
604
|
-
React2.useEffect(() => {
|
|
605
|
-
if (selectedIndex >= currentFlat.length) {
|
|
606
|
-
setSelectedIndex(0);
|
|
607
|
-
}
|
|
608
|
-
}, [currentFlat.length, selectedIndex]);
|
|
609
|
-
if (!open) return null;
|
|
610
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
611
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
612
|
-
"div",
|
|
613
|
-
{
|
|
614
|
-
className: "tollerud-cmd-overlay",
|
|
615
|
-
onClick: () => onOpenChange(false),
|
|
616
|
-
"aria-hidden": "true"
|
|
617
|
-
}
|
|
618
|
-
),
|
|
619
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
620
|
-
"div",
|
|
621
|
-
{
|
|
622
|
-
className: cn("tollerud-cmd", className),
|
|
623
|
-
role: "listbox",
|
|
624
|
-
"aria-label": "Command palette",
|
|
625
|
-
onKeyDown: handleKeyDown,
|
|
626
|
-
children: [
|
|
627
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tollerud-cmd__header", children: [
|
|
628
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "tollerud-cmd__search-icon", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
629
|
-
"svg",
|
|
630
|
-
{
|
|
631
|
-
width: "18",
|
|
632
|
-
height: "18",
|
|
633
|
-
viewBox: "0 0 24 24",
|
|
634
|
-
fill: "none",
|
|
635
|
-
stroke: "currentColor",
|
|
636
|
-
strokeWidth: "2",
|
|
637
|
-
strokeLinecap: "round",
|
|
638
|
-
strokeLinejoin: "round",
|
|
639
|
-
children: [
|
|
640
|
-
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "11", cy: "11", r: "8" }),
|
|
641
|
-
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "m21 21-4.35-4.35" })
|
|
642
|
-
]
|
|
643
|
-
}
|
|
644
|
-
) }),
|
|
645
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
646
|
-
"input",
|
|
647
|
-
{
|
|
648
|
-
ref: inputRef,
|
|
649
|
-
type: "text",
|
|
650
|
-
className: "tollerud-cmd__input",
|
|
651
|
-
placeholder,
|
|
652
|
-
value: query,
|
|
653
|
-
onChange: (e) => {
|
|
654
|
-
setQuery(e.target.value);
|
|
655
|
-
setSelectedIndex(0);
|
|
656
|
-
},
|
|
657
|
-
autoComplete: "off",
|
|
658
|
-
spellCheck: false
|
|
659
|
-
}
|
|
660
|
-
)
|
|
661
|
-
] }),
|
|
662
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { ref: listRef, className: "tollerud-cmd__list", children: [
|
|
663
|
-
filteredGroups.length === 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tollerud-cmd__empty", children: emptyMessage }),
|
|
664
|
-
filteredGroups.map((group, gi) => {
|
|
665
|
-
const flatOffset = filteredGroups.slice(0, gi).reduce((acc, g) => acc + g.items.length, 0);
|
|
666
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tollerud-cmd__group", children: [
|
|
667
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "tollerud-cmd__group-label", children: group.label }),
|
|
668
|
-
group.items.map((item, ii) => {
|
|
669
|
-
const flatIndex = flatOffset + ii;
|
|
670
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
671
|
-
ActionRow,
|
|
672
|
-
{
|
|
673
|
-
action: item,
|
|
674
|
-
highlighted: selectedIndex === flatIndex,
|
|
675
|
-
onClick: () => {
|
|
676
|
-
item.onSelect?.();
|
|
677
|
-
onAction?.(item);
|
|
678
|
-
onOpenChange(false);
|
|
679
|
-
},
|
|
680
|
-
onMouseEnter: () => setSelectedIndex(flatIndex)
|
|
681
|
-
},
|
|
682
|
-
item.id
|
|
683
|
-
);
|
|
684
|
-
})
|
|
685
|
-
] }, group.label);
|
|
686
|
-
})
|
|
687
|
-
] }),
|
|
688
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tollerud-cmd__footer", children: [
|
|
689
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "tollerud-cmd__hint", children: [
|
|
690
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "tollerud-kbd tollerud-kbd--sm", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "tollerud-kbd__key", children: "\u2191" }) }),
|
|
691
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "tollerud-kbd tollerud-kbd--sm", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "tollerud-kbd__key", children: "\u2193" }) }),
|
|
692
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "tollerud-cmd__hint-text", children: "navigate" })
|
|
693
|
-
] }),
|
|
694
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "tollerud-cmd__hint", children: [
|
|
695
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "tollerud-kbd tollerud-kbd--sm", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "tollerud-kbd__key", children: "\u21B5" }) }),
|
|
696
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "tollerud-cmd__hint-text", children: "select" })
|
|
697
|
-
] }),
|
|
698
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "tollerud-cmd__hint", children: [
|
|
699
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "tollerud-kbd tollerud-kbd--sm", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "tollerud-kbd__key", children: "Esc" }) }),
|
|
700
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "tollerud-cmd__hint-text", children: "close" })
|
|
701
|
-
] })
|
|
702
|
-
] })
|
|
703
|
-
]
|
|
704
|
-
}
|
|
705
|
-
)
|
|
706
|
-
] });
|
|
707
|
-
}
|
|
708
|
-
);
|
|
709
|
-
CommandMenu.displayName = "CommandMenu";
|
|
710
|
-
var ServiceHealthCard = React2.forwardRef(
|
|
711
|
-
({ className, service, status = "online", uptime, responseTime, version, loading, ...props }, ref) => {
|
|
712
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
713
|
-
"div",
|
|
714
|
-
{
|
|
715
|
-
ref,
|
|
716
|
-
className: cn(
|
|
717
|
-
"rounded-lg border bg-tollerud-surface-raised p-4",
|
|
718
|
-
"transition-[border-color] duration-[150ms]",
|
|
719
|
-
status === "offline" && "border-tollerud-error/40",
|
|
720
|
-
status === "warning" && "border-tollerud-yellow/30",
|
|
721
|
-
status === "online" && "border-tollerud-border hover:border-tollerud-noir-500",
|
|
722
|
-
status === "idle" && "border-tollerud-border opacity-60",
|
|
723
|
-
loading && "animate-pulse",
|
|
724
|
-
className
|
|
725
|
-
),
|
|
726
|
-
...props,
|
|
727
|
-
children: [
|
|
728
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between mb-2", children: [
|
|
729
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-semibold text-tollerud-foreground truncate", children: service }),
|
|
730
|
-
/* @__PURE__ */ jsxRuntime.jsx(StatusDot, { status })
|
|
731
|
-
] }),
|
|
732
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap gap-x-4 gap-y-1 text-xs text-tollerud-text-muted", children: [
|
|
733
|
-
uptime && /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
|
|
734
|
-
"Uptime: ",
|
|
735
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-tollerud-text-secondary", children: uptime })
|
|
736
|
-
] }),
|
|
737
|
-
responseTime && /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
|
|
738
|
-
"Response: ",
|
|
739
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-tollerud-text-secondary", children: responseTime })
|
|
740
|
-
] }),
|
|
741
|
-
version && /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
|
|
742
|
-
"Version: ",
|
|
743
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-tollerud-text-secondary", children: version })
|
|
744
|
-
] })
|
|
745
|
-
] })
|
|
746
|
-
]
|
|
747
|
-
}
|
|
748
|
-
);
|
|
749
|
-
}
|
|
750
|
-
);
|
|
751
|
-
ServiceHealthCard.displayName = "ServiceHealthCard";
|
|
752
|
-
var HostCard = React2.forwardRef(
|
|
753
|
-
({ className, hostname, ip, status = "online", cpu, memory, disk, uptime, containers, loading, ...props }, ref) => {
|
|
754
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
755
|
-
"div",
|
|
756
|
-
{
|
|
757
|
-
ref,
|
|
758
|
-
className: cn(
|
|
759
|
-
"rounded-lg border bg-tollerud-surface-raised p-4",
|
|
760
|
-
"transition-[border-color] duration-[150ms]",
|
|
761
|
-
status === "offline" && "border-tollerud-error/40",
|
|
762
|
-
status === "warning" && "border-tollerud-yellow/30",
|
|
763
|
-
status === "online" && "border-tollerud-border hover:border-tollerud-noir-500",
|
|
764
|
-
loading && "animate-pulse",
|
|
765
|
-
className
|
|
766
|
-
),
|
|
767
|
-
...props,
|
|
768
|
-
children: [
|
|
769
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between mb-2", children: [
|
|
770
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 min-w-0", children: [
|
|
771
|
-
/* @__PURE__ */ jsxRuntime.jsx(StatusDot, { status }),
|
|
772
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-semibold text-sm text-tollerud-foreground truncate", children: hostname })
|
|
773
|
-
] }),
|
|
774
|
-
containers !== void 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-[11px] text-tollerud-text-muted whitespace-nowrap ml-2", children: [
|
|
775
|
-
containers,
|
|
776
|
-
" container",
|
|
777
|
-
containers !== 1 ? "s" : ""
|
|
778
|
-
] })
|
|
779
|
-
] }),
|
|
780
|
-
ip && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs text-tollerud-text-muted mb-2 font-mono", children: ip }),
|
|
781
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap gap-x-4 gap-y-1 text-xs text-tollerud-text-muted", children: [
|
|
782
|
-
cpu && /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
|
|
783
|
-
"CPU: ",
|
|
784
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-tollerud-text-secondary", children: cpu })
|
|
785
|
-
] }),
|
|
786
|
-
memory && /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
|
|
787
|
-
"RAM: ",
|
|
788
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-tollerud-text-secondary", children: memory })
|
|
789
|
-
] }),
|
|
790
|
-
disk && /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
|
|
791
|
-
"Disk: ",
|
|
792
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-tollerud-text-secondary", children: disk })
|
|
793
|
-
] }),
|
|
794
|
-
uptime && /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
|
|
795
|
-
"Up: ",
|
|
796
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-tollerud-text-secondary", children: uptime })
|
|
797
|
-
] })
|
|
798
|
-
] })
|
|
799
|
-
]
|
|
800
|
-
}
|
|
801
|
-
);
|
|
802
|
-
}
|
|
803
|
-
);
|
|
804
|
-
HostCard.displayName = "HostCard";
|
|
805
|
-
var DockerStackCard = React2.forwardRef(
|
|
806
|
-
({ className, name, services, composePath, loading, ...props }, ref) => {
|
|
807
|
-
const onlineCount = services.filter((s) => s.status === "online").length;
|
|
808
|
-
const degraded = services.some((s) => s.status === "offline" || s.status === "warning");
|
|
809
|
-
const status = services.every((s) => s.status === "online") ? "online" : degraded ? "warning" : "offline";
|
|
810
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
811
|
-
"div",
|
|
812
|
-
{
|
|
813
|
-
ref,
|
|
814
|
-
className: cn(
|
|
815
|
-
"rounded-lg border bg-tollerud-surface-raised p-4",
|
|
816
|
-
"transition-[border-color] duration-[150ms]",
|
|
817
|
-
status === "offline" && "border-tollerud-error/40",
|
|
818
|
-
status === "warning" && "border-tollerud-yellow/30",
|
|
819
|
-
status === "online" && "border-tollerud-border hover:border-tollerud-noir-500",
|
|
820
|
-
loading && "animate-pulse",
|
|
821
|
-
className
|
|
822
|
-
),
|
|
823
|
-
...props,
|
|
824
|
-
children: [
|
|
825
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between mb-3", children: [
|
|
826
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 min-w-0", children: [
|
|
827
|
-
/* @__PURE__ */ jsxRuntime.jsx(StatusDot, { status }),
|
|
828
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-semibold text-sm text-tollerud-foreground truncate", children: name })
|
|
829
|
-
] }),
|
|
830
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-xs text-tollerud-text-muted whitespace-nowrap ml-2", children: [
|
|
831
|
-
onlineCount,
|
|
832
|
-
"/",
|
|
833
|
-
services.length,
|
|
834
|
-
" healthy"
|
|
835
|
-
] })
|
|
836
|
-
] }),
|
|
837
|
-
composePath && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-[11px] text-tollerud-text-muted font-mono mb-2 truncate", children: composePath }),
|
|
838
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-1", children: services.map((svc) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between text-xs", children: [
|
|
839
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-tollerud-text-secondary truncate", children: svc.name }),
|
|
840
|
-
/* @__PURE__ */ jsxRuntime.jsx(StatusDot, { status: svc.status })
|
|
841
|
-
] }, svc.name)) })
|
|
842
|
-
]
|
|
843
|
-
}
|
|
844
|
-
);
|
|
845
|
-
}
|
|
846
|
-
);
|
|
847
|
-
DockerStackCard.displayName = "DockerStackCard";
|
|
848
|
-
var severityStyles = {
|
|
849
|
-
critical: { border: "border-tollerud-error/50", dot: "bg-tollerud-error shadow-[0_0_8px_rgba(239,68,68,0.6)]", label: "text-tollerud-error" },
|
|
850
|
-
high: { border: "border-tollerud-yellow/50", dot: "bg-tollerud-yellow shadow-[0_0_8px_rgba(232,213,0,0.5)]", label: "text-tollerud-yellow" },
|
|
851
|
-
medium: { border: "border-tollerud-amber/40", dot: "bg-tollerud-amber", label: "text-tollerud-amber" },
|
|
852
|
-
low: { border: "border-tollerud-noir-500", dot: "bg-tollerud-noir-400", label: "text-tollerud-text-muted" },
|
|
853
|
-
info: { border: "border-tollerud-info/30", dot: "bg-tollerud-info", label: "text-tollerud-info" }
|
|
854
|
-
};
|
|
855
|
-
var IncidentCard = React2.forwardRef(
|
|
856
|
-
({ className, title, severity, timestamp, description, service, acknowledged, loading, ...props }, ref) => {
|
|
857
|
-
const style = severityStyles[severity];
|
|
858
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
859
|
-
"div",
|
|
860
|
-
{
|
|
861
|
-
ref,
|
|
862
|
-
className: cn(
|
|
863
|
-
"rounded-lg border bg-tollerud-surface-raised p-4",
|
|
864
|
-
"transition-[border-color] duration-[150ms]",
|
|
865
|
-
style.border,
|
|
866
|
-
acknowledged && "opacity-50",
|
|
867
|
-
loading && "animate-pulse",
|
|
868
|
-
className
|
|
869
|
-
),
|
|
870
|
-
...props,
|
|
871
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-3", children: [
|
|
872
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: cn("w-2 h-2 rounded-full mt-1.5 flex-shrink-0", style.dot) }),
|
|
873
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
874
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-2", children: [
|
|
875
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-semibold text-tollerud-foreground truncate", children: title }),
|
|
876
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: cn("text-[11px] font-medium uppercase whitespace-nowrap", style.label), children: severity })
|
|
877
|
-
] }),
|
|
878
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 mt-0.5 text-xs text-tollerud-text-muted", children: [
|
|
879
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { children: timestamp }),
|
|
880
|
-
service && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
881
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-tollerud-noir-500", children: "\xB7" }),
|
|
882
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { children: service })
|
|
883
|
-
] })
|
|
884
|
-
] }),
|
|
885
|
-
description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-1.5 text-xs text-tollerud-text-secondary leading-relaxed", children: description })
|
|
886
|
-
] })
|
|
887
|
-
] })
|
|
888
|
-
}
|
|
889
|
-
);
|
|
890
|
-
}
|
|
891
|
-
);
|
|
892
|
-
IncidentCard.displayName = "IncidentCard";
|
|
893
|
-
var stateStyles = {
|
|
894
|
-
pending: "border-tollerud-yellow/30 hover:border-tollerud-yellow/50",
|
|
895
|
-
approved: "border-tollerud-success/40 opacity-70",
|
|
896
|
-
rejected: "border-tollerud-error/40 opacity-70"
|
|
897
|
-
};
|
|
898
|
-
var stateLabels = {
|
|
899
|
-
pending: { text: "Awaiting approval", cls: "text-tollerud-yellow" },
|
|
900
|
-
approved: { text: "Approved", cls: "text-tollerud-success" },
|
|
901
|
-
rejected: { text: "Rejected", cls: "text-tollerud-error" }
|
|
902
|
-
};
|
|
903
|
-
var ApprovalCard = React2.forwardRef(
|
|
904
|
-
({ className, action, description, source, state = "pending", timestamp, onApprove, onReject, disabled, loading, ...props }, ref) => {
|
|
905
|
-
const label = stateLabels[state];
|
|
906
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
907
|
-
"div",
|
|
908
|
-
{
|
|
909
|
-
ref,
|
|
910
|
-
className: cn(
|
|
911
|
-
"rounded-lg border bg-tollerud-surface-raised p-4",
|
|
912
|
-
"transition-all duration-[150ms]",
|
|
913
|
-
stateStyles[state],
|
|
914
|
-
loading && "animate-pulse",
|
|
915
|
-
className
|
|
916
|
-
),
|
|
917
|
-
...props,
|
|
918
|
-
children: [
|
|
919
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between mb-1.5", children: [
|
|
920
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-semibold text-tollerud-foreground truncate", children: action }),
|
|
921
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: cn("text-[11px] font-medium whitespace-nowrap ml-2", label.cls), children: label.text })
|
|
922
|
-
] }),
|
|
923
|
-
description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-tollerud-text-secondary mb-1.5 leading-relaxed", children: description }),
|
|
924
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap gap-x-4 gap-y-0.5 text-[11px] text-tollerud-text-muted mb-3", children: [
|
|
925
|
-
source && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-mono", children: source }),
|
|
926
|
-
timestamp && /* @__PURE__ */ jsxRuntime.jsx("span", { children: timestamp })
|
|
927
|
-
] }),
|
|
928
|
-
state === "pending" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-2", children: [
|
|
929
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
930
|
-
"button",
|
|
931
|
-
{
|
|
932
|
-
type: "button",
|
|
933
|
-
disabled,
|
|
934
|
-
onClick: onApprove,
|
|
935
|
-
className: cn(
|
|
936
|
-
"flex-1 rounded-md px-3 py-1.5 text-xs font-semibold transition-all",
|
|
937
|
-
"bg-tollerud-success text-tollerud-text-inverse",
|
|
938
|
-
"hover:brightness-110 disabled:opacity-40 disabled:cursor-not-allowed"
|
|
939
|
-
),
|
|
940
|
-
children: "Approve"
|
|
941
|
-
}
|
|
942
|
-
),
|
|
943
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
944
|
-
"button",
|
|
945
|
-
{
|
|
946
|
-
type: "button",
|
|
947
|
-
disabled,
|
|
948
|
-
onClick: onReject,
|
|
949
|
-
className: cn(
|
|
950
|
-
"flex-1 rounded-md px-3 py-1.5 text-xs font-semibold transition-all",
|
|
951
|
-
"bg-tollerud-error text-white",
|
|
952
|
-
"hover:brightness-110 disabled:opacity-40 disabled:cursor-not-allowed"
|
|
953
|
-
),
|
|
954
|
-
children: "Reject"
|
|
955
|
-
}
|
|
956
|
-
)
|
|
957
|
-
] })
|
|
958
|
-
]
|
|
959
|
-
}
|
|
960
|
-
);
|
|
961
|
-
}
|
|
962
|
-
);
|
|
963
|
-
ApprovalCard.displayName = "ApprovalCard";
|
|
964
|
-
var BackupStatusPanel = React2.forwardRef(
|
|
965
|
-
({ className, jobs, totalSize, lastFullBackup, loading, ...props }, ref) => {
|
|
966
|
-
const failed = jobs.filter((j) => j.status === "offline").length;
|
|
967
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
968
|
-
"div",
|
|
969
|
-
{
|
|
970
|
-
ref,
|
|
971
|
-
className: cn(
|
|
972
|
-
"rounded-lg border border-tollerud-border bg-tollerud-surface-raised",
|
|
973
|
-
loading && "animate-pulse",
|
|
974
|
-
className
|
|
975
|
-
),
|
|
976
|
-
...props,
|
|
977
|
-
children: [
|
|
978
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between px-4 py-3 border-b border-tollerud-border", children: [
|
|
979
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-semibold text-tollerud-foreground", children: "Backups" }),
|
|
980
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3 text-[11px] text-tollerud-text-muted", children: [
|
|
981
|
-
totalSize && /* @__PURE__ */ jsxRuntime.jsx("span", { children: totalSize }),
|
|
982
|
-
lastFullBackup && /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
|
|
983
|
-
"Last full: ",
|
|
984
|
-
lastFullBackup
|
|
985
|
-
] })
|
|
986
|
-
] })
|
|
987
|
-
] }),
|
|
988
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-1", children: [
|
|
989
|
-
jobs.length === 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-3 py-6 text-xs text-center text-tollerud-text-muted", children: "No backup jobs configured" }),
|
|
990
|
-
jobs.map((job) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
991
|
-
"div",
|
|
992
|
-
{
|
|
993
|
-
className: "flex items-center justify-between px-3 py-2 rounded-md hover:bg-tollerud-noir-800/50 transition-colors",
|
|
994
|
-
children: [
|
|
995
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 min-w-0 flex-1", children: [
|
|
996
|
-
/* @__PURE__ */ jsxRuntime.jsx(StatusDot, { status: job.status }),
|
|
997
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-medium text-tollerud-foreground truncate", children: job.name })
|
|
998
|
-
] }),
|
|
999
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3 text-[11px] text-tollerud-text-muted flex-shrink-0 ml-2", children: [
|
|
1000
|
-
job.size && /* @__PURE__ */ jsxRuntime.jsx("span", { children: job.size }),
|
|
1001
|
-
job.target && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "hidden sm:inline font-mono", children: job.target })
|
|
1002
|
-
] })
|
|
1003
|
-
]
|
|
1004
|
-
},
|
|
1005
|
-
job.name
|
|
1006
|
-
))
|
|
1007
|
-
] }),
|
|
1008
|
-
failed > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-4 py-2 border-t border-tollerud-border", children: /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-[11px] text-tollerud-error", children: [
|
|
1009
|
-
failed,
|
|
1010
|
-
" job",
|
|
1011
|
-
failed !== 1 ? "s" : "",
|
|
1012
|
-
" failed \u2014 check logs"
|
|
1013
|
-
] }) })
|
|
1014
|
-
]
|
|
1015
|
-
}
|
|
1016
|
-
);
|
|
1017
|
-
}
|
|
1018
|
-
);
|
|
1019
|
-
BackupStatusPanel.displayName = "BackupStatusPanel";
|
|
1020
|
-
var Timeline = React2.forwardRef(
|
|
1021
|
-
({ className, items, active, loading, ...props }, ref) => {
|
|
1022
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1023
|
-
"div",
|
|
1024
|
-
{
|
|
1025
|
-
ref,
|
|
1026
|
-
className: cn("tollerud-timeline", loading && "animate-pulse", className),
|
|
1027
|
-
role: "list",
|
|
1028
|
-
"aria-label": "Activity timeline",
|
|
1029
|
-
...props,
|
|
1030
|
-
children: items.map((item, i) => {
|
|
1031
|
-
const isLast = i === items.length - 1;
|
|
1032
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tollerud-timeline__item", role: "listitem", children: [
|
|
1033
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "tollerud-timeline__marker", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tollerud-timeline__dot-group", children: [
|
|
1034
|
-
item.icon ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "tollerud-timeline__icon", children: item.icon }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
1035
|
-
"span",
|
|
1036
|
-
{
|
|
1037
|
-
className: cn(
|
|
1038
|
-
"tollerud-timeline__dot",
|
|
1039
|
-
active && "tollerud-timeline__dot--active",
|
|
1040
|
-
item.status === "online" && "bg-tollerud-success shadow-[0_0_6px_rgba(34,197,94,0.5)]",
|
|
1041
|
-
item.status === "offline" && "bg-tollerud-error",
|
|
1042
|
-
item.status === "warning" && "bg-tollerud-yellow shadow-[0_0_6px_rgba(232,213,0,0.5)]",
|
|
1043
|
-
!item.status && "bg-tollerud-noir-500"
|
|
1044
|
-
)
|
|
1045
|
-
}
|
|
1046
|
-
),
|
|
1047
|
-
!isLast && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tollerud-timeline__line" })
|
|
1048
|
-
] }) }),
|
|
1049
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tollerud-timeline__content", children: [
|
|
1050
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-2", children: [
|
|
1051
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "tollerud-timeline__title", children: item.title }),
|
|
1052
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "tollerud-timeline__time", children: item.time })
|
|
1053
|
-
] }),
|
|
1054
|
-
item.description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "tollerud-timeline__description", children: item.description }),
|
|
1055
|
-
item.meta && item.meta.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-wrap gap-1.5 mt-1", children: item.meta.map((m) => /* @__PURE__ */ jsxRuntime.jsx("span", { className: "tollerud-timeline__meta", children: m }, m)) })
|
|
1056
|
-
] })
|
|
1057
|
-
] }, item.id);
|
|
1058
|
-
})
|
|
1059
|
-
}
|
|
1060
|
-
);
|
|
1061
|
-
}
|
|
1062
|
-
);
|
|
1063
|
-
Timeline.displayName = "Timeline";
|
|
1064
|
-
var AlertInbox = React2.forwardRef(
|
|
1065
|
-
({ className, alerts, filterSeverity = "", onAcknowledge, loading, emptyMessage = "All clear \u2014 no incidents", ...props }, ref) => {
|
|
1066
|
-
const filtered = filterSeverity ? alerts.filter((a) => a.severity === filterSeverity) : alerts;
|
|
1067
|
-
const counts = {
|
|
1068
|
-
total: alerts.length,
|
|
1069
|
-
unacknowledged: alerts.filter((a) => !a.acknowledged).length,
|
|
1070
|
-
critical: alerts.filter((a) => a.severity === "critical" && !a.acknowledged).length
|
|
1071
|
-
};
|
|
1072
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1073
|
-
"div",
|
|
1074
|
-
{
|
|
1075
|
-
ref,
|
|
1076
|
-
className: cn(
|
|
1077
|
-
"rounded-lg border border-tollerud-border bg-tollerud-surface-raised overflow-hidden",
|
|
1078
|
-
loading && "animate-pulse",
|
|
1079
|
-
className
|
|
1080
|
-
),
|
|
1081
|
-
...props,
|
|
1082
|
-
children: [
|
|
1083
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between px-4 py-3 border-b border-tollerud-border", children: [
|
|
1084
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
1085
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-semibold text-tollerud-foreground", children: "Alerts" }),
|
|
1086
|
-
counts.unacknowledged > 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "inline-flex items-center gap-1 text-[11px] text-tollerud-error font-medium", children: [
|
|
1087
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-tollerud-error animate-pulse" }),
|
|
1088
|
-
counts.unacknowledged,
|
|
1089
|
-
" unread"
|
|
1090
|
-
] }),
|
|
1091
|
-
counts.critical > 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-[11px] text-tollerud-error font-bold", children: [
|
|
1092
|
-
counts.critical,
|
|
1093
|
-
" critical"
|
|
1094
|
-
] })
|
|
1095
|
-
] }),
|
|
1096
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-xs text-tollerud-text-muted", children: [
|
|
1097
|
-
filtered.length,
|
|
1098
|
-
" of ",
|
|
1099
|
-
alerts.length
|
|
1100
|
-
] })
|
|
1101
|
-
] }),
|
|
1102
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "divide-y divide-tollerud-border/50 max-h-[480px] overflow-y-auto", children: [
|
|
1103
|
-
filtered.length === 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-4 py-8 text-xs text-center text-tollerud-text-muted", children: emptyMessage }),
|
|
1104
|
-
filtered.map((alert) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative group", children: [
|
|
1105
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1106
|
-
IncidentCard,
|
|
1107
|
-
{
|
|
1108
|
-
title: alert.title,
|
|
1109
|
-
severity: alert.severity,
|
|
1110
|
-
timestamp: alert.timestamp,
|
|
1111
|
-
description: alert.description,
|
|
1112
|
-
service: alert.service,
|
|
1113
|
-
acknowledged: alert.acknowledged,
|
|
1114
|
-
className: "border-0 rounded-none bg-transparent hover:bg-tollerud-noir-800/30"
|
|
1115
|
-
}
|
|
1116
|
-
),
|
|
1117
|
-
alert.acknowledged && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute bottom-2 right-3 text-[10px] font-medium text-tollerud-text-muted/50", children: "Acknowledged" }),
|
|
1118
|
-
!alert.acknowledged && onAcknowledge && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1119
|
-
"button",
|
|
1120
|
-
{
|
|
1121
|
-
type: "button",
|
|
1122
|
-
onClick: () => onAcknowledge(alert.id),
|
|
1123
|
-
className: cn(
|
|
1124
|
-
"absolute bottom-2 right-3 text-[10px] font-medium px-2 py-0.5 rounded",
|
|
1125
|
-
"text-tollerud-yellow/70 hover:text-tollerud-yellow hover:bg-tollerud-yellow/10",
|
|
1126
|
-
"opacity-0 group-hover:opacity-100 transition-opacity duration-150"
|
|
1127
|
-
),
|
|
1128
|
-
children: "Acknowledge"
|
|
1129
|
-
}
|
|
1130
|
-
)
|
|
1131
|
-
] }, alert.id))
|
|
1132
|
-
] })
|
|
1133
|
-
]
|
|
1134
|
-
}
|
|
1135
|
-
);
|
|
1136
|
-
}
|
|
1137
|
-
);
|
|
1138
|
-
AlertInbox.displayName = "AlertInbox";
|
|
1139
|
-
var stepIcon = {
|
|
1140
|
-
pending: "\u25CB",
|
|
1141
|
-
running: "\u25C9",
|
|
1142
|
-
success: "\u25CF",
|
|
1143
|
-
failed: "\u2715",
|
|
1144
|
-
skipped: "\u2014"
|
|
1145
|
-
};
|
|
1146
|
-
var stepStyles = {
|
|
1147
|
-
pending: "text-tollerud-noir-400",
|
|
1148
|
-
running: "text-tollerud-yellow animate-pulse",
|
|
1149
|
-
success: "text-tollerud-success",
|
|
1150
|
-
failed: "text-tollerud-error",
|
|
1151
|
-
skipped: "text-tollerud-noir-500"
|
|
1152
|
-
};
|
|
1153
|
-
var RollbackPlan = React2.forwardRef(
|
|
1154
|
-
({ className, name, steps, executing, loading, ...props }, ref) => {
|
|
1155
|
-
const statusSummary = {
|
|
1156
|
-
pending: steps.filter((s) => s.status === "pending").length,
|
|
1157
|
-
running: steps.filter((s) => s.status === "running").length,
|
|
1158
|
-
success: steps.filter((s) => s.status === "success").length,
|
|
1159
|
-
failed: steps.filter((s) => s.status === "failed").length,
|
|
1160
|
-
skipped: steps.filter((s) => s.status === "skipped").length
|
|
1161
|
-
};
|
|
1162
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1163
|
-
"div",
|
|
1164
|
-
{
|
|
1165
|
-
ref,
|
|
1166
|
-
className: cn(
|
|
1167
|
-
"rounded-lg border border-tollerud-border bg-tollerud-surface-raised",
|
|
1168
|
-
loading && "animate-pulse",
|
|
1169
|
-
className
|
|
1170
|
-
),
|
|
1171
|
-
...props,
|
|
1172
|
-
children: [
|
|
1173
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between px-4 py-3 border-b border-tollerud-border", children: [
|
|
1174
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
1175
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-semibold text-tollerud-foreground", children: name }),
|
|
1176
|
-
executing && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[11px] text-tollerud-yellow font-medium animate-pulse", children: "Executing\u2026" })
|
|
1177
|
-
] }),
|
|
1178
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 text-[11px] text-tollerud-text-muted", children: [
|
|
1179
|
-
statusSummary.success > 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-tollerud-success", children: [
|
|
1180
|
-
statusSummary.success,
|
|
1181
|
-
" done"
|
|
1182
|
-
] }),
|
|
1183
|
-
statusSummary.failed > 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-tollerud-error", children: [
|
|
1184
|
-
statusSummary.failed,
|
|
1185
|
-
" failed"
|
|
1186
|
-
] }),
|
|
1187
|
-
statusSummary.running > 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-tollerud-yellow", children: [
|
|
1188
|
-
statusSummary.running,
|
|
1189
|
-
" running"
|
|
1190
|
-
] })
|
|
1191
|
-
] })
|
|
1192
|
-
] }),
|
|
1193
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-1", children: steps.map((step) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1194
|
-
"div",
|
|
1195
|
-
{
|
|
1196
|
-
className: cn(
|
|
1197
|
-
"flex items-start gap-3 px-3 py-2 rounded-md",
|
|
1198
|
-
"transition-colors duration-[150ms]",
|
|
1199
|
-
step.status === "failed" && "bg-tollerud-error/5",
|
|
1200
|
-
step.status === "running" && "bg-tollerud-yellow/5"
|
|
1201
|
-
),
|
|
1202
|
-
children: [
|
|
1203
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: cn("font-mono text-sm mt-0.5 flex-shrink-0", stepStyles[step.status]), children: stepIcon[step.status] }),
|
|
1204
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
1205
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: cn(
|
|
1206
|
-
"text-xs font-medium",
|
|
1207
|
-
step.status === "success" ? "text-tollerud-success" : step.status === "failed" ? "text-tollerud-error" : step.status === "skipped" ? "text-tollerud-noir-500" : "text-tollerud-foreground"
|
|
1208
|
-
), children: step.label }),
|
|
1209
|
-
step.description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[11px] text-tollerud-text-muted mt-0.5", children: step.description })
|
|
1210
|
-
] }),
|
|
1211
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: cn(
|
|
1212
|
-
"text-[10px] uppercase font-semibold flex-shrink-0",
|
|
1213
|
-
stepStyles[step.status]
|
|
1214
|
-
), children: step.status })
|
|
1215
|
-
]
|
|
1216
|
-
},
|
|
1217
|
-
step.id
|
|
1218
|
-
)) })
|
|
1219
|
-
]
|
|
1220
|
-
}
|
|
1221
|
-
);
|
|
1222
|
-
}
|
|
1223
|
-
);
|
|
1224
|
-
RollbackPlan.displayName = "RollbackPlan";
|
|
1225
|
-
var diffStyles = {
|
|
1226
|
-
add: "bg-tollerud-success/[0.06] text-tollerud-success hover:bg-tollerud-success/[0.10]",
|
|
1227
|
-
remove: "bg-tollerud-error/[0.06] text-tollerud-error hover:bg-tollerud-error/[0.10]",
|
|
1228
|
-
context: "text-tollerud-noir-300"
|
|
1229
|
-
};
|
|
1230
|
-
var diffPrefix = {
|
|
1231
|
-
add: "+",
|
|
1232
|
-
remove: "-",
|
|
1233
|
-
context: " "
|
|
1234
|
-
};
|
|
1235
|
-
var ActionDiff = React2.forwardRef(
|
|
1236
|
-
({ className, lines, label, view = "unified", loading, ...props }, ref) => {
|
|
1237
|
-
const [showContext, setShowContext] = React2.useState(true);
|
|
1238
|
-
const stats = React2.useMemo(() => {
|
|
1239
|
-
const adds = lines.filter((l) => l.type === "add").length;
|
|
1240
|
-
const rems = lines.filter((l) => l.type === "remove").length;
|
|
1241
|
-
return { adds, rems };
|
|
1242
|
-
}, [lines]);
|
|
1243
|
-
const displayLines = showContext ? lines : lines.filter((l) => l.type !== "context");
|
|
1244
|
-
const hasContext = lines.some((l) => l.type === "context");
|
|
1245
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1246
|
-
"div",
|
|
1247
|
-
{
|
|
1248
|
-
ref,
|
|
1249
|
-
className: cn(
|
|
1250
|
-
"rounded-lg border border-tollerud-border bg-[var(--color-tollerud-surface-raised)] overflow-hidden",
|
|
1251
|
-
loading && "animate-pulse",
|
|
1252
|
-
className
|
|
1253
|
-
),
|
|
1254
|
-
...props,
|
|
1255
|
-
children: [
|
|
1256
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between px-4 py-2.5 border-b border-tollerud-border bg-tollerud-noir-900", children: [
|
|
1257
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-2 min-w-0", children: label && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-medium text-tollerud-foreground font-mono truncate", children: label }) }),
|
|
1258
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3 text-[11px]", children: [
|
|
1259
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-tollerud-success", children: [
|
|
1260
|
-
"+",
|
|
1261
|
-
stats.adds
|
|
1262
|
-
] }),
|
|
1263
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-tollerud-error", children: [
|
|
1264
|
-
"-",
|
|
1265
|
-
stats.rems
|
|
1266
|
-
] }),
|
|
1267
|
-
hasContext && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1268
|
-
"button",
|
|
1269
|
-
{
|
|
1270
|
-
type: "button",
|
|
1271
|
-
onClick: () => setShowContext(!showContext),
|
|
1272
|
-
className: "text-tollerud-text-muted hover:text-tollerud-foreground transition-colors",
|
|
1273
|
-
children: showContext ? "Hide context" : "Show context"
|
|
1274
|
-
}
|
|
1275
|
-
)
|
|
1276
|
-
] })
|
|
1277
|
-
] }),
|
|
1278
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "overflow-x-auto font-mono text-xs leading-relaxed", children: /* @__PURE__ */ jsxRuntime.jsx("table", { className: "w-full border-collapse", children: /* @__PURE__ */ jsxRuntime.jsx("tbody", { children: displayLines.map((line, i) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1279
|
-
"tr",
|
|
1280
|
-
{
|
|
1281
|
-
className: cn(
|
|
1282
|
-
"transition-colors duration-[100ms]",
|
|
1283
|
-
diffStyles[line.type]
|
|
1284
|
-
),
|
|
1285
|
-
children: [
|
|
1286
|
-
/* @__PURE__ */ jsxRuntime.jsx("td", { className: cn(
|
|
1287
|
-
"w-10 text-right px-2 py-px select-none",
|
|
1288
|
-
"text-tollerud-noir-500 border-r border-tollerud-border/30",
|
|
1289
|
-
"text-[10px] align-top"
|
|
1290
|
-
), children: line.oldLine ?? "" }),
|
|
1291
|
-
/* @__PURE__ */ jsxRuntime.jsx("td", { className: cn(
|
|
1292
|
-
"w-10 text-right px-2 py-px select-none",
|
|
1293
|
-
"text-tollerud-noir-500 border-r border-tollerud-border/30",
|
|
1294
|
-
"text-[10px] align-top"
|
|
1295
|
-
), children: line.newLine ?? "" }),
|
|
1296
|
-
/* @__PURE__ */ jsxRuntime.jsxs("td", { className: "px-2 py-px whitespace-pre-wrap", children: [
|
|
1297
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "select-none opacity-50 mr-2", children: diffPrefix[line.type] }),
|
|
1298
|
-
line.text
|
|
1299
|
-
] })
|
|
1300
|
-
]
|
|
1301
|
-
},
|
|
1302
|
-
i
|
|
1303
|
-
)) }) }) })
|
|
1304
|
-
]
|
|
1305
|
-
}
|
|
1306
|
-
);
|
|
1307
|
-
}
|
|
1308
|
-
);
|
|
1309
|
-
ActionDiff.displayName = "ActionDiff";
|
|
1310
|
-
var levelStyles = {
|
|
1311
|
-
debug: "text-tollerud-noir-400",
|
|
1312
|
-
trace: "text-tollerud-noir-300",
|
|
1313
|
-
info: "text-tollerud-foreground",
|
|
1314
|
-
warn: "text-tollerud-amber",
|
|
1315
|
-
error: "text-tollerud-error"
|
|
1316
|
-
};
|
|
1317
|
-
var levelLabels = {
|
|
1318
|
-
debug: "DBG",
|
|
1319
|
-
trace: "TRC",
|
|
1320
|
-
info: "INF",
|
|
1321
|
-
warn: "WRN",
|
|
1322
|
-
error: "ERR"
|
|
1323
|
-
};
|
|
1324
|
-
var LogViewer = React2.forwardRef(
|
|
1325
|
-
({ className, lines, maxLines = 5e3, showLineNumbers = true, showTimestamps = true, follow = true, searchable, height = "400px", loading, ...props }, ref) => {
|
|
1326
|
-
const [search, setSearch] = React2.useState("");
|
|
1327
|
-
const [isFollowing, setIsFollowing] = React2.useState(follow);
|
|
1328
|
-
const scrollRef = React2.useRef(null);
|
|
1329
|
-
const displayedLines = React2.useMemo(() => {
|
|
1330
|
-
return lines.length > maxLines ? lines.slice(-maxLines) : lines;
|
|
1331
|
-
}, [lines, maxLines]);
|
|
1332
|
-
const filteredLines = React2.useMemo(() => {
|
|
1333
|
-
if (!search.trim()) return displayedLines;
|
|
1334
|
-
return displayedLines.filter(
|
|
1335
|
-
(l) => l.text.toLowerCase().includes(search.toLowerCase()) || l.source?.toLowerCase().includes(search.toLowerCase())
|
|
1336
|
-
);
|
|
1337
|
-
}, [displayedLines, search]);
|
|
1338
|
-
React2.useEffect(() => {
|
|
1339
|
-
if (isFollowing && scrollRef.current) {
|
|
1340
|
-
scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
|
|
1341
|
-
}
|
|
1342
|
-
}, [filteredLines.length, isFollowing]);
|
|
1343
|
-
const handleScroll = (e) => {
|
|
1344
|
-
const el = e.currentTarget;
|
|
1345
|
-
const atBottom = el.scrollHeight - el.scrollTop - el.clientHeight < 40;
|
|
1346
|
-
setIsFollowing(atBottom);
|
|
1347
|
-
};
|
|
1348
|
-
const filteredFrom = displayedLines.indexOf(filteredLines[0]);
|
|
1349
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1350
|
-
"div",
|
|
1351
|
-
{
|
|
1352
|
-
ref,
|
|
1353
|
-
className: cn(
|
|
1354
|
-
"rounded-lg border border-tollerud-border bg-[var(--color-tollerud-surface-raised)] overflow-hidden tollerud-log-viewer",
|
|
1355
|
-
loading && "animate-pulse",
|
|
1356
|
-
className
|
|
1357
|
-
),
|
|
1358
|
-
...props,
|
|
1359
|
-
children: [
|
|
1360
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between px-3 py-2 border-b border-tollerud-border bg-tollerud-noir-900", children: [
|
|
1361
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 text-xs text-tollerud-text-muted", children: [
|
|
1362
|
-
isFollowing ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-tollerud-yellow font-medium", children: "\u25CF Live" }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-tollerud-noir-400", children: "\u25CF Paused" }),
|
|
1363
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
|
|
1364
|
-
filteredLines.length,
|
|
1365
|
-
" lines"
|
|
1366
|
-
] }),
|
|
1367
|
-
lines.length > maxLines && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-tollerud-amber", children: [
|
|
1368
|
-
"(showing last ",
|
|
1369
|
-
maxLines,
|
|
1370
|
-
")"
|
|
1371
|
-
] })
|
|
1372
|
-
] }),
|
|
1373
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-2", children: searchable && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1374
|
-
"input",
|
|
1375
|
-
{
|
|
1376
|
-
type: "text",
|
|
1377
|
-
value: search,
|
|
1378
|
-
onChange: (e) => setSearch(e.target.value),
|
|
1379
|
-
placeholder: "Search logs\u2026",
|
|
1380
|
-
className: cn(
|
|
1381
|
-
"w-40 text-[11px] px-2 py-1 rounded bg-tollerud-noir-800",
|
|
1382
|
-
"border border-tollerud-noir-600 text-tollerud-foreground",
|
|
1383
|
-
"placeholder:text-tollerud-noir-400 outline-none",
|
|
1384
|
-
"focus:border-tollerud-yellow/50 transition-colors"
|
|
1385
|
-
)
|
|
1386
|
-
}
|
|
1387
|
-
) })
|
|
1388
|
-
] }),
|
|
1389
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1390
|
-
"div",
|
|
1391
|
-
{
|
|
1392
|
-
ref: scrollRef,
|
|
1393
|
-
onScroll: handleScroll,
|
|
1394
|
-
className: "overflow-y-auto font-mono text-xs leading-relaxed p-3",
|
|
1395
|
-
style: { height },
|
|
1396
|
-
children: [
|
|
1397
|
-
filteredLines.length === 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center h-full text-tollerud-noir-400 text-xs", children: search ? "No matching log lines" : "No log output" }),
|
|
1398
|
-
filteredLines.map((line, i) => {
|
|
1399
|
-
const absLineNum = filteredFrom >= 0 ? filteredFrom + i + 1 : i + 1;
|
|
1400
|
-
const level = line.level ?? "info";
|
|
1401
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1402
|
-
"div",
|
|
1403
|
-
{
|
|
1404
|
-
className: cn(
|
|
1405
|
-
"flex gap-3 hover:bg-[var(--color-tollerud-surface-hover)] px-1 py-px rounded-sm",
|
|
1406
|
-
levelStyles[level]
|
|
1407
|
-
),
|
|
1408
|
-
children: [
|
|
1409
|
-
showLineNumbers && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-tollerud-noir-500 text-right select-none w-8 flex-shrink-0", children: absLineNum }),
|
|
1410
|
-
showTimestamps && line.timestamp && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-tollerud-noir-400 flex-shrink-0 select-none", children: line.timestamp }),
|
|
1411
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-shrink-0 w-7 text-center font-bold text-[10px] uppercase opacity-60", children: levelLabels[level] }),
|
|
1412
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "whitespace-pre-wrap break-all", children: line.text })
|
|
1413
|
-
]
|
|
1414
|
-
},
|
|
1415
|
-
`${absLineNum}-${i}`
|
|
1416
|
-
);
|
|
1417
|
-
})
|
|
1418
|
-
]
|
|
1419
|
-
}
|
|
1420
|
-
)
|
|
1421
|
-
]
|
|
1422
|
-
}
|
|
1423
|
-
);
|
|
1424
|
-
}
|
|
1425
|
-
);
|
|
1426
|
-
LogViewer.displayName = "LogViewer";
|
|
1427
|
-
var Textarea = React2.forwardRef(
|
|
1428
|
-
({ className, label, error, id, ...props }, ref) => {
|
|
1429
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
1430
|
-
label && /* @__PURE__ */ jsxRuntime.jsx("label", { htmlFor: id, className: "text-xs font-medium text-tollerud-text-muted", children: label }),
|
|
1431
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1432
|
-
"textarea",
|
|
1433
|
-
{
|
|
1434
|
-
ref,
|
|
1435
|
-
id,
|
|
1436
|
-
className: cn(
|
|
1437
|
-
"font-sans text-base px-3 py-2 rounded min-h-[80px] resize-y",
|
|
1438
|
-
"bg-tollerud-surface-raised border",
|
|
1439
|
-
"text-tollerud-text-primary",
|
|
1440
|
-
"placeholder:text-tollerud-text-muted",
|
|
1441
|
-
"transition-[border-color] duration-[150ms]",
|
|
1442
|
-
"focus:outline-none focus:border-tollerud-yellow focus:shadow-[0_0_0_1px_#E8D500]",
|
|
1443
|
-
error ? "border-tollerud-error" : "border-tollerud-border",
|
|
1444
|
-
className
|
|
1445
|
-
),
|
|
1446
|
-
...props
|
|
1447
|
-
}
|
|
1448
|
-
),
|
|
1449
|
-
error && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-tollerud-error mt-0.5", children: error })
|
|
1450
|
-
] });
|
|
1451
|
-
}
|
|
1452
|
-
);
|
|
1453
|
-
Textarea.displayName = "Textarea";
|
|
1454
|
-
var Select = React2.forwardRef(
|
|
1455
|
-
({ className, label, error, placeholder, options = [], value, onChange, ...props }, ref) => {
|
|
1456
|
-
const [open, setOpen] = React2.useState(false);
|
|
1457
|
-
const [highlightedIdx, setHighlightedIdx] = React2.useState(0);
|
|
1458
|
-
const containerRef = React2.useRef(null);
|
|
1459
|
-
const listRef = React2.useRef(null);
|
|
1460
|
-
const selectedOption = options.find((o) => o.value === value);
|
|
1461
|
-
React2.useEffect(() => {
|
|
1462
|
-
if (!open) return;
|
|
1463
|
-
const handleClick = (e) => {
|
|
1464
|
-
if (containerRef.current && !containerRef.current.contains(e.target)) {
|
|
1465
|
-
setOpen(false);
|
|
1466
|
-
}
|
|
1467
|
-
};
|
|
1468
|
-
document.addEventListener("mousedown", handleClick);
|
|
1469
|
-
return () => document.removeEventListener("mousedown", handleClick);
|
|
1470
|
-
}, [open]);
|
|
1471
|
-
React2.useEffect(() => {
|
|
1472
|
-
if (open) {
|
|
1473
|
-
const idx = value ? options.findIndex((o) => o.value === value) : -1;
|
|
1474
|
-
setHighlightedIdx(idx >= 0 ? idx : 0);
|
|
1475
|
-
}
|
|
1476
|
-
}, [open, options, value]);
|
|
1477
|
-
React2.useEffect(() => {
|
|
1478
|
-
if (open && listRef.current) {
|
|
1479
|
-
const item = listRef.current.children[highlightedIdx];
|
|
1480
|
-
item?.scrollIntoView({ block: "nearest" });
|
|
1481
|
-
}
|
|
1482
|
-
}, [open, highlightedIdx]);
|
|
1483
|
-
const selectOption = React2.useCallback(
|
|
1484
|
-
(opt) => {
|
|
1485
|
-
onChange?.(opt.value);
|
|
1486
|
-
setOpen(false);
|
|
1487
|
-
},
|
|
1488
|
-
[onChange]
|
|
1489
|
-
);
|
|
1490
|
-
const handleKeyDown = (e) => {
|
|
1491
|
-
if (!open) {
|
|
1492
|
-
if (e.key === "Enter" || e.key === " " || e.key === "ArrowDown") {
|
|
1493
|
-
e.preventDefault();
|
|
1494
|
-
setOpen(true);
|
|
1495
|
-
}
|
|
1496
|
-
return;
|
|
1497
|
-
}
|
|
1498
|
-
switch (e.key) {
|
|
1499
|
-
case "Escape":
|
|
1500
|
-
e.preventDefault();
|
|
1501
|
-
setOpen(false);
|
|
1502
|
-
break;
|
|
1503
|
-
case "ArrowDown":
|
|
1504
|
-
e.preventDefault();
|
|
1505
|
-
setHighlightedIdx((prev) => Math.min(prev + 1, options.length - 1));
|
|
1506
|
-
break;
|
|
1507
|
-
case "ArrowUp":
|
|
1508
|
-
e.preventDefault();
|
|
1509
|
-
setHighlightedIdx((prev) => Math.max(prev - 1, 0));
|
|
1510
|
-
break;
|
|
1511
|
-
case "Enter":
|
|
1512
|
-
e.preventDefault();
|
|
1513
|
-
if (options[highlightedIdx]) {
|
|
1514
|
-
selectOption(options[highlightedIdx]);
|
|
1515
|
-
}
|
|
1516
|
-
break;
|
|
1517
|
-
}
|
|
1518
|
-
};
|
|
1519
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-1.5", ref, children: [
|
|
1520
|
-
label && /* @__PURE__ */ jsxRuntime.jsx("label", { className: "text-xs font-medium text-tollerud-text-muted", children: label }),
|
|
1521
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { ref: containerRef, className: "relative", children: [
|
|
1522
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1523
|
-
"button",
|
|
1524
|
-
{
|
|
1525
|
-
type: "button",
|
|
1526
|
-
onClick: () => setOpen(!open),
|
|
1527
|
-
onKeyDown: handleKeyDown,
|
|
1528
|
-
"aria-haspopup": "listbox",
|
|
1529
|
-
"aria-expanded": open,
|
|
1530
|
-
className: cn(
|
|
1531
|
-
"font-sans text-sm w-full flex items-center justify-between px-3 py-2.5 rounded-lg",
|
|
1532
|
-
"bg-tollerud-surface-raised",
|
|
1533
|
-
"text-tollerud-text-primary text-left",
|
|
1534
|
-
"transition-all duration-150 ease-out cursor-pointer",
|
|
1535
|
-
error ? "border-tollerud-error/70 focus:border-tollerud-error focus:shadow-[0_0_0_1px_#EF4444]" : "border-tollerud-border focus:border-tollerud-yellow focus:shadow-[0_0_0_1px_#E8D500]",
|
|
1536
|
-
"border hover:border-tollerud-noir-400",
|
|
1537
|
-
"focus:outline-none",
|
|
1538
|
-
className
|
|
1539
|
-
),
|
|
1540
|
-
children: [
|
|
1541
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: cn(!selectedOption && "text-tollerud-text-muted"), children: selectedOption ? selectedOption.label : placeholder || "Select\u2026" }),
|
|
1542
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1543
|
-
"svg",
|
|
1544
|
-
{
|
|
1545
|
-
className: cn(
|
|
1546
|
-
"h-4 w-4 text-tollerud-text-muted transition-transform duration-150 flex-shrink-0",
|
|
1547
|
-
open && "rotate-180"
|
|
1548
|
-
),
|
|
1549
|
-
fill: "none",
|
|
1550
|
-
viewBox: "0 0 24 24",
|
|
1551
|
-
stroke: "currentColor",
|
|
1552
|
-
strokeWidth: 2,
|
|
1553
|
-
"aria-hidden": "true",
|
|
1554
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 9l6 6 6-6" })
|
|
1555
|
-
}
|
|
1556
|
-
)
|
|
1557
|
-
]
|
|
1558
|
-
}
|
|
1559
|
-
),
|
|
1560
|
-
open && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1561
|
-
"div",
|
|
1562
|
-
{
|
|
1563
|
-
ref: listRef,
|
|
1564
|
-
role: "listbox",
|
|
1565
|
-
className: cn(
|
|
1566
|
-
"absolute z-10 left-0 right-0 mt-1 py-1",
|
|
1567
|
-
"rounded-lg border border-tollerud-border bg-tollerud-surface-overlay",
|
|
1568
|
-
"shadow-[0_8px_24px_rgba(0,0,0,0.4)]",
|
|
1569
|
-
"max-h-60 overflow-y-auto"
|
|
1570
|
-
),
|
|
1571
|
-
children: [
|
|
1572
|
-
options.length === 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-3 py-2 text-xs text-tollerud-text-muted text-center", children: "No options" }),
|
|
1573
|
-
options.map((opt, idx) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1574
|
-
"button",
|
|
1575
|
-
{
|
|
1576
|
-
type: "button",
|
|
1577
|
-
role: "option",
|
|
1578
|
-
"aria-selected": opt.value === value,
|
|
1579
|
-
onClick: () => selectOption(opt),
|
|
1580
|
-
onMouseEnter: () => setHighlightedIdx(idx),
|
|
1581
|
-
className: cn(
|
|
1582
|
-
"w-full text-sm text-left px-3 py-2 transition-colors duration-75",
|
|
1583
|
-
"cursor-pointer",
|
|
1584
|
-
opt.value === value ? "text-tollerud-yellow" : "text-tollerud-text-primary",
|
|
1585
|
-
idx === highlightedIdx && !(opt.value === value) ? "bg-tollerud-noir-700" : "hover:bg-tollerud-noir-700/60",
|
|
1586
|
-
opt.value === value && highlightedIdx === idx && "bg-tollerud-noir-700"
|
|
1587
|
-
),
|
|
1588
|
-
children: opt.label
|
|
1589
|
-
},
|
|
1590
|
-
opt.value
|
|
1591
|
-
))
|
|
1592
|
-
]
|
|
1593
|
-
}
|
|
1594
|
-
)
|
|
1595
|
-
] }),
|
|
1596
|
-
error && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-tollerud-error mt-0.5", children: error })
|
|
1597
|
-
] });
|
|
1598
|
-
}
|
|
1599
|
-
);
|
|
1600
|
-
Select.displayName = "Select";
|
|
1601
|
-
var Checkbox = React2.forwardRef(
|
|
1602
|
-
({ className, label, id: idProp, checked, ...props }, ref) => {
|
|
1603
|
-
const autoId = React2.useId();
|
|
1604
|
-
const id = idProp ?? autoId;
|
|
1605
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1606
|
-
"label",
|
|
1607
|
-
{
|
|
1608
|
-
htmlFor: id,
|
|
1609
|
-
className: cn(
|
|
1610
|
-
"inline-flex items-center gap-2 cursor-pointer select-none group",
|
|
1611
|
-
"text-sm text-tollerud-text-primary",
|
|
1612
|
-
props.disabled && "opacity-50 pointer-events-none",
|
|
1613
|
-
className
|
|
1614
|
-
),
|
|
1615
|
-
children: [
|
|
1616
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "relative flex items-center justify-center", children: [
|
|
1617
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1618
|
-
"input",
|
|
1619
|
-
{
|
|
1620
|
-
ref,
|
|
1621
|
-
id,
|
|
1622
|
-
type: "checkbox",
|
|
1623
|
-
checked,
|
|
1624
|
-
className: "peer sr-only",
|
|
1625
|
-
...props
|
|
1626
|
-
}
|
|
1627
|
-
),
|
|
1628
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1629
|
-
"span",
|
|
1630
|
-
{
|
|
1631
|
-
className: cn(
|
|
1632
|
-
"h-4 w-4 rounded border transition-all duration-[150ms]",
|
|
1633
|
-
"flex items-center justify-center",
|
|
1634
|
-
"bg-tollerud-surface-raised border-tollerud-border",
|
|
1635
|
-
"peer-focus-visible:outline-2 peer-focus-visible:outline-tollerud-yellow",
|
|
1636
|
-
"peer-checked:bg-tollerud-yellow peer-checked:border-tollerud-yellow",
|
|
1637
|
-
"group-hover:border-tollerud-text-secondary"
|
|
1638
|
-
),
|
|
1639
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1640
|
-
"svg",
|
|
1641
|
-
{
|
|
1642
|
-
className: cn(
|
|
1643
|
-
"h-3 w-3 text-tollerud-noir-black transition-opacity duration-[150ms]",
|
|
1644
|
-
checked ? "opacity-100" : "opacity-0"
|
|
1645
|
-
),
|
|
1646
|
-
viewBox: "0 0 12 12",
|
|
1647
|
-
fill: "none",
|
|
1648
|
-
"aria-hidden": "true",
|
|
1649
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1650
|
-
"path",
|
|
1651
|
-
{
|
|
1652
|
-
d: "M2.5 6l2.5 2.5 4.5-5",
|
|
1653
|
-
stroke: "currentColor",
|
|
1654
|
-
strokeWidth: 2,
|
|
1655
|
-
strokeLinecap: "round",
|
|
1656
|
-
strokeLinejoin: "round"
|
|
1657
|
-
}
|
|
1658
|
-
)
|
|
1659
|
-
}
|
|
1660
|
-
)
|
|
1661
|
-
}
|
|
1662
|
-
)
|
|
1663
|
-
] }),
|
|
1664
|
-
label && /* @__PURE__ */ jsxRuntime.jsx("span", { children: label })
|
|
1665
|
-
]
|
|
1666
|
-
}
|
|
1667
|
-
);
|
|
1668
|
-
}
|
|
1669
|
-
);
|
|
1670
|
-
Checkbox.displayName = "Checkbox";
|
|
1671
|
-
var Switch = React2.forwardRef(
|
|
1672
|
-
({ className, label, id: idProp, checked, ...props }, ref) => {
|
|
1673
|
-
const autoId = React2.useId();
|
|
1674
|
-
const id = idProp ?? autoId;
|
|
1675
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1676
|
-
"label",
|
|
1677
|
-
{
|
|
1678
|
-
htmlFor: id,
|
|
1679
|
-
className: cn(
|
|
1680
|
-
"inline-flex items-center gap-2.5 cursor-pointer select-none group",
|
|
1681
|
-
"text-sm text-tollerud-text-primary",
|
|
1682
|
-
props.disabled && "opacity-40 pointer-events-none cursor-not-allowed",
|
|
1683
|
-
className
|
|
1684
|
-
),
|
|
1685
|
-
children: [
|
|
1686
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1687
|
-
"span",
|
|
1688
|
-
{
|
|
1689
|
-
className: cn(
|
|
1690
|
-
"relative inline-flex items-center h-5 w-9 flex-shrink-0 rounded-full",
|
|
1691
|
-
"transition-colors duration-200 ease-out",
|
|
1692
|
-
checked ? "bg-tollerud-yellow" : "bg-tollerud-noir-600",
|
|
1693
|
-
"group-hover:bg-tollerud-noir-500",
|
|
1694
|
-
checked && "group-hover:bg-tollerud-yellow-warm",
|
|
1695
|
-
"peer-focus-visible:outline-2 peer-focus-visible:outline-tollerud-yellow peer-focus-visible:outline-offset-2"
|
|
1696
|
-
),
|
|
1697
|
-
children: [
|
|
1698
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1699
|
-
"input",
|
|
1700
|
-
{
|
|
1701
|
-
ref,
|
|
1702
|
-
id,
|
|
1703
|
-
type: "checkbox",
|
|
1704
|
-
role: "switch",
|
|
1705
|
-
checked,
|
|
1706
|
-
className: "peer absolute inset-0 opacity-0 w-full h-full cursor-pointer z-10",
|
|
1707
|
-
...props
|
|
1708
|
-
}
|
|
1709
|
-
),
|
|
1710
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1711
|
-
"span",
|
|
1712
|
-
{
|
|
1713
|
-
className: cn(
|
|
1714
|
-
"block h-3.5 w-3.5 rounded-full shadow-sm",
|
|
1715
|
-
"transition-all duration-200 ease-out",
|
|
1716
|
-
checked ? "translate-x-[18px] bg-tollerud-black" : "translate-x-[3px] bg-tollerud-white"
|
|
1717
|
-
)
|
|
1718
|
-
}
|
|
1719
|
-
)
|
|
1720
|
-
]
|
|
1721
|
-
}
|
|
1722
|
-
),
|
|
1723
|
-
label && /* @__PURE__ */ jsxRuntime.jsx("span", { children: label })
|
|
1724
|
-
]
|
|
1725
|
-
}
|
|
1726
|
-
);
|
|
1727
|
-
}
|
|
1728
|
-
);
|
|
1729
|
-
Switch.displayName = "Switch";
|
|
1730
|
-
var RadioGroup = React2.forwardRef(
|
|
1731
|
-
({ label, error, children, className }, ref) => {
|
|
1732
|
-
React2.useId();
|
|
1733
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("fieldset", { ref, className: cn("flex flex-col gap-1", className), children: [
|
|
1734
|
-
label && /* @__PURE__ */ jsxRuntime.jsx("legend", { className: "text-xs font-medium text-tollerud-text-muted mb-1", children: label }),
|
|
1735
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-2", children }),
|
|
1736
|
-
error && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-tollerud-error mt-0.5", children: error })
|
|
1737
|
-
] });
|
|
1738
|
-
}
|
|
1739
|
-
);
|
|
1740
|
-
RadioGroup.displayName = "RadioGroup";
|
|
1741
|
-
var Radio = React2.forwardRef(
|
|
1742
|
-
({ className, label, id: idProp, ...props }, ref) => {
|
|
1743
|
-
const autoId = React2.useId();
|
|
1744
|
-
const id = idProp ?? autoId;
|
|
1745
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1746
|
-
"label",
|
|
1747
|
-
{
|
|
1748
|
-
htmlFor: id,
|
|
1749
|
-
className: cn(
|
|
1750
|
-
"inline-flex items-center gap-2 cursor-pointer select-none group",
|
|
1751
|
-
"text-sm text-tollerud-text-primary",
|
|
1752
|
-
props.disabled && "opacity-50 pointer-events-none",
|
|
1753
|
-
className
|
|
1754
|
-
),
|
|
1755
|
-
children: [
|
|
1756
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "relative flex items-center justify-center", children: [
|
|
1757
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1758
|
-
"input",
|
|
1759
|
-
{
|
|
1760
|
-
ref,
|
|
1761
|
-
id,
|
|
1762
|
-
type: "radio",
|
|
1763
|
-
className: "peer sr-only",
|
|
1764
|
-
...props
|
|
1765
|
-
}
|
|
1766
|
-
),
|
|
1767
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1768
|
-
"span",
|
|
1769
|
-
{
|
|
1770
|
-
className: cn(
|
|
1771
|
-
"h-4 w-4 rounded-full border transition-all duration-[150ms]",
|
|
1772
|
-
"bg-tollerud-surface-raised border-tollerud-border",
|
|
1773
|
-
"peer-focus-visible:outline-2 peer-focus-visible:outline-tollerud-yellow",
|
|
1774
|
-
"peer-checked:border-tollerud-yellow",
|
|
1775
|
-
"group-hover:border-tollerud-text-secondary",
|
|
1776
|
-
"flex items-center justify-center"
|
|
1777
|
-
),
|
|
1778
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1779
|
-
"span",
|
|
1780
|
-
{
|
|
1781
|
-
className: cn(
|
|
1782
|
-
"h-2 w-2 rounded-full bg-tollerud-yellow transition-opacity duration-[150ms]",
|
|
1783
|
-
props.checked ? "opacity-100" : "opacity-0"
|
|
1784
|
-
)
|
|
1785
|
-
}
|
|
1786
|
-
)
|
|
1787
|
-
}
|
|
1788
|
-
)
|
|
1789
|
-
] }),
|
|
1790
|
-
label && /* @__PURE__ */ jsxRuntime.jsx("span", { children: label })
|
|
1791
|
-
]
|
|
1792
|
-
}
|
|
1793
|
-
);
|
|
1794
|
-
}
|
|
1795
|
-
);
|
|
1796
|
-
Radio.displayName = "Radio";
|
|
1797
|
-
var defaultLabels = {
|
|
1798
|
-
tollerudProject: "A Tollerud Project",
|
|
1799
|
-
allRightsReserved: "All rights reserved."
|
|
1800
|
-
};
|
|
1801
|
-
var MONOGRAM_PATH = "M82.4839273,140.272626 L95.1738252,140.272626 L95.1738252,143 L34.8114657,143 L34.8114657,140.272626 L47.5013636,140.272626 L47.5013636,28.2924381 C40.1277806,26.4177752 32.9252955,25.2241422 26.4088393,25.2241422 C12.1757856,25.2241422 4.11617359,34.5982703 4.11617359,39.8821508 C4.11617359,40.9049161 4.63028596,41.5867596 5.65932936,41.5867596 C7.20248513,41.5867596 7.37440169,40.3931266 8.06043062,38.8593855 C10.4615319,33.575505 15.6059302,31.5307881 20.4073141,31.5307881 C29.152955,31.5307881 35.1552988,38.5184637 35.1552988,47.2107482 C35.1552988,56.2447681 28.8107592,62.8907084 18.0070315,62.8907084 C7.5454996,62.891522 0,53.6882617 0,43.8023442 C0,30.8497582 11.3178401,21.986606 26.5799372,21.986606 C51.1026062,21.986606 84.1989996,39.2011209 104.948509,39.2011209 C118.495534,39.2011209 126.384048,31.7016558 126.384048,19.4300996 C126.384048,10.3968933 118.667451,4.60203698 115.580321,4.60203698 C114.552096,4.60203698 113.69415,5.1130128 113.69415,6.13577809 C113.69415,7.49946515 114.552096,7.6695192 115.409223,8.01044097 C115.752237,8.18049502 122.268693,10.5669474 122.268693,19.2592319 C122.268693,28.2924381 115.238125,34.0872945 107.177694,34.0872945 C97.7460244,34.0872945 91.0584702,26.4177752 91.0584702,17.8955448 C91.0584702,6.64675391 99.9760277,0 109.749893,0 C122.268693,0 129.642276,9.88510384 129.642276,19.6001536 C129.642276,34.2581622 119.181563,42.4386572 104.947691,42.4386572 C98.0890388,42.4386572 90.5443579,40.9049161 82.4839273,38.6901451 L82.4839273,140.272626 Z";
|
|
1802
|
-
function Footer({
|
|
1803
|
-
labels,
|
|
1804
|
-
layout = "responsive",
|
|
1805
|
-
className,
|
|
1806
|
-
style,
|
|
1807
|
-
unstyled = false,
|
|
1808
|
-
accent = false,
|
|
1809
|
-
classNameInner,
|
|
1810
|
-
classNameLogo,
|
|
1811
|
-
classNameText,
|
|
1812
|
-
classNameLink
|
|
1813
|
-
}) {
|
|
1814
|
-
const t = { ...defaultLabels, ...labels };
|
|
1815
|
-
const attribution = t.attribution?.trim();
|
|
1816
|
-
const footerSurface = unstyled ? "" : accent ? "border-t border-tollerud-yellow/20 bg-tollerud-yellow/5" : "border-t border-tollerud-border bg-tollerud-noir-900/80";
|
|
1817
|
-
const innerLayoutClasses = layout === "row" ? "max-w-7xl mx-auto px-8 flex flex-row items-center justify-between gap-4" : "max-w-7xl mx-auto px-8 flex flex-col md:flex-row items-center justify-center md:justify-between gap-4 md:gap-0";
|
|
1818
|
-
const logoColor = unstyled ? "" : accent ? "text-tollerud-yellow" : "text-tollerud-text-muted";
|
|
1819
|
-
const textWrapperClasses = layout === "row" ? "flex-1 text-right ml-4" : "flex-1 text-center md:text-right md:ml-4";
|
|
1820
|
-
const textLayoutClasses = layout === "row" ? "text-sm text-tollerud-text-secondary inline-flex flex-row items-center justify-end text-right gap-0" : "text-sm text-tollerud-text-secondary flex flex-col md:flex-row md:inline gap-0";
|
|
1821
|
-
return /* @__PURE__ */ jsxRuntime.jsx("footer", { className: cn("w-full pt-4 pb-4", footerSurface, className), style, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn(innerLayoutClasses, classNameInner), children: [
|
|
1822
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-shrink-0 md:flex-shrink-0", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1823
|
-
"svg",
|
|
1824
|
-
{
|
|
1825
|
-
width: "24",
|
|
1826
|
-
height: "24",
|
|
1827
|
-
viewBox: "0 0 130 143",
|
|
1828
|
-
version: "1.1",
|
|
1829
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
1830
|
-
xmlnsXlink: "http://www.w3.org/1999/xlink",
|
|
1831
|
-
className: cn("h-5 w-5", logoColor, classNameLogo),
|
|
1832
|
-
role: "img",
|
|
1833
|
-
children: [
|
|
1834
|
-
/* @__PURE__ */ jsxRuntime.jsx("title", { children: "Tollerud Logo" }),
|
|
1835
|
-
/* @__PURE__ */ jsxRuntime.jsx("g", { id: "Page-1", stroke: "none", strokeWidth: "1", fill: "none", fillRule: "evenodd", children: /* @__PURE__ */ jsxRuntime.jsx("g", { id: "Tollerud-Monogram", transform: "translate(-86.000000, -109.000000)", fill: "currentColor", children: /* @__PURE__ */ jsxRuntime.jsx("g", { id: "Group-2", transform: "translate(32.000000, 55.000000)", children: /* @__PURE__ */ jsxRuntime.jsx("g", { id: "Group", transform: "translate(54.000000, 54.000000)", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: MONOGRAM_PATH, id: "Monogram" }) }) }) }) })
|
|
1836
|
-
]
|
|
1837
|
-
}
|
|
1838
|
-
) }),
|
|
1839
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: textWrapperClasses, children: /* @__PURE__ */ jsxRuntime.jsxs("p", { className: cn(textLayoutClasses, classNameText), children: [
|
|
1840
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
|
|
1841
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1842
|
-
"a",
|
|
1843
|
-
{
|
|
1844
|
-
href: "https://tollerud.no",
|
|
1845
|
-
target: "_blank",
|
|
1846
|
-
rel: "noopener noreferrer",
|
|
1847
|
-
className: cn(
|
|
1848
|
-
"underline decoration-tollerud-yellow decoration-[3px] underline-offset-[4px] hover:opacity-80 transition-opacity",
|
|
1849
|
-
classNameLink
|
|
1850
|
-
),
|
|
1851
|
-
style: {
|
|
1852
|
-
textDecorationThickness: "3px",
|
|
1853
|
-
textUnderlineOffset: "4px"
|
|
1854
|
-
},
|
|
1855
|
-
children: t.tollerudProject
|
|
1856
|
-
}
|
|
1857
|
-
),
|
|
1858
|
-
attribution ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1859
|
-
" ",
|
|
1860
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { children: attribution })
|
|
1861
|
-
] }) : null,
|
|
1862
|
-
" "
|
|
1863
|
-
] }),
|
|
1864
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: layout === "row" ? "ml-1" : "md:ml-1", children: t.allRightsReserved })
|
|
1865
|
-
] }) })
|
|
1866
|
-
] }) });
|
|
1867
|
-
}
|
|
1868
|
-
var Dialog = DialogPrimitive__namespace.Root;
|
|
1869
|
-
var DialogTrigger = DialogPrimitive__namespace.Trigger;
|
|
1870
|
-
var DialogPortal = DialogPrimitive__namespace.Portal;
|
|
1871
|
-
var DialogClose = DialogPrimitive__namespace.Close;
|
|
1872
|
-
var DialogOverlay = React2__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1873
|
-
DialogPrimitive__namespace.Overlay,
|
|
1874
|
-
{
|
|
1875
|
-
ref,
|
|
1876
|
-
className: cn(
|
|
1877
|
-
"fixed inset-0 z-50 bg-black/60 backdrop-blur-sm",
|
|
1878
|
-
className
|
|
1879
|
-
),
|
|
1880
|
-
...props
|
|
1881
|
-
}
|
|
1882
|
-
));
|
|
1883
|
-
DialogOverlay.displayName = "DialogOverlay";
|
|
1884
|
-
var DialogContent = React2__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(DialogPortal, { children: [
|
|
1885
|
-
/* @__PURE__ */ jsxRuntime.jsx(DialogOverlay, {}),
|
|
1886
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1887
|
-
DialogPrimitive__namespace.Content,
|
|
1888
|
-
{
|
|
1889
|
-
ref,
|
|
1890
|
-
className: cn(
|
|
1891
|
-
"fixed top-1/2 left-1/2 z-50 w-full max-w-lg -translate-x-1/2 -translate-y-1/2",
|
|
1892
|
-
"rounded-lg border border-tollerud-border/30 bg-tollerud-noir-900 p-6 shadow-xl",
|
|
1893
|
-
"data-[state=open]:animate-none data-[state=closed]:animate-none",
|
|
1894
|
-
className
|
|
1895
|
-
),
|
|
1896
|
-
...props,
|
|
1897
|
-
children: [
|
|
1898
|
-
children,
|
|
1899
|
-
/* @__PURE__ */ jsxRuntime.jsxs(DialogPrimitive__namespace.Close, { className: "absolute top-4 right-4 rounded-sm p-1 text-tollerud-text-muted hover:text-tollerud-foreground transition-colors cursor-pointer", children: [
|
|
1900
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-4 w-4" }),
|
|
1901
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Close" })
|
|
1902
|
-
] })
|
|
1903
|
-
]
|
|
1904
|
-
}
|
|
1905
|
-
)
|
|
1906
|
-
] }));
|
|
1907
|
-
DialogContent.displayName = "DialogContent";
|
|
1908
|
-
var DialogHeader = ({
|
|
1909
|
-
className,
|
|
1910
|
-
...props
|
|
1911
|
-
}) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1912
|
-
"div",
|
|
1913
|
-
{
|
|
1914
|
-
className: cn("flex flex-col gap-1.5 mb-4", className),
|
|
1915
|
-
...props
|
|
1916
|
-
}
|
|
1917
|
-
);
|
|
1918
|
-
DialogHeader.displayName = "DialogHeader";
|
|
1919
|
-
var DialogFooter = ({
|
|
1920
|
-
className,
|
|
1921
|
-
...props
|
|
1922
|
-
}) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1923
|
-
"div",
|
|
1924
|
-
{
|
|
1925
|
-
className: cn("flex flex-col-reverse sm:flex-row sm:justify-end gap-2 mt-6", className),
|
|
1926
|
-
...props
|
|
1927
|
-
}
|
|
1928
|
-
);
|
|
1929
|
-
DialogFooter.displayName = "DialogFooter";
|
|
1930
|
-
var DialogTitle = React2__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1931
|
-
DialogPrimitive__namespace.Title,
|
|
1932
|
-
{
|
|
1933
|
-
ref,
|
|
1934
|
-
className: cn("text-base font-semibold text-tollerud-foreground", className),
|
|
1935
|
-
...props
|
|
1936
|
-
}
|
|
1937
|
-
));
|
|
1938
|
-
DialogTitle.displayName = "DialogTitle";
|
|
1939
|
-
var DialogDescription = React2__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1940
|
-
DialogPrimitive__namespace.Description,
|
|
1941
|
-
{
|
|
1942
|
-
ref,
|
|
1943
|
-
className: cn("text-sm text-tollerud-text-secondary", className),
|
|
1944
|
-
...props
|
|
1945
|
-
}
|
|
1946
|
-
));
|
|
1947
|
-
DialogDescription.displayName = "DialogDescription";
|
|
1948
|
-
var TooltipProvider = TooltipPrimitive__namespace.Provider;
|
|
1949
|
-
var TooltipContext = React2__namespace.createContext(null);
|
|
1950
|
-
function Tooltip({
|
|
1951
|
-
children,
|
|
1952
|
-
defaultOpen,
|
|
1953
|
-
open: controlledOpen,
|
|
1954
|
-
onOpenChange: controlledOnOpenChange,
|
|
1955
|
-
...props
|
|
1956
|
-
}) {
|
|
1957
|
-
const [internalOpen, setInternalOpen] = React2__namespace.useState(defaultOpen ?? false);
|
|
1958
|
-
const isControlled = controlledOpen !== void 0;
|
|
1959
|
-
const open = isControlled ? controlledOpen : internalOpen;
|
|
1960
|
-
const setOpen = isControlled ? controlledOnOpenChange ?? setInternalOpen : setInternalOpen;
|
|
1961
|
-
return /* @__PURE__ */ jsxRuntime.jsx(TooltipContext.Provider, { value: { open, setOpen }, children: /* @__PURE__ */ jsxRuntime.jsx(TooltipPrimitive__namespace.Root, { open, onOpenChange: (v) => setOpen(v), ...props, children }) });
|
|
1962
|
-
}
|
|
1963
|
-
Tooltip.displayName = "Tooltip";
|
|
1964
|
-
var TooltipTrigger = React2__namespace.forwardRef(({ onClick, onTouchStart, children, ...props }, ref) => {
|
|
1965
|
-
const ctx = React2__namespace.useContext(TooltipContext);
|
|
1966
|
-
const touchFired = React2__namespace.useRef(false);
|
|
1967
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1968
|
-
TooltipPrimitive__namespace.Trigger,
|
|
1969
|
-
{
|
|
1970
|
-
ref,
|
|
1971
|
-
onClick: (e) => {
|
|
1972
|
-
if (touchFired.current) {
|
|
1973
|
-
touchFired.current = false;
|
|
1974
|
-
return;
|
|
1975
|
-
}
|
|
1976
|
-
if (ctx) {
|
|
1977
|
-
ctx.setOpen(!ctx.open);
|
|
1978
|
-
}
|
|
1979
|
-
onClick?.(e);
|
|
1980
|
-
},
|
|
1981
|
-
onTouchStart: (e) => {
|
|
1982
|
-
touchFired.current = true;
|
|
1983
|
-
if (ctx && !ctx.open) {
|
|
1984
|
-
ctx.setOpen(true);
|
|
1985
|
-
}
|
|
1986
|
-
onTouchStart?.(e);
|
|
1987
|
-
},
|
|
1988
|
-
...props,
|
|
1989
|
-
children
|
|
1990
|
-
}
|
|
1991
|
-
);
|
|
1992
|
-
});
|
|
1993
|
-
TooltipTrigger.displayName = "TooltipTrigger";
|
|
1994
|
-
var TooltipContent = React2__namespace.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1995
|
-
TooltipPrimitive__namespace.Content,
|
|
1996
|
-
{
|
|
1997
|
-
ref,
|
|
1998
|
-
sideOffset,
|
|
1999
|
-
className: cn(
|
|
2000
|
-
"z-50 overflow-hidden rounded-md border border-tollerud-border/30",
|
|
2001
|
-
"bg-tollerud-noir-800 px-3 py-1.5 text-xs text-tollerud-foreground",
|
|
2002
|
-
"shadow-md",
|
|
2003
|
-
"animate-in fade-in-0 zoom-in-95",
|
|
2004
|
-
"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
|
|
2005
|
-
"data-[side=bottom]:slide-in-from-top-1",
|
|
2006
|
-
"data-[side=left]:slide-in-from-right-1",
|
|
2007
|
-
"data-[side=right]:slide-in-from-left-1",
|
|
2008
|
-
"data-[side=top]:slide-in-from-bottom-1",
|
|
2009
|
-
className
|
|
2010
|
-
),
|
|
2011
|
-
...props
|
|
2012
|
-
}
|
|
2013
|
-
));
|
|
2014
|
-
TooltipContent.displayName = "TooltipContent";
|
|
2015
|
-
var Tabs = TabsPrimitive__namespace.Root;
|
|
2016
|
-
var TabsList = React2__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2017
|
-
TabsPrimitive__namespace.List,
|
|
2018
|
-
{
|
|
2019
|
-
ref,
|
|
2020
|
-
className: cn(
|
|
2021
|
-
"inline-flex h-9 items-center justify-center rounded-lg",
|
|
2022
|
-
"bg-tollerud-noir-800 p-1 text-tollerud-text-muted",
|
|
2023
|
-
className
|
|
2024
|
-
),
|
|
2025
|
-
...props
|
|
2026
|
-
}
|
|
2027
|
-
));
|
|
2028
|
-
TabsList.displayName = "TabsList";
|
|
2029
|
-
var TabsTrigger = React2__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2030
|
-
TabsPrimitive__namespace.Trigger,
|
|
2031
|
-
{
|
|
2032
|
-
ref,
|
|
2033
|
-
className: cn(
|
|
2034
|
-
"inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1",
|
|
2035
|
-
"text-xs font-medium transition-all",
|
|
2036
|
-
"text-tollerud-text-muted hover:text-tollerud-foreground",
|
|
2037
|
-
"data-[state=active]:bg-tollerud-surface-raised data-[state=active]:text-tollerud-foreground data-[state=active]:shadow-sm",
|
|
2038
|
-
"disabled:pointer-events-none disabled:opacity-50",
|
|
2039
|
-
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-tollerud-yellow/50",
|
|
2040
|
-
className
|
|
2041
|
-
),
|
|
2042
|
-
...props
|
|
2043
|
-
}
|
|
2044
|
-
));
|
|
2045
|
-
TabsTrigger.displayName = "TabsTrigger";
|
|
2046
|
-
var TabsContent = React2__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2047
|
-
TabsPrimitive__namespace.Content,
|
|
2048
|
-
{
|
|
2049
|
-
ref,
|
|
2050
|
-
className: cn(
|
|
2051
|
-
"mt-2 ring-offset-tollerud-black focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-tollerud-yellow/50 focus-visible:ring-offset-2",
|
|
2052
|
-
className
|
|
2053
|
-
),
|
|
2054
|
-
...props
|
|
2055
|
-
}
|
|
2056
|
-
));
|
|
2057
|
-
TabsContent.displayName = "TabsContent";
|
|
2058
|
-
function Skeleton({
|
|
2059
|
-
className,
|
|
2060
|
-
...props
|
|
2061
|
-
}) {
|
|
2062
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2063
|
-
"div",
|
|
2064
|
-
{
|
|
2065
|
-
className: cn(
|
|
2066
|
-
"animate-pulse rounded-md bg-tollerud-noir-800",
|
|
2067
|
-
className
|
|
2068
|
-
),
|
|
2069
|
-
...props
|
|
2070
|
-
}
|
|
2071
|
-
);
|
|
2072
|
-
}
|
|
2073
|
-
var Progress = React2__namespace.forwardRef(({ className, value, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2074
|
-
ProgressPrimitive__namespace.Root,
|
|
2075
|
-
{
|
|
2076
|
-
ref,
|
|
2077
|
-
className: cn(
|
|
2078
|
-
"relative h-2 w-full overflow-hidden rounded-full bg-tollerud-noir-800",
|
|
2079
|
-
className
|
|
2080
|
-
),
|
|
2081
|
-
...props,
|
|
2082
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2083
|
-
ProgressPrimitive__namespace.Indicator,
|
|
2084
|
-
{
|
|
2085
|
-
className: "h-full w-full flex-1 rounded-full bg-tollerud-yellow transition-all duration-300 ease-in-out",
|
|
2086
|
-
style: { transform: `translateX(-${100 - (value || 0)}%)` }
|
|
2087
|
-
}
|
|
2088
|
-
)
|
|
2089
|
-
}
|
|
2090
|
-
));
|
|
2091
|
-
Progress.displayName = "Progress";
|
|
2092
|
-
var Toaster = ({ theme = "dark", ...props }) => {
|
|
2093
|
-
const [mobile, setMobile] = React2.useState(false);
|
|
2094
|
-
React2.useEffect(() => {
|
|
2095
|
-
const check = () => setMobile(window.innerWidth < 640);
|
|
2096
|
-
check();
|
|
2097
|
-
window.addEventListener("resize", check);
|
|
2098
|
-
return () => window.removeEventListener("resize", check);
|
|
2099
|
-
}, []);
|
|
2100
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2101
|
-
sonner.Toaster,
|
|
2102
|
-
{
|
|
2103
|
-
position: mobile ? "top-center" : "top-right",
|
|
2104
|
-
theme,
|
|
2105
|
-
className: "toaster group",
|
|
2106
|
-
toastOptions: {
|
|
2107
|
-
classNames: {
|
|
2108
|
-
toast: "group toast group-[.toaster]:bg-tollerud-noir-900 group-[.toaster]:text-tollerud-foreground group-[.toaster]:border group-[.toaster]:border-tollerud-border/30 group-[.toaster]:shadow-lg",
|
|
2109
|
-
description: "group-[.toast]:text-tollerud-text-muted text-xs",
|
|
2110
|
-
actionButton: "group-[.toast]:bg-tollerud-yellow group-[.toast]:text-tollerud-black group-[.toast]:text-xs group-[.toast]:font-medium group-[.toast]:px-3 group-[.toast]:py-1 group-[.toast]:rounded",
|
|
2111
|
-
cancelButton: "group-[.toast]:bg-tollerud-noir-800 group-[.toast]:text-tollerud-text-muted group-[.toast]:text-xs group-[.toast]:px-3 group-[.toast]:py-1 group-[.toast]:rounded",
|
|
2112
|
-
success: "group-[.toast]:border-l-tollerud-success group-[.toast]:border-l-2",
|
|
2113
|
-
error: "group-[.toast]:border-l-tollerud-error group-[.toast]:border-l-2",
|
|
2114
|
-
warning: "group-[.toast]:border-l-tollerud-yellow group-[.toast]:border-l-2",
|
|
2115
|
-
info: "group-[.toast]:border-l-tollerud-info group-[.toast]:border-l-2"
|
|
2116
|
-
}
|
|
2117
|
-
},
|
|
2118
|
-
...props
|
|
2119
|
-
}
|
|
2120
|
-
);
|
|
2121
|
-
};
|
|
2122
|
-
var Empty = React2.forwardRef(
|
|
2123
|
-
({ className, ...props }, ref) => {
|
|
2124
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2125
|
-
"div",
|
|
2126
|
-
{
|
|
2127
|
-
ref,
|
|
2128
|
-
className: cn(
|
|
2129
|
-
"flex w-full flex-1 flex-col items-center justify-center text-center py-12",
|
|
2130
|
-
className
|
|
2131
|
-
),
|
|
2132
|
-
...props
|
|
2133
|
-
}
|
|
2134
|
-
);
|
|
2135
|
-
}
|
|
2136
|
-
);
|
|
2137
|
-
Empty.displayName = "Empty";
|
|
2138
|
-
var EmptyHeader = React2.forwardRef(
|
|
2139
|
-
({ className, ...props }, ref) => {
|
|
2140
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2141
|
-
"div",
|
|
2142
|
-
{
|
|
2143
|
-
ref,
|
|
2144
|
-
className: cn(
|
|
2145
|
-
"flex max-w-sm flex-col items-center gap-2",
|
|
2146
|
-
className
|
|
2147
|
-
),
|
|
2148
|
-
...props
|
|
2149
|
-
}
|
|
2150
|
-
);
|
|
2151
|
-
}
|
|
2152
|
-
);
|
|
2153
|
-
EmptyHeader.displayName = "EmptyHeader";
|
|
2154
|
-
var EmptyIcon = React2.forwardRef(
|
|
2155
|
-
({ className, ...props }, ref) => {
|
|
2156
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2157
|
-
"div",
|
|
2158
|
-
{
|
|
2159
|
-
ref,
|
|
2160
|
-
className: cn(
|
|
2161
|
-
"flex items-center justify-center w-12 h-12 rounded-full bg-tollerud-noir-800 text-tollerud-text-muted mb-2",
|
|
2162
|
-
className
|
|
2163
|
-
),
|
|
2164
|
-
...props
|
|
2165
|
-
}
|
|
2166
|
-
);
|
|
2167
|
-
}
|
|
2168
|
-
);
|
|
2169
|
-
EmptyIcon.displayName = "EmptyIcon";
|
|
2170
|
-
var EmptyTitle = React2.forwardRef(
|
|
2171
|
-
({ className, ...props }, ref) => {
|
|
2172
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2173
|
-
"h3",
|
|
2174
|
-
{
|
|
2175
|
-
ref,
|
|
2176
|
-
className: cn(
|
|
2177
|
-
"text-base font-semibold text-tollerud-foreground",
|
|
2178
|
-
className
|
|
2179
|
-
),
|
|
2180
|
-
...props
|
|
2181
|
-
}
|
|
2182
|
-
);
|
|
2183
|
-
}
|
|
2184
|
-
);
|
|
2185
|
-
EmptyTitle.displayName = "EmptyTitle";
|
|
2186
|
-
var EmptyDescription = React2.forwardRef(
|
|
2187
|
-
({ className, ...props }, ref) => {
|
|
2188
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2189
|
-
"p",
|
|
2190
|
-
{
|
|
2191
|
-
ref,
|
|
2192
|
-
className: cn(
|
|
2193
|
-
"text-sm text-tollerud-text-secondary max-w-sm",
|
|
2194
|
-
className
|
|
2195
|
-
),
|
|
2196
|
-
...props
|
|
2197
|
-
}
|
|
2198
|
-
);
|
|
2199
|
-
}
|
|
2200
|
-
);
|
|
2201
|
-
EmptyDescription.displayName = "EmptyDescription";
|
|
2202
|
-
var EmptyContent = React2.forwardRef(
|
|
2203
|
-
({ className, ...props }, ref) => {
|
|
2204
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2205
|
-
"div",
|
|
2206
|
-
{
|
|
2207
|
-
ref,
|
|
2208
|
-
className: cn(
|
|
2209
|
-
"flex w-full max-w-sm flex-col items-center gap-4 mt-4",
|
|
2210
|
-
className
|
|
2211
|
-
),
|
|
2212
|
-
...props
|
|
2213
|
-
}
|
|
2214
|
-
);
|
|
2215
|
-
}
|
|
2216
|
-
);
|
|
2217
|
-
EmptyContent.displayName = "EmptyContent";
|
|
2218
|
-
var DropdownMenu = DropdownMenuPrimitive__namespace.Root;
|
|
2219
|
-
var DropdownMenuTrigger = DropdownMenuPrimitive__namespace.Trigger;
|
|
2220
|
-
var DropdownMenuContent = React2.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2221
|
-
DropdownMenuPrimitive__namespace.Content,
|
|
2222
|
-
{
|
|
2223
|
-
ref,
|
|
2224
|
-
sideOffset,
|
|
2225
|
-
className: cn(
|
|
2226
|
-
"z-50 min-w-[9rem] overflow-hidden rounded-lg border p-1 shadow-md",
|
|
2227
|
-
"bg-tollerud-noir-850 border-tollerud-border/30 text-tollerud-text-primary",
|
|
2228
|
-
"data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
2229
|
-
"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
2230
|
-
"data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
|
|
2231
|
-
"data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2",
|
|
2232
|
-
"data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
2233
|
-
className
|
|
2234
|
-
),
|
|
2235
|
-
...props
|
|
2236
|
-
}
|
|
2237
|
-
) }));
|
|
2238
|
-
DropdownMenuContent.displayName = "DropdownMenuContent";
|
|
2239
|
-
var DropdownMenuItem = React2.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2240
|
-
DropdownMenuPrimitive__namespace.Item,
|
|
2241
|
-
{
|
|
2242
|
-
ref,
|
|
2243
|
-
className: cn(
|
|
2244
|
-
"relative flex cursor-default select-none items-center rounded-md px-2 py-1.5 text-sm outline-none",
|
|
2245
|
-
"text-tollerud-text-secondary data-[highlighted]:text-tollerud-text-primary",
|
|
2246
|
-
"data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
2247
|
-
"data-[highlighted]:bg-tollerud-surface-raised",
|
|
2248
|
-
inset && "pl-8",
|
|
2249
|
-
className
|
|
2250
|
-
),
|
|
2251
|
-
...props
|
|
2252
|
-
}
|
|
2253
|
-
));
|
|
2254
|
-
DropdownMenuItem.displayName = "DropdownMenuItem";
|
|
2255
|
-
var DropdownMenuSeparator = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2256
|
-
DropdownMenuPrimitive__namespace.Separator,
|
|
2257
|
-
{
|
|
2258
|
-
ref,
|
|
2259
|
-
className: cn("-mx-1 my-1 h-px bg-tollerud-border/30", className),
|
|
2260
|
-
...props
|
|
2261
|
-
}
|
|
2262
|
-
));
|
|
2263
|
-
DropdownMenuSeparator.displayName = "DropdownMenuSeparator";
|
|
2264
|
-
var DropdownMenuLabel = React2.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2265
|
-
DropdownMenuPrimitive__namespace.Label,
|
|
2266
|
-
{
|
|
2267
|
-
ref,
|
|
2268
|
-
className: cn("px-2 py-1.5 text-xs font-semibold text-tollerud-text-muted", inset && "pl-8", className),
|
|
2269
|
-
...props
|
|
2270
|
-
}
|
|
2271
|
-
));
|
|
2272
|
-
DropdownMenuLabel.displayName = "DropdownMenuLabel";
|
|
2273
|
-
var Sheet = ({ open, onOpenChange, children }) => /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Root, { open, onOpenChange, children });
|
|
2274
|
-
var SheetTrigger = DialogPrimitive__namespace.Trigger;
|
|
2275
|
-
var SheetClose = DialogPrimitive__namespace.Close;
|
|
2276
|
-
var SheetOverlay = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2277
|
-
DialogPrimitive__namespace.Overlay,
|
|
2278
|
-
{
|
|
2279
|
-
ref,
|
|
2280
|
-
className: cn(
|
|
2281
|
-
"fixed inset-0 z-50 bg-black/60 backdrop-blur-sm",
|
|
2282
|
-
"data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
2283
|
-
"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
2284
|
-
className
|
|
2285
|
-
),
|
|
2286
|
-
...props
|
|
2287
|
-
}
|
|
2288
|
-
));
|
|
2289
|
-
SheetOverlay.displayName = "SheetOverlay";
|
|
2290
|
-
var SheetContent = React2.forwardRef(({ className, children, side = "right", ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(SheetOverlay, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2291
|
-
DialogPrimitive__namespace.Content,
|
|
2292
|
-
{
|
|
2293
|
-
ref,
|
|
2294
|
-
className: cn(
|
|
2295
|
-
"fixed z-50 gap-4 bg-tollerud-noir-900 border-tollerud-border/30 p-6 shadow-lg",
|
|
2296
|
-
"data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
2297
|
-
side === "right" && [
|
|
2298
|
-
"inset-y-0 right-0 h-full w-full max-w-md border-l",
|
|
2299
|
-
"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right"
|
|
2300
|
-
],
|
|
2301
|
-
side === "left" && [
|
|
2302
|
-
"inset-y-0 left-0 h-full w-full max-w-md border-r",
|
|
2303
|
-
"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left"
|
|
2304
|
-
],
|
|
2305
|
-
className
|
|
2306
|
-
),
|
|
2307
|
-
...props,
|
|
2308
|
-
children: [
|
|
2309
|
-
children,
|
|
2310
|
-
/* @__PURE__ */ jsxRuntime.jsxs(SheetClose, { className: "absolute right-4 top-4 rounded-sm opacity-70 hover:opacity-100 transition-opacity text-tollerud-text-muted hover:text-tollerud-text-primary", children: [
|
|
2311
|
-
/* @__PURE__ */ jsxRuntime.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
2312
|
-
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M18 6 6 18" }),
|
|
2313
|
-
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "m6 6 12 12" })
|
|
2314
|
-
] }),
|
|
2315
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Close" })
|
|
2316
|
-
] })
|
|
2317
|
-
]
|
|
2318
|
-
}
|
|
2319
|
-
) }));
|
|
2320
|
-
SheetContent.displayName = "SheetContent";
|
|
2321
|
-
var SheetHeader = ({ className, ...props }) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("flex flex-col space-y-1.5 text-left", className), ...props });
|
|
2322
|
-
var SheetTitle = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2323
|
-
DialogPrimitive__namespace.Title,
|
|
2324
|
-
{
|
|
2325
|
-
ref,
|
|
2326
|
-
className: cn("text-base font-semibold text-tollerud-text-primary", className),
|
|
2327
|
-
...props
|
|
2328
|
-
}
|
|
2329
|
-
));
|
|
2330
|
-
SheetTitle.displayName = "SheetTitle";
|
|
2331
|
-
var SheetDescription = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2332
|
-
DialogPrimitive__namespace.Description,
|
|
2333
|
-
{
|
|
2334
|
-
ref,
|
|
2335
|
-
className: cn("text-sm text-tollerud-text-secondary", className),
|
|
2336
|
-
...props
|
|
2337
|
-
}
|
|
2338
|
-
));
|
|
2339
|
-
SheetDescription.displayName = "SheetDescription";
|
|
2340
|
-
function DataTableInner({
|
|
2341
|
-
columns,
|
|
2342
|
-
data,
|
|
2343
|
-
rowKey,
|
|
2344
|
-
onRowClick,
|
|
2345
|
-
className,
|
|
2346
|
-
emptyMessage = "No data",
|
|
2347
|
-
forwardedRef
|
|
2348
|
-
}) {
|
|
2349
|
-
const [sortKey, setSortKey] = React2.useState(null);
|
|
2350
|
-
const [sortDir, setSortDir] = React2.useState("asc");
|
|
2351
|
-
const [filters, setFilters] = React2.useState({});
|
|
2352
|
-
const filtered = React2.useMemo(() => {
|
|
2353
|
-
const activeFilters = Object.entries(filters).filter(([, v]) => v.trim() !== "");
|
|
2354
|
-
if (activeFilters.length === 0) return data;
|
|
2355
|
-
return data.filter(
|
|
2356
|
-
(row) => activeFilters.every(([key, filterValue]) => {
|
|
2357
|
-
const cellValue = String(row[key] ?? "").toLowerCase();
|
|
2358
|
-
return cellValue.includes(filterValue.toLowerCase());
|
|
2359
|
-
})
|
|
2360
|
-
);
|
|
2361
|
-
}, [data, filters]);
|
|
2362
|
-
const sorted = React2.useMemo(() => {
|
|
2363
|
-
if (!sortKey) return filtered;
|
|
2364
|
-
const col = columns.find((c) => c.key === sortKey);
|
|
2365
|
-
if (!col?.sortable) return filtered;
|
|
2366
|
-
return [...filtered].sort((a, b) => {
|
|
2367
|
-
const aVal = a[sortKey];
|
|
2368
|
-
const bVal = b[sortKey];
|
|
2369
|
-
if (typeof aVal === "number" && typeof bVal === "number") {
|
|
2370
|
-
return sortDir === "asc" ? aVal - bVal : bVal - aVal;
|
|
2371
|
-
}
|
|
2372
|
-
const aStr = String(aVal ?? "");
|
|
2373
|
-
const bStr = String(bVal ?? "");
|
|
2374
|
-
const cmp = aStr.localeCompare(bStr, "nb", { numeric: true });
|
|
2375
|
-
return sortDir === "asc" ? cmp : -cmp;
|
|
2376
|
-
});
|
|
2377
|
-
}, [filtered, sortKey, sortDir, columns]);
|
|
2378
|
-
const getRowKey = (row, i) => {
|
|
2379
|
-
if (typeof rowKey === "function") return rowKey(row);
|
|
2380
|
-
if (rowKey) return row[rowKey];
|
|
2381
|
-
return row.id ?? row.key ?? i;
|
|
2382
|
-
};
|
|
2383
|
-
const toggleSort = (key) => {
|
|
2384
|
-
if (sortKey === key) {
|
|
2385
|
-
setSortDir((d) => d === "asc" ? "desc" : "asc");
|
|
2386
|
-
} else {
|
|
2387
|
-
setSortKey(key);
|
|
2388
|
-
setSortDir("asc");
|
|
2389
|
-
}
|
|
2390
|
-
};
|
|
2391
|
-
const updateFilter = (key, value) => {
|
|
2392
|
-
setFilters((prev) => {
|
|
2393
|
-
const next = { ...prev };
|
|
2394
|
-
if (value.trim() === "") {
|
|
2395
|
-
delete next[key];
|
|
2396
|
-
} else {
|
|
2397
|
-
next[key] = value;
|
|
2398
|
-
}
|
|
2399
|
-
return next;
|
|
2400
|
-
});
|
|
2401
|
-
};
|
|
2402
|
-
const hasActiveFilters = Object.values(filters).some((v) => v.trim() !== "");
|
|
2403
|
-
const filterableColumns = columns.filter((c) => c.filterable);
|
|
2404
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref: forwardedRef, className: cn("overflow-x-auto rounded-lg border border-tollerud-border/30", className), children: /* @__PURE__ */ jsxRuntime.jsxs("table", { className: "w-full text-sm", children: [
|
|
2405
|
-
/* @__PURE__ */ jsxRuntime.jsxs("thead", { children: [
|
|
2406
|
-
/* @__PURE__ */ jsxRuntime.jsx("tr", { className: "border-b border-tollerud-border/30 bg-tollerud-noir-900", children: columns.map((col) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2407
|
-
"th",
|
|
2408
|
-
{
|
|
2409
|
-
className: cn(
|
|
2410
|
-
"px-3 py-2.5 text-xs font-semibold text-tollerud-text-muted uppercase tracking-wider",
|
|
2411
|
-
col.sortable && "cursor-pointer select-none hover:text-tollerud-text-primary transition-colors",
|
|
2412
|
-
col.align === "right" && "text-right",
|
|
2413
|
-
col.align === "center" && "text-center"
|
|
2414
|
-
),
|
|
2415
|
-
style: col.width ? { width: col.width } : void 0,
|
|
2416
|
-
onClick: () => col.sortable && toggleSort(col.key),
|
|
2417
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "inline-flex items-center gap-1.5", children: [
|
|
2418
|
-
col.label,
|
|
2419
|
-
col.sortable && sortKey === col.key && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-tollerud-accent", children: sortDir === "asc" ? "\u2191" : "\u2193" }),
|
|
2420
|
-
col.sortable && sortKey !== col.key && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-tollerud-text-muted/30", children: "\u2195" }),
|
|
2421
|
-
col.filterable && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2422
|
-
"svg",
|
|
2423
|
-
{
|
|
2424
|
-
width: "12",
|
|
2425
|
-
height: "12",
|
|
2426
|
-
viewBox: "0 0 24 24",
|
|
2427
|
-
fill: "none",
|
|
2428
|
-
stroke: "currentColor",
|
|
2429
|
-
strokeWidth: "2",
|
|
2430
|
-
strokeLinecap: "round",
|
|
2431
|
-
strokeLinejoin: "round",
|
|
2432
|
-
className: cn(
|
|
2433
|
-
"opacity-40",
|
|
2434
|
-
filters[col.key] && "opacity-100 text-tollerud-yellow"
|
|
2435
|
-
),
|
|
2436
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M4 4h16v2.172a2 2 0 0 1-.586 1.414L15 12v7l-6 2v-8.5L4.52 7.53A2 2 0 0 1 4 6.16V4z" })
|
|
2437
|
-
}
|
|
2438
|
-
)
|
|
2439
|
-
] })
|
|
2440
|
-
},
|
|
2441
|
-
col.key
|
|
2442
|
-
)) }),
|
|
2443
|
-
filterableColumns.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("tr", { className: "border-b border-tollerud-border/20", children: columns.map((col) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2444
|
-
"th",
|
|
2445
|
-
{
|
|
2446
|
-
className: cn(
|
|
2447
|
-
"px-1.5 py-1",
|
|
2448
|
-
col.align === "right" && "text-right",
|
|
2449
|
-
col.align === "center" && "text-center"
|
|
2450
|
-
),
|
|
2451
|
-
children: col.filterable ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2452
|
-
"input",
|
|
2453
|
-
{
|
|
2454
|
-
type: "text",
|
|
2455
|
-
placeholder: `Filter ${col.label.toLowerCase()}\u2026`,
|
|
2456
|
-
value: filters[col.key] ?? "",
|
|
2457
|
-
onChange: (e) => updateFilter(col.key, e.target.value),
|
|
2458
|
-
className: cn(
|
|
2459
|
-
"w-full px-2 py-1 text-xs rounded border transition-colors outline-none",
|
|
2460
|
-
"bg-tollerud-noir-900/50 border-tollerud-border/20 text-tollerud-text-primary placeholder:text-tollerud-text-muted/40",
|
|
2461
|
-
"focus:border-tollerud-yellow/40 focus:ring-1 focus:ring-tollerud-yellow/20"
|
|
2462
|
-
)
|
|
2463
|
-
}
|
|
2464
|
-
) : null
|
|
2465
|
-
},
|
|
2466
|
-
`filter-${col.key}`
|
|
2467
|
-
)) })
|
|
2468
|
-
] }),
|
|
2469
|
-
/* @__PURE__ */ jsxRuntime.jsx("tbody", { children: sorted.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("tr", { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2470
|
-
"td",
|
|
2471
|
-
{
|
|
2472
|
-
colSpan: columns.length,
|
|
2473
|
-
className: "px-3 py-8 text-center text-sm text-tollerud-text-muted",
|
|
2474
|
-
children: hasActiveFilters ? "No matching rows" : emptyMessage
|
|
2475
|
-
}
|
|
2476
|
-
) }) : sorted.map((row, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2477
|
-
"tr",
|
|
2478
|
-
{
|
|
2479
|
-
className: cn(
|
|
2480
|
-
"border-b border-tollerud-border/20 transition-colors",
|
|
2481
|
-
onRowClick && "cursor-pointer hover:bg-tollerud-surface-raised/50"
|
|
2482
|
-
),
|
|
2483
|
-
onClick: () => onRowClick?.(row),
|
|
2484
|
-
children: columns.map((col) => {
|
|
2485
|
-
const value = row[col.key];
|
|
2486
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2487
|
-
"td",
|
|
2488
|
-
{
|
|
2489
|
-
className: cn(
|
|
2490
|
-
"px-3 py-2.5 text-tollerud-text-secondary",
|
|
2491
|
-
col.align === "right" && "text-right",
|
|
2492
|
-
col.align === "center" && "text-center",
|
|
2493
|
-
"font-mono text-xs"
|
|
2494
|
-
),
|
|
2495
|
-
children: col.render ? col.render(value, row) : String(value ?? "\u2014")
|
|
2496
|
-
},
|
|
2497
|
-
col.key
|
|
2498
|
-
);
|
|
2499
|
-
})
|
|
2500
|
-
},
|
|
2501
|
-
getRowKey(row, i)
|
|
2502
|
-
)) })
|
|
2503
|
-
] }) });
|
|
2504
|
-
}
|
|
2505
|
-
var DataTable = React2.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(DataTableInner, { ...props, forwardedRef: ref }));
|
|
2506
|
-
DataTable.displayName = "DataTable";
|
|
2507
|
-
function GlowCard({
|
|
2508
|
-
children,
|
|
2509
|
-
className,
|
|
2510
|
-
glowColor = "var(--tollerud-accent, #FFFF00)",
|
|
2511
|
-
intensity = 0.15
|
|
2512
|
-
}) {
|
|
2513
|
-
const ref = React2.useRef(null);
|
|
2514
|
-
const [pos, setPos] = React2.useState({ x: 0, y: 0 });
|
|
2515
|
-
const [isHovered, setIsHovered] = React2.useState(false);
|
|
2516
|
-
const handleMouseMove = (e) => {
|
|
2517
|
-
if (!ref.current) return;
|
|
2518
|
-
const rect = ref.current.getBoundingClientRect();
|
|
2519
|
-
setPos({
|
|
2520
|
-
x: (e.clientX - rect.left) / rect.width * 100,
|
|
2521
|
-
y: (e.clientY - rect.top) / rect.height * 100
|
|
2522
|
-
});
|
|
2523
|
-
};
|
|
2524
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2525
|
-
"div",
|
|
2526
|
-
{
|
|
2527
|
-
ref,
|
|
2528
|
-
className: cn("relative overflow-hidden", className),
|
|
2529
|
-
onMouseMove: handleMouseMove,
|
|
2530
|
-
onMouseEnter: () => setIsHovered(true),
|
|
2531
|
-
onMouseLeave: () => setIsHovered(false),
|
|
2532
|
-
children: [
|
|
2533
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2534
|
-
"div",
|
|
2535
|
-
{
|
|
2536
|
-
className: "pointer-events-none absolute inset-0 transition-opacity duration-300",
|
|
2537
|
-
style: {
|
|
2538
|
-
opacity: isHovered ? 1 : 0,
|
|
2539
|
-
background: `radial-gradient(600px circle at ${pos.x}% ${pos.y}%, ${glowColor} ${intensity * 100}%, transparent 70%)`
|
|
2540
|
-
}
|
|
2541
|
-
}
|
|
2542
|
-
),
|
|
2543
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative z-10", children })
|
|
2544
|
-
]
|
|
2545
|
-
}
|
|
2546
|
-
);
|
|
2547
|
-
}
|
|
2548
|
-
function BentoDashboard({
|
|
2549
|
-
title,
|
|
2550
|
-
hosts = [],
|
|
2551
|
-
metrics = [],
|
|
2552
|
-
services = [],
|
|
2553
|
-
incidents = [],
|
|
2554
|
-
className
|
|
2555
|
-
}) {
|
|
2556
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("space-y-4", className), children: [
|
|
2557
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
2558
|
-
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-lg font-semibold text-tollerud-text-primary", children: title }),
|
|
2559
|
-
/* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-xs text-tollerud-text-muted", children: [
|
|
2560
|
-
hosts.length,
|
|
2561
|
-
" hosts \xB7 ",
|
|
2562
|
-
services.length,
|
|
2563
|
-
" services",
|
|
2564
|
-
incidents.length > 0 && ` \xB7 ${incidents.length} active incident${incidents.length > 1 ? "s" : ""}`
|
|
2565
|
-
] })
|
|
2566
|
-
] }) }),
|
|
2567
|
-
hosts.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-3", children: [
|
|
2568
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "md:col-span-2 lg:col-span-1", children: /* @__PURE__ */ jsxRuntime.jsx(HostCardComponent, { host: hosts[0] }) }),
|
|
2569
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-1 gap-3 md:col-span-2 lg:col-span-1", children: hosts.slice(1).map((h, i) => /* @__PURE__ */ jsxRuntime.jsx(HostCardComponent, { host: h }, h.hostname ?? i)) })
|
|
2570
|
-
] }),
|
|
2571
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 lg:grid-cols-3 gap-3", children: [
|
|
2572
|
-
metrics.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "lg:col-span-2", children: [
|
|
2573
|
-
/* @__PURE__ */ jsxRuntime.jsx(SectionLabel, { children: "Metrics" }),
|
|
2574
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-2 sm:grid-cols-4 gap-2", children: metrics.map((m, i) => /* @__PURE__ */ jsxRuntime.jsx(StatCardComponent, { stat: m }, m.label ?? i)) })
|
|
2575
|
-
] }),
|
|
2576
|
-
services.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
2577
|
-
/* @__PURE__ */ jsxRuntime.jsx(SectionLabel, { children: "Services" }),
|
|
2578
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-2", children: services.slice(0, 4).map((s, i) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-lg border border-tollerud-border/20 bg-tollerud-surface p-3", children: [
|
|
2579
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
2580
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-medium text-tollerud-text-primary", children: s.service }),
|
|
2581
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: cn(
|
|
2582
|
-
"text-xs px-1.5 py-0.5 rounded-full font-medium",
|
|
2583
|
-
s.status === "online" && "text-tollerud-accent bg-tollerud-accent/10",
|
|
2584
|
-
s.status === "warning" && "text-tollerud-warning bg-tollerud-warning/10",
|
|
2585
|
-
s.status === "offline" && "text-tollerud-error bg-tollerud-error/10",
|
|
2586
|
-
s.status === "idle" && "text-tollerud-text-muted bg-tollerud-noir-800"
|
|
2587
|
-
), children: s.status })
|
|
2588
|
-
] }),
|
|
2589
|
-
s.responseTime && /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-xs text-tollerud-text-muted mt-1", children: [
|
|
2590
|
-
s.responseTime,
|
|
2591
|
-
" response"
|
|
2592
|
-
] })
|
|
2593
|
-
] }, s.service ?? i)) })
|
|
2594
|
-
] })
|
|
2595
|
-
] }),
|
|
2596
|
-
incidents.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
2597
|
-
/* @__PURE__ */ jsxRuntime.jsx(SectionLabel, { children: "Recent Incidents" }),
|
|
2598
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-1.5", children: incidents.slice(0, 4).map((inc, i) => /* @__PURE__ */ jsxRuntime.jsx(IncidentCardItem, { incident: inc }, inc.title + i)) })
|
|
2599
|
-
] })
|
|
2600
|
-
] });
|
|
2601
|
-
}
|
|
2602
|
-
function SectionLabel({ children }) {
|
|
2603
|
-
return /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs font-semibold text-tollerud-text-muted uppercase tracking-wider mb-2", children });
|
|
2604
|
-
}
|
|
2605
|
-
function HostCardComponent({ host }) {
|
|
2606
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn(
|
|
2607
|
-
"rounded-xl border p-4",
|
|
2608
|
-
host.status === "online" ? "border-tollerud-border/30 bg-tollerud-surface" : host.status === "warning" ? "border-tollerud-warning/30 bg-tollerud-warning/5" : "border-tollerud-border/20 bg-tollerud-surface opacity-70"
|
|
2609
|
-
), children: [
|
|
2610
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between mb-3", children: [
|
|
2611
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
2612
|
-
/* @__PURE__ */ jsxRuntime.jsx(StatusDotComp, { status: host.status }),
|
|
2613
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-semibold text-tollerud-text-primary", children: host.hostname })
|
|
2614
|
-
] }),
|
|
2615
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-tollerud-text-muted font-mono", children: host.ip })
|
|
2616
|
-
] }),
|
|
2617
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-2 text-xs", children: [
|
|
2618
|
-
host.cpu && /* @__PURE__ */ jsxRuntime.jsx(MetricBadge, { label: "CPU", value: host.cpu }),
|
|
2619
|
-
host.memory && /* @__PURE__ */ jsxRuntime.jsx(MetricBadge, { label: "Mem", value: host.memory }),
|
|
2620
|
-
host.disk && /* @__PURE__ */ jsxRuntime.jsx(MetricBadge, { label: "Disk", value: host.disk }),
|
|
2621
|
-
host.uptime && /* @__PURE__ */ jsxRuntime.jsx(MetricBadge, { label: "Up", value: host.uptime })
|
|
2622
|
-
] })
|
|
2623
|
-
] });
|
|
2624
|
-
}
|
|
2625
|
-
function StatCardComponent({ stat }) {
|
|
2626
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-lg border border-tollerud-border/20 bg-tollerud-surface p-3", children: [
|
|
2627
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-tollerud-text-muted", children: stat.label }),
|
|
2628
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-lg font-semibold text-tollerud-text-primary mt-0.5", children: stat.value }),
|
|
2629
|
-
stat.change && /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn(
|
|
2630
|
-
"text-xs font-medium",
|
|
2631
|
-
stat.change.direction === "up" ? "text-tollerud-accent" : "text-tollerud-error"
|
|
2632
|
-
), children: stat.change.value })
|
|
2633
|
-
] });
|
|
2634
|
-
}
|
|
2635
|
-
function IncidentCardItem({ incident }) {
|
|
2636
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn(
|
|
2637
|
-
"flex items-start gap-3 rounded-lg border p-3",
|
|
2638
|
-
incident.acknowledged ? "border-tollerud-border/10 bg-tollerud-noir-900/50 opacity-60" : "border-tollerud-border/20 bg-tollerud-surface"
|
|
2639
|
-
), children: [
|
|
2640
|
-
/* @__PURE__ */ jsxRuntime.jsx(SeverityDot, { severity: incident.severity }),
|
|
2641
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
2642
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
2643
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-medium text-tollerud-text-primary truncate", children: incident.title }),
|
|
2644
|
-
incident.acknowledged && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-tollerud-text-muted", children: "(acknowledged)" })
|
|
2645
|
-
] }),
|
|
2646
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 text-xs text-tollerud-text-muted mt-0.5", children: [
|
|
2647
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { children: incident.service }),
|
|
2648
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "\xB7" }),
|
|
2649
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { children: incident.timestamp })
|
|
2650
|
-
] }),
|
|
2651
|
-
incident.description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-tollerud-text-secondary mt-1", children: incident.description })
|
|
2652
|
-
] })
|
|
2653
|
-
] });
|
|
2654
|
-
}
|
|
2655
|
-
function StatusDotComp({ status }) {
|
|
2656
|
-
return /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn(
|
|
2657
|
-
"inline-block w-2 h-2 rounded-full",
|
|
2658
|
-
status === "online" && "bg-tollerud-accent shadow-[0_0_4px_var(--tollerud-accent)]",
|
|
2659
|
-
status === "warning" && "bg-tollerud-warning",
|
|
2660
|
-
status === "offline" && "bg-tollerud-error"
|
|
2661
|
-
) });
|
|
2662
|
-
}
|
|
2663
|
-
function SeverityDot({ severity }) {
|
|
2664
|
-
return /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn(
|
|
2665
|
-
"inline-block w-2 h-2 rounded-full mt-1 shrink-0",
|
|
2666
|
-
severity === "critical" && "bg-tollerud-error shadow-[0_0_4px_var(--tollerud-error)]",
|
|
2667
|
-
severity === "high" && "bg-tollerud-warning",
|
|
2668
|
-
severity === "medium" && "bg-tollerud-accent",
|
|
2669
|
-
severity === "low" && "bg-tollerud-text-muted",
|
|
2670
|
-
severity === "info" && "bg-tollerud-info"
|
|
2671
|
-
) });
|
|
2672
|
-
}
|
|
2673
|
-
function MetricBadge({ label, value }) {
|
|
2674
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded bg-tollerud-noir-800 px-2 py-1.5", children: [
|
|
2675
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-tollerud-text-muted", children: label }),
|
|
2676
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "float-right text-tollerud-text-primary font-mono", children: value })
|
|
2677
|
-
] });
|
|
2678
|
-
}
|
|
2679
|
-
var Divider = React2.forwardRef(
|
|
2680
|
-
({ className, orientation = "horizontal", label, ...props }, ref) => {
|
|
2681
|
-
if (orientation === "vertical") {
|
|
2682
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2683
|
-
"div",
|
|
2684
|
-
{
|
|
2685
|
-
ref,
|
|
2686
|
-
role: "separator",
|
|
2687
|
-
"aria-orientation": "vertical",
|
|
2688
|
-
className: cn("w-px self-stretch bg-tollerud-border", className),
|
|
2689
|
-
...props
|
|
2690
|
-
}
|
|
2691
|
-
);
|
|
2692
|
-
}
|
|
2693
|
-
if (label) {
|
|
2694
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2695
|
-
"div",
|
|
2696
|
-
{
|
|
2697
|
-
ref,
|
|
2698
|
-
role: "separator",
|
|
2699
|
-
"aria-orientation": "horizontal",
|
|
2700
|
-
className: cn("flex items-center gap-3 text-xs text-tollerud-text-muted", className),
|
|
2701
|
-
...props,
|
|
2702
|
-
children: [
|
|
2703
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "h-px flex-1 bg-tollerud-border" }),
|
|
2704
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { children: label }),
|
|
2705
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "h-px flex-1 bg-tollerud-border" })
|
|
2706
|
-
]
|
|
2707
|
-
}
|
|
2708
|
-
);
|
|
2709
|
-
}
|
|
2710
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2711
|
-
"div",
|
|
2712
|
-
{
|
|
2713
|
-
ref,
|
|
2714
|
-
role: "separator",
|
|
2715
|
-
"aria-orientation": "horizontal",
|
|
2716
|
-
className: cn("h-px w-full bg-tollerud-border", className),
|
|
2717
|
-
...props
|
|
2718
|
-
}
|
|
2719
|
-
);
|
|
2720
|
-
}
|
|
2721
|
-
);
|
|
2722
|
-
Divider.displayName = "Divider";
|
|
2723
|
-
var pillVariants = {
|
|
2724
|
-
outline: "bg-transparent border border-tollerud-border text-tollerud-text-secondary",
|
|
2725
|
-
solid: "bg-tollerud-surface-raised text-tollerud-text-primary",
|
|
2726
|
-
accent: "bg-tollerud-yellow/15 border border-tollerud-yellow/30 text-tollerud-yellow"
|
|
2727
|
-
};
|
|
2728
|
-
var Pill = React2.forwardRef(
|
|
2729
|
-
({ className, variant = "outline", ...props }, ref) => {
|
|
2730
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2731
|
-
"span",
|
|
2732
|
-
{
|
|
2733
|
-
ref,
|
|
2734
|
-
className: cn(
|
|
2735
|
-
"inline-flex items-center gap-1 px-2.5 py-1 text-xs font-medium rounded-full leading-none",
|
|
2736
|
-
pillVariants[variant],
|
|
2737
|
-
className
|
|
2738
|
-
),
|
|
2739
|
-
...props
|
|
2740
|
-
}
|
|
2741
|
-
);
|
|
2742
|
-
}
|
|
2743
|
-
);
|
|
2744
|
-
Pill.displayName = "Pill";
|
|
2745
|
-
var avatarSizes = {
|
|
2746
|
-
sm: "h-6 w-6 text-[10px]",
|
|
2747
|
-
md: "h-8 w-8 text-xs",
|
|
2748
|
-
lg: "h-11 w-11 text-sm"
|
|
2749
|
-
};
|
|
2750
|
-
function initialsFrom(name) {
|
|
2751
|
-
const parts = name.trim().split(/\s+/).filter(Boolean);
|
|
2752
|
-
if (parts.length === 0) return "";
|
|
2753
|
-
if (parts.length === 1) return parts[0].slice(0, 2).toUpperCase();
|
|
2754
|
-
return (parts[0][0] + parts[parts.length - 1][0]).toUpperCase();
|
|
2755
|
-
}
|
|
2756
|
-
var Avatar = React2.forwardRef(
|
|
2757
|
-
({ className, src, name, fallback, size = "md", ...props }, ref) => {
|
|
2758
|
-
const [errored, setErrored] = React2.useState(false);
|
|
2759
|
-
const showImage = !!src && !errored;
|
|
2760
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2761
|
-
"span",
|
|
2762
|
-
{
|
|
2763
|
-
ref,
|
|
2764
|
-
className: cn(
|
|
2765
|
-
"relative inline-flex shrink-0 items-center justify-center overflow-hidden rounded-full select-none",
|
|
2766
|
-
"bg-tollerud-surface-raised text-tollerud-text-secondary font-medium",
|
|
2767
|
-
"ring-1 ring-tollerud-border",
|
|
2768
|
-
avatarSizes[size],
|
|
2769
|
-
className
|
|
2770
|
-
),
|
|
2771
|
-
...props,
|
|
2772
|
-
children: showImage ? (
|
|
2773
|
-
// eslint-disable-next-line @next/next/no-img-element
|
|
2774
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2775
|
-
"img",
|
|
2776
|
-
{
|
|
2777
|
-
src,
|
|
2778
|
-
alt: name ?? "",
|
|
2779
|
-
className: "h-full w-full object-cover",
|
|
2780
|
-
onError: () => setErrored(true)
|
|
2781
|
-
}
|
|
2782
|
-
)
|
|
2783
|
-
) : /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": !!name, children: fallback ?? (name ? initialsFrom(name) : null) })
|
|
2784
|
-
}
|
|
2785
|
-
);
|
|
2786
|
-
}
|
|
2787
|
-
);
|
|
2788
|
-
Avatar.displayName = "Avatar";
|
|
2789
|
-
var AvatarGroup = React2.forwardRef(
|
|
2790
|
-
({ className, max, size = "md", children, ...props }, ref) => {
|
|
2791
|
-
const items = Array.isArray(children) ? children : [children];
|
|
2792
|
-
const visible = max ? items.slice(0, max) : items;
|
|
2793
|
-
const overflow = max ? items.length - max : 0;
|
|
2794
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2795
|
-
"div",
|
|
2796
|
-
{
|
|
2797
|
-
ref,
|
|
2798
|
-
className: cn("flex items-center -space-x-2", className),
|
|
2799
|
-
...props,
|
|
2800
|
-
children: [
|
|
2801
|
-
visible.map((child, i) => /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ring-2 ring-tollerud-surface rounded-full", children: child }, i)),
|
|
2802
|
-
overflow > 0 && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2803
|
-
"span",
|
|
2804
|
-
{
|
|
2805
|
-
className: cn(
|
|
2806
|
-
"relative inline-flex shrink-0 items-center justify-center rounded-full select-none",
|
|
2807
|
-
"bg-tollerud-surface-raised text-tollerud-text-muted font-medium",
|
|
2808
|
-
"ring-2 ring-tollerud-surface",
|
|
2809
|
-
avatarSizes[size]
|
|
2810
|
-
),
|
|
2811
|
-
children: [
|
|
2812
|
-
"+",
|
|
2813
|
-
overflow
|
|
2814
|
-
]
|
|
2815
|
-
}
|
|
2816
|
-
)
|
|
2817
|
-
]
|
|
2818
|
-
}
|
|
2819
|
-
);
|
|
2820
|
-
}
|
|
2821
|
-
);
|
|
2822
|
-
AvatarGroup.displayName = "AvatarGroup";
|
|
2823
|
-
var Breadcrumb = React2.forwardRef(
|
|
2824
|
-
({ className, items, separator, ...props }, ref) => {
|
|
2825
|
-
return /* @__PURE__ */ jsxRuntime.jsx("nav", { ref, "aria-label": "Breadcrumb", className: cn("text-sm", className), ...props, children: /* @__PURE__ */ jsxRuntime.jsx("ol", { className: "flex items-center gap-1.5 flex-wrap", children: items.map((item, i) => {
|
|
2826
|
-
const isLast = i === items.length - 1;
|
|
2827
|
-
const content = !isLast && (item.href || item.onClick) ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2828
|
-
"a",
|
|
2829
|
-
{
|
|
2830
|
-
href: item.href,
|
|
2831
|
-
onClick: item.onClick,
|
|
2832
|
-
className: "text-tollerud-text-secondary hover:text-tollerud-text-primary transition-colors duration-[150ms]",
|
|
2833
|
-
children: item.label
|
|
2834
|
-
}
|
|
2835
|
-
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
2836
|
-
"span",
|
|
2837
|
-
{
|
|
2838
|
-
"aria-current": isLast ? "page" : void 0,
|
|
2839
|
-
className: isLast ? "text-tollerud-text-primary font-medium" : "text-tollerud-text-secondary",
|
|
2840
|
-
children: item.label
|
|
2841
|
-
}
|
|
2842
|
-
);
|
|
2843
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(React2.Fragment, { children: [
|
|
2844
|
-
/* @__PURE__ */ jsxRuntime.jsx("li", { className: "flex items-center gap-1.5", children: content }),
|
|
2845
|
-
!isLast && /* @__PURE__ */ jsxRuntime.jsx("li", { "aria-hidden": "true", className: "flex items-center text-tollerud-text-muted", children: separator ?? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { size: 14 }) })
|
|
2846
|
-
] }, i);
|
|
2847
|
-
}) }) });
|
|
2848
|
-
}
|
|
2849
|
-
);
|
|
2850
|
-
Breadcrumb.displayName = "Breadcrumb";
|
|
2851
|
-
function getPageRange(page, pageCount, siblingCount) {
|
|
2852
|
-
const totalVisible = siblingCount * 2 + 5;
|
|
2853
|
-
if (pageCount <= totalVisible) {
|
|
2854
|
-
return Array.from({ length: pageCount }, (_, i) => i + 1);
|
|
2855
|
-
}
|
|
2856
|
-
const left = Math.max(page - siblingCount, 1);
|
|
2857
|
-
const right = Math.min(page + siblingCount, pageCount);
|
|
2858
|
-
const range = [1];
|
|
2859
|
-
if (left > 2) range.push("ellipsis");
|
|
2860
|
-
for (let p = left === 1 ? 2 : left; p <= (right === pageCount ? pageCount - 1 : right); p++) {
|
|
2861
|
-
range.push(p);
|
|
2862
|
-
}
|
|
2863
|
-
if (right < pageCount - 1) range.push("ellipsis");
|
|
2864
|
-
if (pageCount > 1) range.push(pageCount);
|
|
2865
|
-
return range;
|
|
2866
|
-
}
|
|
2867
|
-
var navButtonClasses = "inline-flex h-8 min-w-8 items-center justify-center rounded px-2 text-sm transition-colors duration-[150ms] disabled:opacity-40 disabled:pointer-events-none";
|
|
2868
|
-
var Pagination = React2.forwardRef(
|
|
2869
|
-
({ className, page, pageCount, onChange, siblingCount = 1, ...props }, ref) => {
|
|
2870
|
-
const range = getPageRange(page, pageCount, siblingCount);
|
|
2871
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("nav", { ref, "aria-label": "Pagination", className: cn("flex items-center gap-1", className), ...props, children: [
|
|
2872
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2873
|
-
"button",
|
|
2874
|
-
{
|
|
2875
|
-
type: "button",
|
|
2876
|
-
"aria-label": "Previous page",
|
|
2877
|
-
disabled: page <= 1,
|
|
2878
|
-
onClick: () => onChange(page - 1),
|
|
2879
|
-
className: cn(navButtonClasses, "text-tollerud-text-secondary hover:bg-tollerud-surface-hover"),
|
|
2880
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronLeft, { size: 16 })
|
|
2881
|
-
}
|
|
2882
|
-
),
|
|
2883
|
-
range.map(
|
|
2884
|
-
(item, i) => item === "ellipsis" ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-flex h-8 w-8 items-center justify-center text-tollerud-text-muted", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MoreHorizontal, { size: 16 }) }, `e-${i}`) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
2885
|
-
"button",
|
|
2886
|
-
{
|
|
2887
|
-
type: "button",
|
|
2888
|
-
"aria-current": item === page ? "page" : void 0,
|
|
2889
|
-
onClick: () => onChange(item),
|
|
2890
|
-
className: cn(
|
|
2891
|
-
navButtonClasses,
|
|
2892
|
-
item === page ? "bg-tollerud-yellow text-tollerud-noir-black font-medium" : "text-tollerud-text-secondary hover:bg-tollerud-surface-hover"
|
|
2893
|
-
),
|
|
2894
|
-
children: item
|
|
2895
|
-
},
|
|
2896
|
-
item
|
|
2897
|
-
)
|
|
2898
|
-
),
|
|
2899
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2900
|
-
"button",
|
|
2901
|
-
{
|
|
2902
|
-
type: "button",
|
|
2903
|
-
"aria-label": "Next page",
|
|
2904
|
-
disabled: page >= pageCount,
|
|
2905
|
-
onClick: () => onChange(page + 1),
|
|
2906
|
-
className: cn(navButtonClasses, "text-tollerud-text-secondary hover:bg-tollerud-surface-hover"),
|
|
2907
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { size: 16 })
|
|
2908
|
-
}
|
|
2909
|
-
)
|
|
2910
|
-
] });
|
|
2911
|
-
}
|
|
2912
|
-
);
|
|
2913
|
-
Pagination.displayName = "Pagination";
|
|
2914
|
-
var Segmented = React2.forwardRef(
|
|
2915
|
-
({ className, options, value, onChange, size = "md", ...props }, ref) => {
|
|
2916
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2917
|
-
"div",
|
|
2918
|
-
{
|
|
2919
|
-
ref,
|
|
2920
|
-
role: "radiogroup",
|
|
2921
|
-
className: cn(
|
|
2922
|
-
"inline-flex items-center gap-0.5 rounded-lg p-1 bg-tollerud-surface-raised border border-tollerud-border",
|
|
2923
|
-
className
|
|
2924
|
-
),
|
|
2925
|
-
...props,
|
|
2926
|
-
children: options.map((opt) => {
|
|
2927
|
-
const active = opt.value === value;
|
|
2928
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2929
|
-
"button",
|
|
2930
|
-
{
|
|
2931
|
-
type: "button",
|
|
2932
|
-
role: "radio",
|
|
2933
|
-
"aria-checked": active,
|
|
2934
|
-
disabled: opt.disabled,
|
|
2935
|
-
onClick: () => !opt.disabled && onChange(opt.value),
|
|
2936
|
-
className: cn(
|
|
2937
|
-
"rounded-md font-medium transition-colors duration-[150ms]",
|
|
2938
|
-
size === "sm" ? "px-2.5 py-1 text-xs" : "px-3.5 py-1.5 text-sm",
|
|
2939
|
-
active ? "bg-tollerud-yellow text-tollerud-noir-black" : "text-tollerud-text-secondary hover:text-tollerud-text-primary",
|
|
2940
|
-
opt.disabled && "opacity-40 pointer-events-none"
|
|
2941
|
-
),
|
|
2942
|
-
children: opt.label
|
|
2943
|
-
},
|
|
2944
|
-
opt.value
|
|
2945
|
-
);
|
|
2946
|
-
})
|
|
2947
|
-
}
|
|
2948
|
-
);
|
|
2949
|
-
}
|
|
2950
|
-
);
|
|
2951
|
-
Segmented.displayName = "Segmented";
|
|
2952
|
-
var Stepper = React2.forwardRef(
|
|
2953
|
-
({ className, steps, current, orientation = "horizontal", ...props }, ref) => {
|
|
2954
|
-
const vertical = orientation === "vertical";
|
|
2955
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2956
|
-
"ol",
|
|
2957
|
-
{
|
|
2958
|
-
ref,
|
|
2959
|
-
className: cn("flex", vertical ? "flex-col gap-0" : "items-start gap-0 w-full", className),
|
|
2960
|
-
...props,
|
|
2961
|
-
children: steps.map((step, i) => {
|
|
2962
|
-
const status = i < current ? "complete" : i === current ? "active" : "upcoming";
|
|
2963
|
-
const isLast = i === steps.length - 1;
|
|
2964
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2965
|
-
"li",
|
|
2966
|
-
{
|
|
2967
|
-
className: cn(
|
|
2968
|
-
"flex",
|
|
2969
|
-
vertical ? "flex-row gap-3" : "flex-col flex-1 gap-2",
|
|
2970
|
-
!vertical && !isLast && "pr-2"
|
|
2971
|
-
),
|
|
2972
|
-
children: [
|
|
2973
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("flex items-center", vertical ? "flex-col" : "flex-row gap-2 w-full"), children: [
|
|
2974
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2975
|
-
"span",
|
|
2976
|
-
{
|
|
2977
|
-
className: cn(
|
|
2978
|
-
"flex h-7 w-7 shrink-0 items-center justify-center rounded-full text-xs font-medium transition-colors duration-[150ms]",
|
|
2979
|
-
status === "complete" && "bg-tollerud-yellow text-tollerud-noir-black",
|
|
2980
|
-
status === "active" && "border-2 border-tollerud-yellow text-tollerud-yellow",
|
|
2981
|
-
status === "upcoming" && "border border-tollerud-border text-tollerud-text-muted"
|
|
2982
|
-
),
|
|
2983
|
-
children: status === "complete" ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { size: 14 }) : i + 1
|
|
2984
|
-
}
|
|
2985
|
-
),
|
|
2986
|
-
!isLast && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2987
|
-
"span",
|
|
2988
|
-
{
|
|
2989
|
-
"aria-hidden": "true",
|
|
2990
|
-
className: cn(
|
|
2991
|
-
"bg-tollerud-border",
|
|
2992
|
-
vertical ? "w-px flex-1 my-1" : "h-px flex-1",
|
|
2993
|
-
status === "complete" && "bg-tollerud-yellow"
|
|
2994
|
-
)
|
|
2995
|
-
}
|
|
2996
|
-
)
|
|
2997
|
-
] }),
|
|
2998
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("flex flex-col", vertical && "pb-6"), children: [
|
|
2999
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3000
|
-
"span",
|
|
3001
|
-
{
|
|
3002
|
-
className: cn(
|
|
3003
|
-
"text-sm font-medium",
|
|
3004
|
-
status === "upcoming" ? "text-tollerud-text-muted" : "text-tollerud-text-primary"
|
|
3005
|
-
),
|
|
3006
|
-
children: step.label
|
|
3007
|
-
}
|
|
3008
|
-
),
|
|
3009
|
-
step.description && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-tollerud-text-muted", children: step.description })
|
|
3010
|
-
] })
|
|
3011
|
-
]
|
|
3012
|
-
},
|
|
3013
|
-
i
|
|
3014
|
-
);
|
|
3015
|
-
})
|
|
3016
|
-
}
|
|
3017
|
-
);
|
|
3018
|
-
}
|
|
3019
|
-
);
|
|
3020
|
-
Stepper.displayName = "Stepper";
|
|
3021
|
-
var Panel = React2.forwardRef(
|
|
3022
|
-
({ className, title, description, actions, children, ...props }, ref) => {
|
|
3023
|
-
const hasHeader = title || description || actions;
|
|
3024
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3025
|
-
"div",
|
|
3026
|
-
{
|
|
3027
|
-
ref,
|
|
3028
|
-
className: cn(
|
|
3029
|
-
"rounded-lg border border-tollerud-border bg-tollerud-surface overflow-hidden",
|
|
3030
|
-
className
|
|
3031
|
-
),
|
|
3032
|
-
...props,
|
|
3033
|
-
children: [
|
|
3034
|
-
hasHeader && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-4 px-5 py-4 border-b border-tollerud-border", children: [
|
|
3035
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-0.5", children: [
|
|
3036
|
-
title && /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-sm font-medium text-tollerud-text-primary", children: title }),
|
|
3037
|
-
description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-tollerud-text-muted", children: description })
|
|
3038
|
-
] }),
|
|
3039
|
-
actions && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-2 shrink-0", children: actions })
|
|
3040
|
-
] }),
|
|
3041
|
-
children && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-5 py-4", children })
|
|
3042
|
-
]
|
|
3043
|
-
}
|
|
3044
|
-
);
|
|
3045
|
-
}
|
|
3046
|
-
);
|
|
3047
|
-
Panel.displayName = "Panel";
|
|
3048
|
-
var meterTones = {
|
|
3049
|
-
default: "bg-tollerud-yellow",
|
|
3050
|
-
success: "bg-tollerud-success",
|
|
3051
|
-
warning: "bg-tollerud-warning",
|
|
3052
|
-
error: "bg-tollerud-error"
|
|
3053
|
-
};
|
|
3054
|
-
var Meter = React2.forwardRef(
|
|
3055
|
-
({ className, value, max = 100, label, showValue, tone = "default", ...props }, ref) => {
|
|
3056
|
-
const pct = Math.min(100, Math.max(0, value / max * 100));
|
|
3057
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref, className: cn("flex flex-col gap-1.5", className), ...props, children: [
|
|
3058
|
-
(label || showValue) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between text-xs", children: [
|
|
3059
|
-
label && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-tollerud-text-secondary", children: label }),
|
|
3060
|
-
showValue && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-tollerud-text-muted tabular-nums", children: [
|
|
3061
|
-
Math.round(pct),
|
|
3062
|
-
"%"
|
|
3063
|
-
] })
|
|
3064
|
-
] }),
|
|
3065
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3066
|
-
"div",
|
|
3067
|
-
{
|
|
3068
|
-
role: "meter",
|
|
3069
|
-
"aria-valuenow": value,
|
|
3070
|
-
"aria-valuemin": 0,
|
|
3071
|
-
"aria-valuemax": max,
|
|
3072
|
-
className: "h-1.5 w-full overflow-hidden rounded-full bg-tollerud-surface-raised",
|
|
3073
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3074
|
-
"div",
|
|
3075
|
-
{
|
|
3076
|
-
className: cn("h-full rounded-full transition-[width] duration-300", meterTones[tone]),
|
|
3077
|
-
style: { width: `${pct}%` }
|
|
3078
|
-
}
|
|
3079
|
-
)
|
|
3080
|
-
}
|
|
3081
|
-
)
|
|
3082
|
-
] });
|
|
3083
|
-
}
|
|
3084
|
-
);
|
|
3085
|
-
Meter.displayName = "Meter";
|
|
3086
|
-
var FormRow = React2.forwardRef(
|
|
3087
|
-
({ className, label, description, error, required, htmlFor, children, ...props }, ref) => {
|
|
3088
|
-
const autoId = React2.useId();
|
|
3089
|
-
const descriptionId = description ? `${autoId}-description` : void 0;
|
|
3090
|
-
const errorId = error ? `${autoId}-error` : void 0;
|
|
3091
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref, className: cn("flex flex-col gap-1.5", className), ...props, children: [
|
|
3092
|
-
label && /* @__PURE__ */ jsxRuntime.jsxs("label", { htmlFor, className: "text-sm font-medium text-tollerud-text-primary", children: [
|
|
3093
|
-
label,
|
|
3094
|
-
required && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-0.5 text-tollerud-error", children: "*" })
|
|
3095
|
-
] }),
|
|
3096
|
-
description && /* @__PURE__ */ jsxRuntime.jsx("p", { id: descriptionId, className: "text-xs text-tollerud-text-muted", children: description }),
|
|
3097
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { "aria-describedby": [descriptionId, errorId].filter(Boolean).join(" ") || void 0, children }),
|
|
3098
|
-
error && /* @__PURE__ */ jsxRuntime.jsx("p", { id: errorId, className: "text-xs text-tollerud-error", children: error })
|
|
3099
|
-
] });
|
|
3100
|
-
}
|
|
3101
|
-
);
|
|
3102
|
-
FormRow.displayName = "FormRow";
|
|
3103
|
-
var PricingCard = React2.forwardRef(
|
|
3104
|
-
({
|
|
3105
|
-
className,
|
|
3106
|
-
name,
|
|
3107
|
-
price,
|
|
3108
|
-
period,
|
|
3109
|
-
description,
|
|
3110
|
-
features = [],
|
|
3111
|
-
ctaLabel = "Get started",
|
|
3112
|
-
onCtaClick,
|
|
3113
|
-
featured,
|
|
3114
|
-
badge,
|
|
3115
|
-
...props
|
|
3116
|
-
}, ref) => {
|
|
3117
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3118
|
-
"div",
|
|
3119
|
-
{
|
|
3120
|
-
ref,
|
|
3121
|
-
className: cn(
|
|
3122
|
-
"flex flex-col gap-5 rounded-xl border p-6",
|
|
3123
|
-
featured ? "border-tollerud-yellow bg-tollerud-yellow/[0.04] shadow-[0_0_0_1px_rgba(255,255,0,0.15)]" : "border-tollerud-border bg-tollerud-surface",
|
|
3124
|
-
className
|
|
3125
|
-
),
|
|
3126
|
-
...props,
|
|
3127
|
-
children: [
|
|
3128
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
3129
|
-
badge && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-flex w-fit items-center rounded-full bg-tollerud-yellow/15 px-2.5 py-0.5 text-xs font-medium text-tollerud-yellow", children: badge }),
|
|
3130
|
-
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-base font-medium text-tollerud-text-primary", children: name }),
|
|
3131
|
-
description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-tollerud-text-muted", children: description })
|
|
3132
|
-
] }),
|
|
3133
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-baseline gap-1", children: [
|
|
3134
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-3xl font-semibold tracking-tight text-tollerud-text-primary", children: price }),
|
|
3135
|
-
period && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-tollerud-text-muted", children: period })
|
|
3136
|
-
] }),
|
|
3137
|
-
features.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "flex flex-col gap-2.5", children: features.map((feature, i) => /* @__PURE__ */ jsxRuntime.jsxs("li", { className: "flex items-start gap-2.5 text-sm text-tollerud-text-secondary", children: [
|
|
3138
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { size: 16, className: "mt-0.5 shrink-0 text-tollerud-yellow" }),
|
|
3139
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { children: feature })
|
|
3140
|
-
] }, i)) }),
|
|
3141
|
-
/* @__PURE__ */ jsxRuntime.jsx(Button, { variant: featured ? "primary" : "secondary", onClick: onCtaClick, className: "mt-auto w-full", children: ctaLabel })
|
|
3142
|
-
]
|
|
3143
|
-
}
|
|
3144
|
-
);
|
|
3145
|
-
}
|
|
3146
|
-
);
|
|
3147
|
-
PricingCard.displayName = "PricingCard";
|
|
3148
|
-
var AccordionContext = React2.createContext(null);
|
|
3149
|
-
function useAccordionContext(component) {
|
|
3150
|
-
const ctx = React2.useContext(AccordionContext);
|
|
3151
|
-
if (!ctx) throw new Error(`<${component}> must be used within <Accordion>`);
|
|
3152
|
-
return ctx;
|
|
3153
|
-
}
|
|
3154
|
-
var Accordion = React2.forwardRef(
|
|
3155
|
-
({ className, multiple = false, defaultOpen, children, ...props }, ref) => {
|
|
3156
|
-
const [openItems, setOpenItems] = React2.useState(() => {
|
|
3157
|
-
if (!defaultOpen) return /* @__PURE__ */ new Set();
|
|
3158
|
-
return new Set(Array.isArray(defaultOpen) ? defaultOpen : [defaultOpen]);
|
|
3159
|
-
});
|
|
3160
|
-
const toggle = (value) => {
|
|
3161
|
-
setOpenItems((prev) => {
|
|
3162
|
-
const next = multiple ? new Set(prev) : /* @__PURE__ */ new Set();
|
|
3163
|
-
if (prev.has(value)) {
|
|
3164
|
-
next.delete(value);
|
|
3165
|
-
} else {
|
|
3166
|
-
next.add(value);
|
|
3167
|
-
}
|
|
3168
|
-
return next;
|
|
3169
|
-
});
|
|
3170
|
-
};
|
|
3171
|
-
return /* @__PURE__ */ jsxRuntime.jsx(AccordionContext.Provider, { value: { openItems, toggle }, children: /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("flex flex-col divide-y divide-tollerud-border rounded-lg border border-tollerud-border", className), ...props, children }) });
|
|
3172
|
-
}
|
|
3173
|
-
);
|
|
3174
|
-
Accordion.displayName = "Accordion";
|
|
3175
|
-
var AccordionItemContext = React2.createContext(null);
|
|
3176
|
-
var AccordionItem = React2.forwardRef(
|
|
3177
|
-
({ className, value, children, ...props }, ref) => {
|
|
3178
|
-
const { openItems } = useAccordionContext("AccordionItem");
|
|
3179
|
-
const autoId = React2.useId();
|
|
3180
|
-
const open = openItems.has(value);
|
|
3181
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3182
|
-
AccordionItemContext.Provider,
|
|
3183
|
-
{
|
|
3184
|
-
value: { value, open, triggerId: `${autoId}-trigger`, contentId: `${autoId}-content` },
|
|
3185
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("first:rounded-t-lg last:rounded-b-lg", className), ...props, children })
|
|
3186
|
-
}
|
|
3187
|
-
);
|
|
3188
|
-
}
|
|
3189
|
-
);
|
|
3190
|
-
AccordionItem.displayName = "AccordionItem";
|
|
3191
|
-
function useAccordionItemContext(component) {
|
|
3192
|
-
const ctx = React2.useContext(AccordionItemContext);
|
|
3193
|
-
if (!ctx) throw new Error(`<${component}> must be used within <AccordionItem>`);
|
|
3194
|
-
return ctx;
|
|
3195
|
-
}
|
|
3196
|
-
var AccordionTrigger = React2.forwardRef(
|
|
3197
|
-
({ className, children, ...props }, ref) => {
|
|
3198
|
-
const { toggle } = useAccordionContext("AccordionTrigger");
|
|
3199
|
-
const { value, open, triggerId, contentId } = useAccordionItemContext("AccordionTrigger");
|
|
3200
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3201
|
-
"button",
|
|
3202
|
-
{
|
|
3203
|
-
ref,
|
|
3204
|
-
id: triggerId,
|
|
3205
|
-
type: "button",
|
|
3206
|
-
"aria-expanded": open,
|
|
3207
|
-
"aria-controls": contentId,
|
|
3208
|
-
onClick: () => toggle(value),
|
|
3209
|
-
className: cn(
|
|
3210
|
-
"flex w-full items-center justify-between gap-4 px-4 py-3.5 text-left text-sm font-medium",
|
|
3211
|
-
"text-tollerud-text-primary hover:bg-tollerud-surface-hover transition-colors duration-[150ms]",
|
|
3212
|
-
className
|
|
3213
|
-
),
|
|
3214
|
-
...props,
|
|
3215
|
-
children: [
|
|
3216
|
-
children,
|
|
3217
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3218
|
-
lucideReact.ChevronDown,
|
|
3219
|
-
{
|
|
3220
|
-
size: 16,
|
|
3221
|
-
className: cn("shrink-0 text-tollerud-text-muted transition-transform duration-[200ms]", open && "rotate-180")
|
|
3222
|
-
}
|
|
3223
|
-
)
|
|
3224
|
-
]
|
|
3225
|
-
}
|
|
3226
|
-
);
|
|
3227
|
-
}
|
|
3228
|
-
);
|
|
3229
|
-
AccordionTrigger.displayName = "AccordionTrigger";
|
|
3230
|
-
var AccordionContent = React2.forwardRef(
|
|
3231
|
-
({ className, children, ...props }, ref) => {
|
|
3232
|
-
const { open, triggerId, contentId } = useAccordionItemContext("AccordionContent");
|
|
3233
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3234
|
-
"div",
|
|
3235
|
-
{
|
|
3236
|
-
ref,
|
|
3237
|
-
id: contentId,
|
|
3238
|
-
role: "region",
|
|
3239
|
-
"aria-labelledby": triggerId,
|
|
3240
|
-
hidden: !open,
|
|
3241
|
-
className: cn("px-4 pb-4 text-sm text-tollerud-text-secondary", className),
|
|
3242
|
-
...props,
|
|
3243
|
-
children
|
|
3244
|
-
}
|
|
3245
|
-
);
|
|
3246
|
-
}
|
|
3247
|
-
);
|
|
3248
|
-
AccordionContent.displayName = "AccordionContent";
|
|
3249
|
-
var Slider = React2.forwardRef(
|
|
3250
|
-
({ className, label, showValue, id: idProp, value, defaultValue, min = 0, max = 100, onChange, ...props }, ref) => {
|
|
3251
|
-
const autoId = React2.useId();
|
|
3252
|
-
const id = idProp ?? autoId;
|
|
3253
|
-
const current = value ?? defaultValue ?? min;
|
|
3254
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-1.5", children: [
|
|
3255
|
-
(label || showValue) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between text-xs", children: [
|
|
3256
|
-
label && /* @__PURE__ */ jsxRuntime.jsx("label", { htmlFor: id, className: "font-medium text-tollerud-text-muted", children: label }),
|
|
3257
|
-
showValue && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-tollerud-text-secondary tabular-nums", children: current })
|
|
3258
|
-
] }),
|
|
3259
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3260
|
-
"input",
|
|
3261
|
-
{
|
|
3262
|
-
ref,
|
|
3263
|
-
id,
|
|
3264
|
-
type: "range",
|
|
3265
|
-
min,
|
|
3266
|
-
max,
|
|
3267
|
-
value,
|
|
3268
|
-
defaultValue,
|
|
3269
|
-
onChange: (e) => onChange?.(Number(e.target.value)),
|
|
3270
|
-
className: cn(
|
|
3271
|
-
"h-1.5 w-full cursor-pointer appearance-none rounded-full bg-tollerud-surface-raised accent-tollerud-yellow",
|
|
3272
|
-
"[&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:h-4 [&::-webkit-slider-thumb]:w-4",
|
|
3273
|
-
"[&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:bg-tollerud-yellow [&::-webkit-slider-thumb]:cursor-pointer",
|
|
3274
|
-
"[&::-webkit-slider-thumb]:border-2 [&::-webkit-slider-thumb]:border-tollerud-noir-black",
|
|
3275
|
-
"[&::-moz-range-thumb]:h-4 [&::-moz-range-thumb]:w-4 [&::-moz-range-thumb]:rounded-full",
|
|
3276
|
-
"[&::-moz-range-thumb]:bg-tollerud-yellow [&::-moz-range-thumb]:border-2 [&::-moz-range-thumb]:border-tollerud-noir-black [&::-moz-range-thumb]:cursor-pointer",
|
|
3277
|
-
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-tollerud-yellow/50",
|
|
3278
|
-
"disabled:opacity-40 disabled:pointer-events-none",
|
|
3279
|
-
className
|
|
3280
|
-
),
|
|
3281
|
-
...props
|
|
3282
|
-
}
|
|
3283
|
-
)
|
|
3284
|
-
] });
|
|
3285
|
-
}
|
|
3286
|
-
);
|
|
3287
|
-
Slider.displayName = "Slider";
|
|
3288
|
-
var PasswordInput = React2.forwardRef(
|
|
3289
|
-
({ className, label, error, id, ...props }, ref) => {
|
|
3290
|
-
const [visible, setVisible] = React2.useState(false);
|
|
3291
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
3292
|
-
label && /* @__PURE__ */ jsxRuntime.jsx("label", { htmlFor: id, className: "text-xs font-medium text-tollerud-text-muted", children: label }),
|
|
3293
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
|
|
3294
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3295
|
-
"input",
|
|
3296
|
-
{
|
|
3297
|
-
ref,
|
|
3298
|
-
id,
|
|
3299
|
-
type: visible ? "text" : "password",
|
|
3300
|
-
className: cn(
|
|
3301
|
-
"w-full font-sans text-base px-3 py-2 pr-10 rounded",
|
|
3302
|
-
"bg-tollerud-surface-raised border",
|
|
3303
|
-
"text-tollerud-text-primary",
|
|
3304
|
-
"placeholder:text-tollerud-text-muted",
|
|
3305
|
-
"transition-[border-color] duration-[150ms]",
|
|
3306
|
-
"focus:outline-none focus:border-tollerud-yellow focus:shadow-[0_0_0_1px_#E8D500]",
|
|
3307
|
-
error ? "border-tollerud-error" : "border-tollerud-border",
|
|
3308
|
-
className
|
|
3309
|
-
),
|
|
3310
|
-
...props
|
|
3311
|
-
}
|
|
3312
|
-
),
|
|
3313
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3314
|
-
"button",
|
|
3315
|
-
{
|
|
3316
|
-
type: "button",
|
|
3317
|
-
onClick: () => setVisible((v) => !v),
|
|
3318
|
-
"aria-label": visible ? "Hide password" : "Show password",
|
|
3319
|
-
"aria-pressed": visible,
|
|
3320
|
-
className: "absolute right-2.5 top-1/2 -translate-y-1/2 text-tollerud-text-muted hover:text-tollerud-text-secondary transition-colors duration-[150ms]",
|
|
3321
|
-
children: visible ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.EyeOff, { size: 16 }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Eye, { size: 16 })
|
|
3322
|
-
}
|
|
3323
|
-
)
|
|
3324
|
-
] }),
|
|
3325
|
-
error && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-tollerud-error mt-0.5", children: error })
|
|
3326
|
-
] });
|
|
3327
|
-
}
|
|
3328
|
-
);
|
|
3329
|
-
PasswordInput.displayName = "PasswordInput";
|
|
3330
|
-
var defaultFilter = (option, query) => option.label.toLowerCase().includes(query.toLowerCase());
|
|
3331
|
-
function Combobox({
|
|
3332
|
-
options,
|
|
3333
|
-
value: valueProp,
|
|
3334
|
-
defaultValue,
|
|
3335
|
-
onChange,
|
|
3336
|
-
placeholder = "Search\u2026",
|
|
3337
|
-
label,
|
|
3338
|
-
error,
|
|
3339
|
-
filter = defaultFilter,
|
|
3340
|
-
className,
|
|
3341
|
-
disabled
|
|
3342
|
-
}) {
|
|
3343
|
-
const id = React2.useId();
|
|
3344
|
-
const rootRef = React2.useRef(null);
|
|
3345
|
-
const isControlled = valueProp !== void 0;
|
|
3346
|
-
const [internalValue, setInternalValue] = React2.useState(defaultValue);
|
|
3347
|
-
const value = isControlled ? valueProp : internalValue;
|
|
3348
|
-
const [open, setOpen] = React2.useState(false);
|
|
3349
|
-
const [query, setQuery] = React2.useState("");
|
|
3350
|
-
const [activeIndex, setActiveIndex] = React2.useState(0);
|
|
3351
|
-
const selected = options.find((o) => o.value === value);
|
|
3352
|
-
const filtered = React2.useMemo(() => {
|
|
3353
|
-
if (!query) return options;
|
|
3354
|
-
return options.filter((o) => filter(o, query));
|
|
3355
|
-
}, [options, query, filter]);
|
|
3356
|
-
React2.useEffect(() => {
|
|
3357
|
-
if (!open) return;
|
|
3358
|
-
function onClickOutside(e) {
|
|
3359
|
-
if (rootRef.current && !rootRef.current.contains(e.target)) {
|
|
3360
|
-
setOpen(false);
|
|
3361
|
-
setQuery("");
|
|
3362
|
-
}
|
|
3363
|
-
}
|
|
3364
|
-
function onResize() {
|
|
3365
|
-
setOpen(false);
|
|
3366
|
-
setQuery("");
|
|
3367
|
-
}
|
|
3368
|
-
document.addEventListener("mousedown", onClickOutside);
|
|
3369
|
-
window.addEventListener("resize", onResize);
|
|
3370
|
-
return () => {
|
|
3371
|
-
document.removeEventListener("mousedown", onClickOutside);
|
|
3372
|
-
window.removeEventListener("resize", onResize);
|
|
3373
|
-
};
|
|
3374
|
-
}, [open]);
|
|
3375
|
-
const commit = (option) => {
|
|
3376
|
-
if (option.disabled) return;
|
|
3377
|
-
if (!isControlled) setInternalValue(option.value);
|
|
3378
|
-
onChange?.(option.value);
|
|
3379
|
-
setOpen(false);
|
|
3380
|
-
setQuery("");
|
|
3381
|
-
};
|
|
3382
|
-
const onKeyDown = (e) => {
|
|
3383
|
-
if (e.key === "ArrowDown") {
|
|
3384
|
-
e.preventDefault();
|
|
3385
|
-
setOpen(true);
|
|
3386
|
-
setActiveIndex((i) => Math.min(i + 1, filtered.length - 1));
|
|
3387
|
-
} else if (e.key === "ArrowUp") {
|
|
3388
|
-
e.preventDefault();
|
|
3389
|
-
setActiveIndex((i) => Math.max(i - 1, 0));
|
|
3390
|
-
} else if (e.key === "Enter") {
|
|
3391
|
-
e.preventDefault();
|
|
3392
|
-
const opt = filtered[activeIndex];
|
|
3393
|
-
if (opt) commit(opt);
|
|
3394
|
-
} else if (e.key === "Escape") {
|
|
3395
|
-
setOpen(false);
|
|
3396
|
-
setQuery("");
|
|
3397
|
-
}
|
|
3398
|
-
};
|
|
3399
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref: rootRef, className: cn("relative flex flex-col gap-1", className), children: [
|
|
3400
|
-
label && /* @__PURE__ */ jsxRuntime.jsx("label", { htmlFor: id, className: "text-xs font-medium text-tollerud-text-muted", children: label }),
|
|
3401
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
|
|
3402
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3403
|
-
"input",
|
|
3404
|
-
{
|
|
3405
|
-
id,
|
|
3406
|
-
role: "combobox",
|
|
3407
|
-
"aria-expanded": open,
|
|
3408
|
-
"aria-autocomplete": "list",
|
|
3409
|
-
"aria-controls": `${id}-listbox`,
|
|
3410
|
-
disabled,
|
|
3411
|
-
value: open ? query : selected?.label ?? "",
|
|
3412
|
-
placeholder: selected ? selected.label : placeholder,
|
|
3413
|
-
onFocus: () => {
|
|
3414
|
-
setOpen(true);
|
|
3415
|
-
setActiveIndex(0);
|
|
3416
|
-
},
|
|
3417
|
-
onChange: (e) => {
|
|
3418
|
-
setQuery(e.target.value);
|
|
3419
|
-
setActiveIndex(0);
|
|
3420
|
-
if (!open) setOpen(true);
|
|
3421
|
-
},
|
|
3422
|
-
onKeyDown,
|
|
3423
|
-
className: cn(
|
|
3424
|
-
"w-full font-sans text-base px-3 py-2 pr-9 rounded",
|
|
3425
|
-
"bg-tollerud-surface-raised border",
|
|
3426
|
-
"text-tollerud-text-primary placeholder:text-tollerud-text-muted",
|
|
3427
|
-
"transition-[border-color] duration-[150ms]",
|
|
3428
|
-
"focus:outline-none focus:border-tollerud-yellow focus:shadow-[0_0_0_1px_#E8D500]",
|
|
3429
|
-
error ? "border-tollerud-error" : "border-tollerud-border",
|
|
3430
|
-
disabled && "opacity-50 pointer-events-none"
|
|
3431
|
-
)
|
|
3432
|
-
}
|
|
3433
|
-
),
|
|
3434
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3435
|
-
lucideReact.ChevronDown,
|
|
3436
|
-
{
|
|
3437
|
-
size: 15,
|
|
3438
|
-
className: cn(
|
|
3439
|
-
"pointer-events-none absolute right-3 top-1/2 -translate-y-1/2 text-tollerud-text-muted transition-transform duration-[150ms]",
|
|
3440
|
-
open && "rotate-180"
|
|
3441
|
-
)
|
|
3442
|
-
}
|
|
3443
|
-
)
|
|
3444
|
-
] }),
|
|
3445
|
-
open && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3446
|
-
"ul",
|
|
3447
|
-
{
|
|
3448
|
-
id: `${id}-listbox`,
|
|
3449
|
-
role: "listbox",
|
|
3450
|
-
className: "absolute top-full z-20 mt-1 max-h-64 w-full overflow-auto rounded-lg border border-tollerud-border bg-tollerud-surface-overlay py-1 shadow-lg",
|
|
3451
|
-
children: [
|
|
3452
|
-
filtered.length === 0 && /* @__PURE__ */ jsxRuntime.jsx("li", { className: "px-3 py-2 text-sm text-tollerud-text-muted", children: "No results" }),
|
|
3453
|
-
filtered.map((option, i) => {
|
|
3454
|
-
const isSelected = option.value === value;
|
|
3455
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3456
|
-
"li",
|
|
3457
|
-
{
|
|
3458
|
-
role: "option",
|
|
3459
|
-
"aria-selected": isSelected,
|
|
3460
|
-
onMouseDown: (e) => {
|
|
3461
|
-
e.preventDefault();
|
|
3462
|
-
commit(option);
|
|
3463
|
-
},
|
|
3464
|
-
onMouseEnter: () => setActiveIndex(i),
|
|
3465
|
-
className: cn(
|
|
3466
|
-
"flex items-center justify-between gap-2 px-3 py-2 text-sm cursor-pointer",
|
|
3467
|
-
i === activeIndex ? "bg-tollerud-surface-hover text-tollerud-text-primary" : "text-tollerud-text-secondary",
|
|
3468
|
-
option.disabled && "opacity-40 pointer-events-none"
|
|
3469
|
-
),
|
|
3470
|
-
children: [
|
|
3471
|
-
option.label,
|
|
3472
|
-
isSelected && /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { size: 14, className: "text-tollerud-yellow" })
|
|
3473
|
-
]
|
|
3474
|
-
},
|
|
3475
|
-
option.value
|
|
3476
|
-
);
|
|
3477
|
-
})
|
|
3478
|
-
]
|
|
3479
|
-
}
|
|
3480
|
-
),
|
|
3481
|
-
error && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-tollerud-error mt-0.5", children: error })
|
|
3482
|
-
] });
|
|
3483
|
-
}
|
|
3484
|
-
Combobox.displayName = "Combobox";
|
|
3485
|
-
var defaultFormat = (date) => date.toLocaleDateString(void 0, { year: "numeric", month: "short", day: "numeric" });
|
|
3486
|
-
function isSameDay(a, b) {
|
|
3487
|
-
return a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();
|
|
3488
|
-
}
|
|
3489
|
-
function startOfMonth(date) {
|
|
3490
|
-
return new Date(date.getFullYear(), date.getMonth(), 1);
|
|
3491
|
-
}
|
|
3492
|
-
function buildCalendarGrid(monthDate) {
|
|
3493
|
-
const first = startOfMonth(monthDate);
|
|
3494
|
-
const startWeekday = first.getDay();
|
|
3495
|
-
const daysInMonth = new Date(monthDate.getFullYear(), monthDate.getMonth() + 1, 0).getDate();
|
|
3496
|
-
const cells = [];
|
|
3497
|
-
for (let i = 0; i < startWeekday; i++) cells.push(null);
|
|
3498
|
-
for (let d = 1; d <= daysInMonth; d++) cells.push(new Date(monthDate.getFullYear(), monthDate.getMonth(), d));
|
|
3499
|
-
return cells;
|
|
3500
|
-
}
|
|
3501
|
-
var WEEKDAYS = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
|
|
3502
|
-
function DatePicker({
|
|
3503
|
-
value: valueProp,
|
|
3504
|
-
defaultValue = null,
|
|
3505
|
-
onChange,
|
|
3506
|
-
label,
|
|
3507
|
-
error,
|
|
3508
|
-
placeholder = "Select a date",
|
|
3509
|
-
formatDate = defaultFormat,
|
|
3510
|
-
className,
|
|
3511
|
-
disabled
|
|
3512
|
-
}) {
|
|
3513
|
-
const id = React2.useId();
|
|
3514
|
-
const rootRef = React2.useRef(null);
|
|
3515
|
-
const isControlled = valueProp !== void 0;
|
|
3516
|
-
const [internalValue, setInternalValue] = React2.useState(defaultValue);
|
|
3517
|
-
const value = isControlled ? valueProp ?? null : internalValue;
|
|
3518
|
-
const [open, setOpen] = React2.useState(false);
|
|
3519
|
-
const [viewMonth, setViewMonth] = React2.useState(() => startOfMonth(value ?? /* @__PURE__ */ new Date()));
|
|
3520
|
-
const cells = React2.useMemo(() => buildCalendarGrid(viewMonth), [viewMonth]);
|
|
3521
|
-
React2.useEffect(() => {
|
|
3522
|
-
if (!open) return;
|
|
3523
|
-
function onClickOutside(e) {
|
|
3524
|
-
if (rootRef.current && !rootRef.current.contains(e.target)) setOpen(false);
|
|
3525
|
-
}
|
|
3526
|
-
function onResize() {
|
|
3527
|
-
setOpen(false);
|
|
3528
|
-
}
|
|
3529
|
-
document.addEventListener("mousedown", onClickOutside);
|
|
3530
|
-
window.addEventListener("resize", onResize);
|
|
3531
|
-
return () => {
|
|
3532
|
-
document.removeEventListener("mousedown", onClickOutside);
|
|
3533
|
-
window.removeEventListener("resize", onResize);
|
|
3534
|
-
};
|
|
3535
|
-
}, [open]);
|
|
3536
|
-
const select = (date) => {
|
|
3537
|
-
if (!isControlled) setInternalValue(date);
|
|
3538
|
-
onChange?.(date);
|
|
3539
|
-
setOpen(false);
|
|
3540
|
-
};
|
|
3541
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref: rootRef, className: cn("relative flex flex-col gap-1", className), children: [
|
|
3542
|
-
label && /* @__PURE__ */ jsxRuntime.jsx("label", { htmlFor: id, className: "text-xs font-medium text-tollerud-text-muted", children: label }),
|
|
3543
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3544
|
-
"button",
|
|
3545
|
-
{
|
|
3546
|
-
id,
|
|
3547
|
-
type: "button",
|
|
3548
|
-
disabled,
|
|
3549
|
-
onClick: () => {
|
|
3550
|
-
setViewMonth(startOfMonth(value ?? /* @__PURE__ */ new Date()));
|
|
3551
|
-
setOpen((o) => !o);
|
|
3552
|
-
},
|
|
3553
|
-
"aria-haspopup": "dialog",
|
|
3554
|
-
"aria-expanded": open,
|
|
3555
|
-
className: cn(
|
|
3556
|
-
"flex w-full items-center justify-between gap-2 rounded px-3 py-2 text-left text-base",
|
|
3557
|
-
"bg-tollerud-surface-raised border",
|
|
3558
|
-
"transition-[border-color] duration-[150ms]",
|
|
3559
|
-
"focus:outline-none focus:border-tollerud-yellow focus:shadow-[0_0_0_1px_#E8D500]",
|
|
3560
|
-
error ? "border-tollerud-error" : "border-tollerud-border",
|
|
3561
|
-
value ? "text-tollerud-text-primary" : "text-tollerud-text-muted",
|
|
3562
|
-
disabled && "opacity-50 pointer-events-none"
|
|
3563
|
-
),
|
|
3564
|
-
children: [
|
|
3565
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { children: value ? formatDate(value) : placeholder }),
|
|
3566
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Calendar, { size: 15, className: "text-tollerud-text-muted" })
|
|
3567
|
-
]
|
|
3568
|
-
}
|
|
3569
|
-
),
|
|
3570
|
-
open && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3571
|
-
"div",
|
|
3572
|
-
{
|
|
3573
|
-
role: "dialog",
|
|
3574
|
-
"aria-label": "Choose date",
|
|
3575
|
-
className: "absolute top-full z-20 mt-1 w-72 rounded-lg border border-tollerud-border bg-tollerud-surface-overlay p-3 shadow-lg",
|
|
3576
|
-
children: [
|
|
3577
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-2 flex items-center justify-between", children: [
|
|
3578
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3579
|
-
"button",
|
|
3580
|
-
{
|
|
3581
|
-
type: "button",
|
|
3582
|
-
"aria-label": "Previous month",
|
|
3583
|
-
onClick: () => setViewMonth((m) => new Date(m.getFullYear(), m.getMonth() - 1, 1)),
|
|
3584
|
-
className: "rounded p-1 text-tollerud-text-secondary hover:bg-tollerud-surface-hover",
|
|
3585
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronLeft, { size: 16 })
|
|
3586
|
-
}
|
|
3587
|
-
),
|
|
3588
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-medium text-tollerud-text-primary", children: viewMonth.toLocaleDateString(void 0, { month: "long", year: "numeric" }) }),
|
|
3589
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3590
|
-
"button",
|
|
3591
|
-
{
|
|
3592
|
-
type: "button",
|
|
3593
|
-
"aria-label": "Next month",
|
|
3594
|
-
onClick: () => setViewMonth((m) => new Date(m.getFullYear(), m.getMonth() + 1, 1)),
|
|
3595
|
-
className: "rounded p-1 text-tollerud-text-secondary hover:bg-tollerud-surface-hover",
|
|
3596
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { size: 16 })
|
|
3597
|
-
}
|
|
3598
|
-
)
|
|
3599
|
-
] }),
|
|
3600
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-7 gap-1 text-center", children: [
|
|
3601
|
-
WEEKDAYS.map((d) => /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[11px] font-medium text-tollerud-text-muted py-1", children: d }, d)),
|
|
3602
|
-
cells.map((date, i) => {
|
|
3603
|
-
if (!date) return /* @__PURE__ */ jsxRuntime.jsx("span", {}, i);
|
|
3604
|
-
const selected = value ? isSameDay(date, value) : false;
|
|
3605
|
-
const today = isSameDay(date, /* @__PURE__ */ new Date());
|
|
3606
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3607
|
-
"button",
|
|
3608
|
-
{
|
|
3609
|
-
type: "button",
|
|
3610
|
-
onClick: () => select(date),
|
|
3611
|
-
className: cn(
|
|
3612
|
-
"h-8 w-8 rounded-full text-sm transition-colors duration-[150ms]",
|
|
3613
|
-
selected ? "bg-tollerud-yellow text-tollerud-noir-black font-medium" : "text-tollerud-text-secondary hover:bg-tollerud-surface-hover",
|
|
3614
|
-
!selected && today && "ring-1 ring-tollerud-yellow/40"
|
|
3615
|
-
),
|
|
3616
|
-
children: date.getDate()
|
|
3617
|
-
},
|
|
3618
|
-
i
|
|
3619
|
-
);
|
|
3620
|
-
})
|
|
3621
|
-
] })
|
|
3622
|
-
]
|
|
3623
|
-
}
|
|
3624
|
-
),
|
|
3625
|
-
error && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-tollerud-error mt-0.5", children: error })
|
|
3626
|
-
] });
|
|
3627
|
-
}
|
|
3628
|
-
DatePicker.displayName = "DatePicker";
|
|
3629
|
-
function formatBytes(bytes) {
|
|
3630
|
-
if (bytes < 1024) return `${bytes} B`;
|
|
3631
|
-
if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;
|
|
3632
|
-
return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
|
|
3633
|
-
}
|
|
3634
|
-
function FileUpload({
|
|
3635
|
-
label,
|
|
3636
|
-
description,
|
|
3637
|
-
error,
|
|
3638
|
-
accept,
|
|
3639
|
-
multiple,
|
|
3640
|
-
onFilesChange,
|
|
3641
|
-
className,
|
|
3642
|
-
disabled
|
|
3643
|
-
}) {
|
|
3644
|
-
const id = React2.useId();
|
|
3645
|
-
const inputRef = React2.useRef(null);
|
|
3646
|
-
const [files, setFiles] = React2.useState([]);
|
|
3647
|
-
const [dragging, setDragging] = React2.useState(false);
|
|
3648
|
-
const setAndNotify = (next) => {
|
|
3649
|
-
setFiles(next);
|
|
3650
|
-
onFilesChange?.(next);
|
|
3651
|
-
};
|
|
3652
|
-
const addFiles = (incoming) => {
|
|
3653
|
-
if (!incoming || incoming.length === 0) return;
|
|
3654
|
-
const incomingArr = Array.from(incoming);
|
|
3655
|
-
setAndNotify(multiple ? [...files, ...incomingArr] : [incomingArr[0]]);
|
|
3656
|
-
};
|
|
3657
|
-
const removeAt = (index) => {
|
|
3658
|
-
setAndNotify(files.filter((_, i) => i !== index));
|
|
3659
|
-
};
|
|
3660
|
-
const onDrop = (e) => {
|
|
3661
|
-
e.preventDefault();
|
|
3662
|
-
setDragging(false);
|
|
3663
|
-
if (disabled) return;
|
|
3664
|
-
addFiles(e.dataTransfer.files);
|
|
3665
|
-
};
|
|
3666
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("flex flex-col gap-1.5", className), children: [
|
|
3667
|
-
label && /* @__PURE__ */ jsxRuntime.jsx("label", { htmlFor: id, className: "text-xs font-medium text-tollerud-text-muted", children: label }),
|
|
3668
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3669
|
-
"div",
|
|
3670
|
-
{
|
|
3671
|
-
role: "button",
|
|
3672
|
-
tabIndex: disabled ? -1 : 0,
|
|
3673
|
-
"aria-disabled": disabled,
|
|
3674
|
-
onClick: () => !disabled && inputRef.current?.click(),
|
|
3675
|
-
onKeyDown: (e) => {
|
|
3676
|
-
if (!disabled && (e.key === "Enter" || e.key === " ")) {
|
|
3677
|
-
e.preventDefault();
|
|
3678
|
-
inputRef.current?.click();
|
|
3679
|
-
}
|
|
3680
|
-
},
|
|
3681
|
-
onDragOver: (e) => {
|
|
3682
|
-
e.preventDefault();
|
|
3683
|
-
if (!disabled) setDragging(true);
|
|
3684
|
-
},
|
|
3685
|
-
onDragLeave: () => setDragging(false),
|
|
3686
|
-
onDrop,
|
|
3687
|
-
className: cn(
|
|
3688
|
-
"flex flex-col items-center justify-center gap-2 rounded-lg border border-dashed px-6 py-8 text-center cursor-pointer transition-colors duration-[150ms]",
|
|
3689
|
-
dragging ? "border-tollerud-yellow bg-tollerud-yellow/[0.06]" : "border-tollerud-border bg-tollerud-surface-raised hover:border-tollerud-text-secondary",
|
|
3690
|
-
error && "border-tollerud-error",
|
|
3691
|
-
disabled && "opacity-50 pointer-events-none"
|
|
3692
|
-
),
|
|
3693
|
-
children: [
|
|
3694
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Upload, { size: 20, className: "text-tollerud-text-muted" }),
|
|
3695
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-sm text-tollerud-text-secondary", children: [
|
|
3696
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-tollerud-yellow", children: "Click to upload" }),
|
|
3697
|
-
" or drag and drop"
|
|
3698
|
-
] }),
|
|
3699
|
-
description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-tollerud-text-muted", children: description }),
|
|
3700
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3701
|
-
"input",
|
|
3702
|
-
{
|
|
3703
|
-
ref: inputRef,
|
|
3704
|
-
id,
|
|
3705
|
-
type: "file",
|
|
3706
|
-
accept,
|
|
3707
|
-
multiple,
|
|
3708
|
-
disabled,
|
|
3709
|
-
onChange: (e) => addFiles(e.target.files),
|
|
3710
|
-
className: "sr-only"
|
|
3711
|
-
}
|
|
3712
|
-
)
|
|
3713
|
-
]
|
|
3714
|
-
}
|
|
3715
|
-
),
|
|
3716
|
-
files.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "flex flex-col gap-1.5", children: files.map((file, i) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3717
|
-
"li",
|
|
3718
|
-
{
|
|
3719
|
-
className: "flex items-center gap-2.5 rounded-md border border-tollerud-border bg-tollerud-surface-raised px-3 py-2 text-sm",
|
|
3720
|
-
children: [
|
|
3721
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.File, { size: 15, className: "shrink-0 text-tollerud-text-muted" }),
|
|
3722
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-1 truncate text-tollerud-text-primary", children: file.name }),
|
|
3723
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 text-xs text-tollerud-text-muted", children: formatBytes(file.size) }),
|
|
3724
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3725
|
-
"button",
|
|
3726
|
-
{
|
|
3727
|
-
type: "button",
|
|
3728
|
-
"aria-label": `Remove ${file.name}`,
|
|
3729
|
-
onClick: () => removeAt(i),
|
|
3730
|
-
className: "shrink-0 text-tollerud-text-muted hover:text-tollerud-text-primary transition-colors duration-[150ms]",
|
|
3731
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { size: 14 })
|
|
3732
|
-
}
|
|
3733
|
-
)
|
|
3734
|
-
]
|
|
3735
|
-
},
|
|
3736
|
-
`${file.name}-${i}`
|
|
3737
|
-
)) }),
|
|
3738
|
-
error && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-tollerud-error", children: error })
|
|
3739
|
-
] });
|
|
3740
|
-
}
|
|
3741
|
-
FileUpload.displayName = "FileUpload";
|
|
3742
|
-
function TagInput({
|
|
3743
|
-
value: valueProp,
|
|
3744
|
-
defaultValue = [],
|
|
3745
|
-
onChange,
|
|
3746
|
-
label,
|
|
3747
|
-
error,
|
|
3748
|
-
placeholder = "Add a tag\u2026",
|
|
3749
|
-
max,
|
|
3750
|
-
className,
|
|
3751
|
-
disabled
|
|
3752
|
-
}) {
|
|
3753
|
-
const id = React2.useId();
|
|
3754
|
-
const isControlled = valueProp !== void 0;
|
|
3755
|
-
const [internalTags, setInternalTags] = React2.useState(defaultValue);
|
|
3756
|
-
const tags = isControlled ? valueProp : internalTags;
|
|
3757
|
-
const [draft, setDraft] = React2.useState("");
|
|
3758
|
-
const setAndNotify = (next) => {
|
|
3759
|
-
if (!isControlled) setInternalTags(next);
|
|
3760
|
-
onChange?.(next);
|
|
3761
|
-
};
|
|
3762
|
-
const addTag = (raw) => {
|
|
3763
|
-
const tag = raw.trim();
|
|
3764
|
-
if (!tag || tags.includes(tag)) return;
|
|
3765
|
-
if (max && tags.length >= max) return;
|
|
3766
|
-
setAndNotify([...tags, tag]);
|
|
3767
|
-
setDraft("");
|
|
3768
|
-
};
|
|
3769
|
-
const removeTag = (index) => {
|
|
3770
|
-
setAndNotify(tags.filter((_, i) => i !== index));
|
|
3771
|
-
};
|
|
3772
|
-
const onKeyDown = (e) => {
|
|
3773
|
-
if (e.key === "Enter" || e.key === ",") {
|
|
3774
|
-
e.preventDefault();
|
|
3775
|
-
addTag(draft);
|
|
3776
|
-
} else if (e.key === "Backspace" && draft === "" && tags.length > 0) {
|
|
3777
|
-
removeTag(tags.length - 1);
|
|
3778
|
-
}
|
|
3779
|
-
};
|
|
3780
|
-
const atMax = max ? tags.length >= max : false;
|
|
3781
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("flex flex-col gap-1", className), children: [
|
|
3782
|
-
label && /* @__PURE__ */ jsxRuntime.jsx("label", { htmlFor: id, className: "text-xs font-medium text-tollerud-text-muted", children: label }),
|
|
3783
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3784
|
-
"div",
|
|
3785
|
-
{
|
|
3786
|
-
className: cn(
|
|
3787
|
-
"flex flex-wrap items-center gap-1.5 rounded px-2.5 py-1.5",
|
|
3788
|
-
"bg-tollerud-surface-raised border",
|
|
3789
|
-
"transition-[border-color] duration-[150ms]",
|
|
3790
|
-
"focus-within:border-tollerud-yellow focus-within:shadow-[0_0_0_1px_#E8D500]",
|
|
3791
|
-
error ? "border-tollerud-error" : "border-tollerud-border",
|
|
3792
|
-
disabled && "opacity-50 pointer-events-none"
|
|
3793
|
-
),
|
|
3794
|
-
children: [
|
|
3795
|
-
tags.map((tag, i) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3796
|
-
"span",
|
|
3797
|
-
{
|
|
3798
|
-
className: "inline-flex items-center gap-1 rounded-full bg-tollerud-surface-hover px-2.5 py-0.5 text-xs font-medium text-tollerud-text-primary",
|
|
3799
|
-
children: [
|
|
3800
|
-
tag,
|
|
3801
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3802
|
-
"button",
|
|
3803
|
-
{
|
|
3804
|
-
type: "button",
|
|
3805
|
-
"aria-label": `Remove ${tag}`,
|
|
3806
|
-
onClick: () => removeTag(i),
|
|
3807
|
-
className: "text-tollerud-text-muted hover:text-tollerud-text-primary transition-colors duration-[150ms]",
|
|
3808
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { size: 12 })
|
|
3809
|
-
}
|
|
3810
|
-
)
|
|
3811
|
-
]
|
|
3812
|
-
},
|
|
3813
|
-
`${tag}-${i}`
|
|
3814
|
-
)),
|
|
3815
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3816
|
-
"input",
|
|
3817
|
-
{
|
|
3818
|
-
id,
|
|
3819
|
-
value: draft,
|
|
3820
|
-
disabled: disabled || atMax,
|
|
3821
|
-
onChange: (e) => setDraft(e.target.value),
|
|
3822
|
-
onKeyDown,
|
|
3823
|
-
onBlur: () => addTag(draft),
|
|
3824
|
-
placeholder: atMax ? "" : placeholder,
|
|
3825
|
-
className: cn(
|
|
3826
|
-
"min-w-[6rem] flex-1 bg-transparent py-0.5 text-sm text-tollerud-text-primary",
|
|
3827
|
-
"placeholder:text-tollerud-text-muted focus:outline-none"
|
|
3828
|
-
)
|
|
3829
|
-
}
|
|
3830
|
-
)
|
|
3831
|
-
]
|
|
3832
|
-
}
|
|
3833
|
-
),
|
|
3834
|
-
error && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-tollerud-error mt-0.5", children: error })
|
|
3835
|
-
] });
|
|
3836
|
-
}
|
|
3837
|
-
TagInput.displayName = "TagInput";
|
|
3838
|
-
|
|
3839
|
-
exports.Accordion = Accordion;
|
|
3840
|
-
exports.AccordionContent = AccordionContent;
|
|
3841
|
-
exports.AccordionItem = AccordionItem;
|
|
3842
|
-
exports.AccordionTrigger = AccordionTrigger;
|
|
3843
|
-
exports.ActionDiff = ActionDiff;
|
|
3844
|
-
exports.ActionRow = ActionRow;
|
|
3845
|
-
exports.Alert = Alert;
|
|
3846
|
-
exports.AlertInbox = AlertInbox;
|
|
3847
|
-
exports.ApprovalCard = ApprovalCard;
|
|
3848
|
-
exports.Avatar = Avatar;
|
|
3849
|
-
exports.AvatarGroup = AvatarGroup;
|
|
3850
|
-
exports.BackupStatusPanel = BackupStatusPanel;
|
|
3851
|
-
exports.Badge = Badge;
|
|
3852
|
-
exports.BentoDashboard = BentoDashboard;
|
|
3853
|
-
exports.Breadcrumb = Breadcrumb;
|
|
3854
|
-
exports.Button = Button;
|
|
3855
|
-
exports.Card = Card;
|
|
3856
|
-
exports.Checkbox = Checkbox;
|
|
3857
|
-
exports.CodeBlock = CodeBlock;
|
|
3858
|
-
exports.Combobox = Combobox;
|
|
3859
|
-
exports.CommandMenu = CommandMenu;
|
|
3860
|
-
exports.Container = Container;
|
|
3861
|
-
exports.DataTable = DataTable;
|
|
3862
|
-
exports.DatePicker = DatePicker;
|
|
3863
|
-
exports.Dialog = Dialog;
|
|
3864
|
-
exports.DialogClose = DialogClose;
|
|
3865
|
-
exports.DialogContent = DialogContent;
|
|
3866
|
-
exports.DialogDescription = DialogDescription;
|
|
3867
|
-
exports.DialogFooter = DialogFooter;
|
|
3868
|
-
exports.DialogHeader = DialogHeader;
|
|
3869
|
-
exports.DialogOverlay = DialogOverlay;
|
|
3870
|
-
exports.DialogPortal = DialogPortal;
|
|
3871
|
-
exports.DialogTitle = DialogTitle;
|
|
3872
|
-
exports.DialogTrigger = DialogTrigger;
|
|
3873
|
-
exports.Divider = Divider;
|
|
3874
|
-
exports.DockerStackCard = DockerStackCard;
|
|
3875
|
-
exports.DropdownMenu = DropdownMenu;
|
|
3876
|
-
exports.DropdownMenuContent = DropdownMenuContent;
|
|
3877
|
-
exports.DropdownMenuItem = DropdownMenuItem;
|
|
3878
|
-
exports.DropdownMenuLabel = DropdownMenuLabel;
|
|
3879
|
-
exports.DropdownMenuSeparator = DropdownMenuSeparator;
|
|
3880
|
-
exports.DropdownMenuTrigger = DropdownMenuTrigger;
|
|
3881
|
-
exports.Empty = Empty;
|
|
3882
|
-
exports.EmptyContent = EmptyContent;
|
|
3883
|
-
exports.EmptyDescription = EmptyDescription;
|
|
3884
|
-
exports.EmptyHeader = EmptyHeader;
|
|
3885
|
-
exports.EmptyIcon = EmptyIcon;
|
|
3886
|
-
exports.EmptyTitle = EmptyTitle;
|
|
3887
|
-
exports.FileUpload = FileUpload;
|
|
3888
|
-
exports.Footer = Footer;
|
|
3889
|
-
exports.FormRow = FormRow;
|
|
3890
|
-
exports.GlowCard = GlowCard;
|
|
3891
|
-
exports.HostCard = HostCard;
|
|
3892
|
-
exports.IncidentCard = IncidentCard;
|
|
3893
|
-
exports.Input = Input;
|
|
3894
|
-
exports.Kbd = Kbd;
|
|
3895
|
-
exports.LogViewer = LogViewer;
|
|
3896
|
-
exports.Meter = Meter;
|
|
3897
|
-
exports.NoirGlowBackground = NoirGlowBackground;
|
|
3898
|
-
exports.Pagination = Pagination;
|
|
3899
|
-
exports.Panel = Panel;
|
|
3900
|
-
exports.PasswordInput = PasswordInput;
|
|
3901
|
-
exports.Pill = Pill;
|
|
3902
|
-
exports.PricingCard = PricingCard;
|
|
3903
|
-
exports.Progress = Progress;
|
|
3904
|
-
exports.Radio = Radio;
|
|
3905
|
-
exports.RadioGroup = RadioGroup;
|
|
3906
|
-
exports.RollbackPlan = RollbackPlan;
|
|
3907
|
-
exports.Segmented = Segmented;
|
|
3908
|
-
exports.Select = Select;
|
|
3909
|
-
exports.ServiceHealthCard = ServiceHealthCard;
|
|
3910
|
-
exports.Sheet = Sheet;
|
|
3911
|
-
exports.SheetClose = SheetClose;
|
|
3912
|
-
exports.SheetContent = SheetContent;
|
|
3913
|
-
exports.SheetDescription = SheetDescription;
|
|
3914
|
-
exports.SheetHeader = SheetHeader;
|
|
3915
|
-
exports.SheetTitle = SheetTitle;
|
|
3916
|
-
exports.SheetTrigger = SheetTrigger;
|
|
3917
|
-
exports.Skeleton = Skeleton;
|
|
3918
|
-
exports.Slider = Slider;
|
|
3919
|
-
exports.StatCard = StatCard;
|
|
3920
|
-
exports.StatusDot = StatusDot;
|
|
3921
|
-
exports.Stepper = Stepper;
|
|
3922
|
-
exports.Switch = Switch;
|
|
3923
|
-
exports.Tabs = Tabs;
|
|
3924
|
-
exports.TabsContent = TabsContent;
|
|
3925
|
-
exports.TabsList = TabsList;
|
|
3926
|
-
exports.TabsTrigger = TabsTrigger;
|
|
3927
|
-
exports.TagInput = TagInput;
|
|
3928
|
-
exports.Textarea = Textarea;
|
|
3929
|
-
exports.Timeline = Timeline;
|
|
3930
|
-
exports.Toaster = Toaster;
|
|
3931
|
-
exports.Tooltip = Tooltip;
|
|
3932
|
-
exports.TooltipContent = TooltipContent;
|
|
3933
|
-
exports.TooltipProvider = TooltipProvider;
|
|
3934
|
-
exports.TooltipTrigger = TooltipTrigger;
|
|
3935
|
-
exports.buttonVariants = buttonVariants;
|
|
3936
|
-
exports.cn = cn;
|
|
3937
|
-
//# sourceMappingURL=index.cjs.map
|
|
3938
|
-
//# sourceMappingURL=index.cjs.map
|