@flamingo-stack/openframe-frontend-core 0.0.731 → 0.0.733
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/build/export-map.json +1 -1
- package/dist/{chunk-RAHRDJBP.cjs → chunk-3HPB4H4C.cjs} +4 -4
- package/dist/{chunk-2UNQJVYN.cjs → chunk-3KGICRH7.cjs} +1457 -1187
- package/dist/{chunk-A4HNF4MP.cjs → chunk-3UTPZW36.cjs} +89 -89
- package/dist/{chunk-GID62YEN.cjs → chunk-AAFW4STC.cjs} +3 -3
- package/dist/{chunk-XDBHGWFH.cjs → chunk-ATMBJBOI.cjs} +16 -16
- package/dist/{chunk-YDGBRI3Y.cjs → chunk-AV5533DH.cjs} +15 -15
- package/dist/{chunk-BFHLGEJK.cjs → chunk-BP6R5WDW.cjs} +63 -60
- package/dist/{chunk-CLILWI6O.cjs → chunk-CJVAA7KL.cjs} +32 -32
- package/dist/{chunk-YJFN2W7A.cjs → chunk-DUVOQHQI.cjs} +7 -7
- package/dist/{chunk-E3N24573.cjs → chunk-DUXLZPMJ.cjs} +9 -9
- package/dist/{chunk-TH4N726A.cjs → chunk-E26I4XH6.cjs} +17 -17
- package/dist/{chunk-Y4QRK3CB.cjs → chunk-EMG3T55N.cjs} +7 -7
- package/dist/{chunk-JK75ZZP3.cjs → chunk-EQORT7NK.cjs} +59 -59
- package/dist/chunk-FCGLSWKR.cjs +417 -0
- package/dist/{chunk-MANNIJ42.cjs → chunk-FICJS5OA.cjs} +6 -0
- package/dist/{chunk-QP6QS3YU.cjs → chunk-FNRMDDVN.cjs} +48 -50
- package/dist/{chunk-KLXHCNDC.cjs → chunk-FTTLBMHU.cjs} +3 -3
- package/dist/{chunk-JPZ4Y6X3.cjs → chunk-GB3CHAW7.cjs} +93 -93
- package/dist/{chunk-7DUXR4HL.cjs → chunk-GVTDVS5U.cjs} +3 -3
- package/dist/{chunk-ZV6473Z4.cjs → chunk-HSWHOCZ3.cjs} +20 -20
- package/dist/{chunk-53XZ6MJ5.cjs → chunk-IC4FT3A6.cjs} +28 -28
- package/dist/{chunk-6V4GEE55.cjs → chunk-J7JKPTGO.cjs} +12 -12
- package/dist/{chunk-FKKUQK4C.cjs → chunk-L4ZNR5V7.cjs} +43 -39
- package/dist/{chunk-NYY25425.cjs → chunk-MYBTNOS6.cjs} +2 -2
- package/dist/chunk-NTJE6SM6.cjs +28 -0
- package/dist/{chunk-RBOIGJYF.cjs → chunk-P3R23TOE.cjs} +35 -35
- package/dist/chunk-PX7FY655.cjs +114 -0
- package/dist/{chunk-YUXRIR45.cjs → chunk-SA7LDEVJ.cjs} +98 -50
- package/dist/{chunk-32ENYVFA.cjs → chunk-TIMCHP4X.cjs} +42 -42
- package/dist/{chunk-3SWLL4IM.cjs → chunk-U4T5NLZD.cjs} +8 -8
- package/dist/{chunk-HI7EFAFQ.cjs → chunk-XDWY6HAW.cjs} +28 -28
- package/dist/{chunk-25H2SZH7.cjs → chunk-XY632BCH.cjs} +4 -4
- package/dist/{chunk-HY2KTQSL.cjs → chunk-YIXKH2JO.cjs} +236 -236
- package/dist/{chunk-4YPV4OI4.cjs → chunk-ZBNA6TCW.cjs} +82 -82
- package/dist/{chunk-HLIJ3U2T.cjs → chunk-ZJNYWNCB.cjs} +23 -21
- package/dist/{chunk-HEOD765R.cjs → chunk-ZRYKDN2J.cjs} +32 -379
- package/dist/{cloud-tenants-SC4FNAC2.cjs → cloud-tenants-3GOGR3EN.cjs} +22 -22
- package/dist/components/agent-identity.d.ts +8 -0
- package/dist/components/agent-identity.d.ts.map +1 -1
- package/dist/components/agent-identity.js +13 -1
- package/dist/components/case-studies/index.cjs +35 -35
- package/dist/components/chat/embeddable-chat.d.ts +16 -0
- package/dist/components/chat/embeddable-chat.d.ts.map +1 -1
- package/dist/components/chat/embeddable-chat.js +5 -2
- package/dist/components/chat/index.cjs +16 -16
- package/dist/components/chat/utils/icon-library.d.ts.map +1 -1
- package/dist/components/chat/utils/icon-library.js +6 -0
- package/dist/components/contact/index.cjs +23 -23
- package/dist/components/docs/index.cjs +26 -26
- package/dist/components/embeds/index.cjs +23 -23
- package/dist/components/faq/index.cjs +23 -23
- package/dist/components/features/index.cjs +22 -22
- package/dist/components/help-center-pages/index.cjs +138 -138
- package/dist/components/index.cjs +89 -82
- package/dist/components/meeting-scheduler/index.cjs +67 -67
- package/dist/components/navigation/index.cjs +25 -25
- package/dist/components/onboarding-guides/index.cjs +25 -25
- package/dist/components/product-demo/index.cjs +8 -8
- package/dist/components/product-demo/screens/remote-desktop-picture.d.ts.map +1 -1
- package/dist/components/product-demo/screens/remote-desktop-picture.js +2 -1
- package/dist/components/related-content/index.cjs +10 -10
- package/dist/components/tickets/index.cjs +26 -26
- package/dist/components/ui/device-wallpaper.d.ts +7 -0
- package/dist/components/ui/device-wallpaper.d.ts.map +1 -0
- package/dist/components/ui/device-wallpaper.js +5 -0
- package/dist/components/ui/feature-list.d.ts +9 -4
- package/dist/components/ui/feature-list.d.ts.map +1 -1
- package/dist/components/ui/feature-list.js +26 -35
- package/dist/components/ui/index.cjs +28 -22
- package/dist/components/ui/index.d.ts +3 -1
- package/dist/components/ui/index.d.ts.map +1 -1
- package/dist/components/ui/index.js +3 -1
- package/dist/components/ui/notification-stack.d.ts +33 -0
- package/dist/components/ui/notification-stack.d.ts.map +1 -0
- package/dist/components/ui/notification-stack.js +78 -0
- package/dist/components/ui/numbered-step.d.ts +29 -0
- package/dist/components/ui/numbered-step.d.ts.map +1 -0
- package/dist/components/ui/numbered-step.js +57 -0
- package/dist/components/ui/phone-frame.d.ts +14 -9
- package/dist/components/ui/phone-frame.d.ts.map +1 -1
- package/dist/components/ui/phone-frame.js +50 -6
- package/dist/components/ui/phone-glyphs/lock-camera-glyph.d.ts +5 -0
- package/dist/components/ui/phone-glyphs/lock-camera-glyph.d.ts.map +1 -0
- package/dist/components/ui/phone-glyphs/lock-camera-glyph.js +14 -0
- package/dist/components/ui/phone-glyphs/lock-flashlight-glyph.d.ts +5 -0
- package/dist/components/ui/phone-glyphs/lock-flashlight-glyph.d.ts.map +1 -0
- package/dist/components/ui/phone-glyphs/lock-flashlight-glyph.js +14 -0
- package/dist/components/ui/phone-glyphs/status-bar-glyphs.d.ts +5 -0
- package/dist/components/ui/phone-glyphs/status-bar-glyphs.d.ts.map +1 -0
- package/dist/components/ui/phone-glyphs/status-bar-glyphs.js +68 -0
- package/dist/components/ui/searchable-select.d.ts +29 -3
- package/dist/components/ui/searchable-select.d.ts.map +1 -1
- package/dist/components/ui/searchable-select.js +101 -45
- package/dist/components/ui/snap-carousel.d.ts +5 -8
- package/dist/components/ui/snap-carousel.d.ts.map +1 -1
- package/dist/components/ui/snap-carousel.js +2 -27
- package/dist/components/ui/tab-navigation.d.ts +8 -1
- package/dist/components/ui/tab-navigation.d.ts.map +1 -1
- package/dist/components/ui/tab-navigation.js +30 -20
- package/dist/{devices-7MHSJNXS.cjs → devices-POZXTP7X.cjs} +23 -23
- package/dist/{embeddable-chat-VPIG3F7E.cjs → embeddable-chat-I3Y5GCCR.cjs} +96 -93
- package/dist/hooks/index.cjs +9 -9
- package/dist/hooks/ui/use-autoplay.d.ts +50 -13
- package/dist/hooks/ui/use-autoplay.d.ts.map +1 -1
- package/dist/hooks/ui/use-autoplay.js +76 -13
- package/dist/hooks/ui/use-in-view.d.ts +8 -0
- package/dist/hooks/ui/use-in-view.d.ts.map +1 -1
- package/dist/hooks/ui/use-in-view.js +21 -36
- package/dist/hooks/use-agent-identities.d.ts +6 -0
- package/dist/hooks/use-agent-identities.d.ts.map +1 -1
- package/dist/hooks/use-scenario-player.d.ts +26 -9
- package/dist/hooks/use-scenario-player.d.ts.map +1 -1
- package/dist/hooks/use-scenario-player.js +12 -9
- package/dist/index.cjs +58 -51
- package/dist/{knowledge-4DREGSOZ.cjs → knowledge-AP34IMXN.cjs} +23 -23
- package/dist/{logs-BWXNT2KP.cjs → logs-CEVMIOPW.cjs} +30 -30
- package/dist/{policies-MGFUI23M.cjs → policies-AMBMRCGB.cjs} +26 -26
- package/dist/{remote-session-O6QGXV2N.cjs → remote-session-Z4YZFG5E.cjs} +10 -9
- package/dist/{software-update-7LF7XEYC.cjs → software-update-Z3MWMSHI.cjs} +26 -26
- package/dist/{tickets-board-KNXK747O.cjs → tickets-board-JOSYLOS7.cjs} +13 -13
- package/package.json +1 -1
- package/src/components/agent-identity.tsx +20 -1
- package/src/components/chat/embeddable-chat.tsx +29 -2
- package/src/components/chat/utils/icon-library.tsx +7 -0
- package/src/components/product-demo/screens/remote-desktop-picture.tsx +2 -1
- package/src/components/ui/device-wallpaper.ts +7 -0
- package/src/components/ui/feature-list.tsx +24 -30
- package/src/components/ui/index.ts +3 -1
- package/src/components/ui/notification-stack.tsx +133 -0
- package/src/components/ui/numbered-step.tsx +81 -0
- package/src/components/ui/phone-frame.tsx +83 -19
- package/src/components/ui/phone-glyphs/lock-camera-glyph.tsx +14 -0
- package/src/components/ui/phone-glyphs/lock-flashlight-glyph.tsx +14 -0
- package/src/components/ui/phone-glyphs/status-bar-glyphs.tsx +45 -0
- package/src/components/ui/searchable-select.tsx +124 -32
- package/src/components/ui/snap-carousel.tsx +6 -38
- package/src/components/ui/tab-navigation.tsx +49 -21
- package/src/hooks/ui/use-autoplay.ts +144 -27
- package/src/hooks/ui/use-in-view.ts +31 -38
- package/src/hooks/use-agent-identities.ts +6 -0
- package/src/hooks/use-scenario-player.ts +44 -20
- package/dist/chunk-2WXLQ5R5.cjs +0 -99
- package/dist/chunk-BE2WAMG5.cjs +0 -54
- package/dist/chunk-LCTDHLDL.cjs +0 -43
- package/dist/components/ui/playback-toggle.d.ts +0 -24
- package/dist/components/ui/playback-toggle.d.ts.map +0 -1
- package/dist/components/ui/playback-toggle.js +0 -32
- package/src/components/ui/playback-toggle.tsx +0 -53
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "../../utils/cn.js";
|
|
4
|
+
function StepNumber({ number, current = false, accent, className }) {
|
|
5
|
+
return /* @__PURE__ */ jsx(
|
|
6
|
+
"span",
|
|
7
|
+
{
|
|
8
|
+
className: cn(
|
|
9
|
+
"grid h-6 w-6 shrink-0 place-items-center rounded-full border-2 font-bold transition-colors duration-200 text-h6 motion-reduce:transition-none",
|
|
10
|
+
current ? !accent && "border-ods-accent text-ods-accent" : "border-ods-text-secondary text-ods-text-secondary",
|
|
11
|
+
className
|
|
12
|
+
),
|
|
13
|
+
style: current && accent ? { borderColor: accent, color: accent } : void 0,
|
|
14
|
+
children: number
|
|
15
|
+
}
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
function NumberedStep({
|
|
19
|
+
number,
|
|
20
|
+
title,
|
|
21
|
+
description,
|
|
22
|
+
current = false,
|
|
23
|
+
accent,
|
|
24
|
+
titleAs: Title = "h3",
|
|
25
|
+
className
|
|
26
|
+
}) {
|
|
27
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("flex items-start gap-[var(--spacing-system-xs)]", className), children: [
|
|
28
|
+
/* @__PURE__ */ jsx(StepNumber, { number, current, accent }),
|
|
29
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-col gap-[var(--spacing-system-xxs)]", children: [
|
|
30
|
+
/* @__PURE__ */ jsx(
|
|
31
|
+
Title,
|
|
32
|
+
{
|
|
33
|
+
className: cn(
|
|
34
|
+
"m-0 transition-colors duration-200 text-h3 motion-reduce:transition-none",
|
|
35
|
+
current ? !accent && "text-ods-accent" : "text-ods-text-primary"
|
|
36
|
+
),
|
|
37
|
+
style: current && accent ? { color: accent } : void 0,
|
|
38
|
+
children: title
|
|
39
|
+
}
|
|
40
|
+
),
|
|
41
|
+
description && /* @__PURE__ */ jsx(
|
|
42
|
+
"p",
|
|
43
|
+
{
|
|
44
|
+
className: cn(
|
|
45
|
+
"m-0 transition-colors duration-200 text-h4 motion-reduce:transition-none",
|
|
46
|
+
current ? "text-ods-text-primary" : "text-ods-text-secondary"
|
|
47
|
+
),
|
|
48
|
+
children: description
|
|
49
|
+
}
|
|
50
|
+
)
|
|
51
|
+
] })
|
|
52
|
+
] });
|
|
53
|
+
}
|
|
54
|
+
export {
|
|
55
|
+
NumberedStep,
|
|
56
|
+
StepNumber
|
|
57
|
+
};
|
|
@@ -1,20 +1,25 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
2
|
export interface PhoneFrameProps {
|
|
3
|
-
/**
|
|
3
|
+
/** A fixed lock-screen date line ("Thursday, October 1"). Omitted, it is today's, in the visitor's own locale. */
|
|
4
4
|
dateLabel?: string;
|
|
5
|
-
/**
|
|
5
|
+
/** A fixed lock-screen clock ("5:09"). Omitted, it is the visitor's own time, kept current. */
|
|
6
6
|
timeLabel?: string;
|
|
7
|
-
/** The
|
|
7
|
+
/** The notifications, right under the clock, the newest first (`NotificationStack`). */
|
|
8
8
|
children?: ReactNode;
|
|
9
9
|
className?: string;
|
|
10
10
|
}
|
|
11
11
|
/**
|
|
12
|
-
* A phone lock screen: island, date
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
12
|
+
* A phone lock screen: the status bar and island, the date and clock on the
|
|
13
|
+
* device wallpaper (`DEVICE_WALLPAPER_CLASS`, the one every drawn device
|
|
14
|
+
* shares), the notifications stacked under the clock, then the two
|
|
15
|
+
* shortcuts and the home indicator. Decorative chrome for showing what lands
|
|
16
|
+
* on a phone.
|
|
16
17
|
*
|
|
17
|
-
*
|
|
18
|
+
* The clock is REAL: the visitor's own date and time, kept current, unless a
|
|
19
|
+
* caller fixes them. The server draws neither (it cannot know them); their
|
|
20
|
+
* lines keep their height, so nothing moves when they appear.
|
|
21
|
+
*
|
|
22
|
+
* It is sized by its class (default 299 x 617), never scaled, so the text
|
|
18
23
|
* inside stays the size the page set.
|
|
19
24
|
*/
|
|
20
25
|
export declare function PhoneFrame({ dateLabel, timeLabel, children, className }: PhoneFrameProps): import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"phone-frame.d.ts","sourceRoot":"","sources":["../../../src/components/ui/phone-frame.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"phone-frame.d.ts","sourceRoot":"","sources":["../../../src/components/ui/phone-frame.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAwB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAO7D,MAAM,WAAW,eAAe;IAC9B,kHAAkH;IAClH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+FAA+F;IAC/F,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,wFAAwF;IACxF,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAkCD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,UAAU,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,eAAe,+BAsCxF"}
|
|
@@ -1,16 +1,60 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useSyncExternalStore } from "react";
|
|
3
4
|
import { cn } from "../../utils/cn.js";
|
|
5
|
+
import { DEVICE_WALLPAPER_CLASS } from "./device-wallpaper.js";
|
|
6
|
+
import { LockCameraGlyph } from "./phone-glyphs/lock-camera-glyph.js";
|
|
7
|
+
import { LockFlashlightGlyph } from "./phone-glyphs/lock-flashlight-glyph.js";
|
|
8
|
+
import { StatusBarGlyphs } from "./phone-glyphs/status-bar-glyphs.js";
|
|
9
|
+
const CLOCK_TICK_MS = 1e3;
|
|
10
|
+
function subscribeToClock(onTick) {
|
|
11
|
+
const timer = setInterval(onTick, CLOCK_TICK_MS);
|
|
12
|
+
return () => clearInterval(timer);
|
|
13
|
+
}
|
|
14
|
+
function readClock() {
|
|
15
|
+
const parts = new Intl.DateTimeFormat(void 0, { hour: "numeric", minute: "2-digit" }).formatToParts(/* @__PURE__ */ new Date());
|
|
16
|
+
const part = (type) => parts.find((p) => p.type === type)?.value ?? "";
|
|
17
|
+
return `${part("hour")}:${part("minute")}`;
|
|
18
|
+
}
|
|
19
|
+
function readDate() {
|
|
20
|
+
return new Intl.DateTimeFormat(void 0, { weekday: "long", month: "long", day: "numeric" }).format(/* @__PURE__ */ new Date());
|
|
21
|
+
}
|
|
22
|
+
const noTime = () => "";
|
|
23
|
+
function LockShortcut({ children }) {
|
|
24
|
+
return /* @__PURE__ */ jsx("span", { className: "grid size-[34px] place-items-center rounded-full bg-ods-text-primary/35 text-ods-text-primary backdrop-blur-md", children });
|
|
25
|
+
}
|
|
4
26
|
function PhoneFrame({ dateLabel, timeLabel, children, className }) {
|
|
27
|
+
const liveTime = useSyncExternalStore(subscribeToClock, readClock, noTime);
|
|
28
|
+
const liveDate = useSyncExternalStore(subscribeToClock, readDate, noTime);
|
|
29
|
+
const time = timeLabel ?? liveTime;
|
|
30
|
+
const date = dateLabel ?? liveDate;
|
|
5
31
|
return /* @__PURE__ */ jsx(
|
|
6
32
|
"div",
|
|
7
33
|
{
|
|
8
|
-
className: cn("h-[
|
|
9
|
-
children: /* @__PURE__ */ jsxs("div", { className: "flex h-full flex-col
|
|
10
|
-
/* @__PURE__ */
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
34
|
+
className: cn("h-[617px] w-[299px] shrink-0 rounded-[48px] border border-ods-border bg-black p-2.5", className),
|
|
35
|
+
children: /* @__PURE__ */ jsxs("div", { className: cn("relative flex h-full flex-col overflow-hidden rounded-[38px]", DEVICE_WALLPAPER_CLASS), children: [
|
|
36
|
+
/* @__PURE__ */ jsxs(
|
|
37
|
+
"div",
|
|
38
|
+
{
|
|
39
|
+
className: "grid shrink-0 grid-cols-[1fr_auto_1fr] items-center px-5 pt-2.5 text-ods-text-primary",
|
|
40
|
+
"aria-hidden": true,
|
|
41
|
+
children: [
|
|
42
|
+
/* @__PURE__ */ jsx("span", { className: "font-semibold tabular-nums text-h6", children: time }),
|
|
43
|
+
/* @__PURE__ */ jsx("span", { className: "h-6 w-20 rounded-full bg-black" }),
|
|
44
|
+
/* @__PURE__ */ jsx(StatusBarGlyphs, { className: "h-2.5 w-[54px] justify-self-end" })
|
|
45
|
+
]
|
|
46
|
+
}
|
|
47
|
+
),
|
|
48
|
+
/* @__PURE__ */ jsxs("div", { className: "flex shrink-0 flex-col items-center pt-4 text-ods-text-primary", children: [
|
|
49
|
+
/* @__PURE__ */ jsx("span", { className: "min-h-[var(--font-line-space-h4-body)] text-h4", children: date }),
|
|
50
|
+
/* @__PURE__ */ jsx("span", { className: "h-[68px] text-[64px] font-bold tabular-nums leading-[68px] tracking-tight", children: time })
|
|
51
|
+
] }),
|
|
52
|
+
/* @__PURE__ */ jsx("div", { className: "flex min-h-0 w-full flex-1 flex-col justify-start overflow-hidden px-2.5 pb-3 pt-4", children }),
|
|
53
|
+
/* @__PURE__ */ jsxs("div", { className: "flex shrink-0 items-center justify-between px-8", "aria-hidden": true, children: [
|
|
54
|
+
/* @__PURE__ */ jsx(LockShortcut, { children: /* @__PURE__ */ jsx(LockFlashlightGlyph, { className: "size-[34px]" }) }),
|
|
55
|
+
/* @__PURE__ */ jsx(LockShortcut, { children: /* @__PURE__ */ jsx(LockCameraGlyph, { className: "size-[34px]" }) })
|
|
56
|
+
] }),
|
|
57
|
+
/* @__PURE__ */ jsx("span", { className: "mx-auto mb-2 mt-3 h-1 w-24 shrink-0 rounded-full bg-ods-text-primary", "aria-hidden": true })
|
|
14
58
|
] })
|
|
15
59
|
}
|
|
16
60
|
);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lock-camera-glyph.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/phone-glyphs/lock-camera-glyph.tsx"],"names":[],"mappings":"AAGA,uEAAuE;AACvE,wBAAgB,eAAe,CAAC,EAAE,SAAS,EAAE,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,+BASpE"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
function LockCameraGlyph({ className }) {
|
|
4
|
+
return /* @__PURE__ */ jsx("svg", { viewBox: "0 0 34.0257 34.0257", fill: "none", "aria-hidden": "true", className, children: /* @__PURE__ */ jsx(
|
|
5
|
+
"path",
|
|
6
|
+
{
|
|
7
|
+
d: "M10.4883 23.8176H23.5348C25.0193 23.8176 25.7758 23.0753 25.7758 21.6051V14.1326C25.7758 12.6624 25.0193 11.9273 23.5348 11.9273H21.4936C20.9297 11.9273 20.7585 11.8131 20.4373 11.4563L19.8663 10.8139C19.5095 10.4214 19.1455 10.2073 18.4104 10.2073H15.5627C14.8276 10.2073 14.4636 10.4214 14.1068 10.8139L13.5358 11.4563C13.2146 11.806 13.0362 11.9273 12.4795 11.9273H10.4883C8.99665 11.9273 8.24726 12.6624 8.24726 14.1326V21.6051C8.24726 23.0753 8.99665 23.8176 10.4883 23.8176ZM17.0115 21.7122C14.849 21.7122 13.1147 19.985 13.1147 17.8082C13.1147 15.6386 14.849 13.9114 17.0115 13.9114C19.174 13.9114 20.9012 15.6386 20.9012 17.8082C20.9012 19.985 19.1669 21.7122 17.0115 21.7122ZM21.3794 15.1818C21.3794 14.6965 21.8076 14.2682 22.3072 14.2682C22.7996 14.2682 23.2207 14.6965 23.2207 15.1818C23.2207 15.6885 22.7996 16.0953 22.3072 16.1025C21.8076 16.1025 21.3794 15.6956 21.3794 15.1818ZM17.0115 20.6273C18.5674 20.6273 19.8235 19.3784 19.8235 17.8082C19.8235 16.2452 18.5674 14.9891 17.0115 14.9891C15.4556 14.9891 14.1924 16.2452 14.1924 17.8082C14.1924 19.3784 15.4628 20.6273 17.0115 20.6273Z",
|
|
8
|
+
fill: "currentColor"
|
|
9
|
+
}
|
|
10
|
+
) });
|
|
11
|
+
}
|
|
12
|
+
export {
|
|
13
|
+
LockCameraGlyph
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lock-flashlight-glyph.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/phone-glyphs/lock-flashlight-glyph.tsx"],"names":[],"mappings":"AAGA,2EAA2E;AAC3E,wBAAgB,mBAAmB,CAAC,EAAE,SAAS,EAAE,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,+BASxE"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
function LockFlashlightGlyph({ className }) {
|
|
4
|
+
return /* @__PURE__ */ jsx("svg", { viewBox: "0 0 34.0257 34.0257", fill: "none", "aria-hidden": "true", className, children: /* @__PURE__ */ jsx(
|
|
5
|
+
"path",
|
|
6
|
+
{
|
|
7
|
+
d: "M13.8216 11.1597H20.8833V10.8248C20.8833 9.94557 20.4507 9.5269 19.6133 9.5269H15.0916C14.2543 9.5269 13.8216 9.94557 13.8216 10.8248V11.1597ZM16.5151 25.1505H18.1898C19.0272 25.1505 19.4528 24.7318 19.4528 23.8526V16.442C19.4528 15.7093 19.6273 15.179 19.8924 14.7743L20.346 14.1044C20.667 13.609 20.8833 13.1415 20.8833 12.5483V11.9762H13.8216V12.5483C13.8216 13.1415 14.038 13.609 14.3589 14.1044L14.8055 14.7743C15.0777 15.179 15.2451 15.7093 15.2451 16.442V23.8526C15.2451 24.7318 15.6778 25.1505 16.5151 25.1505ZM17.3525 19.7845C16.7803 19.7845 16.4105 19.3658 16.4105 18.7796V16.8677C16.4105 16.2746 16.7803 15.8768 17.3525 15.8908C17.9177 15.8978 18.2945 16.2955 18.2945 16.8677V18.7796C18.2945 19.3658 17.9177 19.7845 17.3525 19.7845ZM17.3525 19.289C17.6595 19.289 17.9247 19.0308 17.9247 18.7168C17.9247 18.4028 17.6595 18.1377 17.3525 18.1377C17.0385 18.1377 16.7733 18.4028 16.7733 18.7168C16.7733 19.0308 17.0385 19.289 17.3525 19.289Z",
|
|
8
|
+
fill: "currentColor"
|
|
9
|
+
}
|
|
10
|
+
) });
|
|
11
|
+
}
|
|
12
|
+
export {
|
|
13
|
+
LockFlashlightGlyph
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status-bar-glyphs.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/phone-glyphs/status-bar-glyphs.tsx"],"names":[],"mappings":"AAGA,8EAA8E;AAC9E,wBAAgB,eAAe,CAAC,EAAE,SAAS,EAAE,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,+BAwCpE"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
function StatusBarGlyphs({ className }) {
|
|
4
|
+
return /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 54.441 9.78982", fill: "none", "aria-hidden": "true", className, children: [
|
|
5
|
+
/* @__PURE__ */ jsx(
|
|
6
|
+
"path",
|
|
7
|
+
{
|
|
8
|
+
d: "M6.89491 2.89491C6.89491 2.51412 7.20361 2.20542 7.5844 2.20542H8.27389C8.65469 2.20542 8.96338 2.51412 8.96338 2.89491V8.41084C8.96338 8.79164 8.65469 9.10033 8.27389 9.10033H7.5844C7.20361 9.10033 6.89491 8.79164 6.89491 8.41084V2.89491Z",
|
|
9
|
+
fill: "currentColor"
|
|
10
|
+
}
|
|
11
|
+
),
|
|
12
|
+
/* @__PURE__ */ jsx(
|
|
13
|
+
"path",
|
|
14
|
+
{
|
|
15
|
+
d: "M10.3424 1.51593C10.3424 1.13513 10.6511 0.826438 11.0319 0.826438H11.7213C12.1021 0.826438 12.4108 1.13513 12.4108 1.51593V8.41084C12.4108 8.79164 12.1021 9.10033 11.7213 9.10033H11.0319C10.6511 9.10033 10.3424 8.79164 10.3424 8.41084V1.51593Z",
|
|
16
|
+
fill: "currentColor"
|
|
17
|
+
}
|
|
18
|
+
),
|
|
19
|
+
/* @__PURE__ */ jsx(
|
|
20
|
+
"path",
|
|
21
|
+
{
|
|
22
|
+
d: "M3.44746 5.30813C3.44746 4.92733 3.75615 4.61864 4.13695 4.61864H4.82644C5.20723 4.61864 5.51593 4.92733 5.51593 5.30813V8.41084C5.51593 8.79164 5.20723 9.10033 4.82644 9.10033H4.13695C3.75615 9.10033 3.44746 8.79164 3.44746 8.41084V5.30813Z",
|
|
23
|
+
fill: "currentColor"
|
|
24
|
+
}
|
|
25
|
+
),
|
|
26
|
+
/* @__PURE__ */ jsx(
|
|
27
|
+
"path",
|
|
28
|
+
{
|
|
29
|
+
d: "M0 7.03186C0 6.65106 0.308696 6.34237 0.689491 6.34237H1.37898C1.75978 6.34237 2.06847 6.65106 2.06847 7.03186V8.41084C2.06847 8.79164 1.75978 9.10033 1.37898 9.10033H0.689491C0.308696 9.10033 0 8.79164 0 8.41084V7.03186Z",
|
|
30
|
+
fill: "currentColor"
|
|
31
|
+
}
|
|
32
|
+
),
|
|
33
|
+
/* @__PURE__ */ jsx(
|
|
34
|
+
"path",
|
|
35
|
+
{
|
|
36
|
+
d: "M22.1436 6.97595C23.1225 6.13113 24.5563 6.13095 25.5352 6.97595C25.5844 7.02139 25.6129 7.08596 25.6143 7.15368C25.6156 7.22145 25.5894 7.28687 25.542 7.33435L24.0088 8.91345C23.9639 8.95973 23.9027 8.98571 23.8389 8.98571C23.775 8.98566 23.7138 8.9598 23.669 8.91345L22.1358 7.33435C22.0884 7.28683 22.0621 7.22144 22.0635 7.15368C22.0649 7.08593 22.0943 7.02136 22.1436 6.97595ZM20.0703 5.0863C22.1795 3.08361 25.4465 3.08362 27.5557 5.0863C27.6033 5.13326 27.6302 5.19841 27.6309 5.26599C27.6314 5.33341 27.6052 5.39784 27.5586 5.44567L26.6729 6.35974C26.5815 6.45307 26.4335 6.45548 26.3399 6.36462C25.6473 5.72459 24.7467 5.36952 23.8125 5.3695C22.8788 5.3699 21.9783 5.72488 21.2861 6.36462C21.1925 6.45548 21.0445 6.45307 20.9531 6.35974L20.0674 5.44567C20.0209 5.39792 19.9946 5.33335 19.9951 5.26599C19.9958 5.19843 20.0227 5.13325 20.0703 5.0863ZM18.001 3.19958C21.236 0.0354236 26.3393 0.0353572 29.5742 3.19958C29.6211 3.2466 29.6481 3.31125 29.6485 3.37829C29.6488 3.44529 29.6224 3.50946 29.5762 3.557L28.6895 4.47107C28.5981 4.56485 28.4493 4.56633 28.3565 4.474C27.124 3.27797 25.4887 2.61088 23.7881 2.61071C22.0873 2.61071 20.4515 3.27787 19.2188 4.474C19.126 4.56648 18.9771 4.565 18.8858 4.47107L17.9981 3.557C17.952 3.50946 17.9264 3.44515 17.9268 3.37829C17.9272 3.31125 17.9541 3.24656 18.001 3.19958Z",
|
|
37
|
+
fill: "currentColor"
|
|
38
|
+
}
|
|
39
|
+
),
|
|
40
|
+
/* @__PURE__ */ jsx(
|
|
41
|
+
"path",
|
|
42
|
+
{
|
|
43
|
+
opacity: "0.35",
|
|
44
|
+
d: "M37.9222 0.363281H50.0277C51.3498 0.363404 52.4211 1.43566 52.4212 2.75781V6.20508C52.4212 7.5273 51.3499 8.59949 50.0277 8.59961H37.9222C36.6 8.59953 35.5277 7.52732 35.5277 6.20508V2.75781C35.5278 1.43564 36.6 0.363363 37.9222 0.363281Z",
|
|
45
|
+
stroke: "currentColor",
|
|
46
|
+
strokeWidth: "0.727473"
|
|
47
|
+
}
|
|
48
|
+
),
|
|
49
|
+
/* @__PURE__ */ jsx(
|
|
50
|
+
"path",
|
|
51
|
+
{
|
|
52
|
+
opacity: "0.4",
|
|
53
|
+
d: "M53.4749 3.44746V6.35735C54.0603 6.1109 54.441 5.53758 54.441 4.9024C54.441 4.26722 54.0603 3.69391 53.4749 3.44746Z",
|
|
54
|
+
fill: "currentColor"
|
|
55
|
+
}
|
|
56
|
+
),
|
|
57
|
+
/* @__PURE__ */ jsx(
|
|
58
|
+
"path",
|
|
59
|
+
{
|
|
60
|
+
d: "M36.5434 2.75797C36.5434 1.99638 37.1608 1.37898 37.9224 1.37898H50.0274C50.789 1.37898 51.4064 1.99637 51.4064 2.75796V6.20542C51.4064 6.96701 50.789 7.5844 50.0274 7.5844H37.9224C37.1608 7.5844 36.5434 6.96701 36.5434 6.20542V2.75797Z",
|
|
61
|
+
fill: "currentColor"
|
|
62
|
+
}
|
|
63
|
+
)
|
|
64
|
+
] });
|
|
65
|
+
}
|
|
66
|
+
export {
|
|
67
|
+
StatusBarGlyphs
|
|
68
|
+
};
|
|
@@ -2,9 +2,15 @@ import { type ReactNode } from 'react';
|
|
|
2
2
|
export interface SearchableSelectOption {
|
|
3
3
|
value: string;
|
|
4
4
|
label: string;
|
|
5
|
-
/** Optional leading visual for the option row (avatar, icon, badge).
|
|
5
|
+
/** Optional leading visual for the option row (avatar, icon, badge). The
|
|
6
|
+
* default trigger leads with the selected option's icon too. */
|
|
6
7
|
icon?: ReactNode;
|
|
8
|
+
/** Extra terms the search matches besides `label` — e.g. the stored key of a
|
|
9
|
+
* glyph (`chart-pie`) whose label reads "Pie chart". */
|
|
10
|
+
keywords?: string[];
|
|
7
11
|
}
|
|
12
|
+
/** How the dropdown lays its options out — see `SearchableSelectProps.layout`. */
|
|
13
|
+
export type SearchableSelectLayout = 'list' | 'grid';
|
|
8
14
|
export interface SearchableSelectProps {
|
|
9
15
|
options: SearchableSelectOption[];
|
|
10
16
|
/** Currently selected option value; null/undefined when nothing is selected. */
|
|
@@ -24,7 +30,27 @@ export interface SearchableSelectProps {
|
|
|
24
30
|
* is rendered.
|
|
25
31
|
*/
|
|
26
32
|
trigger?: ReactNode;
|
|
27
|
-
/**
|
|
33
|
+
/** `id` of the default trigger button, which `label` names through `htmlFor`; generated when omitted. */
|
|
34
|
+
id?: string;
|
|
35
|
+
/**
|
|
36
|
+
* Label above the default trigger — the same `FieldWrapper` treatment
|
|
37
|
+
* `SelectTrigger` gives its `label`, so a searchable field lines up with the
|
|
38
|
+
* plain selects beside it. A custom `trigger` owns its own label.
|
|
39
|
+
*/
|
|
40
|
+
label?: string;
|
|
41
|
+
/** Label scale forwarded to FieldWrapper ('large' = text-h4 for designs with body-scale field titles). */
|
|
42
|
+
labelVariant?: 'default' | 'large';
|
|
43
|
+
/** Validation message under the default trigger; also paints its border red. */
|
|
44
|
+
error?: string;
|
|
45
|
+
/**
|
|
46
|
+
* `'list'` (default) stacks full-width rows. `'grid'` tiles the options —
|
|
47
|
+
* icon above a centered caption, `minmax(7rem, 1fr)` columns — the
|
|
48
|
+
* icon-picker pattern. The grid fills the popover, so size it through
|
|
49
|
+
* `contentClassName` (360px fits three tiles).
|
|
50
|
+
*/
|
|
51
|
+
layout?: SearchableSelectLayout;
|
|
52
|
+
/** Custom option-row renderer; default is icon + label + selected check
|
|
53
|
+
* (icon above the caption in the grid layout). */
|
|
28
54
|
renderOption?: (option: SearchableSelectOption, isSelected: boolean) => ReactNode;
|
|
29
55
|
align?: 'start' | 'center' | 'end';
|
|
30
56
|
/** Classes for the default trigger button. */
|
|
@@ -39,5 +65,5 @@ export interface SearchableSelectProps {
|
|
|
39
65
|
* custom `trigger` for icon-button use cases; the default trigger looks and
|
|
40
66
|
* behaves like `SelectTrigger`.
|
|
41
67
|
*/
|
|
42
|
-
export declare function SearchableSelect(
|
|
68
|
+
export declare function SearchableSelect(allProps: SearchableSelectProps): import("react").JSX.Element;
|
|
43
69
|
//# sourceMappingURL=searchable-select.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"searchable-select.d.ts","sourceRoot":"","sources":["../../../src/components/ui/searchable-select.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,SAAS,
|
|
1
|
+
{"version":3,"file":"searchable-select.d.ts","sourceRoot":"","sources":["../../../src/components/ui/searchable-select.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,SAAS,EAA4B,MAAM,OAAO,CAAC;AAQjE,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd;qEACiE;IACjE,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB;6DACyD;IACzD,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAED,kFAAkF;AAClF,MAAM,MAAM,sBAAsB,GAAG,MAAM,GAAG,MAAM,CAAC;AAErD,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,sBAAsB,EAAE,CAAC;IAClC,gFAAgF;IAChF,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,sDAAsD;IACtD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,2EAA2E;IAC3E,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,yGAAyG;IACzG,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,0GAA0G;IAC1G,YAAY,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;IACnC,gFAAgF;IAChF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;OAKG;IACH,MAAM,CAAC,EAAE,sBAAsB,CAAC;IAChC;uDACmD;IACnD,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,sBAAsB,EAAE,UAAU,EAAE,OAAO,KAAK,SAAS,CAAC;IAClF,KAAK,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;IACnC,8CAA8C;IAC9C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8EAA8E;IAC9E,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,qBAAqB,+BA8M/D"}
|
|
@@ -1,28 +1,40 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
4
|
-
import { useMemo, useState } from "react";
|
|
4
|
+
import { useId, useMemo, useState } from "react";
|
|
5
5
|
import { useKeyboardCollisionPadding } from "../../hooks/ui/use-keyboard-collision-padding.js";
|
|
6
6
|
import { cn } from "../../utils/cn.js";
|
|
7
7
|
import { CheckIcon, SearchIcon } from "../icons-v2-generated/index.js";
|
|
8
8
|
import { Chevron02DownIcon } from "../icons-v2-generated/arrows/chevron-02-down-icon.js";
|
|
9
|
+
import { FieldWrapper } from "./field-wrapper.js";
|
|
9
10
|
import { Input } from "./input.js";
|
|
10
|
-
function SearchableSelect({
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
11
|
+
function SearchableSelect(allProps) {
|
|
12
|
+
const {
|
|
13
|
+
options,
|
|
14
|
+
value = null,
|
|
15
|
+
onValueChange,
|
|
16
|
+
placeholder = "Select...",
|
|
17
|
+
searchPlaceholder = "Search...",
|
|
18
|
+
emptyText = "No results found",
|
|
19
|
+
loadingText = "Loading\u2026",
|
|
20
|
+
isLoading = false,
|
|
21
|
+
disabled = false,
|
|
22
|
+
trigger,
|
|
23
|
+
id,
|
|
24
|
+
label,
|
|
25
|
+
labelVariant,
|
|
26
|
+
error,
|
|
27
|
+
layout = "list",
|
|
28
|
+
renderOption,
|
|
29
|
+
align = "start",
|
|
30
|
+
className,
|
|
31
|
+
contentClassName
|
|
32
|
+
} = allProps;
|
|
33
|
+
const errorSlot = "error" in allProps;
|
|
34
|
+
const isInvalid = !!error;
|
|
35
|
+
const isGrid = layout === "grid";
|
|
36
|
+
const generatedId = useId();
|
|
37
|
+
const triggerId = id ?? generatedId;
|
|
26
38
|
const [isOpen, setIsOpen] = useState(false);
|
|
27
39
|
const [search, setSearch] = useState("");
|
|
28
40
|
const keyboardPadding = useKeyboardCollisionPadding();
|
|
@@ -30,7 +42,9 @@ function SearchableSelect({
|
|
|
30
42
|
const filtered = useMemo(() => {
|
|
31
43
|
const q = search.trim().toLowerCase();
|
|
32
44
|
if (!q) return options;
|
|
33
|
-
return options.filter(
|
|
45
|
+
return options.filter(
|
|
46
|
+
(o) => o.label.toLowerCase().includes(q) || (o.keywords ?? []).some((k) => k.toLowerCase().includes(q))
|
|
47
|
+
);
|
|
34
48
|
}, [options, search]);
|
|
35
49
|
const selectedOption = useMemo(
|
|
36
50
|
() => value != null ? options.find((o) => o.value === value) : void 0,
|
|
@@ -43,8 +57,10 @@ function SearchableSelect({
|
|
|
43
57
|
const defaultTrigger = /* @__PURE__ */ jsxs(
|
|
44
58
|
"button",
|
|
45
59
|
{
|
|
60
|
+
id: triggerId,
|
|
46
61
|
type: "button",
|
|
47
62
|
disabled,
|
|
63
|
+
"data-invalid": isInvalid || void 0,
|
|
48
64
|
className: cn(
|
|
49
65
|
// Mirrors SelectTrigger so the closed state is indistinguishable from
|
|
50
66
|
// the regular Select.
|
|
@@ -52,24 +68,36 @@ function SearchableSelect({
|
|
|
52
68
|
"border-ods-border bg-ods-card text-h4",
|
|
53
69
|
selectedOption ? "text-ods-text-primary" : "text-ods-text-secondary",
|
|
54
70
|
"enabled:hover:border-ods-border-hover enabled:hover:bg-ods-bg-hover enabled:active:border-ods-border-active enabled:active:bg-ods-bg-active",
|
|
55
|
-
"data-[state=open]:border-ods-accent data-[state=open]:hover:border-ods-accent",
|
|
71
|
+
!isInvalid && "data-[state=open]:border-ods-accent data-[state=open]:hover:border-ods-accent",
|
|
56
72
|
"group cursor-pointer transition-colors duration-200 disabled:!cursor-not-allowed disabled:bg-ods-bg",
|
|
73
|
+
isInvalid && "border-ods-error enabled:hover:border-ods-error enabled:active:border-ods-error data-[state=open]:border-ods-error",
|
|
57
74
|
className
|
|
58
75
|
),
|
|
59
76
|
children: [
|
|
60
|
-
/* @__PURE__ */
|
|
77
|
+
/* @__PURE__ */ jsxs("span", { className: "flex min-w-0 flex-1 items-center gap-2", children: [
|
|
78
|
+
selectedOption?.icon,
|
|
79
|
+
/* @__PURE__ */ jsx("span", { className: "truncate", children: selectedOption ? selectedOption.label : placeholder })
|
|
80
|
+
] }),
|
|
61
81
|
/* @__PURE__ */ jsx(
|
|
62
82
|
Chevron02DownIcon,
|
|
63
83
|
{
|
|
64
|
-
className:
|
|
84
|
+
className: cn(
|
|
85
|
+
"shrink-0 text-ods-text-secondary transition-all duration-200 group-data-[state=open]:rotate-180",
|
|
86
|
+
isInvalid ? "text-ods-error" : "group-data-[state=open]:text-ods-accent"
|
|
87
|
+
),
|
|
65
88
|
size: 24
|
|
66
89
|
}
|
|
67
90
|
)
|
|
68
91
|
]
|
|
69
92
|
}
|
|
70
93
|
);
|
|
94
|
+
const triggerElement = /* @__PURE__ */ jsx(PopoverPrimitive.Trigger, { asChild: true, children: trigger ?? defaultTrigger });
|
|
95
|
+
const statusClass = cn(
|
|
96
|
+
"px-[var(--spacing-system-sf)] py-[var(--spacing-system-s)] text-ods-text-secondary text-h5",
|
|
97
|
+
isGrid && "col-span-full"
|
|
98
|
+
);
|
|
71
99
|
return /* @__PURE__ */ jsxs(PopoverPrimitive.Root, { open: isOpen, onOpenChange: disabled ? void 0 : setIsOpen, modal: false, children: [
|
|
72
|
-
/* @__PURE__ */ jsx(
|
|
100
|
+
!trigger && (label !== void 0 || errorSlot) ? /* @__PURE__ */ jsx(FieldWrapper, { label, htmlFor: triggerId, labelVariant, error, errorSlot, children: triggerElement }) : triggerElement,
|
|
73
101
|
/* @__PURE__ */ jsx(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsxs(
|
|
74
102
|
PopoverPrimitive.Content,
|
|
75
103
|
{
|
|
@@ -97,29 +125,57 @@ function SearchableSelect({
|
|
|
97
125
|
className: "rounded-none border-0"
|
|
98
126
|
}
|
|
99
127
|
) }),
|
|
100
|
-
/* @__PURE__ */ jsx(
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
128
|
+
/* @__PURE__ */ jsx(
|
|
129
|
+
"div",
|
|
130
|
+
{
|
|
131
|
+
className: cn(
|
|
132
|
+
"max-h-80 min-h-0 overflow-y-auto",
|
|
133
|
+
// Tiles grow from 7rem: the popover's own border and a classic
|
|
134
|
+
// always-on scrollbar both eat into the track, so 7.5rem (the
|
|
135
|
+
// Figma cell) dropped a 360px popover to two columns. The column
|
|
136
|
+
// count follows the popover width. Each tile draws its own
|
|
137
|
+
// bottom/right rule, so the grid needs no gap.
|
|
138
|
+
isGrid ? "grid grid-cols-[repeat(auto-fill,minmax(7rem,1fr))]" : "py-[var(--spacing-system-xs)]"
|
|
139
|
+
),
|
|
140
|
+
role: "listbox",
|
|
141
|
+
children: isLoading ? /* @__PURE__ */ jsx("div", { className: statusClass, children: loadingText }) : filtered.length === 0 ? /* @__PURE__ */ jsx("div", { className: statusClass, children: emptyText }) : filtered.map((opt) => {
|
|
142
|
+
const isSelected = value === opt.value;
|
|
143
|
+
return /* @__PURE__ */ jsx(
|
|
144
|
+
"button",
|
|
145
|
+
{
|
|
146
|
+
type: "button",
|
|
147
|
+
role: "option",
|
|
148
|
+
"aria-selected": isSelected,
|
|
149
|
+
onClick: () => handleSelect(opt.value),
|
|
150
|
+
className: cn(
|
|
151
|
+
"transition-colors hover:bg-ods-bg-hover",
|
|
152
|
+
isGrid ? "flex min-w-0 flex-col items-center justify-center gap-[var(--spacing-system-xxs)] border-b border-r border-ods-border p-[var(--spacing-system-xs)]" : "flex w-full items-center gap-[var(--spacing-system-xs)] px-[var(--spacing-system-sf)] py-[var(--spacing-system-xs)] text-left",
|
|
153
|
+
isSelected && "bg-ods-bg-hover"
|
|
154
|
+
),
|
|
155
|
+
children: renderOption ? renderOption(opt, isSelected) : isGrid ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
156
|
+
opt.icon,
|
|
157
|
+
/* @__PURE__ */ jsx(
|
|
158
|
+
"span",
|
|
159
|
+
{
|
|
160
|
+
className: cn(
|
|
161
|
+
"w-full truncate text-center text-h6",
|
|
162
|
+
isSelected ? "text-ods-text-primary" : "text-ods-text-secondary"
|
|
163
|
+
),
|
|
164
|
+
title: opt.label,
|
|
165
|
+
children: opt.label
|
|
166
|
+
}
|
|
167
|
+
)
|
|
168
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
169
|
+
opt.icon,
|
|
170
|
+
/* @__PURE__ */ jsx("span", { className: "flex-1 truncate text-ods-text-primary text-h4", title: opt.label, children: opt.label }),
|
|
171
|
+
isSelected && /* @__PURE__ */ jsx(CheckIcon, { className: "size-4 shrink-0 text-ods-accent" })
|
|
172
|
+
] })
|
|
173
|
+
},
|
|
174
|
+
opt.value
|
|
175
|
+
);
|
|
176
|
+
})
|
|
177
|
+
}
|
|
178
|
+
)
|
|
123
179
|
]
|
|
124
180
|
}
|
|
125
181
|
) })
|
|
@@ -15,9 +15,6 @@ export interface SnapCarouselProps<T> {
|
|
|
15
15
|
label: string;
|
|
16
16
|
/** Move to the next slide after this long. `0` turns auto-advance off. Default 5000. */
|
|
17
17
|
autoAdvanceMs?: number;
|
|
18
|
-
/** Names of the stop/start control. */
|
|
19
|
-
playLabel?: string;
|
|
20
|
-
pauseLabel?: string;
|
|
21
18
|
/** Width of one slide. Default `basis-[300px]`. */
|
|
22
19
|
slideClassName?: string;
|
|
23
20
|
prevLabel?: string;
|
|
@@ -32,10 +29,10 @@ export interface SnapCarouselProps<T> {
|
|
|
32
29
|
*
|
|
33
30
|
* WHEN IT ADVANCES is `useAutoplay`'s rule, the same one the looping demos
|
|
34
31
|
* use: mostly on screen, tab visible, not paused, motion allowed. A swipe or
|
|
35
|
-
* an arrow moves it and it carries on from there after a full interval
|
|
36
|
-
* waits
|
|
37
|
-
*
|
|
38
|
-
*
|
|
32
|
+
* an arrow moves it and it carries on from there after a full interval. It
|
|
33
|
+
* waits while the visitor holds it (`useAutoplay`'s hold: a finger or the
|
|
34
|
+
* mouse button down on it, the keyboard inside it); there is no pause button. While it is auto-playing the active dot fills over the
|
|
35
|
+
* interval, so the wait is visible.
|
|
39
36
|
*/
|
|
40
|
-
export declare function SnapCarousel<T>({ items, renderItem, getKey, label, autoAdvanceMs,
|
|
37
|
+
export declare function SnapCarousel<T>({ items, renderItem, getKey, label, autoAdvanceMs, slideClassName, prevLabel, nextLabel, focusIndex, className, }: SnapCarouselProps<T>): import("react").JSX.Element | null;
|
|
41
38
|
//# sourceMappingURL=snap-carousel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snap-carousel.d.ts","sourceRoot":"","sources":["../../../src/components/ui/snap-carousel.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAA4C,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"snap-carousel.d.ts","sourceRoot":"","sources":["../../../src/components/ui/snap-carousel.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAA4C,MAAM,OAAO,CAAC;AAUjF;;;;GAIG;AACH,wBAAgB,4BAA4B,CAAC,EAAE,SAAS,EAAE,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,+BAEjF;AAED,MAAM,WAAW,iBAAiB,CAAC,CAAC;IAClC,KAAK,EAAE,SAAS,CAAC,EAAE,CAAC;IACpB,UAAU,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,SAAS,CAAC;IAClD,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,GAAG,MAAM,CAAC;IACrD,6CAA6C;IAC7C,KAAK,EAAE,MAAM,CAAC;IACd,wFAAwF;IACxF,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,mDAAmD;IACnD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,2HAA2H;IAC3H,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAuBD;;;;;;;;;;GAUG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,EAC9B,KAAK,EACL,UAAU,EACV,MAAM,EACN,KAAK,EACL,aAAoB,EACpB,cAAgC,EAChC,SAAsB,EACtB,SAAkB,EAClB,UAAU,EACV,SAAS,GACV,EAAE,iBAAiB,CAAC,CAAC,CAAC,sCAkItB"}
|