@atlaskit/navigation-system
Version:
The latest navigation system for Atlassian apps.
50 lines (48 loc) • 2.22 kB
JavaScript
/* themed-pressable.tsx generated by @compiled/babel-plugin v3.0.2 */
import _extends from "@babel/runtime/helpers/extends";
import "./themed-pressable.compiled.css";
import { ax, ix } from "@compiled/react/runtime";
import React, { forwardRef } from 'react';
import { cx } from '@compiled/react';
import { Pressable } from '@atlaskit/primitives/compiled/pressable';
import { getPrimitiveSpreadProps } from './get-primitives-spread-props';
const styles = {
root: "_zulp12x7 _11c8fhey _2rko1qi0 _v564k6bl _4bfu1r31 _1hmsglyw _ajmmnqa1 _1rjcze3t _1e0c1txw _4cvr1h6o _1bah1h6o _4t3i5r7u _kqswh2mm _1nrm1r31 _1a3b1r31 _9oik1r31 _c2waglyw _4fprglyw _1bnxglyw _1iohnqa1 _5goinqa1 _jf4cnqa1 _1ggl5xtf",
border: "_14mj1kw7 _9v7aze3t _1tv3nqa1 _39yqe4h9 _aetrb3bt _18postnw",
selected: "_11q71qds _syazw5ct _8l3m15jn _f8pjw5ct _1053w5ct _19lcjrv1 _30l3w5ct _j6xtnh62 _9h8hw5ct",
disabled: "_11q71c9b _syaz1i3i _8l3m4il5 _f8pj1i3i _10531i3i _19lc1c9b _30l31i3i _j6xt1c9b _9h8h1i3i"
};
const shapeStyles = {
default: "_18zrutpp",
square: "_18zrze3t _1bsb5r7u _vwz4idpf"
};
const appearanceStyles = {
default: "_11q7pkxg _syaz1r31 _8l3maykr _f8pj1r31 _10531r31 _19lc1rps _30l31r31 _j6xtqtgh _9h8h1r31",
subtle: "_11q7pkxg _syaz1r31 _f8pj1r31 _10531r31 _19lc1rps _30l31r31 _j6xtqtgh _9h8h1r31",
primary: "_11q7esko _syaz15o7 _f8pj15o7 _105315o7 _19lcp6hf _30l315o7 _j6xt5sko _9h8h15o7"
};
/**
* Props shared by `ThemedPressable` and `ThemedAnchor`
*/
export const ThemedPressable = /*#__PURE__*/forwardRef(({
appearance = 'default',
shape = 'default',
isSelected,
isDisabled,
...props
}, ref) => {
const hasBorder = appearance === 'default' || isSelected;
return /*#__PURE__*/React.createElement(Pressable, _extends({}, getPrimitiveSpreadProps(props), {
ref: ref,
type: "button"
/**
* We are using some style values that are outside of the strict
* `@atlaskit/css` types.
*/
// @ts-expect-error
// eslint-disable-next-line @compiled/no-suppress-xcss
,
xcss: cx(styles.root, shapeStyles[shape], hasBorder && styles.border, appearanceStyles[appearance], isSelected && styles.selected, isDisabled && styles.disabled),
isDisabled: isDisabled
}));
});