@parallelworks/ui 0.19.0 → 0.19.1

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 (217) hide show
  1. package/dist/{chunks/memoryStore-CC91S5LP.js → ai/adapter/memoryStore.js} +2 -2
  2. package/dist/ai/adapter/mock/index.js +2 -80
  3. package/dist/ai/adapter/mock/mockAdapter.js +81 -0
  4. package/dist/ai/adapter/openai/createOpenAIStream.js +33 -0
  5. package/dist/ai/adapter/openai/errors.js +37 -0
  6. package/dist/ai/adapter/openai/index.js +5 -333
  7. package/dist/ai/adapter/openai/openaiAdapter.js +54 -0
  8. package/dist/ai/adapter/openai/responses.js +108 -0
  9. package/dist/ai/adapter/openai/sse.js +112 -0
  10. package/dist/{chunks/types-Yy0NrerF.js → ai/adapter/types.js} +1 -1
  11. package/dist/ai/agent/classifier.js +12 -0
  12. package/dist/ai/agent/diff.js +223 -0
  13. package/dist/ai/agent/diffHighlight.js +101 -0
  14. package/dist/ai/agent/permissions.js +29 -0
  15. package/dist/ai/agent/toolfmt.js +383 -0
  16. package/dist/ai/agent/transcript.js +127 -0
  17. package/dist/ai/components/AllocationSelector.js +56 -0
  18. package/dist/ai/components/AttachmentManager.js +144 -0
  19. package/dist/ai/components/AttachmentUpload.js +179 -0
  20. package/dist/ai/components/BlockedGroupBanner.js +29 -0
  21. package/dist/ai/components/BranchNavigator.js +57 -0
  22. package/dist/ai/components/ChatEmptyState.js +171 -0
  23. package/dist/ai/components/ChatInput.js +265 -0
  24. package/dist/ai/components/ChatLayout.js +15 -0
  25. package/dist/ai/components/ChatMessage.js +338 -0
  26. package/dist/ai/components/ChatMessageList.js +301 -0
  27. package/dist/ai/components/ChatSidebar.js +345 -0
  28. package/dist/ai/components/ChatThread.js +198 -0
  29. package/dist/ai/components/ComposerChrome.js +50 -0
  30. package/dist/ai/components/ComposerFrame.js +33 -0
  31. package/dist/ai/components/DragOverlay.js +20 -0
  32. package/dist/ai/components/ModelSelector.js +343 -0
  33. package/dist/ai/components/ShareDialog.js +260 -0
  34. package/dist/ai/components/SlashMenu.js +91 -0
  35. package/dist/ai/components/agent/ActivityLine.js +151 -0
  36. package/dist/ai/components/agent/AgentMessageParts.js +721 -0
  37. package/dist/ai/components/agent/PermissionPicker.js +38 -0
  38. package/dist/ai/components/attachmentKeys.js +10 -0
  39. package/dist/ai/core/ChatProvider.js +848 -0
  40. package/dist/ai/core/KeyboardShortcutsProvider.js +9 -0
  41. package/dist/ai/core/chatReducer.js +223 -0
  42. package/dist/ai/core/config.js +45 -0
  43. package/dist/ai/core/events.js +4 -0
  44. package/dist/ai/core/exportConversation.js +42 -0
  45. package/dist/ai/core/greeting.js +38 -0
  46. package/dist/ai/core/parts.js +84 -0
  47. package/dist/ai/core/useDragDrop.js +36 -0
  48. package/dist/ai/core/useKeyboardShortcuts.js +77 -0
  49. package/dist/ai/core/useSSEStream.js +98 -0
  50. package/dist/ai/index.js +43 -6644
  51. package/dist/ai/strings.js +175 -0
  52. package/dist/ai/ui/Avatar.js +35 -0
  53. package/dist/ai/ui/Dropdown.js +110 -0
  54. package/dist/ai/ui/Markdown.js +79 -0
  55. package/dist/ai/ui/Notice.js +77 -0
  56. package/dist/ai/ui/codeBreaks.js +36 -0
  57. package/dist/ai/ui/prose.js +13 -0
  58. package/dist/ai/ui/sidebar.js +148 -0
  59. package/dist/ai/utils.js +23 -0
  60. package/dist/components/AddMenu.js +46 -0
  61. package/dist/components/Avatar.js +46 -0
  62. package/dist/{chunks/BareModal-BtRiQezg.js → components/BareModal.js} +1 -1
  63. package/dist/components/Breadcrumbs.js +83 -0
  64. package/dist/components/Button.js +83 -0
  65. package/dist/components/Callout.js +23 -0
  66. package/dist/components/Card.js +31 -0
  67. package/dist/components/CollapsiblePanel.js +77 -0
  68. package/dist/{chunks/ConfirmModal-aOR4O1QE.js → components/ConfirmModal.js} +4 -9
  69. package/dist/components/CopyToClipboard.js +81 -0
  70. package/dist/{chunks/Markdown-CM-FenNE.js → components/CreateModal.js} +9 -116
  71. package/dist/components/DescriptionList.js +42 -0
  72. package/dist/components/Dropdown.js +349 -0
  73. package/dist/components/EmptyState.js +27 -0
  74. package/dist/components/Filter.js +32 -0
  75. package/dist/components/FilterPill.js +13 -0
  76. package/dist/components/IconButton.js +34 -0
  77. package/dist/{chunks/Indicator-hBSIxOPK.js → components/Indicator.js} +1 -1
  78. package/dist/components/Input.js +88 -0
  79. package/dist/components/LetterBadge.js +13 -0
  80. package/dist/components/Listbox.js +123 -0
  81. package/dist/{chunks/Loader-BXoXTZGc.js → components/Loader.js} +1 -1
  82. package/dist/components/Markdown.js +15 -0
  83. package/dist/components/MultiSelect.js +171 -0
  84. package/dist/components/Overview.js +39 -0
  85. package/dist/components/PageHeader.js +194 -0
  86. package/dist/components/Pagination.js +35 -0
  87. package/dist/{chunks/Provider-CDYurraE.js → components/Provider.js} +1 -1
  88. package/dist/{chunks/RequiredMark-DfLdYbYZ.js → components/RequiredMark.js} +1 -1
  89. package/dist/components/SectionHeader.js +11 -0
  90. package/dist/components/SettingModeOption.js +30 -0
  91. package/dist/components/SettingRow.js +35 -0
  92. package/dist/components/SettingsCard.js +31 -0
  93. package/dist/components/SettingsGroup.js +17 -0
  94. package/dist/components/Sort.js +42 -0
  95. package/dist/components/StatusBadge.js +63 -0
  96. package/dist/components/SwitchToggle.js +59 -0
  97. package/dist/{chunks/SwitchToggleSmall-FcsaYSTs.js → components/SwitchToggleSmall.js} +1 -1
  98. package/dist/{chunks/Table-DU2MW8xz.js → components/Table.js} +3 -3
  99. package/dist/components/Toggle.js +20 -0
  100. package/dist/{chunks/Tooltip-K5HJr4_p.js → components/Tooltip.js} +2 -27
  101. package/dist/{chunks/StatusBadge-C1Blx_cW.js → components/dropdownUtils.js} +2 -63
  102. package/dist/{chunks/focus-D_iZJTW1.js → components/focus.js} +1 -1
  103. package/dist/components/ghostButton.js +7 -0
  104. package/dist/components/inputClasses.js +4 -0
  105. package/dist/components/keys.js +27 -0
  106. package/dist/components/relativeTime.js +32 -0
  107. package/dist/{chunks/useCssIsDark-DHr05dG2.js → components/useCssIsDark.js} +1 -1
  108. package/dist/{chunks/duration-BOv8Phl8.js → duration.js} +1 -1
  109. package/dist/editor/Editor.js +13 -0
  110. package/dist/editor/EditorField.js +53 -0
  111. package/dist/editor/FormCodePanel.js +173 -0
  112. package/dist/{chunks/Monaco-DJ8MW-Dq.js → editor/Monaco.js} +4 -2
  113. package/dist/editor/index.js +6 -1
  114. package/dist/editor/themes.js +91 -0
  115. package/dist/editor/workers.js +29 -0
  116. package/dist/editor/yaml.js +15 -0
  117. package/dist/file-explorer/FileExplorer.js +1402 -0
  118. package/dist/file-explorer/FileExplorerContext.js +370 -0
  119. package/dist/{chunks/CodePreviewEditor-YqQBz1YL.js → file-explorer/FilePreview/CodePreviewEditor.js} +3 -2
  120. package/dist/file-explorer/FilePreview/Inline.js +45 -0
  121. package/dist/file-explorer/FilePreview/StreamedBadge.js +16 -0
  122. package/dist/file-explorer/FilePreview/Viewer.js +526 -0
  123. package/dist/file-explorer/FilePreview/index.js +266 -0
  124. package/dist/file-explorer/FilePreview/parse.js +63 -0
  125. package/dist/file-explorer/FilePreview/previewCache.js +98 -0
  126. package/dist/file-explorer/FilePreview/previewType.js +151 -0
  127. package/dist/file-explorer/FilePreview/readCappedBytes.js +196 -0
  128. package/dist/file-explorer/FilePreview/useObjectBlobUrl.js +95 -0
  129. package/dist/file-explorer/FilePreview/useObjectText.js +109 -0
  130. package/dist/file-explorer/FilePreview/usePresignedUrl.js +73 -0
  131. package/dist/file-explorer/FileRow.js +165 -0
  132. package/dist/file-explorer/FileRowsWindow.js +92 -0
  133. package/dist/file-explorer/FileTable.js +172 -0
  134. package/dist/file-explorer/FileTableHeaders.js +49 -0
  135. package/dist/file-explorer/LoadMoreRow.js +46 -0
  136. package/dist/file-explorer/TreeView.js +376 -0
  137. package/dist/file-explorer/helpers.js +537 -0
  138. package/dist/file-explorer/index.js +7 -5671
  139. package/dist/file-explorer/lib/batch.js +39 -0
  140. package/dist/file-explorer/lib/errors.js +9 -0
  141. package/dist/file-explorer/lib/paging.js +124 -0
  142. package/dist/file-explorer/lib/utils.js +322 -0
  143. package/dist/file-explorer/toasts.js +400 -0
  144. package/dist/file-explorer/treeRows.js +73 -0
  145. package/dist/file-explorer/useNearEnd.js +27 -0
  146. package/dist/form/FieldWrapper.js +54 -0
  147. package/dist/form/Fields/BooleanField.js +51 -0
  148. package/dist/form/Fields/CheckboxGroupField.js +72 -0
  149. package/dist/form/Fields/ColorField.js +33 -0
  150. package/dist/form/Fields/DropdownField.js +49 -0
  151. package/dist/form/Fields/DurationField.js +130 -0
  152. package/dist/form/Fields/LabelField.js +19 -0
  153. package/dist/form/Fields/MultiDropdownField.js +40 -0
  154. package/dist/form/Fields/NumberField.js +51 -0
  155. package/dist/form/Fields/ObjectField.js +54 -0
  156. package/dist/form/Fields/RadioField.js +49 -0
  157. package/dist/form/Fields/RangeField.js +58 -0
  158. package/dist/form/Fields/ResourceOptionIcon.js +21 -0
  159. package/dist/form/Fields/StepField.js +6 -0
  160. package/dist/form/Fields/StringField.js +37 -0
  161. package/dist/form/Fields/TextAreaField.js +31 -0
  162. package/dist/form/Fields/durationValidity.js +11 -0
  163. package/dist/form/Form.js +643 -0
  164. package/dist/form/SpecialTypes/DropdownWrapper.js +30 -0
  165. package/dist/form/SpecialTypes/FormikCustomDropdown.js +122 -0
  166. package/dist/form/SpecialTypes/FormikCustomInput.js +111 -0
  167. package/dist/form/SpecialTypes/FormikMultiSelectDropdown.js +31 -0
  168. package/dist/form/SpecialTypes/FormikNumericInput.js +60 -0
  169. package/dist/form/Wizard/WizardContainer.js +138 -0
  170. package/dist/form/Wizard/WizardNavigation.js +92 -0
  171. package/dist/form/Wizard/WizardStepContent.js +35 -0
  172. package/dist/form/Wizard/WizardStepIndicator.js +108 -0
  173. package/dist/form/Wizard/useWizardState.js +118 -0
  174. package/dist/form/Wizard/utils.js +34 -0
  175. package/dist/form/fieldContext.js +26 -0
  176. package/dist/form/fieldRegistry.js +50 -0
  177. package/dist/form/index.js +17 -2321
  178. package/dist/{chunks/FieldWrapper-Cszwg-4B.js → form/lib.js} +2 -97
  179. package/dist/form/useParsedOpts.js +62 -0
  180. package/dist/form/usePrevious.js +11 -0
  181. package/dist/form/utils/checkShowIfObject.js +14 -0
  182. package/dist/form/utils/duration.js +69 -0
  183. package/dist/form/utils/getParentValue.js +23 -0
  184. package/dist/form/utils/getPlaceholder.js +9 -0
  185. package/dist/form/utils/getValueUsingPath.js +23 -0
  186. package/dist/form/utils/secondaryField.js +22 -0
  187. package/dist/graph/AnnotationBanner.js +141 -0
  188. package/dist/graph/Collapse.js +41 -0
  189. package/dist/graph/DependencyGraph.js +1398 -0
  190. package/dist/graph/JobSummary.js +104 -0
  191. package/dist/graph/MatrixGroup.js +107 -0
  192. package/dist/graph/Reveal.js +57 -0
  193. package/dist/graph/TreeView.js +711 -0
  194. package/dist/graph/index.js +1 -2519
  195. package/dist/graph/types.js +6 -0
  196. package/dist/index.js +46 -599
  197. package/dist/list/ActionToolbar.js +184 -0
  198. package/dist/list/HoverCard.js +73 -0
  199. package/dist/list/ListPage.js +145 -0
  200. package/dist/list/ListPager.js +59 -0
  201. package/dist/list/ListTable.js +163 -0
  202. package/dist/list/ListViewControls.js +372 -0
  203. package/dist/list/RowContextMenu.js +350 -0
  204. package/dist/list/UserHoverCard.js +117 -0
  205. package/dist/list/index.js +11 -2
  206. package/dist/list/listSearch.js +137 -0
  207. package/dist/list/listView.js +210 -0
  208. package/dist/list/textEntry.js +10 -0
  209. package/dist/{chunks/logviewer-BTKuQWzw.js → logviewer/LogViewer.js} +4 -82
  210. package/dist/logviewer/index.js +2 -1
  211. package/dist/logviewer/segments.js +80 -0
  212. package/package.json +1 -1
  213. package/dist/chunks/PageHeader-0kG_iypP.js +0 -692
  214. package/dist/chunks/SwitchToggle-DShNdcao.js +0 -758
  215. package/dist/chunks/editor-Dk1rbV75.js +0 -361
  216. package/dist/chunks/list-CJm875m7.js +0 -1418
  217. /package/dist/{chunks/MarkdownImpl-CyeTVvSt.js → components/MarkdownImpl.js} +0 -0
@@ -0,0 +1,6 @@
1
+ //#region src/graph/types.ts
2
+ function isJobRecord(value) {
3
+ return typeof value === "object" && value !== null;
4
+ }
5
+ //#endregion
6
+ export { isJobRecord };
package/dist/index.js CHANGED
@@ -1,601 +1,48 @@
1
- import { a as useOptionalWorkflowEngine, c as useRunFile, d as useWorkflowEngine, f as useWorkflowEngineLoader, i as useNotify, l as useSlots, n as useLink, o as usePersistedState, r as useNavigation, s as useProvisionCorsRules, t as UIProvider, u as useStrings } from "./chunks/Provider-CDYurraE.js";
2
- import { AlertIcon, AngleRightIcon, EyeIcon, EyeOffIcon, FilterIcon, LoaderIcon, SortDownIcon, SortUnsortedIcon, SortUpIcon } from "./icons.js";
3
- import { a as truncationTooltipProps, i as formatTooltipContent, n as TOOLTIP_ID, r as TooltipInfo, t as GlobalTooltip } from "./chunks/Tooltip-K5HJr4_p.js";
4
- import { C as useSetDefaultBreadcrumbs, E as AddMenu, S as useSetBreadcrumbs, T as avatarInitials, a as HeaderAddButton, b as useClearBreadcrumbs, c as PageHeader, i as HeaderActionMenu, l as headerActionButtonClasses, n as BreadcrumbsRightAction, o as HeaderEditButton, r as BreadcrumbsTitleAction, s as HeaderRowMenu, t as BreadcrumbsActionButton, v as BreadcrumbProvider, w as Avatar, x as useHideBreadcrumbs, y as useBreadcrumb } from "./chunks/PageHeader-0kG_iypP.js";
5
- import { n as modalPanelClasses, t as BareModal } from "./chunks/BareModal-BtRiQezg.js";
6
- import { a as CreateModalField, c as CreateModalTextarea, d as Callout, i as CreateModalAutocompleteField, l as CopyCodeBlock, n as CREATE_MODAL_SELECT_FILTER_THRESHOLD, o as CreateModalSelect, r as CreateModal, s as CreateModalSwitch, t as Markdown, u as CopyToClipboard } from "./chunks/Markdown-CM-FenNE.js";
7
- import { a as Dropdown, c as UncontrolledCollapsiblePanel, i as CustomListbox, n as SectionHeader, o as ControlledCollapsiblePanel, r as MultiSelectDropdown, s as MaybeCollapsible, t as SwitchToggle } from "./chunks/SwitchToggle-DShNdcao.js";
8
- import { i as primaryButtonClasses, n as dangerButtonClasses, r as ghostButtonClasses, t as ConfirmModal } from "./chunks/ConfirmModal-aOR4O1QE.js";
9
- import { a as filterOption, c as isCategory, i as DropdownCaret, l as isOption, n as StatusDot, r as statusTextClass, s as flattenOptions, t as StatusBadge, u as toggleSetMember } from "./chunks/StatusBadge-C1Blx_cW.js";
10
- import { t as Indicator } from "./chunks/Indicator-hBSIxOPK.js";
11
- import { t as RequiredMark } from "./chunks/RequiredMark-DfLdYbYZ.js";
12
- import { t as Loader } from "./chunks/Loader-BXoXTZGc.js";
13
- import { t as SwitchToggleSmall } from "./chunks/SwitchToggleSmall-FcsaYSTs.js";
14
- import { n as Table, t as CompactTable } from "./chunks/Table-DU2MW8xz.js";
15
- import { t as useCssIsDark } from "./chunks/useCssIsDark-DHr05dG2.js";
1
+ import { UIProvider, useNavigation, useNotify, useOptionalWorkflowEngine, usePersistedState, useProvisionCorsRules, useRunFile, useSlots, useStrings, useWorkflowEngine, useWorkflowEngineLoader } from "./components/Provider.js";
2
+ import { GlobalTooltip, TOOLTIP_ID, TooltipInfo, formatTooltipContent, truncationTooltipProps } from "./components/Tooltip.js";
3
+ import { AddMenu } from "./components/AddMenu.js";
4
+ import { Avatar, avatarInitials } from "./components/Avatar.js";
5
+ import { BareModal, modalPanelClasses } from "./components/BareModal.js";
6
+ import { BreadcrumbProvider, useBreadcrumb, useClearBreadcrumbs, useHideBreadcrumbs, useSetBreadcrumbs, useSetDefaultBreadcrumbs } from "./components/Breadcrumbs.js";
7
+ import { Button, MethodButton } from "./components/Button.js";
8
+ import Callout from "./components/Callout.js";
9
+ import { Card, CardHeader } from "./components/Card.js";
10
+ import { ControlledCollapsiblePanel, MaybeCollapsible, UncontrolledCollapsiblePanel } from "./components/CollapsiblePanel.js";
11
+ import { dangerButtonClasses, ghostButtonClasses, primaryButtonClasses } from "./components/ghostButton.js";
12
+ import { ConfirmModal } from "./components/ConfirmModal.js";
13
+ import CopyToClipboard, { CopyCodeBlock } from "./components/CopyToClipboard.js";
14
+ import { DropdownCaret, filterOption, flattenOptions, isCategory, isOption, toggleSetMember } from "./components/dropdownUtils.js";
15
+ import { CREATE_MODAL_SELECT_FILTER_THRESHOLD, CreateModal, CreateModalAutocompleteField, CreateModalField, CreateModalSelect, CreateModalSwitch, CreateModalTextarea } from "./components/CreateModal.js";
16
+ import DescriptionList, { DescriptionListItem } from "./components/DescriptionList.js";
17
+ import Dropdown from "./components/Dropdown.js";
18
+ import EmptyState from "./components/EmptyState.js";
19
+ import Filter from "./components/Filter.js";
20
+ import { FilterPill } from "./components/FilterPill.js";
21
+ import { IconButton } from "./components/IconButton.js";
22
+ import { Indicator } from "./components/Indicator.js";
23
+ import { RequiredMark } from "./components/RequiredMark.js";
24
+ import { Input, Textarea } from "./components/Input.js";
25
+ import { inputClasses } from "./components/inputClasses.js";
26
+ import { LetterBadge } from "./components/LetterBadge.js";
27
+ import CustomListbox from "./components/Listbox.js";
28
+ import Loader from "./components/Loader.js";
29
+ import Markdown from "./components/Markdown.js";
30
+ import MultiSelectDropdown from "./components/MultiSelect.js";
31
+ import { Overview } from "./components/Overview.js";
32
+ import { BreadcrumbsActionButton, BreadcrumbsRightAction, BreadcrumbsTitleAction, HeaderActionMenu, HeaderAddButton, HeaderEditButton, HeaderRowMenu, PageHeader, headerActionButtonClasses } from "./components/PageHeader.js";
33
+ import { Pagination } from "./components/Pagination.js";
34
+ import { useRelativeTime } from "./components/relativeTime.js";
35
+ import SectionHeader from "./components/SectionHeader.js";
36
+ import { SettingModeOption } from "./components/SettingModeOption.js";
37
+ import { SettingRow, SettingSection } from "./components/SettingRow.js";
38
+ import SettingsCard from "./components/SettingsCard.js";
39
+ import SettingsGroup from "./components/SettingsGroup.js";
40
+ import Sort from "./components/Sort.js";
41
+ import { StatusBadge, StatusDot, statusTextClass } from "./components/StatusBadge.js";
42
+ import SwitchToggle from "./components/SwitchToggle.js";
43
+ import SwitchToggleSmall from "./components/SwitchToggleSmall.js";
44
+ import { CompactTable, Table } from "./components/Table.js";
45
+ import { Toggle } from "./components/Toggle.js";
46
+ import { useCssIsDark } from "./components/useCssIsDark.js";
16
47
  import { DEFAULT_PRESET, THEME_PRESETS, THEME_TOKENS, applyTheme, contrastRatio, deriveTheme, isDarkColor } from "./theme/index.js";
17
- import cx from "classnames";
18
- import React, { forwardRef, useEffect, useId, useState } from "react";
19
- import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
20
- import Skeleton from "react-loading-skeleton";
21
- import { DateTime } from "luxon";
22
- //#region src/components/Button.tsx
23
- var Button = forwardRef(({ children, variant = "primary", size = "default", loading, icon, iconPosition = "right", fullWidth = true, className = "", disabled, ...props }, ref) => {
24
- const baseClasses = "inline-flex items-center justify-center gap-2 font-semibold rounded-lg transition-all duration-200 cursor-pointer border-none mt-2 disabled:opacity-50 disabled:cursor-not-allowed";
25
- const variantClasses = {
26
- primary: "bg-gradient-to-br from-[var(--gradient-start,var(--theme-element))] to-[var(--gradient-mid,var(--theme-link))] text-white shadow-[0_4px_14px_0_rgba(59,130,246,0.3)] hover:enabled:-translate-y-0.5 hover:enabled:shadow-[0_6px_20px_0_rgba(59,130,246,0.4)] active:enabled:translate-y-0",
27
- secondary: "bg-[var(--theme-muted-panel-bg)] text-[var(--theme-app)] border border-[var(--theme-border)] hover:enabled:bg-[var(--theme-border)]",
28
- outline: "bg-transparent text-[var(--theme-app)] border border-[var(--theme-border)] hover:enabled:bg-[var(--theme-muted-panel-bg)] hover:enabled:border-[var(--theme-muted-text-color)]",
29
- ghost: "bg-transparent text-[var(--theme-muted-text-color)] hover:enabled:text-[var(--theme-app)] hover:enabled:bg-[var(--theme-muted-panel-bg)]"
30
- };
31
- const sizeClasses = {
32
- sm: "py-2 px-4 text-[0.8125rem]",
33
- default: "py-3 px-5 text-sm",
34
- lg: "py-4 px-6 text-base"
35
- };
36
- const widthClass = fullWidth ? "w-full" : "w-auto";
37
- return /* @__PURE__ */ jsx("button", {
38
- ref,
39
- type: "button",
40
- disabled: disabled || loading,
41
- className: cx(baseClasses, variantClasses[variant], sizeClasses[size], widthClass, className),
42
- ...props,
43
- children: loading ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(LoaderIcon, { className: "size-[18px]" }), children] }) : /* @__PURE__ */ jsxs(Fragment$1, { children: [
44
- icon && iconPosition === "left" && /* @__PURE__ */ jsx("span", {
45
- className: "flex items-center",
46
- children: icon
47
- }),
48
- children,
49
- icon && iconPosition === "right" && /* @__PURE__ */ jsx("span", {
50
- className: "flex items-center",
51
- children: icon
52
- })
53
- ] })
54
- });
55
- });
56
- Button.displayName = "Button";
57
- function MethodButton({ icon, label, description, href, loading, disabled, className = "", ...props }) {
58
- const Link = useLink();
59
- const baseClasses = "flex items-center w-full p-4 bg-[var(--theme-muted-panel-bg)] border border-[var(--theme-border)] rounded-xl text-[var(--theme-app)] text-[0.9375rem] font-medium cursor-pointer transition-all duration-200 no-underline mb-3 last:mb-0 hover:bg-[var(--theme-border)] hover:border-[var(--theme-muted-text-color)] hover:-translate-y-0.5 active:translate-y-0";
60
- const disabledClasses = "disabled:opacity-60 disabled:cursor-not-allowed disabled:hover:bg-[var(--ds-muted)] disabled:hover:border-[var(--ds-border)] disabled:hover:translate-y-0";
61
- const content = /* @__PURE__ */ jsxs(Fragment$1, { children: [
62
- icon && /* @__PURE__ */ jsx("span", {
63
- className: "size-10 rounded-lg bg-gradient-to-br from-[var(--gradient-start,var(--theme-element))] to-[var(--gradient-mid,var(--theme-link))] flex items-center justify-center shrink-0 mr-4 [&_svg]:size-5 [&_svg]:text-white",
64
- children: icon
65
- }),
66
- /* @__PURE__ */ jsxs("span", {
67
- className: "flex-1 text-left",
68
- children: [/* @__PURE__ */ jsx("span", {
69
- className: "block font-semibold text-[var(--theme-app)]",
70
- children: label
71
- }), description && /* @__PURE__ */ jsx("span", {
72
- className: "block text-[0.8125rem] text-[var(--theme-muted-text-color)] font-normal mt-0.5",
73
- children: description
74
- })]
75
- }),
76
- loading ? /* @__PURE__ */ jsx(LoaderIcon, { className: "size-5 text-[var(--theme-muted-text-color)] shrink-0 ml-2" }) : /* @__PURE__ */ jsx(AngleRightIcon, { className: "size-5 text-[var(--theme-muted-text-color)] shrink-0 ml-2 transition-all duration-200 group-hover:translate-x-[3px] group-hover:text-[var(--theme-app)]" })
77
- ] });
78
- if (href) {
79
- if (href.startsWith("/api/") || href.startsWith("http")) return /* @__PURE__ */ jsx("a", {
80
- href,
81
- className: cx("group", baseClasses, className),
82
- children: content
83
- });
84
- return /* @__PURE__ */ jsx(Link, {
85
- to: href,
86
- className: cx("group", baseClasses, className),
87
- children: content
88
- });
89
- }
90
- return /* @__PURE__ */ jsx("button", {
91
- type: "button",
92
- className: cx("group", baseClasses, disabledClasses, className),
93
- disabled: disabled || loading,
94
- ...props,
95
- children: content
96
- });
97
- }
98
- //#endregion
99
- //#region src/components/Card.tsx
100
- function Card({ children, className = "", wide, compact, interactive, authShadow }) {
101
- return /* @__PURE__ */ jsx("div", {
102
- className: cx("w-full bg-[var(--theme-card-bg)] backdrop-blur-xl border border-[var(--theme-border)] rounded-2xl", authShadow ? "shadow-[var(--theme-auth-shadow)]" : "shadow-[var(--theme-shadow)]", wide && "max-w-[560px] p-8", compact && "max-w-[400px] p-6", !wide && !compact && "max-w-[520px] p-10", interactive && "ds-card-interactive cursor-pointer", className),
103
- children
104
- });
105
- }
106
- function CardHeader({ badge, title, description, className = "", align = "center" }) {
107
- return /* @__PURE__ */ jsxs("div", {
108
- className: cx(align === "center" ? "text-center" : "text-left", "mb-6", className),
109
- children: [
110
- badge && /* @__PURE__ */ jsx("div", {
111
- className: "inline-flex items-center gap-1.5 py-1.5 px-3 text-xs font-medium bg-[var(--theme-muted-panel-bg)] border border-[var(--theme-border)] rounded-full text-[var(--theme-muted-text-color)] mb-4 transition-colors duration-200",
112
- children: badge
113
- }),
114
- /* @__PURE__ */ jsx("h1", {
115
- className: "text-2xl font-bold tracking-tight text-[var(--theme-app)]",
116
- style: { letterSpacing: "-0.025em" },
117
- children: title
118
- }),
119
- description && /* @__PURE__ */ jsx("p", {
120
- className: "text-[var(--theme-muted-text-color)] text-sm leading-relaxed mt-2",
121
- children: description
122
- })
123
- ]
124
- });
125
- }
126
- //#endregion
127
- //#region src/components/DescriptionList.tsx
128
- function DescriptionListItem({ label, children, tooltip, className, ...props }) {
129
- return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs("dt", {
130
- className: cx("text-[13px] leading-6 col-span-1 font-normal flex gap-1", className),
131
- children: [/* @__PURE__ */ jsx("span", {
132
- className: "min-w-0 truncate",
133
- children: label
134
- }), tooltip && /* @__PURE__ */ jsx(TooltipInfo, {
135
- className: "pr-2",
136
- text: tooltip
137
- })]
138
- }), /* @__PURE__ */ jsx("dd", {
139
- ...props,
140
- className: "flex text-[13px] leading-6 col-span-4 font-light items-center overflow-auto",
141
- children
142
- })] });
143
- }
144
- function DescriptionList({ children, title, separators = true, subtitle, className, wrapperClassName, vertical = false }) {
145
- return /* @__PURE__ */ jsxs("div", {
146
- className: cx("w-full", wrapperClassName),
147
- children: [
148
- title && /* @__PURE__ */ jsx("h2", {
149
- className: "text-sm font-semibold w-full mb-1",
150
- children: title
151
- }),
152
- subtitle && /* @__PURE__ */ jsx("div", {
153
- className: "max-w-2xl text-sm/6 w-full",
154
- children: subtitle
155
- }),
156
- /* @__PURE__ */ jsx("dl", {
157
- className: cx("grid", separators && "*:not-last-of-type:border-b-1", vertical ? "grid-cols-1" : "grid-cols-5 gap-x-4 gap-y-0.5 *:pb-0.5", className),
158
- children: Array.isArray(children) ? React.Children.toArray(children) : children
159
- })
160
- ]
161
- });
162
- }
163
- //#endregion
164
- //#region src/components/EmptyState.tsx
165
- function EmptyState({ title, description, action, icon: Icon }) {
166
- return /* @__PURE__ */ jsxs("div", {
167
- className: "border-solid rounded-2xl border border-(--theme-border) theme-panel flex flex-col items-center justify-center py-12 px-6",
168
- children: [
169
- Icon && /* @__PURE__ */ jsx("div", {
170
- className: "w-10 h-10 rounded-full bg-(--theme-muted-panel-bg) flex items-center justify-center mb-3",
171
- children: /* @__PURE__ */ jsx(Icon, { className: "w-5 h-5 theme-muted-text" })
172
- }),
173
- /* @__PURE__ */ jsx("p", {
174
- className: "text-sm font-medium mb-1",
175
- children: title
176
- }),
177
- description && /* @__PURE__ */ jsx("p", {
178
- className: "text-xs theme-muted-text text-center max-w-xs",
179
- children: description
180
- }),
181
- action && /* @__PURE__ */ jsx("div", {
182
- className: "mt-4",
183
- children: action
184
- })
185
- ]
186
- });
187
- }
188
- //#endregion
189
- //#region src/components/Filter.tsx
190
- function Filter({ filter, setFilter, placeholder = "Filter...", pills, activePill, onPillChange }) {
191
- return /* @__PURE__ */ jsxs("div", {
192
- className: "flex items-center gap-2",
193
- children: [/* @__PURE__ */ jsxs("div", {
194
- className: "relative flex items-center",
195
- children: [/* @__PURE__ */ jsx("input", {
196
- placeholder,
197
- type: "text",
198
- value: filter,
199
- onChange: (e) => setFilter(e.target.value.toLowerCase()),
200
- className: "shadow-sm focus:ring-1 block w-full pr-3 sm:text-sm theme-border rounded-md py-1.5 pl-8"
201
- }), /* @__PURE__ */ jsx("div", {
202
- className: "absolute inset-y-0 left-0 flex py-2.5 pl-2",
203
- children: /* @__PURE__ */ jsx(FilterIcon, {})
204
- })]
205
- }), pills && onPillChange && /* @__PURE__ */ jsx("div", {
206
- className: "flex gap-1",
207
- children: pills.map((pill) => /* @__PURE__ */ jsx("button", {
208
- type: "button",
209
- onClick: () => onPillChange(pill.value),
210
- className: cx("px-2.5 py-1 text-xs rounded-full transition-colors border", activePill === pill.value ? "bg-(--theme-element) text-(--theme-element-text) border-transparent" : "theme-border theme-text hover:theme-hover"),
211
- children: pill.label
212
- }, pill.value))
213
- })]
214
- });
215
- }
216
- //#endregion
217
- //#region src/components/FilterPill.tsx
218
- function FilterPill({ active, onClick, children }) {
219
- return /* @__PURE__ */ jsx("button", {
220
- type: "button",
221
- onClick,
222
- className: cx("px-3 py-1.5 text-xs font-medium rounded-full border transition-all duration-200", active ? "bg-[var(--theme-panel-bg)] border-[var(--theme-border)] text-[var(--theme-panel)] shadow-sm" : "bg-transparent border-transparent text-[var(--theme-muted-text-color)] hover:text-[var(--theme-panel)] hover:bg-[var(--theme-hover)]"),
223
- children
224
- });
225
- }
226
- //#endregion
227
- //#region src/components/IconButton.tsx
228
- var IconButton = forwardRef(({ icon, label, variant = "default", size = "md", active = false, showTooltip = true, className, disabled, ...props }, ref) => {
229
- const sizeClasses = {
230
- sm: "w-7 h-7 [&_svg]:w-3.5 [&_svg]:h-3.5",
231
- md: "w-9 h-9 [&_svg]:w-4 [&_svg]:h-4",
232
- lg: "w-11 h-11 [&_svg]:w-5 [&_svg]:h-5"
233
- };
234
- const variantClasses = {
235
- default: cx("bg-[var(--theme-muted-panel-bg)] text-[var(--theme-muted-text-color)]", "hover:bg-[var(--theme-border)] hover:text-[var(--theme-app)]", active && "bg-[var(--theme-element)]/10 text-[var(--theme-element)]"),
236
- ghost: cx("bg-transparent text-[var(--theme-muted-text-color)]", "hover:bg-[var(--theme-muted-panel-bg)] hover:text-[var(--theme-app)]", active && "text-[var(--theme-element)]"),
237
- primary: cx("bg-[var(--theme-element)] text-white", "hover:bg-[var(--theme-element)]/90", active && "ring-2 ring-[var(--theme-element)]/50"),
238
- success: cx("bg-[#22c55e] text-white", "hover:bg-[#22c55e]/90", active && "ring-2 ring-[#22c55e]/50")
239
- };
240
- return /* @__PURE__ */ jsx("button", {
241
- ref,
242
- type: "button",
243
- "aria-label": label,
244
- disabled,
245
- ...showTooltip ? { "data-tooltip-id": TOOLTIP_ID } : {},
246
- "data-tooltip-content": label,
247
- "data-tooltip-delay-show": 300,
248
- "data-tooltip-class-name": "!bg-[var(--theme-app)] !text-[var(--theme-app-bg)] !text-xs !py-1 !px-2 !rounded-md",
249
- className: cx("inline-flex items-center justify-center rounded-lg", "transition-all duration-200 cursor-pointer", "disabled:opacity-50 disabled:cursor-not-allowed", sizeClasses[size], variantClasses[variant], className),
250
- ...props,
251
- children: icon
252
- });
253
- });
254
- IconButton.displayName = "IconButton";
255
- //#endregion
256
- //#region src/components/Input.tsx
257
- var Input = forwardRef(({ label, error, className = "", mono, type, required, ...props }, ref) => {
258
- const [showPassword, setShowPassword] = useState(false);
259
- const isPassword = type === "password";
260
- const inputType = isPassword && showPassword ? "text" : type;
261
- const generatedId = useId();
262
- const id = props.id ?? generatedId;
263
- const errorId = `${id}-error`;
264
- const describedBy = [props["aria-describedby"], error ? errorId : void 0].filter(Boolean).join(" ") || void 0;
265
- const inputClasses = cx("w-full py-3 px-4 bg-[var(--theme-muted-panel-bg)] border border-[var(--theme-border)] rounded-lg text-[var(--theme-app)] text-sm transition-all duration-200 box-border", "focus:outline-none focus:border-[var(--theme-element)] focus:shadow-[0_0_0_3px_color-mix(in_srgb,var(--theme-element)_25%,transparent)]", "placeholder:text-[var(--theme-muted-text-color)]", "disabled:bg-[var(--theme-muted-panel-bg)] disabled:text-[var(--theme-muted-text-color)] disabled:cursor-not-allowed disabled:opacity-70", mono && "font-mono text-[0.8125rem]", error && "border-[#ef4444]", isPassword && "pr-11", className);
266
- return /* @__PURE__ */ jsxs("div", {
267
- className: "flex flex-col gap-1.5",
268
- children: [
269
- label && /* @__PURE__ */ jsxs("label", {
270
- className: "text-[0.8125rem] font-medium text-[var(--theme-app)]",
271
- htmlFor: id,
272
- children: [label, required && /* @__PURE__ */ jsx(RequiredMark, {})]
273
- }),
274
- /* @__PURE__ */ jsxs("div", {
275
- className: isPassword ? "relative w-full" : "",
276
- children: [/* @__PURE__ */ jsx("input", {
277
- ref,
278
- type: inputType,
279
- className: inputClasses,
280
- ...props,
281
- id,
282
- required,
283
- "aria-invalid": error ? true : props["aria-invalid"],
284
- "aria-describedby": describedBy
285
- }), isPassword && /* @__PURE__ */ jsx("button", {
286
- type: "button",
287
- className: "absolute right-3 top-1/2 -translate-y-1/2 bg-transparent border-none text-[var(--theme-muted-text-color)] cursor-pointer p-1 transition-colors duration-200 flex items-center justify-center hover:text-[var(--theme-app)]",
288
- onClick: () => setShowPassword(!showPassword),
289
- tabIndex: -1,
290
- "aria-label": showPassword ? "Hide password" : "Show password",
291
- children: showPassword ? /* @__PURE__ */ jsx(EyeOffIcon, { className: "w-5 h-5" }) : /* @__PURE__ */ jsx(EyeIcon, { className: "w-5 h-5" })
292
- })]
293
- }),
294
- error && /* @__PURE__ */ jsxs("span", {
295
- id: errorId,
296
- role: "alert",
297
- className: "text-[0.8125rem] text-[#ef4444] flex items-center gap-1.5",
298
- children: [/* @__PURE__ */ jsx(AlertIcon, { className: "w-4 h-4" }), error]
299
- })
300
- ]
301
- });
302
- });
303
- Input.displayName = "Input";
304
- var Textarea = forwardRef(({ label, error, className = "", mono, required, ...props }, ref) => {
305
- const generatedId = useId();
306
- const id = props.id ?? generatedId;
307
- const errorId = `${id}-error`;
308
- const describedBy = [props["aria-describedby"], error ? errorId : void 0].filter(Boolean).join(" ") || void 0;
309
- const textareaClasses = cx("w-full py-3 px-4 bg-[var(--theme-muted-panel-bg)] border border-[var(--theme-border)] rounded-lg text-[var(--theme-app)] text-sm transition-all duration-200 box-border min-h-[140px] resize-y", "focus:outline-none focus:border-[var(--theme-element)] focus:shadow-[0_0_0_3px_color-mix(in_srgb,var(--theme-element)_25%,transparent)]", "placeholder:text-[var(--theme-muted-text-color)]", mono && "font-mono text-[0.8125rem]", error && "border-[#ef4444]", className);
310
- return /* @__PURE__ */ jsxs("div", {
311
- className: "flex flex-col gap-1.5",
312
- children: [
313
- label && /* @__PURE__ */ jsxs("label", {
314
- className: "text-[0.8125rem] font-medium text-[var(--theme-app)]",
315
- htmlFor: id,
316
- children: [label, required && /* @__PURE__ */ jsx(RequiredMark, {})]
317
- }),
318
- /* @__PURE__ */ jsx("textarea", {
319
- ref,
320
- className: textareaClasses,
321
- ...props,
322
- id,
323
- required,
324
- "aria-invalid": error ? true : props["aria-invalid"],
325
- "aria-describedby": describedBy
326
- }),
327
- error && /* @__PURE__ */ jsxs("span", {
328
- id: errorId,
329
- role: "alert",
330
- className: "text-[0.8125rem] text-[#ef4444] flex items-center gap-1.5",
331
- children: [/* @__PURE__ */ jsx(AlertIcon, { className: "w-4 h-4" }), error]
332
- })
333
- ]
334
- });
335
- });
336
- Textarea.displayName = "Textarea";
337
- //#endregion
338
- //#region src/components/inputClasses.ts
339
- var inputClasses = "w-full rounded-md border theme-border bg-(--theme-input-bg) px-3 py-2 text-sm text-(--theme-panel) outline-none focus:ring-2 focus:ring-(--theme-element)";
340
- //#endregion
341
- //#region src/components/LetterBadge.tsx
342
- /** A compact letter badge ("AI", "PUB", "SSH") used as a type mark in place of
343
- * an icon. Size the box and text via className (e.g. "h-5 w-5 text-[8px]"). */
344
- function LetterBadge({ text, className }) {
345
- return /* @__PURE__ */ jsx("span", {
346
- className: cx("inline-flex shrink-0 items-center justify-center rounded-[3px] border theme-border font-bold leading-none tracking-tight text-(--theme-app)", className),
347
- children: text
348
- });
349
- }
350
- //#endregion
351
- //#region src/components/Overview.tsx
352
- function Overview({ Icon, name, type, children, right, className, loading, iconSize = 75 }) {
353
- return /* @__PURE__ */ jsxs("div", {
354
- className: cx("flex items-center w-full", className),
355
- children: [
356
- loading ? /* @__PURE__ */ jsx(Skeleton, {
357
- width: iconSize,
358
- height: iconSize,
359
- circle: true
360
- }) : Icon,
361
- /* @__PURE__ */ jsx("div", {
362
- className: "flex flex-col min-w-0 flex-1",
363
- children: loading ? /* @__PURE__ */ jsx(Skeleton, {
364
- count: 2,
365
- height: 12
366
- }) : /* @__PURE__ */ jsxs(Fragment$1, { children: [
367
- /* @__PURE__ */ jsx("div", {
368
- className: "font-semibold text-xl tracking-tight",
369
- children: name
370
- }),
371
- type && /* @__PURE__ */ jsx("p", { children: type }),
372
- /* @__PURE__ */ jsx("div", {
373
- className: "flex flex-row gap-x-2",
374
- children
375
- })
376
- ] })
377
- }),
378
- right && /* @__PURE__ */ jsx("div", {
379
- className: "shrink-0 self-center",
380
- children: right
381
- })
382
- ]
383
- });
384
- }
385
- //#endregion
386
- //#region src/components/Pagination.tsx
387
- function Pagination({ endingNumber, endingTime, nextCallback, prevCallback, roundedBottom, startingNumber, startingTime, nextDisabled, prevDisabled, name, useTimeRange = false }) {
388
- const t = useStrings().list;
389
- return /* @__PURE__ */ jsxs("nav", {
390
- className: cx(roundedBottom && "rounded-b-2xl", "theme-muted-panel flex items-center justify-between border-t theme-border px-4 py-1 sm:px-6"),
391
- "aria-label": "Pagination",
392
- children: [/* @__PURE__ */ jsx("div", {
393
- className: cx("hidden", (startingNumber !== void 0 && startingNumber !== null && endingNumber !== void 0 && endingNumber !== null || startingTime && endingTime) && "sm:block"),
394
- children: /* @__PURE__ */ jsx("p", {
395
- className: "text-sm whitespace-nowrap",
396
- children: useTimeRange && startingTime && endingTime ? t.paginationShowingTimeRange(name ?? "", startingTime, endingTime) : t.paginationShowing(name ?? "", startingNumber ?? "", endingNumber ?? "")
397
- })
398
- }), /* @__PURE__ */ jsxs("div", {
399
- className: "flex flex-1 justify-between sm:justify-end gap-x-2",
400
- children: [/* @__PURE__ */ jsx("button", {
401
- type: "button",
402
- disabled: prevDisabled,
403
- onClick: prevCallback,
404
- className: cx("link text-sm", prevDisabled && "disabled"),
405
- children: t.paginationPrevious
406
- }), /* @__PURE__ */ jsx("button", {
407
- type: "button",
408
- disabled: nextDisabled,
409
- onClick: nextCallback,
410
- className: cx("link text-sm", nextDisabled && "disabled"),
411
- children: t.paginationNext
412
- })]
413
- })]
414
- });
415
- }
416
- //#endregion
417
- //#region src/components/relativeTime.ts
418
- var TICK_MS = 3e4;
419
- function compactRelativeMinutes(minutes, t) {
420
- if (!Number.isFinite(minutes) || minutes < 1) return t.now;
421
- if (minutes < 60) return t.minutes(minutes);
422
- const hours = Math.floor(minutes / 60);
423
- if (hours < 24) return t.hours(hours);
424
- const days = Math.floor(hours / 24);
425
- if (days < 365) return t.days(days);
426
- return t.years(Math.floor(days / 365));
427
- }
428
- /** A clock that re-reads itself, so "5m" ages while the page sits open, with
429
- * the abbreviated form a row has room for. */
430
- function useRelativeTime() {
431
- const t = useStrings().time;
432
- const [now, setNow] = useState(() => DateTime.now());
433
- useEffect(() => {
434
- const id = setInterval(() => setNow(DateTime.now()), TICK_MS);
435
- return () => clearInterval(id);
436
- }, []);
437
- const compactMinutes = (minutes) => compactRelativeMinutes(minutes, t);
438
- return {
439
- now,
440
- compactMinutes,
441
- compact: (iso) => iso ? compactMinutes(Math.floor(now.diff(DateTime.fromISO(iso)).as("minutes"))) : ""
442
- };
443
- }
444
- //#endregion
445
- //#region src/components/SettingModeOption.tsx
446
- /** A labeled + described radio option row, used inside a SettingsCard to pick
447
- * between modes (e.g. default vs custom). Stacked rows share the card's
448
- * dividers via `isFirst`. */
449
- function SettingModeOption({ name, checked, onSelect, label, description, isFirst, disabled }) {
450
- return /* @__PURE__ */ jsxs("label", {
451
- className: cx("flex items-start gap-3 px-5 py-4", disabled ? "cursor-default opacity-60" : "cursor-pointer", !isFirst && "border-t theme-border"),
452
- children: [/* @__PURE__ */ jsx("input", {
453
- type: "radio",
454
- name,
455
- checked,
456
- onChange: onSelect,
457
- disabled,
458
- className: "mt-0.5 w-4 h-4 theme-input shrink-0"
459
- }), /* @__PURE__ */ jsxs("div", {
460
- className: "min-w-0",
461
- children: [/* @__PURE__ */ jsx("div", {
462
- className: "font-semibold theme-text leading-tight",
463
- children: label
464
- }), /* @__PURE__ */ jsx("div", {
465
- className: "theme-muted-text text-xs leading-snug mt-0.5",
466
- children: description
467
- })]
468
- })]
469
- });
470
- }
471
- //#endregion
472
- //#region src/components/SettingRow.tsx
473
- function SettingRow({ label, htmlFor, helpText, children, isFirst, fill, onClick }) {
474
- return /* @__PURE__ */ jsxs("div", {
475
- role: "none",
476
- onClick,
477
- className: cx("px-5 py-5 grid grid-cols-1 gap-x-8 gap-y-2", fill ? "md:grid-cols-[200px_1fr]" : "md:grid-cols-[1fr_auto]", !isFirst && "border-t theme-border", onClick && "cursor-pointer select-none hover:theme-hover transition-colors"),
478
- children: [/* @__PURE__ */ jsxs("div", {
479
- className: "flex flex-col gap-y-1",
480
- children: [/* @__PURE__ */ jsx("label", {
481
- htmlFor,
482
- className: "font-semibold theme-text leading-tight",
483
- children: label
484
- }), helpText && /* @__PURE__ */ jsx("div", {
485
- className: "theme-muted-text text-xs leading-snug",
486
- children: helpText
487
- })]
488
- }), /* @__PURE__ */ jsx("div", {
489
- className: cx("min-w-0", !fill && "flex items-center justify-end"),
490
- children
491
- })]
492
- });
493
- }
494
- function SettingSection({ title, isFirst }) {
495
- return /* @__PURE__ */ jsx("div", {
496
- className: cx("px-5 py-3 theme-muted-panel", !isFirst && "border-t theme-border"),
497
- children: /* @__PURE__ */ jsx("h2", {
498
- className: "font-semibold text-sm uppercase tracking-wider theme-muted-text",
499
- children: title
500
- })
501
- });
502
- }
503
- //#endregion
504
- //#region src/components/SettingsCard.tsx
505
- /**
506
- * A settings card: an optional sentence-case section label sits above a
507
- * bordered panel of rows. The label carries the breathing-room rhythm between
508
- * cards; the rows inside provide their own dividers via SettingRow's `isFirst`.
509
- */
510
- function SettingsCard({ title, description, action, actionAlign = "adjacent", overflowVisible, children, className }) {
511
- return /* @__PURE__ */ jsxs("section", {
512
- className: cx("mt-10 first:mt-0", className),
513
- children: [(title || action) && /* @__PURE__ */ jsxs("div", {
514
- className: "mb-3 px-0.5",
515
- children: [/* @__PURE__ */ jsxs("div", {
516
- className: cx("flex items-center gap-1.5", actionAlign === "right" && "justify-between"),
517
- children: [title && /* @__PURE__ */ jsx("h2", {
518
- className: "text-[15px] font-semibold theme-text leading-none",
519
- children: title
520
- }), action]
521
- }), description && /* @__PURE__ */ jsx("p", {
522
- className: "text-xs theme-muted-text mt-1.5 leading-snug",
523
- children: description
524
- })]
525
- }), /* @__PURE__ */ jsx("div", {
526
- className: cx("panel", overflowVisible ? "overflow-visible" : "overflow-hidden"),
527
- children
528
- })]
529
- });
530
- }
531
- //#endregion
532
- //#region src/components/SettingsGroup.tsx
533
- function SettingsGroup({ title, children, className }) {
534
- return /* @__PURE__ */ jsxs("div", {
535
- className: cx("mt-8 first:mt-0", className),
536
- children: [title && /* @__PURE__ */ jsx("h2", {
537
- className: "text-[11px] font-semibold uppercase tracking-wider theme-muted-text mb-2 px-1",
538
- children: title
539
- }), /* @__PURE__ */ jsx("div", {
540
- className: "panel divide-y divide-(--theme-border)",
541
- children
542
- })]
543
- });
544
- }
545
- //#endregion
546
- //#region src/components/Sort.tsx
547
- var SortIcon = ({ currentlySorted, currentDirection, name }) => {
548
- const style = { transform: "translateY(2px)" };
549
- if (currentlySorted === name) {
550
- if (currentDirection === "ascending") return /* @__PURE__ */ jsx(SortDownIcon, { style });
551
- else if (currentDirection === "descending") return /* @__PURE__ */ jsx(SortUpIcon, { style });
552
- } else return /* @__PURE__ */ jsx(SortUnsortedIcon, { style });
553
- return null;
554
- };
555
- function Sort({ currentlySorted, name, setCurrentDirection, setCurrentlySorted, currentDirection }) {
556
- const t = useStrings().common;
557
- const sort = (sorted, direction) => {
558
- if (sorted === name) {
559
- if (direction === "ascending") setCurrentDirection("descending");
560
- else if (direction === "descending") {
561
- setCurrentDirection("unsorted");
562
- setCurrentlySorted("");
563
- }
564
- } else {
565
- setCurrentDirection("ascending");
566
- setCurrentlySorted(name);
567
- }
568
- };
569
- return /* @__PURE__ */ jsx("div", {
570
- className: "inline",
571
- children: /* @__PURE__ */ jsx("button", {
572
- type: "button",
573
- "aria-label": t.sort,
574
- onClick: () => sort(currentlySorted, currentDirection),
575
- children: /* @__PURE__ */ jsx(SortIcon, {
576
- currentDirection,
577
- currentlySorted,
578
- name
579
- })
580
- })
581
- });
582
- }
583
- //#endregion
584
- //#region src/components/Toggle.tsx
585
- function Toggle({ checked, onChange, disabled, label }) {
586
- return /* @__PURE__ */ jsxs("label", {
587
- role: "none",
588
- onClick: (e) => e.stopPropagation(),
589
- className: cx("relative inline-flex items-center", disabled ? "cursor-not-allowed opacity-60" : "cursor-pointer"),
590
- children: [/* @__PURE__ */ jsx("input", {
591
- type: "checkbox",
592
- className: "peer sr-only",
593
- checked,
594
- onChange: (e) => onChange(e.target.checked),
595
- disabled,
596
- "aria-label": label
597
- }), /* @__PURE__ */ jsx("div", { className: "h-6 w-11 rounded-full bg-(--theme-muted-panel-bg) transition-colors peer-checked:bg-(--theme-element) peer-focus-visible:ring-2 peer-focus-visible:ring-[color-mix(in_srgb,var(--theme-element)_25%,transparent)] after:absolute after:start-[2px] after:top-[2px] after:h-5 after:w-5 after:rounded-full after:bg-white after:shadow-sm after:transition-transform after:content-[\"\"] motion-reduce:after:transition-none peer-checked:after:translate-x-5" })]
598
- });
599
- }
600
- //#endregion
601
48
  export { AddMenu, Avatar, BareModal, BreadcrumbProvider, BreadcrumbsActionButton, BreadcrumbsRightAction, BreadcrumbsTitleAction, Button, CREATE_MODAL_SELECT_FILTER_THRESHOLD, Callout, Card, CardHeader, CompactTable, ConfirmModal, ControlledCollapsiblePanel, CopyCodeBlock, CopyToClipboard, CreateModal, CreateModalAutocompleteField, CreateModalField, CreateModalSelect, CreateModalSwitch, CreateModalTextarea, CustomListbox, DEFAULT_PRESET, DescriptionList, DescriptionListItem, Dropdown, DropdownCaret, EmptyState, Filter, FilterPill, GlobalTooltip, HeaderActionMenu, HeaderAddButton, HeaderEditButton, HeaderRowMenu, IconButton, Indicator, Input, LetterBadge, Loader, Markdown, MaybeCollapsible, MethodButton, MultiSelectDropdown, Overview, PageHeader, Pagination, RequiredMark, SectionHeader, SettingModeOption, SettingRow, SettingSection, SettingsCard, SettingsGroup, Sort, StatusBadge, StatusDot, SwitchToggle, SwitchToggleSmall, THEME_PRESETS, THEME_TOKENS, TOOLTIP_ID, Table, Textarea, Toggle, TooltipInfo, UIProvider, UncontrolledCollapsiblePanel, applyTheme, avatarInitials, contrastRatio, dangerButtonClasses, deriveTheme, filterOption, flattenOptions, formatTooltipContent, ghostButtonClasses, headerActionButtonClasses, inputClasses, isCategory, isDarkColor, isOption, modalPanelClasses, primaryButtonClasses, statusTextClass, toggleSetMember, truncationTooltipProps, useBreadcrumb, useClearBreadcrumbs, useCssIsDark, useHideBreadcrumbs, useNavigation, useNotify, useOptionalWorkflowEngine, usePersistedState, useProvisionCorsRules, useRelativeTime, useRunFile, useSetBreadcrumbs, useSetDefaultBreadcrumbs, useSlots, useStrings, useWorkflowEngine, useWorkflowEngineLoader };