Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import cx from 'classnames';
import React from 'react';
import PropTypes from 'prop-types';
import ChevronDown16 from '@carbon/icons-react/lib/chevron--down/16';
import { settings } from 'carbon-components';
const { prefix } = settings;
export const translationIds = {
'close.menu': 'close.menu',
'open.menu': 'open.menu',
};
const defaultTranslations = {
[translationIds['close.menu']]: 'Close menu',
[translationIds['open.menu']]: 'Open menu',
};
/**
* `ListBoxMenuIcon` is used to orient the icon up or down depending on the
* state of the menu for a given `ListBox`
*/
const ListBoxMenuIcon = ({ isOpen, translateWithId: t }) => {
const className = cx({
[`${prefix}--list-box__menu-icon`]: true,
[`${prefix}--list-box__menu-icon--open`]: isOpen,
});
const description = isOpen ? t('close.menu') : t('open.menu');
return (
<div role="button">
<title>{description}</title></div>
*/
import React from 'react';
import { settings } from 'carbon-components';
import PropTypes from 'prop-types';
const { prefix } = settings;
export const translationIds = {
'close.menu': 'close.menu',
'open.menu': 'open.menu',
};
const defaultTranslations = {
[translationIds['close.menu']]: 'Close menu',
[translationIds['open.menu']]: 'Open menu',
};
/**
* `ListBoxField` is responsible for creating the containing node for valid
* elements inside of a field. It also provides a11y-related attributes like
* `role` to make sure a user can focus the given field.
*/
const ListBoxField = ({
children,
id,
disabled,
tabIndex,
translateWithId: t,
...rest
}) => (
import cx from 'classnames';
import React from 'react';
import PropTypes from 'prop-types';
import { iconCaretDown } from 'carbon-icons';
import { Icon } from 'carbon-components-react';
export const translationIds = {
'close.menu': 'close.menu',
'open.menu': 'open.menu',
};
const defaultTranslations = {
[translationIds['close.menu']]: 'Close menu',
[translationIds['open.menu']]: 'Open menu',
};
/**
* `ListBoxMenuIcon` is used to orient the icon up or down depending on the
* state of the menu for a given `ListBox`
*/
const ListBoxMenuIcon = ({ isOpen, translateWithId: t }) => {
const className = cx({
'bx--list-box__menu-icon': true,
'bx--list-box__menu-icon--open': isOpen,
});
const description = isOpen ? t('close.menu') : t('open.menu');
return (
<div>
</div>
import cx from 'classnames';
import React from 'react';
import PropTypes from 'prop-types';
import { ChevronDown16 } from '@carbon/icons-react';
import { settings } from 'carbon-components';
const { prefix } = settings;
export const translationIds = {
'close.menu': 'close.menu',
'open.menu': 'open.menu',
};
const defaultTranslations = {
[translationIds['close.menu']]: 'Close menu',
[translationIds['open.menu']]: 'Open menu',
};
/**
* `ListBoxMenuIcon` is used to orient the icon up or down depending on the
* state of the menu for a given `ListBox`
*/
const ListBoxMenuIcon = ({ isOpen, translateWithId: t }) => {
const className = cx(`${prefix}--list-box__menu-icon`, {
[`${prefix}--list-box__menu-icon--open`]: isOpen,
});
const description = isOpen ? t('close.menu') : t('open.menu');
return (
<div>
<title>{description}</title>
</div>