diff --git a/apps/www/src/components/playground/checkbox-examples.tsx b/apps/www/src/components/playground/checkbox-examples.tsx index a7e8ece5e..10b24b24a 100644 --- a/apps/www/src/components/playground/checkbox-examples.tsx +++ b/apps/www/src/components/playground/checkbox-examples.tsx @@ -1,6 +1,6 @@ 'use client'; -import { Checkbox, Flex, Text } from '@raystack/apsara'; +import { Checkbox, Field, Flex, Text } from '@raystack/apsara'; import PlaygroundLayout from './playground-layout'; export function CheckboxExamples() { @@ -20,15 +20,21 @@ export function CheckboxExamples() { - + + Apple + - + + Banana + - + + Cherry + diff --git a/apps/www/src/components/playground/index.ts b/apps/www/src/components/playground/index.ts index 22d903501..3d6ad6d12 100644 --- a/apps/www/src/components/playground/index.ts +++ b/apps/www/src/components/playground/index.ts @@ -30,7 +30,6 @@ export * from './icon-button-examples'; export * from './image-examples'; export * from './indicator-examples'; export * from './input-field-examples'; -export * from './label-examples'; export * from './link-examples'; export * from './list-examples'; export * from './menu-examples'; diff --git a/apps/www/src/components/playground/label-examples.tsx b/apps/www/src/components/playground/label-examples.tsx deleted file mode 100644 index be1f98307..000000000 --- a/apps/www/src/components/playground/label-examples.tsx +++ /dev/null @@ -1,22 +0,0 @@ -'use client'; - -import { Flex, Label } from '@raystack/apsara'; -import PlaygroundLayout from './playground-layout'; - -export function LabelExamples() { - return ( - - - - - - - - - - ); -} diff --git a/apps/www/src/components/playground/radio-examples.tsx b/apps/www/src/components/playground/radio-examples.tsx index dbe0a103b..661d26f7b 100644 --- a/apps/www/src/components/playground/radio-examples.tsx +++ b/apps/www/src/components/playground/radio-examples.tsx @@ -1,27 +1,33 @@ 'use client'; -import { Flex, Radio } from '@raystack/apsara'; +import { Field, Flex, Radio } from '@raystack/apsara'; import PlaygroundLayout from './playground-layout'; export function RadioExamples() { return ( - + - - + + + Option One + - - + + + Option Two + - - + + + Option Three + - + ); } diff --git a/apps/www/src/content/docs/components/field/props.ts b/apps/www/src/content/docs/components/field/props.ts index 1391c3d31..74f3ba882 100644 --- a/apps/www/src/content/docs/components/field/props.ts +++ b/apps/www/src/content/docs/components/field/props.ts @@ -52,6 +52,13 @@ export interface FieldLabelProps { */ required?: boolean; + /** + * Layout direction of the label relative to the control it labels. + * Use `horizontal` when placing the label inline next to a Radio or Checkbox. + * @defaultValue "vertical" + */ + orientation?: 'vertical' | 'horizontal'; + /** Additional CSS class names. */ className?: string; } diff --git a/apps/www/src/content/docs/components/label/demo.ts b/apps/www/src/content/docs/components/label/demo.ts deleted file mode 100644 index f7ae0bc6f..000000000 --- a/apps/www/src/content/docs/components/label/demo.ts +++ /dev/null @@ -1,45 +0,0 @@ -'use client'; - -import { getPropsString } from '@/lib/utils'; - -export const getCode = (props: any) => { - const { children, ...rest } = props; - return `${children}`; -}; - -export const playground = { - type: 'playground', - controls: { - size: { - type: 'select', - options: ['small', 'medium', 'large'], - defaultValue: 'small' - }, - required: { type: 'checkbox', defaultValue: false }, - requiredIndicator: { type: 'text', defaultValue: '*' }, - children: { type: 'text', initialValue: 'Label' } - }, - getCode -}; - -export const sizeDemo = { - type: 'code', - code: ` - - - - - ` -}; -export const requiredDemo = { - type: 'code', - code: ` - - - - ` -}; diff --git a/apps/www/src/content/docs/components/label/index.mdx b/apps/www/src/content/docs/components/label/index.mdx deleted file mode 100644 index cec826f80..000000000 --- a/apps/www/src/content/docs/components/label/index.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -title: Label -description: A text label component that provides names for form controls. -source: packages/raystack/components/label ---- - -import { playground, requiredDemo, sizeDemo } from "./demo.ts"; - - - -## Anatomy - -Import and assemble the component: - -```tsx -import { Label } from '@raystack/apsara' - -