/** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @format */ import React from 'react'; import {Typography, Button, Space, Input, Card, Alert, List} from 'antd'; import {Layout} from '../ui'; import {theme} from 'flipper-plugin'; import {css} from '@emotion/css'; import {DesignComponentDemos} from './DesignComponentDemos'; const {Title, Text, Link} = Typography; export default function SandyDesignSystem() { return (

Welcome to the Flipper Design System. The Flipper design system is based on{' '} Ant Design . Any component found in the ANT documentation can be used. This page demonstrates the usage of:

  • Colors
  • Typography
  • Theme Variables
  • Layout components

The following components from Ant should not be used:

  • Layout: use Flipper's Layout.* instead.

Sandy guidelines

  • Avoid using `margin` properties, use padding on the container indeed, or gap in combination with{' '} Layout.Horizontal|Vertical
  • Avoid using width / height: 100%, use{' '} Layout.Container instead.
  • In general, components that have a grow property will grow to use the full height of their parents if{' '} true. In contrast, if grow is set to{' '} false components will use their natural size, based on their children.
  • The other important property here is scrollable. If an element supports this property, setting it will imply{' '} grow, and the element will show a scrollbar if needed. Setting scrollabe to false{' '} causes the element to always use its natural size, growing or shrinking based on the contents rather than the parent.
Common Ant components, with modifiers applied. The{' '} Title, Text and Link{' '} components can be found by importing the{' '} Typography namespace from Ant. } type="info" /> Title Title level=2 Title level=3 Title level=4 Text Text - type=secondary Text - type=success Text - type=warning Text - danger Text - disbled Text - strong Text - code Link Link - type=secondary The following theme veriables are exposed from the Flipper{' '} theme object. See the colors section above for a preview of the colors. } />
{JSON.stringify(theme, null, 2)}
); } function ColorPreview({name}: {name: keyof typeof theme}) { return ( } title={`theme.${name}`} /> ); } const reset = css` ol, ul { list-style: revert; margin-left: ${theme.space.huge}px; } .ant-alert { margin-bottom: ${theme.space.huge}px; } .ant-card { background: transparent; } `;