Skip to content

Commit

Permalink
Fix/examples (#66)
Browse files Browse the repository at this point in the history
* fix: fixed export types

* fix: fixed export types
  • Loading branch information
wootsbot authored Jan 5, 2024
1 parent a86f02a commit b4d118c
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 79 deletions.
14 changes: 14 additions & 0 deletions .changeset/old-dryers-pull.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
"@design-blocks/unstyled": patch
"tsconfig": patch
"@design-blocks/colors": patch
"@design-blocks/primitives": patch
"@design-blocks/system": patch
"@design-blocks/theme": patch
"@design-blocks/types": patch
"@design-blocks/utils": patch
"@design-blocks/block": patch
"@design-blocks/native": patch
---

Fixed export types
3 changes: 2 additions & 1 deletion examples/basic/App.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import React from 'react';
import { StatusBar } from 'expo-status-bar';
import { SafeAreaView, useColorScheme } from 'react-native';

import { StatusBar } from 'expo-status-bar';

import { ThemeProvider } from '@design-blocks/native';

import { themes, block } from './blocks.config';
Expand Down
25 changes: 11 additions & 14 deletions examples/basic/block.d.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,24 @@
import "@design-blocks/native";
import '@design-blocks/native';

import * as RN from "react-native";
import * as RN from 'react-native';

import { lightTheme, darkTheme } from "./blocks.config";
import { lightTheme, darkTheme } from './blocks.config';

import type { Leaves, LooseAutocomplete } from "@design-blocks/native";
import type { TailwindCssColors } from "@design-blocks/colors";
import type { Leaves, LooseAutocomplete, ColorMapProps } from '@design-blocks/native';

type AppTheme = typeof lightTheme.tokens &
typeof lightTheme.extendTokens &
typeof darkTheme.tokens &
typeof darkTheme.extendTokens;

type ColorsAppTheme = AppTheme["colors"];
type SpacingsCustom = AppTheme["spacings"];
type RadiiCustom = AppTheme["radii"];
type FontSizesCustom = AppTheme["fontSizes"];
type ColorsValueMap =
| LooseAutocomplete<Leaves<ColorsAppTheme>>
| Omit<RN.TextStyle["color"], "string">;
type ColorsAppTheme = typeof lightTheme.tokens.colors | typeof lightTheme.tokens.colors;
type SpacingsCustom = AppTheme['spacings'];
type RadiiCustom = AppTheme['radii'];
type FontSizesCustom = AppTheme['fontSizes'];
type ColorsValueMap = LooseAutocomplete<Leaves<ColorsAppTheme>> | Omit<RN.TextStyle['color'], 'string'>;

declare module "@design-blocks/native" {
export interface Colors extends TailwindCssColors, ColorsAppTheme {}
declare module '@design-blocks/native' {
export interface Colors extends ColorsAppTheme {}
export interface Spacings extends SpacingsCustom {}
export interface Radii extends RadiiCustom {}
export interface FontSizes extends FontSizesCustom {}
Expand Down
4 changes: 0 additions & 4 deletions examples/basic/blocks.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ export const darkTheme = {
tokens: {
colors: {
...colors,
blue: {
...colors.blue,
950: 'red',
},
},
},
extendTokens: {
Expand Down
42 changes: 0 additions & 42 deletions examples/basic/src/screens/DS/screen.tsx

This file was deleted.

15 changes: 0 additions & 15 deletions examples/basic/src/screens/demo/screen.tsx

This file was deleted.

2 changes: 1 addition & 1 deletion packages/@blocks-unstyled/src/Button/ButtonContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ import { createContext } from 'react';

import type { ButtonContextProps } from './Button.types';

export const ButtonContext = createContext<ButtonContextProps>(null as any);
export const ButtonContext = createContext<ButtonContextProps>({});

ButtonContext.displayName = 'Block.ButtonContext';
2 changes: 2 additions & 0 deletions packages/@blocks-unstyled/src/Button/ButtonRoot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ export function ButtonRoot({
<Pressable
nativeID={nativeID}
testID={testID}
aria-busy={accessible && accessibilityState.busy}
aria-disabled={accessible && accessibilityState.disabled}
accessible={accessible}
accessibilityRole={accessibilityRole}
accessibilityState={accessibilityState}
Expand Down
2 changes: 0 additions & 2 deletions packages/tsconfig/base.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{
"$schema": "http://json.schemastore.org/tsconfig",
"compilerOptions": {
"experimentalDecorators": true,
"declaration": true,
"allowUnreachableCode": false,
"allowUnusedLabels": false,
"esModuleInterop": true,
Expand Down

0 comments on commit b4d118c

Please sign in to comment.