@flamingo-stack/openframe-frontend-core 0.0.712 → 0.0.714
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/{chunk-FCAVAEHF.js → chunk-2LZ3IYGT.js} +701 -620
- package/dist/{chunk-G3OMVCID.js → chunk-4GFAKUHF.js} +1 -1
- package/dist/{chunk-7NSU5EQD.cjs → chunk-5MMCYJAJ.cjs} +11 -11
- package/dist/{chunk-3SEEGNRE.js → chunk-AQI74KC7.js} +3 -3
- package/dist/{chunk-5Y72YQEK.js → chunk-BIFUUH4K.js} +3 -3
- package/dist/{chunk-OPYODNV2.js → chunk-DI5VLY3G.js} +1 -1
- package/dist/{chunk-OBZJICEA.cjs → chunk-E25A235W.cjs} +3 -3
- package/dist/{chunk-BXSRTBLU.cjs → chunk-EORJFB2Z.cjs} +2 -2
- package/dist/{chunk-T3CLXR43.cjs → chunk-GXHWSAV6.cjs} +15 -15
- package/dist/{chunk-EFNKS5W4.js → chunk-JHSPIDV5.js} +1 -1
- package/dist/{chunk-4UYKNOZG.js → chunk-KSEOIICU.js} +2 -2
- package/dist/{chunk-JGCFRTND.cjs → chunk-LTLHCAZY.cjs} +4 -4
- package/dist/{chunk-5SDELRH3.js → chunk-OQVGA3YE.js} +1 -1
- package/dist/{chunk-7HNYYNKE.js → chunk-QW7KTWLB.js} +2 -2
- package/dist/{chunk-CSCJU6YC.cjs → chunk-S66W6HNZ.cjs} +10 -10
- package/dist/{chunk-WWJG4GVG.cjs → chunk-U4WCFIYB.cjs} +22 -22
- package/dist/{chunk-RBYVFPER.js → chunk-VBDGMXZO.js} +1 -1
- package/dist/{chunk-N67XG5GY.js → chunk-VKIRTB7K.js} +1 -1
- package/dist/{chunk-3UAJLO5U.cjs → chunk-W4CS6UJS.cjs} +3 -3
- package/dist/{chunk-Z5SWJW5Q.cjs → chunk-WEEZSGFD.cjs} +23 -23
- package/dist/{chunk-UT3ODMBU.cjs → chunk-XFFIUXVI.cjs} +2 -2
- package/dist/{chunk-L6ZQGWCX.cjs → chunk-ZSJ6WWFH.cjs} +191 -110
- package/dist/{cloud-tenants-KZUZGD4A.cjs → cloud-tenants-MI7APZJD.cjs} +2 -2
- package/dist/{cloud-tenants-OGLVVQ7X.js → cloud-tenants-NSEVWC26.js} +1 -1
- package/dist/components/case-studies/index.cjs +10 -10
- package/dist/components/case-studies/index.js +2 -2
- package/dist/components/contact/index.cjs +3 -3
- package/dist/components/contact/index.js +2 -2
- package/dist/components/docs/index.cjs +5 -5
- package/dist/components/docs/index.js +4 -4
- package/dist/components/embeds/index.cjs +3 -3
- package/dist/components/embeds/index.js +2 -2
- package/dist/components/faq/index.cjs +3 -3
- package/dist/components/faq/index.js +2 -2
- package/dist/components/features/approval-level.d.ts +53 -0
- package/dist/components/features/approval-level.d.ts.map +1 -0
- package/dist/components/features/index.cjs +10 -2
- package/dist/components/features/index.d.ts +1 -0
- package/dist/components/features/index.d.ts.map +1 -1
- package/dist/components/features/index.js +9 -1
- package/dist/components/features/policy-configuration-panel.d.ts.map +1 -1
- package/dist/components/help-center-pages/index.cjs +39 -39
- package/dist/components/help-center-pages/index.js +10 -10
- package/dist/components/index.cjs +26 -18
- package/dist/components/index.js +16 -8
- package/dist/components/meeting-scheduler/index.cjs +11 -11
- package/dist/components/meeting-scheduler/index.js +1 -1
- package/dist/components/navigation/index.cjs +3 -3
- package/dist/components/navigation/index.js +2 -2
- package/dist/components/onboarding-guides/index.cjs +4 -4
- package/dist/components/onboarding-guides/index.js +3 -3
- package/dist/components/product-demo/index.cjs +6 -6
- package/dist/components/product-demo/index.js +6 -6
- package/dist/components/tickets/index.cjs +5 -5
- package/dist/components/tickets/index.js +4 -4
- package/dist/components/ui/index.cjs +2 -2
- package/dist/components/ui/index.js +1 -1
- package/dist/{devices-YGYJIXQY.cjs → devices-6NMK4EXV.cjs} +3 -3
- package/dist/{devices-LBMG42K6.js → devices-W3VKQEVZ.js} +1 -1
- package/dist/index.cjs +11 -3
- package/dist/index.js +10 -2
- package/dist/{knowledge-KTCVJIWN.cjs → knowledge-GDMGHFEC.cjs} +2 -2
- package/dist/{knowledge-H5BIWJVI.js → knowledge-YWCB7HNC.js} +1 -1
- package/dist/{logs-RVCC2UQW.cjs → logs-7QDRV3GN.cjs} +10 -10
- package/dist/{logs-DB5Z7M5Q.js → logs-E742S5A2.js} +1 -1
- package/dist/{policies-HV4IQCBV.cjs → policies-BEVF6AEM.cjs} +6 -6
- package/dist/{policies-EWUULFBR.js → policies-XTPAKRHI.js} +1 -1
- package/dist/{software-update-6PXKRKBT.js → software-update-FXWIEKSW.js} +1 -1
- package/dist/{software-update-D4OVSWSG.cjs → software-update-KPHX4XQ7.cjs} +6 -6
- package/package.json +1 -1
- package/src/components/features/approval-level.tsx +153 -0
- package/src/components/features/index.ts +1 -0
- package/src/components/features/policy-configuration-panel.tsx +3 -12
package/dist/index.js
CHANGED
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
isMegaMenu,
|
|
34
34
|
navLinkLabel,
|
|
35
35
|
siteNavHasMobileMenus
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-JHSPIDV5.js";
|
|
37
37
|
import {
|
|
38
38
|
MobileNavigationDropdown,
|
|
39
39
|
MultiLevelNavigation,
|
|
@@ -49,6 +49,8 @@ import {
|
|
|
49
49
|
AIRequiredBadge,
|
|
50
50
|
AIStatusIndicator,
|
|
51
51
|
AIWarningsSection,
|
|
52
|
+
APPROVAL_LEVELS,
|
|
53
|
+
APPROVAL_LEVEL_META,
|
|
52
54
|
Accordion,
|
|
53
55
|
AccordionContent,
|
|
54
56
|
AccordionItem,
|
|
@@ -83,6 +85,8 @@ import {
|
|
|
83
85
|
AppLayoutDrawerTrigger,
|
|
84
86
|
AppStoreBadge,
|
|
85
87
|
AppWindowFrame,
|
|
88
|
+
ApprovalLevelControl,
|
|
89
|
+
ApprovalLevelMark,
|
|
86
90
|
ApprovalRequestNotificationTile,
|
|
87
91
|
ArrayEntryManager,
|
|
88
92
|
ArticleDetailLayout,
|
|
@@ -561,7 +565,7 @@ import {
|
|
|
561
565
|
useTrackerClock,
|
|
562
566
|
useWalkthroughVideo,
|
|
563
567
|
usersCountLabel
|
|
564
|
-
} from "./chunk-
|
|
568
|
+
} from "./chunk-2LZ3IYGT.js";
|
|
565
569
|
import {
|
|
566
570
|
Board,
|
|
567
571
|
BoardColumn,
|
|
@@ -2084,6 +2088,8 @@ export {
|
|
|
2084
2088
|
ANNOUNCEMENT_CTA_DEFAULTS,
|
|
2085
2089
|
ANTHROPIC_SUPPORTED_IMAGE_MIME,
|
|
2086
2090
|
APPROVAL_BLOCK_VARIANT,
|
|
2091
|
+
APPROVAL_LEVELS,
|
|
2092
|
+
APPROVAL_LEVEL_META,
|
|
2087
2093
|
APPROVAL_STATUS,
|
|
2088
2094
|
ASK_AI_OPEN_EVENT,
|
|
2089
2095
|
ASSISTANT_TYPE,
|
|
@@ -2139,6 +2145,8 @@ export {
|
|
|
2139
2145
|
AppWindowFrame,
|
|
2140
2146
|
AppleIcon,
|
|
2141
2147
|
ApprovalBatchMessage,
|
|
2148
|
+
ApprovalLevelControl,
|
|
2149
|
+
ApprovalLevelMark,
|
|
2142
2150
|
ApprovalRequestMessage,
|
|
2143
2151
|
ApprovalRequestNotificationTile,
|
|
2144
2152
|
ApprovalStatusTag,
|
|
@@ -8,7 +8,7 @@ var _chunkII4QMH26cjs = require('./chunk-II4QMH26.cjs');
|
|
|
8
8
|
var _chunkKHXZFLINcjs = require('./chunk-KHXZFLIN.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _chunkZSJ6WWFHcjs = require('./chunk-ZSJ6WWFH.cjs');
|
|
12
12
|
require('./chunk-4HJRHEXD.cjs');
|
|
13
13
|
require('./chunk-HQQE74RO.cjs');
|
|
14
14
|
require('./chunk-DEY6XXGO.cjs');
|
|
@@ -96,7 +96,7 @@ function KnowledgeScreen(_props) {
|
|
|
96
96
|
const cast = _chunkII4QMH26cjs.useProductDemoCast.call(void 0, );
|
|
97
97
|
const fixture = _react.useMemo.call(void 0, () => buildKnowledgeFixture(cast), [cast]);
|
|
98
98
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "h-full bg-ods-bg", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
99
|
-
|
|
99
|
+
_chunkZSJ6WWFHcjs.KnowledgeBaseArticleView,
|
|
100
100
|
{
|
|
101
101
|
...fixture.article,
|
|
102
102
|
content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHETQETPVcjs.SimpleMarkdownRenderer, { content: fixture.content, textSize: "compact" })
|
|
@@ -16,7 +16,7 @@ var _chunkKHXZFLINcjs = require('./chunk-KHXZFLIN.cjs');
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
var
|
|
19
|
+
var _chunkZSJ6WWFHcjs = require('./chunk-ZSJ6WWFH.cjs');
|
|
20
20
|
require('./chunk-4HJRHEXD.cjs');
|
|
21
21
|
require('./chunk-HQQE74RO.cjs');
|
|
22
22
|
require('./chunk-DEY6XXGO.cjs');
|
|
@@ -77,7 +77,7 @@ function entry(logId, minutesAgo, severity, toolType, device2, summary) {
|
|
|
77
77
|
id: logId,
|
|
78
78
|
logId,
|
|
79
79
|
timestamp: displayTime(_chunkKHXZFLINcjs.demoMinutesAgo.call(void 0, minutesAgo)),
|
|
80
|
-
status: { label: severity, variant:
|
|
80
|
+
status: { label: severity, variant: _chunkZSJ6WWFHcjs.logSeverityVariant.call(void 0, severity) },
|
|
81
81
|
source: { name: toolType, toolType },
|
|
82
82
|
device: device2,
|
|
83
83
|
description: { title: summary }
|
|
@@ -149,13 +149,13 @@ var NO_FILTERS = {};
|
|
|
149
149
|
var ACTION_COLUMNS = ["copy", "quickView", "open"];
|
|
150
150
|
var BESIDE_DRAWER_HIDDEN = [...ACTION_COLUMNS, "tool", "source"];
|
|
151
151
|
var logHref = () => "#";
|
|
152
|
-
var copyAction = () => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
152
|
+
var copyAction = () => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZSJ6WWFHcjs.LogCopyIconButton, {});
|
|
153
153
|
function LogsScreen({ compact = false }) {
|
|
154
154
|
const [dock, setDock] = _react.useState.call(void 0, null);
|
|
155
155
|
const selected = LOGS_FIXTURE_SELECTED;
|
|
156
156
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex h-full bg-ods-bg", children: [
|
|
157
157
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "min-w-0 flex-1 overflow-clip", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
158
|
-
|
|
158
|
+
_chunkZSJ6WWFHcjs.LogsPageView,
|
|
159
159
|
{
|
|
160
160
|
showHeader: false,
|
|
161
161
|
className: "p-[var(--spacing-system-l)]",
|
|
@@ -163,7 +163,7 @@ function LogsScreen({ compact = false }) {
|
|
|
163
163
|
onSearchChange: noop,
|
|
164
164
|
onOpenFilters: noop,
|
|
165
165
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
166
|
-
|
|
166
|
+
_chunkZSJ6WWFHcjs.LogsTableView,
|
|
167
167
|
{
|
|
168
168
|
logs: LOGS_FIXTURE_ENTRIES,
|
|
169
169
|
facets: LOGS_FIXTURE_FACETS,
|
|
@@ -177,8 +177,8 @@ function LogsScreen({ compact = false }) {
|
|
|
177
177
|
)
|
|
178
178
|
}
|
|
179
179
|
) }),
|
|
180
|
-
!compact && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { ref: setDock, className: "relative w-[calc(400px+var(--spacing-system-m))] shrink-0", children: dock && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
181
|
-
|
|
180
|
+
!compact && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { ref: setDock, className: "relative w-[calc(400px+var(--spacing-system-m))] shrink-0", children: dock && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZSJ6WWFHcjs.AppLayoutDrawerContainerContext.Provider, { value: dock, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
181
|
+
_chunkZSJ6WWFHcjs.LogDrawer,
|
|
182
182
|
{
|
|
183
183
|
docked: true,
|
|
184
184
|
isOpen: true,
|
|
@@ -190,12 +190,12 @@ function LogsScreen({ compact = false }) {
|
|
|
190
190
|
{ label: "Log ID", value: selected.logId },
|
|
191
191
|
{
|
|
192
192
|
label: "Source",
|
|
193
|
-
value: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
193
|
+
value: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZSJ6WWFHcjs.ToolBadge, { toolType: _chunkHETQETPVcjs.normalizeToolTypeWithFallback.call(void 0, selected.source.toolType) })
|
|
194
194
|
},
|
|
195
|
-
{ label: "Device", value:
|
|
195
|
+
{ label: "Device", value: _chunkZSJ6WWFHcjs.logSourceLabels.call(void 0, selected.device).deviceName }
|
|
196
196
|
],
|
|
197
197
|
deviceCard: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
198
|
-
|
|
198
|
+
_chunkZSJ6WWFHcjs.DeviceCard,
|
|
199
199
|
{
|
|
200
200
|
...LOGS_FIXTURE_DEVICE,
|
|
201
201
|
actions: {
|
|
@@ -10,7 +10,7 @@ var _chunkKHXZFLINcjs = require('./chunk-KHXZFLIN.cjs');
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _chunkZSJ6WWFHcjs = require('./chunk-ZSJ6WWFH.cjs');
|
|
14
14
|
require('./chunk-4HJRHEXD.cjs');
|
|
15
15
|
require('./chunk-HQQE74RO.cjs');
|
|
16
16
|
require('./chunk-DEY6XXGO.cjs');
|
|
@@ -82,14 +82,14 @@ var POLICIES = [
|
|
|
82
82
|
policy("policy-local-admins", "No local admins", "No everyday account is a local administrator.", false, 0)
|
|
83
83
|
];
|
|
84
84
|
var POLICIES_FIXTURE = {
|
|
85
|
-
summary:
|
|
85
|
+
summary: _chunkZSJ6WWFHcjs.computePolicySummary.call(void 0, POLICIES),
|
|
86
86
|
rows: POLICIES.map((item) => ({
|
|
87
87
|
id: item.id,
|
|
88
88
|
name: item.name,
|
|
89
89
|
description: item.description,
|
|
90
90
|
critical: item.critical,
|
|
91
91
|
severityLabel: item.critical ? "Critical" : "Low",
|
|
92
|
-
status:
|
|
92
|
+
status: _chunkZSJ6WWFHcjs.getPolicyTableStatus.call(void 0, item),
|
|
93
93
|
actions: [
|
|
94
94
|
{ label: "Policy Details", onClick: noop },
|
|
95
95
|
{ label: "Delete Policy", onClick: noop }
|
|
@@ -103,16 +103,16 @@ var POLICIES_FIXTURE = {
|
|
|
103
103
|
var _jsxruntime = require('react/jsx-runtime');
|
|
104
104
|
function PoliciesScreen({ compact = false }) {
|
|
105
105
|
const table = /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
106
|
-
|
|
106
|
+
_chunkZSJ6WWFHcjs.PoliciesTable,
|
|
107
107
|
{
|
|
108
108
|
rows: POLICIES_FIXTURE.rows,
|
|
109
109
|
rowAsLink: true,
|
|
110
|
-
rightSlot: compact ? void 0 : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
110
|
+
rightSlot: compact ? void 0 : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZSJ6WWFHcjs.DataTable.RowCount, {}),
|
|
111
111
|
emptyMessage: "No policies found."
|
|
112
112
|
}
|
|
113
113
|
);
|
|
114
114
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex h-full flex-col gap-[var(--spacing-system-l)] bg-ods-bg p-[var(--spacing-system-l)]", children: [
|
|
115
|
-
!compact && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
115
|
+
!compact && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZSJ6WWFHcjs.PolicySummaryCards, { summary: POLICIES_FIXTURE.summary, now: POLICIES_FIXTURE.now }),
|
|
116
116
|
table
|
|
117
117
|
] });
|
|
118
118
|
}
|
|
@@ -16,7 +16,7 @@ var _chunkKHXZFLINcjs = require('./chunk-KHXZFLIN.cjs');
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
var
|
|
19
|
+
var _chunkZSJ6WWFHcjs = require('./chunk-ZSJ6WWFH.cjs');
|
|
20
20
|
require('./chunk-4HJRHEXD.cjs');
|
|
21
21
|
require('./chunk-HQQE74RO.cjs');
|
|
22
22
|
require('./chunk-DEY6XXGO.cjs');
|
|
@@ -114,14 +114,14 @@ var noop = () => {
|
|
|
114
114
|
var HIDDEN_WHEN_COMPACT = ["organization"];
|
|
115
115
|
function StaticPackageField({ value }) {
|
|
116
116
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
117
|
-
|
|
117
|
+
_chunkZSJ6WWFHcjs.Autocomplete,
|
|
118
118
|
{
|
|
119
|
-
label:
|
|
119
|
+
label: _chunkZSJ6WWFHcjs.PACKAGE_SEARCH_LABEL,
|
|
120
120
|
labelVariant: "large",
|
|
121
121
|
options: value ? [{ value: value.id, label: value.name, description: _nullishCoalesce(value.description, () => ( void 0)) }] : [],
|
|
122
122
|
value: _nullishCoalesce(_optionalChain([value, 'optionalAccess', _ => _.id]), () => ( null)),
|
|
123
123
|
onChange: noop,
|
|
124
|
-
placeholder:
|
|
124
|
+
placeholder: _chunkZSJ6WWFHcjs.PACKAGE_SEARCH_PLACEHOLDER
|
|
125
125
|
}
|
|
126
126
|
);
|
|
127
127
|
}
|
|
@@ -135,7 +135,7 @@ function SoftwareUpdateScreen({ compact = false }) {
|
|
|
135
135
|
[fixture.devices, fixture.selectedIds]
|
|
136
136
|
);
|
|
137
137
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "h-full bg-ods-bg pt-[var(--spacing-system-l)]", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "h-full", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
138
|
-
|
|
138
|
+
_chunkZSJ6WWFHcjs.SoftwareActionForm,
|
|
139
139
|
{
|
|
140
140
|
action: fixture.action,
|
|
141
141
|
showHeader: false,
|
|
@@ -147,7 +147,7 @@ function SoftwareUpdateScreen({ compact = false }) {
|
|
|
147
147
|
initialValues: fixture.initialValues,
|
|
148
148
|
renderPackageSearch,
|
|
149
149
|
renderDevicePicker: () => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
150
|
-
|
|
150
|
+
_chunkZSJ6WWFHcjs.DeviceSelector,
|
|
151
151
|
{
|
|
152
152
|
devices: selected,
|
|
153
153
|
loading: false,
|
package/package.json
CHANGED
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import type { ComponentType } from 'react';
|
|
4
|
+
import type { ApprovalLevel } from '../../types/permissions';
|
|
5
|
+
import { cn } from '../../utils/cn';
|
|
6
|
+
import { HeadsetIcon } from '../icons-v2-generated/audio-and-visual/headset-icon';
|
|
7
|
+
import { BannedIcon } from '../icons-v2-generated/security/banned-icon';
|
|
8
|
+
import { CheckCircleIcon } from '../icons-v2-generated/signs-and-symbols/check-circle-icon';
|
|
9
|
+
import { UserIcon } from '../icons-v2-generated/users/user-icon';
|
|
10
|
+
import { ToggleGroup, ToggleGroupItem } from '../toggle-group';
|
|
11
|
+
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '../ui/tooltip';
|
|
12
|
+
import { TouchFriendlyTooltip } from '../ui/touch-friendly-tooltip';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* The approval levels, in the order a choice reads: the two that need nobody
|
|
16
|
+
* (allow, never) side by side, then the two that ask someone (a technician,
|
|
17
|
+
* the user) side by side.
|
|
18
|
+
*/
|
|
19
|
+
export const APPROVAL_LEVELS: readonly ApprovalLevel[] = ['ALLOW', 'DENY', 'ASK_TECHNICIAN', 'ASK_USER'];
|
|
20
|
+
|
|
21
|
+
export interface ApprovalLevelMeta {
|
|
22
|
+
/** The level's name, as every surface writes it. */
|
|
23
|
+
label: string;
|
|
24
|
+
/** What the level means, in one line: the tooltip of its icon. */
|
|
25
|
+
hint: string;
|
|
26
|
+
Icon: ComponentType<{ size?: number; className?: string }>;
|
|
27
|
+
/** The level's colour when it is the one in force (semantic status tokens). */
|
|
28
|
+
toneClassName: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* THE look and wording of an approval level: its name, its one-line meaning,
|
|
33
|
+
* its icon and its colour. The guardrails panel's dropdown, the icon control
|
|
34
|
+
* below and any read-only mark read it, so a level is the same everywhere.
|
|
35
|
+
*/
|
|
36
|
+
export const APPROVAL_LEVEL_META: Record<ApprovalLevel, ApprovalLevelMeta> = {
|
|
37
|
+
ALLOW: {
|
|
38
|
+
label: 'Allow',
|
|
39
|
+
hint: 'Runs on its own. You get a summary after.',
|
|
40
|
+
Icon: CheckCircleIcon,
|
|
41
|
+
toneClassName: 'text-ods-success',
|
|
42
|
+
},
|
|
43
|
+
ASK_USER: {
|
|
44
|
+
label: 'Ask User',
|
|
45
|
+
hint: 'Asks the person at the computer first.',
|
|
46
|
+
Icon: UserIcon,
|
|
47
|
+
toneClassName: 'text-ods-warning',
|
|
48
|
+
},
|
|
49
|
+
ASK_TECHNICIAN: {
|
|
50
|
+
label: 'Ask Technician',
|
|
51
|
+
hint: 'Asks a technician first. Nothing runs until they approve.',
|
|
52
|
+
Icon: HeadsetIcon,
|
|
53
|
+
toneClassName: 'text-ods-warning',
|
|
54
|
+
},
|
|
55
|
+
DENY: { label: 'Restrict', hint: 'Never runs.', Icon: BannedIcon, toneClassName: 'text-ods-error' },
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
const ICON_PX = 16;
|
|
59
|
+
|
|
60
|
+
export interface ApprovalLevelMarkProps {
|
|
61
|
+
level: ApprovalLevel;
|
|
62
|
+
/** Icon only: the name is the mark's accessible name and its tooltip. Default false (icon and name). */
|
|
63
|
+
iconOnly?: boolean;
|
|
64
|
+
className?: string;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/** One level, read-only: its icon in its colour, with its name beside it or as its tooltip. */
|
|
68
|
+
export function ApprovalLevelMark({ level, iconOnly = false, className }: ApprovalLevelMarkProps) {
|
|
69
|
+
const { label, hint, Icon, toneClassName } = APPROVAL_LEVEL_META[level];
|
|
70
|
+
const mark = (
|
|
71
|
+
<span className={cn('inline-flex items-center gap-[var(--spacing-system-xxs)] text-h6', toneClassName, className)}>
|
|
72
|
+
<Icon size={ICON_PX} className="shrink-0" aria-hidden />
|
|
73
|
+
{iconOnly ? <span className="sr-only">{label}</span> : label}
|
|
74
|
+
</span>
|
|
75
|
+
);
|
|
76
|
+
return iconOnly ? (
|
|
77
|
+
<TouchFriendlyTooltip content={`${label}: ${hint}`} side="top">
|
|
78
|
+
{mark}
|
|
79
|
+
</TouchFriendlyTooltip>
|
|
80
|
+
) : (
|
|
81
|
+
mark
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export interface ApprovalLevelControlProps {
|
|
86
|
+
value: ApprovalLevel;
|
|
87
|
+
onChange: (level: ApprovalLevel) => void;
|
|
88
|
+
/** The id of the element that names what is being decided (the rule's label). */
|
|
89
|
+
'aria-labelledby'?: string;
|
|
90
|
+
/** The level in force, written beside the icons. Default true: a row reads without hovering, and on touch. */
|
|
91
|
+
showLabel?: boolean;
|
|
92
|
+
disabled?: boolean;
|
|
93
|
+
className?: string;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* A choice of approval level as four icons, one per level, in a single-choice
|
|
98
|
+
* group (arrow keys move, like every toggle group). Each icon has the level's
|
|
99
|
+
* name as its accessible name and a tooltip with what the level means (hover
|
|
100
|
+
* or keyboard focus; a tap selects). The level in force wears its colour, and its name
|
|
101
|
+
* is written beside the group, so the choice never depends on a tooltip.
|
|
102
|
+
*/
|
|
103
|
+
export function ApprovalLevelControl({
|
|
104
|
+
value,
|
|
105
|
+
onChange,
|
|
106
|
+
'aria-labelledby': labelledBy,
|
|
107
|
+
showLabel = true,
|
|
108
|
+
disabled = false,
|
|
109
|
+
className,
|
|
110
|
+
}: ApprovalLevelControlProps) {
|
|
111
|
+
const current = APPROVAL_LEVEL_META[value];
|
|
112
|
+
return (
|
|
113
|
+
<div className={cn('flex shrink-0 items-center gap-[var(--spacing-system-sf)]', className)}>
|
|
114
|
+
{showLabel && <span className={cn('whitespace-nowrap text-h6', current.toneClassName)}>{current.label}</span>}
|
|
115
|
+
<TooltipProvider delayDuration={150}>
|
|
116
|
+
<ToggleGroup
|
|
117
|
+
type="single"
|
|
118
|
+
variant="outline"
|
|
119
|
+
size="sm"
|
|
120
|
+
value={value}
|
|
121
|
+
disabled={disabled}
|
|
122
|
+
// Clicking the level in force reports '' (deselect): a rule always has a level.
|
|
123
|
+
onValueChange={(next: string) => {
|
|
124
|
+
if (next && next !== value) onChange(next as ApprovalLevel);
|
|
125
|
+
}}
|
|
126
|
+
aria-labelledby={labelledBy}
|
|
127
|
+
>
|
|
128
|
+
{APPROVAL_LEVELS.map(level => {
|
|
129
|
+
const { label, hint, Icon, toneClassName } = APPROVAL_LEVEL_META[level];
|
|
130
|
+
return (
|
|
131
|
+
// A plain tooltip (hover and keyboard focus): a tap must SELECT the level, and on
|
|
132
|
+
// touch the name beside the group says what is in force.
|
|
133
|
+
<Tooltip key={level}>
|
|
134
|
+
<TooltipTrigger asChild>
|
|
135
|
+
<ToggleGroupItem
|
|
136
|
+
value={level}
|
|
137
|
+
aria-label={label}
|
|
138
|
+
className={cn('px-2', level === value && toneClassName)}
|
|
139
|
+
>
|
|
140
|
+
<Icon size={ICON_PX} aria-hidden />
|
|
141
|
+
</ToggleGroupItem>
|
|
142
|
+
</TooltipTrigger>
|
|
143
|
+
<TooltipContent side="top" className="max-w-xs">
|
|
144
|
+
<b>{label}</b>: {hint}
|
|
145
|
+
</TooltipContent>
|
|
146
|
+
</Tooltip>
|
|
147
|
+
);
|
|
148
|
+
})}
|
|
149
|
+
</ToggleGroup>
|
|
150
|
+
</TooltipProvider>
|
|
151
|
+
</div>
|
|
152
|
+
);
|
|
153
|
+
}
|
|
@@ -87,6 +87,7 @@ export * from './highlight-video-combined-section';
|
|
|
87
87
|
export * from './view-toggle';
|
|
88
88
|
// AI Enrich components
|
|
89
89
|
export * from './ai-enrich';
|
|
90
|
+
export * from './approval-level';
|
|
90
91
|
export * from './policy-configuration-panel';
|
|
91
92
|
export * from './policies';
|
|
92
93
|
export * from './cloud-tenants';
|
|
@@ -14,23 +14,14 @@ import { useCollapsible } from '../chat/hooks/use-collapsible';
|
|
|
14
14
|
import { ToolIcon } from '../tool-icon';
|
|
15
15
|
import { Button } from '../ui/button';
|
|
16
16
|
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from '../ui/dropdown-menu';
|
|
17
|
+
import { APPROVAL_LEVEL_META, APPROVAL_LEVELS } from './approval-level';
|
|
17
18
|
|
|
18
|
-
const
|
|
19
|
-
ALLOW: 'Allow',
|
|
20
|
-
ASK_USER: 'Ask User',
|
|
21
|
-
ASK_TECHNICIAN: 'Ask Technician',
|
|
22
|
-
DENY: 'Restrict',
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
const approvalLevelOptions = (Object.keys(approvalLevelLabels) as ApprovalLevel[]).map(value => ({
|
|
26
|
-
value,
|
|
27
|
-
label: approvalLevelLabels[value],
|
|
28
|
-
}));
|
|
19
|
+
const approvalLevelOptions = APPROVAL_LEVELS.map(value => ({ value, label: APPROVAL_LEVEL_META[value].label }));
|
|
29
20
|
|
|
30
21
|
const POLICY_LEVEL_WIDTH = 'w-[180px]';
|
|
31
22
|
const CATEGORY_LEVEL_WIDTH = 'w-[256px]';
|
|
32
23
|
|
|
33
|
-
const getApprovalLevelLabel = (level: ApprovalLevel): string =>
|
|
24
|
+
const getApprovalLevelLabel = (level: ApprovalLevel): string => APPROVAL_LEVEL_META[level]?.label ?? level;
|
|
34
25
|
|
|
35
26
|
const ApprovalLevelDropdown: FC<{
|
|
36
27
|
value: ApprovalLevel | undefined;
|