Skip to content

Commit

Permalink
fix(Card): fixes updates from Card
Browse files Browse the repository at this point in the history
  • Loading branch information
arwehrman committed Aug 2, 2023
1 parent c20c7bf commit bcfdc18
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 42 deletions.
17 changes: 4 additions & 13 deletions packages/@lightningjs/ui-components/src/components/Card/Card.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,31 +19,22 @@
import type lng from '@lightningjs/core';
import Surface, { SurfaceStyle } from '../Surface';
import { TextBoxStyle } from '../TextBox';
import type { Color, StylePartial } from '../../types/lui';
import type { TextContent } from '../InlineContent/InlineContent';

export type CardStyle = SurfaceStyle & {
backgroundColor: Color;
import { Color, StylePartial } from '../../types/lui';
import type { TextContent } from '../InlineContent/InlineContent';

type CardStyle = SurfaceStyle & {
backgroundColorDisabled: Color;
backgroundColorFocused: Color;
backgroundColorUnfocused: Color;
backgroundColor: Color;
paddingHorizontal: number;
paddingVertical: number;
radius: lng.Tools.CornerRadius;
titleTextStyle: TextBoxStyle;
};

export default class Card extends Surface {
title?: string | TextContent[];
declare namespace Card {
export interface TemplateSpec extends Surface.TemplateSpec {
/**
* headline of the content
*/
title?: string;
title?: string | TextContent[];
}
}

Expand All @@ -54,7 +45,7 @@ declare class Card<
/**
* headline of the content
*/
title?: string;
title?: string | TextContent[];

get style(): CardStyle;
set style(v: StylePartial<CardStyle>);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@

import lng from '@lightningjs/core';
import Card, { CardStyle } from './Card';
import type { StylePartial } from '../../types/lui';
import { TextBoxStyle } from '../TextBox';
import { StylePartial } from '../../types/lui';
import { TextBoxStyle } from '../TextBox';

type CardSectionStyle = CardStyle & {
iconHeight: number;
Expand All @@ -43,28 +42,31 @@ declare namespace CardSection {
*/
iconWidth?: number;
}
}

declare class CardSection<TemplateSpec extends CardSection.TemplateSpec = CardSection.TemplateSpec, TypeConfig extends lng.Component.TypeConfig = lng.Component.TypeConfig> extends Card<TemplateSpec, TypeConfig>{

declare class CardSection<
TemplateSpec extends CardSection.TemplateSpec = CardSection.TemplateSpec,
TypeConfig extends lng.Component.TypeConfig = lng.Component.TypeConfig
> extends Card<TemplateSpec, TypeConfig> {
// Properties
/**
* height of the icon on the right
*/
* height of the icon on the right
*/
iconHeight?: number;
/**
* icon source
*/
* icon source
*/
iconSrc?: number;
/**
* width of the icon on the right
*/
/**
* width of the icon on the right
*/
iconWidth?: number;

get style(): CardSectionStyle;
set style(v: StylePartial<CardSectionStyle>);

// tags
get _Icon(): lng.Component;
}
export {CardSection as default, CardSectionStyle}
}

export { CardSection as default, CardSectionStyle };
Original file line number Diff line number Diff line change
Expand Up @@ -19,33 +19,24 @@
import lng from '@lightningjs/core';
import Card, { CardStyle } from './Card';
import { TextBoxStyle } from '../TextBox';
import type { TextContent } from '../InlineContent/InlineContent';
import type { StylePartial } from '../../types/lui';

export type CardTitleStyle = CardStyle & {
descriptionTextProperties: TextBoxStyle;
detailsTextProperties: TextBoxStyle;
};

export default class CardTitle extends Card {
description?: string | TextContent[];
details?: string | TextContent[];
import { TextContent } from '../InlineContent/InlineContent';
import { StylePartial } from '../../types/lui';

type CardTitleStyle = CardStyle & {
descriptionTextStyle: TextBoxStyle;
detailsTextProperties: TextBoxStyle;
};

declare namespace CardTitle {
export interface TemplateSpec extends Card.TemplateSpec {
/**
* description???
*/
description?: string;
description?: string | TextContent[];
/**
* details??
*/
details?: string;
details?: string | TextContent[];
}
}

Expand All @@ -56,11 +47,11 @@ declare class CardTitle<
/**
* text to be displayed in the description section
*/
description?: string;
description?: string | TextContent[];
/**
* text to be displayed in the details section
*/
details?: string;
details?: string | TextContent[];

get style(): CardTitleStyle;
set style(v: StylePartial<CardTitleStyle>);
Expand Down

0 comments on commit bcfdc18

Please sign in to comment.