@dxos/react-ui-tabs 0.8.4-main.bc674ce → 0.8.4-main.c351d160a8
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/index.mjs +10 -10
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +10 -10
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/Tabs.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +10 -10
- package/src/Tabs.stories.tsx +2 -2
- package/src/Tabs.tsx +12 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/react-ui-tabs",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.c351d160a8",
|
|
4
4
|
"description": "Components for facilitating a Tabs pattern.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -36,25 +36,25 @@
|
|
|
36
36
|
"@radix-ui/react-slot": "1.1.2",
|
|
37
37
|
"@radix-ui/react-tabs": "1.1.3",
|
|
38
38
|
"@radix-ui/react-use-controllable-state": "1.1.0",
|
|
39
|
-
"@dxos/react-ui-attention": "0.8.4-main.
|
|
40
|
-
"@dxos/util": "0.8.4-main.
|
|
39
|
+
"@dxos/react-ui-attention": "0.8.4-main.c351d160a8",
|
|
40
|
+
"@dxos/util": "0.8.4-main.c351d160a8"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@types/react": "~19.2.7",
|
|
44
44
|
"@types/react-dom": "~19.2.3",
|
|
45
45
|
"react": "~19.2.3",
|
|
46
46
|
"react-dom": "~19.2.3",
|
|
47
|
-
"vite": "7.1.
|
|
48
|
-
"@dxos/
|
|
49
|
-
"@dxos/storybook-utils": "0.8.4-main.
|
|
50
|
-
"@dxos/
|
|
51
|
-
"@dxos/ui-theme": "0.8.4-main.
|
|
47
|
+
"vite": "^7.1.11",
|
|
48
|
+
"@dxos/random": "0.8.4-main.c351d160a8",
|
|
49
|
+
"@dxos/storybook-utils": "0.8.4-main.c351d160a8",
|
|
50
|
+
"@dxos/react-ui": "0.8.4-main.c351d160a8",
|
|
51
|
+
"@dxos/ui-theme": "0.8.4-main.c351d160a8"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
54
|
"react": "~19.2.3",
|
|
55
55
|
"react-dom": "~19.2.3",
|
|
56
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
57
|
-
"@dxos/ui-theme": "0.8.4-main.
|
|
56
|
+
"@dxos/react-ui": "0.8.4-main.c351d160a8",
|
|
57
|
+
"@dxos/ui-theme": "0.8.4-main.c351d160a8"
|
|
58
58
|
},
|
|
59
59
|
"publishConfig": {
|
|
60
60
|
"access": "public"
|
package/src/Tabs.stories.tsx
CHANGED
|
@@ -36,7 +36,7 @@ export const DefaultStory = () => {
|
|
|
36
36
|
<Icon icon='ph--arrow-left--bold' size={4} />
|
|
37
37
|
<span>Back to tab list</span>
|
|
38
38
|
</NaturalTabs.BackButton>
|
|
39
|
-
<p className='
|
|
39
|
+
<p className='px-1'>{panel}</p>
|
|
40
40
|
</NaturalTabs.Tabpanel>
|
|
41
41
|
);
|
|
42
42
|
})}
|
|
@@ -60,7 +60,7 @@ const meta = {
|
|
|
60
60
|
title: 'ui/react-ui-tabs/Tabs',
|
|
61
61
|
component: NaturalTabs.Root,
|
|
62
62
|
render: DefaultStory,
|
|
63
|
-
decorators: [withTheme],
|
|
63
|
+
decorators: [withTheme()],
|
|
64
64
|
} satisfies Meta<typeof DefaultStory>;
|
|
65
65
|
|
|
66
66
|
export default meta;
|
package/src/Tabs.tsx
CHANGED
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
useForwardedRef,
|
|
25
25
|
} from '@dxos/react-ui';
|
|
26
26
|
import { useAttention } from '@dxos/react-ui-attention';
|
|
27
|
-
import {
|
|
27
|
+
import { mx } from '@dxos/ui-theme';
|
|
28
28
|
|
|
29
29
|
type TabsActivePart = 'list' | 'panel';
|
|
30
30
|
|
|
@@ -50,6 +50,7 @@ type TabsRootProps = ThemedClassName<TabsPrimitive.TabsProps> &
|
|
|
50
50
|
defaultActivePart: TabsActivePart;
|
|
51
51
|
}>;
|
|
52
52
|
|
|
53
|
+
// TODO(burdon): Reconcile padding with Toolbar.
|
|
53
54
|
const TabsRoot = forwardRef<HTMLDivElement, TabsRootProps>(
|
|
54
55
|
(
|
|
55
56
|
{
|
|
@@ -147,8 +148,8 @@ const TabsViewport = ({ classNames, children, ...props }: TabsViewportProps) =>
|
|
|
147
148
|
className={mx(
|
|
148
149
|
orientation === 'vertical' &&
|
|
149
150
|
verticalVariant === 'stateful' && [
|
|
150
|
-
'grid
|
|
151
|
-
'@md:
|
|
151
|
+
'grid w-[200%] grid-cols-2 data-[active=panel]:ms-[-100%]',
|
|
152
|
+
'@md:w-auto @md:data-[active=panel]:ms-0 @md:grid-cols-[minmax(min-content,1fr)_3fr] @md:gap-1',
|
|
152
153
|
],
|
|
153
154
|
classNames,
|
|
154
155
|
)}
|
|
@@ -160,6 +161,7 @@ const TabsViewport = ({ classNames, children, ...props }: TabsViewportProps) =>
|
|
|
160
161
|
|
|
161
162
|
type TabsTablistProps = ThemedClassName<TabsPrimitive.TabsListProps>;
|
|
162
163
|
|
|
164
|
+
// TODO(burdon): Should have same geometry as Toolbar.
|
|
163
165
|
const TabsTablist = ({ children, classNames, ...props }: TabsTablistProps) => {
|
|
164
166
|
const { orientation, verticalVariant } = useTabsContext('TabsTablist');
|
|
165
167
|
return (
|
|
@@ -167,7 +169,7 @@ const TabsTablist = ({ children, classNames, ...props }: TabsTablistProps) => {
|
|
|
167
169
|
{...props}
|
|
168
170
|
data-arrow-keys={orientation === 'vertical' ? 'up down' : 'left right'}
|
|
169
171
|
className={mx(
|
|
170
|
-
'max-
|
|
172
|
+
'max-h-full w-full',
|
|
171
173
|
// NOTE: Padding should be common to Toolbar.
|
|
172
174
|
orientation === 'vertical' ? 'overflow-y-auto' : 'flex items-stretch justify-start overflow-x-auto p-1 gap-1',
|
|
173
175
|
orientation === 'vertical' && verticalVariant === 'stateful' && 'place-self-start p-1',
|
|
@@ -189,14 +191,14 @@ const TabsBackButton = ({ onClick, classNames, ...props }: ButtonProps) => {
|
|
|
189
191
|
[onClick, setActivePart],
|
|
190
192
|
);
|
|
191
193
|
|
|
192
|
-
return <Button {...props} classNames={['
|
|
194
|
+
return <Button {...props} classNames={['w-full text-start @md:hidden mb-2', classNames]} onClick={handleClick} />;
|
|
193
195
|
};
|
|
194
196
|
|
|
195
197
|
type TabsTabGroupHeadingProps = ThemedClassName<ComponentPropsWithoutRef<'h2'>>;
|
|
196
198
|
|
|
197
199
|
const TabsTabGroupHeading = ({ children, classNames, ...props }: ThemedClassName<TabsTabGroupHeadingProps>) => {
|
|
198
200
|
return (
|
|
199
|
-
<h2 {...props} className={mx('
|
|
201
|
+
<h2 {...props} className={mx('my-1 px-2 text-sm text-un-accent', classNames)}>
|
|
200
202
|
{children}
|
|
201
203
|
</h2>
|
|
202
204
|
);
|
|
@@ -227,8 +229,8 @@ const TabsTab = ({ value, classNames, children, onClick, ...props }: TabsTabProp
|
|
|
227
229
|
{...props}
|
|
228
230
|
onClick={handleClick}
|
|
229
231
|
classNames={[
|
|
230
|
-
orientation === 'vertical' && 'block justify-start text-start
|
|
231
|
-
orientation === 'vertical' &&
|
|
232
|
+
orientation === 'vertical' && 'block justify-start text-start w-full',
|
|
233
|
+
orientation === 'vertical' && 'dx-selected',
|
|
232
234
|
classNames,
|
|
233
235
|
]}
|
|
234
236
|
>
|
|
@@ -263,8 +265,8 @@ const TabsIconTab = ({ value, classNames, onClick, ...props }: TabsIconTabProps)
|
|
|
263
265
|
{...props}
|
|
264
266
|
onClick={handleClick}
|
|
265
267
|
classNames={[
|
|
266
|
-
orientation === 'vertical' && 'justify-start text-start
|
|
267
|
-
orientation === 'vertical' &&
|
|
268
|
+
orientation === 'vertical' && 'justify-start text-start w-full',
|
|
269
|
+
orientation === 'vertical' && 'dx-selected',
|
|
268
270
|
classNames,
|
|
269
271
|
]}
|
|
270
272
|
/>
|