Skip to content

Commit

Permalink
style: 💄 run Prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
streamich committed Jul 20, 2024
1 parent 61644c4 commit 36dd49f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 19 deletions.
12 changes: 7 additions & 5 deletions .storybook/vcssom/css5-h.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ import {styled} from './css5';
const cache = {};
const cachedBlock = (useCss, h, tag) => cache[tag] || (cache[tag] = styled(useCss)(h)(tag));

export const H = (h, useCss) => (tag, props, ...rest) => {
if (!props || !props.css || typeof tag !== 'string') return h(tag, props, ...rest);
const Block = cachedBlock(useCss, h, tag);
return h(Block, props, ...rest);
};
export const H =
(h, useCss) =>
(tag, props, ...rest) => {
if (!props || !props.css || typeof tag !== 'string') return h(tag, props, ...rest);
const Block = cachedBlock(useCss, h, tag);
return h(Block, props, ...rest);
};
14 changes: 9 additions & 5 deletions .storybook/vcssom/css5.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import * as React from 'react';
import {useCss} from './react';

export const styled = (useCss) => (h) => (tag) => ({as = tag, css, className, ...rest}) => {
const extraClass = useCss(css);
rest.className = className ? className + ' ' + extraClass : extraClass;
return h(as, rest);
};
export const styled =
(useCss) =>
(h) =>
(tag) =>
({as = tag, css, className, ...rest}) => {
const extraClass = useCss(css);
rest.className = className ? className + ' ' + extraClass : extraClass;
return h(as, rest);
};

export const Box = styled(useCss)(React.createElement)('div') as any;
export const Text = styled(useCss)(React.createElement)('span') as any;
9 changes: 0 additions & 9 deletions addon/atoms.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ export interface Atoms {
*/
z?: CSS.Property.ZIndex;


// Layout (box model)

/**
Expand Down Expand Up @@ -141,7 +140,6 @@ export interface Atoms {
*/
tbl?: CSS.Property.TableLayout;


// Flexbox

/**
Expand Down Expand Up @@ -204,7 +202,6 @@ export interface Atoms {
*/
as?: CSS.Property.AlignSelf;


// Margins

/**
Expand Down Expand Up @@ -329,7 +326,6 @@ export interface Atoms {
*/
padl?: CSS.Property.PaddingLeft<TLength>;


// Borders

/**
Expand Down Expand Up @@ -392,7 +388,6 @@ export interface Atoms {
*/
bxsh?: CSS.Property.BoxShadow;


// Colors

/**
Expand Down Expand Up @@ -565,7 +560,6 @@ export interface Atoms {
*/
va?: CSS.Property.VerticalAlign<TLength>;


// Pointer

/**
Expand All @@ -586,7 +580,6 @@ export interface Atoms {
*/
us?: CSS.Property.UserSelect;


// Animations

/**
Expand Down Expand Up @@ -643,7 +636,6 @@ export interface Atoms {
*/
tr?: CSS.Property.Transform;


// SVG

/**
Expand All @@ -664,7 +656,6 @@ export interface Atoms {
*/
stl?: CSS.Property.StrokeLinecap;


// Other

/**
Expand Down

0 comments on commit 36dd49f

Please sign in to comment.