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
23 changes: 23 additions & 0 deletions @codexteam/ui/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Dependencies
node_modules/

# Build output
dist/

# Logs
*.log

# Test app (internal testing only)
test-app/

# Editor
.idea/
.vscode/
*.sw?

# OS
.DS_Store

# Environment
.env
.env.local
1 change: 1 addition & 0 deletions @codexteam/ui/.npmignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
dev/
test-app/
node_modules/
src/
*.log
Expand Down
120 changes: 103 additions & 17 deletions @codexteam/ui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,50 +4,136 @@ The Design System forged in the fires of open-source development

Demo: https://cdx-ui.vercel.app/

- [ ] Make tree-shaking work
- [x] Make tree-shaking work
- [ ] Test Web/React/Native implementations
- [ ] Think about i18n

## Access Vue components
## Installation

```ts
import { Button, Input, Heading } from '@codexteam/ui/vue';
```bash
npm install @codexteam/ui
# or
yarn add @codexteam/ui
```

## Quick Start

### 1. Import Base Styles (Required)

```typescript
// main.ts
import '@codexteam/ui/styles';
```
Comment on lines +21 to +26
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation doesn't mention that users need to handle font imports separately. Since fonts were moved to a separate fonts.pcss file that is not included in the base styles, users will not have access to the Inter and JetBrains Mono fonts unless they explicitly import them. The README should be updated to document how fonts should be imported, or fonts should be included in the base styles export.

Copilot uses AI. Check for mistakes.

### 2. Import Themes (Tree-shakeable)

Import only the themes you need - others will NOT be included in the bundle:

```typescript
import '@codexteam/ui/styles/themes/pure';
import '@codexteam/ui/styles/themes/grass';
```

**Available themes:** `graphite`, `crimson`, `red`, `violet`, `grass`, `amber`, `pure`, `sky`

### 3. Import Components (Tree-shakeable)

```typescript
import { Button, Avatar, Heading } from '@codexteam/ui/vue';
```

### 4. Apply Theme in Template

```vue
<template>
<div color-scheme="light" theme-accent="pure" theme-base="grass">
<Button>Click me</Button>
</div>
</template>
```

## Complete Example

**main.ts:**
```typescript
import { createApp } from 'vue';
import App from './App.vue';

// Base styles (required)
import '@codexteam/ui/styles';

// Themes (import only what you need)
import '@codexteam/ui/styles/themes/pure';
import '@codexteam/ui/styles/themes/grass';

createApp(App).mount('#app');
```

**App.vue:**
```vue
<Heading :level="2">
CodeX UI showcase
</Heading>
<Button text="Button text" />
<Input text="Input text" />
<script setup lang="ts">
import { Button, Heading, Input } from '@codexteam/ui/vue';
</script>

<template>
<div color-scheme="light" theme-accent="pure" theme-base="grass">
<Heading :level="2">CodeX UI showcase</Heading>
<Button>Button text</Button>
<Input placeholder="Input text" />
</div>
</template>
```

## Types for Vue Components

Add the following "path" to the "tsconfig.json"

```
```json
{
"compilerOptions": {
"paths": {
"@codexteam/ui/vue": ["../@codexteam/ui/dist/types/vue/index.d.ts"],
"@codexteam/ui/vue": ["../@codexteam/ui/dist/types/vue/index.d.ts"]
}
},
}
}

```

## Build Design System
Build the design system to be able to use the @codexteam/ui/styles import

```
```bash
yarn build
```

## Access CSS variables
## Custom Theming

If you don't want to use built-in themes, define your own CSS variables:

```css
:root {
/* Base colors */
--base--bg-primary: #ffffff;
--base--bg-secondary: #f5f5f5;
--base--bg-secondary-hover: #eeeeee;
--base--border: #e0e0e0;
--base--text: #333333;
--base--text-secondary: #666666;
--base--solid: #000000;
--base--text-solid-foreground: #ffffff;

/* Accent colors */
--accent--solid: #2196f3;
--accent--solid-hover: #1976d2;
--accent--bg-secondary: #e3f2fd;
--accent--text-solid-foreground: #ffffff;
}
```

## Access CSS Variables

1. Import `@codexteam/ui/styles` somewhere in App
2. Use variable in CSS, e.g `var(--ui-color)`
1. Import `@codexteam/ui/styles` in your app
2. Import themes you need (e.g., `@codexteam/ui/styles/themes/pure`)
3. Use variables in CSS: `var(--base--text)`, `var(--accent--solid)`

## Using Typography

Expand Down
2 changes: 2 additions & 0 deletions @codexteam/ui/dev/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
<script type="module">
import { createApp } from 'vue';
import { createRouter, createWebHashHistory } from 'vue-router';
import "../src/styles/fonts.pcss";
import "../src/styles/index.pcss";
import "../src/styles/themes/index.pcss";
Comment on lines +13 to +15
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to update the README as well?


import Playground from './Playground.vue';
import routes from './routes';
Expand Down
37 changes: 32 additions & 5 deletions @codexteam/ui/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
{
"name": "@codexteam/ui",
"version": "0.1.1",
"version": "0.2.0",
"type": "module",
"sideEffects": [
"*.css",
"*.pcss"
],
"scripts": {
"dev": "vite",
"build": "yarn build-src && yarn build-types",
Expand All @@ -17,12 +21,35 @@
],
"exports": {
"./vue": {
"import": {
"default": "./dist/vue.js"
}
"types": "./dist/types/vue/index.d.ts",
"import": "./dist/vue.js"
},
"./styles": {
"import": "./dist/styles.css"
"import": "./dist/style.css"
},
"./styles/themes/graphite": {
"import": "./dist/styles/themes/graphite.css"
},
"./styles/themes/crimson": {
"import": "./dist/styles/themes/crimson.css"
},
"./styles/themes/red": {
"import": "./dist/styles/themes/red.css"
},
"./styles/themes/violet": {
"import": "./dist/styles/themes/violet.css"
},
"./styles/themes/grass": {
"import": "./dist/styles/themes/grass.css"
},
"./styles/themes/amber": {
"import": "./dist/styles/themes/amber.css"
},
"./styles/themes/pure": {
"import": "./dist/styles/themes/pure.css"
},
"./styles/themes/sky": {
"import": "./dist/styles/themes/sky.css"
}
},
"devDependencies": {
Expand Down
2 changes: 2 additions & 0 deletions @codexteam/ui/src/styles/fonts.pcss
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@import url('../fonts/Inter/inter.css');
@import url('../fonts/JetBrainsMono/JetBrainsMono.css');
1 change: 0 additions & 1 deletion @codexteam/ui/src/styles/index.pcss
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
@import './themes/index.pcss';
@import './dimensions.pcss';
@import './typography.pcss';
@import './mixins.pcss';
Expand Down
2 changes: 0 additions & 2 deletions @codexteam/ui/src/styles/typography.pcss
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
@import url('../fonts/Inter/inter.css');
@import url('../fonts/JetBrainsMono/JetBrainsMono.css');

Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Font imports have been removed from typography.pcss and moved to fonts.pcss, but fonts.pcss is not being imported in the base styles (index.pcss). This means that when consumers import '@codexteam/ui/styles', they will not get the required font files. Either add fonts.pcss to the vite.config.ts rollup input as a separate entry point, or re-add the font imports back to typography.pcss.

Copilot uses AI. Check for mistakes.
/**
* Fonts setup
Expand Down
Loading
Loading