Skip to content

Commit

Permalink
fix(card): component selector
Browse files Browse the repository at this point in the history
  • Loading branch information
pimenovoleg committed Sep 19, 2024
1 parent 7617fb9 commit 8454a50
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 26 deletions.
1 change: 1 addition & 0 deletions .commitlintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const config = {
'primitives',
'accordion',
'avatar',
'card',
'collapsible',
'context-menu',
'dropdown-menu',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { DropdownExampleRadioComponent } from './examples/dropdown-example-radio
import { DropdownExampleComponent } from './examples/dropdown-example.component';

const DropdownMenuPage: NgDocPage = {
title: `DropdownMenu [In progress]`,
title: `Dropdown Menu`,
mdFile: './index.md',
category: ExamplesCategory,
demos: {
Expand Down
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,15 @@ import { ShTabsModule } from '@radix-ng/shadcn/tabs';
<button shTabsTrigger shValue="password">Password</button>
</div>
<div class="TabsContent" shTabsContent shValue="account">
<div shCard>
<div shCardHeader>
<div shCardTitle>Account</div>
<div shCardDescription>Make changes to your account here. Click save when you're done.</div>
</div>
<div class="space-y-2" shCardContent>
<div shTabsContent shValue="account">
<shCard class="block">
<shCardHeader>
<shCardTitle>Account</shCardTitle>
<shCardDescription>
Make changes to your account here. Click save when you're done.
</shCardDescription>
</shCardHeader>
<shCardContent class="space-y-2">
<div class="space-y-1">
<label shLabel htmlFor="name">Name</label>
<input id="name" shInput type="text" value="Pedro Duarte" />
Expand All @@ -48,19 +50,21 @@ import { ShTabsModule } from '@radix-ng/shadcn/tabs';
<label shLabel htmlFor="username">Username</label>
<input id="username" shInput type="text" value="@peduarte" />
</div>
</div>
<div shCardFooter>
</shCardContent>
<shCardFooter>
<button shButton>Save changes</button>
</div>
</div>
</shCardFooter>
</shCard>
</div>
<div shTabsContent shValue="password">
<div shCard>
<div shCardHeader>
<div shCardTitle>Password</div>
<div shCardDescription>Change your password here. After saving, you'll be logged out.</div>
</div>
<shCard class="block">
<shCardHeader>
<shCardTitle>Password</shCardTitle>
<shCardDescription>
Change your password here. After saving, you'll be logged out.
</shCardDescription>
</shCardHeader>
<div class="space-y-2" shCardContent>
<div class="space-y-1">
<label shLabel htmlFor="current">Current password</label>
Expand All @@ -71,10 +75,10 @@ import { ShTabsModule } from '@radix-ng/shadcn/tabs';
<input id="new" shInput type="password" />
</div>
</div>
<div shCardFooter>
<shCardFooter>
<button shButton>Save password</button>
</div>
</div>
</shCardFooter>
</shCard>
</div>
</div>
`
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@
"migrate": "nx migrate latest",
"run-migrate": "nx migrate --run-migrations --if-exists",
"help": "nx help",
"release:dry-run": "nx release --dry-run -- --skip-nx-cache"
"release:dry-run": "nx release --dry-run -- --skip-nx-cache",
"release:skip-publish": "nx release --skip-publish"
},
"dependencies": {
"@angular/animations": "18.2.1",
Expand Down
10 changes: 5 additions & 5 deletions packages/shadcn/card/src/card.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { cn } from '@radix-ng/shadcn/core';
import { cva } from 'class-variance-authority';

@Component({
selector: 'shCard',
selector: 'shCard, [shCard]',
standalone: true,
template: '<ng-content />',
host: {
Expand All @@ -14,7 +14,7 @@ export class ShCardComponent {}

const cardHeaderVariants = cva('flex flex-col space-y-1.5 p-6');
@Component({
selector: 'shCardHeader',
selector: 'shCardHeader, [shCardHeader]',
standalone: true,
template: '<ng-content />',
host: {
Expand All @@ -38,7 +38,7 @@ export class ShCardHeaderComponent {
export class ShCardTitleComponent {}

@Component({
selector: 'shCardDescription',
selector: 'shCardDescription, [shCardDescription]',
standalone: true,
template: '<ng-content />',
host: {
Expand All @@ -48,7 +48,7 @@ export class ShCardTitleComponent {}
export class ShCardDescriptionComponent {}

@Component({
selector: 'shCardContent',
selector: 'shCardContent, [shCardContent]',
standalone: true,
template: '<ng-content />',
host: {
Expand All @@ -59,7 +59,7 @@ export class ShCardContentComponent {}

const cardFooterVariants = cva('flex items-center p-6 pt-0');
@Component({
selector: 'shCardFooter',
selector: 'shCardFooter, [shCardFooter]',
standalone: true,
template: '<ng-content />',
host: {
Expand Down

0 comments on commit 8454a50

Please sign in to comment.