Skip to content

Commit

Permalink
feat: add QueryItem.Text component
Browse files Browse the repository at this point in the history
  • Loading branch information
ZoeAstra committed Apr 16, 2024
1 parent 91e945f commit 8f0b7bd
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/components/data-entry/QueryItem/QueryItem.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import React from 'react'
import Action from './Action'
import { Qualifier } from './Qualifier'
import { Text } from './Text'

export const QueryItem = () => {
return <>DO NOT USE THIS OR YOU WILL BE FIRED!</>
}
QueryItem.Action = Action
QueryItem.Qualifier = Qualifier
QueryItem.Text = Text
35 changes: 35 additions & 0 deletions src/components/data-entry/QueryItem/Text.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { type Meta, type StoryObj } from '@storybook/react'
import { QueryItem } from 'src/components'

const meta: Meta<typeof QueryItem.Text> = {
title: 'Aquarium/Data Entry/QueryItem/Text',
component: QueryItem.Text,
parameters: {
docs: {
description: {
component:
'This is the "Text" component of the QueryItem component group.',
},
},
},

args: {},
}
export default meta

type Story = StoryObj<typeof QueryItem.Text>

export const Primary: Story = {
args: {
text: 'Default Text',
disabled: false,
},
}


export const Disabled: Story = {
args: {
text: 'Disabled Text',
disabled: true,
},
}
12 changes: 12 additions & 0 deletions src/components/data-entry/QueryItem/Text.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { Text as BaseText } from 'src/components/general/Typography/Typography'

export interface IActionProps {
disabled?: boolean
text: string
}

export const Text = ({ disabled = false, text }: IActionProps) => {
return <BaseText disabled={disabled}>{text}</BaseText>;
}

export default Text

0 comments on commit 8f0b7bd

Please sign in to comment.