@availity/mui-tabs 1.1.0 → 1.2.0

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/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ## [1.2.0](https://github.com/Availity/element/compare/@availity/mui-tabs@1.1.0...@availity/mui-tabs@1.2.0) (2025-03-24)
6
+
7
+
8
+ ### Features
9
+
10
+ * **mui-tabs:** add icon and examples ([af6172d](https://github.com/Availity/element/commit/af6172d25882c03b543fff108424a6875027a5a0))
11
+
5
12
  ## [1.1.0](https://github.com/Availity/element/compare/@availity/mui-tabs@1.0.1...@availity/mui-tabs@1.1.0) (2025-03-13)
6
13
 
7
14
 
package/dist/index.d.mts CHANGED
@@ -4,7 +4,7 @@ import { TabListProps as TabListProps$1 } from '@mui/lab/TabList';
4
4
  import { TabsProps as TabsProps$1 } from '@mui/material/Tabs';
5
5
  import { TabPanelProps as TabPanelProps$1 } from '@mui/lab/TabPanel';
6
6
 
7
- type TabProps = Omit<TabProps$1, 'centerRipple' | 'disableFocusRipple' | 'disableRipple' | 'disableTouchRipple' | 'focusRipple' | 'icon' | 'iconPosition' | 'touchRippleRef' | 'TouchRippleProps'>;
7
+ type TabProps = Omit<TabProps$1, 'centerRipple' | 'disableFocusRipple' | 'disableRipple' | 'disableTouchRipple' | 'focusRipple' | 'touchRippleRef' | 'TouchRippleProps'>;
8
8
  declare const Tab: (props: TabProps) => JSX.Element;
9
9
 
10
10
  interface TabContextProps extends TabContextProps$1 {
package/dist/index.d.ts CHANGED
@@ -4,7 +4,7 @@ import { TabListProps as TabListProps$1 } from '@mui/lab/TabList';
4
4
  import { TabsProps as TabsProps$1 } from '@mui/material/Tabs';
5
5
  import { TabPanelProps as TabPanelProps$1 } from '@mui/lab/TabPanel';
6
6
 
7
- type TabProps = Omit<TabProps$1, 'centerRipple' | 'disableFocusRipple' | 'disableRipple' | 'disableTouchRipple' | 'focusRipple' | 'icon' | 'iconPosition' | 'touchRippleRef' | 'TouchRippleProps'>;
7
+ type TabProps = Omit<TabProps$1, 'centerRipple' | 'disableFocusRipple' | 'disableRipple' | 'disableTouchRipple' | 'focusRipple' | 'touchRippleRef' | 'TouchRippleProps'>;
8
8
  declare const Tab: (props: TabProps) => JSX.Element;
9
9
 
10
10
  interface TabContextProps extends TabContextProps$1 {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@availity/mui-tabs",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "Availity MUI Tabs Component - part of the @availity/element design system",
5
5
  "keywords": [
6
6
  "react",
@@ -44,6 +44,7 @@
44
44
  },
45
45
  "devDependencies": {
46
46
  "@availity/mui-divider": "^1.0.1",
47
+ "@availity/mui-icon": "^1.0.1",
47
48
  "@mui/material": "^6.4.5",
48
49
  "react": "18.2.0",
49
50
  "react-dom": "18.2.0",
package/src/lib/Tab.tsx CHANGED
@@ -7,8 +7,6 @@ export type TabProps = Omit<
7
7
  | 'disableRipple'
8
8
  | 'disableTouchRipple'
9
9
  | 'focusRipple'
10
- | 'icon'
11
- | 'iconPosition'
12
10
  | 'touchRippleRef'
13
11
  | 'TouchRippleProps'
14
12
  >;
@@ -2,6 +2,7 @@
2
2
 
3
3
  import { useState } from 'react';
4
4
  import type { Meta, StoryObj } from '@storybook/react';
5
+ import { LinkIcon, UserIcon } from '@availity/mui-icon';
5
6
  import { TabList, TabListProps } from './TabList';
6
7
  import { Tab } from './Tab';
7
8
  import { TabContext } from './TabContext';
@@ -43,3 +44,23 @@ export const _TabList: StoryObj<typeof TabList> = {
43
44
  },
44
45
  args: {},
45
46
  };
47
+
48
+ export const _WithIcons: StoryObj<typeof TabList> = {
49
+ render: () => {
50
+ const [value, setValue] = useState('1');
51
+
52
+ const handleChange = (event: React.SyntheticEvent, newValue: string) => {
53
+ setValue(newValue);
54
+ };
55
+ return (
56
+ <TabContext value={value}>
57
+ <TabList onChange={handleChange} aria-label="lab API tabs example">
58
+ <Tab value="1" icon={<LinkIcon/>} label="Links" />
59
+ <Tab value="2" icon={<UserIcon/>} label="My Account" />
60
+ </TabList>
61
+ <TabPanel value="1" children={`Hello from Panel ${value}`} />
62
+ <TabPanel value="2" children={`Hello from Panel ${value}`} />
63
+ </TabContext>
64
+ );
65
+ },
66
+ };
@@ -4,8 +4,11 @@
4
4
  import type { Meta, StoryObj } from '@storybook/react';
5
5
  import Box from '@mui/material/Box';
6
6
  import Typography from '@mui/material/Typography';
7
+ import { LinkIcon, UserIcon } from '@availity/mui-icon';
8
+ import { Tooltip } from '@availity/mui-tooltip';
7
9
  import { Tabs, TabsProps } from './Tabs';
8
10
  import { Tab } from './Tab';
11
+ import { useState } from 'react';
9
12
 
10
13
  const meta: Meta<typeof Tabs> = {
11
14
  title: 'Components/Tabs/Tabs',
@@ -134,3 +137,45 @@ export const _Levels: StoryObj<typeof Tabs> = {
134
137
  );
135
138
  },
136
139
  };
140
+
141
+ export const _WithIcons: StoryObj<typeof Tabs> = {
142
+ render: () => {
143
+ const [value, setValue] = useState(0);
144
+
145
+ const handleChange = (event: React.SyntheticEvent, newValue: number) => {
146
+ setValue(newValue);
147
+ };
148
+
149
+ return (
150
+ <>
151
+ <Tabs value={value} onChange={handleChange}>
152
+ <Tab icon={<LinkIcon/>} label="Links" {...a11yProps(0)} />
153
+ <Tab icon={<UserIcon/>} label="My Account" {...a11yProps(1)} />
154
+ </Tabs>
155
+ <CustomTabPanel value={value} index={0} />
156
+ <CustomTabPanel value={value} index={1} />
157
+ </>
158
+ );
159
+ },
160
+ };
161
+
162
+ export const _IconOnly: StoryObj<typeof Tabs> = {
163
+ render: () => {
164
+ const [value, setValue] = useState(0);
165
+
166
+ const handleChange = (event: React.SyntheticEvent, newValue: number) => {
167
+ setValue(newValue);
168
+ };
169
+
170
+ return (
171
+ <>
172
+ <Tabs value={value} onChange={handleChange}>
173
+ <Tab label={<Tooltip title="Links"><LinkIcon/></Tooltip>} {...a11yProps(0)} />
174
+ <Tooltip title="My Account"><Tab label={<UserIcon/>} {...a11yProps(1)} /></Tooltip>
175
+ </Tabs>
176
+ <CustomTabPanel value={value} index={0} />
177
+ <CustomTabPanel value={value} index={1} />
178
+ </>
179
+ );
180
+ },
181
+ };