@crewlethq/ui 0.15.0 → 0.16.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/README.md +36 -6
- package/dist/AddPill/index.js +1 -1
- package/dist/{AddPill-V4TQXJ53.css → AddPill-RYCY56P4.css} +3 -1
- package/dist/AppShell/AccountRow.d.ts +40 -0
- package/dist/AppShell/AppShell.d.ts +1 -0
- package/dist/AppShell/index.d.ts +2 -0
- package/dist/AppShell/index.js +1 -1
- package/dist/{AppShell-6QUD7NWM.css → AppShell-RUNVM4WH.css} +93 -0
- package/dist/AuthLayout/AuthLayout.d.ts +35 -0
- package/dist/AuthLayout/index.d.ts +3 -0
- package/dist/AuthLayout/index.js +8 -0
- package/dist/AuthLayout-ODHBUPHQ.css +54 -0
- package/dist/Avatar/Avatar.d.ts +22 -2
- package/dist/Avatar/index.d.ts +1 -1
- package/dist/Avatar/index.js +2 -2
- package/dist/{Avatar-BPJ36QZR.css → Avatar-MBUPR5E5.css} +22 -3
- package/dist/AvatarPicker/index.js +4 -4
- package/dist/Callout/Callout.d.ts +7 -1
- package/dist/Callout/index.js +1 -1
- package/dist/{Callout-S7QDWHDL.css → Callout-SXXK4B5R.css} +3 -1
- package/dist/CharacterPicker/index.js +2 -2
- package/dist/Checkbox/CheckboxGroup.d.ts +30 -0
- package/dist/Checkbox/index.d.ts +2 -0
- package/dist/Checkbox/index.js +5 -1
- package/dist/{Checkbox-UE7TEPAM.css → Checkbox-KT7RS6QQ.css} +16 -0
- package/dist/CodeBlock/index.js +4 -3
- package/dist/Combobox/index.js +3 -3
- package/dist/CommandPalette/index.js +5 -5
- package/dist/Composer/index.js +3 -3
- package/dist/ConfirmField/ConfirmField.d.ts +43 -0
- package/dist/ConfirmField/index.d.ts +2 -0
- package/dist/ConfirmField/index.js +7 -0
- package/dist/Copyable/CopyButton.d.ts +13 -6
- package/dist/Copyable/index.js +3 -2
- package/dist/DataTable/index.js +7 -5
- package/dist/DataView/index.js +10 -9
- package/dist/DownloadButton/DownloadButton.d.ts +52 -0
- package/dist/DownloadButton/index.d.ts +2 -0
- package/dist/DownloadButton/index.js +6 -0
- package/dist/EntityChip/index.js +3 -3
- package/dist/ImageUpload/index.js +3 -3
- package/dist/InlineCode/InlineCode.d.ts +8 -1
- package/dist/InlineCode/index.js +1 -1
- package/dist/{InlineCode-6WSR5COL.css → InlineCode-ASYHLN3E.css} +9 -0
- package/dist/Input/index.js +2 -2
- package/dist/{Input-RAKNQJCV.css → Input-3KVSNUO5.css} +11 -0
- package/dist/ListInput/index.js +3 -3
- package/dist/MarkdownEditor/index.js +1 -1
- package/dist/Modal/index.js +2 -2
- package/dist/ObjectHeader/ObjectHeader.d.ts +138 -0
- package/dist/ObjectHeader/index.d.ts +3 -0
- package/dist/ObjectHeader/index.js +4 -0
- package/dist/ObjectHeader-UNVYM2KD.css +174 -0
- package/dist/OrgLabel/index.js +3 -3
- package/dist/{OrgLabel-6WSKJQOT.css → OrgLabel-R5KY7C3W.css} +6 -1
- package/dist/OrgNode/index.js +4 -4
- package/dist/OrgTable/index.js +5 -5
- package/dist/QrCode/QrCode.d.ts +58 -0
- package/dist/QrCode/index.d.ts +3 -0
- package/dist/QrCode/index.js +2 -0
- package/dist/QrCode-JWJTWMU5.css +19 -0
- package/dist/Switcher/index.js +4 -4
- package/dist/Text/Text.d.ts +7 -1
- package/dist/Text/index.js +1 -1
- package/dist/{Text-XIPYYZX2.css → Text-S3Q4O3IG.css} +11 -0
- package/dist/TimeWindowPicker/index.js +3 -3
- package/dist/{chunk-FTEJPHBI.js → chunk-4GB57WIT.js} +2 -2
- package/dist/{chunk-NN62JQLR.js → chunk-5CLW2CXT.js} +3 -1
- package/dist/{chunk-2GXTIK37.js → chunk-5EFRWWGX.js} +3 -3
- package/dist/{chunk-6OF2DBKY.js → chunk-6DQWF5Y4.js} +2 -2
- package/dist/{chunk-QSLIN64M.js → chunk-6NIMZ5XC.js} +1 -1
- package/dist/{chunk-YCTMKKRA.js → chunk-75CLJNDQ.js} +12 -2
- package/dist/chunk-7QFAORCY.js +37 -0
- package/dist/chunk-BJCFNRGH.js +53 -0
- package/dist/{chunk-IHGKPEEV.js → chunk-CGNQPGJL.js} +1 -1
- package/dist/{chunk-DDTDN5L2.js → chunk-CKB3OHL3.js} +1 -1
- package/dist/chunk-CXBAIVYZ.js +39 -0
- package/dist/chunk-DTIW4CHZ.js +37 -0
- package/dist/{chunk-YXMCUKFI.js → chunk-DZ2YR6MV.js} +1 -1
- package/dist/{chunk-QV266R6G.js → chunk-EIOTVNYX.js} +4 -4
- package/dist/chunk-F6NZOVWL.js +68 -0
- package/dist/{chunk-LCF4WPYS.js → chunk-FA2V2VT6.js} +2 -2
- package/dist/{chunk-EFNHOVC2.js → chunk-FAEN3HYI.js} +2 -2
- package/dist/{chunk-HI6Q2UXQ.js → chunk-FY4SP3HF.js} +11 -3
- package/dist/{chunk-KGTQ5CVD.js → chunk-GDDE4UM7.js} +1 -1
- package/dist/chunk-I7WXZOWA.js +90 -0
- package/dist/{chunk-23DHIMJA.js → chunk-IKBK4A5O.js} +1 -1
- package/dist/{chunk-7BZPYA5P.js → chunk-JF7X673Z.js} +1 -1
- package/dist/{chunk-DJMLHCLD.js → chunk-KLESCRTS.js} +1 -1
- package/dist/{chunk-DYHSQHAZ.js → chunk-OFMPIRGD.js} +2 -2
- package/dist/{chunk-H3XOMT7W.js → chunk-OYOQU7O5.js} +44 -3
- package/dist/{chunk-IYZZL3MZ.js → chunk-PQ63NLFC.js} +3 -3
- package/dist/{chunk-5VNUYO76.js → chunk-STJ7QBC3.js} +8 -25
- package/dist/{chunk-R6FBDTP3.js → chunk-SVSCLHHI.js} +1 -1
- package/dist/{chunk-GARACZAH.js → chunk-T3ZWBZ65.js} +1 -1
- package/dist/{chunk-74WGARJE.js → chunk-TROLVEZY.js} +1 -1
- package/dist/{chunk-6NIZCQUM.js → chunk-UAMDRJD6.js} +2 -2
- package/dist/{chunk-YACKC3K2.js → chunk-W46LPU4R.js} +8 -8
- package/dist/chunk-Y56FM3K4.js +57 -0
- package/dist/{chunk-4Y7WKXAW.js → chunk-ZFH7H7GS.js} +1 -1
- package/dist/generated/index.d.ts +5 -0
- package/dist/generated/index.js +66 -59
- package/dist/index.js +66 -59
- package/dist/styles.css +439 -15
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/index.js +4 -2
- package/dist/utils/useClipboard.d.ts +6 -3
- package/dist/utils/useDownload.d.ts +63 -0
- package/dist/utils/useOutcome.d.ts +44 -0
- package/package.json +4 -3
- package/dist/{chunk-6AR2T5Y4.js → chunk-CRVETI5L.js} +0 -0
- package/dist/{chunk-K4VORB64.js → chunk-DEEVA6TV.js} +1 -1
- /package/dist/{chunk-AER7UDD4.js → chunk-U5LQ2AS5.js} +0 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/** Where a hand-off stands: not tried, landed, or refused. */
|
|
2
|
+
export type OutcomeState = 'idle' | 'done' | 'failed';
|
|
3
|
+
export interface OutcomeOptions {
|
|
4
|
+
/** How long a success stands before the control settles back. */
|
|
5
|
+
resetMs?: number | undefined;
|
|
6
|
+
/**
|
|
7
|
+
* How long a REFUSAL stands. Unset it is `resetMs`; `null` holds it until
|
|
8
|
+
* the next attempt; a number gives it a clock of its own. See
|
|
9
|
+
* [ClipboardOptions.failedResetMs] for why a refusal wants its own.
|
|
10
|
+
*/
|
|
11
|
+
failedResetMs?: number | null | undefined;
|
|
12
|
+
}
|
|
13
|
+
export interface Outcome {
|
|
14
|
+
state: OutcomeState;
|
|
15
|
+
/**
|
|
16
|
+
* How many attempts have settled. A status region keyed on it is REPLACED
|
|
17
|
+
* on every attempt, so an identical outcome twice running is still a change
|
|
18
|
+
* a screen reader announces: a second refusal used to be silence.
|
|
19
|
+
*/
|
|
20
|
+
attempt: number;
|
|
21
|
+
/**
|
|
22
|
+
* Runs `task` and settles on its answer. The task returns whether it landed
|
|
23
|
+
* and must not throw: a refusal is `false`. The answer is returned to the
|
|
24
|
+
* caller even when the component is gone by the time it arrives.
|
|
25
|
+
*/
|
|
26
|
+
run: (task: () => boolean | Promise<boolean>) => Promise<boolean>;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* The state machine every hand-off control shares: do a thing that either
|
|
30
|
+
* lands or does not, say which, and settle back so the label is never a stale
|
|
31
|
+
* claim.
|
|
32
|
+
*
|
|
33
|
+
* ONE MACHINE, because the controls built on it sit side by side (a Copy and
|
|
34
|
+
* a Download over the same text), and any difference between them in how
|
|
35
|
+
* long a confirmation holds, or whether a repeat is announced, is a visible
|
|
36
|
+
* inconsistency rather than a private detail.
|
|
37
|
+
*
|
|
38
|
+
* THE TASK CAN OUTLIVE THE SCREEN. A clipboard write waits on a permission
|
|
39
|
+
* prompt the reader may never answer, so whether the component is still
|
|
40
|
+
* mounted is checked AFTER the await, and nothing is armed for one that is
|
|
41
|
+
* gone. The flag is set in the effect body as well as cleared in its cleanup,
|
|
42
|
+
* because StrictMode mounts, unmounts and mounts again.
|
|
43
|
+
*/
|
|
44
|
+
export declare function useOutcome({ resetMs, failedResetMs }?: OutcomeOptions): Outcome;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crewlethq/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.0",
|
|
4
4
|
"description": "Crewlet shared React components built on @crewlethq/tokens and @crewlethq/icons.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -42,8 +42,9 @@
|
|
|
42
42
|
"clean": "rm -rf dist src/generated"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@crewlethq/icons": "0.
|
|
46
|
-
"@crewlethq/tokens": "0.
|
|
45
|
+
"@crewlethq/icons": "0.16.0",
|
|
46
|
+
"@crewlethq/tokens": "0.16.0",
|
|
47
|
+
"uqr": "0.1.3"
|
|
47
48
|
},
|
|
48
49
|
"peerDependencies": {
|
|
49
50
|
"react": ">=18",
|
|
File without changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Button } from './chunk-OG6CL3EB.js';
|
|
2
|
-
import { HeadingLevelProvider } from './chunk-PQADV6P6.js';
|
|
3
2
|
import { IconButton } from './chunk-4FQT6ZAY.js';
|
|
3
|
+
import { HeadingLevelProvider } from './chunk-PQADV6P6.js';
|
|
4
4
|
import { useLayerContainer } from './chunk-HMPFGIWM.js';
|
|
5
5
|
import { focusables, useModalLayer, useBodyScrollLock } from './chunk-R25RGPUB.js';
|
|
6
6
|
import { cx } from './chunk-ODEQTPFM.js';
|
|
File without changes
|