@atlaskit/progress-indicator
Version:
A progress indicator shows the user where they are along the steps of a journey.
68 lines • 2.48 kB
JavaScript
/* button-indicator.tsx generated by @compiled/babel-plugin v3.0.2 */
import "./button-indicator.compiled.css";
import * as React from 'react';
import { ax, ix } from "@compiled/react/runtime";
import { cx } from '@compiled/react';
import { Pressable } from '@atlaskit/primitives/compiled';
import VisuallyHidden from '@atlaskit/visually-hidden/visually-hidden';
var commonStyles = {
common: "_2rko1rr0 _1bsbg7kr _4t3ig7kr _kqswh2mm _cfu11ule _1mp41th6 _kfgt1th6 _1cs8stnw _1kt9b3bt _iajm1yh4 _z5wt1yh4"
};
var colorBorderMap = {
default: "_19it1axi",
help: "_19it1axi",
inverted: "_19it1ps9",
primary: "_19it1axi"
};
var buttonStyle = {
root: "_12ji1r31 _1qu2glyw _12y3idpf _1q51ze3t _y4tize3t _85i5ze3t _bozgze3t _80omtlke"
};
var backgroundColor = function backgroundColor(isSelected) {
if (!isSelected) {
return {
default: "var(--ds-surface, #FFFFFF)",
help: "var(--ds-surface, #FFFFFF)",
inverted: "var(--ds-background-neutral-subtle, #00000000)",
primary: "var(--ds-surface, #FFFFFF)"
};
}
return {
default: "var(--ds-icon, #292A2E)",
help: "var(--ds-icon-discovery, #AF59E1)",
inverted: "var(--ds-icon-inverse, #FFFFFF)",
primary: "var(--ds-icon-brand, #1868DB)"
};
};
// TODO: Fill in the component {description} and ensure links point to the correct {packageName} location.
// Remove links that the component does not have (such as usage). If there are no links remove them all.
/**
* __Button indicator__
*
* A button indicator {description}.
*
* - [Examples](https://atlassian.design/components/{packageName}/examples)
* - [Code](https://atlassian.design/components/{packageName}/code)
* - [Usage](https://atlassian.design/components/{packageName}/usage)
*/
export var ButtonIndicator = function ButtonIndicator(_ref) {
var appearance = _ref.appearance,
panelId = _ref.panelId,
tabId = _ref.tabId,
label = _ref.label,
isSelected = _ref.isSelected,
onClick = _ref.onClick,
testId = _ref.testId;
return /*#__PURE__*/React.createElement(Pressable, {
role: "tab",
style: {
backgroundColor: backgroundColor(isSelected)[appearance]
},
xcss: cx(commonStyles.common, buttonStyle.root, colorBorderMap[appearance]),
"aria-controls": panelId,
"aria-selected": isSelected,
id: tabId,
onClick: onClick,
tabIndex: isSelected ? -1 : undefined,
testId: testId
}, /*#__PURE__*/React.createElement(VisuallyHidden, null, label));
};