mirror of
https://github.com/zoriya/yoshiki.git
synced 2026-06-04 11:15:08 +00:00
Fix imports
This commit is contained in:
@@ -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,4 +1,2 @@
|
||||
package.tgz
|
||||
tsconfig.tsbuildinfo
|
||||
/index.ts
|
||||
/web.ts
|
||||
/native.ts
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for details.
|
||||
//
|
||||
|
||||
export * from "./src";
|
||||
export * from "./dist";
|
||||
|
||||
@@ -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,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": [
|
||||
|
||||
@@ -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 => {
|
||||
|
||||
@@ -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>;
|
||||
|
||||
@@ -19,5 +19,5 @@
|
||||
"outDir": "dist/"
|
||||
},
|
||||
"include": ["src/**/*.ts", "src/**/*.tsx"],
|
||||
"exclude": ["node_modules"]
|
||||
"exclude": ["node_modules", "dist"]
|
||||
}
|
||||
|
||||
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user