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
11 changes: 4 additions & 7 deletions apps/storybook/.storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import tailwindcss from '@tailwindcss/vite'
import vue from '@vitejs/plugin-vue'

/** @type {import('@storybook/vue3-vite').StorybookConfig} */
Expand Down Expand Up @@ -45,13 +46,9 @@ const config = {
config.plugins.splice(docgenIdx, 0, vue())
}

// Dev channel: stories still import from '@aziontech/webkit/*'; redirect to the renamed
// workspace package '@aziontech/webkit.dev/*' so no story file needs to change.
config.resolve = config.resolve || {}
config.resolve.alias = {
...(config.resolve.alias || {}),
'@aziontech/webkit': '@aziontech/webkit.dev'
}
// Tailwind v4 CSS-first pipeline: resolves `@import "tailwindcss"` in
// `@aziontech/theme/globals.css` and scans project sources for utility usage.
config.plugins.push(tailwindcss())

// Enable dependency pre-bundling for faster rebuilds
config.optimizeDeps = {
Expand Down
18 changes: 1 addition & 17 deletions apps/storybook/.storybook/preview.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,13 @@
import { setup } from '@storybook/vue3'
import PrimeVue from 'primevue/config'
import Tooltip from 'primevue/tooltip'
import { withThemeByClassName } from '@storybook/addon-themes'

// v3 token build: primitives, --bg-* / --text-* / --border-*, and .text-body-md etc.
// (replaces injectCssVars(), which only emitted --background-* aliases — webkit components use --bg-*)
import '@aziontech/theme/globals.css'
import 'primeflex/primeflex.css'
import '../src/styles/preview.css'
import '@aziontech/theme'
Comment thread
isaquebock marked this conversation as resolved.
import '@aziontech/icons'
import '@aziontech/webkit/styles/country-flags'

setup((app) => {
app.use(PrimeVue, {
ripple: false
})

app.directive('tooltip', Tooltip)
})

export const parameters = {
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/i
},
expanded: true
Expand Down Expand Up @@ -77,7 +61,7 @@ export const parameters = {
order: [
'Get Started',
'Foundations',
['Colors', 'Spacing', 'Typography', 'Icons'],
['Colors', 'Theme', 'Spacing', 'Typography', 'Icons'],
'Components',
'Site'
]
Expand Down
6 changes: 3 additions & 3 deletions apps/storybook/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This is the Storybook documentation application for the `@aziontech/webkit` component library. It provides an interactive documentation and development environment for all webkit components, foundations, and composed templates.

> This app consumes the **dev channel** of the library. Stories import from `@aziontech/webkit/*`, which Storybook aliases to the workspace package `@aziontech/webkit.dev` (see `.storybook/main.js`). You don't need to change import paths in stories.
> Stories import from `@aziontech/webkit/*`, resolved from the workspace package `@aziontech/webkit`.

## Technology Stack

Expand All @@ -12,7 +12,7 @@ This is the Storybook documentation application for the `@aziontech/webkit` comp
- **Tailwind CSS 3.3.x** — Utility-first CSS;
- **Sass 1.86.x** — Stylesheet preprocessor;
- **PrimeVue 3.35.0 / PrimeFlex 3.3.x / VeeValidate 4.15.x** — power the legacy `Field*` / `Input*` form stories;
- **Internal workspace packages** — `@aziontech/webkit.dev` (components), `@aziontech/icons` (icon set), `@aziontech/theme` (design tokens & theming).
- **Internal workspace packages** — `@aziontech/webkit` (components), `@aziontech/icons` (icon set), `@aziontech/theme` (design tokens & theming).

Key Storybook addons: `@storybook/addon-essentials`, `@storybook/addon-links`, `@storybook/addon-themes`, `@whitespace/storybook-addon-html`.

Expand Down Expand Up @@ -176,7 +176,7 @@ export const Default = {
};
```

> Imports use the `@aziontech/webkit/*` paths; Storybook resolves them to `@aziontech/webkit.dev` automatically. New component stories follow the canonical `Button.stories.js` shape — see [`.claude/skills/storybook-write`](../../.claude/skills/storybook-write/SKILL.md).
> Imports use the `@aziontech/webkit/*` paths. New component stories follow the canonical `Button.stories.js` shape — see [`.claude/skills/storybook-write`](../../.claude/skills/storybook-write/SKILL.md).

## Adding New Stories

Expand Down
11 changes: 4 additions & 7 deletions apps/storybook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "storybook",
"version": "0.1.0",
"private": true,
"description": "Storybook documentation for @aziontech/webkit.dev component library",
"description": "Storybook documentation for @aziontech/webkit component library",
"license": "MIT",
"type": "module",
"scripts": {
Expand All @@ -13,13 +13,10 @@
"dependencies": {
"@aziontech/icons": "workspace:*",
"@aziontech/theme": "workspace:*",
"@aziontech/webkit.dev": "workspace:*",
"@aziontech/webkit": "workspace:*",
"@storybook/manager-api": "^8.6.14",
"@tailwindcss/typography": "^0.5.10",
"@whitespace/storybook-addon-html": "^7.0.0",
"primeflex": "^3.3.1",
"primevue": "3.35.0",
"tailwindcss": "^3.3.3",
"tailwindcss": "^4.0.0",
"vee-validate": "^4.15.1",
"vue": "^3.5.29"
},
Expand All @@ -30,8 +27,8 @@
"@storybook/test": "^8.6.15",
"@storybook/vue3": "^8.6.0",
"@storybook/vue3-vite": "^8.6.0",
"@tailwindcss/vite": "^4.0.0",
"@vitejs/plugin-vue": "^5.2.4",
"autoprefixer": "^10.4.27",
"http-server": "^14.1.1",
"sass": "^1.86.0",
"storybook": "^8.6.0",
Expand Down
6 changes: 0 additions & 6 deletions apps/storybook/postcss.config.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<section class="mb-[var(--spacing-xxl)]">
<div class="mb-[var(--spacing-md)]">
<h2
class="m-0 mb-[var(--spacing-xs)] border-b border-[var(--border-default)] pb-[var(--spacing-xs)] !text-overline-md text-[var(--text-muted)]"
class="m-0 mb-[var(--spacing-xs)] border-b border-[var(--border-default)] pb-[var(--spacing-xs)] text-overline-md! text-[var(--text-muted)]"
>
{{ title }}
</h2>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ function isCopied(key) {
@click="copyToClipboard(selectedToken?.tailwindClass, 'tw')"
>
<code class="font-code text-[11px] border bg-white/10 border-white/15 text-code px-1.5 py-0.5 rounded">{{ selectedToken?.tailwindClass }}</code>
<i :class="['pi text-[11px] opacity-0 group-hover:!opacity-50', isCopied('tw') ? 'pi-check text-success' : 'pi-copy']" />
<i :class="['pi text-[11px] opacity-0 group-hover:opacity-50!', isCopied('tw') ? 'pi-check text-success' : 'pi-copy']" />
</button>
</div>

Expand All @@ -164,7 +164,7 @@ function isCopied(key) {
@click="copyToClipboard(selectedToken?.cssVar, 'css')"
>
<code class="font-code text-[11px] border bg-white/10 border-white/15 text-code px-1.5 py-0.5 rounded">{{ selectedToken?.cssVar }}</code>
<i :class="['pi text-[11px] opacity-0 group-hover:!opacity-50', isCopied('css') ? 'pi-check text-success' : 'pi-copy']" />
<i :class="['pi text-[11px] opacity-0 group-hover:opacity-50!', isCopied('css') ? 'pi-check text-success' : 'pi-copy']" />
</button>
</div>

Expand Down
6 changes: 3 additions & 3 deletions apps/storybook/src/foundations/components/IconGrid.vue
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ function isCopied(name) {
<span class="text-[9px] font-code text-muted text-center leading-tight w-full px-1 truncate max-w-20">{{ icon.name.replace('ai-', '') }}</span>
<i :class="[
'absolute top-1.5 right-1.5 text-[10px] transition-opacity duration-100',
isCopied(icon.name) ? 'pi pi-check !opacity-100 text-success' : 'pi pi-copy opacity-0 group-hover:opacity-50'
isCopied(icon.name) ? 'pi pi-check opacity-100! text-success' : 'pi pi-copy opacity-0 group-hover:opacity-50'
]" />
</button>
</div>
Expand Down Expand Up @@ -161,7 +161,7 @@ function isCopied(name) {
<span class="text-[9px] font-code text-muted text-center leading-tight w-full px-1 truncate max-w-20">{{ icon.name.replace('ai-', '') }}</span>
<i :class="[
'absolute top-1.5 right-1.5 text-[10px] transition-opacity duration-100',
isCopied(icon.name) ? 'pi pi-check !opacity-100 text-success' : 'pi pi-copy opacity-0 group-hover:opacity-50'
isCopied(icon.name) ? 'pi pi-check opacity-100! text-success' : 'pi pi-copy opacity-0 group-hover:opacity-50'
]" />
</button>
</div>
Expand Down Expand Up @@ -189,7 +189,7 @@ function isCopied(name) {
<span class="text-[9px] font-code text-muted text-center leading-tight w-full px-1 truncate max-w-20">{{ icon.name.replace('pi-', '') }}</span>
<i :class="[
'absolute top-1.5 right-1.5 text-[10px] transition-opacity duration-100',
isCopied(icon.name) ? 'pi pi-check !opacity-100 text-success' : 'pi pi-copy opacity-0 group-hover:opacity-50'
isCopied(icon.name) ? 'pi pi-check opacity-100! text-success' : 'pi pi-copy opacity-0 group-hover:opacity-50'
]" />
</button>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
<script setup>
import { ref } from 'vue'

defineProps({
title: { type: String, required: true },
description: { type: String, default: '' },
/** Array of { name, description, kind, on }. */
items: { type: Array, default: () => [] }
})

const copiedKey = ref(null)
let copyTimeout = null

function copyToClipboard(value) {
if (!value) return
navigator.clipboard?.writeText(value).catch(() => {})
copiedKey.value = value
if (copyTimeout) clearTimeout(copyTimeout)
copyTimeout = setTimeout(() => {
copiedKey.value = null
}, 1000)
}

// The live token is passed as a CSS custom property, then consumed by the
// token utilities below. Storybook's Tailwind runs with `important: true`, so
// the color has to be a utility (bg-/text-/border-[var(--…)]) — inline styles
// would lose to the !important utilities on the same element.
function swatchVars(item) {
return {
'--swatch-color': `var(${item.name})`,
'--swatch-on': item.on ?? 'var(--bg-surface)'
}
}

// Swatch renders the live token, so it follows the Storybook theme toggle.
function swatchKindClass(item) {
if (item.kind === 'text') {
return 'bg-[var(--swatch-on)] text-[var(--swatch-color)] border-2 border-solid border-[var(--border-muted)]'
}
if (item.kind === 'border') {
return 'bg-[var(--bg-canvas)] border-4 border-solid border-[var(--swatch-color)]'
}
return 'bg-[var(--swatch-color)] border-2 border-solid border-[var(--border-muted)]'
}
</script>

<template>
<section class="mb-[var(--spacing-xxl)]">
<div class="mb-[var(--spacing-md)]">
<h2
class="m-0 mb-[var(--spacing-xs)] border-b border-solid border-[var(--border-default)] pb-[var(--spacing-xs)] text-overline-md! text-[var(--text-muted)]"
>
{{ title }}
</h2>
<p v-if="description" class="m-0 max-w-[var(--container-3xl)] text-body-sm text-[var(--text-muted)]">
{{ description }}
</p>
</div>

<div class="overflow-hidden rounded-[var(--shape-card)] border border-solid border-[var(--border-default)] bg-[var(--bg-surface)]">
<button
v-for="item in items"
:key="item.name"
type="button"
class="flex w-full items-center gap-[var(--spacing-md)] border-b border-solid border-[var(--border-muted)] px-[var(--spacing-md)] py-[var(--spacing-sm)] text-left last:border-b-0 hover:bg-[var(--bg-hover)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring-color)] focus-visible:ring-inset"
:title="copiedKey === item.name ? 'Copied!' : 'Copy CSS variable'"
@click="copyToClipboard(item.name)"
>
<span
:style="swatchVars(item)"
:class="[
'flex h-9 w-14 shrink-0 items-center justify-center rounded-[var(--shape-elements)] font-code text-body-xs',
swatchKindClass(item)
]"
>
<span v-if="item.kind === 'text'">Aa</span>
</span>

<code class="w-[var(--container-3xs)] shrink-0 truncate font-code text-body-sm text-[var(--text-default)]">
{{ copiedKey === item.name ? 'Copied!' : item.name }}
</code>

<span class="text-body-sm text-[var(--text-muted)]">{{ item.description }}</span>
</button>
</div>
</section>
</template>
4 changes: 2 additions & 2 deletions apps/storybook/src/foundations/components/TokenTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function isCopied(key) {
:title="isCopied(`${token.name}-css`) ? 'Copied!' : 'Copy CSS variable'"
>
<code class="font-code text-[11px] border bg-white/10 border-white/15 text-code px-1.5 py-0.5 rounded">{{ token.cssVar }}</code>
<i :class="['pi text-[10px] opacity-0 group-hover:!opacity-50', isCopied(`${token.name}-css`) ? 'pi-check !text-success !opacity-100' : 'pi-copy']" />
<i :class="['pi text-[10px] opacity-0 group-hover:opacity-50!', isCopied(`${token.name}-css`) ? 'pi-check text-success! opacity-100!' : 'pi-copy']" />
</button>
</td>
<td class="px-3.5 py-2.5 border-b border-subtle align-middle">
Expand All @@ -73,7 +73,7 @@ function isCopied(key) {
:title="isCopied(`${token.name}-tw`) ? 'Copied!' : 'Copy Tailwind class'"
>
<code class="font-code text-[11px] border bg-white/10 border-white/15 text-code px-1.5 py-0.5 rounded">{{ token.tailwindClass }}</code>
<i :class="['pi text-[10px] opacity-0 group-hover:!opacity-50', isCopied(`${token.name}-css`) ? 'pi-check !text-success !opacity-100' : 'pi-copy']" />
<i :class="['pi text-[10px] opacity-0 group-hover:opacity-50!', isCopied(`${token.name}-css`) ? 'pi-check text-success! opacity-100!' : 'pi-copy']" />
</button>
</td>
<td class="px-3.5 py-2.5 border-b border-subtle align-middle text-muted text-xs min-w-[200px]">{{ token.description }}</td>
Expand Down
6 changes: 6 additions & 0 deletions apps/storybook/src/foundations/data/theme.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* Semantic theme color catalog — generated from the `@aziontech/theme`
* token resolvers (see ../utils/theme-tokens.js), so the page always reflects
* every color that ships in globals.css.
*/
export { themeColorGroups, buildThemeColorGroups } from '../utils/theme-tokens.js'
Loading
Loading