Repository navigation
feat: Extract UI components from trakli/webui with Nuxt playground explorer #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Lantum-Brendan
wants to merge
29
commits into
trakli:master
from
Lantum-Brendan:feat/extract-components-from-trakli-webui
Closed
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
487bf70
feat: Extract UI components from trakli/webui with Nuxt playground ex…
Lantum-Brendan 31aa5b4
test: Fix Cypress component tests (event listener + asset path assert…
Lantum-Brendan 8aa3dc6
fix: Inline SVG assets and use design tokens for themeability
Lantum-Brendan 227ddfc
fix: replace hardcoded hex with design tokens and dogfood kit compone…
Lantum-Brendan 33bf10a
fix: add demo configs for GoogleIcon and SettingsDisplay in playgroun…
Lantum-Brendan de17fee
docs: update README to reflect shipped components
Lantum-Brendan 27398ca
refactor(components): extract structural T* primitives and migrate do…
Lantum-Brendan 6932fe9
fix: remove hardcoded currency rates from TTableComponent, add conver…
Lantum-Brendan 57e848d
fix: update CI workflow to use Node 22 LTS instead of deprecated Node 20
Lantum-Brendan fdfeb8f
fix: add legacy CSS class names to T* components for backward-compati…
Lantum-Brendan 6cde7fa
feat: migrate Tier A AI chat blocks and onboarding wizard
Lantum-Brendan c67be3c
feat: migrate Tier B AI and import components
Lantum-Brendan 2fc3d8f
fix: ImportSessionsList badge function and demo data
Lantum-Brendan 8483ff3
fix: add missing T* component demos and overflow containment
Lantum-Brendan ab3d4a9
feat(components): extract presentational components and shells from w…
Lantum-Brendan c58802e
fix(package): ship composables and utils and make lucide tree-shakable
Lantum-Brendan b77e653
fix(styles): add surface fallback tokens and fix TFormField BEM
Lantum-Brendan c6b755b
fix(a11y): add tabs semantics and roving tabindex
Lantum-Brendan abf0101
refactor(tabs): migrate domain tabs onto TTabList/TTabPanel
Lantum-Brendan b10e4c1
fix(forms): use local wall-clock for date/time inputs
Lantum-Brendan 36f41e8
fix(charts): stabilize ids for SSR and fix Sankey overflow
Lantum-Brendan 4a7284c
fix: consolidate fill helpers, centralize lucide icons and add surfac…
Lantum-Brendan 0d5a91a
fix(ContentSection): make controlled and fix scroll target
Lantum-Brendan a400e32
refactor: extract embedded sections into dedicated subcomponents
Lantum-Brendan e6a2ff4
refactor(forms+table): rebuild on TForm/TTab primitives and extract t…
Lantum-Brendan 483e1be
feat(playground): add full demo coverage for all 196 components
Lantum-Brendan a0e0623
docs(stories): add Storybook stories for all components
Lantum-Brendan 6b14f7f
test: add Cypress component tests for 87 components
Lantum-Brendan bdceb74
fix(storybook): remove duplicate stories glob and mirror
Lantum-Brendan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,157 @@ | ||||||
| <script setup> | ||||||
| import { computed, ref, h, onErrorCaptured, markRaw } from 'vue'; | ||||||
| import { components, getDemo, slottedComponents } from '../registry'; | ||||||
| import UsageLanding from './UsageLanding.vue'; | ||||||
|
|
||||||
| const props = defineProps({ | ||||||
| selected: { type: String, default: '' } | ||||||
| }); | ||||||
|
|
||||||
| defineEmits(['select-category']); | ||||||
|
|
||||||
| const meta = computed(() => components.find((c) => c.name === props.selected) || null); | ||||||
| const isSlotted = computed(() => meta.value && slottedComponents.has(meta.value.name)); | ||||||
| const demo = computed(() => (meta.value ? getDemo(meta.value.name) : { props: {} })); | ||||||
|
|
||||||
| // Per-render error boundary: a single component that throws during render | ||||||
| // must not take down the whole dashboard (which forced a manual refresh). | ||||||
| const renderError = ref(null); | ||||||
|
|
||||||
| onErrorCaptured((err) => { | ||||||
| renderError.value = err && err.message ? err.message : String(err); | ||||||
| return false; | ||||||
| }); | ||||||
|
|
||||||
| // Reset any prior error whenever the selection changes. | ||||||
| const selectedKey = computed(() => props.selected); | ||||||
| import { watch } from 'vue'; | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Move this import to the top of the script block to follow standard style guides and improve readability.
Suggested change
|
||||||
| watch(selectedKey, () => { renderError.value = null; }); | ||||||
| </script> | ||||||
|
|
||||||
| <template> | ||||||
| <div v-if="!meta" class="usage-wrap"> | ||||||
| <UsageLanding @select-category="$emit('select-category', $event)" /> | ||||||
| </div> | ||||||
|
|
||||||
| <div v-else-if="renderError" class="error-hint"> | ||||||
| <h3>This component could not be previewed</h3> | ||||||
| <p>{{ meta.name }} threw during render:</p> | ||||||
| <pre>{{ renderError }}</pre> | ||||||
| <p class="error-hint__note"> | ||||||
| It likely needs a data shape (e.g. a <code>budget</code>/<code>party</code>/<code>wallet</code> | ||||||
| object) not yet provided in the playground registry. | ||||||
| </p> | ||||||
| </div> | ||||||
|
|
||||||
| <!-- Slotted / composite demos need real template fragments --> | ||||||
| <div v-else-if="isSlotted" class="demo"> | ||||||
| <div v-if="meta.name === 'TButton'" class="btn-row"> | ||||||
| <TButton text="Primary" variant="primary" :full-width="false" /> | ||||||
| <TButton text="Secondary" variant="secondary" :full-width="false" /> | ||||||
| <TButton text="Outline" variant="outline" :full-width="false" /> | ||||||
| <TButton text="Loading" loading :full-width="false" /> | ||||||
| <TButton text="Disabled" disabled :full-width="false" /> | ||||||
| </div> | ||||||
|
|
||||||
| <TCard v-else-if="meta.name === 'TCard'" title="Card title">Card body content</TCard> | ||||||
|
|
||||||
| <TInfoButton v-else-if="meta.name === 'TInfoButton'" text="Info" :full-width="false" /> | ||||||
|
|
||||||
| <TContainer v-else-if="meta.name === 'TContainer'"> | ||||||
| <TStack> | ||||||
| <TCard title="Stacked">One</TCard> | ||||||
| <TCard title="Stacked">Two</TCard> | ||||||
| </TStack> | ||||||
| </TContainer> | ||||||
|
|
||||||
| <TStack v-else-if="meta.name === 'TStack'"> | ||||||
| <TCard title="Stacked">One</TCard> | ||||||
| <TCard title="Stacked">Two</TCard> | ||||||
| </TStack> | ||||||
|
|
||||||
| <TGrid v-else-if="meta.name === 'TGrid'"> | ||||||
| <TCard title="Grid">A</TCard> | ||||||
| <TCard title="Grid">B</TCard> | ||||||
| </TGrid> | ||||||
|
|
||||||
| <TSplit v-else-if="meta.name === 'TSplit'"> | ||||||
| <template #master><TCard title="Master">M</TCard></template> | ||||||
| <template #detail><TCard title="Detail">D</TCard></template> | ||||||
| </TSplit> | ||||||
|
|
||||||
| <TPanel v-else-if="meta.name === 'TPanel'" title="Panel">Panel content</TPanel> | ||||||
|
|
||||||
| <TPageShell v-else-if="meta.name === 'TPageShell'" title="Page shell"> | ||||||
| <TCard title="Inside">Shell body</TCard> | ||||||
| </TPageShell> | ||||||
|
|
||||||
| <TDropdown v-else-if="meta.name === 'TDropdown'" text="Menu" :full-width="false"> | ||||||
| <TDropdownItem text="Action one" /> | ||||||
| <TDropdownItem text="Action two" /> | ||||||
| </TDropdown> | ||||||
|
|
||||||
| <TTabs v-else-if="meta.name === 'TTabs'" v-bind="demo.props"> | ||||||
| <template #first><TCard title="First">First panel</TCard></template> | ||||||
| <template #second><TCard title="Second">Second panel</TCard></template> | ||||||
| </TTabs> | ||||||
|
|
||||||
| <CollapsibleSection v-else-if="meta.name === 'CollapsibleSection'" title="Section"> | ||||||
| Collapsible content | ||||||
| </CollapsibleSection> | ||||||
|
|
||||||
| <TModalBody v-else-if="meta.name === 'TModalBody'"> | ||||||
| <p>Modal body content goes here.</p> | ||||||
| </TModalBody> | ||||||
|
|
||||||
| <TModalFooter v-else-if="meta.name === 'TModalFooter'"> | ||||||
| <TButton text="Cancel" variant="outline" :full-width="false" /> | ||||||
| <TButton text="Confirm" variant="primary" :full-width="false" /> | ||||||
| </TModalFooter> | ||||||
|
|
||||||
| <TFormRow v-else-if="meta.name === 'TFormRow'"> | ||||||
| <TFormField label="Name" /> | ||||||
| <TFormField label="Email" /> | ||||||
| </TFormRow> | ||||||
| </div> | ||||||
|
|
||||||
| <!-- Generic: render with demo props --> | ||||||
| <div v-else class="demo"> | ||||||
| <component :is="meta.component" v-bind="demo.props" /> | ||||||
| </div> | ||||||
| </template> | ||||||
|
|
||||||
| <style scoped> | ||||||
| .demo { | ||||||
| padding: 2rem; | ||||||
| overflow-x: hidden; | ||||||
| } | ||||||
| .btn-row { | ||||||
| display: flex; | ||||||
| flex-wrap: wrap; | ||||||
| gap: 0.75rem; | ||||||
| align-items: center; | ||||||
| } | ||||||
| .usage-wrap { | ||||||
| padding: 1rem 0; | ||||||
| } | ||||||
| .error-hint { | ||||||
| padding: 2rem; | ||||||
| color: var(--color-error-dark); | ||||||
| } | ||||||
| .error-hint h3 { | ||||||
| margin-top: 0; | ||||||
| } | ||||||
| .error-hint pre { | ||||||
| background: rgba(var(--color-error-rgb), 0.08); | ||||||
| border: 1px solid rgba(var(--color-error-rgb), 0.2); | ||||||
| border-radius: 0.5rem; | ||||||
| padding: 0.75rem 1rem; | ||||||
| overflow-x: auto; | ||||||
| font-size: 0.8rem; | ||||||
| white-space: pre-wrap; | ||||||
| } | ||||||
| .error-hint__note { | ||||||
| color: var(--color-text-muted); | ||||||
| font-size: 0.85rem; | ||||||
| } | ||||||
| </style> | ||||||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.