Skip to content

Commit

Permalink
Transition empty
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeldking committed Oct 26, 2023
1 parent 13c31a7 commit c28a3af
Show file tree
Hide file tree
Showing 31 changed files with 167 additions and 148 deletions.
4 changes: 2 additions & 2 deletions src/accordion/Accordion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ export function Accordion({ children }: AccordionProps) {
--accordion-animation-duration: ${theme.animation.global.duration}ms;
&.ac-accordion--default {
--accordion-padding-top: ${theme.spacing.padding8}px;
--accordion-padding-side: ${theme.spacing.padding16}px;
--accordion-padding-top: var(--ac-global-dimension-static-size-100);
--accordion-padding-side: var(--ac-global-dimension-static-size-200);
--accordion-font-size: ${theme.typography.sizes.medium.fontSize}px;
}
`}
Expand Down
7 changes: 4 additions & 3 deletions src/alert/Alert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ export const Alert = ({
<div
{...otherProps}
css={css`
padding: ${theme.spacing.margin8}px ${theme.spacing.margin16}px;
padding: var(--ac-global-dimension-static-size-100)
var(--ac-global-dimension-static-size-200);
border-radius: 4px;
color: var(--ac-global-text-color-900);
display: flex;
Expand All @@ -77,7 +78,7 @@ export const Alert = ({
}
${variantStyle}
.ac-alert__icon-title-wrap .ac-icon-wrap {
margin-right: ${theme.spacing.margin16}px;
margin-right: var(--ac-global-dimension-static-size-200);
font-size: ${theme.typography.sizes.xlarge.fontSize}px;
margin-top: 2px;
}
Expand Down Expand Up @@ -129,7 +130,7 @@ export const Alert = ({
cursor: pointer;
width: 20px;
height: 20px;
margin-left: ${theme.spacing.margin16}px;
margin-left: var(--ac-global-dimension-static-size-200);
`}
onClick={onDismissClick}
>
Expand Down
2 changes: 1 addition & 1 deletion src/breadcrumbs/Breadcrumbs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ const liCSS = css`
position: relative;
.ac-breadcrumbs-item-link {
padding: 0 ${theme.spacing.padding4}px;
padding: 0 var(--ac-global-dimension-static-size-50);
outline: none;
}
.ac-icon-wrap {
Expand Down
3 changes: 1 addition & 2 deletions src/button/ButtonToolbar.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, { ReactNode } from 'react';
import { css } from '@emotion/react';
import theme from '../theme';

type ButtonToolbarProps = {
children: ReactNode;
Expand All @@ -18,7 +17,7 @@ export function ButtonToolbar({ children }: ButtonToolbarProps) {
display: flex;
flex-direction: row;
& > .ac-button + .ac-button {
margin-left: ${theme.spacing.margin8}px;
margin-left: var(--ac-global-dimension-static-size-100);
}
`}
>
Expand Down
14 changes: 9 additions & 5 deletions src/button/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,20 @@ export const buttonCSS = css`
opacity: ${theme.opacity.disabled};
}
&[data-size='normal'][data-childless='false'] {
padding: ${theme.spacing.padding8}px ${theme.spacing.padding16}px;
padding: var(--ac-global-dimension-static-size-100)
var(--ac-global-dimension-static-size-200);
}
&[data-size='compact'][data-childless='false'] {
padding: ${theme.spacing.padding4}px ${theme.spacing.padding8}px;
padding: var(--ac-global-dimension-static-size-50)
var(--ac-global-dimension-static-size-100);
}
&[data-size='normal'][data-childless='true'] {
padding: ${theme.spacing.padding8}px ${theme.spacing.padding8}px;
padding: var(--ac-global-dimension-static-size-100)
var(--ac-global-dimension-static-size-100);
}
&[data-size='compact'][data-childless='true'] {
padding: ${theme.spacing.padding4}px ${theme.spacing.padding4}px;
padding: var(--ac-global-dimension-static-size-50)
var(--ac-global-dimension-static-size-50);
}
&[data-variant='primary'] {
background-color: var(--ac-global-button-primary-background-color);
Expand Down Expand Up @@ -76,6 +80,6 @@ export const buttonCSS = css`
&[data-childless='false'] > i,
& > .ac-spinner {
margin-right: ${theme.spacing.margin4}px;
margin-right: var(--ac-global-dimension-static-size-50);
}
`;
3 changes: 1 addition & 2 deletions src/card/CollapsibleCardTitle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import React, { ReactNode } from 'react';
import { css } from '@emotion/react';
import { Icon, ArrowIosDownwardOutline } from '../icon';
import { classNames, useStyleProps, viewStyleProps } from '../utils';
import theme from '../theme';
import { ViewProps } from '../view';

const titleWrapCSS = css`
Expand Down Expand Up @@ -55,7 +54,7 @@ export function CollapsibleCardTitle(props: CollapsibleCardTitleProps) {
css={css`
transition: transform ease var(--collapsible-card-animation-duration);
transform: rotate(-90deg);
margin-right: ${theme.spacing.padding8}px;
margin-right: var(--ac-global-dimension-static-size-100);
`}
aria-hidden={true}
/>
Expand Down
6 changes: 3 additions & 3 deletions src/dialog/Dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { useDialog } from '@react-aria/dialog';
import { DialogProps } from '../types/dialog';
import { Heading } from '../content';
import { css } from '@emotion/react';
import theme from '../theme';

const dialogCSS = css`
outline: none;
Expand Down Expand Up @@ -112,7 +111,8 @@ function Dialog(props: DialogProps, ref: DOMRef) {
flex-direction: row;
justify-content: space-between;
align-items: center;
padding: ${theme.spacing.padding8}px ${theme.spacing.padding16}px;
padding: var(--ac-global-dimension-static-size-100)
var(--ac-global-dimension-static-size-200);
border-bottom: 1px solid var(--ac-global-border-color-dark);
flex: none;
`}
Expand All @@ -123,7 +123,7 @@ function Dialog(props: DialogProps, ref: DOMRef) {
display: flex;
flex-direction: row;
.ac-dialog__dismiss-button {
margin-left: ${theme.spacing.margin8}px;
margin-left: var(--ac-global-dimension-static-size-100);
}
`}
>
Expand Down
16 changes: 10 additions & 6 deletions src/dropdown/DropdownButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ const buttonBaseCSS = css`
.ac-dropdown-button__validation-icon {
/* Animate in the icon */
animation: ${appearKeyframes} ${0.2}s forwards ease-in-out;
top: ${theme.spacing.padding8}px;
top: var(--ac-global-dimension-static-size-100);
right: 0;
&.ac-dropdown-button__validation-icon--invalid {
color: var(--ac-global-color-danger);
Expand All @@ -84,7 +84,8 @@ const buttonBaseCSS = css`
// Make room for the invalid icon
&.ac-dropdown-button > .ac-dropdown-button__text {
padding-right: calc(
${theme.spacing.padding8}px + var(--ac-validation-icon-width)
var(--ac-global-dimension-static-size-100) +
var(--ac-validation-icon-width)
);
}
Expand All @@ -106,7 +107,8 @@ const quietButtonCSS = css`
--ac-field-border-color-override,
var(--ac-dropdown-button-border-color)
);
margin: ${theme.spacing.margin8}px 0 ${theme.spacing.margin8}px 0;
margin: var(--ac-global-dimension-static-size-100) 0
var(--ac-global-dimension-static-size-100) 0;
&.is-hovered {
border-bottom: 1px solid var(--ac-global-color-grey-500);
}
Expand All @@ -131,7 +133,7 @@ const quietButtonCSS = css`
*/
const nonQuietButtonCSS = css`
min-width: 200px;
padding: 0 ${theme.spacing.margin8}px 0 0;
padding: 0 var(--ac-global-dimension-static-size-100) 0 0;
--ac-dropdown-button-border-color: var(--ac-global-input-field-border-color);
border: 1px solid
var(
Expand All @@ -154,8 +156,10 @@ const nonQuietButtonCSS = css`
border: 1px solid ${theme.components.dropdown.borderColor};
}
.ac-dropdown-button__text {
margin: ${theme.spacing.margin8}px ${theme.spacing.margin8}px
${theme.spacing.margin8}px ${theme.spacing.margin16}px;
margin: var(--ac-global-dimension-static-size-100)
var(--ac-global-dimension-static-size-100)
var(--ac-global-dimension-static-size-100)
var(--ac-global-dimension-static-size-200);
}
&.ac-dropdown-button--invalid {
Expand Down
6 changes: 3 additions & 3 deletions src/empty/graphics/EmptyDocumentsSVG.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const EmptyDocumentsSVG = (props: StyleProps) => {
isolation: isolate;
}
.cls-2 {
fill: #2c353f;
fill: var(--ac-global-color-grey-200);
}
.cls-3,
.cls-9 {
Expand All @@ -29,7 +29,7 @@ export const EmptyDocumentsSVG = (props: StyleProps) => {
stroke-miterlimit: 10;
}
.cls-3 {
stroke: #02bf92;
stroke: var(--ac-global-color-primary);
stroke-width: 1.21px;
stroke-dasharray: 0 6.2;
}
Expand All @@ -50,7 +50,7 @@ export const EmptyDocumentsSVG = (props: StyleProps) => {
fill: url(${linearGradientIdPrefix}-4);
}
.cls-9 {
stroke: #02bfff;
stroke: var(--ac-global-color-primary);
stroke-width: 2px;
}
`}
Expand Down
6 changes: 3 additions & 3 deletions src/empty/graphics/ErrorSVG.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export function ErrorSVG(props: StyleProps) {
fill: transparent;
}
.cls-3 {
fill: #2c353f;
fill: var(--ac-global-color-grey-200);
}
.cls-4 {
mix-blend-mode: multiply;
Expand All @@ -37,11 +37,11 @@ export function ErrorSVG(props: StyleProps) {
stroke-miterlimit: 10;
}
.cls-6 {
stroke: #02bf92;
stroke: var(--ac-global-color-primary);
stroke-dasharray: 0 6.31;
}
.cls-7 {
stroke: #5bdbff;
stroke: var(--ac-global-color-primary);
stroke-width: 2px;
}
`}
Expand Down
8 changes: 4 additions & 4 deletions src/empty/graphics/NotFoundSVG.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const NotFoundSVG = (props: StyleProps) => {
}
.cls-14,
.cls-3 {
fill: #2c353f;
fill: var(--ac-global-color-grey-200);
}
.cls-4 {
fill: url(#${id});
Expand All @@ -44,7 +44,7 @@ export const NotFoundSVG = (props: StyleProps) => {
.cls-7,
.cls-8,
.cls-9 {
stroke: #5bdbff;
stroke: var(--ac-global-color-primary);
}
.cls-5 {
stroke-width: 0.95px;
Expand All @@ -62,7 +62,7 @@ export const NotFoundSVG = (props: StyleProps) => {
stroke-width: 0.25px;
}
.cls-10 {
stroke: #02bf92;
stroke: var(--ac-global-color-primary);
stroke-dasharray: 0 5.11;
}
.cls-11 {
Expand All @@ -71,7 +71,7 @@ export const NotFoundSVG = (props: StyleProps) => {
}
.cls-12,
.cls-14 {
stroke: #ededed;
stroke: var(--ac-global-color-grey-900);
stroke-miterlimit: 1;
stroke-width: 1.5px;
}
Expand Down
2 changes: 1 addition & 1 deletion src/field/Addon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Text } from '../content/Text';

const addonBeforeCSS = css`
background-color: var(--ac-global-color-grey-300);
padding: 0 ${theme.spacing.padding8}px;
padding: 0 var(--ac-global-dimension-static-size-100);
flex: none;
box-sizing: border-box;
height: ${theme.singleLineHeight}px;
Expand Down
4 changes: 2 additions & 2 deletions src/field/FieldLabel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function FieldLabel(props: FieldLabelProps, ref: DOMRef<HTMLLabelElement>) {
line-height: ${theme.typography.sizes.small.lineHeight}px;
font-weight: ${theme.typography.weights.heavy};
color: var(--ac-global-text-color-900);
padding: ${theme.spacing.padding4}px 0;
padding: var(--ac-global-dimension-static-size-50) 0;
display: inline-flex;
align-items: center;
`}
Expand Down Expand Up @@ -90,7 +90,7 @@ function FieldLabel(props: FieldLabelProps, ref: DOMRef<HTMLLabelElement>) {
<span
className="ac-field-label__label-extra"
css={css`
margin-left: ${theme.spacing.padding4}px;
margin-left: var(--ac-global-dimension-static-size-50);
display: inline-flex;
align-items: center;
`}
Expand Down
2 changes: 1 addition & 1 deletion src/field/HelpText.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function HelpText(props: HelpTextComponentProps, ref: DOMRef<HTMLDivElement>) {
ref={domRef}
css={css`
height: 16px;
padding: ${theme.spacing.padding4}px 0 0;
padding: var(--ac-global-dimension-static-size-50) 0 0;
color: var(--ac-global-text-color-500);
&.ac-help-text--danger {
color: var(--ac-global-color-danger);
Expand Down
3 changes: 1 addition & 2 deletions src/label/LabelGroup.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import React, { ReactNode } from 'react';
import { css } from '@emotion/react';
import theme from '../theme';

export const LabelGroup = ({ children }: { children: ReactNode }) => {
return (
<span
className="ac-label-group"
css={css`
.ac-label + .ac-label {
margin: ${theme.spacing.margin8}px;
margin: var(--ac-global-dimension-static-size-100);
}
`}
>
Expand Down
12 changes: 6 additions & 6 deletions src/list/List.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export type ListSize = 'small' | 'default';

const interactiveListCSS = css`
& > li:hover {
background-color: ${theme.colors.hoverBgColor};
background-color: var(--ac-global-background-color-light-hover);
cursor: pointer;
}
`;
Expand Down Expand Up @@ -98,15 +98,15 @@ const listItemCSS = (options: {
}) => {
const spacing =
options.listSize === 'small'
? theme.spacing.padding8
: theme.spacing.padding16;
? 'var(--ac-global-dimension-static-size-100)'
: 'var(--ac-global-dimension-static-size-200)';
const innerPadding = options.noPadding ? 0 : spacing;
return css`
padding: ${innerPadding}px;
padding: ${innerPadding};
position: relative;
&:hover {
background-color: ${options.interactive
? theme.colors.hoverBgColor
? 'var(--ac-global-background-color-light-hover)'
: 'transparent'};
cursor: ${options.interactive ? 'pointer' : 'default'};
}
Expand All @@ -115,7 +115,7 @@ const listItemCSS = (options: {
content: ' ';
border-top: 1px solid var(--ac-global-border-color-default);
position: absolute;
left: ${spacing}px;
left: ${spacing};
right: 0;
top: 0;
}
Expand Down
3 changes: 1 addition & 2 deletions src/menu/ActionMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { ArrowIosDownwardOutline, Icon, MoreHorizontalOutline } from '../icon';
import React, { forwardRef } from 'react';
import { ActionMenuProps } from '../types';
import { css } from '@emotion/react';
import theme from '../theme';

function ActionMenu<T extends object>(
props: ActionMenuProps<T>,
Expand All @@ -34,7 +33,7 @@ function ActionMenu<T extends object>(
align-items: center;
.ac-icon-wrap {
flex: fixed;
padding-left: ${theme.spacing.padding8}px;
padding-left: var(--ac-global-dimension-static-size-100);
width: 16px;
height: 16px;
font-size: 16px;
Expand Down
Loading

0 comments on commit c28a3af

Please sign in to comment.