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
2 changes: 2 additions & 0 deletions dictionary-octopus.txt
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ inetmgr
inetsrv
inkey
inlinable
inlines
INSTALLLOCATION
internalcustomer
ioutil
Expand Down Expand Up @@ -634,6 +635,7 @@ windir
windowsfeatures
Wireshark
WIXUI
wordmark
workerpool
workerpools
workertools
Expand Down
4 changes: 4 additions & 0 deletions src/assets/octopus-logo-v2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion src/components/Button.astro
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ type Props = HTMLAttributes<'button'> & {
icon?: string; // URL to an SVG or a FontAwesome class
iconEnd?: string; // URL to an SVG or a FontAwesome class
size?: 'xSmall' | 'small' | 'medium';
importance?: 'default' | 'loud';
};

const {
label,
icon,
iconEnd,
size = 'medium',
importance = 'default',
disabled = false,
type = 'button',
class: className,
Expand All @@ -24,7 +26,7 @@ if (!label && !rest['aria-label'] && !rest['aria-labelledby']) {
throw new Error('An icon-only button needs an aria-label for screen readers');
}

const classes = `btn btn--${size.toLowerCase()}${className ? ` ${className}` : ''}`;
const classes = `btn btn--${size.toLowerCase()}${importance === 'loud' ? ' btn--loud' : ''}${className ? ` ${className}` : ''}`;
---

<button class={classes} type={type} disabled={disabled} {...rest}>
Expand Down
56 changes: 56 additions & 0 deletions src/components/TopNav.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
import Logo from '../assets/octopus-logo-v2.svg';
import Button from './Button.astro';

type Props = {
active?: string;
links?: { label: string; href: string }[];
};

// TODO: Make these real links
const {
active = 'Docs',
links = [
{ label: 'Docs', href: '#' },
{ label: 'Learn', href: '#' },
{ label: 'API', href: '#' },
{ label: 'CLI', href: '#' },
],
} = Astro.props;
---

<header class="top-nav">
<div class="top-nav__leading">
<a
class="top-nav__logo"
href="https://octopus.com"
aria-label="Octopus Deploy"
>
<Logo class="top-nav__logo-mark" aria-hidden="true" />
</a>
<nav class="top-nav__links" aria-label="Sections">
{
links.map(({ label, href }) => (
<a
class:list={[
'top-nav__link',
label === active && 'top-nav__link--active',
]}
href={href}
aria-current={label === active ? 'page' : undefined}
>
{label}
</a>
))
}
</nav>
</div>
<div class="top-nav__trailing">
<!-- All of these are just non-functional and for visual/presentation only at this stage -->
<Button icon="fa-regular fa-moon" aria-label="Switch to dark theme" />

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I expected fa-regular fa-moon to be the outline like their website says, but it's exactly the same as solid 🤔 Not sure why, but I'm just leaving this as a placeholder for now anyhow, as I'm just trying to get the layout right at this early stage.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have just had an icon, that wasn't on the free fontawesome fonts, i opted to just copy the svg from design-system-icons

https://www.octopus.design/latest/foundations/icons/system-icons-upsPwkne

it has a moon there too, I just opened up a new claude in octopusdeploy repo and got it to write the prompt for me and extract the code, you can do a better prompt but for berevity this prompt gave me the exact svg and the instructions to implement

I need to use a u design-system-icons from here specifically the link-on icon, however the website doesnt support react and it uses css by js, for now i just want the one icon but we will look at other ways to get it, for the single icon how can i easily get the link-on in my astro html css js website? https://www.npmjs.com/package/@octopusdeploy/design-system-icons  (thats the package enerated by this repo's package)

<!-- TODO: Presumably at least some of these buttons should be <a> rather than <button> in practice, which isn't possible just yet -->
<Button label="Changelog" />
<Button label="Sign in" />
<Button label="Start for free" importance="loud" />
</div>
</header>
37 changes: 35 additions & 2 deletions src/pages/components.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import IconTile from 'src/components/IconTile.astro';
import Image from 'src/components/Image.astro';
import Link from 'src/components/Link.astro';
import Separator from 'src/components/Separator.astro';
import TopNav from 'src/components/TopNav.astro';

## Component Usage Guide

Expand Down Expand Up @@ -46,8 +47,9 @@ The Button component renders an HTML `<button>`.
1. **label**: Optional text label. Omit for an icon-only button.
2. **icon** / **iconEnd**: Optional leading and/or trailing icon. Accepts a FontAwesome class (e.g. `iconEnd="fa-solid fa-caret-down"` for a dropdown button) or a URL to an SVG.
3. **size**: Optional: `medium` (default), `small`, or `xSmall`.
4. **disabled**: Optional `true`/`false`
5. **type**: Optional: `button` (default), `submit`, or `reset`.
4. **importance**: Optional: `default` or `loud`
5. **disabled**: Optional `true`/`false`
6. **type**: Optional: `button` (default), `submit`, or `reset`.

An icon-only button has no visible text, so include an `aria-label` to give it an accessible name.

Expand Down Expand Up @@ -144,6 +146,37 @@ An icon-only button has no visible text, so include an `aria-label` to give it a
</div>
</div>

### TopNav

Temporary showcase for the new, work-in-progress TopNav component.

{
// Temporary hack: the nav needs more width than the cap on this page's main column, so the column takes the grid's
// leftover space and everything except the nav is held back at the width the column normally maxes out at
}
<style>{`
@media (min-width: 1131px) {
.content-group {
grid-template-columns: var(--navigation-width) minmax(0, 1fr) var(--toc-width);
}

main > :not(article),
article > :not(.page-content),
.page-content > :not(.top-nav-showcase) {
max-width: var(--content-width-article);
margin-inline: auto;
}
}

.top-nav-showcase {
overflow-x: auto;
}
`}</style>

<div class="top-nav-showcase">
<TopNav />
</div>

### Card

The Card component displays content in a card format, suitable for highlights, features, or related topics.
Expand Down
Loading
Loading