@unisim/sdk 0.1.4 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +107 -101
- package/dist/CompanyMenu.d.ts +42 -0
- package/dist/CompanyMenu.d.ts.map +1 -0
- package/dist/CompanyMenu.js +148 -0
- package/dist/CompanyMenu.js.map +1 -0
- package/dist/KnowledgeBaseMenu.d.ts +28 -0
- package/dist/KnowledgeBaseMenu.d.ts.map +1 -0
- package/dist/KnowledgeBaseMenu.js +160 -0
- package/dist/KnowledgeBaseMenu.js.map +1 -0
- package/dist/SettingsMenu.d.ts +26 -0
- package/dist/SettingsMenu.d.ts.map +1 -0
- package/dist/SettingsMenu.js +130 -0
- package/dist/SettingsMenu.js.map +1 -0
- package/dist/SuiteSwitcher.d.ts +49 -0
- package/dist/SuiteSwitcher.d.ts.map +1 -0
- package/dist/SuiteSwitcher.js +232 -0
- package/dist/SuiteSwitcher.js.map +1 -0
- package/dist/TrialUi.d.ts +16 -0
- package/dist/TrialUi.d.ts.map +1 -0
- package/dist/TrialUi.js +66 -0
- package/dist/TrialUi.js.map +1 -0
- package/dist/UniversalBar.d.ts.map +1 -1
- package/dist/UniversalBar.js +1 -0
- package/dist/UniversalBar.js.map +1 -1
- package/dist/UniversalNavBar.d.ts +53 -0
- package/dist/UniversalNavBar.d.ts.map +1 -0
- package/dist/UniversalNavBar.js +87 -0
- package/dist/UniversalNavBar.js.map +1 -0
- package/dist/UserProfile.d.ts +21 -0
- package/dist/UserProfile.d.ts.map +1 -0
- package/dist/UserProfile.js +165 -0
- package/dist/UserProfile.js.map +1 -0
- package/dist/access.d.ts.map +1 -1
- package/dist/access.js +1 -0
- package/dist/access.js.map +1 -1
- package/dist/admin.d.ts.map +1 -1
- package/dist/admin.js +1 -0
- package/dist/admin.js.map +1 -1
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js +1 -0
- package/dist/auth.js.map +1 -1
- package/dist/branding.d.ts.map +1 -1
- package/dist/branding.js +1 -0
- package/dist/branding.js.map +1 -1
- package/dist/changelog.d.ts.map +1 -1
- package/dist/changelog.js +1 -0
- package/dist/changelog.js.map +1 -1
- package/dist/index.d.ts +25 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +19 -0
- package/dist/index.js.map +1 -1
- package/dist/people.d.ts +45 -0
- package/dist/people.d.ts.map +1 -0
- package/dist/people.js +190 -0
- package/dist/people.js.map +1 -0
- package/dist/places.d.ts +23 -0
- package/dist/places.d.ts.map +1 -0
- package/dist/places.js +66 -0
- package/dist/places.js.map +1 -0
- package/dist/projects.d.ts +32 -0
- package/dist/projects.d.ts.map +1 -0
- package/dist/projects.js +71 -0
- package/dist/projects.js.map +1 -0
- package/dist/provider.d.ts.map +1 -1
- package/dist/provider.js +1 -0
- package/dist/provider.js.map +1 -1
- package/dist/subscription.d.ts +25 -0
- package/dist/subscription.d.ts.map +1 -0
- package/dist/subscription.js +62 -0
- package/dist/subscription.js.map +1 -0
- package/dist/trial.d.ts +29 -0
- package/dist/trial.d.ts.map +1 -0
- package/dist/trial.js +29 -0
- package/dist/trial.js.map +1 -0
- package/dist/types.d.ts +54 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/usage.d.ts.map +1 -1
- package/dist/usage.js +1 -0
- package/dist/usage.js.map +1 -1
- package/package.json +15 -2
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type CSSProperties, type MouseEvent, type ReactNode } from 'react';
|
|
2
|
+
export interface SettingsItem {
|
|
3
|
+
/** Display label, e.g. "Default analysis methods". */
|
|
4
|
+
label: string;
|
|
5
|
+
/** Either provide href (renders as link) or onClick (renders as button). */
|
|
6
|
+
href?: string;
|
|
7
|
+
onClick?: (e: MouseEvent<HTMLButtonElement>) => void;
|
|
8
|
+
/** Optional small icon shown left of the label. */
|
|
9
|
+
icon?: ReactNode;
|
|
10
|
+
/** Render in red — for destructive actions like "Sign out". */
|
|
11
|
+
danger?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface SettingsMenuProps {
|
|
14
|
+
/** Items in the product-specific settings section. */
|
|
15
|
+
productItems?: SettingsItem[];
|
|
16
|
+
/** Items in the global / cross-product settings section (e.g. Theme, Language). */
|
|
17
|
+
globalItems?: SettingsItem[];
|
|
18
|
+
/** Trigger className — typically Tailwind classes from the host nav. */
|
|
19
|
+
triggerClassName?: string;
|
|
20
|
+
/** aria-label for the trigger. Defaults to "Settings". */
|
|
21
|
+
ariaLabel?: string;
|
|
22
|
+
style?: CSSProperties;
|
|
23
|
+
className?: string;
|
|
24
|
+
}
|
|
25
|
+
export declare function SettingsMenu({ productItems, globalItems, triggerClassName, ariaLabel, style, className, }: SettingsMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
//# sourceMappingURL=SettingsMenu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SettingsMenu.d.ts","sourceRoot":"","sources":["../src/SettingsMenu.tsx"],"names":[],"mappings":"AAEA,OAAO,EAIL,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,KAAK,SAAS,EACf,MAAM,OAAO,CAAA;AAMd,MAAM,WAAW,YAAY;IAC3B,sDAAsD;IACtD,KAAK,EAAK,MAAM,CAAA;IAChB,4EAA4E;IAC5E,IAAI,CAAC,EAAK,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAA;IACpD,mDAAmD;IACnD,IAAI,CAAC,EAAK,SAAS,CAAA;IACnB,+DAA+D;IAC/D,MAAM,CAAC,EAAG,OAAO,CAAA;CAClB;AAED,MAAM,WAAW,iBAAiB;IAChC,sDAAsD;IACtD,YAAY,CAAC,EAAK,YAAY,EAAE,CAAA;IAChC,mFAAmF;IACnF,WAAW,CAAC,EAAM,YAAY,EAAE,CAAA;IAChC,wEAAwE;IACxE,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,0DAA0D;IAC1D,SAAS,CAAC,EAAQ,MAAM,CAAA;IACxB,KAAK,CAAC,EAAY,aAAa,CAAA;IAC/B,SAAS,CAAC,EAAQ,MAAM,CAAA;CACzB;AAMD,wBAAgB,YAAY,CAAC,EAC3B,YAAY,EACZ,WAAW,EACX,gBAAgB,EAChB,SAAsB,EACtB,KAAK,EACL,SAAS,GACV,EAAE,iBAAiB,2CAkFnB"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useState, useRef, useEffect, } from 'react';
|
|
4
|
+
// ──────────────────────────────────────────────────────────────────────────────
|
|
5
|
+
// Component
|
|
6
|
+
// ──────────────────────────────────────────────────────────────────────────────
|
|
7
|
+
export function SettingsMenu({ productItems, globalItems, triggerClassName, ariaLabel = 'Settings', style, className, }) {
|
|
8
|
+
const [open, setOpen] = useState(false);
|
|
9
|
+
const wrapRef = useRef(null);
|
|
10
|
+
const closeTimer = useRef(null);
|
|
11
|
+
function openNow() {
|
|
12
|
+
if (closeTimer.current)
|
|
13
|
+
clearTimeout(closeTimer.current);
|
|
14
|
+
setOpen(true);
|
|
15
|
+
}
|
|
16
|
+
function closeSoon() {
|
|
17
|
+
if (closeTimer.current)
|
|
18
|
+
clearTimeout(closeTimer.current);
|
|
19
|
+
closeTimer.current = setTimeout(() => setOpen(false), 220);
|
|
20
|
+
}
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
function onDown(e) {
|
|
23
|
+
if (wrapRef.current && !wrapRef.current.contains(e.target))
|
|
24
|
+
setOpen(false);
|
|
25
|
+
}
|
|
26
|
+
function onKey(e) {
|
|
27
|
+
if (e.key === 'Escape')
|
|
28
|
+
setOpen(false);
|
|
29
|
+
}
|
|
30
|
+
document.addEventListener('mousedown', onDown);
|
|
31
|
+
document.addEventListener('keydown', onKey);
|
|
32
|
+
return () => {
|
|
33
|
+
document.removeEventListener('mousedown', onDown);
|
|
34
|
+
document.removeEventListener('keydown', onKey);
|
|
35
|
+
};
|
|
36
|
+
}, []);
|
|
37
|
+
const hasProduct = productItems && productItems.length > 0;
|
|
38
|
+
const hasGlobal = globalItems && globalItems.length > 0;
|
|
39
|
+
return (_jsxs("div", { ref: wrapRef, className: className, style: { position: 'relative', display: 'inline-block', ...style }, onMouseEnter: openNow, onMouseLeave: closeSoon, children: [_jsx("button", { type: "button", "aria-label": ariaLabel, "aria-expanded": open, "aria-haspopup": "true", onClick: () => setOpen((v) => !v), onFocus: openNow, className: triggerClassName, style: triggerClassName ? undefined : defaultTriggerStyle, children: _jsx(IconGear, {}) }), _jsxs("div", { role: "menu", style: menuStyle(open), children: [hasProduct && (_jsxs(_Fragment, { children: [_jsx(SectionHeader, { label: "Product Settings" }), productItems.map((item, i) => (_jsx(Item, { item: item }, `p${i}`)))] })), hasProduct && hasGlobal && _jsx(Divider, {}), hasGlobal && (_jsxs(_Fragment, { children: [_jsx(SectionHeader, { label: "Global Settings" }), globalItems.map((item, i) => (_jsx(Item, { item: item }, `g${i}`)))] })), !hasProduct && !hasGlobal && (_jsx("div", { style: { padding: '12px 14px', fontSize: 12, color: '#94a3b8', fontStyle: 'italic' }, children: "No settings yet." }))] })] }));
|
|
40
|
+
}
|
|
41
|
+
// ──────────────────────────────────────────────────────────────────────────────
|
|
42
|
+
// Subcomponents
|
|
43
|
+
// ──────────────────────────────────────────────────────────────────────────────
|
|
44
|
+
function Item({ item }) {
|
|
45
|
+
const restingColor = item.danger ? '#dc2626' : '#374151';
|
|
46
|
+
const hoverColor = item.danger ? '#b91c1c' : '#111827';
|
|
47
|
+
const hoverBg = item.danger ? '#fef2f2' : '#f3f4f6';
|
|
48
|
+
const baseStyle = {
|
|
49
|
+
display: 'flex',
|
|
50
|
+
alignItems: 'center',
|
|
51
|
+
gap: 10,
|
|
52
|
+
padding: '8px 14px',
|
|
53
|
+
fontSize: 13,
|
|
54
|
+
color: restingColor,
|
|
55
|
+
background: 'transparent',
|
|
56
|
+
border: 0,
|
|
57
|
+
cursor: 'pointer',
|
|
58
|
+
width: '100%',
|
|
59
|
+
textAlign: 'left',
|
|
60
|
+
textDecoration: 'none',
|
|
61
|
+
fontFamily: 'inherit',
|
|
62
|
+
transition: 'background 120ms, color 120ms',
|
|
63
|
+
};
|
|
64
|
+
const onEnter = (e) => {
|
|
65
|
+
e.currentTarget.style.background = hoverBg;
|
|
66
|
+
e.currentTarget.style.color = hoverColor;
|
|
67
|
+
};
|
|
68
|
+
const onLeave = (e) => {
|
|
69
|
+
e.currentTarget.style.background = 'transparent';
|
|
70
|
+
e.currentTarget.style.color = restingColor;
|
|
71
|
+
};
|
|
72
|
+
if (item.onClick) {
|
|
73
|
+
return (_jsxs("button", { type: "button", role: "menuitem", onClick: item.onClick, onMouseEnter: onEnter, onMouseLeave: onLeave, style: baseStyle, children: [item.icon, item.label] }));
|
|
74
|
+
}
|
|
75
|
+
return (_jsxs("a", { role: "menuitem", href: item.href, onMouseEnter: onEnter, onMouseLeave: onLeave, style: baseStyle, children: [item.icon, item.label] }));
|
|
76
|
+
}
|
|
77
|
+
function SectionHeader({ label }) {
|
|
78
|
+
return _jsx("div", { style: sectionHeaderStyle, children: label });
|
|
79
|
+
}
|
|
80
|
+
function Divider() {
|
|
81
|
+
return _jsx("div", { style: { height: 1, background: '#e5e7eb', margin: '4px 0' }, "aria-hidden": true });
|
|
82
|
+
}
|
|
83
|
+
function IconGear() {
|
|
84
|
+
return (_jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [_jsx("circle", { cx: "12", cy: "12", r: "3" }), _jsx("path", { d: "M19.4 15a1.65 1.65 0 00.33 1.82l.06.06a2 2 0 010 2.83 2 2 0 01-2.83 0l-.06-.06a1.65 1.65 0 00-1.82-.33 1.65 1.65 0 00-1 1.51V21a2 2 0 01-4 0v-.09A1.65 1.65 0 009 19.4a1.65 1.65 0 00-1.82.33l-.06.06a2 2 0 01-2.83-2.83l.06-.06A1.65 1.65 0 004.68 15a1.65 1.65 0 00-1.51-1H3a2 2 0 010-4h.09A1.65 1.65 0 004.6 9a1.65 1.65 0 00-.33-1.82l-.06-.06a2 2 0 012.83-2.83l.06.06A1.65 1.65 0 009 4.68a1.65 1.65 0 001-1.51V3a2 2 0 014 0v.09a1.65 1.65 0 001 1.51 1.65 1.65 0 001.82-.33l.06-.06a2 2 0 012.83 2.83l-.06.06A1.65 1.65 0 0019.4 9a1.65 1.65 0 001.51 1H21a2 2 0 010 4h-.09a1.65 1.65 0 00-1.51 1z" })] }));
|
|
85
|
+
}
|
|
86
|
+
// ──────────────────────────────────────────────────────────────────────────────
|
|
87
|
+
// Styles
|
|
88
|
+
// ──────────────────────────────────────────────────────────────────────────────
|
|
89
|
+
const defaultTriggerStyle = {
|
|
90
|
+
display: 'inline-flex',
|
|
91
|
+
alignItems: 'center',
|
|
92
|
+
justifyContent: 'center',
|
|
93
|
+
width: 32,
|
|
94
|
+
height: 32,
|
|
95
|
+
borderRadius: 8,
|
|
96
|
+
border: 0,
|
|
97
|
+
background: 'transparent',
|
|
98
|
+
color: '#64748b',
|
|
99
|
+
cursor: 'pointer',
|
|
100
|
+
padding: 0,
|
|
101
|
+
transition: 'background 120ms, color 120ms',
|
|
102
|
+
};
|
|
103
|
+
function menuStyle(open) {
|
|
104
|
+
return {
|
|
105
|
+
position: 'absolute',
|
|
106
|
+
right: 0,
|
|
107
|
+
top: 'calc(100% + 8px)',
|
|
108
|
+
minWidth: 220,
|
|
109
|
+
background: '#ffffff',
|
|
110
|
+
border: '1px solid #e5e7eb',
|
|
111
|
+
borderRadius: 12,
|
|
112
|
+
boxShadow: '0 16px 32px -8px rgba(15,23,42,0.16), 0 4px 8px -2px rgba(15,23,42,0.08)',
|
|
113
|
+
padding: '6px 0',
|
|
114
|
+
opacity: open ? 1 : 0,
|
|
115
|
+
visibility: open ? 'visible' : 'hidden',
|
|
116
|
+
transform: open ? 'translateY(0)' : 'translateY(-4px)',
|
|
117
|
+
transition: 'opacity 150ms cubic-bezier(0.16,1,0.3,1), transform 150ms cubic-bezier(0.16,1,0.3,1), visibility 150ms',
|
|
118
|
+
zIndex: 50,
|
|
119
|
+
color: '#111827',
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
const sectionHeaderStyle = {
|
|
123
|
+
padding: '8px 14px 4px',
|
|
124
|
+
fontSize: 10,
|
|
125
|
+
fontWeight: 700,
|
|
126
|
+
letterSpacing: '0.08em',
|
|
127
|
+
textTransform: 'uppercase',
|
|
128
|
+
color: '#64748b',
|
|
129
|
+
};
|
|
130
|
+
//# sourceMappingURL=SettingsMenu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SettingsMenu.js","sourceRoot":"","sources":["../src/SettingsMenu.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,EACL,QAAQ,EACR,MAAM,EACN,SAAS,GAIV,MAAM,OAAO,CAAA;AA+Bd,iFAAiF;AACjF,YAAY;AACZ,iFAAiF;AAEjF,MAAM,UAAU,YAAY,CAAC,EAC3B,YAAY,EACZ,WAAW,EACX,gBAAgB,EAChB,SAAS,GAAG,UAAU,EACtB,KAAK,EACL,SAAS,GACS;IAClB,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAA;IACvC,MAAM,OAAO,GAAM,MAAM,CAAiB,IAAI,CAAC,CAAA;IAC/C,MAAM,UAAU,GAAG,MAAM,CAAuC,IAAI,CAAC,CAAA;IAErE,SAAS,OAAO;QACd,IAAI,UAAU,CAAC,OAAO;YAAE,YAAY,CAAC,UAAU,CAAC,OAAO,CAAC,CAAA;QACxD,OAAO,CAAC,IAAI,CAAC,CAAA;IACf,CAAC;IACD,SAAS,SAAS;QAChB,IAAI,UAAU,CAAC,OAAO;YAAE,YAAY,CAAC,UAAU,CAAC,OAAO,CAAC,CAAA;Q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OAAO,EAAS,CAAC;IACjB,UAAU,EAAM,+BAA+B;CAChD,CAAA;AAED,SAAS,SAAS,CAAC,IAAa;IAC9B,OAAO;QACL,QAAQ,EAAI,UAAU;QACtB,KAAK,EAAO,CAAC;QACb,GAAG,EAAS,kBAAkB;QAC9B,QAAQ,EAAI,GAAG;QACf,UAAU,EAAE,SAAS;QACrB,MAAM,EAAM,mBAAmB;QAC/B,YAAY,EAAE,EAAE;QAChB,SAAS,EAAG,0EAA0E;QACtF,OAAO,EAAK,OAAO;QACnB,OAAO,EAAK,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACxB,UAAU,EAAE,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ;QACvC,SAAS,EAAG,IAAI,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,kBAAkB;QACvD,UAAU,EAAE,wGAAwG;QACpH,MAAM,EAAM,EAAE;QACd,KAAK,EAAO,SAAS;KACtB,CAAA;AACH,CAAC;AAED,MAAM,kBAAkB,GAAkB;IACxC,OAAO,EAAQ,cAAc;IAC7B,QAAQ,EAAO,EAAE;IACjB,UAAU,EAAK,GAAG;IAClB,aAAa,EAAE,QAAQ;IACvB,aAAa,EAAE,WAAW;IAC1B,KAAK,EAAU,SAAS;CACzB,CAAA"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { type ReactNode, type CSSProperties } from 'react';
|
|
2
|
+
export type SuiteProductId = 'ergo_assess' | 'cyber_assess' | 'workplace_assess' | (string & {});
|
|
3
|
+
export interface SuiteProduct {
|
|
4
|
+
id: SuiteProductId;
|
|
5
|
+
name: string;
|
|
6
|
+
/** Short tagline shown under the name. */
|
|
7
|
+
desc: string;
|
|
8
|
+
/** Where the menu item links to. The "current" product never navigates. */
|
|
9
|
+
href: string;
|
|
10
|
+
/** 22×22 inline SVG (or similar) shown in the coloured glyph tile. */
|
|
11
|
+
glyph: ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* Optional small flag/icon shown next to the product name in the menu.
|
|
14
|
+
* Used for region indicators — e.g. UK-only products show <UKFlag />.
|
|
15
|
+
*/
|
|
16
|
+
flag?: ReactNode;
|
|
17
|
+
}
|
|
18
|
+
export interface SuiteSwitcherProps {
|
|
19
|
+
/** Which product is currently being viewed — gets the "You're here" badge. */
|
|
20
|
+
current: SuiteProductId;
|
|
21
|
+
/**
|
|
22
|
+
* Override the full product list (e.g. to add a new Assess product without
|
|
23
|
+
* waiting for an SDK release). Defaults to the canonical Assess suite.
|
|
24
|
+
*/
|
|
25
|
+
products?: SuiteProduct[];
|
|
26
|
+
/**
|
|
27
|
+
* Override the trigger icon. Pass a URL or data-URI. Defaults to an inline
|
|
28
|
+
* UNI·SIM monogram SVG, so the component works with zero asset wiring.
|
|
29
|
+
*/
|
|
30
|
+
iconSrc?: string;
|
|
31
|
+
/** Trigger button aria-label. Defaults to "Switch product". */
|
|
32
|
+
ariaLabel?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Slot for a small chip rendered in the dropdown header — typically the
|
|
35
|
+
* product's <VersionChip />. Lets each product surface its current suite
|
|
36
|
+
* version inside the switcher rather than alongside it in the navbar.
|
|
37
|
+
*/
|
|
38
|
+
chip?: ReactNode;
|
|
39
|
+
/** Apply to the outermost wrapper if you need to nudge positioning. */
|
|
40
|
+
style?: CSSProperties;
|
|
41
|
+
className?: string;
|
|
42
|
+
}
|
|
43
|
+
export declare function UKFlag({ width, height }: {
|
|
44
|
+
width?: number;
|
|
45
|
+
height?: number;
|
|
46
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
47
|
+
export declare const DEFAULT_SUITE_PRODUCTS: SuiteProduct[];
|
|
48
|
+
export declare function SuiteSwitcher({ current, products, iconSrc, ariaLabel, chip, style, className, }: SuiteSwitcherProps): import("react/jsx-runtime").JSX.Element;
|
|
49
|
+
//# sourceMappingURL=SuiteSwitcher.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":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BAAkB,2CAwIpB"}
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useState, useRef, useEffect, } from 'react';
|
|
4
|
+
// ──────────────────────────────────────────────────────────────────────────────
|
|
5
|
+
// Default product catalogue
|
|
6
|
+
//
|
|
7
|
+
// Update this list whenever a new Assess product ships. Every consumer that
|
|
8
|
+
// re-installs/builds against a newer @unisim/sdk picks the change up for free —
|
|
9
|
+
// that's the "sync across the suite" guarantee.
|
|
10
|
+
// ──────────────────────────────────────────────────────────────────────────────
|
|
11
|
+
// ──────────────────────────────────────────────────────────────────────────────
|
|
12
|
+
// Region flags — small SVGs (consistent across platforms unlike emoji 🇬🇧)
|
|
13
|
+
// Exported so products can re-use them in their own headers.
|
|
14
|
+
// ──────────────────────────────────────────────────────────────────────────────
|
|
15
|
+
export function UKFlag({ width = 16, height = 10 }) {
|
|
16
|
+
return (_jsxs("svg", { width: width, height: height, viewBox: "0 0 60 30", "aria-label": "United Kingdom", role: "img", style: { borderRadius: 2, display: 'inline-block', verticalAlign: 'middle' }, children: [_jsx("clipPath", { id: "uk-flag-st", children: _jsx("path", { d: "M30,15 h30 v15 z v15 h-30 z h-30 v-15 z v-15 h30 z" }) }), _jsx("path", { d: "M0,0 v30 h60 v-30 z", fill: "#012169" }), _jsx("path", { d: "M0,0 L60,30 M60,0 L0,30", stroke: "#ffffff", strokeWidth: "6" }), _jsx("path", { d: "M0,0 L60,30 M60,0 L0,30", clipPath: "url(#uk-flag-st)", stroke: "#C8102E", strokeWidth: "4" }), _jsx("path", { d: "M30,0 v30 M0,15 h60", stroke: "#ffffff", strokeWidth: "10" }), _jsx("path", { d: "M30,0 v30 M0,15 h60", stroke: "#C8102E", strokeWidth: "6" })] }));
|
|
17
|
+
}
|
|
18
|
+
const ERGO_GLYPH = (_jsxs("svg", { width: "22", height: "22", viewBox: "0 0 32 32", "aria-hidden": "true", children: [_jsx("rect", { width: "32", height: "32", rx: "7", fill: "#1e293b" }), [
|
|
19
|
+
{ x: 11, y: 5, c: '#22c55e' },
|
|
20
|
+
{ x: 12, y: 9, c: '#f97316' },
|
|
21
|
+
{ x: 11, y: 13, c: '#f97316' },
|
|
22
|
+
{ x: 9, y: 17, c: '#ef4444' },
|
|
23
|
+
{ x: 9, y: 21, c: '#ef4444' },
|
|
24
|
+
{ x: 11, y: 25, c: '#22c55e' },
|
|
25
|
+
].map((d, i) => (_jsx("rect", { x: d.x, y: d.y, width: "12", height: "2.6", rx: "1.3", fill: d.c }, i)))] }));
|
|
26
|
+
const CYBER_GLYPH = (_jsxs("svg", { width: "22", height: "22", viewBox: "0 0 32 32", "aria-hidden": "true", children: [_jsx("rect", { width: "32", height: "32", rx: "7", fill: "#0f172a" }), _jsx("path", { d: "M16 5 L25 9 V16 C25 21 21 25 16 27 C11 25 7 21 7 16 V9 Z", fill: "none", stroke: "#22d3ee", strokeWidth: "2", strokeLinejoin: "round" }), _jsx("path", { d: "M12 16 L15 19 L21 13", stroke: "#22d3ee", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", fill: "none" })] }));
|
|
27
|
+
const WORKPLACE_GLYPH = (_jsxs("svg", { width: "22", height: "22", viewBox: "0 0 32 32", "aria-hidden": "true", children: [_jsx("rect", { width: "32", height: "32", rx: "7", fill: "#e05504" }), _jsx("rect", { x: "9", y: "9", width: "14", height: "10", rx: "1.6", fill: "none", stroke: "white", strokeWidth: "1.8" }), _jsx("rect", { x: "14.6", y: "19.6", width: "2.8", height: "3.4", fill: "white" }), _jsx("path", { d: "M 9 24 L 23 24", stroke: "white", strokeWidth: "1.8", strokeLinecap: "round" }), _jsx("circle", { cx: "25.5", cy: "6.5", r: "2.4", fill: "#fbbf24", stroke: "white", strokeWidth: "1" })] }));
|
|
28
|
+
export const DEFAULT_SUITE_PRODUCTS = [
|
|
29
|
+
{
|
|
30
|
+
id: 'ergo_assess',
|
|
31
|
+
name: 'Ergo Assess UK',
|
|
32
|
+
desc: 'Operator posture & motion · video-based',
|
|
33
|
+
href: 'https://assess.unisim.co.uk/ergo',
|
|
34
|
+
glyph: ERGO_GLYPH,
|
|
35
|
+
flag: _jsx(UKFlag, {}),
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
id: 'cyber_assess',
|
|
39
|
+
name: 'Cyber Assess UK',
|
|
40
|
+
desc: 'Phishing, password & social-engineering drills',
|
|
41
|
+
href: 'https://assess.unisim.co.uk/cyber',
|
|
42
|
+
glyph: CYBER_GLYPH,
|
|
43
|
+
flag: _jsx(UKFlag, {}),
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
id: 'workplace_assess',
|
|
47
|
+
name: 'Workplace Assess',
|
|
48
|
+
desc: 'Desk, lighting & noise screening',
|
|
49
|
+
href: 'https://assess.unisim.co.uk/workplace',
|
|
50
|
+
glyph: WORKPLACE_GLYPH,
|
|
51
|
+
// No flag — Workplace Assess is worldwide.
|
|
52
|
+
},
|
|
53
|
+
];
|
|
54
|
+
// Inline UNI·SIM monogram so the SDK has zero asset dependencies.
|
|
55
|
+
const DEFAULT_TRIGGER_ICON = 'data:image/svg+xml;utf8,' +
|
|
56
|
+
encodeURIComponent(`<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'>
|
|
57
|
+
<rect width='32' height='32' rx='8' fill='#e05504'/>
|
|
58
|
+
<text x='16' y='21' text-anchor='middle' font-family='-apple-system,Segoe UI,Helvetica,Arial,sans-serif' font-weight='800' font-size='13' fill='white' letter-spacing='-0.5'>US</text>
|
|
59
|
+
</svg>`);
|
|
60
|
+
// ──────────────────────────────────────────────────────────────────────────────
|
|
61
|
+
// Component
|
|
62
|
+
// ──────────────────────────────────────────────────────────────────────────────
|
|
63
|
+
export function SuiteSwitcher({ current, products = DEFAULT_SUITE_PRODUCTS, iconSrc = DEFAULT_TRIGGER_ICON, ariaLabel = 'Switch product', chip, style, className, }) {
|
|
64
|
+
const [open, setOpen] = useState(false);
|
|
65
|
+
const wrapRef = useRef(null);
|
|
66
|
+
const closeTimer = useRef(null);
|
|
67
|
+
function openNow() {
|
|
68
|
+
if (closeTimer.current)
|
|
69
|
+
clearTimeout(closeTimer.current);
|
|
70
|
+
setOpen(true);
|
|
71
|
+
}
|
|
72
|
+
function closeSoon() {
|
|
73
|
+
if (closeTimer.current)
|
|
74
|
+
clearTimeout(closeTimer.current);
|
|
75
|
+
closeTimer.current = setTimeout(() => setOpen(false), 220);
|
|
76
|
+
}
|
|
77
|
+
// close on outside click / escape
|
|
78
|
+
useEffect(() => {
|
|
79
|
+
function onDown(e) {
|
|
80
|
+
if (wrapRef.current && !wrapRef.current.contains(e.target))
|
|
81
|
+
setOpen(false);
|
|
82
|
+
}
|
|
83
|
+
function onKey(e) {
|
|
84
|
+
if (e.key === 'Escape')
|
|
85
|
+
setOpen(false);
|
|
86
|
+
}
|
|
87
|
+
document.addEventListener('mousedown', onDown);
|
|
88
|
+
document.addEventListener('keydown', onKey);
|
|
89
|
+
return () => {
|
|
90
|
+
document.removeEventListener('mousedown', onDown);
|
|
91
|
+
document.removeEventListener('keydown', onKey);
|
|
92
|
+
};
|
|
93
|
+
}, []);
|
|
94
|
+
return (_jsxs("div", { ref: wrapRef, className: className, style: { position: 'relative', display: 'inline-block', ...style }, onMouseEnter: openNow, onMouseLeave: closeSoon, children: [_jsx("button", { type: "button", "aria-label": ariaLabel, "aria-expanded": open, "aria-haspopup": "true", onClick: () => setOpen((v) => !v), onFocus: openNow, style: triggerStyle(open), children: _jsx("img", { src: iconSrc, alt: "", "aria-hidden": true, style: { width: 28, height: 28, display: 'block' } }) }), _jsxs("div", { role: "menu", style: menuStyle(open), children: [_jsx("span", { style: menuArrowStyle, "aria-hidden": true }), _jsxs("div", { style: headerStyle, children: [_jsxs("div", { style: { display: 'flex', flexDirection: 'column', lineHeight: 1.1, minWidth: 0 }, children: [_jsx("span", { style: {
|
|
95
|
+
fontSize: 11,
|
|
96
|
+
color: '#64748b',
|
|
97
|
+
fontWeight: 600,
|
|
98
|
+
letterSpacing: '0.06em',
|
|
99
|
+
textTransform: 'uppercase',
|
|
100
|
+
}, children: "Universal Simulation" }), _jsx("span", { style: { fontSize: 13, color: '#334155', marginTop: 2 }, children: "The Assess suite" })] }), chip && _jsx("div", { style: { flexShrink: 0 }, children: chip })] }), products.map((p) => {
|
|
101
|
+
const isCurrent = p.id === current;
|
|
102
|
+
// Render <a> only for navigable items so keyboard users skip the current one cleanly.
|
|
103
|
+
const Wrapper = isCurrent ? 'button' : 'a';
|
|
104
|
+
const wrapperProps = isCurrent
|
|
105
|
+
? { type: 'button', 'aria-current': 'page' }
|
|
106
|
+
: { href: p.href };
|
|
107
|
+
return (_jsxs(Wrapper, { role: "menuitem", ...wrapperProps, style: itemStyle(isCurrent), onMouseEnter: (e) => {
|
|
108
|
+
if (!isCurrent)
|
|
109
|
+
e.currentTarget.style.background = '#f8fafc';
|
|
110
|
+
}, onMouseLeave: (e) => {
|
|
111
|
+
if (!isCurrent)
|
|
112
|
+
e.currentTarget.style.background = 'transparent';
|
|
113
|
+
}, children: [_jsx("span", { style: glyphStyle, children: p.glyph }), _jsxs("span", { style: { flex: 1, minWidth: 0, display: 'flex', flexDirection: 'column', gap: 1 }, children: [_jsxs("span", { style: {
|
|
114
|
+
fontSize: 14,
|
|
115
|
+
fontWeight: 600,
|
|
116
|
+
color: '#0f172a',
|
|
117
|
+
lineHeight: 1.2,
|
|
118
|
+
display: 'inline-flex',
|
|
119
|
+
alignItems: 'center',
|
|
120
|
+
gap: 6,
|
|
121
|
+
}, children: [p.name, p.flag] }), _jsx("span", { style: { fontSize: 11, color: '#64748b', lineHeight: 1.3 }, children: p.desc })] }), isCurrent && _jsx("span", { style: badgeStyle, children: "You're here" })] }, p.id));
|
|
122
|
+
}), _jsx("div", { style: footerStyle, children: _jsx("a", { href: "https://www.unisim.co.uk", target: "_blank", rel: "noreferrer", style: {
|
|
123
|
+
fontSize: 11,
|
|
124
|
+
color: '#c2410c',
|
|
125
|
+
fontWeight: 600,
|
|
126
|
+
textDecoration: 'none',
|
|
127
|
+
}, children: "unisim.co.uk \u2197" }) })] })] }));
|
|
128
|
+
}
|
|
129
|
+
// ──────────────────────────────────────────────────────────────────────────────
|
|
130
|
+
// Inline styles (kept here rather than in a CSS file so the SDK works in any
|
|
131
|
+
// React host — Tailwind, plain CSS, CSS-in-JS, doesn't matter).
|
|
132
|
+
// ──────────────────────────────────────────────────────────────────────────────
|
|
133
|
+
function triggerStyle(open) {
|
|
134
|
+
return {
|
|
135
|
+
display: 'inline-flex',
|
|
136
|
+
alignItems: 'center',
|
|
137
|
+
justifyContent: 'center',
|
|
138
|
+
width: 38,
|
|
139
|
+
height: 38,
|
|
140
|
+
borderRadius: 10,
|
|
141
|
+
border: `1px solid ${open ? '#fed7aa' : '#e2e8f0'}`,
|
|
142
|
+
background: open ? '#fff7ed' : '#ffffff',
|
|
143
|
+
cursor: 'pointer',
|
|
144
|
+
transition: 'all 150ms cubic-bezier(0.16,1,0.3,1)',
|
|
145
|
+
padding: 0,
|
|
146
|
+
boxShadow: open ? '0 0 0 4px rgba(224,85,4,0.08)' : 'none',
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
function menuStyle(open) {
|
|
150
|
+
return {
|
|
151
|
+
position: 'absolute',
|
|
152
|
+
top: 'calc(100% + 8px)',
|
|
153
|
+
right: 0,
|
|
154
|
+
width: 320,
|
|
155
|
+
background: '#ffffff',
|
|
156
|
+
border: '1px solid #e2e8f0',
|
|
157
|
+
borderRadius: 16,
|
|
158
|
+
boxShadow: '0 16px 32px -8px rgba(15,23,42,0.16), 0 4px 8px -2px rgba(15,23,42,0.08)',
|
|
159
|
+
padding: 12,
|
|
160
|
+
opacity: open ? 1 : 0,
|
|
161
|
+
visibility: open ? 'visible' : 'hidden',
|
|
162
|
+
transform: open ? 'translateY(0)' : 'translateY(-4px)',
|
|
163
|
+
transition: 'opacity 150ms cubic-bezier(0.16,1,0.3,1), transform 150ms cubic-bezier(0.16,1,0.3,1), visibility 150ms',
|
|
164
|
+
zIndex: 50,
|
|
165
|
+
color: '#0f172a',
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
const menuArrowStyle = {
|
|
169
|
+
position: 'absolute',
|
|
170
|
+
top: -6,
|
|
171
|
+
right: 14,
|
|
172
|
+
width: 12,
|
|
173
|
+
height: 12,
|
|
174
|
+
background: '#ffffff',
|
|
175
|
+
borderLeft: '1px solid #e2e8f0',
|
|
176
|
+
borderTop: '1px solid #e2e8f0',
|
|
177
|
+
transform: 'rotate(45deg)',
|
|
178
|
+
};
|
|
179
|
+
const headerStyle = {
|
|
180
|
+
display: 'flex',
|
|
181
|
+
alignItems: 'center',
|
|
182
|
+
justifyContent: 'space-between',
|
|
183
|
+
padding: '4px 8px 10px',
|
|
184
|
+
borderBottom: '1px solid #e2e8f0',
|
|
185
|
+
marginBottom: 8,
|
|
186
|
+
};
|
|
187
|
+
function itemStyle(isCurrent) {
|
|
188
|
+
return {
|
|
189
|
+
display: 'flex',
|
|
190
|
+
alignItems: 'center',
|
|
191
|
+
gap: 12,
|
|
192
|
+
padding: '10px 10px',
|
|
193
|
+
borderRadius: 10,
|
|
194
|
+
border: 0,
|
|
195
|
+
background: isCurrent ? '#fff7ed' : 'transparent',
|
|
196
|
+
cursor: isCurrent ? 'default' : 'pointer',
|
|
197
|
+
width: '100%',
|
|
198
|
+
textAlign: 'left',
|
|
199
|
+
transition: 'background 120ms',
|
|
200
|
+
textDecoration: 'none',
|
|
201
|
+
color: 'inherit',
|
|
202
|
+
fontFamily: 'inherit',
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
const glyphStyle = {
|
|
206
|
+
width: 34,
|
|
207
|
+
height: 34,
|
|
208
|
+
borderRadius: 9,
|
|
209
|
+
display: 'grid',
|
|
210
|
+
placeItems: 'center',
|
|
211
|
+
flexShrink: 0,
|
|
212
|
+
};
|
|
213
|
+
const badgeStyle = {
|
|
214
|
+
fontSize: 9,
|
|
215
|
+
fontWeight: 700,
|
|
216
|
+
letterSpacing: '0.08em',
|
|
217
|
+
textTransform: 'uppercase',
|
|
218
|
+
padding: '2px 7px',
|
|
219
|
+
borderRadius: 999,
|
|
220
|
+
background: '#fff7ed',
|
|
221
|
+
color: '#c2410c',
|
|
222
|
+
border: '1px solid #fed7aa',
|
|
223
|
+
flexShrink: 0,
|
|
224
|
+
};
|
|
225
|
+
const footerStyle = {
|
|
226
|
+
display: 'flex',
|
|
227
|
+
justifyContent: 'flex-end',
|
|
228
|
+
paddingTop: 10,
|
|
229
|
+
marginTop: 6,
|
|
230
|
+
borderTop: '1px solid #e2e8f0',
|
|
231
|
+
};
|
|
232
|
+
//# sourceMappingURL=SuiteSwitcher.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SuiteSwitcher.js","sourceRoot":"","sources":["../src/SuiteSwitcher.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,EACL,QAAQ,EACR,MAAM,EACN,SAAS,GAGV,MAAM,OAAO,CAAA;AAsDd,iFAAiF;AACjF,4BAA4B;AAC5B,EAAE;AACF,4EAA4E;AAC5E,gFAAgF;AAChF,gDAAgD;AAChD,iFAAiF;AAEjF,iFAAiF;AACjF,4EAA4E;AAC5E,6DAA6D;AAC7D,iFAAiF;AAEjF,MAAM,UAAU,MAAM,CAAC,EAAE,KAAK,GAAG,EAAE,EAAE,MAAM,GAAG,EAAE,EAAuC;IACrF,OAAO,CACL,eACE,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,OAAO,EAAC,WAAW,gBACR,gBAAgB,EAC3B,IAAI,EAAC,KAAK,EACV,KAAK,EAAE,EAAE,YAAY,EAAE,CAAC,EAAE,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,QAAQ,EAAE,aAE5E,mBAAU,EAAE,EAAC,YAAY,YACvB,eAAM,CAAC,EAAC,oDAAoD,GAAG,GACtD,EACX,eAAM,CAAC,EAAC,qBAAq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S,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS;QACzC,KAAK,EAAE,MAAM;QACb,SAAS,EAAE,MAAM;QACjB,UAAU,EAAE,kBAAkB;QAC9B,cAAc,EAAE,MAAM;QACtB,KAAK,EAAE,SAAS;QAChB,UAAU,EAAE,SAAS;KACtB,CAAA;AACH,CAAC;AAED,MAAM,UAAU,GAAkB;IAChC,KAAK,EAAE,EAAE;IACT,MAAM,EAAE,EAAE;IACV,YAAY,EAAE,CAAC;IACf,OAAO,EAAE,MAAM;IACf,UAAU,EAAE,QAAQ;IACpB,UAAU,EAAE,CAAC;CACd,CAAA;AAED,MAAM,UAAU,GAAkB;IAChC,QAAQ,EAAE,CAAC;IACX,UAAU,EAAE,GAAG;IACf,aAAa,EAAE,QAAQ;IACvB,aAAa,EAAE,WAAW;IAC1B,OAAO,EAAE,SAAS;IAClB,YAAY,EAAE,GAAG;IACjB,UAAU,EAAE,SAAS;IACrB,KAAK,EAAE,SAAS;IAChB,MAAM,EAAE,mBAAmB;IAC3B,UAAU,EAAE,CAAC;CACd,CAAA;AAED,MAAM,WAAW,GAAkB;IACjC,OAAO,EAAE,MAAM;IACf,cAAc,EAAE,UAAU;IAC1B,UAAU,EAAE,EAAE;IACd,SAAS,EAAE,CAAC;IACZ,SAAS,EAAE,mBAAmB;CAC/B,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
export declare function TrialBadge({ label }: {
|
|
3
|
+
label?: string;
|
|
4
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export interface UpgradeWallProps {
|
|
6
|
+
/** Human-friendly verb phrase — "export PDFs", "invite teammates", etc. */
|
|
7
|
+
feature: string;
|
|
8
|
+
/** Optional override of the sign-up URL. Defaults to the Universal ID hub. */
|
|
9
|
+
signUpUrl?: string;
|
|
10
|
+
/** Extra paragraph below the headline (e.g. "your data carries over"). */
|
|
11
|
+
detail?: ReactNode;
|
|
12
|
+
style?: CSSProperties;
|
|
13
|
+
className?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare function UpgradeWall({ feature, signUpUrl, detail, style, className, }: UpgradeWallProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
//# sourceMappingURL=TrialUi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TrialUi.d.ts","sourceRoot":"","sources":["../src/TrialUi.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAcrD,wBAAgB,UAAU,CAAC,EAAE,KAAa,EAAE,EAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,2CAsB/D;AAWD,MAAM,WAAW,gBAAgB;IAC/B,2EAA2E;IAC3E,OAAO,EAAE,MAAM,CAAA;IACf,8EAA8E;IAC9E,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,0EAA0E;IAC1E,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,KAAK,CAAC,EAAE,aAAa,CAAA;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,wBAAgB,WAAW,CAAC,EAC1B,OAAO,EACP,SAAuB,EACvB,MAAM,EACN,KAAK,EACL,SAAS,GACV,EAAE,gBAAgB,2CA+DlB"}
|
package/dist/TrialUi.js
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
const UPGRADE_URL = 'https://unisim.co.uk/login';
|
|
4
|
+
// ──────────────────────────────────────────────────────────────────────────────
|
|
5
|
+
// <TrialBadge /> — small chip you append to a button label that's gated by
|
|
6
|
+
// trial mode. Communicates "this is paid" without taking much room.
|
|
7
|
+
//
|
|
8
|
+
// const { isTrial } = useTrialMode()
|
|
9
|
+
// <Button disabled={isTrial} onClick={exportPdf}>
|
|
10
|
+
// Export PDF {isTrial && <TrialBadge />}
|
|
11
|
+
// </Button>
|
|
12
|
+
// ──────────────────────────────────────────────────────────────────────────────
|
|
13
|
+
export function TrialBadge({ label = 'PRO' }) {
|
|
14
|
+
return (_jsx("span", { style: {
|
|
15
|
+
display: 'inline-flex',
|
|
16
|
+
alignItems: 'center',
|
|
17
|
+
fontSize: 9,
|
|
18
|
+
fontWeight: 800,
|
|
19
|
+
letterSpacing: '0.08em',
|
|
20
|
+
textTransform: 'uppercase',
|
|
21
|
+
padding: '1px 6px',
|
|
22
|
+
borderRadius: 999,
|
|
23
|
+
background: '#fff7ed',
|
|
24
|
+
color: '#c2410c',
|
|
25
|
+
border: '1px solid #fed7aa',
|
|
26
|
+
marginLeft: 6,
|
|
27
|
+
flexShrink: 0,
|
|
28
|
+
}, children: label }));
|
|
29
|
+
}
|
|
30
|
+
export function UpgradeWall({ feature, signUpUrl = UPGRADE_URL, detail, style, className, }) {
|
|
31
|
+
return (_jsxs("div", { className: className, style: {
|
|
32
|
+
maxWidth: 460,
|
|
33
|
+
margin: '32px auto',
|
|
34
|
+
padding: '28px 28px 24px',
|
|
35
|
+
borderRadius: 16,
|
|
36
|
+
border: '1px solid #fed7aa',
|
|
37
|
+
background: 'linear-gradient(180deg, #fffbeb 0%, #ffffff 70%)',
|
|
38
|
+
textAlign: 'center',
|
|
39
|
+
color: '#0f172a',
|
|
40
|
+
...style,
|
|
41
|
+
}, children: [_jsx("div", { style: {
|
|
42
|
+
display: 'inline-flex',
|
|
43
|
+
alignItems: 'center',
|
|
44
|
+
gap: 6,
|
|
45
|
+
padding: '3px 10px',
|
|
46
|
+
fontSize: 10,
|
|
47
|
+
fontWeight: 800,
|
|
48
|
+
letterSpacing: '0.08em',
|
|
49
|
+
textTransform: 'uppercase',
|
|
50
|
+
color: '#c2410c',
|
|
51
|
+
background: '#ffedd5',
|
|
52
|
+
borderRadius: 999,
|
|
53
|
+
border: '1px solid #fed7aa',
|
|
54
|
+
}, children: "Trial limit" }), _jsxs("h2", { style: { fontSize: 18, fontWeight: 700, margin: '12px 0 6px' }, children: ["Sign up free to ", feature] }), _jsx("p", { style: { fontSize: 13, color: '#475569', lineHeight: 1.5, margin: 0 }, children: "You're using a trial account. Everything you've set up so far \u2014 your branding, people, places, projects \u2014 comes with you when you sign up." }), detail && (_jsx("div", { style: { fontSize: 12, color: '#64748b', marginTop: 10 }, children: detail })), _jsx("a", { href: signUpUrl, style: {
|
|
55
|
+
display: 'inline-block',
|
|
56
|
+
marginTop: 18,
|
|
57
|
+
padding: '10px 18px',
|
|
58
|
+
borderRadius: 10,
|
|
59
|
+
background: '#e05504',
|
|
60
|
+
color: 'white',
|
|
61
|
+
fontSize: 14,
|
|
62
|
+
fontWeight: 600,
|
|
63
|
+
textDecoration: 'none',
|
|
64
|
+
}, children: "Create your Universal ID \u2192" })] }));
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=TrialUi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TrialUi.js","sourceRoot":"","sources":["../src/TrialUi.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAIZ,MAAM,WAAW,GAAG,4BAA4B,CAAA;AAEhD,iFAAiF;AACjF,2EAA2E;AAC3E,oEAAoE;AACpE,EAAE;AACF,uCAAuC;AACvC,oDAAoD;AACpD,6CAA6C;AAC7C,cAAc;AACd,iFAAiF;AAEjF,MAAM,UAAU,UAAU,CAAC,EAAE,KAAK,GAAG,KAAK,EAAsB;IAC9D,OAAO,CACL,eACE,KAAK,EAAE;YACL,OAAO,EAAE,aAAa;YACtB,UAAU,EAAE,QAAQ;YACpB,QAAQ,EAAE,CAAC;YACX,UAAU,EAAE,GAAG;YACf,aAAa,EAAE,QAAQ;YACvB,aAAa,EAAE,WAAW;YAC1B,OAAO,EAAE,SAAS;YAClB,YAAY,EAAE,GAAG;YACjB,UAAU,EAAE,SAAS;YACrB,KAAK,EAAE,SAAS;YAChB,MAAM,EAAE,mBAAmB;YAC3B,UA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AAE,SAAS,EACf,KAAK,EAAE;oBACL,OAAO,EAAE,cAAc;oBACvB,SAAS,EAAE,EAAE;oBACb,OAAO,EAAE,WAAW;oBACpB,YAAY,EAAE,EAAE;oBAChB,UAAU,EAAE,SAAS;oBACrB,KAAK,EAAE,OAAO;oBACd,QAAQ,EAAE,EAAE;oBACZ,UAAU,EAAE,GAAG;oBACf,cAAc,EAAE,MAAM;iBACvB,gDAGC,IACA,CACP,CAAA;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UniversalBar.d.ts","sourceRoot":"","sources":["../src/UniversalBar.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"UniversalBar.d.ts","sourceRoot":"","sources":["../src/UniversalBar.tsx"],"names":[],"mappings":"AAIA,MAAM,WAAW,iBAAiB;IAChC,+BAA+B;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,4DAA4D;IAC5D,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,4FAA4F;IAC5F,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,EAC3B,MAAU,EACV,KAAiB,EACjB,QAAe,GAChB,GAAE,iBAAsB,2CA4BxB"}
|
package/dist/UniversalBar.js
CHANGED
package/dist/UniversalBar.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UniversalBar.js","sourceRoot":"","sources":["../src/UniversalBar.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"UniversalBar.js","sourceRoot":"","sources":["../src/UniversalBar.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAWzC;;;;;;;GAOG;AACH,MAAM,UAAU,YAAY,CAAC,EAC3B,MAAM,GAAG,CAAC,EACV,KAAK,GAAG,SAAS,EACjB,QAAQ,GAAG,IAAI,MACM,EAAE;IACvB,MAAM,GAAG,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAA;IAExC,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,QAAQ,IAAI,CAAC,GAAG,CAAC,OAAO;YAAE,OAAM;QACrC,oDAAoD;QACpD,MAAM,OAAO,GAAG,MAAM,CAAC,UAAU,EAAE,CAAC,kCAAkC,CAAC,CAAC,OAAO,CAAA;QAC/E,IAAI,OAAO;YAAE,OAAM;QAEnB,MAAM,SAAS,GAAG,GAAG,CAAC,OAAO,CAAC,OAAO,CACnC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,EACnD,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,aAAa,EAAE,CAChE,CAAA;QACD,OAAO,GAAG,EAAE,CAAC,SAAS,CAAC,MAAM,EAAE,CAAA;IACjC,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAA;IAEd,OAAO,CACL,cACE,GAAG,EAAE,GAAG,iBACI,MAAM,EAClB,KAAK,EAAE;YACL,MAAM,EAAE,GAAG,MAAM,IAAI;YACrB,UAAU,EAAE,0CAA0C,KAAK,yBAAyB;YACpF,UAAU,EAAE,CAAC;YACb,KAAK,EAAE,MAAM;SACd,GACD,CACH,CAAA;AACH,CAAC"}
|