Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
"[pegjs]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"typescript.tsdk": "node_modules/typescript/lib"
"typescript.tsdk": "node_modules/typescript/lib",
"cSpell.words": ["Tamagui"]
}
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,15 @@

| Package | Description | Version | Dependencies |
|---------|-------------|---------|--------------|
| 📦 [`@rocket.chat/fuselage-core`](/packages/core) | | [![npm](https://img.shields.io/npm/v/@rocket.chat/fuselage-core?style=flat-square)](https://www.npmjs.com/package/@rocket.chat/fuselage-core) | ![deps](https://img.shields.io/librariesio/release/npm/@rocket.chat/fuselage-core?style=flat-square) |
| 📦 [`@rocket.chat/css-in-js`](/packages/css-in-js) | Toolset to transpile and use CSS on runtime | [![npm](https://img.shields.io/npm/v/@rocket.chat/css-in-js?style=flat-square)](https://www.npmjs.com/package/@rocket.chat/css-in-js) | ![deps](https://img.shields.io/librariesio/release/npm/@rocket.chat/css-in-js?style=flat-square) |
| 📦 [`@rocket.chat/css-supports`](/packages/css-supports) | Memoized and SSR-compatible facade of CSS.supports API | [![npm](https://img.shields.io/npm/v/@rocket.chat/css-supports?style=flat-square)](https://www.npmjs.com/package/@rocket.chat/css-supports) | ![deps](https://img.shields.io/librariesio/release/npm/@rocket.chat/css-supports?style=flat-square) |
| 📦 [`@rocket.chat/emitter`](/packages/emitter) | Event Emitter by Rocket.Chat | [![npm](https://img.shields.io/npm/v/@rocket.chat/emitter?style=flat-square)](https://www.npmjs.com/package/@rocket.chat/emitter) | ![deps](https://img.shields.io/librariesio/release/npm/@rocket.chat/emitter?style=flat-square) |
| 📦 [`@rocket.chat/fuselage`](/packages/fuselage) | Rocket.Chat's React Components Library | [![npm](https://img.shields.io/npm/v/@rocket.chat/fuselage?style=flat-square)](https://www.npmjs.com/package/@rocket.chat/fuselage) | ![deps](https://img.shields.io/librariesio/release/npm/@rocket.chat/fuselage?style=flat-square) |
| 📦 [`@rocket.chat/fuselage-hooks`](/packages/fuselage-hooks) | React hooks for Fuselage, Rocket.Chat's design system and UI toolkit | [![npm](https://img.shields.io/npm/v/@rocket.chat/fuselage-hooks?style=flat-square)](https://www.npmjs.com/package/@rocket.chat/fuselage-hooks) | ![deps](https://img.shields.io/librariesio/release/npm/@rocket.chat/fuselage-hooks?style=flat-square) |
| 📦 [`@rocket.chat/fuselage-polyfills`](/packages/fuselage-polyfills) | A bundle of useful poly/ponyfills used by fuselage | [![npm](https://img.shields.io/npm/v/@rocket.chat/fuselage-polyfills?style=flat-square)](https://www.npmjs.com/package/@rocket.chat/fuselage-polyfills) | ![deps](https://img.shields.io/librariesio/release/npm/@rocket.chat/fuselage-polyfills?style=flat-square) |
| 📦 [`fuselage-tamagui`](/packages/fuselage-tamagui) | | [![npm](https://img.shields.io/npm/v/fuselage-tamagui?style=flat-square)](https://www.npmjs.com/package/fuselage-tamagui) | ![deps](https://img.shields.io/librariesio/release/npm/fuselage-tamagui?style=flat-square) |
| 📦 [`@rocket.chat/fuselage-tamagui-tokens`](/packages/fuselage-tamagui-tokens) | Tamagui tokens for Fuselage, Rocket.Chat's | [![npm](https://img.shields.io/npm/v/@rocket.chat/fuselage-tamagui-tokens?style=flat-square)](https://www.npmjs.com/package/@rocket.chat/fuselage-tamagui-tokens) | ![deps](https://img.shields.io/librariesio/release/npm/@rocket.chat/fuselage-tamagui-tokens?style=flat-square) |
| 📦 [`@rocket.chat/fuselage-toastbar`](/packages/fuselage-toastbar) | Fuselage ToastBar component | [![npm](https://img.shields.io/npm/v/@rocket.chat/fuselage-toastbar?style=flat-square)](https://www.npmjs.com/package/@rocket.chat/fuselage-toastbar) | ![deps](https://img.shields.io/librariesio/release/npm/@rocket.chat/fuselage-toastbar?style=flat-square) |
| 📦 [`@rocket.chat/fuselage-tokens`](/packages/fuselage-tokens) | Design tokens for Fuselage, Rocket.Chat's design system | [![npm](https://img.shields.io/npm/v/@rocket.chat/fuselage-tokens?style=flat-square)](https://www.npmjs.com/package/@rocket.chat/fuselage-tokens) | ![deps](https://img.shields.io/librariesio/release/npm/@rocket.chat/fuselage-tokens?style=flat-square) |
| 📦 [`@rocket.chat/icons`](/packages/icons) | Rocket.Chat's Icons | [![npm](https://img.shields.io/npm/v/@rocket.chat/icons?style=flat-square)](https://www.npmjs.com/package/@rocket.chat/icons) | ![deps](https://img.shields.io/librariesio/release/npm/@rocket.chat/icons?style=flat-square) |
Expand Down
4 changes: 4 additions & 0 deletions packages/core/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/dist/
/storybook-static/
/bundle-report*.html
/coverage/
59 changes: 59 additions & 0 deletions packages/core/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<!--header-->

<p align="center">
<a href="https://rocket.chat" title="Rocket.Chat">
<img src="https://github.com/RocketChat/Rocket.Chat.Artwork/raw/master/Logos/2020/png/logo-horizontal-red.png" alt="Rocket.Chat" />
</a>
</p>

# `@rocket.chat/fuselage-core`

---

[![npm@latest](https://img.shields.io/npm/v/@rocket.chat/fuselage-core/latest?style=flat-square)](https://www.npmjs.com/package/@rocket.chat/fuselage-core/v/latest) [![npm@next](https://img.shields.io/npm/v/@rocket.chat/fuselage-core/next?style=flat-square)](https://www.npmjs.com/package/@rocket.chat/fuselage-core/v/next) ![npm downloads](https://img.shields.io/npm/dw/@rocket.chat/fuselage-core?style=flat-square) ![License: undefined](https://img.shields.io/npm/l/@rocket.chat/fuselage-core?style=flat-square)

![deps](https://img.shields.io/librariesio/release/npm/@rocket.chat/fuselage-core?style=flat-square) ![npm bundle size](https://img.shields.io/bundlephobia/min/@rocket.chat/fuselage-core?style=flat-square)

<!--/header-->

## Install

<!--install-->

Add `@rocket.chat/fuselage-core` as a dependency:

```sh
npm i @rocket.chat/fuselage-core

# or, if you are using yarn:

yarn add @rocket.chat/fuselage-core
```

<!--/install-->

## Contributing

<!--contributing(msg)-->

Contributions, issues, and feature requests are welcome!<br />
Feel free to check the [issues](https://github.com/RocketChat/fuselage/issues).

<!--/contributing(msg)-->

### Building

As this package dependends on others in this monorepo, before anything run the following at the root directory:

<!--yarn(build)-->

```sh
yarn build
```

<!--/yarn(build)-->





34 changes: 34 additions & 0 deletions packages/core/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"name": "@rocket.chat/fuselage-core",
"version": "2.0.0",
"sideEffects": [
"*.css"
],
"private": true,
"main": "src/index.tsx",
"module:jsx": "src",
"files": [
"types",
"dist"
],
"scripts": {
"build": "tamagui-build",
"watch": "tamagui-build --watch",
"clean": "rm -rf dist types node_modules .turbo"
},
"dependencies": {
"@shopify/flash-list": "^1.6.3",
"@supabase/supabase-js": "^2.38.4",
"@tamagui/animations-react-native": "1.75.9",
"@tamagui/font-inter": "~1.79.12",
"@tamagui/react-native-media-driver": "1.75.9",
"@tamagui/shorthands": "1.75.9",
"@tamagui/themes": "1.75.9",
"@tamagui/toast": "1.75.9",
"@tanstack/react-virtual": "3.0.0-beta.68",
"jotai": "^2.5.1"
},
"devDependencies": {
"@tamagui/build": "1.75.9"
}
}
14 changes: 14 additions & 0 deletions packages/core/src/MyComponent.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { type TamaguiComponent, Stack, styled } from '@tamagui/core'

export const MyComponent: TamaguiComponent = styled(Stack, {
name: 'MyComponent',
backgroundColor: 'red',

variants: {
blue: {
true: {
backgroundColor: 'blue',
},
},
} as const,
})
9 changes: 9 additions & 0 deletions packages/core/src/global.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { config } from './tamagui.config'

export type Conf = typeof config

declare module 'tamagui' {
interface TamaguiCustomConfig extends Conf {}
}

export default config
3 changes: 3 additions & 0 deletions packages/core/src/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export { config } from './tamagui.config'
export * from '@tamagui/core'
export * from './MyComponent'
79 changes: 79 additions & 0 deletions packages/core/src/tamagui.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
// import { createInterFont } from '@tamagui/font-inter'x/
// import { createMedia } from '@tamagui/react-native-media-driver'
import { shorthands } from '@tamagui/shorthands'
import { themes, tokens } from '@tamagui/themes'
import { createTamagui } from '@tamagui/core'


// const headingFont = createInterFont({
// size: {
// 6: 15,
// },
// transform: {
// 6: 'uppercase',
// 7: 'none',
// },
// weight: {
// 6: '400',
// 7: '700',
// },
// color: {
// 6: '$colorFocus',
// 7: '$color',
// },
// letterSpacing: {
// 5: 2,
// 6: 1,
// 7: 0,
// 8: -1,
// 9: -2,
// 10: -3,
// 12: -4,
// 14: -5,
// 15: -6,
// },
// face: {
// 700: { normal: 'InterBold' },
// },
// })

// const bodyFont = createInterFont(
// {
// face: {
// 700: { normal: 'InterBold' },
// },
// },
// {
// sizeSize: (size) => Math.round(size * 1.1),
// sizeLineHeight: (size) => Math.round(size * 1.1 + (size > 20 ? 10 : 10)),
// }
// )

export const config = createTamagui({
// defaultFont: 'body',
shouldAddPrefersColorThemes: true,
themeClassNameOnRoot: true,
shorthands,
// fonts: {
// body: bodyFont,
// heading: headingFont,
// },
themes,
tokens,
// media: createMedia({
// xs: { maxWidth: 660 },
// sm: { maxWidth: 800 },
// md: { maxWidth: 1020 },
// lg: { maxWidth: 1280 },
// xl: { maxWidth: 1420 },
// xxl: { maxWidth: 1600 },
// gtXs: { minWidth: 660 + 1 },
// gtSm: { minWidth: 800 + 1 },
// gtMd: { minWidth: 1020 + 1 },
// gtLg: { minWidth: 1280 + 1 },
// short: { maxHeight: 820 },
// tall: { minHeight: 820 },
// hoverNone: { hover: 'none' },
// pointerCoarse: { pointer: 'coarse' },
// }),
})
8 changes: 8 additions & 0 deletions packages/core/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"rootDir": "./src"
},
"include": ["./src"],
"exclude": ["./**/*.stories.tsx", "./**/*.spec.tsx"]
}
19 changes: 19 additions & 0 deletions packages/core/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"rootDirs": ["./src", "./.storybook"],
"target": "ES5",
"module": "CommonJS",
"lib": ["ES2020", "DOM"],
"downlevelIteration": true,
"outDir": "./dist",
"esModuleInterop": true,
"skipLibCheck": true,
"moduleResolution": "node",
"resolveJsonModule": true,
"allowJs": true,
"jsx": "react"
},
"include": ["./src", "./.storybook/**/*", "./.jest/**/*"],
"exclude": ["./dist", "./storybook-static/", "./*.js"]
}
3 changes: 3 additions & 0 deletions packages/fuselage-tamagui-tokens/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "@rocket.chat/eslint-config-alt/minimal"
}
4 changes: 4 additions & 0 deletions packages/fuselage-tamagui-tokens/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/dist/
/storybook-static/
/bundle-report.html
/build/
1 change: 1 addition & 0 deletions packages/fuselage-tamagui-tokens/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/dist
1 change: 1 addition & 0 deletions packages/fuselage-tamagui-tokens/.stylelintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist
Loading