@veeqo/ui 12.3.4 → 12.4.0-beta-1

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.
Files changed (25) hide show
  1. package/dist/components/SelectDropdown/SelectDropdown.cjs +4 -6
  2. package/dist/components/SelectDropdown/SelectDropdown.cjs.map +1 -1
  3. package/dist/components/SelectDropdown/SelectDropdown.js +4 -6
  4. package/dist/components/SelectDropdown/SelectDropdown.js.map +1 -1
  5. package/dist/components/SelectDropdown/components/GridItem/GridItem.cjs +32 -0
  6. package/dist/components/SelectDropdown/components/GridItem/GridItem.cjs.map +1 -0
  7. package/dist/components/SelectDropdown/components/GridItem/GridItem.js +26 -0
  8. package/dist/components/SelectDropdown/components/GridItem/GridItem.js.map +1 -0
  9. package/dist/components/SelectDropdown/components/OptionsContainers/GridList.cjs +18 -0
  10. package/dist/components/SelectDropdown/components/OptionsContainers/GridList.cjs.map +1 -0
  11. package/dist/components/SelectDropdown/components/OptionsContainers/GridList.d.ts +3 -0
  12. package/dist/components/SelectDropdown/components/OptionsContainers/GridList.js +12 -0
  13. package/dist/components/SelectDropdown/components/OptionsContainers/GridList.js.map +1 -0
  14. package/dist/components/SelectDropdown/components/OptionsContainers/ListBox.cjs +19 -0
  15. package/dist/components/SelectDropdown/components/OptionsContainers/ListBox.cjs.map +1 -0
  16. package/dist/components/SelectDropdown/components/OptionsContainers/ListBox.d.ts +3 -0
  17. package/dist/components/SelectDropdown/components/OptionsContainers/ListBox.js +13 -0
  18. package/dist/components/SelectDropdown/components/OptionsContainers/ListBox.js.map +1 -0
  19. package/dist/components/SelectDropdown/components/OptionsContainers/OptionsContainer.module.scss.cjs +9 -0
  20. package/dist/components/SelectDropdown/components/OptionsContainers/OptionsContainer.module.scss.cjs.map +1 -0
  21. package/dist/components/SelectDropdown/components/OptionsContainers/OptionsContainer.module.scss.js +7 -0
  22. package/dist/components/SelectDropdown/components/OptionsContainers/OptionsContainer.module.scss.js.map +1 -0
  23. package/dist/components/SelectDropdown/components/OptionsContainers/types.d.ts +25 -0
  24. package/dist/components/SelectDropdown/types.d.ts +2 -1
  25. package/package.json +1 -1
@@ -1,31 +1,29 @@
1
1
  'use strict';
2
2
 
3
3
  var React = require('react');
4
- var reactAriaComponents = require('react-aria-components');
5
4
  var buildClassnames = require('../../utils/buildClassnames.cjs');
6
5
  require('uid/secure');
7
6
  var SelectedOption = require('./components/SelectedOption.cjs');
8
7
  var utils = require('./utils.cjs');
9
- var ListItemSection = require('./components/ListItemSection/ListItemSection.cjs');
10
- var ListItem = require('./components/ListItem/ListItem.cjs');
11
- var SelectDropdownState = require('./components/SelectDropdownState.cjs');
12
8
  var Dropdown = require('../Dropdown/Dropdown.cjs');
13
9
  var Search = require('../Search/Search.cjs');
14
10
  var Button = require('../Button/Button.cjs');
15
11
  var SelectDropdown_module = require('./SelectDropdown.module.scss.cjs');
16
12
  var form_module = require('../../utils/forms/form.module.scss.cjs');
13
+ var ListBox = require('./components/OptionsContainers/ListBox.cjs');
14
+ var GridList = require('./components/OptionsContainers/GridList.cjs');
17
15
 
18
16
  function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
19
17
 
20
18
  var React__default = /*#__PURE__*/_interopDefaultCompat(React);
21
19
 
22
- /* eslint-disable react/destructuring-assignment */
23
20
  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 }) => {
24
21
  const hasSection = options.flatMap((option) => option).some((item) => 'items' in item);
25
22
  const classNames = utils.generateClassNames(className);
26
23
  const [isSelectOpen, setIsSelectOpen] = React.useState(false);
27
24
  const selectedValues = utils.getSelectedValues(options, hasSection, value);
28
25
  const selectionMode = multiple ? 'multiple' : 'single';
26
+ const hasRowAction = options.some((option) => 'onClickRowAction' in option && option.onClickRowAction);
29
27
  const onSelectionChange = React.useCallback((keys) => {
30
28
  const selectedKeys = Array.from(keys);
31
29
  const newSelectedValues = utils.getSelectedValues(options, hasSection, selectedKeys);
@@ -49,7 +47,7 @@ const SelectDropdown = ({ id, className, placeholder = 'Select item', multiple =
49
47
  onSearchChange && (React__default.default.createElement(React__default.default.Fragment, null,
50
48
  React__default.default.createElement(Search.Search, { className: SelectDropdown_module.search, value: searchValue, onChange: onSearchChange }),
51
49
  React__default.default.createElement("hr", { className: SelectDropdown_module.separator }))),
52
- React__default.default.createElement(reactAriaComponents.ListBox, { className: buildClassnames.buildClassnames([classNames === null || classNames === undefined ? undefined : classNames.optionsContainer, SelectDropdown_module.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.default.createElement(SelectDropdownState.SelectDropdownState, { isLoading: isLoading, emptyStateSlot: emptyStateSlot })), ...otherProps }, (item) => hasSection ? (React__default.default.createElement(ListItemSection.ListItemSection, { ...item })) : (React__default.default.createElement(ListItem.ListItem, { ...item }))), actions === null || actions === undefined ? undefined :
50
+ hasRowAction ? (React__default.default.createElement(GridList.GridList, { id: id, className: classNames === null || classNames === undefined ? undefined : classNames.optionsContainer, ariaLabelledBy: ariaLabelledBy, ariaDescribedBy: ariaDescribedBy, selectionMode: selectionMode, options: options, onSelectionChange: onSelectionChange, selectedValues: selectedValues.filter((selectedValue) => 'onClickRowAction' in selectedValue), isLoading: isLoading, emptyStateSlot: emptyStateSlot, ...otherProps })) : (React__default.default.createElement(ListBox.ListBox, { id: id, className: classNames === null || classNames === undefined ? undefined : classNames.optionsContainer, ariaLabelledBy: ariaLabelledBy, ariaDescribedBy: ariaDescribedBy, selectionMode: selectionMode, options: options, onSelectionChange: onSelectionChange, selectedValues: selectedValues, isLoading: isLoading, emptyStateSlot: emptyStateSlot, hasSection: hasSection, ...otherProps })), actions === null || actions === undefined ? undefined :
53
51
  actions.map(({ label, ...actionProps }) => (React__default.default.createElement(React.Fragment, { key: label },
54
52
  React__default.default.createElement("hr", { className: SelectDropdown_module.separator, key: `seperator-${label}` }),
55
53
  React__default.default.createElement(Button.Button, { className: SelectDropdown_module.ctaButton, variant: "flat", key: label, ...actionProps }))))));
@@ -1 +1 @@
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 {\n ListItemSection,\n ListItemSectionProps,\n} from './components/ListItemSection/ListItemSection';\nimport { ListItem } from './components/ListItem';\nimport { ListItemProps } from './components/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;AAqBa,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,GAAGA,wBAAkB,CAAC,SAAS,CAAC;IAEhD,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAGC,cAAQ,CAAC,KAAK,CAAC;IAEvD,MAAM,cAAc,GAAGC,uBAAiB,CAAC,OAAO,EAAE,UAAU,EAAE,KAAK,CAAC;IACpE,MAAM,aAAa,GAAG,QAAQ,GAAG,UAAU,GAAG,QAAQ;AAEtD,IAAA,MAAM,iBAAiB,GAAGC,iBAAW,CACnC,CAAC,IAAe,KAAI;QAClB,MAAM,YAAY,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;QACrC,MAAM,iBAAiB,GAAGD,uBAAiB,CAAC,OAAO,EAAE,UAAU,EAAE,YAAY,CAAC;AAE9E,QAAA,IAAI,QAAQ,EAAE;YACX,QAAkD,CAAC,iBAAiB,CAAC;AACvE;AAAM,aAAA;AACJ,Y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AAE,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,GAAG,WAAW,EAAE,MACtCV,sBAAA,CAAA,aAAA,CAACW,cAAQ,EAAC,EAAA,GAAG,EAAE,KAAK,EAAA;YAClBX,sBAAI,CAAA,aAAA,CAAA,IAAA,EAAA,EAAA,SAAS,EAAEG,qBAAM,CAAC,SAAS,EAAE,GAAG,EAAE,CAAA,UAAA,EAAa,KAAK,CAAA,CAAE,EAAI,CAAA;YAC9DH,sBAAC,CAAA,aAAA,CAAAY,aAAM,IAAC,SAAS,EAAET,qBAAM,CAAC,SAAS,EAAE,OAAO,EAAC,MAAM,EAAC,GAAG,EAAE,KAAK,EAAA,GAAM,WAAW,EAAA,CAAI,CAC1E,CACZ,CAAC,CACO;AAEf;;;;"}
1
+ {"version":3,"file":"SelectDropdown.cjs","sources":["../../../src/components/SelectDropdown/SelectDropdown.tsx"],"sourcesContent":["import React, { Fragment, useCallback, useState } from 'react';\nimport { 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 { GridItemProps } from './components/GridItem/types';\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';\nimport { ListBox } from './components/OptionsContainers/ListBox';\nimport { GridList } from './components/OptionsContainers/GridList';\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 const hasRowAction = options.some(\n (option) => 'onClickRowAction' in option && option.onClickRowAction,\n );\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 {hasRowAction ? (\n <GridList\n id={id}\n className={classNames?.optionsContainer}\n ariaLabelledBy={ariaLabelledBy}\n ariaDescribedBy={ariaDescribedBy}\n selectionMode={selectionMode}\n options={options as GridItemProps[]}\n onSelectionChange={onSelectionChange}\n selectedValues={selectedValues.filter(\n (selectedValue): selectedValue is GridItemProps => 'onClickRowAction' in selectedValue,\n )}\n isLoading={isLoading}\n emptyStateSlot={emptyStateSlot}\n {...otherProps}\n />\n ) : (\n <ListBox\n id={id}\n className={classNames?.optionsContainer}\n ariaLabelledBy={ariaLabelledBy}\n ariaDescribedBy={ariaDescribedBy}\n selectionMode={selectionMode}\n options={options}\n onSelectionChange={onSelectionChange}\n selectedValues={selectedValues}\n isLoading={isLoading}\n emptyStateSlot={emptyStateSlot}\n hasSection={hasSection}\n {...otherProps}\n />\n )}\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","GridList","ListBox","Fragment","Button"],"mappings":";;;;;;;;;;;;;;;;;;;AAgBa,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,GAAGA,wBAAkB,CAAC,SAAS,CAAC;IAEhD,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAGC,cAAQ,CAAC,KAAK,CAAC;IAEvD,MAAM,cAAc,GAAGC,uBAAiB,CAAC,OAAO,EAAE,UAAU,EAAE,KAAK,CAAC;IACpE,MAAM,aAAa,GAAG,QAAQ,GAAG,UAAU,GAAG,QAAQ;AACtD,IAAA,MAAM,YAAY,GAAG,OAAO,CAAC,IAAI,CAC/B,CAAC,MAAM,KA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aAAa,EAAE,aAAa,EAC5B,OAAO,EAAE,OAAO,EAChB,iBAAiB,EAAE,iBAAiB,EACpC,cAAc,EAAE,cAAc,EAC9B,SAAS,EAAE,SAAS,EACpB,cAAc,EAAE,cAAc,EAC9B,UAAU,EAAE,UAAU,EAClB,GAAA,UAAU,EACd,CAAA,CACH,EACA,OAAO,aAAP,OAAO,KAAA,SAAA,GAAA,SAAA;AAAP,QAAA,OAAO,CAAE,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,GAAG,WAAW,EAAE,MACtCR,sBAAA,CAAA,aAAA,CAACS,cAAQ,EAAC,EAAA,GAAG,EAAE,KAAK,EAAA;YAClBT,sBAAI,CAAA,aAAA,CAAA,IAAA,EAAA,EAAA,SAAS,EAAEG,qBAAM,CAAC,SAAS,EAAE,GAAG,EAAE,CAAA,UAAA,EAAa,KAAK,CAAA,CAAE,EAAI,CAAA;YAC9DH,sBAAC,CAAA,aAAA,CAAAU,aAAM,IAAC,SAAS,EAAEP,qBAAM,CAAC,SAAS,EAAE,OAAO,EAAC,MAAM,EAAC,GAAG,EAAE,KAAK,EAAA,GAAM,WAAW,EAAA,CAAI,CAC1E,CACZ,CAAC,CACO;AAEf;;;;"}
@@ -1,25 +1,23 @@
1
1
  import React__default, { useState, useCallback, Fragment } from 'react';
2
- import { ListBox } from 'react-aria-components';
3
2
  import { buildClassnames } from '../../utils/buildClassnames.js';
4
3
  import 'uid/secure';
5
4
  import { SelectedOption } from './components/SelectedOption.js';
6
5
  import { getSelectedValues, generateClassNames } from './utils.js';
7
- import { ListItemSection } from './components/ListItemSection/ListItemSection.js';
8
- import { ListItem } from './components/ListItem/ListItem.js';
9
- import { SelectDropdownState } from './components/SelectDropdownState.js';
10
6
  import { Dropdown } from '../Dropdown/Dropdown.js';
11
7
  import { Search } from '../Search/Search.js';
12
8
  import { Button } from '../Button/Button.js';
13
9
  import styles from './SelectDropdown.module.scss.js';
14
10
  import formStyles from '../../utils/forms/form.module.scss.js';
11
+ import { ListBox } from './components/OptionsContainers/ListBox.js';
12
+ import { GridList } from './components/OptionsContainers/GridList.js';
15
13
 
16
- /* eslint-disable react/destructuring-assignment */
17
14
  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 }) => {
18
15
  const hasSection = options.flatMap((option) => option).some((item) => 'items' in item);
19
16
  const classNames = generateClassNames(className);
20
17
  const [isSelectOpen, setIsSelectOpen] = useState(false);
21
18
  const selectedValues = getSelectedValues(options, hasSection, value);
22
19
  const selectionMode = multiple ? 'multiple' : 'single';
20
+ const hasRowAction = options.some((option) => 'onClickRowAction' in option && option.onClickRowAction);
23
21
  const onSelectionChange = useCallback((keys) => {
24
22
  const selectedKeys = Array.from(keys);
25
23
  const newSelectedValues = getSelectedValues(options, hasSection, selectedKeys);
@@ -43,7 +41,7 @@ const SelectDropdown = ({ id, className, placeholder = 'Select item', multiple =
43
41
  onSearchChange && (React__default.createElement(React__default.Fragment, null,
44
42
  React__default.createElement(Search, { className: styles.search, value: searchValue, onChange: onSearchChange }),
45
43
  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 :
44
+ hasRowAction ? (React__default.createElement(GridList, { id: id, className: classNames === null || classNames === undefined ? undefined : classNames.optionsContainer, ariaLabelledBy: ariaLabelledBy, ariaDescribedBy: ariaDescribedBy, selectionMode: selectionMode, options: options, onSelectionChange: onSelectionChange, selectedValues: selectedValues.filter((selectedValue) => 'onClickRowAction' in selectedValue), isLoading: isLoading, emptyStateSlot: emptyStateSlot, ...otherProps })) : (React__default.createElement(ListBox, { id: id, className: classNames === null || classNames === undefined ? undefined : classNames.optionsContainer, ariaLabelledBy: ariaLabelledBy, ariaDescribedBy: ariaDescribedBy, selectionMode: selectionMode, options: options, onSelectionChange: onSelectionChange, selectedValues: selectedValues, isLoading: isLoading, emptyStateSlot: emptyStateSlot, hasSection: hasSection, ...otherProps })), actions === null || actions === undefined ? undefined :
47
45
  actions.map(({ label, ...actionProps }) => (React__default.createElement(Fragment, { key: label },
48
46
  React__default.createElement("hr", { className: styles.separator, key: `seperator-${label}` }),
49
47
  React__default.createElement(Button, { className: styles.ctaButton, variant: "flat", key: label, ...actionProps }))))));
@@ -1 +1 @@
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 {\n ListItemSection,\n ListItemSectionProps,\n} from './components/ListItemSection/ListItemSection';\nimport { ListItem } from './components/ListItem';\nimport { ListItemProps } from './components/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;AAqBa,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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A6B,EAAI,CAAA,KAEvDA,cAAC,CAAA,aAAA,CAAA,QAAQ,EAAM,EAAA,GAAA,IAAsB,EAAI,CAAA,CAC1C,CAEK,EACT,OAAO,KAAA,IAAA,IAAP,OAAO,KAAA,SAAA,GAAA,SAAA;AAAP,QAAA,OAAO,CAAE,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,GAAG,WAAW,EAAE,MACtCA,cAAA,CAAA,aAAA,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;;;;"}
1
+ {"version":3,"file":"SelectDropdown.js","sources":["../../../src/components/SelectDropdown/SelectDropdown.tsx"],"sourcesContent":["import React, { Fragment, useCallback, useState } from 'react';\nimport { 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 { GridItemProps } from './components/GridItem/types';\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';\nimport { ListBox } from './components/OptionsContainers/ListBox';\nimport { GridList } from './components/OptionsContainers/GridList';\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 const hasRowAction = options.some(\n (option) => 'onClickRowAction' in option && option.onClickRowAction,\n );\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 {hasRowAction ? (\n <GridList\n id={id}\n className={classNames?.optionsContainer}\n ariaLabelledBy={ariaLabelledBy}\n ariaDescribedBy={ariaDescribedBy}\n selectionMode={selectionMode}\n options={options as GridItemProps[]}\n onSelectionChange={onSelectionChange}\n selectedValues={selectedValues.filter(\n (selectedValue): selectedValue is GridItemProps => 'onClickRowAction' in selectedValue,\n )}\n isLoading={isLoading}\n emptyStateSlot={emptyStateSlot}\n {...otherProps}\n />\n ) : (\n <ListBox\n id={id}\n className={classNames?.optionsContainer}\n ariaLabelledBy={ariaLabelledBy}\n ariaDescribedBy={ariaDescribedBy}\n selectionMode={selectionMode}\n options={options}\n onSelectionChange={onSelectionChange}\n selectedValues={selectedValues}\n isLoading={isLoading}\n emptyStateSlot={emptyStateSlot}\n hasSection={hasSection}\n {...otherProps}\n />\n )}\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":";;;;;;;;;;;;;AAgBa,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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cAAc,EAC9B,eAAe,EAAE,eAAe,EAChC,aAAa,EAAE,aAAa,EAC5B,OAAO,EAAE,OAAO,EAChB,iBAAiB,EAAE,iBAAiB,EACpC,cAAc,EAAE,cAAc,EAC9B,SAAS,EAAE,SAAS,EACpB,cAAc,EAAE,cAAc,EAC9B,UAAU,EAAE,UAAU,EAClB,GAAA,UAAU,EACd,CAAA,CACH,EACA,OAAO,aAAP,OAAO,KAAA,SAAA,GAAA,SAAA;AAAP,QAAA,OAAO,CAAE,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,GAAG,WAAW,EAAE,MACtCA,cAAA,CAAA,aAAA,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,32 @@
1
+ 'use strict';
2
+
3
+ var React = require('react');
4
+ var reactAriaComponents = require('react-aria-components');
5
+ var FlexRow = require('../../../Flex/FlexRow/FlexRow.cjs');
6
+ var Button = require('../../../Button/Button.cjs');
7
+ var RightArrowIcon = require('../../../../icons/design-system/components/RightArrowIcon.cjs');
8
+ var ItemContent = require('../ItemContent/ItemContent.cjs');
9
+ var buildClassnames = require('../../../../utils/buildClassnames.cjs');
10
+ require('uid/secure');
11
+ require('../../../../hooks/useFocusVisible.cjs');
12
+ var useId = require('../../../../hooks/useId.cjs');
13
+ require('lodash.throttle');
14
+ var item_module = require('../item.module.scss.cjs');
15
+
16
+ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
17
+
18
+ var React__default = /*#__PURE__*/_interopDefaultCompat(React);
19
+
20
+ function GridItem({ id, label, href, appearance = 'primary', className, onClickRowAction, rowActionAriaLabel, isRowActionDisabled = false, ...props }) {
21
+ const idComputed = useId.useId({ id, prefix: 'grid-item' });
22
+ return (React__default.default.createElement(reactAriaComponents.GridListItem, { id: idComputed, textValue: label, href: href, className: buildClassnames.buildClassnames([item_module.item, item_module[`appearance-${appearance}`], className]), ...props }, ({ selectionMode, allowsDragging, isSelected }) => (React__default.default.createElement(FlexRow.FlexRow, { flexWrap: "nowrap", justifyContent: "space-between" },
23
+ React__default.default.createElement(ItemContent.ItemContent, { selectionMode: selectionMode, allowsDragging: allowsDragging, isSelected: isSelected, label: label, isLink: Boolean(href), appearance: appearance, itemType: "grid", ...props }),
24
+ onClickRowAction && (
25
+ /** onPointerDown event prevents click events from bubbling up to the GridListItem.
26
+ * onKeyDown event prevents keyboard events from bubbling up to the GridListItem.
27
+ */
28
+ React__default.default.createElement(Button.Button, { onClick: onClickRowAction, disabled: isRowActionDisabled, onPointerDown: (event) => event.stopPropagation(), onKeyDown: (event) => event.stopPropagation(), iconSlot: React__default.default.createElement(RightArrowIcon.ReactComponent, null), "aria-label": rowActionAriaLabel || `${label} row action` }))))));
29
+ }
30
+
31
+ exports.GridItem = GridItem;
32
+ //# sourceMappingURL=GridItem.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GridItem.cjs","sources":["../../../../../src/components/SelectDropdown/components/GridItem/GridItem.tsx"],"sourcesContent":["import React from 'react';\nimport { GridListItem, GridListItemRenderProps } from 'react-aria-components';\nimport { FlexRow } from '../../../Flex/FlexRow';\nimport { Button } from '../../../Button';\nimport { RightArrowIcon } from '../../../../icons';\nimport { ItemContent } from '../ItemContent';\nimport { GridItemProps } from './types';\nimport { buildClassnames } from '../../../../utils';\nimport { useId } from '../../../../hooks';\n\nimport styles from '../item.module.scss';\n\nexport function GridItem({\n id,\n label,\n href,\n appearance = 'primary',\n className,\n onClickRowAction,\n rowActionAriaLabel,\n isRowActionDisabled = false,\n ...props\n}: GridItemProps) {\n const idComputed = useId({ id, prefix: 'grid-item' });\n\n return (\n <GridListItem\n id={idComputed}\n textValue={label}\n href={href}\n className={buildClassnames([styles.item, styles[`appearance-${appearance}`], className])}\n {...props}\n >\n {/* use react aria's render props to add more such as isHovered */}\n {({ selectionMode, allowsDragging, isSelected }: GridListItemRenderProps) => (\n <FlexRow flexWrap=\"nowrap\" justifyContent=\"space-between\">\n <ItemContent\n selectionMode={selectionMode}\n allowsDragging={allowsDragging}\n isSelected={isSelected}\n label={label}\n isLink={Boolean(href)}\n appearance={appearance}\n itemType=\"grid\"\n {...props}\n />\n {onClickRowAction && (\n /** onPointerDown event prevents click events from bubbling up to the GridListItem.\n * onKeyDown event prevents keyboard events from bubbling up to the GridListItem.\n */\n <Button\n onClick={onClickRowAction}\n disabled={isRowActionDisabled}\n onPointerDown={(event) => event.stopPropagation()}\n onKeyDown={(event) => event.stopPropagation()}\n iconSlot={<RightArrowIcon />}\n aria-label={rowActionAriaLabel || `${label} row action`}\n />\n )}\n </FlexRow>\n )}\n </GridListItem>\n );\n}\n"],"names":["useId","React","GridListItem","buildClassnames","styles","FlexRow","ItemContent","Button","RightArrowIcon"],"mappings":";;;;;;;;;;;;;;;;;;;AAYM,SAAU,QAAQ,CAAC,EACvB,EAAE,EACF,KAAK,EACL,IAAI,EACJ,UAAU,GAAG,SAAS,EACtB,SAAS,EACT,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,GAAG,KAAK,EAC3B,GAAG,KAAK,EACM,EAAA;AACd,IAAA,MAAM,UAAU,GAAGA,WAAK,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC;IAErD,QACEC,sBAAC,CAAA,aAAA,CAAAC,gCAAY,EACX,EAAA,EAAE,EAAE,UAAU,EACd,SAAS,EAAE,KAAK,EAChB,IAAI,EAAE,IAAI,EACV,SAAS,EAAEC,+BAAe,CAAC,CAACC,WAAM,CAAC,IAAI,EAAEA,WAAM,CAAC,CAAc,WAAA,EAAA,UAAU,CAAE,CAAA,CAAC,EAAE,SAAS,CAAC,CAAC,EACpF,GAAA,KAAK,EAGR,EAAA,CAAC,EAAE,aAAa,EAAE,cAAc,EAAE,UAAU,EAA2B,MACtEH,sBAAA,CAAA,aAAA,CAACI,eAAO,EAAA,EAAC,QAAQ,EAAC,QAAQ,EAAC,cAAc,EAAC,eAAe,EAAA;AACvD,QAAAJ,sBAAA,CAAA,aAAA,CAACK,uBAAW,EAAA,EACV,aAAa,EAAE,aAAa,EAC5B,cAAc,EAAE,cAAc,EAC9B,UAAU,EAAE,UAAU,EACtB,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,EACrB,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAC,MAAM,EAAA,GACX,KAAK,EACT,CAAA;AACD,QAAA,gBAAgB;AACf;;AAEG;QACHL,sBAAC,CAAA,aAAA,CAAAM,aAAM,IACL,OAAO,EAAE,gBAAgB,EACzB,QAAQ,EAAE,mBAAmB,EAC7B,aAAa,EAAE,CAAC,KAAK,KAAK,KAAK,CAAC,eAAe,EAAE,EACjD,SAAS,EAAE,CAAC,KAAK,KAAK,KAAK,CAAC,eAAe,EAAE,EAC7C,QAAQ,EAAEN,sBAAA,CAAA,aAAA,CAACO,6BAAc,EAAA,IAAA,CAAG,gBAChB,kBAAkB,IAAI,CAAG,EAAA,KAAK,CAAa,WAAA,CAAA,EAAA,CACvD,CACH,CACO,CACX,CACY;AAEnB;;;;"}
@@ -0,0 +1,26 @@
1
+ import React__default from 'react';
2
+ import { GridListItem } from 'react-aria-components';
3
+ import { FlexRow } from '../../../Flex/FlexRow/FlexRow.js';
4
+ import { Button } from '../../../Button/Button.js';
5
+ import { ReactComponent as RightArrowIcon } from '../../../../icons/design-system/components/RightArrowIcon.js';
6
+ import { ItemContent } from '../ItemContent/ItemContent.js';
7
+ import { buildClassnames } from '../../../../utils/buildClassnames.js';
8
+ import 'uid/secure';
9
+ import '../../../../hooks/useFocusVisible.js';
10
+ import { useId } from '../../../../hooks/useId.js';
11
+ import 'lodash.throttle';
12
+ import styles from '../item.module.scss.js';
13
+
14
+ function GridItem({ id, label, href, appearance = 'primary', className, onClickRowAction, rowActionAriaLabel, isRowActionDisabled = false, ...props }) {
15
+ const idComputed = useId({ id, prefix: 'grid-item' });
16
+ return (React__default.createElement(GridListItem, { id: idComputed, textValue: label, href: href, className: buildClassnames([styles.item, styles[`appearance-${appearance}`], className]), ...props }, ({ selectionMode, allowsDragging, isSelected }) => (React__default.createElement(FlexRow, { flexWrap: "nowrap", justifyContent: "space-between" },
17
+ React__default.createElement(ItemContent, { selectionMode: selectionMode, allowsDragging: allowsDragging, isSelected: isSelected, label: label, isLink: Boolean(href), appearance: appearance, itemType: "grid", ...props }),
18
+ onClickRowAction && (
19
+ /** onPointerDown event prevents click events from bubbling up to the GridListItem.
20
+ * onKeyDown event prevents keyboard events from bubbling up to the GridListItem.
21
+ */
22
+ React__default.createElement(Button, { onClick: onClickRowAction, disabled: isRowActionDisabled, onPointerDown: (event) => event.stopPropagation(), onKeyDown: (event) => event.stopPropagation(), iconSlot: React__default.createElement(RightArrowIcon, null), "aria-label": rowActionAriaLabel || `${label} row action` }))))));
23
+ }
24
+
25
+ export { GridItem };
26
+ //# sourceMappingURL=GridItem.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GridItem.js","sources":["../../../../../src/components/SelectDropdown/components/GridItem/GridItem.tsx"],"sourcesContent":["import React from 'react';\nimport { GridListItem, GridListItemRenderProps } from 'react-aria-components';\nimport { FlexRow } from '../../../Flex/FlexRow';\nimport { Button } from '../../../Button';\nimport { RightArrowIcon } from '../../../../icons';\nimport { ItemContent } from '../ItemContent';\nimport { GridItemProps } from './types';\nimport { buildClassnames } from '../../../../utils';\nimport { useId } from '../../../../hooks';\n\nimport styles from '../item.module.scss';\n\nexport function GridItem({\n id,\n label,\n href,\n appearance = 'primary',\n className,\n onClickRowAction,\n rowActionAriaLabel,\n isRowActionDisabled = false,\n ...props\n}: GridItemProps) {\n const idComputed = useId({ id, prefix: 'grid-item' });\n\n return (\n <GridListItem\n id={idComputed}\n textValue={label}\n href={href}\n className={buildClassnames([styles.item, styles[`appearance-${appearance}`], className])}\n {...props}\n >\n {/* use react aria's render props to add more such as isHovered */}\n {({ selectionMode, allowsDragging, isSelected }: GridListItemRenderProps) => (\n <FlexRow flexWrap=\"nowrap\" justifyContent=\"space-between\">\n <ItemContent\n selectionMode={selectionMode}\n allowsDragging={allowsDragging}\n isSelected={isSelected}\n label={label}\n isLink={Boolean(href)}\n appearance={appearance}\n itemType=\"grid\"\n {...props}\n />\n {onClickRowAction && (\n /** onPointerDown event prevents click events from bubbling up to the GridListItem.\n * onKeyDown event prevents keyboard events from bubbling up to the GridListItem.\n */\n <Button\n onClick={onClickRowAction}\n disabled={isRowActionDisabled}\n onPointerDown={(event) => event.stopPropagation()}\n onKeyDown={(event) => event.stopPropagation()}\n iconSlot={<RightArrowIcon />}\n aria-label={rowActionAriaLabel || `${label} row action`}\n />\n )}\n </FlexRow>\n )}\n </GridListItem>\n );\n}\n"],"names":["React"],"mappings":";;;;;;;;;;;;;AAYM,SAAU,QAAQ,CAAC,EACvB,EAAE,EACF,KAAK,EACL,IAAI,EACJ,UAAU,GAAG,SAAS,EACtB,SAAS,EACT,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,GAAG,KAAK,EAC3B,GAAG,KAAK,EACM,EAAA;AACd,IAAA,MAAM,UAAU,GAAG,KAAK,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC;IAErD,QACEA,cAAC,CAAA,aAAA,CAAA,YAAY,EACX,EAAA,EAAE,EAAE,UAAU,EACd,SAAS,EAAE,KAAK,EAChB,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,eAAe,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAc,WAAA,EAAA,UAAU,CAAE,CAAA,CAAC,EAAE,SAAS,CAAC,CAAC,EACpF,GAAA,KAAK,EAGR,EAAA,CAAC,EAAE,aAAa,EAAE,cAAc,EAAE,UAAU,EAA2B,MACtEA,cAAA,CAAA,aAAA,CAAC,OAAO,EAAA,EAAC,QAAQ,EAAC,QAAQ,EAAC,cAAc,EAAC,eAAe,EAAA;AACvD,QAAAA,cAAA,CAAA,aAAA,CAAC,WAAW,EAAA,EACV,aAAa,EAAE,aAAa,EAC5B,cAAc,EAAE,cAAc,EAC9B,UAAU,EAAE,UAAU,EACtB,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,EACrB,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAC,MAAM,EAAA,GACX,KAAK,EACT,CAAA;AACD,QAAA,gBAAgB;AACf;;AAEG;QACHA,cAAC,CAAA,aAAA,CAAA,MAAM,IACL,OAAO,EAAE,gBAAgB,EACzB,QAAQ,EAAE,mBAAmB,EAC7B,aAAa,EAAE,CAAC,KAAK,KAAK,KAAK,CAAC,eAAe,EAAE,EACjD,SAAS,EAAE,CAAC,KAAK,KAAK,KAAK,CAAC,eAAe,EAAE,EAC7C,QAAQ,EAAEA,cAAA,CAAA,aAAA,CAAC,cAAc,EAAA,IAAA,CAAG,gBAChB,kBAAkB,IAAI,CAAG,EAAA,KAAK,CAAa,WAAA,CAAA,EAAA,CACvD,CACH,CACO,CACX,CACY;AAEnB;;;;"}
@@ -0,0 +1,18 @@
1
+ 'use strict';
2
+
3
+ var reactAriaComponents = require('react-aria-components');
4
+ var React = require('react');
5
+ var GridItem = require('../GridItem/GridItem.cjs');
6
+ var buildClassnames = require('../../../../utils/buildClassnames.cjs');
7
+ require('uid/secure');
8
+ var OptionsContainer_module = require('./OptionsContainer.module.scss.cjs');
9
+ var SelectDropdownState = require('../SelectDropdownState.cjs');
10
+
11
+ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
12
+
13
+ var React__default = /*#__PURE__*/_interopDefaultCompat(React);
14
+
15
+ const GridList = ({ id, className, options, onSelectionChange, selectedValues, selectionMode, emptyStateSlot, isLoading = false, ariaDescribedBy, ariaLabelledBy, ...otherProps }) => (React__default.default.createElement(reactAriaComponents.GridList, { className: buildClassnames.buildClassnames([className, OptionsContainer_module.container]), selectionMode: selectionMode, items: options, onSelectionChange: onSelectionChange, selectedKeys: selectedValues.map((selectedValue) => selectedValue.id), renderEmptyState: () => (React__default.default.createElement(SelectDropdownState.SelectDropdownState, { isLoading: isLoading, emptyStateSlot: emptyStateSlot })), "aria-labelledby": ariaLabelledBy !== null && ariaLabelledBy !== undefined ? ariaLabelledBy : `${id}-label`, "aria-describedby": ariaDescribedBy !== null && ariaDescribedBy !== undefined ? ariaDescribedBy : `${id}-hint`, ...otherProps }, (item) => React__default.default.createElement(GridItem.GridItem, { ...item })));
16
+
17
+ exports.GridList = GridList;
18
+ //# sourceMappingURL=GridList.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GridList.cjs","sources":["../../../../../src/components/SelectDropdown/components/OptionsContainers/GridList.tsx"],"sourcesContent":["import { GridList as AriaGridList, Key } from 'react-aria-components';\nimport React from 'react';\nimport { GridItem } from '../GridItem';\nimport { GridListProps } from './types';\nimport { buildClassnames } from '../../../../utils';\n\nimport styles from './OptionsContainer.module.scss';\nimport { SelectDropdownState } from '../SelectDropdownState';\n\nexport const GridList = ({\n id,\n className,\n options,\n onSelectionChange,\n selectedValues,\n selectionMode,\n emptyStateSlot,\n isLoading = false,\n ariaDescribedBy,\n ariaLabelledBy,\n ...otherProps\n}: GridListProps) => (\n <AriaGridList\n className={buildClassnames([className, styles.container])}\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 aria-labelledby={ariaLabelledBy ?? `${id}-label`}\n aria-describedby={ariaDescribedBy ?? `${id}-hint`}\n {...otherProps}\n >\n {(item) => <GridItem {...item} />}\n </AriaGridList>\n);\n"],"names":["React","AriaGridList","buildClassnames","styles","SelectDropdownState","GridItem"],"mappings":";;;;;;;;;;;;;;AASO,MAAM,QAAQ,GAAG,CAAC,EACvB,EAAE,EACF,SAAS,EACT,OAAO,EACP,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,cAAc,EACd,SAAS,GAAG,KAAK,EACjB,eAAe,EACf,cAAc,EACd,GAAG,UAAU,EACC,MACdA,sBAAA,CAAA,aAAA,CAACC,4BAAY,EAAA,EACX,SAAS,EAAEC,+BAAe,CAAC,CAAC,SAAS,EAAEC,uBAAM,CAAC,SAAS,CAAC,CAAC,EACzD,aAAa,EAAE,aAAa,EAC5B,KAAK,EAAE,OAAO,EACd,iBAAiB,EAAE,iBAAiB,EACpC,YAAY,EAAE,cAAc,CAAC,GAAG,CAAC,CAAC,aAAa,KAAK,aAAa,CAAC,EAAE,CAAU,EAC9E,gBAAgB,EAAE,OAChBH,sBAAC,CAAA,aAAA,CAAAI,uCAAmB,EAAC,EAAA,SAAS,EAAE,SAAS,EAAE,cAAc,EAAE,cAAc,EAAI,CAAA,CAC9E,qBACgB,cAAc,KAAA,IAAA,IAAd,cAAc,KAAA,SAAA,GAAd,cAAc,GAAI,CAAG,EAAA,EAAE,CAAQ,MAAA,CAAA,EAAA,kBAAA,EAC9B,eAAe,KAAA,IAAA,IAAf,eAAe,KAAA,SAAA,GAAf,eAAe,GAAI,GAAG,EAAE,CAAA,KAAA,CAAO,EAC7C,GAAA,UAAU,EAEb,EAAA,CAAC,IAAI,KAAKJ,sBAAC,CAAA,aAAA,CAAAK,iBAAQ,EAAK,EAAA,GAAA,IAAI,EAAI,CAAA,CACpB;;;;"}
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import { GridListProps } from './types';
3
+ export declare const GridList: ({ id, className, options, onSelectionChange, selectedValues, selectionMode, emptyStateSlot, isLoading, ariaDescribedBy, ariaLabelledBy, ...otherProps }: GridListProps) => React.JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { GridList as GridList$1 } from 'react-aria-components';
2
+ import React__default from 'react';
3
+ import { GridItem } from '../GridItem/GridItem.js';
4
+ import { buildClassnames } from '../../../../utils/buildClassnames.js';
5
+ import 'uid/secure';
6
+ import styles from './OptionsContainer.module.scss.js';
7
+ import { SelectDropdownState } from '../SelectDropdownState.js';
8
+
9
+ const GridList = ({ id, className, options, onSelectionChange, selectedValues, selectionMode, emptyStateSlot, isLoading = false, ariaDescribedBy, ariaLabelledBy, ...otherProps }) => (React__default.createElement(GridList$1, { className: buildClassnames([className, styles.container]), selectionMode: selectionMode, items: options, onSelectionChange: onSelectionChange, selectedKeys: selectedValues.map((selectedValue) => selectedValue.id), renderEmptyState: () => (React__default.createElement(SelectDropdownState, { isLoading: isLoading, emptyStateSlot: emptyStateSlot })), "aria-labelledby": ariaLabelledBy !== null && ariaLabelledBy !== undefined ? ariaLabelledBy : `${id}-label`, "aria-describedby": ariaDescribedBy !== null && ariaDescribedBy !== undefined ? ariaDescribedBy : `${id}-hint`, ...otherProps }, (item) => React__default.createElement(GridItem, { ...item })));
10
+
11
+ export { GridList };
12
+ //# sourceMappingURL=GridList.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GridList.js","sources":["../../../../../src/components/SelectDropdown/components/OptionsContainers/GridList.tsx"],"sourcesContent":["import { GridList as AriaGridList, Key } from 'react-aria-components';\nimport React from 'react';\nimport { GridItem } from '../GridItem';\nimport { GridListProps } from './types';\nimport { buildClassnames } from '../../../../utils';\n\nimport styles from './OptionsContainer.module.scss';\nimport { SelectDropdownState } from '../SelectDropdownState';\n\nexport const GridList = ({\n id,\n className,\n options,\n onSelectionChange,\n selectedValues,\n selectionMode,\n emptyStateSlot,\n isLoading = false,\n ariaDescribedBy,\n ariaLabelledBy,\n ...otherProps\n}: GridListProps) => (\n <AriaGridList\n className={buildClassnames([className, styles.container])}\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 aria-labelledby={ariaLabelledBy ?? `${id}-label`}\n aria-describedby={ariaDescribedBy ?? `${id}-hint`}\n {...otherProps}\n >\n {(item) => <GridItem {...item} />}\n </AriaGridList>\n);\n"],"names":["React","AriaGridList"],"mappings":";;;;;;;;AASO,MAAM,QAAQ,GAAG,CAAC,EACvB,EAAE,EACF,SAAS,EACT,OAAO,EACP,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,cAAc,EACd,SAAS,GAAG,KAAK,EACjB,eAAe,EACf,cAAc,EACd,GAAG,UAAU,EACC,MACdA,cAAA,CAAA,aAAA,CAACC,UAAY,EAAA,EACX,SAAS,EAAE,eAAe,CAAC,CAAC,SAAS,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC,EACzD,aAAa,EAAE,aAAa,EAC5B,KAAK,EAAE,OAAO,EACd,iBAAiB,EAAE,iBAAiB,EACpC,YAAY,EAAE,cAAc,CAAC,GAAG,CAAC,CAAC,aAAa,KAAK,aAAa,CAAC,EAAE,CAAU,EAC9E,gBAAgB,EAAE,OAChBD,cAAC,CAAA,aAAA,CAAA,mBAAmB,EAAC,EAAA,SAAS,EAAE,SAAS,EAAE,cAAc,EAAE,cAAc,EAAI,CAAA,CAC9E,qBACgB,cAAc,KAAA,IAAA,IAAd,cAAc,KAAA,SAAA,GAAd,cAAc,GAAI,CAAG,EAAA,EAAE,CAAQ,MAAA,CAAA,EAAA,kBAAA,EAC9B,eAAe,KAAA,IAAA,IAAf,eAAe,KAAA,SAAA,GAAf,eAAe,GAAI,GAAG,EAAE,CAAA,KAAA,CAAO,EAC7C,GAAA,UAAU,EAEb,EAAA,CAAC,IAAI,KAAKA,cAAC,CAAA,aAAA,CAAA,QAAQ,EAAK,EAAA,GAAA,IAAI,EAAI,CAAA,CACpB;;;;"}
@@ -0,0 +1,19 @@
1
+ 'use strict';
2
+
3
+ var React = require('react');
4
+ var reactAriaComponents = require('react-aria-components');
5
+ var buildClassnames = require('../../../../utils/buildClassnames.cjs');
6
+ require('uid/secure');
7
+ var OptionsContainer_module = require('./OptionsContainer.module.scss.cjs');
8
+ var SelectDropdownState = require('../SelectDropdownState.cjs');
9
+ var ListItemSection = require('../ListItemSection/ListItemSection.cjs');
10
+ var ListItem = require('../ListItem/ListItem.cjs');
11
+
12
+ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
13
+
14
+ var React__default = /*#__PURE__*/_interopDefaultCompat(React);
15
+
16
+ const ListBox = ({ id, className, ariaLabelledBy, ariaDescribedBy, selectionMode, options, onSelectionChange, selectedValues, isLoading = false, emptyStateSlot, hasSection, ...otherProps }) => (React__default.default.createElement(reactAriaComponents.ListBox, { className: buildClassnames.buildClassnames([className, OptionsContainer_module.container]), selectionMode: selectionMode, items: options, onSelectionChange: onSelectionChange, selectedKeys: selectedValues.map((selectedValue) => selectedValue.id), renderEmptyState: () => (React__default.default.createElement(SelectDropdownState.SelectDropdownState, { isLoading: isLoading, emptyStateSlot: emptyStateSlot })), "aria-labelledby": ariaLabelledBy !== null && ariaLabelledBy !== undefined ? ariaLabelledBy : `${id}-label`, "aria-describedby": ariaDescribedBy !== null && ariaDescribedBy !== undefined ? ariaDescribedBy : `${id}-hint`, ...otherProps }, (item) => hasSection ? (React__default.default.createElement(ListItemSection.ListItemSection, { ...item })) : (React__default.default.createElement(ListItem.ListItem, { ...item }))));
17
+
18
+ exports.ListBox = ListBox;
19
+ //# sourceMappingURL=ListBox.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ListBox.cjs","sources":["../../../../../src/components/SelectDropdown/components/OptionsContainers/ListBox.tsx"],"sourcesContent":["import React from 'react';\nimport { ListBox as AriaListBox, Key } from 'react-aria-components';\nimport { buildClassnames } from '../../../../utils';\n\nimport styles from './OptionsContainer.module.scss';\nimport { SelectDropdownState } from '../SelectDropdownState';\nimport { ListItemSection } from '../ListItemSection';\nimport { ListItem } from '../ListItem';\nimport { ListItemProps } from '../ListItem/types';\nimport { ListItemSectionProps } from '../ListItemSection/ListItemSection';\nimport { ListBoxProps } from './types';\n\nexport const ListBox = ({\n id,\n className,\n ariaLabelledBy,\n ariaDescribedBy,\n selectionMode,\n options,\n onSelectionChange,\n selectedValues,\n isLoading = false,\n emptyStateSlot,\n hasSection,\n ...otherProps\n}: ListBoxProps) => (\n <AriaListBox\n className={buildClassnames([className, styles.container])}\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 aria-labelledby={ariaLabelledBy ?? `${id}-label`}\n aria-describedby={ariaDescribedBy ?? `${id}-hint`}\n {...otherProps}\n >\n {(item) =>\n hasSection ? (\n <ListItemSection {...(item as ListItemSectionProps)} />\n ) : (\n <ListItem {...(item as ListItemProps)} />\n )\n }\n </AriaListBox>\n);\n"],"names":["React","AriaListBox","buildClassnames","styles","SelectDropdownState","ListItemSection","ListItem"],"mappings":";;;;;;;;;;;;;;;AAYO,MAAM,OAAO,GAAG,CAAC,EACtB,EAAE,EACF,SAAS,EACT,cAAc,EACd,eAAe,EACf,aAAa,EACb,OAAO,EACP,iBAAiB,EACjB,cAAc,EACd,SAAS,GAAG,KAAK,EACjB,cAAc,EACd,UAAU,EACV,GAAG,UAAU,EACA,MACbA,sBAAA,CAAA,aAAA,CAACC,2BAAW,EAAA,EACV,SAAS,EAAEC,+BAAe,CAAC,CAAC,SAAS,EAAEC,uBAAM,CAAC,SAAS,CAAC,CAAC,EACzD,aAAa,EAAE,aAAa,EAC5B,KAAK,EAAE,OAAO,EACd,iBAAiB,EAAE,iBAAiB,EACpC,YAAY,EAAE,cAAc,CAAC,GAAG,CAAC,CAAC,aAAa,KAAK,aAAa,CAAC,EAAE,CAAU,EAC9E,gBAAgB,EAAE,OAChBH,sBAAC,CAAA,aAAA,CAAAI,uCAAmB,EAAC,EAAA,SAAS,EAAE,SAAS,EAAE,cAAc,EAAE,cAAc,EAAA,CAAI,CAC9E,EAAA,iBAAA,EACgB,cAAc,KAAd,IAAA,IAAA,cAAc,KAAd,SAAA,GAAA,cAAc,GAAI,CAAG,EAAA,EAAE,CAAQ,MAAA,CAAA,EAAA,kBAAA,EAC9B,eAAe,KAAf,IAAA,IAAA,eAAe,KAAf,SAAA,GAAA,eAAe,GAAI,CAAA,EAAG,EAAE,CAAA,KAAA,CAAO,KAC7C,UAAU,EAAA,EAEb,CAAC,IAAI,KACJ,UAAU,IACRJ,sBAAC,CAAA,aAAA,CAAAK,+BAAe,OAAM,IAA6B,EAAA,CAAI,KAEvDL,sBAAC,CAAA,aAAA,CAAAM,iBAAQ,OAAM,IAAsB,EAAA,CAAI,CAC1C,CAES;;;;"}
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import { ListBoxProps } from './types';
3
+ export declare const ListBox: ({ id, className, ariaLabelledBy, ariaDescribedBy, selectionMode, options, onSelectionChange, selectedValues, isLoading, emptyStateSlot, hasSection, ...otherProps }: ListBoxProps) => React.JSX.Element;
@@ -0,0 +1,13 @@
1
+ import React__default from 'react';
2
+ import { ListBox as ListBox$1 } from 'react-aria-components';
3
+ import { buildClassnames } from '../../../../utils/buildClassnames.js';
4
+ import 'uid/secure';
5
+ import styles from './OptionsContainer.module.scss.js';
6
+ import { SelectDropdownState } from '../SelectDropdownState.js';
7
+ import { ListItemSection } from '../ListItemSection/ListItemSection.js';
8
+ import { ListItem } from '../ListItem/ListItem.js';
9
+
10
+ const ListBox = ({ id, className, ariaLabelledBy, ariaDescribedBy, selectionMode, options, onSelectionChange, selectedValues, isLoading = false, emptyStateSlot, hasSection, ...otherProps }) => (React__default.createElement(ListBox$1, { className: buildClassnames([className, styles.container]), selectionMode: selectionMode, items: options, onSelectionChange: onSelectionChange, selectedKeys: selectedValues.map((selectedValue) => selectedValue.id), renderEmptyState: () => (React__default.createElement(SelectDropdownState, { isLoading: isLoading, emptyStateSlot: emptyStateSlot })), "aria-labelledby": ariaLabelledBy !== null && ariaLabelledBy !== undefined ? ariaLabelledBy : `${id}-label`, "aria-describedby": ariaDescribedBy !== null && ariaDescribedBy !== undefined ? ariaDescribedBy : `${id}-hint`, ...otherProps }, (item) => hasSection ? (React__default.createElement(ListItemSection, { ...item })) : (React__default.createElement(ListItem, { ...item }))));
11
+
12
+ export { ListBox };
13
+ //# sourceMappingURL=ListBox.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ListBox.js","sources":["../../../../../src/components/SelectDropdown/components/OptionsContainers/ListBox.tsx"],"sourcesContent":["import React from 'react';\nimport { ListBox as AriaListBox, Key } from 'react-aria-components';\nimport { buildClassnames } from '../../../../utils';\n\nimport styles from './OptionsContainer.module.scss';\nimport { SelectDropdownState } from '../SelectDropdownState';\nimport { ListItemSection } from '../ListItemSection';\nimport { ListItem } from '../ListItem';\nimport { ListItemProps } from '../ListItem/types';\nimport { ListItemSectionProps } from '../ListItemSection/ListItemSection';\nimport { ListBoxProps } from './types';\n\nexport const ListBox = ({\n id,\n className,\n ariaLabelledBy,\n ariaDescribedBy,\n selectionMode,\n options,\n onSelectionChange,\n selectedValues,\n isLoading = false,\n emptyStateSlot,\n hasSection,\n ...otherProps\n}: ListBoxProps) => (\n <AriaListBox\n className={buildClassnames([className, styles.container])}\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 aria-labelledby={ariaLabelledBy ?? `${id}-label`}\n aria-describedby={ariaDescribedBy ?? `${id}-hint`}\n {...otherProps}\n >\n {(item) =>\n hasSection ? (\n <ListItemSection {...(item as ListItemSectionProps)} />\n ) : (\n <ListItem {...(item as ListItemProps)} />\n )\n }\n </AriaListBox>\n);\n"],"names":["React","AriaListBox"],"mappings":";;;;;;;;;AAYO,MAAM,OAAO,GAAG,CAAC,EACtB,EAAE,EACF,SAAS,EACT,cAAc,EACd,eAAe,EACf,aAAa,EACb,OAAO,EACP,iBAAiB,EACjB,cAAc,EACd,SAAS,GAAG,KAAK,EACjB,cAAc,EACd,UAAU,EACV,GAAG,UAAU,EACA,MACbA,cAAA,CAAA,aAAA,CAACC,SAAW,EAAA,EACV,SAAS,EAAE,eAAe,CAAC,CAAC,SAAS,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC,EACzD,aAAa,EAAE,aAAa,EAC5B,KAAK,EAAE,OAAO,EACd,iBAAiB,EAAE,iBAAiB,EACpC,YAAY,EAAE,cAAc,CAAC,GAAG,CAAC,CAAC,aAAa,KAAK,aAAa,CAAC,EAAE,CAAU,EAC9E,gBAAgB,EAAE,OAChBD,cAAC,CAAA,aAAA,CAAA,mBAAmB,EAAC,EAAA,SAAS,EAAE,SAAS,EAAE,cAAc,EAAE,cAAc,EAAA,CAAI,CAC9E,EAAA,iBAAA,EACgB,cAAc,KAAd,IAAA,IAAA,cAAc,KAAd,SAAA,GAAA,cAAc,GAAI,CAAG,EAAA,EAAE,CAAQ,MAAA,CAAA,EAAA,kBAAA,EAC9B,eAAe,KAAf,IAAA,IAAA,eAAe,KAAf,SAAA,GAAA,eAAe,GAAI,CAAA,EAAG,EAAE,CAAA,KAAA,CAAO,KAC7C,UAAU,EAAA,EAEb,CAAC,IAAI,KACJ,UAAU,IACRA,cAAC,CAAA,aAAA,CAAA,eAAe,OAAM,IAA6B,EAAA,CAAI,KAEvDA,cAAC,CAAA,aAAA,CAAA,QAAQ,OAAM,IAAsB,EAAA,CAAI,CAC1C,CAES;;;;"}
@@ -0,0 +1,9 @@
1
+ 'use strict';
2
+
3
+ var ___$insertStyle = require('../../../../_virtual/____insertStyle.cjs');
4
+
5
+ ___$insertStyle("._container_jvp9b_1 {\n overflow-y: scroll;\n max-height: 300px;\n padding: var(--sizes-sm);\n scroll-padding: var(--sizes-xs) 0;\n}\n._container_jvp9b_1[data-empty] {\n display: flex;\n align-items: center;\n justify-content: center;\n}");
6
+ var styles = {"container":"_container_jvp9b_1"};
7
+
8
+ module.exports = styles;
9
+ //# sourceMappingURL=OptionsContainer.module.scss.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OptionsContainer.module.scss.cjs","sources":["../../../../../src/components/SelectDropdown/components/OptionsContainers/OptionsContainer.module.scss"],"sourcesContent":[".container {\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"],"names":[],"mappings":";;;;AACE,eAAA,CAAA,sPAAA;AACA,aAAA,CAAA,WAAA,CAAA,oBAAA;;;;"}
@@ -0,0 +1,7 @@
1
+ import insertStyle from '../../../../_virtual/____insertStyle.js';
2
+
3
+ insertStyle("._container_jvp9b_1 {\n overflow-y: scroll;\n max-height: 300px;\n padding: var(--sizes-sm);\n scroll-padding: var(--sizes-xs) 0;\n}\n._container_jvp9b_1[data-empty] {\n display: flex;\n align-items: center;\n justify-content: center;\n}");
4
+ var styles = {"container":"_container_jvp9b_1"};
5
+
6
+ export { styles as default };
7
+ //# sourceMappingURL=OptionsContainer.module.scss.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OptionsContainer.module.scss.js","sources":["../../../../../src/components/SelectDropdown/components/OptionsContainers/OptionsContainer.module.scss"],"sourcesContent":[".container {\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"],"names":["___$insertStyle"],"mappings":";;AACEA,WAAA,CAAA,sPAAA;AACA,aAAA,CAAA,WAAA,CAAA,oBAAA;;;;"}
@@ -0,0 +1,25 @@
1
+ import { ReactElement } from 'react';
2
+ import { Selection, GridListProps as AriaGridListProps, ListBoxProps as AriaListBoxProps } from 'react-aria-components';
3
+ import { ListItemSectionProps } from '../ListItemSection/ListItemSection';
4
+ import { GridItemProps } from '../GridItem/types';
5
+ import { ListItemProps } from '../ListItem/types';
6
+ type ListProps = {
7
+ id?: string;
8
+ className?: string;
9
+ selectionMode: 'single' | 'multiple';
10
+ emptyStateSlot?: ReactElement;
11
+ isLoading?: boolean;
12
+ onSelectionChange: (keys: Selection) => void;
13
+ ariaLabelledBy?: string;
14
+ ariaDescribedBy?: string;
15
+ };
16
+ export type GridListProps = ListProps & Omit<AriaGridListProps<GridItemProps>, 'items' | 'selectedValues'> & {
17
+ options: GridItemProps[];
18
+ selectedValues: GridItemProps[];
19
+ };
20
+ export type ListBoxProps = ListProps & Omit<AriaListBoxProps<ListItemProps | ListItemSectionProps>, 'items' | 'selectedValues'> & {
21
+ options: (ListItemProps | ListItemSectionProps)[];
22
+ selectedValues: (ListItemProps | ListItemSectionProps)[];
23
+ hasSection?: boolean;
24
+ };
25
+ export {};
@@ -3,10 +3,11 @@ import { ReactElement } from 'react';
3
3
  import { ButtonProps } from '../Button/types';
4
4
  import { ListItemProps } from './components/ListItem/types';
5
5
  import { ListItemSectionProps } from './components/ListItemSection/ListItemSection';
6
+ import { GridItemProps } from './components/GridItem/types';
6
7
  type CTAButtonProps = Omit<ButtonProps, 'variant'> & {
7
8
  label: string;
8
9
  };
9
- export type SelectDropdownItem = ListItemProps | ListItemSectionProps;
10
+ export type SelectDropdownItem = ListItemProps | ListItemSectionProps | GridItemProps;
10
11
  type ImportedListBoxProps = Pick<ListBoxProps<SelectDropdownItem>, 'children' | 'dragAndDropHooks' | 'onScroll' | 'disabledKeys'>;
11
12
  export type SelectDropdownSingleProps = ImportedListBoxProps & {
12
13
  multiple?: false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veeqo/ui",
3
- "version": "12.3.4",
3
+ "version": "12.4.0-beta-1",
4
4
  "description": "New optimised component library for Veeqo.",
5
5
  "author": "Robert Wealthall",
6
6
  "license": "ISC",