Skip to content

Commit 88aefdc

Browse files
author
Sebastian BURGIN-FIX (ext)
committed
Sync design system from flows.portal
1 parent 231036b commit 88aefdc

40 files changed

Lines changed: 1840 additions & 294 deletions

README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,38 @@ import { pushToast } from '@codebar-ag/storybook-docuhub';
5656
pushToast({ message: 'Saved.', type: 'success' });
5757
```
5858

59+
## Before building new UI in a consuming app
60+
61+
Component-based consistency is the point of this package: every app should look
62+
identical because every app is built from the same atoms.
63+
64+
1. **Check Storybook first.** Run `npm run dev` in this package (or open the
65+
deployed styleguide) and search `src/index.ts`'s barrel export before writing
66+
any markup for a new screen or feature.
67+
2. **Never re-implement an atom.** If this package already ships a `Button`,
68+
`Card`, `Table`, `Badge`, `Modal`, form field, dropdown, icon, list-row, metric,
69+
or alert, the consuming app must import and use it — not hand-roll an
70+
equivalent with raw `<button>`/`<table>`/`<div>` + Tailwind classes.
71+
3. **Compose, don't fork.** If an atom is close but not quite right, extend it via
72+
its existing props/slots/`class` overrides. Don't copy its template into the
73+
app and tweak it.
74+
4. **Domain-specific "organisms"** (billing panels, instance rows, resource lists,
75+
…) stay in the consuming app, but must be assembled only from these atoms,
76+
never from raw HTML elements.
77+
78+
## Proposing a new atom
79+
80+
Only add a component here when no existing atom (or composition of atoms) can
81+
satisfy the need. A new atom must:
82+
83+
- Live in `src/components/` as a `<script setup>` Vue 3 SFC.
84+
- Be styled only with token-driven Tailwind utility classes — no `<style>` blocks,
85+
no `@apply`, no bespoke CSS.
86+
- Ship a `*.stories.ts` entry documenting its variants.
87+
- Pass `npm run typecheck` and `npm run lint`.
88+
- Be exported from `src/index.ts` (and registered on the `Flows` plugin if it's a
89+
globally-usable atom).
90+
5991
## Develop
6092

6193
```bash

eslint.config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ export default ts.config(
1717
rules: {
1818
// Atoms are intentionally single-word (Button, Card, Icon…).
1919
'vue/multi-word-component-names': 'off',
20+
// `const { class: _omit, ...rest } = attrs` discards `class` on purpose.
21+
'@typescript-eslint/no-unused-vars': ['error', { varsIgnorePattern: '^_', argsIgnorePattern: '^_' }],
2022
},
2123
},
2224
);

0 commit comments

Comments
 (0)