@dxos/react-ui-tabs 0.8.4-main.422d1c7879 → 0.8.4-main.43cb759274
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/LICENSE +102 -5
- package/dist/lib/browser/index.mjs +22 -15
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +22 -15
- 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 +35 -7
- package/dist/types/src/Tabs.d.ts.map +1 -1
- package/dist/types/src/Tabs.stories.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +11 -11
- package/src/Tabs.tsx +31 -16
package/LICENSE
CHANGED
|
@@ -1,8 +1,105 @@
|
|
|
1
|
-
|
|
2
|
-
Copyright (c) 2024 DXOS
|
|
1
|
+
# Functional Source License, Version 1.1, ALv2 Future License
|
|
3
2
|
|
|
4
|
-
|
|
3
|
+
## Abbreviation
|
|
5
4
|
|
|
6
|
-
|
|
5
|
+
FSL-1.1-Apache-2.0
|
|
7
6
|
|
|
8
|
-
|
|
7
|
+
## Notice
|
|
8
|
+
|
|
9
|
+
Copyright 2026 DXOS
|
|
10
|
+
|
|
11
|
+
## Terms and Conditions
|
|
12
|
+
|
|
13
|
+
### Licensor ("We")
|
|
14
|
+
|
|
15
|
+
The party offering the Software under these Terms and Conditions.
|
|
16
|
+
|
|
17
|
+
### The Software
|
|
18
|
+
|
|
19
|
+
The "Software" is each version of the software that we make available under
|
|
20
|
+
these Terms and Conditions, as indicated by our inclusion of these Terms and
|
|
21
|
+
Conditions with the Software.
|
|
22
|
+
|
|
23
|
+
### License Grant
|
|
24
|
+
|
|
25
|
+
Subject to your compliance with this License Grant and the Patents,
|
|
26
|
+
Redistribution and Trademark clauses below, we hereby grant you the right to
|
|
27
|
+
use, copy, modify, create derivative works, publicly perform, publicly display
|
|
28
|
+
and redistribute the Software for any Permitted Purpose identified below.
|
|
29
|
+
|
|
30
|
+
### Permitted Purpose
|
|
31
|
+
|
|
32
|
+
A Permitted Purpose is any purpose other than a Competing Use. A Competing Use
|
|
33
|
+
means making the Software available to others in a commercial product or
|
|
34
|
+
service that:
|
|
35
|
+
|
|
36
|
+
1. substitutes for the Software;
|
|
37
|
+
|
|
38
|
+
2. substitutes for any other product or service we offer using the Software
|
|
39
|
+
that exists as of the date we make the Software available; or
|
|
40
|
+
|
|
41
|
+
3. offers the same or substantially similar functionality as the Software.
|
|
42
|
+
|
|
43
|
+
Permitted Purposes specifically include using the Software:
|
|
44
|
+
|
|
45
|
+
1. for your internal use and access;
|
|
46
|
+
|
|
47
|
+
2. for non-commercial education;
|
|
48
|
+
|
|
49
|
+
3. for non-commercial research; and
|
|
50
|
+
|
|
51
|
+
4. in connection with professional services that you provide to a licensee
|
|
52
|
+
using the Software in accordance with these Terms and Conditions.
|
|
53
|
+
|
|
54
|
+
### Patents
|
|
55
|
+
|
|
56
|
+
To the extent your use for a Permitted Purpose would necessarily infringe our
|
|
57
|
+
patents, the license grant above includes a license under our patents. If you
|
|
58
|
+
make a claim against any party that the Software infringes or contributes to
|
|
59
|
+
the infringement of any patent, then your patent license to the Software ends
|
|
60
|
+
immediately.
|
|
61
|
+
|
|
62
|
+
### Redistribution
|
|
63
|
+
|
|
64
|
+
The Terms and Conditions apply to all copies, modifications and derivatives of
|
|
65
|
+
the Software.
|
|
66
|
+
|
|
67
|
+
If you redistribute any copies, modifications or derivatives of the Software,
|
|
68
|
+
you must include a copy of or a link to these Terms and Conditions and not
|
|
69
|
+
remove any copyright notices provided in or with the Software.
|
|
70
|
+
|
|
71
|
+
### Disclaimer
|
|
72
|
+
|
|
73
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR
|
|
74
|
+
IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR
|
|
75
|
+
PURPOSE, MERCHANTABILITY, TITLE OR NON-INFRINGEMENT.
|
|
76
|
+
|
|
77
|
+
IN NO EVENT WILL WE HAVE ANY LIABILITY TO YOU ARISING OUT OF OR RELATED TO THE
|
|
78
|
+
SOFTWARE, INCLUDING INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES,
|
|
79
|
+
EVEN IF WE HAVE BEEN INFORMED OF THEIR POSSIBILITY IN ADVANCE.
|
|
80
|
+
|
|
81
|
+
### Trademarks
|
|
82
|
+
|
|
83
|
+
Except for displaying the License Details and identifying us as the origin of
|
|
84
|
+
the Software, you have no right under these Terms and Conditions to use our
|
|
85
|
+
trademarks, trade names, service marks or product names.
|
|
86
|
+
|
|
87
|
+
## Grant of Future License
|
|
88
|
+
|
|
89
|
+
We hereby irrevocably grant you an additional license to use the Software under
|
|
90
|
+
the Apache License, Version 2.0 that is effective on the second anniversary of
|
|
91
|
+
the date we make the Software available. On or after that date, you may use the
|
|
92
|
+
Software under the Apache License, Version 2.0, in which case the following
|
|
93
|
+
will apply:
|
|
94
|
+
|
|
95
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
96
|
+
this file except in compliance with the License.
|
|
97
|
+
|
|
98
|
+
You may obtain a copy of the License at
|
|
99
|
+
|
|
100
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
101
|
+
|
|
102
|
+
Unless required by applicable law or agreed to in writing, software distributed
|
|
103
|
+
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
104
|
+
CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
|
105
|
+
specific language governing permissions and limitations under the License.
|
|
@@ -59,16 +59,17 @@ var TabsRoot = /* @__PURE__ */ forwardRef(({ children, classNames, activePart: p
|
|
|
59
59
|
ref: tabsRoot
|
|
60
60
|
}, children));
|
|
61
61
|
});
|
|
62
|
-
|
|
62
|
+
TabsRoot.displayName = "Tabs.Root";
|
|
63
|
+
function TabsViewport({ classNames, children, ...props }) {
|
|
63
64
|
const { activePart } = useTabsContext("TabsViewport");
|
|
64
65
|
return /* @__PURE__ */ React.createElement("div", {
|
|
65
|
-
role: "none",
|
|
66
66
|
...props,
|
|
67
67
|
"data-active": activePart,
|
|
68
68
|
className: mx(classNames)
|
|
69
69
|
}, children);
|
|
70
|
-
}
|
|
71
|
-
|
|
70
|
+
}
|
|
71
|
+
TabsViewport.displayName = "Tabs.Viewport";
|
|
72
|
+
function TabsTablist({ children, classNames, ...props }) {
|
|
72
73
|
const { orientation } = useTabsContext("TabsTablist");
|
|
73
74
|
return /* @__PURE__ */ React.createElement(TabsPrimitive.List, {
|
|
74
75
|
...props,
|
|
@@ -80,8 +81,9 @@ var TabsTablist = ({ children, classNames, ...props }) => {
|
|
|
80
81
|
classNames
|
|
81
82
|
)
|
|
82
83
|
}, children);
|
|
83
|
-
}
|
|
84
|
-
|
|
84
|
+
}
|
|
85
|
+
TabsTablist.displayName = "Tabs.Tablist";
|
|
86
|
+
function TabsBackButton({ onClick, classNames, ...props }) {
|
|
85
87
|
const { setActivePart } = useTabsContext("TabsBackButton");
|
|
86
88
|
const handleClick = useCallback((event) => {
|
|
87
89
|
setActivePart("list");
|
|
@@ -98,14 +100,16 @@ var TabsBackButton = ({ onClick, classNames, ...props }) => {
|
|
|
98
100
|
],
|
|
99
101
|
onClick: handleClick
|
|
100
102
|
});
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
+
}
|
|
104
|
+
TabsBackButton.displayName = "Tabs.BackButton";
|
|
105
|
+
function TabsTabGroupHeading({ children, classNames, ...props }) {
|
|
103
106
|
return /* @__PURE__ */ React.createElement("h2", {
|
|
104
107
|
...props,
|
|
105
108
|
className: mx("my-1 px-2 text-sm text-un-accent", classNames)
|
|
106
109
|
}, children);
|
|
107
|
-
}
|
|
108
|
-
|
|
110
|
+
}
|
|
111
|
+
TabsTabGroupHeading.displayName = "Tabs.TabGroupHeading";
|
|
112
|
+
function TabsTab({ value, classNames, children, onClick, ...props }) {
|
|
109
113
|
const { setActivePart, orientation, value: contextValue, attendableId } = useTabsContext("TabsTab");
|
|
110
114
|
const { hasAttention } = useAttention(attendableId);
|
|
111
115
|
const handleClick = useCallback(
|
|
@@ -132,8 +136,9 @@ var TabsTab = ({ value, classNames, children, onClick, ...props }) => {
|
|
|
132
136
|
],
|
|
133
137
|
onClick: handleClick
|
|
134
138
|
}, children));
|
|
135
|
-
}
|
|
136
|
-
|
|
139
|
+
}
|
|
140
|
+
TabsTab.displayName = "Tabs.Tab";
|
|
141
|
+
function TabsIconTab({ value, classNames, onClick, ...props }) {
|
|
137
142
|
const { setActivePart, orientation, value: contextValue, attendableId } = useTabsContext("TabsTab");
|
|
138
143
|
const { hasAttention } = useAttention(attendableId);
|
|
139
144
|
const handleClick = useCallback((event) => {
|
|
@@ -156,8 +161,9 @@ var TabsIconTab = ({ value, classNames, onClick, ...props }) => {
|
|
|
156
161
|
],
|
|
157
162
|
onClick: handleClick
|
|
158
163
|
}));
|
|
159
|
-
}
|
|
160
|
-
|
|
164
|
+
}
|
|
165
|
+
TabsIconTab.displayName = "Tabs.IconTab";
|
|
166
|
+
function TabsPanel({ classNames, children, ...props }) {
|
|
161
167
|
const { value: contextValue } = useTabsContext("TabsTab");
|
|
162
168
|
return /* @__PURE__ */ React.createElement(Activity, {
|
|
163
169
|
mode: contextValue === props.value ? "visible" : "hidden"
|
|
@@ -165,7 +171,8 @@ var TabsPanel = ({ classNames, children, ...props }) => {
|
|
|
165
171
|
...props,
|
|
166
172
|
className: mx("p-0! dx-focus-ring-inset-over-all", classNames)
|
|
167
173
|
}, children));
|
|
168
|
-
}
|
|
174
|
+
}
|
|
175
|
+
TabsPanel.displayName = "Tabs.Panel";
|
|
169
176
|
var Tabs = {
|
|
170
177
|
Root: TabsRoot,
|
|
171
178
|
Tablist: TabsTablist,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/Tabs.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { useArrowNavigationGroup, useFocusFinders, useFocusableGroup } from '@fluentui/react-tabster';\nimport { createContext } from '@radix-ui/react-context';\nimport * as TabsPrimitive from '@radix-ui/react-tabs';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport React, {\n Activity,\n type ComponentPropsWithoutRef,\n type MouseEvent,\n forwardRef,\n useCallback,\n useLayoutEffect,\n} from 'react';\n\nimport {\n Button,\n type ButtonProps,\n IconButton,\n type IconButtonProps,\n type ThemedClassName,\n useForwardedRef,\n} from '@dxos/react-ui';\nimport { useAttention } from '@dxos/react-ui-attention';\nimport { mx } from '@dxos/ui-theme';\n\ntype TabsActivePart = 'list' | 'panel';\n\nconst TABS_NAME = 'Tabs';\n\ntype TabsContextValue = {\n activePart: TabsActivePart;\n setActivePart: (nextActivePart: TabsActivePart) => void;\n attendableId?: string;\n} & Pick<TabsPrimitive.TabsProps, 'orientation' | 'value'>;\n\nconst [TabsContextProvider, useTabsContext] = createContext<TabsContextValue>(TABS_NAME, {\n orientation: 'vertical',\n activePart: 'list',\n setActivePart: () => {},\n});\n\ntype TabsRootProps = ThemedClassName<TabsPrimitive.TabsProps> &\n Partial<\n Pick<TabsContextValue, 'activePart' | 'attendableId'> & {\n onActivePartChange: (nextActivePart: TabsActivePart) => void;\n defaultActivePart: TabsActivePart;\n }\n >;\n\nconst TabsRoot = forwardRef<HTMLDivElement, TabsRootProps>(\n (\n {\n children,\n classNames,\n activePart: propsActivePart,\n onActivePartChange,\n defaultActivePart,\n value: propsValue,\n onValueChange,\n defaultValue,\n orientation = 'vertical',\n activationMode = 'manual',\n attendableId,\n ...props\n },\n forwardedRef,\n ) => {\n // const tabsRoot = useRef<HTMLDivElement | null>(null);\n const tabsRoot = useForwardedRef(forwardedRef);\n\n // TODO(thure): Without these, we get Groupper/Mover `API used before initialization`, but why?\n const _1 = useArrowNavigationGroup();\n const _2 = useFocusableGroup();\n const [activePart = 'list', setActivePart] = useControllableState({\n prop: propsActivePart,\n onChange: onActivePartChange,\n defaultProp: defaultActivePart,\n });\n\n const [value, setValue] = useControllableState({\n prop: propsValue,\n onChange: onValueChange,\n defaultProp: defaultValue,\n });\n\n const handleValueChange = useCallback(\n (nextValue: string) => {\n setActivePart('panel');\n setValue(nextValue);\n },\n [value],\n );\n\n const { findFirstFocusable } = useFocusFinders();\n\n useLayoutEffect(() => {\n if (tabsRoot.current) {\n findFirstFocusable(tabsRoot.current)?.focus();\n }\n }, [activePart]);\n\n return (\n <TabsContextProvider\n orientation={orientation}\n activePart={activePart}\n setActivePart={setActivePart}\n value={value}\n attendableId={attendableId}\n >\n <TabsPrimitive.Root\n {...props}\n className={mx('overflow-hidden', classNames)}\n orientation={orientation}\n activationMode={activationMode}\n data-active={activePart}\n value={value}\n onValueChange={handleValueChange}\n ref={tabsRoot}\n >\n {children}\n </TabsPrimitive.Root>\n </TabsContextProvider>\n );\n },\n);\n\ntype TabsViewportProps = ThemedClassName<ComponentPropsWithoutRef<'div'>>;\n\
|
|
5
|
-
"mappings": ";AAIA,SAASA,yBAAyBC,iBAAiBC,yBAAyB;AAC5E,SAASC,qBAAqB;AAC9B,YAAYC,mBAAmB;AAC/B,SAASC,4BAA4B;AACrC,OAAOC,SACLC,UAGAC,YACAC,aACAC,uBACK;AAEP,SACEC,QAEAC,YAGAC,uBACK;AACP,SAASC,oBAAoB;AAC7B,SAASC,UAAU;AAInB,IAAMC,YAAY;AAQlB,IAAM,CAACC,qBAAqBC,cAAAA,
|
|
6
|
-
"names": ["useArrowNavigationGroup", "useFocusFinders", "useFocusableGroup", "createContext", "TabsPrimitive", "useControllableState", "React", "Activity", "forwardRef", "useCallback", "useLayoutEffect", "Button", "IconButton", "useForwardedRef", "useAttention", "mx", "TABS_NAME", "TabsContextProvider", "useTabsContext", "
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { useArrowNavigationGroup, useFocusFinders, useFocusableGroup } from '@fluentui/react-tabster';\nimport { createContext } from '@radix-ui/react-context';\nimport * as TabsPrimitive from '@radix-ui/react-tabs';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport React, {\n Activity,\n type ComponentPropsWithoutRef,\n type MouseEvent,\n forwardRef,\n useCallback,\n useLayoutEffect,\n} from 'react';\n\nimport {\n Button,\n type ButtonProps,\n IconButton,\n type IconButtonProps,\n type ThemedClassName,\n useForwardedRef,\n} from '@dxos/react-ui';\nimport { useAttention } from '@dxos/react-ui-attention';\nimport { mx } from '@dxos/ui-theme';\n\ntype TabsActivePart = 'list' | 'panel';\n\nconst TABS_NAME = 'Tabs';\n\ntype TabsContextValue = {\n activePart: TabsActivePart;\n setActivePart: (nextActivePart: TabsActivePart) => void;\n attendableId?: string;\n} & Pick<TabsPrimitive.TabsProps, 'orientation' | 'value'>;\n\nconst [TabsContextProvider, useTabsContext] = createContext<TabsContextValue>(TABS_NAME, {\n orientation: 'vertical',\n activePart: 'list',\n setActivePart: () => {},\n});\n\ntype TabsRootProps = ThemedClassName<TabsPrimitive.TabsProps> &\n Partial<\n Pick<TabsContextValue, 'activePart' | 'attendableId'> & {\n onActivePartChange: (nextActivePart: TabsActivePart) => void;\n defaultActivePart: TabsActivePart;\n }\n >;\n\nconst TabsRoot = forwardRef<HTMLDivElement, TabsRootProps>(\n (\n {\n children,\n classNames,\n activePart: propsActivePart,\n onActivePartChange,\n defaultActivePart,\n value: propsValue,\n onValueChange,\n defaultValue,\n orientation = 'vertical',\n activationMode = 'manual',\n attendableId,\n ...props\n },\n forwardedRef,\n ) => {\n // const tabsRoot = useRef<HTMLDivElement | null>(null);\n const tabsRoot = useForwardedRef(forwardedRef);\n\n // TODO(thure): Without these, we get Groupper/Mover `API used before initialization`, but why?\n const _1 = useArrowNavigationGroup();\n const _2 = useFocusableGroup();\n const [activePart = 'list', setActivePart] = useControllableState({\n prop: propsActivePart,\n onChange: onActivePartChange,\n defaultProp: defaultActivePart,\n });\n\n const [value, setValue] = useControllableState({\n prop: propsValue,\n onChange: onValueChange,\n defaultProp: defaultValue,\n });\n\n const handleValueChange = useCallback(\n (nextValue: string) => {\n setActivePart('panel');\n setValue(nextValue);\n },\n [value],\n );\n\n const { findFirstFocusable } = useFocusFinders();\n\n useLayoutEffect(() => {\n if (tabsRoot.current) {\n findFirstFocusable(tabsRoot.current)?.focus();\n }\n }, [activePart]);\n\n return (\n <TabsContextProvider\n orientation={orientation}\n activePart={activePart}\n setActivePart={setActivePart}\n value={value}\n attendableId={attendableId}\n >\n <TabsPrimitive.Root\n {...props}\n className={mx('overflow-hidden', classNames)}\n orientation={orientation}\n activationMode={activationMode}\n data-active={activePart}\n value={value}\n onValueChange={handleValueChange}\n ref={tabsRoot}\n >\n {children}\n </TabsPrimitive.Root>\n </TabsContextProvider>\n );\n },\n);\n\nTabsRoot.displayName = 'Tabs.Root';\n\ntype TabsViewportProps = ThemedClassName<ComponentPropsWithoutRef<'div'>>;\n\nfunction TabsViewport({ classNames, children, ...props }: TabsViewportProps) {\n const { activePart } = useTabsContext('TabsViewport');\n return (\n <div {...props} data-active={activePart} className={mx(classNames)}>\n {children}\n </div>\n );\n}\n\nTabsViewport.displayName = 'Tabs.Viewport';\n\ntype TabsTablistProps = ThemedClassName<TabsPrimitive.TabsListProps>;\n\nfunction TabsTablist({ children, classNames, ...props }: TabsTablistProps) {\n const { orientation } = useTabsContext('TabsTablist');\n return (\n <TabsPrimitive.List\n {...props}\n data-arrow-keys={orientation === 'vertical' ? 'up down' : 'left right'}\n className={mx(\n 'max-h-full w-full',\n // TODO(burdon): Should be embeddable inside Toolbar (if horizontal).\n orientation === 'vertical' ? 'overflow-y-auto' : 'flex p-1 gap-1 items-stretch justify-start overflow-x-auto',\n classNames,\n )}\n >\n {children}\n </TabsPrimitive.List>\n );\n}\n\nTabsTablist.displayName = 'Tabs.Tablist';\n\nfunction TabsBackButton({ onClick, classNames, ...props }: ButtonProps) {\n const { setActivePart } = useTabsContext('TabsBackButton');\n const handleClick = useCallback(\n (event: MouseEvent<HTMLButtonElement>) => {\n setActivePart('list');\n return onClick?.(event);\n },\n [setActivePart, onClick],\n );\n\n return <Button {...props} classNames={['@md:hidden text-start', classNames]} onClick={handleClick} />;\n}\n\nTabsBackButton.displayName = 'Tabs.BackButton';\n\ntype TabsTabGroupHeadingProps = ThemedClassName<ComponentPropsWithoutRef<'h2'>>;\n\nfunction TabsTabGroupHeading({ children, classNames, ...props }: ThemedClassName<TabsTabGroupHeadingProps>) {\n return (\n <h2 {...props} className={mx('my-1 px-2 text-sm text-un-accent', classNames)}>\n {children}\n </h2>\n );\n}\n\nTabsTabGroupHeading.displayName = 'Tabs.TabGroupHeading';\n\ntype TabsTabProps = ButtonProps & Pick<TabsPrimitive.TabsTriggerProps, 'value'>;\n\nfunction TabsTab({ value, classNames, children, onClick, ...props }: TabsTabProps) {\n const { setActivePart, orientation, value: contextValue, attendableId } = useTabsContext('TabsTab');\n const { hasAttention } = useAttention(attendableId);\n\n const handleClick = useCallback(\n // NOTE: This handler is only called if the tab is *already active*.\n (event: MouseEvent<HTMLButtonElement>) => {\n setActivePart('panel');\n onClick?.(event);\n },\n [setActivePart, onClick],\n );\n\n return (\n <TabsPrimitive.Trigger value={value} asChild>\n <Button\n {...props}\n variant={\n orientation === 'horizontal' && contextValue === value ? (hasAttention ? 'primary' : 'default') : 'ghost'\n }\n classNames={[\n orientation === 'vertical' && 'block justify-start text-start w-full',\n orientation === 'vertical' && 'dx-selected',\n classNames,\n ]}\n onClick={handleClick}\n >\n {children}\n </Button>\n </TabsPrimitive.Trigger>\n );\n}\n\nTabsTab.displayName = 'Tabs.Tab';\n\ntype TabsIconTabProps = IconButtonProps & Pick<TabsPrimitive.TabsTriggerProps, 'value'>;\n\nfunction TabsIconTab({ value, classNames, onClick, ...props }: TabsIconTabProps) {\n const { setActivePart, orientation, value: contextValue, attendableId } = useTabsContext('TabsTab');\n const { hasAttention } = useAttention(attendableId);\n\n // NOTE: This handler is only called if the tab is *already active*.\n const handleClick = useCallback(\n (event: MouseEvent<HTMLButtonElement>) => {\n setActivePart('panel');\n onClick?.(event);\n },\n [setActivePart, onClick],\n );\n\n return (\n <TabsPrimitive.Trigger value={value} asChild>\n <IconButton\n {...props}\n variant={\n orientation === 'horizontal' && contextValue === value ? (hasAttention ? 'primary' : 'default') : 'ghost'\n }\n classNames={[\n orientation === 'vertical' && 'justify-start text-start w-full',\n orientation === 'vertical' && 'dx-selected',\n classNames,\n ]}\n onClick={handleClick}\n />\n </TabsPrimitive.Trigger>\n );\n}\n\nTabsIconTab.displayName = 'Tabs.IconTab';\n\ntype TabsPanelProps = ThemedClassName<TabsPrimitive.TabsContentProps>;\n\nfunction TabsPanel({ classNames, children, ...props }: TabsPanelProps) {\n const { value: contextValue } = useTabsContext('TabsTab');\n return (\n <Activity mode={contextValue === props.value ? 'visible' : 'hidden'}>\n <TabsPrimitive.Content {...props} className={mx('p-0! dx-focus-ring-inset-over-all', classNames)}>\n {children}\n </TabsPrimitive.Content>\n </Activity>\n );\n}\n\nTabsPanel.displayName = 'Tabs.Panel';\n\ntype TabsTabPrimitiveProps = TabsPrimitive.TabsTriggerProps;\n\nexport const Tabs = {\n Root: TabsRoot,\n Tablist: TabsTablist,\n Tab: TabsTab,\n IconTab: TabsIconTab,\n TabPrimitive: TabsPrimitive.Trigger,\n TabGroupHeading: TabsTabGroupHeading,\n Panel: TabsPanel,\n BackButton: TabsBackButton,\n Viewport: TabsViewport,\n};\n\nexport type {\n TabsActivePart,\n TabsRootProps,\n TabsTablistProps,\n TabsTabProps,\n TabsTabPrimitiveProps,\n TabsTabGroupHeadingProps,\n TabsPanelProps,\n TabsViewportProps,\n};\n"],
|
|
5
|
+
"mappings": ";AAIA,SAASA,yBAAyBC,iBAAiBC,yBAAyB;AAC5E,SAASC,qBAAqB;AAC9B,YAAYC,mBAAmB;AAC/B,SAASC,4BAA4B;AACrC,OAAOC,SACLC,UAGAC,YACAC,aACAC,uBACK;AAEP,SACEC,QAEA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BAAiB/B,MAAMN,QAAQ,YAAY;KACzD,sBAAA,cAAe6C,uBAAO;IAAE,GAAGvC;IAAOe,WAAWlC,GAAG,qCAAqCS,UAAAA;KAClFD,QAAAA,CAAAA;AAIT;AAEAgD,UAAUnB,cAAc;AAIjB,IAAMsB,OAAO;EAClB1B,MAAM1B;EACNqD,SAASpB;EACTqB,KAAKZ;EACLa,SAASP;EACTQ,cAA4BX;EAC5BY,iBAAiBjB;EACjBkB,OAAOT;EACPU,YAAYvB;EACZwB,UAAU7B;AACZ;",
|
|
6
|
+
"names": ["useArrowNavigationGroup", "useFocusFinders", "useFocusableGroup", "createContext", "TabsPrimitive", "useControllableState", "React", "Activity", "forwardRef", "useCallback", "useLayoutEffect", "Button", "IconButton", "useForwardedRef", "useAttention", "mx", "TABS_NAME", "TabsContextProvider", "useTabsContext", "orientation", "activePart", "setActivePart", "TabsRoot", "children", "classNames", "propsActivePart", "onActivePartChange", "defaultActivePart", "value", "propsValue", "onValueChange", "defaultValue", "activationMode", "attendableId", "props", "forwardedRef", "tabsRoot", "_1", "_2", "prop", "onChange", "defaultProp", "setValue", "handleValueChange", "nextValue", "findFirstFocusable", "current", "focus", "Root", "className", "data-active", "ref", "displayName", "TabsViewport", "div", "TabsTablist", "List", "data-arrow-keys", "TabsBackButton", "onClick", "handleClick", "event", "TabsTabGroupHeading", "h2", "TabsTab", "contextValue", "hasAttention", "Trigger", "asChild", "variant", "TabsIconTab", "TabsPanel", "mode", "Content", "Tabs", "Tablist", "Tab", "IconTab", "TabPrimitive", "TabGroupHeading", "Panel", "BackButton", "Viewport"]
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"src/Tabs.tsx":{"bytes":
|
|
1
|
+
{"inputs":{"src/Tabs.tsx":{"bytes":26019,"imports":[{"path":"@fluentui/react-tabster","kind":"import-statement","external":true},{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"@radix-ui/react-tabs","kind":"import-statement","external":true},{"path":"@radix-ui/react-use-controllable-state","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-attention","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true}],"format":"esm"},"src/index.ts":{"bytes":368,"imports":[{"path":"src/Tabs.tsx","kind":"import-statement","original":"./Tabs"}],"format":"esm"}},"outputs":{"dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":13922},"dist/lib/browser/index.mjs":{"imports":[{"path":"@fluentui/react-tabster","kind":"import-statement","external":true},{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"@radix-ui/react-tabs","kind":"import-statement","external":true},{"path":"@radix-ui/react-use-controllable-state","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-attention","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true}],"exports":["Tabs"],"entryPoint":"src/index.ts","inputs":{"src/Tabs.tsx":{"bytesInOutput":6480},"src/index.ts":{"bytesInOutput":0}},"bytes":6550}}}
|
|
@@ -61,16 +61,17 @@ var TabsRoot = /* @__PURE__ */ forwardRef(({ children, classNames, activePart: p
|
|
|
61
61
|
ref: tabsRoot
|
|
62
62
|
}, children));
|
|
63
63
|
});
|
|
64
|
-
|
|
64
|
+
TabsRoot.displayName = "Tabs.Root";
|
|
65
|
+
function TabsViewport({ classNames, children, ...props }) {
|
|
65
66
|
const { activePart } = useTabsContext("TabsViewport");
|
|
66
67
|
return /* @__PURE__ */ React.createElement("div", {
|
|
67
|
-
role: "none",
|
|
68
68
|
...props,
|
|
69
69
|
"data-active": activePart,
|
|
70
70
|
className: mx(classNames)
|
|
71
71
|
}, children);
|
|
72
|
-
}
|
|
73
|
-
|
|
72
|
+
}
|
|
73
|
+
TabsViewport.displayName = "Tabs.Viewport";
|
|
74
|
+
function TabsTablist({ children, classNames, ...props }) {
|
|
74
75
|
const { orientation } = useTabsContext("TabsTablist");
|
|
75
76
|
return /* @__PURE__ */ React.createElement(TabsPrimitive.List, {
|
|
76
77
|
...props,
|
|
@@ -82,8 +83,9 @@ var TabsTablist = ({ children, classNames, ...props }) => {
|
|
|
82
83
|
classNames
|
|
83
84
|
)
|
|
84
85
|
}, children);
|
|
85
|
-
}
|
|
86
|
-
|
|
86
|
+
}
|
|
87
|
+
TabsTablist.displayName = "Tabs.Tablist";
|
|
88
|
+
function TabsBackButton({ onClick, classNames, ...props }) {
|
|
87
89
|
const { setActivePart } = useTabsContext("TabsBackButton");
|
|
88
90
|
const handleClick = useCallback((event) => {
|
|
89
91
|
setActivePart("list");
|
|
@@ -100,14 +102,16 @@ var TabsBackButton = ({ onClick, classNames, ...props }) => {
|
|
|
100
102
|
],
|
|
101
103
|
onClick: handleClick
|
|
102
104
|
});
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
+
}
|
|
106
|
+
TabsBackButton.displayName = "Tabs.BackButton";
|
|
107
|
+
function TabsTabGroupHeading({ children, classNames, ...props }) {
|
|
105
108
|
return /* @__PURE__ */ React.createElement("h2", {
|
|
106
109
|
...props,
|
|
107
110
|
className: mx("my-1 px-2 text-sm text-un-accent", classNames)
|
|
108
111
|
}, children);
|
|
109
|
-
}
|
|
110
|
-
|
|
112
|
+
}
|
|
113
|
+
TabsTabGroupHeading.displayName = "Tabs.TabGroupHeading";
|
|
114
|
+
function TabsTab({ value, classNames, children, onClick, ...props }) {
|
|
111
115
|
const { setActivePart, orientation, value: contextValue, attendableId } = useTabsContext("TabsTab");
|
|
112
116
|
const { hasAttention } = useAttention(attendableId);
|
|
113
117
|
const handleClick = useCallback(
|
|
@@ -134,8 +138,9 @@ var TabsTab = ({ value, classNames, children, onClick, ...props }) => {
|
|
|
134
138
|
],
|
|
135
139
|
onClick: handleClick
|
|
136
140
|
}, children));
|
|
137
|
-
}
|
|
138
|
-
|
|
141
|
+
}
|
|
142
|
+
TabsTab.displayName = "Tabs.Tab";
|
|
143
|
+
function TabsIconTab({ value, classNames, onClick, ...props }) {
|
|
139
144
|
const { setActivePart, orientation, value: contextValue, attendableId } = useTabsContext("TabsTab");
|
|
140
145
|
const { hasAttention } = useAttention(attendableId);
|
|
141
146
|
const handleClick = useCallback((event) => {
|
|
@@ -158,8 +163,9 @@ var TabsIconTab = ({ value, classNames, onClick, ...props }) => {
|
|
|
158
163
|
],
|
|
159
164
|
onClick: handleClick
|
|
160
165
|
}));
|
|
161
|
-
}
|
|
162
|
-
|
|
166
|
+
}
|
|
167
|
+
TabsIconTab.displayName = "Tabs.IconTab";
|
|
168
|
+
function TabsPanel({ classNames, children, ...props }) {
|
|
163
169
|
const { value: contextValue } = useTabsContext("TabsTab");
|
|
164
170
|
return /* @__PURE__ */ React.createElement(Activity, {
|
|
165
171
|
mode: contextValue === props.value ? "visible" : "hidden"
|
|
@@ -167,7 +173,8 @@ var TabsPanel = ({ classNames, children, ...props }) => {
|
|
|
167
173
|
...props,
|
|
168
174
|
className: mx("p-0! dx-focus-ring-inset-over-all", classNames)
|
|
169
175
|
}, children));
|
|
170
|
-
}
|
|
176
|
+
}
|
|
177
|
+
TabsPanel.displayName = "Tabs.Panel";
|
|
171
178
|
var Tabs = {
|
|
172
179
|
Root: TabsRoot,
|
|
173
180
|
Tablist: TabsTablist,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/Tabs.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { useArrowNavigationGroup, useFocusFinders, useFocusableGroup } from '@fluentui/react-tabster';\nimport { createContext } from '@radix-ui/react-context';\nimport * as TabsPrimitive from '@radix-ui/react-tabs';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport React, {\n Activity,\n type ComponentPropsWithoutRef,\n type MouseEvent,\n forwardRef,\n useCallback,\n useLayoutEffect,\n} from 'react';\n\nimport {\n Button,\n type ButtonProps,\n IconButton,\n type IconButtonProps,\n type ThemedClassName,\n useForwardedRef,\n} from '@dxos/react-ui';\nimport { useAttention } from '@dxos/react-ui-attention';\nimport { mx } from '@dxos/ui-theme';\n\ntype TabsActivePart = 'list' | 'panel';\n\nconst TABS_NAME = 'Tabs';\n\ntype TabsContextValue = {\n activePart: TabsActivePart;\n setActivePart: (nextActivePart: TabsActivePart) => void;\n attendableId?: string;\n} & Pick<TabsPrimitive.TabsProps, 'orientation' | 'value'>;\n\nconst [TabsContextProvider, useTabsContext] = createContext<TabsContextValue>(TABS_NAME, {\n orientation: 'vertical',\n activePart: 'list',\n setActivePart: () => {},\n});\n\ntype TabsRootProps = ThemedClassName<TabsPrimitive.TabsProps> &\n Partial<\n Pick<TabsContextValue, 'activePart' | 'attendableId'> & {\n onActivePartChange: (nextActivePart: TabsActivePart) => void;\n defaultActivePart: TabsActivePart;\n }\n >;\n\nconst TabsRoot = forwardRef<HTMLDivElement, TabsRootProps>(\n (\n {\n children,\n classNames,\n activePart: propsActivePart,\n onActivePartChange,\n defaultActivePart,\n value: propsValue,\n onValueChange,\n defaultValue,\n orientation = 'vertical',\n activationMode = 'manual',\n attendableId,\n ...props\n },\n forwardedRef,\n ) => {\n // const tabsRoot = useRef<HTMLDivElement | null>(null);\n const tabsRoot = useForwardedRef(forwardedRef);\n\n // TODO(thure): Without these, we get Groupper/Mover `API used before initialization`, but why?\n const _1 = useArrowNavigationGroup();\n const _2 = useFocusableGroup();\n const [activePart = 'list', setActivePart] = useControllableState({\n prop: propsActivePart,\n onChange: onActivePartChange,\n defaultProp: defaultActivePart,\n });\n\n const [value, setValue] = useControllableState({\n prop: propsValue,\n onChange: onValueChange,\n defaultProp: defaultValue,\n });\n\n const handleValueChange = useCallback(\n (nextValue: string) => {\n setActivePart('panel');\n setValue(nextValue);\n },\n [value],\n );\n\n const { findFirstFocusable } = useFocusFinders();\n\n useLayoutEffect(() => {\n if (tabsRoot.current) {\n findFirstFocusable(tabsRoot.current)?.focus();\n }\n }, [activePart]);\n\n return (\n <TabsContextProvider\n orientation={orientation}\n activePart={activePart}\n setActivePart={setActivePart}\n value={value}\n attendableId={attendableId}\n >\n <TabsPrimitive.Root\n {...props}\n className={mx('overflow-hidden', classNames)}\n orientation={orientation}\n activationMode={activationMode}\n data-active={activePart}\n value={value}\n onValueChange={handleValueChange}\n ref={tabsRoot}\n >\n {children}\n </TabsPrimitive.Root>\n </TabsContextProvider>\n );\n },\n);\n\ntype TabsViewportProps = ThemedClassName<ComponentPropsWithoutRef<'div'>>;\n\
|
|
5
|
-
"mappings": ";;;AAIA,SAASA,yBAAyBC,iBAAiBC,yBAAyB;AAC5E,SAASC,qBAAqB;AAC9B,YAAYC,mBAAmB;AAC/B,SAASC,4BAA4B;AACrC,OAAOC,SACLC,UAGAC,YACAC,aACAC,uBACK;AAEP,SACEC,QAEAC,YAGAC,uBACK;AACP,SAASC,oBAAoB;AAC7B,SAASC,UAAU;AAInB,IAAMC,YAAY;AAQlB,IAAM,CAACC,qBAAqBC,cAAAA,
|
|
6
|
-
"names": ["useArrowNavigationGroup", "useFocusFinders", "useFocusableGroup", "createContext", "TabsPrimitive", "useControllableState", "React", "Activity", "forwardRef", "useCallback", "useLayoutEffect", "Button", "IconButton", "useForwardedRef", "useAttention", "mx", "TABS_NAME", "TabsContextProvider", "useTabsContext", "
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { useArrowNavigationGroup, useFocusFinders, useFocusableGroup } from '@fluentui/react-tabster';\nimport { createContext } from '@radix-ui/react-context';\nimport * as TabsPrimitive from '@radix-ui/react-tabs';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport React, {\n Activity,\n type ComponentPropsWithoutRef,\n type MouseEvent,\n forwardRef,\n useCallback,\n useLayoutEffect,\n} from 'react';\n\nimport {\n Button,\n type ButtonProps,\n IconButton,\n type IconButtonProps,\n type ThemedClassName,\n useForwardedRef,\n} from '@dxos/react-ui';\nimport { useAttention } from '@dxos/react-ui-attention';\nimport { mx } from '@dxos/ui-theme';\n\ntype TabsActivePart = 'list' | 'panel';\n\nconst TABS_NAME = 'Tabs';\n\ntype TabsContextValue = {\n activePart: TabsActivePart;\n setActivePart: (nextActivePart: TabsActivePart) => void;\n attendableId?: string;\n} & Pick<TabsPrimitive.TabsProps, 'orientation' | 'value'>;\n\nconst [TabsContextProvider, useTabsContext] = createContext<TabsContextValue>(TABS_NAME, {\n orientation: 'vertical',\n activePart: 'list',\n setActivePart: () => {},\n});\n\ntype TabsRootProps = ThemedClassName<TabsPrimitive.TabsProps> &\n Partial<\n Pick<TabsContextValue, 'activePart' | 'attendableId'> & {\n onActivePartChange: (nextActivePart: TabsActivePart) => void;\n defaultActivePart: TabsActivePart;\n }\n >;\n\nconst TabsRoot = forwardRef<HTMLDivElement, TabsRootProps>(\n (\n {\n children,\n classNames,\n activePart: propsActivePart,\n onActivePartChange,\n defaultActivePart,\n value: propsValue,\n onValueChange,\n defaultValue,\n orientation = 'vertical',\n activationMode = 'manual',\n attendableId,\n ...props\n },\n forwardedRef,\n ) => {\n // const tabsRoot = useRef<HTMLDivElement | null>(null);\n const tabsRoot = useForwardedRef(forwardedRef);\n\n // TODO(thure): Without these, we get Groupper/Mover `API used before initialization`, but why?\n const _1 = useArrowNavigationGroup();\n const _2 = useFocusableGroup();\n const [activePart = 'list', setActivePart] = useControllableState({\n prop: propsActivePart,\n onChange: onActivePartChange,\n defaultProp: defaultActivePart,\n });\n\n const [value, setValue] = useControllableState({\n prop: propsValue,\n onChange: onValueChange,\n defaultProp: defaultValue,\n });\n\n const handleValueChange = useCallback(\n (nextValue: string) => {\n setActivePart('panel');\n setValue(nextValue);\n },\n [value],\n );\n\n const { findFirstFocusable } = useFocusFinders();\n\n useLayoutEffect(() => {\n if (tabsRoot.current) {\n findFirstFocusable(tabsRoot.current)?.focus();\n }\n }, [activePart]);\n\n return (\n <TabsContextProvider\n orientation={orientation}\n activePart={activePart}\n setActivePart={setActivePart}\n value={value}\n attendableId={attendableId}\n >\n <TabsPrimitive.Root\n {...props}\n className={mx('overflow-hidden', classNames)}\n orientation={orientation}\n activationMode={activationMode}\n data-active={activePart}\n value={value}\n onValueChange={handleValueChange}\n ref={tabsRoot}\n >\n {children}\n </TabsPrimitive.Root>\n </TabsContextProvider>\n );\n },\n);\n\nTabsRoot.displayName = 'Tabs.Root';\n\ntype TabsViewportProps = ThemedClassName<ComponentPropsWithoutRef<'div'>>;\n\nfunction TabsViewport({ classNames, children, ...props }: TabsViewportProps) {\n const { activePart } = useTabsContext('TabsViewport');\n return (\n <div {...props} data-active={activePart} className={mx(classNames)}>\n {children}\n </div>\n );\n}\n\nTabsViewport.displayName = 'Tabs.Viewport';\n\ntype TabsTablistProps = ThemedClassName<TabsPrimitive.TabsListProps>;\n\nfunction TabsTablist({ children, classNames, ...props }: TabsTablistProps) {\n const { orientation } = useTabsContext('TabsTablist');\n return (\n <TabsPrimitive.List\n {...props}\n data-arrow-keys={orientation === 'vertical' ? 'up down' : 'left right'}\n className={mx(\n 'max-h-full w-full',\n // TODO(burdon): Should be embeddable inside Toolbar (if horizontal).\n orientation === 'vertical' ? 'overflow-y-auto' : 'flex p-1 gap-1 items-stretch justify-start overflow-x-auto',\n classNames,\n )}\n >\n {children}\n </TabsPrimitive.List>\n );\n}\n\nTabsTablist.displayName = 'Tabs.Tablist';\n\nfunction TabsBackButton({ onClick, classNames, ...props }: ButtonProps) {\n const { setActivePart } = useTabsContext('TabsBackButton');\n const handleClick = useCallback(\n (event: MouseEvent<HTMLButtonElement>) => {\n setActivePart('list');\n return onClick?.(event);\n },\n [setActivePart, onClick],\n );\n\n return <Button {...props} classNames={['@md:hidden text-start', classNames]} onClick={handleClick} />;\n}\n\nTabsBackButton.displayName = 'Tabs.BackButton';\n\ntype TabsTabGroupHeadingProps = ThemedClassName<ComponentPropsWithoutRef<'h2'>>;\n\nfunction TabsTabGroupHeading({ children, classNames, ...props }: ThemedClassName<TabsTabGroupHeadingProps>) {\n return (\n <h2 {...props} className={mx('my-1 px-2 text-sm text-un-accent', classNames)}>\n {children}\n </h2>\n );\n}\n\nTabsTabGroupHeading.displayName = 'Tabs.TabGroupHeading';\n\ntype TabsTabProps = ButtonProps & Pick<TabsPrimitive.TabsTriggerProps, 'value'>;\n\nfunction TabsTab({ value, classNames, children, onClick, ...props }: TabsTabProps) {\n const { setActivePart, orientation, value: contextValue, attendableId } = useTabsContext('TabsTab');\n const { hasAttention } = useAttention(attendableId);\n\n const handleClick = useCallback(\n // NOTE: This handler is only called if the tab is *already active*.\n (event: MouseEvent<HTMLButtonElement>) => {\n setActivePart('panel');\n onClick?.(event);\n },\n [setActivePart, onClick],\n );\n\n return (\n <TabsPrimitive.Trigger value={value} asChild>\n <Button\n {...props}\n variant={\n orientation === 'horizontal' && contextValue === value ? (hasAttention ? 'primary' : 'default') : 'ghost'\n }\n classNames={[\n orientation === 'vertical' && 'block justify-start text-start w-full',\n orientation === 'vertical' && 'dx-selected',\n classNames,\n ]}\n onClick={handleClick}\n >\n {children}\n </Button>\n </TabsPrimitive.Trigger>\n );\n}\n\nTabsTab.displayName = 'Tabs.Tab';\n\ntype TabsIconTabProps = IconButtonProps & Pick<TabsPrimitive.TabsTriggerProps, 'value'>;\n\nfunction TabsIconTab({ value, classNames, onClick, ...props }: TabsIconTabProps) {\n const { setActivePart, orientation, value: contextValue, attendableId } = useTabsContext('TabsTab');\n const { hasAttention } = useAttention(attendableId);\n\n // NOTE: This handler is only called if the tab is *already active*.\n const handleClick = useCallback(\n (event: MouseEvent<HTMLButtonElement>) => {\n setActivePart('panel');\n onClick?.(event);\n },\n [setActivePart, onClick],\n );\n\n return (\n <TabsPrimitive.Trigger value={value} asChild>\n <IconButton\n {...props}\n variant={\n orientation === 'horizontal' && contextValue === value ? (hasAttention ? 'primary' : 'default') : 'ghost'\n }\n classNames={[\n orientation === 'vertical' && 'justify-start text-start w-full',\n orientation === 'vertical' && 'dx-selected',\n classNames,\n ]}\n onClick={handleClick}\n />\n </TabsPrimitive.Trigger>\n );\n}\n\nTabsIconTab.displayName = 'Tabs.IconTab';\n\ntype TabsPanelProps = ThemedClassName<TabsPrimitive.TabsContentProps>;\n\nfunction TabsPanel({ classNames, children, ...props }: TabsPanelProps) {\n const { value: contextValue } = useTabsContext('TabsTab');\n return (\n <Activity mode={contextValue === props.value ? 'visible' : 'hidden'}>\n <TabsPrimitive.Content {...props} className={mx('p-0! dx-focus-ring-inset-over-all', classNames)}>\n {children}\n </TabsPrimitive.Content>\n </Activity>\n );\n}\n\nTabsPanel.displayName = 'Tabs.Panel';\n\ntype TabsTabPrimitiveProps = TabsPrimitive.TabsTriggerProps;\n\nexport const Tabs = {\n Root: TabsRoot,\n Tablist: TabsTablist,\n Tab: TabsTab,\n IconTab: TabsIconTab,\n TabPrimitive: TabsPrimitive.Trigger,\n TabGroupHeading: TabsTabGroupHeading,\n Panel: TabsPanel,\n BackButton: TabsBackButton,\n Viewport: TabsViewport,\n};\n\nexport type {\n TabsActivePart,\n TabsRootProps,\n TabsTablistProps,\n TabsTabProps,\n TabsTabPrimitiveProps,\n TabsTabGroupHeadingProps,\n TabsPanelProps,\n TabsViewportProps,\n};\n"],
|
|
5
|
+
"mappings": ";;;AAIA,SAASA,yBAAyBC,iBAAiBC,yBAAyB;AAC5E,SAASC,qBAAqB;AAC9B,YAAYC,mBAAmB;AAC/B,SAASC,4BAA4B;AACrC,OAAOC,SACLC,UAGAC,YACAC,aACAC,uBACK;AAEP,SACEC,QAEAC,YAGAC,uBACK;AACP,SAASC,oBAAoB;AAC7B,SAASC,UAAU;AAInB,IAAMC,YAAY;AAQlB,IAAM,CAACC,qBAAqBC,cAAAA,IAAkBf,cAAgCa,WAAW;EACvFG,aAAa;EACbC,YAAY;EACZC,eAAe,MAAA;EAAO;AACxB,CAAA;AAUA,IAAMC,WAAWd,2BACf,CACE,EACEe,UACAC,YACAJ,YAAYK,iBACZC,oBACAC,mBACAC,OAAOC,YACPC,eACAC,cACAZ,c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AAYvB;EACZwB,UAAU7B;AACZ;",
|
|
6
|
+
"names": ["useArrowNavigationGroup", "useFocusFinders", "useFocusableGroup", "createContext", "TabsPrimitive", "useControllableState", "React", "Activity", "forwardRef", "useCallback", "useLayoutEffect", "Button", "IconButton", "useForwardedRef", "useAttention", "mx", "TABS_NAME", "TabsContextProvider", "useTabsContext", "orientation", "activePart", "setActivePart", "TabsRoot", "children", "classNames", "propsActivePart", "onActivePartChange", "defaultActivePart", "value", "propsValue", "onValueChange", "defaultValue", "activationMode", "attendableId", "props", "forwardedRef", "tabsRoot", "_1", "_2", "prop", "onChange", "defaultProp", "setValue", "handleValueChange", "nextValue", "findFirstFocusable", "current", "focus", "Root", "className", "data-active", "ref", "displayName", "TabsViewport", "div", "TabsTablist", "List", "data-arrow-keys", "TabsBackButton", "onClick", "handleClick", "event", "TabsTabGroupHeading", "h2", "TabsTab", "contextValue", "hasAttention", "Trigger", "asChild", "variant", "TabsIconTab", "TabsPanel", "mode", "Content", "Tabs", "Tablist", "Tab", "IconTab", "TabPrimitive", "TabGroupHeading", "Panel", "BackButton", "Viewport"]
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"src/Tabs.tsx":{"bytes":
|
|
1
|
+
{"inputs":{"src/Tabs.tsx":{"bytes":26019,"imports":[{"path":"@fluentui/react-tabster","kind":"import-statement","external":true},{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"@radix-ui/react-tabs","kind":"import-statement","external":true},{"path":"@radix-ui/react-use-controllable-state","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-attention","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true}],"format":"esm"},"src/index.ts":{"bytes":368,"imports":[{"path":"src/Tabs.tsx","kind":"import-statement","original":"./Tabs"}],"format":"esm"}},"outputs":{"dist/lib/node-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":13924},"dist/lib/node-esm/index.mjs":{"imports":[{"path":"@fluentui/react-tabster","kind":"import-statement","external":true},{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"@radix-ui/react-tabs","kind":"import-statement","external":true},{"path":"@radix-ui/react-use-controllable-state","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-attention","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true}],"exports":["Tabs"],"entryPoint":"src/index.ts","inputs":{"src/Tabs.tsx":{"bytesInOutput":6480},"src/index.ts":{"bytesInOutput":0}},"bytes":6643}}}
|
package/dist/types/src/Tabs.d.ts
CHANGED
|
@@ -12,11 +12,39 @@ type TabsRootProps = ThemedClassName<TabsPrimitive.TabsProps> & Partial<Pick<Tab
|
|
|
12
12
|
defaultActivePart: TabsActivePart;
|
|
13
13
|
}>;
|
|
14
14
|
type TabsViewportProps = ThemedClassName<ComponentPropsWithoutRef<'div'>>;
|
|
15
|
+
declare function TabsViewport({ classNames, children, ...props }: TabsViewportProps): React.JSX.Element;
|
|
16
|
+
declare namespace TabsViewport {
|
|
17
|
+
var displayName: string;
|
|
18
|
+
}
|
|
15
19
|
type TabsTablistProps = ThemedClassName<TabsPrimitive.TabsListProps>;
|
|
20
|
+
declare function TabsTablist({ children, classNames, ...props }: TabsTablistProps): React.JSX.Element;
|
|
21
|
+
declare namespace TabsTablist {
|
|
22
|
+
var displayName: string;
|
|
23
|
+
}
|
|
24
|
+
declare function TabsBackButton({ onClick, classNames, ...props }: ButtonProps): React.JSX.Element;
|
|
25
|
+
declare namespace TabsBackButton {
|
|
26
|
+
var displayName: string;
|
|
27
|
+
}
|
|
16
28
|
type TabsTabGroupHeadingProps = ThemedClassName<ComponentPropsWithoutRef<'h2'>>;
|
|
29
|
+
declare function TabsTabGroupHeading({ children, classNames, ...props }: ThemedClassName<TabsTabGroupHeadingProps>): React.JSX.Element;
|
|
30
|
+
declare namespace TabsTabGroupHeading {
|
|
31
|
+
var displayName: string;
|
|
32
|
+
}
|
|
17
33
|
type TabsTabProps = ButtonProps & Pick<TabsPrimitive.TabsTriggerProps, 'value'>;
|
|
34
|
+
declare function TabsTab({ value, classNames, children, onClick, ...props }: TabsTabProps): React.JSX.Element;
|
|
35
|
+
declare namespace TabsTab {
|
|
36
|
+
var displayName: string;
|
|
37
|
+
}
|
|
18
38
|
type TabsIconTabProps = IconButtonProps & Pick<TabsPrimitive.TabsTriggerProps, 'value'>;
|
|
39
|
+
declare function TabsIconTab({ value, classNames, onClick, ...props }: TabsIconTabProps): React.JSX.Element;
|
|
40
|
+
declare namespace TabsIconTab {
|
|
41
|
+
var displayName: string;
|
|
42
|
+
}
|
|
19
43
|
type TabsPanelProps = ThemedClassName<TabsPrimitive.TabsContentProps>;
|
|
44
|
+
declare function TabsPanel({ classNames, children, ...props }: TabsPanelProps): React.JSX.Element;
|
|
45
|
+
declare namespace TabsPanel {
|
|
46
|
+
var displayName: string;
|
|
47
|
+
}
|
|
20
48
|
type TabsTabPrimitiveProps = TabsPrimitive.TabsTriggerProps;
|
|
21
49
|
export declare const Tabs: {
|
|
22
50
|
Root: React.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsProps, "className"> & {
|
|
@@ -25,14 +53,14 @@ export declare const Tabs: {
|
|
|
25
53
|
onActivePartChange: (nextActivePart: TabsActivePart) => void;
|
|
26
54
|
defaultActivePart: TabsActivePart;
|
|
27
55
|
}> & React.RefAttributes<HTMLDivElement>>;
|
|
28
|
-
Tablist:
|
|
29
|
-
Tab:
|
|
30
|
-
IconTab:
|
|
56
|
+
Tablist: typeof TabsTablist;
|
|
57
|
+
Tab: typeof TabsTab;
|
|
58
|
+
IconTab: typeof TabsIconTab;
|
|
31
59
|
TabPrimitive: React.ForwardRefExoticComponent<TabsPrimitive.TabsTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
32
|
-
TabGroupHeading:
|
|
33
|
-
Panel:
|
|
34
|
-
BackButton:
|
|
35
|
-
Viewport:
|
|
60
|
+
TabGroupHeading: typeof TabsTabGroupHeading;
|
|
61
|
+
Panel: typeof TabsPanel;
|
|
62
|
+
BackButton: typeof TabsBackButton;
|
|
63
|
+
Viewport: typeof TabsViewport;
|
|
36
64
|
};
|
|
37
65
|
export type { TabsActivePart, TabsRootProps, TabsTablistProps, TabsTabProps, TabsTabPrimitiveProps, TabsTabGroupHeadingProps, TabsPanelProps, TabsViewportProps, };
|
|
38
66
|
//# sourceMappingURL=Tabs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tabs.d.ts","sourceRoot":"","sources":["../../../src/Tabs.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,aAAa,MAAM,sBAAsB,CAAC;AAEtD,OAAO,KAAK,EAAE,EAEZ,KAAK,wBAAwB,EAK9B,MAAM,OAAO,CAAC;AAEf,OAAO,EAEL,KAAK,WAAW,EAEhB,KAAK,eAAe,EACpB,KAAK,eAAe,EAErB,MAAM,gBAAgB,CAAC;AAIxB,KAAK,cAAc,GAAG,MAAM,GAAG,OAAO,CAAC;AAIvC,KAAK,gBAAgB,GAAG;IACtB,UAAU,EAAE,cAAc,CAAC;IAC3B,aAAa,EAAE,CAAC,cAAc,EAAE,cAAc,KAAK,IAAI,CAAC;IACxD,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,GAAG,IAAI,CAAC,aAAa,CAAC,SAAS,EAAE,aAAa,GAAG,OAAO,CAAC,CAAC;AAQ3D,KAAK,aAAa,GAAG,eAAe,CAAC,aAAa,CAAC,SAAS,CAAC,GAC3D,OAAO,CACL,IAAI,CAAC,gBAAgB,EAAE,YAAY,GAAG,cAAc,CAAC,GAAG;IACtD,kBAAkB,EAAE,CAAC,cAAc,EAAE,cAAc,KAAK,IAAI,CAAC;IAC7D,iBAAiB,EAAE,cAAc,CAAC;CACnC,CACF,CAAC;
|
|
1
|
+
{"version":3,"file":"Tabs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s.stories.d.ts","sourceRoot":"","sources":["../../../src/Tabs.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,EAAQ,aAAa,EAAE,MAAM,QAAQ,CAAC;AAwC7C,QAAA,MAAM,IAAI;;;;;;;;;;;;8BApC6B,aAAa
|
|
1
|
+
{"version":3,"file":"Tabs.stories.d.ts","sourceRoot":"","sources":["../../../src/Tabs.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,EAAQ,aAAa,EAAE,MAAM,QAAQ,CAAC;AAwC7C,QAAA,MAAM,IAAI;;;;;;;;;;;;8BApC6B,aAAa;;;QA0ChD,MAAM;;CAE2B,CAAC;eAEvB,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAGnC,eAAO,MAAM,UAAU,EAAE,KAIxB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAItB,CAAC"}
|