Fix imports

This commit is contained in:
Zoe Roux
2022-11-22 23:28:15 +09:00
parent 210a868156
commit 832c0745ff
9 changed files with 34 additions and 11 deletions
+11
View File
@@ -10,6 +10,17 @@
- Atomic CSS generation
- SSR support
## Installation
As any other npm package, simply run
``yarn add yoshiki``
or
``npm install --save yoshiki``
## Usage
```tsx
+1 -3
View File
@@ -1,4 +1,2 @@
package.tgz
tsconfig.tsbuildinfo
/index.ts
/web.ts
/native.ts
+1 -1
View File
@@ -3,4 +3,4 @@
// Licensed under the MIT license. See LICENSE file in the project root for details.
//
export * from "./src";
export * from "./dist";
+1 -1
View File
@@ -3,4 +3,4 @@
// Licensed under the MIT license. See LICENSE file in the project root for details.
//
export * from "./src/native";
export * from "./dist/native";
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "yoshiki",
"version": "0.1.1",
"version": "0.1.4",
"author": "Zoe Roux <zoe.roux@sdg.moe> (https://github.com/AnonymusRaccoon)",
"license": "MIT",
"keywords": [
+14 -2
View File
@@ -5,14 +5,26 @@
import { ViewStyle, TextStyle, ImageStyle, useWindowDimensions } from "react-native";
import { breakpoints, Theme, useTheme } from "../theme";
import { AtLeastOne, Breakpoints, WithState, YoshikiStyle, hasState } from "../type";
import {
AtLeastOne,
Breakpoints,
FilterOr,
WithState,
YoshikiStyle,
hasState,
Length,
} from "../type";
import { isBreakpoints } from "../utils";
import { shorthandsFn } from "../shorthands";
export type EnhancedStyle<Properties> = {
[key in keyof Properties]: YoshikiStyle<Properties[key]>;
} & {
[key in keyof typeof shorthandsFn]?: Parameters<typeof shorthandsFn[key]>[0];
[key in keyof typeof shorthandsFn]?: FilterOr<
Parameters<typeof shorthandsFn[key]>[0],
Length,
number
>;
};
const useBreakpoint = (): number => {
+3 -1
View File
@@ -33,7 +33,9 @@ export type Length = { a: 1 };
export type CssProperties = _CssProperties<0 | Length>;
type FilterOrNever<T, Filter> = T extends Filter ? Filter : never;
type FilterOr<T, Filter> = [FilterOrNever<T, Filter>] extends [never] ? T : Filter;
export type FilterOr<T, Filter, Replacement = Filter> = [FilterOrNever<T, Filter>] extends [never]
? T
: Replacement;
type CombineWithLength<A, B> = {
[key in keyof A & keyof B]?: FilterOr<(A & B)[key], Length>;
+1 -1
View File
@@ -19,5 +19,5 @@
"outDir": "dist/"
},
"include": ["src/**/*.ts", "src/**/*.tsx"],
"exclude": ["node_modules"]
"exclude": ["node_modules", "dist"]
}
+1 -1
View File
@@ -3,4 +3,4 @@
// Licensed under the MIT license. See LICENSE file in the project root for details.
//
export * from "./src/web";
export * from "./dist/web";