kaleido-ui 0.2.1 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -10
- package/dist/css/kaleido-ui.css +0 -4
- package/dist/icon-AvUL0Cws.d.cts +135 -0
- package/dist/icon-AvUL0Cws.d.ts +135 -0
- package/dist/native/index.cjs +0 -126
- package/dist/native/index.js +0 -126
- package/dist/web/assets/kaleidoswap-brand.js +11 -0
- package/dist/web/assets/protocol-icons.js +7 -0
- package/dist/web/chunk-25RRZDZ2.js +269 -0
- package/dist/web/chunk-27CY5EHL.js +230 -0
- package/dist/web/chunk-2GNXC446.js +84 -0
- package/dist/web/chunk-2NCH2ZDU.js +129 -0
- package/dist/web/chunk-2OGYEUYV.js +220 -0
- package/dist/web/chunk-2Q5SSNFO.js +63 -0
- package/dist/web/chunk-2REWXJEN.js +96 -0
- package/dist/web/chunk-2VAS6VYJ.js +106 -0
- package/dist/web/chunk-2VKFRAX3.js +39 -0
- package/dist/web/chunk-2Z6KFK4Z.js +41 -0
- package/dist/web/chunk-4246Y2F2.js +276 -0
- package/dist/web/chunk-4MLPMRXA.js +85 -0
- package/dist/web/chunk-4QLR4ZNK.js +383 -0
- package/dist/web/chunk-4UMKXXAK.js +33 -0
- package/dist/web/chunk-563GMWFT.js +32 -0
- package/dist/web/chunk-5BNDC7M4.js +50 -0
- package/dist/web/chunk-5GBURTY4.js +33 -0
- package/dist/web/chunk-5MM5YGGG.js +43 -0
- package/dist/web/chunk-5PZ2XVWL.js +85 -0
- package/dist/web/chunk-5V2KMO56.js +55 -0
- package/dist/web/chunk-5WBAFYPH.js +62 -0
- package/dist/web/chunk-62HIDJCD.js +98 -0
- package/dist/web/chunk-6IBQJIHT.js +56 -0
- package/dist/web/chunk-6PNGSAJB.js +55 -0
- package/dist/web/chunk-6VKWG5FJ.js +159 -0
- package/dist/web/chunk-76DAZT7Q.js +107 -0
- package/dist/web/chunk-7NS5S2PG.js +126 -0
- package/dist/web/chunk-7OE6AXLY.js +27 -0
- package/dist/web/chunk-7YUPXESC.js +666 -0
- package/dist/web/chunk-A3TKIXSI.js +197 -0
- package/dist/web/chunk-A3XHFJ6J.js +120 -0
- package/dist/web/chunk-A6MSV4MA.js +83 -0
- package/dist/web/chunk-A7MPRLJL.js +169 -0
- package/dist/web/chunk-AP7Q2FCS.js +43 -0
- package/dist/web/chunk-ASHU5XNR.js +21 -0
- package/dist/web/chunk-BGUBHWIO.js +41 -0
- package/dist/web/chunk-BY2KCPTX.js +444 -0
- package/dist/web/chunk-C7YIQDGQ.js +57 -0
- package/dist/web/chunk-CBE7BT3M.js +87 -0
- package/dist/web/chunk-CJATW6EO.js +108 -0
- package/dist/web/chunk-CRDCVB5X.js +96 -0
- package/dist/web/chunk-CRMLYZIX.js +35 -0
- package/dist/web/chunk-CXMCWSWC.js +20 -0
- package/dist/web/chunk-CZPNI33A.js +31 -0
- package/dist/web/chunk-DCUAE6PX.js +202 -0
- package/dist/web/chunk-DDMDRAD6.js +403 -0
- package/dist/web/chunk-DH7VXKGM.js +247 -0
- package/dist/web/chunk-DNHRMPKI.js +63 -0
- package/dist/web/chunk-DXFFYCU3.js +83 -0
- package/dist/web/chunk-EK5N3ZPW.js +417 -0
- package/dist/web/chunk-F2LIZX5K.js +140 -0
- package/dist/web/chunk-FSQV54O4.js +61 -0
- package/dist/web/chunk-FWOIRFV5.js +73 -0
- package/dist/web/chunk-G2MJL3VP.js +54 -0
- package/dist/web/chunk-G2ZYNR3W.js +28 -0
- package/dist/web/chunk-G373WZMN.js +150 -0
- package/dist/web/chunk-GMJGTSCQ.js +82 -0
- package/dist/web/chunk-GX7GBHJ6.js +362 -0
- package/dist/web/chunk-GZZ5KVON.js +70 -0
- package/dist/web/chunk-H3GYLFHP.js +30 -0
- package/dist/web/chunk-HDLOPDFX.js +89 -0
- package/dist/web/chunk-HP25HN7Q.js +69 -0
- package/dist/web/chunk-HVKSBEZN.js +98 -0
- package/dist/web/chunk-HWKXZNBN.js +74 -0
- package/dist/web/chunk-HY3VMT27.js +64 -0
- package/dist/web/chunk-IK32AIOS.js +27 -0
- package/dist/web/chunk-IMER4KGH.js +151 -0
- package/dist/web/chunk-IV6AAVUE.js +177 -0
- package/dist/web/chunk-JWMFTRDC.js +254 -0
- package/dist/web/chunk-JY3H7ZAI.js +41 -0
- package/dist/web/chunk-JY73M73T.js +175 -0
- package/dist/web/chunk-JYM5NHBA.js +80 -0
- package/dist/web/chunk-JZ3BUM5L.js +368 -0
- package/dist/web/chunk-KIMWCG5N.js +108 -0
- package/dist/web/chunk-L2UPQLY7.js +43 -0
- package/dist/web/chunk-LFAORJQK.js +81 -0
- package/dist/web/chunk-LOGZGZWN.js +1 -0
- package/dist/web/chunk-LPDB7EHH.js +65 -0
- package/dist/web/chunk-LSY4DY2I.js +72 -0
- package/dist/web/chunk-LYCLVP26.js +101 -0
- package/dist/web/chunk-LZ6PIXUO.js +43 -0
- package/dist/web/chunk-LZ723UCB.js +96 -0
- package/dist/web/chunk-M6RXTQEL.js +90 -0
- package/dist/web/chunk-MTQ22SKE.js +39 -0
- package/dist/web/chunk-MTQOAMDW.js +8 -0
- package/dist/web/chunk-NEXA6VGG.js +91 -0
- package/dist/web/chunk-NSA777UY.js +89 -0
- package/dist/web/chunk-O2TTO5FS.js +24 -0
- package/dist/web/chunk-O6NPTMDN.js +191 -0
- package/dist/web/chunk-OI7WX7NE.js +17 -0
- package/dist/web/chunk-OWSKP527.js +80 -0
- package/dist/web/chunk-OX3J3FYX.js +64 -0
- package/dist/web/chunk-PCKRLEAO.js +40 -0
- package/dist/web/chunk-PMGIJMRO.js +207 -0
- package/dist/web/chunk-PS7Q6MMU.js +60 -0
- package/dist/web/chunk-PTSOVDKH.js +169 -0
- package/dist/web/chunk-QBZSLR7U.js +54 -0
- package/dist/web/chunk-QCQRA6L5.js +63 -0
- package/dist/web/chunk-QFIGSIXA.js +558 -0
- package/dist/web/chunk-QRFFLA3N.js +84 -0
- package/dist/web/chunk-QXCCUYNY.js +232 -0
- package/dist/web/chunk-QXZ2WY3B.js +38 -0
- package/dist/web/chunk-R2MV4S4U.js +50 -0
- package/dist/web/chunk-R3IIXFGK.js +48 -0
- package/dist/web/chunk-RIOY4LFJ.js +141 -0
- package/dist/web/chunk-RV7Z3B3V.js +106 -0
- package/dist/web/chunk-RXXYUYBP.js +25 -0
- package/dist/web/chunk-S2ICIIH2.js +109 -0
- package/dist/web/chunk-SJNOBBU5.js +86 -0
- package/dist/web/chunk-STMNX3QT.js +109 -0
- package/dist/web/chunk-T7CEJV6P.js +66 -0
- package/dist/web/chunk-TBEKRQGW.js +99 -0
- package/dist/web/chunk-TCFHH5TE.js +179 -0
- package/dist/web/chunk-TI7NWMEQ.js +34 -0
- package/dist/web/chunk-TKRMGN7J.js +8 -0
- package/dist/web/chunk-TMK3SVYI.js +62 -0
- package/dist/web/chunk-TPGNO74K.js +67 -0
- package/dist/web/chunk-TS4UYWJJ.js +105 -0
- package/dist/web/chunk-TY6SGZC7.js +94 -0
- package/dist/web/chunk-UHXOPILM.js +101 -0
- package/dist/web/chunk-UK6ZL4MX.js +375 -0
- package/dist/web/chunk-UXLWWQ4J.js +20 -0
- package/dist/web/chunk-UZ4LWR4X.js +26 -0
- package/dist/web/chunk-VLZMX43R.js +45 -0
- package/dist/web/chunk-VM6AGMYO.js +46 -0
- package/dist/web/chunk-VUGV3ELU.js +176 -0
- package/dist/web/chunk-VYQHGSK6.js +244 -0
- package/dist/web/chunk-VZF5C3C6.js +146 -0
- package/dist/web/chunk-W4E2N3UN.js +58 -0
- package/dist/web/chunk-WEPSTI3Z.js +83 -0
- package/dist/web/chunk-WOAWUXER.js +139 -0
- package/dist/web/chunk-WURSWAKE.js +74 -0
- package/dist/web/chunk-WWF7IJBF.js +330 -0
- package/dist/web/chunk-X2RA4EG3.js +86 -0
- package/dist/web/chunk-XCQGJYGF.js +42 -0
- package/dist/web/chunk-XDSOOOYL.js +35 -0
- package/dist/web/chunk-XPHFJPUQ.js +291 -0
- package/dist/web/chunk-XXH4TYKZ.js +276 -0
- package/dist/web/chunk-XZQUQOR3.js +48 -0
- package/dist/web/chunk-Y3W6LOOE.js +66 -0
- package/dist/web/chunk-YNB4SSLD.js +113 -0
- package/dist/web/chunk-YQDCU7ZL.js +49 -0
- package/dist/web/chunk-YQQ7GDLZ.js +30 -0
- package/dist/web/chunk-YTXWYWVD.js +70 -0
- package/dist/web/chunk-YXVOFEDT.js +85 -0
- package/dist/web/chunk-Z2SS7UJ4.js +139 -0
- package/dist/web/chunk-Z5LVT3BD.js +128 -0
- package/dist/web/chunk-Z5O67WTL.js +85 -0
- package/dist/web/chunk-ZPNGHBKB.js +86 -0
- package/dist/web/chunk-ZR32WYJA.js +55 -0
- package/dist/web/chunk-ZRIBB4EB.js +62 -0
- package/dist/web/chunk-ZTVV4KBT.js +28 -0
- package/dist/web/chunk-ZXCT3Y6P.js +56 -0
- package/dist/web/components/account-capabilities-card.js +21 -0
- package/dist/web/components/account-menu.js +18 -0
- package/dist/web/components/account-settings-shared.js +50 -0
- package/dist/web/components/account-status-tabs.js +20 -0
- package/dist/web/components/action-tile.js +8 -0
- package/dist/web/components/activity-detail-row.js +22 -0
- package/dist/web/components/activity-filter-bar.js +22 -0
- package/dist/web/components/activity-list.js +23 -0
- package/dist/web/components/activity-network-filters.js +19 -0
- package/dist/web/components/activity-row.js +15 -0
- package/dist/web/components/activity-type-tabs.js +17 -0
- package/dist/web/components/alert-banner.js +13 -0
- package/dist/web/components/amount.js +8 -0
- package/dist/web/components/app-icon.js +15 -0
- package/dist/web/components/asset-card.js +21 -0
- package/dist/web/components/asset-icon.js +10 -0
- package/dist/web/components/asset-selector.js +24 -0
- package/dist/web/components/balance-breakdown.js +18 -0
- package/dist/web/components/basic-collapsible.js +11 -0
- package/dist/web/components/bottom-nav.js +13 -0
- package/dist/web/components/bottom-sheet.js +15 -0
- package/dist/web/components/btc-unified-receive.js +28 -0
- package/dist/web/components/charts/bar-chart.js +24 -0
- package/dist/web/components/charts/bar-list.js +24 -0
- package/dist/web/components/charts/core.js +63 -0
- package/dist/web/components/charts/donut-chart.js +26 -0
- package/dist/web/components/charts/index.js +72 -0
- package/dist/web/components/charts/line-chart.js +26 -0
- package/dist/web/components/charts/meter.js +24 -0
- package/dist/web/components/charts/mixed-chart.js +24 -0
- package/dist/web/components/charts/scatter-chart.js +24 -0
- package/dist/web/components/charts/sparkline.js +8 -0
- package/dist/web/components/choice-group.js +11 -0
- package/dist/web/components/code-block.js +21 -0
- package/dist/web/components/confirm-dialog.js +15 -0
- package/dist/web/components/copy-button.js +21 -0
- package/dist/web/components/copyable.js +20 -0
- package/dist/web/components/date-range-filter.js +16 -0
- package/dist/web/components/deposit-asset-selection.js +24 -0
- package/dist/web/components/deposit-generated-view.js +23 -0
- package/dist/web/components/deposit-invoice-generation.js +35 -0
- package/dist/web/components/deposit-network-default-modal.js +13 -0
- package/dist/web/components/deposit-pre-generation.js +17 -0
- package/dist/web/components/deposit-success-screen.js +20 -0
- package/dist/web/components/deposit-ui-shared.js +28 -0
- package/dist/web/components/disclosure-card.js +11 -0
- package/dist/web/components/dotted-leader.js +8 -0
- package/dist/web/components/empty-state.js +8 -0
- package/dist/web/components/environment-indicator.js +9 -0
- package/dist/web/components/error-boundary.js +10 -0
- package/dist/web/components/event-timeline.js +8 -0
- package/dist/web/components/extension-page-frame.js +15 -0
- package/dist/web/components/filter-bar.js +15 -0
- package/dist/web/components/filter-chip-group.js +8 -0
- package/dist/web/components/filter-dropdown.js +12 -0
- package/dist/web/components/floating-notice.js +12 -0
- package/dist/web/components/form-field.js +10 -0
- package/dist/web/components/halo-backdrop.js +8 -0
- package/dist/web/components/info-chip.js +24 -0
- package/dist/web/components/info-panel.js +13 -0
- package/dist/web/components/inline-selector.js +11 -0
- package/dist/web/components/instants-statement.js +20 -0
- package/dist/web/components/kaleidoscope-hero-animation.js +11 -0
- package/dist/web/components/kaleidoswap-logo.js +12 -0
- package/dist/web/components/list-field.js +14 -0
- package/dist/web/components/list-summary.js +8 -0
- package/dist/web/components/metric-card.js +14 -0
- package/dist/web/components/mobile-hero-animation.js +8 -0
- package/dist/web/components/network-badge.js +14 -0
- package/dist/web/components/network-icon.js +21 -0
- package/dist/web/components/network-status-chip.js +11 -0
- package/dist/web/components/notice-bar.js +8 -0
- package/dist/web/components/one-time-secret-dialog.js +18 -0
- package/dist/web/components/option-selector.js +12 -0
- package/dist/web/components/page-header.js +12 -0
- package/dist/web/components/page-shell.js +18 -0
- package/dist/web/components/pager.js +11 -0
- package/dist/web/components/period-select.js +20 -0
- package/dist/web/components/qr-code.js +10 -0
- package/dist/web/components/query-state.js +19 -0
- package/dist/web/components/read-status.js +15 -0
- package/dist/web/components/record-list.js +17 -0
- package/dist/web/components/recovery-phrase-card.js +20 -0
- package/dist/web/components/restricted.js +9 -0
- package/dist/web/components/secret-reveal-card.js +20 -0
- package/dist/web/components/section-header.js +9 -0
- package/dist/web/components/section-label.js +8 -0
- package/dist/web/components/selectable-card.js +8 -0
- package/dist/web/components/setting-item.js +13 -0
- package/dist/web/components/settings-section-card.js +11 -0
- package/dist/web/components/settings-selector-row.js +8 -0
- package/dist/web/components/settings-tile.js +21 -0
- package/dist/web/components/skeleton.js +10 -0
- package/dist/web/components/status-badge.js +13 -0
- package/dist/web/components/status-icon-badge.js +15 -0
- package/dist/web/components/stepper-number-input.js +10 -0
- package/dist/web/components/summary-rows.js +9 -0
- package/dist/web/components/swap-badge.js +11 -0
- package/dist/web/components/swap-input-card.js +28 -0
- package/dist/web/components/swap-step-list.js +10 -0
- package/dist/web/components/switch-row.js +9 -0
- package/dist/web/components/theme-toggle.js +12 -0
- package/dist/web/components/transaction-card.js +14 -0
- package/dist/web/components/trend-chart.js +28 -0
- package/dist/web/components/value-list.js +20 -0
- package/dist/web/components/wallet-asset-list.js +22 -0
- package/dist/web/components/withdraw-amount-input.js +13 -0
- package/dist/web/components/withdraw-confirmation.js +17 -0
- package/dist/web/components/withdraw-destination-input.js +14 -0
- package/dist/web/components/withdraw-invoice-info.js +10 -0
- package/dist/web/components/withdraw-route-selector.js +9 -0
- package/dist/web/components/withdraw-success.js +12 -0
- package/dist/web/hooks/use-asset-icon.js +11 -0
- package/dist/web/hooks/use-copy-to-clipboard.js +7 -0
- package/dist/web/hooks/use-media-query.js +9 -0
- package/dist/web/hooks/use-theme-mode.js +9 -0
- package/dist/web/hooks/use-toast.js +11 -0
- package/dist/web/icons/filled.js +15 -0
- package/dist/web/icons/index.js +13 -0
- package/dist/web/icons/outlined.js +221 -0
- package/dist/web/icons/public.js +248 -0
- package/dist/web/icons.cjs +776 -0
- package/dist/web/icons.d.cts +123 -0
- package/dist/web/icons.d.ts +123 -0
- package/dist/web/index.cjs +3447 -2567
- package/dist/web/index.d.cts +507 -113
- package/dist/web/index.d.ts +507 -113
- package/dist/web/index.js +612 -13675
- package/dist/web/primitives/avatar.js +10 -0
- package/dist/web/primitives/button.js +10 -0
- package/dist/web/primitives/card.js +20 -0
- package/dist/web/primitives/collapsible.js +16 -0
- package/dist/web/primitives/dialog.js +30 -0
- package/dist/web/primitives/dot-pagination.js +8 -0
- package/dist/web/primitives/drawer.js +43 -0
- package/dist/web/primitives/dropdown-menu.js +28 -0
- package/dist/web/primitives/glyph-button.js +10 -0
- package/dist/web/primitives/icon-button.js +15 -0
- package/dist/web/primitives/icon-glyph.js +8 -0
- package/dist/web/primitives/icon.js +16 -0
- package/dist/web/primitives/input.js +9 -0
- package/dist/web/primitives/label.js +9 -0
- package/dist/web/primitives/menu-search.js +20 -0
- package/dist/web/primitives/number-input.js +11 -0
- package/dist/web/primitives/popover.js +18 -0
- package/dist/web/primitives/scroll-area.js +12 -0
- package/dist/web/primitives/select.js +27 -0
- package/dist/web/primitives/switch.js +8 -0
- package/dist/web/primitives/table.js +27 -0
- package/dist/web/primitives/tabs.js +14 -0
- package/dist/web/primitives/toast.js +24 -0
- package/dist/web/primitives/toaster.js +15 -0
- package/dist/web/primitives/tooltip.js +10 -0
- package/dist/web/utils/amount-display.js +13 -0
- package/dist/web/utils/cn.js +7 -0
- package/dist/web/utils/field-styles.js +7 -0
- package/dist/web/utils/type-roles.js +7 -0
- package/package.json +9 -1
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
colors
|
|
4
|
+
} from "./chunk-A7MPRLJL.js";
|
|
5
|
+
|
|
6
|
+
// src/tokens/brand.ts
|
|
7
|
+
var brandMark = {
|
|
8
|
+
violet: "#6F32FF",
|
|
9
|
+
green: "#17B581",
|
|
10
|
+
mint: "#15E99A"
|
|
11
|
+
};
|
|
12
|
+
var themedForeground = {
|
|
13
|
+
light: {
|
|
14
|
+
// Brand green at full saturation (no red), as light as it goes and still
|
|
15
|
+
// clears 4.5:1 on every light surface (4.55:1 on #EFEFF4).
|
|
16
|
+
brand: "#007D49",
|
|
17
|
+
"accent-send-fg": "#6428F0",
|
|
18
|
+
"accent-recv-fg": "#007D49",
|
|
19
|
+
"success-fg": "#076A43",
|
|
20
|
+
// a shade under brand: it also sits on a 14% mint tint
|
|
21
|
+
// Tailwind -800 shades: -700 measured only 3.7 to 4.3:1 on the light ramp.
|
|
22
|
+
"warning-fg": "#92400E",
|
|
23
|
+
"danger-fg": "#991B1B",
|
|
24
|
+
"info-fg": "#1E40AF",
|
|
25
|
+
"network-bitcoin-fg": "#92400E",
|
|
26
|
+
"network-lightning-fg": "#854D0E",
|
|
27
|
+
"network-liquid-fg": "#115E59",
|
|
28
|
+
"network-arkade-fg": "#5B21B6",
|
|
29
|
+
"network-spark-fg": "#0D0C14",
|
|
30
|
+
// Spark is black on light
|
|
31
|
+
"network-rgb-fg": "#991B1B",
|
|
32
|
+
"network-taproot-fg": "#464A69"
|
|
33
|
+
},
|
|
34
|
+
dark: {
|
|
35
|
+
brand: colors.primary,
|
|
36
|
+
"accent-send-fg": "#AD94FB",
|
|
37
|
+
"accent-recv-fg": colors.primary,
|
|
38
|
+
"success-fg": colors.success,
|
|
39
|
+
"warning-fg": colors.warning,
|
|
40
|
+
// danger #E53535 and info #4290FF are 3.0:1 and 3.2:1 on the elevated
|
|
41
|
+
// surface. Same hues, lifted until they clear 4.5:1.
|
|
42
|
+
"danger-fg": "#FF9999",
|
|
43
|
+
"info-fg": "#8BBDFF",
|
|
44
|
+
"network-bitcoin-fg": colors.networkText.bitcoin,
|
|
45
|
+
"network-lightning-fg": colors.networkText.lightning,
|
|
46
|
+
"network-liquid-fg": colors.networkText.liquid,
|
|
47
|
+
// The rgb and arkade *-text tokens dip under 4.5:1 on the elevated
|
|
48
|
+
// surface (3.9 and 4.1), so their -fg twins are lifted a step.
|
|
49
|
+
"network-arkade-fg": "#B49CF5",
|
|
50
|
+
"network-spark-fg": colors.network.spark,
|
|
51
|
+
// and white on dark
|
|
52
|
+
"network-rgb-fg": "#F09490",
|
|
53
|
+
"network-taproot-fg": colors.networkText.taproot
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
var themedForegroundOrder = Object.keys(themedForeground.light);
|
|
57
|
+
var halo = {
|
|
58
|
+
primary: colors.tx.receive,
|
|
59
|
+
secondary: brandMark.violet,
|
|
60
|
+
blur: "110px"
|
|
61
|
+
};
|
|
62
|
+
var brandTheme = {
|
|
63
|
+
/** AA-safe light primary: white on it is 6.3:1, it is 5.1:1 on the light ramp. */
|
|
64
|
+
lightPrimary: themedForeground.light.brand,
|
|
65
|
+
/** Lifted dark status colours (see `themedForeground.dark`). */
|
|
66
|
+
darkDanger: themedForeground.dark["danger-fg"],
|
|
67
|
+
darkInfo: themedForeground.dark["info-fg"]
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
export {
|
|
71
|
+
brandMark
|
|
72
|
+
};
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
protocolIcons
|
|
4
|
+
} from "./chunk-WEPSTI3Z.js";
|
|
5
|
+
import {
|
|
6
|
+
cn
|
|
7
|
+
} from "./chunk-PMGIJMRO.js";
|
|
8
|
+
|
|
9
|
+
// src/web/components/network-icon.tsx
|
|
10
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
|
+
function LightningNetworkIcon({
|
|
12
|
+
className = "size-3.5",
|
|
13
|
+
alt = "Lightning"
|
|
14
|
+
}) {
|
|
15
|
+
return /* @__PURE__ */ jsx(
|
|
16
|
+
"img",
|
|
17
|
+
{
|
|
18
|
+
src: "/icons/lightning/lightning.svg",
|
|
19
|
+
alt,
|
|
20
|
+
className: cn("object-contain", className)
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
function SparkNetworkIcon({ className = "size-3.5", alt = "Spark" }) {
|
|
25
|
+
return /* @__PURE__ */ jsx(
|
|
26
|
+
"img",
|
|
27
|
+
{
|
|
28
|
+
src: "/icons/spark/Asterisk/Spark Asterisk White.svg",
|
|
29
|
+
alt,
|
|
30
|
+
className: cn("kui-mono-icon object-contain", className)
|
|
31
|
+
}
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
function ArkadeNetworkIcon({
|
|
35
|
+
className = "size-3.5 rounded-sm",
|
|
36
|
+
alt = "Arkade"
|
|
37
|
+
}) {
|
|
38
|
+
return /* @__PURE__ */ jsx(
|
|
39
|
+
"img",
|
|
40
|
+
{
|
|
41
|
+
src: "/icons/arkade/arkade-icon.svg",
|
|
42
|
+
alt,
|
|
43
|
+
className: cn("object-contain", className)
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
function NostrNetworkIcon({
|
|
48
|
+
className = "size-3.5",
|
|
49
|
+
alt = "Nostr"
|
|
50
|
+
}) {
|
|
51
|
+
return /* @__PURE__ */ jsx(
|
|
52
|
+
"img",
|
|
53
|
+
{
|
|
54
|
+
src: "/icons/nostr-icon.svg",
|
|
55
|
+
alt,
|
|
56
|
+
className: cn("object-contain", className)
|
|
57
|
+
}
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
function RgbNetworkIcon({ className = "size-3.5", alt = "RGB" }) {
|
|
61
|
+
return /* @__PURE__ */ jsx("img", { src: protocolIcons["RGB20"], alt, className: cn("object-contain", className) });
|
|
62
|
+
}
|
|
63
|
+
function OnchainNetworkIcon({
|
|
64
|
+
className = "size-3.5",
|
|
65
|
+
inherit = false
|
|
66
|
+
}) {
|
|
67
|
+
return /* @__PURE__ */ jsxs(
|
|
68
|
+
"svg",
|
|
69
|
+
{
|
|
70
|
+
viewBox: "0 0 24 24",
|
|
71
|
+
fill: "currentColor",
|
|
72
|
+
stroke: "currentColor",
|
|
73
|
+
strokeWidth: "2",
|
|
74
|
+
strokeLinecap: "round",
|
|
75
|
+
"aria-hidden": true,
|
|
76
|
+
width: "1em",
|
|
77
|
+
height: "1em",
|
|
78
|
+
className: cn("inline-block shrink-0", className),
|
|
79
|
+
style: inherit ? void 0 : { color: "var(--color-network-bitcoin)" },
|
|
80
|
+
children: [
|
|
81
|
+
/* @__PURE__ */ jsx("rect", { x: "2", y: "2", width: "8", height: "8", rx: "2", stroke: "none" }),
|
|
82
|
+
/* @__PURE__ */ jsx("rect", { x: "14", y: "2", width: "8", height: "8", rx: "2", stroke: "none" }),
|
|
83
|
+
/* @__PURE__ */ jsx("rect", { x: "14", y: "14", width: "8", height: "8", rx: "2", stroke: "none" }),
|
|
84
|
+
/* @__PURE__ */ jsx("path", { d: "M10 6h4M18 10v4", fill: "none" })
|
|
85
|
+
]
|
|
86
|
+
}
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
function LiquidNetworkIcon({ className = "size-3.5", alt = "Liquid" }) {
|
|
90
|
+
return /* @__PURE__ */ jsx("img", { src: protocolIcons.Liquid, alt, className: cn("object-contain", className) });
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export {
|
|
94
|
+
LightningNetworkIcon,
|
|
95
|
+
SparkNetworkIcon,
|
|
96
|
+
ArkadeNetworkIcon,
|
|
97
|
+
NostrNetworkIcon,
|
|
98
|
+
RgbNetworkIcon,
|
|
99
|
+
OnchainNetworkIcon,
|
|
100
|
+
LiquidNetworkIcon
|
|
101
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
CopyButton
|
|
4
|
+
} from "./chunk-QCQRA6L5.js";
|
|
5
|
+
import {
|
|
6
|
+
Collapsible,
|
|
7
|
+
CollapsibleChevron,
|
|
8
|
+
CollapsibleContent,
|
|
9
|
+
CollapsibleTrigger
|
|
10
|
+
} from "./chunk-6IBQJIHT.js";
|
|
11
|
+
import {
|
|
12
|
+
cn
|
|
13
|
+
} from "./chunk-PMGIJMRO.js";
|
|
14
|
+
|
|
15
|
+
// src/web/components/value-list.tsx
|
|
16
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
17
|
+
function ValueList({ values, singular, plural, emptyLabel = "None", defaultOpen = false, className }) {
|
|
18
|
+
if (values.length === 0) {
|
|
19
|
+
return /* @__PURE__ */ jsx("span", { className: cn("text-caption text-muted-foreground", className), children: emptyLabel });
|
|
20
|
+
}
|
|
21
|
+
const summary = `${values.length} ${values.length === 1 ? singular : plural}`;
|
|
22
|
+
return /* @__PURE__ */ jsxs(Collapsible, { defaultOpen, "data-slot": "value-list", className: cn("min-w-0", className), children: [
|
|
23
|
+
/* @__PURE__ */ jsxs(
|
|
24
|
+
CollapsibleTrigger,
|
|
25
|
+
{
|
|
26
|
+
type: "button",
|
|
27
|
+
className: "inline-flex items-center gap-1 rounded-lg text-caption font-semibold text-foreground transition-colors hover:text-secondary-content data-[state=open]:text-secondary-content",
|
|
28
|
+
children: [
|
|
29
|
+
summary,
|
|
30
|
+
/* @__PURE__ */ jsx(CollapsibleChevron, {})
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
),
|
|
34
|
+
/* @__PURE__ */ jsx(CollapsibleContent, { children: /* @__PURE__ */ jsx("ul", { className: "m-0 mt-2 list-none space-y-1 p-0", children: values.map((value, index) => /* @__PURE__ */ jsxs("li", { className: "flex items-center gap-1 rounded-xl kui-well px-3 py-1.5", children: [
|
|
35
|
+
/* @__PURE__ */ jsx("span", { className: "min-w-0 select-all break-all font-mono text-caption text-foreground", children: value }),
|
|
36
|
+
/* @__PURE__ */ jsx(CopyButton, { value, label: singular })
|
|
37
|
+
] }, `${index}-${value}`)) }) })
|
|
38
|
+
] });
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export {
|
|
42
|
+
ValueList
|
|
43
|
+
};
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
GlyphButton
|
|
4
|
+
} from "./chunk-JY3H7ZAI.js";
|
|
5
|
+
import {
|
|
6
|
+
Close
|
|
7
|
+
} from "./chunk-XXH4TYKZ.js";
|
|
8
|
+
import {
|
|
9
|
+
cn
|
|
10
|
+
} from "./chunk-PMGIJMRO.js";
|
|
11
|
+
|
|
12
|
+
// src/web/primitives/dialog.tsx
|
|
13
|
+
import * as React from "react";
|
|
14
|
+
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
15
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
16
|
+
var Dialog = DialogPrimitive.Root;
|
|
17
|
+
var DialogTrigger = DialogPrimitive.Trigger;
|
|
18
|
+
var DialogPortal = DialogPrimitive.Portal;
|
|
19
|
+
var DialogClose = DialogPrimitive.Close;
|
|
20
|
+
var DialogOverlay = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
21
|
+
DialogPrimitive.Overlay,
|
|
22
|
+
{
|
|
23
|
+
ref,
|
|
24
|
+
className: cn(
|
|
25
|
+
"fixed inset-0 z-50 bg-background/80 bg-page-radial backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
26
|
+
className
|
|
27
|
+
),
|
|
28
|
+
...props
|
|
29
|
+
}
|
|
30
|
+
));
|
|
31
|
+
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
32
|
+
var DialogContent = React.forwardRef(({ className, children, showClose = true, ...props }, ref) => /* @__PURE__ */ jsxs(DialogPortal, { children: [
|
|
33
|
+
/* @__PURE__ */ jsx(DialogOverlay, {}),
|
|
34
|
+
/* @__PURE__ */ jsxs(
|
|
35
|
+
DialogPrimitive.Content,
|
|
36
|
+
{
|
|
37
|
+
ref,
|
|
38
|
+
className: cn(
|
|
39
|
+
// True-center with ZERO positional animation. The -50%/-50% centering
|
|
40
|
+
// lives on the CSS `translate` property ([translate:-50%_-50%]), NOT
|
|
41
|
+
// on `transform` — the tailwindcss-animate keyframes override the
|
|
42
|
+
// whole `transform` property while animating, so any transform-based
|
|
43
|
+
// centering (translate-x-[-50%] + slide-in-from-left-1/2) gets
|
|
44
|
+
// re-interpolated per frame and reads as a drift from the left.
|
|
45
|
+
// With centering out of `transform`, the entrance/exit is purely a
|
|
46
|
+
// fast fade + 0.98↔1 zoom (150ms ease-out) around the dialog's own
|
|
47
|
+
// center. No slide-in/out utilities may ever be added back here.
|
|
48
|
+
// (BottomSheet owns its own slide-up; it does not use this.)
|
|
49
|
+
// Its one edge is the popover shadow's hairline.
|
|
50
|
+
"fixed left-1/2 top-1/2 z-50 grid w-full max-w-sm [translate:-50%_-50%] gap-4 rounded-2xl bg-card bg-gradient-card-hero p-6 shadow-popover duration-150 ease-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0 data-[state=open]:zoom-in-[0.98] data-[state=closed]:zoom-out-[0.98]",
|
|
51
|
+
className
|
|
52
|
+
),
|
|
53
|
+
...props,
|
|
54
|
+
children: [
|
|
55
|
+
children,
|
|
56
|
+
showClose && /* @__PURE__ */ jsx(DialogPrimitive.Close, { asChild: true, children: /* @__PURE__ */ jsx(GlyphButton, { icon: Close, label: "Close", size: "sm", className: "absolute right-3 top-3" }) })
|
|
57
|
+
]
|
|
58
|
+
}
|
|
59
|
+
)
|
|
60
|
+
] }));
|
|
61
|
+
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
62
|
+
var DialogHeader = ({ className, ...props }) => /* @__PURE__ */ jsx("div", { className: cn("flex flex-col space-y-1.5 text-center sm:text-left", className), ...props });
|
|
63
|
+
DialogHeader.displayName = "DialogHeader";
|
|
64
|
+
var DialogFooter = ({ className, ...props }) => /* @__PURE__ */ jsx("div", { className: cn("flex flex-col-reverse gap-2 sm:flex-row sm:justify-between", className), ...props });
|
|
65
|
+
DialogFooter.displayName = "DialogFooter";
|
|
66
|
+
var DialogTitle = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
67
|
+
DialogPrimitive.Title,
|
|
68
|
+
{
|
|
69
|
+
ref,
|
|
70
|
+
className: cn("text-subhead font-semibold leading-none tracking-tight", className),
|
|
71
|
+
...props
|
|
72
|
+
}
|
|
73
|
+
));
|
|
74
|
+
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
75
|
+
var DialogDescription = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
76
|
+
DialogPrimitive.Description,
|
|
77
|
+
{
|
|
78
|
+
ref,
|
|
79
|
+
className: cn("text-caption text-muted-foreground", className),
|
|
80
|
+
...props
|
|
81
|
+
}
|
|
82
|
+
));
|
|
83
|
+
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
84
|
+
|
|
85
|
+
export {
|
|
86
|
+
Dialog,
|
|
87
|
+
DialogTrigger,
|
|
88
|
+
DialogPortal,
|
|
89
|
+
DialogClose,
|
|
90
|
+
DialogOverlay,
|
|
91
|
+
DialogContent,
|
|
92
|
+
DialogHeader,
|
|
93
|
+
DialogFooter,
|
|
94
|
+
DialogTitle,
|
|
95
|
+
DialogDescription
|
|
96
|
+
};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
useIsNarrow
|
|
4
|
+
} from "./chunk-MTQ22SKE.js";
|
|
5
|
+
import {
|
|
6
|
+
Collapsible,
|
|
7
|
+
CollapsibleChevron,
|
|
8
|
+
CollapsibleContent,
|
|
9
|
+
CollapsibleTrigger
|
|
10
|
+
} from "./chunk-6IBQJIHT.js";
|
|
11
|
+
import {
|
|
12
|
+
Button
|
|
13
|
+
} from "./chunk-OWSKP527.js";
|
|
14
|
+
import {
|
|
15
|
+
IconGlyph
|
|
16
|
+
} from "./chunk-YQQ7GDLZ.js";
|
|
17
|
+
import {
|
|
18
|
+
Tune
|
|
19
|
+
} from "./chunk-XXH4TYKZ.js";
|
|
20
|
+
import {
|
|
21
|
+
cn
|
|
22
|
+
} from "./chunk-PMGIJMRO.js";
|
|
23
|
+
|
|
24
|
+
// src/web/components/filter-bar.tsx
|
|
25
|
+
import { useState } from "react";
|
|
26
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
27
|
+
function activeFiltersLabel(count) {
|
|
28
|
+
return `${count} ${count === 1 ? "filter" : "filters"} applied`;
|
|
29
|
+
}
|
|
30
|
+
var defaultCountLabel = (count) => count > 0 ? `${count} active` : "none";
|
|
31
|
+
function FilterBar({
|
|
32
|
+
activeCount,
|
|
33
|
+
onClear,
|
|
34
|
+
children,
|
|
35
|
+
activeLabel = activeFiltersLabel,
|
|
36
|
+
clearLabel = "Clear all",
|
|
37
|
+
filtersLabel = "Filters",
|
|
38
|
+
countLabel = defaultCountLabel,
|
|
39
|
+
defaultOpen = false,
|
|
40
|
+
align = "start",
|
|
41
|
+
className
|
|
42
|
+
}) {
|
|
43
|
+
const narrow = useIsNarrow();
|
|
44
|
+
const [open, setOpen] = useState(defaultOpen);
|
|
45
|
+
const clear = activeCount > 0 && onClear ? /* @__PURE__ */ jsx(Button, { type: "button", variant: "ghost", size: "sm", onClick: onClear, children: clearLabel }) : null;
|
|
46
|
+
if (narrow) {
|
|
47
|
+
return /* @__PURE__ */ jsxs(Collapsible, { open, onOpenChange: setOpen, "data-slot": "filter-bar", "data-layout": "narrow", className: cn("space-y-3", className), children: [
|
|
48
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
49
|
+
/* @__PURE__ */ jsxs(
|
|
50
|
+
CollapsibleTrigger,
|
|
51
|
+
{
|
|
52
|
+
type: "button",
|
|
53
|
+
"aria-label": `${filtersLabel}, ${countLabel(activeCount)}`,
|
|
54
|
+
className: "inline-flex h-9 items-center gap-2 rounded-xl bg-muted/40 px-3 text-caption font-semibold text-foreground shadow-raised hover-gradient-violet data-[state=open]:bg-secondary/15 data-[state=open]:text-secondary-content",
|
|
55
|
+
children: [
|
|
56
|
+
/* @__PURE__ */ jsx(IconGlyph, { glyph: Tune, className: "text-icon-md" }),
|
|
57
|
+
filtersLabel,
|
|
58
|
+
activeCount > 0 && /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "rounded-full bg-primary/15 px-1.5 text-xxs font-bold text-brand", children: activeCount }),
|
|
59
|
+
/* @__PURE__ */ jsx(CollapsibleChevron, {})
|
|
60
|
+
]
|
|
61
|
+
}
|
|
62
|
+
),
|
|
63
|
+
clear
|
|
64
|
+
] }),
|
|
65
|
+
/* @__PURE__ */ jsx(CollapsibleContent, { className: "flex flex-col gap-3", children })
|
|
66
|
+
] });
|
|
67
|
+
}
|
|
68
|
+
return /* @__PURE__ */ jsxs(
|
|
69
|
+
"div",
|
|
70
|
+
{
|
|
71
|
+
"data-slot": "filter-bar",
|
|
72
|
+
"data-layout": "wide",
|
|
73
|
+
className: cn("flex flex-wrap items-end gap-3", align === "end" && "justify-end", className),
|
|
74
|
+
children: [
|
|
75
|
+
children,
|
|
76
|
+
activeCount > 0 && // Its own line under the filters, never squeezed in beside them.
|
|
77
|
+
// The count belongs to the controls above it: a tighter gap than theirs.
|
|
78
|
+
/* @__PURE__ */ jsxs("div", { className: cn("-mt-1.5 flex basis-full items-center gap-2", align === "end" && "justify-end"), children: [
|
|
79
|
+
/* @__PURE__ */ jsx("span", { className: "text-caption text-muted-foreground", children: activeLabel(activeCount) }),
|
|
80
|
+
clear
|
|
81
|
+
] })
|
|
82
|
+
]
|
|
83
|
+
}
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export {
|
|
88
|
+
activeFiltersLabel,
|
|
89
|
+
FilterBar
|
|
90
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// src/web/hooks/use-media-query.ts
|
|
4
|
+
import { useEffect, useState } from "react";
|
|
5
|
+
|
|
6
|
+
// src/tokens/breakpoints.ts
|
|
7
|
+
var breakpoint = {
|
|
8
|
+
sm: "40rem",
|
|
9
|
+
// 640px
|
|
10
|
+
md: "48rem",
|
|
11
|
+
// 768px
|
|
12
|
+
lg: "64rem",
|
|
13
|
+
// 1024px
|
|
14
|
+
xl: "80rem"
|
|
15
|
+
// 1280px
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
// src/web/hooks/use-media-query.ts
|
|
19
|
+
var matches = (query) => typeof window !== "undefined" && typeof window.matchMedia === "function" ? window.matchMedia(query).matches : false;
|
|
20
|
+
function useMediaQuery(query) {
|
|
21
|
+
const [value, setValue] = useState(() => matches(query));
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
if (typeof window === "undefined" || typeof window.matchMedia !== "function") return;
|
|
24
|
+
const list = window.matchMedia(query);
|
|
25
|
+
const update = () => setValue(list.matches);
|
|
26
|
+
update();
|
|
27
|
+
list.addEventListener?.("change", update);
|
|
28
|
+
return () => list.removeEventListener?.("change", update);
|
|
29
|
+
}, [query]);
|
|
30
|
+
return value;
|
|
31
|
+
}
|
|
32
|
+
function useIsNarrow() {
|
|
33
|
+
return useMediaQuery(`(max-width: calc(${breakpoint.sm} - 0.02px))`);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export {
|
|
37
|
+
useMediaQuery,
|
|
38
|
+
useIsNarrow
|
|
39
|
+
};
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
ListSkeletonRows
|
|
4
|
+
} from "./chunk-5MM5YGGG.js";
|
|
5
|
+
import {
|
|
6
|
+
InfoPanel
|
|
7
|
+
} from "./chunk-2Q5SSNFO.js";
|
|
8
|
+
import {
|
|
9
|
+
EmptyState
|
|
10
|
+
} from "./chunk-UZ4LWR4X.js";
|
|
11
|
+
import {
|
|
12
|
+
Button
|
|
13
|
+
} from "./chunk-OWSKP527.js";
|
|
14
|
+
|
|
15
|
+
// src/web/components/query-state.tsx
|
|
16
|
+
import { useEffect, useRef, useState } from "react";
|
|
17
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
18
|
+
function defaultClassifyError(error) {
|
|
19
|
+
const message = error instanceof Error ? error.message : typeof error === "string" ? error : "Something went wrong.";
|
|
20
|
+
return { title: "Could not load", message, tone: "danger", retryable: true };
|
|
21
|
+
}
|
|
22
|
+
function QueryState({ announce, ...props }) {
|
|
23
|
+
const message = useResultAnnouncement(announce, !props.isLoading && !props.error);
|
|
24
|
+
const body = /* @__PURE__ */ jsx(QueryStateBody, { ...props });
|
|
25
|
+
if (!announce) return body;
|
|
26
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
27
|
+
/* @__PURE__ */ jsx("div", { role: "status", "aria-live": "polite", className: "sr-only", children: message }),
|
|
28
|
+
body
|
|
29
|
+
] });
|
|
30
|
+
}
|
|
31
|
+
function useResultAnnouncement(announce, settled) {
|
|
32
|
+
const [message, setMessage] = useState("");
|
|
33
|
+
const spokenFor = useRef(null);
|
|
34
|
+
const key = announce?.key;
|
|
35
|
+
const next = announce?.message ?? "";
|
|
36
|
+
useEffect(() => {
|
|
37
|
+
if (key === void 0 || !settled) return;
|
|
38
|
+
if (spokenFor.current === null) {
|
|
39
|
+
spokenFor.current = key;
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
if (spokenFor.current === key) return;
|
|
43
|
+
spokenFor.current = key;
|
|
44
|
+
setMessage(next);
|
|
45
|
+
}, [key, next, settled]);
|
|
46
|
+
return message;
|
|
47
|
+
}
|
|
48
|
+
function QueryStateBody({
|
|
49
|
+
isLoading = false,
|
|
50
|
+
error,
|
|
51
|
+
isEmpty = false,
|
|
52
|
+
children,
|
|
53
|
+
classifyError = defaultClassifyError,
|
|
54
|
+
onRetry,
|
|
55
|
+
retryLabel = "Try again",
|
|
56
|
+
errorConsequence,
|
|
57
|
+
emptyTitle = "Nothing here yet",
|
|
58
|
+
emptyDescription,
|
|
59
|
+
emptyAction,
|
|
60
|
+
skeletonRows = 3,
|
|
61
|
+
loadingLabel = "Loading",
|
|
62
|
+
errorDetail
|
|
63
|
+
}) {
|
|
64
|
+
if (isLoading) {
|
|
65
|
+
return (
|
|
66
|
+
// aria-busy, so a screen reader reports the region as loading rather than empty.
|
|
67
|
+
/* @__PURE__ */ jsx("div", { role: "status", "aria-label": loadingLabel, "aria-busy": "true", "data-slot": "query-state", "data-state": "loading", children: /* @__PURE__ */ jsx(ListSkeletonRows, { rows: skeletonRows }) })
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
if (error) {
|
|
71
|
+
const view = classifyError(error);
|
|
72
|
+
const detail = errorDetail?.(error);
|
|
73
|
+
return /* @__PURE__ */ jsxs("div", { role: "alert", "data-slot": "query-state", "data-state": "error", className: "space-y-3", children: [
|
|
74
|
+
/* @__PURE__ */ jsx(InfoPanel, { tone: view.tone, title: view.title, children: /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
|
|
75
|
+
errorConsequence && /* @__PURE__ */ jsx("p", { className: "m-0 font-semibold", children: errorConsequence }),
|
|
76
|
+
/* @__PURE__ */ jsx("p", { className: "m-0", children: view.message }),
|
|
77
|
+
view.retryable && onRetry && /* @__PURE__ */ jsx(Button, { type: "button", variant: "surface", size: "sm", onClick: onRetry, children: retryLabel })
|
|
78
|
+
] }) }),
|
|
79
|
+
detail ? /* @__PURE__ */ jsx("div", { "data-slot": "query-state-detail", className: "text-caption text-muted-foreground", children: detail }) : null
|
|
80
|
+
] });
|
|
81
|
+
}
|
|
82
|
+
if (isEmpty) {
|
|
83
|
+
return /* @__PURE__ */ jsx("div", { "data-slot": "query-state", "data-state": "empty", children: /* @__PURE__ */ jsx(EmptyState, { title: emptyTitle, description: emptyDescription, action: emptyAction }) });
|
|
84
|
+
}
|
|
85
|
+
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export {
|
|
89
|
+
defaultClassifyError,
|
|
90
|
+
QueryState
|
|
91
|
+
};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
InlineSelector
|
|
4
|
+
} from "./chunk-Z2SS7UJ4.js";
|
|
5
|
+
import {
|
|
6
|
+
IconGlyph
|
|
7
|
+
} from "./chunk-YQQ7GDLZ.js";
|
|
8
|
+
import {
|
|
9
|
+
Check,
|
|
10
|
+
ExpandMore
|
|
11
|
+
} from "./chunk-XXH4TYKZ.js";
|
|
12
|
+
import {
|
|
13
|
+
cn
|
|
14
|
+
} from "./chunk-PMGIJMRO.js";
|
|
15
|
+
|
|
16
|
+
// src/web/components/option-selector.tsx
|
|
17
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
18
|
+
function OptionSelector({
|
|
19
|
+
label,
|
|
20
|
+
value,
|
|
21
|
+
options,
|
|
22
|
+
onChange,
|
|
23
|
+
compact = false,
|
|
24
|
+
className,
|
|
25
|
+
onOpenPanelHeightChange,
|
|
26
|
+
triggerAlign = "between"
|
|
27
|
+
}) {
|
|
28
|
+
const selected = options.find((option) => option.id === value) ?? options[0];
|
|
29
|
+
return /* @__PURE__ */ jsx(
|
|
30
|
+
InlineSelector,
|
|
31
|
+
{
|
|
32
|
+
label,
|
|
33
|
+
value,
|
|
34
|
+
options,
|
|
35
|
+
onChange,
|
|
36
|
+
className: cn(compact ? "w-auto shrink-0" : "w-full", className),
|
|
37
|
+
panelClassName: "right-0 left-auto min-w-[11rem] rounded-xl bg-card/55 backdrop-blur-xl backdrop-saturate-150 bg-gradient-card",
|
|
38
|
+
optionClassName: "px-3.5 py-2.5 data-[selected]:shadow-none",
|
|
39
|
+
onOpenPanelHeightChange,
|
|
40
|
+
renderTrigger: ({ open }) => /* @__PURE__ */ jsxs(
|
|
41
|
+
"span",
|
|
42
|
+
{
|
|
43
|
+
className: cn(
|
|
44
|
+
"flex h-9 min-w-[4.5rem] items-center gap-1.5 rounded-full bg-foreground/8 px-3.5 text-body font-semibold leading-none text-foreground shadow-raised transition-all hover-gradient-violet",
|
|
45
|
+
triggerAlign === "center" ? "justify-center" : "justify-between",
|
|
46
|
+
open && "bg-secondary/20 text-secondary-content ring-1 ring-inset ring-secondary/40 shadow-glow-violet-soft hover-gradient-violet",
|
|
47
|
+
!compact && "w-full"
|
|
48
|
+
),
|
|
49
|
+
children: [
|
|
50
|
+
/* @__PURE__ */ jsx("span", { className: "truncate leading-normal", children: selected?.label }),
|
|
51
|
+
/* @__PURE__ */ jsx(
|
|
52
|
+
IconGlyph,
|
|
53
|
+
{
|
|
54
|
+
glyph: ExpandMore,
|
|
55
|
+
className: cn(
|
|
56
|
+
"shrink-0 text-icon-xs transition-transform",
|
|
57
|
+
open ? "rotate-180 text-secondary-content" : "text-muted-foreground"
|
|
58
|
+
)
|
|
59
|
+
}
|
|
60
|
+
)
|
|
61
|
+
]
|
|
62
|
+
}
|
|
63
|
+
),
|
|
64
|
+
renderOption: ({ option, selected: optionSelected }) => /* @__PURE__ */ jsxs("span", { className: "flex w-full items-center justify-between gap-3", children: [
|
|
65
|
+
/* @__PURE__ */ jsxs("span", { className: "flex min-w-0 items-center gap-2", children: [
|
|
66
|
+
option.icon && /* @__PURE__ */ jsx("span", { className: "flex size-5 shrink-0 items-center justify-center", children: option.icon }),
|
|
67
|
+
/* @__PURE__ */ jsxs("span", { className: "min-w-0", children: [
|
|
68
|
+
/* @__PURE__ */ jsx(
|
|
69
|
+
"span",
|
|
70
|
+
{
|
|
71
|
+
className: cn(
|
|
72
|
+
"block truncate text-body",
|
|
73
|
+
optionSelected ? "font-semibold text-brand" : "font-medium text-foreground"
|
|
74
|
+
),
|
|
75
|
+
children: option.label
|
|
76
|
+
}
|
|
77
|
+
),
|
|
78
|
+
option.description && /* @__PURE__ */ jsx("span", { className: "mt-0.5 block truncate text-tiny text-muted-foreground", children: option.description })
|
|
79
|
+
] })
|
|
80
|
+
] }),
|
|
81
|
+
optionSelected && /* @__PURE__ */ jsx(IconGlyph, { glyph: Check, className: "text-icon-sm text-secondary-content" })
|
|
82
|
+
] })
|
|
83
|
+
}
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export {
|
|
88
|
+
OptionSelector
|
|
89
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
Icon
|
|
4
|
+
} from "./chunk-A6MSV4MA.js";
|
|
5
|
+
import {
|
|
6
|
+
GlyphButton
|
|
7
|
+
} from "./chunk-JY3H7ZAI.js";
|
|
8
|
+
|
|
9
|
+
// src/web/primitives/icon-button.tsx
|
|
10
|
+
import * as React from "react";
|
|
11
|
+
import { jsx } from "react/jsx-runtime";
|
|
12
|
+
var IconButton = React.forwardRef(({ icon, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
13
|
+
GlyphButton,
|
|
14
|
+
{
|
|
15
|
+
ref,
|
|
16
|
+
icon: typeof icon === "string" ? /* @__PURE__ */ jsx(Icon, { name: icon, "aria-hidden": "true" }) : icon,
|
|
17
|
+
...props
|
|
18
|
+
}
|
|
19
|
+
));
|
|
20
|
+
IconButton.displayName = "IconButton";
|
|
21
|
+
|
|
22
|
+
export {
|
|
23
|
+
IconButton
|
|
24
|
+
};
|