uhc-portal-components-react 0.2.16 → 0.2.17

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/CHANGELOG.md CHANGED
@@ -2,6 +2,9 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ - Require confirmation for employee suspension, reactivation and permanent
6
+ deletion; expose only valid lifecycle actions and distinguish warning,
7
+ constructive and destructive actions with yellow, blue and red treatments.
5
8
  - Add the shared two-sided SOSCHAIN Smart Identity Card artifact. Face A keeps
6
9
  a DID-only QR and localized subject label; face B formats the seven-digit
7
10
  animal species context and 21-digit telephone identifier and renders an
@@ -51,7 +51,11 @@ export type OrganizationWorkforceCopy = Readonly<{
51
51
  accepted: string;
52
52
  cancelled: string;
53
53
  disable: string;
54
+ reactivate: string;
54
55
  purge: string;
56
+ confirmDisable: string;
57
+ confirmReactivate: string;
58
+ confirmPurge: string;
55
59
  devicesLater: string;
56
60
  }>;
57
61
  export type OrganizationWorkforceAdministrationProps = Readonly<{
@@ -70,6 +74,7 @@ export type OrganizationWorkforceAdministrationProps = Readonly<{
70
74
  onUnlockSecretChange: (value: string) => void;
71
75
  onInvite: () => void | Promise<void>;
72
76
  onDisable: (employeeId: string) => void | Promise<void>;
77
+ onReactivate: (employeeId: string) => void | Promise<void>;
73
78
  onPurge: (employeeId: string) => void | Promise<void>;
74
79
  }>;
75
80
  /**
@@ -78,5 +83,5 @@ export type OrganizationWorkforceAdministrationProps = Readonly<{
78
83
  * The component never infers authorization or changes GW state. The host owns
79
84
  * invitation persistence, license reads and employee lifecycle commands.
80
85
  */
81
- export declare function OrganizationWorkforceAdministration({ copy, summary, employees, invitations, roles, email, role, unlockSecret, busyAction, error, onEmailChange, onRoleChange, onUnlockSecretChange, onInvite, onDisable, onPurge, }: OrganizationWorkforceAdministrationProps): import("react").JSX.Element;
86
+ export declare function OrganizationWorkforceAdministration({ copy, summary, employees, invitations, roles, email, role, unlockSecret, busyAction, error, onEmailChange, onRoleChange, onUnlockSecretChange, onInvite, onDisable, onReactivate, onPurge, }: OrganizationWorkforceAdministrationProps): import("react").JSX.Element;
82
87
  //# sourceMappingURL=OrganizationWorkforceAdministration.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"OrganizationWorkforceAdministration.d.ts","sourceRoot":"","sources":["../src/OrganizationWorkforceAdministration.tsx"],"names":[],"mappings":"AAEA,MAAM,MAAM,uBAAuB,GAAG,QAAQ,CAAC;IAC7C,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;CACb,CAAC,CAAA;AAEF,MAAM,MAAM,iBAAiB,GAAG,QAAQ,CAAC;IACvC,EAAE,EAAE,MAAM,CAAA;IACV,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,QAAQ,GAAG,UAAU,CAAA;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,CAAC,CAAA;AAEF,MAAM,MAAM,mBAAmB,GAAG,QAAQ,CAAC;IACzC,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,SAAS,GAAG,UAAU,GAAG,WAAW,CAAA;IAC5C,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,CAAC,CAAA;AAEF,MAAM,MAAM,mBAAmB,GAAG,QAAQ,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CAAA;AAE5E,MAAM,MAAM,yBAAyB,GAAG,QAAQ,CAAC;IAC/C,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,MAAM,CAAA;IACnB,aAAa,EAAE,MAAM,CAAA;IACrB,YAAY,EAAE,MAAM,CAAA;IACpB,YAAY,EAAE,MAAM,CAAA;IACpB,cAAc,EA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YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACrC,oBAAoB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAC7C,QAAQ,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACpC,SAAS,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACvD,OAAO,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CACtD,CAAC,CAAA;AAEF;;;;;GAKG;AACH,wBAAgB,mCAAmC,CAAC,EAClD,IAAI,EACJ,OAAO,EACP,SAAS,EACT,WAAW,EACX,KAAK,EACL,KAAK,EACL,IAAI,EACJ,YAAY,EACZ,UAAU,EACV,KAAK,EACL,aAAa,EACb,YAAY,EACZ,oBAAoB,EACpB,QAAQ,EACR,SAAS,EACT,OAAO,GACR,EAAE,wCAAwC,+BA4D1C"}
1
+ {"version":3,"file":"OrganizationWorkforceAdministration.d.ts","sourceRoot":"","sources":["../src/OrganizationWorkforceAdministration.tsx"],"names":[],"mappings":"AAEA,MAAM,MAAM,uBAAuB,GAAG,QAAQ,CAAC;IAC7C,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;CACb,CAAC,CAAA;AAEF,MAAM,MAAM,iBAAiB,GAAG,QAAQ,CAAC;IACvC,EAAE,EAAE,MAAM,CAAA;IACV,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,QAAQ,GAAG,UAAU,CAAA;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,CAAC,CAAA;AAEF,MAAM,MAAM,mBAAmB,GAAG,QAAQ,CAAC;IACzC,EAAE,EAAE,MAAM,CAAA;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AY,EACZ,UAAU,EACV,KAAK,EACL,aAAa,EACb,YAAY,EACZ,oBAAoB,EACpB,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,OAAO,GACR,EAAE,wCAAwC,+BAuE1C"}
@@ -1,11 +1,11 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  /**
3
3
  * Controlled organization workforce surface shared by professional portals.
4
4
  *
5
5
  * The component never infers authorization or changes GW state. The host owns
6
6
  * invitation persistence, license reads and employee lifecycle commands.
7
7
  */
8
- export function OrganizationWorkforceAdministration({ copy, summary, employees, invitations, roles, email, role, unlockSecret, busyAction, error, onEmailChange, onRoleChange, onUnlockSecretChange, onInvite, onDisable, onPurge, }) {
8
+ export function OrganizationWorkforceAdministration({ copy, summary, employees, invitations, roles, email, role, unlockSecret, busyAction, error, onEmailChange, onRoleChange, onUnlockSecretChange, onInvite, onDisable, onReactivate, onPurge, }) {
9
9
  const noCapacity = summary.free < 1;
10
10
  const inviting = busyAction === 'invite';
11
11
  const canInvite = !noCapacity && !inviting && Boolean(email.trim() && role && unlockSecret);
@@ -14,8 +14,12 @@ export function OrganizationWorkforceAdministration({ copy, summary, employees,
14
14
  if (canInvite)
15
15
  void onInvite();
16
16
  }
17
+ function confirmAction(message, action) {
18
+ if (window.confirm(message))
19
+ void action();
20
+ }
17
21
  return (_jsxs("section", { className: "uhcp-workforce", "aria-labelledby": "uhcp-workforce-title", children: [_jsxs("header", { children: [_jsxs("div", { children: [_jsx("h1", { id: "uhcp-workforce-title", children: copy.title }), _jsx("p", { children: copy.description })] }), _jsxs("dl", { className: "uhcp-license-summary", children: [_jsxs("div", { children: [_jsx("dt", { children: copy.totalLicenses }), _jsx("dd", { children: summary.total })] }), _jsxs("div", { children: [_jsx("dt", { children: copy.usedLicenses }), _jsx("dd", { children: summary.used })] }), _jsxs("div", { children: [_jsx("dt", { children: copy.freeLicenses }), _jsx("dd", { children: summary.free })] })] })] }), _jsxs("section", { className: "uhcp-workforce-panel", "aria-labelledby": "uhcp-invite-title", children: [_jsx("h2", { id: "uhcp-invite-title", children: copy.inviteTitle }), noCapacity && _jsx("p", { role: "status", className: "uhcp-workforce-warning", children: copy.noFreeLicenses }), _jsxs("form", { onSubmit: submitInvitation, children: [_jsxs("label", { children: [_jsx("span", { children: copy.emailLabel }), _jsx("input", { type: "email", required: true, value: email, onChange: (event) => onEmailChange(event.currentTarget.value) })] }), _jsxs("label", { children: [_jsx("span", { children: copy.roleLabel }), _jsxs("select", { required: true, value: role, onChange: (event) => onRoleChange(event.currentTarget.value), children: [_jsx("option", { value: "" }), roles.map((option) => _jsx("option", { value: option.value, children: option.label }, option.value))] })] }), _jsxs("label", { children: [_jsx("span", { children: copy.unlockSecretLabel }), _jsx("input", { type: "password", required: true, value: unlockSecret, onChange: (event) => onUnlockSecretChange(event.currentTarget.value) })] }), _jsx("button", { type: "submit", disabled: !canInvite, children: inviting ? copy.inviting : copy.invite })] })] }), _jsxs("section", { className: "uhcp-workforce-panel", "aria-labelledby": "uhcp-employees-title", children: [_jsx("h2", { id: "uhcp-employees-title", children: copy.employeesTitle }), employees.length === 0 ? _jsx("p", { children: copy.noEmployees }) : (_jsx("div", { className: "uhcp-table-scroll", children: _jsxs("table", { children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: copy.licenseColumn }), _jsx("th", { children: copy.employeeColumn }), _jsx("th", { children: copy.roleColumn }), _jsx("th", { children: copy.statusColumn }), _jsx("th", { children: copy.devicesColumn }), _jsx("th", { children: copy.actionsColumn })] }) }), _jsx("tbody", { children: employees.map((employee) => {
18
22
  const rowBusy = busyAction === employee.id;
19
- return _jsxs("tr", { children: [_jsx("td", { children: _jsx("code", { children: employee.licenseId }) }), _jsx("td", { children: employee.email }), _jsx("td", { children: employee.role }), _jsx("td", { children: _jsx("span", { className: `uhcp-status uhcp-status-${employee.status}`, children: employee.status === 'active' ? copy.active : copy.inactive }) }), _jsx("td", { children: employee.deviceCount === undefined ? copy.devicesLater : employee.deviceCount }), _jsxs("td", { className: "uhcp-row-actions", children: [_jsx("button", { type: "button", disabled: rowBusy || employee.status !== 'active', onClick: () => void onDisable(employee.id), children: copy.disable }), _jsx("button", { type: "button", className: "uhcp-danger", disabled: rowBusy || employee.status !== 'inactive', onClick: () => void onPurge(employee.id), children: copy.purge })] })] }, employee.id);
23
+ return _jsxs("tr", { children: [_jsx("td", { children: _jsx("code", { children: employee.licenseId }) }), _jsx("td", { children: employee.email }), _jsx("td", { children: employee.role }), _jsx("td", { children: _jsx("span", { className: `uhcp-status uhcp-status-${employee.status}`, children: employee.status === 'active' ? copy.active : copy.inactive }) }), _jsx("td", { children: employee.deviceCount === undefined ? copy.devicesLater : employee.deviceCount }), _jsx("td", { className: "uhcp-row-actions", children: employee.status === 'active' ? (_jsx("button", { type: "button", className: "uhcp-warning-action", disabled: rowBusy, onClick: () => confirmAction(copy.confirmDisable, () => onDisable(employee.id)), children: copy.disable })) : (_jsxs(_Fragment, { children: [_jsx("button", { type: "button", className: "uhcp-primary-action", disabled: rowBusy, onClick: () => confirmAction(copy.confirmReactivate, () => onReactivate(employee.id)), children: copy.reactivate }), _jsx("button", { type: "button", className: "uhcp-danger", disabled: rowBusy, onClick: () => confirmAction(copy.confirmPurge, () => onPurge(employee.id)), children: copy.purge })] })) })] }, employee.id);
20
24
  }) })] }) }))] }), _jsxs("section", { className: "uhcp-workforce-panel", "aria-labelledby": "uhcp-invitations-title", children: [_jsx("h2", { id: "uhcp-invitations-title", children: copy.invitationsTitle }), invitations.length === 0 ? _jsx("p", { children: copy.noInvitations }) : _jsx("ul", { className: "uhcp-invitation-list", children: invitations.map((invitation) => _jsxs("li", { children: [_jsxs("span", { children: [_jsx("strong", { children: invitation.email }), _jsx("small", { children: invitation.role })] }), _jsx("span", { className: `uhcp-status uhcp-status-${invitation.status}`, children: copy[invitation.status] })] }, invitation.id)) })] }), error && _jsx("p", { role: "alert", className: "uhcp-error", children: error })] }));
21
25
  }
package/dist/styles.css CHANGED
@@ -645,6 +645,8 @@ html[data-theme='dark'] .uhcp-brand-artwork-dark { display: block !important; }
645
645
  .uhcp-workforce-panel input, .uhcp-workforce-panel select { background: var(--uhcp-panel); border: 1px solid var(--uhcp-border); border-radius: .75rem; color: var(--uhcp-text); font: inherit; min-width: 0; padding: .75rem; }
646
646
  .uhcp-workforce button { background: linear-gradient(135deg, var(--uhcp-action-start), var(--uhcp-action-end)); border: 0; border-radius: .75rem; color: #fff; cursor: pointer; font: inherit; font-weight: 800; padding: .75rem 1rem; }
647
647
  .uhcp-workforce button:disabled { cursor: not-allowed; opacity: .45; }
648
+ .uhcp-workforce button.uhcp-warning-action { background: #facc15; color: #422006; }
649
+ .uhcp-workforce button.uhcp-primary-action { background: #2563eb; color: #fff; }
648
650
  .uhcp-workforce button.uhcp-danger { background: #9e3535; }
649
651
  .uhcp-workforce-warning { color: var(--uhcp-attention) !important; font-weight: 800; }
650
652
  .uhcp-table-scroll { overflow-x: auto; }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uhc-portal-components-react",
3
- "version": "0.2.16",
3
+ "version": "0.2.17",
4
4
  "description": "Brand-neutral React portal shell, account preferences and protected-profile UI for UHC and VetChain portals.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",