@dxos/react-ui-grid 0.8.4-main.937b3ca → 0.8.4-main.9be5663bfe

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/react-ui-grid",
3
- "version": "0.8.4-main.937b3ca",
3
+ "version": "0.8.4-main.9be5663bfe",
4
4
  "description": "React component which manages a `dx-grid` Lit web component.",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -35,28 +35,28 @@
35
35
  "@radix-ui/react-context": "1.1.1",
36
36
  "@radix-ui/react-popper": "1.2.2",
37
37
  "@radix-ui/react-use-controllable-state": "1.1.0",
38
- "@dxos/react-ui-editor": "0.8.4-main.937b3ca",
39
- "@dxos/ui-editor": "0.8.4-main.937b3ca",
40
- "@dxos/util": "0.8.4-main.937b3ca",
41
- "@dxos/lit-grid": "0.8.4-main.937b3ca"
38
+ "@dxos/lit-grid": "0.8.4-main.9be5663bfe",
39
+ "@dxos/react-ui-editor": "0.8.4-main.9be5663bfe",
40
+ "@dxos/util": "0.8.4-main.9be5663bfe",
41
+ "@dxos/ui-editor": "0.8.4-main.9be5663bfe"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@types/react": "~19.2.7",
45
45
  "@types/react-dom": "~19.2.3",
46
46
  "react": "~19.2.3",
47
47
  "react-dom": "~19.2.3",
48
- "vite": "7.1.9",
49
- "@dxos/random": "0.8.4-main.937b3ca",
50
- "@dxos/react-ui": "0.8.4-main.937b3ca",
51
- "@dxos/react-ui-searchlist": "0.8.4-main.937b3ca",
52
- "@dxos/storybook-utils": "0.8.4-main.937b3ca",
53
- "@dxos/ui-theme": "0.8.4-main.937b3ca"
48
+ "vite": "^7.1.11",
49
+ "@dxos/random": "0.8.4-main.9be5663bfe",
50
+ "@dxos/react-ui": "0.8.4-main.9be5663bfe",
51
+ "@dxos/storybook-utils": "0.8.4-main.9be5663bfe",
52
+ "@dxos/react-ui-search": "0.8.4-main.9be5663bfe",
53
+ "@dxos/ui-theme": "0.8.4-main.9be5663bfe"
54
54
  },
55
55
  "peerDependencies": {
56
56
  "react": "~19.2.3",
57
57
  "react-dom": "~19.2.3",
58
- "@dxos/react-ui": "0.8.4-main.937b3ca",
59
- "@dxos/ui-theme": "0.8.4-main.937b3ca"
58
+ "@dxos/react-ui": "0.8.4-main.9be5663bfe",
59
+ "@dxos/ui-theme": "0.8.4-main.9be5663bfe"
60
60
  },
61
61
  "publishConfig": {
62
62
  "access": "public"
@@ -47,7 +47,7 @@ const DefaultStory = (props: CellEditorProps) => {
47
47
  <div className='text-sm'>
48
48
  Last action: <span className='font-mono'>{lastAction}</span>
49
49
  </div>
50
- <div className='relative border border-separator bs-[100px] is-[300px]'>
50
+ <div className='relative border border-separator h-[100px] w-[300px]'>
51
51
  <CellEditor
52
52
  value={value}
53
53
  extensions={extensions}
@@ -70,7 +70,7 @@ const meta = {
70
70
  title: 'ui/react-ui-grid/CellEditor',
71
71
  component: CellEditor,
72
72
  render: DefaultStory,
73
- decorators: [withTheme],
73
+ decorators: [withTheme()],
74
74
  parameters: {
75
75
  layout: 'centered',
76
76
  },
@@ -144,18 +144,18 @@ export const CellEditor = ({ value, extensions, box, gridId, autoFocus, slots, o
144
144
  slots: {
145
145
  editor: {
146
146
  className: mx(
147
- '!min-is-full !is-min !max-is-[--dx-grid-cell-editor-max-inline-size] !min-bs-full !max-bs-[--dx-grid-cell-editor-max-block-size]',
147
+ 'min-w-full! w-min! !max-w-(--dx-grid-cell-editor-max-w-size) min-h-full! !max-h-(--dx-grid-cell-editor-max-h-size)',
148
148
  slots?.editor?.className,
149
149
  ),
150
150
  },
151
- scroll: {
151
+ scroller: {
152
152
  className: mx(
153
- '!overflow-x-hidden !plb-[max(0,calc(var(--dx-grid-cell-editor-padding-block)-1px))] !pie-0 !pis-[--dx-grid-cell-editor-padding-inline]',
154
- slots?.scroll?.className,
153
+ 'overflow-x-hidden! !py-[max(0,calc(var(--dx-grid-cell-editor-padding-block)-1px))] pe-0! !pl-(--dx-grid-cell-editor-padding-inline)',
154
+ slots?.scroller?.className,
155
155
  ),
156
156
  },
157
157
  content: {
158
- className: mx('!break-normal', slots?.content?.className),
158
+ className: mx('break-normal!', slots?.content?.className),
159
159
  },
160
160
  },
161
161
  }),
@@ -173,7 +173,7 @@ export const CellEditor = ({ value, extensions, box, gridId, autoFocus, slots, o
173
173
  insetBlockStart: box?.insetBlockStart ?? '0px',
174
174
  minInlineSize: box?.inlineSize ?? '180px',
175
175
  minBlockSize: box?.blockSize ?? '30px',
176
- ...{ '--dx-gridCellWidth': `${box?.inlineSize ?? 200}px` },
176
+ ...{ '--dx-grid-cell-width': `${box?.inlineSize ?? 200}px` },
177
177
  }}
178
178
  {...(gridId && { 'data-grid': gridId })}
179
179
  />
@@ -5,7 +5,6 @@
5
5
  import React, { useCallback } from 'react';
6
6
 
7
7
  import { type DxGridCellIndex, type GridScopedProps, useGridContext } from '../Grid';
8
-
9
8
  import { CellEditor, type CellEditorProps } from './CellEditor';
10
9
 
11
10
  export type GridCellEditorProps = GridScopedProps<
@@ -7,15 +7,15 @@ import React, { type MouseEvent, type MutableRefObject, useCallback, useRef, use
7
7
 
8
8
  import { defaultRowSize } from '@dxos/lit-grid';
9
9
  import { type DxGridPlaneCells } from '@dxos/lit-grid';
10
- import { faker } from '@dxos/random';
10
+ import { random } from '@dxos/random';
11
11
  import { DropdownMenu } from '@dxos/react-ui';
12
- import { withLayout, withTheme } from '@dxos/react-ui/testing';
13
12
  import { toPlaneCellIndex } from '@dxos/react-ui-grid';
14
- import { Combobox, type ComboboxRootProps, useSearchListResults } from '@dxos/react-ui-searchlist';
13
+ import { Combobox, type ComboboxRootProps, useSearchListResults } from '@dxos/react-ui-search';
14
+ import { withLayout, withTheme } from '@dxos/react-ui/testing';
15
15
 
16
16
  import { Grid, type GridContentProps, type GridEditing, type GridRootProps } from './Grid';
17
17
 
18
- const storybookItems = faker.helpers.uniqueArray(faker.commerce.productName, 16);
18
+ const storybookItems = random.helpers.uniqueArray(random.commerce.productName, 16);
19
19
 
20
20
  type GridStoryProps = GridContentProps & Pick<GridRootProps, 'onEditingChange'>;
21
21
 
@@ -114,7 +114,7 @@ const ComboboxContentWithFiltering = () => {
114
114
  const meta = {
115
115
  title: 'ui/react-ui-grid/Grid',
116
116
  component: GridStory,
117
- decorators: [withTheme, withLayout({ layout: 'column' })],
117
+ decorators: [withTheme(), withLayout({ layout: 'column' })],
118
118
  parameters: {
119
119
  layout: 'fullscreen',
120
120
  },
@@ -155,7 +155,7 @@ export const Basic: Story = {
155
155
  '1,1': {
156
156
  value: 'Demo decoration',
157
157
  accessoryHtml: `
158
- <button class="dx-button is-6 pli-0.5 min-bs-0 absolute inset-block-1 inline-end-1" data-story-action="menu">
158
+ <button class="dx-button w-6 px-0.5 min-h-0 absolute inset-y-1 right-1" data-story-action="menu">
159
159
  <svg><use href="/icons.svg#ph--arrow-right--regular"/></svg>
160
160
  </button>
161
161
  `,
@@ -199,7 +199,7 @@ export const Calendar: Story = {
199
199
  // TODO(burdon): Formatting changes when cell is selected.
200
200
  cells[toPlaneCellIndex({ col, row })] = {
201
201
  readonly: true,
202
- accessoryHtml: '<div class="flex bs-full is-full justify-center items-center overflow-hidden">0</div>',
202
+ accessoryHtml: '<div class="flex h-full w-full justify-center items-center overflow-hidden">0</div>',
203
203
  className: '',
204
204
  };
205
205
  }
@@ -209,8 +209,8 @@ export const Calendar: Story = {
209
209
  },
210
210
  },
211
211
  render: (args) => (
212
- <div className='bs-full flex justify-center'>
213
- <div className='bs-full is-[288px] border-x border-separator'>
212
+ <div className='h-full flex justify-center'>
213
+ <div className='h-full w-[288px] border-x border-separator'>
214
214
  <GridStory {...args} />
215
215
  </div>
216
216
  </div>
package/src/Grid/Grid.tsx CHANGED
@@ -2,8 +2,6 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
- import '@dxos/lit-grid/dx-grid.pcss';
6
-
7
5
  import { type EventName, createComponent } from '@lit/react';
8
6
  import { type Scope, createContextScope } from '@radix-ui/react-context';
9
7
  import { useControllableState } from '@radix-ui/react-use-controllable-state';
@@ -16,6 +14,7 @@ import React, {
16
14
  useState,
17
15
  } from 'react';
18
16
 
17
+ import '@dxos/lit-grid/dx-grid.pcss';
19
18
  import { type DxAxisResize, type DxEditRequest, type DxGridCellsSelect, DxGrid as NaturalDxGrid } from '@dxos/lit-grid';
20
19
 
21
20
  type DxGridElement = NaturalDxGrid;
@@ -72,6 +71,7 @@ type GridRootProps = PropsWithChildren<
72
71
  }>
73
72
  >;
74
73
 
74
+ // TODO(burdon): Make headless.
75
75
  const GridRoot = ({
76
76
  __gridScope,
77
77
  children,
@@ -152,12 +152,12 @@ GridContent.displayName = GRID_CONTENT_NAME;
152
152
  // Fragments
153
153
  //
154
154
 
155
- // NOTE(Zan): These fragments add border to inline-end and block-end of the grid using pseudo-elements.
155
+ // NOTE(Zan): These fragments add border to w-end and h-end of the grid using pseudo-elements.
156
156
  // These are offset by 1px to avoid double borders in planks.
157
157
  const gridSeparatorInlineEnd =
158
- '[&>.dx-grid]:relative [&>.dx-grid]:after:absolute [&>.dx-grid]:after:inset-block-0 [&>.dx-grid]:after:-inline-end-px [&>.dx-grid]:after:is-px [&>.dx-grid]:after:bg-subduedSeparator';
158
+ '[&>.dx-grid]:relative [&>.dx-grid]:after:absolute [&>.dx-grid]:after:inset-y-0 [&>.dx-grid]:after:-right-px [&>.dx-grid]:after:w-px [&>.dx-grid]:after:bg-subdued-separator';
159
159
  const gridSeparatorBlockEnd =
160
- '[&>.dx-grid]:relative [&>.dx-grid]:before:absolute [&>.dx-grid]:before:inset-inline-0 [&>.dx-grid]:before:-block-end-px [&>.dx-grid]:before:bs-px [&>.dx-grid]:before:bg-subduedSeparator';
160
+ '[&>.dx-grid]:relative [&>.dx-grid]:before:absolute [&>.dx-grid]:before:inset-x-0 [&>.dx-grid]:before:-bottom-px [&>.dx-grid]:before:h-px [&>.dx-grid]:before:bg-subdued-separator';
161
161
 
162
162
  //
163
163
  // Exports