@dxos/react-ui-calendar 0.8.4-main.fcfe5033a5 → 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,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/react-ui-calendar",
3
- "version": "0.8.4-main.fcfe5033a5",
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",
@@ -8,21 +8,27 @@
8
8
  "type": "git",
9
9
  "url": "https://github.com/dxos/dxos"
10
10
  },
11
- "license": "MIT",
11
+ "license": "FSL-1.1-Apache-2.0",
12
12
  "author": "DXOS.org",
13
13
  "type": "module",
14
+ "imports": {
15
+ "#translations": "./src/translations.ts"
16
+ },
14
17
  "exports": {
15
18
  ".": {
16
19
  "source": "./src/index.ts",
17
20
  "types": "./dist/types/src/index.d.ts",
18
21
  "browser": "./dist/lib/browser/index.mjs",
19
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"
20
29
  }
21
30
  },
22
31
  "types": "dist/types/src/index.d.ts",
23
- "typesVersions": {
24
- "*": {}
25
- },
26
32
  "files": [
27
33
  "dist",
28
34
  "src"
@@ -33,31 +39,31 @@
33
39
  "react-resize-detector": "^11.0.1",
34
40
  "react-virtualized": "^9.22.6",
35
41
  "react-window": "^2.2.3",
36
- "@dxos/debug": "0.8.4-main.fcfe5033a5",
37
- "@dxos/async": "0.8.4-main.fcfe5033a5",
38
- "@dxos/invariant": "0.8.4-main.fcfe5033a5",
39
- "@dxos/log": "0.8.4-main.fcfe5033a5",
40
- "@dxos/util": "0.8.4-main.fcfe5033a5"
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"
41
47
  },
42
48
  "devDependencies": {
43
49
  "@types/react": "~19.2.7",
44
50
  "@types/react-dom": "~19.2.3",
45
51
  "@types/react-virtualized": "^9.22.3",
46
- "effect": "3.20.0",
52
+ "effect": "3.21.3",
47
53
  "react": "~19.2.3",
48
54
  "react-dom": "~19.2.3",
49
- "vite": "^7.1.11",
50
- "@dxos/random": "0.8.4-main.fcfe5033a5",
51
- "@dxos/react-ui": "0.8.4-main.fcfe5033a5",
52
- "@dxos/storybook-utils": "0.8.4-main.fcfe5033a5",
53
- "@dxos/ui-theme": "0.8.4-main.fcfe5033a5"
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"
54
60
  },
55
61
  "peerDependencies": {
56
- "effect": "3.20.0",
62
+ "effect": "3.21.3",
57
63
  "react": "~19.2.3",
58
64
  "react-dom": "~19.2.3",
59
- "@dxos/react-ui": "0.8.4-main.fcfe5033a5",
60
- "@dxos/ui-theme": "0.8.4-main.fcfe5033a5"
65
+ "@dxos/ui-theme": "0.8.4-staging.60fe92afc8",
66
+ "@dxos/react-ui": "0.8.4-staging.60fe92afc8"
61
67
  },
62
68
  "publishConfig": {
63
69
  "access": "public"
@@ -3,13 +3,15 @@
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
9
  import { Panel } from '@dxos/react-ui';
9
10
  import { withLayout, withTheme } from '@dxos/react-ui/testing';
10
11
 
11
- import { translations } from '../../translations';
12
- import { Calendar } from './Calendar';
12
+ import { translations } from '#translations';
13
+
14
+ import { Calendar, type Range as DateRange } from './Calendar';
13
15
 
14
16
  const meta = {
15
17
  title: 'ui/react-ui-calendar/Calendar',
@@ -33,6 +35,24 @@ export const Default: Story = {
33
35
  ),
34
36
  };
35
37
 
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
+ },
54
+ };
55
+
36
56
  export const Column: Story = {
37
57
  decorators: [withTheme(), withLayout({ layout: 'column', classNames: 'w-auto' })],
38
58
  render: () => (