@cimpress/react-components
Version:
React components to support the MCP styleguide
101 lines • 4.05 kB
JavaScript
import React, { PureComponent } from 'react';
import { CodeExample } from '@cimpress/react-components';
import CurrencySelectorCode from '!raw-loader!./currencyselector.jsx';
import ComponentDoc from '../../shared/TabbedComponentDoc';
import CurrencySelectorDemo from './currencyselector';
const propInfos = [
{
name: 'currency',
type: 'string | string[]',
default: '',
description: 'String or array of strings representing the currently selected currency code(s).',
},
{
name: 'onChange',
type: 'function',
default: '',
description: (React.createElement("div", null,
React.createElement("p", null, "Callback function that is fired when a user selects a currency. "),
React.createElement("p", null,
"Signature:",
' ',
React.createElement("code", null,
"function({ value: string, label: string, flag: node, symbol: string, country: string, iso2: string }) ",
'=>',
" void"),
' '),
React.createElement("p", null,
React.createElement("code", null, "value:"),
" 3-letter code for the selected currency."),
React.createElement("p", null,
React.createElement("code", null, "label:"),
" The name of the currency's originating country or region.",
React.createElement("br", null)),
React.createElement("p", null,
React.createElement("code", null, "flag:"),
" Image for the flag of the currency's originating country or region.",
React.createElement("br", null)),
React.createElement("p", null,
React.createElement("code", null, "symbol:"),
" The symbol (ie $) representing the currency.",
React.createElement("br", null)),
React.createElement("p", null,
React.createElement("code", null, "country:"),
" The name of the currency's originating country or region.",
React.createElement("br", null)),
React.createElement("p", null,
React.createElement("code", null, "iso2:"),
" The 2-character iso code for the currency's originating country or region.",
React.createElement("br", null)))),
},
{
name: 'className',
type: 'string',
default: '',
description: 'Additional className to apply to the selector.',
},
{
name: 'isDisabled',
type: 'boolean',
default: 'false',
description: 'Boolean determining whether to disable the selector.',
},
{
name: 'disabledCurrencies',
type: 'string[]',
default: '[]',
description: 'A list of ISO 4217 3-letter currency codes to disable.',
},
{
name: 'isMulti',
type: 'boolean',
default: 'false',
description: 'Boolean determining whether to allow multiple currency selections.',
},
{
name: 'label',
type: 'string',
default: 'Currency',
description: 'Floating label for the Select input element.',
},
{
name: 'displayFullName',
type: 'boolean',
default: 'false',
description: 'Boolean determining whether to display full currency names or 3-character currency codes.',
},
{
name: 'isClearable',
type: 'boolean',
default: 'false',
description: 'Boolean determining whether the Select element is clearable.',
},
];
export default class CurrencySelectorDocs extends PureComponent {
render() {
return (React.createElement(ComponentDoc, { name: "Currency Selector", propInfos: propInfos },
React.createElement(CurrencySelectorDemo, null),
React.createElement(CodeExample, { code: CurrencySelectorCode })));
}
}
//# sourceMappingURL=index.js.map