@dxos/react-ui 0.9.1-main.c7dcc2e112 → 0.9.1-staging.ee54ba693a
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/dist/lib/browser/{chunk-HFJYTGHU.mjs → chunk-CMHHVHX3.mjs} +4 -1
- package/dist/lib/browser/chunk-CMHHVHX3.mjs.map +7 -0
- package/dist/lib/browser/{chunk-F3PLXTDA.mjs → chunk-GTHV4WYK.mjs} +123 -232
- package/dist/lib/browser/chunk-GTHV4WYK.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +1069 -976
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +5 -5
- package/dist/lib/browser/testing/index.mjs.map +2 -2
- package/dist/lib/browser/translations.mjs +1 -1
- package/dist/lib/node-esm/{chunk-LLVUYLAM.mjs → chunk-3VSKWNCQ.mjs} +123 -232
- package/dist/lib/node-esm/chunk-3VSKWNCQ.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-OJYUPUCY.mjs → chunk-P4KFQGJI.mjs} +4 -1
- package/dist/lib/node-esm/chunk-P4KFQGJI.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +1069 -976
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/testing/index.mjs +5 -5
- package/dist/lib/node-esm/testing/index.mjs.map +2 -2
- package/dist/lib/node-esm/translations.mjs +1 -1
- package/dist/types/src/components/Avatars/Avatar.d.ts +1 -1
- package/dist/types/src/components/Avatars/Avatar.d.ts.map +1 -1
- package/dist/types/src/components/Breadcrumb/Breadcrumb.d.ts +3 -3
- package/dist/types/src/components/Breadcrumb/Breadcrumb.d.ts.map +1 -1
- package/dist/types/src/components/Button/Button.d.ts +2 -2
- package/dist/types/src/components/Button/Button.d.ts.map +1 -1
- package/dist/types/src/components/Button/IconButton.stories.d.ts +3 -0
- package/dist/types/src/components/Button/IconButton.stories.d.ts.map +1 -1
- package/dist/types/src/components/Button/MicButton.d.ts +24 -0
- package/dist/types/src/components/Button/MicButton.d.ts.map +1 -0
- package/dist/types/src/components/Button/MicButton.stories.d.ts +57 -0
- package/dist/types/src/components/Button/MicButton.stories.d.ts.map +1 -0
- package/dist/types/src/components/Button/SystemIconButton.d.ts +15 -2
- package/dist/types/src/components/Button/SystemIconButton.d.ts.map +1 -1
- package/dist/types/src/components/Button/SystemIconButton.stories.d.ts +51 -0
- package/dist/types/src/components/Button/SystemIconButton.stories.d.ts.map +1 -0
- package/dist/types/src/components/Button/ToggleGroup.d.ts +2 -2
- package/dist/types/src/components/Button/ToggleGroup.d.ts.map +1 -1
- package/dist/types/src/components/Button/index.d.ts +1 -0
- package/dist/types/src/components/Button/index.d.ts.map +1 -1
- package/dist/types/src/components/Calendar/Calendar.d.ts.map +1 -1
- package/dist/types/src/components/Calendar/Calendar.theme.d.ts.map +1 -1
- package/dist/types/src/components/Card/Card.d.ts +8 -8
- package/dist/types/src/components/Card/Card.d.ts.map +1 -1
- package/dist/types/src/components/Card/Card.stories.d.ts +2 -2
- package/dist/types/src/components/Card/Card.stories.d.ts.map +1 -1
- package/dist/types/src/components/Carousel/Carousel.d.ts +29 -6
- package/dist/types/src/components/Carousel/Carousel.d.ts.map +1 -1
- package/dist/types/src/components/Carousel/Carousel.stories.d.ts +48 -2
- package/dist/types/src/components/Carousel/Carousel.stories.d.ts.map +1 -1
- package/dist/types/src/components/Column/Column.d.ts +2 -2
- package/dist/types/src/components/Column/Column.d.ts.map +1 -1
- package/dist/types/src/components/Dialog/AlertDialog.d.ts +2 -2
- package/dist/types/src/components/Dialog/AlertDialog.d.ts.map +1 -1
- package/dist/types/src/components/Dialog/Dialog.d.ts +1 -1
- package/dist/types/src/components/Dialog/Dialog.d.ts.map +1 -1
- package/dist/types/src/components/Dialog/Dialog.stories.d.ts +2 -2
- package/dist/types/src/components/Dialog/Dialog.stories.d.ts.map +1 -1
- package/dist/types/src/components/Icon/Icon.stories.d.ts +5 -0
- package/dist/types/src/components/Icon/Icon.stories.d.ts.map +1 -1
- package/dist/types/src/components/Input/Input.d.ts +4 -1
- package/dist/types/src/components/Input/Input.d.ts.map +1 -1
- package/dist/types/src/components/Input/Input.stories.d.ts +3 -3
- package/dist/types/src/components/Input/Input.stories.d.ts.map +1 -1
- package/dist/types/src/components/Input/Input.theme.d.ts +10 -10
- package/dist/types/src/components/Input/Input.theme.d.ts.map +1 -1
- package/dist/types/src/components/Input/SegmentedInput.d.ts +8 -8
- package/dist/types/src/components/Input/SegmentedInput.d.ts.map +1 -1
- package/dist/types/src/components/Input/index.d.ts +0 -1
- package/dist/types/src/components/Input/index.d.ts.map +1 -1
- package/dist/types/src/components/Main/Main.d.ts +3 -3
- package/dist/types/src/components/Main/Main.d.ts.map +1 -1
- package/dist/types/src/components/Menu/ContextMenu.d.ts +1 -1
- package/dist/types/src/components/Menu/ContextMenu.d.ts.map +1 -1
- package/dist/types/src/components/Menu/DropdownMenu.d.ts +2 -2
- package/dist/types/src/components/Menu/DropdownMenu.d.ts.map +1 -1
- package/dist/types/src/components/Message/Message.d.ts +1 -1
- package/dist/types/src/components/Message/Message.d.ts.map +1 -1
- package/dist/types/src/components/Message/Message.stories.d.ts +2 -2
- package/dist/types/src/components/Message/Message.stories.d.ts.map +1 -1
- package/dist/types/src/components/Panel/Panel.d.ts +1 -1
- package/dist/types/src/components/Panel/Panel.d.ts.map +1 -1
- package/dist/types/src/components/Panel/Panel.theme.d.ts.map +1 -1
- package/dist/types/src/components/Popover/Popover.d.ts +2 -2
- package/dist/types/src/components/Popover/Popover.d.ts.map +1 -1
- package/dist/types/src/components/ScrollArea/ScrollArea.d.ts +2 -0
- package/dist/types/src/components/ScrollArea/ScrollArea.d.ts.map +1 -1
- package/dist/types/src/components/ScrollArea/ScrollArea.stories.d.ts +1 -0
- package/dist/types/src/components/ScrollArea/ScrollArea.stories.d.ts.map +1 -1
- package/dist/types/src/components/ScrollContainer/ScrollContainer.d.ts +1 -1
- package/dist/types/src/components/ScrollContainer/ScrollContainer.d.ts.map +1 -1
- package/dist/types/src/components/ScrollContainer/ScrollContainer.stories.d.ts +2 -2
- package/dist/types/src/components/ScrollContainer/ScrollContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/Select/Select.d.ts +1 -1
- package/dist/types/src/components/Select/Select.d.ts.map +1 -1
- package/dist/types/src/components/Select/Select.stories.d.ts +2 -2
- package/dist/types/src/components/Select/Select.stories.d.ts.map +1 -1
- package/dist/types/src/components/Separator/Separator.d.ts.map +1 -1
- package/dist/types/src/components/Splitter/Splitter.d.ts +30 -16
- package/dist/types/src/components/Splitter/Splitter.d.ts.map +1 -1
- package/dist/types/src/components/Splitter/Splitter.stories.d.ts +6 -1
- package/dist/types/src/components/Splitter/Splitter.stories.d.ts.map +1 -1
- package/dist/types/src/components/Splitter/Splitter.theme.d.ts +3 -1
- package/dist/types/src/components/Splitter/Splitter.theme.d.ts.map +1 -1
- package/dist/types/src/components/Tag/Tag.d.ts +1 -1
- package/dist/types/src/components/Tag/Tag.d.ts.map +1 -1
- package/dist/types/src/components/Tag/Tag.theme.d.ts +1 -1
- package/dist/types/src/components/Tag/Tag.theme.d.ts.map +1 -1
- package/dist/types/src/components/Toast/Toast.d.ts +1 -1
- package/dist/types/src/components/Toast/Toast.d.ts.map +1 -1
- package/dist/types/src/components/Toast/Toast.theme.d.ts.map +1 -1
- package/dist/types/src/components/Toolbar/Toolbar.d.ts +1 -1
- package/dist/types/src/components/Toolbar/Toolbar.d.ts.map +1 -1
- package/dist/types/src/components/Tooltip/Tooltip.d.ts +3 -3
- package/dist/types/src/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/types/src/components/Tooltip/Tooltip.stories.d.ts +2 -2
- package/dist/types/src/components/Tooltip/Tooltip.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +0 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/primitives/ThemeProvider/TranslationsProvider.d.ts +1 -8
- package/dist/types/src/primitives/ThemeProvider/TranslationsProvider.d.ts.map +1 -1
- package/dist/types/src/theme/defaultTheme.d.ts.map +1 -1
- package/dist/types/src/theme/index.d.ts +0 -2
- package/dist/types/src/theme/index.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +3 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/util/slots.d.ts +1 -1
- package/dist/types/src/util/slots.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +22 -21
- package/src/components/Avatars/Avatar.stories.tsx +2 -2
- package/src/components/Avatars/Avatar.theme.ts +1 -1
- package/src/components/Avatars/Avatar.tsx +3 -3
- package/src/components/Breadcrumb/Breadcrumb.tsx +6 -6
- package/src/components/Button/Button.tsx +2 -2
- package/src/components/Button/MicButton.stories.tsx +60 -0
- package/src/components/Button/MicButton.tsx +117 -0
- package/src/components/Button/SystemIconButton.stories.tsx +91 -0
- package/src/components/Button/SystemIconButton.tsx +113 -2
- package/src/components/Button/ToggleGroup.tsx +2 -2
- package/src/components/Button/index.ts +1 -0
- package/src/components/Calendar/Calendar.theme.ts +2 -0
- package/src/components/Calendar/Calendar.tsx +3 -3
- package/src/components/Card/Card.stories.tsx +2 -2
- package/src/components/Card/Card.tsx +11 -11
- package/src/components/Carousel/Carousel.stories.tsx +42 -18
- package/src/components/Carousel/Carousel.tsx +169 -33
- package/src/components/Column/Column.tsx +4 -7
- package/src/components/Dialog/AlertDialog.stories.tsx +2 -2
- package/src/components/Dialog/AlertDialog.tsx +13 -13
- package/src/components/Dialog/Dialog.stories.tsx +3 -4
- package/src/components/Dialog/Dialog.theme.ts +1 -1
- package/src/components/Dialog/Dialog.tsx +12 -12
- package/src/components/Icon/Icon.stories.tsx +23 -0
- package/src/components/Icon/Icon.theme.ts +1 -1
- package/src/components/Input/Input.stories.tsx +13 -5
- package/src/components/Input/Input.theme.ts +17 -39
- package/src/components/Input/Input.tsx +30 -13
- package/src/components/Input/SegmentedInput.tsx +50 -41
- package/src/components/Input/index.ts +0 -1
- package/src/components/Main/Main.tsx +3 -3
- package/src/components/MediaPlayer/MediaPlayer.tsx +4 -4
- package/src/components/Menu/ContextMenu.tsx +8 -8
- package/src/components/Menu/DropdownMenu.tsx +12 -13
- package/src/components/Message/Message.stories.tsx +2 -2
- package/src/components/Message/Message.theme.ts +1 -1
- package/src/components/Message/Message.tsx +2 -2
- package/src/components/Panel/Panel.theme.ts +2 -1
- package/src/components/Panel/Panel.tsx +1 -1
- package/src/components/Popover/Popover.tsx +9 -9
- package/src/components/ScrollArea/ScrollArea.tsx +7 -4
- package/src/components/ScrollContainer/ScrollContainer.stories.tsx +2 -2
- package/src/components/ScrollContainer/ScrollContainer.tsx +2 -2
- package/src/components/Select/Select.stories.tsx +2 -2
- package/src/components/Select/Select.theme.ts +1 -1
- package/src/components/Select/Select.tsx +14 -14
- package/src/components/Separator/Separator.tsx +1 -0
- package/src/components/Splitter/Splitter.stories.tsx +84 -20
- package/src/components/Splitter/Splitter.theme.ts +20 -3
- package/src/components/Splitter/Splitter.tsx +320 -47
- package/src/components/Tag/Tag.stories.tsx +1 -1
- package/src/components/Tag/Tag.theme.ts +1 -1
- package/src/components/Tag/Tag.tsx +3 -5
- package/src/components/Toast/Toast.theme.ts +3 -2
- package/src/components/Toast/Toast.tsx +5 -5
- package/src/components/Toolbar/Toolbar.tsx +10 -10
- package/src/components/Tooltip/Tooltip.stories.tsx +2 -2
- package/src/components/Tooltip/Tooltip.tsx +3 -3
- package/src/components/index.ts +0 -1
- package/src/exemplars/tabster.stories.tsx +1 -1
- package/src/index.ts +1 -1
- package/src/primitives/ThemeProvider/TranslationsProvider.tsx +10 -30
- package/src/testing/decorators/withLayout.tsx +4 -4
- package/src/theme/defaultTheme.ts +0 -4
- package/src/theme/index.ts +0 -2
- package/src/translations.ts +8 -0
- package/src/util/slots.ts +5 -5
- package/dist/lib/browser/chunk-F3PLXTDA.mjs.map +0 -7
- package/dist/lib/browser/chunk-HFJYTGHU.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-LLVUYLAM.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-OJYUPUCY.mjs.map +0 -7
- package/dist/types/src/components/Input/constants.d.ts +0 -5
- package/dist/types/src/components/Input/constants.d.ts.map +0 -1
- package/dist/types/src/components/List/List.d.ts +0 -29
- package/dist/types/src/components/List/List.d.ts.map +0 -1
- package/dist/types/src/components/List/List.stories.d.ts +0 -16
- package/dist/types/src/components/List/List.stories.d.ts.map +0 -1
- package/dist/types/src/components/List/List.theme.d.ts +0 -7
- package/dist/types/src/components/List/List.theme.d.ts.map +0 -1
- package/dist/types/src/components/List/ListDropIndicator.d.ts +0 -13
- package/dist/types/src/components/List/ListDropIndicator.d.ts.map +0 -1
- package/dist/types/src/components/List/Tree.d.ts +0 -23
- package/dist/types/src/components/List/Tree.d.ts.map +0 -1
- package/dist/types/src/components/List/Tree.stories.d.ts +0 -15
- package/dist/types/src/components/List/Tree.stories.d.ts.map +0 -1
- package/dist/types/src/components/List/TreeDropIndicator.d.ts +0 -8
- package/dist/types/src/components/List/TreeDropIndicator.d.ts.map +0 -1
- package/dist/types/src/components/List/Treegrid.d.ts +0 -33
- package/dist/types/src/components/List/Treegrid.d.ts.map +0 -1
- package/dist/types/src/components/List/Treegrid.stories.d.ts +0 -12
- package/dist/types/src/components/List/Treegrid.stories.d.ts.map +0 -1
- package/dist/types/src/components/List/Treegrid.theme.d.ts +0 -7
- package/dist/types/src/components/List/Treegrid.theme.d.ts.map +0 -1
- package/dist/types/src/components/List/index.d.ts +0 -4
- package/dist/types/src/components/List/index.d.ts.map +0 -1
- package/src/components/Input/constants.ts +0 -8
- package/src/components/List/List.stories.tsx +0 -234
- package/src/components/List/List.theme.ts +0 -47
- package/src/components/List/List.tsx +0 -171
- package/src/components/List/ListDropIndicator.tsx +0 -69
- package/src/components/List/Tree.stories.tsx +0 -87
- package/src/components/List/Tree.tsx +0 -74
- package/src/components/List/TreeDropIndicator.tsx +0 -70
- package/src/components/List/Treegrid.stories.tsx +0 -156
- package/src/components/List/Treegrid.theme.ts +0 -35
- package/src/components/List/Treegrid.tsx +0 -187
- package/src/components/List/index.ts +0 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/react-ui",
|
|
3
|
-
"version": "0.9.1-
|
|
3
|
+
"version": "0.9.1-staging.ee54ba693a",
|
|
4
4
|
"description": "Low-level React components for DXOS, applying a theme to a core group of primitives",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -85,17 +85,18 @@
|
|
|
85
85
|
"react-error-boundary": "^4.0.13",
|
|
86
86
|
"react-i18next": "^11.18.6",
|
|
87
87
|
"react-remove-scroll": "^2.6.0",
|
|
88
|
-
"@dxos/
|
|
89
|
-
"@dxos/
|
|
90
|
-
"@dxos/
|
|
91
|
-
"@dxos/
|
|
92
|
-
"@dxos/
|
|
93
|
-
"@dxos/
|
|
94
|
-
"@dxos/
|
|
95
|
-
"@dxos/react-hooks": "0.9.1-
|
|
96
|
-
"@dxos/react-
|
|
97
|
-
"@dxos/ui-types": "0.9.1-
|
|
98
|
-
"@dxos/
|
|
88
|
+
"@dxos/debug": "0.9.1-staging.ee54ba693a",
|
|
89
|
+
"@dxos/i18n": "0.9.1-staging.ee54ba693a",
|
|
90
|
+
"@dxos/invariant": "0.9.1-staging.ee54ba693a",
|
|
91
|
+
"@dxos/react-error-boundary": "0.9.1-staging.ee54ba693a",
|
|
92
|
+
"@dxos/async": "0.9.1-staging.ee54ba693a",
|
|
93
|
+
"@dxos/log": "0.9.1-staging.ee54ba693a",
|
|
94
|
+
"@dxos/lit-ui": "0.9.1-staging.ee54ba693a",
|
|
95
|
+
"@dxos/react-hooks": "0.9.1-staging.ee54ba693a",
|
|
96
|
+
"@dxos/react-input": "0.9.1-staging.ee54ba693a",
|
|
97
|
+
"@dxos/ui-types": "0.9.1-staging.ee54ba693a",
|
|
98
|
+
"@dxos/react-list": "0.9.1-staging.ee54ba693a",
|
|
99
|
+
"@dxos/util": "0.9.1-staging.ee54ba693a"
|
|
99
100
|
},
|
|
100
101
|
"devDependencies": {
|
|
101
102
|
"@dnd-kit/core": "^6.0.5",
|
|
@@ -103,20 +104,20 @@
|
|
|
103
104
|
"@dnd-kit/utilities": "^3.2.0",
|
|
104
105
|
"@phosphor-icons/react": "2.1.10",
|
|
105
106
|
"@tanstack/react-virtual": "^3.13.18",
|
|
106
|
-
"@types/react": "~19.2.
|
|
107
|
+
"@types/react": "~19.2.17",
|
|
107
108
|
"@types/react-dom": "~19.2.3",
|
|
108
|
-
"react": "~19.2.
|
|
109
|
-
"react-dom": "~19.2.
|
|
109
|
+
"react": "~19.2.7",
|
|
110
|
+
"react-dom": "~19.2.7",
|
|
110
111
|
"tabster": "^8.5.5",
|
|
111
112
|
"vite": "^8.0.16",
|
|
112
|
-
"@dxos/
|
|
113
|
-
"@dxos/
|
|
114
|
-
"@dxos/
|
|
113
|
+
"@dxos/random": "0.9.1-staging.ee54ba693a",
|
|
114
|
+
"@dxos/ui-theme": "0.9.1-staging.ee54ba693a",
|
|
115
|
+
"@dxos/util": "0.9.1-staging.ee54ba693a"
|
|
115
116
|
},
|
|
116
117
|
"peerDependencies": {
|
|
117
|
-
"react": "~19.2.
|
|
118
|
-
"react-dom": "~19.2.
|
|
119
|
-
"@dxos/ui-theme": "0.9.1-
|
|
118
|
+
"react": "~19.2.7",
|
|
119
|
+
"react-dom": "~19.2.7",
|
|
120
|
+
"@dxos/ui-theme": "0.9.1-staging.ee54ba693a"
|
|
120
121
|
},
|
|
121
122
|
"publishConfig": {
|
|
122
123
|
"access": "public"
|
|
@@ -11,7 +11,7 @@ import { hexToFallback } from '@dxos/util';
|
|
|
11
11
|
import { withTheme } from '../../testing';
|
|
12
12
|
import { Avatar, type AvatarAnimation, type AvatarStatus, type AvatarVariant } from './Avatar';
|
|
13
13
|
|
|
14
|
-
type
|
|
14
|
+
type StoryArgs = PropsWithChildren<{
|
|
15
15
|
id?: string;
|
|
16
16
|
imgSrc?: string;
|
|
17
17
|
fallbackText?: string;
|
|
@@ -24,7 +24,7 @@ type DefaultStoryProps = PropsWithChildren<{
|
|
|
24
24
|
hue?: ChromaticPalette;
|
|
25
25
|
}>;
|
|
26
26
|
|
|
27
|
-
const DefaultStory = (props:
|
|
27
|
+
const DefaultStory = (props: StoryArgs) => {
|
|
28
28
|
const {
|
|
29
29
|
id = '20970b563fc49b5bb194a6ffdff376031a3a11f9481360c071c3fed87874106b',
|
|
30
30
|
status,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { getHeight, getSize, mx } from '@dxos/ui-theme';
|
|
6
6
|
import { type ComponentFunction, type Size, type Theme } from '@dxos/ui-types';
|
|
7
7
|
|
|
8
8
|
export type AvatarStyleProps = Partial<{
|
|
@@ -101,11 +101,11 @@ export const Avatar = {
|
|
|
101
101
|
export { useAvatarContext };
|
|
102
102
|
|
|
103
103
|
export type {
|
|
104
|
-
AvatarStatus,
|
|
105
|
-
AvatarVariant,
|
|
106
104
|
AvatarAnimation,
|
|
107
105
|
AvatarContentProps,
|
|
108
|
-
AvatarLabelProps,
|
|
109
106
|
AvatarDescriptionProps,
|
|
107
|
+
AvatarLabelProps,
|
|
108
|
+
AvatarStatus,
|
|
109
|
+
AvatarVariant,
|
|
110
110
|
NaturalDxAvatar as DxAvatar,
|
|
111
111
|
};
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { Primitive } from '@radix-ui/react-primitive';
|
|
6
6
|
import { Slot } from '@radix-ui/react-slot';
|
|
7
|
-
import React, { type
|
|
7
|
+
import React, { type ComponentPropsWithoutRef, type ComponentPropsWithRef, forwardRef } from 'react';
|
|
8
8
|
|
|
9
9
|
import { useThemeContext } from '../../hooks';
|
|
10
10
|
import { type ThemedClassName } from '../../util';
|
|
@@ -13,7 +13,7 @@ import { Link, type LinkProps } from '../Link';
|
|
|
13
13
|
|
|
14
14
|
type BreadcrumbRootProps = ThemedClassName<ComponentPropsWithRef<typeof Primitive.div>> & {
|
|
15
15
|
'aria-label': string;
|
|
16
|
-
asChild?: boolean;
|
|
16
|
+
'asChild'?: boolean;
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
const BreadcrumbRoot = forwardRef<HTMLDivElement, BreadcrumbRootProps>(
|
|
@@ -101,10 +101,10 @@ export const Breadcrumb = {
|
|
|
101
101
|
};
|
|
102
102
|
|
|
103
103
|
export type {
|
|
104
|
-
BreadcrumbRootProps,
|
|
105
|
-
BreadcrumbListProps,
|
|
106
|
-
BreadcrumbListItemProps,
|
|
107
|
-
BreadcrumbLinkProps,
|
|
108
104
|
BreadcrumbCurrentProps,
|
|
105
|
+
BreadcrumbLinkProps,
|
|
106
|
+
BreadcrumbListItemProps,
|
|
107
|
+
BreadcrumbListProps,
|
|
108
|
+
BreadcrumbRootProps,
|
|
109
109
|
BreadcrumbSeparatorProps,
|
|
110
110
|
};
|
|
@@ -109,6 +109,6 @@ const ButtonGroup = forwardRef<HTMLDivElement, ButtonGroupProps>(
|
|
|
109
109
|
|
|
110
110
|
ButtonGroup.displayName = BUTTON_GROUP_NAME;
|
|
111
111
|
|
|
112
|
-
export { Button,
|
|
112
|
+
export { Button, BUTTON_GROUP_NAME, ButtonGroup, useButtonGroupContext };
|
|
113
113
|
|
|
114
|
-
export type {
|
|
114
|
+
export type { ButtonGroupProps, ButtonProps };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
|
+
import React, { useState } from 'react';
|
|
7
|
+
|
|
8
|
+
import { withTheme } from '../../testing';
|
|
9
|
+
import { translations } from '../../translations';
|
|
10
|
+
import { Tooltip } from '../Tooltip';
|
|
11
|
+
import { MicButton, type MicButtonProps } from './MicButton';
|
|
12
|
+
|
|
13
|
+
const DefaultStory = ({ mode = 'toggle', ...props }: MicButtonProps) => {
|
|
14
|
+
const [recording, setRecording] = useState(false);
|
|
15
|
+
|
|
16
|
+
return (
|
|
17
|
+
<Tooltip.Provider>
|
|
18
|
+
<MicButton
|
|
19
|
+
iconOnly
|
|
20
|
+
variant='ghost'
|
|
21
|
+
{...props}
|
|
22
|
+
mode={mode}
|
|
23
|
+
// `label`/`recording`/handlers are driven by story state so the demo reacts to interaction.
|
|
24
|
+
label={recording ? 'Stop recording' : mode === 'hold' ? 'Hold to record' : 'Start recording'}
|
|
25
|
+
recording={recording}
|
|
26
|
+
onToggle={() => setRecording((value) => !value)}
|
|
27
|
+
onPressStart={() => setRecording(true)}
|
|
28
|
+
onPressEnd={() => setRecording(false)}
|
|
29
|
+
/>
|
|
30
|
+
</Tooltip.Provider>
|
|
31
|
+
);
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const meta = {
|
|
35
|
+
title: 'ui/react-ui-core/components/MicButton',
|
|
36
|
+
decorators: [withTheme()],
|
|
37
|
+
component: MicButton,
|
|
38
|
+
render: DefaultStory,
|
|
39
|
+
args: { label: 'Record', mode: 'toggle' },
|
|
40
|
+
parameters: {
|
|
41
|
+
layout: 'centered',
|
|
42
|
+
translations,
|
|
43
|
+
},
|
|
44
|
+
} satisfies Meta<typeof MicButton>;
|
|
45
|
+
|
|
46
|
+
export default meta;
|
|
47
|
+
|
|
48
|
+
type Story = StoryObj<typeof meta>;
|
|
49
|
+
|
|
50
|
+
export const Toggle: Story = {
|
|
51
|
+
args: {
|
|
52
|
+
mode: 'toggle',
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export const Hold: Story = {
|
|
57
|
+
args: {
|
|
58
|
+
mode: 'hold',
|
|
59
|
+
},
|
|
60
|
+
};
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { type KeyboardEvent, type PointerEvent, forwardRef, useCallback, useRef } from 'react';
|
|
6
|
+
|
|
7
|
+
import { IconButton, type IconButtonProps } from './IconButton';
|
|
8
|
+
|
|
9
|
+
export type MicButtonMode = 'toggle' | 'hold';
|
|
10
|
+
|
|
11
|
+
export type MicButtonProps = Omit<IconButtonProps, 'icon' | 'onClick'> & {
|
|
12
|
+
/** Defaults to a microphone glyph. */
|
|
13
|
+
icon?: IconButtonProps['icon'];
|
|
14
|
+
/** `toggle`: click flips recording. `hold`: records only while held (push-to-talk). */
|
|
15
|
+
mode?: MicButtonMode;
|
|
16
|
+
/** Whether recording is active; drives the active (recording) styling. */
|
|
17
|
+
recording?: boolean;
|
|
18
|
+
/** Fired in `toggle` mode on click. */
|
|
19
|
+
onToggle?: () => void;
|
|
20
|
+
/** Fired in `hold` mode when the press begins. */
|
|
21
|
+
onPressStart?: () => void;
|
|
22
|
+
/** Fired in `hold` mode when the press ends (release, cancel, or lost capture). */
|
|
23
|
+
onPressEnd?: () => void;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Microphone record button. In `toggle` mode a click flips recording; in `hold` mode recording is
|
|
28
|
+
* active only while the button is held (push-to-talk), using pointer capture so the release still
|
|
29
|
+
* fires if the pointer leaves the button. Presentational — the caller owns recording state.
|
|
30
|
+
*/
|
|
31
|
+
export const MicButton = forwardRef<HTMLButtonElement, MicButtonProps>(
|
|
32
|
+
(
|
|
33
|
+
{
|
|
34
|
+
classNames,
|
|
35
|
+
icon = 'ph--microphone--regular',
|
|
36
|
+
mode = 'toggle',
|
|
37
|
+
recording,
|
|
38
|
+
onToggle,
|
|
39
|
+
onPressStart,
|
|
40
|
+
onPressEnd,
|
|
41
|
+
...props
|
|
42
|
+
},
|
|
43
|
+
forwardedRef,
|
|
44
|
+
) => {
|
|
45
|
+
// A press spans pointer down→up (or key down→up). The guard makes start/end fire exactly once
|
|
46
|
+
// even though release surfaces as both `pointerup` and `lostpointercapture`.
|
|
47
|
+
const pressedRef = useRef(false);
|
|
48
|
+
const beginPress = useCallback(() => {
|
|
49
|
+
if (!pressedRef.current) {
|
|
50
|
+
pressedRef.current = true;
|
|
51
|
+
onPressStart?.();
|
|
52
|
+
}
|
|
53
|
+
}, [onPressStart]);
|
|
54
|
+
|
|
55
|
+
const endPress = useCallback(() => {
|
|
56
|
+
if (pressedRef.current) {
|
|
57
|
+
pressedRef.current = false;
|
|
58
|
+
onPressEnd?.();
|
|
59
|
+
}
|
|
60
|
+
}, [onPressEnd]);
|
|
61
|
+
const handlePointerDown = useCallback(
|
|
62
|
+
(event: PointerEvent<HTMLButtonElement>) => {
|
|
63
|
+
// Capture so the matching release fires on this button even if the pointer leaves it.
|
|
64
|
+
event.currentTarget.setPointerCapture(event.pointerId);
|
|
65
|
+
beginPress();
|
|
66
|
+
},
|
|
67
|
+
[beginPress],
|
|
68
|
+
);
|
|
69
|
+
const handleKeyDown = useCallback(
|
|
70
|
+
(event: KeyboardEvent<HTMLButtonElement>) => {
|
|
71
|
+
// Keyboard push-to-talk: hold Space/Enter to record. Ignore auto-repeat.
|
|
72
|
+
if ((event.key === ' ' || event.key === 'Enter') && !event.repeat) {
|
|
73
|
+
event.preventDefault();
|
|
74
|
+
beginPress();
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
[beginPress],
|
|
78
|
+
);
|
|
79
|
+
const handleKeyUp = useCallback(
|
|
80
|
+
(event: KeyboardEvent<HTMLButtonElement>) => {
|
|
81
|
+
if (event.key === ' ' || event.key === 'Enter') {
|
|
82
|
+
event.preventDefault();
|
|
83
|
+
endPress();
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
[endPress],
|
|
87
|
+
);
|
|
88
|
+
|
|
89
|
+
// Highlight with the error (rose) tone while recording.
|
|
90
|
+
const recordingClassNames = recording ? 'bg-error-surface' : undefined;
|
|
91
|
+
const holdHandlers =
|
|
92
|
+
mode === 'hold'
|
|
93
|
+
? {
|
|
94
|
+
onPointerDown: handlePointerDown,
|
|
95
|
+
onPointerUp: endPress,
|
|
96
|
+
onPointerCancel: endPress,
|
|
97
|
+
onLostPointerCapture: endPress,
|
|
98
|
+
onKeyDown: handleKeyDown,
|
|
99
|
+
onKeyUp: handleKeyUp,
|
|
100
|
+
// Releasing focus mid-hold (e.g. tabbing away) must still end the press.
|
|
101
|
+
onBlur: endPress,
|
|
102
|
+
}
|
|
103
|
+
: {
|
|
104
|
+
onClick: onToggle,
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
return (
|
|
108
|
+
<IconButton
|
|
109
|
+
{...props}
|
|
110
|
+
{...holdHandlers}
|
|
111
|
+
classNames={[recordingClassNames, classNames]}
|
|
112
|
+
icon={icon}
|
|
113
|
+
ref={forwardedRef}
|
|
114
|
+
/>
|
|
115
|
+
);
|
|
116
|
+
},
|
|
117
|
+
);
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
|
+
import React, { useState } from 'react';
|
|
7
|
+
|
|
8
|
+
import { withTheme } from '../../testing';
|
|
9
|
+
import { translations } from '../../translations';
|
|
10
|
+
import { Toolbar } from '../Toolbar';
|
|
11
|
+
import { Tooltip } from '../Tooltip';
|
|
12
|
+
import { SystemIconButton } from './SystemIconButton';
|
|
13
|
+
|
|
14
|
+
const iconOnly = { iconOnly: true, variant: 'ghost' as const };
|
|
15
|
+
|
|
16
|
+
const ToolbarStory = () => {
|
|
17
|
+
const [state, setState] = useState({ star: false, bookmark: false, expander: false });
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<Tooltip.Provider>
|
|
21
|
+
<Toolbar.Root>
|
|
22
|
+
<Toolbar.Button asChild>
|
|
23
|
+
<SystemIconButton.Star
|
|
24
|
+
{...iconOnly}
|
|
25
|
+
active={state.star}
|
|
26
|
+
onClick={() => setState((prev) => ({ ...prev, star: !prev.star }))}
|
|
27
|
+
/>
|
|
28
|
+
</Toolbar.Button>
|
|
29
|
+
<Toolbar.Button asChild>
|
|
30
|
+
<SystemIconButton.Bookmark
|
|
31
|
+
{...iconOnly}
|
|
32
|
+
active={state.bookmark}
|
|
33
|
+
onClick={() => setState((prev) => ({ ...prev, bookmark: !prev.bookmark }))}
|
|
34
|
+
/>
|
|
35
|
+
</Toolbar.Button>
|
|
36
|
+
<Toolbar.Button asChild>
|
|
37
|
+
<SystemIconButton.Expander
|
|
38
|
+
{...iconOnly}
|
|
39
|
+
active={state.expander}
|
|
40
|
+
onClick={() => setState((prev) => ({ ...prev, expander: !prev.expander }))}
|
|
41
|
+
/>
|
|
42
|
+
</Toolbar.Button>
|
|
43
|
+
<Toolbar.Separator variant='line' />
|
|
44
|
+
<Toolbar.Button asChild>
|
|
45
|
+
<SystemIconButton.Add {...iconOnly} />
|
|
46
|
+
</Toolbar.Button>
|
|
47
|
+
<Toolbar.Button asChild>
|
|
48
|
+
<SystemIconButton.Edit {...iconOnly} />
|
|
49
|
+
</Toolbar.Button>
|
|
50
|
+
<Toolbar.Button asChild>
|
|
51
|
+
<SystemIconButton.Delete {...iconOnly} />
|
|
52
|
+
</Toolbar.Button>
|
|
53
|
+
<Toolbar.Separator variant='line' />
|
|
54
|
+
<Toolbar.Button asChild>
|
|
55
|
+
<SystemIconButton.Clipboard {...iconOnly} onCopy={() => 'Copied from toolbar'} />
|
|
56
|
+
</Toolbar.Button>
|
|
57
|
+
<SystemIconButton.Upload {...iconOnly} accept='*/*' />
|
|
58
|
+
<Toolbar.Button asChild>
|
|
59
|
+
<SystemIconButton.Download
|
|
60
|
+
{...iconOnly}
|
|
61
|
+
filename='example.txt'
|
|
62
|
+
onDownload={() => new Blob(['Hello from SystemIconButton'])}
|
|
63
|
+
/>
|
|
64
|
+
</Toolbar.Button>
|
|
65
|
+
<Toolbar.Separator variant='line' />
|
|
66
|
+
<Toolbar.Button asChild>
|
|
67
|
+
<SystemIconButton.Close {...iconOnly} />
|
|
68
|
+
</Toolbar.Button>
|
|
69
|
+
</Toolbar.Root>
|
|
70
|
+
</Tooltip.Provider>
|
|
71
|
+
);
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
const meta = {
|
|
75
|
+
title: 'ui/react-ui-core/components/SystemIconButton',
|
|
76
|
+
component: SystemIconButton.Add,
|
|
77
|
+
render: ToolbarStory,
|
|
78
|
+
decorators: [withTheme()],
|
|
79
|
+
parameters: {
|
|
80
|
+
layout: 'centered',
|
|
81
|
+
translations,
|
|
82
|
+
},
|
|
83
|
+
} satisfies Meta<typeof SystemIconButton.Add>;
|
|
84
|
+
|
|
85
|
+
export default meta;
|
|
86
|
+
|
|
87
|
+
type Story = StoryObj<typeof meta>;
|
|
88
|
+
|
|
89
|
+
export const Default: Story = {
|
|
90
|
+
args: {},
|
|
91
|
+
};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright 2026 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import React, { forwardRef } from 'react';
|
|
5
|
+
import React, { InputHTMLAttributes, forwardRef, useCallback, useRef } from 'react';
|
|
6
6
|
import { useTranslation } from 'react-i18next';
|
|
7
7
|
|
|
8
8
|
import { translationKey } from '#translations';
|
|
@@ -136,6 +136,108 @@ const CloseIconButton = forwardRef<HTMLButtonElement, StaticPresetProps>(({ labe
|
|
|
136
136
|
|
|
137
137
|
CloseIconButton.displayName = 'SystemIconButton.Close';
|
|
138
138
|
|
|
139
|
+
//
|
|
140
|
+
// Clipboard
|
|
141
|
+
//
|
|
142
|
+
|
|
143
|
+
type ClipboardIconButtonProps = StaticPresetProps & {
|
|
144
|
+
onCopy: () => string;
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
const ClipboardIconButton = forwardRef<HTMLButtonElement, ClipboardIconButtonProps>(
|
|
148
|
+
({ label, onCopy, ...props }, forwardedRef) => {
|
|
149
|
+
const { t } = useTranslation(translationKey);
|
|
150
|
+
const handleCopy = useCallback(() => {
|
|
151
|
+
const text = onCopy();
|
|
152
|
+
if (text) {
|
|
153
|
+
void navigator.clipboard.writeText(text);
|
|
154
|
+
}
|
|
155
|
+
}, [onCopy]);
|
|
156
|
+
return (
|
|
157
|
+
<IconButton
|
|
158
|
+
{...props}
|
|
159
|
+
icon='ph--clipboard--regular'
|
|
160
|
+
label={label ?? t('system-button.clipboard.label')}
|
|
161
|
+
onClick={handleCopy}
|
|
162
|
+
ref={forwardedRef}
|
|
163
|
+
/>
|
|
164
|
+
);
|
|
165
|
+
},
|
|
166
|
+
);
|
|
167
|
+
|
|
168
|
+
ClipboardIconButton.displayName = 'SystemIconButton.Clipboard';
|
|
169
|
+
|
|
170
|
+
//
|
|
171
|
+
// Upload
|
|
172
|
+
//
|
|
173
|
+
|
|
174
|
+
type UploadIconButtonProps = StaticPresetProps &
|
|
175
|
+
Pick<InputHTMLAttributes<HTMLInputElement>, 'accept'> & {
|
|
176
|
+
onFileChange?: InputHTMLAttributes<HTMLInputElement>['onChange'];
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
const UploadIconButton = forwardRef<HTMLButtonElement, UploadIconButtonProps>(
|
|
180
|
+
({ accept, onFileChange, label, ...props }, forwardedRef) => {
|
|
181
|
+
const { t } = useTranslation(translationKey);
|
|
182
|
+
const fileInputRef = useRef<HTMLInputElement>(null);
|
|
183
|
+
return (
|
|
184
|
+
<>
|
|
185
|
+
<input className='sr-only' type='file' accept={accept} onChange={onFileChange} ref={fileInputRef} />
|
|
186
|
+
<IconButton
|
|
187
|
+
icon='ph--upload-simple--regular'
|
|
188
|
+
label={label ?? t('system-button.upload.label')}
|
|
189
|
+
{...props}
|
|
190
|
+
onClick={() => fileInputRef.current?.click()}
|
|
191
|
+
ref={forwardedRef}
|
|
192
|
+
/>
|
|
193
|
+
</>
|
|
194
|
+
);
|
|
195
|
+
},
|
|
196
|
+
);
|
|
197
|
+
|
|
198
|
+
UploadIconButton.displayName = 'SystemIconButton.Upload';
|
|
199
|
+
|
|
200
|
+
//
|
|
201
|
+
// Download
|
|
202
|
+
//
|
|
203
|
+
|
|
204
|
+
type DownloadIconButtonProps = StaticPresetProps & {
|
|
205
|
+
filename: string;
|
|
206
|
+
onDownload: () => Blob | null;
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
const DownloadIconButton = forwardRef<HTMLButtonElement, DownloadIconButtonProps>(
|
|
210
|
+
({ filename, onDownload, label, ...props }, forwardedRef) => {
|
|
211
|
+
const { t } = useTranslation(translationKey);
|
|
212
|
+
const handleDownload = useCallback(() => {
|
|
213
|
+
const blob = onDownload();
|
|
214
|
+
if (!blob) {
|
|
215
|
+
return;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
const url = URL.createObjectURL(blob);
|
|
219
|
+
|
|
220
|
+
const a = document.createElement('a');
|
|
221
|
+
a.href = url;
|
|
222
|
+
a.download = filename;
|
|
223
|
+
a.click();
|
|
224
|
+
|
|
225
|
+
URL.revokeObjectURL(url);
|
|
226
|
+
}, [onDownload]);
|
|
227
|
+
return (
|
|
228
|
+
<IconButton
|
|
229
|
+
icon='ph--download-simple--regular'
|
|
230
|
+
label={label ?? t('system-button.download.label')}
|
|
231
|
+
{...props}
|
|
232
|
+
onClick={handleDownload}
|
|
233
|
+
ref={forwardedRef}
|
|
234
|
+
/>
|
|
235
|
+
);
|
|
236
|
+
},
|
|
237
|
+
);
|
|
238
|
+
|
|
239
|
+
DownloadIconButton.displayName = 'SystemIconButton.Download';
|
|
240
|
+
|
|
139
241
|
//
|
|
140
242
|
// Namespace
|
|
141
243
|
//
|
|
@@ -148,6 +250,15 @@ export const SystemIconButton = {
|
|
|
148
250
|
Delete: DeleteIconButton,
|
|
149
251
|
Edit: EditIconButton,
|
|
150
252
|
Close: CloseIconButton,
|
|
253
|
+
Clipboard: ClipboardIconButton,
|
|
254
|
+
Upload: UploadIconButton,
|
|
255
|
+
Download: DownloadIconButton,
|
|
151
256
|
};
|
|
152
257
|
|
|
153
|
-
export type {
|
|
258
|
+
export type {
|
|
259
|
+
ClipboardIconButtonProps,
|
|
260
|
+
DownloadIconButtonProps,
|
|
261
|
+
StaticPresetProps,
|
|
262
|
+
TogglePresetProps,
|
|
263
|
+
UploadIconButtonProps,
|
|
264
|
+
};
|
|
@@ -46,5 +46,5 @@ const ToggleGroupIconItem = forwardRef<HTMLButtonElement, ToggleGroupIconItemPro
|
|
|
46
46
|
},
|
|
47
47
|
);
|
|
48
48
|
|
|
49
|
-
export { ToggleGroup,
|
|
50
|
-
export type {
|
|
49
|
+
export { ToggleGroup, ToggleGroupIconItem, ToggleGroupItem };
|
|
50
|
+
export type { ToggleGroupItemProps, ToggleGroupProps };
|
|
@@ -51,6 +51,8 @@ const day: ComponentFunction<CalendarStyleProps> = (_p, ...etc) =>
|
|
|
51
51
|
'outline-none',
|
|
52
52
|
'data-[hovered]:bg-hover-surface',
|
|
53
53
|
'data-[focus-visible]:outline-2 data-[focus-visible]:outline-primary-500',
|
|
54
|
+
// Highlight today (overridden by the selected style below when today is also the selected day).
|
|
55
|
+
'data-[today]:text-orange-500 data-[today]:font-medium',
|
|
54
56
|
'data-[selected]:bg-primary-500 data-[selected]:text-primary-fg data-[selected]:hover:bg-primary-500',
|
|
55
57
|
'data-[outside-month]:text-description/40',
|
|
56
58
|
'data-[disabled]:text-description/40 data-[disabled]:cursor-not-allowed data-[disabled]:hover:bg-transparent',
|
|
@@ -3,20 +3,20 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { CalendarDate, parseDate } from '@internationalized/date';
|
|
6
|
-
import React, {
|
|
6
|
+
import React, { type ComponentPropsWithoutRef, type ReactNode, forwardRef } from 'react';
|
|
7
7
|
import {
|
|
8
|
+
type DateValue,
|
|
8
9
|
Button as RACButton,
|
|
9
10
|
Calendar as RACCalendar,
|
|
10
11
|
CalendarCell as RACCalendarCell,
|
|
11
|
-
type CalendarProps as RACCalendarProps,
|
|
12
12
|
CalendarGrid as RACCalendarGrid,
|
|
13
13
|
CalendarGridBody as RACCalendarGridBody,
|
|
14
14
|
CalendarGridHeader as RACCalendarGridHeader,
|
|
15
15
|
CalendarHeaderCell as RACCalendarHeaderCell,
|
|
16
|
+
type CalendarProps as RACCalendarProps,
|
|
16
17
|
Heading as RACHeading,
|
|
17
18
|
RangeCalendar as RACRangeCalendar,
|
|
18
19
|
type RangeCalendarProps as RACRangeCalendarProps,
|
|
19
|
-
type DateValue,
|
|
20
20
|
} from 'react-aria-components';
|
|
21
21
|
|
|
22
22
|
import { type ClassNameValue } from '@dxos/ui-types';
|
|
@@ -13,14 +13,14 @@ import { Card } from './Card';
|
|
|
13
13
|
|
|
14
14
|
random.seed(0);
|
|
15
15
|
|
|
16
|
-
type
|
|
16
|
+
type StoryArgs = {
|
|
17
17
|
title: string;
|
|
18
18
|
description?: string;
|
|
19
19
|
image?: string;
|
|
20
20
|
fullWidth?: boolean;
|
|
21
21
|
};
|
|
22
22
|
|
|
23
|
-
const DefaultStory = ({ title, description, image, fullWidth }:
|
|
23
|
+
const DefaultStory = ({ title, description, image, fullWidth }: StoryArgs) => {
|
|
24
24
|
const handleRef = useRef<HTMLButtonElement>(null);
|
|
25
25
|
console.log(title);
|
|
26
26
|
return (
|
|
@@ -30,13 +30,13 @@ import { type ToolbarActionIconButtonProps, type ToolbarDragHandleProps, type To
|
|
|
30
30
|
const CARD_ROOT_NAME = 'Card.Root';
|
|
31
31
|
|
|
32
32
|
type CardRootProps = {
|
|
33
|
-
id?: string;
|
|
34
|
-
border?: boolean;
|
|
35
|
-
fullWidth?: boolean;
|
|
36
|
-
density?: Density;
|
|
37
|
-
style?: CSSProperties;
|
|
38
|
-
tabIndex?: number;
|
|
39
|
-
onClick?: MouseEventHandler<HTMLDivElement>;
|
|
33
|
+
'id'?: string;
|
|
34
|
+
'border'?: boolean;
|
|
35
|
+
'fullWidth'?: boolean;
|
|
36
|
+
'density'?: Density;
|
|
37
|
+
'style'?: CSSProperties;
|
|
38
|
+
'tabIndex'?: number;
|
|
39
|
+
'onClick'?: MouseEventHandler<HTMLDivElement>;
|
|
40
40
|
'data-selected'?: boolean;
|
|
41
41
|
'data-testid'?: string;
|
|
42
42
|
};
|
|
@@ -60,7 +60,7 @@ const CardRoot = composable<HTMLDivElement, CardRootProps>(
|
|
|
60
60
|
return (
|
|
61
61
|
<Column.Root
|
|
62
62
|
asChild
|
|
63
|
-
gutter=
|
|
63
|
+
gutter='lg'
|
|
64
64
|
classNames={tx('card.root', { border, fullWidth }, className)}
|
|
65
65
|
role={role ?? 'group'}
|
|
66
66
|
>
|
|
@@ -552,11 +552,11 @@ export const Card = {
|
|
|
552
552
|
};
|
|
553
553
|
|
|
554
554
|
export type {
|
|
555
|
-
|
|
556
|
-
CardHeaderProps,
|
|
555
|
+
CardActionIconButtonProps,
|
|
557
556
|
CardBlockProps,
|
|
558
557
|
CardDragHandleProps,
|
|
559
|
-
|
|
558
|
+
CardHeaderProps,
|
|
560
559
|
CardMenuProps,
|
|
560
|
+
CardRootProps,
|
|
561
561
|
CardSectionProps,
|
|
562
562
|
};
|