import * as React from "react"; import { useState } from "react"; import * as ReactDOM from "react-dom"; import * as Yup from "yup"; import { Box, Text, Button, Reset, Anchor, Row, Col, Paragraph, BaseButton, BaseAnchor, Action, Icon, Indicator, StatelessCheckboxField, StatelessRadioButtonField, StatelessToggleSwitchField, StatelessTextInput, StatelessTextArea, ManagedTextInputField, ManagedToggleSwitchField, ManagedTextAreaField, ErrorLabel, Label, Checkbox, RadioButton, ToggleSwitch, Rule, FormController, ManagedCheckboxField, ManagedRadioButtonField, ManagedForm, _light as light, _dark as dark, Theme, TwoUp, DisclosureBox, DisclosureButton, Menu, MenuButton, MenuList, MenuItem, ContinuousProgressBar, SegmentedProgressBar, LoadingSpinner, FourUp, _iconIndex, Badge, H1, H2, H3, H4, Li, Ol, Ul, Table, Tr, Td } from "local-indigo-react"; import css, { SystemStyleObject } from "@styled-system/css"; import { ThemeProvider } from "styled-components"; interface ManagedFormValues { firstName: string; lastName: string; iagree: boolean; myStory: string; color: "blue" | "green"; toggleSwitch: boolean; } const ManagedFormSchema = Yup.object().shape({ firstName: Yup.string() .min(2, "Too Short!") .max(50, "Too Long!") .required("Required"), lastName: Yup.string() .min(2, "Too Short!") .max(50, "Too Long!") .required("Required"), iagree: Yup.boolean().test( "isTrue", "You must agree to the TOS before proceeding", (v) => !!v ), // about: Yup.string(), // middleName: Yup.string() // .min(2, 'Too Short!') // .max(50, 'Too Long!') // .required('Required'), color: Yup.string().oneOf(["blue", "green"]), // urbitid: Yup.string() // .test( // 'is-patp', // 'Not a valid Urbit ID', // (value) => { // if (value) return ob.isValidPatp(value) // return // }) // .required('An Urbit ID is Required'), // disabledfield: Yup.string(), // iagree: Yup.boolean().test('isTrue', 'You must agree to the TOS before proceeding', v => !!v) }); const inputTargetVal = (event: React.FormEvent) => { const element = event.currentTarget as HTMLInputElement; return element.value; }; const textAreaTargetVal = (event: React.FormEvent) => { const element = event.currentTarget as HTMLTextAreaElement; return element.value; }; const p = "4"; const enumerateColors = (theme: Theme) => Object.entries(theme.colors).map(([k, v]) => { if (k === "scales" || k === "util") return null; return ( {k} ); }); type ThemeColorsProps = { theme: Theme }; const ThemeColors = ({ theme }: ThemeColorsProps) => ( {enumerateColors(theme)} ); const App = () => { // Checkboxes const [defaultCheckboxIsSelected, defaultCheckboxIsSelectedToggle] = useState( true ); const [errorCheckboxIsSelected, errorCheckboxIsSelectedToggle] = useState( false ); const [statelessCheckboxSelected, statelessCheckboxToggle] = useState(false); const [ checkboxErrorTriggerSelected, checkboxErrorTriggerSelectedToggle, ] = useState(false); // RadioButton const [ defaultRadioButtonIsSelected, defaultRadioButtonIsSelectedToggle, ] = useState(true); const [ errorRadioButtonIsSelected, errorRadioButtonIsSelectedToggle, ] = useState(false); const [statelessRadioButtonIndex, statelessRadioButtonSelect] = useState(0); // ToggleSwitch const [ defaultToggleSwitchIsSelected, defaultToggleSwitchIsSelectedToggle, ] = useState(true); const [ errorToggleSwitchIsSelected, errorToggleSwitchIsSelectedToggle, ] = useState(false); const [statelessToggleSwitchSelected, statelessToggleSwitchToggle] = useState( false ); // TextInput const [ statelessTextInputFieldValue, statelessTextInputFieldOnChange, ] = useState(""); // TextArea const [ statelessTextAreaFieldValue, statelessTextAreaFieldOnChange, ] = useState(""); const [disclosureBoxOpen, disclosureBoxToggle] = useState(false); const initialValues: ManagedFormValues = { firstName: "", lastName: "", iagree: false, color: "blue", toggleSwitch: false, myStory: "", }; const [theme, chooseTheme] = useState(light); return ( { // {JSON.stringify(css({color:'blue'})(theme))} } {"Indigo Examples"} Tools: Github Figma Pesticide for Chrome 0 1 2 3

Heading 1

Heading 2

Heading 3

Heading 4

{""} Default asdfghjkl;qwertyuiop[zxcvbnm,.dsfgsdhsfhfg Monospace Bold Gray http://www.urbit.org Link to new Tab
Badge
A bunch of inlined If we haven’t seen them before, we can optionally register them for a new account. We then invalidate the token so it can’t be used again (though it was going to expire after 15 minutes, anyways). elements Badge {""} Badge Action Disabled Action Destructive Action Desctructive + Disabled Action
{"
    "}
    1. First
    2. Second
    3. Third
    {"
      "}
      • Foo
      • Bar
      • Baz
      {"