@crewlethq/ui 0.15.1 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/README.md +36 -6
  2. package/dist/AppShell/AccountRow.d.ts +40 -0
  3. package/dist/AppShell/AppShell.d.ts +1 -0
  4. package/dist/AppShell/index.d.ts +2 -0
  5. package/dist/AppShell/index.js +1 -1
  6. package/dist/{AppShell-6QUD7NWM.css → AppShell-RUNVM4WH.css} +93 -0
  7. package/dist/AuthLayout/AuthLayout.d.ts +35 -0
  8. package/dist/AuthLayout/index.d.ts +3 -0
  9. package/dist/AuthLayout/index.js +8 -0
  10. package/dist/AuthLayout-ODHBUPHQ.css +54 -0
  11. package/dist/Avatar/Avatar.d.ts +37 -2
  12. package/dist/Avatar/index.d.ts +1 -1
  13. package/dist/Avatar/index.js +2 -2
  14. package/dist/{Avatar-I4NFP3WQ.css → Avatar-3C2H2WA4.css} +34 -0
  15. package/dist/AvatarPicker/index.js +4 -4
  16. package/dist/Callout/Callout.d.ts +7 -1
  17. package/dist/Callout/index.js +1 -1
  18. package/dist/{Callout-S7QDWHDL.css → Callout-SXXK4B5R.css} +3 -1
  19. package/dist/CharacterPicker/index.js +2 -2
  20. package/dist/Checkbox/CheckboxGroup.d.ts +30 -0
  21. package/dist/Checkbox/index.d.ts +2 -0
  22. package/dist/Checkbox/index.js +5 -1
  23. package/dist/{Checkbox-UE7TEPAM.css → Checkbox-KT7RS6QQ.css} +16 -0
  24. package/dist/CodeBlock/index.js +4 -3
  25. package/dist/Combobox/index.js +3 -3
  26. package/dist/CommandPalette/index.js +5 -5
  27. package/dist/Composer/index.js +3 -3
  28. package/dist/ConfirmField/ConfirmField.d.ts +43 -0
  29. package/dist/ConfirmField/index.d.ts +2 -0
  30. package/dist/ConfirmField/index.js +7 -0
  31. package/dist/Copyable/CopyButton.d.ts +13 -6
  32. package/dist/Copyable/index.js +3 -2
  33. package/dist/DataTable/index.js +7 -5
  34. package/dist/DataView/index.js +12 -11
  35. package/dist/DateTimePicker/index.js +2 -2
  36. package/dist/DownloadButton/DownloadButton.d.ts +52 -0
  37. package/dist/DownloadButton/index.d.ts +2 -0
  38. package/dist/DownloadButton/index.js +6 -0
  39. package/dist/EntityChip/index.js +3 -3
  40. package/dist/ImageUpload/index.js +3 -3
  41. package/dist/InlineCode/InlineCode.d.ts +8 -1
  42. package/dist/InlineCode/index.js +1 -1
  43. package/dist/{InlineCode-6WSR5COL.css → InlineCode-ASYHLN3E.css} +9 -0
  44. package/dist/Input/index.js +2 -2
  45. package/dist/{Input-RAKNQJCV.css → Input-3KVSNUO5.css} +11 -0
  46. package/dist/ListInput/index.js +3 -3
  47. package/dist/MarkdownEditor/index.js +1 -1
  48. package/dist/Modal/index.js +2 -2
  49. package/dist/ObjectHeader/ObjectHeader.d.ts +138 -0
  50. package/dist/ObjectHeader/index.d.ts +3 -0
  51. package/dist/ObjectHeader/index.js +4 -0
  52. package/dist/ObjectHeader-UNVYM2KD.css +174 -0
  53. package/dist/OrgLabel/index.js +3 -3
  54. package/dist/OrgNode/index.js +4 -4
  55. package/dist/OrgTable/index.js +4 -4
  56. package/dist/QrCode/QrCode.d.ts +58 -0
  57. package/dist/QrCode/index.d.ts +3 -0
  58. package/dist/QrCode/index.js +2 -0
  59. package/dist/QrCode-JWJTWMU5.css +19 -0
  60. package/dist/Switcher/index.js +4 -4
  61. package/dist/Text/Text.d.ts +7 -1
  62. package/dist/Text/index.js +1 -1
  63. package/dist/{Text-XIPYYZX2.css → Text-S3Q4O3IG.css} +11 -0
  64. package/dist/TimeWindowPicker/index.js +4 -4
  65. package/dist/{chunk-FTEJPHBI.js → chunk-4GB57WIT.js} +2 -2
  66. package/dist/{chunk-DDTDN5L2.js → chunk-4KWOKX2B.js} +1 -1
  67. package/dist/{chunk-NN62JQLR.js → chunk-5CLW2CXT.js} +3 -1
  68. package/dist/{chunk-HI6Q2UXQ.js → chunk-5OM447RW.js} +19 -7
  69. package/dist/{chunk-YXMCUKFI.js → chunk-5PSXBL73.js} +1 -1
  70. package/dist/{chunk-QSLIN64M.js → chunk-6NIMZ5XC.js} +1 -1
  71. package/dist/{chunk-YCTMKKRA.js → chunk-75CLJNDQ.js} +12 -2
  72. package/dist/chunk-7QFAORCY.js +37 -0
  73. package/dist/{chunk-22M7OXKW.js → chunk-AKEZ3G5V.js} +1 -1
  74. package/dist/chunk-BJCFNRGH.js +53 -0
  75. package/dist/chunk-CXBAIVYZ.js +39 -0
  76. package/dist/chunk-DTIW4CHZ.js +37 -0
  77. package/dist/chunk-F6NZOVWL.js +68 -0
  78. package/dist/{chunk-LCF4WPYS.js → chunk-FA2V2VT6.js} +2 -2
  79. package/dist/{chunk-KGTQ5CVD.js → chunk-GDDE4UM7.js} +1 -1
  80. package/dist/{chunk-EFNHOVC2.js → chunk-HENOTGUV.js} +2 -2
  81. package/dist/chunk-I7WXZOWA.js +90 -0
  82. package/dist/{chunk-23DHIMJA.js → chunk-IKBK4A5O.js} +1 -1
  83. package/dist/{chunk-DY77H372.js → chunk-JF7X673Z.js} +2 -2
  84. package/dist/{chunk-YYBD73OI.js → chunk-L4ZLXYPO.js} +1 -1
  85. package/dist/{chunk-H3XOMT7W.js → chunk-OYOQU7O5.js} +44 -3
  86. package/dist/{chunk-IYZZL3MZ.js → chunk-PQ63NLFC.js} +3 -3
  87. package/dist/{chunk-TK6YC5QT.js → chunk-RF5O4FYL.js} +4 -4
  88. package/dist/{chunk-5VNUYO76.js → chunk-STJ7QBC3.js} +8 -25
  89. package/dist/{chunk-R6FBDTP3.js → chunk-SVSCLHHI.js} +1 -1
  90. package/dist/{chunk-GARACZAH.js → chunk-T3ZWBZ65.js} +1 -1
  91. package/dist/{chunk-FY2R4U4Q.js → chunk-TBMDMXEX.js} +1 -1
  92. package/dist/{chunk-ZPWUVVIB.js → chunk-UAN5NE7M.js} +2 -2
  93. package/dist/{chunk-YACKC3K2.js → chunk-W46LPU4R.js} +8 -8
  94. package/dist/{chunk-4EOJR52M.js → chunk-XU4H6JQB.js} +4 -4
  95. package/dist/chunk-Y56FM3K4.js +57 -0
  96. package/dist/{chunk-DJMLHCLD.js → chunk-YDBC4DNW.js} +1 -1
  97. package/dist/{chunk-4Y7WKXAW.js → chunk-ZFH7H7GS.js} +1 -1
  98. package/dist/generated/index.d.ts +5 -0
  99. package/dist/generated/index.js +67 -60
  100. package/dist/index.js +67 -60
  101. package/dist/styles.css +440 -8
  102. package/dist/utils/index.d.ts +4 -0
  103. package/dist/utils/index.js +4 -2
  104. package/dist/utils/useClipboard.d.ts +6 -3
  105. package/dist/utils/useDownload.d.ts +63 -0
  106. package/dist/utils/useOutcome.d.ts +44 -0
  107. package/package.json +4 -3
  108. package/dist/{chunk-GUHP5JHC.js → chunk-2UU5IGZI.js} +1 -1
  109. package/dist/{chunk-6AR2T5Y4.js → chunk-CRVETI5L.js} +0 -0
  110. package/dist/{chunk-K4VORB64.js → chunk-DEEVA6TV.js} +1 -1
  111. /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.15.1",
3
+ "version": "0.17.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.15.1",
46
- "@crewlethq/tokens": "0.15.1"
45
+ "@crewlethq/icons": "0.17.0",
46
+ "@crewlethq/tokens": "0.17.0",
47
+ "uqr": "0.1.3"
47
48
  },
48
49
  "peerDependencies": {
49
50
  "react": ">=18",
@@ -1,5 +1,5 @@
1
- import { Button } from './chunk-OG6CL3EB.js';
2
1
  import { today, CalendarGrid, shiftMonth, compareDays } from './chunk-GXQ3B46I.js';
2
+ import { Button } from './chunk-OG6CL3EB.js';
3
3
  import { IconButton } from './chunk-4FQT6ZAY.js';
4
4
  import { Popover } from './chunk-BWRGFKJP.js';
5
5
  import { cx } from './chunk-ODEQTPFM.js';
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