Skip to content

Commit b24d492

Browse files
Merge pull request #454 from aziontech/storybook
fix: input space between label, input and descriptions
2 parents 863a629 + 25acd2a commit b24d492

62 files changed

Lines changed: 5732 additions & 979 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

apps/icons-gallery/.gitignore

Lines changed: 0 additions & 4 deletions
This file was deleted.

apps/storybook/.storybook/main.js

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import vue from '@vitejs/plugin-vue';
2+
3+
/** @type {import('@storybook/vue3-vite').StorybookConfig} */
4+
const config = {
5+
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
6+
addons: [
7+
'@storybook/addon-links',
8+
// '@storybook/addon-essentials',
9+
// '@storybook/addon-interactions',
10+
'@storybook/addon-docs',
11+
12+
'@storybook/addon-links',
13+
'@storybook/addon-docs',
14+
// '@chromatic-com/storybook',
15+
'@storybook/addon-themes'
16+
],
17+
framework: {
18+
name: '@storybook/vue3-vite',
19+
options: {}
20+
},
21+
docs: {
22+
autodocs: 'tag'
23+
},
24+
viteFinal: async (config) => {
25+
// Add Vue plugin to handle .vue SFC files from @aziontech/webkit
26+
config.plugins = config.plugins || [];
27+
config.plugins.push(vue());
28+
29+
return config;
30+
}
31+
};
32+
33+
export default config;
34+
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
import { setup } from '@storybook/vue3';
2+
import PrimeVue from 'primevue/config';
3+
import Tooltip from 'primevue/tooltip';
4+
5+
import '../src/styles/preview.css';
6+
import 'primeflex/primeflex.css'
7+
import '@aziontech/icons'
8+
import 'azion-theme'
9+
10+
11+
import { withThemeByClassName } from '@storybook/addon-themes'
12+
13+
setup((app) => {
14+
app.use(PrimeVue, {
15+
ripple: false
16+
});
17+
18+
app.directive('tooltip', Tooltip);
19+
});
20+
21+
export const parameters = {
22+
controls: {
23+
matchers: {
24+
color: /(background|color)$/i,
25+
date: /Date$/i
26+
},
27+
expanded: true
28+
},
29+
docs: {
30+
source: {
31+
type: 'code'
32+
},
33+
theme: {
34+
base: 'dark',
35+
colorPrimary: '#F3652B',
36+
colorSecondary: '#585C6D',
37+
appBg: '#0a0a0a',
38+
appContentBg: '#0a0a0a',
39+
appBorderColor: '#404040',
40+
textColor: '#FFFFFF',
41+
textInverseColor: '#0a0a0a',
42+
barTextColor: '#999999',
43+
barSelectedColor: '#F3652B',
44+
barBg: '#0A0A0A',
45+
inputBg: '#0A0A0A',
46+
inputBorder: '#404040',
47+
inputTextColor: '#FFFFFF',
48+
inputBorderRadius: 4
49+
}
50+
},
51+
backgrounds: {
52+
default: 'azion azion-dark',
53+
values: [
54+
{
55+
name: 'azion-dark',
56+
value: '#0a0a0a'
57+
},
58+
{
59+
name: 'azion-light',
60+
value: '#ffffff'
61+
}
62+
]
63+
},
64+
options: {
65+
storySort: {
66+
method: 'alphabetical',
67+
order: ['Introduction', 'Core', 'Components']
68+
}
69+
}
70+
};
71+
72+
export const decorators = [
73+
withThemeByClassName({
74+
themes: {
75+
light: 'azion azion-light',
76+
dark: 'azion azion-dark',
77+
},
78+
defaultTheme: 'dark',
79+
})
80+
]

apps/storybook/README.md

Lines changed: 190 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,190 @@
1+
# @aziontech/webkit Storybook
2+
3+
This is the Storybook documentation application for the `@aziontech/webkit` component library. It provides interactive documentation and development environment for all webkit components.
4+
5+
## Technology Stack
6+
7+
- **Storybook 8.x** - Component documentation tool
8+
- **Vue 3.5.x** - Frontend framework
9+
- **Vite 6.x** - Build tool
10+
- **PrimeVue 3.47.2** - UI component library
11+
- **PrimeFlex 3.3.1** - CSS utility library
12+
- **Tailwind CSS 3.4.x** - Utility-first CSS
13+
- **azion-theme 1.18.3** - Azion custom theming
14+
- **vee-validate 4.15.x** - Form validation
15+
16+
## Getting Started
17+
18+
### Prerequisites
19+
20+
Make sure you have the following installed:
21+
- Node.js 18.x or higher
22+
- pnpm 10.x or higher
23+
24+
### Installation
25+
26+
From the root of the monorepo:
27+
28+
```bash
29+
pnpm install
30+
```
31+
32+
### Running Storybook
33+
34+
To start the Storybook development server:
35+
36+
```bash
37+
# From the root
38+
pnpm storybook:dev
39+
40+
# Or from this directory
41+
pnpm dev
42+
```
43+
44+
The Storybook will be available at `http://localhost:6006`.
45+
46+
### Building Storybook
47+
48+
To build a static version of the Storybook:
49+
50+
```bash
51+
# From the root
52+
pnpm storybook:build
53+
54+
# Or from this directory
55+
pnpm build
56+
```
57+
58+
The static files will be generated in the `dist` directory.
59+
60+
### Previewing Built Storybook
61+
62+
To preview the built Storybook:
63+
64+
```bash
65+
pnpm preview
66+
```
67+
68+
## Project Structure
69+
70+
```
71+
apps/storybook/
72+
├── .storybook/
73+
│ ├── main.js # Main Storybook configuration
74+
│ └── preview.js # Global decorators and parameters
75+
├── src/
76+
│ ├── stories/
77+
│ │ ├── core/
78+
│ │ │ ├── form/ # Form component stories
79+
│ │ │ │ ├── FieldText.stories.js
80+
│ │ │ │ ├── FieldDropdown.stories.js
81+
│ │ │ │ └── ... # Other form field stories
82+
│ │ │ └── SelectorBlock.stories.js
83+
│ │ └── components/
84+
│ │ └── AzionSystemStatus.stories.js
85+
│ └── styles/
86+
│ └── preview.css # Global styles
87+
├── package.json
88+
├── tailwind.config.js
89+
├── postcss.config.js
90+
└── README.md
91+
```
92+
93+
## Component Categories
94+
95+
### Form Components
96+
97+
All form components are located under `Core/Form/` in the Storybook sidebar:
98+
99+
- FieldText - Basic text input
100+
- FieldTextArea - Multi-line text input
101+
- FieldDropdown - Select dropdown
102+
- FieldDropdownIcon - Dropdown with icons
103+
- FieldDropdownLazyLoader - Lazy-loading dropdown
104+
- FieldDropdownLazyLoaderDynamic - Dynamic lazy dropdown
105+
- FieldDropdownLazyLoaderWithFilter - Lazy dropdown with filter
106+
- FieldDropdownMultiSelectLazyLoader - Multi-select lazy dropdown
107+
- FieldCheckboxBlock - Checkbox with label
108+
- FieldRadioBlock - Radio button with label
109+
- FieldSwitch - Toggle switch
110+
- FieldSwitchBlock - Switch with label block
111+
- FieldGroupCheckbox - Checkbox group
112+
- FieldGroupRadio - Radio button group
113+
- FieldGroupSwitch - Switch group
114+
- FieldMultiSelect - Multi-select dropdown
115+
- FieldNumber - Number input
116+
- FieldPhoneNumber - Phone number input
117+
- FieldPhoneNumberCountry - Phone with country selector
118+
- FieldAutoComplete - Autocomplete input
119+
- FieldPickList - Pick list component
120+
- FieldInputGroup - Input with addons
121+
- FieldTextIcon - Text input with icon
122+
- FieldTextPassword - Password input
123+
- FieldTextPrivacy - Privacy-sensitive input
124+
- Label - Form label component
125+
126+
### Core Components
127+
128+
- SelectorBlock - Selection block component
129+
130+
### UI Components
131+
132+
- AzionSystemStatus - System status indicator
133+
134+
## Writing Stories
135+
136+
Stories are written using the Component Story Format (CSF). Here's an example:
137+
138+
```javascript
139+
import FieldText from '@aziontech/webkit/field-text';
140+
141+
export default {
142+
title: 'Core/Form/FieldText',
143+
component: FieldText,
144+
tags: ['autodocs'],
145+
argTypes: {
146+
name: { control: 'text' },
147+
label: { control: 'text' },
148+
disabled: { control: 'boolean' }
149+
}
150+
};
151+
152+
export const Default = {
153+
args: {
154+
name: 'field-text',
155+
label: 'Text Field',
156+
placeholder: 'Enter text...'
157+
}
158+
};
159+
```
160+
161+
## Adding New Stories
162+
163+
1. Create a new file in the appropriate directory under `src/stories/`
164+
2. Name the file following the pattern: `ComponentName.stories.js`
165+
3. Import the component from `@aziontech/webkit`
166+
4. Define the default export with title, component, and argTypes
167+
5. Export named story variants
168+
169+
## Testing Components
170+
171+
Storybook provides interactive controls for testing different prop combinations. Use the Controls panel to modify props in real-time.
172+
173+
## Documentation
174+
175+
Each component has auto-generated documentation (via `autodocs` tag) that shows:
176+
- Component description
177+
- Available props and their types
178+
- Default values
179+
- Usage examples
180+
181+
## Related Documentation
182+
183+
- [Storybook Documentation](https://storybook.js.org/docs)
184+
- [Vue 3 Documentation](https://vuejs.org/)
185+
- [PrimeVue Documentation](https://primevue.org/)
186+
- [VeeValidate Documentation](https://vee-validate.logaretm.com/)
187+
188+
## License
189+
190+
MIT

0 commit comments

Comments
 (0)