Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
2e90bb8
Hardening
benjaminleonard Sep 23, 2025
4f7bcf1
Update deps
benjaminleonard Sep 23, 2025
a4ddad3
Fmt
benjaminleonard Sep 23, 2025
b0b7bf2
Fmt
benjaminleonard Sep 23, 2025
83dc9f3
Update to new shiki
benjaminleonard Sep 23, 2025
edb090c
Upgraded style dictionary
benjaminleonard Sep 23, 2025
21e813b
Update README.md
benjaminleonard Sep 23, 2025
3a9a967
Merge branch 'master' into hardening
benjaminleonard Sep 23, 2025
ab94ba5
Update release.yml
benjaminleonard Sep 23, 2025
c29ff72
Update themes from token file [ci skip]
github-actions[bot] Sep 23, 2025
ea661d1
Don't add `ci skip` to bot commits (bypassing protections)
benjaminleonard Sep 23, 2025
0d3d78d
Merge branch 'hardening' of github.com:oxidecomputer/design-system in…
benjaminleonard Sep 23, 2025
7889912
Exit if committed and release that bot commit instead
benjaminleonard Sep 23, 2025
10b5d72
Try splitting into two workflows (env only for release)
benjaminleonard Sep 23, 2025
e905378
Update themes from token file
github-actions[bot] Sep 23, 2025
436a7fc
Run on all pushes
benjaminleonard Sep 23, 2025
65ef59b
Merge branch 'hardening' of github.com:oxidecomputer/design-system in…
benjaminleonard Sep 23, 2025
e7188fc
Update themes from token file
github-actions[bot] Sep 23, 2025
71fc75e
Revert to single job for commit and release
benjaminleonard Sep 23, 2025
b3eca8e
Update themes from token file
github-actions[bot] Sep 23, 2025
d9d7110
Fix if else typo
benjaminleonard Sep 23, 2025
cd6ef20
Update themes from token file
github-actions[bot] Sep 23, 2025
275c571
Fmt
benjaminleonard Sep 23, 2025
b9a44a2
Alpha decimals
benjaminleonard Sep 23, 2025
8ac144f
Update themes from token file
github-actions[bot] Sep 23, 2025
7007247
Bump commit
benjaminleonard Sep 23, 2025
18278f0
Allow null ref on delegated links
benjaminleonard Sep 24, 2025
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
20 changes: 0 additions & 20 deletions .eslintrc

This file was deleted.

32 changes: 0 additions & 32 deletions .github/workflows/check-release.yml

This file was deleted.

13 changes: 0 additions & 13 deletions .github/workflows/license-check.yaml

This file was deleted.

67 changes: 51 additions & 16 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,46 +1,81 @@
name: Release

on: [push]
on:
push:
branches: [main]
pull_request:
types: [opened, synchronize, reopened]

# Enabled permissions on GITHUB_TOKEN
permissions:
# To be able to push to the repo
contents: write
# To update the pr description with canary info
pull-requests: write
# For pr-check to create a status
statuses: write
# Needed to create PR statuses/checks
checks: write
# To post comments on PRs
issues: write
# For trusted publishing
id-token: write

jobs:
release:
validate-labels:
runs-on: ubuntu-latest
if:
"!contains(github.event.head_commit.message, 'ci skip') &&
!contains(github.event.head_commit.message, 'skip ci')"
permissions:
pull-requests: write
contents: write
steps:
- uses: actions/checkout@v5
- run: git fetch --unshallow --tags

- name: Use Node.js 22.x
uses: actions/setup-node@v4
- uses: actions/setup-node@v5
with:
node-version: 22.x
cache: npm
- run: npm install
- name: Verify Release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run:
npx auto pr-check
--url=https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID

- name: Install dependencies
run: npm install
release:
runs-on: ubuntu-latest
environment: production
if: |
!contains(github.event.head_commit.message, 'ci skip') &&
!contains(github.event.head_commit.message, 'skip ci')
steps:
- uses: actions/checkout@v5
with:
ref: ${{ github.head_ref || github.ref_name }}
- run: git fetch --unshallow --tags
- uses: actions/setup-node@v5
with:
node-version: 22.x
cache: npm
- run: npm install
- run: npm install -g npm@latest

- name: Build
run: npm run build

- name: Commit theme changes if needed
- name: Check theme changes
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add ./styles/dist
if ! git diff --staged --quiet; then
git commit -m "Update themes from token file [ci skip]"
git commit -m "Update themes from token file"
git push
else
echo "No changes to commit"
echo "No theme changes detected. Continuing with release."
fi

- name: Create Release
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm run release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 3 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
CHANGELOG.md
**/*.json
*.md
*.css
6 changes: 2 additions & 4 deletions .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
"semi": false,
"singleQuote": true,
"trailingComma": "all",
"plugins": ["./node_modules/@trivago/prettier-plugin-sort-imports"],
"importOrder": ["^~/(.*)$", "^[./]"],
"importOrderSeparation": true,
"importOrderSortSpecifiers": true
"plugins": ["@ianvs/prettier-plugin-sort-imports", "prettier-plugin-tailwindcss"],
"importOrder": ["^~/(.*)$", "", "^[./]"]
}
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,7 @@ For more information checkout [auto's docs](https://intuit.github.io/auto/docs).

To ensure consistency between our designs and implementation we use the
[Design Tokens Plugin](https://www.figma.com/community/plugin/888356646278934516/Design-Tokens)
inside of figma to export a [json tokens file](styles/src/tokens.json) to the repo. When
that file is changed the [build-themes](.github/workflows/build-themes.yaml) workflow runs
to generate theme stylesheets, a tailwind token file, and other artifacts in
[dist](styles/dist/).
inside of figma to export a [json tokens file](styles/src/tokens.json) to the repo. The user can then run `npm run build` to generate theme files. This is not automatic, the user should then commit the changes.

The design tokens plugin is two way so token changes made in the json file can be synced
back with figma.
Expand All @@ -46,7 +43,6 @@ icon component as shown below:

```tsx
import { type Icon as IconType } from '@oxide/design-system/icons'

// Cannot be imported through '@oxide/design-system'
import sprite from '../../node_modules/@oxide/design-system/icons/sprite.svg'

Expand Down
2 changes: 1 addition & 1 deletion components/src/asciidoc/Admonition.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*
* Copyright Oxide Computer Company
*/
import { type AdmonitionBlock, Content, Title, parse } from '@oxide/react-asciidoc'
import { Content, parse, Title, type AdmonitionBlock } from '@oxide/react-asciidoc'

import { titleCase } from '../utils'

Expand Down
6 changes: 3 additions & 3 deletions components/src/asciidoc/Section.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
* Copyright Oxide Computer Company
*/
import { Link16Icon } from '@/icons/react'
import { Content, type SectionBlock, parse } from '@oxide/react-asciidoc'
import { Content, parse, type SectionBlock } from '@oxide/react-asciidoc'
import cn from 'classnames'
import { type JSX, createElement } from 'react'
import { createElement, type JSX } from 'react'

// We need to remove anchors from the section title (and table of contents) because having
// an anchor within an anchor causes a client/server render mismatch
Expand All @@ -26,7 +26,7 @@ const Section = ({ node }: { node: SectionBlock }) => {
<span className="anchor" id={node.id || ''} aria-hidden="true" />
<a className="link group" href={`#${node.id}`}>
{parse(stripAnchors(node.title))}
<Link16Icon className="ml-2 hidden text-accent-secondary group-hover:inline-block" />
<Link16Icon className="text-accent-secondary ml-2 hidden group-hover:inline-block" />
</a>
</>
)
Expand Down
14 changes: 7 additions & 7 deletions components/src/asciidoc/TableOfContents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Copyright Oxide Computer Company
*/
import { DirectionRightIcon } from '@/icons/react'
import { type DocumentSection, parse } from '@oxide/react-asciidoc'
import { parse, type DocumentSection } from '@oxide/react-asciidoc'
import * as Accordion from '@radix-ui/react-accordion'
import cn from 'classnames'
import { Fragment, useCallback, useEffect, useMemo, useRef, useState } from 'react'
Expand Down Expand Up @@ -271,7 +271,7 @@ export const DesktopOutline = ({
<Fragment key={item.id}>
<li
data-level={item.level}
className={cn('mb-0 list-none text-sans-sm', item.level > 2 && 'hidden')}
className={cn('text-sans-sm mb-0 list-none', item.level > 2 && 'hidden')}
>
<a
href={`#${item.id}`}
Expand Down Expand Up @@ -315,7 +315,7 @@ export const SmallScreenOutline = ({
<Fragment key={item.id}>
<li
data-level={item.level}
className={cn('list-none text-sans-sm', item.level > 2 && 'hidden')}
className={cn('text-sans-sm list-none', item.level > 2 && 'hidden')}
>
<a
href={`#${item.id}`}
Expand Down Expand Up @@ -343,7 +343,7 @@ export const SmallScreenOutline = ({
<Accordion.Root
type="single"
className={cn(
'toc sticky top-[calc(var(--header-height)-1px)] z-10 -mt-px mb-10 block w-full border-b border-t bg-default border-secondary print:hidden',
'toc bg-default border-secondary sticky top-[calc(var(--header-height)-1px)] z-10 -mt-px mb-10 block w-full border-b border-t print:hidden',
className,
)}
collapsible
Expand All @@ -352,13 +352,13 @@ export const SmallScreenOutline = ({
>
<Accordion.Item value="toc">
<Accordion.Header>
<Accordion.Trigger className="flex h-12 w-full items-center justify-between text-sans-md text-default hover:bg-hover px-(--container-px) [&>svg]:data-[state=open]:rotate-90">
<Accordion.Trigger className="text-sans-md text-default hover:bg-hover px-(--container-px) flex h-12 w-full items-center justify-between [&>svg]:data-[state=open]:rotate-90">
Table of Contents{' '}
<DirectionRightIcon className="transition-all text-tertiary" />
<DirectionRightIcon className="text-tertiary transition-all" />
</Accordion.Trigger>
</Accordion.Header>

<Accordion.Content className="animated-accordion hydrated max-h-[60vh] overflow-y-scroll w-full border-t border-secondary px-(--container-px)">
<Accordion.Content className="animated-accordion hydrated border-secondary px-(--container-px) max-h-[60vh] w-full overflow-y-scroll border-t">
<div className="py-4">{renderToc(toc)}</div>
</Accordion.Content>
</Accordion.Item>
Expand Down
2 changes: 1 addition & 1 deletion components/src/asciidoc/use-delegated-links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function useDelegatedReactRouterLinks(
// this is to avoid a dependency on remix/react router
/** Pass in the result of `useNavigate()` in the calling application. */
navigate: (to: To) => void,
nodeRef: React.RefObject<HTMLElement>,
nodeRef: React.RefObject<HTMLElement | null>,
key: string,
) {
useEffect(() => {
Expand Down
6 changes: 3 additions & 3 deletions components/src/asciidoc/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ import {
processDocument,
} from '@oxide/react-asciidoc'
import {
bundledLanguages,
createHighlighter,
type BundledLanguage,
type BundledTheme,
type HighlighterGeneric,
type LanguageInput,
bundledLanguages,
getHighlighter,
} from 'shiki'

import oxqlLang from './langs/oxql.tmLanguage.json'
Expand All @@ -42,7 +42,7 @@ async function getOrCreateHighlighter() {
...oxqlLang,
})

highlighter = await getHighlighter({
highlighter = await createHighlighter({
themes: [theme],
langs: langs,
})
Expand Down
4 changes: 2 additions & 2 deletions components/src/assets/button.css
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ label {
}

&.btn-ghost {
@apply text-secondary hover:bg-hover disabled:bg-transparent disabled:text-disabled;
@apply text-secondary hover:bg-hover disabled:text-disabled disabled:bg-transparent;
}
&.btn-ghost:after {
@apply text-neutral-300 opacity-100;
}

&.btn-accent-ghost {
@apply border text-accent border-accent-secondary hover:bg-accent-secondary-hover;
@apply text-accent border-accent-secondary hover:bg-accent-secondary-hover border;
}

&.btn-accent-ghost:after {
Expand Down
9 changes: 4 additions & 5 deletions components/src/assets/tabs.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,20 @@
}

.ox-tabs-list:after {
@apply block w-full border-b border-secondary;
@apply border-secondary block w-full border-b;
content: ' ';
}
.ox-tabs.full-width .ox-tabs-list:before {
@apply block w-10 min-w-max flex-shrink-0 border-b border-secondary;
@apply border-secondary block w-10 min-w-max flex-shrink-0 border-b;
content: ' ';
}

.ox-tabs-panel:focus-visible {
@apply outline outline-2 outline-offset-[1rem] outline-accent-secondary;
@apply outline-accent-secondary outline outline-2 outline-offset-[1rem];
}

.ox-tab {
@apply h-10 space-x-2 whitespace-nowrap border-b px-1.5 pb-1 pt-2
uppercase !no-underline text-mono-sm text-tertiary border-secondary;
@apply text-mono-sm text-tertiary border-secondary h-10 space-x-2 whitespace-nowrap border-b px-1.5 pb-1 pt-2 uppercase !no-underline;
}

.ox-tab[data-state='active'],
Expand Down
2 changes: 1 addition & 1 deletion components/src/ui/badge/Badge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export const Badge = ({
className={cn(
'ox-badge ring ring-inset',
`variant-${variant}`,
'inline-flex h-4 items-center whitespace-nowrap rounded-sm px-[3px] py-[1px] uppercase text-mono-sm',
'text-mono-sm inline-flex h-4 items-center whitespace-nowrap rounded-sm px-[3px] py-[1px] uppercase',
badgeColors[variant][color],
className,
)}
Expand Down
4 changes: 2 additions & 2 deletions components/src/ui/checkbox/Checkbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import cn from 'classnames'
import { classed } from '../../utils'

const Check = () => (
<Checkmark12Icon className="pointer-events-none absolute left-0.5 top-0.5 h-3 w-3 fill-current text-accent" />
<Checkmark12Icon className="text-accent pointer-events-none absolute left-0.5 top-0.5 h-3 w-3 fill-current" />
)

const Indeterminate = classed.div`absolute w-2 h-0.5 left-1 top-[7px] bg-accent pointer-events-none`
Expand Down Expand Up @@ -57,6 +57,6 @@ export const Checkbox = ({
{indeterminate && <Indeterminate />}
</span>

{children && <span className="ml-2.5 text-sans-md text-secondary">{children}</span>}
{children && <span className="text-sans-md text-secondary ml-2.5">{children}</span>}
</label>
)
Loading
Loading