Skip to content

Commit

Permalink
fix: fix type errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredLunde committed Sep 27, 2021
1 parent 97e06e8 commit 4926481
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 20 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
"husky": "latest",
"jest": "latest",
"lint-staged": "latest",
"lundle": "latest",
"lundle": "^0.4.13",
"minify-css.macro": "^1.0.6",
"prettier": "latest",
"react": "latest",
Expand Down
14 changes: 7 additions & 7 deletions pnpm-lock.yaml

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

10 changes: 4 additions & 6 deletions src/box.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,9 @@ const padStyle: ResponsiveLazyProp<
| Extract<keyof DashTokens["pad"], string | number>
// @ts-expect-error
| Extract<keyof DashTokens["pad"], string | number>[]
// @ts-expect-error
> =
(padProp) =>
// @ts-expect-error
({ pad }) =>
css`
padding: ${Array.isArray(padProp)
Expand Down Expand Up @@ -183,10 +183,8 @@ const elevationStyle: ResponsiveLazyProp<
string | number
>
> =
(
elevationProp
// @ts-expect-error
) =>
(elevationProp) =>
// @ts-expect-error
({ elevation }) =>
css`
box-shadow: ${elevation[elevationProp]};
Expand All @@ -196,9 +194,9 @@ const radiusStyle: ResponsiveLazyProp<
| Extract<keyof DashTokens["radius"], string | number>
// @ts-expect-error
| Extract<keyof DashTokens["radius"], string | number>[]
// @ts-expect-error
> =
(radiusProp) =>
// @ts-expect-error
({ radius }) =>
css`
border-radius: ${Array.isArray(radiusProp)
Expand Down
2 changes: 1 addition & 1 deletion src/grid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,9 @@ const gapStyle: ResponsiveLazyProp<
// @ts-expect-error
Extract<keyof DashTokens["gap"], number | string>
]
// @ts-expect-error
> =
(gapProp: GapProp) =>
// @ts-expect-error
({ gap }) =>
css`
grid-gap: ${Array.isArray(gapProp)
Expand Down
1 change: 1 addition & 0 deletions types/cluster.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export declare const Cluster: import("forward-ref-as").ForwardRefExoticComponent
export interface ClusterProps extends Omit<BoxProps, "display"> {
/**
* Reverses the direction of your cluster so that it lays out right-to-left
*
* @default false
*/
readonly reverse?: ResponsiveProp<boolean>;
Expand Down
1 change: 1 addition & 0 deletions types/column.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export interface ColumnProps extends BoxProps {
>;
/**
* Reverses the direction of the column to bottom-to-top
*
* @default false
*/
readonly reverse?: ResponsiveProp<boolean>;
Expand Down
2 changes: 1 addition & 1 deletion types/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export * from "./box";
export * from "./column";
export * from "./cluster";
export * from "./column";
export * from "./flex-item";
export * from "./grid";
export * from "./layer";
Expand Down
10 changes: 7 additions & 3 deletions types/layout.d.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import * as React from "react";
import type {
Responsive,
ResponsiveStyles,
ResponsiveLazyCallback,
ResponsiveStyles,
} from "@dash-ui/responsive";
import type { Styles, DashTokens, LazyValue } from "@dash-ui/styles";
import type { DashTokens, LazyValue, Styles } from "@dash-ui/styles";
import * as React from "react";
/**
* Returns the [responsive `styles()`](https://github.com/dash-ui/responsive)
* used for creating responsive layout props.
Expand All @@ -18,6 +18,10 @@ export declare function useResponsiveStyles(): ResponsiveStyles<
* A context provider which is only required if you intend on using
* responsive props or a custom `styles()` instance.
*
* @param root0
* @param root0.styles
* @param root0.mediaQueries
* @param root0.children
* @example
* <LayoutProvider
* styles={styles}
Expand Down
1 change: 1 addition & 0 deletions types/row.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export interface RowProps extends BoxProps {
>;
/**
* Reverses the direction of the row to left-to-right
*
* @default false
*/
readonly reverse?: ResponsiveProp<boolean>;
Expand Down
3 changes: 2 additions & 1 deletion types/utils.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/**
* Adds a `px` unit to numeric values and returns non-numeric values as
* they are.
* @param value The value you want to maybe add a unit to
*
* @param value - The value you want to maybe add a unit to
*/
export declare function unit<T extends unknown>(value: T): string | T;

0 comments on commit 4926481

Please sign in to comment.