Skip to content

Commit

Permalink
Bump versions
Browse files Browse the repository at this point in the history
  • Loading branch information
drozdzynski committed May 21, 2024
1 parent 96bb670 commit e514bb8
Show file tree
Hide file tree
Showing 13 changed files with 3,389 additions and 2,789 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ node_modules
.pnp.*
**/dist/*
**/.turbo/*
**/coverage/*
**/coverage/*
*storybook.log
4 changes: 4 additions & 0 deletions .storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,9 @@ module.exports = {
title: 'Svelte',
url: 'http://localhost:6006',
},
vue: {
title: 'Vue',
url: 'http://localhost:6007',
},
},
}
Binary file modified .yarn/install-state.gz
Binary file not shown.
107 changes: 20 additions & 87 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,19 @@

**Teiler** is an open source library that simplifies the creation of stylish components for various frameworks.

Currently in the **alpha phase**, the library is actively being developed and improved. It currently provides support solely for Svelte CSR (Client-Side Rendering).
Currently in the **alpha phase**, the library is actively being developed and improved.

Join our community on our [Discord Server](https://discord.gg/J6Sv9sQ64t) to stay informed about the latest developments, exchange ideas, and connect with fellow developers. We are continuously working on expanding our support to include more frameworks, allowing developers to effortlessly create components across various environments.

## Features

- 🧰 **Multiple** frameworks support
- 🪡 **Patterns system** for UI libraries
- 🚉 **Server-Side Rendering** (SSR)*
-**Babel** not required

\* Not all frameworks, more details [here](#frameworks)

### Example

```typescript
Expand Down Expand Up @@ -37,92 +46,16 @@ const Button = component.button<{

These are the frameworks we are currently working on and planning to support in the future.

| Framework | CSR | SSR |
| :--- | :---- | :--- |
| Svelte |||
| React |||
| VueJS |||
| SolidJS |||

*CSR - Client Side Rendering*\
*SSR - Server Side Rendering*

## Keyframes

```typescript
import { component, keyframes } from '@teiler/svelte'

const bouncing = keyframes`
from, 20%, 53%, 80%, to {
transform: translate3d(0,0,0);
}
40%, 43% {
transform: translate3d(0, -40px, 0);
}
70% {
transform: translate3d(0, -15px, 0);
}
90% {
transform: translate3d(0,-4px,0);
}
`

const Button = component.button<{}>`
animation: ${bouncing} 1s ease infinite;
display: inline-block;
border-radius: 4px;
font-size: 0.8rem;
line-height: 1.5rem;
background: transparent;
box-shadow: 0 0 0 3px #CBCBCB inset;
`
```

## Theme

Example how to use themes.

```typescript
// Main component inside application (`App.svelte`)
<script context="module" lang="ts">
export type CustomTheme = {
fontColor: string,
}
</script>
<script lang="ts">
import ThemeProvider from '../src/ThemeProvider.svelte'
import { Component } from './theme'

export let theme: CustomTheme = {
fontColor: 'red',
}
</script>
| Framework | CSR | SSR | More details |
| :--- | :---- | :--- | :----------- |
| Svelte v4 ||| [README](https://github.com/nerdslabs/teiler/blob/master/packages/svelte/README.md) |
| VueJS ||| [README](https://github.com/nerdslabs/teiler/blob/master/packages/vue/README.md) |
| SolidJS ||| --- |
| React ||| --- |

<ThemeProvider {theme}>
<Component>Some test text</Component>
</ThemeProvider>

// Component with theme usage
import { component } from '@teiler/svelte'

const Component = component.div`
color: ${({ theme }) => theme.fontColor};
`

export { Component }
```

To add typing for Typescript applications you need to add `extend` inside declaration file (`d.ts`)
```typescript
import type { CustomTheme } from "./App.svelte";

declare module '@teiler/core' {
export interface DefaultTheme extends CustomTheme {}
}
```
> [!NOTE]
> CSR - Client Side Rendering*\
> SSR - Server Side Rendering*
## Sew a Pattern

Expand All @@ -148,7 +81,7 @@ export default ButtonPattern
// Usage of Pattern
import { ButtonPattern } from 'some-uikit-library'
import { sew } from '@teiler/core'
import { createComponent } from '@teiler/svelte'
import { createComponent } from '@teiler/framework'

const Button = sew(ButtonPattern, createComponent)

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"wait": "wait-on tcp:6006 && wait-on tcp:6007"
},
"devDependencies": {
"@changesets/changelog-github": "^0.5.0",
"@storybook/html-vite": "^8.1.1",
"@typescript-eslint/eslint-plugin": "^6.21.0",
"@typescript-eslint/parser": "^6.21.0",
Expand Down
10 changes: 10 additions & 0 deletions packages/core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# @teiler/core

## 0.0.22

### Patch Changes

- Make `theme` in `Arguments` optional

- Fix `compile` function when property is object

- Fix typings

## 0.0.21

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@teiler/core",
"version": "0.0.21",
"version": "0.0.22",
"repository": {
"type": "git",
"url": "github:nerdslabs/teiler"
Expand Down
9 changes: 9 additions & 0 deletions packages/svelte/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# @teiler/svelte

## 0.0.22

### Patch Changes

- Add tests

- Updated dependencies []:
- @teiler/core@0.0.22

## 0.0.21

### Patch Changes
Expand Down
143 changes: 142 additions & 1 deletion packages/svelte/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,142 @@
# svelte
# Teiler 🪡 (ˈteɪlər - tailor)

![Discord](https://img.shields.io/discord/1125416414069661698?logo=discord&link=https%3A%2F%2Fdiscord.gg%2FJ6Sv9sQ64t)

**Teiler** is an open source library that simplifies the creation of stylish components for various frameworks.

Currently in the **alpha phase**, the library is actively being developed and improved. It currently provides support solely for Svelte CSR (Client-Side Rendering).

Join our community on our [Discord Server](https://discord.gg/J6Sv9sQ64t) to stay informed about the latest developments, exchange ideas, and connect with fellow developers. We are continuously working on expanding our support to include more frameworks, allowing developers to effortlessly create components across various environments.

### Example

```typescript
import { component } from '@teiler/svelte'

const Button = component.button<{
_primary: boolean
}>`
display: inline-block;
border-radius: 4px;
font-size: 0.8rem;
line-height: 1.5rem;
background: transparent;
box-shadow: 0 0 0 3px #CBCBCB inset;
${({ _primary }) =>
_primary && `
color: #fff;
box-shadow: none;
background: #CBCBCB;
`
}
`
```

## Keyframes

```typescript
import { component, keyframes } from '@teiler/svelte'

const bouncing = keyframes`
from, 20%, 53%, 80%, to {
transform: translate3d(0,0,0);
}
40%, 43% {
transform: translate3d(0, -40px, 0);
}
70% {
transform: translate3d(0, -15px, 0);
}
90% {
transform: translate3d(0,-4px,0);
}
`

const Button = component.button<{}>`
animation: ${bouncing} 1s ease infinite;
display: inline-block;
border-radius: 4px;
font-size: 0.8rem;
line-height: 1.5rem;
background: transparent;
box-shadow: 0 0 0 3px #CBCBCB inset;
`
```

## Theme

Example how to use themes.

```typescript
// Main component inside application (`App.svelte`)
<script context="module" lang="ts">
export type CustomTheme = {
fontColor: string,
}
</script>
<script lang="ts">
import { ThemeProvider } from '@teiler/svelte'
import { Component } from './theme'

export let theme: CustomTheme = {
fontColor: 'red',
}
</script>

<ThemeProvider {theme}>
<Component>Some test text</Component>
</ThemeProvider>

// Component with theme usage
import { component } from '@teiler/svelte'

const Component = component.div`
color: ${({ theme }) => theme.fontColor};
`

export { Component }
```

To add typing for Typescript applications you need to add `extend` inside declaration file (`d.ts`)
```typescript
import type { CustomTheme } from "./App.svelte";

declare module '@teiler/core' {
export interface DefaultTheme extends CustomTheme {}
}
```

## Sew a Pattern

This tool simplifies the creation of consistent and reusable visual styles for components across various web frameworks. It provides a pattern-based approach, where patterns serve as blueprints for defining the visual style of components.

### Example

```typescript
// Pattern file in ui kit library
import { pattern } from '@teiler/core'

const ButtonPattern = pattern.button`
display: inline-block;
border-radius: 4px;
font-size: 0.8rem;
line-height: 1.5rem;
background: transparent;
box-shadow: 0 0 0 3px #CBCBCB inset;
`

export default ButtonPattern

// Usage of Pattern
import { ButtonPattern } from 'some-uikit-library'
import { sew } from '@teiler/core'
import { createComponent } from '@teiler/svelte'

const Button = sew(ButtonPattern, createComponent)

export default Button
```
4 changes: 2 additions & 2 deletions packages/svelte/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@teiler/svelte",
"version": "0.0.21",
"version": "0.0.22",
"repository": {
"type": "git",
"url": "github:nerdslabs/teiler"
Expand All @@ -24,7 +24,7 @@
"build-storybook": "storybook build"
},
"dependencies": {
"@teiler/core": "0.0.21",
"@teiler/core": "0.0.22",
"svelte": "^4.2.10"
},
"devDependencies": {
Expand Down
7 changes: 7 additions & 0 deletions packages/vue/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# @teiler/vue

## 0.0.1

### Patch Changes

- Vue support
4 changes: 2 additions & 2 deletions packages/vue/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@teiler/vue",
"version": "0.0.0",
"version": "0.0.1",
"repository": {
"type": "git",
"url": "github:nerdslabs/teiler"
Expand All @@ -24,7 +24,7 @@
"build-storybook": "storybook build"
},
"dependencies": {
"@teiler/core": "0.0.21"
"@teiler/core": "0.0.22"
},
"devDependencies": {
"@chromatic-com/storybook": "^1.3.4",
Expand Down
Loading

0 comments on commit e514bb8

Please sign in to comment.