@dxos/react-ui-calendar 0.8.4-main.fffef41 → 0.8.4-staging.60fe92afc8

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,62 +1,69 @@
1
1
  {
2
2
  "name": "@dxos/react-ui-calendar",
3
- "version": "0.8.4-main.fffef41",
3
+ "version": "0.8.4-staging.60fe92afc8",
4
4
  "description": "A calendar component.",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
7
- "license": "MIT",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/dxos/dxos"
10
+ },
11
+ "license": "FSL-1.1-Apache-2.0",
8
12
  "author": "DXOS.org",
9
13
  "type": "module",
14
+ "imports": {
15
+ "#translations": "./src/translations.ts"
16
+ },
10
17
  "exports": {
11
18
  ".": {
12
19
  "source": "./src/index.ts",
13
20
  "types": "./dist/types/src/index.d.ts",
14
21
  "browser": "./dist/lib/browser/index.mjs",
15
22
  "node": "./dist/lib/node-esm/index.mjs"
23
+ },
24
+ "./translations": {
25
+ "source": "./src/translations.ts",
26
+ "types": "./dist/types/src/translations.d.ts",
27
+ "browser": "./dist/lib/browser/translations.mjs",
28
+ "node": "./dist/lib/node-esm/translations.mjs"
16
29
  }
17
30
  },
18
31
  "types": "dist/types/src/index.d.ts",
19
- "typesVersions": {
20
- "*": {}
21
- },
22
32
  "files": [
23
33
  "dist",
24
34
  "src"
25
35
  ],
26
36
  "dependencies": {
27
- "@preact-signals/safe-react": "^0.9.0",
28
- "@preact/signals-core": "^1.12.1",
29
37
  "@radix-ui/react-context": "1.1.1",
30
- "date-fns": "^3.3.1",
38
+ "date-fns": "^3.6.0",
31
39
  "react-resize-detector": "^11.0.1",
32
40
  "react-virtualized": "^9.22.6",
33
41
  "react-window": "^2.2.3",
34
- "@dxos/async": "0.8.4-main.fffef41",
35
- "@dxos/debug": "0.8.4-main.fffef41",
36
- "@dxos/invariant": "0.8.4-main.fffef41",
37
- "@dxos/util": "0.8.4-main.fffef41",
38
- "@dxos/log": "0.8.4-main.fffef41"
42
+ "@dxos/async": "0.8.4-staging.60fe92afc8",
43
+ "@dxos/debug": "0.8.4-staging.60fe92afc8",
44
+ "@dxos/invariant": "0.8.4-staging.60fe92afc8",
45
+ "@dxos/log": "0.8.4-staging.60fe92afc8",
46
+ "@dxos/util": "0.8.4-staging.60fe92afc8"
39
47
  },
40
48
  "devDependencies": {
41
- "@types/react": "~19.2.2",
42
- "@types/react-dom": "~19.2.2",
49
+ "@types/react": "~19.2.7",
50
+ "@types/react-dom": "~19.2.3",
43
51
  "@types/react-virtualized": "^9.22.3",
44
- "@types/react-window": "^2.0.0",
45
- "effect": "3.18.3",
46
- "react": "~19.2.0",
47
- "react-dom": "~19.2.0",
48
- "vite": "7.1.9",
49
- "@dxos/random": "0.8.4-main.fffef41",
50
- "@dxos/react-ui": "0.8.4-main.fffef41",
51
- "@dxos/react-ui-theme": "0.8.4-main.fffef41",
52
- "@dxos/storybook-utils": "0.8.4-main.fffef41"
52
+ "effect": "3.21.3",
53
+ "react": "~19.2.3",
54
+ "react-dom": "~19.2.3",
55
+ "vite": "^8.0.16",
56
+ "@dxos/react-ui": "0.8.4-staging.60fe92afc8",
57
+ "@dxos/random": "0.8.4-staging.60fe92afc8",
58
+ "@dxos/ui-theme": "0.8.4-staging.60fe92afc8",
59
+ "@dxos/storybook-utils": "0.8.4-staging.60fe92afc8"
53
60
  },
54
61
  "peerDependencies": {
55
- "effect": "3.13.3",
56
- "react": "^19.0.0",
57
- "react-dom": "^19.0.0",
58
- "@dxos/react-ui-theme": "0.8.4-main.fffef41",
59
- "@dxos/react-ui": "0.8.4-main.fffef41"
62
+ "effect": "3.21.3",
63
+ "react": "~19.2.3",
64
+ "react-dom": "~19.2.3",
65
+ "@dxos/ui-theme": "0.8.4-staging.60fe92afc8",
66
+ "@dxos/react-ui": "0.8.4-staging.60fe92afc8"
60
67
  },
61
68
  "publishConfig": {
62
69
  "access": "public"
@@ -3,20 +3,20 @@
3
3
  //
4
4
 
5
5
  import { type Meta, type StoryObj } from '@storybook/react-vite';
6
- import React from 'react';
6
+ import { format } from 'date-fns';
7
+ import React, { useState } from 'react';
7
8
 
8
- import { withTheme } from '@dxos/react-ui/testing';
9
+ import { Panel } from '@dxos/react-ui';
10
+ import { withLayout, withTheme } from '@dxos/react-ui/testing';
9
11
 
10
- import { translations } from '../../translations';
12
+ import { translations } from '#translations';
11
13
 
12
- import { Calendar } from './Calendar';
14
+ import { Calendar, type Range as DateRange } from './Calendar';
13
15
 
14
16
  const meta = {
15
17
  title: 'ui/react-ui-calendar/Calendar',
16
18
  component: Calendar.Grid,
17
- decorators: [withTheme],
18
19
  parameters: {
19
- layout: 'centered',
20
20
  translations,
21
21
  },
22
22
  } satisfies Meta<typeof Calendar.Grid>;
@@ -26,51 +26,45 @@ export default meta;
26
26
  type Story = StoryObj<typeof meta>;
27
27
 
28
28
  export const Default: Story = {
29
+ decorators: [withTheme(), withLayout({ layout: 'centered' })],
29
30
  render: () => (
30
31
  <Calendar.Root>
31
- <Calendar.Viewport>
32
- <Calendar.Toolbar />
33
- <Calendar.Grid rows={6} />
34
- </Calendar.Viewport>
32
+ <Calendar.Toolbar />
33
+ <Calendar.Grid rows={6} />
35
34
  </Calendar.Root>
36
35
  ),
37
36
  };
38
37
 
39
- export const Border: Story = {
40
- render: () => (
41
- <Calendar.Root>
42
- <Calendar.Viewport classNames='bg-modalSurface border border-separator rounded'>
43
- <Calendar.Toolbar />
44
- <Calendar.Grid rows={6} />
45
- </Calendar.Viewport>
46
- </Calendar.Root>
47
- ),
38
+ export const Range: Story = {
39
+ decorators: [withTheme(), withLayout({ layout: 'centered' })],
40
+ render: () => {
41
+ const [range, setRange] = useState<DateRange | undefined>();
42
+ return (
43
+ <div className='flex flex-col gap-2'>
44
+ <Calendar.Root>
45
+ <Calendar.Toolbar />
46
+ <Calendar.Grid rows={6} onSelectRange={({ range }) => setRange(range)} />
47
+ </Calendar.Root>
48
+ <div className='text-sm text-description text-center'>
49
+ {range ? `${format(range.from, 'PP')} → ${format(range.to, 'PP')}` : 'Drag across days to select a range.'}
50
+ </div>
51
+ </div>
52
+ );
53
+ },
48
54
  };
49
55
 
50
56
  export const Column: Story = {
57
+ decorators: [withTheme(), withLayout({ layout: 'column', classNames: 'w-auto' })],
51
58
  render: () => (
52
- <div className='absolute inset-0 flex bs-full justify-center'>
53
- <Calendar.Root>
54
- <Calendar.Viewport>
59
+ <Calendar.Root>
60
+ <Panel.Root>
61
+ <Panel.Toolbar asChild>
55
62
  <Calendar.Toolbar />
63
+ </Panel.Toolbar>
64
+ <Panel.Content asChild>
56
65
  <Calendar.Grid />
57
- </Calendar.Viewport>
58
- </Calendar.Root>
59
- </div>
60
- ),
61
- };
62
-
63
- export const Mobile: Story = {
64
- render: () => (
65
- <div className='absolute inset-0 flex bs-full justify-center'>
66
- <div className='flex bs-full is-[400px] justify-center'>
67
- <Calendar.Root>
68
- <Calendar.Viewport classNames='is-full'>
69
- <Calendar.Toolbar />
70
- <Calendar.Grid />
71
- </Calendar.Viewport>
72
- </Calendar.Root>
73
- </div>
74
- </div>
66
+ </Panel.Content>
67
+ </Panel.Root>
68
+ </Calendar.Root>
75
69
  ),
76
70
  };