@crewlethq/ui 0.17.1 → 0.19.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 (226) hide show
  1. package/README.md +55 -3
  2. package/dist/AccessDeniedCard/AccessDeniedCard.d.ts +39 -0
  3. package/dist/AccessDeniedCard/index.d.ts +3 -0
  4. package/dist/AccessDeniedCard/index.js +8 -0
  5. package/dist/AccessDeniedCard-WXM5DBDZ.css +8 -0
  6. package/dist/AppShell/index.js +2 -2
  7. package/dist/ArrangeBoard/ArrangeBoard.d.ts +32 -0
  8. package/dist/ArrangeBoard/index.d.ts +3 -0
  9. package/dist/ArrangeBoard/index.js +2 -0
  10. package/dist/ArrangeBoard-MQE35P6Z.css +80 -0
  11. package/dist/ArrangeFrame/ArrangeFrame.d.ts +82 -0
  12. package/dist/ArrangeFrame/index.d.ts +5 -0
  13. package/dist/ArrangeFrame/index.js +5 -0
  14. package/dist/ArrangeFrame/useGridResize.d.ts +66 -0
  15. package/dist/ArrangeFrame-3PLZAG22.css +329 -0
  16. package/dist/ArrangeGroup/ArrangeGroup.d.ts +42 -0
  17. package/dist/ArrangeGroup/index.d.ts +3 -0
  18. package/dist/ArrangeGroup/index.js +4 -0
  19. package/dist/ArrangeGroup-SHFHA7BE.css +170 -0
  20. package/dist/ArrangeList/ArrangeList.d.ts +64 -0
  21. package/dist/ArrangeList/index.d.ts +3 -0
  22. package/dist/ArrangeList/index.js +10 -0
  23. package/dist/ArrangeList-NNRTDFI5.css +94 -0
  24. package/dist/ArtifactCard/ArtifactCard.d.ts +61 -0
  25. package/dist/ArtifactCard/index.d.ts +3 -0
  26. package/dist/ArtifactCard/index.js +12 -0
  27. package/dist/ArtifactCard-EXVAEBV6.css +109 -0
  28. package/dist/AuthLayout/index.js +2 -2
  29. package/dist/AvatarPicker/index.js +5 -5
  30. package/dist/Canvas/index.js +2 -2
  31. package/dist/Card/index.js +1 -1
  32. package/dist/ChangeMark/ChangeMark.d.ts +26 -0
  33. package/dist/ChangeMark/index.d.ts +3 -0
  34. package/dist/ChangeMark/index.js +8 -0
  35. package/dist/ChangeMark-3VMTW7MT.css +22 -0
  36. package/dist/Checkbox/index.js +3 -3
  37. package/dist/Combobox/index.js +3 -3
  38. package/dist/CommandPalette/index.js +5 -5
  39. package/dist/Composer/index.js +3 -3
  40. package/dist/ConfirmField/index.js +3 -3
  41. package/dist/CursorFlag/CursorFlag.d.ts +34 -0
  42. package/dist/CursorFlag/index.d.ts +3 -0
  43. package/dist/CursorFlag/index.js +3 -0
  44. package/dist/CursorFlag-AJQJBUGY.css +61 -0
  45. package/dist/DataTable/index.js +7 -7
  46. package/dist/DataView/index.js +13 -13
  47. package/dist/DateTimePicker/index.js +2 -2
  48. package/dist/Divider/Divider.d.ts +15 -0
  49. package/dist/Divider/index.d.ts +3 -0
  50. package/dist/Divider/index.js +2 -0
  51. package/dist/Divider-3Z77ZAJH.css +37 -0
  52. package/dist/FollowBanner/FollowBanner.d.ts +35 -0
  53. package/dist/FollowBanner/index.d.ts +2 -0
  54. package/dist/FollowBanner/index.js +7 -0
  55. package/dist/FrameProtocol/index.d.ts +2 -0
  56. package/dist/FrameProtocol/index.js +2 -0
  57. package/dist/FrameProtocol/protocol.d.ts +164 -0
  58. package/dist/HuePicker/HuePicker.d.ts +16 -4
  59. package/dist/HuePicker/index.js +3 -3
  60. package/dist/{HuePicker-5QIUR6L7.css → HuePicker-PAIGH6LR.css} +6 -0
  61. package/dist/IconTile/IconTile.d.ts +23 -0
  62. package/dist/IconTile/index.d.ts +3 -0
  63. package/dist/IconTile/index.js +2 -0
  64. package/dist/IconTile-4GNWTLAW.css +30 -0
  65. package/dist/Input/index.js +2 -2
  66. package/dist/LinkInterstitial/LinkInterstitial.d.ts +41 -0
  67. package/dist/LinkInterstitial/index.d.ts +3 -0
  68. package/dist/LinkInterstitial/index.js +11 -0
  69. package/dist/LinkInterstitial-ET4MSVSV.css +34 -0
  70. package/dist/ListInput/index.js +4 -4
  71. package/dist/LiveCursor/LiveCursor.d.ts +34 -0
  72. package/dist/LiveCursor/index.d.ts +3 -0
  73. package/dist/LiveCursor/index.js +4 -0
  74. package/dist/LiveCursor-DZHGIYWE.css +47 -0
  75. package/dist/MarkdownEditor/index.js +3 -3
  76. package/dist/Menu/index.js +2 -2
  77. package/dist/Modal/Modal.d.ts +20 -0
  78. package/dist/Modal/index.js +2 -2
  79. package/dist/{Modal-RQAYGG4L.css → Modal-XOSV6FAH.css} +14 -0
  80. package/dist/Note/Note.d.ts +23 -0
  81. package/dist/Note/index.d.ts +3 -0
  82. package/dist/Note/index.js +2 -0
  83. package/dist/Note-RT4L6VUT.css +58 -0
  84. package/dist/OrgTable/index.js +5 -5
  85. package/dist/PinTile/PinTile.d.ts +37 -0
  86. package/dist/PinTile/index.d.ts +3 -0
  87. package/dist/PinTile/index.js +4 -0
  88. package/dist/PinTile-IIA25MNZ.css +141 -0
  89. package/dist/PresenceModel/index.d.ts +2 -0
  90. package/dist/PresenceModel/index.js +3 -0
  91. package/dist/PresenceModel/presence.d.ts +80 -0
  92. package/dist/PresenceRing/PresenceRing.d.ts +31 -0
  93. package/dist/PresenceRing/index.d.ts +3 -0
  94. package/dist/PresenceRing/index.js +2 -0
  95. package/dist/PresenceRing-M4C22Q6U.css +68 -0
  96. package/dist/PresenceStack/PresenceStack.d.ts +36 -0
  97. package/dist/PresenceStack/index.d.ts +3 -0
  98. package/dist/PresenceStack/index.js +9 -0
  99. package/dist/PresenceStack-QSXQJND5.css +59 -0
  100. package/dist/PricingCard/index.js +2 -2
  101. package/dist/Principal/Principal.d.ts +35 -0
  102. package/dist/Principal/index.d.ts +2 -0
  103. package/dist/Principal/index.js +4 -0
  104. package/dist/PrincipalPicker/PrincipalPicker.d.ts +45 -0
  105. package/dist/PrincipalPicker/index.d.ts +3 -0
  106. package/dist/PrincipalPicker/index.js +12 -0
  107. package/dist/PrincipalPicker-7NNZTGUP.css +41 -0
  108. package/dist/Reorder/index.d.ts +2 -0
  109. package/dist/Reorder/index.js +4 -0
  110. package/dist/Reorder/useReorder.d.ts +138 -0
  111. package/dist/SandboxedFrame/SandboxedFrame.d.ts +142 -0
  112. package/dist/SandboxedFrame/index.d.ts +3 -0
  113. package/dist/SandboxedFrame/index.js +8 -0
  114. package/dist/SandboxedFrame-L6HBQZCD.css +50 -0
  115. package/dist/ShareDialog/ShareDialog.d.ts +101 -0
  116. package/dist/ShareDialog/index.d.ts +5 -0
  117. package/dist/ShareDialog/index.js +19 -0
  118. package/dist/ShareDialog/roles.d.ts +10 -0
  119. package/dist/ShareDialog-YZ4F37MW.css +146 -0
  120. package/dist/SheetGrid/SheetGrid.d.ts +78 -0
  121. package/dist/SheetGrid/cells.d.ts +117 -0
  122. package/dist/SheetGrid/index.d.ts +5 -0
  123. package/dist/SheetGrid/index.js +18 -0
  124. package/dist/SheetGrid-4HOXDVIB.css +595 -0
  125. package/dist/SheetModel/clipboard.d.ts +37 -0
  126. package/dist/SheetModel/edits.d.ts +68 -0
  127. package/dist/SheetModel/index.d.ts +14 -0
  128. package/dist/SheetModel/index.js +3 -0
  129. package/dist/SheetModel/labels.d.ts +71 -0
  130. package/dist/SheetModel/navigation.d.ts +79 -0
  131. package/dist/SheetModel/options.d.ts +28 -0
  132. package/dist/SheetModel/types.d.ts +126 -0
  133. package/dist/SheetModel/values.d.ts +76 -0
  134. package/dist/SheetModel/view.d.ts +32 -0
  135. package/dist/StatGroup/StatGroup.d.ts +7 -1
  136. package/dist/StatGroup/index.js +1 -1
  137. package/dist/{StatGroup-HVG6O62W.css → StatGroup-PADTJCUQ.css} +7 -0
  138. package/dist/Switcher/index.js +8 -8
  139. package/dist/Tag/Tag.d.ts +13 -0
  140. package/dist/Tag/index.js +1 -1
  141. package/dist/{Tag-4BRQS6GN.css → Tag-SRGTK5KI.css} +42 -0
  142. package/dist/TagsInput/index.js +4 -4
  143. package/dist/ThemeSwitcher/apply.d.ts +43 -0
  144. package/dist/ThemeSwitcher/index.d.ts +4 -2
  145. package/dist/ThemeSwitcher/index.js +3 -2
  146. package/dist/ThemeSwitcher/preferences.d.ts +2 -19
  147. package/dist/ThemeToggle/index.js +3 -2
  148. package/dist/TimeWindowPicker/index.js +4 -4
  149. package/dist/Timeline/Timeline.d.ts +7 -2
  150. package/dist/Timeline/index.js +1 -1
  151. package/dist/TreeCanvas/index.js +3 -3
  152. package/dist/TreeGrid/index.js +2 -2
  153. package/dist/VersionTimeline/VersionTimeline.d.ts +76 -0
  154. package/dist/VersionTimeline/index.d.ts +3 -0
  155. package/dist/VersionTimeline/index.js +10 -0
  156. package/dist/VersionTimeline-EBJ6MIPJ.css +108 -0
  157. package/dist/{chunk-SBRE7IML.js → chunk-2ONWEDQT.js} +1 -1
  158. package/dist/chunk-35XVR5JQ.js +81 -0
  159. package/dist/chunk-3BYIWOTV.js +29 -0
  160. package/dist/chunk-4KP4RC3O.js +25 -0
  161. package/dist/chunk-5XACKNYR.js +53 -0
  162. package/dist/chunk-63WJLRB2.js +24 -0
  163. package/dist/{chunk-L4ZLXYPO.js → chunk-6A7P6II6.js} +1 -1
  164. package/dist/chunk-6KWNXIDE.js +18 -0
  165. package/dist/chunk-6MIXD6IW.js +49 -0
  166. package/dist/{chunk-FA2V2VT6.js → chunk-7FQEUNHX.js} +4 -4
  167. package/dist/{chunk-DEEVA6TV.js → chunk-7IJARUIF.js} +17 -4
  168. package/dist/{chunk-JCO3SIST.js → chunk-7ZNKEPLN.js} +2 -2
  169. package/dist/chunk-AIVZVKYZ.js +126 -0
  170. package/dist/{chunk-FSKTOIYC.js → chunk-AJESMWJS.js} +5 -5
  171. package/dist/{chunk-O67VF5MS.js → chunk-AUQPBL4O.js} +2 -2
  172. package/dist/chunk-CENOOTAV.js +1 -0
  173. package/dist/chunk-DEJHAOC5.js +279 -0
  174. package/dist/{chunk-UCYIRDND.js → chunk-DQSXWQMJ.js} +1 -1
  175. package/dist/{chunk-JF7X673Z.js → chunk-EIGEIT4O.js} +2 -2
  176. package/dist/chunk-F6V2PTN6.js +142 -0
  177. package/dist/chunk-FFMCMSJB.js +1 -0
  178. package/dist/chunk-FW7HN6AP.js +40 -0
  179. package/dist/chunk-G3EEUNZQ.js +46 -0
  180. package/dist/{chunk-LOECRMHA.js → chunk-GFV4LJHH.js} +4 -3
  181. package/dist/chunk-HTCJSUIZ.js +216 -0
  182. package/dist/{chunk-75CLJNDQ.js → chunk-I6NZKJGK.js} +1 -1
  183. package/dist/chunk-I6POAB4V.js +20 -0
  184. package/dist/chunk-IXJHTFXG.js +17 -0
  185. package/dist/chunk-JEDWC3GI.js +98 -0
  186. package/dist/{chunk-QVAFL2LE.js → chunk-JXRI5YD2.js} +3 -3
  187. package/dist/{chunk-ZFH7H7GS.js → chunk-LOLELDBW.js} +1 -1
  188. package/dist/{chunk-6TSZCBID.js → chunk-NP2C4Y4E.js} +1 -1
  189. package/dist/{chunk-6NN2F7GM.js → chunk-OIMAK5AE.js} +6 -6
  190. package/dist/chunk-PPAQFGS2.js +12 -0
  191. package/dist/chunk-PUQY4WXR.js +1235 -0
  192. package/dist/chunk-QO7QEQKV.js +24 -0
  193. package/dist/chunk-RT323I4I.js +49 -0
  194. package/dist/chunk-S35G6PNC.js +80 -0
  195. package/dist/{chunk-HENOTGUV.js → chunk-T7ICFXEC.js} +2 -2
  196. package/dist/{chunk-2OLCUNG7.js → chunk-TBIZSQHB.js} +1 -1
  197. package/dist/chunk-TODND5AD.js +99 -0
  198. package/dist/{chunk-PQ63NLFC.js → chunk-UXELEORU.js} +3 -3
  199. package/dist/{chunk-6NIMZ5XC.js → chunk-VJLYGPPE.js} +1 -1
  200. package/dist/chunk-VYDFB6PJ.js +243 -0
  201. package/dist/{chunk-7QFAORCY.js → chunk-WHZFDS62.js} +1 -1
  202. package/dist/chunk-WXAULPBH.js +135 -0
  203. package/dist/chunk-XJ2QEBMM.js +277 -0
  204. package/dist/{chunk-NXDEPUVG.js → chunk-XU4ZUGLE.js} +20 -5
  205. package/dist/chunk-YM3GJHGW.js +69 -0
  206. package/dist/{chunk-T3ZWBZ65.js → chunk-YSJYWQSP.js} +2 -2
  207. package/dist/{chunk-CXBAIVYZ.js → chunk-YSY6UJ4F.js} +1 -1
  208. package/dist/chunk-YYZRLLLY.js +822 -0
  209. package/dist/{chunk-EG6NYWVK.js → chunk-YZCJ63JF.js} +1 -1
  210. package/dist/{chunk-K3OWD7BJ.js → chunk-Z24ZUSTX.js} +4 -19
  211. package/dist/chunk-ZXXDZJQN.js +36 -0
  212. package/dist/generated/index.d.ts +27 -0
  213. package/dist/generated/index.js +98 -69
  214. package/dist/index.js +98 -69
  215. package/dist/styles.css +13625 -11206
  216. package/dist/utils/index.js +1 -1
  217. package/package.json +3 -3
  218. package/dist/chunk-EXHQ2QVW.js +0 -1
  219. package/dist/{chunk-CRVETI5L.js → chunk-4Z7PW3L6.js} +0 -0
  220. package/dist/{chunk-OYOQU7O5.js → chunk-EDGCPVVD.js} +1 -1
  221. package/dist/{chunk-NS7BVLL3.js → chunk-JULMZNGT.js} +1 -1
  222. package/dist/{chunk-2UU5IGZI.js → chunk-L4H7SSWF.js} +1 -1
  223. package/dist/{chunk-4GB57WIT.js → chunk-Q55TXPA3.js} +1 -1
  224. package/dist/{chunk-77IEHFY4.js → chunk-QQGWES46.js} +1 -1
  225. package/dist/{chunk-B2Z2CDM5.js → chunk-T5TFZ2JB.js} +1 -1
  226. package/dist/{chunk-AMH67MLM.js → chunk-TXAFKH2A.js} +1 -1
@@ -0,0 +1,59 @@
1
+ /*
2
+ * Who is here (PresenceStack.tsx), on the avatar stack's own geometry: the
3
+ * overlap and the counted chip are the stack's. What this adds is the ring in
4
+ * each present collaborator's hue, outside the cut-out, and the idle fade.
5
+ */
6
+
7
+ /* The wrapper (a span, or a button when badges select) carries no edge of its
8
+ own: the cut-out and the hue ring are drawn on the badge inside it, which
9
+ has the badge's own outline to follow. */
10
+ .crewlet-presence-stack > .crewlet-presence-stack__member {
11
+ display: inline-flex;
12
+ flex: none;
13
+ padding: 0;
14
+ border: 0;
15
+ background: none;
16
+ box-shadow: none;
17
+ color: inherit;
18
+ font: inherit;
19
+ }
20
+
21
+ .crewlet-presence-stack > .crewlet-presence-stack__member--human {
22
+ border-radius: var(--radius-circle);
23
+ }
24
+
25
+ .crewlet-presence-stack > .crewlet-presence-stack__member--agent {
26
+ border-radius: var(--radius-sm);
27
+ }
28
+
29
+ button.crewlet-presence-stack__member {
30
+ cursor: pointer;
31
+ }
32
+
33
+ button.crewlet-presence-stack__member:focus-visible {
34
+ outline: 2px solid var(--color-focus);
35
+ outline-offset: var(--size-focus-ring-inset-offset);
36
+ }
37
+
38
+ .crewlet-presence-stack .crewlet-presence-stack__badge {
39
+ box-shadow: 0 0 0 2px var(--crewlet-avatar-stack-ground);
40
+ }
41
+
42
+ /* The hue ring sits outside the cut-out, so it reads as a ring round the
43
+ badge rather than a stroke on it. */
44
+ .crewlet-presence-stack .crewlet-presence-stack__badge--present {
45
+ box-shadow:
46
+ 0 0 0 2px var(--crewlet-avatar-stack-ground),
47
+ 0 0 0 4px var(--crewlet-presence-hue);
48
+ }
49
+
50
+ .crewlet-presence-stack .crewlet-presence-stack__badge--idle {
51
+ opacity: 0.5;
52
+ }
53
+
54
+ @media (forced-colors: active) {
55
+ .crewlet-presence-stack .crewlet-presence-stack__badge--present {
56
+ outline: 2px solid Highlight;
57
+ outline-offset: 2px;
58
+ }
59
+ }
@@ -1,4 +1,4 @@
1
- export { PricingCard } from '../chunk-UCYIRDND.js';
2
- import '../chunk-LOECRMHA.js';
1
+ export { PricingCard } from '../chunk-DQSXWQMJ.js';
2
+ import '../chunk-GFV4LJHH.js';
3
3
  import '../chunk-WIATRXEJ.js';
4
4
  import '../chunk-ODEQTPFM.js';
@@ -0,0 +1,35 @@
1
+ import type { CrewletCharacterId } from '@crewlethq/icons/characters';
2
+ import { type AvatarSize } from '../Avatar/index.js';
3
+ import type { NodeHue } from '../utils/nodeHue.js';
4
+ /**
5
+ * Who something is shared with, made by or owned by.
6
+ *
7
+ * `person` and `agent` are seats (a person holds a human seat), drawn as the
8
+ * circle and the squircle `Avatar` already draws them as. A `team` is an org
9
+ * unit: everyone in it and below it, people and agents alike, so it is drawn
10
+ * with the people glyph rather than anybody's initials.
11
+ */
12
+ export type PrincipalKind = 'person' | 'agent' | 'team';
13
+ export declare const PRINCIPAL_KINDS: readonly ["person", "agent", "team"];
14
+ export interface Principal {
15
+ /** Stable across renames: a seat handle or a unit key. */
16
+ id: string;
17
+ kind: PrincipalKind;
18
+ name: string;
19
+ /** A short second line: a unit, a handle, "6 people, 4 agents". */
20
+ detail?: string | undefined;
21
+ /** The Crewlet character an agent is drawn as. */
22
+ character?: CrewletCharacterId | undefined;
23
+ /** The hue an agent's character is drawn in. */
24
+ hue?: NodeHue | undefined;
25
+ /** A person's picture. */
26
+ src?: string | undefined;
27
+ }
28
+ export interface PrincipalAvatarProps {
29
+ principal: Principal;
30
+ size?: AvatarSize | undefined;
31
+ /** The name is printed beside the badge, so the badge says nothing itself. Defaults to true. */
32
+ decorative?: boolean | undefined;
33
+ }
34
+ /** A principal's badge, drawn the one way every surface draws it. */
35
+ export declare function PrincipalAvatar({ principal, size, decorative }: PrincipalAvatarProps): import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { PRINCIPAL_KINDS, PrincipalAvatar } from './Principal.js';
2
+ export type { Principal, PrincipalAvatarProps, PrincipalKind } from './Principal.js';
@@ -0,0 +1,4 @@
1
+ export { PRINCIPAL_KINDS, PrincipalAvatar } from '../chunk-4KP4RC3O.js';
2
+ import '../chunk-UAN5NE7M.js';
3
+ import '../chunk-5OM447RW.js';
4
+ import '../chunk-ODEQTPFM.js';
@@ -0,0 +1,45 @@
1
+ import { type Principal, type PrincipalKind } from '../Principal/index.js';
2
+ /** A principal that may be offered but not taken, with the reason in words. */
3
+ export interface PrincipalOption extends Principal {
4
+ disabled?: boolean | undefined;
5
+ /** Why it cannot be picked: "Already has access", "Only a person can add the whole company". */
6
+ disabledReason?: string | undefined;
7
+ }
8
+ export interface PrincipalPickerLabels {
9
+ /** The heading over each kind's group of suggestions. */
10
+ groups: Record<PrincipalKind, string>;
11
+ empty: string;
12
+ loading: string;
13
+ }
14
+ export interface PrincipalPickerProps {
15
+ /** What the field holds. The caller owns it, and searches with it. */
16
+ query: string;
17
+ onQueryChange: (query: string) => void;
18
+ /**
19
+ * The matches for `query`, in any order: they are grouped people, then
20
+ * agents, then teams. The caller filters, because who matches is the
21
+ * engine's answer, not a substring of a list the browser happens to hold.
22
+ */
23
+ options: readonly PrincipalOption[];
24
+ onPick: (principal: Principal) => void;
25
+ /** Names the field and its list. */
26
+ label: string;
27
+ placeholder?: string | undefined;
28
+ /** A search is in flight; the list says so instead of saying nobody matches. */
29
+ loading?: boolean | undefined;
30
+ disabled?: boolean | undefined;
31
+ className?: string | undefined;
32
+ labels?: Partial<PrincipalPickerLabels> | undefined;
33
+ }
34
+ /**
35
+ * A search over people, agents and teams, with each match drawn as itself.
36
+ *
37
+ * THE LIST IS GROUPED BY KIND, because "Operations" the team and "Operations
38
+ * Lead" the agent are different answers to "who should see this", and a flat
39
+ * list of names makes a reader stop on every row to find out which is which.
40
+ * The groups are real ARIA groups named by their headings, and the highlight
41
+ * still moves through every option in order, across the groups.
42
+ *
43
+ * Picking clears the field, ready for the next name.
44
+ */
45
+ export declare function PrincipalPicker({ query, onQueryChange, options, onPick, label, placeholder, loading, disabled, className, labels, }: PrincipalPickerProps): import("react").JSX.Element;
@@ -0,0 +1,3 @@
1
+ import './PrincipalPicker.css';
2
+ export { PrincipalPicker } from './PrincipalPicker.js';
3
+ export type { PrincipalOption, PrincipalPickerLabels, PrincipalPickerProps } from './PrincipalPicker.js';
@@ -0,0 +1,12 @@
1
+ export { PrincipalPicker } from '../chunk-JEDWC3GI.js';
2
+ import '../chunk-LOLELDBW.js';
3
+ import '../chunk-F73MC7EZ.js';
4
+ import '../chunk-Q55TXPA3.js';
5
+ import '../chunk-4KP4RC3O.js';
6
+ import '../chunk-UAN5NE7M.js';
7
+ import '../chunk-5OM447RW.js';
8
+ import '../chunk-PQADV6P6.js';
9
+ import '../chunk-R25RGPUB.js';
10
+ import '../chunk-4FQT6ZAY.js';
11
+ import '../chunk-BZFWDIV6.js';
12
+ import '../chunk-ODEQTPFM.js';
@@ -0,0 +1,41 @@
1
+ /*
2
+ * The suggestions under the field, grouped by kind. A row is the badge and the
3
+ * name with its second line, the shape every list of principals in the
4
+ * product draws.
5
+ */
6
+
7
+ .crewlet-principal-picker {
8
+ flex: 1 1 auto;
9
+ min-width: 0;
10
+ }
11
+
12
+ .crewlet-principal-picker__group + .crewlet-principal-picker__group {
13
+ margin-top: var(--spacing-1);
14
+ padding-top: var(--spacing-1);
15
+ border-top: 1px solid var(--color-border-default);
16
+ }
17
+
18
+ .crewlet-principal-picker__heading {
19
+ padding: var(--spacing-1) var(--spacing-2);
20
+ color: var(--color-text-tertiary);
21
+ font-size: var(--font-size-xs);
22
+ font-weight: var(--font-weight-medium);
23
+ }
24
+
25
+ .crewlet-principal-picker__option {
26
+ display: flex;
27
+ align-items: center;
28
+ gap: var(--spacing-2);
29
+ }
30
+
31
+ .crewlet-principal-picker__text {
32
+ display: flex;
33
+ flex-direction: column;
34
+ min-width: 0;
35
+ }
36
+
37
+ .crewlet-principal-picker__name {
38
+ overflow: hidden;
39
+ text-overflow: ellipsis;
40
+ white-space: nowrap;
41
+ }
@@ -0,0 +1,2 @@
1
+ export { useReorder, useReorderLists, moveKey, DEFAULT_REORDER_LABELS } from './useReorder.js';
2
+ export type { Reorder, ReorderAxis, ReorderContainerProps, ReorderHandleProps, ReorderItemProps, ReorderLabels, ReorderLists, ReorderListsState, UseReorderListsOptions, UseReorderOptions, } from './useReorder.js';
@@ -0,0 +1,4 @@
1
+ export { DEFAULT_REORDER_LABELS, moveKey, useReorder, useReorderLists } from '../chunk-XJ2QEBMM.js';
2
+ import '../chunk-RSAQOKH3.js';
3
+ import '../chunk-BZFWDIV6.js';
4
+ import '../chunk-ODEQTPFM.js';
@@ -0,0 +1,138 @@
1
+ import { type DragEvent, type KeyboardEvent } from 'react';
2
+ /**
3
+ * How the arrow keys map to a move.
4
+ *
5
+ * - `vertical`: Up moves an item one place earlier, Down one place later. A
6
+ * list.
7
+ * - `grid`: Left and Up move it one place earlier, Right and Down one place
8
+ * later. A wrapping row of cards, where the reading order is the order and
9
+ * "the card above" is not a position the list holds.
10
+ */
11
+ export type ReorderAxis = 'vertical' | 'grid';
12
+ export interface ReorderLabels {
13
+ /** What the handle does, and its NAME: "Move Projects". */
14
+ handle: (name: string) => string;
15
+ /** The instruction a handle is described by, for a reader who cannot drag. */
16
+ hint: string;
17
+ /** Said after every move, by any means: "Projects moved to position 2 of 6." */
18
+ moved: (name: string, position: number, total: number) => string;
19
+ }
20
+ export declare const DEFAULT_REORDER_LABELS: ReorderLabels;
21
+ /** Several ordered lists, by the id of the container each one is drawn in. */
22
+ export type ReorderLists<K extends string> = Readonly<Record<string, readonly K[]>>;
23
+ export interface UseReorderListsOptions<K extends string> {
24
+ /** Every list as it stands. The hook never owns them. */
25
+ lists: ReorderLists<K>;
26
+ /** A finished move: a drop, an arrow key or a call to `move`. */
27
+ onReorder: (next: Record<string, K[]>) => void;
28
+ /** What a reader calls an item, for the handle's name and the announcement. */
29
+ nameOf: (key: K) => string;
30
+ /**
31
+ * Whether an item may be dropped into a list. Left out, every item goes
32
+ * anywhere. A page refuses a group inside a group here.
33
+ */
34
+ accepts?: ((key: K, list: string) => boolean) | undefined;
35
+ axis?: ReorderAxis | undefined;
36
+ labels?: Partial<ReorderLabels> | undefined;
37
+ }
38
+ export interface ReorderHandleProps {
39
+ draggable: true;
40
+ 'aria-label': string;
41
+ 'aria-describedby': string;
42
+ onDragStart: (event: DragEvent<HTMLElement>) => void;
43
+ onDragEnd: () => void;
44
+ onKeyDown: (event: KeyboardEvent<HTMLElement>) => void;
45
+ }
46
+ export interface ReorderItemProps {
47
+ ref: (node: HTMLElement | null) => void;
48
+ 'data-reorder': 'dragging' | 'idle';
49
+ /** Set on the item another list's drag would land before, or after when it is the last. */
50
+ 'data-reorder-target'?: 'before' | 'after' | undefined;
51
+ /**
52
+ * Which way the target's marker runs: `vertical` beside an item that shares
53
+ * its row, `horizontal` above or below one that spans the row.
54
+ */
55
+ 'data-reorder-line'?: 'vertical' | 'horizontal' | undefined;
56
+ onDragOver: (event: DragEvent<HTMLElement>) => void;
57
+ onDrop: (event: DragEvent<HTMLElement>) => void;
58
+ }
59
+ export interface ReorderContainerProps {
60
+ 'data-reorder-over'?: 'true' | undefined;
61
+ onDragOver: (event: DragEvent<HTMLElement>) => void;
62
+ onDrop: (event: DragEvent<HTMLElement>) => void;
63
+ }
64
+ export interface ReorderListsState<K extends string> {
65
+ /** The lists to DRAW: the caller's, or the preview while a drag is held. */
66
+ lists: Readonly<Record<string, readonly K[]>>;
67
+ /** The item being dragged, if any. */
68
+ dragging: K | null;
69
+ /** Spread on the control an item is moved BY. */
70
+ handleProps: (key: K) => ReorderHandleProps;
71
+ /** Spread on the element that holds the item, the one a drag passes over. */
72
+ itemProps: (key: K) => ReorderItemProps;
73
+ /**
74
+ * Spread on the element a list is drawn in. A drop in the gap between two
75
+ * items keeps the preview, and a drag over an EMPTY stretch of another list
76
+ * (an empty group, the space after its last item) moves the item to its end.
77
+ */
78
+ listProps: (list: string) => ReorderContainerProps;
79
+ /** Move an item by a number of places within its own list, clamped to the ends. */
80
+ move: (key: K, by: number) => void;
81
+ /** Move an item to the end of another list, by command (a menu's "Move to"). */
82
+ moveTo: (key: K, list: string) => void;
83
+ /** The id of the hidden instruction every handle is described by. */
84
+ hintId: string;
85
+ /** The instruction itself, for the caller to render once (`VisuallyHidden`). */
86
+ hint: string;
87
+ }
88
+ export interface UseReorderOptions<K extends string> {
89
+ keys: readonly K[];
90
+ onReorder: (next: K[]) => void;
91
+ nameOf: (key: K) => string;
92
+ axis?: ReorderAxis | undefined;
93
+ labels?: Partial<ReorderLabels> | undefined;
94
+ }
95
+ export interface Reorder<K extends string> {
96
+ order: readonly K[];
97
+ dragging: K | null;
98
+ handleProps: (key: K) => ReorderHandleProps;
99
+ itemProps: (key: K) => ReorderItemProps;
100
+ containerProps: ReorderContainerProps;
101
+ move: (key: K, by: number) => void;
102
+ hintId: string;
103
+ hint: string;
104
+ }
105
+ /** `keys` with `key` taken out and put back at `to`. */
106
+ export declare function moveKey<K>(keys: readonly K[], key: K, to: number): K[];
107
+ /**
108
+ * Reordering items within and between lists, by drag, by keyboard and by
109
+ * command, as one operation: the cards of a page and the cards inside each
110
+ * of its groups.
111
+ *
112
+ * ONE IMPLEMENTATION, because there were three. DataTable's column settings,
113
+ * the dashboard's priority list and its board each carried their own drag
114
+ * handlers, and only one of them could be reached from a keyboard. This hook
115
+ * is that one's rules, given to every list that can be put in order.
116
+ *
117
+ * THE HANDLE IS A CONTROL. It is what an item is dragged BY, it has a name
118
+ * ("Move Projects"), it takes focus, and the arrow keys move the item from
119
+ * there. Moving into another list by keyboard is `moveTo`, which a caller
120
+ * offers as a command ("Move to group"), because "the next list" is not a
121
+ * direction an arrow key names.
122
+ *
123
+ * THE CALLER OWNS THE LISTS. While a drag is held the hook draws a PREVIEW
124
+ * within the item's own list and MARKS where it would land in another one
125
+ * (`data-reorder-target` on the item it would precede, `data-reorder-over`
126
+ * on the list); a drop reports the new lists once, and a drag that ends
127
+ * anywhere else (Escape, outside every list) leaves them as they were.
128
+ *
129
+ * EVERY MOVE IS SAID, through the page's `Announcer`, and ITEMS GLIDE to
130
+ * their new place (a FLIP transform) unless the reader asked for reduced
131
+ * motion.
132
+ */
133
+ export declare function useReorderLists<K extends string>({ lists, onReorder, nameOf, accepts, axis, labels: labelOverrides, }: UseReorderListsOptions<K>): ReorderListsState<K>;
134
+ /**
135
+ * One list's reordering: `useReorderLists` over a single list, for the
136
+ * common case of a settings panel or a shelf.
137
+ */
138
+ export declare function useReorder<K extends string>({ keys, onReorder, nameOf, axis, labels, }: UseReorderOptions<K>): Reorder<K>;
@@ -0,0 +1,142 @@
1
+ import { type HTMLAttributes } from 'react';
2
+ import { type FrameBridgeRange, type FrameHello, type FrameOriginMode, type FrameTheme } from '../FrameProtocol/index.js';
3
+ /**
4
+ * Where the frame is in its life.
5
+ *
6
+ * `loading` until the document has said hello, `ready` once it holds a port,
7
+ * and four ends, each torn down rather than left showing a document nobody
8
+ * vouched for: `failed` (it never said hello), `navigated` (a document that did
9
+ * not say hello replaced one that had), `refused` (the policy it arrived with
10
+ * is not one this host embeds) and `outdated` (it speaks no bridge version
11
+ * this host does).
12
+ */
13
+ export type SandboxedFrameState = 'loading' | 'ready' | 'failed' | 'navigated' | 'refused' | 'outdated';
14
+ /**
15
+ * Something the host turned away, reported so the page around the frame can
16
+ * record it. None of these is shown to the reader as more than the frame's
17
+ * own state: they are evidence for whoever reads the logs.
18
+ */
19
+ export type FrameRefusal =
20
+ /** The engine's sandbox attribute carried tokens this host never sets. */
21
+ {
22
+ kind: 'sandbox';
23
+ tokens: string[];
24
+ }
25
+ /** The frame URL is not http or https, or is not served from the origin it was given. */
26
+ | {
27
+ kind: 'src';
28
+ }
29
+ /** The nonce handed to the frame is not the shape the engine mints. */
30
+ | {
31
+ kind: 'nonce';
32
+ }
33
+ /** The embedded window said hello from the wrong origin. */
34
+ | {
35
+ kind: 'origin';
36
+ origin: string;
37
+ }
38
+ /** The embedded window said hello with a nonce that is not this frame's. */
39
+ | {
40
+ kind: 'hello-nonce';
41
+ }
42
+ /** A second hello without a document load between, or any second hello on the shared host. */
43
+ | {
44
+ kind: 'rehello';
45
+ }
46
+ /** The runtime speaks no bridge version this host does. */
47
+ | {
48
+ kind: 'bridge';
49
+ offered: FrameBridgeRange;
50
+ }
51
+ /** The page asked to open something that is not an external http, https or mailto link. */
52
+ | {
53
+ kind: 'link';
54
+ url: string;
55
+ };
56
+ export interface SandboxedFrameLabels {
57
+ /** The loading line, said once to a screen reader and drawn under the placeholder. */
58
+ loading: (title: string) => string;
59
+ failed: string;
60
+ failedDetail: string;
61
+ navigated: string;
62
+ navigatedDetail: string;
63
+ refused: string;
64
+ refusedDetail: string;
65
+ outdated: string;
66
+ outdatedDetail: string;
67
+ reload: string;
68
+ }
69
+ /** How long a document has to say hello after the frame mounts, or after a load, before it is torn down. */
70
+ export declare const FRAME_HELLO_TIMEOUT_MS = 10000;
71
+ type FrameDivAttributes = Omit<HTMLAttributes<HTMLDivElement>, 'title' | 'onMessage' | 'children' | 'role' | 'aria-label'>;
72
+ export interface SandboxedFrameProps extends FrameDivAttributes {
73
+ /** The engine's ticketed frame URL (`Frame.frame_url`). The host appends the fragment. */
74
+ src: string;
75
+ /**
76
+ * The origin the document is served from (`Frame.origin`). Per artifact, the
77
+ * hello must come from exactly this origin. On the shared host the document
78
+ * is opaque, its hello comes from `"null"`, and this may be that host's
79
+ * origin or `"null"` itself.
80
+ */
81
+ origin: string;
82
+ /** How the engine isolated the artifact (`Frame.mode`). */
83
+ mode: FrameOriginMode;
84
+ /** The engine's sandbox attribute (`Frame.sandbox`), set verbatim once it passes the host's own check. */
85
+ sandbox: string;
86
+ /** The engine's permissions attribute (`Frame.allow`), set verbatim. */
87
+ allow?: string | undefined;
88
+ /** The artifact's title. It names the frame, and the region around it, to assistive technology. */
89
+ title: string;
90
+ /**
91
+ * The reader's appearance. The value at mount goes in the fragment, so the
92
+ * first paint is already right; later values are posted on the port.
93
+ */
94
+ theme: FrameTheme;
95
+ /** The handshake nonce minted with the ticket (`Frame.nonce`). */
96
+ nonce: string;
97
+ /** The document said hello and holds its port. Called again for each document that does. */
98
+ onReady?: ((port: MessagePort, hello: FrameHello) => void) | undefined;
99
+ /** Every port message the frame does not handle itself. UNTRUSTED input: decide every call. */
100
+ onMessage?: ((data: unknown, port: MessagePort) => void) | undefined;
101
+ /**
102
+ * The page asked to open an external link. The frame never opens a window
103
+ * itself: the page around it shows the destination first (`LinkInterstitial`).
104
+ */
105
+ onOpenLink?: ((url: URL) => void) | undefined;
106
+ /**
107
+ * The page asked to give focus back, which is how a reader leaves a page
108
+ * that traps Tab. Without a handler, focus moves to the frame's region.
109
+ */
110
+ onFocusExit?: (() => void) | undefined;
111
+ onStateChange?: ((state: SandboxedFrameState) => void) | undefined;
112
+ onRefusal?: ((refusal: FrameRefusal) => void) | undefined;
113
+ /** Offered on every end state as the Reload action. Mint a fresh frame, then re-render with it. */
114
+ onReload?: (() => void) | undefined;
115
+ helloTimeoutMs?: number | undefined;
116
+ labels?: Partial<SandboxedFrameLabels> | undefined;
117
+ }
118
+ /**
119
+ * An artifact's document, embedded in a sandboxed frame and spoken to over one
120
+ * transferred `MessagePort`.
121
+ *
122
+ * THE HANDSHAKE IS THE WHOLE SECURITY OF THE BRIDGE. A hello is accepted only
123
+ * from this iframe's own window, carrying the nonce minted with its ticket,
124
+ * and, per artifact, from the artifact's own origin. Only then is a fresh
125
+ * port transferred, in the same task, to the window that was checked. Every
126
+ * later call travels on that port, which no other window can address, and a
127
+ * document that navigates away loses it.
128
+ *
129
+ * A DOCUMENT THAT DOES NOT ANNOUNCE ITSELF IS TORN DOWN. The engine's runtime
130
+ * says hello on every load, so a load with no hello means the frame now holds
131
+ * a document the engine did not serve, and the frame is removed rather than
132
+ * left on screen. On the shared host, where origins are opaque, a document
133
+ * gets one handshake per ticket; a second document needs a fresh ticket.
134
+ *
135
+ * The frame never opens a window: an external link reaches `onOpenLink`, and
136
+ * the page around the frame decides.
137
+ *
138
+ * A new `src` or `nonce` is a new frame: everything is torn down and started
139
+ * again, as if the component had been remounted.
140
+ */
141
+ export declare function SandboxedFrame(props: SandboxedFrameProps): import("react").JSX.Element;
142
+ export {};
@@ -0,0 +1,3 @@
1
+ import './SandboxedFrame.css';
2
+ export { FRAME_HELLO_TIMEOUT_MS, SandboxedFrame } from './SandboxedFrame.js';
3
+ export type { FrameRefusal, SandboxedFrameLabels, SandboxedFrameProps, SandboxedFrameState } from './SandboxedFrame.js';
@@ -0,0 +1,8 @@
1
+ export { FRAME_HELLO_TIMEOUT_MS, SandboxedFrame } from '../chunk-VYDFB6PJ.js';
2
+ import '../chunk-W5J7R5EB.js';
3
+ import '../chunk-F6V2PTN6.js';
4
+ import '../chunk-ZXXDZJQN.js';
5
+ import '../chunk-SVSCLHHI.js';
6
+ import '../chunk-OG6CL3EB.js';
7
+ import '../chunk-BZFWDIV6.js';
8
+ import '../chunk-ODEQTPFM.js';
@@ -0,0 +1,50 @@
1
+ /*
2
+ * The frame fills the box it is given. The page around it does not scroll
3
+ * round the artifact: the artifact scrolls inside its own document, which is
4
+ * what a viewer body that holds one wants.
5
+ *
6
+ * The region takes focus when the frame hands it back, and keeps the
7
+ * document's own focus treatment then: a reader who just left a page by
8
+ * keyboard needs to see where they landed.
9
+ */
10
+
11
+ .crewlet-sandboxed-frame {
12
+ position: relative;
13
+ display: flex;
14
+ flex-direction: column;
15
+ width: 100%;
16
+ height: 100%;
17
+ min-height: 0;
18
+ overflow: hidden;
19
+ border-radius: var(--radius-md);
20
+ background: var(--color-surface-background);
21
+ }
22
+
23
+ .crewlet-sandboxed-frame__frame {
24
+ flex: 1 1 auto;
25
+ display: block;
26
+ width: 100%;
27
+ height: 100%;
28
+ border: 0;
29
+ background: transparent;
30
+ }
31
+
32
+ /* Kept out of sight while it starts, so a document that has not painted in
33
+ the reader's palette yet is never what they see. It still loads. */
34
+ .crewlet-sandboxed-frame[data-state='loading'] .crewlet-sandboxed-frame__frame {
35
+ visibility: hidden;
36
+ }
37
+
38
+ .crewlet-sandboxed-frame__loading {
39
+ position: absolute;
40
+ inset: 0;
41
+ display: flex;
42
+ padding: var(--spacing-3);
43
+ }
44
+
45
+ .crewlet-sandboxed-frame__end {
46
+ display: flex;
47
+ flex-direction: column;
48
+ justify-content: flex-start;
49
+ padding: var(--spacing-4);
50
+ }