-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
0e069c6
commit 5fa19ba
Showing
12 changed files
with
195 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import type { Meta, StoryObj } from '@storybook/react'; | ||
|
||
import { Hero } from './Hero'; | ||
|
||
const meta = { | ||
component: Hero, | ||
} satisfies Meta<typeof Hero>; | ||
|
||
export default meta; | ||
|
||
type Story = StoryObj<typeof meta>; | ||
|
||
export const Default: Story = { | ||
args: {} | ||
}; | ||
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,21 @@ | ||
|
||
import { HeroProps, HeroProvider } from './data/HeroProvider'; | ||
import { clsx, clmg } from '@do-ob/core'; | ||
|
||
export function Hero(props: HeroProps) { | ||
|
||
const { title, subtitle, className } = props; | ||
|
||
return ( | ||
<HeroProvider {...props}> | ||
<section | ||
aria-label="Introduction" | ||
className={clmg(clsx('flex w-full flex-col items-center justify-center', className))}> | ||
<div> | ||
<h1 className="text-center text-4xl font-bold">{title}</h1> | ||
<p className="text-center text-lg">{subtitle}</p> | ||
</div> | ||
</section> | ||
</HeroProvider> | ||
); | ||
}; |
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,40 @@ | ||
'use client'; | ||
|
||
import React from 'react'; | ||
|
||
/** | ||
* Hero section props | ||
*/ | ||
export interface HeroProps { | ||
/** | ||
* The title of the hero section | ||
*/ | ||
title?: string; | ||
/** | ||
* The subtitle of the hero section | ||
*/ | ||
subtitle?: string; | ||
|
||
/** | ||
* Custom class name | ||
*/ | ||
className?: string; | ||
} | ||
|
||
/** | ||
* Hero context | ||
*/ | ||
export const HeroContext = React.createContext<HeroProps>({}); | ||
|
||
/** | ||
* Hero provider | ||
*/ | ||
export function HeroProvider({ | ||
children, ...props | ||
}: React.PropsWithChildren<HeroProps>) { | ||
return ( | ||
<HeroContext.Provider value={props}> | ||
{children} | ||
</HeroContext.Provider> | ||
); | ||
} |
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
14 changes: 14 additions & 0 deletions
14
packages/ui/src/components/Navigation/parts/NavigationPart_MenuToggle.tsx
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,14 @@ | ||
import { NavbarMenuToggle } from "@nextui-org/react"; | ||
|
||
export function NavigationPart_MenuToggle({ | ||
isMenuOpen = false, | ||
className = '', | ||
}) { | ||
|
||
return ( | ||
<NavbarMenuToggle | ||
aria-label={isMenuOpen ? 'Close manu' : 'Open menu'} | ||
className={className} | ||
/> | ||
); | ||
} | ||
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,52 @@ | ||
import { Locale, LocaleCode } from '@do-ob/ui/types'; | ||
|
||
import {enUs} from './locale/en-us'; | ||
Check failure on line 3 in packages/ui/src/locale.ts GitHub Actions / release / integrity / Test
|
||
|
||
const library: Record<LocaleCode, Locale> = { | ||
'en-US': enUs, | ||
'fr-FR': {}, | ||
'fr-CA': {}, | ||
'de-DE': {}, | ||
'en-GB': {}, | ||
'ja-JP': {}, | ||
'da-DK': {}, | ||
'nl-NL': {}, | ||
'fi-FI': {}, | ||
'it-IT': {}, | ||
'nb-NO': {}, | ||
'es-ES': {}, | ||
'sv-SE': {}, | ||
'pt-BR': {}, | ||
'zh-CN': {}, | ||
'zh-TW': {}, | ||
'ko-KR': {}, | ||
'bg-BG': {}, | ||
'hr-HR': {}, | ||
'cs-CZ': {}, | ||
'et-EE': {}, | ||
'hu-HU': {}, | ||
'lv-LV': {}, | ||
'lt-LT': {}, | ||
'pl-PL': {}, | ||
'ro-RO': {}, | ||
'ru-RU': {}, | ||
'sr-SP': {}, | ||
'sk-SK': {}, | ||
'sl-SI': {}, | ||
'tr-TR': {}, | ||
'uk-UA': {}, | ||
'ar-AE': {}, | ||
'ar-DZ': {}, | ||
'AR-EG': {}, | ||
'ar-SA': {}, | ||
'el-GR': {}, | ||
'he-IL': {}, | ||
'fa-AF': {}, | ||
'am-ET': {}, | ||
'hi-IN': {}, | ||
'th-TH': {} | ||
} | ||
|
||
export function localeLibrary(code: LocaleCode) { | ||
return library[code] | ||
} | ||
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,7 @@ | ||
import { Locale } from '@do-ob/ui/types'; | ||
|
||
export const enUs: Locale = { | ||
navigation_menu_open_aria_label: 'Open navigation menu', | ||
navigation_menu_close_aria_label: 'Close navigation menu', | ||
hero_aria_label: 'Hero section', | ||
}; |
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,3 +1,5 @@ | ||
export * from './types/locale'; | ||
|
||
/** | ||
* Theme mode. | ||
*/ | ||
|
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,24 @@ | ||
export type LocaleCode = 'fr-FR' | 'fr-CA' | 'de-DE' | 'en-US' | 'en-GB' | 'ja-JP' | | ||
'da-DK' | 'nl-NL' | 'fi-FI' | 'it-IT' | 'nb-NO' | 'es-ES' | | ||
'sv-SE' | 'pt-BR' | 'zh-CN' | 'zh-TW' | 'ko-KR' | 'bg-BG' | | ||
'hr-HR' | 'cs-CZ' | 'et-EE' | 'hu-HU' | 'lv-LV' | 'lt-LT' | | ||
'pl-PL' | 'ro-RO' | 'ru-RU' | 'sr-SP' | 'sk-SK' | 'sl-SI' | | ||
'tr-TR' | 'uk-UA' | 'ar-AE' | 'ar-DZ' | 'AR-EG' | 'ar-SA' | | ||
'el-GR' | 'he-IL' | 'fa-AF' | 'am-ET' | 'hi-IN' | 'th-TH'; | ||
|
||
export interface Locale { | ||
/** | ||
* The navigation menu open button aria label. | ||
*/ | ||
navigation_menu_open_aria_label?: string; | ||
|
||
/** | ||
* The navigation menu close button aria label. | ||
*/ | ||
navigation_menu_close_aria_label?: string; | ||
|
||
/** | ||
* Aria label for the Hero section. | ||
*/ | ||
hero_aria_label?: string; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.