Skip to content
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

docs(components/stories): improve documentation #54

Merged
merged 1 commit into from
Jun 20, 2024
Merged
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"prepare": "husky",
"storybook": "ng run cli:storybook",
"storybook:build": "ng run cli:build-storybook",
"doc": "compodoc -e json -d projects/cli -p projects/cli/.storybook/tsconfig.json"
"storybook:doc": "compodoc -e json -d projects/cli -p projects/cli/.storybook/tsconfig.json"
},
"private": true,
"dependencies": {
Expand Down
118 changes: 74 additions & 44 deletions projects/cli/documentation.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ import {
*
* @component
* @selector `zen-avatar`
*
* @license BSD-2-Clause
* @author Konrad Stępień <kord.stp@gmail.com>
* @link https://github.com/Kordrad/ng-zen
*/
@Component({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,14 @@ import {
* --zen-badge-offset-x: unset; // Controls the horizontal offset of the badge.
* --zen-badge-offset-y: unset; // Controls the vertical offset of the badge.
* ```

*
* @example <zen-badge> Text <span bottom>🦆</span></zen-badge>
*
* @component
* @selector `zen-badge`,`[zenBadge]`
*
* @license BSD-2-Clause
* @author Konrad Stępień <kord.stp@gmail.com>
* @link https://github.com/Kordrad/ng-zen
*/
@Component({
Expand Down
2 changes: 2 additions & 0 deletions projects/cli/schematics/components/files/pin/pin.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import {
* @component
* @selector `zen-pin`
*
* @license BSD-2-Clause
* @author Konrad Stępień <kord.stp@gmail.com>
* @link https://github.com/Kordrad/ng-zen
*/
@Component({
Expand Down
17 changes: 17 additions & 0 deletions projects/cli/stories/components/badge.stories.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import type { Meta, StoryObj } from '@storybook/angular';
import { moduleMetadata } from '@storybook/angular';

import { ZenAvatarComponent } from '../../schematics/components/files/avatar';
import { ZenBadgeComponent } from '../../schematics/components/files/badge';
import { OnElement } from './pin.stories';
import { AvatarWithTag as _AvatarWithTag } from './tag.stories';
Expand Down Expand Up @@ -50,5 +52,20 @@ export const Attribute: Story = {
}),
};

export const Emoji: Story = {
decorators: [
moduleMetadata({
imports: [ZenAvatarComponent, ZenBadgeComponent],
}),
],
render: () => ({
template: `
<zen-badge style="--zen-badge-offset: -4px">
<zen-avatar src="https://picsum.photos/33" />
<b topRight>💬</b>
</zen-badge>
`,
}),
};
export const Avatar = OnElement;
export const AvatarWithATag = _AvatarWithTag;
Loading