@flamingo-stack/openframe-frontend-core 0.0.850 → 0.0.852
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/{case-study-card-X2HKPKT7.cjs → case-study-card-WP5Z234Q.cjs} +5 -5
- package/dist/chat-protocol/events.d.ts +4 -1
- package/dist/chat-protocol/events.d.ts.map +1 -1
- package/dist/chat-protocol/index.cjs +90 -40
- package/dist/chat-protocol/nats-decoder.d.ts.map +1 -1
- package/dist/chat-protocol/nats-decoder.js +5 -1
- package/dist/chat-protocol/policy-review.d.ts +18 -0
- package/dist/chat-protocol/policy-review.d.ts.map +1 -0
- package/dist/chat-protocol/policy-review.js +55 -0
- package/dist/{chunk-BU2PSRAS.cjs → chunk-2W22LY3W.cjs} +11 -11
- package/dist/{chunk-ZDSC3GFX.cjs → chunk-3SJVF3HW.cjs} +6 -6
- package/dist/{chunk-GAYLAA3L.cjs → chunk-3ZQESOPJ.cjs} +79 -79
- package/dist/{chunk-IPGGSFR7.cjs → chunk-477P6AQH.cjs} +6 -6
- package/dist/{chunk-5CBI2ZYV.cjs → chunk-5RMBLOJ5.cjs} +12 -12
- package/dist/{chunk-36DUCHI7.cjs → chunk-6GWRPW6B.cjs} +4 -4
- package/dist/{chunk-SOSIXRQ3.cjs → chunk-AZEO7HBB.cjs} +2 -2
- package/dist/{chunk-FRG724DU.cjs → chunk-BNHTBLAG.cjs} +17 -17
- package/dist/{chunk-VRWBJL7B.cjs → chunk-CHGIACIP.cjs} +91 -91
- package/dist/{chunk-CAGNWDVJ.cjs → chunk-COJG2ATY.cjs} +45 -45
- package/dist/{chunk-XKOL5CNU.cjs → chunk-D3H6AI7O.cjs} +956 -1077
- package/dist/{chunk-ALRYVZ3E.cjs → chunk-DLTPSP5F.cjs} +2 -2
- package/dist/{chunk-3W4ASAXN.cjs → chunk-EIACEY2L.cjs} +4 -4
- package/dist/{chunk-TIVPOVIM.cjs → chunk-ETZFBB7O.cjs} +2 -2
- package/dist/{chunk-GRCOEICK.cjs → chunk-G7GF4PWA.cjs} +6 -6
- package/dist/{chunk-7ICHJVAT.cjs → chunk-GEZ3UXCA.cjs} +25 -25
- package/dist/chunk-GGUFVIJ6.cjs +28 -0
- package/dist/{chunk-ZGEWT3SF.cjs → chunk-HXURNKXI.cjs} +3 -3
- package/dist/{chunk-TX4NTH22.cjs → chunk-IC4IJJB2.cjs} +102 -102
- package/dist/{chunk-BUEEQD3G.cjs → chunk-IGVAPIEW.cjs} +2 -2
- package/dist/{chunk-IG6ROHPS.cjs → chunk-IO6NN3SL.cjs} +54 -54
- package/dist/{chunk-5PIR77V5.cjs → chunk-KHOB3TES.cjs} +4 -4
- package/dist/{chunk-JQCQCE6U.cjs → chunk-KKFDRCQF.cjs} +2 -2
- package/dist/{chunk-6AJYGXXS.cjs → chunk-KNN2GCMW.cjs} +21 -21
- package/dist/{chunk-YJZ7R3W5.cjs → chunk-KXFIYO4O.cjs} +8 -8
- package/dist/{chunk-FXLROQUT.cjs → chunk-LFEURIZN.cjs} +590 -607
- package/dist/{chunk-JWIITCVB.cjs → chunk-MFDRCTM3.cjs} +47 -47
- package/dist/{chunk-OHHDX3Z4.cjs → chunk-MXY2OGEV.cjs} +42 -42
- package/dist/{chunk-533QK4R6.cjs → chunk-NMWLXHFH.cjs} +130 -130
- package/dist/{chunk-MDLT6D46.cjs → chunk-O3EKOXFZ.cjs} +20 -20
- package/dist/{chunk-HLJXCOMA.cjs → chunk-OH5TXFRR.cjs} +4 -4
- package/dist/{chunk-SA2NNWIJ.cjs → chunk-P63CRPWI.cjs} +19 -64
- package/dist/{chunk-R5JPZ6TY.cjs → chunk-QOW2GP3V.cjs} +21 -21
- package/dist/{chunk-JBTH3O2C.cjs → chunk-SSKMGH5O.cjs} +4 -4
- package/dist/{chunk-4YBS4HIO.cjs → chunk-U767P4JU.cjs} +455 -38
- package/dist/{chunk-FNQWL4W4.cjs → chunk-UO2EJGRJ.cjs} +45 -45
- package/dist/{chunk-IHY7E4EX.cjs → chunk-USPUZO53.cjs} +4 -4
- package/dist/{chunk-IN3LA2FU.cjs → chunk-UV45EPXN.cjs} +2 -2
- package/dist/{chunk-S3QXLD4X.cjs → chunk-VCFQHPOO.cjs} +37 -3
- package/dist/{chunk-2QZUTNL3.cjs → chunk-VUHHLRAY.cjs} +92 -92
- package/dist/{chunk-QJER2ZNA.cjs → chunk-WFAZMASF.cjs} +3 -3
- package/dist/{chunk-LGYPCUHO.cjs → chunk-X3WIOMEE.cjs} +36 -36
- package/dist/{cloud-tenants-TVB3DT3J.cjs → cloud-tenants-O33HCUYB.cjs} +50 -50
- package/dist/components/case-studies/index.cjs +69 -69
- package/dist/components/chat/approval-batch-message.d.ts +5 -0
- package/dist/components/chat/approval-batch-message.d.ts.map +1 -1
- package/dist/components/chat/approval-batch-message.js +36 -10
- package/dist/components/chat/index.cjs +45 -45
- package/dist/components/chat/policy-review.d.ts +27 -0
- package/dist/components/chat/policy-review.d.ts.map +1 -0
- package/dist/components/chat/policy-review.js +67 -0
- package/dist/components/chat/stream/message-mutations.d.ts.map +1 -1
- package/dist/components/chat/stream/message-mutations.js +4 -1
- package/dist/components/chat/tool-execution-display.d.ts.map +1 -1
- package/dist/components/chat/tool-execution-display.js +16 -5
- package/dist/components/chat/types/message.types.d.ts +40 -2
- package/dist/components/chat/types/message.types.d.ts.map +1 -1
- package/dist/components/chat/utils/extract-incomplete-message-state.d.ts.map +1 -1
- package/dist/components/chat/utils/extract-incomplete-message-state.js +2 -0
- package/dist/components/chat/utils/message-segment-accumulator.d.ts.map +1 -1
- package/dist/components/chat/utils/message-segment-accumulator.js +3 -0
- package/dist/components/chat/utils/process-historical-messages.d.ts +2 -2
- package/dist/components/chat/utils/process-historical-messages.d.ts.map +1 -1
- package/dist/components/chat/utils/process-historical-messages.js +7 -1
- package/dist/components/contact/index.cjs +51 -51
- package/dist/components/docs/index.cjs +54 -54
- package/dist/components/embeds/index.cjs +51 -51
- package/dist/components/faq/index.cjs +52 -52
- package/dist/components/features/approval-level.d.ts +6 -12
- package/dist/components/features/approval-level.d.ts.map +1 -1
- package/dist/components/features/approval-level.js +45 -55
- package/dist/components/features/index.cjs +55 -54
- package/dist/components/features/notifications/approval-request-notification-tile.d.ts.map +1 -1
- package/dist/components/features/notifications/approval-request-notification-tile.js +71 -48
- package/dist/components/features/notifications/types.d.ts +2 -0
- package/dist/components/features/notifications/types.d.ts.map +1 -1
- package/dist/components/features/notifications/types.js +3 -1
- package/dist/components/features/policy-configuration-panel.d.ts.map +1 -1
- package/dist/components/features/policy-configuration-panel.js +75 -64
- package/dist/components/help-center-pages/index.cjs +156 -156
- package/dist/components/icons-v2-generated/brand-logos/index.d.ts +1 -0
- package/dist/components/icons-v2-generated/brand-logos/index.d.ts.map +1 -1
- package/dist/components/icons-v2-generated/brand-logos/index.js +2 -0
- package/dist/components/icons-v2-generated/brand-logos/stripe-icon.d.ts +8 -0
- package/dist/components/icons-v2-generated/brand-logos/stripe-icon.d.ts.map +1 -0
- package/dist/components/icons-v2-generated/brand-logos/stripe-icon.js +24 -0
- package/dist/components/icons-v2-generated/icon-loaders.d.ts.map +1 -1
- package/dist/components/icons-v2-generated/icon-loaders.js +1 -0
- package/dist/components/icons-v2-generated/icon-names.js +1 -1
- package/dist/components/icons-v2-generated/index.cjs +33 -29
- package/dist/components/index.cjs +122 -123
- package/dist/components/meeting-scheduler/index.cjs +113 -112
- package/dist/components/navigation/index.cjs +54 -54
- package/dist/components/onboarding-guides/index.cjs +53 -53
- package/dist/components/product-demo/index.cjs +61 -61
- package/dist/components/related-content/index.cjs +9 -9
- package/dist/components/tickets/index.cjs +57 -57
- package/dist/components/ui/file-manager/index.cjs +8 -9
- package/dist/components/ui/index.cjs +55 -56
- package/dist/components/ui/radio-group.d.ts.map +1 -1
- package/dist/components/ui/radio-group.js +8 -2
- package/dist/components/ui/tab-selector.d.ts +7 -1
- package/dist/components/ui/tab-selector.d.ts.map +1 -1
- package/dist/components/ui/tab-selector.js +22 -3
- package/dist/{devices-NGCTSXIU.cjs → devices-2RGGMC2B.cjs} +51 -51
- package/dist/{embeddable-chat-322NDFP5.cjs → embeddable-chat-SJEEJI4N.cjs} +122 -122
- package/dist/hooks/index.cjs +9 -9
- package/dist/{icon-loaders-SUPEKMBJ.cjs → icon-loaders-CTH6E7OP.cjs} +1 -0
- package/dist/index.cjs +61 -62
- package/dist/{knowledge-75PO5DYS.cjs → knowledge-5TJIXVMD.cjs} +52 -52
- package/dist/{logs-PZESOAIG.cjs → logs-HGQOTRKZ.cjs} +57 -57
- package/dist/{policies-6XNMBFWO.cjs → policies-GWFSLVSM.cjs} +54 -54
- package/dist/{remote-session-Q2FIBCGT.cjs → remote-session-SG44CNOK.cjs} +36 -36
- package/dist/{scripts-B3JW6TPF.cjs → scripts-PGJNAZF4.cjs} +57 -57
- package/dist/{software-update-NWP542J7.cjs → software-update-KKLSYHDI.cjs} +54 -54
- package/dist/stripe-icon-YKVABTNI.cjs +7 -0
- package/dist/{tickets-board-7FLGQEHF.cjs → tickets-board-SQY2Y6QV.cjs} +39 -38
- package/dist/utils/index.cjs +32 -1
- package/package.json +1 -1
- package/src/chat-protocol/events.ts +4 -1
- package/src/chat-protocol/nats-decoder.ts +4 -0
- package/src/chat-protocol/policy-review.ts +71 -0
- package/src/components/chat/approval-batch-message.tsx +47 -10
- package/src/components/chat/policy-review.tsx +90 -0
- package/src/components/chat/stream/message-mutations.ts +4 -0
- package/src/components/chat/tool-execution-display.tsx +23 -4
- package/src/components/chat/types/message.types.ts +42 -2
- package/src/components/chat/utils/extract-incomplete-message-state.ts +2 -0
- package/src/components/chat/utils/message-segment-accumulator.ts +3 -0
- package/src/components/chat/utils/process-historical-messages.ts +14 -3
- package/src/components/features/approval-level.tsx +74 -78
- package/src/components/features/notifications/approval-request-notification-tile.tsx +75 -50
- package/src/components/features/notifications/types.ts +4 -0
- package/src/components/features/policy-configuration-panel.tsx +100 -83
- package/src/components/icons-v2/icon-colors.json +3 -0
- package/src/components/icons-v2-generated/brand-logos/index.ts +1 -0
- package/src/components/icons-v2-generated/brand-logos/stripe-icon.tsx +27 -0
- package/src/components/icons-v2-generated/icon-loaders.ts +1 -0
- package/src/components/icons-v2-generated/icon-names.ts +1 -1
- package/src/components/ui/radio-group.tsx +20 -2
- package/src/components/ui/tab-selector.tsx +26 -3
- package/src/styles/ods-colors.css +1 -0
- package/dist/chunk-N3MBQRCQ.cjs +0 -41
- /package/dist/{chunk-46547WQW.cjs → chunk-7HH4Y27U.cjs} +0 -0
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import type { ComponentType } from 'react';
|
|
2
2
|
import type { ApprovalLevel } from '../../types/permissions';
|
|
3
|
-
/**
|
|
4
|
-
* The approval levels, in the order a choice reads: the two that need nobody
|
|
5
|
-
* (allow, never) side by side, then the two that ask someone (a technician,
|
|
6
|
-
* the user) side by side.
|
|
7
|
-
*/
|
|
3
|
+
/** The approval levels, from the freest to the strictest, as the guardrails settings order them (Figma 4365-22670). */
|
|
8
4
|
export declare const APPROVAL_LEVELS: readonly ApprovalLevel[];
|
|
9
5
|
export interface ApprovalLevelMeta {
|
|
10
6
|
/** The level's name, as every surface writes it. */
|
|
@@ -51,13 +47,11 @@ export interface ApprovalLevelViewProps {
|
|
|
51
47
|
}
|
|
52
48
|
/**
|
|
53
49
|
* THE way a level is shown, read-only or editable, by one prop: the level's
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
* Editable, each icon has its level's name as its accessible name and a
|
|
60
|
-
* tooltip with what the level means (hover or keyboard focus; a tap selects).
|
|
50
|
+
* icon in its colour, then its name (read-only, Figma 1608-49531), or its name
|
|
51
|
+
* in its colour, then the four levels' icons in a compact `TabSelector` strip,
|
|
52
|
+
* the one in force filled (editable, Figma 4365-22670). Name, icon and colour
|
|
53
|
+
* are `APPROVAL_LEVEL_META`'s in both. Editable, each icon has its level's name
|
|
54
|
+
* as its accessible name.
|
|
61
55
|
*/
|
|
62
56
|
export declare function ApprovalLevelView({ value, editable, onChange, disabled, showLabel, 'aria-labelledby': labelledBy, loading, className, }: ApprovalLevelViewProps): import("react").JSX.Element;
|
|
63
57
|
//# sourceMappingURL=approval-level.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"approval-level.d.ts","sourceRoot":"","sources":["../../../src/components/features/approval-level.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"approval-level.d.ts","sourceRoot":"","sources":["../../../src/components/features/approval-level.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAY7D,uHAAuH;AACvH,eAAO,MAAM,eAAe,EAAE,SAAS,aAAa,EAAoD,CAAC;AAEzG,MAAM,WAAW,iBAAiB;IAChC,oDAAoD;IACpD,KAAK,EAAE,MAAM,CAAC;IACd,kEAAkE;IAClE,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,aAAa,CAAC;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC3D,+EAA+E;IAC/E,aAAa,EAAE,MAAM,CAAC;CACvB;AAED;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,aAAa,EAAE,iBAAiB,CAoBxE,CAAC;AAgCF,MAAM,WAAW,sBAAsB;IACrC,0BAA0B;IAC1B,KAAK,EAAE,aAAa,CAAC;IACrB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,kCAAkC;IAClC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IAC1C,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,2FAA2F;IAC3F,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,gGAAgG;IAChG,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,QAAgB,EAChB,SAAgB,EAChB,iBAAiB,EAAE,UAAU,EAC7B,OAAe,EACf,SAAS,GACV,EAAE,sBAAsB,+BAoDxB"}
|
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { cn } from "../../utils/cn.js";
|
|
4
|
-
import { HeadsetIcon } from "../icons-v2-generated/audio-and-visual/headset-icon.js";
|
|
5
4
|
import { BannedIcon } from "../icons-v2-generated/security/banned-icon.js";
|
|
5
|
+
import { ShieldCheckIcon } from "../icons-v2-generated/security/shield-check-icon.js";
|
|
6
6
|
import { CheckCircleIcon } from "../icons-v2-generated/signs-and-symbols/check-circle-icon.js";
|
|
7
|
-
import {
|
|
7
|
+
import { UserCheckIcon } from "../icons-v2-generated/users/user-check-icon.js";
|
|
8
8
|
import { UnifiedSkeleton } from "../loading/unified-skeleton.js";
|
|
9
|
-
import { TOGGLE_GROUP_CLASS, ToggleGroup, ToggleGroupItem } from "../toggle-group.js";
|
|
10
9
|
import { TextHold } from "../ui/layout-hold.js";
|
|
11
10
|
import { useLoadingScope } from "../ui/loading-scope.js";
|
|
12
|
-
import {
|
|
13
|
-
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "../ui/tooltip.js";
|
|
11
|
+
import { TabSelector } from "../ui/tab-selector.js";
|
|
14
12
|
import { TouchFriendlyTooltip } from "../ui/touch-friendly-tooltip.js";
|
|
15
|
-
const APPROVAL_LEVELS = ["ALLOW", "
|
|
13
|
+
const APPROVAL_LEVELS = ["ALLOW", "ASK_USER", "ASK_TECHNICIAN", "DENY"];
|
|
16
14
|
const APPROVAL_LEVEL_META = {
|
|
17
15
|
ALLOW: {
|
|
18
16
|
label: "Allow",
|
|
@@ -23,25 +21,35 @@ const APPROVAL_LEVEL_META = {
|
|
|
23
21
|
ASK_USER: {
|
|
24
22
|
label: "Ask User",
|
|
25
23
|
hint: "Asks the person at the computer first.",
|
|
26
|
-
Icon:
|
|
24
|
+
Icon: UserCheckIcon,
|
|
27
25
|
toneClassName: "text-ods-warning"
|
|
28
26
|
},
|
|
29
27
|
ASK_TECHNICIAN: {
|
|
30
28
|
label: "Ask Technician",
|
|
31
29
|
hint: "Asks a technician first. Nothing runs until they approve.",
|
|
32
|
-
Icon:
|
|
30
|
+
Icon: ShieldCheckIcon,
|
|
33
31
|
toneClassName: "text-ods-warning"
|
|
34
32
|
},
|
|
35
33
|
DENY: { label: "Restrict", hint: "Never runs.", Icon: BannedIcon, toneClassName: "text-ods-error" }
|
|
36
34
|
};
|
|
37
|
-
const ICON_PX =
|
|
35
|
+
const ICON_PX = 24;
|
|
38
36
|
const READ_ONLY_ROW_CLASS = "inline-flex shrink-0 items-center gap-[var(--spacing-system-xxs)]";
|
|
39
|
-
const EDITABLE_ROW_CLASS = "flex shrink-0 items-center gap-[var(--spacing-system-
|
|
37
|
+
const EDITABLE_ROW_CLASS = "flex shrink-0 items-center gap-[var(--spacing-system-xxs)] content-md:gap-[var(--spacing-system-m)]";
|
|
38
|
+
const EDITABLE_NAME_ORDER_CLASS = "order-last content-md:order-none";
|
|
39
|
+
const READ_ONLY_ICON_BOX_CLASS = "[&>*]:!size-4 content-md:[&>*]:!size-6";
|
|
40
|
+
const READ_ONLY_NAME_CLASS = "whitespace-nowrap text-ods-text-primary text-h4";
|
|
40
41
|
const LEVEL_NAME_CLASS = "whitespace-nowrap text-h6";
|
|
41
|
-
const
|
|
42
|
+
const EDITABLE_ICON_PX = 20;
|
|
42
43
|
const LONGEST_LEVEL_LABEL = APPROVAL_LEVELS.map((level) => APPROVAL_LEVEL_META[level].label).reduce(
|
|
43
44
|
(a, b) => b.length > a.length ? b : a
|
|
44
45
|
);
|
|
46
|
+
function levelItems(inForce) {
|
|
47
|
+
return APPROVAL_LEVELS.map((level) => {
|
|
48
|
+
const { label, Icon } = APPROVAL_LEVEL_META[level];
|
|
49
|
+
const tone = level === inForce ? "text-ods-text-primary" : "text-ods-text-secondary";
|
|
50
|
+
return { id: level, ariaLabel: label, icon: /* @__PURE__ */ jsx(Icon, { size: EDITABLE_ICON_PX, className: tone, "aria-hidden": true }) };
|
|
51
|
+
});
|
|
52
|
+
}
|
|
45
53
|
function ApprovalLevelView({
|
|
46
54
|
value,
|
|
47
55
|
editable,
|
|
@@ -57,76 +65,58 @@ function ApprovalLevelView({
|
|
|
57
65
|
return /* @__PURE__ */ jsx(ApprovalLevelSkeleton, { editable: canEdit, showLabel, className });
|
|
58
66
|
}
|
|
59
67
|
const current = APPROVAL_LEVEL_META[value];
|
|
60
|
-
const name = showLabel ? /* @__PURE__ */ jsx("span", { className: cn(LEVEL_NAME_CLASS, current.toneClassName), children: current.label }) : null;
|
|
61
68
|
if (!canEdit) {
|
|
62
|
-
const icon = /* @__PURE__ */ jsxs("span", { className: cn("inline-flex shrink-0", current.toneClassName), children: [
|
|
69
|
+
const icon = /* @__PURE__ */ jsxs("span", { className: cn("inline-flex shrink-0", READ_ONLY_ICON_BOX_CLASS, current.toneClassName), children: [
|
|
63
70
|
/* @__PURE__ */ jsx(current.Icon, { size: ICON_PX, "aria-hidden": true }),
|
|
64
71
|
!showLabel && /* @__PURE__ */ jsx("span", { className: "sr-only", children: current.label })
|
|
65
72
|
] });
|
|
66
73
|
return /* @__PURE__ */ jsxs("span", { className: cn(READ_ONLY_ROW_CLASS, className), children: [
|
|
67
|
-
|
|
68
|
-
showLabel
|
|
74
|
+
showLabel ? icon : /* @__PURE__ */ jsx(TouchFriendlyTooltip, { content: `${current.label}: ${current.hint}`, side: "top", children: icon }),
|
|
75
|
+
showLabel && /* @__PURE__ */ jsx("span", { className: READ_ONLY_NAME_CLASS, children: current.label })
|
|
69
76
|
] });
|
|
70
77
|
}
|
|
78
|
+
const name = showLabel ? /* @__PURE__ */ jsx("span", { className: cn(LEVEL_NAME_CLASS, EDITABLE_NAME_ORDER_CLASS, current.toneClassName), children: current.label }) : null;
|
|
71
79
|
return /* @__PURE__ */ jsxs("div", { className: cn(EDITABLE_ROW_CLASS, className), children: [
|
|
72
80
|
name,
|
|
73
|
-
/* @__PURE__ */ jsx(
|
|
74
|
-
|
|
81
|
+
/* @__PURE__ */ jsx("div", { role: "group", "aria-labelledby": labelledBy, children: /* @__PURE__ */ jsx(
|
|
82
|
+
TabSelector,
|
|
75
83
|
{
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
size: "sm",
|
|
84
|
+
variant: "secondary",
|
|
85
|
+
size: "compact",
|
|
79
86
|
value,
|
|
80
87
|
disabled,
|
|
81
88
|
onValueChange: (next) => {
|
|
82
|
-
if (next
|
|
89
|
+
if (next !== value) onChange?.(next);
|
|
83
90
|
},
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
const { label, hint, Icon, toneClassName } = APPROVAL_LEVEL_META[level];
|
|
87
|
-
return (
|
|
88
|
-
// A plain tooltip (hover and keyboard focus): a tap must SELECT the level, and on
|
|
89
|
-
// touch the name beside the group says what is in force.
|
|
90
|
-
/* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
91
|
-
/* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
92
|
-
ToggleGroupItem,
|
|
93
|
-
{
|
|
94
|
-
value: level,
|
|
95
|
-
"aria-label": label,
|
|
96
|
-
className: cn(LEVEL_BUTTON_CLASS, level === value && toneClassName),
|
|
97
|
-
children: /* @__PURE__ */ jsx(Icon, { size: ICON_PX, "aria-hidden": true })
|
|
98
|
-
}
|
|
99
|
-
) }),
|
|
100
|
-
/* @__PURE__ */ jsxs(TooltipContent, { side: "top", className: "max-w-xs", children: [
|
|
101
|
-
/* @__PURE__ */ jsx("b", { children: label }),
|
|
102
|
-
": ",
|
|
103
|
-
hint
|
|
104
|
-
] })
|
|
105
|
-
] }, level)
|
|
106
|
-
);
|
|
107
|
-
})
|
|
91
|
+
items: levelItems(value),
|
|
92
|
+
className: "w-auto"
|
|
108
93
|
}
|
|
109
94
|
) })
|
|
110
95
|
] });
|
|
111
96
|
}
|
|
112
97
|
function ApprovalLevelSkeleton({ editable = false, showLabel = true, className }) {
|
|
113
|
-
const name = showLabel ? /* @__PURE__ */ jsx("span", { className: LEVEL_NAME_CLASS, children: /* @__PURE__ */ jsx(TextHold, { children: LONGEST_LEVEL_LABEL }) }) : null;
|
|
114
98
|
if (!editable) {
|
|
115
99
|
return /* @__PURE__ */ jsxs("span", { "aria-hidden": true, className: cn(READ_ONLY_ROW_CLASS, className), children: [
|
|
116
|
-
|
|
117
|
-
/* @__PURE__ */ jsx(
|
|
100
|
+
/* @__PURE__ */ jsx("span", { className: cn("inline-flex shrink-0", READ_ONLY_ICON_BOX_CLASS), children: /* @__PURE__ */ jsx(UnifiedSkeleton, { as: "span", className: "inline-block shrink-0 rounded-sm", width: ICON_PX, height: ICON_PX }) }),
|
|
101
|
+
showLabel && /* @__PURE__ */ jsx("span", { className: READ_ONLY_NAME_CLASS, children: /* @__PURE__ */ jsx(TextHold, { children: LONGEST_LEVEL_LABEL }) })
|
|
118
102
|
] });
|
|
119
103
|
}
|
|
104
|
+
const name = showLabel ? /* @__PURE__ */ jsx("span", { className: cn(LEVEL_NAME_CLASS, EDITABLE_NAME_ORDER_CLASS), children: /* @__PURE__ */ jsx(TextHold, { children: LONGEST_LEVEL_LABEL }) }) : null;
|
|
120
105
|
return /* @__PURE__ */ jsxs("div", { "aria-hidden": true, inert: true, className: cn(EDITABLE_ROW_CLASS, className), children: [
|
|
121
106
|
name,
|
|
122
|
-
/* @__PURE__ */ jsx(
|
|
123
|
-
|
|
107
|
+
/* @__PURE__ */ jsx(
|
|
108
|
+
TabSelector,
|
|
124
109
|
{
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
110
|
+
variant: "secondary",
|
|
111
|
+
size: "compact",
|
|
112
|
+
value: "",
|
|
113
|
+
disabled: true,
|
|
114
|
+
onValueChange: () => {
|
|
115
|
+
},
|
|
116
|
+
items: levelItems(void 0),
|
|
117
|
+
className: "w-auto"
|
|
118
|
+
}
|
|
119
|
+
)
|
|
130
120
|
] });
|
|
131
121
|
}
|
|
132
122
|
export {
|