How to use the react-view.PropTypes.Enum function in react-view

To help you get started, we’ve selected a few react-view examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github uber / baseweb / documentation-site / components / yard / config / drawer.ts View on Github external
description: 'Drawer content.',
    },
    onClose: {
      value: '() => setIsOpen(false);',
      type: PropTypes.Function,
      description: 'A callback that is invoked when the modal will close.',
      propHook: {
        what: 'false',
        into: 'isOpen',
      },
    },
    size: {
      value: 'SIZE.default',
      options: SIZE,
      defaultValue: 'SIZE.default',
      type: PropTypes.Enum,
      description: 'Defines the modal size.',
      imports: {
        'baseui/drawer': {
          named: ['SIZE'],
        },
      },
    },
    anchor: {
      value: 'ANCHOR.default',
      options: ANCHOR,
      defaultValue: 'ANCHOR.default',
      type: PropTypes.Enum,
      description: 'Window side from which the drawer originates from.',
      imports: {
        'baseui/drawer': {
          named: ['ANCHOR'],
github uber / baseweb / documentation-site / components / yard / config / tag.ts View on Github external
imports: {
        'baseui/tag': {
          named: ['KIND'],
        },
      },
    },
    color: {
      value: undefined,
      type: PropTypes.String,
      description: `The color theme to be applied to a Tag. To make this custom color active, you have to set kind to custom.`,
    },
    variant: {
      value: 'VARIANT.light',
      defaultValue: 'VARIANT.light',
      options: VARIANT,
      type: PropTypes.Enum,
      description:
        'Defines tags look. Set it to one of VARIANT[key] values. Defaults to VARIANT.light.',
      imports: {
        'baseui/tag': {
          named: ['VARIANT'],
        },
      },
    },
    disabled: {
      value: false,
      type: PropTypes.Boolean,
      description: `Disable the tag from being changed.`,
    },
    isFocused: {
      value: false,
      type: PropTypes.Boolean,
github uber / baseweb / documentation-site / components / yard / config / toast.ts View on Github external
usePortal: {
      value: true,
      defaultValue: true,
      type: PropTypes.Boolean,
      description: `Indicates if 'createPortal' is used to append the toaster container to the body element.`,
      hidden: true,
    },
    overrides: {
      value: undefined,
      type: PropTypes.Custom,
      description: 'Lets you customize all aspects of the component.',
      custom: {
        names: ['Root', 'ToastBody', 'ToastInnerContainer', 'ToastCloseIcon'],
        sharedProps: {
          $kind: {
            type: PropTypes.Enum,
            description: 'Defines the type of notification.',
          },
          $closeable: {
            type: PropTypes.Boolean,
            description: `When set to true a close button is displayed
            and the notification can be dismissed by a user.`,
          },
        },
      },
    },
  },
  mapTokensToProps: {
    ToasterContainer: toasterContainerProps,
    Button: buttonProps,
    Block: blockProps,
  },
github uber / baseweb / documentation-site / components / yard / config / toast.ts View on Github external
SIZE,
    Block,
  },
  theme: [
    'toastInfoBackground',
    'toastPositiveBackground',
    'toastWarningBackground',
    'toastNegativeBackground',
    'toastText',
  ],
  props: {
    placement: {
      value: 'PLACEMENT.top',
      defaultValue: 'PLACEMENT.top',
      options: PLACEMENT,
      type: PropTypes.Enum,
      description: `Defines notifications placement.`,
      imports: {
        'baseui/toast': {
          named: ['PLACEMENT'],
        },
      },
    },
    children: {
      value: `<button>{
          let toastKey;
          const msg = 'Use toaster.info(), toaster.positive(), toaster.warning(), or toaster.negative()';
          const ok = (
            
              </button><button size="{SIZE.compact}">toaster.clear(toastKey)}&gt;Ok</button>
            
          );
github uber / baseweb / documentation-site / components / yard / config / list-item.ts View on Github external
props: {
    children: {
      value: 'Label',
      type: PropTypes.ReactNode,
      description: 'List item content.',
    },
    artwork: {
      value: 'props =&gt; ',
      type: PropTypes.ReactNode,
      description: 'Left-hand icon to render in the list item.',
    },
    artworkSize: {
      value: undefined,
      options: ARTWORK_SIZES,
      enumName: 'ARTWORK_SIZES',
      type: PropTypes.Enum,
      description: 'Defines the size of the artwork.',
      imports: {
        'baseui/list': {
          named: ['ARTWORK_SIZES'],
        },
      },
    },
    endEnhancer: {
      value: '() =&gt; "Right-Label"',
      type: PropTypes.ReactNode,
      description: 'Right-hand content to render in the list item.',
    },
    sublist: {
      value: false,
      type: PropTypes.Boolean,
      description: 'Renders the list item smaller to convey hierarchy.',
github uber / baseweb / documentation-site / components / yard / config / phone-input.ts View on Github external
imports: {
    'baseui/phone-input': {
      named: ['PhoneInput'],
    },
  },
  scope: {
    PhoneInput,
    COUNTRIES,
    SIZE,
  },
  theme,
  props: {
    country: {
      value: undefined,
      options: countriesEnum,
      type: PropTypes.Enum,
      enumName: 'COUNTRIES',
      description: 'Input value attribute.',
      stateful: true,
      imports: {
        'baseui/phone-input': {
          named: ['COUNTRIES'],
        },
      },
    },
    onCountryChange: {
      value: '({option}) => setCountry(option)',
      type: PropTypes.Function,
      description: 'Called when country value is changed.',
      propHook: {
        what: '"COUNTRIES." + option.id',
        into: 'country',
github uber / baseweb / documentation-site / components / yard / config / button.ts View on Github external
value: 'KIND.primary',
      defaultValue: 'KIND.primary',
      options: KIND,
      type: PropTypes.Enum,
      description: 'Defines the kind (purpose) of a button.',
      imports: {
        'baseui/button': {
          named: ['KIND'],
        },
      },
    },
    size: {
      value: 'SIZE.default',
      defaultValue: 'SIZE.default',
      options: SIZE,
      type: PropTypes.Enum,
      description: 'Defines the size of the button.',
      imports: {
        'baseui/button': {
          named: ['SIZE'],
        },
      },
    },
    shape: {
      value: 'SHAPE.default',
      defaultValue: 'SHAPE.default',
      options: SHAPE,
      type: PropTypes.Enum,
      description: 'Defines the shape of the button.',
      imports: {
        'baseui/button': {
          named: ['SHAPE'],
github uber / baseweb / documentation-site / components / yard / config / notification.ts View on Github external
theme: [
    'notificationInfoBackground',
    'notificationPositiveBackground',
    'notificationWarningBackground',
    'notificationNegativeBackground',
    'notificationInfoText',
    'notificationPositiveText',
    'notificationWarningText',
    'notificationNegativeText',
  ],
  props: {
    kind: {
      value: 'KIND.info',
      defaultValue: 'KIND.info',
      options: KIND,
      type: PropTypes.Enum,
      description: 'Defines the type of notification.',
      imports: {
        'baseui/notification': {
          named: ['KIND'],
        },
      },
    },
    closeable: {
      value: undefined,
      type: PropTypes.Boolean,
      description:
        'When set to true a close button is displayed and the notification can be dismissed by a user.',
    },
    children: {
      value: '{() => "This is a notification."}',
      type: PropTypes.Function,
github uber / baseweb / documentation-site / components / yard / config / select.ts View on Github external
value: undefined,
      type: PropTypes.Boolean,
      description: 'Defines if the control is in positive state.',
    },
    escapeClearsValue: {
      value: true,
      type: PropTypes.Boolean,
      defaultValue: true,
      description:
        'Defines if the value is cleared when escape is pressed and the dropdown is closed.',
    },
    size: {
      value: 'SIZE.default',
      defaultValue: 'SIZE.default',
      options: SIZE,
      type: PropTypes.Enum,
      description:
        'Defines the size (scale) of dropdown menu items. See the Menu component API.',
      imports: {
        'baseui/select': {
          named: ['SIZE'],
        },
      },
    },
    options: {
      value: `[
  {label: 'AliceBlue', id: '#F0F8FF'},
  {label: 'AntiqueWhite', id: '#FAEBD7'},
  {label: 'Aqua', id: '#00FFFF'},
  {label: 'Aquamarine', id: '#7FFFD4'},
  {label: 'Azure', id: '#F0FFFF'},
  {label: 'Beige', id: '#F5F5DC'},
github uber / baseweb / documentation-site / components / yard / config / checkbox.ts View on Github external
},
    isError: {
      value: false,
      type: PropTypes.Boolean,
      description: 'Renders component in error state.',
    },
    isIndeterminate: {
      value: false,
      type: PropTypes.Boolean,
      description:
        'Indicates indeterminate state for the checkmark. Checked property is ignored.',
    },
    labelPlacement: {
      value: 'LABEL_PLACEMENT.right',
      options: LABEL_PLACEMENT,
      type: PropTypes.Enum,
      enumName: 'LABEL_PLACEMENT',
      description:
        'Determines how to position the label relative to the checkbox.',
      imports: {
        'baseui/checkbox': {
          named: ['LABEL_PLACEMENT'],
        },
      },
    },
    required: {
      value: false,
      type: PropTypes.Boolean,
      description: 'Renders component in required state.',
      hidden: true,
    },
    inputRef: {