A design system in a box. hip-ui.tngl.io/docs/introduction
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

add headerlayout

+529 -64
+6 -9
apps/docs/src/components/footer/index.tsx
··· 8 8 9 9 import { Button } from "../button"; 10 10 import { TextField } from "../text-field"; 11 - import { 12 - breakpoints, 13 - containerBreakpoints, 14 - } from "../theme/media-queries.stylex"; 11 + import { containerBreakpoints } from "../theme/media-queries.stylex"; 15 12 import { ui } from "../theme/semantic-color.stylex"; 16 13 import { spacing } from "../theme/spacing.stylex"; 17 14 import { StyleXComponentProps } from "../theme/types"; ··· 28 25 containerType: "inline-size", 29 26 }, 30 27 footerSection: { 31 - maxWidth: "1280px", 28 + maxWidth: "var(--page-content-max-width)", 32 29 marginLeft: "auto", 33 30 marginRight: "auto", 34 31 paddingTop: spacing["6"], 35 32 paddingBottom: spacing["6"], 36 33 paddingLeft: { 37 - default: spacing["6"], 38 - [breakpoints.sm]: spacing["8"], 34 + default: spacing["4"], 35 + [containerBreakpoints.sm]: spacing["8"], 39 36 }, 40 37 paddingRight: { 41 - default: spacing["6"], 42 - [breakpoints.sm]: spacing["8"], 38 + default: spacing["4"], 39 + [containerBreakpoints.sm]: spacing["8"], 43 40 }, 44 41 display: "flex", 45 42 flexDirection: {
+113
apps/docs/src/components/header-layout/index.tsx
··· 1 + "use client"; 2 + 3 + import * as stylex from "@stylexjs/stylex"; 4 + 5 + import { spacing } from "../theme/spacing.stylex"; 6 + import { StyleXComponentProps } from "../theme/types"; 7 + import { uiColor } from "../theme/color.stylex"; 8 + import { containerBreakpoints } from "../theme/media-queries.stylex"; 9 + 10 + const styles = stylex.create({ 11 + root: { 12 + "--page-content-max-width": "1280px", 13 + minHeight: "100vh", 14 + display: "flex", 15 + flexDirection: "column", 16 + backgroundColor: uiColor.bg, 17 + containerType: "inline-size", 18 + width: "100cqw", 19 + }, 20 + header: { 21 + flexShrink: 0, 22 + }, 23 + page: { 24 + flexGrow: 1, 25 + minHeight: 0, 26 + paddingTop: { 27 + default: spacing["2"], 28 + [containerBreakpoints.sm]: spacing["6"], 29 + }, 30 + paddingBottom: { 31 + default: spacing["10"], 32 + [containerBreakpoints.sm]: spacing["12"], 33 + }, 34 + paddingLeft: { 35 + default: spacing["4"], 36 + [containerBreakpoints.sm]: spacing["8"], 37 + }, 38 + paddingRight: { 39 + default: spacing["4"], 40 + [containerBreakpoints.sm]: spacing["8"], 41 + }, 42 + maxWidth: "var(--page-content-max-width)", 43 + width: "100%", 44 + marginLeft: "auto", 45 + marginRight: "auto", 46 + boxSizing: "border-box", 47 + }, 48 + footer: { 49 + flexShrink: 0, 50 + }, 51 + }); 52 + 53 + /** 54 + * Header layout root component. Main container for the page layout. 55 + */ 56 + export interface HeaderLayoutRootProps 57 + extends StyleXComponentProps<React.ComponentProps<"div">> {} 58 + 59 + export const HeaderLayoutRoot = ({ 60 + style, 61 + ...props 62 + }: HeaderLayoutRootProps) => { 63 + return <div {...props} {...stylex.props(styles.root, style)} />; 64 + }; 65 + 66 + /** 67 + * Header layout header component. Slot for header content. 68 + */ 69 + export interface HeaderLayoutHeaderProps 70 + extends StyleXComponentProps<React.ComponentProps<"header">> {} 71 + 72 + export const HeaderLayoutHeader = ({ 73 + style, 74 + ...props 75 + }: HeaderLayoutHeaderProps) => { 76 + return <header {...props} {...stylex.props(styles.header, style)} />; 77 + }; 78 + 79 + /** 80 + * Header layout page component. Slot for main page content. 81 + */ 82 + export interface HeaderLayoutPageProps 83 + extends StyleXComponentProps<React.ComponentProps<"main">> {} 84 + 85 + export const HeaderLayoutPage = ({ 86 + style, 87 + ...props 88 + }: HeaderLayoutPageProps) => { 89 + return <main {...props} {...stylex.props(styles.page, style)} />; 90 + }; 91 + 92 + /** 93 + * Header layout footer component. Slot for footer content. 94 + */ 95 + export interface HeaderLayoutFooterProps 96 + extends StyleXComponentProps<React.ComponentProps<"footer">> {} 97 + 98 + export const HeaderLayoutFooter = ({ 99 + style, 100 + ...props 101 + }: HeaderLayoutFooterProps) => { 102 + return <footer {...props} {...stylex.props(styles.footer, style)} />; 103 + }; 104 + 105 + /** 106 + * Header layout component with subcomponents. 107 + */ 108 + export const HeaderLayout = { 109 + Root: HeaderLayoutRoot, 110 + Header: HeaderLayoutHeader, 111 + Page: HeaderLayoutPage, 112 + Footer: HeaderLayoutFooter, 113 + };
+38 -11
apps/docs/src/components/navbar/Navbar.tsx
··· 9 9 import { IconButton } from "../icon-button"; 10 10 import { Separator } from "../separator"; 11 11 import { primaryColor, uiColor } from "../theme/color.stylex"; 12 - import { containerBreakpoints } from "../theme/media-queries.stylex"; 12 + import { 13 + breakpoints, 14 + containerBreakpoints, 15 + } from "../theme/media-queries.stylex"; 13 16 import { ui } from "../theme/semantic-color.stylex"; 14 17 import { spacing } from "../theme/spacing.stylex"; 15 18 import { Size, StyleXComponentProps } from "../theme/types"; ··· 17 20 18 21 const styles = stylex.create({ 19 22 navbar: { 23 + maxWidth: "var(--page-content-max-width)", 20 24 "--separator-visibility": { 21 25 default: "none", 22 - ":is([data-navbar-open])": "flex", 26 + ":is([data-navbar-open]):has([data-navbar-action])": "flex", 23 27 ":has([data-always-visible])": "none", 24 28 [containerBreakpoints.sm]: "none", 25 29 }, ··· 34 38 ":is([data-navbar-open])": ` 35 39 "logo hamburger" 36 40 "navigation navigation" 41 + `, 42 + ":is([data-navbar-open]):has([data-navbar-action])": ` 43 + "logo hamburger" 44 + "navigation navigation" 37 45 "separator separator" 38 46 "action action" 39 47 `, ··· 45 53 "navigation navigation navigation" 46 54 "separator separator separator" 47 55 `, 48 - [containerBreakpoints.sm]: ` 49 - "logo navigation action" 50 - `, 56 + [containerBreakpoints.sm]: { 57 + default: ` 58 + "logo navigation" 59 + `, 60 + ":has([data-navbar-action])": ` 61 + "logo navigation action" 62 + `, 63 + }, 51 64 }, 52 65 overflow: { 53 66 ":is([data-navbar-open])": "auto", ··· 61 74 display: "grid", 62 75 gridTemplateColumns: { 63 76 default: "1fr auto", 64 - ":has([data-always-visible])": "1fr min-content min-content", 65 - [containerBreakpoints.sm]: "auto 1fr auto", 77 + ":has([data-always-visible]):not([data-navbar-action])": 78 + "1fr min-content min-content", 79 + [containerBreakpoints.sm]: { 80 + default: "1fr auto", 81 + ":has([data-navbar-action])": "auto 1fr auto", 82 + }, 66 83 }, 67 84 gridTemplateRows: { 68 - ":is([data-navbar-open])": `min-content min-content min-content min-content`, 85 + ":is([data-navbar-open])": `min-content min-content min-content`, 86 + ":is([data-navbar-open]):has([data-navbar-action])": `min-content min-content min-content min-content`, 69 87 }, 70 88 rowGap: spacing["8"], 71 89 zIndex: 1000, ··· 77 95 ":is([data-navbar-open])": "100%", 78 96 [containerBreakpoints.sm]: spacing["14"], 79 97 }, 80 - paddingBottom: spacing["3"], 81 - paddingLeft: spacing["4"], 82 - paddingRight: spacing["4"], 98 + paddingBottom: { 99 + default: spacing["3"], 100 + ":is([data-navbar-open]):has([data-navbar-action])": spacing["4"], 101 + }, 102 + paddingLeft: { 103 + default: spacing["4"], 104 + [containerBreakpoints.sm]: spacing["8"], 105 + }, 106 + paddingRight: { 107 + default: spacing["4"], 108 + [containerBreakpoints.sm]: spacing["8"], 109 + }, 83 110 paddingTop: spacing["3"], 84 111 top: 0, 85 112 width: "100%",
+47
apps/docs/src/docs/components/navigation/header-layout.mdx
··· 1 + --- 2 + title: HeaderLayout 3 + description: A flexible page layout component with unstyled slots for header, page content, and footer. 4 + --- 5 + 6 + import { PropDocs } from '../../../lib/PropDocs' 7 + import { Example } from '../../../lib/Example' 8 + import { Basic } from '../../../examples/header-layout/basic' 9 + import { WithFooter } from '../../../examples/header-layout/with-footer' 10 + import { Styled } from '../../../examples/header-layout/styled' 11 + 12 + <Example src={Styled} noPadding /> 13 + 14 + ## Installation 15 + 16 + Run the following command to add the header layout component to your project. 17 + 18 + ```bash 19 + pnpm hip install header-layout 20 + ``` 21 + 22 + ## Props 23 + 24 + This is a custom component built for page layouts with header, content, and footer slots. 25 + 26 + <PropDocs components={["HeaderLayoutRoot", "HeaderLayoutHeader", "HeaderLayoutPage", "HeaderLayoutFooter"]} /> 27 + 28 + ## Features 29 + 30 + ### Basic 31 + 32 + A simple page layout with header and page content slots. 33 + 34 + <Example src={Basic} noPadding /> 35 + 36 + ### With Footer 37 + 38 + Add a footer slot to your page layout. 39 + 40 + <Example src={WithFooter} noPadding /> 41 + 42 + ## Related Components 43 + 44 + - [Flex](/docs/components/flex) - For flexible layouts within slots 45 + - [Grid](/docs/components/grid) - For two-dimensional layouts within slots 46 + - [Navbar](/docs/components/navbar) - For navigation in the header slot 47 + - [Footer](/docs/components/footer) - For footer content in the footer slot
+1 -8
apps/docs/src/examples/footer/comprehensive.tsx
··· 67 67 <Footer.SubscribeDescription> 68 68 The latest news, articles, and resources, sent to your inbox weekly. 69 69 </Footer.SubscribeDescription> 70 - <Footer.SubscribeInput 71 - onSubmit={(e) => { 72 - const formData = new FormData(e.currentTarget); 73 - const email = formData.get("email"); 74 - alert(`Subscribed with: ${email}`); 75 - }} 76 - /> 70 + <Footer.SubscribeInput /> 77 71 </Footer.Subscribe> 78 72 </Footer.Section> 79 73 <Footer.Section> ··· 106 100 </Footer.Root> 107 101 ); 108 102 } 109 -
+1 -7
apps/docs/src/examples/footer/with-subscribe-horizontal.tsx
··· 19 19 <Footer.SubscribeDescription> 20 20 The latest news, articles, and resources, sent to your inbox weekly. 21 21 </Footer.SubscribeDescription> 22 - <Footer.SubscribeInput 23 - onSubmit={(e) => { 24 - const formData = new FormData(e.currentTarget); 25 - const email = formData.get("email"); 26 - alert(`Subscribed with: ${email}`); 27 - }} 28 - /> 22 + <Footer.SubscribeInput /> 29 23 </Footer.Subscribe> 30 24 </Footer.Section> 31 25 </Footer.Root>
+4 -9
apps/docs/src/examples/footer/with-subscribe-vertical.tsx
··· 13 13 <Footer.Root style={styles.footer}> 14 14 <Footer.Section> 15 15 <Footer.Subscribe variant="vertical"> 16 - <Footer.SubscribeTitle>Subscribe to our newsletter</Footer.SubscribeTitle> 16 + <Footer.SubscribeTitle> 17 + Subscribe to our newsletter 18 + </Footer.SubscribeTitle> 17 19 <Footer.SubscribeDescription> 18 20 The latest news, articles, and resources, sent to your inbox weekly. 19 21 </Footer.SubscribeDescription> 20 - <Footer.SubscribeInput 21 - onSubmit={(e) => { 22 - const formData = new FormData(e.currentTarget); 23 - const email = formData.get("email"); 24 - alert(`Subscribed with: ${email}`); 25 - }} 26 - /> 22 + <Footer.SubscribeInput /> 27 23 </Footer.Subscribe> 28 24 </Footer.Section> 29 25 </Footer.Root> 30 26 ); 31 27 } 32 -
+39
apps/docs/src/examples/header-layout/basic.tsx
··· 1 + import { HeaderLayout } from "@/components/header-layout"; 2 + import { Navbar, NavbarLogo, NavbarNavigation, NavbarLink } from "@/components/navbar"; 3 + 4 + function Logo() { 5 + return ( 6 + <svg 7 + width="32" 8 + height="32" 9 + viewBox="0 0 120 120" 10 + fill="currentColor" 11 + xmlns="http://www.w3.org/2000/svg" 12 + > 13 + <circle cx="60" cy="60" r="50" stroke="currentColor" strokeWidth="2" /> 14 + </svg> 15 + ); 16 + } 17 + 18 + export function Basic() { 19 + return ( 20 + <HeaderLayout.Root> 21 + <HeaderLayout.Header> 22 + <Navbar> 23 + <NavbarLogo> 24 + <Logo /> 25 + </NavbarLogo> 26 + <NavbarNavigation justify="right"> 27 + <NavbarLink href="/dashboard">Dashboard</NavbarLink> 28 + <NavbarLink href="/projects">Projects</NavbarLink> 29 + <NavbarLink href="/settings">Settings</NavbarLink> 30 + </NavbarNavigation> 31 + </Navbar> 32 + </HeaderLayout.Header> 33 + <HeaderLayout.Page> 34 + <h1>Page Content</h1> 35 + <p>This is the main page content area.</p> 36 + </HeaderLayout.Page> 37 + </HeaderLayout.Root> 38 + ); 39 + }
+58
apps/docs/src/examples/header-layout/styled.tsx
··· 1 + import { HeaderLayout } from "@/components/header-layout"; 2 + import { 3 + Navbar, 4 + NavbarLogo, 5 + NavbarNavigation, 6 + NavbarLink, 7 + } from "@/components/navbar"; 8 + import { Footer } from "@/components/footer"; 9 + 10 + function Logo() { 11 + return ( 12 + <svg 13 + width="32" 14 + height="32" 15 + viewBox="0 0 120 120" 16 + fill="currentColor" 17 + xmlns="http://www.w3.org/2000/svg" 18 + > 19 + <circle cx="60" cy="60" r="50" stroke="currentColor" strokeWidth="2" /> 20 + </svg> 21 + ); 22 + } 23 + 24 + export function Styled() { 25 + return ( 26 + <HeaderLayout.Root> 27 + <HeaderLayout.Header> 28 + <Navbar> 29 + <NavbarLogo> 30 + <Logo /> 31 + </NavbarLogo> 32 + <NavbarNavigation justify="right"> 33 + <NavbarLink href="/dashboard">Dashboard</NavbarLink> 34 + <NavbarLink href="/projects">Projects</NavbarLink> 35 + <NavbarLink href="/settings">Settings</NavbarLink> 36 + </NavbarNavigation> 37 + </Navbar> 38 + </HeaderLayout.Header> 39 + <HeaderLayout.Page> 40 + <h1>Page Content</h1> 41 + <p>This is the main page content area with default styling applied.</p> 42 + <p> 43 + The HeaderLayout component provides styled slots that work out of the 44 + box, but you can override styles as needed. 45 + </p> 46 + </HeaderLayout.Page> 47 + <HeaderLayout.Footer> 48 + <Footer.Root isCentered> 49 + <Footer.Section> 50 + <Footer.Copyright> 51 + © 2025 Company Name. All rights reserved. 52 + </Footer.Copyright> 53 + </Footer.Section> 54 + </Footer.Root> 55 + </HeaderLayout.Footer> 56 + </HeaderLayout.Root> 57 + ); 58 + }
+50
apps/docs/src/examples/header-layout/with-footer.tsx
··· 1 + import { HeaderLayout } from "@/components/header-layout"; 2 + import { Navbar, NavbarLogo, NavbarNavigation, NavbarLink } from "@/components/navbar"; 3 + import { Footer } from "@/components/footer"; 4 + 5 + function Logo() { 6 + return ( 7 + <svg 8 + width="32" 9 + height="32" 10 + viewBox="0 0 120 120" 11 + fill="currentColor" 12 + xmlns="http://www.w3.org/2000/svg" 13 + > 14 + <circle cx="60" cy="60" r="50" stroke="currentColor" strokeWidth="2" /> 15 + </svg> 16 + ); 17 + } 18 + 19 + export function WithFooter() { 20 + return ( 21 + <HeaderLayout.Root> 22 + <HeaderLayout.Header> 23 + <Navbar> 24 + <NavbarLogo> 25 + <Logo /> 26 + </NavbarLogo> 27 + <NavbarNavigation justify="right"> 28 + <NavbarLink href="/dashboard">Dashboard</NavbarLink> 29 + <NavbarLink href="/projects">Projects</NavbarLink> 30 + <NavbarLink href="/settings">Settings</NavbarLink> 31 + </NavbarNavigation> 32 + </Navbar> 33 + </HeaderLayout.Header> 34 + <HeaderLayout.Page> 35 + <h1>Page Content</h1> 36 + <p>This is the main page content area.</p> 37 + </HeaderLayout.Page> 38 + <HeaderLayout.Footer> 39 + <Footer.Root> 40 + <Footer.Section> 41 + <Footer.Copyright> 42 + © 2025 Company Name. All rights reserved. 43 + </Footer.Copyright> 44 + </Footer.Section> 45 + </Footer.Root> 46 + </HeaderLayout.Footer> 47 + </HeaderLayout.Root> 48 + ); 49 + } 50 +
+2
packages/hip-ui/src/cli/install.tsx
··· 43 43 import { footerConfig } from "../components/footer/footer-config.js"; 44 44 import { formConfig } from "../components/form/form-config.js"; 45 45 import { gridConfig } from "../components/grid/grid-config.js"; 46 + import { headerLayoutConfig } from "../components/header-layout/header-layout-config.js"; 46 47 import { hoverCardConfig } from "../components/hover-card/hover-card-config.js"; 47 48 import { iconButtonConfig } from "../components/icon-button/icon-button-config.js"; 48 49 import { kbdConfig } from "../components/kbd/kbd-config.js"; ··· 138 139 fileDropZoneConfig, 139 140 footerConfig, 140 141 formConfig, 142 + headerLayoutConfig, 141 143 tableConfig, 142 144 sliderConfig, 143 145 tagGroupConfig,
+6 -9
packages/hip-ui/src/components/footer/index.tsx
··· 8 8 9 9 import { Button } from "../button"; 10 10 import { TextField } from "../text-field"; 11 - import { 12 - breakpoints, 13 - containerBreakpoints, 14 - } from "../theme/media-queries.stylex"; 11 + import { containerBreakpoints } from "../theme/media-queries.stylex"; 15 12 import { ui } from "../theme/semantic-color.stylex"; 16 13 import { spacing } from "../theme/spacing.stylex"; 17 14 import { StyleXComponentProps } from "../theme/types"; ··· 28 25 containerType: "inline-size", 29 26 }, 30 27 footerSection: { 31 - maxWidth: "1280px", 28 + maxWidth: "var(--page-content-max-width)", 32 29 marginLeft: "auto", 33 30 marginRight: "auto", 34 31 paddingTop: spacing["6"], 35 32 paddingBottom: spacing["6"], 36 33 paddingLeft: { 37 - default: spacing["6"], 38 - [breakpoints.sm]: spacing["8"], 34 + default: spacing["4"], 35 + [containerBreakpoints.sm]: spacing["8"], 39 36 }, 40 37 paddingRight: { 41 - default: spacing["6"], 42 - [breakpoints.sm]: spacing["8"], 38 + default: spacing["4"], 39 + [containerBreakpoints.sm]: spacing["8"], 43 40 }, 44 41 display: "flex", 45 42 flexDirection: {
+13
packages/hip-ui/src/components/header-layout/header-layout-config.ts
··· 1 + import { ComponentConfig } from "../../types"; 2 + 3 + export const headerLayoutConfig: ComponentConfig = { 4 + name: "header-layout", 5 + filepath: "./index.tsx", 6 + hipDependencies: [ 7 + "../theme/spacing.stylex.tsx", 8 + "../theme/color.stylex.tsx", 9 + "../theme/types.ts", 10 + ], 11 + dependencies: {}, 12 + }; 13 +
+113
packages/hip-ui/src/components/header-layout/index.tsx
··· 1 + "use client"; 2 + 3 + import * as stylex from "@stylexjs/stylex"; 4 + 5 + import { spacing } from "../theme/spacing.stylex"; 6 + import { StyleXComponentProps } from "../theme/types"; 7 + import { uiColor } from "../theme/color.stylex"; 8 + import { containerBreakpoints } from "../theme/media-queries.stylex"; 9 + 10 + const styles = stylex.create({ 11 + root: { 12 + "--page-content-max-width": "1280px", 13 + minHeight: "100vh", 14 + display: "flex", 15 + flexDirection: "column", 16 + backgroundColor: uiColor.bg, 17 + containerType: "inline-size", 18 + width: "100cqw", 19 + }, 20 + header: { 21 + flexShrink: 0, 22 + }, 23 + page: { 24 + flexGrow: 1, 25 + minHeight: 0, 26 + paddingTop: { 27 + default: spacing["2"], 28 + [containerBreakpoints.sm]: spacing["6"], 29 + }, 30 + paddingBottom: { 31 + default: spacing["10"], 32 + [containerBreakpoints.sm]: spacing["12"], 33 + }, 34 + paddingLeft: { 35 + default: spacing["4"], 36 + [containerBreakpoints.sm]: spacing["8"], 37 + }, 38 + paddingRight: { 39 + default: spacing["4"], 40 + [containerBreakpoints.sm]: spacing["8"], 41 + }, 42 + maxWidth: "var(--page-content-max-width)", 43 + width: "100%", 44 + marginLeft: "auto", 45 + marginRight: "auto", 46 + boxSizing: "border-box", 47 + }, 48 + footer: { 49 + flexShrink: 0, 50 + }, 51 + }); 52 + 53 + /** 54 + * Header layout root component. Main container for the page layout. 55 + */ 56 + export interface HeaderLayoutRootProps 57 + extends StyleXComponentProps<React.ComponentProps<"div">> {} 58 + 59 + export const HeaderLayoutRoot = ({ 60 + style, 61 + ...props 62 + }: HeaderLayoutRootProps) => { 63 + return <div {...props} {...stylex.props(styles.root, style)} />; 64 + }; 65 + 66 + /** 67 + * Header layout header component. Slot for header content. 68 + */ 69 + export interface HeaderLayoutHeaderProps 70 + extends StyleXComponentProps<React.ComponentProps<"header">> {} 71 + 72 + export const HeaderLayoutHeader = ({ 73 + style, 74 + ...props 75 + }: HeaderLayoutHeaderProps) => { 76 + return <header {...props} {...stylex.props(styles.header, style)} />; 77 + }; 78 + 79 + /** 80 + * Header layout page component. Slot for main page content. 81 + */ 82 + export interface HeaderLayoutPageProps 83 + extends StyleXComponentProps<React.ComponentProps<"main">> {} 84 + 85 + export const HeaderLayoutPage = ({ 86 + style, 87 + ...props 88 + }: HeaderLayoutPageProps) => { 89 + return <main {...props} {...stylex.props(styles.page, style)} />; 90 + }; 91 + 92 + /** 93 + * Header layout footer component. Slot for footer content. 94 + */ 95 + export interface HeaderLayoutFooterProps 96 + extends StyleXComponentProps<React.ComponentProps<"footer">> {} 97 + 98 + export const HeaderLayoutFooter = ({ 99 + style, 100 + ...props 101 + }: HeaderLayoutFooterProps) => { 102 + return <footer {...props} {...stylex.props(styles.footer, style)} />; 103 + }; 104 + 105 + /** 106 + * Header layout component with subcomponents. 107 + */ 108 + export const HeaderLayout = { 109 + Root: HeaderLayoutRoot, 110 + Header: HeaderLayoutHeader, 111 + Page: HeaderLayoutPage, 112 + Footer: HeaderLayoutFooter, 113 + };
+38 -11
packages/hip-ui/src/components/navbar/Navbar.tsx
··· 9 9 import { IconButton } from "../icon-button"; 10 10 import { Separator } from "../separator"; 11 11 import { primaryColor, uiColor } from "../theme/color.stylex"; 12 - import { containerBreakpoints } from "../theme/media-queries.stylex"; 12 + import { 13 + breakpoints, 14 + containerBreakpoints, 15 + } from "../theme/media-queries.stylex"; 13 16 import { ui } from "../theme/semantic-color.stylex"; 14 17 import { spacing } from "../theme/spacing.stylex"; 15 18 import { Size, StyleXComponentProps } from "../theme/types"; ··· 17 20 18 21 const styles = stylex.create({ 19 22 navbar: { 23 + maxWidth: "var(--page-content-max-width)", 20 24 "--separator-visibility": { 21 25 default: "none", 22 - ":is([data-navbar-open])": "flex", 26 + ":is([data-navbar-open]):has([data-navbar-action])": "flex", 23 27 ":has([data-always-visible])": "none", 24 28 [containerBreakpoints.sm]: "none", 25 29 }, ··· 34 38 ":is([data-navbar-open])": ` 35 39 "logo hamburger" 36 40 "navigation navigation" 41 + `, 42 + ":is([data-navbar-open]):has([data-navbar-action])": ` 43 + "logo hamburger" 44 + "navigation navigation" 37 45 "separator separator" 38 46 "action action" 39 47 `, ··· 45 53 "navigation navigation navigation" 46 54 "separator separator separator" 47 55 `, 48 - [containerBreakpoints.sm]: ` 49 - "logo navigation action" 50 - `, 56 + [containerBreakpoints.sm]: { 57 + default: ` 58 + "logo navigation" 59 + `, 60 + ":has([data-navbar-action])": ` 61 + "logo navigation action" 62 + `, 63 + }, 51 64 }, 52 65 overflow: { 53 66 ":is([data-navbar-open])": "auto", ··· 61 74 display: "grid", 62 75 gridTemplateColumns: { 63 76 default: "1fr auto", 64 - ":has([data-always-visible])": "1fr min-content min-content", 65 - [containerBreakpoints.sm]: "auto 1fr auto", 77 + ":has([data-always-visible]):not([data-navbar-action])": 78 + "1fr min-content min-content", 79 + [containerBreakpoints.sm]: { 80 + default: "1fr auto", 81 + ":has([data-navbar-action])": "auto 1fr auto", 82 + }, 66 83 }, 67 84 gridTemplateRows: { 68 - ":is([data-navbar-open])": `min-content min-content min-content min-content`, 85 + ":is([data-navbar-open])": `min-content min-content min-content`, 86 + ":is([data-navbar-open]):has([data-navbar-action])": `min-content min-content min-content min-content`, 69 87 }, 70 88 rowGap: spacing["8"], 71 89 zIndex: 1000, ··· 77 95 ":is([data-navbar-open])": "100%", 78 96 [containerBreakpoints.sm]: spacing["14"], 79 97 }, 80 - paddingBottom: spacing["3"], 81 - paddingLeft: spacing["4"], 82 - paddingRight: spacing["4"], 98 + paddingBottom: { 99 + default: spacing["3"], 100 + ":is([data-navbar-open]):has([data-navbar-action])": spacing["4"], 101 + }, 102 + paddingLeft: { 103 + default: spacing["4"], 104 + [containerBreakpoints.sm]: spacing["8"], 105 + }, 106 + paddingRight: { 107 + default: spacing["4"], 108 + [containerBreakpoints.sm]: spacing["8"], 109 + }, 83 110 paddingTop: spacing["3"], 84 111 top: 0, 85 112 width: "100%",