@coffre/ui 0.5.0 → 0.6.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.
Files changed (120) hide show
  1. package/dist/chunks/{affordances-Bqdevf7w.js → affordances-D0GyCT-I.js} +3 -3
  2. package/dist/chunks/affordances-D0GyCT-I.js.map +1 -0
  3. package/dist/chunks/{audit-sentence-Cm5nby5k.js → audit-sentence-CUUMshIp.js} +22 -6
  4. package/dist/chunks/audit-sentence-CUUMshIp.js.map +1 -0
  5. package/dist/chunks/{connected-apps-DTNS7YmY.js → connected-apps-IP0KfUjo.js} +5 -5
  6. package/dist/chunks/{connected-apps-DTNS7YmY.js.map → connected-apps-IP0KfUjo.js.map} +1 -1
  7. package/dist/chunks/{delete-place-CIaOq0mt.js → delete-place-CVv6CN5y.js} +5 -5
  8. package/dist/chunks/{delete-place-CIaOq0mt.js.map → delete-place-CVv6CN5y.js.map} +1 -1
  9. package/dist/chunks/{directory-DSVt5Tya.js → directory-pMVS1m-c.js} +62 -43
  10. package/dist/chunks/directory-pMVS1m-c.js.map +1 -0
  11. package/dist/chunks/{folders-CoGK9oqg.js → folders-hR2Lnk0k.js} +3 -3
  12. package/dist/chunks/{folders-CoGK9oqg.js.map → folders-hR2Lnk0k.js.map} +1 -1
  13. package/dist/chunks/{grants-CRU7yZhL.js → grants-CgC8Ybhu.js} +6 -6
  14. package/dist/chunks/{grants-CRU7yZhL.js.map → grants-CgC8Ybhu.js.map} +1 -1
  15. package/dist/chunks/{offboarding-DVBSiJRZ.js → offboarding-3fzRjKla.js} +5 -5
  16. package/dist/chunks/{offboarding-DVBSiJRZ.js.map → offboarding-3fzRjKla.js.map} +1 -1
  17. package/dist/chunks/{page-DvsgZ2Hd.js → page-JTORvh-N.js} +7 -3
  18. package/dist/chunks/page-JTORvh-N.js.map +1 -0
  19. package/dist/chunks/{principal-BIN-xwZw.js → principal-DFBswTBr.js} +2 -2
  20. package/dist/chunks/{principal-BIN-xwZw.js.map → principal-DFBswTBr.js.map} +1 -1
  21. package/dist/chunks/{principal-page-BEBr_zW7.js → principal-page-CYJIJAdp.js} +17 -19
  22. package/dist/chunks/principal-page-CYJIJAdp.js.map +1 -0
  23. package/dist/chunks/{project-page-B3TZ5_ig.js → project-page-lO5P6iCb.js} +3 -3
  24. package/dist/chunks/{project-page-B3TZ5_ig.js.map → project-page-lO5P6iCb.js.map} +1 -1
  25. package/dist/chunks/{queries-DE5nK2y4.js → queries-gigcQOO_.js} +26 -12
  26. package/dist/chunks/queries-gigcQOO_.js.map +1 -0
  27. package/dist/chunks/{references-uv4Mli9z.js → references-DZ179hTJ.js} +5 -5
  28. package/dist/chunks/{references-uv4Mli9z.js.map → references-DZ179hTJ.js.map} +1 -1
  29. package/dist/chunks/{role-field-DWhkRY6n.js → role-field-DiqiFwm_.js} +14 -7
  30. package/dist/chunks/role-field-DiqiFwm_.js.map +1 -0
  31. package/dist/chunks/{row-state-DOPUsjQK.js → row-state-Zf3kZVhd.js} +13 -5
  32. package/dist/chunks/row-state-Zf3kZVhd.js.map +1 -0
  33. package/dist/chunks/{signin-errors--ykMFuqN.js → signin-errors-TlQmQe0t.js} +2 -2
  34. package/dist/chunks/signin-errors-TlQmQe0t.js.map +1 -0
  35. package/dist/chunks/{theme-DJuz-xLM.js → theme-B6-V9JvY.js} +3 -3
  36. package/dist/chunks/{theme-DJuz-xLM.js.map → theme-B6-V9JvY.js.map} +1 -1
  37. package/dist/chunks/{ui-DJje3gST.js → ui-Br-dNUTc.js} +2 -2
  38. package/dist/chunks/{ui-DJje3gST.js.map → ui-Br-dNUTc.js.map} +1 -1
  39. package/dist/chunks/{use-action-BRgvbUWt.js → use-action-CQGGNqWb.js} +3 -3
  40. package/dist/chunks/{use-action-BRgvbUWt.js.map → use-action-CQGGNqWb.js.map} +1 -1
  41. package/dist/chunks/{use-change-BJ3dCFHb.js → use-change-BdS1gzyo.js} +31 -19
  42. package/dist/chunks/use-change-BdS1gzyo.js.map +1 -0
  43. package/dist/chunks/{use-shell-BO4ZTr1y.js → use-shell-BCU505bx.js} +3 -3
  44. package/dist/chunks/{use-shell-BO4ZTr1y.js.map → use-shell-BCU505bx.js.map} +1 -1
  45. package/dist/index.d.ts +6 -7
  46. package/dist/index.js +8 -9
  47. package/dist/index.js.map +1 -1
  48. package/dist/pages/account.js +12 -13
  49. package/dist/pages/account.js.map +1 -1
  50. package/dist/pages/approval.js +2 -2
  51. package/dist/pages/audit.js +5 -5
  52. package/dist/pages/audit.js.map +1 -1
  53. package/dist/pages/device-login.js +2 -2
  54. package/dist/pages/environment.js +829 -155
  55. package/dist/pages/environment.js.map +1 -1
  56. package/dist/pages/login.js +4 -4
  57. package/dist/pages/oauth-authorize.js +2 -2
  58. package/dist/pages/project-access.js +160 -80
  59. package/dist/pages/project-access.js.map +1 -1
  60. package/dist/pages/project-environments.js +10 -10
  61. package/dist/pages/project-settings.js +8 -8
  62. package/dist/pages/project.js +3 -3
  63. package/dist/pages/projects.js +10 -10
  64. package/dist/pages/projects.js.map +1 -1
  65. package/dist/pages/service-account.js +537 -109
  66. package/dist/pages/service-account.js.map +1 -1
  67. package/dist/pages/service-accounts.js +5 -5
  68. package/dist/pages/settings.js +8 -18
  69. package/dist/pages/settings.js.map +1 -1
  70. package/dist/pages/unregistered.js +3 -3
  71. package/dist/pages/unregistered.js.map +1 -1
  72. package/dist/pages/user.js +6 -6
  73. package/dist/pages/users.js +5 -5
  74. package/package.json +3 -3
  75. package/src/components/affordances.ts +1 -1
  76. package/src/components/directory.tsx +40 -34
  77. package/src/components/generate-value.tsx +362 -0
  78. package/src/components/github-picker.tsx +83 -0
  79. package/src/components/icons.tsx +4 -0
  80. package/src/components/masked.tsx +60 -0
  81. package/src/components/missing.tsx +3 -3
  82. package/src/components/multi-combobox.tsx +94 -0
  83. package/src/components/principal-page.tsx +8 -12
  84. package/src/components/principal-picker.tsx +68 -18
  85. package/src/components/role-field.tsx +7 -5
  86. package/src/components/row-state.tsx +7 -3
  87. package/src/components/shell.tsx +0 -1
  88. package/src/components/trusted-workloads.tsx +157 -62
  89. package/src/lib/audit-sentences.ts +25 -3
  90. package/src/lib/bindings.ts +125 -14
  91. package/src/lib/capabilities.ts +15 -9
  92. package/src/lib/changes.ts +15 -9
  93. package/src/lib/coffre.ts +2 -0
  94. package/src/lib/generate.ts +160 -0
  95. package/src/lib/queries.ts +18 -5
  96. package/src/lib/secret-edit-batch.ts +38 -5
  97. package/src/lib/secret-order.ts +23 -0
  98. package/src/lib/shortcuts.ts +9 -0
  99. package/src/lib/signin-errors.ts +1 -1
  100. package/src/lib/use-github-lookup.ts +70 -0
  101. package/src/pages/account.tsx +1 -2
  102. package/src/pages/audit.tsx +1 -1
  103. package/src/pages/environment.tsx +228 -119
  104. package/src/pages/project-access.tsx +19 -8
  105. package/src/pages/projects.tsx +3 -3
  106. package/src/pages/settings.tsx +0 -10
  107. package/src/pages/unregistered.tsx +1 -1
  108. package/src/parity.ts +3 -1
  109. package/src/shared/models.ts +2 -2
  110. package/src/styles/globals.css +303 -19
  111. package/dist/chunks/affordances-Bqdevf7w.js.map +0 -1
  112. package/dist/chunks/audit-sentence-Cm5nby5k.js.map +0 -1
  113. package/dist/chunks/directory-DSVt5Tya.js.map +0 -1
  114. package/dist/chunks/page-DvsgZ2Hd.js.map +0 -1
  115. package/dist/chunks/principal-page-BEBr_zW7.js.map +0 -1
  116. package/dist/chunks/queries-DE5nK2y4.js.map +0 -1
  117. package/dist/chunks/role-field-DWhkRY6n.js.map +0 -1
  118. package/dist/chunks/row-state-DOPUsjQK.js.map +0 -1
  119. package/dist/chunks/signin-errors--ykMFuqN.js.map +0 -1
  120. package/dist/chunks/use-change-BJ3dCFHb.js.map +0 -1
@@ -3,7 +3,7 @@ import { useSuspenseQuery } from '@tanstack/react-query';
3
3
  import { useShell } from '../lib/use-shell';
4
4
  import { useCoffre } from '../lib/coffre';
5
5
  import { grantAccess, grantId } from '../lib/changes';
6
- import { queries } from '../lib/queries';
6
+ import { listsServices, queries } from '../lib/queries';
7
7
  import { useChange } from '../lib/use-change';
8
8
  import type { GrantRow, ProjectSummary } from '../shared/models';
9
9
  import { ReferencesInto } from '../components/references';
@@ -116,17 +116,25 @@ function NewGrant({
116
116
  environments: ProjectSummary['environments'];
117
117
  grants: GrantRow[];
118
118
  }) {
119
- const { capabilities } = useShell();
119
+ const shell = useShell();
120
120
  const [open, setOpen] = useState(false);
121
121
  const [principalId, setPrincipalId] = useState('');
122
+ // A new service account, named in the picker: the grant makes it.
123
+ const [admit, setAdmit] = useState(false);
122
124
  const [permission, setPermission] = useState('viewer:');
123
125
  const [expiresAt, setExpiresAt] = useState('');
124
126
  const grant = useChange(grantAccess(useCoffre(), project));
125
127
  const permissionOptions = projectAccessOptions(environments);
126
128
  const kind = KIND[principalType];
129
+ const service = principalType === 'service';
127
130
 
131
+ // Each opening starts afresh: the picker's filter does, and a new account is named only there.
128
132
  function close() {
129
133
  setOpen(false);
134
+ setPrincipalId('');
135
+ setAdmit(false);
136
+ setExpiresAt('');
137
+ setPermission('viewer:');
130
138
  }
131
139
 
132
140
  return (
@@ -160,19 +168,22 @@ function NewGrant({
160
168
  roleName: permissionOptions.find((option) => option.value === permission)?.label ?? access.role,
161
169
  environmentSlug: access.environmentSlug,
162
170
  expiresAt: expiresAt === '' ? null : new Date(`${expiresAt}T23:59:59Z`).toISOString(),
171
+ admit,
163
172
  });
164
- setPrincipalId('');
165
- setExpiresAt('');
166
- setPermission('viewer:');
167
173
  close();
168
174
  }}
169
175
  >
170
176
  <PrincipalPicker
171
177
  principalType={principalType}
172
- canList={capabilities.canManageGrants}
178
+ canList={service ? listsServices(shell) : shell.capabilities.canManageGrants}
179
+ canCreate={service && shell.capabilities.setsUpServices}
173
180
  grants={grants}
174
181
  value={principalId}
175
- onChange={setPrincipalId}
182
+ admit={admit}
183
+ onChange={(next, isNew) => {
184
+ setPrincipalId(next);
185
+ setAdmit(isNew);
186
+ }}
176
187
  />
177
188
 
178
189
  <div className="form-row">
@@ -209,7 +220,7 @@ function NewGrant({
209
220
  Cancel
210
221
  </button>
211
222
  <button className="btn btn-primary" type="submit" disabled={principalId.trim() === ''}>
212
- Grant access
223
+ {admit ? 'Create and grant access' : 'Grant access'}
213
224
  </button>
214
225
  </div>
215
226
  </form>
@@ -22,7 +22,7 @@ import { Tile } from '../components/tile';
22
22
  import { AlertTriangle, Folder, Hash, Layers, Plus } from '../components/icons';
23
23
  import {
24
24
  ProjectEmptyStateCopy,
25
- RootAdminOnly,
25
+ MakesProjectsOnly,
26
26
  } from '../components/affordances';
27
27
 
28
28
  export function ProjectsPage() {
@@ -76,11 +76,11 @@ export function ProjectsPage() {
76
76
  </section>
77
77
  )}
78
78
 
79
- <RootAdminOnly capabilities={capabilities}>
79
+ <MakesProjectsOnly capabilities={capabilities}>
80
80
  <div className="table-actions">
81
81
  <NewProject />
82
82
  </div>
83
- </RootAdminOnly>
83
+ </MakesProjectsOnly>
84
84
 
85
85
  {archived.length > 0 && (
86
86
  <section aria-labelledby="archived-projects">
@@ -24,7 +24,6 @@ export function SettingsPage() {
24
24
  const providers = auth?.signin?.providers.map((provider) => provider.label) ?? [];
25
25
 
26
26
  const principals = directory?.ok === true ? directory.principals : null;
27
- const rootAdmins = principals?.filter((entry) => entry.isRootAdmin) ?? [];
28
27
  const users = principals?.filter((entry) => entry.principalType === 'user').length ?? 0;
29
28
  const tokens = principals?.filter((entry) => entry.principalType === 'service').length ?? 0;
30
29
 
@@ -56,15 +55,6 @@ export function SettingsPage() {
56
55
  </Fact>
57
56
  {principals !== null && (
58
57
  <>
59
- <Fact label="Root admins">
60
- <span className="fact-list">
61
- {rootAdmins.map((admin) => (
62
- <span key={admin.principalId} className="mono">
63
- {admin.principalId}
64
- </span>
65
- ))}
66
- </span>
67
- </Fact>
68
58
  <Fact label="Directory">
69
59
  <span>
70
60
  <Link to="/users">
@@ -46,7 +46,7 @@ export function UnregisteredPage() {
46
46
  , but coffre has not added you.
47
47
  </p>
48
48
  <p>
49
- Ask a coffre admin or root admin to add your Access email under Users.
49
+ Ask a coffre admin or owner to add your Access email under Users.
50
50
  </p>
51
51
  </ClosedDoor>
52
52
  );
package/src/parity.ts CHANGED
@@ -55,7 +55,7 @@ export const UI_PARITY: { [K in RouteKey]: Reach } = {
55
55
  ],
56
56
  },
57
57
  'GET /projects/:project/:environment/missing': {
58
- ui: [{ does: "an environment: the keys its siblings you read have and it lacks", in: 'lib/queries.ts', call: 'environments.missing' }],
58
+ ui: [{ does: "an environment: the keys its siblings have and it lacks", in: 'lib/queries.ts', call: 'environments.missing' }],
59
59
  },
60
60
  'PATCH /projects/:project/:environment/dismissals': {
61
61
  ui: [{ does: 'an environment › Missing keys › Dismiss, Dismiss all, Restore', in: 'components/missing.tsx', call: 'environments.dismiss' }],
@@ -116,6 +116,7 @@ export const UI_PARITY: { [K in RouteKey]: Reach } = {
116
116
  'PUT /members/:member': {
117
117
  ui: [
118
118
  { does: 'Users › Add user; Service accounts › Add service account', in: 'components/directory.tsx', call: 'members.add' },
119
+ { does: 'a project › Service accounts › Add service account › New service account: made with its grant, in one call', in: 'pages/project-access.tsx', call: 'members.add' },
119
120
  { does: 'a user › ⋯ › Change role', in: 'components/directory.tsx', call: 'members.add' },
120
121
  ],
121
122
  },
@@ -132,6 +133,7 @@ export const UI_PARITY: { [K in RouteKey]: Reach } = {
132
133
  },
133
134
  'DELETE /members/:member/bindings/:id': { ui: [{ does: 'a trust binding › Remove', in: 'components/trusted-workloads.tsx', call: 'bindings.remove' }] },
134
135
  'GET /workloads/lookup': { ui: [{ does: 'Trust a workload: a repository named, its IDs looked up', in: 'components/trusted-workloads.tsx', call: 'bindings.lookup' }] },
136
+ 'GET /workloads/repositories': { ui: [{ does: "Trust a workload: the repositories the deployment's GitHub App is installed on, offered as the name is typed", in: 'lib/queries.ts', call: 'bindings.repositories' }] },
135
137
  'PATCH /access/:member': {
136
138
  ui: [
137
139
  { does: 'a project › Users, Service accounts › Add user, Add service account', in: 'pages/project-access.tsx', call: 'access.set' },
@@ -44,8 +44,8 @@ export type RoleRow = {
44
44
  assignableToEnvironment: boolean;
45
45
  };
46
46
 
47
- export type DirectoryPrincipal = Pick<Member, 'principalType' | 'principalId' | 'instanceRole' | 'scope' | 'isRootAdmin'> &
48
- Partial<Pick<Member, 'tampered' | 'managed'>> & {
47
+ export type DirectoryPrincipal = Pick<Member, 'principalType' | 'principalId' | 'instanceRole' | 'scope'> &
48
+ Partial<Pick<Member, 'tampered' | 'managed' | 'declared'>> & {
49
49
  /** Where it has access, when the list said; a member just added has none yet. */
50
50
  grants?: { project: string; environment: string | null }[];
51
51
  };
@@ -1349,6 +1349,15 @@ a.crumb-link:hover {
1349
1349
  padding-left: 2rem;
1350
1350
  }
1351
1351
 
1352
+ /* A secret's value field holds two buttons, Generate and Show, side by side. */
1353
+ .input-group.has-generate .input {
1354
+ padding-right: 3.875rem;
1355
+ }
1356
+
1357
+ .input-group .input-addon-generate {
1358
+ right: calc(0.1875rem + 1.75rem);
1359
+ }
1360
+
1352
1361
  /* The engine's clear button for a search field, drawn in the field's own ink
1353
1362
  rather than the bright system glyph. */
1354
1363
  .input[type='search']::-webkit-search-cancel-button {
@@ -1441,6 +1450,12 @@ a.crumb-link:hover {
1441
1450
  visibility: visible;
1442
1451
  }
1443
1452
 
1453
+ /* A service account the grant makes: the last option, its name as typed. */
1454
+ .avatar-new {
1455
+ background: var(--accent-wash);
1456
+ color: var(--accent);
1457
+ }
1458
+
1444
1459
  .picker-empty {
1445
1460
  display: flex;
1446
1461
  align-items: center;
@@ -1519,7 +1534,7 @@ a.crumb-link:hover {
1519
1534
  font-size: 0.875rem;
1520
1535
  }
1521
1536
 
1522
- /* Checkboxes under one label: the events a trust binding accepts. */
1537
+ /* Checkboxes under one label: the places a scope reaches. */
1523
1538
  .checks {
1524
1539
  margin: 0;
1525
1540
  padding: 0;
@@ -1531,10 +1546,168 @@ a.crumb-link:hover {
1531
1546
  margin-bottom: 0.375rem;
1532
1547
  }
1533
1548
 
1534
- .checks-row {
1549
+ /* Several of a fixed list, typed to filter: the chosen ones as chips in the
1550
+ field, the rest in a menu below (MultiCombobox). */
1551
+ .combo {
1552
+ display: flex;
1553
+ align-items: center;
1554
+ min-height: 2.125rem;
1555
+ padding: 0.1875rem 0.375rem;
1556
+ border: 1px solid var(--edge);
1557
+ border-radius: var(--radius);
1558
+ background: var(--panel);
1559
+ cursor: text;
1560
+ transition:
1561
+ border-color 120ms,
1562
+ box-shadow 120ms;
1563
+ }
1564
+
1565
+ .combo:focus-within {
1566
+ border-color: var(--accent);
1567
+ box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 22%, transparent);
1568
+ }
1569
+
1570
+ .combo-chips {
1535
1571
  display: flex;
1572
+ flex: 1;
1536
1573
  flex-wrap: wrap;
1537
- gap: 0.5rem 1.25rem;
1574
+ align-items: center;
1575
+ gap: 0.25rem;
1576
+ min-width: 0;
1577
+ }
1578
+
1579
+ .combo-chip {
1580
+ display: inline-flex;
1581
+ align-items: center;
1582
+ gap: 0.125rem;
1583
+ height: 1.5rem;
1584
+ padding: 0 0.125rem 0 0.4375rem;
1585
+ border-radius: var(--radius-sm);
1586
+ background: var(--subtle);
1587
+ box-shadow: inset 0 0 0 1px var(--border);
1588
+ color: var(--ink);
1589
+ font-size: 0.8125rem;
1590
+ outline: none;
1591
+ cursor: default;
1592
+ }
1593
+
1594
+ .combo-chip:focus-visible {
1595
+ background: var(--accent-wash);
1596
+ box-shadow: inset 0 0 0 1px var(--accent);
1597
+ }
1598
+
1599
+ .combo-chip-remove {
1600
+ display: grid;
1601
+ place-items: center;
1602
+ width: 1.125rem;
1603
+ height: 1.125rem;
1604
+ padding: 0;
1605
+ border: 0;
1606
+ border-radius: 3px;
1607
+ background: transparent;
1608
+ color: var(--ink-3);
1609
+ }
1610
+
1611
+ .combo-chip-remove:hover {
1612
+ background: color-mix(in oklab, var(--ink) 8%, transparent);
1613
+ color: var(--ink);
1614
+ }
1615
+
1616
+ .combo-input {
1617
+ flex: 1 0 2rem;
1618
+ min-width: 2rem;
1619
+ height: 1.5rem;
1620
+ padding: 0 0.25rem;
1621
+ border: 0;
1622
+ outline: none;
1623
+ background: transparent;
1624
+ color: var(--ink);
1625
+ font-size: 0.875rem;
1626
+ }
1627
+
1628
+ .combo-input::placeholder {
1629
+ color: var(--ink-3);
1630
+ opacity: 1;
1631
+ }
1632
+
1633
+ .combo-mono :is(.combo-chip, .combo-input) {
1634
+ font-family: var(--font-mono);
1635
+ font-size: 0.8125rem;
1636
+ font-variant-ligatures: none;
1637
+ }
1638
+
1639
+ .combo-popup {
1640
+ width: var(--anchor-width);
1641
+ }
1642
+
1643
+ .combo-check {
1644
+ display: grid;
1645
+ flex: none;
1646
+ place-items: center;
1647
+ width: 0.875rem;
1648
+ }
1649
+
1650
+ .combo-check svg {
1651
+ color: var(--accent);
1652
+ }
1653
+
1654
+ .combo-option {
1655
+ flex: 1;
1656
+ }
1657
+
1658
+ .combo-empty:not(:empty) {
1659
+ padding: 0.5rem;
1660
+ color: var(--ink-3);
1661
+ font-size: 0.8125rem;
1662
+ }
1663
+
1664
+ /* A repository's name, and what GitHub said of it below: who it is, or why
1665
+ it could not say and the IDs to type instead (the Trust dialog). */
1666
+ .lookup-group {
1667
+ display: flex;
1668
+ flex-direction: column;
1669
+ gap: 0.5rem;
1670
+ }
1671
+
1672
+ .lookup {
1673
+ display: flex;
1674
+ align-items: center;
1675
+ gap: 0.375rem;
1676
+ margin: 0;
1677
+ color: var(--ink-3);
1678
+ font-size: 0.8125rem;
1679
+ overflow-wrap: anywhere;
1680
+ }
1681
+
1682
+ .lookup svg {
1683
+ flex: none;
1684
+ }
1685
+
1686
+ .lookup-found svg {
1687
+ color: var(--green);
1688
+ }
1689
+
1690
+ .lookup-name {
1691
+ color: var(--ink);
1692
+ }
1693
+
1694
+ .lookup-failed {
1695
+ color: var(--ink-2);
1696
+ }
1697
+
1698
+ .disclosure summary {
1699
+ width: fit-content;
1700
+ color: var(--accent);
1701
+ font-size: 0.8125rem;
1702
+ font-weight: 550;
1703
+ cursor: pointer;
1704
+ }
1705
+
1706
+ .disclosure-body {
1707
+ display: flex;
1708
+ flex-direction: column;
1709
+ gap: 0.75rem;
1710
+ margin-top: 0.75rem;
1538
1711
  }
1539
1712
 
1540
1713
  /* A trust binding's claims, what a run's ID token must carry, in full. */
@@ -1781,6 +1954,34 @@ a.crumb-link:hover {
1781
1954
  font-weight: 450;
1782
1955
  }
1783
1956
 
1957
+ /* A header that orders its table: the whole label is the button, and its
1958
+ mark says which way, or, idle, shows on hover that it can. */
1959
+ .th-sort {
1960
+ padding: 0;
1961
+ border: 0;
1962
+ background: none;
1963
+ color: inherit;
1964
+ font: inherit;
1965
+ cursor: pointer;
1966
+ }
1967
+
1968
+ .th-sort .sort-mark {
1969
+ transition: transform 120ms ease, opacity 120ms ease;
1970
+ }
1971
+
1972
+ .th-sort .sort-mark.is-ascending {
1973
+ transform: rotate(180deg);
1974
+ }
1975
+
1976
+ .th-sort .sort-mark.is-idle {
1977
+ opacity: 0;
1978
+ }
1979
+
1980
+ .th-sort:hover .sort-mark.is-idle,
1981
+ .th-sort:focus-visible .sort-mark.is-idle {
1982
+ opacity: 1;
1983
+ }
1984
+
1784
1985
  .dt td {
1785
1986
  padding: 0.625rem 0.75rem;
1786
1987
  border-bottom: 1px solid var(--border);
@@ -1996,23 +2197,26 @@ a.crumb-link:hover {
1996
2197
  }
1997
2198
 
1998
2199
  /* Those action columns fit their button, not the "Removing…" that briefly
1999
- stands in for it: that reads leftwards, over the blank end of the column
2000
- before. Stacked rows, on a phone, have the room. */
2001
- @media (min-width: 44.0625rem) {
2002
- .grants td.col-actions,
2003
- .directory td.col-actions,
2004
- .secrets td.col-actions {
2005
- position: relative;
2006
- }
2200
+ stands in for it, stacked rows included: the spinner stays and the words go
2201
+ to screen readers and the tooltip. The spinner sits where the menu's icon
2202
+ does, a button wide (an icon and its padding), so the row does not jump
2203
+ when it settles. */
2204
+ .grants .col-actions .row-pending,
2205
+ .directory .col-actions .row-pending,
2206
+ .secrets .col-actions .row-pending {
2207
+ justify-content: center;
2208
+ width: 2rem;
2209
+ }
2007
2210
 
2008
- .grants .col-actions > .row-pending,
2009
- .directory .col-actions > .row-pending,
2010
- .secrets .col-actions > .row-pending {
2011
- position: absolute;
2012
- top: 50%;
2013
- right: 0.375rem;
2014
- transform: translateY(-50%);
2015
- }
2211
+ .grants .col-actions .row-pending-words,
2212
+ .directory .col-actions .row-pending-words,
2213
+ .secrets .col-actions .row-pending-words {
2214
+ position: absolute;
2215
+ width: 1px;
2216
+ height: 1px;
2217
+ margin: -1px;
2218
+ overflow: hidden;
2219
+ clip: rect(0 0 0 0);
2016
2220
  }
2017
2221
 
2018
2222
  /* A person or token: avatar and name, the name cut short rather than
@@ -2130,6 +2334,13 @@ a.crumb-link:hover {
2130
2334
  display: none;
2131
2335
  }
2132
2336
 
2337
+ /* Its buttons stay on its first line, however tall a paste makes it, and
2338
+ hide the text that scrolls under them. */
2339
+ .secret-row .input.value-lines ~ .input-addon {
2340
+ top: 0.0625rem;
2341
+ background: var(--panel);
2342
+ }
2343
+
2133
2344
  /* Masked where the browser cannot draw discs: the text is there, unseen. */
2134
2345
  .input.is-masked-fallback {
2135
2346
  color: transparent;
@@ -2221,6 +2432,15 @@ a.crumb-link:hover {
2221
2432
  text-overflow: ellipsis;
2222
2433
  }
2223
2434
 
2435
+ /* A value unchanged past the deployment's rotateAfterDays: a small tag that
2436
+ says what to do. */
2437
+ .written-flag {
2438
+ align-self: center;
2439
+ height: 1.125rem;
2440
+ padding: 0 0.35rem;
2441
+ font-size: 0.6875rem;
2442
+ }
2443
+
2224
2444
  .secret-row .mask {
2225
2445
  color: var(--ink-3);
2226
2446
  font-family: var(--font-mono);
@@ -3770,6 +3990,40 @@ a.env-card-name:hover {
3770
3990
  margin-bottom: 0.5rem;
3771
3991
  }
3772
3992
 
3993
+ /* Generate a value: its length as a slider and a number of bytes, side by side. */
3994
+ .generate-length {
3995
+ display: flex;
3996
+ align-items: center;
3997
+ gap: 0.625rem;
3998
+ }
3999
+
4000
+ .generate-length .range {
4001
+ flex: 1;
4002
+ min-width: 0;
4003
+ accent-color: var(--accent);
4004
+ }
4005
+
4006
+ .input.generate-bytes {
4007
+ flex: none;
4008
+ width: 4.5rem;
4009
+ font-variant-numeric: tabular-nums;
4010
+ }
4011
+
4012
+ .generate-unit {
4013
+ color: var(--ink-2);
4014
+ font-size: 0.8125rem;
4015
+ }
4016
+
4017
+ .label-note {
4018
+ color: var(--ink-3);
4019
+ font-weight: 400;
4020
+ }
4021
+
4022
+ /* Generate again sits apart from the two that close the dialog. */
4023
+ .generate-actions > :first-child {
4024
+ margin-right: auto;
4025
+ }
4026
+
3773
4027
  .menu-positioner {
3774
4028
  z-index: 70;
3775
4029
  }
@@ -4444,6 +4698,36 @@ a.env-card-name:hover {
4444
4698
  display: none;
4445
4699
  }
4446
4700
 
4701
+ /* A table that sorts keeps its sortable headers, a row of their own. */
4702
+ .dt.stacks.sortable thead {
4703
+ display: block;
4704
+ }
4705
+
4706
+ .dt.stacks.sortable thead tr {
4707
+ display: flex;
4708
+ gap: 1.25rem;
4709
+ padding: 0.5rem 0.875rem;
4710
+ border-bottom: 1px solid var(--border);
4711
+ background: var(--subtle);
4712
+ }
4713
+
4714
+ .dt.stacks.sortable thead th {
4715
+ display: none;
4716
+ }
4717
+
4718
+ .dt.stacks.sortable thead th.th-sortable {
4719
+ display: block;
4720
+ width: auto;
4721
+ height: auto;
4722
+ padding: 0;
4723
+ border: 0;
4724
+ background: none;
4725
+ }
4726
+
4727
+ .dt.stacks.sortable .sort-mark.is-idle {
4728
+ opacity: 1;
4729
+ }
4730
+
4447
4731
  /* Short facts under a row's lead: each label on its value's line. */
4448
4732
  .dt.stacks-inline td:first-child {
4449
4733
  grid-column: 1;
@@ -1 +0,0 @@
1
- {"version":3,"file":"affordances-Bqdevf7w.js","names":[],"sources":["../../src/components/affordances.ts"],"sourcesContent":["import {\n createElement,\n Fragment,\n type ReactElement,\n type ReactNode,\n} from 'react';\nimport type { UiCapabilities } from '../lib/capabilities';\n\ntype AdministrationItemsProps = {\n capabilities: UiCapabilities;\n users: ReactNode;\n services: ReactNode;\n audit: ReactNode;\n};\n\n/** The shared ordering and visibility rule for administration destinations. */\nexport function AdministrationItems({\n capabilities,\n users,\n services,\n audit,\n}: AdministrationItemsProps): ReactElement {\n return createElement(\n Fragment,\n null,\n ...administrationEntries(capabilities, { users: [users], services: [services], audit: [audit] }),\n );\n}\n\n/** The same rule, for destinations kept as data (the command palette's). */\nexport function administrationEntries<T>(\n capabilities: UiCapabilities,\n { users, services, audit }: { users: T[]; services: T[]; audit: T[] },\n): T[] {\n return [\n ...(capabilities.canManageGrants ? users : []),\n // Service accounts, to whoever sets one up too: they see those they manage.\n ...(capabilities.canManageGrants || capabilities.setsUpServices ? services : []),\n ...(capabilities.canReadAudit ? audit : []),\n ];\n}\n\n/** Project creation exists before a grantable resource, so it follows the instance role and its scope (`makesProjects`). */\nexport function RootAdminOnly({\n capabilities,\n children,\n}: {\n capabilities: UiCapabilities;\n children: ReactNode;\n}): ReactNode {\n return capabilities.canCreateProject ? children : null;\n}\n\n/** Empty project copy must distinguish an empty instance from archived-only state. */\nexport function ProjectEmptyStateCopy({\n capabilities,\n hasArchivedProjects,\n}: {\n capabilities: UiCapabilities;\n hasArchivedProjects: boolean;\n}): ReactNode {\n if (hasArchivedProjects) {\n return capabilities.canCreateProject\n ? 'No active projects. Start a new one, or restore one from the archive below.'\n : 'No active projects. Your archived projects appear below.';\n }\n\n if (capabilities.canCreateProject) {\n return 'No projects exist yet. Start the first one with New project.';\n }\n\n return createElement(\n Fragment,\n null,\n 'No project is visible to you. Someone holding ',\n createElement('span', { className: 'mono' }, 'grant.manage'),\n ' on a project can add you.',\n );\n}\n\n/** Reveal- and history-shaped controls require secret.read in this environment. */\nexport function SecretReadOnly({\n canReveal,\n children,\n}: {\n canReveal: boolean;\n children: ReactNode;\n}): ReactNode {\n return canReveal ? children : null;\n}\n"],"mappings":";;;AAgBA,SAAgB,oBAAoB,EAClC,cACA,OACA,UACA,SACyC;CACzC,OAAO,cACL,UACA,MACA,GAAG,sBAAsB,cAAc;EAAE,OAAO,CAAC,KAAK;EAAG,UAAU,CAAC,QAAQ;EAAG,OAAO,CAAC,KAAK;CAAE,CAAC,CACjG;AACF;;AAGA,SAAgB,sBACd,cACA,EAAE,OAAO,UAAU,SACd;CACL,OAAO;EACL,GAAI,aAAa,kBAAkB,QAAQ,CAAC;EAE5C,GAAI,aAAa,mBAAmB,aAAa,iBAAiB,WAAW,CAAC;EAC9E,GAAI,aAAa,eAAe,QAAQ,CAAC;CAC3C;AACF;;AAGA,SAAgB,cAAc,EAC5B,cACA,YAIY;CACZ,OAAO,aAAa,mBAAmB,WAAW;AACpD;;AAGA,SAAgB,sBAAsB,EACpC,cACA,uBAIY;CACZ,IAAI,qBACF,OAAO,aAAa,mBAChB,gFACA;CAGN,IAAI,aAAa,kBACf,OAAO;CAGT,OAAO,cACL,UACA,MACA,kDACA,cAAc,QAAQ,EAAE,WAAW,OAAO,GAAG,cAAc,GAC3D,4BACF;AACF;;AAGA,SAAgB,eAAe,EAC7B,WACA,YAIY;CACZ,OAAO,YAAY,WAAW;AAChC"}