How to use the react-view.PropTypes.Custom 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 / textarea.ts View on Github external
const TextareaConfig: TConfig = {
  imports: {
    'baseui/textarea': {named: ['Textarea']},
  },
  scope: {
    Textarea,
    SIZE,
    ADJOINED,
  },
  theme,
  props: {
    ...omit(inputProps, ['type', 'startEnhancer', 'endEnhancer']),
    overrides: {
      value: undefined,
      type: PropTypes.Custom,
      description: 'Lets you customize all aspects of the component.',
      custom: {
        names: ['Input', 'InputContainer'],
        sharedProps: {
          $isFocused: {
            type: PropTypes.Boolean,
            description: 'True when the component is focused.',
          },
          $disabled: 'disabled',
          $error: 'error',
          $positive: 'positive',
          $adjoined: 'adjoined',
          $size: 'size',
          $required: 'required',
        },
      },
github uber / baseweb / documentation-site / components / yard / config / payment-card.ts View on Github external
value: '',
    },
    ...omit(inputProps, [
      'type',
      'startEnhancer',
      'endEnhancer',
      'value',
      'placeholder',
    ]),
    placeholder: {
      ...inputProps.placeholder,
      value: undefined,
    },
    overrides: {
      value: undefined,
      type: PropTypes.Custom,
      description: 'Lets you customize all aspects of the component.',
      custom: {
        names: ['Root', 'Input', 'InputContainer', 'IconWrapper'],
        sharedProps: {
          $isFocused: {
            type: PropTypes.Boolean,
            description: 'True when the component is focused.',
          },
          $disabled: 'disabled',
          $error: 'error',
          $positive: 'positive',
          $adjoined: 'adjoined',
          $size: 'size',
          $required: 'required',
        },
      },
github uber / baseweb / documentation-site / components / yard / config / accordion.ts View on Github external
'baseui/accordion': {named: ['Panel']},
      },
    },
    onChange: {
      value: '({expanded}) => console.log(expanded)',
      type: PropTypes.Function,
      description: 'Called when a panel is expanded.',
    },
    disabled: {
      value: false,
      type: PropTypes.Boolean,
      description: 'Renders component in disabled state.',
    },
    overrides: {
      value: undefined,
      type: PropTypes.Custom,
      description: 'Lets you customize all aspects of the component.',
      custom: {
        names: ['Content', 'Header', 'PanelContainer', 'Root', 'ToggleIcon'],
        sharedProps: {
          $disabled: 'disabled',
        },
      },
    },
  },
  mapTokensToProps: {
    Accordion: accordionProps,
    Panel: panelProps,
  },
};

export default AccordionConfig;
github uber / baseweb / documentation-site / components / yard / config / breadcrumbs.ts View on Github external
<span>Current Page</span>
`,
      type: PropTypes.ReactNode,
      description: 'Elements separated by divider',
      imports: {
        'baseui/link': {named: ['StyledLink']},
      },
    },
    ariaLabel: {
      value: undefined,
      description: 'Elements separated by divider',
      type: PropTypes.String,
    },
    overrides: {
      value: undefined,
      type: PropTypes.Custom,
      description: 'Lets you customize all aspects of the component.',
      custom: {
        names: ['Root', 'Separator', 'List', 'ListItem', 'Icon'],
        sharedProps: {},
      },
    },
  },
  mapTokensToProps: {
    Breadcrumbs: breadcrumbsProps,
  },
};

export default BreadcrumbsConfig;
github uber / baseweb / documentation-site / components / yard / config / notification.ts View on Github external
value: undefined,
      type: PropTypes.Function,
      description: `A callback function called when a notification is dismissed.`,
      placeholder: '() => {}',
    },
    autoHideDuration: {
      value: undefined,
      type: PropTypes.Number,
      description: `The number of milliseconds to wait before automatically dismissing a
        notification. This behavior is disabled when the value is set to 0.`,
      placeholder: '10000',
    },
    ...pick(changeHandlers, ['onMouseEnter', 'onMouseLeave']),
    overrides: {
      value: undefined,
      type: PropTypes.Custom,
      description: 'Lets you customize all aspects of the component.',
      custom: {
        names: ['Body', 'CloseIcon', 'InnerContainer'],
        sharedProps: {
          $kind: 'kind',
          $closeable: 'closeable',
        },
      },
    },
  },
  mapTokensToProps: {
    Notification: notificationProps,
  },
};

export default NotificationConfig;
github uber / baseweb / documentation-site / components / yard / config / tag.ts View on Github external
value: undefined,
      placeholder: '() => alert("click")',
      type: PropTypes.Function,
      description: `onkeydown handler for the tag.`,
      hidden: true,
    },
    onActionKeyDown: {
      value: undefined,
      placeholder: '() => alert("click")',
      type: PropTypes.Function,
      description: `keydown handler for the action button element.`,
      hidden: true,
    },
    overrides: {
      value: undefined,
      type: PropTypes.Custom,
      description: 'Lets you customize all aspects of the component.',
      custom: {
        names: ['Root', 'Action', 'ActionIcon', 'Text'],
        sharedProps: {
          $kind: 'kind',
          $variant: 'variant',
          $closeable: 'closeable',
          $isActive: {
            type: PropTypes.Boolean,
            description: 'Is tag active.',
          },
          $disabled: 'disabled',
          $isHovered: 'isHovered',
          $isFocused: 'isFocused',
        },
      },
github uber / baseweb / documentation-site / components / yard / config / side-nav.ts View on Github external
type: PropTypes.String,
      description: 'Currently selected item id.',
      stateful: true,
    },
    onChange: {
      value: '({item}) => setActiveItemId(item.itemId)',
      type: PropTypes.Function,
      description: 'Called when item is clicked.',
      propHook: {
        what: 'item.itemId',
        into: 'activeItemId',
      },
    },
    overrides: {
      value: undefined,
      type: PropTypes.Custom,
      description: 'Lets you customize all aspects of the component.',
      custom: {
        names: [
          'Root',
          'NavItemContainer',
          'NavLink',
          'NavItem',
          'SubNavContainer',
        ],
        sharedProps: {
          $active: {
            type: PropTypes.Boolean,
            description: 'True if nav item is active.',
          },
          $level: {
            type: PropTypes.Number,
github uber / baseweb / documentation-site / components / yard / config / button.ts View on Github external
},
      },
    },
    isLoading: {
      value: false,
      type: PropTypes.Boolean,
      description: 'Show loading button style and spinner.',
    },
    isSelected: {
      value: false,
      type: PropTypes.Boolean,
      description: 'Indicates that the button is selected.',
    },
    overrides: {
      value: undefined,
      type: PropTypes.Custom,
      description: 'Lets you customize all aspects of the component.',
      custom: {
        names: [
          'BaseButton',
          'EndEnhancer',
          'LoadingSpinner',
          'LoadingSpinnerContainer',
          'StartEnhancer',
        ],
        sharedProps: {
          $kind: 'kind',
          $isSelected: 'isSelected',
          $shape: 'shape',
          $size: 'size',
          $isLoading: 'isLoading',
          $disabled: 'disabled',
github uber / baseweb / documentation-site / components / yard / config / input.ts View on Github external
imports: {
    'baseui/input': {
      named: ['Input'],
    },
  },
  scope: {
    Input,
    SIZE,
    ADJOINED,
  },
  theme,
  props: {
    ...inputProps,
    overrides: {
      value: undefined,
      type: PropTypes.Custom,
      description: 'Lets you customize all aspects of the component.',
      custom: {
        names: [
          'Root',
          'Input',
          'InputContainer',
          'After',
          'Before',
          'ClearIcon',
          'ClearIconContainer',
          'EndEnhancer',
          'MaskToggleButton',
          'MaskToggleHideIcon',
          'MaskToggleShowIcon',
          'StartEnhancer',
        ],
github uber / baseweb / documentation-site / components / yard / config / list-item.ts View on Github external
},
      },
    },
    endEnhancer: {
      value: '() => "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.',
    },
    overrides: {
      value: undefined,
      type: PropTypes.Custom,
      description: 'Lets you customize all aspects of the component.',
      custom: {
        names: ['Root', 'ArtworkContainer', 'Content', 'EndEnhancerContainer'],
        sharedProps: {
          $artworkSize: 'artworkSize',
          $mLeft: {
            type: PropTypes.Boolean,
            description: 'True when an artwork is present.',
          },
          $sublist: 'sublist',
        },
      },
    },
  },
  mapTokensToProps: {
    ListItem: listItemProps,