@parallelworks/ui 0.54.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 (50) hide show
  1. package/README.md +65 -26
  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 +62 -58
  21. package/dist/components/Drawer.js +3 -1
  22. package/dist/components/Field.d.ts +8 -3
  23. package/dist/components/Field.js +32 -12
  24. package/dist/components/HoverCard.js +15 -10
  25. package/dist/components/InfoTip.d.ts +3 -1
  26. package/dist/components/InfoTip.js +2 -1
  27. package/dist/components/Menu.js +3 -0
  28. package/dist/components/Modal.js +32 -27
  29. package/dist/components/Popover.d.ts +4 -1
  30. package/dist/components/Popover.js +31 -26
  31. package/dist/components/Radio.js +1 -1
  32. package/dist/components/Select.js +47 -42
  33. package/dist/components/Slider.js +3 -3
  34. package/dist/components/Switch.js +1 -1
  35. package/dist/components/Tooltip.js +16 -11
  36. package/dist/components/fieldBox.js +1 -1
  37. package/dist/components/fullscreen.d.ts +4 -0
  38. package/dist/components/fullscreen.js +18 -0
  39. package/dist/editor/EditorField.js +1 -2
  40. package/dist/editor/Monaco.js +26 -2
  41. package/dist/editor/themes.js +1 -1
  42. package/dist/graph/GraphEditorDialogs.d.ts +1 -1
  43. package/dist/index.d.ts +1 -1
  44. package/dist/index.js +2 -2
  45. package/dist/styles/theme.css +10 -10
  46. package/dist/styles.css +1 -1
  47. package/dist/theme/derive.d.ts +2 -0
  48. package/dist/theme/derive.js +25 -14
  49. package/package.json +2 -2
  50. package/dist/access/GroupPicker.d.ts +0 -35
@@ -6,12 +6,11 @@ import { jsx } from "react/jsx-runtime";
6
6
  //#region src/editor/EditorField.tsx
7
7
  /** A form field that edits its value as code, in the language its `options` name (shell by default). */
8
8
  function EditorField(props) {
9
- const { field, label, disabled, onChange } = props;
9
+ const { field, disabled, onChange } = props;
10
10
  const [value, change] = useFieldValue(field.name ?? "");
11
11
  return /* @__PURE__ */ jsx(Field, {
12
12
  ...fieldFrame(props),
13
13
  children: /* @__PURE__ */ jsx(Editor, {
14
- ariaLabel: label,
15
14
  height: "200px",
16
15
  value: value ?? "",
17
16
  disabled,
@@ -1,5 +1,6 @@
1
1
  import { cx } from "../cx.js";
2
2
  import { useStrings } from "../components/Provider.js";
3
+ import { useFieldLabelledControl } from "../components/Field.js";
3
4
  import { useCssIsDark } from "../components/useCssIsDark.js";
4
5
  import { HOST_MARKER_OWNER, LINT_OWNER } from "./lintOwner.js";
5
6
  import { lintContext, useLintEditing, useLintSources } from "./lintContext.js";
@@ -62,6 +63,7 @@ function minimalEdit(model, from, to) {
62
63
  }
63
64
  function MonacoEditor({ className, disabled, onChange = noop, onValidate = noop, width = "100%", height = "100%", path: pathProp, preserveUndo = false, lint = false, markers, nested, value, language, ...options }) {
64
65
  const { common: t } = useStrings();
66
+ const field = useFieldLabelledControl();
65
67
  const ownPath = `file:///editor/${useId().replace(/[^\w-]/g, "")}`;
66
68
  const path = useRef(pathProp ?? ownPath).current;
67
69
  const isDark = useCssIsDark();
@@ -86,6 +88,7 @@ function MonacoEditor({ className, disabled, onChange = noop, onValidate = noop,
86
88
  markersRef.current = markers;
87
89
  const editorOptions = {
88
90
  ariaLabel: t.codeEditor,
91
+ ...field?.["aria-required"] && { ariaRequired: true },
89
92
  readOnlyMessage: { value: t.readOnlyText },
90
93
  domReadOnly: readOnly,
91
94
  hideCursorInOverviewRuler: readOnly,
@@ -201,9 +204,30 @@ function MonacoEditor({ className, disabled, onChange = noop, onValidate = noop,
201
204
  for (const name of DISABLED_BACKGROUNDS) if (disabled) node?.style.setProperty(name, "var(--theme-input-disabled-bg)");
202
205
  else node?.style.removeProperty(name);
203
206
  }, [disabled]);
207
+ const fieldId = field?.id;
208
+ const labelledBy = field?.["aria-labelledby"];
209
+ const describedBy = field?.["aria-describedby"];
210
+ const invalid = field?.["aria-invalid"];
204
211
  useEffect(() => {
205
- monacoRef.current?.getDomNode()?.querySelector("textarea.inputarea, .native-edit-context")?.setAttribute("aria-readonly", String(readOnly));
206
- }, [readOnly, path]);
212
+ const input = monacoRef.current?.getDomNode()?.querySelector("textarea.inputarea, .native-edit-context");
213
+ if (!input) return;
214
+ input.setAttribute("aria-readonly", String(readOnly));
215
+ const attributes = {
216
+ id: fieldId,
217
+ "aria-labelledby": labelledBy,
218
+ "aria-describedby": describedBy,
219
+ "aria-invalid": invalid && "true"
220
+ };
221
+ for (const [name, value] of Object.entries(attributes)) if (value) input.setAttribute(name, value);
222
+ else input.removeAttribute(name);
223
+ }, [
224
+ readOnly,
225
+ path,
226
+ fieldId,
227
+ labelledBy,
228
+ describedBy,
229
+ invalid
230
+ ]);
207
231
  useEffect(() => {
208
232
  monacoRef.current?.updateOptions(optionsRef.current);
209
233
  }, [optionsKey]);
@@ -66,7 +66,7 @@ function editorTheme(style, mode) {
66
66
  "editor.background": c("--theme-panel-bg"),
67
67
  "editor.border": c("--theme-border"),
68
68
  "editorCursor.foreground": c("--theme-app"),
69
- "editor.lineHighlightBackground": c("--theme-hover"),
69
+ "editor.lineHighlightBackground": c(mode === "dark" ? "--theme-panel-hover" : "--theme-hover"),
70
70
  "editorLineNumber.foreground": c("--theme-placeholder"),
71
71
  "editorLineNumber.activeForeground": c("--theme-muted-text-color"),
72
72
  ...mode === "dark" ? {
@@ -12,7 +12,7 @@ export declare const STEP_FIELDS: readonly ['name', 'run', 'shell', 'uses', 'wit
12
12
  export declare const RETRY_FIELDS: readonly ['max-retries', 'interval', 'timeout', 'clean-on-retry'];
13
13
  interface ViewProps {
14
14
  source?: string | undefined;
15
- /** Adds the job or step being edited; applied with the first save, so cancelling adds nothing. */
15
+ /** Adds the job or step being edited; applied with the first save, so canceling adds nothing. */
16
16
  addition?: GraphEdit | undefined;
17
17
  /** The view to open in; YAML unless the host says form. */
18
18
  view?: SettingsView | undefined;
package/dist/index.d.ts CHANGED
@@ -18,7 +18,7 @@ export { Disclosure, DisclosurePanel, type DisclosureProps } from './components/
18
18
  export { Drawer, type DrawerProps } from './components/Drawer.js';
19
19
  export { EmptyState, type EmptyStateProps } from './components/EmptyState.js';
20
20
  export { ExternalLink, type ExternalLinkProps } from './components/ExternalLink.js';
21
- export { ErrorText, Field, type FieldControlProps, type FieldLayout, FieldOption, type FieldProps, FieldValue, type FieldValueProps, RevealToggle, useFieldControl, } from './components/Field.js';
21
+ export { ErrorText, Field, type FieldControlProps, type FieldLayout, FieldOption, type FieldProps, FieldValue, type FieldValueProps, RevealToggle, useFieldControl, useFieldLabelledControl, } from './components/Field.js';
22
22
  export { type FieldBoxOptions, type FieldBoxSize, fieldBox } from './components/fieldBox.js';
23
23
  export type { FloatingAnchor } from './components/floating.js';
24
24
  export { HoverCard, type HoverCardProps } from './components/HoverCard.js';
package/dist/index.js CHANGED
@@ -28,7 +28,7 @@ import { ExternalLink } from "./components/ExternalLink.js";
28
28
  import { Popover, PopoverClose, useClosePopover } from "./components/Popover.js";
29
29
  import { InfoTip, formatInfoTipContent } from "./components/InfoTip.js";
30
30
  import { RequiredMark } from "./components/RequiredMark.js";
31
- import { ErrorText, Field, FieldOption, FieldValue, RevealToggle, useFieldControl } from "./components/Field.js";
31
+ import { ErrorText, Field, FieldOption, FieldValue, RevealToggle, useFieldControl, useFieldLabelledControl } from "./components/Field.js";
32
32
  import { Input, Textarea } from "./components/Input.js";
33
33
  import { ColorInput } from "./components/ColorInput.js";
34
34
  import { Autocomplete, Combobox } from "./components/Combobox.js";
@@ -72,4 +72,4 @@ import { ThemeEditor, ThemePreview } from "./components/ThemeEditor.js";
72
72
  import { ToggleGroup } from "./components/ToggleGroup.js";
73
73
  import { useCssIsDark } from "./components/useCssIsDark.js";
74
74
  import { useApplyTheme, useColorMode } from "./components/useTheme.js";
75
- export { ActionMenu, AppLink, Autocomplete, Avatar, Button, CODE_STYLES, Callout, Card, CardHeader, Checkbox, CheckboxGroup, ColorInput, Combobox, ConfirmModal, CopyButton, CopyCodeBlock, CreateModal, CreateModalSelect, CreateModalSwitch, DEFAULT_CONTRAST, DEFAULT_PRESET, DEFAULT_THEME, DatePicker, DescriptionList, DescriptionListGroup, DescriptionListItem, Disclosure, DisclosurePanel, Drawer, Elapsed, EmptyState, ErrorText, ExternalLink, Field, FieldOption, FieldValue, HoverCard, IconButton, InfoTip, Input, JND, LetterBadge, Loader, LoadingRegion, Markdown, MenuCheckboxItem, MenuEntries, MenuFilter, MenuGroupLabel, MenuItem, MenuLinkItem, MenuPopup, MenuRadioItem, MenuSeparator, MenuSubmenuTrigger, Meter, MethodButton, Modal, ModalDescription, ModalTitle, NumberInput, OneTimeCodeInput, Overview, PAGE_SIZES, PageHeader, PageHeaderAction, PageHeaderAddButton, PageHeaderBar, PageHeaderMenu, PageHeaderProvider, Pagination, Popover, PopoverClose, ProgressBar, Radio, RadioGroup, RefreshButton, RelativeTime, RequiredMark, RevealToggle, RunStatusIcon, SIDEBAR_TOKENS, SearchInput, Section, SegmentedControl, Select, SettingModeOption, SettingRow, SettingsCard, SettingsHeading, Skeleton, Slider, StatusBadge, StatusDot, Switch, THEME_PRESETS, THEME_TOKENS, TabPanel, Table, Tabs, Textarea, ThemeEditor, ThemePreview, ToggleGroup, Tooltip, TooltipProvider, UIProvider, apcaContrast, applyTheme, avatarInitials, buttonClasses, composite, contrastRatio, cx, deltaE, deriveTheme, fieldBox, fitSeed, formatBytes, formatCount, formatDateTime, formatDuration, formatInfoTipContent, formatTimeLeft, generateTheme, isDarkColor, isPlainClick, isTextEntryContext, levelTone, menuDivider, modalPanelClassName, modeOf, parseColor, parseTheme, prefersWideGamut, resolveMode, runStatusTone, schemeFor, serializeTheme, statusTextClass, themeStylesheet, toHex, toP3, toast, useApplyTheme, useClock, useClosePopover, useColorMode, useContextMenu, useCopy, useCssIsDark, useElapsed, useFieldControl, useNavigation, useOptionalWorkflowEngine, usePersistedState, useProvisionCorsRules, useRelativeTime, useRunFile, useShortcutKey, useSlots, useStrings, useWorkflowActions, useWorkflowEditing, useWorkflowEngine, useWorkflowEngineLoader };
75
+ export { ActionMenu, AppLink, Autocomplete, Avatar, Button, CODE_STYLES, Callout, Card, CardHeader, Checkbox, CheckboxGroup, ColorInput, Combobox, ConfirmModal, CopyButton, CopyCodeBlock, CreateModal, CreateModalSelect, CreateModalSwitch, DEFAULT_CONTRAST, DEFAULT_PRESET, DEFAULT_THEME, DatePicker, DescriptionList, DescriptionListGroup, DescriptionListItem, Disclosure, DisclosurePanel, Drawer, Elapsed, EmptyState, ErrorText, ExternalLink, Field, FieldOption, FieldValue, HoverCard, IconButton, InfoTip, Input, JND, LetterBadge, Loader, LoadingRegion, Markdown, MenuCheckboxItem, MenuEntries, MenuFilter, MenuGroupLabel, MenuItem, MenuLinkItem, MenuPopup, MenuRadioItem, MenuSeparator, MenuSubmenuTrigger, Meter, MethodButton, Modal, ModalDescription, ModalTitle, NumberInput, OneTimeCodeInput, Overview, PAGE_SIZES, PageHeader, PageHeaderAction, PageHeaderAddButton, PageHeaderBar, PageHeaderMenu, PageHeaderProvider, Pagination, Popover, PopoverClose, ProgressBar, Radio, RadioGroup, RefreshButton, RelativeTime, RequiredMark, RevealToggle, RunStatusIcon, SIDEBAR_TOKENS, SearchInput, Section, SegmentedControl, Select, SettingModeOption, SettingRow, SettingsCard, SettingsHeading, Skeleton, Slider, StatusBadge, StatusDot, Switch, THEME_PRESETS, THEME_TOKENS, TabPanel, Table, Tabs, Textarea, ThemeEditor, ThemePreview, ToggleGroup, Tooltip, TooltipProvider, UIProvider, apcaContrast, applyTheme, avatarInitials, buttonClasses, composite, contrastRatio, cx, deltaE, deriveTheme, fieldBox, fitSeed, formatBytes, formatCount, formatDateTime, formatDuration, formatInfoTipContent, formatTimeLeft, generateTheme, isDarkColor, isPlainClick, isTextEntryContext, levelTone, menuDivider, modalPanelClassName, modeOf, parseColor, parseTheme, prefersWideGamut, resolveMode, runStatusTone, schemeFor, serializeTheme, statusTextClass, themeStylesheet, toHex, toP3, toast, useApplyTheme, useClock, useClosePopover, useColorMode, useContextMenu, useCopy, useCssIsDark, useElapsed, useFieldControl, useFieldLabelledControl, useNavigation, useOptionalWorkflowEngine, usePersistedState, useProvisionCorsRules, useRelativeTime, useRunFile, useShortcutKey, useSlots, useStrings, useWorkflowActions, useWorkflowEditing, useWorkflowEngine, useWorkflowEngineLoader };
@@ -15,15 +15,15 @@
15
15
  --theme-panel-bg: light-dark(#fcfeff, #151c25);
16
16
  --theme-panel-hover: light-dark(#f2f5f9, #1e262e);
17
17
  --theme-muted-panel-bg: light-dark(#e7eaee, #1c242c);
18
- --theme-hover: light-dark(#e3e5e9, #1f2730);
18
+ --theme-hover: light-dark(#e3e5e9, #323a43);
19
19
  --theme-input-bg: light-dark(#fafcfe, #182028);
20
20
  --theme-input-disabled-bg: light-dark(#ebeef1, #131a22);
21
- --theme-app: light-dark(#0a101b, #e2eaf3);
22
- --theme-muted-text-color: light-dark(#4e5664, #c1c9d2);
21
+ --theme-app: light-dark(#0a101b, #e9f1fa);
22
+ --theme-muted-text-color: light-dark(#4e5664, #c8d1d9);
23
23
  --theme-placeholder: light-dark(#7e8796, #9da5ad);
24
- --theme-link: light-dark(#06354f, #8dcfff);
24
+ --theme-link: light-dark(#06354f, #9dd7ff);
25
25
  --theme-border: light-dark(#cacdd0, #30363d);
26
- --theme-border-strong: light-dark(#a3a6a9, #4f565d);
26
+ --theme-border-strong: light-dark(#848689, #676e76);
27
27
  --theme-accent: light-dark(#06354f, #5b9ccf);
28
28
  --theme-accent-text: light-dark(#ffffff, #000000);
29
29
  --theme-accent-hover: light-dark(#002841, #6aace0);
@@ -31,23 +31,23 @@
31
31
  --theme-focus: light-dark(#06354f, #5b9ccf);
32
32
  --theme-focus-ring: light-dark(rgba(6, 53, 79, 0.25), rgba(91, 156, 207, 0.35));
33
33
  --theme-success: light-dark(#00973d, #00bf54);
34
- --theme-success-text: light-dark(#006226, #65e387);
34
+ --theme-success-text: light-dark(#006226, #6be88c);
35
35
  --theme-success-solid: #00873c;
36
36
  --theme-success-muted: light-dark(rgba(0, 151, 61, 0.1), rgba(0, 191, 84, 0.15));
37
37
  --theme-error: light-dark(#ea4841, #ff6056);
38
- --theme-error-text: light-dark(#a11a1b, #ffb8af);
38
+ --theme-error-text: light-dark(#a11a1b, #ffc1b8);
39
39
  --theme-error-solid: #db3934;
40
40
  --theme-error-muted: light-dark(rgba(234, 72, 65, 0.1), rgba(255, 96, 86, 0.15));
41
41
  --theme-warning: light-dark(#bd7100, #dd8900);
42
- --theme-warning-text: light-dark(#7b4a00, #ffbe6a);
42
+ --theme-warning-text: light-dark(#7b4a00, #ffc672);
43
43
  --theme-warning-solid: #a76900;
44
44
  --theme-warning-muted: light-dark(rgba(189, 113, 0, 0.1), rgba(221, 137, 0, 0.15));
45
45
  --theme-info: light-dark(#0681f8, #499fff);
46
- --theme-info-text: light-dark(#0050af, #a6cfff);
46
+ --theme-info-text: light-dark(#0050af, #abd4ff);
47
47
  --theme-info-solid: light-dark(#0073e8, #0073e9);
48
48
  --theme-info-muted: light-dark(rgba(6, 129, 248, 0.1), rgba(73, 159, 255, 0.15));
49
49
  --theme-favorite: light-dark(#e7457a, #fe5c8e);
50
- --theme-favorite-text: light-dark(#9e174b, #ffb7c7);
50
+ --theme-favorite-text: light-dark(#9e174b, #ffbecd);
51
51
  --theme-favorite-solid: #d7366e;
52
52
  --theme-favorite-muted: light-dark(rgba(231, 69, 122, 0.1), rgba(254, 92, 142, 0.15));
53
53
  --theme-shadow-sm: 0 1px 2px light-dark(rgba(0, 0, 0, 0.07), rgba(0, 0, 0, 0.35));