-
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.
Merge pull request #8 from askorama/feature/orm-1438
Feature/orm-1438
- Loading branch information
Showing
53 changed files
with
11,948 additions
and
13,404 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,30 @@ | ||
import { join, dirname } from "path"; | ||
import { join, dirname } from 'path' | ||
|
||
/** | ||
* This function is used to resolve the absolute path of a package. | ||
* It is needed in projects that use Yarn PnP or are set up within a monorepo. | ||
*/ | ||
function getAbsolutePath(value) { | ||
return dirname(require.resolve(join(value, "package.json"))); | ||
return dirname(require.resolve(join(value, 'package.json'))) | ||
} | ||
|
||
/** @type { import('@storybook/html-vite').StorybookConfig } */ | ||
const config = { | ||
stories: [ | ||
"../stories/**/*.mdx", | ||
"../stories/**/*.stories.@(js|jsx|mjs|ts|tsx)", | ||
], | ||
stories: ['../stories/**/*.mdx', '../stories/**/*.stories.@(js|jsx|mjs|ts|tsx)'], | ||
addons: [ | ||
getAbsolutePath("@storybook/addon-links"), | ||
getAbsolutePath("@storybook/addon-essentials"), | ||
getAbsolutePath("@storybook/addon-interactions"), | ||
getAbsolutePath("@storybook/addon-styling-webpack"), | ||
getAbsolutePath("@storybook/addon-designs"), | ||
getAbsolutePath("@storybook/addon-themes"), | ||
getAbsolutePath("@storybook/addon-a11y"), | ||
"@chromatic-com/storybook" | ||
getAbsolutePath('@storybook/addon-links'), | ||
getAbsolutePath('@storybook/addon-essentials'), | ||
getAbsolutePath('@storybook/addon-interactions'), | ||
getAbsolutePath('@storybook/addon-styling-webpack'), | ||
getAbsolutePath('@storybook/addon-designs'), | ||
getAbsolutePath('@storybook/addon-themes'), | ||
getAbsolutePath('@storybook/addon-a11y'), | ||
'@chromatic-com/storybook', | ||
], | ||
framework: { | ||
name: getAbsolutePath("@storybook/html-vite"), | ||
name: getAbsolutePath('@storybook/html-vite'), | ||
options: {}, | ||
}, | ||
docs: {}, | ||
}; | ||
export default config; | ||
} | ||
export default config |
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,3 @@ | ||
.sb-show-main.sb-main-padded { | ||
/* padding: 0 !important; */ | ||
} |
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,24 @@ | ||
import type { StoryObj, Meta } from '@storybook/html' | ||
|
||
const meta = { | ||
title: 'Internal/Button', | ||
component: 'orama-button', | ||
} satisfies Meta | ||
|
||
export default meta | ||
|
||
type Story = StoryObj | ||
|
||
const Template = (content: string) => (args) => | ||
` | ||
<orama-button variant=${args.variant} class=${args.class}>${content}</orama-button> | ||
` | ||
|
||
export const Primary: Story = { | ||
render: Template('Primary button'), | ||
args: { | ||
variant: 'primary', | ||
class: 'my-optional-class', | ||
type: 'button', | ||
}, | ||
} |
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,30 @@ | ||
// Create a story for the OramaFacets web component | ||
import { h } from '@stencil/core' | ||
import type { StoryObj, Meta } from '@storybook/web-components' | ||
|
||
const meta: Meta = { | ||
title: 'Internal/Facets', | ||
component: 'orama-facets', | ||
} | ||
|
||
export default meta | ||
|
||
type Story = StoryObj | ||
|
||
const Template = (args) => { | ||
return ` | ||
<div> | ||
<p>Something that uses facets</p> | ||
<orama-facets current-facet=${args.currentFacet} facets=${JSON.stringify(args.facets)}></orama-facets> | ||
</div> | ||
` | ||
} | ||
|
||
// More on writing stories with args: https://storybook.js.org/docs/html/writing-stories/args | ||
export const Facets: Story = { | ||
render: Template, | ||
args: { | ||
facets: ['FacetOne', 'FacetTwo', 'FacetThree'], | ||
currentFacet: 'Facet 2', | ||
}, | ||
} |
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,18 +1,36 @@ | ||
import type { StoryObj, Meta } from "@storybook/html"; | ||
import type { StoryObj, Meta } from '@storybook/html' | ||
|
||
const meta = { | ||
title: "Internal/Search Results", | ||
component: "orama-search-results", | ||
} satisfies Meta; | ||
title: 'Internal/Search Results', | ||
component: 'orama-search-results', | ||
} satisfies Meta | ||
|
||
export default meta; | ||
type Story = StoryObj; | ||
export default meta | ||
type Story = StoryObj | ||
|
||
const Template = (args) => ` | ||
<orama-search-results ${{ ...args }}></orama-search-results> | ||
`; | ||
<orama-search-results items=${args.items} search-term='test'</orama-search-results> | ||
` | ||
|
||
export const Default: Story = { | ||
export const NoResults: Story = { | ||
render: Template, | ||
args: {}, | ||
}; | ||
} | ||
|
||
export const WithResults: Story = { | ||
render: Template, | ||
args: { | ||
items: [ | ||
{ | ||
id: '1', | ||
title: 'Title 1', | ||
description: 'Description 1', | ||
}, | ||
{ | ||
id: '2', | ||
title: 'Title 2', | ||
description: 'Description 2', | ||
}, | ||
], | ||
}, | ||
} |
File renamed without changes.
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
Oops, something went wrong.