@dxos/react-ui-stack 0.6.14-staging.e15392e → 0.7.1-staging.599df14

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 (92) hide show
  1. package/dist/lib/browser/index.mjs +493 -335
  2. package/dist/lib/browser/index.mjs.map +4 -4
  3. package/dist/lib/browser/meta.json +1 -1
  4. package/dist/lib/browser/testing/index.mjs +3 -6
  5. package/dist/lib/browser/testing/index.mjs.map +3 -3
  6. package/dist/lib/node/index.cjs +477 -326
  7. package/dist/lib/node/index.cjs.map +4 -4
  8. package/dist/lib/node/meta.json +1 -1
  9. package/dist/lib/node/testing/index.cjs +3 -6
  10. package/dist/lib/node/testing/index.cjs.map +3 -3
  11. package/dist/lib/node-esm/index.mjs +493 -335
  12. package/dist/lib/node-esm/index.mjs.map +4 -4
  13. package/dist/lib/node-esm/meta.json +1 -1
  14. package/dist/lib/node-esm/testing/index.mjs +3 -6
  15. package/dist/lib/node-esm/testing/index.mjs.map +3 -3
  16. package/dist/types/src/components/LayoutControls.d.ts +19 -0
  17. package/dist/types/src/components/LayoutControls.d.ts.map +1 -0
  18. package/dist/types/src/components/MenuSignifier.d.ts +4 -0
  19. package/dist/types/src/components/MenuSignifier.d.ts.map +1 -0
  20. package/dist/types/src/components/Stack.d.ts +12 -12
  21. package/dist/types/src/components/Stack.d.ts.map +1 -1
  22. package/dist/types/src/components/Stack.stories.d.ts +6 -83
  23. package/dist/types/src/components/Stack.stories.d.ts.map +1 -1
  24. package/dist/types/src/components/StackContext.d.ts +19 -0
  25. package/dist/types/src/components/StackContext.d.ts.map +1 -0
  26. package/dist/types/src/components/StackItem.d.ts +41 -0
  27. package/dist/types/src/components/StackItem.d.ts.map +1 -0
  28. package/dist/types/src/components/StackItemContent.d.ts +8 -0
  29. package/dist/types/src/components/StackItemContent.d.ts.map +1 -0
  30. package/dist/types/src/components/StackItemHeading.d.ts +8 -0
  31. package/dist/types/src/components/StackItemHeading.d.ts.map +1 -0
  32. package/dist/types/src/components/StackItemResizeHandle.d.ts +3 -0
  33. package/dist/types/src/components/StackItemResizeHandle.d.ts.map +1 -0
  34. package/dist/types/src/components/StackItemSigil.d.ts +31 -0
  35. package/dist/types/src/components/StackItemSigil.d.ts.map +1 -0
  36. package/dist/types/src/components/index.d.ts +2 -1
  37. package/dist/types/src/components/index.d.ts.map +1 -1
  38. package/dist/types/src/testing/EditorContent.d.ts +2 -2
  39. package/dist/types/src/testing/EditorContent.d.ts.map +1 -1
  40. package/dist/types/src/testing/stack-manager.d.ts +0 -1
  41. package/dist/types/src/testing/stack-manager.d.ts.map +1 -1
  42. package/dist/types/src/translations.d.ts +7 -8
  43. package/dist/types/src/translations.d.ts.map +1 -1
  44. package/package.json +20 -21
  45. package/src/components/LayoutControls.tsx +131 -0
  46. package/src/components/MenuSignifier.tsx +33 -0
  47. package/src/components/Stack.stories.tsx +109 -182
  48. package/src/components/Stack.tsx +61 -156
  49. package/src/components/StackContext.tsx +38 -0
  50. package/src/components/StackItem.tsx +173 -0
  51. package/src/components/StackItemContent.tsx +47 -0
  52. package/src/components/StackItemHeading.tsx +55 -0
  53. package/src/components/StackItemResizeHandle.tsx +115 -0
  54. package/src/components/StackItemSigil.tsx +170 -0
  55. package/src/components/index.ts +3 -2
  56. package/src/playwright/smoke.spec.ts +3 -3
  57. package/src/testing/EditorContent.tsx +4 -4
  58. package/src/testing/stack-manager.ts +3 -7
  59. package/src/translations.ts +7 -8
  60. package/dist/types/src/components/CaretDownUp.d.ts +0 -4
  61. package/dist/types/src/components/CaretDownUp.d.ts.map +0 -1
  62. package/dist/types/src/components/ContentTypes.stories.d.ts +0 -96
  63. package/dist/types/src/components/ContentTypes.stories.d.ts.map +0 -1
  64. package/dist/types/src/components/Deck.stories.d.ts +0 -19
  65. package/dist/types/src/components/Deck.stories.d.ts.map +0 -1
  66. package/dist/types/src/components/Section.d.ts +0 -53
  67. package/dist/types/src/components/Section.d.ts.map +0 -1
  68. package/dist/types/src/components/Section.stories.d.ts +0 -36
  69. package/dist/types/src/components/Section.stories.d.ts.map +0 -1
  70. package/dist/types/src/components/style-fragments.d.ts +0 -2
  71. package/dist/types/src/components/style-fragments.d.ts.map +0 -1
  72. package/dist/types/src/next/Stack.d.ts +0 -9
  73. package/dist/types/src/next/Stack.d.ts.map +0 -1
  74. package/dist/types/src/next/Stack.stories.d.ts +0 -8
  75. package/dist/types/src/next/Stack.stories.d.ts.map +0 -1
  76. package/dist/types/src/next/StackItem.d.ts +0 -14
  77. package/dist/types/src/next/StackItem.d.ts.map +0 -1
  78. package/dist/types/src/next/index.d.ts +0 -2
  79. package/dist/types/src/next/index.d.ts.map +0 -1
  80. package/dist/types/src/testing/TableContent.d.ts +0 -20
  81. package/dist/types/src/testing/TableContent.d.ts.map +0 -1
  82. package/src/components/CaretDownUp.tsx +0 -31
  83. package/src/components/ContentTypes.stories.tsx +0 -104
  84. package/src/components/Deck.stories.tsx +0 -362
  85. package/src/components/Section.stories.tsx +0 -50
  86. package/src/components/Section.tsx +0 -378
  87. package/src/components/style-fragments.ts +0 -5
  88. package/src/next/Stack.stories.tsx +0 -148
  89. package/src/next/Stack.tsx +0 -30
  90. package/src/next/StackItem.tsx +0 -78
  91. package/src/next/index.ts +0 -5
  92. package/src/testing/TableContent.tsx +0 -119
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StackItem.d.ts","sourceRoot":"","sources":["../../../../src/components/StackItem.tsx"],"names":[],"mappings":"AAMA,OAAO,EAEL,KAAK,IAAI,EAEV,MAAM,uDAAuD,CAAC;AAI/D,OAAO,KAAK,EAAE,EAAyC,KAAK,qBAAqB,EAAe,MAAM,OAAO,CAAC;AAE9G,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAItD,OAAO,EAAoB,KAAK,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAClF,OAAO,EAGL,KAAK,qBAAqB,EAC1B,KAAK,0BAA0B,EAChC,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,yBAAyB,EAE/B,MAAM,kBAAkB,CAAC;AAE1B,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,aAAa,CAAC;AACnD,eAAO,MAAM,uBAAuB,KAA6B,CAAC;AAClE,eAAO,MAAM,qBAAqB,gBAAwC,CAAC;AAC3E,eAAO,MAAM,sBAAsB,KAAkD,CAAC;AAEtF,MAAM,MAAM,aAAa,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,CAAA;CAAE,CAAC;AAEpE,MAAM,MAAM,kBAAkB,GAAG,eAAe,CAAC,qBAAqB,CAAC,KAAK,CAAC,CAAC,GAAG;IAC/E,IAAI,EAAE,IAAI,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,aAAa,EAAE,WAAW,EAAE,IAAI,GAAG,IAAI,KAAK,IAAI,CAAC;IAC/F,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,YAAY,CAAC,EAAE,CAAC,QAAQ,EAAE,aAAa,KAAK,IAAI,CAAC;IACjD,IAAI,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;CAC9B,CAAC;AAyGF,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;CAQrB,CAAC;AAEF,YAAY,EACV,qBAAqB,EACrB,qBAAqB,EACrB,0BAA0B,EAC1B,mBAAmB,EACnB,yBAAyB,EACzB,oBAAoB,GACrB,CAAC"}
@@ -0,0 +1,8 @@
1
+ import React, { type ComponentPropsWithoutRef } from 'react';
2
+ import { type ThemedClassName } from '@dxos/react-ui';
3
+ export type StackItemContentProps = ThemedClassName<ComponentPropsWithoutRef<'div'>> & {
4
+ toolbar?: boolean;
5
+ statusbar?: boolean;
6
+ };
7
+ export declare const StackItemContent: ({ children, toolbar, statusbar, classNames, ...props }: StackItemContentProps) => React.JSX.Element;
8
+ //# sourceMappingURL=StackItemContent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StackItemContent.d.ts","sourceRoot":"","sources":["../../../../src/components/StackItemContent.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAE,KAAK,wBAAwB,EAAE,MAAM,OAAO,CAAC;AAE7D,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAKtD,MAAM,MAAM,qBAAqB,GAAG,eAAe,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAC,GAAG;IACrF,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,gBAAgB,2DAM1B,qBAAqB,sBAwBvB,CAAC"}
@@ -0,0 +1,8 @@
1
+ import React, { type ComponentPropsWithoutRef, type ComponentPropsWithRef } from 'react';
2
+ import { type ThemedClassName } from '@dxos/react-ui';
3
+ import { type AttendableId, type Related } from '@dxos/react-ui-attention';
4
+ export type StackItemHeadingProps = ThemedClassName<ComponentPropsWithoutRef<'div'>>;
5
+ export declare const StackItemHeading: ({ children, classNames, ...props }: StackItemHeadingProps) => React.JSX.Element;
6
+ export type StackItemHeadingLabelProps = ThemedClassName<ComponentPropsWithRef<'h1'>> & AttendableId & Related;
7
+ export declare const StackItemHeadingLabel: React.ForwardRefExoticComponent<Omit<StackItemHeadingLabelProps, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
8
+ //# sourceMappingURL=StackItemHeading.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StackItemHeading.d.ts","sourceRoot":"","sources":["../../../../src/components/StackItemHeading.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,EAAE,KAAK,wBAAwB,EAAE,KAAK,qBAAqB,EAAc,MAAM,OAAO,CAAC;AAErG,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAgB,KAAK,YAAY,EAAE,KAAK,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAKzF,MAAM,MAAM,qBAAqB,GAAG,eAAe,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAC,CAAC;AAErF,eAAO,MAAM,gBAAgB,uCAAwC,qBAAqB,sBAoBzF,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG,eAAe,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC,GAAG,YAAY,GAAG,OAAO,CAAC;AAE/G,eAAO,MAAM,qBAAqB,oHAejC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ export declare const StackItemResizeHandle: () => React.JSX.Element;
3
+ //# sourceMappingURL=StackItemResizeHandle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StackItemResizeHandle.d.ts","sourceRoot":"","sources":["../../../../src/components/StackItemResizeHandle.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAkC,MAAM,OAAO,CAAC;AAoBvD,eAAO,MAAM,qBAAqB,yBAoEjC,CAAC"}
@@ -0,0 +1,31 @@
1
+ import React, { type PropsWithChildren } from 'react';
2
+ import { type ActionLike } from '@dxos/app-graph';
3
+ import { type ButtonProps } from '@dxos/react-ui';
4
+ import { type AttendableId, type Related } from '@dxos/react-ui-attention';
5
+ export type KeyBinding = {
6
+ windows?: string;
7
+ macos?: string;
8
+ ios?: string;
9
+ linux?: string;
10
+ unknown?: string;
11
+ };
12
+ export type StackItemSigilAction = Pick<ActionLike, 'id' | 'properties' | 'data'>;
13
+ export type StackItemSigilButtonProps = Omit<ButtonProps, 'variant'> & AttendableId & Related;
14
+ export declare const StackItemSigilButton: React.ForwardRefExoticComponent<Omit<StackItemSigilButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
15
+ export type StackItemSigilProps = PropsWithChildren<{
16
+ attendableId?: string;
17
+ triggerLabel: string;
18
+ actions?: StackItemSigilAction[][];
19
+ icon: string;
20
+ onAction?: (action: StackItemSigilAction) => void;
21
+ } & Related>;
22
+ export declare const StackItemSigil: React.ForwardRefExoticComponent<{
23
+ attendableId?: string;
24
+ triggerLabel: string;
25
+ actions?: StackItemSigilAction[][];
26
+ icon: string;
27
+ onAction?: (action: StackItemSigilAction) => void;
28
+ } & Related & {
29
+ children?: React.ReactNode | undefined;
30
+ } & React.RefAttributes<HTMLButtonElement>>;
31
+ //# sourceMappingURL=StackItemSigil.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StackItemSigil.d.ts","sourceRoot":"","sources":["../../../../src/components/StackItemSigil.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAY,KAAK,iBAAiB,EAAgC,MAAM,OAAO,CAAC;AAE9F,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,OAAO,EAEL,KAAK,WAAW,EAMjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,OAAO,EAAgB,MAAM,0BAA0B,CAAC;AAOzF,MAAM,MAAM,UAAU,GAAG;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,IAAI,CAAC,UAAU,EAAE,IAAI,GAAG,YAAY,GAAG,MAAM,CAAC,CAAC;AAElF,MAAM,MAAM,yBAAyB,GAAG,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,GAAG,YAAY,GAAG,OAAO,CAAC;AAE9F,eAAO,MAAM,oBAAoB,kHAgBhC,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,iBAAiB,CACjD;IACE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,oBAAoB,EAAE,EAAE,CAAC;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,oBAAoB,KAAK,IAAI,CAAC;CACnD,GAAG,OAAO,CACZ,CAAC;AAEF,eAAO,MAAM,cAAc;mBARR,MAAM;kBACP,MAAM;cACV,oBAAoB,EAAE,EAAE;UAC5B,MAAM;eACD,CAAC,MAAM,EAAE,oBAAoB,KAAK,IAAI;;;2CA6GpD,CAAC"}
@@ -1,3 +1,4 @@
1
1
  export * from './Stack';
2
- export { SectionToolbar, type SectionToolbarProps, sectionToolbarLayout, type StackSectionItem } from './Section';
2
+ export * from './StackItem';
3
+ export * from './LayoutControls';
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAIA,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,KAAK,mBAAmB,EAAE,oBAAoB,EAAE,KAAK,gBAAgB,EAAE,MAAM,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAIA,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
- import type { StackSectionContent } from '../components/Section';
2
+ import { type StackItemContentProps } from '../components';
3
3
  export declare const EditorContent: ({ data: { content } }: {
4
- data: StackSectionContent & {
4
+ data: StackItemContentProps & {
5
5
  content?: string;
6
6
  };
7
7
  }) => React.JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"EditorContent.d.ts","sourceRoot":"","sources":["../../../../src/testing/EditorContent.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAiBxC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAEjE,eAAO,MAAM,aAAa,0BAAgC;IAAE,IAAI,EAAE,mBAAmB,GAAG;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,sBAmC7G,CAAC"}
1
+ {"version":3,"file":"EditorContent.d.ts","sourceRoot":"","sources":["../../../../src/testing/EditorContent.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAiBxC,OAAO,EAAa,KAAK,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAEtE,eAAO,MAAM,aAAa,0BAAgC;IAAE,IAAI,EAAE,qBAAqB,GAAG;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,sBAmC/G,CAAC"}
@@ -3,7 +3,6 @@ export declare class StackManager {
3
3
  readonly locator: Locator;
4
4
  private readonly _page;
5
5
  constructor(locator: Locator);
6
- empty(): Locator;
7
6
  sections(): Locator;
8
7
  order(): Promise<(string | null)[]>;
9
8
  section(index: number): SectionManager;
@@ -1 +1 @@
1
- {"version":3,"file":"stack-manager.d.ts","sourceRoot":"","sources":["../../../../src/testing/stack-manager.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAQ,MAAM,kBAAkB,CAAC;AAEtD,qBAAa,YAAY;IAGX,QAAQ,CAAC,OAAO,EAAE,OAAO;IAFrC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAO;gBAER,OAAO,EAAE,OAAO;IAIrC,KAAK;IAIL,QAAQ;IAIR,KAAK;IAIL,OAAO,CAAC,KAAK,EAAE,MAAM;CAGtB;AAED,qBAAa,cAAc;IAGb,QAAQ,CAAC,OAAO,EAAE,OAAO;IAFrC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAO;gBAER,OAAO,EAAE,OAAO;IAI/B,EAAE;IAIF,MAAM;IAKN,UAAU;IAKV,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,GAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAmB;CAehF"}
1
+ {"version":3,"file":"stack-manager.d.ts","sourceRoot":"","sources":["../../../../src/testing/stack-manager.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAQ,MAAM,kBAAkB,CAAC;AAEtD,qBAAa,YAAY;IAGX,QAAQ,CAAC,OAAO,EAAE,OAAO;IAFrC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAO;gBAER,OAAO,EAAE,OAAO;IAIrC,QAAQ;IAIR,KAAK;IAIL,OAAO,CAAC,KAAK,EAAE,MAAM;CAGtB;AAED,qBAAa,cAAc;IAGb,QAAQ,CAAC,OAAO,EAAE,OAAO;IAFrC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAO;gBAER,OAAO,EAAE,OAAO;IAI/B,EAAE;IAIF,MAAM;IAKN,UAAU;IAKV,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,GAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAmB;CAehF"}
@@ -2,14 +2,13 @@ export declare const translationKey = "stack";
2
2
  declare const _default: {
3
3
  'en-US': {
4
4
  stack: {
5
- 'empty stack message': string;
6
- 'remove section label': string;
7
- 'navigate to section label': string;
8
- 'untitled section title': string;
9
- 'add section before label': string;
10
- 'add section after label': string;
11
- 'expand label': string;
12
- 'collapse label': string;
5
+ 'resize label': string;
6
+ 'pin start label': string;
7
+ 'pin end label': string;
8
+ 'increment start label': string;
9
+ 'increment end label': string;
10
+ 'close label': string;
11
+ 'minify label': string;
13
12
  };
14
13
  };
15
14
  }[];
@@ -1 +1 @@
1
- {"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../src/translations.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,cAAc,UAAU,CAAC;;;;;;;;;;;;;;;AAEtC,wBAeE"}
1
+ {"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../src/translations.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,cAAc,UAAU,CAAC;;;;;;;;;;;;;;AAEtC,wBAcE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/react-ui-stack",
3
- "version": "0.6.14-staging.e15392e",
3
+ "version": "0.7.1-staging.599df14",
4
4
  "description": "A stack component.",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -38,19 +38,19 @@
38
38
  "@atlaskit/pragmatic-drag-and-drop": "^1.4.0",
39
39
  "@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.0.3",
40
40
  "@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^1.1.3",
41
- "@effect/schema": "^0.75.1",
41
+ "@effect/schema": "^0.75.5",
42
42
  "@fluentui/react-tabster": "^9.19.0",
43
43
  "@radix-ui/primitive": "^1.0.0",
44
- "@radix-ui/react-collapsible": "^1.0.2",
45
44
  "@radix-ui/react-compose-refs": "^1.0.0",
46
45
  "@radix-ui/react-context": "^1.0.0",
47
46
  "@radix-ui/react-menu": "^2.0.6",
48
47
  "@radix-ui/react-use-controllable-state": "^1.0.0",
49
48
  "react-resize-detector": "^11.0.1",
50
- "@dxos/echo-schema": "0.6.14-staging.e15392e",
51
- "@dxos/react-ui-deck": "0.6.14-staging.e15392e",
52
- "@dxos/react-ui-mosaic": "0.6.14-staging.e15392e",
53
- "@dxos/react-ui-attention": "0.6.14-staging.e15392e"
49
+ "@dxos/react-ui-mosaic": "0.7.1-staging.599df14",
50
+ "@dxos/echo-schema": "0.7.1-staging.599df14",
51
+ "@dxos/react-ui-attention": "0.7.1-staging.599df14",
52
+ "@dxos/keyboard": "0.7.1-staging.599df14",
53
+ "@dxos/util": "0.7.1-staging.599df14"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@phosphor-icons/react": "^2.1.5",
@@ -59,25 +59,24 @@
59
59
  "react": "~18.2.0",
60
60
  "react-dom": "~18.2.0",
61
61
  "vite": "5.4.7",
62
- "@dxos/echo-schema": "0.6.14-staging.e15392e",
63
- "@dxos/client": "0.6.14-staging.e15392e",
64
- "@dxos/random": "0.6.14-staging.e15392e",
65
- "@dxos/react-ui": "0.6.14-staging.e15392e",
66
- "@dxos/react-ui-editor": "0.6.14-staging.e15392e",
67
- "@dxos/react-ui-table": "0.6.14-staging.e15392e",
68
- "@dxos/react-ui-theme": "0.6.14-staging.e15392e",
69
- "@dxos/storybook-utils": "0.6.14-staging.e15392e",
70
- "@dxos/test-utils": "0.6.14-staging.e15392e",
71
- "@dxos/util": "0.6.14-staging.e15392e"
62
+ "@dxos/random": "0.7.1-staging.599df14",
63
+ "@dxos/echo-schema": "0.7.1-staging.599df14",
64
+ "@dxos/app-graph": "0.7.1-staging.599df14",
65
+ "@dxos/react-ui": "0.7.1-staging.599df14",
66
+ "@dxos/client": "0.7.1-staging.599df14",
67
+ "@dxos/react-ui-theme": "0.7.1-staging.599df14",
68
+ "@dxos/react-ui-editor": "0.7.1-staging.599df14",
69
+ "@dxos/storybook-utils": "0.7.1-staging.599df14",
70
+ "@dxos/test-utils": "0.7.1-staging.599df14"
72
71
  },
73
72
  "peerDependencies": {
74
73
  "@phosphor-icons/react": "^2.1.5",
75
74
  "react": "~18.2.0",
76
75
  "react-dom": "~18.2.0",
77
- "@dxos/client": "0.6.14-staging.e15392e",
78
- "@dxos/react-ui": "0.6.14-staging.e15392e",
79
- "@dxos/random": "0.6.14-staging.e15392e",
80
- "@dxos/react-ui-theme": "0.6.14-staging.e15392e"
76
+ "@dxos/client": "0.7.1-staging.599df14",
77
+ "@dxos/random": "0.7.1-staging.599df14",
78
+ "@dxos/react-ui-theme": "0.7.1-staging.599df14",
79
+ "@dxos/react-ui": "0.7.1-staging.599df14"
81
80
  },
82
81
  "publishConfig": {
83
82
  "access": "public"
@@ -0,0 +1,131 @@
1
+ //
2
+ // Copyright 2024 DXOS.org
3
+ //
4
+
5
+ import React, { forwardRef } from 'react';
6
+
7
+ import {
8
+ Button,
9
+ ButtonGroup,
10
+ type ButtonGroupProps,
11
+ type ButtonProps,
12
+ Icon,
13
+ Tooltip,
14
+ useTranslation,
15
+ } from '@dxos/react-ui';
16
+
17
+ import { translationKey } from '../translations';
18
+
19
+ export type LayoutControlEvent = 'solo' | 'close' | `${'pin' | 'increment'}-${'start' | 'end'}`;
20
+ export type LayoutControlHandler = (event: LayoutControlEvent) => void;
21
+
22
+ export type LayoutCapabilities = {
23
+ incrementStart?: boolean;
24
+ incrementEnd?: boolean;
25
+ solo?: boolean;
26
+ };
27
+
28
+ export type LayoutControlsProps = Omit<ButtonGroupProps, 'onClick'> & {
29
+ onClick?: LayoutControlHandler;
30
+ variant?: 'hide-disabled' | 'default';
31
+ close?: boolean | 'minify-start' | 'minify-end';
32
+ capabilities: LayoutCapabilities;
33
+ isSolo?: boolean;
34
+ pin?: 'start' | 'end' | 'both';
35
+ };
36
+
37
+ const LayoutControl = ({ icon, label, ...props }: Omit<ButtonProps, 'children'> & { label: string; icon: string }) => {
38
+ return (
39
+ <Tooltip.Root>
40
+ <Tooltip.Trigger asChild>
41
+ <Button variant='ghost' {...props}>
42
+ <span className='sr-only'>{label}</span>
43
+ <Icon icon={icon} />
44
+ </Button>
45
+ </Tooltip.Trigger>
46
+ <Tooltip.Portal>
47
+ <Tooltip.Content side='bottom' classNames='z-[70]'>
48
+ {label}
49
+ </Tooltip.Content>
50
+ </Tooltip.Portal>
51
+ </Tooltip.Root>
52
+ );
53
+ };
54
+
55
+ export const LayoutControls = forwardRef<HTMLDivElement, LayoutControlsProps>(
56
+ (
57
+ { onClick, variant = 'default', capabilities: can, isSolo, pin, close = false, children, ...props },
58
+ forwardedRef,
59
+ ) => {
60
+ const { t } = useTranslation(translationKey);
61
+ const buttonClassNames = variant === 'hide-disabled' ? 'disabled:hidden !p-1' : '!p-1';
62
+
63
+ return (
64
+ <ButtonGroup {...props} ref={forwardedRef}>
65
+ {pin && !isSolo && ['both', 'start'].includes(pin) && (
66
+ <LayoutControl
67
+ label={t('pin start label')}
68
+ variant='ghost'
69
+ classNames={buttonClassNames}
70
+ onClick={() => onClick?.('pin-start')}
71
+ icon='ph--caret-line-left--regular'
72
+ />
73
+ )}
74
+
75
+ {can.solo && (
76
+ <LayoutControl
77
+ label={t('solo layout label')}
78
+ classNames={buttonClassNames}
79
+ onClick={() => onClick?.('solo')}
80
+ icon={isSolo ? 'ph--arrows-in--regular' : 'ph--arrows-out--regular'}
81
+ />
82
+ )}
83
+
84
+ {!isSolo && can.solo && (
85
+ <>
86
+ <LayoutControl
87
+ label={t('increment start label')}
88
+ disabled={!can.incrementStart}
89
+ classNames={buttonClassNames}
90
+ onClick={() => onClick?.('increment-start')}
91
+ icon='ph--caret-left--regular'
92
+ />
93
+ <LayoutControl
94
+ label={t('increment end label')}
95
+ disabled={!can.incrementEnd}
96
+ classNames={buttonClassNames}
97
+ onClick={() => onClick?.('increment-end')}
98
+ icon='ph--caret-right--regular'
99
+ />
100
+ </>
101
+ )}
102
+
103
+ {pin && !isSolo && ['both', 'end'].includes(pin) && (
104
+ <LayoutControl
105
+ label={t('pin end label')}
106
+ classNames={buttonClassNames}
107
+ onClick={() => onClick?.('pin-end')}
108
+ icon='ph--caret-line-right--regular'
109
+ />
110
+ )}
111
+
112
+ {close && !isSolo && (
113
+ <LayoutControl
114
+ label={t(`${typeof close === 'string' ? 'minify' : 'close'} label`)}
115
+ classNames={buttonClassNames}
116
+ onClick={() => onClick?.('close')}
117
+ data-testid='layoutHeading.close'
118
+ icon={
119
+ close === 'minify-start'
120
+ ? 'ph--caret-line-left--regular'
121
+ : close === 'minify-end'
122
+ ? 'ph--caret-line-right--regular'
123
+ : 'ph--x--regular'
124
+ }
125
+ />
126
+ )}
127
+ {children}
128
+ </ButtonGroup>
129
+ );
130
+ },
131
+ );
@@ -0,0 +1,33 @@
1
+ //
2
+ // Copyright 2024 DXOS.org
3
+ //
4
+
5
+ import React from 'react';
6
+
7
+ export const MenuSignifierHorizontal = () => (
8
+ <svg
9
+ className='absolute block-end-[7px]'
10
+ width={20}
11
+ height={2}
12
+ viewBox='0 0 20 2'
13
+ stroke='currentColor'
14
+ opacity={0.5}
15
+ >
16
+ <line
17
+ x1={0.5}
18
+ y1={0.75}
19
+ x2={19}
20
+ y2={0.75}
21
+ strokeWidth={1.25}
22
+ strokeLinecap='round'
23
+ strokeDasharray='6 20'
24
+ strokeDashoffset='-6.5'
25
+ />
26
+ </svg>
27
+ );
28
+
29
+ export const MenuSignifierVertical = () => (
30
+ <svg className='absolute inline-start-1' width={2} height={18} viewBox='0 0 2 18' stroke='currentColor'>
31
+ <line x1={1} y1={3} x2={1} y2={18} strokeWidth={1.5} strokeLinecap='round' strokeDasharray='0 6' />
32
+ </svg>
33
+ );