Closed mrtimbrook closed 2 years ago
To use the color component - use <x-ui-colors />
. It supports a type
prop which supports the values - bg
or background
, text
, border
. If no type is defined it will load all colors in one block.
For Example:
@storybook([
'layout' => 'fullscreen',
'args' => []
])
<x-docs-page
title="Colors"
label="Blast"
description="Documentation for the project's colors"
>
<h2 class="blast-mt-10 blast-text-4xl blast-font-bold">Background (bg) Colors</h2>
<x-ui-colors type="bg" class="blast-mt-3" />
<h2 class="blast-mt-10 blast-text-4xl blast-font-bold">Background (background) Colors</h2>
<x-ui-colors type="background" class="blast-mt-3" />
<h2 class="blast-mt-10 blast-text-4xl blast-font-bold">Text Colors</h2>
<x-ui-colors type="text" class="blast-mt-3" />
<h2 class="blast-mt-10 blast-text-4xl blast-font-bold">Border Colors</h2>
<x-ui-colors type="border" class="blast-mt-3" />
<h2 class="blast-mt-10 blast-text-4xl blast-font-bold">All Colors</h2>
<x-ui-colors type="all" class="blast-mt-3" />
</x-docs-page>
I've updated it so that we use a task to generate the documentation. It'll work in a similar way to the blast:demo
task where it copies files to the stories
directory with the app's other components. The benefits of this are:
blast:generate-stories
task
Work in progress
The Plan
Add a task to parse the tailwind config and automatically generate stories for each section of the tailwind docs (color, typography, grid, etc). Build in a way to add support for other UI frameworks in the future?
Users should be able to:
enable/disable the auto-documentationNo longer required - will be handled by a dedicated task.specify the tailwind config pathspecify which pieces of documentation they would like to renderUse the UI Docs components in the app's own stories to create more curated documentation, for example, using thecolors
UI component in adocs-page
componentIn Progress
Added
UiDataStore
to store the data in the same way as theDataStore
and the UI Docs components can then read from this to generate the documentation.Todo:
Update task to automatically generate theNo longer required - will be handledstories.json
filesblast:generate-stories
taskAdd enable/disable toNo longer required - will be handled by a dedicated task.config/blast.php
Add tailwind config path toconfig/blast.php
Add ability to select areas to auto-document toconfig/blast.php
Build out other components