diff --git a/src/components/navigation/navigation-disclosure-panel.tsx b/src/components/navigation/navigation-disclosure-panel.tsx new file mode 100644 index 00000000..1fb75293 --- /dev/null +++ b/src/components/navigation/navigation-disclosure-panel.tsx @@ -0,0 +1,42 @@ +import React from "react"; +import { Disclosure } from "@headlessui/react"; +import { classNames } from "../../util/class-names"; + +export interface NavigationDisclosurePanelItemProps { + children: React.ReactNode; + isActive?: boolean; + isIndented?: boolean; +} + +const NavigationDisclosurePanelItem = ({ + children, + isActive, + isIndented, +}: NavigationDisclosurePanelItemProps) => { + return ( +
+ {children} + {isActive && ( +
+ )} +
+ ); +}; + +export interface NavigationDisclosurePanelProps { + children: React.ReactNode; +} + +const NavigationDisclosurePanel = ({ children }: NavigationDisclosurePanelProps) => { + return {children}; +}; + +NavigationDisclosurePanel.Item = NavigationDisclosurePanelItem; + +export { NavigationDisclosurePanel }; diff --git a/src/components/navigation/navigation-disclosure.tsx b/src/components/navigation/navigation-disclosure.tsx new file mode 100644 index 00000000..f15f022e --- /dev/null +++ b/src/components/navigation/navigation-disclosure.tsx @@ -0,0 +1,35 @@ +import { Disclosure } from "@headlessui/react"; +import React from "react"; +import { NavigationDisclosurePanel } from "./navigation-disclosure-panel"; + +interface NavigationDisclosureButtonProps { + children: React.ReactNode; + LeftIcon?: React.ElementType; +} + +const NavigationDisclosureButton = ({ children, LeftIcon }: NavigationDisclosureButtonProps) => { + return ( + + {LeftIcon ? : null} + {children} + + ); +}; + +export interface NavigationDisclosureProps { + children: React.ReactNode; + defaultOpen?: boolean; +} + +const NavigationDisclosure = ({ children, defaultOpen }: NavigationDisclosureProps) => { + return ( + + {children} + + ); +}; + +NavigationDisclosure.Panel = NavigationDisclosurePanel; +NavigationDisclosure.Button = NavigationDisclosureButton; + +export { NavigationDisclosure }; diff --git a/src/components/navigation/navigation-group.tsx b/src/components/navigation/navigation-group.tsx new file mode 100644 index 00000000..f2c8e855 --- /dev/null +++ b/src/components/navigation/navigation-group.tsx @@ -0,0 +1,33 @@ +import React from "react"; +import { classNames } from "../../util/class-names"; + +export interface NavigationGroupItemProps { + children: React.ReactNode; + isActive?: boolean; + LeftIcon?: React.ElementType; +} + +const NavigationGroupItem = ({ children, isActive, LeftIcon }: NavigationGroupItemProps) => { + return ( +
+ {LeftIcon ? : null} + {children} + {isActive && ( +
+ )} +
+ ); +}; + +const NavigationGroup = ({ children }: { children: React.ReactNode }) => { + return
{children}
; +}; + +NavigationGroup.Item = NavigationGroupItem; + +export { NavigationGroup }; diff --git a/src/components/navigation/navigation.stories.tsx b/src/components/navigation/navigation.stories.tsx new file mode 100644 index 00000000..072eae61 --- /dev/null +++ b/src/components/navigation/navigation.stories.tsx @@ -0,0 +1,96 @@ +import type { Meta, StoryObj } from "@storybook/react"; +import React from "react"; +import { Navigation } from "./navigation"; +import { CogIcon, HelpIcon, InfoSignIcon } from "../../icons"; + +const meta: Meta = { + title: "Navigation", + component: Navigation, +}; + +export default meta; +type Story = StoryObj; + +export const Default: Story = { + render: () => ( +
+ + +
Abusix
+
+ +
+
+ ), +}; diff --git a/src/components/navigation/navigation.tsx b/src/components/navigation/navigation.tsx new file mode 100644 index 00000000..47706295 --- /dev/null +++ b/src/components/navigation/navigation.tsx @@ -0,0 +1,29 @@ +import React from "react"; +import { NavigationDisclosure } from "./navigation-disclosure"; +import { NavigationGroup } from "./navigation-group"; + +export interface NavigationLogoProps { + children: React.ReactNode; +} + +const NavigationLogo = ({ children }: NavigationLogoProps) => { + return
{children}
; +}; + +export interface NavigationProps { + children: React.ReactNode; +} + +const Navigation = ({ children }: NavigationProps) => { + return ( +
+ {children} +
+ ); +}; + +Navigation.Logo = NavigationLogo; +Navigation.Group = NavigationGroup; +Navigation.Disclosure = NavigationDisclosure; + +export { Navigation }; diff --git a/src/components/sidesheet/sidesheet.tsx b/src/components/sidesheet/sidesheet.tsx index 82ade1ca..06d11850 100644 --- a/src/components/sidesheet/sidesheet.tsx +++ b/src/components/sidesheet/sidesheet.tsx @@ -36,7 +36,7 @@ const Sidesheet = ({ children, isOpen, onClose, initialFocus }: SidesheetProps) leaveFrom="-translate-x-0" leaveTo="translate-x-full" > - + {children} diff --git a/tailwind.config.cjs b/tailwind.config.cjs index f2f47260..ab4b5a79 100644 --- a/tailwind.config.cjs +++ b/tailwind.config.cjs @@ -23,6 +23,9 @@ export default { 0: "#ffffff", }, primary: { + "900+20": '#1A276C', + "900+10": '#1E2C7A', + "900+8": '#1E2D7C', 900: "#213187", 800: "#2235AB", 700: "#223FD3", @@ -33,6 +36,7 @@ export default { 200: "#C1D5FC", 100: "#DCE7FD", 50: "#EFF4FF", + }, success: { 900: "#114335",