@parallelworks/ui 0.55.0 → 0.56.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 (40) hide show
  1. package/README.md +52 -22
  2. package/dist/access/AccessDrawer.d.ts +30 -19
  3. package/dist/access/AccessDrawer.js +92 -67
  4. package/dist/access/AccessList.d.ts +17 -16
  5. package/dist/access/AccessList.js +218 -114
  6. package/dist/access/GrantView.d.ts +9 -8
  7. package/dist/access/GrantView.js +34 -36
  8. package/dist/access/PrincipalPicker.d.ts +38 -0
  9. package/dist/access/{GroupPicker.js → PrincipalPicker.js} +173 -80
  10. package/dist/access/index.d.ts +1 -1
  11. package/dist/access/model.d.ts +67 -24
  12. package/dist/access/model.js +111 -47
  13. package/dist/access/strings.d.ts +63 -39
  14. package/dist/access/strings.js +114 -84
  15. package/dist/access/types.d.ts +32 -14
  16. package/dist/ai/adapter/mock/mockAdapter.js +1 -1
  17. package/dist/ai/core/useSSEStream.d.ts +1 -1
  18. package/dist/components/Checkbox.js +1 -1
  19. package/dist/components/Combobox.js +25 -20
  20. package/dist/components/DatePicker.js +58 -53
  21. package/dist/components/Drawer.js +3 -1
  22. package/dist/components/HoverCard.js +15 -10
  23. package/dist/components/Menu.js +3 -0
  24. package/dist/components/Modal.js +32 -27
  25. package/dist/components/Popover.js +30 -25
  26. package/dist/components/Radio.js +1 -1
  27. package/dist/components/Select.js +47 -42
  28. package/dist/components/Slider.js +3 -3
  29. package/dist/components/Switch.js +1 -1
  30. package/dist/components/Tooltip.js +16 -11
  31. package/dist/components/fieldBox.js +1 -1
  32. package/dist/components/fullscreen.d.ts +4 -0
  33. package/dist/components/fullscreen.js +18 -0
  34. package/dist/graph/GraphEditorDialogs.d.ts +1 -1
  35. package/dist/styles/theme.css +1 -1
  36. package/dist/styles.css +1 -1
  37. package/dist/theme/derive.d.ts +2 -0
  38. package/dist/theme/derive.js +12 -13
  39. package/package.json +1 -1
  40. package/dist/access/GroupPicker.d.ts +0 -35
@@ -17,6 +17,8 @@ export interface DeriveOptions {
17
17
  /** The surfaces placeholder and disabled text sit on: field boxes, and the bare inputs of
18
18
  * search bars, menus and dialogs that take their surface's background. */
19
19
  export declare const PLACEHOLDER_ON: ThemeToken[];
20
+ /** The surfaces a control's edge sits on: the page, panels, and the control's own fill. */
21
+ export declare const CONTROL_ON: ThemeToken[];
20
22
  /** Every token as sRGB, plus display-p3 overrides that keep every contrast the sRGB output meets. */
21
23
  export declare function generateTheme(scheme: Scheme, options?: DeriveOptions): GeneratedTheme;
22
24
  /** Every `--theme-*` token for a scheme, in sRGB. */
@@ -107,6 +107,13 @@ var PLACEHOLDER_ON = [
107
107
  "--theme-panel-bg",
108
108
  "--theme-muted-panel-bg"
109
109
  ];
110
+ /** The surfaces a control's edge sits on: the page, panels, and the control's own fill. */
111
+ var CONTROL_ON = [
112
+ "--theme-app-bg",
113
+ "--theme-panel-bg",
114
+ "--theme-muted-panel-bg",
115
+ "--theme-input-bg"
116
+ ];
110
117
  /** The roles' targets at a contrast. WCAG AA is the floor at every contrast. */
111
118
  function targets(k) {
112
119
  const at = (wcag, apca) => ({
@@ -146,11 +153,6 @@ function targets(k) {
146
153
  3,
147
154
  4.5
148
155
  ]) },
149
- control: { wcag: byContrast(k, [
150
- 1.6,
151
- 2.2,
152
- 3
153
- ]) },
154
156
  label: { wcag: 4.5 }
155
157
  };
156
158
  }
@@ -310,16 +312,13 @@ function build(scheme, options) {
310
312
  "--theme-muted-panel-bg",
311
313
  "--theme-hover"
312
314
  ], t.secondary);
313
- set("--theme-focus-ring", solved("--theme-focus", accent, [
315
+ const focusOn = [
314
316
  "--theme-app-bg",
315
317
  "--theme-panel-bg",
316
318
  "--theme-input-bg"
317
- ], t.graphic), dark ? .35 : .25);
318
- solved("--theme-border-strong", border, [
319
- "--theme-app-bg",
320
- "--theme-panel-bg",
321
- "--theme-input-bg"
322
- ], t.control);
319
+ ];
320
+ set("--theme-focus-ring", solved("--theme-focus", accent, focusOn, meets(toHex(accent), focusOn.map(hexOf), t.graphic) ? t.graphic : { wcag: t.secondary.wcag }), dark ? .35 : .25);
321
+ solved("--theme-border-strong", border, CONTROL_ON, t.graphic);
323
322
  set("--theme-accent", accent);
324
323
  const white = contrastRatio("#ffffff", toHex(accent)) >= 4.5;
325
324
  set("--theme-accent-hover", {
@@ -571,4 +570,4 @@ function themeStylesheet(selector, scheme, options = {}) {
571
570
  return `${selector} {\n${block(srgb, " ")}\n}\n${wide ? `\n@media (color-gamut: p3) {\n ${selector} {\n${wide}\n }\n}\n` : ""}`;
572
571
  }
573
572
  //#endregion
574
- export { PLACEHOLDER_ON, SIDEBAR_TOKENS, THEME_TOKENS, deriveTheme, generateTheme, themeStylesheet };
573
+ export { CONTROL_ON, PLACEHOLDER_ON, SIDEBAR_TOKENS, THEME_TOKENS, deriveTheme, generateTheme, themeStylesheet };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parallelworks/ui",
3
- "version": "0.55.0",
3
+ "version": "0.56.0",
4
4
  "description": "React UI components: a theme contract, icons, brand logos, primitives, lists, forms, a job graph, a code editor, a log viewer, a file explorer and an AI chat, each on its own subpath",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -1,35 +0,0 @@
1
- import { type AccessModel } from './model.js';
2
- import type { AccessStrings } from './strings.js';
3
- import type { AccessGroup, AccessGroupDetails, AccessRole } from './types.js';
4
- export type DescribeGroup = (groupId: string, signal: AbortSignal) => Promise<AccessGroupDetails>;
5
- export type SearchGroups = (query: string, signal: AbortSignal) => Promise<readonly AccessGroup[]>;
6
- /** Details already loaded, kept for as long as the drawer is open. */
7
- export type DetailsCache = Map<string, AccessGroupDetails>;
8
- export declare function GroupTile({ everyone, className }: {
9
- everyone: boolean;
10
- className?: string;
11
- }): import("react").JSX.Element;
12
- interface GroupPickerProps {
13
- model: AccessModel;
14
- value: readonly string[];
15
- onValueChange: (ids: string[]) => void;
16
- /** The roles being granted, which the details weigh against what the group holds. */
17
- granting: readonly AccessRole[];
18
- resourceName: string;
19
- describeGroup?: DescribeGroup | undefined;
20
- searchGroups?: SearchGroups | undefined;
21
- groupCount?: number | undefined;
22
- recentGroupIds?: readonly string[] | undefined;
23
- cache: DetailsCache;
24
- /** Every group the picker has seen, by id, so a chosen one found by a search keeps its name. */
25
- seen: Map<string, AccessGroup>;
26
- id: string;
27
- describedBy: string;
28
- /** The drawer's body, above its footer, which the open list fills. */
29
- boundary: Element | null;
30
- t: AccessStrings;
31
- }
32
- /** The groups field: everyone pinned first, then recent groups, then all of them; a pane beside
33
- * the list says who is in the highlighted group and what it holds here. */
34
- export declare function GroupPicker({ model, value, onValueChange, granting, resourceName, describeGroup, searchGroups, groupCount, recentGroupIds, cache, seen, id, describedBy, boundary, t, }: GroupPickerProps): import("react").JSX.Element;
35
- export {};