Sha256: fec72fb9bb01124c7ca6a0e32d98abf374df8d2ed67d0f7d132bc2af258443a3

Contents?: true

Size: 1.94 KB

Versions: 149

Compression:

Stored size: 1.94 KB

Contents

import React from 'react'
import classnames from 'classnames'
import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
import { globalProps, GlobalProps } from '../utilities/globalProps'

import Flex  from "../pb_flex/_flex"
import Icon from '../pb_icon/_icon'
import Button from '../pb_button/_button'

type MapProps = {
  aria?: { [key: string]: string },
  children?: React.ReactChild[] | React.ReactNode,
  className?: string,
  data?: { [key: string]: string },
  id?: string,
  zoomBtns?: boolean,
  flyTo?: boolean, 
  zoomInClick?: () => {},
  zoomOutClick?: () => {},
  flyToClick?: () => {},
} & GlobalProps

const Map = (props: MapProps) => {
  const {
  aria = {},
  children,
  className,
  data = {},
  id,
  zoomBtns = false,
  flyTo = false,
  zoomInClick,
  zoomOutClick,
  flyToClick
  } = props

  const ariaProps = buildAriaProps(aria)
  const dataProps = buildDataProps(data)
  const classes = classnames(buildCss('pb_map'), globalProps(props), className)

  return (
    <div
        {...ariaProps}
        {...dataProps}
        className={classes}
        id={id}
    >
      {
        zoomBtns ? (
          <Flex className="custom-nav-control" orientation='column'>
            <div className="custom-nav-control-zoom">
              <Button className='map-zoom-in-button'
                  onClick={zoomInClick}
              >
                    <Icon icon="plus"/>
              </Button>
              <Button className='map-zoom-out-button'
                 onClick={zoomOutClick}
              >
                    <Icon icon="minus"/>
              </Button>
            </div>
            {
              flyTo ? (
                <Button className='map-flyto-button'
                  onClick={flyToClick}
                >
                      <Icon icon="eye"/>
                </Button>
              ) : null
            }
         </Flex>
         ) : null
      }
      {children}
    </div>
  )
}

export default Map

Version data entries

149 entries across 149 versions & 1 rubygems

Version Path
playbook_ui-12.18.0.pre.alpha.PLAY603datepickerquickpickinputpresetdropdown628 app/pb_kits/playbook/pb_map/_map.tsx
playbook_ui-12.18.0.pre.alpha.play786multilevelselectimprovements627 app/pb_kits/playbook/pb_map/_map.tsx
playbook_ui-12.18.0.pre.alpha.PLAY603datepickerquickpickinputpresetdropdown626 app/pb_kits/playbook/pb_map/_map.tsx
playbook_ui-12.18.0.pre.alpha.PLAY603datepickerquickpickinputpresetdropdown617 app/pb_kits/playbook/pb_map/_map.tsx
playbook_ui-12.18.0.pre.alpha.PLAY735mobileheadersfix616 app/pb_kits/playbook/pb_map/_map.tsx
playbook_ui-12.18.0.pre.alpha.play786multilevelselectimprovements613 app/pb_kits/playbook/pb_map/_map.tsx
playbook_ui-12.18.0.pre.alpha.PLAY747carddarktokens610 app/pb_kits/playbook/pb_map/_map.tsx
playbook_ui-12.18.0.pre.alpha.PLAY785typeaheadts608 app/pb_kits/playbook/pb_map/_map.tsx
playbook_ui-12.18.0.pre.alpha.PLAY785typeaheadts607 app/pb_kits/playbook/pb_map/_map.tsx
playbook_ui-12.18.0 app/pb_kits/playbook/pb_map/_map.tsx
playbook_ui-12.17.1 app/pb_kits/playbook/pb_map/_map.tsx
playbook_ui-12.17.0.pre.alpha.lightboxcurrentPhotoIndex582 app/pb_kits/playbook/pb_map/_map.tsx
playbook_ui-12.17.0 app/pb_kits/playbook/pb_map/_map.tsx
playbook_ui-12.16.0.pre.alpha.tooltippositionprop566 app/pb_kits/playbook/pb_map/_map.tsx
playbook_ui-12.16.0.pre.alpha.PLAY693tooltipwrongbg558 app/pb_kits/playbook/pb_map/_map.tsx
playbook_ui-12.16.0.pre.alpha.PLAY693tooltipwrongbg547 app/pb_kits/playbook/pb_map/_map.tsx
playbook_ui-12.16.0.pre.alpha.PLAY693tooltipwrongbg532 app/pb_kits/playbook/pb_map/_map.tsx
playbook_ui-12.16.0.pre.alpha.lightboxcurrentphotoprop531 app/pb_kits/playbook/pb_map/_map.tsx
playbook_ui-12.16.0.pre.alpha.tiptaptestingpart1528 app/pb_kits/playbook/pb_map/_map.tsx
playbook_ui-12.16.0 app/pb_kits/playbook/pb_map/_map.tsx