Sha256: 0e639c5d499216caaa428bdb0136f8a45276bf599547173b5f34e5ac268afc2e

Contents?: true

Size: 1.14 KB

Versions: 98

Compression:

Stored size: 1.14 KB

Contents

import React from 'react'
import classnames from 'classnames'
import { GlobalProps, globalProps } from '../utilities/globalProps'

import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'

type OnlineStatusProps = {
  aria?: {[key: string]: string},
  className?: string,
  data?: {[key: string]: string | number},
  htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
  id?: string,
  status?: "away" | "error" | "info" | "neutral" | "offline" |"online" | "primary"| "success" | "warning",
} & GlobalProps

const OnlineStatus = (props: OnlineStatusProps) => {
  const {
    aria = {},
    className,
    data = {},
    htmlOptions = {},
    id,
    status = 'offline',
  } = props

  aria.label = status

  const ariaProps = buildAriaProps(aria)
  const dataProps = buildDataProps(data)
  const htmlProps = buildHtmlProps(htmlOptions)
  const classes = classnames(buildCss('pb_online_status_kit', status), globalProps(props), className)

  return (
    <div
        {...ariaProps}
        {...dataProps}
        {...htmlProps}
        className={classes}
        id={id}
    />
  )
}

export default OnlineStatus

Version data entries

98 entries across 98 versions & 1 rubygems

Version Path
playbook_ui-13.30.0.pre.alpha.20240515remotebuildkitconversion3150 app/pb_kits/playbook/pb_online_status/_online_status.tsx
playbook_ui-13.30.0.pre.alpha.PBNTR353draggablev53136 app/pb_kits/playbook/pb_online_status/_online_status.tsx
playbook_ui-13.30.0.pre.alpha.PLAY1328fixtimelinekitglobalpropsreact3096 app/pb_kits/playbook/pb_online_status/_online_status.tsx
playbook_ui-13.30.0 app/pb_kits/playbook/pb_online_status/_online_status.tsx
playbook_ui-13.29.0.pre.alpha.removeduplicatekitexampleclass3063 app/pb_kits/playbook/pb_online_status/_online_status.tsx
playbook_ui-13.29.0.pre.alpha.PBNTR329draggablev33060 app/pb_kits/playbook/pb_online_status/_online_status.tsx
playbook_ui-13.29.0.pre.alpha.PBNTR329draggablev33059 app/pb_kits/playbook/pb_online_status/_online_status.tsx
playbook_ui-13.29.0.pre.alpha.testingcollapsibleissue3052 app/pb_kits/playbook/pb_online_status/_online_status.tsx
playbook_ui-13.29.0 app/pb_kits/playbook/pb_online_status/_online_status.tsx
playbook_ui-13.28.0.pre.alpha.PBNTR297gradientoverlay3029 app/pb_kits/playbook/pb_online_status/_online_status.tsx
playbook_ui-13.28.0.pre.alpha.pbntr312tableheaderflexremoval3019 app/pb_kits/playbook/pb_online_status/_online_status.tsx
playbook_ui-13.28.0.pre.alpha.dialogturbostreameventlistener3017 app/pb_kits/playbook/pb_online_status/_online_status.tsx
playbook_ui-13.28.0.pre.alpha.PLAY1338alpha3001 app/pb_kits/playbook/pb_online_status/_online_status.tsx
playbook_ui-13.28.0.pre.alpha.PLAY1343fixTooltiprunwayissue2987 app/pb_kits/playbook/pb_online_status/_online_status.tsx
playbook_ui-13.28.0.pre.alpha.PLAY1343fixTooltiprunwayissue2986 app/pb_kits/playbook/pb_online_status/_online_status.tsx
playbook_ui-13.28.0.pre.alpha.PLAY1343fixTooltiprunwayissue2984 app/pb_kits/playbook/pb_online_status/_online_status.tsx
playbook_ui-13.27.0 app/pb_kits/playbook/pb_online_status/_online_status.tsx
playbook_ui-13.26.0.pre.alpha.PBNTR291Dropdownrailsv22840 app/pb_kits/playbook/pb_online_status/_online_status.tsx
playbook_ui-13.26.0.pre.alpha.jasoncypretpatch12820 app/pb_kits/playbook/pb_online_status/_online_status.tsx
playbook_ui-13.26.0.pre.alpha.jasoncypretpatch12816 app/pb_kits/playbook/pb_online_status/_online_status.tsx