@transferwise/components 0.0.0-experimental-e9426b6 → 0.0.0-experimental-ce46fbc
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/dateInput/DateInput.js +3 -6
- package/build/dateInput/DateInput.js.map +1 -1
- package/build/dateInput/DateInput.mjs +2 -5
- package/build/dateInput/DateInput.mjs.map +1 -1
- package/build/expressiveMoneyInput/currencySelector/CurrencySelector.js +3 -5
- package/build/expressiveMoneyInput/currencySelector/CurrencySelector.js.map +1 -1
- package/build/expressiveMoneyInput/currencySelector/CurrencySelector.mjs +1 -3
- package/build/expressiveMoneyInput/currencySelector/CurrencySelector.mjs.map +1 -1
- package/build/index.js +3 -5
- package/build/index.js.map +1 -1
- package/build/index.mjs +1 -3
- package/build/index.mjs.map +1 -1
- package/build/inputs/SelectInput.js +821 -0
- package/build/inputs/SelectInput.js.map +1 -0
- package/build/inputs/SelectInput.messages.js.map +1 -0
- package/build/inputs/SelectInput.messages.mjs.map +1 -0
- package/build/inputs/SelectInput.mjs +813 -0
- package/build/inputs/SelectInput.mjs.map +1 -0
- package/build/main.css +47 -47
- package/build/moneyInput/MoneyInput.js +2 -5
- package/build/moneyInput/MoneyInput.js.map +1 -1
- package/build/moneyInput/MoneyInput.mjs +1 -4
- package/build/moneyInput/MoneyInput.mjs.map +1 -1
- package/build/phoneNumberInput/PhoneNumberInput.js +2 -5
- package/build/phoneNumberInput/PhoneNumberInput.js.map +1 -1
- package/build/phoneNumberInput/PhoneNumberInput.mjs +1 -4
- package/build/phoneNumberInput/PhoneNumberInput.mjs.map +1 -1
- package/build/styles/main.css +47 -47
- package/build/types/inputs/{SelectInput/SelectInput.types.d.ts → SelectInput.d.ts} +7 -4
- package/build/types/inputs/SelectInput.d.ts.map +1 -0
- package/build/types/inputs/SelectInput.messages.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/inputs/{SelectInput/SelectInput.docs.mdx → SelectInput.docs.mdx} +1 -0
- package/src/inputs/SelectInput.less +219 -0
- package/src/inputs/{SelectInput/SelectInput.story.tsx → SelectInput.story.tsx} +7 -7
- package/src/inputs/SelectInput.tsx +1190 -0
- package/src/listItem/_stories/ListItem.story.tsx +76 -1
- package/src/main.css +47 -47
- package/src/main.less +1 -1
- package/build/inputs/SelectInput/SelectInput.helpers.js +0 -115
- package/build/inputs/SelectInput/SelectInput.helpers.js.map +0 -1
- package/build/inputs/SelectInput/SelectInput.helpers.mjs +0 -109
- package/build/inputs/SelectInput/SelectInput.helpers.mjs.map +0 -1
- package/build/inputs/SelectInput/SelectInput.js +0 -216
- package/build/inputs/SelectInput/SelectInput.js.map +0 -1
- package/build/inputs/SelectInput/SelectInput.messages.js.map +0 -1
- package/build/inputs/SelectInput/SelectInput.messages.mjs.map +0 -1
- package/build/inputs/SelectInput/SelectInput.mjs +0 -210
- package/build/inputs/SelectInput/SelectInput.mjs.map +0 -1
- package/build/inputs/SelectInput/components/SelectInputClearButton/SelectInputClearButton.js +0 -26
- package/build/inputs/SelectInput/components/SelectInputClearButton/SelectInputClearButton.js.map +0 -1
- package/build/inputs/SelectInput/components/SelectInputClearButton/SelectInputClearButton.mjs +0 -24
- package/build/inputs/SelectInput/components/SelectInputClearButton/SelectInputClearButton.mjs.map +0 -1
- package/build/inputs/SelectInput/components/SelectInputDefaultTrigger/SelectInputDefaultTrigger.js +0 -54
- package/build/inputs/SelectInput/components/SelectInputDefaultTrigger/SelectInputDefaultTrigger.js.map +0 -1
- package/build/inputs/SelectInput/components/SelectInputDefaultTrigger/SelectInputDefaultTrigger.mjs +0 -52
- package/build/inputs/SelectInput/components/SelectInputDefaultTrigger/SelectInputDefaultTrigger.mjs.map +0 -1
- package/build/inputs/SelectInput/components/SelectInputGroupItemView/SelectInputGroupItemView.js +0 -50
- package/build/inputs/SelectInput/components/SelectInputGroupItemView/SelectInputGroupItemView.js.map +0 -1
- package/build/inputs/SelectInput/components/SelectInputGroupItemView/SelectInputGroupItemView.mjs +0 -48
- package/build/inputs/SelectInput/components/SelectInputGroupItemView/SelectInputGroupItemView.mjs.map +0 -1
- package/build/inputs/SelectInput/components/SelectInputItemView/SelectInputItemView.js +0 -47
- package/build/inputs/SelectInput/components/SelectInputItemView/SelectInputItemView.js.map +0 -1
- package/build/inputs/SelectInput/components/SelectInputItemView/SelectInputItemView.mjs +0 -45
- package/build/inputs/SelectInput/components/SelectInputItemView/SelectInputItemView.mjs.map +0 -1
- package/build/inputs/SelectInput/components/SelectInputOption/SelectInputOption.js +0 -45
- package/build/inputs/SelectInput/components/SelectInputOption/SelectInputOption.js.map +0 -1
- package/build/inputs/SelectInput/components/SelectInputOption/SelectInputOption.mjs +0 -41
- package/build/inputs/SelectInput/components/SelectInputOption/SelectInputOption.mjs.map +0 -1
- package/build/inputs/SelectInput/components/SelectInputOptionContent/SelectInputOptionContent.js +0 -41
- package/build/inputs/SelectInput/components/SelectInputOptionContent/SelectInputOptionContent.js.map +0 -1
- package/build/inputs/SelectInput/components/SelectInputOptionContent/SelectInputOptionContent.mjs +0 -38
- package/build/inputs/SelectInput/components/SelectInputOptionContent/SelectInputOptionContent.mjs.map +0 -1
- package/build/inputs/SelectInput/components/SelectInputOptions/SelectInputOptions.js +0 -270
- package/build/inputs/SelectInput/components/SelectInputOptions/SelectInputOptions.js.map +0 -1
- package/build/inputs/SelectInput/components/SelectInputOptions/SelectInputOptions.mjs +0 -268
- package/build/inputs/SelectInput/components/SelectInputOptions/SelectInputOptions.mjs.map +0 -1
- package/build/inputs/SelectInput/components/SelectInputOptionsContainer/SelectInputOptionsContainer.js +0 -48
- package/build/inputs/SelectInput/components/SelectInputOptionsContainer/SelectInputOptionsContainer.js.map +0 -1
- package/build/inputs/SelectInput/components/SelectInputOptionsContainer/SelectInputOptionsContainer.mjs +0 -46
- package/build/inputs/SelectInput/components/SelectInputOptionsContainer/SelectInputOptionsContainer.mjs.map +0 -1
- package/build/inputs/SelectInput/components/SelectInputTriggerButton/SelectInputTriggerButton.js +0 -41
- package/build/inputs/SelectInput/components/SelectInputTriggerButton/SelectInputTriggerButton.js.map +0 -1
- package/build/inputs/SelectInput/components/SelectInputTriggerButton/SelectInputTriggerButton.mjs +0 -34
- package/build/inputs/SelectInput/components/SelectInputTriggerButton/SelectInputTriggerButton.mjs.map +0 -1
- package/build/styles/inputs/SelectInput/components/SelectInputDefaultTrigger/SelectInputDefaultTrigger.css +0 -17
- package/build/styles/inputs/SelectInput/components/SelectInputItemView/SelectInputItemView.css +0 -16
- package/build/styles/inputs/SelectInput/components/SelectInputOption/SelectInputOption.css +0 -33
- package/build/styles/inputs/SelectInput/components/SelectInputOptionContent/SelectInputOptionContent.css +0 -37
- package/build/types/inputs/SelectInput/SelectInput.d.ts +0 -3
- package/build/types/inputs/SelectInput/SelectInput.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/SelectInput.helpers.d.ts +0 -28
- package/build/types/inputs/SelectInput/SelectInput.helpers.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/SelectInput.messages.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/SelectInput.types.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/components/SelectInputClearButton/SelectInputClearButton.d.ts +0 -5
- package/build/types/inputs/SelectInput/components/SelectInputClearButton/SelectInputClearButton.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/components/SelectInputClearButton/index.d.ts +0 -2
- package/build/types/inputs/SelectInput/components/SelectInputClearButton/index.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/components/SelectInputDefaultTrigger/SelectInputDefaultTrigger.d.ts +0 -9
- package/build/types/inputs/SelectInput/components/SelectInputDefaultTrigger/SelectInputDefaultTrigger.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/components/SelectInputDefaultTrigger/index.d.ts +0 -2
- package/build/types/inputs/SelectInput/components/SelectInputDefaultTrigger/index.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/components/SelectInputGroupItemView/SelectInputGroupItemView.d.ts +0 -9
- package/build/types/inputs/SelectInput/components/SelectInputGroupItemView/SelectInputGroupItemView.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/components/SelectInputGroupItemView/index.d.ts +0 -2
- package/build/types/inputs/SelectInput/components/SelectInputGroupItemView/index.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/components/SelectInputItemView/SelectInputItemView.d.ts +0 -8
- package/build/types/inputs/SelectInput/components/SelectInputItemView/SelectInputItemView.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/components/SelectInputItemView/index.d.ts +0 -2
- package/build/types/inputs/SelectInput/components/SelectInputItemView/index.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/components/SelectInputOption/SelectInputOption.d.ts +0 -10
- package/build/types/inputs/SelectInput/components/SelectInputOption/SelectInputOption.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/components/SelectInputOption/index.d.ts +0 -2
- package/build/types/inputs/SelectInput/components/SelectInputOption/index.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/components/SelectInputOptionContent/SelectInputOptionContent.d.ts +0 -9
- package/build/types/inputs/SelectInput/components/SelectInputOptionContent/SelectInputOptionContent.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/components/SelectInputOptionContent/index.d.ts +0 -3
- package/build/types/inputs/SelectInput/components/SelectInputOptionContent/index.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/components/SelectInputOptions/SelectInputOptions.d.ts +0 -15
- package/build/types/inputs/SelectInput/components/SelectInputOptions/SelectInputOptions.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/components/SelectInputOptions/index.d.ts +0 -2
- package/build/types/inputs/SelectInput/components/SelectInputOptions/index.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/components/SelectInputOptionsContainer/SelectInputOptionsContainer.d.ts +0 -6
- package/build/types/inputs/SelectInput/components/SelectInputOptionsContainer/SelectInputOptionsContainer.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/components/SelectInputOptionsContainer/index.d.ts +0 -2
- package/build/types/inputs/SelectInput/components/SelectInputOptionsContainer/index.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/components/SelectInputTriggerButton/SelectInputTriggerButton.d.ts +0 -15
- package/build/types/inputs/SelectInput/components/SelectInputTriggerButton/SelectInputTriggerButton.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/components/SelectInputTriggerButton/index.d.ts +0 -3
- package/build/types/inputs/SelectInput/components/SelectInputTriggerButton/index.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/index.d.ts +0 -5
- package/build/types/inputs/SelectInput/index.d.ts.map +0 -1
- package/src/inputs/SelectInput/SelectInput.helpers.ts +0 -152
- package/src/inputs/SelectInput/SelectInput.less +0 -42
- package/src/inputs/SelectInput/SelectInput.test.tsx +0 -606
- package/src/inputs/SelectInput/SelectInput.tsx +0 -247
- package/src/inputs/SelectInput/SelectInput.types.ts +0 -114
- package/src/inputs/SelectInput/components/SelectInputClearButton/SelectInputClearButton.tsx +0 -25
- package/src/inputs/SelectInput/components/SelectInputClearButton/index.ts +0 -1
- package/src/inputs/SelectInput/components/SelectInputDefaultTrigger/SelectInputDefaultTrigger.css +0 -17
- package/src/inputs/SelectInput/components/SelectInputDefaultTrigger/SelectInputDefaultTrigger.less +0 -15
- package/src/inputs/SelectInput/components/SelectInputDefaultTrigger/SelectInputDefaultTrigger.tsx +0 -56
- package/src/inputs/SelectInput/components/SelectInputDefaultTrigger/index.ts +0 -1
- package/src/inputs/SelectInput/components/SelectInputGroupItemView/SelectInputGroupItemView.tsx +0 -64
- package/src/inputs/SelectInput/components/SelectInputGroupItemView/index.ts +0 -1
- package/src/inputs/SelectInput/components/SelectInputItemView/SelectInputItemView.css +0 -16
- package/src/inputs/SelectInput/components/SelectInputItemView/SelectInputItemView.less +0 -17
- package/src/inputs/SelectInput/components/SelectInputItemView/SelectInputItemView.tsx +0 -55
- package/src/inputs/SelectInput/components/SelectInputItemView/index.ts +0 -1
- package/src/inputs/SelectInput/components/SelectInputOption/SelectInputOption.css +0 -33
- package/src/inputs/SelectInput/components/SelectInputOption/SelectInputOption.less +0 -32
- package/src/inputs/SelectInput/components/SelectInputOption/SelectInputOption.tsx +0 -51
- package/src/inputs/SelectInput/components/SelectInputOption/index.ts +0 -5
- package/src/inputs/SelectInput/components/SelectInputOptionContent/SelectInputOptionContent.css +0 -37
- package/src/inputs/SelectInput/components/SelectInputOptionContent/SelectInputOptionContent.less +0 -38
- package/src/inputs/SelectInput/components/SelectInputOptionContent/SelectInputOptionContent.tsx +0 -67
- package/src/inputs/SelectInput/components/SelectInputOptionContent/index.ts +0 -5
- package/src/inputs/SelectInput/components/SelectInputOptions/SelectInputOptions.less +0 -75
- package/src/inputs/SelectInput/components/SelectInputOptions/SelectInputOptions.tsx +0 -369
- package/src/inputs/SelectInput/components/SelectInputOptions/index.ts +0 -1
- package/src/inputs/SelectInput/components/SelectInputOptionsContainer/SelectInputOptionsContainer.tsx +0 -56
- package/src/inputs/SelectInput/components/SelectInputOptionsContainer/index.ts +0 -1
- package/src/inputs/SelectInput/components/SelectInputTriggerButton/SelectInputTriggerButton.tsx +0 -39
- package/src/inputs/SelectInput/components/SelectInputTriggerButton/index.ts +0 -5
- package/src/inputs/SelectInput/index.ts +0 -13
- package/build/inputs/{SelectInput/SelectInput.messages.js → SelectInput.messages.js} +0 -0
- package/build/inputs/{SelectInput/SelectInput.messages.mjs → SelectInput.messages.mjs} +0 -0
- package/{src/inputs/SelectInput → build/styles/inputs}/SelectInput.css +47 -47
- package/build/types/inputs/{SelectInput/SelectInput.messages.d.ts → SelectInput.messages.d.ts} +0 -0
- package/{build/styles/inputs/SelectInput → src/inputs}/SelectInput.css +47 -47
- /package/src/inputs/{SelectInput/SelectInput.messages.ts → SelectInput.messages.ts} +0 -0
package/build/inputs/SelectInput/components/SelectInputDefaultTrigger/SelectInputDefaultTrigger.mjs
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { ChevronDown } from '@transferwise/icons';
|
|
2
|
-
import { clsx } from 'clsx';
|
|
3
|
-
import { ButtonInput } from '../../../_ButtonInput.mjs';
|
|
4
|
-
import { InputGroup } from '../../../InputGroup.mjs';
|
|
5
|
-
import { SelectInputClearButton } from '../SelectInputClearButton/SelectInputClearButton.mjs';
|
|
6
|
-
import { SelectInputTriggerButton } from '../SelectInputTriggerButton/SelectInputTriggerButton.mjs';
|
|
7
|
-
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
8
|
-
|
|
9
|
-
const SelectInputDefaultTrigger = ({
|
|
10
|
-
content,
|
|
11
|
-
placeholderShown,
|
|
12
|
-
clear,
|
|
13
|
-
disabled,
|
|
14
|
-
size,
|
|
15
|
-
className
|
|
16
|
-
}) => /*#__PURE__*/jsx(InputGroup, {
|
|
17
|
-
addonEnd: {
|
|
18
|
-
content: /*#__PURE__*/jsxs("span", {
|
|
19
|
-
className: clsx('np-select-input-addon-container', disabled && 'disabled'),
|
|
20
|
-
children: [clear != null && !placeholderShown ? /*#__PURE__*/jsxs(Fragment, {
|
|
21
|
-
children: [/*#__PURE__*/jsx(SelectInputClearButton, {
|
|
22
|
-
onClick: event => {
|
|
23
|
-
event.preventDefault();
|
|
24
|
-
clear();
|
|
25
|
-
}
|
|
26
|
-
}), /*#__PURE__*/jsx("span", {
|
|
27
|
-
className: "np-select-input-addon-separator"
|
|
28
|
-
})]
|
|
29
|
-
}) : null, /*#__PURE__*/jsx("span", {
|
|
30
|
-
className: "np-select-input-addon",
|
|
31
|
-
children: /*#__PURE__*/jsx(ChevronDown, {
|
|
32
|
-
size: 16
|
|
33
|
-
})
|
|
34
|
-
})]
|
|
35
|
-
}),
|
|
36
|
-
initialContentWidth: 24 + 4,
|
|
37
|
-
padding: 'sm'
|
|
38
|
-
},
|
|
39
|
-
disabled: disabled,
|
|
40
|
-
className: className,
|
|
41
|
-
children: /*#__PURE__*/jsx(SelectInputTriggerButton, {
|
|
42
|
-
as: ButtonInput,
|
|
43
|
-
size: size,
|
|
44
|
-
children: /*#__PURE__*/jsx("span", {
|
|
45
|
-
className: clsx('np-select-input-content', placeholderShown && 'np-select-input-placeholder'),
|
|
46
|
-
children: content
|
|
47
|
-
})
|
|
48
|
-
})
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
export { SelectInputDefaultTrigger };
|
|
52
|
-
//# sourceMappingURL=SelectInputDefaultTrigger.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SelectInputDefaultTrigger.mjs","sources":["../../../../../src/inputs/SelectInput/components/SelectInputDefaultTrigger/SelectInputDefaultTrigger.tsx"],"sourcesContent":["import { ChevronDown } from '@transferwise/icons';\nimport { clsx } from 'clsx';\n\nimport { ButtonInput } from '../../../_ButtonInput';\nimport { InputGroup } from '../../../InputGroup';\nimport { SelectInputClearButton } from '../SelectInputClearButton';\nimport { SelectInputTriggerButton } from '../SelectInputTriggerButton';\nimport type { SelectInputProps } from '../../SelectInput.types';\n\nexport const SelectInputDefaultTrigger = (({\n content,\n placeholderShown,\n clear,\n disabled,\n size,\n className,\n}) => (\n <InputGroup\n addonEnd={{\n content: (\n <span className={clsx('np-select-input-addon-container', disabled && 'disabled')}>\n {clear != null && !placeholderShown ? (\n <>\n <SelectInputClearButton\n onClick={(event) => {\n event.preventDefault();\n clear();\n }}\n />\n <span className=\"np-select-input-addon-separator\" />\n </>\n ) : null}\n\n <span className=\"np-select-input-addon\">\n <ChevronDown size={16} />\n </span>\n </span>\n ),\n initialContentWidth: 24 + 4,\n padding: 'sm',\n }}\n disabled={disabled}\n className={className}\n >\n <SelectInputTriggerButton as={ButtonInput} size={size}>\n <span\n className={clsx(\n 'np-select-input-content',\n placeholderShown && 'np-select-input-placeholder',\n )}\n >\n {content}\n </span>\n </SelectInputTriggerButton>\n </InputGroup>\n)) satisfies SelectInputProps['renderTrigger'];\n"],"names":["SelectInputDefaultTrigger","content","placeholderShown","clear","disabled","size","className","_jsx","InputGroup","addonEnd","_jsxs","clsx","children","_Fragment","SelectInputClearButton","onClick","event","preventDefault","ChevronDown","initialContentWidth","padding","SelectInputTriggerButton","as","ButtonInput"],"mappings":";;;;;;;;AASO,MAAMA,yBAAyB,GAAIA,CAAC;EACzCC,OAAO;EACPC,gBAAgB;EAChBC,KAAK;EACLC,QAAQ;EACRC,IAAI;AACJC,EAAAA;AAAS,CACV,kBACCC,GAAA,CAACC,UAAU,EAAA;AACTC,EAAAA,QAAQ,EAAE;AACRR,IAAAA,OAAO,eACLS,IAAA,CAAA,MAAA,EAAA;MAAMJ,SAAS,EAAEK,IAAI,CAAC,iCAAiC,EAAEP,QAAQ,IAAI,UAAU,CAAE;MAAAQ,QAAA,EAAA,CAC9ET,KAAK,IAAI,IAAI,IAAI,CAACD,gBAAgB,gBACjCQ,IAAA,CAAAG,QAAA,EAAA;QAAAD,QAAA,EAAA,cACEL,GAAA,CAACO,sBAAsB,EAAA;UACrBC,OAAO,EAAGC,KAAK,IAAI;YACjBA,KAAK,CAACC,cAAc,EAAE;AACtBd,YAAAA,KAAK,EAAE;AACT,UAAA;SAAE,CAEJ,eAAAI,GAAA,CAAA,MAAA,EAAA;AAAMD,UAAAA,SAAS,EAAC;AAAiC,SAAA,CACnD;AAAA,OAAA,CAAG,GACD,IAAI,eAERC,GAAA,CAAA,MAAA,EAAA;AAAMD,QAAAA,SAAS,EAAC,uBAAuB;QAAAM,QAAA,eACrCL,GAAA,CAACW,WAAW,EAAA;AAACb,UAAAA,IAAI,EAAE;SAAG;AACxB,OAAM,CACR;AAAA,KAAM,CACP;IACDc,mBAAmB,EAAE,EAAE,GAAG,CAAC;AAC3BC,IAAAA,OAAO,EAAE;GACT;AACFhB,EAAAA,QAAQ,EAAEA,QAAS;AACnBE,EAAAA,SAAS,EAAEA,SAAU;EAAAM,QAAA,eAErBL,GAAA,CAACc,wBAAwB,EAAA;AAACC,IAAAA,EAAE,EAAEC,WAAY;AAAClB,IAAAA,IAAI,EAAEA,IAAK;AAAAO,IAAAA,QAAA,eACpDL,GAAA,CAAA,MAAA,EAAA;MACED,SAAS,EAAEK,IAAI,CACb,yBAAyB,EACzBT,gBAAgB,IAAI,6BAA6B,CACjD;AAAAU,MAAAA,QAAA,EAEDX;KACG;GACkB;AAC5B,CAAY;;;;"}
|
package/build/inputs/SelectInput/components/SelectInputGroupItemView/SelectInputGroupItemView.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var clsx = require('clsx');
|
|
4
|
-
var React = require('react');
|
|
5
|
-
var Header = require('../../../../header/Header.js');
|
|
6
|
-
var Section = require('../../../../section/Section.js');
|
|
7
|
-
var SelectInputItemView = require('../SelectInputItemView/SelectInputItemView.js');
|
|
8
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
9
|
-
|
|
10
|
-
function SelectInputGroupItemView({
|
|
11
|
-
item,
|
|
12
|
-
renderValue,
|
|
13
|
-
needle
|
|
14
|
-
}) {
|
|
15
|
-
const headerId = React.useId();
|
|
16
|
-
const header = /*#__PURE__*/jsxRuntime.jsx(Header.default, {
|
|
17
|
-
as: "header",
|
|
18
|
-
role: "none",
|
|
19
|
-
id: headerId,
|
|
20
|
-
title: item.label
|
|
21
|
-
// @ts-expect-error when we migrate ActionButton to new Button this should be sorted
|
|
22
|
-
,
|
|
23
|
-
action: item.action && {
|
|
24
|
-
text: item.action.label,
|
|
25
|
-
onClick: item.action.onClick
|
|
26
|
-
},
|
|
27
|
-
className: "np-select-input-group-item-header p-x-1"
|
|
28
|
-
});
|
|
29
|
-
return (
|
|
30
|
-
/*#__PURE__*/
|
|
31
|
-
// An empty container may be rendered when no options match `needle`
|
|
32
|
-
// However, pre-filtering would result in worse performance overall
|
|
33
|
-
jsxRuntime.jsxs(Section.default, {
|
|
34
|
-
as: "section",
|
|
35
|
-
role: "group",
|
|
36
|
-
"aria-labelledby": headerId,
|
|
37
|
-
className: clsx.clsx('m-y-0', needle === null && 'np-select-input-group-item--without-needle'),
|
|
38
|
-
children: [needle == null ? header : null, item.options.map((option, index) => /*#__PURE__*/jsxRuntime.jsx(SelectInputItemView.SelectInputItemView
|
|
39
|
-
// eslint-disable-next-line react/no-array-index-key
|
|
40
|
-
, {
|
|
41
|
-
item: option,
|
|
42
|
-
renderValue: renderValue,
|
|
43
|
-
needle: needle
|
|
44
|
-
}, index))]
|
|
45
|
-
})
|
|
46
|
-
);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
exports.SelectInputGroupItemView = SelectInputGroupItemView;
|
|
50
|
-
//# sourceMappingURL=SelectInputGroupItemView.js.map
|
package/build/inputs/SelectInput/components/SelectInputGroupItemView/SelectInputGroupItemView.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SelectInputGroupItemView.js","sources":["../../../../../src/inputs/SelectInput/components/SelectInputGroupItemView/SelectInputGroupItemView.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useId } from 'react';\n\nimport Header from '../../../../header';\nimport Section from '../../../../section';\nimport type {\n SelectInputGroupItem,\n SelectInputProps,\n} from '../../SelectInput.types';\n\nimport { SelectInputItemView } from '../SelectInputItemView';\n\ninterface SelectInputGroupItemViewProps<T = string> {\n item: SelectInputGroupItem<T | undefined>;\n renderValue: Required<Pick<SelectInputProps<T>, 'renderValue'>>['renderValue'];\n needle: string | null | undefined;\n}\n\nexport function SelectInputGroupItemView<T = string>({\n item,\n renderValue,\n needle,\n}: SelectInputGroupItemViewProps<T>) {\n const headerId = useId();\n\n const header = (\n <Header\n as=\"header\"\n role=\"none\"\n id={headerId}\n title={item.label}\n // @ts-expect-error when we migrate ActionButton to new Button this should be sorted\n action={\n item.action && {\n text: item.action.label,\n onClick: item.action.onClick,\n }\n }\n className=\"np-select-input-group-item-header p-x-1\"\n />\n );\n\n return (\n // An empty container may be rendered when no options match `needle`\n // However, pre-filtering would result in worse performance overall\n <Section\n as=\"section\"\n role=\"group\"\n aria-labelledby={headerId}\n className={clsx('m-y-0', needle === null && 'np-select-input-group-item--without-needle')}\n >\n {needle == null ? header : null}\n {item.options.map((option, index) => (\n <SelectInputItemView\n // eslint-disable-next-line react/no-array-index-key\n key={index}\n item={option}\n renderValue={renderValue}\n needle={needle}\n />\n ))}\n </Section>\n );\n}\n"],"names":["SelectInputGroupItemView","item","renderValue","needle","headerId","useId","header","_jsx","Header","as","role","id","title","label","action","text","onClick","className","_jsxs","Section","clsx","children","options","map","option","index","SelectInputItemView"],"mappings":";;;;;;;;;AAkBM,SAAUA,wBAAwBA,CAAa;EACnDC,IAAI;EACJC,WAAW;AACXC,EAAAA;AAAM,CAC2B,EAAA;AACjC,EAAA,MAAMC,QAAQ,GAAGC,WAAK,EAAE;AAExB,EAAA,MAAMC,MAAM,gBACVC,cAAA,CAACC,cAAM,EAAA;AACLC,IAAAA,EAAE,EAAC,QAAQ;AACXC,IAAAA,IAAI,EAAC,MAAM;AACXC,IAAAA,EAAE,EAAEP,QAAS;IACbQ,KAAK,EAAEX,IAAI,CAACY;AACZ;AAAA;AACAC,IAAAA,MAAM,EACJb,IAAI,CAACa,MAAM,IAAI;AACbC,MAAAA,IAAI,EAAEd,IAAI,CAACa,MAAM,CAACD,KAAK;AACvBG,MAAAA,OAAO,EAAEf,IAAI,CAACa,MAAM,CAACE;KAExB;AACDC,IAAAA,SAAS,EAAC;AAAyC,GAAA,CAEtD;AAED,EAAA;AAAA;AACE;AACA;AACAC,IAAAA,eAAA,CAACC,eAAO,EAAA;AACNV,MAAAA,EAAE,EAAC,SAAS;AACZC,MAAAA,IAAI,EAAC,OAAO;AACZ,MAAA,iBAAA,EAAiBN,QAAS;MAC1Ba,SAAS,EAAEG,SAAI,CAAC,OAAO,EAAEjB,MAAM,KAAK,IAAI,IAAI,4CAA4C,CAAE;MAAAkB,QAAA,EAAA,CAEzFlB,MAAM,IAAI,IAAI,GAAGG,MAAM,GAAG,IAAI,EAC9BL,IAAI,CAACqB,OAAO,CAACC,GAAG,CAAC,CAACC,MAAM,EAAEC,KAAK,kBAC9BlB,cAAA,CAACmB;AACC;AAAA,QAAA;AAEAzB,QAAAA,IAAI,EAAEuB,MAAO;AACbtB,QAAAA,WAAW,EAAEA,WAAY;AACzBC,QAAAA,MAAM,EAAEA;OAAO,EAHVsB,KAGU,CAElB,CAAC;KACK;AAAC;AAEd;;;;"}
|
package/build/inputs/SelectInput/components/SelectInputGroupItemView/SelectInputGroupItemView.mjs
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { clsx } from 'clsx';
|
|
2
|
-
import { useId } from 'react';
|
|
3
|
-
import Header from '../../../../header/Header.mjs';
|
|
4
|
-
import Section from '../../../../section/Section.mjs';
|
|
5
|
-
import { SelectInputItemView } from '../SelectInputItemView/SelectInputItemView.mjs';
|
|
6
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
7
|
-
|
|
8
|
-
function SelectInputGroupItemView({
|
|
9
|
-
item,
|
|
10
|
-
renderValue,
|
|
11
|
-
needle
|
|
12
|
-
}) {
|
|
13
|
-
const headerId = useId();
|
|
14
|
-
const header = /*#__PURE__*/jsx(Header, {
|
|
15
|
-
as: "header",
|
|
16
|
-
role: "none",
|
|
17
|
-
id: headerId,
|
|
18
|
-
title: item.label
|
|
19
|
-
// @ts-expect-error when we migrate ActionButton to new Button this should be sorted
|
|
20
|
-
,
|
|
21
|
-
action: item.action && {
|
|
22
|
-
text: item.action.label,
|
|
23
|
-
onClick: item.action.onClick
|
|
24
|
-
},
|
|
25
|
-
className: "np-select-input-group-item-header p-x-1"
|
|
26
|
-
});
|
|
27
|
-
return (
|
|
28
|
-
/*#__PURE__*/
|
|
29
|
-
// An empty container may be rendered when no options match `needle`
|
|
30
|
-
// However, pre-filtering would result in worse performance overall
|
|
31
|
-
jsxs(Section, {
|
|
32
|
-
as: "section",
|
|
33
|
-
role: "group",
|
|
34
|
-
"aria-labelledby": headerId,
|
|
35
|
-
className: clsx('m-y-0', needle === null && 'np-select-input-group-item--without-needle'),
|
|
36
|
-
children: [needle == null ? header : null, item.options.map((option, index) => /*#__PURE__*/jsx(SelectInputItemView
|
|
37
|
-
// eslint-disable-next-line react/no-array-index-key
|
|
38
|
-
, {
|
|
39
|
-
item: option,
|
|
40
|
-
renderValue: renderValue,
|
|
41
|
-
needle: needle
|
|
42
|
-
}, index))]
|
|
43
|
-
})
|
|
44
|
-
);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export { SelectInputGroupItemView };
|
|
48
|
-
//# sourceMappingURL=SelectInputGroupItemView.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SelectInputGroupItemView.mjs","sources":["../../../../../src/inputs/SelectInput/components/SelectInputGroupItemView/SelectInputGroupItemView.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useId } from 'react';\n\nimport Header from '../../../../header';\nimport Section from '../../../../section';\nimport type {\n SelectInputGroupItem,\n SelectInputProps,\n} from '../../SelectInput.types';\n\nimport { SelectInputItemView } from '../SelectInputItemView';\n\ninterface SelectInputGroupItemViewProps<T = string> {\n item: SelectInputGroupItem<T | undefined>;\n renderValue: Required<Pick<SelectInputProps<T>, 'renderValue'>>['renderValue'];\n needle: string | null | undefined;\n}\n\nexport function SelectInputGroupItemView<T = string>({\n item,\n renderValue,\n needle,\n}: SelectInputGroupItemViewProps<T>) {\n const headerId = useId();\n\n const header = (\n <Header\n as=\"header\"\n role=\"none\"\n id={headerId}\n title={item.label}\n // @ts-expect-error when we migrate ActionButton to new Button this should be sorted\n action={\n item.action && {\n text: item.action.label,\n onClick: item.action.onClick,\n }\n }\n className=\"np-select-input-group-item-header p-x-1\"\n />\n );\n\n return (\n // An empty container may be rendered when no options match `needle`\n // However, pre-filtering would result in worse performance overall\n <Section\n as=\"section\"\n role=\"group\"\n aria-labelledby={headerId}\n className={clsx('m-y-0', needle === null && 'np-select-input-group-item--without-needle')}\n >\n {needle == null ? header : null}\n {item.options.map((option, index) => (\n <SelectInputItemView\n // eslint-disable-next-line react/no-array-index-key\n key={index}\n item={option}\n renderValue={renderValue}\n needle={needle}\n />\n ))}\n </Section>\n );\n}\n"],"names":["SelectInputGroupItemView","item","renderValue","needle","headerId","useId","header","_jsx","Header","as","role","id","title","label","action","text","onClick","className","_jsxs","Section","clsx","children","options","map","option","index","SelectInputItemView"],"mappings":";;;;;;;AAkBM,SAAUA,wBAAwBA,CAAa;EACnDC,IAAI;EACJC,WAAW;AACXC,EAAAA;AAAM,CAC2B,EAAA;AACjC,EAAA,MAAMC,QAAQ,GAAGC,KAAK,EAAE;AAExB,EAAA,MAAMC,MAAM,gBACVC,GAAA,CAACC,MAAM,EAAA;AACLC,IAAAA,EAAE,EAAC,QAAQ;AACXC,IAAAA,IAAI,EAAC,MAAM;AACXC,IAAAA,EAAE,EAAEP,QAAS;IACbQ,KAAK,EAAEX,IAAI,CAACY;AACZ;AAAA;AACAC,IAAAA,MAAM,EACJb,IAAI,CAACa,MAAM,IAAI;AACbC,MAAAA,IAAI,EAAEd,IAAI,CAACa,MAAM,CAACD,KAAK;AACvBG,MAAAA,OAAO,EAAEf,IAAI,CAACa,MAAM,CAACE;KAExB;AACDC,IAAAA,SAAS,EAAC;AAAyC,GAAA,CAEtD;AAED,EAAA;AAAA;AACE;AACA;AACAC,IAAAA,IAAA,CAACC,OAAO,EAAA;AACNV,MAAAA,EAAE,EAAC,SAAS;AACZC,MAAAA,IAAI,EAAC,OAAO;AACZ,MAAA,iBAAA,EAAiBN,QAAS;MAC1Ba,SAAS,EAAEG,IAAI,CAAC,OAAO,EAAEjB,MAAM,KAAK,IAAI,IAAI,4CAA4C,CAAE;MAAAkB,QAAA,EAAA,CAEzFlB,MAAM,IAAI,IAAI,GAAGG,MAAM,GAAG,IAAI,EAC9BL,IAAI,CAACqB,OAAO,CAACC,GAAG,CAAC,CAACC,MAAM,EAAEC,KAAK,kBAC9BlB,GAAA,CAACmB;AACC;AAAA,QAAA;AAEAzB,QAAAA,IAAI,EAAEuB,MAAO;AACbtB,QAAAA,WAAW,EAAEA,WAAY;AACzBC,QAAAA,MAAM,EAAEA;OAAO,EAHVsB,KAGU,CAElB,CAAC;KACK;AAAC;AAEd;;;;"}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var SelectInput_helpers = require('../../SelectInput.helpers.js');
|
|
4
|
-
var SelectInputOption = require('../SelectInputOption/SelectInputOption.js');
|
|
5
|
-
var SelectInputGroupItemView = require('../SelectInputGroupItemView/SelectInputGroupItemView.js');
|
|
6
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
7
|
-
|
|
8
|
-
function SelectInputItemView({
|
|
9
|
-
item,
|
|
10
|
-
renderValue,
|
|
11
|
-
needle
|
|
12
|
-
}) {
|
|
13
|
-
switch (item.type) {
|
|
14
|
-
case 'option':
|
|
15
|
-
{
|
|
16
|
-
if (item.value != null && (needle == null || SelectInput_helpers.selectInputOptionItemIncludesNeedle(item, needle))) {
|
|
17
|
-
return /*#__PURE__*/jsxRuntime.jsx(SelectInputOption.SelectInputOption, {
|
|
18
|
-
value: item.value,
|
|
19
|
-
disabled: item.disabled,
|
|
20
|
-
children: renderValue(item.value, false)
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
break;
|
|
24
|
-
}
|
|
25
|
-
case 'group':
|
|
26
|
-
{
|
|
27
|
-
return /*#__PURE__*/jsxRuntime.jsx(SelectInputGroupItemView.SelectInputGroupItemView, {
|
|
28
|
-
item: item,
|
|
29
|
-
renderValue: renderValue,
|
|
30
|
-
needle: needle
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
case 'separator':
|
|
34
|
-
{
|
|
35
|
-
if (needle == null) {
|
|
36
|
-
return /*#__PURE__*/jsxRuntime.jsx("hr", {
|
|
37
|
-
className: "np-select-input-separator-item"
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
break;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
return null;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
exports.SelectInputItemView = SelectInputItemView;
|
|
47
|
-
//# sourceMappingURL=SelectInputItemView.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SelectInputItemView.js","sources":["../../../../../src/inputs/SelectInput/components/SelectInputItemView/SelectInputItemView.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useId } from 'react';\n\nimport Header from '../../../../header';\nimport Section from '../../../../section';\nimport { selectInputOptionItemIncludesNeedle } from '../../SelectInput.helpers';\nimport type {\n SelectInputGroupItem,\n SelectInputProps,\n SelectInputItem,\n} from '../../SelectInput.types';\nimport { SelectInputOption } from '../SelectInputOption';\n\nimport { SelectInputGroupItemView } from '../SelectInputGroupItemView';\n\ninterface SelectInputItemViewProps<\n T = string,\n I extends SelectInputItem<T | undefined> = SelectInputItem<T | undefined>,\n> extends Required<Pick<SelectInputProps<T>, 'renderValue'>> {\n item: I;\n needle: string | null | undefined;\n}\n\nexport function SelectInputItemView<T = string>({\n item,\n renderValue,\n needle,\n}: SelectInputItemViewProps<T>) {\n switch (item.type) {\n case 'option': {\n if (\n item.value != null &&\n (needle == null || selectInputOptionItemIncludesNeedle(item, needle))\n ) {\n return (\n <SelectInputOption value={item.value} disabled={item.disabled}>\n {renderValue(item.value, false)}\n </SelectInputOption>\n );\n }\n break;\n }\n case 'group': {\n return <SelectInputGroupItemView item={item} renderValue={renderValue} needle={needle} />;\n }\n case 'separator': {\n if (needle == null) {\n return <hr className=\"np-select-input-separator-item\" />;\n }\n break;\n }\n }\n return null;\n}\n\n"],"names":["SelectInputItemView","item","renderValue","needle","type","value","selectInputOptionItemIncludesNeedle","_jsx","SelectInputOption","disabled","children","SelectInputGroupItemView","className"],"mappings":";;;;;;;AAuBM,SAAUA,mBAAmBA,CAAa;EAC9CC,IAAI;EACJC,WAAW;AACXC,EAAAA;AAAM,CACsB,EAAA;EAC5B,QAAQF,IAAI,CAACG,IAAI;AACf,IAAA,KAAK,QAAQ;AAAE,MAAA;AACb,QAAA,IACEH,IAAI,CAACI,KAAK,IAAI,IAAI,KACjBF,MAAM,IAAI,IAAI,IAAIG,uDAAmC,CAACL,IAAI,EAAEE,MAAM,CAAC,CAAC,EACrE;UACA,oBACEI,cAAA,CAACC,mCAAiB,EAAA;YAACH,KAAK,EAAEJ,IAAI,CAACI,KAAM;YAACI,QAAQ,EAAER,IAAI,CAACQ,QAAS;AAAAC,YAAAA,QAAA,EAC3DR,WAAW,CAACD,IAAI,CAACI,KAAK,EAAE,KAAK;AAAC,WACd,CAAC;AAExB,QAAA;AACA,QAAA;AACF,MAAA;AACA,IAAA,KAAK,OAAO;AAAE,MAAA;QACZ,oBAAOE,cAAA,CAACI,iDAAwB,EAAA;AAACV,UAAAA,IAAI,EAAEA,IAAK;AAACC,UAAAA,WAAW,EAAEA,WAAY;AAACC,UAAAA,MAAM,EAAEA;AAAO,SAAA,CAAG;AAC3F,MAAA;AACA,IAAA,KAAK,WAAW;AAAE,MAAA;QAChB,IAAIA,MAAM,IAAI,IAAI,EAAE;AAClB,UAAA,oBAAOI,cAAA,CAAA,IAAA,EAAA;AAAIK,YAAAA,SAAS,EAAC;AAAgC,YAAG;AAC1D,QAAA;AACA,QAAA;AACF,MAAA;AACF;AACA,EAAA,OAAO,IAAI;AACb;;;;"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { selectInputOptionItemIncludesNeedle } from '../../SelectInput.helpers.mjs';
|
|
2
|
-
import { SelectInputOption } from '../SelectInputOption/SelectInputOption.mjs';
|
|
3
|
-
import { SelectInputGroupItemView } from '../SelectInputGroupItemView/SelectInputGroupItemView.mjs';
|
|
4
|
-
import { jsx } from 'react/jsx-runtime';
|
|
5
|
-
|
|
6
|
-
function SelectInputItemView({
|
|
7
|
-
item,
|
|
8
|
-
renderValue,
|
|
9
|
-
needle
|
|
10
|
-
}) {
|
|
11
|
-
switch (item.type) {
|
|
12
|
-
case 'option':
|
|
13
|
-
{
|
|
14
|
-
if (item.value != null && (needle == null || selectInputOptionItemIncludesNeedle(item, needle))) {
|
|
15
|
-
return /*#__PURE__*/jsx(SelectInputOption, {
|
|
16
|
-
value: item.value,
|
|
17
|
-
disabled: item.disabled,
|
|
18
|
-
children: renderValue(item.value, false)
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
break;
|
|
22
|
-
}
|
|
23
|
-
case 'group':
|
|
24
|
-
{
|
|
25
|
-
return /*#__PURE__*/jsx(SelectInputGroupItemView, {
|
|
26
|
-
item: item,
|
|
27
|
-
renderValue: renderValue,
|
|
28
|
-
needle: needle
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
case 'separator':
|
|
32
|
-
{
|
|
33
|
-
if (needle == null) {
|
|
34
|
-
return /*#__PURE__*/jsx("hr", {
|
|
35
|
-
className: "np-select-input-separator-item"
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
break;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
return null;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export { SelectInputItemView };
|
|
45
|
-
//# sourceMappingURL=SelectInputItemView.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SelectInputItemView.mjs","sources":["../../../../../src/inputs/SelectInput/components/SelectInputItemView/SelectInputItemView.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useId } from 'react';\n\nimport Header from '../../../../header';\nimport Section from '../../../../section';\nimport { selectInputOptionItemIncludesNeedle } from '../../SelectInput.helpers';\nimport type {\n SelectInputGroupItem,\n SelectInputProps,\n SelectInputItem,\n} from '../../SelectInput.types';\nimport { SelectInputOption } from '../SelectInputOption';\n\nimport { SelectInputGroupItemView } from '../SelectInputGroupItemView';\n\ninterface SelectInputItemViewProps<\n T = string,\n I extends SelectInputItem<T | undefined> = SelectInputItem<T | undefined>,\n> extends Required<Pick<SelectInputProps<T>, 'renderValue'>> {\n item: I;\n needle: string | null | undefined;\n}\n\nexport function SelectInputItemView<T = string>({\n item,\n renderValue,\n needle,\n}: SelectInputItemViewProps<T>) {\n switch (item.type) {\n case 'option': {\n if (\n item.value != null &&\n (needle == null || selectInputOptionItemIncludesNeedle(item, needle))\n ) {\n return (\n <SelectInputOption value={item.value} disabled={item.disabled}>\n {renderValue(item.value, false)}\n </SelectInputOption>\n );\n }\n break;\n }\n case 'group': {\n return <SelectInputGroupItemView item={item} renderValue={renderValue} needle={needle} />;\n }\n case 'separator': {\n if (needle == null) {\n return <hr className=\"np-select-input-separator-item\" />;\n }\n break;\n }\n }\n return null;\n}\n\n"],"names":["SelectInputItemView","item","renderValue","needle","type","value","selectInputOptionItemIncludesNeedle","_jsx","SelectInputOption","disabled","children","SelectInputGroupItemView","className"],"mappings":";;;;;AAuBM,SAAUA,mBAAmBA,CAAa;EAC9CC,IAAI;EACJC,WAAW;AACXC,EAAAA;AAAM,CACsB,EAAA;EAC5B,QAAQF,IAAI,CAACG,IAAI;AACf,IAAA,KAAK,QAAQ;AAAE,MAAA;AACb,QAAA,IACEH,IAAI,CAACI,KAAK,IAAI,IAAI,KACjBF,MAAM,IAAI,IAAI,IAAIG,mCAAmC,CAACL,IAAI,EAAEE,MAAM,CAAC,CAAC,EACrE;UACA,oBACEI,GAAA,CAACC,iBAAiB,EAAA;YAACH,KAAK,EAAEJ,IAAI,CAACI,KAAM;YAACI,QAAQ,EAAER,IAAI,CAACQ,QAAS;AAAAC,YAAAA,QAAA,EAC3DR,WAAW,CAACD,IAAI,CAACI,KAAK,EAAE,KAAK;AAAC,WACd,CAAC;AAExB,QAAA;AACA,QAAA;AACF,MAAA;AACA,IAAA,KAAK,OAAO;AAAE,MAAA;QACZ,oBAAOE,GAAA,CAACI,wBAAwB,EAAA;AAACV,UAAAA,IAAI,EAAEA,IAAK;AAACC,UAAAA,WAAW,EAAEA,WAAY;AAACC,UAAAA,MAAM,EAAEA;AAAO,SAAA,CAAG;AAC3F,MAAA;AACA,IAAA,KAAK,WAAW;AAAE,MAAA;QAChB,IAAIA,MAAM,IAAI,IAAI,EAAE;AAClB,UAAA,oBAAOI,GAAA,CAAA,IAAA,EAAA;AAAIK,YAAAA,SAAS,EAAC;AAAgC,YAAG;AAC1D,QAAA;AACA,QAAA;AACF,MAAA;AACF;AACA,EAAA,OAAO,IAAI;AACb;;;;"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var react = require('@headlessui/react');
|
|
4
|
-
var icons = require('@transferwise/icons');
|
|
5
|
-
var clsx = require('clsx');
|
|
6
|
-
var React = require('react');
|
|
7
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
8
|
-
|
|
9
|
-
const SelectInputItemsCountContext = /*#__PURE__*/React.createContext(undefined);
|
|
10
|
-
const SelectInputItemPositionContext = /*#__PURE__*/React.createContext(undefined);
|
|
11
|
-
function SelectInputOption({
|
|
12
|
-
value,
|
|
13
|
-
disabled,
|
|
14
|
-
children
|
|
15
|
-
}) {
|
|
16
|
-
const itemsCount = React.useContext(SelectInputItemsCountContext);
|
|
17
|
-
const itemPosition = React.useContext(SelectInputItemPositionContext);
|
|
18
|
-
return /*#__PURE__*/jsxRuntime.jsx(react.ListboxOption, {
|
|
19
|
-
as: "div",
|
|
20
|
-
value: value,
|
|
21
|
-
"aria-setsize": itemsCount,
|
|
22
|
-
"aria-posinset": itemPosition,
|
|
23
|
-
disabled: disabled,
|
|
24
|
-
className: ({
|
|
25
|
-
active,
|
|
26
|
-
disabled: uiDisabled
|
|
27
|
-
}) => clsx.clsx('np-select-input-option-container np-text-body-large', active && 'np-select-input-option-container--active', uiDisabled && 'np-select-input-option-container--disabled'),
|
|
28
|
-
children: ({
|
|
29
|
-
selected
|
|
30
|
-
}) => /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
31
|
-
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
32
|
-
className: "np-select-input-option",
|
|
33
|
-
children: children
|
|
34
|
-
}), /*#__PURE__*/jsxRuntime.jsx(icons.Check, {
|
|
35
|
-
size: 16,
|
|
36
|
-
className: clsx.clsx('np-select-input-option-check', !selected && 'np-select-input-option-check--not-selected')
|
|
37
|
-
})]
|
|
38
|
-
})
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
exports.SelectInputItemPositionContext = SelectInputItemPositionContext;
|
|
43
|
-
exports.SelectInputItemsCountContext = SelectInputItemsCountContext;
|
|
44
|
-
exports.SelectInputOption = SelectInputOption;
|
|
45
|
-
//# sourceMappingURL=SelectInputOption.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SelectInputOption.js","sources":["../../../../../src/inputs/SelectInput/components/SelectInputOption/SelectInputOption.tsx"],"sourcesContent":["import { ListboxOption } from '@headlessui/react';\nimport { Check } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport { useContext, createContext } from 'react';\n\nexport const SelectInputItemsCountContext = createContext<number | undefined>(undefined);\nexport const SelectInputItemPositionContext = createContext<number | undefined>(undefined);\n\ninterface SelectInputOptionProps<T = string> {\n value: T;\n disabled?: boolean;\n children?: React.ReactNode;\n}\n\nexport function SelectInputOption<T = string>({\n value,\n disabled,\n children,\n}: SelectInputOptionProps<T>) {\n const itemsCount = useContext(SelectInputItemsCountContext);\n const itemPosition = useContext(SelectInputItemPositionContext);\n return (\n <ListboxOption\n as=\"div\"\n value={value}\n aria-setsize={itemsCount}\n aria-posinset={itemPosition}\n disabled={disabled}\n className={({ active, disabled: uiDisabled }) =>\n clsx(\n 'np-select-input-option-container np-text-body-large',\n active && 'np-select-input-option-container--active',\n uiDisabled && 'np-select-input-option-container--disabled',\n )\n }\n >\n {({ selected }) => (\n <>\n <div className=\"np-select-input-option\">{children}</div>\n <Check\n size={16}\n className={clsx(\n 'np-select-input-option-check',\n !selected && 'np-select-input-option-check--not-selected',\n )}\n />\n </>\n )}\n </ListboxOption>\n );\n}\n"],"names":["SelectInputItemsCountContext","createContext","undefined","SelectInputItemPositionContext","SelectInputOption","value","disabled","children","itemsCount","useContext","itemPosition","_jsx","ListboxOption","as","className","active","uiDisabled","clsx","selected","_jsxs","_Fragment","Check","size"],"mappings":";;;;;;;;MAKaA,4BAA4B,gBAAGC,mBAAa,CAAqBC,SAAS;MAC1EC,8BAA8B,gBAAGF,mBAAa,CAAqBC,SAAS;AAQnF,SAAUE,iBAAiBA,CAAa;EAC5CC,KAAK;EACLC,QAAQ;AACRC,EAAAA;AAAQ,CACkB,EAAA;AAC1B,EAAA,MAAMC,UAAU,GAAGC,gBAAU,CAACT,4BAA4B,CAAC;AAC3D,EAAA,MAAMU,YAAY,GAAGD,gBAAU,CAACN,8BAA8B,CAAC;EAC/D,oBACEQ,cAAA,CAACC,mBAAa,EAAA;AACZC,IAAAA,EAAE,EAAC,KAAK;AACRR,IAAAA,KAAK,EAAEA,KAAM;AACb,IAAA,cAAA,EAAcG,UAAW;AACzB,IAAA,eAAA,EAAeE,YAAa;AAC5BJ,IAAAA,QAAQ,EAAEA,QAAS;AACnBQ,IAAAA,SAAS,EAAEA,CAAC;MAAEC,MAAM;AAAET,MAAAA,QAAQ,EAAEU;AAAU,KAAE,KAC1CC,SAAI,CACF,qDAAqD,EACrDF,MAAM,IAAI,0CAA0C,EACpDC,UAAU,IAAI,4CAA4C,CAE7D;AAAAT,IAAAA,QAAA,EAEAA,CAAC;AAAEW,MAAAA;KAAU,kBACZC,eAAA,CAAAC,mBAAA,EAAA;AAAAb,MAAAA,QAAA,gBACEI,cAAA,CAAA,KAAA,EAAA;AAAKG,QAAAA,SAAS,EAAC,wBAAwB;AAAAP,QAAAA,QAAA,EAAEA;AAAQ,OAAM,CACvD,eAAAI,cAAA,CAACU,WAAK,EAAA;AACJC,QAAAA,IAAI,EAAE,EAAG;QACTR,SAAS,EAAEG,SAAI,CACb,8BAA8B,EAC9B,CAACC,QAAQ,IAAI,4CAA4C;AACzD,OAAA,CAEN;KAAA;AACD,GACY,CAAC;AAEpB;;;;;;"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { ListboxOption } from '@headlessui/react';
|
|
2
|
-
import { Check } from '@transferwise/icons';
|
|
3
|
-
import { clsx } from 'clsx';
|
|
4
|
-
import { createContext, useContext } from 'react';
|
|
5
|
-
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
6
|
-
|
|
7
|
-
const SelectInputItemsCountContext = /*#__PURE__*/createContext(undefined);
|
|
8
|
-
const SelectInputItemPositionContext = /*#__PURE__*/createContext(undefined);
|
|
9
|
-
function SelectInputOption({
|
|
10
|
-
value,
|
|
11
|
-
disabled,
|
|
12
|
-
children
|
|
13
|
-
}) {
|
|
14
|
-
const itemsCount = useContext(SelectInputItemsCountContext);
|
|
15
|
-
const itemPosition = useContext(SelectInputItemPositionContext);
|
|
16
|
-
return /*#__PURE__*/jsx(ListboxOption, {
|
|
17
|
-
as: "div",
|
|
18
|
-
value: value,
|
|
19
|
-
"aria-setsize": itemsCount,
|
|
20
|
-
"aria-posinset": itemPosition,
|
|
21
|
-
disabled: disabled,
|
|
22
|
-
className: ({
|
|
23
|
-
active,
|
|
24
|
-
disabled: uiDisabled
|
|
25
|
-
}) => clsx('np-select-input-option-container np-text-body-large', active && 'np-select-input-option-container--active', uiDisabled && 'np-select-input-option-container--disabled'),
|
|
26
|
-
children: ({
|
|
27
|
-
selected
|
|
28
|
-
}) => /*#__PURE__*/jsxs(Fragment, {
|
|
29
|
-
children: [/*#__PURE__*/jsx("div", {
|
|
30
|
-
className: "np-select-input-option",
|
|
31
|
-
children: children
|
|
32
|
-
}), /*#__PURE__*/jsx(Check, {
|
|
33
|
-
size: 16,
|
|
34
|
-
className: clsx('np-select-input-option-check', !selected && 'np-select-input-option-check--not-selected')
|
|
35
|
-
})]
|
|
36
|
-
})
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export { SelectInputItemPositionContext, SelectInputItemsCountContext, SelectInputOption };
|
|
41
|
-
//# sourceMappingURL=SelectInputOption.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SelectInputOption.mjs","sources":["../../../../../src/inputs/SelectInput/components/SelectInputOption/SelectInputOption.tsx"],"sourcesContent":["import { ListboxOption } from '@headlessui/react';\nimport { Check } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport { useContext, createContext } from 'react';\n\nexport const SelectInputItemsCountContext = createContext<number | undefined>(undefined);\nexport const SelectInputItemPositionContext = createContext<number | undefined>(undefined);\n\ninterface SelectInputOptionProps<T = string> {\n value: T;\n disabled?: boolean;\n children?: React.ReactNode;\n}\n\nexport function SelectInputOption<T = string>({\n value,\n disabled,\n children,\n}: SelectInputOptionProps<T>) {\n const itemsCount = useContext(SelectInputItemsCountContext);\n const itemPosition = useContext(SelectInputItemPositionContext);\n return (\n <ListboxOption\n as=\"div\"\n value={value}\n aria-setsize={itemsCount}\n aria-posinset={itemPosition}\n disabled={disabled}\n className={({ active, disabled: uiDisabled }) =>\n clsx(\n 'np-select-input-option-container np-text-body-large',\n active && 'np-select-input-option-container--active',\n uiDisabled && 'np-select-input-option-container--disabled',\n )\n }\n >\n {({ selected }) => (\n <>\n <div className=\"np-select-input-option\">{children}</div>\n <Check\n size={16}\n className={clsx(\n 'np-select-input-option-check',\n !selected && 'np-select-input-option-check--not-selected',\n )}\n />\n </>\n )}\n </ListboxOption>\n );\n}\n"],"names":["SelectInputItemsCountContext","createContext","undefined","SelectInputItemPositionContext","SelectInputOption","value","disabled","children","itemsCount","useContext","itemPosition","_jsx","ListboxOption","as","className","active","uiDisabled","clsx","selected","_jsxs","_Fragment","Check","size"],"mappings":";;;;;;MAKaA,4BAA4B,gBAAGC,aAAa,CAAqBC,SAAS;MAC1EC,8BAA8B,gBAAGF,aAAa,CAAqBC,SAAS;AAQnF,SAAUE,iBAAiBA,CAAa;EAC5CC,KAAK;EACLC,QAAQ;AACRC,EAAAA;AAAQ,CACkB,EAAA;AAC1B,EAAA,MAAMC,UAAU,GAAGC,UAAU,CAACT,4BAA4B,CAAC;AAC3D,EAAA,MAAMU,YAAY,GAAGD,UAAU,CAACN,8BAA8B,CAAC;EAC/D,oBACEQ,GAAA,CAACC,aAAa,EAAA;AACZC,IAAAA,EAAE,EAAC,KAAK;AACRR,IAAAA,KAAK,EAAEA,KAAM;AACb,IAAA,cAAA,EAAcG,UAAW;AACzB,IAAA,eAAA,EAAeE,YAAa;AAC5BJ,IAAAA,QAAQ,EAAEA,QAAS;AACnBQ,IAAAA,SAAS,EAAEA,CAAC;MAAEC,MAAM;AAAET,MAAAA,QAAQ,EAAEU;AAAU,KAAE,KAC1CC,IAAI,CACF,qDAAqD,EACrDF,MAAM,IAAI,0CAA0C,EACpDC,UAAU,IAAI,4CAA4C,CAE7D;AAAAT,IAAAA,QAAA,EAEAA,CAAC;AAAEW,MAAAA;KAAU,kBACZC,IAAA,CAAAC,QAAA,EAAA;AAAAb,MAAAA,QAAA,gBACEI,GAAA,CAAA,KAAA,EAAA;AAAKG,QAAAA,SAAS,EAAC,wBAAwB;AAAAP,QAAAA,QAAA,EAAEA;AAAQ,OAAM,CACvD,eAAAI,GAAA,CAACU,KAAK,EAAA;AACJC,QAAAA,IAAI,EAAE,EAAG;QACTR,SAAS,EAAEG,IAAI,CACb,8BAA8B,EAC9B,CAACC,QAAQ,IAAI,4CAA4C;AACzD,OAAA,CAEN;KAAA;AACD,GACY,CAAC;AAEpB;;;;"}
|
package/build/inputs/SelectInput/components/SelectInputOptionContent/SelectInputOptionContent.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var clsx = require('clsx');
|
|
4
|
-
var React = require('react');
|
|
5
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
-
|
|
7
|
-
const SelectInputOptionContentWithinTriggerContext = /*#__PURE__*/React.createContext(false);
|
|
8
|
-
function SelectInputOptionContent({
|
|
9
|
-
title,
|
|
10
|
-
note,
|
|
11
|
-
description,
|
|
12
|
-
icon
|
|
13
|
-
}) {
|
|
14
|
-
const withinTrigger = React.useContext(SelectInputOptionContentWithinTriggerContext);
|
|
15
|
-
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
16
|
-
className: clsx.clsx('np-select-input-option-content-container', (note || description) && 'np-text-body-large'),
|
|
17
|
-
children: [icon ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
18
|
-
className: clsx.clsx('np-select-input-option-content-icon', !withinTrigger && 'np-select-input-option-content-icon--not-within-trigger'),
|
|
19
|
-
children: icon
|
|
20
|
-
}) : null, /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
21
|
-
className: "np-select-input-option-content-text",
|
|
22
|
-
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
23
|
-
className: clsx.clsx('np-select-input-option-content-text-line-1', withinTrigger && 'np-select-input-option-content-text-within-trigger'),
|
|
24
|
-
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
25
|
-
className: "d-inline",
|
|
26
|
-
children: title
|
|
27
|
-
}), note ? /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
28
|
-
className: "np-select-input-option-content-text-secondary np-text-body-default",
|
|
29
|
-
children: note
|
|
30
|
-
}) : null]
|
|
31
|
-
}), description ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
32
|
-
className: clsx.clsx('np-select-input-option-content-text-secondary np-text-body-default', withinTrigger && 'np-select-input-option-content-text-within-trigger'),
|
|
33
|
-
children: description
|
|
34
|
-
}) : null]
|
|
35
|
-
})]
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
exports.SelectInputOptionContent = SelectInputOptionContent;
|
|
40
|
-
exports.SelectInputOptionContentWithinTriggerContext = SelectInputOptionContentWithinTriggerContext;
|
|
41
|
-
//# sourceMappingURL=SelectInputOptionContent.js.map
|
package/build/inputs/SelectInput/components/SelectInputOptionContent/SelectInputOptionContent.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SelectInputOptionContent.js","sources":["../../../../../src/inputs/SelectInput/components/SelectInputOptionContent/SelectInputOptionContent.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useContext, createContext } from 'react';\n\nexport const SelectInputOptionContentWithinTriggerContext = createContext(false);\n\nexport interface SelectInputOptionContentProps {\n title: string;\n note?: string;\n description?: string;\n icon?: React.ReactNode;\n}\n\nexport function SelectInputOptionContent({\n title,\n note,\n description,\n icon,\n}: SelectInputOptionContentProps) {\n const withinTrigger = useContext(SelectInputOptionContentWithinTriggerContext);\n\n return (\n <div\n className={clsx(\n 'np-select-input-option-content-container',\n (note || description) && 'np-text-body-large',\n )}\n >\n {icon ? (\n <div\n className={clsx(\n 'np-select-input-option-content-icon',\n !withinTrigger && 'np-select-input-option-content-icon--not-within-trigger',\n )}\n >\n {icon}\n </div>\n ) : null}\n\n <div className=\"np-select-input-option-content-text\">\n <div\n className={clsx(\n 'np-select-input-option-content-text-line-1',\n withinTrigger && 'np-select-input-option-content-text-within-trigger',\n )}\n >\n <div className=\"d-inline\">{title}</div>\n {note ? (\n <span className=\"np-select-input-option-content-text-secondary np-text-body-default\">\n {note}\n </span>\n ) : null}\n </div>\n\n {description ? (\n <div\n className={clsx(\n 'np-select-input-option-content-text-secondary np-text-body-default',\n withinTrigger && 'np-select-input-option-content-text-within-trigger',\n )}\n >\n {description}\n </div>\n ) : null}\n </div>\n </div>\n );\n}\n"],"names":["SelectInputOptionContentWithinTriggerContext","createContext","SelectInputOptionContent","title","note","description","icon","withinTrigger","useContext","_jsxs","className","clsx","children","_jsx"],"mappings":";;;;;;MAGaA,4CAA4C,gBAAGC,mBAAa,CAAC,KAAK;AASzE,SAAUC,wBAAwBA,CAAC;EACvCC,KAAK;EACLC,IAAI;EACJC,WAAW;AACXC,EAAAA;AAAI,CAC0B,EAAA;AAC9B,EAAA,MAAMC,aAAa,GAAGC,gBAAU,CAACR,4CAA4C,CAAC;AAE9E,EAAA,oBACES,eAAA,CAAA,KAAA,EAAA;IACEC,SAAS,EAAEC,SAAI,CACb,0CAA0C,EAC1C,CAACP,IAAI,IAAIC,WAAW,KAAK,oBAAoB,CAC7C;IAAAO,QAAA,EAAA,CAEDN,IAAI,gBACHO,cAAA,CAAA,KAAA,EAAA;MACEH,SAAS,EAAEC,SAAI,CACb,qCAAqC,EACrC,CAACJ,aAAa,IAAI,yDAAyD,CAC3E;AAAAK,MAAAA,QAAA,EAEDN;AAAI,KACF,CAAC,GACJ,IAAI,eAERG,eAAA,CAAA,KAAA,EAAA;AAAKC,MAAAA,SAAS,EAAC,qCAAqC;AAAAE,MAAAA,QAAA,gBAClDH,eAAA,CAAA,KAAA,EAAA;QACEC,SAAS,EAAEC,SAAI,CACb,4CAA4C,EAC5CJ,aAAa,IAAI,oDAAoD,CACrE;AAAAK,QAAAA,QAAA,gBAEFC,cAAA,CAAA,KAAA,EAAA;AAAKH,UAAAA,SAAS,EAAC,UAAU;AAAAE,UAAAA,QAAA,EAAET;AAAK,SAAM,CACtC,EAACC,IAAI,gBACHS,cAAA,CAAA,MAAA,EAAA;AAAMH,UAAAA,SAAS,EAAC,oEAAoE;AAAAE,UAAAA,QAAA,EACjFR;SACG,CAAC,GACL,IAAI;AAAA,OACL,CAEL,EAACC,WAAW,gBACVQ,cAAA,CAAA,KAAA,EAAA;QACEH,SAAS,EAAEC,SAAI,CACb,oEAAoE,EACpEJ,aAAa,IAAI,oDAAoD,CACrE;AAAAK,QAAAA,QAAA,EAEDP;OACE,CAAC,GACJ,IAAI;AAAA,KACL,CACP;AAAA,GAAK,CAAC;AAEV;;;;;"}
|
package/build/inputs/SelectInput/components/SelectInputOptionContent/SelectInputOptionContent.mjs
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { clsx } from 'clsx';
|
|
2
|
-
import { createContext, useContext } from 'react';
|
|
3
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
|
-
|
|
5
|
-
const SelectInputOptionContentWithinTriggerContext = /*#__PURE__*/createContext(false);
|
|
6
|
-
function SelectInputOptionContent({
|
|
7
|
-
title,
|
|
8
|
-
note,
|
|
9
|
-
description,
|
|
10
|
-
icon
|
|
11
|
-
}) {
|
|
12
|
-
const withinTrigger = useContext(SelectInputOptionContentWithinTriggerContext);
|
|
13
|
-
return /*#__PURE__*/jsxs("div", {
|
|
14
|
-
className: clsx('np-select-input-option-content-container', (note || description) && 'np-text-body-large'),
|
|
15
|
-
children: [icon ? /*#__PURE__*/jsx("div", {
|
|
16
|
-
className: clsx('np-select-input-option-content-icon', !withinTrigger && 'np-select-input-option-content-icon--not-within-trigger'),
|
|
17
|
-
children: icon
|
|
18
|
-
}) : null, /*#__PURE__*/jsxs("div", {
|
|
19
|
-
className: "np-select-input-option-content-text",
|
|
20
|
-
children: [/*#__PURE__*/jsxs("div", {
|
|
21
|
-
className: clsx('np-select-input-option-content-text-line-1', withinTrigger && 'np-select-input-option-content-text-within-trigger'),
|
|
22
|
-
children: [/*#__PURE__*/jsx("div", {
|
|
23
|
-
className: "d-inline",
|
|
24
|
-
children: title
|
|
25
|
-
}), note ? /*#__PURE__*/jsx("span", {
|
|
26
|
-
className: "np-select-input-option-content-text-secondary np-text-body-default",
|
|
27
|
-
children: note
|
|
28
|
-
}) : null]
|
|
29
|
-
}), description ? /*#__PURE__*/jsx("div", {
|
|
30
|
-
className: clsx('np-select-input-option-content-text-secondary np-text-body-default', withinTrigger && 'np-select-input-option-content-text-within-trigger'),
|
|
31
|
-
children: description
|
|
32
|
-
}) : null]
|
|
33
|
-
})]
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export { SelectInputOptionContent, SelectInputOptionContentWithinTriggerContext };
|
|
38
|
-
//# sourceMappingURL=SelectInputOptionContent.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SelectInputOptionContent.mjs","sources":["../../../../../src/inputs/SelectInput/components/SelectInputOptionContent/SelectInputOptionContent.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useContext, createContext } from 'react';\n\nexport const SelectInputOptionContentWithinTriggerContext = createContext(false);\n\nexport interface SelectInputOptionContentProps {\n title: string;\n note?: string;\n description?: string;\n icon?: React.ReactNode;\n}\n\nexport function SelectInputOptionContent({\n title,\n note,\n description,\n icon,\n}: SelectInputOptionContentProps) {\n const withinTrigger = useContext(SelectInputOptionContentWithinTriggerContext);\n\n return (\n <div\n className={clsx(\n 'np-select-input-option-content-container',\n (note || description) && 'np-text-body-large',\n )}\n >\n {icon ? (\n <div\n className={clsx(\n 'np-select-input-option-content-icon',\n !withinTrigger && 'np-select-input-option-content-icon--not-within-trigger',\n )}\n >\n {icon}\n </div>\n ) : null}\n\n <div className=\"np-select-input-option-content-text\">\n <div\n className={clsx(\n 'np-select-input-option-content-text-line-1',\n withinTrigger && 'np-select-input-option-content-text-within-trigger',\n )}\n >\n <div className=\"d-inline\">{title}</div>\n {note ? (\n <span className=\"np-select-input-option-content-text-secondary np-text-body-default\">\n {note}\n </span>\n ) : null}\n </div>\n\n {description ? (\n <div\n className={clsx(\n 'np-select-input-option-content-text-secondary np-text-body-default',\n withinTrigger && 'np-select-input-option-content-text-within-trigger',\n )}\n >\n {description}\n </div>\n ) : null}\n </div>\n </div>\n );\n}\n"],"names":["SelectInputOptionContentWithinTriggerContext","createContext","SelectInputOptionContent","title","note","description","icon","withinTrigger","useContext","_jsxs","className","clsx","children","_jsx"],"mappings":";;;;MAGaA,4CAA4C,gBAAGC,aAAa,CAAC,KAAK;AASzE,SAAUC,wBAAwBA,CAAC;EACvCC,KAAK;EACLC,IAAI;EACJC,WAAW;AACXC,EAAAA;AAAI,CAC0B,EAAA;AAC9B,EAAA,MAAMC,aAAa,GAAGC,UAAU,CAACR,4CAA4C,CAAC;AAE9E,EAAA,oBACES,IAAA,CAAA,KAAA,EAAA;IACEC,SAAS,EAAEC,IAAI,CACb,0CAA0C,EAC1C,CAACP,IAAI,IAAIC,WAAW,KAAK,oBAAoB,CAC7C;IAAAO,QAAA,EAAA,CAEDN,IAAI,gBACHO,GAAA,CAAA,KAAA,EAAA;MACEH,SAAS,EAAEC,IAAI,CACb,qCAAqC,EACrC,CAACJ,aAAa,IAAI,yDAAyD,CAC3E;AAAAK,MAAAA,QAAA,EAEDN;AAAI,KACF,CAAC,GACJ,IAAI,eAERG,IAAA,CAAA,KAAA,EAAA;AAAKC,MAAAA,SAAS,EAAC,qCAAqC;AAAAE,MAAAA,QAAA,gBAClDH,IAAA,CAAA,KAAA,EAAA;QACEC,SAAS,EAAEC,IAAI,CACb,4CAA4C,EAC5CJ,aAAa,IAAI,oDAAoD,CACrE;AAAAK,QAAAA,QAAA,gBAEFC,GAAA,CAAA,KAAA,EAAA;AAAKH,UAAAA,SAAS,EAAC,UAAU;AAAAE,UAAAA,QAAA,EAAET;AAAK,SAAM,CACtC,EAACC,IAAI,gBACHS,GAAA,CAAA,MAAA,EAAA;AAAMH,UAAAA,SAAS,EAAC,oEAAoE;AAAAE,UAAAA,QAAA,EACjFR;SACG,CAAC,GACL,IAAI;AAAA,OACL,CAEL,EAACC,WAAW,gBACVQ,GAAA,CAAA,KAAA,EAAA;QACEH,SAAS,EAAEC,IAAI,CACb,oEAAoE,EACpEJ,aAAa,IAAI,oDAAoD,CACrE;AAAAK,QAAAA,QAAA,EAEDP;OACE,CAAC,GACJ,IAAI;AAAA,KACL,CACP;AAAA,GAAK,CAAC;AAEV;;;;"}
|