-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: update stories with string templates
- Loading branch information
1 parent
a971da8
commit efad4dd
Showing
16 changed files
with
110 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import type { StoryObj, Meta } from "@storybook/html"; | ||
import { ParagraphProps } from "ui-stencil"; | ||
|
||
const meta = { | ||
title: "Internal/Typography", | ||
tags: ["autodocs"], | ||
|
||
argTypes: { | ||
as: { | ||
control: { type: "select" }, | ||
options: ["p", "h1", "h2", "h3", "h4", "h5", "h6", "span", "small"], | ||
}, | ||
}, | ||
} satisfies Meta; | ||
|
||
export default meta; | ||
type Story = StoryObj; | ||
|
||
const Template = (content: string) => (args: ParagraphProps) => `<orama-paragraph {...args}>${content}</orama-paragraph>`; | ||
|
||
export const Paragraph: Story = { | ||
render: Template("This is a paragraph"), | ||
args: { | ||
as: "p", | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,6 @@ | |
import * as d from './components'; | ||
|
||
export const DIRECTIVES = [ | ||
d.OramaP, | ||
d.OramaParagraph, | ||
d.SearchBox | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 15 additions & 9 deletions
24
packages/ui-stencil/src/components/internal/Typography/Paragraph.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,22 @@ | ||
import { Component, h } from '@stencil/core' | ||
|
||
import { Component, Prop, h } from '@stencil/core'; | ||
export interface ParagraphProps { | ||
as?: 'span' | 'p' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'; | ||
} | ||
@Component({ | ||
tag: 'orama-p', | ||
tag: 'orama-paragraph', | ||
styleUrl: 'typography.scss', | ||
shadow: false | ||
}) | ||
export class Paragraph { | ||
|
||
export class Paragraph implements ParagraphProps { | ||
@Prop() as?: 'span' | 'p' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'; | ||
|
||
render() { | ||
const Tag = this.as || 'p'; | ||
|
||
return ( | ||
<p class='paragraph'> | ||
<slot></slot> | ||
</p> | ||
) | ||
<Tag class="paragraph"> | ||
<slot /> | ||
</Tag> | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
declare module "*.scss" { | ||
const content: Record<string, string>; | ||
export default content; | ||
} | ||
// declare module "*.scss" { | ||
// const content: Record<string, string>; | ||
// export default content; | ||
// } |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.