@crewlethq/ui 0.148.0 → 0.150.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.
- package/dist/ActivityLine/index.js +3 -3
- package/dist/AgentHandoffPanel/index.js +8 -8
- package/dist/AppShell/index.js +5 -5
- package/dist/ArrangeFrame/index.js +3 -3
- package/dist/ArrangeList/index.js +5 -5
- package/dist/ArtifactBar/index.js +7 -7
- package/dist/ArtifactCard/index.js +6 -6
- package/dist/ArtifactPanel/index.js +4 -4
- package/dist/ArtifactRef/index.js +2 -2
- package/dist/AttentionList/index.js +4 -4
- package/dist/Avatar/index.js +1 -1
- package/dist/{Avatar-HD7YSWDV.css → Avatar-OUKBB6UF.css} +19 -5
- package/dist/AvatarPicker/index.js +8 -8
- package/dist/BriefCard/index.js +3 -3
- package/dist/Button/index.js +2 -2
- package/dist/Callout/index.js +3 -3
- package/dist/Canvas/index.js +4 -4
- package/dist/CanvasBoard/index.js +6 -6
- package/dist/CanvasToolbar/index.js +5 -5
- package/dist/ChangeMark/index.js +2 -2
- package/dist/ChatMessage/index.js +3 -3
- package/dist/ChatThread/index.js +4 -4
- package/dist/CheckGrid/index.js +5 -5
- package/dist/Checkbox/index.js +4 -4
- package/dist/Clamp/index.js +3 -3
- package/dist/CodeBlock/CodeBlock.d.ts +11 -1
- package/dist/CodeBlock/index.js +6 -6
- package/dist/CodeBlock/syntax.d.ts +23 -0
- package/dist/{CodeBlock-LS7H6KUQ.css → CodeBlock-GPNAG43I.css} +34 -0
- package/dist/ColorField/index.js +4 -4
- package/dist/ColorSwatch/index.js +6 -6
- package/dist/Combobox/index.js +4 -4
- package/dist/CommandPalette/index.js +6 -6
- package/dist/CommentThread/index.js +7 -7
- package/dist/Composer/index.js +4 -4
- package/dist/ConfirmField/index.js +4 -4
- package/dist/ConflictNote/index.js +3 -3
- package/dist/ContrastHelp/index.js +3 -3
- package/dist/Copyable/index.js +5 -5
- package/dist/DataGrid/index.js +7 -6
- package/dist/DataTable/index.js +8 -8
- package/dist/DataView/index.js +11 -11
- package/dist/DateTimePicker/index.js +4 -4
- package/dist/DeepWorkCard/index.js +4 -4
- package/dist/DeliveryReceipt/DeliveryReceipt.d.ts +69 -53
- package/dist/DeliveryReceipt/index.js +8 -1
- package/dist/DeliveryReceipt-GTES3RSG.css +90 -0
- package/dist/DocTabsEditor/index.js +6 -6
- package/dist/DownloadButton/index.js +3 -3
- 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/{Editor-PGDR7XMZ.js → Editor-FXREHINI.js} +5 -5
- package/dist/EmojiPicker/index.js +4 -4
- package/dist/EntityChip/index.js +1 -1
- package/dist/ErrorBoundary/index.js +3 -3
- package/dist/FactList/index.js +2 -2
- package/dist/FileDrop/index.js +3 -3
- package/dist/FilterPill/index.js +3 -3
- package/dist/FollowBanner/index.js +5 -5
- package/dist/Fullscreen/index.js +3 -3
- package/dist/GraphCanvas/index.js +6 -6
- package/dist/HuePicker/index.js +7 -7
- package/dist/IconButton/index.js +2 -2
- package/dist/ImageUpload/index.js +1 -1
- package/dist/InlineEditor/index.js +3 -3
- package/dist/InlineRef/index.js +1 -1
- package/dist/{InlineRef-LHU6MH4I.css → InlineRef-CUBTBIYD.css} +2 -1
- package/dist/Input/index.js +3 -3
- package/dist/KeyValueRows/index.js +5 -5
- package/dist/LinkInterstitial/index.js +6 -6
- package/dist/ListDetail/index.js +3 -3
- package/dist/ListInput/index.js +5 -5
- package/dist/LogoSlot/index.js +4 -4
- package/dist/MarkdownEditor/index.js +7 -7
- package/dist/MemberPicker/index.js +5 -5
- package/dist/Menu/index.js +4 -4
- package/dist/MergeConflicts/index.js +7 -7
- package/dist/MessageActions/index.js +5 -5
- package/dist/Modal/index.js +4 -4
- package/dist/NoticeList/index.js +3 -3
- 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/OrgLabel/index.js +1 -1
- package/dist/OrgNode/index.js +1 -1
- package/dist/OrgTable/index.js +10 -9
- package/dist/PeekRail/index.js +4 -4
- package/dist/PeopleRail/index.js +5 -5
- package/dist/PinTile/index.js +3 -3
- package/dist/PresenceStack/index.js +1 -1
- package/dist/PresenterView/index.js +5 -5
- 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/Principal/index.js +1 -1
- package/dist/PrincipalPicker/index.js +6 -6
- package/dist/ProposalCard/index.js +8 -8
- package/dist/RailList/index.js +5 -5
- package/dist/ReactionBar/index.js +5 -5
- package/dist/ReceiptStrip/index.js +3 -3
- package/dist/ResultTableCard/index.js +4 -4
- package/dist/RichEditor/index.js +5 -5
- package/dist/SandboxedFrame/index.js +5 -5
- package/dist/SectionFrame/index.js +4 -4
- package/dist/SegmentedControl/index.js +6 -6
- package/dist/SelectionBar/index.js +3 -3
- package/dist/SendButton/index.js +3 -3
- 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 +7 -5
- package/dist/SettingsTable-KAMWVCQB.css +169 -0
- package/dist/ShareDialog/index.js +9 -9
- package/dist/SheetColumnEditor/index.js +11 -11
- package/dist/SheetGrid/index.js +7 -7
- package/dist/SidePanel/index.js +3 -3
- package/dist/SidebarNav/index.js +3 -3
- package/dist/SlideCompare/index.js +3 -3
- package/dist/SlideFilmstrip/index.js +5 -5
- package/dist/SlideNav/index.js +3 -3
- package/dist/StatusLine/index.js +2 -2
- package/dist/Switcher/index.js +6 -6
- package/dist/TableCells/index.js +1 -1
- package/dist/Tabs/index.js +5 -5
- package/dist/TagsInput/index.js +3 -3
- package/dist/ThemeSwitcher/index.js +7 -7
- package/dist/ThemeToggle/index.js +3 -3
- package/dist/ThreadSummary/index.js +2 -2
- package/dist/TimeRangePicker/index.js +10 -10
- package/dist/TimeWindowPicker/index.js +5 -5
- package/dist/Tooltip/Tooltip.d.ts +8 -1
- package/dist/Tooltip/index.js +1 -1
- package/dist/TreeCanvas/index.js +5 -5
- package/dist/TreeGrid/index.js +8 -7
- package/dist/ValueField/index.js +5 -5
- package/dist/VersionCompare/index.js +7 -7
- package/dist/VersionTimeline/index.js +4 -4
- package/dist/WorkingLine/index.js +2 -2
- package/dist/{chunk-CYRGASHY.js → chunk-27NS67UI.js} +2 -2
- package/dist/{chunk-2RJFKMTX.js → chunk-27ZF7D3C.js} +2 -2
- package/dist/chunk-2EPEVS2M.js +158 -0
- package/dist/{chunk-SPCNQUEU.js → chunk-2PSOUDCS.js} +1 -1
- package/dist/{chunk-IEM64WYC.js → chunk-2QPELDAA.js} +2 -2
- package/dist/{chunk-RG6XQJ74.js → chunk-2W2KAF7D.js} +1 -1
- package/dist/{chunk-CLEQII3E.js → chunk-3EL3IF3W.js} +1 -1
- package/dist/{chunk-2Z5SMA7Q.js → chunk-3OZPHFDT.js} +1 -1
- package/dist/{chunk-BXP6WDKR.js → chunk-3Q5USPLM.js} +2 -2
- package/dist/{chunk-YLOADTDS.js → chunk-3RLOH5AR.js} +1 -1
- package/dist/{chunk-IAER2ZMS.js → chunk-4DUK2TC4.js} +1 -1
- package/dist/{chunk-T7J2U3IN.js → chunk-4LNSURYZ.js} +1 -1
- package/dist/{chunk-WTRAMP4V.js → chunk-5ORAUELE.js} +3 -3
- package/dist/chunk-6QWSGM4W.js +21 -0
- package/dist/{chunk-VXSCGB2L.js → chunk-6RBE5RVG.js} +2 -2
- package/dist/{chunk-7UN7ICUE.js → chunk-733FZXNS.js} +2 -2
- package/dist/{chunk-UOVEN5RY.js → chunk-7C6NHVMX.js} +5 -5
- package/dist/{chunk-RIAEOKY7.js → chunk-7CVV3DQC.js} +1 -1
- package/dist/{chunk-RJZO5NQW.js → chunk-7FY7L6WD.js} +2 -2
- package/dist/{chunk-OU4P4E3U.js → chunk-7J2RIAZ4.js} +1 -1
- package/dist/{chunk-BPCXMQMB.js → chunk-7MAU74EI.js} +1 -1
- package/dist/{chunk-UJETUDIL.js → chunk-7PK2Z5JY.js} +2 -2
- package/dist/{chunk-SSRQLPGT.js → chunk-7SXCCVUR.js} +2 -2
- package/dist/{chunk-RMGAZEEX.js → chunk-7WXLPNZF.js} +1 -1
- package/dist/{chunk-MMJYDMGL.js → chunk-AH7R777J.js} +2 -2
- package/dist/{chunk-5L4ZSNGP.js → chunk-AU4EKD2G.js} +1 -1
- package/dist/{chunk-PDGXQBFS.js → chunk-BFZAGIXR.js} +3 -1
- package/dist/{chunk-QNN4OYLU.js → chunk-BJE7TPO6.js} +2 -2
- package/dist/chunk-BQMDD2FD.js +224 -0
- package/dist/{chunk-TYCICVST.js → chunk-BRMJPZC4.js} +1 -1
- package/dist/{chunk-EZG3SRSM.js → chunk-CA62YCFK.js} +1 -1
- package/dist/{chunk-JXLFC5BX.js → chunk-CC5NUAOF.js} +1 -1
- package/dist/{chunk-74B3HREV.js → chunk-CJGLMT44.js} +1 -1
- package/dist/{chunk-TCQIJ2VO.js → chunk-CRGYWLP6.js} +1 -1
- package/dist/{chunk-2UEMCSVB.js → chunk-CXJMWEZC.js} +1 -1
- package/dist/{chunk-HHCD55D3.js → chunk-D33K2BCZ.js} +1 -1
- package/dist/chunk-DDGHRDGV.js +134 -0
- package/dist/{chunk-SNKLBPXQ.js → chunk-DGB7R42F.js} +1 -1
- package/dist/{chunk-GYVL23ZK.js → chunk-DLYYW77C.js} +1 -1
- package/dist/{chunk-7VE7SOH6.js → chunk-E3JUS3CR.js} +1 -1
- package/dist/{chunk-X2R3GWCB.js → chunk-ECHQLOWI.js} +2 -2
- package/dist/{chunk-QA774VCH.js → chunk-ECYA6XZL.js} +1 -1
- package/dist/{chunk-QDVXEQJC.js → chunk-EDQHZOU3.js} +3 -3
- package/dist/{chunk-HLCQHRHJ.js → chunk-EO64FXVL.js} +1 -1
- package/dist/{chunk-BXGFDSC7.js → chunk-F6OYNO7O.js} +3 -3
- package/dist/{chunk-U62CXJPE.js → chunk-FCRJAFTU.js} +7 -7
- package/dist/{chunk-LO3CTXQI.js → chunk-FMKQSDBQ.js} +3 -3
- package/dist/{chunk-4DJONKYN.js → chunk-FYVV6GJN.js} +1 -1
- package/dist/{chunk-D7XI5DN5.js → chunk-GMXOZEF5.js} +1 -1
- package/dist/{chunk-3HY3KHMR.js → chunk-GR6XGA5V.js} +2 -2
- package/dist/{chunk-R4H352IB.js → chunk-HHTAGV5R.js} +1 -1
- package/dist/{chunk-EVOLZQTB.js → chunk-HIDOUXLD.js} +1 -1
- package/dist/{chunk-CMLRFHBD.js → chunk-HJ6ZY4UX.js} +2 -2
- package/dist/chunk-HU56GCZ7.js +198 -0
- package/dist/{chunk-F37ZBF4D.js → chunk-HYUO2RHC.js} +1 -1
- package/dist/{chunk-QGDQ5YDC.js → chunk-IMF3CPTY.js} +2 -2
- package/dist/{chunk-TRV7VZW6.js → chunk-IRGS5FEC.js} +1 -1
- package/dist/{chunk-P67SLIPX.js → chunk-IRLHICS4.js} +2 -2
- package/dist/{chunk-HDJMTHAP.js → chunk-IZH5DCOQ.js} +1 -1
- package/dist/{chunk-3ZJ6X3ZJ.js → chunk-JD5K6Y7Q.js} +3 -3
- package/dist/{chunk-7R77GFUO.js → chunk-JNDZGQGS.js} +2 -2
- package/dist/{chunk-DJAYXYDZ.js → chunk-KM5OKCW6.js} +2 -2
- package/dist/{chunk-NDZEN2ON.js → chunk-KQUENZR3.js} +1 -1
- package/dist/{chunk-PD3RJT3F.js → chunk-LDSLEEWR.js} +3 -3
- package/dist/{chunk-MCZJ2SD7.js → chunk-LZ3TKYAY.js} +2 -2
- package/dist/{chunk-LDVZYLA6.js → chunk-M2USLODI.js} +2 -2
- package/dist/{chunk-VGAZHT6S.js → chunk-M4VA76JF.js} +6 -6
- package/dist/{chunk-5Y3BFCGM.js → chunk-MUBJN75T.js} +5 -5
- package/dist/{chunk-5B5N4X5H.js → chunk-N3LAAA4R.js} +3 -3
- package/dist/{chunk-RVFSUF7V.js → chunk-N3R2POGO.js} +3 -3
- package/dist/chunk-NG6GEBSJ.js +53 -0
- package/dist/chunk-NZHWGKPW.js +334 -0
- package/dist/{chunk-XIJU47UT.js → chunk-O2J5PSWI.js} +2 -2
- package/dist/{chunk-R75TTEHL.js → chunk-OAD4AXYJ.js} +1 -1
- package/dist/{chunk-ZCA3JNQS.js → chunk-ODN3LSYW.js} +1 -1
- package/dist/{chunk-BKHS6YPM.js → chunk-OMVGWZ3V.js} +1 -1
- package/dist/chunk-OX332RI7.js +127 -0
- package/dist/{chunk-ETVXKUW7.js → chunk-PW6QXVIX.js} +3 -3
- package/dist/{chunk-N37AX25G.js → chunk-Q3SHCEXN.js} +7 -196
- package/dist/{chunk-PGLRFPYY.js → chunk-Q7RI66TT.js} +4 -4
- package/dist/{chunk-FYN2HXEB.js → chunk-QRUQOITJ.js} +1 -1
- package/dist/{chunk-XNTYJAHL.js → chunk-QULAFXL3.js} +1 -1
- package/dist/{chunk-QO76JNSB.js → chunk-R2RHSKAT.js} +3 -3
- package/dist/{chunk-V2K6EHJA.js → chunk-RNVPYDRQ.js} +1 -1
- package/dist/{chunk-QPAUKLNC.js → chunk-RUKSDKG5.js} +4 -3
- package/dist/{chunk-WGSIKYDE.js → chunk-RUNZWWN6.js} +5 -5
- package/dist/{chunk-QNG5MH7P.js → chunk-RXHY5T2Z.js} +2 -2
- package/dist/{chunk-Z3GOZ42N.js → chunk-S4ADDFRT.js} +3 -3
- package/dist/{chunk-EFTWYGN5.js → chunk-TBOVJ7RL.js} +1 -1
- package/dist/{chunk-ZPJX57QO.js → chunk-TPABM6DW.js} +2 -2
- package/dist/{chunk-ACXYNJZR.js → chunk-TSLXQVBC.js} +1 -1
- package/dist/{chunk-WK3OWTOD.js → chunk-TTUFOH2Y.js} +1 -1
- package/dist/{chunk-LHGDKWHV.js → chunk-U3ZUZ7VU.js} +3 -3
- package/dist/{chunk-X4QL7STV.js → chunk-UEO3A76N.js} +1 -1
- package/dist/{chunk-LILN66O3.js → chunk-V4CGY2CI.js} +1 -1
- package/dist/{chunk-PY3PKWAN.js → chunk-V67VL3WD.js} +1 -1
- package/dist/{chunk-JLWCONCZ.js → chunk-VARFEAUH.js} +5 -5
- package/dist/{chunk-OL42IZ6I.js → chunk-VFC7KVCW.js} +1 -1
- package/dist/{chunk-HTWN4IJJ.js → chunk-W2T7RGH7.js} +2 -2
- package/dist/{chunk-3FBJACLW.js → chunk-WAF36OFS.js} +5 -5
- package/dist/{chunk-EILMLMSG.js → chunk-WOHPQEBZ.js} +1 -1
- package/dist/{chunk-QWDTC2UI.js → chunk-WSKVFRKK.js} +1 -1
- package/dist/{chunk-TAOVSH32.js → chunk-X5ZUDJNK.js} +1 -1
- package/dist/{chunk-CNEHTSA5.js → chunk-XJU53WMW.js} +1 -1
- package/dist/{chunk-VGYVCLN4.js → chunk-XQMRSL7Z.js} +1 -1
- package/dist/{chunk-UC4YASMJ.js → chunk-YMBXTGFC.js} +2 -2
- package/dist/{chunk-VWEF6LTZ.js → chunk-YOCTDR2P.js} +1 -1
- package/dist/{chunk-H4OV6SYF.js → chunk-YRNIPS4M.js} +2 -2
- package/dist/{chunk-2BIGA4VD.js → chunk-YWPUT6JQ.js} +2 -2
- package/dist/{chunk-5DYNF5U2.js → chunk-Z6HWOPI7.js} +1 -1
- package/dist/{chunk-DQ3MKG7I.js → chunk-Z6OZNSHF.js} +1 -1
- package/dist/{chunk-PRNJO37A.js → chunk-Z7BA2EVV.js} +2 -2
- package/dist/{chunk-YKM3HCDL.js → chunk-ZAQ7CEYN.js} +2 -2
- package/dist/{chunk-WYO5KDET.js → chunk-ZC73GPA3.js} +1 -1
- package/dist/{chunk-SQHDMVU7.js → chunk-ZFSKRN6D.js} +1 -1
- package/dist/{chunk-4DKECHWE.js → chunk-ZMZNKDPO.js} +4 -4
- package/dist/{chunk-2FAEKL36.js → chunk-ZNEMXLTY.js} +1 -1
- package/dist/generated/index.d.ts +4 -0
- package/dist/generated/index.js +153 -148
- package/dist/index.js +153 -148
- package/dist/styles.css +286 -132
- package/package.json +3 -3
- package/dist/DeliveryReceipt-BILVVNTO.css +0 -64
- package/dist/SettingsTable-MTZJTKA6.css +0 -182
- package/dist/chunk-GTNXDLYH.js +0 -146
- package/dist/chunk-L6E4DVIF.js +0 -131
- package/dist/chunk-TNYRJVKE.js +0 -94
- /package/dist/{chunk-II7TPQ64.js → chunk-2DASEYUG.js} +0 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SegmentedControl } from './chunk-GMXOZEF5.js';
|
|
2
|
+
import { cx } from './chunk-ODEQTPFM.js';
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
function PresetChips({ label, options, value, onPick, disabled = false, className }) {
|
|
6
|
+
return /* @__PURE__ */ jsx(
|
|
7
|
+
SegmentedControl,
|
|
8
|
+
{
|
|
9
|
+
semantics: "radio",
|
|
10
|
+
layout: "chips",
|
|
11
|
+
size: "sm",
|
|
12
|
+
label,
|
|
13
|
+
className: cx("crewlet-preset-chips", className),
|
|
14
|
+
options: options.map((option) => ({ value: option.value, label: option.label, disabled })),
|
|
15
|
+
value,
|
|
16
|
+
onValueChange: onPick
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export { PresetChips };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Button } from './chunk-
|
|
2
|
-
import { Tooltip } from './chunk-
|
|
1
|
+
import { Button } from './chunk-IMF3CPTY.js';
|
|
2
|
+
import { Tooltip } from './chunk-BFZAGIXR.js';
|
|
3
3
|
import { cx } from './chunk-ODEQTPFM.js';
|
|
4
4
|
import { forwardRef, useState, useCallback } from 'react';
|
|
5
5
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { ConfirmModal } from './chunk-7PK2Z5JY.js';
|
|
1
2
|
import { InlineCode } from './chunk-W4UJWFCZ.js';
|
|
2
|
-
import {
|
|
3
|
-
import { Callout } from './chunk-X4QL7STV.js';
|
|
3
|
+
import { Callout } from './chunk-UEO3A76N.js';
|
|
4
4
|
import './LinkInterstitial-ET4MSVSV.css';
|
|
5
5
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
6
6
|
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { TagGroup } from './chunk-FOUIZS7Q.js';
|
|
2
2
|
import { CursorFlag } from './chunk-MMCYH5LB.js';
|
|
3
3
|
import { presenceHueClass } from './chunk-EFX2YC5T.js';
|
|
4
|
-
import { ChangeMark } from './chunk-
|
|
4
|
+
import { ChangeMark } from './chunk-Z6HWOPI7.js';
|
|
5
5
|
import { isEmptyValue, displayText, ratingMax, findPerson, findOption, statusTone, editText, textMax, sheetLabels, normalizeValue, sameValue, spokenText, drawnColumns, fitSamples, fittedWidth, columnWidth, SHEET_COLUMN_BOUNDS, sortRows, SHEET_ROW_HEIGHT, cellKey, columnOffsets, SHEET_ROW_NUMBER_WIDTH, rangeOf, presenceByCell, presenceByRow, presenceByColumn, scrollToRow, planClear, visibleRows, cellDescription, nextSort, rowName, inRange, hasPrevious, flagText, toTSV, planPaste, parseTSV, isMod, moveFrom, isTypingKey, editorSide, optionHue, parseText, liveOptions, checkValue } from './chunk-LFSIKGRQ.js';
|
|
6
6
|
import { presenceLabels } from './chunk-Z7JYG5TF.js';
|
|
7
7
|
import { Tag } from './chunk-SJ3EUCFD.js';
|
|
8
8
|
import { Popover } from './chunk-AJFA2XDQ.js';
|
|
9
9
|
import { StatusDot } from './chunk-QRE6JCHS.js';
|
|
10
|
-
import { Menu } from './chunk-
|
|
10
|
+
import { Menu } from './chunk-ZMZNKDPO.js';
|
|
11
11
|
import { Avatar } from './chunk-YMFFGPFE.js';
|
|
12
|
-
import { Button } from './chunk-
|
|
13
|
-
import { IconButton } from './chunk-
|
|
14
|
-
import { Tooltip } from './chunk-
|
|
12
|
+
import { Button } from './chunk-IMF3CPTY.js';
|
|
13
|
+
import { IconButton } from './chunk-KM5OKCW6.js';
|
|
14
|
+
import { Tooltip } from './chunk-BFZAGIXR.js';
|
|
15
15
|
import { viewportBounds, LAYER_GAP } from './chunk-AVJKMQXK.js';
|
|
16
16
|
import { isComposing } from './chunk-EDPMHSLZ.js';
|
|
17
17
|
import { VisuallyHidden } from './chunk-RRRK2KB6.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SlideStage } from './chunk-7O53SWKI.js';
|
|
2
2
|
import { useReorder } from './chunk-JMBPMSNI.js';
|
|
3
|
-
import { Menu } from './chunk-
|
|
3
|
+
import { Menu } from './chunk-ZMZNKDPO.js';
|
|
4
4
|
import { Kbd, isApplePlatform } from './chunk-VBBLHS2Y.js';
|
|
5
5
|
import { VisuallyHidden } from './chunk-RRRK2KB6.js';
|
|
6
6
|
import { cx } from './chunk-ODEQTPFM.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { useScrollerFocus, Modal } from './chunk-
|
|
1
|
+
import { useScrollerFocus, Modal } from './chunk-7PK2Z5JY.js';
|
|
2
2
|
import { useListbox, useHighlightRest } from './chunk-KW7T23RT.js';
|
|
3
|
-
import { Input } from './chunk-
|
|
3
|
+
import { Input } from './chunk-XQMRSL7Z.js';
|
|
4
4
|
import { Kbd } from './chunk-VBBLHS2Y.js';
|
|
5
5
|
import { HIT_AREA_CLASS } from './chunk-2YTOOH3A.js';
|
|
6
6
|
import { isComposing } from './chunk-EDPMHSLZ.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Tag } from './chunk-SJ3EUCFD.js';
|
|
2
|
-
import { AvatarStack } from './chunk-
|
|
2
|
+
import { AvatarStack } from './chunk-2PSOUDCS.js';
|
|
3
3
|
import { cx } from './chunk-ODEQTPFM.js';
|
|
4
4
|
import './ChatScale-LGESYXCO.css';
|
|
5
5
|
import './ThreadSummary-3AODTHAM.css';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Button } from './chunk-
|
|
2
|
-
import { IconButton } from './chunk-
|
|
1
|
+
import { Button } from './chunk-IMF3CPTY.js';
|
|
2
|
+
import { IconButton } from './chunk-KM5OKCW6.js';
|
|
3
3
|
import { useComposedRef } from './chunk-L72URIHR.js';
|
|
4
4
|
import { useLayerContainer } from './chunk-AVJKMQXK.js';
|
|
5
5
|
import { focusables, useModalLayer, useBodyScrollLock } from './chunk-EDPMHSLZ.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { today, CalendarGrid, shiftMonth, compareDays } from './chunk-EE3DJMSQ.js';
|
|
2
2
|
import { Popover } from './chunk-AJFA2XDQ.js';
|
|
3
|
-
import { Button } from './chunk-
|
|
4
|
-
import { IconButton } from './chunk-
|
|
3
|
+
import { Button } from './chunk-IMF3CPTY.js';
|
|
4
|
+
import { IconButton } from './chunk-KM5OKCW6.js';
|
|
5
5
|
import { useFocusModality } from './chunk-4ITETIGZ.js';
|
|
6
6
|
import { cx } from './chunk-ODEQTPFM.js';
|
|
7
7
|
import './DateTimePicker-EBJHNQ53.css';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ContrastLevelTag } from './chunk-3YOLD7WG.js';
|
|
2
2
|
import { Popover } from './chunk-AJFA2XDQ.js';
|
|
3
|
-
import { IconButton } from './chunk-
|
|
3
|
+
import { IconButton } from './chunk-KM5OKCW6.js';
|
|
4
4
|
import { cx } from './chunk-ODEQTPFM.js';
|
|
5
5
|
import './ContrastHelp-MZCAW5WQ.css';
|
|
6
6
|
import { InfoGlyph } from '@crewlethq/icons/glyphs';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { IconTile } from './chunk-VRVNLJUA.js';
|
|
2
|
-
import { ReceiptStrip } from './chunk-
|
|
2
|
+
import { ReceiptStrip } from './chunk-OAD4AXYJ.js';
|
|
3
3
|
import { StatusCard } from './chunk-NWKH5FF7.js';
|
|
4
4
|
import { safeHref } from './chunk-KBZO4B33.js';
|
|
5
|
-
import { ButtonLink, Button } from './chunk-
|
|
5
|
+
import { ButtonLink, Button } from './chunk-IMF3CPTY.js';
|
|
6
6
|
import { cx } from './chunk-ODEQTPFM.js';
|
|
7
7
|
import './OpenInAppCard-CKHCK7DO.css';
|
|
8
8
|
import { CircleCheckGlyph } from '@crewlethq/icons/glyphs';
|
|
@@ -26,6 +26,7 @@ function Tooltip({
|
|
|
26
26
|
placement = "top",
|
|
27
27
|
align = "center",
|
|
28
28
|
disabled = false,
|
|
29
|
+
describes = true,
|
|
29
30
|
pressOpens = false,
|
|
30
31
|
openDelay = OPEN_DELAY,
|
|
31
32
|
closeDelay = CLOSE_DELAY,
|
|
@@ -155,7 +156,7 @@ function Tooltip({
|
|
|
155
156
|
const trigger = cloneElement(child, {
|
|
156
157
|
...passed,
|
|
157
158
|
ref: triggerRef,
|
|
158
|
-
"aria-describedby": open ? cx(describedBy, panelId) : describedBy,
|
|
159
|
+
"aria-describedby": open && describes ? cx(describedBy, panelId) : describedBy,
|
|
159
160
|
onPointerEnter: (event) => {
|
|
160
161
|
over.current.pointer = true;
|
|
161
162
|
if (!over.current.pressed) show(openDelay);
|
|
@@ -217,6 +218,7 @@ function Tooltip({
|
|
|
217
218
|
},
|
|
218
219
|
id: panelId,
|
|
219
220
|
role: "tooltip",
|
|
221
|
+
"aria-hidden": describes ? void 0 : true,
|
|
220
222
|
className: cx(
|
|
221
223
|
"crewlet-tooltip",
|
|
222
224
|
`crewlet-tooltip--${place?.side ?? (placement === "top" ? "above" : "below")}`,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { SlideNav } from './chunk-
|
|
1
|
+
import { SlideNav } from './chunk-WSKVFRKK.js';
|
|
2
2
|
import { SlideStage, SLIDE_WIDTH, SLIDE_HEIGHT } from './chunk-7O53SWKI.js';
|
|
3
3
|
import { Eyebrow } from './chunk-RK4XPHVG.js';
|
|
4
|
-
import { Button } from './chunk-
|
|
4
|
+
import { Button } from './chunk-IMF3CPTY.js';
|
|
5
5
|
import { cx } from './chunk-ODEQTPFM.js';
|
|
6
6
|
import './PresenterView-RKYEK27N.css';
|
|
7
7
|
import { useRef, useState, useEffect } from 'react';
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
import { GridHeadCell } from './chunk-HU56GCZ7.js';
|
|
2
|
+
import { copyGlyph, CopyStatus } from './chunk-IRGS5FEC.js';
|
|
3
|
+
import { useClipboard } from './chunk-STJ7QBC3.js';
|
|
4
|
+
import { StatusDot } from './chunk-QRE6JCHS.js';
|
|
5
|
+
import { Button } from './chunk-IMF3CPTY.js';
|
|
6
|
+
import { IconButton } from './chunk-KM5OKCW6.js';
|
|
7
|
+
import { returnFocus } from './chunk-4ITETIGZ.js';
|
|
8
|
+
import { cx } from './chunk-ODEQTPFM.js';
|
|
9
|
+
import './DataGrid-XX6ALDIM.css';
|
|
10
|
+
import './SettingsTable-KAMWVCQB.css';
|
|
11
|
+
import { useState, useRef, useLayoutEffect } from 'react';
|
|
12
|
+
import { RotateCcwGlyph } from '@crewlethq/icons/glyphs';
|
|
13
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
14
|
+
|
|
15
|
+
var COLUMNS = {
|
|
16
|
+
setting: "Setting",
|
|
17
|
+
value: "Value",
|
|
18
|
+
source: "Source",
|
|
19
|
+
actions: "Actions"
|
|
20
|
+
};
|
|
21
|
+
var noSort = () => void 0;
|
|
22
|
+
function SettingsTable({ header = true, columns, className, children, ...rest }) {
|
|
23
|
+
const names = { ...COLUMNS, ...columns };
|
|
24
|
+
return /* @__PURE__ */ jsxs("div", { ...rest, role: "table", className: cx("crewlet-data-grid", "crewlet-settings-table", className), children: [
|
|
25
|
+
/* @__PURE__ */ jsxs(
|
|
26
|
+
"div",
|
|
27
|
+
{
|
|
28
|
+
role: "row",
|
|
29
|
+
className: cx(
|
|
30
|
+
"crewlet-data-grid__head",
|
|
31
|
+
"crewlet-settings-table__head",
|
|
32
|
+
!header && "crewlet-settings-table__head--hidden"
|
|
33
|
+
),
|
|
34
|
+
children: [
|
|
35
|
+
/* @__PURE__ */ jsx(GridHeadCell, { column: { key: "setting", header: names.setting }, sort: null, sortable: false, onSort: noSort }),
|
|
36
|
+
/* @__PURE__ */ jsx(GridHeadCell, { column: { key: "value", header: names.value }, sort: null, sortable: false, onSort: noSort }),
|
|
37
|
+
/* @__PURE__ */ jsx(GridHeadCell, { column: { key: "source", header: names.source }, sort: null, sortable: false, onSort: noSort }),
|
|
38
|
+
/* @__PURE__ */ jsx(
|
|
39
|
+
GridHeadCell,
|
|
40
|
+
{
|
|
41
|
+
column: { key: "actions", header: "", action: true, label: names.actions },
|
|
42
|
+
sort: null,
|
|
43
|
+
sortable: false,
|
|
44
|
+
onSort: noSort
|
|
45
|
+
}
|
|
46
|
+
)
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
),
|
|
50
|
+
/* @__PURE__ */ jsx("div", { role: "rowgroup", className: "crewlet-data-grid__body crewlet-settings-table__body", children })
|
|
51
|
+
] });
|
|
52
|
+
}
|
|
53
|
+
var SETTINGS_TABLE_ROW_LABELS = {
|
|
54
|
+
reset: "Reset to default",
|
|
55
|
+
confirm: (defaultLabel) => defaultLabel === void 0 || defaultLabel === null ? "Reset to the default?" : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
56
|
+
"Reset to ",
|
|
57
|
+
defaultLabel,
|
|
58
|
+
"?"
|
|
59
|
+
] }),
|
|
60
|
+
confirmReset: "Reset",
|
|
61
|
+
cancel: "Cancel"
|
|
62
|
+
};
|
|
63
|
+
function SettingsTableRow({
|
|
64
|
+
label,
|
|
65
|
+
settingKey,
|
|
66
|
+
source,
|
|
67
|
+
changed = false,
|
|
68
|
+
actions,
|
|
69
|
+
onReset,
|
|
70
|
+
defaultLabel,
|
|
71
|
+
resetHeld,
|
|
72
|
+
labels: overrides,
|
|
73
|
+
className,
|
|
74
|
+
children,
|
|
75
|
+
...rest
|
|
76
|
+
}) {
|
|
77
|
+
const labels = { ...SETTINGS_TABLE_ROW_LABELS, ...overrides };
|
|
78
|
+
const offered = changed && onReset !== void 0;
|
|
79
|
+
const [asking, setAsking] = useState(false);
|
|
80
|
+
const confirming = asking && offered;
|
|
81
|
+
const resetButton = useRef(null);
|
|
82
|
+
const confirmButton = useRef(null);
|
|
83
|
+
const actionsCell = useRef(null);
|
|
84
|
+
const settleFocus = useRef(false);
|
|
85
|
+
const resetHeldFocus = useRef(false);
|
|
86
|
+
useLayoutEffect(() => {
|
|
87
|
+
if (confirming) {
|
|
88
|
+
confirmButton.current?.focus();
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
if (!settleFocus.current && !(resetHeldFocus.current && !offered)) return;
|
|
92
|
+
settleFocus.current = false;
|
|
93
|
+
resetHeldFocus.current = false;
|
|
94
|
+
returnFocus(resetButton.current ?? actionsCell.current?.querySelector("button") ?? null);
|
|
95
|
+
}, [confirming, offered]);
|
|
96
|
+
const close = (reset) => {
|
|
97
|
+
settleFocus.current = true;
|
|
98
|
+
setAsking(false);
|
|
99
|
+
if (reset) onReset?.();
|
|
100
|
+
};
|
|
101
|
+
const keys = (event) => {
|
|
102
|
+
if (event.key !== "Escape") return;
|
|
103
|
+
event.preventDefault();
|
|
104
|
+
event.stopPropagation();
|
|
105
|
+
close(false);
|
|
106
|
+
};
|
|
107
|
+
const leave = (event) => {
|
|
108
|
+
if (event.relatedTarget instanceof Node && event.currentTarget.contains(event.relatedTarget)) return;
|
|
109
|
+
setAsking(false);
|
|
110
|
+
};
|
|
111
|
+
return /* @__PURE__ */ jsxs(
|
|
112
|
+
"div",
|
|
113
|
+
{
|
|
114
|
+
...rest,
|
|
115
|
+
role: "row",
|
|
116
|
+
"data-changed": changed ? "" : void 0,
|
|
117
|
+
"data-confirming": confirming ? "" : void 0,
|
|
118
|
+
className: cx("crewlet-data-grid__row", "crewlet-settings-table__row", className),
|
|
119
|
+
children: [
|
|
120
|
+
/* @__PURE__ */ jsxs("div", { role: "rowheader", className: "crewlet-data-grid__cell crewlet-settings-table__setting", children: [
|
|
121
|
+
/* @__PURE__ */ jsx("span", { className: "crewlet-settings-table__label", children: label }),
|
|
122
|
+
settingKey === void 0 ? null : /* @__PURE__ */ jsx(SettingKey, { settingKey })
|
|
123
|
+
] }),
|
|
124
|
+
/* @__PURE__ */ jsx("div", { role: "cell", className: "crewlet-data-grid__cell crewlet-settings-table__value", children }),
|
|
125
|
+
confirming ? (
|
|
126
|
+
// The question's own keys and focus: Escape answers no, and leaving it puts it away.
|
|
127
|
+
// eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
|
|
128
|
+
/* @__PURE__ */ jsxs(
|
|
129
|
+
"div",
|
|
130
|
+
{
|
|
131
|
+
role: "cell",
|
|
132
|
+
className: "crewlet-data-grid__cell crewlet-settings-table__confirm",
|
|
133
|
+
onKeyDown: keys,
|
|
134
|
+
onBlur: leave,
|
|
135
|
+
children: [
|
|
136
|
+
/* @__PURE__ */ jsx("span", { className: "crewlet-settings-table__question", children: labels.confirm(defaultLabel) }),
|
|
137
|
+
/* @__PURE__ */ jsx(Button, { type: "button", size: "small", variant: "ghost", onClick: () => close(false), children: labels.cancel }),
|
|
138
|
+
/* @__PURE__ */ jsx(Button, { ref: confirmButton, type: "button", size: "small", variant: "secondary", onClick: () => close(true), children: labels.confirmReset })
|
|
139
|
+
]
|
|
140
|
+
}
|
|
141
|
+
)
|
|
142
|
+
) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
143
|
+
/* @__PURE__ */ jsxs(
|
|
144
|
+
"div",
|
|
145
|
+
{
|
|
146
|
+
role: "cell",
|
|
147
|
+
className: cx(
|
|
148
|
+
"crewlet-data-grid__cell",
|
|
149
|
+
"crewlet-settings-table__source",
|
|
150
|
+
changed && "crewlet-settings-table__source--changed"
|
|
151
|
+
),
|
|
152
|
+
children: [
|
|
153
|
+
changed ? /* @__PURE__ */ jsx(StatusDot, { tone: "brand" }) : null,
|
|
154
|
+
source
|
|
155
|
+
]
|
|
156
|
+
}
|
|
157
|
+
),
|
|
158
|
+
/* @__PURE__ */ jsxs(
|
|
159
|
+
"div",
|
|
160
|
+
{
|
|
161
|
+
ref: actionsCell,
|
|
162
|
+
role: "cell",
|
|
163
|
+
className: "crewlet-data-grid__cell crewlet-data-grid__cell--action crewlet-settings-table__actions",
|
|
164
|
+
children: [
|
|
165
|
+
offered ? /* @__PURE__ */ jsx(
|
|
166
|
+
IconButton,
|
|
167
|
+
{
|
|
168
|
+
ref: resetButton,
|
|
169
|
+
size: "sm",
|
|
170
|
+
variant: "ghost",
|
|
171
|
+
icon: /* @__PURE__ */ jsx(RotateCcwGlyph, {}),
|
|
172
|
+
label: labels.reset,
|
|
173
|
+
tooltip: true,
|
|
174
|
+
disabledReason: resetHeld,
|
|
175
|
+
onFocus: () => {
|
|
176
|
+
resetHeldFocus.current = true;
|
|
177
|
+
},
|
|
178
|
+
onBlur: () => {
|
|
179
|
+
resetHeldFocus.current = false;
|
|
180
|
+
},
|
|
181
|
+
onClick: () => {
|
|
182
|
+
if (resetHeld === void 0) setAsking(true);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
) : null,
|
|
186
|
+
actions
|
|
187
|
+
]
|
|
188
|
+
}
|
|
189
|
+
)
|
|
190
|
+
] })
|
|
191
|
+
]
|
|
192
|
+
}
|
|
193
|
+
);
|
|
194
|
+
}
|
|
195
|
+
SettingsTable.Row = SettingsTableRow;
|
|
196
|
+
function SettingKey({ settingKey }) {
|
|
197
|
+
const { state, attempt, copy } = useClipboard({ failedResetMs: null });
|
|
198
|
+
return /* @__PURE__ */ jsxs("span", { className: "crewlet-settings-table__key", "data-copy": state, children: [
|
|
199
|
+
/* @__PURE__ */ jsx(
|
|
200
|
+
IconButton,
|
|
201
|
+
{
|
|
202
|
+
size: "sm",
|
|
203
|
+
variant: "ghost",
|
|
204
|
+
icon: copyGlyph(state),
|
|
205
|
+
label: `Copy the setting's key, ${settingKey}`,
|
|
206
|
+
tooltip: settingKey,
|
|
207
|
+
onClick: () => {
|
|
208
|
+
void copy(settingKey);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
),
|
|
212
|
+
/* @__PURE__ */ jsx(
|
|
213
|
+
CopyStatus,
|
|
214
|
+
{
|
|
215
|
+
state,
|
|
216
|
+
attempt,
|
|
217
|
+
copiedMessage: `${settingKey} copied to the clipboard`,
|
|
218
|
+
failedMessage: "the browser refused the clipboard"
|
|
219
|
+
}
|
|
220
|
+
)
|
|
221
|
+
] });
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
export { SETTINGS_TABLE_ROW_LABELS, SettingsTable, SettingsTableRow };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EditingStatus } from './chunk-KRF3GQ63.js';
|
|
2
2
|
import { Kbd } from './chunk-VBBLHS2Y.js';
|
|
3
|
-
import { Button } from './chunk-
|
|
3
|
+
import { Button } from './chunk-IMF3CPTY.js';
|
|
4
4
|
import { isComposing } from './chunk-EDPMHSLZ.js';
|
|
5
5
|
import { cx } from './chunk-ODEQTPFM.js';
|
|
6
6
|
import './InlineEditor-W55DDKML.css';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useThemePreference, useSystemTheme, resolveTheme } from './chunk-Z24ZUSTX.js';
|
|
2
|
-
import { IconButton } from './chunk-
|
|
2
|
+
import { IconButton } from './chunk-KM5OKCW6.js';
|
|
3
3
|
import { SunGlyph, MoonGlyph } from '@crewlethq/icons/glyphs';
|
|
4
4
|
import { jsx } from 'react/jsx-runtime';
|
|
5
5
|
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { PresetChips } from './chunk-6QWSGM4W.js';
|
|
2
|
+
import { Input } from './chunk-XQMRSL7Z.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,6 +1,6 @@
|
|
|
1
1
|
import { useAppShellAside } from './chunk-MBEZOURR.js';
|
|
2
2
|
import { ResizeHandle } from './chunk-FQ6J4DK7.js';
|
|
3
|
-
import { IconButton } from './chunk-
|
|
3
|
+
import { IconButton } from './chunk-KM5OKCW6.js';
|
|
4
4
|
import { useEscapeWithin, useModalLayer } from './chunk-EDPMHSLZ.js';
|
|
5
5
|
import { HeadingLevelProvider } from './chunk-PQADV6P6.js';
|
|
6
6
|
import { cx } from './chunk-ODEQTPFM.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { FileDrop, FilePickButton } from './chunk-
|
|
1
|
+
import { FileDrop, FilePickButton } from './chunk-AU4EKD2G.js';
|
|
2
2
|
import { contrastRatio } from './chunk-3YOLD7WG.js';
|
|
3
3
|
import { normalizeHex } from './chunk-7W3LYIOC.js';
|
|
4
|
-
import { Button } from './chunk-
|
|
4
|
+
import { Button } from './chunk-IMF3CPTY.js';
|
|
5
5
|
import { VisuallyHidden } from './chunk-RRRK2KB6.js';
|
|
6
6
|
import { cx } from './chunk-ODEQTPFM.js';
|
|
7
7
|
import './LogoSlot-LRHO4R54.css';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { FormField, Label, Input } from './chunk-
|
|
2
|
-
import { Button } from './chunk-
|
|
3
|
-
import { IconButton } from './chunk-
|
|
1
|
+
import { FormField, Label, Input } from './chunk-XQMRSL7Z.js';
|
|
2
|
+
import { Button } from './chunk-IMF3CPTY.js';
|
|
3
|
+
import { IconButton } from './chunk-KM5OKCW6.js';
|
|
4
4
|
import { announce } from './chunk-WGMKERCR.js';
|
|
5
5
|
import { cx } from './chunk-ODEQTPFM.js';
|
|
6
6
|
import './KeyValueRows-US5KW7JK.css';
|