Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 61 additions & 7 deletions docs/navigation/tabs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ With the prop <TagDocs text='fontSize' /> you can customize the font size of the

<br />

#### <span>TextColor</span>
#### <span name="floating-nav">TextColor</span>

With the prop <TagDocs text='textColor' /> you can customize the color of the first tab

Expand Down Expand Up @@ -143,7 +143,7 @@ With the prop <TagDocs text='textColor' /> you can customize the color of the fi

<br />

#### <span>Witdh</span>
#### <span name="floating-nav">Witdh</span>

With the prop <TagDocs text='width' /> you can customize the size of the TabGroup

Expand Down Expand Up @@ -171,7 +171,7 @@ With the prop <TagDocs text='width' /> you can customize the size of the TabGrou

<br />

#### <span>IndicatorColor</span>
#### <span name="floating-nav">IndicatorColor</span>

With the prop <TagDocs text='indicatorColor' /> you can customize the color of the line below the active tab

Expand Down Expand Up @@ -199,7 +199,7 @@ With the prop <TagDocs text='indicatorColor' /> you can customize the color of t

<br />

#### <span>WideLine</span>
#### <span name="floating-nav">WideLine</span>

With the prop <TagDocs text='wideLine' /> you can customize the width of the line under the active tab

Expand Down Expand Up @@ -227,7 +227,7 @@ With the prop <TagDocs text='wideLine' /> you can customize the width of the lin

<br />

#### <span>DisabledText</span>
#### <span name="floating-nav">DisabledText</span>

With the prop <TagDocs text='disabledText' /> you can customize a message for disabled tabs

Expand All @@ -253,7 +253,7 @@ With the prop <TagDocs text='disabledText' /> you can customize a message for di

`} />

#### <span>Hidden</span>
#### <span name="floating-nav">Hidden</span>

With the prop <TagDocs text='hidden' /> you can hide the tab

Expand Down Expand Up @@ -281,6 +281,57 @@ With the prop <TagDocs text='hidden' /> you can hide the tab

<br />

##### <span name="floating-nav">Tab Custom</span>

With the <TagDocs text='tertiary' /> variant you can customize the appearance of the tabs. you can do so using the props: child ClassName, className, tabWidth textDisabledColor and others.

<Playground className="flex items-center">
<Flex className="bg-gray-900 py-2">
<TabGroup
fontSize="xs"
indicatorColor="#3b82f6"
className="border-b border-gray-500"
childClassName="text-gray-400 py-2 hover:bg-gray-800"
tabWidth={106}
textColor="#ffffff"
textDisabledColor="#4b5563"
variant="tertiary"
wideLine={3}
>
<Tab label="Element First" />
<Tab label="Element Second" />
<Tab label="Element Third" />
<Tab label="Element Fourth" disabled />
</TabGroup>
</Flex>
</Playground>

<WindowEditor
codeString={`import { Flex, TabGroup, Tabs } from 'dd360-ds'

<Flex className="bg-gray-800 py-2">
<TabGroup
fontSize="xs"
indicatorColor="#3b82f6"
className="border-b border-gray-500"
childClassName="text-gray-400 py-2 hover:bg-gray-800"
tabWidth={106}
textColor="#ffffff"
textDisabledColor="#4b5563"
variant="tertiary"
wideLine={3}
>
<Tab label="Element First" />
<Tab label="Element Second" />
<Tab label="Element Third" />
<Tab label="Element Fourth" disabled />
</TabGroup>
</Flex>

`} />

<br />

<br />

<br />
Expand All @@ -291,12 +342,15 @@ With the prop <TagDocs text='hidden' /> you can hide the tab
dataTable={[
{ title: 'orientation', default: 'horizontal', types: ['vertical', 'horizontal'] },
{ title: 'wideLine', default: 3.2, types: ['number'] },
{ title: 'variant', default: 'primary', types: ['primary', 'secondary'] },
{ title: 'variant', default: 'primary', types: ['primary', 'secondary', 'tertiary'] },
{ title: 'value', default: 0, types: ['number'] },
{ title: 'disabledText', default: null, types: ['string'] },
{ title: 'fontSize', default: null, types: ['base', 'xs', 'sm', 'lg', 'xl'] },
{ title: 'width', default: null, types: ['number'] },
{ title: 'tabWidth', default: null, types: ['number'] },
{ title: 'tabMinWidth', default: null, types: ['number'] },
{ title: 'textColor', default: null, types: ['string'] },
{ title: 'textDisabledColor', default: '#D1D5DB', types: ['string'] },
{ title: 'indicatorColor', default: null, types: ['string'] },
{ title: 'className', default: null, types: ['string'] },
{ title: 'childClassName', default: null, types: ['string'] },
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"@algolia/autocomplete-core": "^1.8.3",
"@docsearch/react": "^3.5.1",
"@vercel/analytics": "^1.0.1",
"dd360-ds": "6.20.1",
"dd360-ds": "https://pkg.csb.dev/dd3tech/bui/commit/519a144f/dd360-ds",
"dd360-utils": "18.1.0",
"gray-matter": "^4.0.3",
"i18next": "^22.4.9",
Expand Down
30 changes: 20 additions & 10 deletions src/modules/docs/navigation/TabsCustom.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ import { Tab, TabGroup } from 'dd360-ds'
import { useState } from 'react'

const TabsCustom = ({ option }: { option: string }) => {
const [variant, setVariant] = useState<'primary' | 'secondary'>('primary')
const [variant, setVariant] = useState<'primary' | 'secondary' | 'tertiary'>(
'primary'
)
const [orientation, setOrientation] = useState<'vertical' | 'horizontal'>(
'horizontal'
)
Expand Down Expand Up @@ -31,18 +33,26 @@ const TabsCustom = ({ option }: { option: string }) => {
checked={variant === 'primary'}
className="cursor-pointer"
name="variant"
onClick={() => setVariant('primary')}
onChange={() => setVariant('primary')}
type="radio"
/>
<label>Primary</label>
<input
checked={variant === 'secondary'}
className="cursor-pointer"
name="variant"
onClick={() => setVariant('secondary')}
onChange={() => setVariant('secondary')}
type="radio"
/>
<label>Secondary</label>
<input
checked={variant === 'tertiary'}
className="cursor-pointer"
name="variant"
onChange={() => setVariant('tertiary')}
type="radio"
/>
<label>Tertiary</label>
</>
)}

Expand All @@ -52,15 +62,15 @@ const TabsCustom = ({ option }: { option: string }) => {
checked={orientation === 'horizontal'}
className="cursor-pointer"
name="orientation"
onClick={() => setOrientation('horizontal')}
onChange={() => setOrientation('horizontal')}
type="radio"
/>
<label>Horizontal</label>
<input
checked={orientation === 'vertical'}
className="cursor-pointer"
name="orientation"
onClick={() => setOrientation('vertical')}
onChange={() => setOrientation('vertical')}
type="radio"
/>
<label>Vertical</label>
Expand All @@ -73,39 +83,39 @@ const TabsCustom = ({ option }: { option: string }) => {
checked={fontSize === 'xs'}
className="cursor-pointer"
name="size"
onClick={() => setFontSize('xs')}
onChange={() => setFontSize('xs')}
type="radio"
/>
<label>xs</label>
<input
checked={fontSize === 'sm'}
className="cursor-pointer"
name="size"
onClick={() => setFontSize('sm')}
onChange={() => setFontSize('sm')}
type="radio"
/>
<label>sm</label>
<input
checked={fontSize === 'base'}
className="cursor-pointer"
name="size"
onClick={() => setFontSize('base')}
onChange={() => setFontSize('base')}
type="radio"
/>
<label>base</label>
<input
checked={fontSize === 'lg'}
className="cursor-pointer"
name="size"
onClick={() => setFontSize('lg')}
onChange={() => setFontSize('lg')}
type="radio"
/>
<label>lg</label>
<input
checked={fontSize === 'xl'}
className="cursor-pointer"
name="size"
onClick={() => setFontSize('xl')}
onChange={() => setFontSize('xl')}
type="radio"
/>
<label>xl</label>
Expand Down