@crewlethq/ui 0.149.0 → 0.150.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.
- package/dist/AgentHandoffPanel/index.js +11 -11
- package/dist/ArrangeFrame/index.js +2 -2
- package/dist/ArrangeList/index.js +6 -6
- package/dist/ArtifactBar/index.js +4 -4
- package/dist/ArtifactCard/index.js +6 -6
- package/dist/ArtifactPanel/index.js +3 -3
- package/dist/ArtifactRef/index.js +2 -2
- package/dist/AttentionList/index.js +3 -3
- package/dist/AuthLayout/index.js +1 -1
- package/dist/AvatarPicker/index.js +6 -6
- package/dist/BriefCard/index.js +3 -3
- package/dist/CheckGrid/index.js +5 -5
- package/dist/Checkbox/index.js +4 -4
- package/dist/ChipField/index.js +2 -2
- package/dist/ColorField/index.js +4 -4
- package/dist/Combobox/index.js +4 -4
- package/dist/CommandPalette/index.js +6 -6
- package/dist/CommentPin/cursor.d.ts +3 -5
- package/dist/CommentThread/index.js +7 -7
- package/dist/Composer/index.js +4 -4
- package/dist/ConfirmField/index.js +4 -4
- package/dist/DataGrid/index.js +7 -6
- package/dist/DataTable/index.js +7 -7
- package/dist/DataView/index.js +9 -9
- package/dist/DatasetSource/index.js +1 -1
- package/dist/DeepWorkCard/index.js +4 -4
- package/dist/DocTabsEditor/index.js +6 -6
- package/dist/DurationField/DurationField.d.ts +59 -0
- package/dist/DurationField/index.d.ts +3 -0
- package/dist/DurationField/index.js +32 -0
- package/dist/DurationField-TJFIAUMW.css +23 -0
- package/dist/EditingStatus/index.js +2 -2
- package/dist/{Editor-FXREHINI.js → Editor-XAJF2WQ3.js} +4 -4
- package/dist/EmojiPicker/index.js +4 -4
- package/dist/EntityList/index.js +1 -1
- package/dist/HuePicker/index.js +4 -4
- package/dist/InboxList/index.js +2 -2
- package/dist/InlineEditor/index.js +3 -3
- package/dist/InlineRef/index.js +1 -1
- package/dist/{InlineRef-CUBTBIYD.css → InlineRef-EBQZ26KM.css} +6 -0
- package/dist/Input/index.js +3 -3
- package/dist/KeyValueRows/index.js +4 -4
- package/dist/LinkInterstitial/index.js +3 -3
- package/dist/ListInput/index.js +5 -5
- package/dist/MarkdownEditor/index.js +4 -4
- package/dist/MemberPicker/index.js +5 -5
- package/dist/MergeConflicts/index.js +4 -4
- package/dist/MessageActions/index.js +5 -5
- package/dist/Modal/index.js +2 -2
- package/dist/NumberField/NumberField.d.ts +56 -0
- package/dist/NumberField/index.d.ts +3 -0
- package/dist/NumberField/index.js +29 -0
- package/dist/NumberField-G7H4VNZP.css +30 -0
- package/dist/OpenInAppCard/index.js +4 -4
- package/dist/OrgTable/index.js +9 -8
- package/dist/PeopleRail/index.js +2 -2
- package/dist/PresetChips/PresetChips.d.ts +27 -0
- package/dist/PresetChips/index.d.ts +2 -0
- package/dist/PresetChips/index.js +21 -0
- package/dist/PrincipalPicker/index.js +5 -5
- package/dist/ProposalCard/index.js +8 -8
- package/dist/RailList/index.js +4 -4
- package/dist/ReactionBar/index.js +5 -5
- package/dist/ReadingPane/index.js +2 -2
- package/dist/RefusalCard/index.js +1 -1
- package/dist/Reorder/index.js +2 -2
- package/dist/ResultTableCard/index.js +3 -3
- package/dist/RichEditor/index.js +1 -1
- package/dist/RunChip/index.js +1 -1
- package/dist/SegmentedControl/index.js +3 -3
- package/dist/SelectionBar/index.js +2 -2
- package/dist/SettingForm/SettingForm.d.ts +50 -0
- package/dist/SettingForm/index.d.ts +3 -0
- package/dist/SettingForm/index.js +20 -0
- package/dist/SettingForm-ODVZZ7JZ.css +30 -0
- package/dist/SettingsTable/SettingsTable.d.ts +47 -34
- package/dist/SettingsTable/index.d.ts +3 -2
- package/dist/SettingsTable/index.js +3 -1
- package/dist/SettingsTable-KAMWVCQB.css +169 -0
- package/dist/SetupWizard/index.js +4 -4
- package/dist/ShareDialog/index.js +3 -3
- package/dist/SheetColumnEditor/index.js +11 -11
- package/dist/SheetGrid/index.js +3 -3
- package/dist/SidePanel/index.js +2 -2
- package/dist/SlideFilmstrip/index.js +3 -3
- package/dist/StatusCard/index.js +1 -1
- package/dist/Switcher/index.js +5 -5
- package/dist/TableCells/index.js +1 -1
- package/dist/Tabs/index.js +2 -2
- package/dist/TagsInput/index.js +2 -2
- package/dist/ThemeSwitcher/index.js +4 -4
- package/dist/TimeRangePicker/index.js +9 -9
- package/dist/TimeWindowPicker/index.js +4 -4
- package/dist/TreeGrid/index.js +8 -7
- package/dist/ValueField/index.js +5 -5
- package/dist/VersionCompare/index.js +6 -6
- package/dist/{chunk-V67VL3WD.js → chunk-2IOI52YU.js} +1 -1
- package/dist/{chunk-TPABM6DW.js → chunk-2LTJUWCR.js} +2 -2
- package/dist/{chunk-HIDOUXLD.js → chunk-3ZSKFZP3.js} +1 -1
- package/dist/{chunk-X5ZUDJNK.js → chunk-5K7D64VG.js} +1 -1
- package/dist/{chunk-OMVGWZ3V.js → chunk-6DL4HM7T.js} +1 -1
- package/dist/{chunk-TSLXQVBC.js → chunk-6KCQXKFQ.js} +1 -1
- package/dist/{chunk-WAF36OFS.js → chunk-6VSR7TW7.js} +2 -2
- package/dist/{chunk-N3LAAA4R.js → chunk-7NEHBDNS.js} +2 -2
- package/dist/chunk-7TITGQ3A.js +127 -0
- package/dist/{chunk-27NS67UI.js → chunk-ABWPMBMX.js} +1 -1
- package/dist/{chunk-GMXOZEF5.js → chunk-ANXCMHTP.js} +2 -2
- package/dist/{chunk-4DUK2TC4.js → chunk-B4QF35QY.js} +1 -1
- package/dist/{chunk-R2RHSKAT.js → chunk-BC4OVFBQ.js} +1 -1
- package/dist/{chunk-7FY7L6WD.js → chunk-BCOTJM4W.js} +3 -3
- package/dist/chunk-BQMDD2FD.js +224 -0
- package/dist/chunk-C7BK32JK.js +21 -0
- package/dist/{chunk-PW6QXVIX.js → chunk-CFSPFFHJ.js} +3 -3
- package/dist/{chunk-QRUQOITJ.js → chunk-CUU24MKQ.js} +1 -1
- package/dist/{chunk-27ZF7D3C.js → chunk-FWXAPOMM.js} +1 -1
- package/dist/{chunk-7CVV3DQC.js → chunk-GVD7GVPM.js} +1 -1
- package/dist/chunk-HU56GCZ7.js +198 -0
- package/dist/{chunk-N3R2POGO.js → chunk-JGJSCWZY.js} +2 -2
- package/dist/{chunk-YMBXTGFC.js → chunk-K7C4BIX6.js} +1 -1
- package/dist/{chunk-U3ZUZ7VU.js → chunk-KCFF2MBD.js} +4 -4
- package/dist/{chunk-ZNEMXLTY.js → chunk-KY6W76V3.js} +1 -1
- package/dist/{chunk-MUBJN75T.js → chunk-LMWDWGPE.js} +1 -1
- package/dist/{chunk-BRMJPZC4.js → chunk-MALV624H.js} +1 -1
- package/dist/{chunk-O3CY4MHN.js → chunk-MWAQEHAF.js} +3 -2
- package/dist/{chunk-M4VA76JF.js → chunk-NCQBZ7FU.js} +3 -3
- package/dist/{chunk-RUNZWWN6.js → chunk-OESG3U7F.js} +2 -2
- package/dist/{chunk-FCRJAFTU.js → chunk-OIX7B57V.js} +3 -3
- package/dist/{chunk-YRNIPS4M.js → chunk-PMS3TIU2.js} +2 -2
- package/dist/{chunk-RNVPYDRQ.js → chunk-PN6VKDRF.js} +1 -1
- package/dist/{chunk-3SUIU2ZO.js → chunk-PQDMYIEJ.js} +7 -196
- package/dist/chunk-Q5OB4LBX.js +134 -0
- package/dist/{chunk-FYVV6GJN.js → chunk-QNSAFNGT.js} +1 -1
- package/dist/{chunk-Z6OZNSHF.js → chunk-ROE6HKEI.js} +1 -1
- package/dist/{chunk-S4ADDFRT.js → chunk-S7TZH45K.js} +2 -2
- package/dist/{chunk-UPQ4MDPE.js → chunk-SG3XSUJ5.js} +1 -1
- package/dist/{chunk-ZAQ7CEYN.js → chunk-SIM6FR5B.js} +1 -1
- package/dist/{chunk-EDQHZOU3.js → chunk-SM7NURKY.js} +2 -2
- package/dist/{chunk-FMKQSDBQ.js → chunk-SZH7MLBY.js} +1 -1
- package/dist/{chunk-ODN3LSYW.js → chunk-T2457TRX.js} +1 -1
- package/dist/chunk-TYZSARP5.js +53 -0
- package/dist/{chunk-YWPUT6JQ.js → chunk-UH6B2HTX.js} +1 -1
- package/dist/{chunk-Q7RI66TT.js → chunk-VI2ZUOP7.js} +1 -1
- package/dist/{chunk-E3JUS3CR.js → chunk-VZOGZZCA.js} +1 -1
- package/dist/{chunk-5C7MP4C7.js → chunk-VZWRSV4M.js} +1 -1
- package/dist/{chunk-CA62YCFK.js → chunk-WTWYN7Z5.js} +1 -1
- package/dist/{chunk-F6OYNO7O.js → chunk-YLDZ3TXH.js} +1 -1
- package/dist/{chunk-O2J5PSWI.js → chunk-YQHSUUMN.js} +3 -3
- package/dist/{chunk-VARFEAUH.js → chunk-ZEKRJMX5.js} +3 -3
- package/dist/generated/index.d.ts +4 -0
- package/dist/generated/index.js +127 -122
- package/dist/index.js +127 -122
- package/dist/styles.css +173 -88
- package/dist/utils/index.js +1 -1
- package/package.json +3 -3
- package/dist/SettingsTable-MTZJTKA6.css +0 -182
- package/dist/chunk-RTMFZLU3.js +0 -94
- package/dist/{chunk-II7TPQ64.js → chunk-2DASEYUG.js} +0 -0
- package/dist/{chunk-KRF3GQ63.js → chunk-6N53ZWRM.js} +1 -1
- package/dist/{chunk-UMEK5DHS.js → chunk-6VWBIHSJ.js} +1 -1
- package/dist/{chunk-7PK2Z5JY.js → chunk-73XXYQC7.js} +1 -1
- package/dist/{chunk-3OZPHFDT.js → chunk-DHYJNBWC.js} +1 -1
- package/dist/{chunk-3EL3IF3W.js → chunk-DZPT7P2I.js} +1 -1
- package/dist/{chunk-3GWCWUSY.js → chunk-ECYA6XZL.js} +1 -1
- package/dist/{chunk-Z7BA2EVV.js → chunk-EDUK7DD5.js} +1 -1
- package/dist/{chunk-XQMRSL7Z.js → chunk-GTAAOGDQ.js} +2 -2
- package/dist/{chunk-YUW4DD2Z.js → chunk-H5CN7YWD.js} +1 -1
- package/dist/{chunk-7C6NHVMX.js → chunk-HKRNKAHN.js} +1 -1
- package/dist/{chunk-XZ47PWVD.js → chunk-LXPA2SRT.js} +1 -1
- package/dist/{chunk-JMBPMSNI.js → chunk-NIOE6ZAL.js} +1 -1
- package/dist/{chunk-DGB7R42F.js → chunk-PWRYYOQ4.js} +1 -1
- package/dist/{chunk-2DZV4PHK.js → chunk-R76HBPY5.js} +1 -1
- package/dist/{chunk-ZC73GPA3.js → chunk-RJDRNXDB.js} +1 -1
- package/dist/{chunk-W2T7RGH7.js → chunk-UR3UUHPC.js} +1 -1
- package/dist/{chunk-XJU53WMW.js → chunk-V3RQYIZO.js} +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Toolbar } from './chunk-NPEI2QAN.js';
|
|
2
2
|
import { Popover } from './chunk-AJFA2XDQ.js';
|
|
3
|
-
import { Input } from './chunk-
|
|
3
|
+
import { Input } from './chunk-GTAAOGDQ.js';
|
|
4
4
|
import { Tooltip } from './chunk-BFZAGIXR.js';
|
|
5
5
|
import { isComposing } from './chunk-EDPMHSLZ.js';
|
|
6
6
|
import { cx } from './chunk-ODEQTPFM.js';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import { Document } from './chunk-I4PBFJGX.js';
|
|
1
2
|
import { PrincipalAvatar } from './chunk-265IX4YA.js';
|
|
2
3
|
import { toInstant, RelativeTime, formatExact, toISO } from './chunk-GBKBME7Q.js';
|
|
3
|
-
import {
|
|
4
|
-
import { Composer } from './chunk-QRUQOITJ.js';
|
|
5
|
-
import { Button } from './chunk-IMF3CPTY.js';
|
|
6
|
-
import { IconButton } from './chunk-KM5OKCW6.js';
|
|
4
|
+
import { Composer } from './chunk-CUU24MKQ.js';
|
|
7
5
|
import { Count } from './chunk-Y5CMDLQM.js';
|
|
8
6
|
import { useHeadingLevel, headingTag } from './chunk-PQADV6P6.js';
|
|
7
|
+
import { Button } from './chunk-IMF3CPTY.js';
|
|
8
|
+
import { IconButton } from './chunk-KM5OKCW6.js';
|
|
9
9
|
import { cx } from './chunk-ODEQTPFM.js';
|
|
10
10
|
import './CommentThread-YU6VSVS4.css';
|
|
11
11
|
import { useState, useRef, useId, useMemo, useEffect } from 'react';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SegmentedControl } from './chunk-
|
|
1
|
+
import { SegmentedControl } from './chunk-ANXCMHTP.js';
|
|
2
2
|
import { ArtifactIcon } from './chunk-AVL52EME.js';
|
|
3
3
|
import { Menu } from './chunk-ZMZNKDPO.js';
|
|
4
4
|
import { isApplePlatform, Kbd, ariaKeyshortcuts } from './chunk-VBBLHS2Y.js';
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { useTreeState, treeExpandable, treeLevel, treePosInSet, treeSetSize, treeItemAction, treePrevious, treeNext, treeStep } from './chunk-MY374UUD.js';
|
|
2
|
-
import {
|
|
2
|
+
import { fitGridColumns } from './chunk-PQDMYIEJ.js';
|
|
3
|
+
import { GRID_FOOT_LABELS, parseGridSort, overrunning, squeezedCells, tableTrack, GRID_ICON_TRACK, GridHeadCell, alignOf, rowLinkTitle, headerWord, GridFoot, droppedNames, nextGridSort, sortByValue } from './chunk-HU56GCZ7.js';
|
|
3
4
|
import { LayerNodeBridge } from './chunk-CUEPPDBC.js';
|
|
4
|
-
import { Checkbox } from './chunk-
|
|
5
|
+
import { Checkbox } from './chunk-MALV624H.js';
|
|
5
6
|
import { EmptyState } from './chunk-PPUR46MK.js';
|
|
6
7
|
import { useMediaMatch } from './chunk-COS6LJ4K.js';
|
|
7
8
|
import { IconButton } from './chunk-KM5OKCW6.js';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Select } from './chunk-657WR3MX.js';
|
|
2
2
|
import { SHEET_LABELS, SHEET_COLUMN_TYPES, optionHue, retypeColumn } from './chunk-LFSIKGRQ.js';
|
|
3
|
-
import { HueSwatch } from './chunk-
|
|
3
|
+
import { HueSwatch } from './chunk-VZOGZZCA.js';
|
|
4
4
|
import { NODE_HUES, NODE_HUE_NAMES } from './chunk-AYKXMIOR.js';
|
|
5
|
-
import { Checkbox } from './chunk-
|
|
5
|
+
import { Checkbox } from './chunk-MALV624H.js';
|
|
6
|
+
import { FormField, Input } from './chunk-GTAAOGDQ.js';
|
|
6
7
|
import { Menu } from './chunk-ZMZNKDPO.js';
|
|
7
|
-
import { FormField, Input } from './chunk-XQMRSL7Z.js';
|
|
8
8
|
import { Kbd } from './chunk-VBBLHS2Y.js';
|
|
9
9
|
import { Button } from './chunk-IMF3CPTY.js';
|
|
10
10
|
import { IconButton } from './chunk-KM5OKCW6.js';
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Select } from './chunk-657WR3MX.js';
|
|
2
|
-
import { Modal } from './chunk-
|
|
2
|
+
import { Modal } from './chunk-73XXYQC7.js';
|
|
3
3
|
import { CopyButton } from './chunk-IRGS5FEC.js';
|
|
4
4
|
import { Callout } from './chunk-UEO3A76N.js';
|
|
5
5
|
import { PrincipalAvatar } from './chunk-265IX4YA.js';
|
|
6
|
+
import { useHeadingLevel, headingTag } from './chunk-PQADV6P6.js';
|
|
6
7
|
import { useMediaMatch } from './chunk-COS6LJ4K.js';
|
|
7
8
|
import { Button } from './chunk-IMF3CPTY.js';
|
|
8
9
|
import { IconButton } from './chunk-KM5OKCW6.js';
|
|
9
|
-
import { useHeadingLevel, headingTag } from './chunk-PQADV6P6.js';
|
|
10
10
|
import { cx } from './chunk-ODEQTPFM.js';
|
|
11
11
|
import './ShareDialog-72VTMM4K.css';
|
|
12
12
|
import { useState, useId } from 'react';
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { PageHeader } from './chunk-FPDIHEM4.js';
|
|
2
2
|
import { FilterPill } from './chunk-TBOVJ7RL.js';
|
|
3
|
-
import { DataTable } from './chunk-
|
|
3
|
+
import { DataTable } from './chunk-6VSR7TW7.js';
|
|
4
4
|
import { DateTimePicker } from './chunk-7SXCCVUR.js';
|
|
5
5
|
import { useListbox, useOptionKeys } from './chunk-KW7T23RT.js';
|
|
6
6
|
import { Toolbar } from './chunk-NPEI2QAN.js';
|
|
7
7
|
import { Popover } from './chunk-AJFA2XDQ.js';
|
|
8
8
|
import { RelativeTime } from './chunk-GBKBME7Q.js';
|
|
9
|
+
import { Input } from './chunk-GTAAOGDQ.js';
|
|
10
|
+
import { Count } from './chunk-Y5CMDLQM.js';
|
|
9
11
|
import { Menu } from './chunk-ZMZNKDPO.js';
|
|
10
|
-
import { Input } from './chunk-XQMRSL7Z.js';
|
|
11
12
|
import { Kbd } from './chunk-VBBLHS2Y.js';
|
|
12
13
|
import { Button } from './chunk-IMF3CPTY.js';
|
|
13
14
|
import { IconButton } from './chunk-KM5OKCW6.js';
|
|
14
|
-
import { Count } from './chunk-Y5CMDLQM.js';
|
|
15
15
|
import { VisuallyHidden } from './chunk-RRRK2KB6.js';
|
|
16
16
|
import { cx } from './chunk-ODEQTPFM.js';
|
|
17
17
|
import './DataView-L7HLNW7C.css';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Switch } from './chunk-6YYRFGXO.js';
|
|
2
|
-
import { useReorder } from './chunk-
|
|
3
|
-
import { Checkbox } from './chunk-
|
|
2
|
+
import { useReorder } from './chunk-NIOE6ZAL.js';
|
|
3
|
+
import { Checkbox } from './chunk-MALV624H.js';
|
|
4
4
|
import { IconButton } from './chunk-KM5OKCW6.js';
|
|
5
5
|
import { VisuallyHidden } from './chunk-RRRK2KB6.js';
|
|
6
6
|
import { cx } from './chunk-ODEQTPFM.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { normalizeHex, parseColourInput } from './chunk-7W3LYIOC.js';
|
|
2
|
-
import { FormField, Input, InputAffix } from './chunk-
|
|
2
|
+
import { FormField, Input, InputAffix } from './chunk-GTAAOGDQ.js';
|
|
3
3
|
import { cx } from './chunk-ODEQTPFM.js';
|
|
4
4
|
import './ColorField-2OIOWT3Z.css';
|
|
5
5
|
import { useId, useState } from 'react';
|
|
@@ -1,208 +1,19 @@
|
|
|
1
|
+
import { GRID_FOOT_LABELS, GRID_ICON_TRACK, headerWord, sortByValue, parseGridSort, overrunning, tableTrack, GridHeadCell, GridFoot, droppedNames, nextGridSort, rowLinkTitle, squeezedCells, SHORT_COLUMN_PX, alignOf } from './chunk-HU56GCZ7.js';
|
|
2
|
+
import { useReorder } from './chunk-NIOE6ZAL.js';
|
|
1
3
|
import { Skeleton } from './chunk-WFAJYBLX.js';
|
|
2
|
-
import { titleWhenCut
|
|
3
|
-
import {
|
|
4
|
-
import { Checkbox } from './chunk-BRMJPZC4.js';
|
|
4
|
+
import { titleWhenCut } from './chunk-WSIJDWUG.js';
|
|
5
|
+
import { Checkbox } from './chunk-MALV624H.js';
|
|
5
6
|
import { EmptyState } from './chunk-PPUR46MK.js';
|
|
6
7
|
import { useMediaMatch } from './chunk-COS6LJ4K.js';
|
|
7
|
-
import { Button } from './chunk-IMF3CPTY.js';
|
|
8
8
|
import { IconButton } from './chunk-KM5OKCW6.js';
|
|
9
9
|
import { VisuallyHidden } from './chunk-RRRK2KB6.js';
|
|
10
10
|
import { cx } from './chunk-ODEQTPFM.js';
|
|
11
11
|
import './DataGrid-XX6ALDIM.css';
|
|
12
12
|
import { useId, useRef, useState, useMemo, useCallback, useLayoutEffect, useImperativeHandle, useSyncExternalStore, useEffect, Fragment as Fragment$1 } from 'react';
|
|
13
13
|
import { breakpoint } from '@crewlethq/tokens';
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
14
|
+
import { GripVerticalGlyph, ChevronRightGlyph } from '@crewlethq/icons/glyphs';
|
|
15
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
16
16
|
|
|
17
|
-
// src/utils/tableTrack.ts
|
|
18
|
-
var SHORT_COLUMN_PX = 192;
|
|
19
|
-
var SHRINK_SHARE = 0.2;
|
|
20
|
-
function tableTrack({ width, shrink, floor, short }) {
|
|
21
|
-
if (width) return width;
|
|
22
|
-
if (shrink) return `fit-content(${SHRINK_SHARE * 100}%)`;
|
|
23
|
-
if (short) return floor === "max-content" || !floor ? "max-content" : `minmax(${floor}, max-content)`;
|
|
24
|
-
return `minmax(${floor ?? 0}, 1fr)`;
|
|
25
|
-
}
|
|
26
|
-
var GRID_ICON_TRACK = "calc(var(--size-target-min) + var(--spacing-3) * 2)";
|
|
27
|
-
function alignOf(column) {
|
|
28
|
-
return column.align ?? (column.icon ? "center" : "left");
|
|
29
|
-
}
|
|
30
|
-
function headerWord(column) {
|
|
31
|
-
return typeof column.header === "string" ? column.header : "";
|
|
32
|
-
}
|
|
33
|
-
function columnName(column) {
|
|
34
|
-
return headerWord(column) || column.label || column.key;
|
|
35
|
-
}
|
|
36
|
-
function parseGridSort(raw) {
|
|
37
|
-
if (!raw) return null;
|
|
38
|
-
return raw.startsWith("-") ? { key: raw.slice(1), desc: true } : { key: raw, desc: false };
|
|
39
|
-
}
|
|
40
|
-
function nextGridSort(column, sort, defaultSort = "") {
|
|
41
|
-
const chosen = sort === defaultSort ? "" : sort;
|
|
42
|
-
const current2 = parseGridSort(chosen || defaultSort);
|
|
43
|
-
let next;
|
|
44
|
-
if (current2?.key !== column) next = column;
|
|
45
|
-
else if (!current2.desc) next = `-${column}`;
|
|
46
|
-
else next = chosen ? "" : column;
|
|
47
|
-
return next === defaultSort ? "" : next;
|
|
48
|
-
}
|
|
49
|
-
function compare(a, b) {
|
|
50
|
-
if (typeof a === "number" && typeof b === "number") {
|
|
51
|
-
if (Number.isNaN(a)) return Number.isNaN(b) ? 0 : 1;
|
|
52
|
-
if (Number.isNaN(b)) return -1;
|
|
53
|
-
return a < b ? -1 : a > b ? 1 : 0;
|
|
54
|
-
}
|
|
55
|
-
return String(a).localeCompare(String(b), void 0, { numeric: true, sensitivity: "base" });
|
|
56
|
-
}
|
|
57
|
-
function sortByValue(items, get, desc) {
|
|
58
|
-
return [...items].sort((a, b) => {
|
|
59
|
-
const av = get(a);
|
|
60
|
-
const bv = get(b);
|
|
61
|
-
if (av == null && bv == null) return 0;
|
|
62
|
-
if (av == null) return 1;
|
|
63
|
-
if (bv == null) return -1;
|
|
64
|
-
const cmp = compare(av, bv);
|
|
65
|
-
return desc ? -cmp : cmp;
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
var GRID_FOOT_LABELS = {
|
|
69
|
-
hiddenToFit: (names) => `Hidden to fit: ${names}`,
|
|
70
|
-
loadMore: "Load more",
|
|
71
|
-
showEveryColumn: "Show every column",
|
|
72
|
-
and: "and"
|
|
73
|
-
};
|
|
74
|
-
function droppedNames(columns, dropped, and) {
|
|
75
|
-
const names = dropped.map((key) => {
|
|
76
|
-
const c = columns.find((col) => col.key === key);
|
|
77
|
-
return c ? columnName(c) : key;
|
|
78
|
-
});
|
|
79
|
-
return names.length <= 1 ? names[0] ?? "" : `${names.slice(0, -1).join(", ")} ${and} ${names[names.length - 1]}`;
|
|
80
|
-
}
|
|
81
|
-
function GridHeadCell({
|
|
82
|
-
column,
|
|
83
|
-
sort,
|
|
84
|
-
sortable,
|
|
85
|
-
onSort,
|
|
86
|
-
hidden = false,
|
|
87
|
-
colIndex,
|
|
88
|
-
actionsLabel
|
|
89
|
-
}) {
|
|
90
|
-
const align = alignOf(column);
|
|
91
|
-
const sorted = sort?.key === column.key;
|
|
92
|
-
const headClass = cx(
|
|
93
|
-
"crewlet-data-grid__th",
|
|
94
|
-
align !== "left" && `crewlet-data-grid__th--${align}`,
|
|
95
|
-
column.icon && "crewlet-data-grid__th--icon",
|
|
96
|
-
column.shrink && "crewlet-data-grid__th--shrink",
|
|
97
|
-
sorted && "crewlet-data-grid__th--sorted",
|
|
98
|
-
!sortable && "crewlet-data-grid__th--plain"
|
|
99
|
-
);
|
|
100
|
-
const worded = column.header !== "" && column.header !== null && column.header !== void 0;
|
|
101
|
-
const label = !worded ? null : hidden ? /* @__PURE__ */ jsx(VisuallyHidden, { children: column.header }) : /* @__PURE__ */ jsx("span", { className: "crewlet-data-grid__truncate", onMouseEnter: titleWhenCut, children: column.header });
|
|
102
|
-
const arrow = sorted ? sort?.desc ? /* @__PURE__ */ jsx(ArrowDownGlyph, { size: "xs" }) : /* @__PURE__ */ jsx(ArrowUpGlyph, { size: "xs" }) : sortable ? /* @__PURE__ */ jsx(ArrowUpDownGlyph, { size: "xs" }) : null;
|
|
103
|
-
const ariaSort = sorted ? sort?.desc ? "descending" : "ascending" : void 0;
|
|
104
|
-
const mark = arrow && /* @__PURE__ */ jsx("span", { className: "crewlet-data-grid__sort-mark", "aria-hidden": "true", children: arrow });
|
|
105
|
-
if (!sortable) {
|
|
106
|
-
const word = headerWord(column);
|
|
107
|
-
const glyph = !word && !column.action ? column.label : void 0;
|
|
108
|
-
const named = word ? void 0 : glyph ?? (column.action && !worded ? column.label ?? actionsLabel : void 0);
|
|
109
|
-
return /* @__PURE__ */ jsxs("div", { className: headClass, role: "columnheader", "aria-colindex": colIndex, title: glyph, "aria-sort": ariaSort, children: [
|
|
110
|
-
label,
|
|
111
|
-
mark,
|
|
112
|
-
named && /* @__PURE__ */ jsx(VisuallyHidden, { children: named })
|
|
113
|
-
] });
|
|
114
|
-
}
|
|
115
|
-
return /* @__PURE__ */ jsx("div", { className: headClass, role: "columnheader", "aria-colindex": colIndex, "aria-sort": ariaSort, children: /* @__PURE__ */ jsxs(
|
|
116
|
-
"button",
|
|
117
|
-
{
|
|
118
|
-
type: "button",
|
|
119
|
-
className: "crewlet-data-grid__sort",
|
|
120
|
-
onClick: onSort,
|
|
121
|
-
"aria-label": headerWord(column) ? void 0 : column.label,
|
|
122
|
-
children: [
|
|
123
|
-
label,
|
|
124
|
-
mark
|
|
125
|
-
]
|
|
126
|
-
}
|
|
127
|
-
) });
|
|
128
|
-
}
|
|
129
|
-
function GridFoot({ footer, dropped, loadedNote, onLoadMore, onReset, labels, columns }) {
|
|
130
|
-
const shows = Boolean(footer) || Boolean(onLoadMore) || Boolean(loadedNote) || dropped !== "";
|
|
131
|
-
if (!shows && !onReset) return null;
|
|
132
|
-
const table = columns !== void 0;
|
|
133
|
-
const cell = (className, children) => table ? /* @__PURE__ */ jsx("div", { role: "cell", "aria-colspan": columns, className, children }) : /* @__PURE__ */ jsx("div", { className, children });
|
|
134
|
-
return /* @__PURE__ */ jsxs("div", { role: table ? "rowgroup" : void 0, className: "crewlet-data-grid__foot-group", children: [
|
|
135
|
-
shows && /* @__PURE__ */ jsx("div", { role: table ? "row" : void 0, className: "crewlet-data-grid__foot", children: cell(
|
|
136
|
-
"crewlet-data-grid__foot-cell",
|
|
137
|
-
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
138
|
-
footer,
|
|
139
|
-
/* @__PURE__ */ jsx("span", { className: "crewlet-data-grid__foot-spacer", "aria-hidden": "true" }),
|
|
140
|
-
dropped !== "" && /* @__PURE__ */ jsx("span", { className: "crewlet-data-grid__note", children: labels.hiddenToFit(dropped) }),
|
|
141
|
-
loadedNote && /* @__PURE__ */ jsx("span", { className: "crewlet-data-grid__note", children: loadedNote }),
|
|
142
|
-
onLoadMore && /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", onClick: onLoadMore, children: labels.loadMore })
|
|
143
|
-
] })
|
|
144
|
-
) }),
|
|
145
|
-
onReset && /* @__PURE__ */ jsx("div", { role: table ? "row" : void 0, className: "crewlet-data-grid__reset", children: cell(
|
|
146
|
-
"crewlet-data-grid__reset-cell",
|
|
147
|
-
/* @__PURE__ */ jsx("button", { type: "button", className: "crewlet-data-grid__cols-reset", onClick: onReset, children: labels.showEveryColumn })
|
|
148
|
-
) })
|
|
149
|
-
] });
|
|
150
|
-
}
|
|
151
|
-
var CUT = ".crewlet-data-grid__truncate, .crewlet-table-cell__truncate, .crewlet-text--truncate";
|
|
152
|
-
function titleBeneath(link, x, y) {
|
|
153
|
-
const row = link.closest('[role="row"]');
|
|
154
|
-
if (!row || typeof document.elementsFromPoint !== "function") return null;
|
|
155
|
-
const under = document.elementsFromPoint(x, y).find((el) => el !== link && row.contains(el) && el !== row);
|
|
156
|
-
if (!under) return null;
|
|
157
|
-
const titled = under.closest("[title]");
|
|
158
|
-
const own = titled && row.contains(titled) && titled !== row ? titled : null;
|
|
159
|
-
if (own && !own.matches(CUT)) return own.getAttribute("title");
|
|
160
|
-
const cut = under.closest(CUT);
|
|
161
|
-
if (cut && row.contains(cut)) {
|
|
162
|
-
titleIfCut(cut);
|
|
163
|
-
return cut.getAttribute("title");
|
|
164
|
-
}
|
|
165
|
-
return own?.getAttribute("title") ?? null;
|
|
166
|
-
}
|
|
167
|
-
var rowLinkTitle = {
|
|
168
|
-
onMouseMove: (event) => {
|
|
169
|
-
const title = titleBeneath(event.currentTarget, event.clientX, event.clientY);
|
|
170
|
-
if (title) event.currentTarget.setAttribute("title", title);
|
|
171
|
-
else event.currentTarget.removeAttribute("title");
|
|
172
|
-
},
|
|
173
|
-
onMouseLeave: (event) => event.currentTarget.removeAttribute("title")
|
|
174
|
-
};
|
|
175
|
-
var SQUEEZE_SAMPLE_ROWS = 12;
|
|
176
|
-
function overrunning(box, head) {
|
|
177
|
-
const last = head?.lastElementChild;
|
|
178
|
-
if (!last) return false;
|
|
179
|
-
const inner = box.getBoundingClientRect().left + box.clientLeft + box.clientWidth;
|
|
180
|
-
return last.getBoundingClientRect().right > inner + 0.5;
|
|
181
|
-
}
|
|
182
|
-
function cutShort(el) {
|
|
183
|
-
for (const node of [el, ...el.querySelectorAll("*")]) {
|
|
184
|
-
const box = node;
|
|
185
|
-
if (box.clientWidth > 1 && box.scrollWidth > box.clientWidth + 1) return true;
|
|
186
|
-
}
|
|
187
|
-
return false;
|
|
188
|
-
}
|
|
189
|
-
function squeezedCells(width, heads, rows, cellsOf, visible, leading = 0) {
|
|
190
|
-
const cap = width * SHRINK_SHARE - 1;
|
|
191
|
-
const sample = rows.slice(0, SQUEEZE_SAMPLE_ROWS);
|
|
192
|
-
let headCut = false;
|
|
193
|
-
for (let i = 0; i < visible.length; i++) {
|
|
194
|
-
const column = visible[i];
|
|
195
|
-
if (!column.shrink || column.width || column.icon) continue;
|
|
196
|
-
const head = heads[i + leading];
|
|
197
|
-
if (!head || head.getBoundingClientRect().width >= cap) continue;
|
|
198
|
-
if (cutShort(head)) headCut = true;
|
|
199
|
-
for (const row of sample) {
|
|
200
|
-
const cell = cellsOf(row)[i + leading];
|
|
201
|
-
if (cell && cutShort(cell)) return "values";
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
return headCut ? "heads" : null;
|
|
205
|
-
}
|
|
206
17
|
var DATA_GRID_ICON_TRACK = GRID_ICON_TRACK;
|
|
207
18
|
function sortsBy(column) {
|
|
208
19
|
return column.sortable ?? column.sortValue !== void 0;
|
|
@@ -987,4 +798,4 @@ function useAnyDataGridDriving() {
|
|
|
987
798
|
return drivable.length > 0;
|
|
988
799
|
}
|
|
989
800
|
|
|
990
|
-
export { ChooserList, ColumnChooser, DATA_GRID_ICON_TRACK, DataGrid,
|
|
801
|
+
export { ChooserList, ColumnChooser, DATA_GRID_ICON_TRACK, DataGrid, columnChoicesOf, countDataGridRows, fitGridColumns, sortGridRows, useAnyDataGridDriving, useDataGridDriving };
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { PresetChips } from './chunk-C7BK32JK.js';
|
|
2
|
+
import { Input } from './chunk-GTAAOGDQ.js';
|
|
3
|
+
import { useFieldError } from './chunk-JLKO7PSK.js';
|
|
4
|
+
import { IconButton } from './chunk-KM5OKCW6.js';
|
|
5
|
+
import { cx } from './chunk-ODEQTPFM.js';
|
|
6
|
+
import './NumberField-G7H4VNZP.css';
|
|
7
|
+
import { forwardRef, useRef, useImperativeHandle, useEffect } from 'react';
|
|
8
|
+
import { MinusGlyph, PlusGlyph } from '@crewlethq/icons/glyphs';
|
|
9
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
10
|
+
|
|
11
|
+
var NUMBER_FIELD_LABELS = {
|
|
12
|
+
decrease: "Decrease",
|
|
13
|
+
increase: "Increase",
|
|
14
|
+
defaultPreset: (value) => `Default (${value})`,
|
|
15
|
+
presets: "Common values"
|
|
16
|
+
};
|
|
17
|
+
function decimals(step) {
|
|
18
|
+
const text = String(step);
|
|
19
|
+
const at = text.indexOf(".");
|
|
20
|
+
return at === -1 ? 0 : text.length - at - 1;
|
|
21
|
+
}
|
|
22
|
+
function typedNumber(value) {
|
|
23
|
+
const text = value.trim();
|
|
24
|
+
if (!/^-?\d+(\.\d+)?$/.test(text)) return null;
|
|
25
|
+
const n = Number(text);
|
|
26
|
+
return Number.isFinite(n) ? n : null;
|
|
27
|
+
}
|
|
28
|
+
function clamp(n, min, max) {
|
|
29
|
+
if (min !== void 0 && n < min) return min;
|
|
30
|
+
if (max !== void 0 && n > max) return max;
|
|
31
|
+
return n;
|
|
32
|
+
}
|
|
33
|
+
var NumberField = forwardRef(function NumberField2({
|
|
34
|
+
id,
|
|
35
|
+
value,
|
|
36
|
+
onValueChange,
|
|
37
|
+
defaultValue,
|
|
38
|
+
min,
|
|
39
|
+
max,
|
|
40
|
+
step = 1,
|
|
41
|
+
unit,
|
|
42
|
+
presets,
|
|
43
|
+
formatValue,
|
|
44
|
+
error: errorProp,
|
|
45
|
+
disabled = false,
|
|
46
|
+
focusOnMount = false,
|
|
47
|
+
labels: overrides,
|
|
48
|
+
className,
|
|
49
|
+
...aria
|
|
50
|
+
}, ref) {
|
|
51
|
+
const labels = { ...NUMBER_FIELD_LABELS, ...overrides };
|
|
52
|
+
const field = useRef(null);
|
|
53
|
+
useImperativeHandle(ref, () => field.current, []);
|
|
54
|
+
useEffect(() => {
|
|
55
|
+
if (focusOnMount) field.current?.focus();
|
|
56
|
+
}, [focusOnMount]);
|
|
57
|
+
const error = useFieldError(errorProp);
|
|
58
|
+
const typed = typedNumber(value);
|
|
59
|
+
const current = value.trim() === "" ? defaultValue : typed ?? void 0;
|
|
60
|
+
const say = formatValue ?? ((n) => n.toLocaleString());
|
|
61
|
+
const places = decimals(step);
|
|
62
|
+
const stepBy = (times) => {
|
|
63
|
+
const from = current ?? defaultValue ?? min ?? 0;
|
|
64
|
+
const next = clamp(Number((from + times * step).toFixed(places)), min, max);
|
|
65
|
+
onValueChange(String(next));
|
|
66
|
+
};
|
|
67
|
+
const atMin = min !== void 0 && current !== void 0 && current <= min;
|
|
68
|
+
const atMax = max !== void 0 && current !== void 0 && current >= max;
|
|
69
|
+
const keys = (event) => {
|
|
70
|
+
const by = event.key === "ArrowUp" ? 1 : event.key === "ArrowDown" ? -1 : event.key === "PageUp" ? 10 : event.key === "PageDown" ? -10 : 0;
|
|
71
|
+
if (by === 0 || disabled) return;
|
|
72
|
+
event.preventDefault();
|
|
73
|
+
stepBy(by);
|
|
74
|
+
};
|
|
75
|
+
const chips = [
|
|
76
|
+
...defaultValue === void 0 ? [] : [{ value: "", label: labels.defaultPreset(say(defaultValue)) }],
|
|
77
|
+
...presets ?? []
|
|
78
|
+
];
|
|
79
|
+
return /* @__PURE__ */ jsxs("div", { className: cx("crewlet-number-field", className), children: [
|
|
80
|
+
/* @__PURE__ */ jsxs("div", { className: "crewlet-number-field__row", children: [
|
|
81
|
+
/* @__PURE__ */ jsx(
|
|
82
|
+
IconButton,
|
|
83
|
+
{
|
|
84
|
+
size: "md",
|
|
85
|
+
variant: "secondary",
|
|
86
|
+
icon: /* @__PURE__ */ jsx(MinusGlyph, {}),
|
|
87
|
+
label: labels.decrease,
|
|
88
|
+
tabIndex: -1,
|
|
89
|
+
disabled: disabled || atMin,
|
|
90
|
+
onClick: () => stepBy(-1)
|
|
91
|
+
}
|
|
92
|
+
),
|
|
93
|
+
/* @__PURE__ */ jsx(
|
|
94
|
+
Input,
|
|
95
|
+
{
|
|
96
|
+
ref: field,
|
|
97
|
+
id,
|
|
98
|
+
role: "spinbutton",
|
|
99
|
+
value,
|
|
100
|
+
placeholder: defaultValue === void 0 ? void 0 : String(defaultValue),
|
|
101
|
+
inputMode: places > 0 || min !== void 0 && min < 0 ? "decimal" : "numeric",
|
|
102
|
+
autoComplete: "off",
|
|
103
|
+
spellCheck: false,
|
|
104
|
+
disabled,
|
|
105
|
+
error,
|
|
106
|
+
"aria-valuemin": min,
|
|
107
|
+
"aria-valuemax": max,
|
|
108
|
+
"aria-valuenow": current,
|
|
109
|
+
"aria-label": aria["aria-label"],
|
|
110
|
+
"aria-describedby": aria["aria-describedby"],
|
|
111
|
+
trailing: unit === void 0 ? void 0 : /* @__PURE__ */ jsx("span", { className: "crewlet-number-field__unit", children: unit }),
|
|
112
|
+
containerClassName: "crewlet-number-field__input",
|
|
113
|
+
onChange: (event) => onValueChange(event.target.value),
|
|
114
|
+
onKeyDown: keys
|
|
115
|
+
}
|
|
116
|
+
),
|
|
117
|
+
/* @__PURE__ */ jsx(
|
|
118
|
+
IconButton,
|
|
119
|
+
{
|
|
120
|
+
size: "md",
|
|
121
|
+
variant: "secondary",
|
|
122
|
+
icon: /* @__PURE__ */ jsx(PlusGlyph, {}),
|
|
123
|
+
label: labels.increase,
|
|
124
|
+
tabIndex: -1,
|
|
125
|
+
disabled: disabled || atMax,
|
|
126
|
+
onClick: () => stepBy(1)
|
|
127
|
+
}
|
|
128
|
+
)
|
|
129
|
+
] }),
|
|
130
|
+
presets !== void 0 && chips.length > 0 ? /* @__PURE__ */ jsx(PresetChips, { label: labels.presets, options: chips, value: value.trim(), disabled, onPick: onValueChange }) : null
|
|
131
|
+
] });
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
export { NUMBER_FIELD_LABELS, NumberField, typedNumber };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useListbox, useOptionKeys } from './chunk-KW7T23RT.js';
|
|
2
|
-
import { Input } from './chunk-
|
|
2
|
+
import { Input } from './chunk-GTAAOGDQ.js';
|
|
3
3
|
import { HIT_AREA_CLASS } from './chunk-2YTOOH3A.js';
|
|
4
4
|
import { cx } from './chunk-ODEQTPFM.js';
|
|
5
5
|
import './HitArea-QUOS6ZDJ.css';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Timeline } from './chunk-XDUXAQIS.js';
|
|
2
2
|
import { Section } from './chunk-WFCWPXJN.js';
|
|
3
|
-
import { Composer } from './chunk-
|
|
3
|
+
import { Composer } from './chunk-CUU24MKQ.js';
|
|
4
4
|
import { Disclosure } from './chunk-D5O64CVE.js';
|
|
5
|
-
import { ArtifactPanel } from './chunk-
|
|
5
|
+
import { ArtifactPanel } from './chunk-3ZSKFZP3.js';
|
|
6
6
|
import { Button } from './chunk-IMF3CPTY.js';
|
|
7
7
|
import { cx } from './chunk-ODEQTPFM.js';
|
|
8
8
|
import './AgentHandoffPanel-AIU7YWWB.css';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { ConfirmModal } from './chunk-73XXYQC7.js';
|
|
1
2
|
import { InlineCode } from './chunk-W4UJWFCZ.js';
|
|
2
|
-
import { ConfirmModal } from './chunk-7PK2Z5JY.js';
|
|
3
3
|
import { Callout } from './chunk-UEO3A76N.js';
|
|
4
4
|
import './LinkInterstitial-ET4MSVSV.css';
|
|
5
5
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { FormField, Label, Input } from './chunk-
|
|
1
|
+
import { FormField, Label, Input } from './chunk-GTAAOGDQ.js';
|
|
2
|
+
import { announce } from './chunk-WGMKERCR.js';
|
|
2
3
|
import { Button } from './chunk-IMF3CPTY.js';
|
|
3
4
|
import { IconButton } from './chunk-KM5OKCW6.js';
|
|
4
|
-
import { announce } from './chunk-WGMKERCR.js';
|
|
5
5
|
import { cx } from './chunk-ODEQTPFM.js';
|
|
6
6
|
import './KeyValueRows-US5KW7JK.css';
|
|
7
7
|
import { useId, useRef, useEffect } from 'react';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useThemePreference, useDensityPreference } from './chunk-Z24ZUSTX.js';
|
|
2
|
-
import { SegmentedControl } from './chunk-
|
|
2
|
+
import { SegmentedControl } from './chunk-ANXCMHTP.js';
|
|
3
3
|
import { SunGlyph, MonitorGlyph, MoonGlyph } from '@crewlethq/icons/glyphs';
|
|
4
4
|
import { jsx } from 'react/jsx-runtime';
|
|
5
5
|
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { FormField } from './chunk-GTAAOGDQ.js';
|
|
2
|
+
import { Button } from './chunk-IMF3CPTY.js';
|
|
3
|
+
import { cx } from './chunk-ODEQTPFM.js';
|
|
4
|
+
import './SettingForm-ODVZZ7JZ.css';
|
|
5
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
6
|
+
|
|
7
|
+
var SETTING_FORM_LABELS = { save: "Save", cancel: "Cancel" };
|
|
8
|
+
function SettingForm({
|
|
9
|
+
label,
|
|
10
|
+
htmlFor,
|
|
11
|
+
subject,
|
|
12
|
+
children,
|
|
13
|
+
hint,
|
|
14
|
+
error,
|
|
15
|
+
status,
|
|
16
|
+
onSave,
|
|
17
|
+
onCancel,
|
|
18
|
+
saving = false,
|
|
19
|
+
saveHeld,
|
|
20
|
+
saveLabel,
|
|
21
|
+
labels: overrides,
|
|
22
|
+
className,
|
|
23
|
+
...rest
|
|
24
|
+
}) {
|
|
25
|
+
const labels = { ...SETTING_FORM_LABELS, ...overrides };
|
|
26
|
+
const submit = (event) => {
|
|
27
|
+
event.preventDefault();
|
|
28
|
+
if (saving || saveHeld !== void 0) return;
|
|
29
|
+
onSave();
|
|
30
|
+
};
|
|
31
|
+
return /* @__PURE__ */ jsxs("form", { ...rest, noValidate: true, "aria-busy": saving || void 0, className: cx("crewlet-setting-form", className), onSubmit: submit, children: [
|
|
32
|
+
subject ? /* @__PURE__ */ jsx("p", { className: "crewlet-setting-form__subject", children: subject }) : null,
|
|
33
|
+
/* @__PURE__ */ jsx(FormField, { htmlFor, label, helper: hint, error, children }),
|
|
34
|
+
status ? /* @__PURE__ */ jsx("div", { className: "crewlet-setting-form__status", children: status }) : null,
|
|
35
|
+
/* @__PURE__ */ jsxs("div", { className: "crewlet-setting-form__actions", children: [
|
|
36
|
+
/* @__PURE__ */ jsx(Button, { type: "button", size: "small", variant: "ghost", onClick: onCancel, children: labels.cancel }),
|
|
37
|
+
/* @__PURE__ */ jsx(
|
|
38
|
+
Button,
|
|
39
|
+
{
|
|
40
|
+
type: "submit",
|
|
41
|
+
size: "small",
|
|
42
|
+
variant: "primary",
|
|
43
|
+
loading: saving,
|
|
44
|
+
disabledReason: saveHeld,
|
|
45
|
+
tooltip: saveHeld !== void 0,
|
|
46
|
+
children: saveLabel ?? labels.save
|
|
47
|
+
}
|
|
48
|
+
)
|
|
49
|
+
] })
|
|
50
|
+
] });
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export { SETTING_FORM_LABELS, SettingForm };
|
|
@@ -3,7 +3,7 @@ import { PrincipalAvatar } from './chunk-265IX4YA.js';
|
|
|
3
3
|
import { RelativeTime } from './chunk-GBKBME7Q.js';
|
|
4
4
|
import { Card } from './chunk-E7KRB77B.js';
|
|
5
5
|
import { ArtifactKindGround } from './chunk-W3A6NBUM.js';
|
|
6
|
-
import { Checkbox } from './chunk-
|
|
6
|
+
import { Checkbox } from './chunk-MALV624H.js';
|
|
7
7
|
import { ArtifactAccessGlyph } from './chunk-DOY3KC6I.js';
|
|
8
8
|
import { ArtifactKindGlyph } from './chunk-RSKW25Y5.js';
|
|
9
9
|
import { AvatarStack } from './chunk-2PSOUDCS.js';
|
|
@@ -3,7 +3,7 @@ import { ChangeList } from './chunk-NB53SAL4.js';
|
|
|
3
3
|
import { StatusCard } from './chunk-NWKH5FF7.js';
|
|
4
4
|
import { Callout } from './chunk-UEO3A76N.js';
|
|
5
5
|
import { toInstant, formatUntil, useNow, formatExact, toISO } from './chunk-GBKBME7Q.js';
|
|
6
|
-
import { Checkbox } from './chunk-
|
|
6
|
+
import { Checkbox } from './chunk-MALV624H.js';
|
|
7
7
|
import { Disclosure } from './chunk-D5O64CVE.js';
|
|
8
8
|
import { Button } from './chunk-IMF3CPTY.js';
|
|
9
9
|
import { Spinner } from './chunk-XSPCITPN.js';
|