@veeqo/ui 11.3.1 → 11.3.2
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/dist/components/SelectDropdown/ListItem/ListItem.cjs +6 -3
- package/dist/components/SelectDropdown/ListItem/ListItem.cjs.map +1 -1
- package/dist/components/SelectDropdown/ListItem/ListItem.d.ts +1 -1
- package/dist/components/SelectDropdown/ListItem/ListItem.js +6 -3
- package/dist/components/SelectDropdown/ListItem/ListItem.js.map +1 -1
- package/dist/components/SelectDropdown/ListItem/ListItem.module.scss.cjs +9 -0
- package/dist/components/SelectDropdown/ListItem/ListItem.module.scss.cjs.map +1 -0
- package/dist/components/SelectDropdown/ListItem/ListItem.module.scss.js +7 -0
- package/dist/components/SelectDropdown/ListItem/ListItem.module.scss.js.map +1 -0
- package/dist/components/SelectDropdown/ListItem/components/ListItemContent.cjs +36 -18
- package/dist/components/SelectDropdown/ListItem/components/ListItemContent.cjs.map +1 -1
- package/dist/components/SelectDropdown/ListItem/components/ListItemContent.js +37 -19
- package/dist/components/SelectDropdown/ListItem/components/ListItemContent.js.map +1 -1
- package/dist/components/SelectDropdown/ListItem/components/SelectionType.cjs +4 -4
- package/dist/components/SelectDropdown/ListItem/components/SelectionType.cjs.map +1 -1
- package/dist/components/SelectDropdown/ListItem/components/SelectionType.js +4 -4
- package/dist/components/SelectDropdown/ListItem/components/SelectionType.js.map +1 -1
- package/dist/components/SelectDropdown/ListItemSection/ListItemSection.cjs +6 -6
- package/dist/components/SelectDropdown/ListItemSection/ListItemSection.cjs.map +1 -1
- package/dist/components/SelectDropdown/ListItemSection/ListItemSection.js +7 -7
- package/dist/components/SelectDropdown/ListItemSection/ListItemSection.js.map +1 -1
- package/dist/components/SelectDropdown/ListItemSection/ListItemSection.module.scss.cjs +9 -0
- package/dist/components/SelectDropdown/ListItemSection/ListItemSection.module.scss.cjs.map +1 -0
- package/dist/components/SelectDropdown/ListItemSection/ListItemSection.module.scss.js +7 -0
- package/dist/components/SelectDropdown/ListItemSection/ListItemSection.module.scss.js.map +1 -0
- package/dist/components/SelectDropdown/SelectDropdown.cjs +20 -8
- package/dist/components/SelectDropdown/SelectDropdown.cjs.map +1 -1
- package/dist/components/SelectDropdown/SelectDropdown.js +21 -9
- package/dist/components/SelectDropdown/SelectDropdown.js.map +1 -1
- package/dist/components/SelectDropdown/SelectDropdown.module.scss.cjs +9 -0
- package/dist/components/SelectDropdown/SelectDropdown.module.scss.cjs.map +1 -0
- package/dist/components/SelectDropdown/SelectDropdown.module.scss.js +7 -0
- package/dist/components/SelectDropdown/SelectDropdown.module.scss.js.map +1 -0
- package/dist/components/SelectDropdown/components/SelectedOption.cjs +4 -6
- package/dist/components/SelectDropdown/components/SelectedOption.cjs.map +1 -1
- package/dist/components/SelectDropdown/components/SelectedOption.js +4 -6
- package/dist/components/SelectDropdown/components/SelectedOption.js.map +1 -1
- package/dist/utils/forms/form.module.scss.cjs +9 -0
- package/dist/utils/forms/form.module.scss.cjs.map +1 -0
- package/dist/utils/forms/form.module.scss.js +7 -0
- package/dist/utils/forms/form.module.scss.js.map +1 -0
- package/dist/utils/forms/inputStyles.cjs +17 -0
- package/dist/utils/forms/inputStyles.cjs.map +1 -1
- package/dist/utils/forms/inputStyles.d.ts +17 -0
- package/dist/utils/forms/inputStyles.js +17 -0
- package/dist/utils/forms/inputStyles.js.map +1 -1
- package/dist/utils/forms/variables.cjs +6 -0
- package/dist/utils/forms/variables.cjs.map +1 -1
- package/dist/utils/forms/variables.d.ts +6 -0
- package/dist/utils/forms/variables.js +6 -0
- package/dist/utils/forms/variables.js.map +1 -1
- package/package.json +1 -1
- package/dist/components/SelectDropdown/ListItem/components/CheckboxIndicator.cjs +0 -18
- package/dist/components/SelectDropdown/ListItem/components/CheckboxIndicator.cjs.map +0 -1
- package/dist/components/SelectDropdown/ListItem/components/CheckboxIndicator.d.ts +0 -2
- package/dist/components/SelectDropdown/ListItem/components/CheckboxIndicator.js +0 -12
- package/dist/components/SelectDropdown/ListItem/components/CheckboxIndicator.js.map +0 -1
- package/dist/components/SelectDropdown/ListItem/components/RadioIndicator.cjs +0 -18
- package/dist/components/SelectDropdown/ListItem/components/RadioIndicator.cjs.map +0 -1
- package/dist/components/SelectDropdown/ListItem/components/RadioIndicator.d.ts +0 -2
- package/dist/components/SelectDropdown/ListItem/components/RadioIndicator.js +0 -12
- package/dist/components/SelectDropdown/ListItem/components/RadioIndicator.js.map +0 -1
- package/dist/components/SelectDropdown/ListItem/styled.cjs +0 -42
- package/dist/components/SelectDropdown/ListItem/styled.cjs.map +0 -1
- package/dist/components/SelectDropdown/ListItem/styled.d.ts +0 -21
- package/dist/components/SelectDropdown/ListItem/styled.js +0 -31
- package/dist/components/SelectDropdown/ListItem/styled.js.map +0 -1
- package/dist/components/SelectDropdown/ListItemSection/styled.cjs +0 -16
- package/dist/components/SelectDropdown/ListItemSection/styled.cjs.map +0 -1
- package/dist/components/SelectDropdown/ListItemSection/styled.d.ts +0 -3
- package/dist/components/SelectDropdown/ListItemSection/styled.js +0 -9
- package/dist/components/SelectDropdown/ListItemSection/styled.js.map +0 -1
- package/dist/components/SelectDropdown/styled.cjs +0 -33
- package/dist/components/SelectDropdown/styled.cjs.map +0 -1
- package/dist/components/SelectDropdown/styled.d.ts +0 -321
- package/dist/components/SelectDropdown/styled.js +0 -22
- package/dist/components/SelectDropdown/styled.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectDropdown.cjs","sources":["../../../src/components/SelectDropdown/SelectDropdown.tsx"],"sourcesContent":["/* eslint-disable react/destructuring-assignment */\nimport React, { useCallback, useState } from 'react';\nimport { Key, Selection } from 'react-aria-components';\n\nimport { buildClassnames } from '../../utils';\nimport { SelectedOption } from './components/SelectedOption';\nimport { generateClassNames, getSelectedValues } from './utils';\nimport {
|
|
1
|
+
{"version":3,"file":"SelectDropdown.cjs","sources":["../../../src/components/SelectDropdown/SelectDropdown.tsx"],"sourcesContent":["/* eslint-disable react/destructuring-assignment */\nimport React, { Fragment, useCallback, useState } from 'react';\nimport { Key, ListBox, Selection } from 'react-aria-components';\n\nimport { buildClassnames } from '../../utils';\nimport { SelectedOption } from './components/SelectedOption';\nimport { generateClassNames, getSelectedValues } from './utils';\nimport { SelectDropdownItem, SelectDropdownProps } from './types';\nimport { ListItemSection, ListItemSectionProps } from './ListItemSection/ListItemSection';\nimport { ListItem } from './ListItem';\nimport { ListItemProps } from './ListItem/types';\nimport { SelectDropdownState } from './components/SelectDropdownState';\nimport { Dropdown } from '../Dropdown';\nimport { Search } from '../Search';\nimport { Button } from '../Button';\nimport styles from './SelectDropdown.module.scss';\nimport formStyles from '../../utils/forms/form.module.scss';\n\nexport const SelectDropdown = ({\n id,\n className,\n placeholder = 'Select item',\n multiple = false,\n compact = false,\n hasError = false,\n disabled,\n options,\n value,\n actions,\n isLoading = false,\n searchValue,\n emptyStateSlot,\n onSearchChange,\n onChange,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-describedby': ariaDescribedBy,\n ...otherProps\n}: SelectDropdownProps) => {\n const hasSection = options.flatMap((option) => option).some((item) => 'items' in item);\n const classNames = generateClassNames(className);\n\n const [isSelectOpen, setIsSelectOpen] = useState(false);\n\n const selectedValues = getSelectedValues(options, hasSection, value);\n const selectionMode = multiple ? 'multiple' : 'single';\n\n const onSelectionChange = useCallback(\n (keys: Selection) => {\n const selectedKeys = Array.from(keys);\n const newSelectedValues = getSelectedValues(options, hasSection, selectedKeys);\n\n if (multiple) {\n (onChange as (items: SelectDropdownItem[]) => void)(newSelectedValues);\n } else {\n (onChange as (item: SelectDropdownItem) => void)(newSelectedValues[0]);\n setIsSelectOpen(false);\n }\n },\n [options, hasSection, multiple, onChange],\n );\n\n return (\n <Dropdown\n id={`select-dropdown-${id}`}\n className={buildClassnames([classNames?.popover, styles.dropdown, className])}\n shouldShow={isSelectOpen}\n setShouldShow={setIsSelectOpen}\n useAnchorWidth\n disabled={disabled}\n renderCta={(buttonProps, anchorRef) => (\n <button\n {...buttonProps}\n type=\"button\"\n ref={anchorRef}\n className={buildClassnames([\n className,\n styles.dropdownTrigger,\n formStyles.fullStyles,\n formStyles.base,\n hasError && formStyles.error,\n compact && formStyles.compact,\n ])}\n >\n <SelectedOption\n placeholder={placeholder}\n options={selectedValues}\n selectionMode={selectionMode}\n />\n </button>\n )}\n >\n {onSearchChange && (\n <>\n <Search className={styles.search} value={searchValue} onChange={onSearchChange} />\n <hr className={styles.separator} />\n </>\n )}\n <ListBox\n className={buildClassnames([classNames?.optionsContainer, styles.listBox, className])}\n aria-labelledby={ariaLabelledBy ?? `${id}-label`}\n aria-describedby={ariaDescribedBy ?? `${id}-hint`}\n selectionMode={selectionMode}\n items={options}\n onSelectionChange={onSelectionChange}\n selectedKeys={selectedValues.map((selectedValue) => selectedValue.id) as Key[]}\n renderEmptyState={() => (\n <SelectDropdownState isLoading={isLoading} emptyStateSlot={emptyStateSlot} />\n )}\n {...otherProps}\n >\n {(item) =>\n hasSection ? (\n <ListItemSection {...(item as ListItemSectionProps)} />\n ) : (\n <ListItem {...(item as ListItemProps)} />\n )\n }\n </ListBox>\n {actions?.map(({ label, ...actionProps }) => (\n <Fragment key={label}>\n <hr className={styles.separator} key={`seperator-${label}`} />\n <Button className={styles.ctaButton} variant=\"flat\" key={label} {...actionProps} />\n </Fragment>\n ))}\n </Dropdown>\n );\n};\n"],"names":["generateClassNames","useState","getSelectedValues","useCallback","React","Dropdown","buildClassnames","styles","formStyles","SelectedOption","Search","ListBox","SelectDropdownState","ListItemSection","ListItem","Fragment","Button"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAkBa,MAAA,cAAc,GAAG,CAAC,EAC7B,EAAE,EACF,SAAS,EACT,WAAW,GAAG,aAAa,EAC3B,QAAQ,GAAG,KAAK,EAChB,OAAO,GAAG,KAAK,EACf,QAAQ,GAAG,KAAK,EAChB,QAAQ,EACR,OAAO,EACP,KAAK,EACL,OAAO,EACP,SAAS,GAAG,KAAK,EACjB,WAAW,E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AM,WAAW,EAAA,CAAI,CAC1E,CACZ,CAAC,CACO;AAEf;;;;"}
|
|
@@ -1,12 +1,17 @@
|
|
|
1
|
-
import React__default, { useState, useCallback } from 'react';
|
|
1
|
+
import React__default, { useState, useCallback, Fragment } from 'react';
|
|
2
|
+
import { ListBox } from 'react-aria-components';
|
|
2
3
|
import { buildClassnames } from '../../utils/buildClassnames.js';
|
|
3
4
|
import 'uid/secure';
|
|
4
5
|
import { SelectedOption } from './components/SelectedOption.js';
|
|
5
6
|
import { getSelectedValues, generateClassNames } from './utils.js';
|
|
6
|
-
import { StyledDropdown, StyledSelectButton, StyledSearch, Separator, StyledListBox, CTAButton } from './styled.js';
|
|
7
7
|
import { ListItemSection } from './ListItemSection/ListItemSection.js';
|
|
8
8
|
import { ListItem } from './ListItem/ListItem.js';
|
|
9
9
|
import { SelectDropdownState } from './components/SelectDropdownState.js';
|
|
10
|
+
import { Dropdown } from '../Dropdown/Dropdown.js';
|
|
11
|
+
import { Search } from '../Search/Search.js';
|
|
12
|
+
import { Button } from '../Button/Button.js';
|
|
13
|
+
import styles from './SelectDropdown.module.scss.js';
|
|
14
|
+
import formStyles from '../../utils/forms/form.module.scss.js';
|
|
10
15
|
|
|
11
16
|
/* eslint-disable react/destructuring-assignment */
|
|
12
17
|
const SelectDropdown = ({ id, className, placeholder = 'Select item', multiple = false, compact = false, hasError = false, disabled, options, value, actions, isLoading = false, searchValue, emptyStateSlot, onSearchChange, onChange, 'aria-labelledby': ariaLabelledBy, 'aria-describedby': ariaDescribedBy, ...otherProps }) => {
|
|
@@ -26,15 +31,22 @@ const SelectDropdown = ({ id, className, placeholder = 'Select item', multiple =
|
|
|
26
31
|
setIsSelectOpen(false);
|
|
27
32
|
}
|
|
28
33
|
}, [options, hasSection, multiple, onChange]);
|
|
29
|
-
return (React__default.createElement(
|
|
34
|
+
return (React__default.createElement(Dropdown, { id: `select-dropdown-${id}`, className: buildClassnames([classNames === null || classNames === undefined ? undefined : classNames.popover, styles.dropdown, className]), shouldShow: isSelectOpen, setShouldShow: setIsSelectOpen, useAnchorWidth: true, disabled: disabled, renderCta: (buttonProps, anchorRef) => (React__default.createElement("button", { ...buttonProps, type: "button", ref: anchorRef, className: buildClassnames([
|
|
35
|
+
className,
|
|
36
|
+
styles.dropdownTrigger,
|
|
37
|
+
formStyles.fullStyles,
|
|
38
|
+
formStyles.base,
|
|
39
|
+
hasError && formStyles.error,
|
|
40
|
+
compact && formStyles.compact,
|
|
41
|
+
]) },
|
|
30
42
|
React__default.createElement(SelectedOption, { placeholder: placeholder, options: selectedValues, selectionMode: selectionMode }))) },
|
|
31
43
|
onSearchChange && (React__default.createElement(React__default.Fragment, null,
|
|
32
|
-
React__default.createElement(
|
|
33
|
-
React__default.createElement(
|
|
34
|
-
React__default.createElement(
|
|
35
|
-
actions.map(({ label, ...actionProps }) => (React__default.createElement(
|
|
36
|
-
React__default.createElement(
|
|
37
|
-
React__default.createElement(
|
|
44
|
+
React__default.createElement(Search, { className: styles.search, value: searchValue, onChange: onSearchChange }),
|
|
45
|
+
React__default.createElement("hr", { className: styles.separator }))),
|
|
46
|
+
React__default.createElement(ListBox, { className: buildClassnames([classNames === null || classNames === undefined ? undefined : classNames.optionsContainer, styles.listBox, className]), "aria-labelledby": ariaLabelledBy !== null && ariaLabelledBy !== undefined ? ariaLabelledBy : `${id}-label`, "aria-describedby": ariaDescribedBy !== null && ariaDescribedBy !== undefined ? ariaDescribedBy : `${id}-hint`, selectionMode: selectionMode, items: options, onSelectionChange: onSelectionChange, selectedKeys: selectedValues.map((selectedValue) => selectedValue.id), renderEmptyState: () => (React__default.createElement(SelectDropdownState, { isLoading: isLoading, emptyStateSlot: emptyStateSlot })), ...otherProps }, (item) => hasSection ? (React__default.createElement(ListItemSection, { ...item })) : (React__default.createElement(ListItem, { ...item }))), actions === null || actions === undefined ? undefined :
|
|
47
|
+
actions.map(({ label, ...actionProps }) => (React__default.createElement(Fragment, { key: label },
|
|
48
|
+
React__default.createElement("hr", { className: styles.separator, key: `seperator-${label}` }),
|
|
49
|
+
React__default.createElement(Button, { className: styles.ctaButton, variant: "flat", key: label, ...actionProps }))))));
|
|
38
50
|
};
|
|
39
51
|
|
|
40
52
|
export { SelectDropdown };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectDropdown.js","sources":["../../../src/components/SelectDropdown/SelectDropdown.tsx"],"sourcesContent":["/* eslint-disable react/destructuring-assignment */\nimport React, { useCallback, useState } from 'react';\nimport { Key, Selection } from 'react-aria-components';\n\nimport { buildClassnames } from '../../utils';\nimport { SelectedOption } from './components/SelectedOption';\nimport { generateClassNames, getSelectedValues } from './utils';\nimport {
|
|
1
|
+
{"version":3,"file":"SelectDropdown.js","sources":["../../../src/components/SelectDropdown/SelectDropdown.tsx"],"sourcesContent":["/* eslint-disable react/destructuring-assignment */\nimport React, { Fragment, useCallback, useState } from 'react';\nimport { Key, ListBox, Selection } from 'react-aria-components';\n\nimport { buildClassnames } from '../../utils';\nimport { SelectedOption } from './components/SelectedOption';\nimport { generateClassNames, getSelectedValues } from './utils';\nimport { SelectDropdownItem, SelectDropdownProps } from './types';\nimport { ListItemSection, ListItemSectionProps } from './ListItemSection/ListItemSection';\nimport { ListItem } from './ListItem';\nimport { ListItemProps } from './ListItem/types';\nimport { SelectDropdownState } from './components/SelectDropdownState';\nimport { Dropdown } from '../Dropdown';\nimport { Search } from '../Search';\nimport { Button } from '../Button';\nimport styles from './SelectDropdown.module.scss';\nimport formStyles from '../../utils/forms/form.module.scss';\n\nexport const SelectDropdown = ({\n id,\n className,\n placeholder = 'Select item',\n multiple = false,\n compact = false,\n hasError = false,\n disabled,\n options,\n value,\n actions,\n isLoading = false,\n searchValue,\n emptyStateSlot,\n onSearchChange,\n onChange,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-describedby': ariaDescribedBy,\n ...otherProps\n}: SelectDropdownProps) => {\n const hasSection = options.flatMap((option) => option).some((item) => 'items' in item);\n const classNames = generateClassNames(className);\n\n const [isSelectOpen, setIsSelectOpen] = useState(false);\n\n const selectedValues = getSelectedValues(options, hasSection, value);\n const selectionMode = multiple ? 'multiple' : 'single';\n\n const onSelectionChange = useCallback(\n (keys: Selection) => {\n const selectedKeys = Array.from(keys);\n const newSelectedValues = getSelectedValues(options, hasSection, selectedKeys);\n\n if (multiple) {\n (onChange as (items: SelectDropdownItem[]) => void)(newSelectedValues);\n } else {\n (onChange as (item: SelectDropdownItem) => void)(newSelectedValues[0]);\n setIsSelectOpen(false);\n }\n },\n [options, hasSection, multiple, onChange],\n );\n\n return (\n <Dropdown\n id={`select-dropdown-${id}`}\n className={buildClassnames([classNames?.popover, styles.dropdown, className])}\n shouldShow={isSelectOpen}\n setShouldShow={setIsSelectOpen}\n useAnchorWidth\n disabled={disabled}\n renderCta={(buttonProps, anchorRef) => (\n <button\n {...buttonProps}\n type=\"button\"\n ref={anchorRef}\n className={buildClassnames([\n className,\n styles.dropdownTrigger,\n formStyles.fullStyles,\n formStyles.base,\n hasError && formStyles.error,\n compact && formStyles.compact,\n ])}\n >\n <SelectedOption\n placeholder={placeholder}\n options={selectedValues}\n selectionMode={selectionMode}\n />\n </button>\n )}\n >\n {onSearchChange && (\n <>\n <Search className={styles.search} value={searchValue} onChange={onSearchChange} />\n <hr className={styles.separator} />\n </>\n )}\n <ListBox\n className={buildClassnames([classNames?.optionsContainer, styles.listBox, className])}\n aria-labelledby={ariaLabelledBy ?? `${id}-label`}\n aria-describedby={ariaDescribedBy ?? `${id}-hint`}\n selectionMode={selectionMode}\n items={options}\n onSelectionChange={onSelectionChange}\n selectedKeys={selectedValues.map((selectedValue) => selectedValue.id) as Key[]}\n renderEmptyState={() => (\n <SelectDropdownState isLoading={isLoading} emptyStateSlot={emptyStateSlot} />\n )}\n {...otherProps}\n >\n {(item) =>\n hasSection ? (\n <ListItemSection {...(item as ListItemSectionProps)} />\n ) : (\n <ListItem {...(item as ListItemProps)} />\n )\n }\n </ListBox>\n {actions?.map(({ label, ...actionProps }) => (\n <Fragment key={label}>\n <hr className={styles.separator} key={`seperator-${label}`} />\n <Button className={styles.ctaButton} variant=\"flat\" key={label} {...actionProps} />\n </Fragment>\n ))}\n </Dropdown>\n );\n};\n"],"names":["React"],"mappings":";;;;;;;;;;;;;;;AAAA;AAkBa,MAAA,cAAc,GAAG,CAAC,EAC7B,EAAE,EACF,SAAS,EACT,WAAW,GAAG,aAAa,EAC3B,QAAQ,GAAG,KAAK,EAChB,OAAO,GAAG,KAAK,EACf,QAAQ,GAAG,KAAK,EAChB,QAAQ,EACR,OAAO,EACP,KAAK,EACL,OAAO,EACP,SAAS,GAAG,KAAK,EACjB,WAAW,EACX,cAAc,EACd,cAAc,EACd,QAAQ,EACR,iBAAiB,EAAE,cAAc,EACjC,kBAAkB,EAAE,eAAe,EACnC,GAAG,UAAU,EACO,KAAI;IACxB,MAAM,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK,OAAO,IAAI,IAAI,CAAC;AACtF,IAAA,MAAM,UAAU,GAAG,kBAAkB,CAAC,SAAS,CAAC;IAEhD,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC;IAEvD,MAAM,cAAc,GAAG,iBAAiB,CAAC,OAAO,EAAE,UAAU,EAAE,KAAK,CAAC;IACpE,MAAM,aAAa,GAAG,QAAQ,GAAG,UAAU,GAAG,QAAQ;AAEtD,IAAA,MAAM,iBAAiB,GAAG,WAAW,CACnC,CAAC,IAAe,KAAI;QAClB,MAAM,YAAY,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;QACrC,MAAM,iBAAiB,GAAG,iBAAiB,CAAC,OAAO,EAAE,UAAU,EAAE,YAAY,CAAC;AAE9E,QAAA,IAAI,QAAQ,EAAE;YACX,QAAkD,CAAC,iBAAiB,CAAC;AACvE;AAAM,aAAA;AACJ,YAAA,QAA+C,CAAC,iBAAiB,CAAC,C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,CAAC,QAAQ,EAAC,EAAA,GAAG,EAAE,KAAK,EAAA;YAClBA,cAAI,CAAA,aAAA,CAAA,IAAA,EAAA,EAAA,SAAS,EAAE,MAAM,CAAC,SAAS,EAAE,GAAG,EAAE,CAAA,UAAA,EAAa,KAAK,CAAA,CAAE,EAAI,CAAA;YAC9DA,cAAC,CAAA,aAAA,CAAA,MAAM,IAAC,SAAS,EAAE,MAAM,CAAC,SAAS,EAAE,OAAO,EAAC,MAAM,EAAC,GAAG,EAAE,KAAK,EAAA,GAAM,WAAW,EAAA,CAAI,CAC1E,CACZ,CAAC,CACO;AAEf;;;;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var ___$insertStyle = require('../../_virtual/____insertStyle.cjs');
|
|
4
|
+
|
|
5
|
+
___$insertStyle("._listBox_fnslz_1 {\n overflow-y: scroll;\n max-height: 300px;\n padding: var(--sizes-sm);\n scroll-padding: var(--sizes-xs) 0;\n}\n._listBox_fnslz_1[data-empty] {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n._dropdown_fnslz_13 {\n padding: var(--sizes-none) !important;\n}\n\n._dropdownTrigger_fnslz_17 {\n padding-right: var(--sizes-9);\n background-image: url(\"data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fillRule='evenodd' clipRule='evenodd' d='M4 6L8 10L12 6H4Z' fill='currentColor' /%3E%3C/svg%3E\");\n background-repeat: no-repeat;\n background-position: right var(--sizes-3) top 50%;\n}\n\n._separator_fnslz_24 {\n height: var(--sizes-line);\n background: var(--colors-neutral-grey-base);\n border: none;\n margin: var(--sizes-none) var(--sizes-none);\n width: 100%;\n}\n\n._search_fnslz_32 {\n margin: var(--sizes-sm) !important;\n}\n\n._ctaButton_fnslz_36 {\n justify-content: start !important;\n padding-left: var(--sizes-xs) !important;\n margin: var(--sizes-sm) var(--sizes-xs) !important;\n border-radius: var(--radius-base) !important;\n font-size: var(--text-body-font-size) !important;\n}\n._ctaButton_fnslz_36 svg {\n width: var(--sizes-md) !important;\n height: var(--sizes-md) !important;\n}");
|
|
6
|
+
var styles = {"listBox":"_listBox_fnslz_1","dropdown":"_dropdown_fnslz_13","dropdownTrigger":"_dropdownTrigger_fnslz_17","separator":"_separator_fnslz_24","search":"_search_fnslz_32","ctaButton":"_ctaButton_fnslz_36"};
|
|
7
|
+
|
|
8
|
+
module.exports = styles;
|
|
9
|
+
//# sourceMappingURL=SelectDropdown.module.scss.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SelectDropdown.module.scss.cjs","sources":["../../../src/components/SelectDropdown/SelectDropdown.module.scss"],"sourcesContent":[".listBox {\n overflow-y: scroll;\n max-height: 300px;\n padding: var(--sizes-sm);\n scroll-padding: var(--sizes-xs) 0;\n\n &[data-empty] {\n display: flex;\n align-items: center;\n justify-content: center;\n }\n}\n\n// used important to override styled-component styles from Dropdown\n.dropdown {\n padding: var(--sizes-none) !important;\n}\n\n.dropdownTrigger {\n padding-right: var(--sizes-9);\n background-image: url(\"data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fillRule='evenodd' clipRule='evenodd' d='M4 6L8 10L12 6H4Z' fill='currentColor' /%3E%3C/svg%3E\");\n background-repeat: no-repeat;\n background-position: right var(--sizes-3) top 50%;\n}\n\n.separator {\n height: var(--sizes-line);\n background: var(--colors-neutral-grey-base);\n border: none;\n margin: var(--sizes-none) var(--sizes-none);\n width: 100%;\n}\n\n// used important to override styled-component styles from Search\n.search {\n margin: var(--sizes-sm) !important;\n}\n\n// used important to override styled-component styles from Button\n.ctaButton {\n justify-content: start !important;\n padding-left: var(--sizes-xs) !important;\n margin: var(--sizes-sm) var(--sizes-xs) !important;\n border-radius: var(--radius-base) !important;\n font-size: var(--text-body-font-size) !important;\n svg {\n width: var(--sizes-md) !important;\n height: var(--sizes-md) !important;\n }\n}\n"],"names":[],"mappings":";;;;AACE,eAAA,CAAA,s0CAAA;AACA,aAAA,CAAA,SAAA,CAAA,kBAAA,CAAA,UAAA,CAAA,oBAAA,CAAA,iBAAA,CAAA,2BAAA,CAAA,WAAA,CAAA,qBAAA,CAAA,QAAA,CAAA,kBAAA,CAAA,WAAA,CAAA,qBAAA;;;;"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import insertStyle from '../../_virtual/____insertStyle.js';
|
|
2
|
+
|
|
3
|
+
insertStyle("._listBox_fnslz_1 {\n overflow-y: scroll;\n max-height: 300px;\n padding: var(--sizes-sm);\n scroll-padding: var(--sizes-xs) 0;\n}\n._listBox_fnslz_1[data-empty] {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n._dropdown_fnslz_13 {\n padding: var(--sizes-none) !important;\n}\n\n._dropdownTrigger_fnslz_17 {\n padding-right: var(--sizes-9);\n background-image: url(\"data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fillRule='evenodd' clipRule='evenodd' d='M4 6L8 10L12 6H4Z' fill='currentColor' /%3E%3C/svg%3E\");\n background-repeat: no-repeat;\n background-position: right var(--sizes-3) top 50%;\n}\n\n._separator_fnslz_24 {\n height: var(--sizes-line);\n background: var(--colors-neutral-grey-base);\n border: none;\n margin: var(--sizes-none) var(--sizes-none);\n width: 100%;\n}\n\n._search_fnslz_32 {\n margin: var(--sizes-sm) !important;\n}\n\n._ctaButton_fnslz_36 {\n justify-content: start !important;\n padding-left: var(--sizes-xs) !important;\n margin: var(--sizes-sm) var(--sizes-xs) !important;\n border-radius: var(--radius-base) !important;\n font-size: var(--text-body-font-size) !important;\n}\n._ctaButton_fnslz_36 svg {\n width: var(--sizes-md) !important;\n height: var(--sizes-md) !important;\n}");
|
|
4
|
+
var styles = {"listBox":"_listBox_fnslz_1","dropdown":"_dropdown_fnslz_13","dropdownTrigger":"_dropdownTrigger_fnslz_17","separator":"_separator_fnslz_24","search":"_search_fnslz_32","ctaButton":"_ctaButton_fnslz_36"};
|
|
5
|
+
|
|
6
|
+
export { styles as default };
|
|
7
|
+
//# sourceMappingURL=SelectDropdown.module.scss.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SelectDropdown.module.scss.js","sources":["../../../src/components/SelectDropdown/SelectDropdown.module.scss"],"sourcesContent":[".listBox {\n overflow-y: scroll;\n max-height: 300px;\n padding: var(--sizes-sm);\n scroll-padding: var(--sizes-xs) 0;\n\n &[data-empty] {\n display: flex;\n align-items: center;\n justify-content: center;\n }\n}\n\n// used important to override styled-component styles from Dropdown\n.dropdown {\n padding: var(--sizes-none) !important;\n}\n\n.dropdownTrigger {\n padding-right: var(--sizes-9);\n background-image: url(\"data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fillRule='evenodd' clipRule='evenodd' d='M4 6L8 10L12 6H4Z' fill='currentColor' /%3E%3C/svg%3E\");\n background-repeat: no-repeat;\n background-position: right var(--sizes-3) top 50%;\n}\n\n.separator {\n height: var(--sizes-line);\n background: var(--colors-neutral-grey-base);\n border: none;\n margin: var(--sizes-none) var(--sizes-none);\n width: 100%;\n}\n\n// used important to override styled-component styles from Search\n.search {\n margin: var(--sizes-sm) !important;\n}\n\n// used important to override styled-component styles from Button\n.ctaButton {\n justify-content: start !important;\n padding-left: var(--sizes-xs) !important;\n margin: var(--sizes-sm) var(--sizes-xs) !important;\n border-radius: var(--radius-base) !important;\n font-size: var(--text-body-font-size) !important;\n svg {\n width: var(--sizes-md) !important;\n height: var(--sizes-md) !important;\n }\n}\n"],"names":["___$insertStyle"],"mappings":";;AACEA,WAAA,CAAA,s0CAAA;AACA,aAAA,CAAA,SAAA,CAAA,kBAAA,CAAA,UAAA,CAAA,oBAAA,CAAA,iBAAA,CAAA,2BAAA,CAAA,WAAA,CAAA,qBAAA,CAAA,QAAA,CAAA,kBAAA,CAAA,WAAA,CAAA,qBAAA;;;;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var React = require('react');
|
|
4
|
+
var FlexRow = require('../../Flex/FlexRow/FlexRow.cjs');
|
|
4
5
|
var Text = require('../../Text/Text.cjs');
|
|
5
|
-
var styled = require('../ListItem/styled.cjs');
|
|
6
6
|
|
|
7
7
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
8
8
|
|
|
@@ -11,16 +11,14 @@ var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
|
11
11
|
const SelectedOption = ({ placeholder, options, selectionMode }) => {
|
|
12
12
|
var _a, _b, _c;
|
|
13
13
|
if (options.length === 0) {
|
|
14
|
-
return
|
|
15
|
-
React__default.default.createElement(Text.Text, { variant: "placeholder" }, placeholder)));
|
|
14
|
+
return React__default.default.createElement(Text.Text, { variant: "placeholder" }, placeholder);
|
|
16
15
|
}
|
|
17
16
|
if (selectionMode === 'single') {
|
|
18
|
-
return (React__default.default.createElement(
|
|
17
|
+
return (React__default.default.createElement(FlexRow.FlexRow, { gap: "sm" },
|
|
19
18
|
React__default.default.createElement(Text.Text, { variant: "placeholder" }, (_a = options[0]) === null || _a === undefined ? undefined : _a.label),
|
|
20
19
|
((_b = options[0]) === null || _b === undefined ? undefined : _b.itemInfoSlot) && React__default.default.createElement(Text.Text, { variant: "hintText" }, (_c = options[0]) === null || _c === undefined ? undefined : _c.itemInfoSlot)));
|
|
21
20
|
}
|
|
22
|
-
return
|
|
23
|
-
React__default.default.createElement(Text.Text, { variant: "placeholder" }, options.map((opt) => opt.label).join(', '))));
|
|
21
|
+
return React__default.default.createElement(Text.Text, { variant: "placeholder" }, options.map((opt) => opt.label).join(', '));
|
|
24
22
|
};
|
|
25
23
|
|
|
26
24
|
exports.SelectedOption = SelectedOption;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectedOption.cjs","sources":["../../../../src/components/SelectDropdown/components/SelectedOption.tsx"],"sourcesContent":["import React from 'react';\nimport {
|
|
1
|
+
{"version":3,"file":"SelectedOption.cjs","sources":["../../../../src/components/SelectDropdown/components/SelectedOption.tsx"],"sourcesContent":["import React from 'react';\nimport { FlexRow } from '../../Flex/FlexRow';\nimport { Text } from '../../Text';\nimport { SelectDropdownItem } from '../types';\n\ntype SelectedOptionProps = {\n placeholder: string;\n options: SelectDropdownItem[];\n selectionMode: 'single' | 'multiple';\n};\n\nexport const SelectedOption = ({ placeholder, options, selectionMode }: SelectedOptionProps) => {\n if (options.length === 0) {\n return <Text variant=\"placeholder\">{placeholder}</Text>;\n }\n\n if (selectionMode === 'single') {\n return (\n <FlexRow gap=\"sm\">\n <Text variant=\"placeholder\">{options[0]?.label}</Text>\n {options[0]?.itemInfoSlot && <Text variant=\"hintText\">{options[0]?.itemInfoSlot}</Text>}\n </FlexRow>\n );\n }\n\n return <Text variant=\"placeholder\">{options.map((opt: any) => opt.label).join(', ')}</Text>;\n};\n"],"names":["React","Text","FlexRow"],"mappings":";;;;;;;;;;AAWO,MAAM,cAAc,GAAG,CAAC,EAAE,WAAW,EAAE,OAAO,EAAE,aAAa,EAAuB,KAAI;;AAC7F,IAAA,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE;QACxB,OAAOA,sBAAA,CAAA,aAAA,CAACC,SAAI,EAAC,EAAA,OAAO,EAAC,aAAa,EAAA,EAAE,WAAW,CAAQ;AACxD;IAED,IAAI,aAAa,KAAK,QAAQ,EAAE;AAC9B,QAAA,QACED,sBAAC,CAAA,aAAA,CAAAE,eAAO,EAAC,EAAA,GAAG,EAAC,IAAI,EAAA;AACf,YAAAF,sBAAA,CAAA,aAAA,CAACC,SAAI,EAAA,EAAC,OAAO,EAAC,aAAa,EAAA,EAAE,CAAA,EAAA,GAAA,OAAO,CAAC,CAAC,CAAC,MAAA,IAAA,IAAA,EAAA,KAAA,SAAA,GAAA,SAAA,GAAA,EAAA,CAAE,KAAK,CAAQ;YACrD,CAAA,CAAA,EAAA,GAAA,OAAO,CAAC,CAAC,CAAC,gDAAE,YAAY,KAAID,sBAAC,CAAA,aAAA,CAAAC,SAAI,EAAC,EAAA,OAAO,EAAC,UAAU,EAAA,EAAE,CAAA,EAAA,GAAA,OAAO,CAAC,CAAC,CAAC,MAAA,IAAA,IAAA,EAAA,KAAA,SAAA,GAAA,SAAA,GAAA,EAAA,CAAE,YAAY,CAAQ,CAC/E;AAEb;IAED,OAAOD,sBAAA,CAAA,aAAA,CAACC,SAAI,EAAA,EAAC,OAAO,EAAC,aAAa,EAAA,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,GAAQ,KAAK,GAAG,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAQ;AAC7F;;;;"}
|
|
@@ -1,20 +1,18 @@
|
|
|
1
1
|
import React__default from 'react';
|
|
2
|
+
import { FlexRow } from '../../Flex/FlexRow/FlexRow.js';
|
|
2
3
|
import { Text } from '../../Text/Text.js';
|
|
3
|
-
import { ItemInfoContainer } from '../ListItem/styled.js';
|
|
4
4
|
|
|
5
5
|
const SelectedOption = ({ placeholder, options, selectionMode }) => {
|
|
6
6
|
var _a, _b, _c;
|
|
7
7
|
if (options.length === 0) {
|
|
8
|
-
return
|
|
9
|
-
React__default.createElement(Text, { variant: "placeholder" }, placeholder)));
|
|
8
|
+
return React__default.createElement(Text, { variant: "placeholder" }, placeholder);
|
|
10
9
|
}
|
|
11
10
|
if (selectionMode === 'single') {
|
|
12
|
-
return (React__default.createElement(
|
|
11
|
+
return (React__default.createElement(FlexRow, { gap: "sm" },
|
|
13
12
|
React__default.createElement(Text, { variant: "placeholder" }, (_a = options[0]) === null || _a === undefined ? undefined : _a.label),
|
|
14
13
|
((_b = options[0]) === null || _b === undefined ? undefined : _b.itemInfoSlot) && React__default.createElement(Text, { variant: "hintText" }, (_c = options[0]) === null || _c === undefined ? undefined : _c.itemInfoSlot)));
|
|
15
14
|
}
|
|
16
|
-
return
|
|
17
|
-
React__default.createElement(Text, { variant: "placeholder" }, options.map((opt) => opt.label).join(', '))));
|
|
15
|
+
return React__default.createElement(Text, { variant: "placeholder" }, options.map((opt) => opt.label).join(', '));
|
|
18
16
|
};
|
|
19
17
|
|
|
20
18
|
export { SelectedOption };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectedOption.js","sources":["../../../../src/components/SelectDropdown/components/SelectedOption.tsx"],"sourcesContent":["import React from 'react';\nimport {
|
|
1
|
+
{"version":3,"file":"SelectedOption.js","sources":["../../../../src/components/SelectDropdown/components/SelectedOption.tsx"],"sourcesContent":["import React from 'react';\nimport { FlexRow } from '../../Flex/FlexRow';\nimport { Text } from '../../Text';\nimport { SelectDropdownItem } from '../types';\n\ntype SelectedOptionProps = {\n placeholder: string;\n options: SelectDropdownItem[];\n selectionMode: 'single' | 'multiple';\n};\n\nexport const SelectedOption = ({ placeholder, options, selectionMode }: SelectedOptionProps) => {\n if (options.length === 0) {\n return <Text variant=\"placeholder\">{placeholder}</Text>;\n }\n\n if (selectionMode === 'single') {\n return (\n <FlexRow gap=\"sm\">\n <Text variant=\"placeholder\">{options[0]?.label}</Text>\n {options[0]?.itemInfoSlot && <Text variant=\"hintText\">{options[0]?.itemInfoSlot}</Text>}\n </FlexRow>\n );\n }\n\n return <Text variant=\"placeholder\">{options.map((opt: any) => opt.label).join(', ')}</Text>;\n};\n"],"names":["React"],"mappings":";;;;AAWO,MAAM,cAAc,GAAG,CAAC,EAAE,WAAW,EAAE,OAAO,EAAE,aAAa,EAAuB,KAAI;;AAC7F,IAAA,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE;QACxB,OAAOA,cAAA,CAAA,aAAA,CAAC,IAAI,EAAC,EAAA,OAAO,EAAC,aAAa,EAAA,EAAE,WAAW,CAAQ;AACxD;IAED,IAAI,aAAa,KAAK,QAAQ,EAAE;AAC9B,QAAA,QACEA,cAAC,CAAA,aAAA,CAAA,OAAO,EAAC,EAAA,GAAG,EAAC,IAAI,EAAA;AACf,YAAAA,cAAA,CAAA,aAAA,CAAC,IAAI,EAAA,EAAC,OAAO,EAAC,aAAa,EAAA,EAAE,CAAA,EAAA,GAAA,OAAO,CAAC,CAAC,CAAC,MAAA,IAAA,IAAA,EAAA,KAAA,SAAA,GAAA,SAAA,GAAA,EAAA,CAAE,KAAK,CAAQ;YACrD,CAAA,CAAA,EAAA,GAAA,OAAO,CAAC,CAAC,CAAC,gDAAE,YAAY,KAAIA,cAAC,CAAA,aAAA,CAAA,IAAI,EAAC,EAAA,OAAO,EAAC,UAAU,EAAA,EAAE,CAAA,EAAA,GAAA,OAAO,CAAC,CAAC,CAAC,MAAA,IAAA,IAAA,EAAA,KAAA,SAAA,GAAA,SAAA,GAAA,EAAA,CAAE,YAAY,CAAQ,CAC/E;AAEb;IAED,OAAOA,cAAA,CAAA,aAAA,CAAC,IAAI,EAAA,EAAC,OAAO,EAAC,aAAa,EAAA,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,GAAQ,KAAK,GAAG,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAQ;AAC7F;;;;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var ___$insertStyle = require('../../_virtual/____insertStyle.cjs');
|
|
4
|
+
|
|
5
|
+
___$insertStyle("._fullStyles_1j3kl_1 {\n /* Set default CSS custom properties */\n --outline-size: var(--sizes-xs);\n --border-color: var(--colors-neutral-ink-lightest);\n --shadow-color: var(--colors-secondary-blue-light);\n}\n._fullStyles_1j3kl_1:disabled, ._fullStyles_1j3kl_1[data-disabled] {\n opacity: 1;\n box-shadow: none;\n background-color: var(--colors-neutral-grey-light);\n cursor: not-allowed;\n}\n._fullStyles_1j3kl_1._compact_1j3kl_13 {\n --outline-size: 2px;\n min-height: var(--sizes-8);\n}\n._fullStyles_1j3kl_1._error_1j3kl_17 {\n --border-color: var(--colors-secondary-red-base);\n --shadow-color: var(--colors-secondary-red-light);\n}\n._fullStyles_1j3kl_1:focus {\n border-color: var(--border-color);\n box-shadow: 0 0 0 var(--outline-size) var(--shadow-color);\n outline: 0;\n}\n._fullStyles_1j3kl_1::placeholder {\n font-family: var(--text-placeholder-font-family);\n font-style: var(--text-placeholder-font-style);\n font-weight: var(--text-placeholder-font-weight);\n font-size: var(--text-placeholder-font-size);\n line-height: var(--text-placeholder-line-height);\n color: var(--text-placeholder-color);\n text-decoration: var(--text-placeholder-text-decoration);\n letter-spacing: var(--text-placeholder-letter-spacing);\n}\n._fullStyles_1j3kl_1:invalid {\n box-shadow: 0 0 0 var(--outline-size) var(--border-color);\n border-color: var(--colors-secondary-red-base);\n}\n\n._base_1j3kl_41 {\n font-family: var(--text-body-font-family);\n font-style: var(--text-body-font-style);\n font-weight: var(--text-body-font-weight);\n font-size: var(--text-body-font-size);\n line-height: var(--text-body-line-height);\n color: var(--text-body-color);\n text-decoration: var(--text-body-text-decoration);\n letter-spacing: var(--text-body-letter-spacing);\n appearance: none;\n box-sizing: border-box;\n background-color: white;\n text-align: left;\n min-height: var(--sizes-10);\n padding-inline: var(--sizes-3);\n border-radius: var(--radius-base);\n border: 1px solid var(--border-color);\n display: flex;\n align-items: center;\n justify-content: flex-start;\n}\n._base_1j3kl_41._inputGroup_1j3kl_62:first-child {\n padding-right: calc(var(--sizes-3) - var(--sizes-1));\n}\n._base_1j3kl_41._inputGroup_1j3kl_62:last-child {\n padding-left: var(--sizes-2);\n}\n._base_1j3kl_41._inputGroup_1j3kl_62:not(:first-child):not(:last-child) {\n padding-inline: var(--sizes-2);\n}");
|
|
6
|
+
var formStyles = {"fullStyles":"_fullStyles_1j3kl_1","compact":"_compact_1j3kl_13","error":"_error_1j3kl_17","base":"_base_1j3kl_41","inputGroup":"_inputGroup_1j3kl_62"};
|
|
7
|
+
|
|
8
|
+
module.exports = formStyles;
|
|
9
|
+
//# sourceMappingURL=form.module.scss.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form.module.scss.cjs","sources":["../../../src/utils/forms/form.module.scss"],"sourcesContent":[".fullStyles {\n /* Set default CSS custom properties */\n --outline-size: var(--sizes-xs);\n --border-color: var(--colors-neutral-ink-lightest);\n --shadow-color: var(--colors-secondary-blue-light);\n\n &:disabled,\n &[data-disabled] {\n opacity: 1;\n box-shadow: none;\n background-color: var(--colors-neutral-grey-light);\n cursor: not-allowed;\n }\n\n &.compact {\n --outline-size: 2px;\n min-height: var(--sizes-8);\n }\n\n &.error {\n --border-color: var(--colors-secondary-red-base);\n --shadow-color: var(--colors-secondary-red-light);\n }\n\n &:focus {\n border-color: var(--border-color);\n box-shadow: 0 0 0 var(--outline-size) var(--shadow-color);\n outline: 0;\n }\n\n &::placeholder {\n font-family: var(--text-placeholder-font-family);\n font-style: var(--text-placeholder-font-style);\n font-weight: var(--text-placeholder-font-weight);\n font-size: var(--text-placeholder-font-size);\n line-height: var(--text-placeholder-line-height);\n color: var(--text-placeholder-color);\n text-decoration: var(--text-placeholder-text-decoration);\n letter-spacing: var(--text-placeholder-letter-spacing);\n }\n\n &:invalid {\n box-shadow: 0 0 0 var(--outline-size) var(--border-color);\n border-color: var(--colors-secondary-red-base);\n }\n}\n\n.base {\n font-family: var(--text-body-font-family);\n font-style: var(--text-body-font-style);\n font-weight: var(--text-body-font-weight);\n font-size: var(--text-body-font-size);\n line-height: var(--text-body-line-height);\n color: var(--text-body-color);\n text-decoration: var(--text-body-text-decoration);\n letter-spacing: var(--text-body-letter-spacing);\n\n appearance: none;\n box-sizing: border-box;\n\n background-color: white;\n text-align: left;\n\n min-height: var(--sizes-10);\n padding-inline: var(--sizes-3);\n border-radius: var(--radius-base);\n border: 1px solid var(--border-color);\n\n display: flex;\n align-items: center;\n justify-content: flex-start;\n\n &.inputGroup {\n &:first-child {\n padding-right: calc(var(--sizes-3) - var(--sizes-1));\n }\n\n &:last-child {\n padding-left: var(--sizes-2);\n }\n\n &:not(:first-child):not(:last-child) {\n padding-inline: var(--sizes-2);\n }\n }\n}\n"],"names":[],"mappings":";;;;AACE,eAAA,CAAA,43EAAA;AACA,iBAAA,CAAA,YAAA,CAAA,qBAAA,CAAA,SAAA,CAAA,mBAAA,CAAA,OAAA,CAAA,iBAAA,CAAA,MAAA,CAAA,gBAAA,CAAA,YAAA,CAAA,sBAAA;;;;"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import insertStyle from '../../_virtual/____insertStyle.js';
|
|
2
|
+
|
|
3
|
+
insertStyle("._fullStyles_1j3kl_1 {\n /* Set default CSS custom properties */\n --outline-size: var(--sizes-xs);\n --border-color: var(--colors-neutral-ink-lightest);\n --shadow-color: var(--colors-secondary-blue-light);\n}\n._fullStyles_1j3kl_1:disabled, ._fullStyles_1j3kl_1[data-disabled] {\n opacity: 1;\n box-shadow: none;\n background-color: var(--colors-neutral-grey-light);\n cursor: not-allowed;\n}\n._fullStyles_1j3kl_1._compact_1j3kl_13 {\n --outline-size: 2px;\n min-height: var(--sizes-8);\n}\n._fullStyles_1j3kl_1._error_1j3kl_17 {\n --border-color: var(--colors-secondary-red-base);\n --shadow-color: var(--colors-secondary-red-light);\n}\n._fullStyles_1j3kl_1:focus {\n border-color: var(--border-color);\n box-shadow: 0 0 0 var(--outline-size) var(--shadow-color);\n outline: 0;\n}\n._fullStyles_1j3kl_1::placeholder {\n font-family: var(--text-placeholder-font-family);\n font-style: var(--text-placeholder-font-style);\n font-weight: var(--text-placeholder-font-weight);\n font-size: var(--text-placeholder-font-size);\n line-height: var(--text-placeholder-line-height);\n color: var(--text-placeholder-color);\n text-decoration: var(--text-placeholder-text-decoration);\n letter-spacing: var(--text-placeholder-letter-spacing);\n}\n._fullStyles_1j3kl_1:invalid {\n box-shadow: 0 0 0 var(--outline-size) var(--border-color);\n border-color: var(--colors-secondary-red-base);\n}\n\n._base_1j3kl_41 {\n font-family: var(--text-body-font-family);\n font-style: var(--text-body-font-style);\n font-weight: var(--text-body-font-weight);\n font-size: var(--text-body-font-size);\n line-height: var(--text-body-line-height);\n color: var(--text-body-color);\n text-decoration: var(--text-body-text-decoration);\n letter-spacing: var(--text-body-letter-spacing);\n appearance: none;\n box-sizing: border-box;\n background-color: white;\n text-align: left;\n min-height: var(--sizes-10);\n padding-inline: var(--sizes-3);\n border-radius: var(--radius-base);\n border: 1px solid var(--border-color);\n display: flex;\n align-items: center;\n justify-content: flex-start;\n}\n._base_1j3kl_41._inputGroup_1j3kl_62:first-child {\n padding-right: calc(var(--sizes-3) - var(--sizes-1));\n}\n._base_1j3kl_41._inputGroup_1j3kl_62:last-child {\n padding-left: var(--sizes-2);\n}\n._base_1j3kl_41._inputGroup_1j3kl_62:not(:first-child):not(:last-child) {\n padding-inline: var(--sizes-2);\n}");
|
|
4
|
+
var formStyles = {"fullStyles":"_fullStyles_1j3kl_1","compact":"_compact_1j3kl_13","error":"_error_1j3kl_17","base":"_base_1j3kl_41","inputGroup":"_inputGroup_1j3kl_62"};
|
|
5
|
+
|
|
6
|
+
export { formStyles as default };
|
|
7
|
+
//# sourceMappingURL=form.module.scss.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form.module.scss.js","sources":["../../../src/utils/forms/form.module.scss"],"sourcesContent":[".fullStyles {\n /* Set default CSS custom properties */\n --outline-size: var(--sizes-xs);\n --border-color: var(--colors-neutral-ink-lightest);\n --shadow-color: var(--colors-secondary-blue-light);\n\n &:disabled,\n &[data-disabled] {\n opacity: 1;\n box-shadow: none;\n background-color: var(--colors-neutral-grey-light);\n cursor: not-allowed;\n }\n\n &.compact {\n --outline-size: 2px;\n min-height: var(--sizes-8);\n }\n\n &.error {\n --border-color: var(--colors-secondary-red-base);\n --shadow-color: var(--colors-secondary-red-light);\n }\n\n &:focus {\n border-color: var(--border-color);\n box-shadow: 0 0 0 var(--outline-size) var(--shadow-color);\n outline: 0;\n }\n\n &::placeholder {\n font-family: var(--text-placeholder-font-family);\n font-style: var(--text-placeholder-font-style);\n font-weight: var(--text-placeholder-font-weight);\n font-size: var(--text-placeholder-font-size);\n line-height: var(--text-placeholder-line-height);\n color: var(--text-placeholder-color);\n text-decoration: var(--text-placeholder-text-decoration);\n letter-spacing: var(--text-placeholder-letter-spacing);\n }\n\n &:invalid {\n box-shadow: 0 0 0 var(--outline-size) var(--border-color);\n border-color: var(--colors-secondary-red-base);\n }\n}\n\n.base {\n font-family: var(--text-body-font-family);\n font-style: var(--text-body-font-style);\n font-weight: var(--text-body-font-weight);\n font-size: var(--text-body-font-size);\n line-height: var(--text-body-line-height);\n color: var(--text-body-color);\n text-decoration: var(--text-body-text-decoration);\n letter-spacing: var(--text-body-letter-spacing);\n\n appearance: none;\n box-sizing: border-box;\n\n background-color: white;\n text-align: left;\n\n min-height: var(--sizes-10);\n padding-inline: var(--sizes-3);\n border-radius: var(--radius-base);\n border: 1px solid var(--border-color);\n\n display: flex;\n align-items: center;\n justify-content: flex-start;\n\n &.inputGroup {\n &:first-child {\n padding-right: calc(var(--sizes-3) - var(--sizes-1));\n }\n\n &:last-child {\n padding-left: var(--sizes-2);\n }\n\n &:not(:first-child):not(:last-child) {\n padding-inline: var(--sizes-2);\n }\n }\n}\n"],"names":["___$insertStyle"],"mappings":";;AACEA,WAAA,CAAA,43EAAA;AACA,iBAAA,CAAA,YAAA,CAAA,qBAAA,CAAA,SAAA,CAAA,mBAAA,CAAA,OAAA,CAAA,iBAAA,CAAA,MAAA,CAAA,gBAAA,CAAA,YAAA,CAAA,sBAAA;;;;"}
|
|
@@ -7,9 +7,26 @@ var variables = require('./variables.cjs');
|
|
|
7
7
|
var utils = require('../../theme/utils.cjs');
|
|
8
8
|
|
|
9
9
|
const { colors, radius, sizes, text } = index.theme;
|
|
10
|
+
/**
|
|
11
|
+
* @deprecated
|
|
12
|
+
* Styles in this file have been converted to CSS modules in src/utils/forms/form.module.scss
|
|
13
|
+
*/
|
|
10
14
|
const inputFocusStyles = ({ hasError }) => styled.css `&:focus{--border-color:${hasError ? colors.secondary.red.base : colors.secondary.blue.base};border-color:var(--border-color);box-shadow:0 0 0 var(--outline-size)var(--shadow-color);outline:0;}`;
|
|
15
|
+
/**
|
|
16
|
+
* @deprecated
|
|
17
|
+
* use css modules instead
|
|
18
|
+
*/
|
|
11
19
|
const inputDisabledStyles = styled.css `&:disabled,&[data-disabled]{opacity:1;box-shadow:none;background-color:${colors.neutral.grey.light};cursor:not-allowed;}`;
|
|
20
|
+
/**
|
|
21
|
+
*
|
|
22
|
+
* @deprecated
|
|
23
|
+
* use css modules instead
|
|
24
|
+
*/
|
|
12
25
|
const inputBaseStyles = ({ compact }) => styled.css `${variables.inputVariableStyles} ${utils.getTextStyles(text.body)} appearance:none;box-sizing:border-box;background-color:white;text-align:left;min-height:${compact ? sizes[8] : sizes[10]};padding-inline:var(--padding);border:1px solid var(--border-color);border-radius:${radius.base};display:flex;align-items:center;justify-content:flex-start;${index$1.InputGroup} > &:first-child{padding-right:calc(var(--padding-right) - ${sizes[1]});}${index$1.InputGroup} > &:last-child{padding-left:${sizes[2]};}${index$1.InputGroup} > &:not(:first-child):not(:last-child){padding-inline:${sizes[2]};}`;
|
|
26
|
+
/**
|
|
27
|
+
* @deprecated
|
|
28
|
+
* use css modules instead from src/utils/forms/form.module.scss
|
|
29
|
+
*/
|
|
13
30
|
const inputFullStyles = styled.css `${inputBaseStyles} ${inputDisabledStyles} ${inputFocusStyles} &::placeholder{${utils.getTextStyles(text.placeholder)}}&:invalid{box-shadow:0 0 0 var(--outline-size)var(--shadow-color);border-color:${colors.secondary.red.base};}`;
|
|
14
31
|
|
|
15
32
|
exports.inputBaseStyles = inputBaseStyles;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inputStyles.cjs","sources":["../../../src/utils/forms/inputStyles.ts"],"sourcesContent":["import { css } from 'styled-components';\nimport { InputGroup } from '../../components/InputGroup';\nimport { FormComponentProps } from '../../components/types';\nimport { getTextStyles, theme } from '../../theme';\nimport { inputVariableStyles } from './variables';\n\nconst { colors, radius, sizes, text } = theme;\n\nexport const inputFocusStyles = ({ hasError }: FormComponentProps) => css`\n &:focus {\n --border-color: ${hasError ? colors.secondary.red.base : colors.secondary.blue.base};\n border-color: var(--border-color);\n box-shadow: 0 0 0 var(--outline-size) var(--shadow-color);\n outline: 0;\n }\n`;\n\nexport const inputDisabledStyles = css`\n &:disabled,\n &[data-disabled] {\n opacity: 1;\n box-shadow: none;\n background-color: ${colors.neutral.grey.light};\n cursor: not-allowed;\n }\n`;\n\nexport const inputBaseStyles = ({ compact }: FormComponentProps) => css`\n ${inputVariableStyles}\n ${getTextStyles(text.body)}\n\n appearance: none;\n box-sizing: border-box;\n\n background-color: white;\n text-align: left;\n\n min-height: ${compact ? sizes[8] : sizes[10]};\n padding-inline: var(--padding);\n border: 1px solid var(--border-color);\n border-radius: ${radius.base};\n\n display: flex;\n align-items: center;\n justify-content: flex-start;\n\n /* When inside an InputGroup, reduce inline padding to bring content closer together */\n ${InputGroup} > &:first-child {\n padding-right: calc(var(--padding-right) - ${sizes[1]});\n }\n\n ${InputGroup} > &:last-child {\n padding-left: ${sizes[2]};\n }\n\n ${InputGroup} > &:not(:first-child):not(:last-child) {\n padding-inline: ${sizes[2]};\n }\n`;\n\nexport const inputFullStyles = css`\n ${inputBaseStyles}\n ${inputDisabledStyles}\n ${inputFocusStyles}\n\n &::placeholder {\n ${getTextStyles(text.placeholder)}\n }\n\n &:invalid {\n box-shadow: 0 0 0 var(--outline-size) var(--shadow-color);\n border-color: ${colors.secondary.red.base};\n }\n`;\n"],"names":["theme","css","inputVariableStyles","getTextStyles","InputGroup"],"mappings":";;;;;;;;AAMA,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAGA,WAAK;
|
|
1
|
+
{"version":3,"file":"inputStyles.cjs","sources":["../../../src/utils/forms/inputStyles.ts"],"sourcesContent":["import { css } from 'styled-components';\nimport { InputGroup } from '../../components/InputGroup';\nimport { FormComponentProps } from '../../components/types';\nimport { getTextStyles, theme } from '../../theme';\nimport { inputVariableStyles } from './variables';\n\nconst { colors, radius, sizes, text } = theme;\n\n/**\n * @deprecated\n * Styles in this file have been converted to CSS modules in src/utils/forms/form.module.scss\n */\nexport const inputFocusStyles = ({ hasError }: FormComponentProps) => css`\n &:focus {\n --border-color: ${hasError ? colors.secondary.red.base : colors.secondary.blue.base};\n border-color: var(--border-color);\n box-shadow: 0 0 0 var(--outline-size) var(--shadow-color);\n outline: 0;\n }\n`;\n/**\n * @deprecated\n * use css modules instead\n */\nexport const inputDisabledStyles = css`\n &:disabled,\n &[data-disabled] {\n opacity: 1;\n box-shadow: none;\n background-color: ${colors.neutral.grey.light};\n cursor: not-allowed;\n }\n`;\n\n/**\n *\n * @deprecated\n * use css modules instead\n */\nexport const inputBaseStyles = ({ compact }: FormComponentProps) => css`\n ${inputVariableStyles}\n ${getTextStyles(text.body)}\n\n appearance: none;\n box-sizing: border-box;\n\n background-color: white;\n text-align: left;\n\n min-height: ${compact ? sizes[8] : sizes[10]};\n padding-inline: var(--padding);\n border: 1px solid var(--border-color);\n border-radius: ${radius.base};\n\n display: flex;\n align-items: center;\n justify-content: flex-start;\n\n /* When inside an InputGroup, reduce inline padding to bring content closer together */\n ${InputGroup} > &:first-child {\n padding-right: calc(var(--padding-right) - ${sizes[1]});\n }\n\n ${InputGroup} > &:last-child {\n padding-left: ${sizes[2]};\n }\n\n ${InputGroup} > &:not(:first-child):not(:last-child) {\n padding-inline: ${sizes[2]};\n }\n`;\n\n/**\n * @deprecated\n * use css modules instead from src/utils/forms/form.module.scss\n */\nexport const inputFullStyles = css`\n ${inputBaseStyles}\n ${inputDisabledStyles}\n ${inputFocusStyles}\n\n &::placeholder {\n ${getTextStyles(text.placeholder)}\n }\n\n &:invalid {\n box-shadow: 0 0 0 var(--outline-size) var(--shadow-color);\n border-color: ${colors.secondary.red.base};\n }\n`;\n"],"names":["theme","css","inputVariableStyles","getTextStyles","InputGroup"],"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entProps } from '../../components/types';
|
|
2
|
+
/**
|
|
3
|
+
* @deprecated
|
|
4
|
+
* Styles in this file have been converted to CSS modules in src/utils/forms/form.module.scss
|
|
5
|
+
*/
|
|
2
6
|
export declare const inputFocusStyles: ({ hasError }: FormComponentProps) => import("styled-components").FlattenSimpleInterpolation;
|
|
7
|
+
/**
|
|
8
|
+
* @deprecated
|
|
9
|
+
* use css modules instead
|
|
10
|
+
*/
|
|
3
11
|
export declare const inputDisabledStyles: import("styled-components").FlattenSimpleInterpolation;
|
|
12
|
+
/**
|
|
13
|
+
*
|
|
14
|
+
* @deprecated
|
|
15
|
+
* use css modules instead
|
|
16
|
+
*/
|
|
4
17
|
export declare const inputBaseStyles: ({ compact }: FormComponentProps) => import("styled-components").FlattenInterpolation<import("styled-components").ThemedStyledProps<FormComponentProps, any>>;
|
|
18
|
+
/**
|
|
19
|
+
* @deprecated
|
|
20
|
+
* use css modules instead from src/utils/forms/form.module.scss
|
|
21
|
+
*/
|
|
5
22
|
export declare const inputFullStyles: import("styled-components").FlattenInterpolation<import("styled-components").ThemedStyledProps<FormComponentProps, any>>;
|
|
@@ -5,9 +5,26 @@ import { inputVariableStyles } from './variables.js';
|
|
|
5
5
|
import { getTextStyles } from '../../theme/utils.js';
|
|
6
6
|
|
|
7
7
|
const { colors, radius, sizes, text } = theme;
|
|
8
|
+
/**
|
|
9
|
+
* @deprecated
|
|
10
|
+
* Styles in this file have been converted to CSS modules in src/utils/forms/form.module.scss
|
|
11
|
+
*/
|
|
8
12
|
const inputFocusStyles = ({ hasError }) => css `&:focus{--border-color:${hasError ? colors.secondary.red.base : colors.secondary.blue.base};border-color:var(--border-color);box-shadow:0 0 0 var(--outline-size)var(--shadow-color);outline:0;}`;
|
|
13
|
+
/**
|
|
14
|
+
* @deprecated
|
|
15
|
+
* use css modules instead
|
|
16
|
+
*/
|
|
9
17
|
const inputDisabledStyles = css `&:disabled,&[data-disabled]{opacity:1;box-shadow:none;background-color:${colors.neutral.grey.light};cursor:not-allowed;}`;
|
|
18
|
+
/**
|
|
19
|
+
*
|
|
20
|
+
* @deprecated
|
|
21
|
+
* use css modules instead
|
|
22
|
+
*/
|
|
10
23
|
const inputBaseStyles = ({ compact }) => css `${inputVariableStyles} ${getTextStyles(text.body)} appearance:none;box-sizing:border-box;background-color:white;text-align:left;min-height:${compact ? sizes[8] : sizes[10]};padding-inline:var(--padding);border:1px solid var(--border-color);border-radius:${radius.base};display:flex;align-items:center;justify-content:flex-start;${InputGroup} > &:first-child{padding-right:calc(var(--padding-right) - ${sizes[1]});}${InputGroup} > &:last-child{padding-left:${sizes[2]};}${InputGroup} > &:not(:first-child):not(:last-child){padding-inline:${sizes[2]};}`;
|
|
24
|
+
/**
|
|
25
|
+
* @deprecated
|
|
26
|
+
* use css modules instead from src/utils/forms/form.module.scss
|
|
27
|
+
*/
|
|
11
28
|
const inputFullStyles = css `${inputBaseStyles} ${inputDisabledStyles} ${inputFocusStyles} &::placeholder{${getTextStyles(text.placeholder)}}&:invalid{box-shadow:0 0 0 var(--outline-size)var(--shadow-color);border-color:${colors.secondary.red.base};}`;
|
|
12
29
|
|
|
13
30
|
export { inputBaseStyles, inputDisabledStyles, inputFocusStyles, inputFullStyles };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inputStyles.js","sources":["../../../src/utils/forms/inputStyles.ts"],"sourcesContent":["import { css } from 'styled-components';\nimport { InputGroup } from '../../components/InputGroup';\nimport { FormComponentProps } from '../../components/types';\nimport { getTextStyles, theme } from '../../theme';\nimport { inputVariableStyles } from './variables';\n\nconst { colors, radius, sizes, text } = theme;\n\nexport const inputFocusStyles = ({ hasError }: FormComponentProps) => css`\n &:focus {\n --border-color: ${hasError ? colors.secondary.red.base : colors.secondary.blue.base};\n border-color: var(--border-color);\n box-shadow: 0 0 0 var(--outline-size) var(--shadow-color);\n outline: 0;\n }\n`;\n\nexport const inputDisabledStyles = css`\n &:disabled,\n &[data-disabled] {\n opacity: 1;\n box-shadow: none;\n background-color: ${colors.neutral.grey.light};\n cursor: not-allowed;\n }\n`;\n\nexport const inputBaseStyles = ({ compact }: FormComponentProps) => css`\n ${inputVariableStyles}\n ${getTextStyles(text.body)}\n\n appearance: none;\n box-sizing: border-box;\n\n background-color: white;\n text-align: left;\n\n min-height: ${compact ? sizes[8] : sizes[10]};\n padding-inline: var(--padding);\n border: 1px solid var(--border-color);\n border-radius: ${radius.base};\n\n display: flex;\n align-items: center;\n justify-content: flex-start;\n\n /* When inside an InputGroup, reduce inline padding to bring content closer together */\n ${InputGroup} > &:first-child {\n padding-right: calc(var(--padding-right) - ${sizes[1]});\n }\n\n ${InputGroup} > &:last-child {\n padding-left: ${sizes[2]};\n }\n\n ${InputGroup} > &:not(:first-child):not(:last-child) {\n padding-inline: ${sizes[2]};\n }\n`;\n\nexport const inputFullStyles = css`\n ${inputBaseStyles}\n ${inputDisabledStyles}\n ${inputFocusStyles}\n\n &::placeholder {\n ${getTextStyles(text.placeholder)}\n }\n\n &:invalid {\n box-shadow: 0 0 0 var(--outline-size) var(--shadow-color);\n border-color: ${colors.secondary.red.base};\n }\n`;\n"],"names":[],"mappings":";;;;;;AAMA,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,KAAK;
|
|
1
|
+
{"version":3,"file":"inputStyles.js","sources":["../../../src/utils/forms/inputStyles.ts"],"sourcesContent":["import { css } from 'styled-components';\nimport { InputGroup } from '../../components/InputGroup';\nimport { FormComponentProps } from '../../components/types';\nimport { getTextStyles, theme } from '../../theme';\nimport { inputVariableStyles } from './variables';\n\nconst { colors, radius, sizes, text } = theme;\n\n/**\n * @deprecated\n * Styles in this file have been converted to CSS modules in src/utils/forms/form.module.scss\n */\nexport const inputFocusStyles = ({ hasError }: FormComponentProps) => css`\n &:focus {\n --border-color: ${hasError ? colors.secondary.red.base : colors.secondary.blue.base};\n border-color: var(--border-color);\n box-shadow: 0 0 0 var(--outline-size) var(--shadow-color);\n outline: 0;\n }\n`;\n/**\n * @deprecated\n * use css modules instead\n */\nexport const inputDisabledStyles = css`\n &:disabled,\n &[data-disabled] {\n opacity: 1;\n box-shadow: none;\n background-color: ${colors.neutral.grey.light};\n cursor: not-allowed;\n }\n`;\n\n/**\n *\n * @deprecated\n * use css modules instead\n */\nexport const inputBaseStyles = ({ compact }: FormComponentProps) => css`\n ${inputVariableStyles}\n ${getTextStyles(text.body)}\n\n appearance: none;\n box-sizing: border-box;\n\n background-color: white;\n text-align: left;\n\n min-height: ${compact ? sizes[8] : sizes[10]};\n padding-inline: var(--padding);\n border: 1px solid var(--border-color);\n border-radius: ${radius.base};\n\n display: flex;\n align-items: center;\n justify-content: flex-start;\n\n /* When inside an InputGroup, reduce inline padding to bring content closer together */\n ${InputGroup} > &:first-child {\n padding-right: calc(var(--padding-right) - ${sizes[1]});\n }\n\n ${InputGroup} > &:last-child {\n padding-left: ${sizes[2]};\n }\n\n ${InputGroup} > &:not(:first-child):not(:last-child) {\n padding-inline: ${sizes[2]};\n }\n`;\n\n/**\n * @deprecated\n * use css modules instead from src/utils/forms/form.module.scss\n */\nexport const inputFullStyles = css`\n ${inputBaseStyles}\n ${inputDisabledStyles}\n ${inputFocusStyles}\n\n &::placeholder {\n ${getTextStyles(text.placeholder)}\n }\n\n &:invalid {\n box-shadow: 0 0 0 var(--outline-size) var(--shadow-color);\n border-color: ${colors.secondary.red.base};\n }\n`;\n"],"names":[],"mappings":";;;;;;AAMA,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,KAAK;AAE7C;;;AAGG;AACI,MAAM,gBAAgB,GAAG,CAAC,EAAE,QAAQ,EAAsB,KAAK,GAAG,CAEnD,CAAA,uBAAA,EAAA,QAAQ,GAAG,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,GAAG,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI;AAMvF;;;AAGG;AACI,MAAM,mBAAmB,GAAG,GAAG,CAKd,CAAA,uEAAA,EAAA,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK;AAKjD;;;;AAIG;AACI,MAAM,eAAe,GAAG,CAAC,EAAE,OAAO,EAAsB,KAAK,GAAG,CACnE,CAAA,EAAA,mBAAmB,CACnB,CAAA,EAAA,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA,yFAAA,EAQZ,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,EAAE,CAAC,CAG3B,kFAAA,EAAA,MAAM,CAAC,IAAI,CAO1B,4DAAA,EAAA,UAAU,CACmC,2DAAA,EAAA,KAAK,CAAC,CAAC,CAAC,CAGrD,GAAA,EAAA,UAAU,CACM,6BAAA,EAAA,KAAK,CAAC,CAAC,CAAC,CAAA,EAAA,EAGxB,UAAU,CAAA,uDAAA,EACQ,KAAK,CAAC,CAAC,CAAC;AAI9B;;;AAGG;AACU,MAAA,eAAe,GAAG,GAAG,CAC9B,CAAA,EAAA,eAAe,CACf,CAAA,EAAA,mBAAmB,CACnB,CAAA,EAAA,gBAAgB,CAGd,gBAAA,EAAA,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC,CAAA,gFAAA,EAKjB,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAA,EAAA;;;;"}
|
|
@@ -4,6 +4,12 @@ var styled = require('styled-components');
|
|
|
4
4
|
var index = require('../../theme/index.cjs');
|
|
5
5
|
|
|
6
6
|
const { colors, sizes } = index.theme;
|
|
7
|
+
/**
|
|
8
|
+
*
|
|
9
|
+
* @deprecated
|
|
10
|
+
* use css modules instead from src/utils/forms/form.module.scss
|
|
11
|
+
*
|
|
12
|
+
*/
|
|
7
13
|
const inputVariableStyles = ({ hasError, compact }) => styled.css `--padding:${sizes[3]};--padding-right:var(--padding);--outline-size:${compact ? '2px' : sizes.xs};--border-color:${hasError ? colors.secondary.red.base : colors.neutral.ink.lightest};--shadow-color:${hasError ? colors.secondary.red.light : colors.secondary.blue.light};`;
|
|
8
14
|
|
|
9
15
|
exports.inputVariableStyles = inputVariableStyles;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"variables.cjs","sources":["../../../src/utils/forms/variables.ts"],"sourcesContent":["import { css } from 'styled-components';\nimport { FormComponentProps } from '../../components/types';\nimport { theme } from '../../theme';\n\nconst { colors, sizes } = theme;\n\nexport const inputVariableStyles = ({ hasError, compact }: FormComponentProps) => css`\n --padding: ${sizes[3]};\n --padding-right: var(--padding);\n --outline-size: ${compact ? '2px' : sizes.xs};\n --border-color: ${hasError ? colors.secondary.red.base : colors.neutral.ink.lightest};\n --shadow-color: ${hasError ? colors.secondary.red.light : colors.secondary.blue.light};\n`;\n"],"names":["theme","css"],"mappings":";;;;;AAIA,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAGA,WAAK;
|
|
1
|
+
{"version":3,"file":"variables.cjs","sources":["../../../src/utils/forms/variables.ts"],"sourcesContent":["import { css } from 'styled-components';\nimport { FormComponentProps } from '../../components/types';\nimport { theme } from '../../theme';\n\nconst { colors, sizes } = theme;\n\n/**\n *\n * @deprecated\n * use css modules instead from src/utils/forms/form.module.scss\n *\n */\nexport const inputVariableStyles = ({ hasError, compact }: FormComponentProps) => css`\n --padding: ${sizes[3]};\n --padding-right: var(--padding);\n --outline-size: ${compact ? '2px' : sizes.xs};\n --border-color: ${hasError ? colors.secondary.red.base : colors.neutral.ink.lightest};\n --shadow-color: ${hasError ? colors.secondary.red.light : colors.secondary.blue.light};\n`;\n"],"names":["theme","css"],"mappings":";;;;;AAIA,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAGA,WAAK;AAE/B;;;;;AAKG;AACU,MAAA,mBAAmB,GAAG,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAsB,KAAKC,UAAG,CAAA,CAAA,UAAA,EACtE,KAAK,CAAC,CAAC,CAAC,CAAA,+CAAA,EAEH,OAAO,GAAG,KAAK,GAAG,KAAK,CAAC,EAAE,CAC1B,gBAAA,EAAA,QAAQ,GAAG,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAClE,gBAAA,EAAA,QAAQ,GAAG,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,GAAG,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK;;;;"}
|
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
import { FormComponentProps } from '../../components/types';
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* @deprecated
|
|
5
|
+
* use css modules instead from src/utils/forms/form.module.scss
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
2
8
|
export declare const inputVariableStyles: ({ hasError, compact }: FormComponentProps) => import("styled-components").FlattenSimpleInterpolation;
|
|
@@ -2,6 +2,12 @@ import { css } from 'styled-components';
|
|
|
2
2
|
import { theme } from '../../theme/index.js';
|
|
3
3
|
|
|
4
4
|
const { colors, sizes } = theme;
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
* @deprecated
|
|
8
|
+
* use css modules instead from src/utils/forms/form.module.scss
|
|
9
|
+
*
|
|
10
|
+
*/
|
|
5
11
|
const inputVariableStyles = ({ hasError, compact }) => css `--padding:${sizes[3]};--padding-right:var(--padding);--outline-size:${compact ? '2px' : sizes.xs};--border-color:${hasError ? colors.secondary.red.base : colors.neutral.ink.lightest};--shadow-color:${hasError ? colors.secondary.red.light : colors.secondary.blue.light};`;
|
|
6
12
|
|
|
7
13
|
export { inputVariableStyles };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"variables.js","sources":["../../../src/utils/forms/variables.ts"],"sourcesContent":["import { css } from 'styled-components';\nimport { FormComponentProps } from '../../components/types';\nimport { theme } from '../../theme';\n\nconst { colors, sizes } = theme;\n\nexport const inputVariableStyles = ({ hasError, compact }: FormComponentProps) => css`\n --padding: ${sizes[3]};\n --padding-right: var(--padding);\n --outline-size: ${compact ? '2px' : sizes.xs};\n --border-color: ${hasError ? colors.secondary.red.base : colors.neutral.ink.lightest};\n --shadow-color: ${hasError ? colors.secondary.red.light : colors.secondary.blue.light};\n`;\n"],"names":[],"mappings":";;;AAIA,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK;
|
|
1
|
+
{"version":3,"file":"variables.js","sources":["../../../src/utils/forms/variables.ts"],"sourcesContent":["import { css } from 'styled-components';\nimport { FormComponentProps } from '../../components/types';\nimport { theme } from '../../theme';\n\nconst { colors, sizes } = theme;\n\n/**\n *\n * @deprecated\n * use css modules instead from src/utils/forms/form.module.scss\n *\n */\nexport const inputVariableStyles = ({ hasError, compact }: FormComponentProps) => css`\n --padding: ${sizes[3]};\n --padding-right: var(--padding);\n --outline-size: ${compact ? '2px' : sizes.xs};\n --border-color: ${hasError ? colors.secondary.red.base : colors.neutral.ink.lightest};\n --shadow-color: ${hasError ? colors.secondary.red.light : colors.secondary.blue.light};\n`;\n"],"names":[],"mappings":";;;AAIA,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK;AAE/B;;;;;AAKG;AACU,MAAA,mBAAmB,GAAG,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAsB,KAAK,GAAG,CAAA,CAAA,UAAA,EACtE,KAAK,CAAC,CAAC,CAAC,CAAA,+CAAA,EAEH,OAAO,GAAG,KAAK,GAAG,KAAK,CAAC,EAAE,CAC1B,gBAAA,EAAA,QAAQ,GAAG,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAClE,gBAAA,EAAA,QAAQ,GAAG,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,GAAG,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK;;;;"}
|
package/package.json
CHANGED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var React = require('react');
|
|
4
|
-
var ActiveCheckboxIcon = require('../../../../icons/custom/components/ActiveCheckboxIcon.cjs');
|
|
5
|
-
var InactiveCheckboxIcon = require('../../../../icons/custom/components/InactiveCheckboxIcon.cjs');
|
|
6
|
-
|
|
7
|
-
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
8
|
-
|
|
9
|
-
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
10
|
-
|
|
11
|
-
const CheckboxIndicator = ({ checked, ...otherProps }) => {
|
|
12
|
-
if (checked)
|
|
13
|
-
return React__default.default.createElement(ActiveCheckboxIcon.ActiveCheckboxIcon, { ...otherProps });
|
|
14
|
-
return React__default.default.createElement(InactiveCheckboxIcon.InactiveCheckboxIcon, { ...otherProps });
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
exports.CheckboxIndicator = CheckboxIndicator;
|
|
18
|
-
//# sourceMappingURL=CheckboxIndicator.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxIndicator.cjs","sources":["../../../../../src/components/SelectDropdown/ListItem/components/CheckboxIndicator.tsx"],"sourcesContent":["import React from 'react';\nimport { ActiveCheckboxIcon, InactiveCheckboxIcon } from '../../../../icons';\n\nexport const CheckboxIndicator = ({ checked, ...otherProps }: any) => {\n if (checked) return <ActiveCheckboxIcon {...otherProps} />;\n\n return <InactiveCheckboxIcon {...otherProps} />;\n};\n"],"names":["React","ActiveCheckboxIcon","InactiveCheckboxIcon"],"mappings":";;;;;;;;;;AAGO,MAAM,iBAAiB,GAAG,CAAC,EAAE,OAAO,EAAE,GAAG,UAAU,EAAO,KAAI;AACnE,IAAA,IAAI,OAAO;AAAE,QAAA,OAAOA,sBAAC,CAAA,aAAA,CAAAC,qCAAkB,EAAK,EAAA,GAAA,UAAU,GAAI;AAE1D,IAAA,OAAOD,sBAAC,CAAA,aAAA,CAAAE,yCAAoB,EAAK,EAAA,GAAA,UAAU,GAAI;AACjD;;;;"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React__default from 'react';
|
|
2
|
-
import { ActiveCheckboxIcon } from '../../../../icons/custom/components/ActiveCheckboxIcon.js';
|
|
3
|
-
import { InactiveCheckboxIcon } from '../../../../icons/custom/components/InactiveCheckboxIcon.js';
|
|
4
|
-
|
|
5
|
-
const CheckboxIndicator = ({ checked, ...otherProps }) => {
|
|
6
|
-
if (checked)
|
|
7
|
-
return React__default.createElement(ActiveCheckboxIcon, { ...otherProps });
|
|
8
|
-
return React__default.createElement(InactiveCheckboxIcon, { ...otherProps });
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export { CheckboxIndicator };
|
|
12
|
-
//# sourceMappingURL=CheckboxIndicator.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxIndicator.js","sources":["../../../../../src/components/SelectDropdown/ListItem/components/CheckboxIndicator.tsx"],"sourcesContent":["import React from 'react';\nimport { ActiveCheckboxIcon, InactiveCheckboxIcon } from '../../../../icons';\n\nexport const CheckboxIndicator = ({ checked, ...otherProps }: any) => {\n if (checked) return <ActiveCheckboxIcon {...otherProps} />;\n\n return <InactiveCheckboxIcon {...otherProps} />;\n};\n"],"names":["React"],"mappings":";;;;AAGO,MAAM,iBAAiB,GAAG,CAAC,EAAE,OAAO,EAAE,GAAG,UAAU,EAAO,KAAI;AACnE,IAAA,IAAI,OAAO;AAAE,QAAA,OAAOA,cAAC,CAAA,aAAA,CAAA,kBAAkB,EAAK,EAAA,GAAA,UAAU,GAAI;AAE1D,IAAA,OAAOA,cAAC,CAAA,aAAA,CAAA,oBAAoB,EAAK,EAAA,GAAA,UAAU,GAAI;AACjD;;;;"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var React = require('react');
|
|
4
|
-
var ActiveRadioIcon = require('../../../../icons/custom/components/ActiveRadioIcon.cjs');
|
|
5
|
-
var InactiveRadioIcon = require('../../../../icons/custom/components/InactiveRadioIcon.cjs');
|
|
6
|
-
|
|
7
|
-
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
8
|
-
|
|
9
|
-
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
10
|
-
|
|
11
|
-
const RadioIndicator = ({ checked, ...otherProps }) => {
|
|
12
|
-
if (checked)
|
|
13
|
-
return React__default.default.createElement(ActiveRadioIcon.ActiveRadioIcon, { ...otherProps });
|
|
14
|
-
return React__default.default.createElement(InactiveRadioIcon.InactiveRadioIcon, { ...otherProps });
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
exports.RadioIndicator = RadioIndicator;
|
|
18
|
-
//# sourceMappingURL=RadioIndicator.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RadioIndicator.cjs","sources":["../../../../../src/components/SelectDropdown/ListItem/components/RadioIndicator.tsx"],"sourcesContent":["import React from 'react';\nimport { ActiveRadioIcon, InactiveRadioIcon } from '../../../../icons';\n\nexport const RadioIndicator = ({ checked, ...otherProps }: any) => {\n if (checked) return <ActiveRadioIcon {...otherProps} />;\n\n return <InactiveRadioIcon {...otherProps} />;\n};\n"],"names":["React","ActiveRadioIcon","InactiveRadioIcon"],"mappings":";;;;;;;;;;AAGO,MAAM,cAAc,GAAG,CAAC,EAAE,OAAO,EAAE,GAAG,UAAU,EAAO,KAAI;AAChE,IAAA,IAAI,OAAO;AAAE,QAAA,OAAOA,sBAAC,CAAA,aAAA,CAAAC,+BAAe,EAAK,EAAA,GAAA,UAAU,GAAI;AAEvD,IAAA,OAAOD,sBAAC,CAAA,aAAA,CAAAE,mCAAiB,EAAK,EAAA,GAAA,UAAU,GAAI;AAC9C;;;;"}
|