mds-storybook
v1.0.1
Published
mds storybook
Readme
Marketing Design System (MDS)
A themed React component library for marketing — dark mode by default, light mode via data-theme="light".
Stack
- React 18 + TypeScript
- Sass Modules
- Storybook 8 + Vite
Getting started
npm install
npm run storybook # dev server at localhost:6006
npm run build-storybookBuild outputs
npm run npm:build:lib
npm run npm:build:storybook
npm run npm:build:allnpm run npm:build:libbuilds the consumable package intodist/.npm run npm:build:storybookbuilds the Storybook display site intostorybook-static/.npm run npm:build:allbuilds both outputs.
The dist/ folder is the package output intended for consumption.
The storybook-static/ folder is the Storybook presentation build.
Publish scripts
npm run npm:pack:check
npm run npm:version:patch
npm run npm:publishnpm:pack:checkpreviews the npm tarball before publishing.npm:version:patch|minor|majorbumps the package version.npm:publishpublishes the package.npm:publish:publicpublishes a scoped package with public access.npm:whoamiconfirms the logged-in npm account.
Remove "private": true from package.json before publishing, otherwise npm will refuse to publish the package.
Package usage
import { Animate, Accordion, AccordionItem, BackToTop, Button, Checkbox, Dropdown, Footer, Hamburger, Headline, Icon, Navbar, SmallIcon, SSOButton, Subhead, Tabs, TextField } from 'mds-storybook';
import 'mds-storybook/style.css';Theming
Tokens live in src/styles/tokens.scss. All colors are CSS custom properties — switch themes by toggling html[data-theme="light"].
Components
Animate
animation—AnimationNameduration?—numberdelay?—numberchildren—ReactElement
Accordion
items—AccordionItemData[]autoCollapse?—booleanclassName?—string
AccordionItem
title—stringchildren—ReactNodedefaultOpen?—booleanisOpen?—booleanonToggle?—() => void
Headline
size?—HeadlineSizeas?—HeadingElementchildren—ReactNodeclassName?—string
Subhead
size?—SubheadSizeas?—HeadingElementchildren—ReactNodeclassName?—string
Button
variant?—ButtonVariantplatform?—ButtonPlatformsize?—ButtonSizeicon?—IconNameiconPosition?—'leading' | 'trailing'disabled?—booleanonClick?—() => voidchildren—ReactNodeclassName?—string
Checkbox
size?—CheckboxSizeindicatorPosition?—CheckboxIndicatorPositionindeterminate?—booleanchildren?—ReactNodeclassName?—string- extends
InputHTMLAttributes<HTMLInputElement>
SSOButton
provider—SSOProviderlabel?—stringfullWidth?—boolean- extends
ButtonHTMLAttributes<HTMLButtonElement>
Icon
name—IconNamesize?—IconSizeclassName?—string
SmallIcon
name—SmallIconNamesize?—numberclassName?—string
Dropdown
options—DropdownOption[]value?—string | string[]onChange?—(value: string | string[]) => voidmultiple?—booleanlabel?—stringplaceholder?—stringrequired?—booleandisabled?—booleanclearable?—booleansupportingText?—stringsize?—DropdownSizeid?—stringclassName?—string
TextField
label?—stringrequired?—booleanerror?—stringsupportingText?—stringvariant?—TextFieldVariantclassName?—string- extends
InputHTMLAttributes<HTMLInputElement>
BackToTop
show?—booleanlabel?—string
Footer
showBackToTop?—booleanlogos?—LogoItem[]legalStatement?—stringexternalLinks?—ExternalLink[]socialLinks?—SocialLink[]
Hamburger
isOpen?—booleanonClick?—() => void
Navbar
navItems?—NavItem[]breakpoint?—NavbarBreakpointsticky?—booleanchildren?—ReactNode
Tabs
items—TabItem[]value?—stringdefaultValue?—stringonChange?—(value: string) => voidsize?—'S' | 'L'className?—string
