Skip to content

Commit

Permalink
Add tinloof toolkit files
Browse files Browse the repository at this point in the history
  • Loading branch information
Elena Banon authored and Elena Banon committed May 27, 2024
0 parents commit efd1a31
Show file tree
Hide file tree
Showing 19 changed files with 454 additions and 0 deletions.
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Toolkit

React utility functions.

[Storybook](http://toolkit.tinloof.com/)

## Install

```
yarn add @tinloof/toolkit
```

## Usage

### Stack
> Requires Emotion and React.
```js
import { Stack } from "@tinloof/toolkit";

function App() {
<Stack>
...
</Stack>
}
```
6 changes: 6 additions & 0 deletions lib/Box.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/// <reference types="react" />
declare type BoxProps = {
size: number;
};
export default function Box({ size }: BoxProps): JSX.Element;
export {};
5 changes: 5 additions & 0 deletions lib/Row/Row.stories.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { ComponentStory, ComponentMeta } from "@storybook/react";
import Row from "./index";
declare const _default: ComponentMeta<typeof Row>;
export default _default;
export declare const Default: ComponentStory<typeof Row>;
13 changes: 13 additions & 0 deletions lib/Row/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React from "react";
import { responsiveProp } from "../utils";
import * as styles from "./styles";
interface RowProps {
gap: responsiveProp<styles.gap>;
vGap?: responsiveProp<styles.gap>;
align?: responsiveProp<styles.align>;
wrap?: boolean;
wrapBefore?: number;
children: React.ReactNode;
}
export default function Row({ gap, vGap, align, wrap, wrapBefore, children, }: RowProps): import("@emotion/react/jsx-runtime").JSX.Element;
export {};
11 changes: 11 additions & 0 deletions lib/Row/styles.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export declare type gap = "spaceBetween" | number;
export declare type align = "start" | "center" | "end" | "stretch";
export declare const row: import("@emotion/react").SerializedStyles;
export declare const rowWrap: (wrap: boolean) => import("@emotion/react").SerializedStyles;
export declare const rowAlign: (responsiveProp: any) => import("@emotion/react").SerializedStyles | (import("@emotion/react").SerializedStyles | import("@emotion/react").SerializedStyles[] | null)[] | null;
export declare const rowGap: (responsiveProp: any) => import("@emotion/react").SerializedStyles | (import("@emotion/react").SerializedStyles | import("@emotion/react").SerializedStyles[] | null)[] | null;
export declare const rowVGap: (responsiveProp: any) => import("@emotion/react").SerializedStyles | (import("@emotion/react").SerializedStyles | import("@emotion/react").SerializedStyles[] | null)[] | null;
export declare const wrapBefore: (screenSize: number) => import("@emotion/react").SerializedStyles;
export declare const box: import("@emotion/react").SerializedStyles;
export declare const boxGap: (responsiveProp: any) => import("@emotion/react").SerializedStyles | (import("@emotion/react").SerializedStyles | import("@emotion/react").SerializedStyles[] | null)[] | null;
export declare const boxVGap: (responsiveProp: any) => import("@emotion/react").SerializedStyles | (import("@emotion/react").SerializedStyles | import("@emotion/react").SerializedStyles[] | null)[] | null;
5 changes: 5 additions & 0 deletions lib/Stack/Stack.stories.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { ComponentStory, ComponentMeta } from "@storybook/react";
import Stack from "./index";
declare const _default: ComponentMeta<typeof Stack>;
export default _default;
export declare const Default: ComponentStory<typeof Stack>;
10 changes: 10 additions & 0 deletions lib/Stack/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import React from "react";
import { responsiveProp } from "../utils";
import * as styles from "./styles";
declare type StackProps = {
gap: responsiveProp<number>;
align?: responsiveProp<styles.align>;
children: React.ReactNode;
};
export default function Stack({ gap, align, children }: StackProps): import("@emotion/react/jsx-runtime").JSX.Element;
export {};
4 changes: 4 additions & 0 deletions lib/Stack/styles.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export declare type align = "start" | "center" | "end" | "stretch";
export declare const stack: import("@emotion/react").SerializedStyles;
export declare const align: (responsiveProp: any) => import("@emotion/react").SerializedStyles | (import("@emotion/react").SerializedStyles | import("@emotion/react").SerializedStyles[] | null)[] | null;
export declare const stackGap: (responsiveProp: any) => import("@emotion/react").SerializedStyles | (import("@emotion/react").SerializedStyles | import("@emotion/react").SerializedStyles[] | null)[] | null;
2 changes: 2 additions & 0 deletions lib/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export { default as Row } from "./Row";
export { default as Stack } from "./Stack";
114 changes: 114 additions & 0 deletions lib/index.es.js

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

1 change: 1 addition & 0 deletions lib/index.es.js.map

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions lib/index.es.min.js

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

1 change: 1 addition & 0 deletions lib/index.es.min.js.map

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

Loading

0 comments on commit efd1a31

Please sign in to comment.