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.28.0.pre.alpha.PLAY863multilevelv2877 app/pb_kits/playbook/pb_map/_map.tsx
playbook_ui-12.28.0.pre.alpha.PLAY863multilevelv2876 app/pb_kits/playbook/pb_map/_map.tsx
playbook_ui-12.28.0.pre.alpha.PLAY814removemomentjs871 app/pb_kits/playbook/pb_map/_map.tsx
playbook_ui-12.28.0.pre.alpha.PLAY603datepickerquickpickinputpresetdropdown869 app/pb_kits/playbook/pb_map/_map.tsx
playbook_ui-12.28.0.pre.alpha.20230613implementbakesupport865 app/pb_kits/playbook/pb_map/_map.tsx
playbook_ui-12.28.0 app/pb_kits/playbook/pb_map/_map.tsx
playbook_ui-12.27.0.pre.alpha.expandednotworking853 app/pb_kits/playbook/pb_map/_map.tsx
playbook_ui-12.27.0 app/pb_kits/playbook/pb_map/_map.tsx
playbook_ui-12.26.1.pre.alpha.railsmultilevelimprovements842 app/pb_kits/playbook/pb_map/_map.tsx
playbook_ui-12.26.1.pre.alpha.railsmultilevelimprovements837 app/pb_kits/playbook/pb_map/_map.tsx
playbook_ui-12.26.1.pre.alpha.PLAY860PhoneNumInputOptions836 app/pb_kits/playbook/pb_map/_map.tsx
playbook_ui-12.26.1.pre.alpha.railsmultilevelimprovements835 app/pb_kits/playbook/pb_map/_map.tsx
playbook_ui-12.26.1.pre.alpha.play716popoverkitcloseonclickissue833 app/pb_kits/playbook/pb_map/_map.tsx
playbook_ui-12.26.1.pre.alpha.PLAY603datepickerquickpickinputpresetdropdown831 app/pb_kits/playbook/pb_map/_map.tsx
playbook_ui-12.26.1 app/pb_kits/playbook/pb_map/_map.tsx
playbook_ui-12.26.0.pre.alpha.multiselectfixes825 app/pb_kits/playbook/pb_map/_map.tsx
playbook_ui-12.26.0.pre.alpha.PLAY603datepickerquickpickinputpresetdropdown822 app/pb_kits/playbook/pb_map/_map.tsx
playbook_ui-12.26.0.pre.alpha.multiselectfixes821 app/pb_kits/playbook/pb_map/_map.tsx
playbook_ui-12.26.0.pre.alpha.PLAY603datepickerquickpickinputpresetdropdown818 app/pb_kits/playbook/pb_map/_map.tsx
playbook_ui-12.26.0.pre.alpha.PLAY603datepickerquickpickinputpresetdropdown817 app/pb_kits/playbook/pb_map/_map.tsx