diff --git a/packages/styleguide/src/lib/Atoms/FormInputs/Radio/Radio.mdx b/packages/styleguide/src/lib/Atoms/FormInputs/Radio/Radio.mdx index 5783f5d720..78030814cd 100644 --- a/packages/styleguide/src/lib/Atoms/FormInputs/Radio/Radio.mdx +++ b/packages/styleguide/src/lib/Atoms/FormInputs/Radio/Radio.mdx @@ -24,6 +24,8 @@ export const parameters = { + + ## Usage Use Radio to handle single selection within a group of options. Use RadioGroup to group multiple Radio components together semantically. diff --git a/packages/styleguide/src/lib/Atoms/FormInputs/Radio/Radio.stories.tsx b/packages/styleguide/src/lib/Atoms/FormInputs/Radio/Radio.stories.tsx index f70443a392..9ba19dda2f 100644 --- a/packages/styleguide/src/lib/Atoms/FormInputs/Radio/Radio.stories.tsx +++ b/packages/styleguide/src/lib/Atoms/FormInputs/Radio/Radio.stories.tsx @@ -1,5 +1,7 @@ -import { Radio, RadioGroup } from '@codecademy/gamut'; +import { Box, FlexBox, Radio, RadioGroup, Text } from '@codecademy/gamut'; +import styled from '@emotion/styled'; import type { Meta, StoryObj } from '@storybook/react'; +import { useState } from 'react'; import type { TypeWithDeepControls } from 'storybook-addon-deep-controls'; import { infotipNestedArgTypes } from '~styleguide/argTypes'; @@ -81,3 +83,94 @@ export const CustomLabel: Story = { label: 'Option with infotip', }, }; + +const PadlessBoldedRadio = styled(Radio)` + label { + padding: 0; + font-weight: bold; + } +`; + +const KnowledgeSourceSelectionComponent = () => { + const [selectedType, setSelectedType] = useState< + 'workspace' | 'project' | 'content' + >('project'); + + const workspaceName = 'workspace name'; + const projectName = 'project name'; + const contentName = 'content name'; + + const options = [ + { + type: 'workspace' as const, + label: `Workspace: ${workspaceName}`, + bullets: [ + `Accessible across all projects in your "${workspaceName}" workspace.`, + 'Can be shared to other projects or workspaces later if needed.', + 'Best for broad references like brand, legal, or voice guidelines.', + ], + }, + { + type: 'project' as const, + label: `Project: ${projectName}`, + bullets: [ + `Accessible to all content items within your "${projectName}" project.`, + 'Can be shared to other projects or workspaces later if needed.', + 'Ideal for project‑specific datasets, briefs, or design standards.', + ], + }, + { + type: 'content' as const, + label: `Content item: ${contentName}`, + bullets: [ + `Applied only to "${contentName}".`, + "Won't surface in search or be discoverable elsewhere.", + 'Best for highly tailored or one‑off content.', + ], + }, + ]; + + return ( + + + Select where this knowledge source will be available + + + {options.map((option) => ( + + setSelectedType(option.type)} + /> + + + {option.bullets.map((bullet) => ( + + {bullet} + + ))} + + + + ))} + + + ); +}; + +export const KnowledgeSourceSelection: Story = { + render: () => , +};