Skip to content

Commit

Permalink
fix: Removed animation by default, Sidebar padding, and Radio RTL (#336)
Browse files Browse the repository at this point in the history
  • Loading branch information
ggazzo authored Nov 30, 2020
1 parent 56c2eb7 commit 63bcc18
Show file tree
Hide file tree
Showing 15 changed files with 31 additions and 21 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions packages/fuselage/src/components/Accordion/Item.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ export function Item({
<Box is='section' rcx-accordion-item className={className} {...props}>
{title && (
<Box
animated
rcx-accordion-item__bar
rcx-accordion-item__bar--disabled={disabled}
{...barProps}
Expand All @@ -108,6 +109,7 @@ export function Item({
</Box>
)}
<Box
animated
rcx-accordion-item__panel
rcx-accordion-item__panel--expanded={panelExpanded}
id={panelId}
Expand Down
2 changes: 1 addition & 1 deletion packages/fuselage/src/components/Accordion/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Box } from '../Box';
import { Item } from './Item';

export function Accordion(props) {
return <Box rcx-accordion {...props} />;
return <Box animated rcx-accordion {...props} />;
}

Accordion.propTypes = {
Expand Down
5 changes: 4 additions & 1 deletion packages/fuselage/src/components/Box/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export const useBoxOnlyProps = (props) => {
};

export const Box = memo(
forwardRef(function Box({ is = 'div', children, ...props }, ref) {
forwardRef(function Box({ is = 'div', children, animated, ...props }, ref) {
useStyleSheet();

if (ref) {
Expand All @@ -69,6 +69,9 @@ export const Box = memo(
props = useBoxOnlyProps(props);
props = useStylingProps(props);

if (animated) {
props.className = prependClassName(props.className, 'rcx-box--animated');
}
const element = createElement(is, props, children);

if (transformFn) {
Expand Down
11 changes: 9 additions & 2 deletions packages/fuselage/src/components/Box/styles.scss
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
.rcx-box {
@extend %box;

&--full {
&--animated {
@extend %box--animated;

&::before,
&::after {
@extend %box--animated;
}
}

&--full {
@extend %box--full;

&::before,
&::after {
@extend %box;
@extend %box--animated;
@extend %box--full;
}
}
Expand Down
1 change: 1 addition & 0 deletions packages/fuselage/src/components/Button/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export const Button = forwardRef(function Button(

return (
<Box
animated
is={is}
rcx-button
rcx-button--danger={!primary && danger && !ghost}
Expand Down
9 changes: 4 additions & 5 deletions packages/fuselage/src/components/CheckBox/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,21 @@

&__fake {
@extend %selection-button__fake;
display: flex;
justify-content: center;
align-items: center;

border-radius: lengths.border-radius(2);
inline-size: lengths.size(20);

&::before,
&::after {
position: absolute;
inset-block-start: 50%;
inset-inline-start: 50%;

display: block;
visibility: hidden;

content: '';
transform: translate(-50%, -50%);

opacity: 0;

Expand Down Expand Up @@ -59,7 +60,6 @@
height: $icon-thickness;

transform:
translate(-50%, -50%)
translate($icon-size * lengths.size(20) / -3, $icon-size * lengths.size(20) / 6)
rotate(-45deg)
translate($icon-size * lengths.size(20) / 2, $icon-size * lengths.size(20) / 6);
Expand All @@ -70,7 +70,6 @@
height: 0.5 * $icon-size * lengths.size(20);

transform:
translate(-50%, -50%)
translate($icon-size * lengths.size(20) / -3, $icon-size * lengths.size(20) / 6)
rotate(-45deg);
}
Expand Down
6 changes: 4 additions & 2 deletions packages/fuselage/src/components/InputBox/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ import { Skeleton } from '../Skeleton';
import { Option } from './Option';
import { Placeholder } from './Placeholder';

const Wrapper = (props) => <Box is={Label} rcx-input-box__wrapper {...props} />;
const Wrapper = (props) => (
<Box animated is={Label} rcx-input-box__wrapper {...props} />
);

const Input = forwardRef((props, ref) => (
<Box is='input' rcx-input-box ref={ref} {...props} />
<Box is='input' animated rcx-input-box ref={ref} {...props} />
));

const Addon = forwardRef((props, ref) => (
Expand Down
10 changes: 4 additions & 6 deletions packages/fuselage/src/components/RadioButton/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,22 @@

&__fake {
@extend %selection-button__fake;
display: flex;
justify-content: center;
align-items: center;

border-radius: lengths.border-radius(full);
inline-size: lengths.size(20);
}

&__input:checked + &__fake::before {
position: absolute;
inset-block-start: 50%;
inset-inline-start: 50%;

display: block;

width: 0.3 * lengths.size(20);
height: 0.3 * lengths.size(20);

content: '';

transform: translate(-50%, -50%);

border-radius: lengths.border-radius(full);

background-color: currentColor;
Expand Down
2 changes: 1 addition & 1 deletion packages/fuselage/src/components/Sidebar/Item.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const Container = (props) => (

const Menu = (props) => (
<div
className='rc-box rcx-box--full rcx-sidebar-item__menu-wraper '
className='rc-box rcx-box--full rcx-box--animated rcx-sidebar-item__menu-wraper '
{...props}
/>
);
Expand Down
3 changes: 1 addition & 2 deletions packages/fuselage/src/components/Sidebar/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ $sidebar-item-color-selected: theme('sidebar-item-color-selected', colors.foregr
&-item {
@extend %sidebar-base;
padding-block: lengths.padding(4);
padding-inline-start: lengths.padding(16);
padding-inline-end: lengths.padding(8);
padding-inline: lengths.padding(16);

color: $sidebar-item-color;

Expand Down
1 change: 0 additions & 1 deletion packages/fuselage/src/styles/primitives/box.scss
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
outline: none;

font-family: typography.font-family('sans');
font-variant-numeric: tabular-nums;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

0 comments on commit 63bcc18

Please sign in to comment.