Skip to content

Commit

Permalink
Merge pull request #38 from oxidecomputer/p3-color-test
Browse files Browse the repository at this point in the history
New approach to wide gamut colour
  • Loading branch information
benjaminleonard authored Jul 27, 2023
2 parents 7250abd + a11788c commit fea1d6d
Show file tree
Hide file tree
Showing 19 changed files with 2,725 additions and 111 deletions.
5 changes: 0 additions & 5 deletions .figmaexportrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,6 @@ module.exports = {
basename = `carat-${basename.split('=')[1].toLowerCase()}-12`
}

// Update distro icon names to match what's in figma
if (dirname === 'distro') {
return `distro-${basename}.svg`
}

// Add the icon's size category as a postfix, if present
if (!isNaN(parseInt(dirname))) {
return `${basename}-${dirname}.svg`
Expand Down
8 changes: 4 additions & 4 deletions components/dist/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ declare const Badge: ({ className, children, color, variant, }: BadgeProps) => r

declare const buttonSizes: readonly ["sm", "icon", "base"];
declare const variants: readonly ["primary", "secondary", "ghost", "danger"];
type ButtonSize = (typeof buttonSizes)[number];
type Variant = (typeof variants)[number];
type ButtonSize = typeof buttonSizes[number];
type Variant = typeof variants[number];
type ButtonStyleProps = {
size?: ButtonSize;
variant?: Variant;
Expand All @@ -45,8 +45,8 @@ declare const Button: react.ForwardRefExoticComponent<Omit<ButtonProps, "ref"> &

declare const spinnerSizes: readonly ["base", "lg"];
declare const spinnerVariants: readonly ["primary", "secondary", "ghost", "danger"];
type SpinnerSize = (typeof spinnerSizes)[number];
type SpinnerVariant = (typeof spinnerVariants)[number];
type SpinnerSize = typeof spinnerSizes[number];
type SpinnerVariant = typeof spinnerVariants[number];
interface SpinnerProps {
className?: string;
size?: SpinnerSize;
Expand Down
2 changes: 1 addition & 1 deletion components/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -58782,7 +58782,7 @@ var import_jsx_runtime = require("react/jsx-runtime");
var Admonition = ({ node }) => {
const attrs = node.getAttributes();
const content = (0, import_react_asciidoc.useGetContent)(node);
const contentModel = node.content_model;
const contentModel = node.getContentModel();
let icon;
if (attrs.name === "caution") {
icon = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Error12, {});
Expand Down
2 changes: 1 addition & 1 deletion components/dist/index.js.map

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions components/src/AsciiDoc/Admonition.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ const Admonition = ({ node }: { node: AdocTypes.Block }) => {

// Undocumented asciidoc attribute
// Use this to check if we should render the content as is, or use a <Content /> block
// @ts-ignore
const contentModel = node.content_model
const contentModel = node.getContentModel()

let icon
if (attrs.name === 'caution') {
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 @@ -56,7 +56,7 @@ export const Badge = ({
`variant-${variant}`,
'inline-flex h-4 items-center whitespace-nowrap rounded-sm px-[3px] py-[1px] uppercase text-mono-sm',
badgeColors[variant][color],
className
className,
)}
>
<span>{children}</span>
Expand Down
10 changes: 5 additions & 5 deletions components/src/ui/button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import { Spinner } from '../'
export const buttonSizes = ['sm', 'icon', 'base'] as const
export const variants = ['primary', 'secondary', 'ghost', 'danger'] as const

export type ButtonSize = (typeof buttonSizes)[number]
export type Variant = (typeof variants)[number]
export type ButtonSize = typeof buttonSizes[number]
export type Variant = typeof variants[number]

const sizeStyle: Record<ButtonSize, string> = {
sm: 'h-8 px-3 text-mono-sm svg:w-4',
Expand All @@ -40,7 +40,7 @@ export const buttonStyle = ({
sizeStyle[size],
variant === 'danger'
? 'focus:outline-destructive-secondary'
: 'focus:outline-accent-secondary'
: 'focus:outline-accent-secondary',
)
}

Expand Down Expand Up @@ -79,7 +79,7 @@ export const Button = forwardRef<HTMLButtonElement, ButtonProps>(
// props by the parent
...rest
},
ref
ref,
) => {
const isDisabled = disabled || loading
return (
Expand All @@ -100,5 +100,5 @@ export const Button = forwardRef<HTMLButtonElement, ButtonProps>(
</span>
</button>
)
}
},
)
4 changes: 2 additions & 2 deletions components/src/ui/spinner/Spinner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import { useEffect, useRef, useState } from 'react'

export const spinnerSizes = ['base', 'lg'] as const
export const spinnerVariants = ['primary', 'secondary', 'ghost', 'danger'] as const
export type SpinnerSize = (typeof spinnerSizes)[number]
export type SpinnerVariant = (typeof spinnerVariants)[number]
export type SpinnerSize = typeof spinnerSizes[number]
export type SpinnerVariant = typeof spinnerVariants[number]

interface SpinnerProps {
className?: string
Expand Down
File renamed without changes
2 changes: 1 addition & 1 deletion icons/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export type Icon =
| { name: 'folder', size: 24 }
| { name: 'gateway', size: 16 }
| { name: 'gateway', size: 24 }
| { name: 'health', size: 16 }
| { name: 'heart', size: 16 }
| { name: 'heart', size: 24 }
| { name: 'hide', size: 12 }
| { name: 'hide', size: 16 }
Expand Down
2 changes: 1 addition & 1 deletion icons/sprite.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
124 changes: 63 additions & 61 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit fea1d6d

Please sign in to comment.