Skip to content

Commit

Permalink
feat: add nui-mask utility stories
Browse files Browse the repository at this point in the history
  • Loading branch information
driss-chelouati committed Jan 11, 2024
1 parent b4335b2 commit 6347952
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 0 deletions.
30 changes: 30 additions & 0 deletions src/plugins/components/mask/mask.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { html } from 'lit'
import { spread } from '@open-wc/lit-helpers'

import type { MaskAttrs } from './mask.types'
import * as variants from './mask.variants'

/**
* Primary UI component for user interaction
*/
export const Mask = ({ ...attrs }: MaskAttrs) => {
return html`
<div class="flex items-end gap-4 p-4">
<div
class="nui-mask nui-mask-hex h-12 w-12 bg-muted-100 dark:bg-muted-800"
></div>
<div
class="nui-mask nui-mask-hexed h-12 w-12 bg-muted-100 dark:bg-muted-800"
></div>
<div
class="nui-mask nui-mask-blob h-12 w-12 bg-muted-100 dark:bg-muted-800"
></div>
<div
class="nui-mask nui-mask-deca h-12 w-12 bg-muted-100 dark:bg-muted-800"
></div>
<div
class="nui-mask nui-mask-diamond h-12 w-12 bg-muted-100 dark:bg-muted-800"
></div>
</div>
`
}
15 changes: 15 additions & 0 deletions src/plugins/components/mask/mask.doc.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Meta, Primary, Controls, Story } from '@storybook/blocks'
import * as MaskStories from './mask.stories'
import { defaultConfig } from './mask.config'

<Meta of={MaskStories} />

# nui-mask

When using autocompletes or search, you often see some highlighted text. This is the component that does that.

<Primary />

## Props

<Controls />
25 changes: 25 additions & 0 deletions src/plugins/components/mask/mask.stories.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import type { Meta, StoryObj } from '@storybook/web-components'
import { html } from 'lit'

import type { MaskAttrs } from './mask.types'
import { Mask } from './mask.component'

// More on how to set up stories at: https://storybook.js.org/docs/web-components/writing-stories/introduction
const meta = {
title: 'Shuriken UI/Utility/Mask',
// tags: ['autodocs'],
render: (args) => Mask(args),
argTypes: {},
} satisfies Meta<MaskAttrs>

export default meta
type Story = StoryObj<MaskAttrs>

// first export is the Primary story

// #region Main
export const Main: Story = {
name: 'Main example',
args: {},
}
// #endregion
10 changes: 10 additions & 0 deletions src/plugins/components/mask/mask.types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import type { PropertyVariant } from '~/types/utils'

export interface MaskProps extends Record<string, unknown> {}

export interface MaskEvents {}

export interface MaskSlots {}

export type MaskAttrs = MaskProps & MaskEvents & MaskSlots
export type MaskVariant<T> = PropertyVariant<T, MaskProps>
1 change: 1 addition & 0 deletions src/plugins/components/mask/mask.variants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {}

0 comments on commit 6347952

Please sign in to comment.