-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
73 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,25 @@ | ||
import React from 'react'; | ||
import React, { useState } from 'react'; | ||
|
||
import { KolNav } from '@public-ui/react'; | ||
import { KolInputCheckbox, KolNav } from '@public-ui/react'; | ||
|
||
import { LINKS } from './links'; | ||
|
||
import type { FC } from 'react'; | ||
export const NavBasic: FC = () => <KolNav class="block w-fit" _label="Main navigation" _links={LINKS} _hasCompactButton />; | ||
export const NavBasic: FC = () => { | ||
const [hasIconsWhenExpanded, setHasIconsWhenExpanded] = useState(false); | ||
|
||
return ( | ||
<> | ||
<KolInputCheckbox | ||
_label="Show icons when expanded" | ||
_checked={hasIconsWhenExpanded} | ||
_on={{ | ||
onChange: (_event, value: unknown) => { | ||
setHasIconsWhenExpanded(value as boolean); | ||
}, | ||
}} | ||
></KolInputCheckbox> | ||
<KolNav class="block w-fit" _label="Main navigation" _links={LINKS} _hasCompactButton _hasIconsWhenExpanded={hasIconsWhenExpanded} /> | ||
</> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import type { Generic } from 'adopted-style-sheets'; | ||
|
||
import { watchBoolean } from '../utils'; | ||
|
||
/* types */ | ||
export type HasIconsWhenExpandedPropType = boolean; | ||
|
||
/** | ||
* Shows icons next to the navigation item labels, even when the navigation is not collapsed. | ||
*/ | ||
export type PropHasIconsWhenExpanded = { | ||
hasIconsWhenExpanded: HasIconsWhenExpandedPropType; | ||
}; | ||
|
||
/* validator */ | ||
export const validateHasIconsWhenExpanded = (component: Generic.Element.Component, value?: HasIconsWhenExpandedPropType): void => { | ||
watchBoolean(component, '_hasIconsWhenExpanded', value); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+3.86 KB
(110%)
packages/themes/bmf/snapshots/theme-bmf/snapshot-for-nav-basic-firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+2.81 KB
(110%)
...themes/default/snapshots/theme-default/snapshot-for-nav-basic-firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-2.54 KB
(89%)
...s/default/snapshots/theme-default/snapshot-for-nav-horizontal-firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.