@ship-it-ui/ui 0.0.9 → 0.0.10
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/dist/index.cjs +959 -432
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +267 -14
- package/dist/index.d.ts +267 -14
- package/dist/index.js +931 -405
- package/dist/index.js.map +1 -1
- package/package.json +26 -26
package/dist/index.js
CHANGED
|
@@ -4349,10 +4349,31 @@ Lightbox.displayName = "Lightbox";
|
|
|
4349
4349
|
|
|
4350
4350
|
// src/patterns/ListingCard/ListingCard.tsx
|
|
4351
4351
|
import { IconGlyph as IconGlyph7 } from "@ship-it-ui/icons";
|
|
4352
|
-
import {
|
|
4352
|
+
import { cva as cva11 } from "class-variance-authority";
|
|
4353
|
+
import { forwardRef as forwardRef51, useState as useState13 } from "react";
|
|
4353
4354
|
import { jsx as jsx53, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
4355
|
+
var hoverVariants = cva11("", {
|
|
4356
|
+
variants: {
|
|
4357
|
+
hoverEffect: {
|
|
4358
|
+
lift: "transition-[transform,box-shadow,border-color] duration-(--duration-micro) hover:-translate-y-px hover:shadow hover:border-border-strong",
|
|
4359
|
+
glow: "transition-[box-shadow,border-color] duration-(--duration-micro) hover:ring-[3px] hover:ring-accent-dim hover:border-accent",
|
|
4360
|
+
none: ""
|
|
4361
|
+
}
|
|
4362
|
+
}
|
|
4363
|
+
});
|
|
4364
|
+
var flagToneClass = {
|
|
4365
|
+
accent: "bg-accent-dim text-accent",
|
|
4366
|
+
purple: "bg-[color-mix(in_oklab,var(--color-purple),transparent_75%)] text-purple",
|
|
4367
|
+
pink: "bg-[color-mix(in_oklab,var(--color-pink),transparent_75%)] text-pink",
|
|
4368
|
+
ok: "bg-[color-mix(in_oklab,var(--color-ok),transparent_75%)] text-ok",
|
|
4369
|
+
warn: "bg-[color-mix(in_oklab,var(--color-warn),transparent_75%)] text-warn"
|
|
4370
|
+
};
|
|
4354
4371
|
var ListingCard = forwardRef51(function ListingCard2({
|
|
4372
|
+
variant = "default",
|
|
4355
4373
|
photos,
|
|
4374
|
+
renderPhoto,
|
|
4375
|
+
onClick,
|
|
4376
|
+
hoverEffect,
|
|
4356
4377
|
title,
|
|
4357
4378
|
eyebrow,
|
|
4358
4379
|
rating,
|
|
@@ -4360,31 +4381,50 @@ var ListingCard = forwardRef51(function ListingCard2({
|
|
|
4360
4381
|
price,
|
|
4361
4382
|
priceUnit = "/day",
|
|
4362
4383
|
originalPrice,
|
|
4384
|
+
pricePrefix,
|
|
4363
4385
|
host,
|
|
4364
4386
|
distance,
|
|
4365
4387
|
verified,
|
|
4366
4388
|
href,
|
|
4367
4389
|
onFavorite,
|
|
4368
4390
|
favorited,
|
|
4369
|
-
width = 280,
|
|
4391
|
+
width = variant === "spec" ? 320 : 280,
|
|
4392
|
+
flag,
|
|
4393
|
+
category,
|
|
4394
|
+
meta,
|
|
4395
|
+
specs,
|
|
4396
|
+
cta,
|
|
4397
|
+
hidePhotoCounter,
|
|
4398
|
+
classNames: cls = {},
|
|
4370
4399
|
className,
|
|
4371
4400
|
...props
|
|
4372
4401
|
}, ref) {
|
|
4402
|
+
const [photoIndex, setPhotoIndex] = useState13(0);
|
|
4403
|
+
const isSpec = variant === "spec";
|
|
4404
|
+
const stretchedLinkSupported = !isSpec || !cta && !!href;
|
|
4405
|
+
const isInteractive = Boolean(onClick) || Boolean(href);
|
|
4406
|
+
const effectiveHover = hoverEffect ?? (isInteractive ? "lift" : "none");
|
|
4407
|
+
const hoverClass = hoverVariants({ hoverEffect: effectiveHover });
|
|
4373
4408
|
return /* @__PURE__ */ jsxs46(
|
|
4374
4409
|
Card,
|
|
4375
4410
|
{
|
|
4376
4411
|
ref,
|
|
4377
|
-
className: cn("relative overflow-hidden !p-0", className),
|
|
4412
|
+
className: cn("relative isolate overflow-hidden !p-0", hoverClass, cls.root, className),
|
|
4378
4413
|
style: { width },
|
|
4379
4414
|
...props,
|
|
4380
4415
|
children: [
|
|
4381
|
-
/* @__PURE__ */ jsxs46("div", { className: "relative", children: [
|
|
4416
|
+
/* @__PURE__ */ jsxs46("div", { className: cn("relative", cls.photos), children: [
|
|
4382
4417
|
/* @__PURE__ */ jsx53(
|
|
4383
4418
|
Carousel,
|
|
4384
4419
|
{
|
|
4385
4420
|
items: photos,
|
|
4421
|
+
...isSpec ? {
|
|
4422
|
+
index: photoIndex,
|
|
4423
|
+
onIndexChange: setPhotoIndex,
|
|
4424
|
+
showDots: false
|
|
4425
|
+
} : {},
|
|
4386
4426
|
"aria-label": typeof title === "string" ? `${title} photos` : "Listing photos",
|
|
4387
|
-
renderItem: (src) => /* @__PURE__ */ jsx53(
|
|
4427
|
+
renderItem: (src, i) => renderPhoto ? renderPhoto(src, i) : /* @__PURE__ */ jsx53(
|
|
4388
4428
|
"img",
|
|
4389
4429
|
{
|
|
4390
4430
|
src,
|
|
@@ -4395,15 +4435,133 @@ var ListingCard = forwardRef51(function ListingCard2({
|
|
|
4395
4435
|
)
|
|
4396
4436
|
}
|
|
4397
4437
|
),
|
|
4398
|
-
verified && /* @__PURE__ */ jsx53("div", { className: "pointer-events-none absolute top-3 left-3 z-10", children: /* @__PURE__ */ jsxs46(Badge, { variant: "ok", size: "sm", children: [
|
|
4438
|
+
!isSpec && verified && /* @__PURE__ */ jsx53("div", { className: "pointer-events-none absolute top-3 left-3 z-10", children: /* @__PURE__ */ jsxs46(Badge, { variant: "ok", size: "sm", children: [
|
|
4399
4439
|
/* @__PURE__ */ jsx53(IconGlyph7, { name: "verified", size: 11 }),
|
|
4400
4440
|
" Verified host"
|
|
4401
|
-
] }) })
|
|
4441
|
+
] }) }),
|
|
4442
|
+
isSpec && flag && /* @__PURE__ */ jsx53("div", { className: "pointer-events-none absolute top-3 left-3 z-10", children: /* @__PURE__ */ jsxs46(
|
|
4443
|
+
"span",
|
|
4444
|
+
{
|
|
4445
|
+
className: cn(
|
|
4446
|
+
"inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-medium backdrop-blur",
|
|
4447
|
+
flagToneClass[flag.tone ?? "accent"],
|
|
4448
|
+
cls.flag
|
|
4449
|
+
),
|
|
4450
|
+
children: [
|
|
4451
|
+
flag.icon && /* @__PURE__ */ jsx53(IconGlyph7, { name: flag.icon, size: 11 }),
|
|
4452
|
+
flag.label
|
|
4453
|
+
]
|
|
4454
|
+
}
|
|
4455
|
+
) }),
|
|
4456
|
+
isSpec && !hidePhotoCounter && photos.length > 1 && /* @__PURE__ */ jsxs46(
|
|
4457
|
+
"div",
|
|
4458
|
+
{
|
|
4459
|
+
"aria-hidden": true,
|
|
4460
|
+
className: cn(
|
|
4461
|
+
"pointer-events-none absolute top-3 right-3 z-10 rounded-full bg-black/55 px-2.5 py-1 font-mono text-[11px] text-white backdrop-blur",
|
|
4462
|
+
cls.photoCounter
|
|
4463
|
+
),
|
|
4464
|
+
children: [
|
|
4465
|
+
photoIndex + 1,
|
|
4466
|
+
" / ",
|
|
4467
|
+
photos.length
|
|
4468
|
+
]
|
|
4469
|
+
}
|
|
4470
|
+
)
|
|
4402
4471
|
] }),
|
|
4403
|
-
/* @__PURE__ */ jsxs46("div", { className: "flex flex-col
|
|
4404
|
-
|
|
4405
|
-
|
|
4406
|
-
|
|
4472
|
+
isSpec ? /* @__PURE__ */ jsxs46("div", { className: cn("flex flex-col", cls.body), children: [
|
|
4473
|
+
/* @__PURE__ */ jsxs46("div", { className: cn("flex flex-col gap-2 p-4 pb-3", cls.header), children: [
|
|
4474
|
+
/* @__PURE__ */ jsxs46("div", { className: "flex items-start justify-between gap-2", children: [
|
|
4475
|
+
/* @__PURE__ */ jsx53("span", { className: cn("text-text text-[15px] leading-snug font-semibold", cls.title), children: title }),
|
|
4476
|
+
category && /* @__PURE__ */ jsx53(
|
|
4477
|
+
"span",
|
|
4478
|
+
{
|
|
4479
|
+
className: cn(
|
|
4480
|
+
"border-border bg-panel-2 text-text-muted shrink-0 rounded-full border px-2 py-0.5 text-[10px] tracking-wide uppercase",
|
|
4481
|
+
cls.category
|
|
4482
|
+
),
|
|
4483
|
+
children: category
|
|
4484
|
+
}
|
|
4485
|
+
)
|
|
4486
|
+
] }),
|
|
4487
|
+
meta && /* @__PURE__ */ jsx53("span", { className: cn("text-text-dim font-mono text-[11px] tracking-wide", cls.meta), children: meta }),
|
|
4488
|
+
specs && specs.length > 0 && /* @__PURE__ */ jsx53(
|
|
4489
|
+
"dl",
|
|
4490
|
+
{
|
|
4491
|
+
className: cn(
|
|
4492
|
+
"border-border mt-1 grid gap-2 border-t pt-3",
|
|
4493
|
+
specs.length === 2 && "grid-cols-2",
|
|
4494
|
+
specs.length === 3 && "grid-cols-3",
|
|
4495
|
+
specs.length >= 4 && "grid-cols-4",
|
|
4496
|
+
cls.specs
|
|
4497
|
+
),
|
|
4498
|
+
children: specs.map((s, i) => /* @__PURE__ */ jsxs46("div", { className: cn("flex flex-col gap-0.5", cls.specCell), children: [
|
|
4499
|
+
/* @__PURE__ */ jsx53(
|
|
4500
|
+
"dt",
|
|
4501
|
+
{
|
|
4502
|
+
className: cn(
|
|
4503
|
+
"text-text-dim text-[10px] tracking-wider uppercase",
|
|
4504
|
+
cls.specLabel
|
|
4505
|
+
),
|
|
4506
|
+
children: s.label
|
|
4507
|
+
}
|
|
4508
|
+
),
|
|
4509
|
+
/* @__PURE__ */ jsx53("dd", { className: cn("text-text text-[13px] font-medium", cls.specValue), children: s.value })
|
|
4510
|
+
] }, i))
|
|
4511
|
+
}
|
|
4512
|
+
)
|
|
4513
|
+
] }),
|
|
4514
|
+
/* @__PURE__ */ jsxs46(
|
|
4515
|
+
"div",
|
|
4516
|
+
{
|
|
4517
|
+
className: cn(
|
|
4518
|
+
"border-border bg-panel-2 relative z-10 flex items-center justify-between gap-2 border-t px-4 py-3",
|
|
4519
|
+
cls.footer
|
|
4520
|
+
),
|
|
4521
|
+
children: [
|
|
4522
|
+
/* @__PURE__ */ jsx53("div", { className: "flex flex-col leading-tight", children: /* @__PURE__ */ jsxs46("div", { className: "flex items-baseline gap-1.5", children: [
|
|
4523
|
+
pricePrefix && /* @__PURE__ */ jsx53("span", { className: "text-text-dim text-[11px]", children: pricePrefix }),
|
|
4524
|
+
originalPrice && /* @__PURE__ */ jsx53("span", { className: "text-text-dim decoration-sale text-[11px] line-through", children: originalPrice }),
|
|
4525
|
+
/* @__PURE__ */ jsx53("span", { className: cn("text-text text-[15px] font-semibold", cls.price), children: price }),
|
|
4526
|
+
/* @__PURE__ */ jsx53("span", { className: cn("text-text-dim text-[11px]", cls.priceUnit), children: priceUnit })
|
|
4527
|
+
] }) }),
|
|
4528
|
+
cta && (cta.href ? /* @__PURE__ */ jsx53(
|
|
4529
|
+
Button,
|
|
4530
|
+
{
|
|
4531
|
+
asChild: true,
|
|
4532
|
+
variant: "primary",
|
|
4533
|
+
size: "sm",
|
|
4534
|
+
disabled: cta.disabled,
|
|
4535
|
+
className: cls.cta,
|
|
4536
|
+
children: /* @__PURE__ */ jsx53("a", { href: cta.href, onClick: cta.onClick, children: cta.label })
|
|
4537
|
+
}
|
|
4538
|
+
) : /* @__PURE__ */ jsx53(
|
|
4539
|
+
Button,
|
|
4540
|
+
{
|
|
4541
|
+
variant: "primary",
|
|
4542
|
+
size: "sm",
|
|
4543
|
+
onClick: cta.onClick,
|
|
4544
|
+
disabled: cta.disabled,
|
|
4545
|
+
className: cls.cta,
|
|
4546
|
+
children: cta.label
|
|
4547
|
+
}
|
|
4548
|
+
))
|
|
4549
|
+
]
|
|
4550
|
+
}
|
|
4551
|
+
)
|
|
4552
|
+
] }) : /* @__PURE__ */ jsxs46("div", { className: cn("flex flex-col gap-1 p-3", cls.body), children: [
|
|
4553
|
+
eyebrow && /* @__PURE__ */ jsx53(
|
|
4554
|
+
"span",
|
|
4555
|
+
{
|
|
4556
|
+
className: cn(
|
|
4557
|
+
"text-text-dim font-mono text-[10px] tracking-wide uppercase",
|
|
4558
|
+
cls.eyebrow
|
|
4559
|
+
),
|
|
4560
|
+
children: eyebrow
|
|
4561
|
+
}
|
|
4562
|
+
),
|
|
4563
|
+
/* @__PURE__ */ jsxs46("div", { className: cn("flex items-start justify-between gap-2", cls.header), children: [
|
|
4564
|
+
/* @__PURE__ */ jsx53("span", { className: cn("text-text text-[14px] leading-snug font-semibold", cls.title), children: title }),
|
|
4407
4565
|
rating !== void 0 && /* @__PURE__ */ jsxs46("span", { className: "inline-flex shrink-0 items-center gap-1 text-[12px]", children: [
|
|
4408
4566
|
/* @__PURE__ */ jsx53(IconGlyph7, { name: "star", size: 12, className: "text-rating" }),
|
|
4409
4567
|
/* @__PURE__ */ jsx53("span", { className: "text-text font-medium", children: rating.toFixed(1) }),
|
|
@@ -4414,19 +4572,29 @@ var ListingCard = forwardRef51(function ListingCard2({
|
|
|
4414
4572
|
] })
|
|
4415
4573
|
] })
|
|
4416
4574
|
] }),
|
|
4417
|
-
(host || distance) && /* @__PURE__ */ jsxs46("div", { className: "text-text-dim flex items-center gap-2 text-[12px]", children: [
|
|
4575
|
+
(host || distance) && /* @__PURE__ */ jsxs46("div", { className: cn("text-text-dim flex items-center gap-2 text-[12px]", cls.meta), children: [
|
|
4418
4576
|
host && /* @__PURE__ */ jsx53("span", { children: host }),
|
|
4419
4577
|
host && distance && /* @__PURE__ */ jsx53("span", { "aria-hidden": true, children: "\xB7" }),
|
|
4420
4578
|
distance && /* @__PURE__ */ jsx53("span", { children: distance })
|
|
4421
4579
|
] }),
|
|
4422
|
-
/* @__PURE__ */ jsxs46("div", { className: "mt-2 flex items-baseline gap-2", children: [
|
|
4580
|
+
/* @__PURE__ */ jsxs46("div", { className: cn("mt-2 flex items-baseline gap-2", cls.footer), children: [
|
|
4423
4581
|
originalPrice && /* @__PURE__ */ jsx53("span", { className: "text-text-dim decoration-sale text-[12px] line-through", children: originalPrice }),
|
|
4424
|
-
/* @__PURE__ */ jsx53("span", { className: "text-text text-[15px] font-semibold", children: price }),
|
|
4425
|
-
/* @__PURE__ */ jsx53("span", { className: "text-text-dim text-[12px]", children: priceUnit })
|
|
4582
|
+
/* @__PURE__ */ jsx53("span", { className: cn("text-text text-[15px] font-semibold", cls.price), children: price }),
|
|
4583
|
+
/* @__PURE__ */ jsx53("span", { className: cn("text-text-dim text-[12px]", cls.priceUnit), children: priceUnit })
|
|
4426
4584
|
] }),
|
|
4427
|
-
rating !== void 0 && /* @__PURE__ */ jsx53(
|
|
4585
|
+
rating !== void 0 && /* @__PURE__ */ jsx53(
|
|
4586
|
+
Rating,
|
|
4587
|
+
{
|
|
4588
|
+
value: rating,
|
|
4589
|
+
max: 5,
|
|
4590
|
+
precision: "half",
|
|
4591
|
+
size: "sm",
|
|
4592
|
+
readOnly: true,
|
|
4593
|
+
className: "sr-only"
|
|
4594
|
+
}
|
|
4595
|
+
)
|
|
4428
4596
|
] }),
|
|
4429
|
-
href && /* @__PURE__ */ jsx53(
|
|
4597
|
+
href && stretchedLinkSupported && !onClick && /* @__PURE__ */ jsx53(
|
|
4430
4598
|
"a",
|
|
4431
4599
|
{
|
|
4432
4600
|
href,
|
|
@@ -4434,7 +4602,16 @@ var ListingCard = forwardRef51(function ListingCard2({
|
|
|
4434
4602
|
className: "absolute inset-0 z-0 no-underline"
|
|
4435
4603
|
}
|
|
4436
4604
|
),
|
|
4437
|
-
|
|
4605
|
+
onClick && /* @__PURE__ */ jsx53(
|
|
4606
|
+
"button",
|
|
4607
|
+
{
|
|
4608
|
+
type: "button",
|
|
4609
|
+
onClick,
|
|
4610
|
+
"aria-label": typeof title === "string" ? `View ${title}` : "View listing",
|
|
4611
|
+
className: "focus-visible:ring-accent-dim absolute inset-0 z-0 cursor-pointer bg-transparent outline-none focus-visible:ring-[3px]"
|
|
4612
|
+
}
|
|
4613
|
+
),
|
|
4614
|
+
!isSpec && onFavorite && /* @__PURE__ */ jsx53(
|
|
4438
4615
|
"button",
|
|
4439
4616
|
{
|
|
4440
4617
|
type: "button",
|
|
@@ -4444,7 +4621,8 @@ var ListingCard = forwardRef51(function ListingCard2({
|
|
|
4444
4621
|
className: cn(
|
|
4445
4622
|
"absolute top-3 right-3 z-20 inline-grid h-8 w-8 cursor-pointer place-items-center rounded-full",
|
|
4446
4623
|
"bg-panel/85 hover:bg-panel border-border border shadow-sm backdrop-blur",
|
|
4447
|
-
favorited ? "text-err" : "text-text-dim hover:text-text"
|
|
4624
|
+
favorited ? "text-err" : "text-text-dim hover:text-text",
|
|
4625
|
+
cls.favorite
|
|
4448
4626
|
),
|
|
4449
4627
|
children: /* @__PURE__ */ jsx53(IconGlyph7, { name: "heart", size: 16 })
|
|
4450
4628
|
}
|
|
@@ -4455,8 +4633,355 @@ var ListingCard = forwardRef51(function ListingCard2({
|
|
|
4455
4633
|
});
|
|
4456
4634
|
ListingCard.displayName = "ListingCard";
|
|
4457
4635
|
|
|
4636
|
+
// src/patterns/ListingDetail/ListingDetail.tsx
|
|
4637
|
+
import * as RadixDialog6 from "@radix-ui/react-dialog";
|
|
4638
|
+
import { IconGlyph as IconGlyph8 } from "@ship-it-ui/icons";
|
|
4639
|
+
import { forwardRef as forwardRef52, useState as useState14 } from "react";
|
|
4640
|
+
import { jsx as jsx54, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
4641
|
+
function renderAction(action, variant) {
|
|
4642
|
+
if (action.href) {
|
|
4643
|
+
return /* @__PURE__ */ jsx54(Button, { asChild: true, variant, disabled: action.disabled, children: /* @__PURE__ */ jsx54("a", { href: action.href, onClick: action.onClick, children: action.label }) });
|
|
4644
|
+
}
|
|
4645
|
+
return /* @__PURE__ */ jsx54(Button, { variant, onClick: action.onClick, disabled: action.disabled, children: action.label });
|
|
4646
|
+
}
|
|
4647
|
+
var flagToneClass2 = {
|
|
4648
|
+
accent: "bg-accent-dim text-accent",
|
|
4649
|
+
purple: "bg-[color-mix(in_oklab,var(--color-purple),transparent_75%)] text-purple",
|
|
4650
|
+
pink: "bg-[color-mix(in_oklab,var(--color-pink),transparent_75%)] text-pink",
|
|
4651
|
+
ok: "bg-[color-mix(in_oklab,var(--color-ok),transparent_75%)] text-ok",
|
|
4652
|
+
warn: "bg-[color-mix(in_oklab,var(--color-warn),transparent_75%)] text-warn"
|
|
4653
|
+
};
|
|
4654
|
+
var ListingDetail = forwardRef52(function ListingDetail2({
|
|
4655
|
+
variant = "default",
|
|
4656
|
+
open,
|
|
4657
|
+
defaultOpen,
|
|
4658
|
+
onOpenChange,
|
|
4659
|
+
photos,
|
|
4660
|
+
renderPhoto,
|
|
4661
|
+
title,
|
|
4662
|
+
eyebrow,
|
|
4663
|
+
description,
|
|
4664
|
+
rating,
|
|
4665
|
+
reviewCount,
|
|
4666
|
+
price,
|
|
4667
|
+
priceUnit = "/day",
|
|
4668
|
+
originalPrice,
|
|
4669
|
+
pricePrefix,
|
|
4670
|
+
host,
|
|
4671
|
+
features,
|
|
4672
|
+
primaryAction,
|
|
4673
|
+
secondaryAction,
|
|
4674
|
+
flag,
|
|
4675
|
+
category,
|
|
4676
|
+
meta,
|
|
4677
|
+
specs,
|
|
4678
|
+
cta,
|
|
4679
|
+
hidePhotoCounter,
|
|
4680
|
+
classNames: cls = {}
|
|
4681
|
+
}, ref) {
|
|
4682
|
+
const [galleryIndex, setGalleryIndex] = useState14(0);
|
|
4683
|
+
const [lightboxOpen, setLightboxOpen] = useState14(false);
|
|
4684
|
+
const isSpec = variant === "spec";
|
|
4685
|
+
const lightboxTitle = typeof title === "string" ? `${title} photos` : "Listing photos";
|
|
4686
|
+
return /* @__PURE__ */ jsxs47(RadixDialog6.Root, { open, defaultOpen, onOpenChange, children: [
|
|
4687
|
+
/* @__PURE__ */ jsxs47(RadixDialog6.Portal, { children: [
|
|
4688
|
+
/* @__PURE__ */ jsx54(
|
|
4689
|
+
RadixDialog6.Overlay,
|
|
4690
|
+
{
|
|
4691
|
+
className: cn(
|
|
4692
|
+
"z-overlay fixed inset-0 bg-black/55 backdrop-blur-[4px]",
|
|
4693
|
+
"data-[state=open]:animate-[ship-fade-in_150ms_ease]",
|
|
4694
|
+
cls.overlay
|
|
4695
|
+
)
|
|
4696
|
+
}
|
|
4697
|
+
),
|
|
4698
|
+
/* @__PURE__ */ jsxs47(
|
|
4699
|
+
RadixDialog6.Content,
|
|
4700
|
+
{
|
|
4701
|
+
ref,
|
|
4702
|
+
...description ? {} : { "aria-describedby": void 0 },
|
|
4703
|
+
className: cn(
|
|
4704
|
+
"z-modal fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2",
|
|
4705
|
+
"w-[calc(100%-32px)] max-w-[960px]",
|
|
4706
|
+
"max-h-[min(92vh,820px)] overflow-hidden",
|
|
4707
|
+
"bg-panel border-border-strong rounded-lg border shadow-lg outline-none",
|
|
4708
|
+
"data-[state=open]:animate-[ship-dialog-in_180ms_var(--easing-out)]",
|
|
4709
|
+
"flex flex-col",
|
|
4710
|
+
cls.content
|
|
4711
|
+
),
|
|
4712
|
+
children: [
|
|
4713
|
+
/* @__PURE__ */ jsxs47(
|
|
4714
|
+
"div",
|
|
4715
|
+
{
|
|
4716
|
+
className: cn(
|
|
4717
|
+
"grid grid-cols-1 gap-6 overflow-y-auto p-6 md:grid-cols-[1.1fr_1fr]",
|
|
4718
|
+
isSpec && cta && "pb-4",
|
|
4719
|
+
cls.grid
|
|
4720
|
+
),
|
|
4721
|
+
children: [
|
|
4722
|
+
/* @__PURE__ */ jsxs47("div", { className: cn("flex flex-col gap-3", cls.photos), children: [
|
|
4723
|
+
/* @__PURE__ */ jsxs47("div", { className: "relative overflow-hidden rounded-md", children: [
|
|
4724
|
+
/* @__PURE__ */ jsx54(
|
|
4725
|
+
Carousel,
|
|
4726
|
+
{
|
|
4727
|
+
items: photos,
|
|
4728
|
+
index: galleryIndex,
|
|
4729
|
+
onIndexChange: setGalleryIndex,
|
|
4730
|
+
...isSpec ? { showDots: false } : {},
|
|
4731
|
+
"aria-label": typeof title === "string" ? `${title} photos` : "Listing photos",
|
|
4732
|
+
renderItem: (src, i) => renderPhoto ? renderPhoto(src, i, "gallery") : /* @__PURE__ */ jsx54(
|
|
4733
|
+
"img",
|
|
4734
|
+
{
|
|
4735
|
+
src,
|
|
4736
|
+
alt: "",
|
|
4737
|
+
className: "block h-full w-full object-cover",
|
|
4738
|
+
loading: "lazy"
|
|
4739
|
+
}
|
|
4740
|
+
)
|
|
4741
|
+
}
|
|
4742
|
+
),
|
|
4743
|
+
isSpec && flag ? /* @__PURE__ */ jsx54("div", { className: "pointer-events-none absolute top-3 left-3 z-10", children: /* @__PURE__ */ jsxs47(
|
|
4744
|
+
"span",
|
|
4745
|
+
{
|
|
4746
|
+
className: cn(
|
|
4747
|
+
"inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-medium backdrop-blur",
|
|
4748
|
+
flagToneClass2[flag.tone ?? "accent"],
|
|
4749
|
+
cls.flag
|
|
4750
|
+
),
|
|
4751
|
+
children: [
|
|
4752
|
+
flag.icon && /* @__PURE__ */ jsx54(IconGlyph8, { name: flag.icon, size: 11 }),
|
|
4753
|
+
flag.label
|
|
4754
|
+
]
|
|
4755
|
+
}
|
|
4756
|
+
) }) : null,
|
|
4757
|
+
/* @__PURE__ */ jsx54(
|
|
4758
|
+
"button",
|
|
4759
|
+
{
|
|
4760
|
+
type: "button",
|
|
4761
|
+
onClick: () => setLightboxOpen(true),
|
|
4762
|
+
"aria-label": "Open photo viewer",
|
|
4763
|
+
className: cn(
|
|
4764
|
+
"bg-panel/85 hover:bg-panel border-border text-text-muted hover:text-text focus-visible:ring-accent-dim absolute z-10 inline-grid h-8 w-8 cursor-pointer place-items-center rounded-full border shadow-sm backdrop-blur outline-none focus-visible:ring-[3px]",
|
|
4765
|
+
isSpec ? "right-3 bottom-3" : "top-3 left-3"
|
|
4766
|
+
),
|
|
4767
|
+
children: /* @__PURE__ */ jsx54(IconGlyph8, { name: "maximize", size: 14 })
|
|
4768
|
+
}
|
|
4769
|
+
),
|
|
4770
|
+
isSpec && !hidePhotoCounter && photos.length > 1 && /* @__PURE__ */ jsxs47(
|
|
4771
|
+
"div",
|
|
4772
|
+
{
|
|
4773
|
+
"aria-hidden": true,
|
|
4774
|
+
className: cn(
|
|
4775
|
+
"pointer-events-none absolute top-3 right-3 z-10 rounded-full bg-black/55 px-2.5 py-1 font-mono text-[11px] text-white backdrop-blur",
|
|
4776
|
+
cls.photoCounter
|
|
4777
|
+
),
|
|
4778
|
+
children: [
|
|
4779
|
+
galleryIndex + 1,
|
|
4780
|
+
" / ",
|
|
4781
|
+
photos.length
|
|
4782
|
+
]
|
|
4783
|
+
}
|
|
4784
|
+
)
|
|
4785
|
+
] }),
|
|
4786
|
+
!isSpec && features && features.length > 0 && /* @__PURE__ */ jsx54("ul", { className: cn("flex flex-wrap gap-2", cls.features), children: features.map((f, i) => /* @__PURE__ */ jsxs47(
|
|
4787
|
+
"li",
|
|
4788
|
+
{
|
|
4789
|
+
className: "border-border bg-panel-2 text-text-muted inline-flex items-center gap-1.5 rounded-full border px-2.5 py-1 text-[12px]",
|
|
4790
|
+
children: [
|
|
4791
|
+
/* @__PURE__ */ jsx54(IconGlyph8, { name: f.icon, size: 12 }),
|
|
4792
|
+
f.label
|
|
4793
|
+
]
|
|
4794
|
+
},
|
|
4795
|
+
i
|
|
4796
|
+
)) })
|
|
4797
|
+
] }),
|
|
4798
|
+
/* @__PURE__ */ jsxs47("div", { className: cn("flex flex-col gap-4", cls.info), children: [
|
|
4799
|
+
/* @__PURE__ */ jsxs47("header", { className: cn("flex flex-col gap-1.5", cls.header), children: [
|
|
4800
|
+
eyebrow && !isSpec && /* @__PURE__ */ jsx54("span", { className: "text-text-dim font-mono text-[10px] tracking-wide uppercase", children: eyebrow }),
|
|
4801
|
+
/* @__PURE__ */ jsxs47("div", { className: "flex items-start justify-between gap-3", children: [
|
|
4802
|
+
/* @__PURE__ */ jsx54(RadixDialog6.Title, { asChild: true, children: /* @__PURE__ */ jsx54(
|
|
4803
|
+
"h2",
|
|
4804
|
+
{
|
|
4805
|
+
className: cn("text-text text-[22px] leading-tight font-semibold", cls.title),
|
|
4806
|
+
children: title
|
|
4807
|
+
}
|
|
4808
|
+
) }),
|
|
4809
|
+
isSpec && category && /* @__PURE__ */ jsx54(
|
|
4810
|
+
"span",
|
|
4811
|
+
{
|
|
4812
|
+
className: cn(
|
|
4813
|
+
"border-border bg-panel-2 text-text-muted mt-1 shrink-0 rounded-full border px-2 py-0.5 text-[10px] tracking-wide uppercase",
|
|
4814
|
+
cls.category
|
|
4815
|
+
),
|
|
4816
|
+
children: category
|
|
4817
|
+
}
|
|
4818
|
+
)
|
|
4819
|
+
] }),
|
|
4820
|
+
isSpec && meta && /* @__PURE__ */ jsx54(
|
|
4821
|
+
"span",
|
|
4822
|
+
{
|
|
4823
|
+
className: cn("text-text-dim font-mono text-[12px] tracking-wide", cls.meta),
|
|
4824
|
+
children: meta
|
|
4825
|
+
}
|
|
4826
|
+
),
|
|
4827
|
+
rating !== void 0 && /* @__PURE__ */ jsxs47("div", { className: "text-text-muted mt-1 flex items-center gap-2 text-[13px]", children: [
|
|
4828
|
+
/* @__PURE__ */ jsx54(IconGlyph8, { name: "star", size: 13, className: "text-rating" }),
|
|
4829
|
+
/* @__PURE__ */ jsx54("span", { className: "text-text font-medium", children: rating.toFixed(2) }),
|
|
4830
|
+
reviewCount !== void 0 && /* @__PURE__ */ jsxs47("span", { children: [
|
|
4831
|
+
"(",
|
|
4832
|
+
reviewCount,
|
|
4833
|
+
" reviews)"
|
|
4834
|
+
] }),
|
|
4835
|
+
/* @__PURE__ */ jsx54(
|
|
4836
|
+
Rating,
|
|
4837
|
+
{
|
|
4838
|
+
value: rating,
|
|
4839
|
+
max: 5,
|
|
4840
|
+
precision: "half",
|
|
4841
|
+
size: "sm",
|
|
4842
|
+
readOnly: true,
|
|
4843
|
+
className: "sr-only"
|
|
4844
|
+
}
|
|
4845
|
+
)
|
|
4846
|
+
] })
|
|
4847
|
+
] }),
|
|
4848
|
+
isSpec && specs && specs.length > 0 && /* @__PURE__ */ jsx54(
|
|
4849
|
+
"dl",
|
|
4850
|
+
{
|
|
4851
|
+
className: cn(
|
|
4852
|
+
"border-border grid grid-cols-2 gap-3 border-t pt-4 sm:grid-cols-3",
|
|
4853
|
+
cls.specs
|
|
4854
|
+
),
|
|
4855
|
+
children: specs.map((s, i) => /* @__PURE__ */ jsxs47("div", { className: cn("flex flex-col gap-0.5", cls.specCell), children: [
|
|
4856
|
+
/* @__PURE__ */ jsx54(
|
|
4857
|
+
"dt",
|
|
4858
|
+
{
|
|
4859
|
+
className: cn(
|
|
4860
|
+
"text-text-dim text-[10px] tracking-wider uppercase",
|
|
4861
|
+
cls.specLabel
|
|
4862
|
+
),
|
|
4863
|
+
children: s.label
|
|
4864
|
+
}
|
|
4865
|
+
),
|
|
4866
|
+
/* @__PURE__ */ jsx54("dd", { className: cn("text-text text-[15px] font-semibold", cls.specValue), children: s.value })
|
|
4867
|
+
] }, i))
|
|
4868
|
+
}
|
|
4869
|
+
),
|
|
4870
|
+
host && /* @__PURE__ */ jsxs47(
|
|
4871
|
+
"div",
|
|
4872
|
+
{
|
|
4873
|
+
className: cn("border-border flex items-center gap-3 border-t pt-4", cls.host),
|
|
4874
|
+
children: [
|
|
4875
|
+
/* @__PURE__ */ jsx54(
|
|
4876
|
+
Avatar,
|
|
4877
|
+
{
|
|
4878
|
+
size: "md",
|
|
4879
|
+
name: typeof host.name === "string" ? host.name : "Host",
|
|
4880
|
+
src: host.avatarUrl
|
|
4881
|
+
}
|
|
4882
|
+
),
|
|
4883
|
+
/* @__PURE__ */ jsxs47("div", { className: "flex flex-col", children: [
|
|
4884
|
+
/* @__PURE__ */ jsxs47("div", { className: "text-text inline-flex items-center gap-1.5 text-[13px] font-medium", children: [
|
|
4885
|
+
/* @__PURE__ */ jsxs47("span", { children: [
|
|
4886
|
+
"Hosted by ",
|
|
4887
|
+
host.name
|
|
4888
|
+
] }),
|
|
4889
|
+
host.verified && /* @__PURE__ */ jsxs47(Badge, { variant: "ok", size: "sm", children: [
|
|
4890
|
+
/* @__PURE__ */ jsx54(IconGlyph8, { name: "verified", size: 11 }),
|
|
4891
|
+
" Verified"
|
|
4892
|
+
] })
|
|
4893
|
+
] }),
|
|
4894
|
+
host.meta && /* @__PURE__ */ jsx54("span", { className: "text-text-dim text-[12px]", children: host.meta })
|
|
4895
|
+
] })
|
|
4896
|
+
]
|
|
4897
|
+
}
|
|
4898
|
+
),
|
|
4899
|
+
description && /* @__PURE__ */ jsx54(RadixDialog6.Description, { asChild: true, children: /* @__PURE__ */ jsx54("p", { className: cn("text-text-muted text-[13px] leading-[1.6]", cls.description), children: description }) }),
|
|
4900
|
+
!isSpec && /* @__PURE__ */ jsxs47(
|
|
4901
|
+
"div",
|
|
4902
|
+
{
|
|
4903
|
+
className: cn(
|
|
4904
|
+
"border-border mt-auto flex flex-col gap-3 border-t pt-4",
|
|
4905
|
+
cls.footer
|
|
4906
|
+
),
|
|
4907
|
+
children: [
|
|
4908
|
+
/* @__PURE__ */ jsxs47("div", { className: "flex items-baseline gap-2", children: [
|
|
4909
|
+
originalPrice && /* @__PURE__ */ jsx54("span", { className: "text-text-dim decoration-sale text-[13px] line-through", children: originalPrice }),
|
|
4910
|
+
/* @__PURE__ */ jsx54("span", { className: cn("text-text text-[22px] font-semibold", cls.price), children: price }),
|
|
4911
|
+
/* @__PURE__ */ jsx54("span", { className: cn("text-text-dim text-[13px]", cls.priceUnit), children: priceUnit })
|
|
4912
|
+
] }),
|
|
4913
|
+
(primaryAction || secondaryAction) && /* @__PURE__ */ jsxs47("div", { className: "flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-end", children: [
|
|
4914
|
+
secondaryAction && renderAction(secondaryAction, "ghost"),
|
|
4915
|
+
primaryAction && renderAction(primaryAction, "primary")
|
|
4916
|
+
] })
|
|
4917
|
+
]
|
|
4918
|
+
}
|
|
4919
|
+
)
|
|
4920
|
+
] })
|
|
4921
|
+
]
|
|
4922
|
+
}
|
|
4923
|
+
),
|
|
4924
|
+
isSpec && (cta || price) && /* @__PURE__ */ jsxs47(
|
|
4925
|
+
"div",
|
|
4926
|
+
{
|
|
4927
|
+
className: cn(
|
|
4928
|
+
"border-border bg-panel-2 flex items-center justify-between gap-3 border-t px-6 py-4",
|
|
4929
|
+
cls.footer
|
|
4930
|
+
),
|
|
4931
|
+
children: [
|
|
4932
|
+
/* @__PURE__ */ jsxs47("div", { className: "flex items-baseline gap-2", children: [
|
|
4933
|
+
pricePrefix && /* @__PURE__ */ jsx54("span", { className: "text-text-dim text-[12px]", children: pricePrefix }),
|
|
4934
|
+
originalPrice && /* @__PURE__ */ jsx54("span", { className: "text-text-dim decoration-sale text-[13px] line-through", children: originalPrice }),
|
|
4935
|
+
/* @__PURE__ */ jsx54("span", { className: cn("text-text text-[20px] font-semibold", cls.price), children: price }),
|
|
4936
|
+
/* @__PURE__ */ jsx54("span", { className: cn("text-text-dim text-[13px]", cls.priceUnit), children: priceUnit })
|
|
4937
|
+
] }),
|
|
4938
|
+
cta && (cta.href ? /* @__PURE__ */ jsx54(Button, { asChild: true, variant: "primary", disabled: cta.disabled, className: cls.cta, children: /* @__PURE__ */ jsx54("a", { href: cta.href, onClick: cta.onClick, children: cta.label }) }) : /* @__PURE__ */ jsx54(
|
|
4939
|
+
Button,
|
|
4940
|
+
{
|
|
4941
|
+
variant: "primary",
|
|
4942
|
+
onClick: cta.onClick,
|
|
4943
|
+
disabled: cta.disabled,
|
|
4944
|
+
className: cls.cta,
|
|
4945
|
+
children: cta.label
|
|
4946
|
+
}
|
|
4947
|
+
))
|
|
4948
|
+
]
|
|
4949
|
+
}
|
|
4950
|
+
),
|
|
4951
|
+
/* @__PURE__ */ jsx54(RadixDialog6.Close, { asChild: true, children: /* @__PURE__ */ jsx54(
|
|
4952
|
+
"button",
|
|
4953
|
+
{
|
|
4954
|
+
type: "button",
|
|
4955
|
+
"aria-label": "Close listing details",
|
|
4956
|
+
className: cn(
|
|
4957
|
+
"bg-panel-2 hover:bg-panel-2/80 text-text-muted hover:text-text border-border focus-visible:ring-accent-dim absolute top-3 right-3 inline-grid h-9 w-9 cursor-pointer place-items-center rounded-full border outline-none focus-visible:ring-[3px]",
|
|
4958
|
+
cls.close
|
|
4959
|
+
),
|
|
4960
|
+
children: /* @__PURE__ */ jsx54(IconGlyph8, { name: "close", size: 16 })
|
|
4961
|
+
}
|
|
4962
|
+
) })
|
|
4963
|
+
]
|
|
4964
|
+
}
|
|
4965
|
+
)
|
|
4966
|
+
] }),
|
|
4967
|
+
/* @__PURE__ */ jsx54(
|
|
4968
|
+
Lightbox,
|
|
4969
|
+
{
|
|
4970
|
+
open: lightboxOpen,
|
|
4971
|
+
onOpenChange: setLightboxOpen,
|
|
4972
|
+
items: photos,
|
|
4973
|
+
index: galleryIndex,
|
|
4974
|
+
onIndexChange: setGalleryIndex,
|
|
4975
|
+
title: lightboxTitle,
|
|
4976
|
+
renderItem: (src, i) => renderPhoto ? renderPhoto(src, i, "lightbox") : /* @__PURE__ */ jsx54("img", { src, alt: "", className: "max-h-[88vh] max-w-[92vw] object-contain" })
|
|
4977
|
+
}
|
|
4978
|
+
)
|
|
4979
|
+
] });
|
|
4980
|
+
});
|
|
4981
|
+
ListingDetail.displayName = "ListingDetail";
|
|
4982
|
+
|
|
4458
4983
|
// src/patterns/PhoneInput/PhoneInput.tsx
|
|
4459
|
-
import { forwardRef as
|
|
4984
|
+
import { forwardRef as forwardRef53, useEffect as useEffect14, useMemo as useMemo5, useRef as useRef12, useState as useState15 } from "react";
|
|
4460
4985
|
|
|
4461
4986
|
// src/patterns/PhoneInput/countries.ts
|
|
4462
4987
|
var phoneCountries = [
|
|
@@ -4500,7 +5025,7 @@ var phoneCountries = [
|
|
|
4500
5025
|
];
|
|
4501
5026
|
|
|
4502
5027
|
// src/patterns/PhoneInput/PhoneInput.tsx
|
|
4503
|
-
import { jsx as
|
|
5028
|
+
import { jsx as jsx55, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
4504
5029
|
function parseE164(value, list) {
|
|
4505
5030
|
if (!value.startsWith("+")) return null;
|
|
4506
5031
|
const digits = value.slice(1);
|
|
@@ -4514,7 +5039,7 @@ function toE164(country, national) {
|
|
|
4514
5039
|
if (cleaned.length === 0) return "";
|
|
4515
5040
|
return `+${country.dialCode}${cleaned}`;
|
|
4516
5041
|
}
|
|
4517
|
-
var PhoneInput =
|
|
5042
|
+
var PhoneInput = forwardRef53(function PhoneInput2({
|
|
4518
5043
|
value,
|
|
4519
5044
|
defaultValue,
|
|
4520
5045
|
onValueChange,
|
|
@@ -4530,10 +5055,10 @@ var PhoneInput = forwardRef52(function PhoneInput2({
|
|
|
4530
5055
|
onChange: onValueChange
|
|
4531
5056
|
});
|
|
4532
5057
|
const parsed = useMemo5(() => parseE164(committed ?? "", countries), [committed, countries]);
|
|
4533
|
-
const [country, setCountry] =
|
|
5058
|
+
const [country, setCountry] = useState15(
|
|
4534
5059
|
parsed?.country ?? countries.find((c) => c.code === defaultCountry) ?? countries[0]
|
|
4535
5060
|
);
|
|
4536
|
-
const [national, setNational] =
|
|
5061
|
+
const [national, setNational] = useState15(parsed?.national ?? "");
|
|
4537
5062
|
const lastEmittedRef = useRef12(committed ?? "");
|
|
4538
5063
|
useEffect14(() => {
|
|
4539
5064
|
const current = committed ?? "";
|
|
@@ -4567,7 +5092,7 @@ var PhoneInput = forwardRef52(function PhoneInput2({
|
|
|
4567
5092
|
})),
|
|
4568
5093
|
[countries]
|
|
4569
5094
|
);
|
|
4570
|
-
return /* @__PURE__ */
|
|
5095
|
+
return /* @__PURE__ */ jsxs48(
|
|
4571
5096
|
"div",
|
|
4572
5097
|
{
|
|
4573
5098
|
className: cn(
|
|
@@ -4576,7 +5101,7 @@ var PhoneInput = forwardRef52(function PhoneInput2({
|
|
|
4576
5101
|
disabled && "opacity-50"
|
|
4577
5102
|
),
|
|
4578
5103
|
children: [
|
|
4579
|
-
/* @__PURE__ */
|
|
5104
|
+
/* @__PURE__ */ jsx55(
|
|
4580
5105
|
Select,
|
|
4581
5106
|
{
|
|
4582
5107
|
options: selectOptions,
|
|
@@ -4586,7 +5111,7 @@ var PhoneInput = forwardRef52(function PhoneInput2({
|
|
|
4586
5111
|
"aria-label": "Country"
|
|
4587
5112
|
}
|
|
4588
5113
|
),
|
|
4589
|
-
/* @__PURE__ */
|
|
5114
|
+
/* @__PURE__ */ jsx55(
|
|
4590
5115
|
"input",
|
|
4591
5116
|
{
|
|
4592
5117
|
ref,
|
|
@@ -4608,8 +5133,8 @@ var PhoneInput = forwardRef52(function PhoneInput2({
|
|
|
4608
5133
|
PhoneInput.displayName = "PhoneInput";
|
|
4609
5134
|
|
|
4610
5135
|
// src/patterns/PriceBreakdown/PriceBreakdown.tsx
|
|
4611
|
-
import { forwardRef as
|
|
4612
|
-
import { jsx as
|
|
5136
|
+
import { forwardRef as forwardRef54 } from "react";
|
|
5137
|
+
import { jsx as jsx56, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
4613
5138
|
function PriceBreakdownRoot({
|
|
4614
5139
|
items,
|
|
4615
5140
|
total,
|
|
@@ -4619,30 +5144,30 @@ function PriceBreakdownRoot({
|
|
|
4619
5144
|
children,
|
|
4620
5145
|
...props
|
|
4621
5146
|
}, ref) {
|
|
4622
|
-
return /* @__PURE__ */
|
|
4623
|
-
items?.map((item, i) => /* @__PURE__ */
|
|
5147
|
+
return /* @__PURE__ */ jsxs49("div", { ref, className: cn("flex flex-col gap-2", className), ...props, children: [
|
|
5148
|
+
items?.map((item, i) => /* @__PURE__ */ jsx56(PriceBreakdownLine, { ...item }, i)),
|
|
4624
5149
|
children,
|
|
4625
|
-
total !== void 0 && /* @__PURE__ */
|
|
4626
|
-
/* @__PURE__ */
|
|
4627
|
-
/* @__PURE__ */
|
|
5150
|
+
total !== void 0 && /* @__PURE__ */ jsxs49("div", { className: "border-border mt-2 flex items-baseline justify-between border-t pt-3", children: [
|
|
5151
|
+
/* @__PURE__ */ jsx56("span", { className: "text-text text-[14px] font-semibold", children: totalLabel }),
|
|
5152
|
+
/* @__PURE__ */ jsxs49("span", { className: "text-text text-[16px] font-semibold", children: [
|
|
4628
5153
|
total,
|
|
4629
|
-
currency && /* @__PURE__ */
|
|
5154
|
+
currency && /* @__PURE__ */ jsx56("span", { className: "text-text-dim ml-1 text-[12px] font-normal", children: currency })
|
|
4630
5155
|
] })
|
|
4631
5156
|
] })
|
|
4632
5157
|
] });
|
|
4633
5158
|
}
|
|
4634
|
-
var PriceBreakdown =
|
|
5159
|
+
var PriceBreakdown = forwardRef54(PriceBreakdownRoot);
|
|
4635
5160
|
PriceBreakdown.displayName = "PriceBreakdown";
|
|
4636
|
-
var PriceBreakdownLine =
|
|
5161
|
+
var PriceBreakdownLine = forwardRef54(
|
|
4637
5162
|
function PriceBreakdownLine2({ label, subLabel, amount, originalAmount, discount, className }, ref) {
|
|
4638
|
-
return /* @__PURE__ */
|
|
4639
|
-
/* @__PURE__ */
|
|
4640
|
-
/* @__PURE__ */
|
|
4641
|
-
subLabel && /* @__PURE__ */
|
|
5163
|
+
return /* @__PURE__ */ jsxs49("div", { ref, className: cn("flex items-baseline justify-between gap-3", className), children: [
|
|
5164
|
+
/* @__PURE__ */ jsxs49("div", { className: "flex min-w-0 flex-col", children: [
|
|
5165
|
+
/* @__PURE__ */ jsx56("span", { className: "text-text text-[13px]", children: label }),
|
|
5166
|
+
subLabel && /* @__PURE__ */ jsx56("span", { className: "text-text-dim text-[11px]", children: subLabel })
|
|
4642
5167
|
] }),
|
|
4643
|
-
/* @__PURE__ */
|
|
4644
|
-
originalAmount && /* @__PURE__ */
|
|
4645
|
-
/* @__PURE__ */
|
|
5168
|
+
/* @__PURE__ */ jsxs49("div", { className: "inline-flex shrink-0 items-baseline gap-2", children: [
|
|
5169
|
+
originalAmount && /* @__PURE__ */ jsx56("span", { className: "text-text-dim decoration-sale text-[12px] line-through", children: originalAmount }),
|
|
5170
|
+
/* @__PURE__ */ jsx56(
|
|
4646
5171
|
"span",
|
|
4647
5172
|
{
|
|
4648
5173
|
className: cn("text-[13px] font-medium", discount ? "text-sale-text" : "text-text"),
|
|
@@ -4657,19 +5182,19 @@ PriceBreakdownLine.displayName = "PriceBreakdownLine";
|
|
|
4657
5182
|
PriceBreakdown.Line = PriceBreakdownLine;
|
|
4658
5183
|
|
|
4659
5184
|
// src/patterns/ReviewCard/ReviewCard.tsx
|
|
4660
|
-
import { IconGlyph as
|
|
4661
|
-
import { forwardRef as
|
|
4662
|
-
import { jsx as
|
|
4663
|
-
var ReviewCard =
|
|
4664
|
-
return /* @__PURE__ */
|
|
5185
|
+
import { IconGlyph as IconGlyph9 } from "@ship-it-ui/icons";
|
|
5186
|
+
import { forwardRef as forwardRef55 } from "react";
|
|
5187
|
+
import { jsx as jsx57, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
5188
|
+
var ReviewCard = forwardRef55(function ReviewCard2({ author, authorAvatar, rating, date, body, photos, verified, subtitle, className, ...props }, ref) {
|
|
5189
|
+
return /* @__PURE__ */ jsxs50(
|
|
4665
5190
|
"article",
|
|
4666
5191
|
{
|
|
4667
5192
|
ref,
|
|
4668
5193
|
className: cn("border-border bg-panel flex flex-col gap-3 rounded-md border p-4", className),
|
|
4669
5194
|
...props,
|
|
4670
5195
|
children: [
|
|
4671
|
-
/* @__PURE__ */
|
|
4672
|
-
/* @__PURE__ */
|
|
5196
|
+
/* @__PURE__ */ jsxs50("header", { className: "flex items-start gap-3", children: [
|
|
5197
|
+
/* @__PURE__ */ jsx57(
|
|
4673
5198
|
Avatar,
|
|
4674
5199
|
{
|
|
4675
5200
|
src: authorAvatar,
|
|
@@ -4677,24 +5202,24 @@ var ReviewCard = forwardRef54(function ReviewCard2({ author, authorAvatar, ratin
|
|
|
4677
5202
|
size: "md"
|
|
4678
5203
|
}
|
|
4679
5204
|
),
|
|
4680
|
-
/* @__PURE__ */
|
|
4681
|
-
/* @__PURE__ */
|
|
4682
|
-
/* @__PURE__ */
|
|
4683
|
-
verified && /* @__PURE__ */
|
|
4684
|
-
/* @__PURE__ */
|
|
5205
|
+
/* @__PURE__ */ jsxs50("div", { className: "flex min-w-0 flex-1 flex-col gap-0.5", children: [
|
|
5206
|
+
/* @__PURE__ */ jsxs50("div", { className: "flex items-center gap-2", children: [
|
|
5207
|
+
/* @__PURE__ */ jsx57("span", { className: "text-text text-[14px] leading-tight font-semibold", children: author }),
|
|
5208
|
+
verified && /* @__PURE__ */ jsxs50(Badge, { variant: "ok", size: "sm", children: [
|
|
5209
|
+
/* @__PURE__ */ jsx57(IconGlyph9, { name: "verified", size: 11 }),
|
|
4685
5210
|
" Verified trip"
|
|
4686
5211
|
] })
|
|
4687
5212
|
] }),
|
|
4688
|
-
subtitle && /* @__PURE__ */
|
|
4689
|
-
/* @__PURE__ */
|
|
4690
|
-
/* @__PURE__ */
|
|
4691
|
-
/* @__PURE__ */
|
|
4692
|
-
/* @__PURE__ */
|
|
5213
|
+
subtitle && /* @__PURE__ */ jsx57("span", { className: "text-text-dim text-[11px]", children: subtitle }),
|
|
5214
|
+
/* @__PURE__ */ jsxs50("div", { className: "mt-1 flex items-center gap-2", children: [
|
|
5215
|
+
/* @__PURE__ */ jsx57(Rating, { value: rating, max: 5, precision: "half", size: "sm", readOnly: true }),
|
|
5216
|
+
/* @__PURE__ */ jsx57("span", { className: "text-text-dim text-[11px]", children: "\xB7" }),
|
|
5217
|
+
/* @__PURE__ */ jsx57("time", { className: "text-text-dim text-[11px]", children: date })
|
|
4693
5218
|
] })
|
|
4694
5219
|
] })
|
|
4695
5220
|
] }),
|
|
4696
|
-
/* @__PURE__ */
|
|
4697
|
-
photos && photos.length > 0 && /* @__PURE__ */
|
|
5221
|
+
/* @__PURE__ */ jsx57("p", { className: "text-text text-[13px] leading-relaxed", children: body }),
|
|
5222
|
+
photos && photos.length > 0 && /* @__PURE__ */ jsx57("div", { className: "flex gap-2 overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden", children: photos.map((src, i) => /* @__PURE__ */ jsx57(
|
|
4698
5223
|
"img",
|
|
4699
5224
|
{
|
|
4700
5225
|
src,
|
|
@@ -4711,11 +5236,11 @@ var ReviewCard = forwardRef54(function ReviewCard2({ author, authorAvatar, ratin
|
|
|
4711
5236
|
ReviewCard.displayName = "ReviewCard";
|
|
4712
5237
|
|
|
4713
5238
|
// src/patterns/Dots/Dots.tsx
|
|
4714
|
-
import { forwardRef as
|
|
4715
|
-
import { jsx as
|
|
4716
|
-
var Dots =
|
|
5239
|
+
import { forwardRef as forwardRef56 } from "react";
|
|
5240
|
+
import { jsx as jsx58 } from "react/jsx-runtime";
|
|
5241
|
+
var Dots = forwardRef56(function Dots2({ total, current, onChange, className, "aria-label": ariaLabel = "Progress", ...props }, ref) {
|
|
4717
5242
|
const interactive = typeof onChange === "function";
|
|
4718
|
-
return /* @__PURE__ */
|
|
5243
|
+
return /* @__PURE__ */ jsx58(
|
|
4719
5244
|
"nav",
|
|
4720
5245
|
{
|
|
4721
5246
|
ref,
|
|
@@ -4729,7 +5254,7 @@ var Dots = forwardRef55(function Dots2({ total, current, onChange, className, "a
|
|
|
4729
5254
|
isActive ? "w-[18px] bg-accent" : "w-[6px] bg-panel-2"
|
|
4730
5255
|
);
|
|
4731
5256
|
if (interactive) {
|
|
4732
|
-
return /* @__PURE__ */
|
|
5257
|
+
return /* @__PURE__ */ jsx58(
|
|
4733
5258
|
"button",
|
|
4734
5259
|
{
|
|
4735
5260
|
type: "button",
|
|
@@ -4746,7 +5271,7 @@ var Dots = forwardRef55(function Dots2({ total, current, onChange, className, "a
|
|
|
4746
5271
|
i
|
|
4747
5272
|
);
|
|
4748
5273
|
}
|
|
4749
|
-
return /* @__PURE__ */
|
|
5274
|
+
return /* @__PURE__ */ jsx58("span", { "aria-hidden": true, className: sharedClass }, i);
|
|
4750
5275
|
})
|
|
4751
5276
|
}
|
|
4752
5277
|
);
|
|
@@ -4755,15 +5280,15 @@ Dots.displayName = "Dots";
|
|
|
4755
5280
|
|
|
4756
5281
|
// src/patterns/Dropzone/Dropzone.tsx
|
|
4757
5282
|
import {
|
|
4758
|
-
forwardRef as
|
|
4759
|
-
useState as
|
|
5283
|
+
forwardRef as forwardRef57,
|
|
5284
|
+
useState as useState16
|
|
4760
5285
|
} from "react";
|
|
4761
|
-
import { jsx as
|
|
5286
|
+
import { jsx as jsx59, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
4762
5287
|
function listToArray(list) {
|
|
4763
5288
|
if (!list) return [];
|
|
4764
5289
|
return Array.from(list);
|
|
4765
5290
|
}
|
|
4766
|
-
var Dropzone =
|
|
5291
|
+
var Dropzone = forwardRef57(function Dropzone2({
|
|
4767
5292
|
onFiles,
|
|
4768
5293
|
accept,
|
|
4769
5294
|
multiple = true,
|
|
@@ -4774,7 +5299,7 @@ var Dropzone = forwardRef56(function Dropzone2({
|
|
|
4774
5299
|
className,
|
|
4775
5300
|
...props
|
|
4776
5301
|
}, ref) {
|
|
4777
|
-
const [isDragging, setIsDragging] =
|
|
5302
|
+
const [isDragging, setIsDragging] = useState16(false);
|
|
4778
5303
|
const onDragOver = (e) => {
|
|
4779
5304
|
if (disabled) return;
|
|
4780
5305
|
e.preventDefault();
|
|
@@ -4788,7 +5313,7 @@ var Dropzone = forwardRef56(function Dropzone2({
|
|
|
4788
5313
|
const files = listToArray(e.dataTransfer.files);
|
|
4789
5314
|
if (files.length) onFiles?.(files);
|
|
4790
5315
|
};
|
|
4791
|
-
return /* @__PURE__ */
|
|
5316
|
+
return /* @__PURE__ */ jsxs51(
|
|
4792
5317
|
"label",
|
|
4793
5318
|
{
|
|
4794
5319
|
ref,
|
|
@@ -4805,7 +5330,7 @@ var Dropzone = forwardRef56(function Dropzone2({
|
|
|
4805
5330
|
),
|
|
4806
5331
|
...props,
|
|
4807
5332
|
children: [
|
|
4808
|
-
/* @__PURE__ */
|
|
5333
|
+
/* @__PURE__ */ jsx59(
|
|
4809
5334
|
"input",
|
|
4810
5335
|
{
|
|
4811
5336
|
type: "file",
|
|
@@ -4821,7 +5346,7 @@ var Dropzone = forwardRef56(function Dropzone2({
|
|
|
4821
5346
|
}
|
|
4822
5347
|
}
|
|
4823
5348
|
),
|
|
4824
|
-
/* @__PURE__ */
|
|
5349
|
+
/* @__PURE__ */ jsx59(
|
|
4825
5350
|
"div",
|
|
4826
5351
|
{
|
|
4827
5352
|
"aria-hidden": true,
|
|
@@ -4829,8 +5354,8 @@ var Dropzone = forwardRef56(function Dropzone2({
|
|
|
4829
5354
|
children: icon
|
|
4830
5355
|
}
|
|
4831
5356
|
),
|
|
4832
|
-
/* @__PURE__ */
|
|
4833
|
-
description && /* @__PURE__ */
|
|
5357
|
+
/* @__PURE__ */ jsx59("div", { className: "mb-1 text-[13px] font-medium", children: title }),
|
|
5358
|
+
description && /* @__PURE__ */ jsx59("div", { className: "text-text-dim text-[11px]", children: description })
|
|
4834
5359
|
]
|
|
4835
5360
|
}
|
|
4836
5361
|
);
|
|
@@ -4838,10 +5363,10 @@ var Dropzone = forwardRef56(function Dropzone2({
|
|
|
4838
5363
|
Dropzone.displayName = "Dropzone";
|
|
4839
5364
|
|
|
4840
5365
|
// src/patterns/EmptyState/EmptyState.tsx
|
|
4841
|
-
import { cva as
|
|
4842
|
-
import { forwardRef as
|
|
4843
|
-
import { jsx as
|
|
4844
|
-
var plateStyles =
|
|
5366
|
+
import { cva as cva12 } from "class-variance-authority";
|
|
5367
|
+
import { forwardRef as forwardRef58 } from "react";
|
|
5368
|
+
import { jsx as jsx60, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
5369
|
+
var plateStyles = cva12("grid h-12 w-12 place-items-center rounded-base text-[22px]", {
|
|
4845
5370
|
variants: {
|
|
4846
5371
|
tone: {
|
|
4847
5372
|
neutral: "bg-panel-2 text-text-muted",
|
|
@@ -4853,8 +5378,8 @@ var plateStyles = cva11("grid h-12 w-12 place-items-center rounded-base text-[22
|
|
|
4853
5378
|
},
|
|
4854
5379
|
defaultVariants: { tone: "neutral" }
|
|
4855
5380
|
});
|
|
4856
|
-
var EmptyState =
|
|
4857
|
-
return /* @__PURE__ */
|
|
5381
|
+
var EmptyState = forwardRef58(function EmptyState2({ icon, title, description, action, chips, tone, className, ...props }, ref) {
|
|
5382
|
+
return /* @__PURE__ */ jsxs52(
|
|
4858
5383
|
"div",
|
|
4859
5384
|
{
|
|
4860
5385
|
ref,
|
|
@@ -4864,10 +5389,10 @@ var EmptyState = forwardRef57(function EmptyState2({ icon, title, description, a
|
|
|
4864
5389
|
),
|
|
4865
5390
|
...props,
|
|
4866
5391
|
children: [
|
|
4867
|
-
icon != null && /* @__PURE__ */
|
|
4868
|
-
/* @__PURE__ */
|
|
4869
|
-
description && /* @__PURE__ */
|
|
4870
|
-
chips && chips.length > 0 && /* @__PURE__ */
|
|
5392
|
+
icon != null && /* @__PURE__ */ jsx60("span", { "aria-hidden": true, className: plateStyles({ tone: tone ?? "neutral" }), children: icon }),
|
|
5393
|
+
/* @__PURE__ */ jsx60("div", { className: "text-[14px] font-medium", children: title }),
|
|
5394
|
+
description && /* @__PURE__ */ jsx60("div", { className: "text-text-muted max-w-[260px] text-[12px] leading-[1.5]", children: description }),
|
|
5395
|
+
chips && chips.length > 0 && /* @__PURE__ */ jsx60("div", { className: "flex w-full flex-col gap-1", children: chips.map((c, i) => /* @__PURE__ */ jsx60(
|
|
4871
5396
|
"button",
|
|
4872
5397
|
{
|
|
4873
5398
|
type: "button",
|
|
@@ -4889,18 +5414,18 @@ var EmptyState = forwardRef57(function EmptyState2({ icon, title, description, a
|
|
|
4889
5414
|
EmptyState.displayName = "EmptyState";
|
|
4890
5415
|
|
|
4891
5416
|
// src/patterns/FileChip/FileChip.tsx
|
|
4892
|
-
import { forwardRef as
|
|
4893
|
-
import { jsx as
|
|
5417
|
+
import { forwardRef as forwardRef59 } from "react";
|
|
5418
|
+
import { jsx as jsx61, jsxs as jsxs53 } from "react/jsx-runtime";
|
|
4894
5419
|
function deriveExt(name) {
|
|
4895
5420
|
const dot = name.lastIndexOf(".");
|
|
4896
5421
|
if (dot < 0) return "FILE";
|
|
4897
5422
|
return name.slice(dot + 1).slice(0, 4).toUpperCase();
|
|
4898
5423
|
}
|
|
4899
|
-
var FileChip =
|
|
5424
|
+
var FileChip = forwardRef59(function FileChip2({ name, size, progress, icon, onRemove, failed, className, ...props }, ref) {
|
|
4900
5425
|
const ext = deriveExt(name);
|
|
4901
5426
|
const showProgress = typeof progress === "number";
|
|
4902
5427
|
const isComplete = showProgress && progress >= 100;
|
|
4903
|
-
return /* @__PURE__ */
|
|
5428
|
+
return /* @__PURE__ */ jsxs53(
|
|
4904
5429
|
"div",
|
|
4905
5430
|
{
|
|
4906
5431
|
ref,
|
|
@@ -4910,7 +5435,7 @@ var FileChip = forwardRef58(function FileChip2({ name, size, progress, icon, onR
|
|
|
4910
5435
|
),
|
|
4911
5436
|
...props,
|
|
4912
5437
|
children: [
|
|
4913
|
-
/* @__PURE__ */
|
|
5438
|
+
/* @__PURE__ */ jsx61(
|
|
4914
5439
|
"span",
|
|
4915
5440
|
{
|
|
4916
5441
|
"aria-hidden": true,
|
|
@@ -4918,17 +5443,17 @@ var FileChip = forwardRef58(function FileChip2({ name, size, progress, icon, onR
|
|
|
4918
5443
|
children: icon ?? ext
|
|
4919
5444
|
}
|
|
4920
5445
|
),
|
|
4921
|
-
/* @__PURE__ */
|
|
4922
|
-
/* @__PURE__ */
|
|
4923
|
-
/* @__PURE__ */
|
|
5446
|
+
/* @__PURE__ */ jsxs53("div", { className: "min-w-0 flex-1", children: [
|
|
5447
|
+
/* @__PURE__ */ jsx61("div", { className: "truncate text-[12px] font-medium", children: name }),
|
|
5448
|
+
/* @__PURE__ */ jsxs53("div", { className: cn("font-mono text-[10px]", failed ? "text-err" : "text-text-dim"), children: [
|
|
4924
5449
|
size,
|
|
4925
|
-
showProgress && !isComplete && /* @__PURE__ */
|
|
5450
|
+
showProgress && !isComplete && /* @__PURE__ */ jsxs53("span", { children: [
|
|
4926
5451
|
" \xB7 ",
|
|
4927
5452
|
Math.round(progress),
|
|
4928
5453
|
"%"
|
|
4929
5454
|
] })
|
|
4930
5455
|
] }),
|
|
4931
|
-
showProgress && !isComplete && /* @__PURE__ */
|
|
5456
|
+
showProgress && !isComplete && /* @__PURE__ */ jsx61("div", { className: "bg-panel mt-1 h-[2px] overflow-hidden rounded-full", children: /* @__PURE__ */ jsx61(
|
|
4932
5457
|
"div",
|
|
4933
5458
|
{
|
|
4934
5459
|
className: cn(
|
|
@@ -4939,7 +5464,7 @@ var FileChip = forwardRef58(function FileChip2({ name, size, progress, icon, onR
|
|
|
4939
5464
|
}
|
|
4940
5465
|
) })
|
|
4941
5466
|
] }),
|
|
4942
|
-
onRemove && /* @__PURE__ */
|
|
5467
|
+
onRemove && /* @__PURE__ */ jsx61(
|
|
4943
5468
|
"button",
|
|
4944
5469
|
{
|
|
4945
5470
|
type: "button",
|
|
@@ -4959,10 +5484,10 @@ var FileChip = forwardRef58(function FileChip2({ name, size, progress, icon, onR
|
|
|
4959
5484
|
FileChip.displayName = "FileChip";
|
|
4960
5485
|
|
|
4961
5486
|
// src/patterns/FilterPanel/FilterPanel.tsx
|
|
4962
|
-
import { forwardRef as
|
|
4963
|
-
import { jsx as
|
|
5487
|
+
import { forwardRef as forwardRef60, useCallback as useCallback12, useState as useState17 } from "react";
|
|
5488
|
+
import { jsx as jsx62, jsxs as jsxs54 } from "react/jsx-runtime";
|
|
4964
5489
|
var EMPTY = Object.freeze({});
|
|
4965
|
-
var FilterPanel =
|
|
5490
|
+
var FilterPanel = forwardRef60(function FilterPanel2({
|
|
4966
5491
|
facets,
|
|
4967
5492
|
value,
|
|
4968
5493
|
defaultValue,
|
|
@@ -4995,7 +5520,7 @@ var FilterPanel = forwardRef59(function FilterPanel2({
|
|
|
4995
5520
|
setSelection(EMPTY);
|
|
4996
5521
|
onReset?.();
|
|
4997
5522
|
}, [setSelection, onReset]);
|
|
4998
|
-
return /* @__PURE__ */
|
|
5523
|
+
return /* @__PURE__ */ jsxs54(
|
|
4999
5524
|
"div",
|
|
5000
5525
|
{
|
|
5001
5526
|
ref,
|
|
@@ -5007,10 +5532,10 @@ var FilterPanel = forwardRef59(function FilterPanel2({
|
|
|
5007
5532
|
),
|
|
5008
5533
|
...props,
|
|
5009
5534
|
children: [
|
|
5010
|
-
/* @__PURE__ */
|
|
5011
|
-
/* @__PURE__ */
|
|
5012
|
-
total > 0 && /* @__PURE__ */
|
|
5013
|
-
/* @__PURE__ */
|
|
5535
|
+
/* @__PURE__ */ jsxs54("div", { className: "flex items-center gap-2", children: [
|
|
5536
|
+
/* @__PURE__ */ jsx62("span", { className: "text-text-dim font-mono text-[10px] tracking-[1.4px] uppercase", children: title }),
|
|
5537
|
+
total > 0 && /* @__PURE__ */ jsx62(Badge, { size: "sm", variant: "accent", children: total }),
|
|
5538
|
+
/* @__PURE__ */ jsx62(
|
|
5014
5539
|
Button,
|
|
5015
5540
|
{
|
|
5016
5541
|
type: "button",
|
|
@@ -5023,7 +5548,7 @@ var FilterPanel = forwardRef59(function FilterPanel2({
|
|
|
5023
5548
|
}
|
|
5024
5549
|
)
|
|
5025
5550
|
] }),
|
|
5026
|
-
facets.map((facet) => /* @__PURE__ */
|
|
5551
|
+
facets.map((facet) => /* @__PURE__ */ jsx62(
|
|
5027
5552
|
FilterFacetGroup,
|
|
5028
5553
|
{
|
|
5029
5554
|
facet,
|
|
@@ -5040,12 +5565,12 @@ var FilterPanel = forwardRef59(function FilterPanel2({
|
|
|
5040
5565
|
FilterPanel.displayName = "FilterPanel";
|
|
5041
5566
|
function FilterFacetGroup({ facet, selected, counts, onToggle }) {
|
|
5042
5567
|
const collapsible = facet.collapsible ?? true;
|
|
5043
|
-
const [open, setOpen] =
|
|
5568
|
+
const [open, setOpen] = useState17(facet.defaultOpen ?? true);
|
|
5044
5569
|
const isOpen = !collapsible || open;
|
|
5045
5570
|
const selectedCount = selected.length;
|
|
5046
5571
|
const headingClass = "text-text-muted flex items-center gap-[6px] font-mono text-[10px] tracking-[1.4px] uppercase";
|
|
5047
|
-
return /* @__PURE__ */
|
|
5048
|
-
collapsible ? /* @__PURE__ */
|
|
5572
|
+
return /* @__PURE__ */ jsxs54("section", { className: "flex flex-col gap-1", children: [
|
|
5573
|
+
collapsible ? /* @__PURE__ */ jsxs54(
|
|
5049
5574
|
"button",
|
|
5050
5575
|
{
|
|
5051
5576
|
type: "button",
|
|
@@ -5058,20 +5583,20 @@ function FilterFacetGroup({ facet, selected, counts, onToggle }) {
|
|
|
5058
5583
|
"hover:text-text"
|
|
5059
5584
|
),
|
|
5060
5585
|
children: [
|
|
5061
|
-
/* @__PURE__ */
|
|
5062
|
-
selectedCount > 0 && /* @__PURE__ */
|
|
5063
|
-
/* @__PURE__ */
|
|
5586
|
+
/* @__PURE__ */ jsx62("span", { className: "flex-1 text-left", children: facet.label }),
|
|
5587
|
+
selectedCount > 0 && /* @__PURE__ */ jsx62(Badge, { size: "sm", variant: "neutral", children: selectedCount }),
|
|
5588
|
+
/* @__PURE__ */ jsx62("span", { "aria-hidden": true, className: "text-[10px] opacity-70", children: isOpen ? "\u25BE" : "\u25B8" })
|
|
5064
5589
|
]
|
|
5065
5590
|
}
|
|
5066
|
-
) : /* @__PURE__ */
|
|
5067
|
-
/* @__PURE__ */
|
|
5068
|
-
selectedCount > 0 && /* @__PURE__ */
|
|
5591
|
+
) : /* @__PURE__ */ jsxs54("div", { className: cn(headingClass, "px-1 py-[2px]"), children: [
|
|
5592
|
+
/* @__PURE__ */ jsx62("span", { className: "flex-1", children: facet.label }),
|
|
5593
|
+
selectedCount > 0 && /* @__PURE__ */ jsx62(Badge, { size: "sm", variant: "neutral", children: selectedCount })
|
|
5069
5594
|
] }),
|
|
5070
|
-
isOpen && /* @__PURE__ */
|
|
5595
|
+
isOpen && /* @__PURE__ */ jsx62("ul", { className: "m-0 flex list-none flex-col gap-[2px] p-0", children: facet.options.map((option) => {
|
|
5071
5596
|
const isSelected = selected.includes(option.value);
|
|
5072
5597
|
const count = counts?.[option.value];
|
|
5073
|
-
return /* @__PURE__ */
|
|
5074
|
-
/* @__PURE__ */
|
|
5598
|
+
return /* @__PURE__ */ jsxs54("li", { className: "flex items-center gap-2 px-1 py-[3px]", children: [
|
|
5599
|
+
/* @__PURE__ */ jsx62(
|
|
5075
5600
|
Checkbox,
|
|
5076
5601
|
{
|
|
5077
5602
|
checked: isSelected,
|
|
@@ -5079,25 +5604,25 @@ function FilterFacetGroup({ facet, selected, counts, onToggle }) {
|
|
|
5079
5604
|
label: option.label
|
|
5080
5605
|
}
|
|
5081
5606
|
),
|
|
5082
|
-
typeof count === "number" && /* @__PURE__ */
|
|
5607
|
+
typeof count === "number" && /* @__PURE__ */ jsx62("span", { className: "text-text-dim ml-auto font-mono text-[10px] tabular-nums", children: count })
|
|
5083
5608
|
] }, option.value);
|
|
5084
5609
|
}) })
|
|
5085
5610
|
] });
|
|
5086
5611
|
}
|
|
5087
5612
|
|
|
5088
5613
|
// src/patterns/HealthScore/HealthScore.tsx
|
|
5089
|
-
import { forwardRef as
|
|
5614
|
+
import { forwardRef as forwardRef62 } from "react";
|
|
5090
5615
|
|
|
5091
5616
|
// src/patterns/RadialProgress/RadialProgress.tsx
|
|
5092
|
-
import { forwardRef as
|
|
5093
|
-
import { jsx as
|
|
5617
|
+
import { forwardRef as forwardRef61 } from "react";
|
|
5618
|
+
import { jsx as jsx63, jsxs as jsxs55 } from "react/jsx-runtime";
|
|
5094
5619
|
var toneStrokeClass = {
|
|
5095
5620
|
accent: "stroke-accent",
|
|
5096
5621
|
ok: "stroke-ok",
|
|
5097
5622
|
warn: "stroke-warn",
|
|
5098
5623
|
err: "stroke-err"
|
|
5099
5624
|
};
|
|
5100
|
-
var RadialProgress =
|
|
5625
|
+
var RadialProgress = forwardRef61(
|
|
5101
5626
|
function RadialProgress2({
|
|
5102
5627
|
value,
|
|
5103
5628
|
max = 100,
|
|
@@ -5115,7 +5640,7 @@ var RadialProgress = forwardRef60(
|
|
|
5115
5640
|
const c = 2 * Math.PI * r;
|
|
5116
5641
|
const dash = pct / 100 * c;
|
|
5117
5642
|
const resolvedTone = tone ?? (clamped >= max ? "ok" : "accent");
|
|
5118
|
-
return /* @__PURE__ */
|
|
5643
|
+
return /* @__PURE__ */ jsxs55(
|
|
5119
5644
|
"div",
|
|
5120
5645
|
{
|
|
5121
5646
|
ref,
|
|
@@ -5128,8 +5653,8 @@ var RadialProgress = forwardRef60(
|
|
|
5128
5653
|
style: { width: size, height: size },
|
|
5129
5654
|
...props,
|
|
5130
5655
|
children: [
|
|
5131
|
-
/* @__PURE__ */
|
|
5132
|
-
/* @__PURE__ */
|
|
5656
|
+
/* @__PURE__ */ jsxs55("svg", { width: size, height: size, viewBox: `0 0 ${size} ${size}`, children: [
|
|
5657
|
+
/* @__PURE__ */ jsx63(
|
|
5133
5658
|
"circle",
|
|
5134
5659
|
{
|
|
5135
5660
|
cx: size / 2,
|
|
@@ -5140,7 +5665,7 @@ var RadialProgress = forwardRef60(
|
|
|
5140
5665
|
className: "stroke-panel-2"
|
|
5141
5666
|
}
|
|
5142
5667
|
),
|
|
5143
|
-
/* @__PURE__ */
|
|
5668
|
+
/* @__PURE__ */ jsx63(
|
|
5144
5669
|
"circle",
|
|
5145
5670
|
{
|
|
5146
5671
|
cx: size / 2,
|
|
@@ -5158,7 +5683,7 @@ var RadialProgress = forwardRef60(
|
|
|
5158
5683
|
}
|
|
5159
5684
|
)
|
|
5160
5685
|
] }),
|
|
5161
|
-
/* @__PURE__ */
|
|
5686
|
+
/* @__PURE__ */ jsx63("div", { className: "absolute inset-0 grid place-items-center font-mono text-[11px] font-medium tabular-nums", children: children ?? `${Math.round(pct)}%` })
|
|
5162
5687
|
]
|
|
5163
5688
|
}
|
|
5164
5689
|
);
|
|
@@ -5167,7 +5692,7 @@ var RadialProgress = forwardRef60(
|
|
|
5167
5692
|
RadialProgress.displayName = "RadialProgress";
|
|
5168
5693
|
|
|
5169
5694
|
// src/patterns/HealthScore/HealthScore.tsx
|
|
5170
|
-
import { jsx as
|
|
5695
|
+
import { jsx as jsx64, jsxs as jsxs56 } from "react/jsx-runtime";
|
|
5171
5696
|
function deltaTone(delta) {
|
|
5172
5697
|
if (delta > 0) return "ok";
|
|
5173
5698
|
if (delta < 0) return "err";
|
|
@@ -5184,7 +5709,7 @@ var toneTextClass = {
|
|
|
5184
5709
|
warn: "text-warn",
|
|
5185
5710
|
err: "text-err"
|
|
5186
5711
|
};
|
|
5187
|
-
var HealthScore =
|
|
5712
|
+
var HealthScore = forwardRef62(function HealthScore2({
|
|
5188
5713
|
value,
|
|
5189
5714
|
max = 100,
|
|
5190
5715
|
delta,
|
|
@@ -5199,7 +5724,7 @@ var HealthScore = forwardRef61(function HealthScore2({
|
|
|
5199
5724
|
const pct = max > 0 ? Math.round(Math.min(max, Math.max(0, value)) / max * 100) : 0;
|
|
5200
5725
|
const resolvedTone = tone ?? (pct >= 80 ? "ok" : pct >= 50 ? "accent" : "warn");
|
|
5201
5726
|
const indicatorTone = typeof delta === "number" ? deltaTone(delta) : "accent";
|
|
5202
|
-
const core = /* @__PURE__ */
|
|
5727
|
+
const core = /* @__PURE__ */ jsxs56(
|
|
5203
5728
|
"div",
|
|
5204
5729
|
{
|
|
5205
5730
|
ref,
|
|
@@ -5207,10 +5732,10 @@ var HealthScore = forwardRef61(function HealthScore2({
|
|
|
5207
5732
|
"aria-label": ariaLabel ?? `${pct}% health`,
|
|
5208
5733
|
...props,
|
|
5209
5734
|
children: [
|
|
5210
|
-
/* @__PURE__ */
|
|
5211
|
-
label && /* @__PURE__ */
|
|
5212
|
-
typeof delta === "number" && /* @__PURE__ */
|
|
5213
|
-
/* @__PURE__ */
|
|
5735
|
+
/* @__PURE__ */ jsx64(RadialProgress, { value, max, size, tone: resolvedTone }),
|
|
5736
|
+
label && /* @__PURE__ */ jsx64("div", { className: "text-text-muted mt-1 text-[12px] leading-tight", children: label }),
|
|
5737
|
+
typeof delta === "number" && /* @__PURE__ */ jsxs56("div", { className: cn("font-mono text-[11px] tabular-nums", toneTextClass[indicatorTone]), children: [
|
|
5738
|
+
/* @__PURE__ */ jsx64("span", { "aria-hidden": true, children: deltaGlyph(delta) }),
|
|
5214
5739
|
" ",
|
|
5215
5740
|
Math.abs(delta)
|
|
5216
5741
|
] })
|
|
@@ -5220,15 +5745,15 @@ var HealthScore = forwardRef61(function HealthScore2({
|
|
|
5220
5745
|
if (!breakdown || breakdown.length === 0) {
|
|
5221
5746
|
return core;
|
|
5222
5747
|
}
|
|
5223
|
-
return /* @__PURE__ */
|
|
5748
|
+
return /* @__PURE__ */ jsx64(
|
|
5224
5749
|
HoverCard,
|
|
5225
5750
|
{
|
|
5226
|
-
trigger: /* @__PURE__ */
|
|
5227
|
-
content: /* @__PURE__ */
|
|
5228
|
-
/* @__PURE__ */
|
|
5229
|
-
/* @__PURE__ */
|
|
5230
|
-
/* @__PURE__ */
|
|
5231
|
-
/* @__PURE__ */
|
|
5751
|
+
trigger: /* @__PURE__ */ jsx64("span", { className: "inline-flex", children: core }),
|
|
5752
|
+
content: /* @__PURE__ */ jsxs56("div", { className: "flex min-w-[180px] flex-col gap-2", children: [
|
|
5753
|
+
/* @__PURE__ */ jsx64("div", { className: "text-text-dim font-mono text-[9px] tracking-[1.4px] uppercase", children: "Breakdown" }),
|
|
5754
|
+
/* @__PURE__ */ jsx64("ul", { className: "m-0 flex list-none flex-col gap-1 p-0 text-[12px]", children: breakdown.map((entry, i) => /* @__PURE__ */ jsxs56("li", { className: "flex items-center gap-2", children: [
|
|
5755
|
+
/* @__PURE__ */ jsx64("span", { className: "text-text-muted flex-1 truncate", children: entry.label }),
|
|
5756
|
+
/* @__PURE__ */ jsx64(
|
|
5232
5757
|
"span",
|
|
5233
5758
|
{
|
|
5234
5759
|
className: cn(
|
|
@@ -5246,21 +5771,21 @@ var HealthScore = forwardRef61(function HealthScore2({
|
|
|
5246
5771
|
HealthScore.displayName = "HealthScore";
|
|
5247
5772
|
|
|
5248
5773
|
// src/patterns/LargeTitle/LargeTitle.tsx
|
|
5249
|
-
import { forwardRef as
|
|
5250
|
-
import { jsx as
|
|
5251
|
-
var LargeTitle =
|
|
5252
|
-
return /* @__PURE__ */
|
|
5774
|
+
import { forwardRef as forwardRef63 } from "react";
|
|
5775
|
+
import { jsx as jsx65, jsxs as jsxs57 } from "react/jsx-runtime";
|
|
5776
|
+
var LargeTitle = forwardRef63(function LargeTitle2({ title, eyebrow, trailing, className, ...props }, ref) {
|
|
5777
|
+
return /* @__PURE__ */ jsxs57(
|
|
5253
5778
|
"header",
|
|
5254
5779
|
{
|
|
5255
5780
|
ref,
|
|
5256
5781
|
className: cn("px-screen flex items-end justify-between gap-3 py-3 pb-4", className),
|
|
5257
5782
|
...props,
|
|
5258
5783
|
children: [
|
|
5259
|
-
/* @__PURE__ */
|
|
5260
|
-
eyebrow && /* @__PURE__ */
|
|
5261
|
-
/* @__PURE__ */
|
|
5784
|
+
/* @__PURE__ */ jsxs57("div", { className: "min-w-0 flex-1", children: [
|
|
5785
|
+
eyebrow && /* @__PURE__ */ jsx65("div", { className: "text-m-eyebrow text-accent mb-[6px] font-mono tracking-wide uppercase", children: eyebrow }),
|
|
5786
|
+
/* @__PURE__ */ jsx65("h1", { className: "text-m-h1 m-0 truncate leading-tight font-medium tracking-tight", children: title })
|
|
5262
5787
|
] }),
|
|
5263
|
-
trailing && /* @__PURE__ */
|
|
5788
|
+
trailing && /* @__PURE__ */ jsx65("div", { className: "shrink-0", children: trailing })
|
|
5264
5789
|
]
|
|
5265
5790
|
}
|
|
5266
5791
|
);
|
|
@@ -5269,10 +5794,10 @@ LargeTitle.displayName = "LargeTitle";
|
|
|
5269
5794
|
|
|
5270
5795
|
// src/patterns/Menubar/Menubar.tsx
|
|
5271
5796
|
import * as RadixMenubar from "@radix-ui/react-menubar";
|
|
5272
|
-
import { forwardRef as
|
|
5273
|
-
import { jsx as
|
|
5274
|
-
var Menubar =
|
|
5275
|
-
return /* @__PURE__ */
|
|
5797
|
+
import { forwardRef as forwardRef64 } from "react";
|
|
5798
|
+
import { jsx as jsx66, jsxs as jsxs58 } from "react/jsx-runtime";
|
|
5799
|
+
var Menubar = forwardRef64(function Menubar2({ className, ...props }, ref) {
|
|
5800
|
+
return /* @__PURE__ */ jsx66(
|
|
5276
5801
|
RadixMenubar.Root,
|
|
5277
5802
|
{
|
|
5278
5803
|
ref,
|
|
@@ -5286,9 +5811,9 @@ var Menubar = forwardRef63(function Menubar2({ className, ...props }, ref) {
|
|
|
5286
5811
|
});
|
|
5287
5812
|
Menubar.displayName = "Menubar";
|
|
5288
5813
|
var MenubarMenu = RadixMenubar.Menu;
|
|
5289
|
-
var MenubarTrigger =
|
|
5814
|
+
var MenubarTrigger = forwardRef64(
|
|
5290
5815
|
function MenubarTrigger2({ className, ...props }, ref) {
|
|
5291
|
-
return /* @__PURE__ */
|
|
5816
|
+
return /* @__PURE__ */ jsx66(
|
|
5292
5817
|
RadixMenubar.Trigger,
|
|
5293
5818
|
{
|
|
5294
5819
|
ref,
|
|
@@ -5305,9 +5830,9 @@ var MenubarTrigger = forwardRef63(
|
|
|
5305
5830
|
}
|
|
5306
5831
|
);
|
|
5307
5832
|
MenubarTrigger.displayName = "MenubarTrigger";
|
|
5308
|
-
var MenubarContent =
|
|
5833
|
+
var MenubarContent = forwardRef64(
|
|
5309
5834
|
function MenubarContent2({ className, sideOffset = 6, align = "start", ...props }, ref) {
|
|
5310
|
-
return /* @__PURE__ */
|
|
5835
|
+
return /* @__PURE__ */ jsx66(RadixMenubar.Portal, { children: /* @__PURE__ */ jsx66(
|
|
5311
5836
|
RadixMenubar.Content,
|
|
5312
5837
|
{
|
|
5313
5838
|
ref,
|
|
@@ -5329,24 +5854,24 @@ var itemBase3 = cn(
|
|
|
5329
5854
|
"data-[highlighted]:bg-panel-2",
|
|
5330
5855
|
"data-[disabled]:opacity-40 data-[disabled]:cursor-not-allowed"
|
|
5331
5856
|
);
|
|
5332
|
-
var MenubarItem =
|
|
5333
|
-
return /* @__PURE__ */
|
|
5857
|
+
var MenubarItem = forwardRef64(function MenubarItem2({ trailing, destructive, className, children, ...props }, ref) {
|
|
5858
|
+
return /* @__PURE__ */ jsxs58(
|
|
5334
5859
|
RadixMenubar.Item,
|
|
5335
5860
|
{
|
|
5336
5861
|
ref,
|
|
5337
5862
|
className: cn(itemBase3, destructive ? "text-err" : "text-text", className),
|
|
5338
5863
|
...props,
|
|
5339
5864
|
children: [
|
|
5340
|
-
/* @__PURE__ */
|
|
5341
|
-
trailing && /* @__PURE__ */
|
|
5865
|
+
/* @__PURE__ */ jsx66("span", { className: "flex-1", children }),
|
|
5866
|
+
trailing && /* @__PURE__ */ jsx66("span", { className: "text-text-dim font-mono text-[10px]", children: trailing })
|
|
5342
5867
|
]
|
|
5343
5868
|
}
|
|
5344
5869
|
);
|
|
5345
5870
|
});
|
|
5346
5871
|
MenubarItem.displayName = "MenubarItem";
|
|
5347
|
-
var MenubarSeparator =
|
|
5872
|
+
var MenubarSeparator = forwardRef64(
|
|
5348
5873
|
function MenubarSeparator2({ className, ...props }, ref) {
|
|
5349
|
-
return /* @__PURE__ */
|
|
5874
|
+
return /* @__PURE__ */ jsx66(
|
|
5350
5875
|
RadixMenubar.Separator,
|
|
5351
5876
|
{
|
|
5352
5877
|
ref,
|
|
@@ -5361,22 +5886,22 @@ MenubarSeparator.displayName = "MenubarSeparator";
|
|
|
5361
5886
|
// src/patterns/NavBar/NavBar.tsx
|
|
5362
5887
|
import * as RadixNav from "@radix-ui/react-navigation-menu";
|
|
5363
5888
|
import {
|
|
5364
|
-
forwardRef as
|
|
5889
|
+
forwardRef as forwardRef66,
|
|
5365
5890
|
useCallback as useCallback14,
|
|
5366
5891
|
useEffect as useEffect15,
|
|
5367
5892
|
useRef as useRef13,
|
|
5368
|
-
useState as
|
|
5893
|
+
useState as useState19
|
|
5369
5894
|
} from "react";
|
|
5370
5895
|
|
|
5371
5896
|
// src/patterns/Sidebar/Sidebar.tsx
|
|
5372
5897
|
import {
|
|
5373
|
-
forwardRef as
|
|
5898
|
+
forwardRef as forwardRef65,
|
|
5374
5899
|
useCallback as useCallback13,
|
|
5375
|
-
useState as
|
|
5900
|
+
useState as useState18
|
|
5376
5901
|
} from "react";
|
|
5377
|
-
import { Fragment as Fragment4, jsx as
|
|
5378
|
-
var Sidebar =
|
|
5379
|
-
return /* @__PURE__ */
|
|
5902
|
+
import { Fragment as Fragment4, jsx as jsx67, jsxs as jsxs59 } from "react/jsx-runtime";
|
|
5903
|
+
var Sidebar = forwardRef65(function Sidebar2({ width = 240, className, style, ...props }, ref) {
|
|
5904
|
+
return /* @__PURE__ */ jsx67(
|
|
5380
5905
|
"aside",
|
|
5381
5906
|
{
|
|
5382
5907
|
ref,
|
|
@@ -5390,12 +5915,12 @@ var Sidebar = forwardRef64(function Sidebar2({ width = 240, className, style, ..
|
|
|
5390
5915
|
);
|
|
5391
5916
|
});
|
|
5392
5917
|
Sidebar.displayName = "Sidebar";
|
|
5393
|
-
var NavItem =
|
|
5918
|
+
var NavItem = forwardRef65(
|
|
5394
5919
|
function NavItem2({ icon, label, active, badge, href, disabled, className, ...props }, ref) {
|
|
5395
|
-
const inner = /* @__PURE__ */
|
|
5396
|
-
icon && /* @__PURE__ */
|
|
5397
|
-
/* @__PURE__ */
|
|
5398
|
-
badge != null && /* @__PURE__ */
|
|
5920
|
+
const inner = /* @__PURE__ */ jsxs59(Fragment4, { children: [
|
|
5921
|
+
icon && /* @__PURE__ */ jsx67("span", { "aria-hidden": true, className: "w-[14px] text-center opacity-80", children: icon }),
|
|
5922
|
+
/* @__PURE__ */ jsx67("span", { className: "flex-1 truncate", children: label }),
|
|
5923
|
+
badge != null && /* @__PURE__ */ jsx67(
|
|
5399
5924
|
"span",
|
|
5400
5925
|
{
|
|
5401
5926
|
className: cn(
|
|
@@ -5416,7 +5941,7 @@ var NavItem = forwardRef64(
|
|
|
5416
5941
|
);
|
|
5417
5942
|
if (href) {
|
|
5418
5943
|
const anchorProps = props;
|
|
5419
|
-
return /* @__PURE__ */
|
|
5944
|
+
return /* @__PURE__ */ jsx67(
|
|
5420
5945
|
"a",
|
|
5421
5946
|
{
|
|
5422
5947
|
ref,
|
|
@@ -5430,7 +5955,7 @@ var NavItem = forwardRef64(
|
|
|
5430
5955
|
);
|
|
5431
5956
|
}
|
|
5432
5957
|
const buttonProps = props;
|
|
5433
|
-
return /* @__PURE__ */
|
|
5958
|
+
return /* @__PURE__ */ jsx67(
|
|
5434
5959
|
"button",
|
|
5435
5960
|
{
|
|
5436
5961
|
ref,
|
|
@@ -5445,7 +5970,7 @@ var NavItem = forwardRef64(
|
|
|
5445
5970
|
}
|
|
5446
5971
|
);
|
|
5447
5972
|
NavItem.displayName = "NavItem";
|
|
5448
|
-
var NavSection =
|
|
5973
|
+
var NavSection = forwardRef65(function NavSection2({
|
|
5449
5974
|
label,
|
|
5450
5975
|
icon,
|
|
5451
5976
|
action,
|
|
@@ -5459,7 +5984,7 @@ var NavSection = forwardRef64(function NavSection2({
|
|
|
5459
5984
|
...props
|
|
5460
5985
|
}, ref) {
|
|
5461
5986
|
const isControlled = open !== void 0;
|
|
5462
|
-
const [internalOpen, setInternalOpen] =
|
|
5987
|
+
const [internalOpen, setInternalOpen] = useState18(defaultOpen);
|
|
5463
5988
|
const isOpen = !collapsible || (isControlled ? open : internalOpen);
|
|
5464
5989
|
const toggle = useCallback13(() => {
|
|
5465
5990
|
const next = !isOpen;
|
|
@@ -5467,8 +5992,8 @@ var NavSection = forwardRef64(function NavSection2({
|
|
|
5467
5992
|
onOpenChange?.(next);
|
|
5468
5993
|
}, [isOpen, isControlled, onOpenChange]);
|
|
5469
5994
|
const eyebrowClass = "text-text-dim flex items-center gap-[6px] px-2 pt-2 font-mono text-[9px] tracking-[1.4px] uppercase";
|
|
5470
|
-
return /* @__PURE__ */
|
|
5471
|
-
collapsible ? /* @__PURE__ */
|
|
5995
|
+
return /* @__PURE__ */ jsxs59("div", { ref, className: cn("flex flex-col gap-1", className), ...props, children: [
|
|
5996
|
+
collapsible ? /* @__PURE__ */ jsxs59(
|
|
5472
5997
|
"button",
|
|
5473
5998
|
{
|
|
5474
5999
|
type: "button",
|
|
@@ -5481,18 +6006,18 @@ var NavSection = forwardRef64(function NavSection2({
|
|
|
5481
6006
|
"hover:text-text-muted"
|
|
5482
6007
|
),
|
|
5483
6008
|
children: [
|
|
5484
|
-
icon != null && /* @__PURE__ */
|
|
5485
|
-
/* @__PURE__ */
|
|
6009
|
+
icon != null && /* @__PURE__ */ jsx67("span", { "aria-hidden": true, className: "opacity-80", children: icon }),
|
|
6010
|
+
/* @__PURE__ */ jsx67("span", { className: "flex-1 text-left", children: label }),
|
|
5486
6011
|
action,
|
|
5487
|
-
/* @__PURE__ */
|
|
6012
|
+
/* @__PURE__ */ jsx67("span", { "aria-hidden": true, className: "text-[10px] opacity-70", children: isOpen ? "\u25BE" : "\u25B8" })
|
|
5488
6013
|
]
|
|
5489
6014
|
}
|
|
5490
|
-
) : /* @__PURE__ */
|
|
5491
|
-
icon != null && /* @__PURE__ */
|
|
5492
|
-
/* @__PURE__ */
|
|
6015
|
+
) : /* @__PURE__ */ jsxs59("div", { className: eyebrowClass, children: [
|
|
6016
|
+
icon != null && /* @__PURE__ */ jsx67("span", { "aria-hidden": true, className: "opacity-80", children: icon }),
|
|
6017
|
+
/* @__PURE__ */ jsx67("span", { className: "flex-1", children: label }),
|
|
5493
6018
|
action
|
|
5494
6019
|
] }),
|
|
5495
|
-
isOpen && /* @__PURE__ */
|
|
6020
|
+
isOpen && /* @__PURE__ */ jsx67(
|
|
5496
6021
|
"div",
|
|
5497
6022
|
{
|
|
5498
6023
|
className: cn("flex flex-col gap-[2px]", indent > 0 && "border-border ml-2 border-l"),
|
|
@@ -5505,12 +6030,12 @@ var NavSection = forwardRef64(function NavSection2({
|
|
|
5505
6030
|
NavSection.displayName = "NavSection";
|
|
5506
6031
|
|
|
5507
6032
|
// src/patterns/NavBar/NavBar.tsx
|
|
5508
|
-
import { Fragment as Fragment5, jsx as
|
|
6033
|
+
import { Fragment as Fragment5, jsx as jsx68, jsxs as jsxs60 } from "react/jsx-runtime";
|
|
5509
6034
|
function isActiveTree(item, activeId) {
|
|
5510
6035
|
if (item.id === activeId) return true;
|
|
5511
6036
|
return item.children?.some((c) => isActiveTree(c, activeId)) ?? false;
|
|
5512
6037
|
}
|
|
5513
|
-
var NavBar =
|
|
6038
|
+
var NavBar = forwardRef66(function NavBar2({
|
|
5514
6039
|
orientation = "horizontal",
|
|
5515
6040
|
items,
|
|
5516
6041
|
brand,
|
|
@@ -5524,9 +6049,9 @@ var NavBar = forwardRef65(function NavBar2({
|
|
|
5524
6049
|
...props
|
|
5525
6050
|
}, ref) {
|
|
5526
6051
|
const isControlled = value !== void 0;
|
|
5527
|
-
const [internalValue, setInternalValue] =
|
|
6052
|
+
const [internalValue, setInternalValue] = useState19(defaultValue);
|
|
5528
6053
|
const activeId = isControlled ? value : internalValue;
|
|
5529
|
-
const [drawerOpen, setDrawerOpen] =
|
|
6054
|
+
const [drawerOpen, setDrawerOpen] = useState19(false);
|
|
5530
6055
|
const select = useCallback14(
|
|
5531
6056
|
(id) => {
|
|
5532
6057
|
if (!isControlled) setInternalValue(id);
|
|
@@ -5546,7 +6071,7 @@ var NavBar = forwardRef65(function NavBar2({
|
|
|
5546
6071
|
// drawer is open on a viewport that's resizing past `md`, both navs can
|
|
5547
6072
|
// sit in the DOM together. Identical accessible names would trip axe's
|
|
5548
6073
|
// `landmark-unique` rule.
|
|
5549
|
-
/* @__PURE__ */
|
|
6074
|
+
/* @__PURE__ */ jsx68("nav", { "aria-label": "Mobile navigation", className: "flex flex-col gap-1", children: items.map((item) => /* @__PURE__ */ jsx68(
|
|
5550
6075
|
VerticalItem,
|
|
5551
6076
|
{
|
|
5552
6077
|
item,
|
|
@@ -5556,14 +6081,14 @@ var NavBar = forwardRef65(function NavBar2({
|
|
|
5556
6081
|
item.id
|
|
5557
6082
|
)) })
|
|
5558
6083
|
);
|
|
5559
|
-
const mobileBar = responsive ? /* @__PURE__ */
|
|
6084
|
+
const mobileBar = responsive ? /* @__PURE__ */ jsxs60(
|
|
5560
6085
|
"div",
|
|
5561
6086
|
{
|
|
5562
6087
|
className: cn(
|
|
5563
6088
|
"border-border bg-panel z-overlay sticky top-0 flex h-[52px] items-center gap-4 border-b px-5 md:hidden"
|
|
5564
6089
|
),
|
|
5565
6090
|
children: [
|
|
5566
|
-
/* @__PURE__ */
|
|
6091
|
+
/* @__PURE__ */ jsx68(
|
|
5567
6092
|
"button",
|
|
5568
6093
|
{
|
|
5569
6094
|
type: "button",
|
|
@@ -5573,15 +6098,15 @@ var NavBar = forwardRef65(function NavBar2({
|
|
|
5573
6098
|
children: "\u2630"
|
|
5574
6099
|
}
|
|
5575
6100
|
),
|
|
5576
|
-
brand && /* @__PURE__ */
|
|
5577
|
-
actions && /* @__PURE__ */
|
|
6101
|
+
brand && /* @__PURE__ */ jsx68("div", { className: "flex flex-1 items-center text-[13px] font-medium whitespace-nowrap", children: brand }),
|
|
6102
|
+
actions && /* @__PURE__ */ jsx68("div", { className: "flex items-center gap-3", children: actions })
|
|
5578
6103
|
]
|
|
5579
6104
|
}
|
|
5580
6105
|
) : null;
|
|
5581
6106
|
if (orientation === "horizontal") {
|
|
5582
|
-
return /* @__PURE__ */
|
|
6107
|
+
return /* @__PURE__ */ jsxs60(Fragment5, { children: [
|
|
5583
6108
|
mobileBar,
|
|
5584
|
-
/* @__PURE__ */
|
|
6109
|
+
/* @__PURE__ */ jsxs60(
|
|
5585
6110
|
"header",
|
|
5586
6111
|
{
|
|
5587
6112
|
ref,
|
|
@@ -5592,10 +6117,10 @@ var NavBar = forwardRef65(function NavBar2({
|
|
|
5592
6117
|
),
|
|
5593
6118
|
...props,
|
|
5594
6119
|
children: [
|
|
5595
|
-
brand && /* @__PURE__ */
|
|
5596
|
-
/* @__PURE__ */
|
|
5597
|
-
/* @__PURE__ */
|
|
5598
|
-
(item) => item.children?.length ? /* @__PURE__ */
|
|
6120
|
+
brand && /* @__PURE__ */ jsx68("div", { className: "shrink-0 text-[13px] font-medium whitespace-nowrap", children: brand }),
|
|
6121
|
+
/* @__PURE__ */ jsxs60(RadixNav.Root, { className: "relative flex-1", delayDuration: 120, children: [
|
|
6122
|
+
/* @__PURE__ */ jsx68(RadixNav.List, { className: "m-0! flex list-none! items-center gap-1 p-0! [&_li]:m-0!", children: items.map(
|
|
6123
|
+
(item) => item.children?.length ? /* @__PURE__ */ jsx68(
|
|
5599
6124
|
HorizontalDropdown,
|
|
5600
6125
|
{
|
|
5601
6126
|
item,
|
|
@@ -5604,7 +6129,7 @@ var NavBar = forwardRef65(function NavBar2({
|
|
|
5604
6129
|
onActivate: handleItemActivate
|
|
5605
6130
|
},
|
|
5606
6131
|
item.id
|
|
5607
|
-
) : /* @__PURE__ */
|
|
6132
|
+
) : /* @__PURE__ */ jsx68(RadixNav.Item, { children: /* @__PURE__ */ jsx68(
|
|
5608
6133
|
HorizontalLink,
|
|
5609
6134
|
{
|
|
5610
6135
|
item,
|
|
@@ -5613,13 +6138,13 @@ var NavBar = forwardRef65(function NavBar2({
|
|
|
5613
6138
|
}
|
|
5614
6139
|
) }, item.id)
|
|
5615
6140
|
) }),
|
|
5616
|
-
/* @__PURE__ */
|
|
6141
|
+
/* @__PURE__ */ jsx68("div", { className: "z-popover absolute top-full left-0 flex justify-start", children: /* @__PURE__ */ jsx68(RadixNav.Viewport, { className: "origin-top-left data-[state=open]:animate-[ship-fade-in_120ms_var(--easing-out)]" }) })
|
|
5617
6142
|
] }),
|
|
5618
|
-
actions && /* @__PURE__ */
|
|
6143
|
+
actions && /* @__PURE__ */ jsx68("div", { className: "flex items-center gap-3", children: actions })
|
|
5619
6144
|
]
|
|
5620
6145
|
}
|
|
5621
6146
|
),
|
|
5622
|
-
responsive && /* @__PURE__ */
|
|
6147
|
+
responsive && /* @__PURE__ */ jsx68(
|
|
5623
6148
|
Drawer,
|
|
5624
6149
|
{
|
|
5625
6150
|
open: drawerOpen,
|
|
@@ -5632,9 +6157,9 @@ var NavBar = forwardRef65(function NavBar2({
|
|
|
5632
6157
|
)
|
|
5633
6158
|
] });
|
|
5634
6159
|
}
|
|
5635
|
-
return /* @__PURE__ */
|
|
6160
|
+
return /* @__PURE__ */ jsxs60(Fragment5, { children: [
|
|
5636
6161
|
mobileBar,
|
|
5637
|
-
/* @__PURE__ */
|
|
6162
|
+
/* @__PURE__ */ jsxs60(
|
|
5638
6163
|
"aside",
|
|
5639
6164
|
{
|
|
5640
6165
|
ref,
|
|
@@ -5647,8 +6172,8 @@ var NavBar = forwardRef65(function NavBar2({
|
|
|
5647
6172
|
),
|
|
5648
6173
|
...props,
|
|
5649
6174
|
children: [
|
|
5650
|
-
brand && /* @__PURE__ */
|
|
5651
|
-
/* @__PURE__ */
|
|
6175
|
+
brand && /* @__PURE__ */ jsx68("div", { className: "px-2 py-1 text-[13px] font-medium", children: brand }),
|
|
6176
|
+
/* @__PURE__ */ jsx68("nav", { "aria-label": "Sidebar navigation", className: "flex flex-1 flex-col gap-1 overflow-y-auto", children: items.map((item) => /* @__PURE__ */ jsx68(
|
|
5652
6177
|
VerticalItem,
|
|
5653
6178
|
{
|
|
5654
6179
|
item,
|
|
@@ -5657,11 +6182,11 @@ var NavBar = forwardRef65(function NavBar2({
|
|
|
5657
6182
|
},
|
|
5658
6183
|
item.id
|
|
5659
6184
|
)) }),
|
|
5660
|
-
actions && /* @__PURE__ */
|
|
6185
|
+
actions && /* @__PURE__ */ jsx68("div", { className: "border-border mt-auto flex flex-col gap-2 border-t pt-3", children: actions })
|
|
5661
6186
|
]
|
|
5662
6187
|
}
|
|
5663
6188
|
),
|
|
5664
|
-
responsive && /* @__PURE__ */
|
|
6189
|
+
responsive && /* @__PURE__ */ jsx68(
|
|
5665
6190
|
Drawer,
|
|
5666
6191
|
{
|
|
5667
6192
|
open: drawerOpen,
|
|
@@ -5690,13 +6215,13 @@ function HorizontalLink({ item, active, onActivate }) {
|
|
|
5690
6215
|
}
|
|
5691
6216
|
onActivate(item.id);
|
|
5692
6217
|
};
|
|
5693
|
-
const inner = /* @__PURE__ */
|
|
5694
|
-
item.icon != null && /* @__PURE__ */
|
|
5695
|
-
/* @__PURE__ */
|
|
5696
|
-
item.badge != null && /* @__PURE__ */
|
|
6218
|
+
const inner = /* @__PURE__ */ jsxs60(Fragment5, { children: [
|
|
6219
|
+
item.icon != null && /* @__PURE__ */ jsx68("span", { "aria-hidden": true, className: "opacity-80", children: item.icon }),
|
|
6220
|
+
/* @__PURE__ */ jsx68("span", { children: item.label }),
|
|
6221
|
+
item.badge != null && /* @__PURE__ */ jsx68(ItemBadge, { active, children: item.badge })
|
|
5697
6222
|
] });
|
|
5698
6223
|
if (item.href) {
|
|
5699
|
-
return /* @__PURE__ */
|
|
6224
|
+
return /* @__PURE__ */ jsx68(RadixNav.Link, { asChild: true, active, children: /* @__PURE__ */ jsx68(
|
|
5700
6225
|
"a",
|
|
5701
6226
|
{
|
|
5702
6227
|
href: item.href,
|
|
@@ -5708,7 +6233,7 @@ function HorizontalLink({ item, active, onActivate }) {
|
|
|
5708
6233
|
}
|
|
5709
6234
|
) });
|
|
5710
6235
|
}
|
|
5711
|
-
return /* @__PURE__ */
|
|
6236
|
+
return /* @__PURE__ */ jsx68(RadixNav.Link, { asChild: true, active, children: /* @__PURE__ */ jsx68(
|
|
5712
6237
|
"button",
|
|
5713
6238
|
{
|
|
5714
6239
|
type: "button",
|
|
@@ -5721,8 +6246,8 @@ function HorizontalLink({ item, active, onActivate }) {
|
|
|
5721
6246
|
) });
|
|
5722
6247
|
}
|
|
5723
6248
|
function HorizontalDropdown({ item, active, activeId, onActivate }) {
|
|
5724
|
-
return /* @__PURE__ */
|
|
5725
|
-
/* @__PURE__ */
|
|
6249
|
+
return /* @__PURE__ */ jsxs60(RadixNav.Item, { children: [
|
|
6250
|
+
/* @__PURE__ */ jsxs60(
|
|
5726
6251
|
RadixNav.Trigger,
|
|
5727
6252
|
{
|
|
5728
6253
|
className: cn(
|
|
@@ -5734,9 +6259,9 @@ function HorizontalDropdown({ item, active, activeId, onActivate }) {
|
|
|
5734
6259
|
),
|
|
5735
6260
|
disabled: item.disabled,
|
|
5736
6261
|
children: [
|
|
5737
|
-
item.icon != null && /* @__PURE__ */
|
|
5738
|
-
/* @__PURE__ */
|
|
5739
|
-
/* @__PURE__ */
|
|
6262
|
+
item.icon != null && /* @__PURE__ */ jsx68("span", { "aria-hidden": true, className: "opacity-80", children: item.icon }),
|
|
6263
|
+
/* @__PURE__ */ jsx68("span", { children: item.label }),
|
|
6264
|
+
/* @__PURE__ */ jsx68(
|
|
5740
6265
|
"span",
|
|
5741
6266
|
{
|
|
5742
6267
|
"aria-hidden": true,
|
|
@@ -5747,7 +6272,7 @@ function HorizontalDropdown({ item, active, activeId, onActivate }) {
|
|
|
5747
6272
|
]
|
|
5748
6273
|
}
|
|
5749
6274
|
),
|
|
5750
|
-
/* @__PURE__ */
|
|
6275
|
+
/* @__PURE__ */ jsx68(RadixNav.Content, { className: "border-border bg-panel min-w-[220px] rounded-xs border p-2 shadow-lg", children: /* @__PURE__ */ jsx68("ul", { className: "m-0! flex list-none! flex-col gap-[2px] p-0! [&_li]:m-0!", children: item.children.map((child) => /* @__PURE__ */ jsx68("li", { children: /* @__PURE__ */ jsx68(DropdownLink, { item: child, active: child.id === activeId, onActivate }) }, child.id)) }) })
|
|
5751
6276
|
] });
|
|
5752
6277
|
}
|
|
5753
6278
|
function DropdownLink({ item, active, onActivate }) {
|
|
@@ -5764,13 +6289,13 @@ function DropdownLink({ item, active, onActivate }) {
|
|
|
5764
6289
|
}
|
|
5765
6290
|
onActivate(item.id);
|
|
5766
6291
|
};
|
|
5767
|
-
const inner = /* @__PURE__ */
|
|
5768
|
-
item.icon != null && /* @__PURE__ */
|
|
5769
|
-
/* @__PURE__ */
|
|
5770
|
-
item.badge != null && /* @__PURE__ */
|
|
6292
|
+
const inner = /* @__PURE__ */ jsxs60(Fragment5, { children: [
|
|
6293
|
+
item.icon != null && /* @__PURE__ */ jsx68("span", { "aria-hidden": true, className: "opacity-80", children: item.icon }),
|
|
6294
|
+
/* @__PURE__ */ jsx68("span", { className: "flex-1", children: item.label }),
|
|
6295
|
+
item.badge != null && /* @__PURE__ */ jsx68(ItemBadge, { active, children: item.badge })
|
|
5771
6296
|
] });
|
|
5772
6297
|
if (item.href) {
|
|
5773
|
-
return /* @__PURE__ */
|
|
6298
|
+
return /* @__PURE__ */ jsx68(RadixNav.Link, { asChild: true, active, children: /* @__PURE__ */ jsx68(
|
|
5774
6299
|
"a",
|
|
5775
6300
|
{
|
|
5776
6301
|
href: item.href,
|
|
@@ -5782,7 +6307,7 @@ function DropdownLink({ item, active, onActivate }) {
|
|
|
5782
6307
|
}
|
|
5783
6308
|
) });
|
|
5784
6309
|
}
|
|
5785
|
-
return /* @__PURE__ */
|
|
6310
|
+
return /* @__PURE__ */ jsx68(RadixNav.Link, { asChild: true, active, children: /* @__PURE__ */ jsx68(
|
|
5786
6311
|
"button",
|
|
5787
6312
|
{
|
|
5788
6313
|
type: "button",
|
|
@@ -5797,7 +6322,7 @@ function DropdownLink({ item, active, onActivate }) {
|
|
|
5797
6322
|
function VerticalItem({ item, activeId, onActivate }) {
|
|
5798
6323
|
const hasChildren = (item.children?.length ?? 0) > 0;
|
|
5799
6324
|
const treeActive = isActiveTree(item, activeId);
|
|
5800
|
-
const [open, setOpen] =
|
|
6325
|
+
const [open, setOpen] = useState19(treeActive);
|
|
5801
6326
|
const prevTreeActive = useRef13(treeActive);
|
|
5802
6327
|
useEffect15(() => {
|
|
5803
6328
|
if (treeActive && !prevTreeActive.current) setOpen(true);
|
|
@@ -5811,7 +6336,7 @@ function VerticalItem({ item, activeId, onActivate }) {
|
|
|
5811
6336
|
}
|
|
5812
6337
|
onActivate(item.id);
|
|
5813
6338
|
};
|
|
5814
|
-
return /* @__PURE__ */
|
|
6339
|
+
return /* @__PURE__ */ jsx68(
|
|
5815
6340
|
NavItem,
|
|
5816
6341
|
{
|
|
5817
6342
|
icon: item.icon,
|
|
@@ -5824,8 +6349,8 @@ function VerticalItem({ item, activeId, onActivate }) {
|
|
|
5824
6349
|
}
|
|
5825
6350
|
);
|
|
5826
6351
|
}
|
|
5827
|
-
return /* @__PURE__ */
|
|
5828
|
-
/* @__PURE__ */
|
|
6352
|
+
return /* @__PURE__ */ jsxs60("div", { className: "flex flex-col", children: [
|
|
6353
|
+
/* @__PURE__ */ jsxs60(
|
|
5829
6354
|
"button",
|
|
5830
6355
|
{
|
|
5831
6356
|
type: "button",
|
|
@@ -5841,18 +6366,18 @@ function VerticalItem({ item, activeId, onActivate }) {
|
|
|
5841
6366
|
item.disabled && "pointer-events-none opacity-50"
|
|
5842
6367
|
),
|
|
5843
6368
|
children: [
|
|
5844
|
-
item.icon != null && /* @__PURE__ */
|
|
5845
|
-
/* @__PURE__ */
|
|
5846
|
-
item.badge != null && /* @__PURE__ */
|
|
5847
|
-
/* @__PURE__ */
|
|
6369
|
+
item.icon != null && /* @__PURE__ */ jsx68("span", { "aria-hidden": true, className: "w-[14px] text-center opacity-80", children: item.icon }),
|
|
6370
|
+
/* @__PURE__ */ jsx68("span", { className: "flex-1 truncate", children: item.label }),
|
|
6371
|
+
item.badge != null && /* @__PURE__ */ jsx68(ItemBadge, { active: treeActive, children: item.badge }),
|
|
6372
|
+
/* @__PURE__ */ jsx68("span", { "aria-hidden": true, className: "text-[10px] opacity-60", children: open ? "\u25BE" : "\u25B8" })
|
|
5848
6373
|
]
|
|
5849
6374
|
}
|
|
5850
6375
|
),
|
|
5851
|
-
open && /* @__PURE__ */
|
|
6376
|
+
open && /* @__PURE__ */ jsx68("div", { className: "border-border mt-1 ml-[18px] flex flex-col gap-[2px] border-l pl-3", children: item.children.map((child) => /* @__PURE__ */ jsx68(VerticalItem, { item: child, activeId, onActivate }, child.id)) })
|
|
5852
6377
|
] });
|
|
5853
6378
|
}
|
|
5854
6379
|
function ItemBadge({ active, children }) {
|
|
5855
|
-
return /* @__PURE__ */
|
|
6380
|
+
return /* @__PURE__ */ jsx68(
|
|
5856
6381
|
"span",
|
|
5857
6382
|
{
|
|
5858
6383
|
className: cn(
|
|
@@ -5865,8 +6390,8 @@ function ItemBadge({ active, children }) {
|
|
|
5865
6390
|
}
|
|
5866
6391
|
|
|
5867
6392
|
// src/patterns/OnboardingChecklist/OnboardingChecklist.tsx
|
|
5868
|
-
import { forwardRef as
|
|
5869
|
-
import { Fragment as Fragment6, jsx as
|
|
6393
|
+
import { forwardRef as forwardRef67 } from "react";
|
|
6394
|
+
import { Fragment as Fragment6, jsx as jsx69, jsxs as jsxs61 } from "react/jsx-runtime";
|
|
5870
6395
|
var statusDot = {
|
|
5871
6396
|
pending: "off",
|
|
5872
6397
|
"in-progress": "sync",
|
|
@@ -5877,11 +6402,11 @@ var labelStateClass = {
|
|
|
5877
6402
|
"in-progress": "text-text",
|
|
5878
6403
|
done: "text-text-dim line-through"
|
|
5879
6404
|
};
|
|
5880
|
-
var OnboardingChecklist =
|
|
6405
|
+
var OnboardingChecklist = forwardRef67(
|
|
5881
6406
|
function OnboardingChecklist2({ items, onItemClick, title = "Get started", progressLabel, hideProgress, className, ...props }, ref) {
|
|
5882
6407
|
const total = items.length;
|
|
5883
6408
|
const done = items.filter((i) => i.status === "done").length;
|
|
5884
|
-
return /* @__PURE__ */
|
|
6409
|
+
return /* @__PURE__ */ jsxs61(
|
|
5885
6410
|
"section",
|
|
5886
6411
|
{
|
|
5887
6412
|
ref,
|
|
@@ -5892,11 +6417,11 @@ var OnboardingChecklist = forwardRef66(
|
|
|
5892
6417
|
),
|
|
5893
6418
|
...props,
|
|
5894
6419
|
children: [
|
|
5895
|
-
/* @__PURE__ */
|
|
5896
|
-
/* @__PURE__ */
|
|
5897
|
-
/* @__PURE__ */
|
|
6420
|
+
/* @__PURE__ */ jsxs61("header", { className: "flex items-center gap-2", children: [
|
|
6421
|
+
/* @__PURE__ */ jsx69("span", { className: "text-[14px] font-medium", children: title }),
|
|
6422
|
+
/* @__PURE__ */ jsx69("span", { className: "text-text-dim ml-auto font-mono text-[11px] tabular-nums", children: progressLabel ?? `${done} of ${total} complete` })
|
|
5898
6423
|
] }),
|
|
5899
|
-
!hideProgress && total > 0 && /* @__PURE__ */
|
|
6424
|
+
!hideProgress && total > 0 && /* @__PURE__ */ jsx69(
|
|
5900
6425
|
"div",
|
|
5901
6426
|
{
|
|
5902
6427
|
role: "progressbar",
|
|
@@ -5905,7 +6430,7 @@ var OnboardingChecklist = forwardRef66(
|
|
|
5905
6430
|
"aria-valuenow": done,
|
|
5906
6431
|
"aria-label": typeof title === "string" ? `${title} progress` : "Setup progress",
|
|
5907
6432
|
className: "bg-panel-2 h-[3px] w-full overflow-hidden rounded-full",
|
|
5908
|
-
children: /* @__PURE__ */
|
|
6433
|
+
children: /* @__PURE__ */ jsx69(
|
|
5909
6434
|
"span",
|
|
5910
6435
|
{
|
|
5911
6436
|
"aria-hidden": true,
|
|
@@ -5918,10 +6443,10 @@ var OnboardingChecklist = forwardRef66(
|
|
|
5918
6443
|
)
|
|
5919
6444
|
}
|
|
5920
6445
|
),
|
|
5921
|
-
/* @__PURE__ */
|
|
6446
|
+
/* @__PURE__ */ jsx69("ul", { className: "m-0 flex list-none flex-col gap-1 p-0", children: items.map((item) => {
|
|
5922
6447
|
const interactive = typeof onItemClick === "function";
|
|
5923
|
-
const labelBlock = /* @__PURE__ */
|
|
5924
|
-
/* @__PURE__ */
|
|
6448
|
+
const labelBlock = /* @__PURE__ */ jsxs61(Fragment6, { children: [
|
|
6449
|
+
/* @__PURE__ */ jsx69(
|
|
5925
6450
|
StatusDot,
|
|
5926
6451
|
{
|
|
5927
6452
|
state: statusDot[item.status],
|
|
@@ -5930,17 +6455,17 @@ var OnboardingChecklist = forwardRef66(
|
|
|
5930
6455
|
className: "mt-[3px]"
|
|
5931
6456
|
}
|
|
5932
6457
|
),
|
|
5933
|
-
/* @__PURE__ */
|
|
5934
|
-
/* @__PURE__ */
|
|
5935
|
-
item.description && /* @__PURE__ */
|
|
6458
|
+
/* @__PURE__ */ jsxs61("div", { className: "flex min-w-0 flex-1 flex-col gap-[2px]", children: [
|
|
6459
|
+
/* @__PURE__ */ jsx69("span", { className: cn("text-[13px]", labelStateClass[item.status]), children: item.label }),
|
|
6460
|
+
item.description && /* @__PURE__ */ jsx69("span", { className: "text-text-muted text-[12px] leading-[1.45]", children: item.description })
|
|
5936
6461
|
] })
|
|
5937
6462
|
] });
|
|
5938
6463
|
const labelRegionClass = cn(
|
|
5939
6464
|
"flex flex-1 items-start gap-3 rounded-md px-2 py-2 text-left transition-colors duration-(--duration-micro)",
|
|
5940
6465
|
interactive && "cursor-pointer outline-none hover:bg-panel-2 focus-visible:ring-[3px] focus-visible:ring-accent-dim"
|
|
5941
6466
|
);
|
|
5942
|
-
return /* @__PURE__ */
|
|
5943
|
-
interactive ? /* @__PURE__ */
|
|
6467
|
+
return /* @__PURE__ */ jsxs61("li", { className: "flex items-start gap-2", children: [
|
|
6468
|
+
interactive ? /* @__PURE__ */ jsx69(
|
|
5944
6469
|
"button",
|
|
5945
6470
|
{
|
|
5946
6471
|
type: "button",
|
|
@@ -5949,8 +6474,8 @@ var OnboardingChecklist = forwardRef66(
|
|
|
5949
6474
|
className: labelRegionClass,
|
|
5950
6475
|
children: labelBlock
|
|
5951
6476
|
}
|
|
5952
|
-
) : /* @__PURE__ */
|
|
5953
|
-
item.action && /* @__PURE__ */
|
|
6477
|
+
) : /* @__PURE__ */ jsx69("div", { className: labelRegionClass, children: labelBlock }),
|
|
6478
|
+
item.action && /* @__PURE__ */ jsx69("div", { className: "shrink-0 self-center", children: item.action })
|
|
5954
6479
|
] }, item.id);
|
|
5955
6480
|
}) })
|
|
5956
6481
|
]
|
|
@@ -5961,8 +6486,8 @@ var OnboardingChecklist = forwardRef66(
|
|
|
5961
6486
|
OnboardingChecklist.displayName = "OnboardingChecklist";
|
|
5962
6487
|
|
|
5963
6488
|
// src/patterns/Pagination/Pagination.tsx
|
|
5964
|
-
import { forwardRef as
|
|
5965
|
-
import { jsx as
|
|
6489
|
+
import { forwardRef as forwardRef68 } from "react";
|
|
6490
|
+
import { jsx as jsx70, jsxs as jsxs62 } from "react/jsx-runtime";
|
|
5966
6491
|
function buildRange(page, total, siblings) {
|
|
5967
6492
|
if (total <= 0) return [];
|
|
5968
6493
|
const items = [];
|
|
@@ -5975,9 +6500,9 @@ function buildRange(page, total, siblings) {
|
|
|
5975
6500
|
if (total > 1) items.push(total);
|
|
5976
6501
|
return items;
|
|
5977
6502
|
}
|
|
5978
|
-
var Pagination =
|
|
6503
|
+
var Pagination = forwardRef68(function Pagination2({ page, total, onPageChange, siblings = 1, className, ...props }, ref) {
|
|
5979
6504
|
const items = buildRange(page, total, siblings);
|
|
5980
|
-
return /* @__PURE__ */
|
|
6505
|
+
return /* @__PURE__ */ jsxs62(
|
|
5981
6506
|
"nav",
|
|
5982
6507
|
{
|
|
5983
6508
|
ref,
|
|
@@ -5985,7 +6510,7 @@ var Pagination = forwardRef67(function Pagination2({ page, total, onPageChange,
|
|
|
5985
6510
|
className: cn("inline-flex items-center gap-1", className),
|
|
5986
6511
|
...props,
|
|
5987
6512
|
children: [
|
|
5988
|
-
/* @__PURE__ */
|
|
6513
|
+
/* @__PURE__ */ jsx70(
|
|
5989
6514
|
IconButton,
|
|
5990
6515
|
{
|
|
5991
6516
|
size: "sm",
|
|
@@ -5998,7 +6523,7 @@ var Pagination = forwardRef67(function Pagination2({ page, total, onPageChange,
|
|
|
5998
6523
|
),
|
|
5999
6524
|
items.map((item, i) => {
|
|
6000
6525
|
if (item === "start-ellipsis" || item === "end-ellipsis") {
|
|
6001
|
-
return /* @__PURE__ */
|
|
6526
|
+
return /* @__PURE__ */ jsx70(
|
|
6002
6527
|
"span",
|
|
6003
6528
|
{
|
|
6004
6529
|
"aria-hidden": true,
|
|
@@ -6009,7 +6534,7 @@ var Pagination = forwardRef67(function Pagination2({ page, total, onPageChange,
|
|
|
6009
6534
|
);
|
|
6010
6535
|
}
|
|
6011
6536
|
const isActive = item === page;
|
|
6012
|
-
return /* @__PURE__ */
|
|
6537
|
+
return /* @__PURE__ */ jsx70(
|
|
6013
6538
|
"button",
|
|
6014
6539
|
{
|
|
6015
6540
|
type: "button",
|
|
@@ -6027,7 +6552,7 @@ var Pagination = forwardRef67(function Pagination2({ page, total, onPageChange,
|
|
|
6027
6552
|
item
|
|
6028
6553
|
);
|
|
6029
6554
|
}),
|
|
6030
|
-
/* @__PURE__ */
|
|
6555
|
+
/* @__PURE__ */ jsx70(
|
|
6031
6556
|
IconButton,
|
|
6032
6557
|
{
|
|
6033
6558
|
size: "sm",
|
|
@@ -6045,10 +6570,10 @@ var Pagination = forwardRef67(function Pagination2({ page, total, onPageChange,
|
|
|
6045
6570
|
Pagination.displayName = "Pagination";
|
|
6046
6571
|
|
|
6047
6572
|
// src/patterns/Progress/Progress.tsx
|
|
6048
|
-
import { cva as
|
|
6049
|
-
import { forwardRef as
|
|
6050
|
-
import { jsx as
|
|
6051
|
-
var trackStyles =
|
|
6573
|
+
import { cva as cva13 } from "class-variance-authority";
|
|
6574
|
+
import { forwardRef as forwardRef69 } from "react";
|
|
6575
|
+
import { jsx as jsx71, jsxs as jsxs63 } from "react/jsx-runtime";
|
|
6576
|
+
var trackStyles = cva13("w-full rounded-full bg-panel-2 overflow-hidden", {
|
|
6052
6577
|
variants: {
|
|
6053
6578
|
size: {
|
|
6054
6579
|
sm: "h-[3px]",
|
|
@@ -6058,7 +6583,7 @@ var trackStyles = cva12("w-full rounded-full bg-panel-2 overflow-hidden", {
|
|
|
6058
6583
|
},
|
|
6059
6584
|
defaultVariants: { size: "md" }
|
|
6060
6585
|
});
|
|
6061
|
-
var fillStyles =
|
|
6586
|
+
var fillStyles = cva13("h-full rounded-full transition-[width] duration-(--duration-step)", {
|
|
6062
6587
|
variants: {
|
|
6063
6588
|
tone: {
|
|
6064
6589
|
accent: "bg-accent",
|
|
@@ -6069,7 +6594,7 @@ var fillStyles = cva12("h-full rounded-full transition-[width] duration-(--durat
|
|
|
6069
6594
|
},
|
|
6070
6595
|
defaultVariants: { tone: "accent" }
|
|
6071
6596
|
});
|
|
6072
|
-
var Progress =
|
|
6597
|
+
var Progress = forwardRef69(function Progress2({
|
|
6073
6598
|
value = 0,
|
|
6074
6599
|
max = 100,
|
|
6075
6600
|
indeterminate = false,
|
|
@@ -6083,15 +6608,15 @@ var Progress = forwardRef68(function Progress2({
|
|
|
6083
6608
|
const clamped = Math.min(max, Math.max(0, value));
|
|
6084
6609
|
const pct = max > 0 ? clamped / max * 100 : 0;
|
|
6085
6610
|
const display = Math.round(pct);
|
|
6086
|
-
return /* @__PURE__ */
|
|
6087
|
-
label != null && /* @__PURE__ */
|
|
6088
|
-
/* @__PURE__ */
|
|
6089
|
-
showValue && !indeterminate && /* @__PURE__ */
|
|
6611
|
+
return /* @__PURE__ */ jsxs63("div", { ref, className: cn("flex w-full flex-col gap-2", className), ...props, children: [
|
|
6612
|
+
label != null && /* @__PURE__ */ jsxs63("div", { className: "flex text-[12px]", children: [
|
|
6613
|
+
/* @__PURE__ */ jsx71("span", { className: "text-text-muted", children: label }),
|
|
6614
|
+
showValue && !indeterminate && /* @__PURE__ */ jsxs63("span", { className: "text-text ml-auto font-mono tabular-nums", children: [
|
|
6090
6615
|
display,
|
|
6091
6616
|
"%"
|
|
6092
6617
|
] })
|
|
6093
6618
|
] }),
|
|
6094
|
-
/* @__PURE__ */
|
|
6619
|
+
/* @__PURE__ */ jsx71(
|
|
6095
6620
|
"div",
|
|
6096
6621
|
{
|
|
6097
6622
|
role: "progressbar",
|
|
@@ -6100,7 +6625,7 @@ var Progress = forwardRef68(function Progress2({
|
|
|
6100
6625
|
"aria-valuenow": indeterminate ? void 0 : display,
|
|
6101
6626
|
"aria-label": typeof label === "string" ? label : void 0,
|
|
6102
6627
|
className: trackStyles({ size }),
|
|
6103
|
-
children: indeterminate ? /* @__PURE__ */
|
|
6628
|
+
children: indeterminate ? /* @__PURE__ */ jsx71(
|
|
6104
6629
|
"span",
|
|
6105
6630
|
{
|
|
6106
6631
|
"aria-hidden": true,
|
|
@@ -6110,7 +6635,7 @@ var Progress = forwardRef68(function Progress2({
|
|
|
6110
6635
|
"animate-[ship-indeterminate_1.4s_linear_infinite]"
|
|
6111
6636
|
)
|
|
6112
6637
|
}
|
|
6113
|
-
) : /* @__PURE__ */
|
|
6638
|
+
) : /* @__PURE__ */ jsx71("span", { "aria-hidden": true, className: fillStyles({ tone }), style: { width: `${pct}%` } })
|
|
6114
6639
|
}
|
|
6115
6640
|
)
|
|
6116
6641
|
] });
|
|
@@ -6118,18 +6643,18 @@ var Progress = forwardRef68(function Progress2({
|
|
|
6118
6643
|
Progress.displayName = "Progress";
|
|
6119
6644
|
|
|
6120
6645
|
// src/patterns/PullToRefresh/PullToRefresh.tsx
|
|
6121
|
-
import { forwardRef as
|
|
6122
|
-
import { jsx as
|
|
6646
|
+
import { forwardRef as forwardRef70 } from "react";
|
|
6647
|
+
import { jsx as jsx72, jsxs as jsxs64 } from "react/jsx-runtime";
|
|
6123
6648
|
var labels = {
|
|
6124
6649
|
idle: "Pull to refresh",
|
|
6125
6650
|
pulling: "Pull to refresh",
|
|
6126
6651
|
ready: "Release to refresh",
|
|
6127
6652
|
loading: "Refreshing\u2026"
|
|
6128
6653
|
};
|
|
6129
|
-
var PullToRefresh =
|
|
6654
|
+
var PullToRefresh = forwardRef70(function PullToRefresh2({ state = "idle", label, className, ...props }, ref) {
|
|
6130
6655
|
const isLoading = state === "loading";
|
|
6131
6656
|
const transform = state === "ready" ? "rotate(180deg)" : state === "pulling" ? "rotate(90deg)" : "rotate(0deg)";
|
|
6132
|
-
return /* @__PURE__ */
|
|
6657
|
+
return /* @__PURE__ */ jsxs64(
|
|
6133
6658
|
"div",
|
|
6134
6659
|
{
|
|
6135
6660
|
ref,
|
|
@@ -6139,7 +6664,7 @@ var PullToRefresh = forwardRef69(function PullToRefresh2({ state = "idle", label
|
|
|
6139
6664
|
className: cn("text-text-muted flex flex-col items-center gap-[6px] py-3", className),
|
|
6140
6665
|
...props,
|
|
6141
6666
|
children: [
|
|
6142
|
-
/* @__PURE__ */
|
|
6667
|
+
/* @__PURE__ */ jsx72(
|
|
6143
6668
|
"div",
|
|
6144
6669
|
{
|
|
6145
6670
|
"aria-hidden": true,
|
|
@@ -6155,7 +6680,7 @@ var PullToRefresh = forwardRef69(function PullToRefresh2({ state = "idle", label
|
|
|
6155
6680
|
}
|
|
6156
6681
|
}
|
|
6157
6682
|
),
|
|
6158
|
-
/* @__PURE__ */
|
|
6683
|
+
/* @__PURE__ */ jsx72("span", { className: "text-m-eyebrow font-mono tracking-wide uppercase", children: label ?? labels[state] })
|
|
6159
6684
|
]
|
|
6160
6685
|
}
|
|
6161
6686
|
);
|
|
@@ -6163,8 +6688,8 @@ var PullToRefresh = forwardRef69(function PullToRefresh2({ state = "idle", label
|
|
|
6163
6688
|
PullToRefresh.displayName = "PullToRefresh";
|
|
6164
6689
|
|
|
6165
6690
|
// src/patterns/Sparkline/Sparkline.tsx
|
|
6166
|
-
import { forwardRef as
|
|
6167
|
-
import { jsx as
|
|
6691
|
+
import { forwardRef as forwardRef71, useMemo as useMemo6 } from "react";
|
|
6692
|
+
import { jsx as jsx73, jsxs as jsxs65 } from "react/jsx-runtime";
|
|
6168
6693
|
function buildPath(values, w, h) {
|
|
6169
6694
|
if (values.length === 0) return { line: "", area: "" };
|
|
6170
6695
|
const pad = 2;
|
|
@@ -6183,7 +6708,7 @@ function buildPath(values, w, h) {
|
|
|
6183
6708
|
)} L${pad.toFixed(2)},${(h - pad).toFixed(2)} Z`;
|
|
6184
6709
|
return { line, area };
|
|
6185
6710
|
}
|
|
6186
|
-
var Sparkline =
|
|
6711
|
+
var Sparkline = forwardRef71(function Sparkline2({
|
|
6187
6712
|
values,
|
|
6188
6713
|
width = 160,
|
|
6189
6714
|
height = 32,
|
|
@@ -6195,7 +6720,7 @@ var Sparkline = forwardRef70(function Sparkline2({
|
|
|
6195
6720
|
...props
|
|
6196
6721
|
}, ref) {
|
|
6197
6722
|
const { line, area } = useMemo6(() => buildPath(values, width, height), [values, width, height]);
|
|
6198
|
-
return /* @__PURE__ */
|
|
6723
|
+
return /* @__PURE__ */ jsxs65(
|
|
6199
6724
|
"svg",
|
|
6200
6725
|
{
|
|
6201
6726
|
ref,
|
|
@@ -6207,8 +6732,8 @@ var Sparkline = forwardRef70(function Sparkline2({
|
|
|
6207
6732
|
className: cn("inline-block", className),
|
|
6208
6733
|
...props,
|
|
6209
6734
|
children: [
|
|
6210
|
-
fill && /* @__PURE__ */
|
|
6211
|
-
/* @__PURE__ */
|
|
6735
|
+
fill && /* @__PURE__ */ jsx73("path", { d: area, fill: stroke, fillOpacity: 0.16, stroke: "none" }),
|
|
6736
|
+
/* @__PURE__ */ jsx73(
|
|
6212
6737
|
"path",
|
|
6213
6738
|
{
|
|
6214
6739
|
d: line,
|
|
@@ -6226,16 +6751,16 @@ var Sparkline = forwardRef70(function Sparkline2({
|
|
|
6226
6751
|
Sparkline.displayName = "Sparkline";
|
|
6227
6752
|
|
|
6228
6753
|
// src/patterns/Spinner/Spinner.tsx
|
|
6229
|
-
import { forwardRef as
|
|
6230
|
-
import { jsx as
|
|
6754
|
+
import { forwardRef as forwardRef72 } from "react";
|
|
6755
|
+
import { jsx as jsx74 } from "react/jsx-runtime";
|
|
6231
6756
|
var sizes = {
|
|
6232
6757
|
sm: { box: "h-3 w-3", border: "border-[2px]" },
|
|
6233
6758
|
md: { box: "h-4 w-4", border: "border-[2px]" },
|
|
6234
6759
|
lg: { box: "h-5 w-5", border: "border-[2px]" }
|
|
6235
6760
|
};
|
|
6236
|
-
var Spinner2 =
|
|
6761
|
+
var Spinner2 = forwardRef72(function Spinner3({ size = "md", label = "Loading", className, ...props }, ref) {
|
|
6237
6762
|
const s = sizes[size];
|
|
6238
|
-
return /* @__PURE__ */
|
|
6763
|
+
return /* @__PURE__ */ jsx74(
|
|
6239
6764
|
"span",
|
|
6240
6765
|
{
|
|
6241
6766
|
ref,
|
|
@@ -6243,7 +6768,7 @@ var Spinner2 = forwardRef71(function Spinner3({ size = "md", label = "Loading",
|
|
|
6243
6768
|
"aria-label": label,
|
|
6244
6769
|
className: cn("inline-block", className),
|
|
6245
6770
|
...props,
|
|
6246
|
-
children: /* @__PURE__ */
|
|
6771
|
+
children: /* @__PURE__ */ jsx74(
|
|
6247
6772
|
"span",
|
|
6248
6773
|
{
|
|
6249
6774
|
"aria-hidden": true,
|
|
@@ -6260,8 +6785,8 @@ var Spinner2 = forwardRef71(function Spinner3({ size = "md", label = "Loading",
|
|
|
6260
6785
|
Spinner2.displayName = "Spinner";
|
|
6261
6786
|
|
|
6262
6787
|
// src/patterns/Stepper/Stepper.tsx
|
|
6263
|
-
import { forwardRef as
|
|
6264
|
-
import { jsx as
|
|
6788
|
+
import { forwardRef as forwardRef73, Fragment as Fragment7 } from "react";
|
|
6789
|
+
import { jsx as jsx75, jsxs as jsxs66 } from "react/jsx-runtime";
|
|
6265
6790
|
var dotBase = "h-6 w-6 rounded-full grid place-items-center text-[11px] font-mono font-semibold border";
|
|
6266
6791
|
var dotStateClass = {
|
|
6267
6792
|
done: "bg-accent text-on-accent border-accent",
|
|
@@ -6278,8 +6803,8 @@ function stateFor(index, current) {
|
|
|
6278
6803
|
if (index === current) return "current";
|
|
6279
6804
|
return "upcoming";
|
|
6280
6805
|
}
|
|
6281
|
-
var Stepper =
|
|
6282
|
-
return /* @__PURE__ */
|
|
6806
|
+
var Stepper = forwardRef73(function Stepper2({ steps, current, className, ...props }, ref) {
|
|
6807
|
+
return /* @__PURE__ */ jsx75(
|
|
6283
6808
|
"ol",
|
|
6284
6809
|
{
|
|
6285
6810
|
ref,
|
|
@@ -6291,19 +6816,19 @@ var Stepper = forwardRef72(function Stepper2({ steps, current, className, ...pro
|
|
|
6291
6816
|
const id = typeof step === "string" ? void 0 : step.id;
|
|
6292
6817
|
const state = stateFor(i, current);
|
|
6293
6818
|
const connectorActive = i < current;
|
|
6294
|
-
return /* @__PURE__ */
|
|
6295
|
-
/* @__PURE__ */
|
|
6819
|
+
return /* @__PURE__ */ jsxs66(Fragment7, { children: [
|
|
6820
|
+
/* @__PURE__ */ jsxs66(
|
|
6296
6821
|
"li",
|
|
6297
6822
|
{
|
|
6298
6823
|
"aria-current": state === "current" ? "step" : void 0,
|
|
6299
6824
|
className: "flex items-center gap-2",
|
|
6300
6825
|
children: [
|
|
6301
|
-
/* @__PURE__ */
|
|
6302
|
-
/* @__PURE__ */
|
|
6826
|
+
/* @__PURE__ */ jsx75("span", { "aria-hidden": true, className: cn(dotBase, dotStateClass[state]), children: state === "done" ? "\u2713" : i + 1 }),
|
|
6827
|
+
/* @__PURE__ */ jsx75("span", { className: cn("text-[12px]", labelStateClass2[state]), children: label })
|
|
6303
6828
|
]
|
|
6304
6829
|
}
|
|
6305
6830
|
),
|
|
6306
|
-
i < steps.length - 1 && /* @__PURE__ */
|
|
6831
|
+
i < steps.length - 1 && /* @__PURE__ */ jsx75(
|
|
6307
6832
|
"span",
|
|
6308
6833
|
{
|
|
6309
6834
|
"aria-hidden": true,
|
|
@@ -6319,14 +6844,14 @@ Stepper.displayName = "Stepper";
|
|
|
6319
6844
|
|
|
6320
6845
|
// src/patterns/TabBar/TabBar.tsx
|
|
6321
6846
|
import {
|
|
6322
|
-
forwardRef as
|
|
6847
|
+
forwardRef as forwardRef74,
|
|
6323
6848
|
useCallback as useCallback15,
|
|
6324
|
-
useState as
|
|
6849
|
+
useState as useState20
|
|
6325
6850
|
} from "react";
|
|
6326
|
-
import { jsx as
|
|
6327
|
-
var TabBar =
|
|
6851
|
+
import { jsx as jsx76, jsxs as jsxs67 } from "react/jsx-runtime";
|
|
6852
|
+
var TabBar = forwardRef74(function TabBar2({ items, value, defaultValue, onValueChange, className, ...props }, ref) {
|
|
6328
6853
|
const isControlled = value !== void 0;
|
|
6329
|
-
const [internalValue, setInternalValue] =
|
|
6854
|
+
const [internalValue, setInternalValue] = useState20(defaultValue);
|
|
6330
6855
|
const activeId = isControlled ? value : internalValue;
|
|
6331
6856
|
const handleSelect = useCallback15(
|
|
6332
6857
|
(id, e) => {
|
|
@@ -6336,7 +6861,7 @@ var TabBar = forwardRef73(function TabBar2({ items, value, defaultValue, onValue
|
|
|
6336
6861
|
},
|
|
6337
6862
|
[isControlled, onValueChange]
|
|
6338
6863
|
);
|
|
6339
|
-
return /* @__PURE__ */
|
|
6864
|
+
return /* @__PURE__ */ jsx76(
|
|
6340
6865
|
"nav",
|
|
6341
6866
|
{
|
|
6342
6867
|
ref,
|
|
@@ -6351,7 +6876,7 @@ var TabBar = forwardRef73(function TabBar2({ items, value, defaultValue, onValue
|
|
|
6351
6876
|
children: items.map((item) => {
|
|
6352
6877
|
const isActive = item.id === activeId;
|
|
6353
6878
|
if (item.elevated) {
|
|
6354
|
-
return /* @__PURE__ */
|
|
6879
|
+
return /* @__PURE__ */ jsx76("div", { className: "grid place-items-center", children: /* @__PURE__ */ jsxs67(
|
|
6355
6880
|
"button",
|
|
6356
6881
|
{
|
|
6357
6882
|
type: "button",
|
|
@@ -6367,13 +6892,13 @@ var TabBar = forwardRef73(function TabBar2({ items, value, defaultValue, onValue
|
|
|
6367
6892
|
"disabled:cursor-not-allowed disabled:opacity-40"
|
|
6368
6893
|
),
|
|
6369
6894
|
children: [
|
|
6370
|
-
/* @__PURE__ */
|
|
6371
|
-
/* @__PURE__ */
|
|
6895
|
+
/* @__PURE__ */ jsx76("span", { "aria-hidden": true, children: item.icon }),
|
|
6896
|
+
/* @__PURE__ */ jsx76("span", { className: "sr-only", children: item.label })
|
|
6372
6897
|
]
|
|
6373
6898
|
}
|
|
6374
6899
|
) }, item.id);
|
|
6375
6900
|
}
|
|
6376
|
-
return /* @__PURE__ */
|
|
6901
|
+
return /* @__PURE__ */ jsxs67(
|
|
6377
6902
|
"button",
|
|
6378
6903
|
{
|
|
6379
6904
|
type: "button",
|
|
@@ -6388,9 +6913,9 @@ var TabBar = forwardRef73(function TabBar2({ items, value, defaultValue, onValue
|
|
|
6388
6913
|
isActive ? "text-accent-text" : "text-text-muted hover:text-text"
|
|
6389
6914
|
),
|
|
6390
6915
|
children: [
|
|
6391
|
-
/* @__PURE__ */
|
|
6916
|
+
/* @__PURE__ */ jsxs67("span", { className: "relative inline-flex", "aria-hidden": true, children: [
|
|
6392
6917
|
item.icon,
|
|
6393
|
-
item.badge != null && /* @__PURE__ */
|
|
6918
|
+
item.badge != null && /* @__PURE__ */ jsx76(
|
|
6394
6919
|
"span",
|
|
6395
6920
|
{
|
|
6396
6921
|
className: cn(
|
|
@@ -6401,9 +6926,9 @@ var TabBar = forwardRef73(function TabBar2({ items, value, defaultValue, onValue
|
|
|
6401
6926
|
}
|
|
6402
6927
|
)
|
|
6403
6928
|
] }),
|
|
6404
|
-
/* @__PURE__ */
|
|
6929
|
+
/* @__PURE__ */ jsxs67("span", { className: "text-[10px] font-medium tracking-tight", children: [
|
|
6405
6930
|
item.label,
|
|
6406
|
-
item.badge != null && /* @__PURE__ */
|
|
6931
|
+
item.badge != null && /* @__PURE__ */ jsxs67("span", { className: "sr-only", children: [
|
|
6407
6932
|
", ",
|
|
6408
6933
|
item.badge,
|
|
6409
6934
|
" unread"
|
|
@@ -6421,11 +6946,11 @@ TabBar.displayName = "TabBar";
|
|
|
6421
6946
|
|
|
6422
6947
|
// src/patterns/Tabs/Tabs.tsx
|
|
6423
6948
|
import * as RadixTabs from "@radix-ui/react-tabs";
|
|
6424
|
-
import { cva as
|
|
6425
|
-
import { createContext as createContext2, forwardRef as
|
|
6426
|
-
import { jsx as
|
|
6949
|
+
import { cva as cva14 } from "class-variance-authority";
|
|
6950
|
+
import { createContext as createContext2, forwardRef as forwardRef75, useContext as useContext2 } from "react";
|
|
6951
|
+
import { jsx as jsx77 } from "react/jsx-runtime";
|
|
6427
6952
|
var TabsVariantContext = createContext2("underline");
|
|
6428
|
-
var tabsListStyles =
|
|
6953
|
+
var tabsListStyles = cva14("", {
|
|
6429
6954
|
variants: {
|
|
6430
6955
|
variant: {
|
|
6431
6956
|
underline: "flex gap-6 border-b border-border",
|
|
@@ -6433,7 +6958,7 @@ var tabsListStyles = cva13("", {
|
|
|
6433
6958
|
}
|
|
6434
6959
|
}
|
|
6435
6960
|
});
|
|
6436
|
-
var tabsTriggerStyles =
|
|
6961
|
+
var tabsTriggerStyles = cva14(
|
|
6437
6962
|
"cursor-pointer outline-none transition-colors duration-(--duration-micro) focus-visible:ring-[3px] focus-visible:ring-accent-dim",
|
|
6438
6963
|
{
|
|
6439
6964
|
variants: {
|
|
@@ -6454,8 +6979,8 @@ var tabsTriggerStyles = cva13(
|
|
|
6454
6979
|
}
|
|
6455
6980
|
}
|
|
6456
6981
|
);
|
|
6457
|
-
var Tabs =
|
|
6458
|
-
return /* @__PURE__ */
|
|
6982
|
+
var Tabs = forwardRef75(function Tabs2({ variant = "underline", className, ...props }, ref) {
|
|
6983
|
+
return /* @__PURE__ */ jsx77(TabsVariantContext.Provider, { value: variant, children: /* @__PURE__ */ jsx77(
|
|
6459
6984
|
RadixTabs.Root,
|
|
6460
6985
|
{
|
|
6461
6986
|
ref,
|
|
@@ -6465,14 +6990,14 @@ var Tabs = forwardRef74(function Tabs2({ variant = "underline", className, ...pr
|
|
|
6465
6990
|
) });
|
|
6466
6991
|
});
|
|
6467
6992
|
Tabs.displayName = "Tabs";
|
|
6468
|
-
var TabsList =
|
|
6993
|
+
var TabsList = forwardRef75(function TabsList2({ className, ...props }, ref) {
|
|
6469
6994
|
const variant = useContext2(TabsVariantContext);
|
|
6470
|
-
return /* @__PURE__ */
|
|
6995
|
+
return /* @__PURE__ */ jsx77(RadixTabs.List, { ref, className: cn(tabsListStyles({ variant }), className), ...props });
|
|
6471
6996
|
});
|
|
6472
6997
|
TabsList.displayName = "TabsList";
|
|
6473
|
-
var Tab =
|
|
6998
|
+
var Tab = forwardRef75(function Tab2({ className, ...props }, ref) {
|
|
6474
6999
|
const variant = useContext2(TabsVariantContext);
|
|
6475
|
-
return /* @__PURE__ */
|
|
7000
|
+
return /* @__PURE__ */ jsx77(
|
|
6476
7001
|
RadixTabs.Trigger,
|
|
6477
7002
|
{
|
|
6478
7003
|
ref,
|
|
@@ -6482,9 +7007,9 @@ var Tab = forwardRef74(function Tab2({ className, ...props }, ref) {
|
|
|
6482
7007
|
);
|
|
6483
7008
|
});
|
|
6484
7009
|
Tab.displayName = "Tab";
|
|
6485
|
-
var TabsContent =
|
|
7010
|
+
var TabsContent = forwardRef75(
|
|
6486
7011
|
function TabsContent2({ className, ...props }, ref) {
|
|
6487
|
-
return /* @__PURE__ */
|
|
7012
|
+
return /* @__PURE__ */ jsx77(
|
|
6488
7013
|
RadixTabs.Content,
|
|
6489
7014
|
{
|
|
6490
7015
|
ref,
|
|
@@ -6500,8 +7025,8 @@ var TabsContent = forwardRef74(
|
|
|
6500
7025
|
TabsContent.displayName = "TabsContent";
|
|
6501
7026
|
|
|
6502
7027
|
// src/patterns/Timeline/Timeline.tsx
|
|
6503
|
-
import { forwardRef as
|
|
6504
|
-
import { jsx as
|
|
7028
|
+
import { forwardRef as forwardRef76 } from "react";
|
|
7029
|
+
import { jsx as jsx78, jsxs as jsxs68 } from "react/jsx-runtime";
|
|
6505
7030
|
var ringClass = {
|
|
6506
7031
|
accent: "border-accent",
|
|
6507
7032
|
ok: "border-ok",
|
|
@@ -6509,8 +7034,8 @@ var ringClass = {
|
|
|
6509
7034
|
err: "border-err",
|
|
6510
7035
|
muted: "border-text-dim"
|
|
6511
7036
|
};
|
|
6512
|
-
var Timeline =
|
|
6513
|
-
return /* @__PURE__ */
|
|
7037
|
+
var Timeline = forwardRef76(function Timeline2({ events, className, children, ...props }, ref) {
|
|
7038
|
+
return /* @__PURE__ */ jsx78(
|
|
6514
7039
|
"ol",
|
|
6515
7040
|
{
|
|
6516
7041
|
ref,
|
|
@@ -6520,14 +7045,14 @@ var Timeline = forwardRef75(function Timeline2({ events, className, children, ..
|
|
|
6520
7045
|
className
|
|
6521
7046
|
),
|
|
6522
7047
|
...props,
|
|
6523
|
-
children: events ? events.map((e, i) => /* @__PURE__ */
|
|
7048
|
+
children: events ? events.map((e, i) => /* @__PURE__ */ jsx78(TimelineItem, { tone: e.tone, time: e.time, description: e.description, children: e.title }, i)) : children
|
|
6524
7049
|
}
|
|
6525
7050
|
);
|
|
6526
7051
|
});
|
|
6527
7052
|
Timeline.displayName = "Timeline";
|
|
6528
|
-
var TimelineItem =
|
|
6529
|
-
return /* @__PURE__ */
|
|
6530
|
-
/* @__PURE__ */
|
|
7053
|
+
var TimelineItem = forwardRef76(function TimelineItem2({ tone = "accent", description, time, className, children, ...props }, ref) {
|
|
7054
|
+
return /* @__PURE__ */ jsxs68("li", { ref, className: cn("relative mb-[18px] last:mb-0", className), ...props, children: [
|
|
7055
|
+
/* @__PURE__ */ jsx78(
|
|
6531
7056
|
"span",
|
|
6532
7057
|
{
|
|
6533
7058
|
"aria-hidden": true,
|
|
@@ -6537,15 +7062,15 @@ var TimelineItem = forwardRef75(function TimelineItem2({ tone = "accent", descri
|
|
|
6537
7062
|
)
|
|
6538
7063
|
}
|
|
6539
7064
|
),
|
|
6540
|
-
/* @__PURE__ */
|
|
6541
|
-
description && /* @__PURE__ */
|
|
6542
|
-
time && /* @__PURE__ */
|
|
7065
|
+
/* @__PURE__ */ jsx78("div", { className: "text-[13px] font-medium", children }),
|
|
7066
|
+
description && /* @__PURE__ */ jsx78("div", { className: "text-text-muted text-[12px]", children: description }),
|
|
7067
|
+
time && /* @__PURE__ */ jsx78("div", { className: "text-text-dim mt-[2px] font-mono text-[10px]", children: time })
|
|
6543
7068
|
] });
|
|
6544
7069
|
});
|
|
6545
7070
|
TimelineItem.displayName = "TimelineItem";
|
|
6546
7071
|
|
|
6547
7072
|
// src/patterns/Timeline/ActivityTimeline.tsx
|
|
6548
|
-
import { forwardRef as
|
|
7073
|
+
import { forwardRef as forwardRef77 } from "react";
|
|
6549
7074
|
|
|
6550
7075
|
// src/patterns/Timeline/formatRelative.ts
|
|
6551
7076
|
var SECOND = 1e3;
|
|
@@ -6580,7 +7105,7 @@ function formatRelative(input, now = /* @__PURE__ */ new Date()) {
|
|
|
6580
7105
|
}
|
|
6581
7106
|
|
|
6582
7107
|
// src/patterns/Timeline/ActivityTimeline.tsx
|
|
6583
|
-
import { jsx as
|
|
7108
|
+
import { jsx as jsx79, jsxs as jsxs69 } from "react/jsx-runtime";
|
|
6584
7109
|
var ringClass2 = {
|
|
6585
7110
|
accent: "border-accent",
|
|
6586
7111
|
ok: "border-ok",
|
|
@@ -6588,10 +7113,10 @@ var ringClass2 = {
|
|
|
6588
7113
|
err: "border-err",
|
|
6589
7114
|
muted: "border-text-dim"
|
|
6590
7115
|
};
|
|
6591
|
-
var ActivityTimeline =
|
|
7116
|
+
var ActivityTimeline = forwardRef77(
|
|
6592
7117
|
function ActivityTimeline2({ events, relativeNow, className, ...props }, ref) {
|
|
6593
7118
|
const now = relativeNow ?? /* @__PURE__ */ new Date();
|
|
6594
|
-
return /* @__PURE__ */
|
|
7119
|
+
return /* @__PURE__ */ jsx79(
|
|
6595
7120
|
"ol",
|
|
6596
7121
|
{
|
|
6597
7122
|
ref,
|
|
@@ -6604,8 +7129,8 @@ var ActivityTimeline = forwardRef76(
|
|
|
6604
7129
|
children: events.map((event) => {
|
|
6605
7130
|
const tone = event.tone ?? "accent";
|
|
6606
7131
|
const time = formatRelative(event.at, now);
|
|
6607
|
-
return /* @__PURE__ */
|
|
6608
|
-
/* @__PURE__ */
|
|
7132
|
+
return /* @__PURE__ */ jsxs69("li", { className: "relative mb-4 last:mb-0", children: [
|
|
7133
|
+
/* @__PURE__ */ jsx79(
|
|
6609
7134
|
"span",
|
|
6610
7135
|
{
|
|
6611
7136
|
"aria-hidden": true,
|
|
@@ -6615,16 +7140,16 @@ var ActivityTimeline = forwardRef76(
|
|
|
6615
7140
|
)
|
|
6616
7141
|
}
|
|
6617
7142
|
),
|
|
6618
|
-
/* @__PURE__ */
|
|
6619
|
-
event.icon && /* @__PURE__ */
|
|
6620
|
-
/* @__PURE__ */
|
|
6621
|
-
time && /* @__PURE__ */
|
|
7143
|
+
/* @__PURE__ */ jsxs69("div", { className: "flex items-baseline gap-2", children: [
|
|
7144
|
+
event.icon && /* @__PURE__ */ jsx79("span", { "aria-hidden": true, className: "text-text-muted font-mono text-[12px]", children: event.icon }),
|
|
7145
|
+
/* @__PURE__ */ jsx79("div", { className: "text-[13px] font-medium", children: event.title }),
|
|
7146
|
+
time && /* @__PURE__ */ jsx79("time", { className: "text-text-dim ml-auto font-mono text-[10px]", children: time })
|
|
6622
7147
|
] }),
|
|
6623
|
-
event.actor && /* @__PURE__ */
|
|
6624
|
-
event.actor.avatar && /* @__PURE__ */
|
|
6625
|
-
/* @__PURE__ */
|
|
7148
|
+
event.actor && /* @__PURE__ */ jsxs69("div", { className: "text-text-muted mt-[2px] flex items-center gap-[6px] text-[12px]", children: [
|
|
7149
|
+
event.actor.avatar && /* @__PURE__ */ jsx79("span", { "aria-hidden": true, className: "inline-flex", children: event.actor.avatar }),
|
|
7150
|
+
/* @__PURE__ */ jsx79("span", { children: event.actor.name })
|
|
6626
7151
|
] }),
|
|
6627
|
-
event.payload && /* @__PURE__ */
|
|
7152
|
+
event.payload && /* @__PURE__ */ jsx79("div", { className: "border-border bg-panel-2 mt-2 rounded-md border px-3 py-2 font-mono text-[11px] leading-[1.5]", children: event.payload })
|
|
6628
7153
|
] }, event.id);
|
|
6629
7154
|
})
|
|
6630
7155
|
}
|
|
@@ -6634,9 +7159,9 @@ var ActivityTimeline = forwardRef76(
|
|
|
6634
7159
|
ActivityTimeline.displayName = "ActivityTimeline";
|
|
6635
7160
|
|
|
6636
7161
|
// src/patterns/Topbar/Topbar.tsx
|
|
6637
|
-
import { forwardRef as
|
|
6638
|
-
import { jsx as
|
|
6639
|
-
var Topbar =
|
|
7162
|
+
import { forwardRef as forwardRef78 } from "react";
|
|
7163
|
+
import { jsx as jsx80, jsxs as jsxs70 } from "react/jsx-runtime";
|
|
7164
|
+
var Topbar = forwardRef78(function Topbar2({
|
|
6640
7165
|
title,
|
|
6641
7166
|
eyebrow,
|
|
6642
7167
|
leading,
|
|
@@ -6650,7 +7175,7 @@ var Topbar = forwardRef77(function Topbar2({
|
|
|
6650
7175
|
}, ref) {
|
|
6651
7176
|
const isTouch = density === "touch";
|
|
6652
7177
|
const backHandler = typeof back === "function" ? back : back ? onBack : void 0;
|
|
6653
|
-
return /* @__PURE__ */
|
|
7178
|
+
return /* @__PURE__ */ jsxs70(
|
|
6654
7179
|
"header",
|
|
6655
7180
|
{
|
|
6656
7181
|
ref,
|
|
@@ -6661,7 +7186,7 @@ var Topbar = forwardRef77(function Topbar2({
|
|
|
6661
7186
|
),
|
|
6662
7187
|
...props,
|
|
6663
7188
|
children: [
|
|
6664
|
-
isTouch && back && /* @__PURE__ */
|
|
7189
|
+
isTouch && back && /* @__PURE__ */ jsx80(
|
|
6665
7190
|
"button",
|
|
6666
7191
|
{
|
|
6667
7192
|
type: "button",
|
|
@@ -6675,7 +7200,7 @@ var Topbar = forwardRef77(function Topbar2({
|
|
|
6675
7200
|
"hover:bg-panel-2 h-touch w-touch",
|
|
6676
7201
|
"focus-visible:ring-accent-dim outline-none focus-visible:ring-[3px]"
|
|
6677
7202
|
),
|
|
6678
|
-
children: /* @__PURE__ */
|
|
7203
|
+
children: /* @__PURE__ */ jsx80(
|
|
6679
7204
|
"svg",
|
|
6680
7205
|
{
|
|
6681
7206
|
width: "20",
|
|
@@ -6685,15 +7210,15 @@ var Topbar = forwardRef77(function Topbar2({
|
|
|
6685
7210
|
stroke: "currentColor",
|
|
6686
7211
|
strokeWidth: "2",
|
|
6687
7212
|
"aria-hidden": true,
|
|
6688
|
-
children: /* @__PURE__ */
|
|
7213
|
+
children: /* @__PURE__ */ jsx80("path", { d: "m15 18-6-6 6-6" })
|
|
6689
7214
|
}
|
|
6690
7215
|
)
|
|
6691
7216
|
}
|
|
6692
7217
|
),
|
|
6693
7218
|
leading,
|
|
6694
|
-
(title || isTouch && eyebrow) && /* @__PURE__ */
|
|
6695
|
-
isTouch && eyebrow && /* @__PURE__ */
|
|
6696
|
-
title && /* @__PURE__ */
|
|
7219
|
+
(title || isTouch && eyebrow) && /* @__PURE__ */ jsxs70("div", { className: cn("min-w-0", isTouch && "flex-1"), children: [
|
|
7220
|
+
isTouch && eyebrow && /* @__PURE__ */ jsx80("div", { className: "text-m-eyebrow text-accent font-mono tracking-wide uppercase", children: eyebrow }),
|
|
7221
|
+
title && /* @__PURE__ */ jsx80(
|
|
6697
7222
|
"div",
|
|
6698
7223
|
{
|
|
6699
7224
|
className: cn(
|
|
@@ -6703,8 +7228,8 @@ var Topbar = forwardRef77(function Topbar2({
|
|
|
6703
7228
|
}
|
|
6704
7229
|
)
|
|
6705
7230
|
] }),
|
|
6706
|
-
!isTouch && /* @__PURE__ */
|
|
6707
|
-
actions && /* @__PURE__ */
|
|
7231
|
+
!isTouch && /* @__PURE__ */ jsx80("div", { className: "flex flex-1 items-center" }),
|
|
7232
|
+
actions && /* @__PURE__ */ jsx80("div", { className: cn("flex items-center", isTouch ? "gap-1" : "gap-3"), children: actions }),
|
|
6708
7233
|
children
|
|
6709
7234
|
]
|
|
6710
7235
|
}
|
|
@@ -6714,15 +7239,15 @@ Topbar.displayName = "Topbar";
|
|
|
6714
7239
|
|
|
6715
7240
|
// src/patterns/Tree/Tree.tsx
|
|
6716
7241
|
import {
|
|
6717
|
-
forwardRef as
|
|
7242
|
+
forwardRef as forwardRef79,
|
|
6718
7243
|
useCallback as useCallback16,
|
|
6719
7244
|
useEffect as useEffect16,
|
|
6720
7245
|
useMemo as useMemo7,
|
|
6721
7246
|
useRef as useRef14,
|
|
6722
|
-
useState as
|
|
7247
|
+
useState as useState21
|
|
6723
7248
|
} from "react";
|
|
6724
7249
|
import { flushSync } from "react-dom";
|
|
6725
|
-
import { jsx as
|
|
7250
|
+
import { jsx as jsx81, jsxs as jsxs71 } from "react/jsx-runtime";
|
|
6726
7251
|
var EMPTY_SET2 = /* @__PURE__ */ new Set();
|
|
6727
7252
|
function flattenVisible(items, expanded, level, parentId, out) {
|
|
6728
7253
|
for (const item of items) {
|
|
@@ -6733,7 +7258,7 @@ function flattenVisible(items, expanded, level, parentId, out) {
|
|
|
6733
7258
|
}
|
|
6734
7259
|
}
|
|
6735
7260
|
}
|
|
6736
|
-
var Tree =
|
|
7261
|
+
var Tree = forwardRef79(function Tree2({
|
|
6737
7262
|
items,
|
|
6738
7263
|
expanded: expandedProp,
|
|
6739
7264
|
defaultExpanded,
|
|
@@ -6761,7 +7286,7 @@ var Tree = forwardRef78(function Tree2({
|
|
|
6761
7286
|
flattenVisible(items, expandedSet, 1, null, out);
|
|
6762
7287
|
return out;
|
|
6763
7288
|
}, [items, expandedSet]);
|
|
6764
|
-
const [activeId, setActiveId] =
|
|
7289
|
+
const [activeId, setActiveId] = useState21(null);
|
|
6765
7290
|
useEffect16(() => {
|
|
6766
7291
|
if (activeId && !flatVisible.some((f) => f.id === activeId)) {
|
|
6767
7292
|
setActiveId(null);
|
|
@@ -6915,7 +7440,7 @@ var Tree = forwardRef78(function Tree2({
|
|
|
6915
7440
|
toggle
|
|
6916
7441
|
]
|
|
6917
7442
|
);
|
|
6918
|
-
return /* @__PURE__ */
|
|
7443
|
+
return /* @__PURE__ */ jsx81(
|
|
6919
7444
|
"ul",
|
|
6920
7445
|
{
|
|
6921
7446
|
ref: setRefs,
|
|
@@ -6923,7 +7448,7 @@ var Tree = forwardRef78(function Tree2({
|
|
|
6923
7448
|
className: cn("flex flex-col gap-px text-[12px]", className),
|
|
6924
7449
|
onKeyDown: handleKeyDown,
|
|
6925
7450
|
...props,
|
|
6926
|
-
children: items.map((item) => /* @__PURE__ */
|
|
7451
|
+
children: items.map((item) => /* @__PURE__ */ jsx81(
|
|
6927
7452
|
TreeItemRow,
|
|
6928
7453
|
{
|
|
6929
7454
|
item,
|
|
@@ -6958,8 +7483,8 @@ function TreeItemRow({
|
|
|
6958
7483
|
const isExpanded = hasChildren && expanded.has(item.id);
|
|
6959
7484
|
const isSelected = selected === item.id;
|
|
6960
7485
|
const isTabStop = tabStopId === item.id;
|
|
6961
|
-
return /* @__PURE__ */
|
|
6962
|
-
/* @__PURE__ */
|
|
7486
|
+
return /* @__PURE__ */ jsxs71("li", { role: "none", children: [
|
|
7487
|
+
/* @__PURE__ */ jsxs71(
|
|
6963
7488
|
"div",
|
|
6964
7489
|
{
|
|
6965
7490
|
role: "treeitem",
|
|
@@ -6982,14 +7507,14 @@ function TreeItemRow({
|
|
|
6982
7507
|
isSelected ? "bg-accent-dim text-accent" : "text-text hover:bg-panel-2"
|
|
6983
7508
|
),
|
|
6984
7509
|
children: [
|
|
6985
|
-
/* @__PURE__ */
|
|
6986
|
-
item.icon && /* @__PURE__ */
|
|
6987
|
-
/* @__PURE__ */
|
|
7510
|
+
/* @__PURE__ */ jsx81("span", { "aria-hidden": true, className: "text-text-dim grid w-3 place-items-center text-[10px]", children: hasChildren ? isExpanded ? "\u25BE" : "\u25B8" : "" }),
|
|
7511
|
+
item.icon && /* @__PURE__ */ jsx81("span", { "aria-hidden": true, className: "text-[12px] opacity-80", children: item.icon }),
|
|
7512
|
+
/* @__PURE__ */ jsx81("span", { className: "flex-1 truncate", children: item.label }),
|
|
6988
7513
|
item.trailing
|
|
6989
7514
|
]
|
|
6990
7515
|
}
|
|
6991
7516
|
),
|
|
6992
|
-
hasChildren && isExpanded && /* @__PURE__ */
|
|
7517
|
+
hasChildren && isExpanded && /* @__PURE__ */ jsx81("ul", { role: "group", className: "flex flex-col gap-px", children: (item.children ?? []).map((child) => /* @__PURE__ */ jsx81(
|
|
6993
7518
|
TreeItemRow,
|
|
6994
7519
|
{
|
|
6995
7520
|
item: child,
|
|
@@ -7007,10 +7532,10 @@ function TreeItemRow({
|
|
|
7007
7532
|
}
|
|
7008
7533
|
|
|
7009
7534
|
// src/patterns/WizardDialog/WizardDialog.tsx
|
|
7010
|
-
import * as
|
|
7011
|
-
import { forwardRef as
|
|
7012
|
-
import { jsx as
|
|
7013
|
-
var WizardDialog =
|
|
7535
|
+
import * as RadixDialog7 from "@radix-ui/react-dialog";
|
|
7536
|
+
import { forwardRef as forwardRef80, useCallback as useCallback17, useMemo as useMemo8, useState as useState22 } from "react";
|
|
7537
|
+
import { jsx as jsx82, jsxs as jsxs72 } from "react/jsx-runtime";
|
|
7538
|
+
var WizardDialog = forwardRef80(function WizardDialog2({
|
|
7014
7539
|
open,
|
|
7015
7540
|
defaultOpen,
|
|
7016
7541
|
onOpenChange,
|
|
@@ -7026,7 +7551,7 @@ var WizardDialog = forwardRef79(function WizardDialog2({
|
|
|
7026
7551
|
cancelLabel,
|
|
7027
7552
|
onCancel
|
|
7028
7553
|
}, ref) {
|
|
7029
|
-
const [current, setCurrent] =
|
|
7554
|
+
const [current, setCurrent] = useState22(initialStep);
|
|
7030
7555
|
const total = steps.length;
|
|
7031
7556
|
const safeCurrent = Math.min(current, Math.max(0, total - 1));
|
|
7032
7557
|
const step = steps[safeCurrent];
|
|
@@ -7061,36 +7586,36 @@ var WizardDialog = forwardRef79(function WizardDialog2({
|
|
|
7061
7586
|
goNext();
|
|
7062
7587
|
}
|
|
7063
7588
|
};
|
|
7064
|
-
return /* @__PURE__ */
|
|
7589
|
+
return /* @__PURE__ */ jsx82(DialogRoot, { open, defaultOpen, onOpenChange, children: /* @__PURE__ */ jsxs72(
|
|
7065
7590
|
DialogContent,
|
|
7066
7591
|
{
|
|
7067
7592
|
ref,
|
|
7068
7593
|
width,
|
|
7069
7594
|
...description ? {} : { "aria-describedby": void 0 },
|
|
7070
7595
|
children: [
|
|
7071
|
-
title ? /* @__PURE__ */
|
|
7596
|
+
title ? /* @__PURE__ */ jsx82(WizardTitle, { children: title }) : (
|
|
7072
7597
|
// Radix Dialog requires a Title for assistive tech and warns in dev
|
|
7073
7598
|
// mode without one. Fall back to a visually-hidden generic title so
|
|
7074
7599
|
// the contract is met even when no title prop is supplied.
|
|
7075
|
-
/* @__PURE__ */
|
|
7600
|
+
/* @__PURE__ */ jsx82(RadixDialog7.Title, { className: "sr-only", children: "Wizard" })
|
|
7076
7601
|
),
|
|
7077
|
-
description && /* @__PURE__ */
|
|
7078
|
-
/* @__PURE__ */
|
|
7079
|
-
/* @__PURE__ */
|
|
7080
|
-
/* @__PURE__ */
|
|
7081
|
-
cancelLabel && /* @__PURE__ */
|
|
7082
|
-
/* @__PURE__ */
|
|
7083
|
-
/* @__PURE__ */
|
|
7602
|
+
description && /* @__PURE__ */ jsx82(WizardDescription, { children: description }),
|
|
7603
|
+
/* @__PURE__ */ jsx82("div", { className: "mb-5", children: /* @__PURE__ */ jsx82(Stepper, { steps: stepperSteps, current: safeCurrent }) }),
|
|
7604
|
+
/* @__PURE__ */ jsx82("div", { className: "mb-5", children: body }),
|
|
7605
|
+
/* @__PURE__ */ jsxs72("div", { className: "flex justify-end gap-2", children: [
|
|
7606
|
+
cancelLabel && /* @__PURE__ */ jsx82(Button, { type: "button", variant: "ghost", onClick: onCancel, children: cancelLabel }),
|
|
7607
|
+
/* @__PURE__ */ jsx82(Button, { type: "button", variant: "secondary", onClick: goBack, disabled: ctx.isFirst, children: backLabel }),
|
|
7608
|
+
/* @__PURE__ */ jsx82(Button, { type: "button", variant: "primary", onClick: handlePrimary, disabled: !canAdvance, children: ctx.isLast ? completeLabel : nextLabel })
|
|
7084
7609
|
] })
|
|
7085
7610
|
]
|
|
7086
7611
|
}
|
|
7087
7612
|
) });
|
|
7088
7613
|
});
|
|
7089
7614
|
function WizardTitle({ children }) {
|
|
7090
|
-
return /* @__PURE__ */
|
|
7615
|
+
return /* @__PURE__ */ jsx82(RadixDialog7.Title, { className: "mb-2 text-[16px] font-medium", children });
|
|
7091
7616
|
}
|
|
7092
7617
|
function WizardDescription({ children }) {
|
|
7093
|
-
return /* @__PURE__ */
|
|
7618
|
+
return /* @__PURE__ */ jsx82(RadixDialog7.Description, { className: "text-text-muted mb-4 text-[13px] leading-[1.55]", children });
|
|
7094
7619
|
}
|
|
7095
7620
|
WizardDialog.displayName = "WizardDialog";
|
|
7096
7621
|
export {
|
|
@@ -7167,6 +7692,7 @@ export {
|
|
|
7167
7692
|
LargeTitle,
|
|
7168
7693
|
Lightbox,
|
|
7169
7694
|
ListingCard,
|
|
7695
|
+
ListingDetail,
|
|
7170
7696
|
MenuCheckboxItem,
|
|
7171
7697
|
MenuItem,
|
|
7172
7698
|
MenuSeparator,
|