@lumx/react 2.2.12-alpha.2 → 2.2.14
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/esm/_internal/Checkbox2.js +3 -1
- package/esm/_internal/Checkbox2.js.map +1 -1
- package/esm/_internal/CommentBlock.js +12 -5
- package/esm/_internal/CommentBlock.js.map +1 -1
- package/esm/_internal/Dropdown2.js +5 -2
- package/esm/_internal/Dropdown2.js.map +1 -1
- package/esm/_internal/List2.js +11 -2
- package/esm/_internal/List2.js.map +1 -1
- package/esm/_internal/Popover2.js +69 -4
- package/esm/_internal/Popover2.js.map +1 -1
- package/esm/_internal/RadioGroup.js +3 -1
- package/esm/_internal/RadioGroup.js.map +1 -1
- package/esm/_internal/Slides.js +1 -24
- package/esm/_internal/Slides.js.map +1 -1
- package/esm/_internal/Tooltip2.js +1 -3
- package/esm/_internal/Tooltip2.js.map +1 -1
- package/esm/_internal/comment-block.js +8 -0
- package/esm/_internal/comment-block.js.map +1 -1
- package/package.json +4 -4
- package/src/components/autocomplete/__snapshots__/Autocomplete.test.tsx.snap +4 -0
- package/src/components/autocomplete/__snapshots__/AutocompleteMultiple.test.tsx.snap +1 -0
- package/src/components/checkbox/Checkbox.tsx +4 -0
- package/src/components/comment-block/CommentBlock.stories.tsx +7 -4
- package/src/components/comment-block/CommentBlock.tsx +13 -3
- package/src/components/comment-block/__snapshots__/CommentBlock.test.tsx.snap +10 -5
- package/src/components/dialog/__snapshots__/Dialog.test.tsx.snap +1 -0
- package/src/components/dropdown/Dropdown.tsx +5 -0
- package/src/components/dropdown/__snapshots__/Dropdown.test.tsx.snap +1 -0
- package/src/components/list/List.tsx +12 -2
- package/src/components/list/__snapshots__/List.test.tsx.snap +5 -5
- package/src/components/popover/Popover.tsx +42 -2
- package/src/components/radio-button/RadioButton.tsx +4 -0
- package/src/components/select/__snapshots__/Select.test.tsx.snap +1 -0
- package/src/components/select/__snapshots__/SelectMultiple.test.tsx.snap +2 -0
- package/src/components/tooltip/useTooltipOpen.tsx +0 -1
- package/src/stories/generated/Toolbar/Demos.stories.tsx +1 -0
- package/types.d.ts +13 -1
|
@@ -41,6 +41,7 @@ var Checkbox = forwardRef(function (props, ref) {
|
|
|
41
41
|
disabled = props.disabled,
|
|
42
42
|
helper = props.helper,
|
|
43
43
|
id = props.id,
|
|
44
|
+
inputRef = props.inputRef,
|
|
44
45
|
_props$isChecked = props.isChecked,
|
|
45
46
|
isChecked = _props$isChecked === void 0 ? checked : _props$isChecked,
|
|
46
47
|
_props$isDisabled = props.isDisabled,
|
|
@@ -52,7 +53,7 @@ var Checkbox = forwardRef(function (props, ref) {
|
|
|
52
53
|
value = props.value,
|
|
53
54
|
_props$inputProps = props.inputProps,
|
|
54
55
|
inputProps = _props$inputProps === void 0 ? {} : _props$inputProps,
|
|
55
|
-
forwardedProps = _objectWithoutProperties(props, ["checked", "className", "disabled", "helper", "id", "isChecked", "isDisabled", "label", "name", "onChange", "theme", "value", "inputProps"]);
|
|
56
|
+
forwardedProps = _objectWithoutProperties(props, ["checked", "className", "disabled", "helper", "id", "inputRef", "isChecked", "isDisabled", "label", "name", "onChange", "theme", "value", "inputProps"]);
|
|
56
57
|
|
|
57
58
|
var inputId = useMemo(function () {
|
|
58
59
|
return id || "".concat(CLASSNAME.toLowerCase(), "-").concat(uid());
|
|
@@ -77,6 +78,7 @@ var Checkbox = forwardRef(function (props, ref) {
|
|
|
77
78
|
}), React.createElement("div", {
|
|
78
79
|
className: "".concat(CLASSNAME, "__input-wrapper")
|
|
79
80
|
}, React.createElement("input", _extends({
|
|
81
|
+
ref: inputRef,
|
|
80
82
|
type: "checkbox",
|
|
81
83
|
id: inputId,
|
|
82
84
|
className: "".concat(CLASSNAME, "__input-native"),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox2.js","sources":["../../../src/components/checkbox/Checkbox.tsx"],"sourcesContent":["import React, { useMemo, forwardRef, ReactNode, SyntheticEvent, InputHTMLAttributes } from 'react';\n\nimport classNames from 'classnames';\nimport { uid } from 'uid';\n\nimport { mdiCheck } from '@lumx/icons';\n\nimport { Icon, InputHelper, InputLabel, Theme } from '@lumx/react';\nimport { Comp, GenericProps, getRootClassName, handleBasicClasses } from '@lumx/react/utils';\n\n/**\n * Defines the props of the component.\n */\nexport interface CheckboxProps extends GenericProps {\n /** Helper text. */\n helper?: string;\n /** Native input id property. */\n id?: string;\n /** Whether it is checked or not. */\n isChecked?: boolean;\n /** Whether the component is disabled or not. */\n isDisabled?: boolean;\n /** Label text. */\n label?: ReactNode;\n /** Native input name property. */\n name?: string;\n /** Theme adapting the component to light or dark background. */\n theme?: Theme;\n /** Native input value property. */\n value?: string;\n /** On change callback. */\n onChange?(isChecked: boolean, value?: string, name?: string, event?: SyntheticEvent): void;\n /** optional props for input */\n inputProps?: InputHTMLAttributes<HTMLInputElement>;\n}\n\n/**\n * Component display name.\n */\nconst COMPONENT_NAME = 'Checkbox';\n\n/**\n * Component default class name and class prefix.\n */\nconst CLASSNAME = getRootClassName(COMPONENT_NAME);\n\n/**\n * Component default props.\n */\nconst DEFAULT_PROPS: Partial<CheckboxProps> = {\n theme: Theme.light,\n};\n\n/**\n * Checkbox component.\n *\n * @param props Component props.\n * @param ref Component ref.\n * @return React element.\n */\nexport const Checkbox: Comp<CheckboxProps, HTMLDivElement> = forwardRef((props, ref) => {\n const {\n checked,\n className,\n disabled,\n helper,\n id,\n isChecked = checked,\n isDisabled = disabled,\n label,\n name,\n onChange,\n theme,\n value,\n inputProps = {},\n ...forwardedProps\n } = props;\n const inputId = useMemo(() => id || `${CLASSNAME.toLowerCase()}-${uid()}`, [id]);\n\n const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n if (onChange) {\n onChange(!isChecked, value, name, event);\n }\n };\n\n return (\n <div\n ref={ref}\n {...forwardedProps}\n className={classNames(\n className,\n handleBasicClasses({\n isChecked,\n isDisabled,\n isUnchecked: !isChecked,\n prefix: CLASSNAME,\n theme,\n }),\n )}\n >\n <div className={`${CLASSNAME}__input-wrapper`}>\n <input\n type=\"checkbox\"\n id={inputId}\n className={`${CLASSNAME}__input-native`}\n tabIndex={isDisabled ? -1 : 0}\n name={name}\n value={value}\n checked={isChecked}\n onChange={handleChange}\n {...inputProps}\n />\n\n <div className={`${CLASSNAME}__input-placeholder`}>\n <div className={`${CLASSNAME}__input-background`} />\n\n <div className={`${CLASSNAME}__input-indicator`}>\n <Icon icon={mdiCheck} />\n </div>\n </div>\n </div>\n\n <div className={`${CLASSNAME}__content`}>\n {label && (\n <InputLabel htmlFor={inputId} className={`${CLASSNAME}__label`} theme={theme}>\n {label}\n </InputLabel>\n )}\n {helper && (\n <InputHelper className={`${CLASSNAME}__helper`} theme={theme}>\n {helper}\n </InputHelper>\n )}\n </div>\n </div>\n );\n});\nCheckbox.displayName = COMPONENT_NAME;\nCheckbox.className = CLASSNAME;\nCheckbox.defaultProps = DEFAULT_PROPS;\n"],"names":["COMPONENT_NAME","CLASSNAME","getRootClassName","DEFAULT_PROPS","theme","Theme","light","Checkbox","forwardRef","props","ref","checked","className","disabled","helper","id","isChecked","isDisabled","label","name","onChange","value","inputProps","forwardedProps","inputId","useMemo","toLowerCase","uid","handleChange","event","classNames","handleBasicClasses","isUnchecked","prefix","mdiCheck","displayName","defaultProps"],"mappings":";;;;;;;;;AAUA;;;;
|
|
1
|
+
{"version":3,"file":"Checkbox2.js","sources":["../../../src/components/checkbox/Checkbox.tsx"],"sourcesContent":["import React, { useMemo, forwardRef, ReactNode, SyntheticEvent, InputHTMLAttributes } from 'react';\n\nimport classNames from 'classnames';\nimport { uid } from 'uid';\n\nimport { mdiCheck } from '@lumx/icons';\n\nimport { Icon, InputHelper, InputLabel, Theme } from '@lumx/react';\nimport { Comp, GenericProps, getRootClassName, handleBasicClasses } from '@lumx/react/utils';\n\n/**\n * Defines the props of the component.\n */\nexport interface CheckboxProps extends GenericProps {\n /** Helper text. */\n helper?: string;\n /** Native input id property. */\n id?: string;\n /** Native input ref. */\n inputRef?: React.Ref<HTMLInputElement>;\n /** Whether it is checked or not. */\n isChecked?: boolean;\n /** Whether the component is disabled or not. */\n isDisabled?: boolean;\n /** Label text. */\n label?: ReactNode;\n /** Native input name property. */\n name?: string;\n /** Theme adapting the component to light or dark background. */\n theme?: Theme;\n /** Native input value property. */\n value?: string;\n /** On change callback. */\n onChange?(isChecked: boolean, value?: string, name?: string, event?: SyntheticEvent): void;\n /** optional props for input */\n inputProps?: InputHTMLAttributes<HTMLInputElement>;\n}\n\n/**\n * Component display name.\n */\nconst COMPONENT_NAME = 'Checkbox';\n\n/**\n * Component default class name and class prefix.\n */\nconst CLASSNAME = getRootClassName(COMPONENT_NAME);\n\n/**\n * Component default props.\n */\nconst DEFAULT_PROPS: Partial<CheckboxProps> = {\n theme: Theme.light,\n};\n\n/**\n * Checkbox component.\n *\n * @param props Component props.\n * @param ref Component ref.\n * @return React element.\n */\nexport const Checkbox: Comp<CheckboxProps, HTMLDivElement> = forwardRef((props, ref) => {\n const {\n checked,\n className,\n disabled,\n helper,\n id,\n inputRef,\n isChecked = checked,\n isDisabled = disabled,\n label,\n name,\n onChange,\n theme,\n value,\n inputProps = {},\n ...forwardedProps\n } = props;\n const inputId = useMemo(() => id || `${CLASSNAME.toLowerCase()}-${uid()}`, [id]);\n\n const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n if (onChange) {\n onChange(!isChecked, value, name, event);\n }\n };\n\n return (\n <div\n ref={ref}\n {...forwardedProps}\n className={classNames(\n className,\n handleBasicClasses({\n isChecked,\n isDisabled,\n isUnchecked: !isChecked,\n prefix: CLASSNAME,\n theme,\n }),\n )}\n >\n <div className={`${CLASSNAME}__input-wrapper`}>\n <input\n ref={inputRef}\n type=\"checkbox\"\n id={inputId}\n className={`${CLASSNAME}__input-native`}\n tabIndex={isDisabled ? -1 : 0}\n name={name}\n value={value}\n checked={isChecked}\n onChange={handleChange}\n {...inputProps}\n />\n\n <div className={`${CLASSNAME}__input-placeholder`}>\n <div className={`${CLASSNAME}__input-background`} />\n\n <div className={`${CLASSNAME}__input-indicator`}>\n <Icon icon={mdiCheck} />\n </div>\n </div>\n </div>\n\n <div className={`${CLASSNAME}__content`}>\n {label && (\n <InputLabel htmlFor={inputId} className={`${CLASSNAME}__label`} theme={theme}>\n {label}\n </InputLabel>\n )}\n {helper && (\n <InputHelper className={`${CLASSNAME}__helper`} theme={theme}>\n {helper}\n </InputHelper>\n )}\n </div>\n </div>\n );\n});\nCheckbox.displayName = COMPONENT_NAME;\nCheckbox.className = CLASSNAME;\nCheckbox.defaultProps = DEFAULT_PROPS;\n"],"names":["COMPONENT_NAME","CLASSNAME","getRootClassName","DEFAULT_PROPS","theme","Theme","light","Checkbox","forwardRef","props","ref","checked","className","disabled","helper","id","inputRef","isChecked","isDisabled","label","name","onChange","value","inputProps","forwardedProps","inputId","useMemo","toLowerCase","uid","handleChange","event","classNames","handleBasicClasses","isUnchecked","prefix","mdiCheck","displayName","defaultProps"],"mappings":";;;;;;;;;AAUA;;;;AA4BA;;;AAGA,IAAMA,cAAc,GAAG,UAAvB;AAEA;;;;AAGA,IAAMC,SAAS,GAAGC,gBAAgB,CAACF,cAAD,CAAlC;AAEA;;;;AAGA,IAAMG,aAAqC,GAAG;AAC1CC,EAAAA,KAAK,EAAEC,KAAK,CAACC;AAD6B,CAA9C;AAIA;;;;;;;;IAOaC,QAA6C,GAAGC,UAAU,CAAC,UAACC,KAAD,EAAQC,GAAR,EAAgB;AAAA,MAEhFC,OAFgF,GAiBhFF,KAjBgF,CAEhFE,OAFgF;AAAA,MAGhFC,SAHgF,GAiBhFH,KAjBgF,CAGhFG,SAHgF;AAAA,MAIhFC,QAJgF,GAiBhFJ,KAjBgF,CAIhFI,QAJgF;AAAA,MAKhFC,MALgF,GAiBhFL,KAjBgF,CAKhFK,MALgF;AAAA,MAMhFC,EANgF,GAiBhFN,KAjBgF,CAMhFM,EANgF;AAAA,MAOhFC,QAPgF,GAiBhFP,KAjBgF,CAOhFO,QAPgF;AAA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AS,YAAKH,SAAL;AAAd,KACI;AACI,IAAA,GAAG,EAAEe,QADT;AAEI,IAAA,IAAI,EAAC,UAFT;AAGI,IAAA,EAAE,EAAES,OAHR;AAII,IAAA,SAAS,YAAKxB,SAAL,mBAJb;AAKI,IAAA,QAAQ,EAAEiB,UAAU,GAAG,CAAC,CAAJ,GAAQ,CALhC;AAMI,IAAA,IAAI,EAAEE,IANV;AAOI,IAAA,KAAK,EAAEE,KAPX;AAQI,IAAA,OAAO,EAAEL,SARb;AASI,IAAA,QAAQ,EAAEY;AATd,KAUQN,UAVR,EADJ,EAcI;AAAK,IAAA,SAAS,YAAKtB,SAAL;AAAd,KACI;AAAK,IAAA,SAAS,YAAKA,SAAL;AAAd,IADJ,EAGI;AAAK,IAAA,SAAS,YAAKA,SAAL;AAAd,KACI,oBAAC,IAAD;AAAM,IAAA,IAAI,EAAEkC;AAAZ,IADJ,CAHJ,CAdJ,CAdJ,EAqCI;AAAK,IAAA,SAAS,YAAKlC,SAAL;AAAd,KACKkB,KAAK,IACF,oBAAC,UAAD;AAAY,IAAA,OAAO,EAAEM,OAArB;AAA8B,IAAA,SAAS,YAAKxB,SAAL,YAAvC;AAAgE,IAAA,KAAK,EAAEG;AAAvE,KACKe,KADL,CAFR,EAMKL,MAAM,IACH,oBAAC,WAAD;AAAa,IAAA,SAAS,YAAKb,SAAL,aAAtB;AAAgD,IAAA,KAAK,EAAEG;AAAvD,KACKU,MADL,CAPR,CArCJ,CADJ;AAoDH,CA9EsE;AA+EvEP,QAAQ,CAAC6B,WAAT,GAAuBpC,cAAvB;AACAO,QAAQ,CAACK,SAAT,GAAqBX,SAArB;AACAM,QAAQ,CAAC8B,YAAT,GAAwBlC,aAAxB;;;;"}
|
|
@@ -4,6 +4,7 @@ import React, { forwardRef, Children } from 'react';
|
|
|
4
4
|
import { g as getRootClassName, c as classnames, h as handleBasicClasses } from './getRootClassName.js';
|
|
5
5
|
import { A as Avatar } from './Avatar2.js';
|
|
6
6
|
import isFunction from 'lodash/isFunction';
|
|
7
|
+
import { T as Tooltip } from './Tooltip2.js';
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* Comment block variants.
|
|
@@ -44,6 +45,7 @@ var CommentBlock = forwardRef(function (props, ref) {
|
|
|
44
45
|
children = props.children,
|
|
45
46
|
className = props.className,
|
|
46
47
|
date = props.date,
|
|
48
|
+
fullDate = props.fullDate,
|
|
47
49
|
hasActions = props.hasActions,
|
|
48
50
|
headerActions = props.headerActions,
|
|
49
51
|
isOpen = props.isOpen,
|
|
@@ -55,7 +57,7 @@ var CommentBlock = forwardRef(function (props, ref) {
|
|
|
55
57
|
text = props.text,
|
|
56
58
|
theme = props.theme,
|
|
57
59
|
variant = props.variant,
|
|
58
|
-
forwardedProps = _objectWithoutProperties(props, ["actions", "avatarProps", "children", "className", "date", "hasActions", "headerActions", "isOpen", "isRelevant", "name", "onClick", "onMouseEnter", "onMouseLeave", "text", "theme", "variant"]);
|
|
60
|
+
forwardedProps = _objectWithoutProperties(props, ["actions", "avatarProps", "children", "className", "date", "fullDate", "hasActions", "headerActions", "isOpen", "isRelevant", "name", "onClick", "onMouseEnter", "onMouseLeave", "text", "theme", "variant"]);
|
|
59
61
|
|
|
60
62
|
var enterKeyPress = function enterKeyPress(evt) {
|
|
61
63
|
if (evt.key === 'Enter' && isFunction(onClick)) {
|
|
@@ -97,13 +99,18 @@ var CommentBlock = forwardRef(function (props, ref) {
|
|
|
97
99
|
onMouseLeave: onMouseLeave,
|
|
98
100
|
role: "button",
|
|
99
101
|
tabIndex: onClick ? 0 : -1
|
|
100
|
-
}, name),
|
|
101
|
-
className: "".concat(CLASSNAME, "__date")
|
|
102
|
-
}, date), headerActions && React.createElement("span", {
|
|
102
|
+
}, name), headerActions && React.createElement("span", {
|
|
103
103
|
className: "".concat(CLASSNAME, "__header-actions")
|
|
104
104
|
}, headerActions)), React.createElement("div", {
|
|
105
105
|
className: "".concat(CLASSNAME, "__text")
|
|
106
|
-
}, text)
|
|
106
|
+
}, text), date && (fullDate ? React.createElement(Tooltip, {
|
|
107
|
+
label: fullDate,
|
|
108
|
+
placement: "top"
|
|
109
|
+
}, React.createElement("span", {
|
|
110
|
+
className: "".concat(CLASSNAME, "__date")
|
|
111
|
+
}, date)) : React.createElement("span", {
|
|
112
|
+
className: "".concat(CLASSNAME, "__date")
|
|
113
|
+
}, date))), hasActions && React.createElement("div", {
|
|
107
114
|
className: "".concat(CLASSNAME, "__actions")
|
|
108
115
|
}, actions))), hasChildren && isOpen && React.createElement("div", {
|
|
109
116
|
className: "".concat(CLASSNAME, "__children")
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommentBlock.js","sources":["../../../src/components/comment-block/CommentBlock.tsx"],"sourcesContent":["import React, { Children, forwardRef, KeyboardEvent, KeyboardEventHandler, ReactNode } from 'react';\n\nimport classNames from 'classnames';\n\nimport { Avatar, Size, Theme } from '@lumx/react';\nimport { Comp, GenericProps, getRootClassName, handleBasicClasses, ValueOf } from '@lumx/react/utils';\n\nimport isFunction from 'lodash/isFunction';\nimport { AvatarProps } from '../avatar/Avatar';\n\n/**\n * Comment block variants.\n */\nexport const CommentBlockVariant = {\n indented: 'indented',\n linear: 'linear',\n} as const;\nexport type CommentBlockVariant = ValueOf<typeof CommentBlockVariant>;\n\n/**\n * Defines the props of the component.\n */\nexport interface CommentBlockProps extends GenericProps {\n /** Action toolbar content. */\n actions?: ReactNode;\n /** Props to pass to the avatar. */\n avatarProps: AvatarProps;\n /** Comment block replies. */\n children?: ReactNode;\n /** Comment date
|
|
1
|
+
{"version":3,"file":"CommentBlock.js","sources":["../../../src/components/comment-block/CommentBlock.tsx"],"sourcesContent":["import React, { Children, forwardRef, KeyboardEvent, KeyboardEventHandler, ReactNode } from 'react';\n\nimport classNames from 'classnames';\n\nimport { Avatar, Size, Theme, Tooltip } from '@lumx/react';\nimport { Comp, GenericProps, getRootClassName, handleBasicClasses, ValueOf } from '@lumx/react/utils';\n\nimport isFunction from 'lodash/isFunction';\nimport { AvatarProps } from '../avatar/Avatar';\n\n/**\n * Comment block variants.\n */\nexport const CommentBlockVariant = {\n indented: 'indented',\n linear: 'linear',\n} as const;\nexport type CommentBlockVariant = ValueOf<typeof CommentBlockVariant>;\n\n/**\n * Defines the props of the component.\n */\nexport interface CommentBlockProps extends GenericProps {\n /** Action toolbar content. */\n actions?: ReactNode;\n /** Props to pass to the avatar. */\n avatarProps: AvatarProps;\n /** Comment block replies. */\n children?: ReactNode;\n /** Comment date with the minimal timestamp informations (xx minutes, x hours, yesterday, 6 days, Month Day, Month Day Year)*/\n date: string;\n /** Comment date with the full timestamp informations (day, month, year, time) */\n fullDate?: string;\n /** Whether the component has actions to display or not. */\n hasActions?: boolean;\n /** Action toolbar header content. */\n headerActions?: ReactNode;\n /** Whether the component is open or not. */\n isOpen?: boolean;\n /** Whether the comment is relevant or not. */\n isRelevant?: boolean;\n /** Comment author name. */\n name: string;\n /** On click callback. */\n onClick?(): void;\n /** On mouse enter callback. */\n onMouseEnter?(): void;\n /** On mouse leave callback. */\n onMouseLeave?(): void;\n /** Comment content. */\n text: ReactNode | string;\n /** Theme adapting the component to light or dark background. */\n theme?: Theme;\n /** Comment variant. */\n variant?: CommentBlockVariant;\n}\n\n/**\n * Component display name.\n */\nconst COMPONENT_NAME = 'CommentBlock';\n\n/**\n * Component default class name and class prefix.\n */\nconst CLASSNAME = getRootClassName(COMPONENT_NAME);\n\n/**\n * Component default props.\n */\nconst DEFAULT_PROPS: Partial<CommentBlockProps> = {\n theme: Theme.light,\n variant: CommentBlockVariant.indented,\n};\n\n/**\n * CommentBlock component.\n *\n * @param props Component props.\n * @param ref Component ref.\n * @return React element.\n */\nexport const CommentBlock: Comp<CommentBlockProps, HTMLDivElement> = forwardRef((props, ref) => {\n const {\n actions,\n avatarProps,\n children,\n className,\n date,\n fullDate,\n hasActions,\n headerActions,\n isOpen,\n isRelevant,\n name,\n onClick,\n onMouseEnter,\n onMouseLeave,\n text,\n theme,\n variant,\n ...forwardedProps\n } = props;\n const enterKeyPress: KeyboardEventHandler<HTMLElement> = (evt: KeyboardEvent<HTMLElement>) => {\n if (evt.key === 'Enter' && isFunction(onClick)) {\n onClick();\n }\n };\n const hasChildren = Children.count(children) > 0;\n\n return (\n <div\n ref={ref}\n className={classNames(\n className,\n handleBasicClasses({\n hasChildren: hasChildren && isOpen,\n hasIndentedChildren: hasChildren && variant === CommentBlockVariant.indented,\n hasLinearChildren: hasChildren && variant === CommentBlockVariant.linear,\n isRelevant,\n prefix: CLASSNAME,\n theme,\n }),\n )}\n {...forwardedProps}\n >\n <div className={`${CLASSNAME}__wrapper`}>\n <div className={`${CLASSNAME}__avatar`}>\n <Avatar\n {...avatarProps}\n size={Size.m}\n tabIndex={onClick ? 0 : -1}\n onClick={onClick}\n onKeyPress={enterKeyPress}\n />\n </div>\n\n <div className={`${CLASSNAME}__container`}>\n <div className={`${CLASSNAME}__content`}>\n <div className={`${CLASSNAME}__meta`}>\n <span\n className={`${CLASSNAME}__name`}\n onClick={onClick}\n onKeyPress={enterKeyPress}\n onMouseEnter={onMouseEnter}\n onMouseLeave={onMouseLeave}\n role=\"button\"\n tabIndex={onClick ? 0 : -1}\n >\n {name}\n </span>\n {headerActions && <span className={`${CLASSNAME}__header-actions`}>{headerActions}</span>}\n </div>\n\n <div className={`${CLASSNAME}__text`}>{text}</div>\n {date &&\n (fullDate ? (\n <Tooltip label={fullDate} placement=\"top\">\n <span className={`${CLASSNAME}__date`}>{date}</span>\n </Tooltip>\n ) : (\n <span className={`${CLASSNAME}__date`}>{date}</span>\n ))}\n </div>\n {hasActions && <div className={`${CLASSNAME}__actions`}>{actions}</div>}\n </div>\n </div>\n\n {hasChildren && isOpen && <div className={`${CLASSNAME}__children`}>{children}</div>}\n </div>\n );\n});\nCommentBlock.displayName = COMPONENT_NAME;\nCommentBlock.className = CLASSNAME;\nCommentBlock.defaultProps = DEFAULT_PROPS;\n"],"names":["CommentBlockVariant","indented","linear","COMPONENT_NAME","CLASSNAME","getRootClassName","DEFAULT_PROPS","theme","Theme","light","variant","CommentBlock","forwardRef","props","ref","actions","avatarProps","children","className","date","fullDate","hasActions","headerActions","isOpen","isRelevant","name","onClick","onMouseEnter","onMouseLeave","text","forwardedProps","enterKeyPress","evt","key","isFunction","hasChildren","Children","count","classNames","handleBasicClasses","hasIndentedChildren","hasLinearChildren","prefix","Size","m","displayName","defaultProps"],"mappings":";;;;;;;;AAUA;;;IAGaA,mBAAmB,GAAG;AAC/BC,EAAAA,QAAQ,EAAE,UADqB;AAE/BC,EAAAA,MAAM,EAAE;AAFuB;;AA4CnC;;;AAGA,IAAMC,cAAc,GAAG,cAAvB;AAEA;;;;AAGA,IAAMC,SAAS,GAAGC,gBAAgB,CAACF,cAAD,CAAlC;AAEA;;;;AAGA,IAAMG,aAAyC,GAAG;AAC9CC,EAAAA,KAAK,EAAEC,KAAK,CAACC,KADiC;AAE9CC,EAAAA,OAAO,EAAEV,mBAAmB,CAACC;AAFiB,CAAlD;AAKA;;;;;;;;IAOaU,YAAqD,GAAGC,UAAU,CAAC,UAACC,KAAD,EAAQC,GAAR,EAAgB;AAAA,MAExFC,OAFwF,GAoBxFF,KApBwF,CAExFE,OAFwF;AAAA,MAGxFC,WAHwF,GAoBxFH,KApBwF,CAGxFG,WAHwF;AAAA,MAIxFC,QAJwF,GAoBxFJ,KApBwF,CAIxFI,QAJwF;AAAA,MAKxFC,SALwF,GAoBxFL,KApBwF,CAKxFK,SALwF;AAAA,MAMxFC,IANwF,GAoBxFN,KApBwF,CAMxFM,IANwF;AAAA,MAOxFC,QAPwF,GAoBxFP,KApBwF,CAOxFO,QAPwF;AAAA,MAQxFC,UARwF,GAoBxFR,KApBwF,CAQxFQ,UARwF;AAAA,MASxFC,aATwF,GAoBxFT,KApBwF,CASxFS,aATwF;AAAA,MAUxFC,MAVwF,GAoBxFV,KApBwF,CAUxFU,MAVwF;AAAA,MAWxFC,UAXwF,GAoBxFX,KApBwF,CAWxFW,UAXwF;AAAA,MAYxFC,IAZwF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A6DH,CAzF8E;AA0F/EN,YAAY,CAACkC,WAAb,GAA2B1C,cAA3B;AACAQ,YAAY,CAACO,SAAb,GAAyBd,SAAzB;AACAO,YAAY,CAACmC,YAAb,GAA4BxC,aAA5B;;;;"}
|
|
@@ -77,7 +77,8 @@ var DEFAULT_PROPS = {
|
|
|
77
77
|
fitToAnchorWidth: true,
|
|
78
78
|
fitWithinViewportHeight: true,
|
|
79
79
|
placement: Placement.BOTTOM_START,
|
|
80
|
-
shouldFocusOnOpen: true
|
|
80
|
+
shouldFocusOnOpen: true,
|
|
81
|
+
focusAnchorOnClose: true
|
|
81
82
|
};
|
|
82
83
|
/**
|
|
83
84
|
* Dropdown component.
|
|
@@ -98,12 +99,13 @@ var Dropdown = forwardRef(function (props, ref) {
|
|
|
98
99
|
fitWithinViewportHeight = props.fitWithinViewportHeight,
|
|
99
100
|
isOpen = props.isOpen,
|
|
100
101
|
offset = props.offset,
|
|
102
|
+
focusAnchorOnClose = props.focusAnchorOnClose,
|
|
101
103
|
onClose = props.onClose,
|
|
102
104
|
onInfiniteScroll = props.onInfiniteScroll,
|
|
103
105
|
placement = props.placement,
|
|
104
106
|
shouldFocusOnOpen = props.shouldFocusOnOpen,
|
|
105
107
|
zIndex = props.zIndex,
|
|
106
|
-
forwardedProps = _objectWithoutProperties(props, ["anchorRef", "children", "className", "closeOnClick", "closeOnClickAway", "closeOnEscape", "fitToAnchorWidth", "fitWithinViewportHeight", "isOpen", "offset", "onClose", "onInfiniteScroll", "placement", "shouldFocusOnOpen", "zIndex"]);
|
|
108
|
+
forwardedProps = _objectWithoutProperties(props, ["anchorRef", "children", "className", "closeOnClick", "closeOnClickAway", "closeOnEscape", "fitToAnchorWidth", "fitWithinViewportHeight", "isOpen", "offset", "focusAnchorOnClose", "onClose", "onInfiniteScroll", "placement", "shouldFocusOnOpen", "zIndex"]);
|
|
107
109
|
|
|
108
110
|
var innerRef = useRef(null);
|
|
109
111
|
var listElement = useRef(null);
|
|
@@ -126,6 +128,7 @@ var Dropdown = forwardRef(function (props, ref) {
|
|
|
126
128
|
return isOpen ? React.createElement(Popover, _extends({
|
|
127
129
|
ref: ref
|
|
128
130
|
}, forwardedProps, {
|
|
131
|
+
focusAnchorOnClose: focusAnchorOnClose,
|
|
129
132
|
anchorRef: anchorRef,
|
|
130
133
|
className: classnames(className, handleBasicClasses({
|
|
131
134
|
prefix: CLASSNAME
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dropdown2.js","sources":["../../../src/hooks/useInfiniteScroll.tsx","../../../src/components/dropdown/Dropdown.tsx"],"sourcesContent":["import React, { useEffect } from 'react';\n\ntype useInfiniteScrollType = (\n ref: React.RefObject<HTMLElement>,\n callback?: EventCallback,\n callbackOnMount?: boolean,\n) => void;\ntype EventCallback = (evt?: Event) => void;\n\n// The error margin in px we want to have for triggering infinite scroll\nconst SCROLL_TRIGGER_MARGIN = 5;\n\n/**\n * Listen to clicks away from a given element and callback the passed in function.\n *\n * @param ref A reference to the element on which you want to listen scroll event.\n * @param [callback] A callback function to call when the bottom of the reference element is reached.\n * @param [callbackOnMount] A callback function to call when the component is mounted.\n */\nexport const useInfiniteScroll: useInfiniteScrollType = (\n ref,\n callback,\n callbackOnMount = false,\n scrollTriggerMargin = SCROLL_TRIGGER_MARGIN,\n) => {\n useEffect(() => {\n const { current } = ref;\n if (!callback || !current) {\n return undefined;\n }\n\n const isAtBottom = () =>\n Boolean(\n current && current.scrollHeight - (current.scrollTop + current.clientHeight) <= scrollTriggerMargin,\n );\n\n const onScroll = (e?: Event): void => {\n if (isAtBottom()) {\n callback(e);\n }\n };\n\n if (isAtBottom()) {\n onScroll();\n }\n\n current.addEventListener('scroll', onScroll);\n current.addEventListener('resize', onScroll);\n return () => {\n current.removeEventListener('scroll', onScroll);\n current.removeEventListener('resize', onScroll);\n };\n }, [ref, callback, scrollTriggerMargin]);\n\n useEffect(() => {\n if (callback && callbackOnMount) {\n callback();\n }\n }, [callback, callbackOnMount]);\n};\n","import React, { cloneElement, forwardRef, useMemo, useRef } from 'react';\n\nimport classNames from 'classnames';\n\nimport { List, ListProps } from '@lumx/react/components/list/List';\nimport { Offset, Placement, Popover } from '@lumx/react/components/popover/Popover';\nimport { useInfiniteScroll } from '@lumx/react/hooks/useInfiniteScroll';\nimport { Comp, GenericProps, getRootClassName, handleBasicClasses, isComponent } from '@lumx/react/utils';\n\n/**\n * Defines the props of the component.\n */\nexport interface DropdownProps extends GenericProps {\n /** Reference to the element around which the dropdown is placed.\n * @see {@link PopoverProps#anchorRef}\n */\n anchorRef: React.RefObject<HTMLElement>;\n /** Dropdown content. */\n children: React.ReactNode;\n /**\n * Whether a click anywhere out of the Dropdown would close it or not.\n * @see {@link PopoverProps#closeOnClickAway}\n */\n closeOnClickAway?: boolean;\n /**\n * Whether to close the Dropdown when clicking in it or not.\n */\n closeOnClick?: boolean;\n /**\n * Whether an escape key press would close the Dropdown or not.\n * @see {@link PopoverProps#closeOnEscape}\n */\n closeOnEscape?: boolean;\n /**\n * Whether the dropdown should fit to the anchor width (if dropdown is smaller) or not.\n * @see {@link PopoverProps#fitToAnchorWidth}\n */\n fitToAnchorWidth?: boolean;\n /**\n * Whether the dropdown should shrink to fit within the viewport height or not.\n * @see {@link PopoverProps#fitWithinViewportHeight}\n */\n fitWithinViewportHeight?: boolean;\n /**\n * Whether the dropdown should be displayed or not. Useful to control the Dropdown from outside the component.\n * @see {@link PopoverProps#isOpen}\n */\n isOpen: boolean;\n /**\n * Offset applied to the Dropdown position.\n * @see {@link PopoverProps#offset}\n */\n offset?: Offset;\n /**\n * Preferred Dropdown placement against the anchor element.\n * @see {@link PopoverProps#placement}\n */\n placement?: Placement;\n /** Whether the focus should be set on the list when the dropdown is open or not. */\n shouldFocusOnOpen?: boolean;\n /**\n * Z-axis position.\n * @see {@link PopoverProps#zIndex}\n */\n zIndex?: number;\n /**\n * On close callback.\n * @see {@link PopoverProps#onClose}\n */\n onClose?(): void;\n /** On scroll end callback. */\n onInfiniteScroll?(): void;\n}\n\n/**\n * Component display name.\n */\nconst COMPONENT_NAME = 'Dropdown';\n\n/**\n * Component default class name and class prefix.\n */\nconst CLASSNAME = getRootClassName(COMPONENT_NAME);\n\n/**\n * Component default props.\n */\nconst DEFAULT_PROPS: Partial<DropdownProps> = {\n closeOnClick: true,\n closeOnClickAway: true,\n closeOnEscape: true,\n fitToAnchorWidth: true,\n fitWithinViewportHeight: true,\n placement: Placement.BOTTOM_START,\n shouldFocusOnOpen: true,\n};\n\n/**\n * Dropdown component.\n *\n * @param props Component props.\n * @param ref Component ref.\n * @return React element.\n */\nexport const Dropdown: Comp<DropdownProps, HTMLDivElement> = forwardRef((props, ref) => {\n const {\n anchorRef,\n children,\n className,\n closeOnClick,\n closeOnClickAway,\n closeOnEscape,\n fitToAnchorWidth,\n fitWithinViewportHeight,\n isOpen,\n offset,\n onClose,\n onInfiniteScroll,\n placement,\n shouldFocusOnOpen,\n zIndex,\n ...forwardedProps\n } = props;\n const innerRef = useRef<HTMLDivElement>(null);\n const listElement = useRef(null);\n\n useInfiniteScroll(innerRef, onInfiniteScroll);\n\n const popperElement = useMemo(() => {\n return !Array.isArray(children) && isComponent(List)(children)\n ? cloneElement<ListProps>(children, {\n ...children.props,\n ref: listElement,\n onClick(evt: MouseEvent) {\n children.props.onClick?.(evt);\n\n if (closeOnClick) {\n onClose?.();\n }\n },\n isClickable: true,\n })\n : children;\n }, [children, closeOnClick, onClose]);\n\n return isOpen ? (\n <Popover\n ref={ref}\n {...forwardedProps}\n anchorRef={anchorRef}\n className={classNames(className, handleBasicClasses({ prefix: CLASSNAME }))}\n elevation={0 as any}\n closeOnClickAway={closeOnClickAway}\n closeOnEscape={closeOnEscape}\n fitToAnchorWidth={fitToAnchorWidth}\n fitWithinViewportHeight={fitWithinViewportHeight}\n focusElement={shouldFocusOnOpen ? listElement : undefined}\n isOpen={isOpen}\n offset={offset}\n onClose={onClose}\n placement={placement}\n zIndex={zIndex}\n >\n <div className={`${CLASSNAME}__menu`} ref={innerRef}>\n {popperElement}\n </div>\n </Popover>\n ) : null;\n});\nDropdown.displayName = COMPONENT_NAME;\nDropdown.className = CLASSNAME;\nDropdown.defaultProps = DEFAULT_PROPS;\n"],"names":["SCROLL_TRIGGER_MARGIN","useInfiniteScroll","ref","callback","callbackOnMount","scrollTriggerMargin","useEffect","current","undefined","isAtBottom","Boolean","scrollHeight","scrollTop","clientHeight","onScroll","e","addEventListener","removeEventListener","COMPONENT_NAME","CLASSNAME","getRootClassName","DEFAULT_PROPS","closeOnClick","closeOnClickAway","closeOnEscape","fitToAnchorWidth","fitWithinViewportHeight","placement","Placement","BOTTOM_START","shouldFocusOnOpen","Dropdown","forwardRef","props","anchorRef","children","className","isOpen","offset","onClose","onInfiniteScroll","zIndex","forwardedProps","innerRef","useRef","listElement","popperElement","useMemo","Array","isArray","isComponent","List","cloneElement","onClick","evt","isClickable","classNames","handleBasicClasses","prefix","displayName","defaultProps"],"mappings":";;;;;;;AASA;AACA,IAAMA,qBAAqB,GAAG,CAA9B;AAEA;;;;;;;;AAOO,IAAMC,iBAAwC,GAAG,SAA3CA,iBAA2C,CACpDC,GADoD,EAEpDC,QAFoD,EAKnD;AAAA,MAFDC,eAEC,uEAFiB,KAEjB;AAAA,MADDC,mBACC,uEADqBL,qBACrB;AACDM,EAAAA,SAAS,CAAC,YAAM;AAAA,QACJC,OADI,GACQL,GADR,CACJK,OADI;;AAEZ,QAAI,CAACJ,QAAD,IAAa,CAACI,OAAlB,EAA2B;AACvB,aAAOC,SAAP;AACH;;AAED,QAAMC,UAAU,GAAG,SAAbA,UAAa;AAAA,aACfC,OAAO,CACHH,OAAO,IAAIA,OAAO,CAACI,YAAR,IAAwBJ,OAAO,CAACK,SAAR,GAAoBL,OAAO,CAACM,YAApD,KAAqER,mBAD7E,CADQ;AAAA,KAAnB;;AAKA,QAAMS,QAAQ,GAAG,SAAXA,QAAW,CAACC,CAAD,EAAqB;AAClC,UAAIN,UAAU,EAAd,EAAkB;AACdN,QAAAA,QAAQ,C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":3,"file":"Dropdown2.js","sources":["../../../src/hooks/useInfiniteScroll.tsx","../../../src/components/dropdown/Dropdown.tsx"],"sourcesContent":["import React, { useEffect } from 'react';\n\ntype useInfiniteScrollType = (\n ref: React.RefObject<HTMLElement>,\n callback?: EventCallback,\n callbackOnMount?: boolean,\n) => void;\ntype EventCallback = (evt?: Event) => void;\n\n// The error margin in px we want to have for triggering infinite scroll\nconst SCROLL_TRIGGER_MARGIN = 5;\n\n/**\n * Listen to clicks away from a given element and callback the passed in function.\n *\n * @param ref A reference to the element on which you want to listen scroll event.\n * @param [callback] A callback function to call when the bottom of the reference element is reached.\n * @param [callbackOnMount] A callback function to call when the component is mounted.\n */\nexport const useInfiniteScroll: useInfiniteScrollType = (\n ref,\n callback,\n callbackOnMount = false,\n scrollTriggerMargin = SCROLL_TRIGGER_MARGIN,\n) => {\n useEffect(() => {\n const { current } = ref;\n if (!callback || !current) {\n return undefined;\n }\n\n const isAtBottom = () =>\n Boolean(\n current && current.scrollHeight - (current.scrollTop + current.clientHeight) <= scrollTriggerMargin,\n );\n\n const onScroll = (e?: Event): void => {\n if (isAtBottom()) {\n callback(e);\n }\n };\n\n if (isAtBottom()) {\n onScroll();\n }\n\n current.addEventListener('scroll', onScroll);\n current.addEventListener('resize', onScroll);\n return () => {\n current.removeEventListener('scroll', onScroll);\n current.removeEventListener('resize', onScroll);\n };\n }, [ref, callback, scrollTriggerMargin]);\n\n useEffect(() => {\n if (callback && callbackOnMount) {\n callback();\n }\n }, [callback, callbackOnMount]);\n};\n","import React, { cloneElement, forwardRef, useMemo, useRef } from 'react';\n\nimport classNames from 'classnames';\n\nimport { List, ListProps } from '@lumx/react/components/list/List';\nimport { Offset, Placement, Popover } from '@lumx/react/components/popover/Popover';\nimport { useInfiniteScroll } from '@lumx/react/hooks/useInfiniteScroll';\nimport { Comp, GenericProps, getRootClassName, handleBasicClasses, isComponent } from '@lumx/react/utils';\n\n/**\n * Defines the props of the component.\n */\nexport interface DropdownProps extends GenericProps {\n /** Reference to the element around which the dropdown is placed.\n * @see {@link PopoverProps#anchorRef}\n */\n anchorRef: React.RefObject<HTMLElement>;\n /** Dropdown content. */\n children: React.ReactNode;\n /**\n * Whether a click anywhere out of the Dropdown would close it or not.\n * @see {@link PopoverProps#closeOnClickAway}\n */\n closeOnClickAway?: boolean;\n /**\n * Whether to close the Dropdown when clicking in it or not.\n */\n closeOnClick?: boolean;\n /**\n * Whether an escape key press would close the Dropdown or not.\n * @see {@link PopoverProps#closeOnEscape}\n */\n closeOnEscape?: boolean;\n /**\n * Whether the dropdown should fit to the anchor width (if dropdown is smaller) or not.\n * @see {@link PopoverProps#fitToAnchorWidth}\n */\n fitToAnchorWidth?: boolean;\n /**\n * Whether the dropdown should shrink to fit within the viewport height or not.\n * @see {@link PopoverProps#fitWithinViewportHeight}\n */\n fitWithinViewportHeight?: boolean;\n /**\n * Whether the dropdown should be displayed or not. Useful to control the Dropdown from outside the component.\n * @see {@link PopoverProps#isOpen}\n */\n isOpen: boolean;\n /**\n * Offset applied to the Dropdown position.\n * @see {@link PopoverProps#offset}\n */\n offset?: Offset;\n /**\n * Preferred Dropdown placement against the anchor element.\n * @see {@link PopoverProps#placement}\n */\n placement?: Placement;\n /** Whether the focus should be set on the list when the dropdown is open or not. */\n shouldFocusOnOpen?: boolean;\n /** Whether the focus should go back on the anchor when dropdown closes and focus is within. */\n focusAnchorOnClose?: boolean;\n /**\n * Z-axis position.\n * @see {@link PopoverProps#zIndex}\n */\n zIndex?: number;\n /**\n * On close callback.\n * @see {@link PopoverProps#onClose}\n */\n onClose?(): void;\n /** On scroll end callback. */\n onInfiniteScroll?(): void;\n}\n\n/**\n * Component display name.\n */\nconst COMPONENT_NAME = 'Dropdown';\n\n/**\n * Component default class name and class prefix.\n */\nconst CLASSNAME = getRootClassName(COMPONENT_NAME);\n\n/**\n * Component default props.\n */\nconst DEFAULT_PROPS: Partial<DropdownProps> = {\n closeOnClick: true,\n closeOnClickAway: true,\n closeOnEscape: true,\n fitToAnchorWidth: true,\n fitWithinViewportHeight: true,\n placement: Placement.BOTTOM_START,\n shouldFocusOnOpen: true,\n focusAnchorOnClose: true,\n};\n\n/**\n * Dropdown component.\n *\n * @param props Component props.\n * @param ref Component ref.\n * @return React element.\n */\nexport const Dropdown: Comp<DropdownProps, HTMLDivElement> = forwardRef((props, ref) => {\n const {\n anchorRef,\n children,\n className,\n closeOnClick,\n closeOnClickAway,\n closeOnEscape,\n fitToAnchorWidth,\n fitWithinViewportHeight,\n isOpen,\n offset,\n focusAnchorOnClose,\n onClose,\n onInfiniteScroll,\n placement,\n shouldFocusOnOpen,\n zIndex,\n ...forwardedProps\n } = props;\n const innerRef = useRef<HTMLDivElement>(null);\n const listElement = useRef(null);\n\n useInfiniteScroll(innerRef, onInfiniteScroll);\n\n const popperElement = useMemo(() => {\n return !Array.isArray(children) && isComponent(List)(children)\n ? cloneElement<ListProps>(children, {\n ...children.props,\n ref: listElement,\n onClick(evt: MouseEvent) {\n children.props.onClick?.(evt);\n\n if (closeOnClick) {\n onClose?.();\n }\n },\n isClickable: true,\n })\n : children;\n }, [children, closeOnClick, onClose]);\n\n return isOpen ? (\n <Popover\n ref={ref}\n {...forwardedProps}\n focusAnchorOnClose={focusAnchorOnClose}\n anchorRef={anchorRef}\n className={classNames(className, handleBasicClasses({ prefix: CLASSNAME }))}\n elevation={0 as any}\n closeOnClickAway={closeOnClickAway}\n closeOnEscape={closeOnEscape}\n fitToAnchorWidth={fitToAnchorWidth}\n fitWithinViewportHeight={fitWithinViewportHeight}\n focusElement={shouldFocusOnOpen ? listElement : undefined}\n isOpen={isOpen}\n offset={offset}\n onClose={onClose}\n placement={placement}\n zIndex={zIndex}\n >\n <div className={`${CLASSNAME}__menu`} ref={innerRef}>\n {popperElement}\n </div>\n </Popover>\n ) : null;\n});\nDropdown.displayName = COMPONENT_NAME;\nDropdown.className = CLASSNAME;\nDropdown.defaultProps = DEFAULT_PROPS;\n"],"names":["SCROLL_TRIGGER_MARGIN","useInfiniteScroll","ref","callback","callbackOnMount","scrollTriggerMargin","useEffect","current","undefined","isAtBottom","Boolean","scrollHeight","scrollTop","clientHeight","onScroll","e","addEventListener","removeEventListener","COMPONENT_NAME","CLASSNAME","getRootClassName","DEFAULT_PROPS","closeOnClick","closeOnClickAway","closeOnEscape","fitToAnchorWidth","fitWithinViewportHeight","placement","Placement","BOTTOM_START","shouldFocusOnOpen","focusAnchorOnClose","Dropdown","forwardRef","props","anchorRef","children","className","isOpen","offset","onClose","onInfiniteScroll","zIndex","forwardedProps","innerRef","useRef","listElement","popperElement","useMemo","Array","isArray","isComponent","List","cloneElement","onClick","evt","isClickable","classNames","handleBasicClasses","prefix","displayName","defaultProps"],"mappings":";;;;;;;AASA;AACA,IAAMA,qBAAqB,GAAG,CAA9B;AAEA;;;;;;;;AAOO,IAAMC,iBAAwC,GAAG,SAA3CA,iBAA2C,CACpDC,GADoD,EAEpDC,QAFoD,EAKnD;AAAA,MAFDC,eAEC,uEAFiB,KAEjB;AAAA,MADDC,mBACC,uEADqBL,qBACrB;AACDM,EAAAA,SAAS,CAAC,YAAM;AAAA,QACJC,OADI,GACQL,GADR,CACJK,OADI;;AAEZ,QAAI,CAACJ,QAAD,IAAa,CAACI,OAAlB,EAA2B;AACvB,aAAOC,SAAP;AACH;;AAED,QAAMC,UAAU,GAAG,SAAbA,UAAa;AAAA,aACfC,OAAO,CACHH,OAAO,IAAIA,OAAO,CAACI,YAAR,IAAwBJ,OAAO,CAACK,SAAR,GAAoBL,OAAO,CAACM,YAApD,KAAqER,mBAD7E,CADQ;AAAA,KAAnB;;AAKA,QAAMS,QAAQ,GAAG,SAAXA,QAAW,CAACC,CAAD,EAAqB;AAClC,UAAIN,UAAU,EAAd,EAAkB;AACdN,QAAAA,QAAQ,CAACY,CAAD,CAAR;AACH;AACJ,KAJD;;AAMA,QAAIN,UAAU,EAAd,EAAkB;AACdK,MAAAA,QAAQ;AACX;;AAEDP,IAAAA,OAAO,CAACS,gBAAR,CAAyB,QAAzB,EAA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GED
|
@@ -742,6 +742,13 @@ var COMPONENT_NAME$1 = 'List';
|
|
|
742
742
|
*/
|
|
743
743
|
|
|
744
744
|
var CLASSNAME$1 = getRootClassName(COMPONENT_NAME$1);
|
|
745
|
+
/**
|
|
746
|
+
* Component default props.
|
|
747
|
+
*/
|
|
748
|
+
|
|
749
|
+
var DEFAULT_PROPS$1 = {
|
|
750
|
+
tabIndex: -1
|
|
751
|
+
};
|
|
745
752
|
/* eslint-disable jsx-a11y/no-noninteractive-tabindex */
|
|
746
753
|
|
|
747
754
|
/**
|
|
@@ -758,7 +765,8 @@ var InternalList = forwardRef(function (props, ref) {
|
|
|
758
765
|
isClickable = props.isClickable,
|
|
759
766
|
itemPadding = props.itemPadding,
|
|
760
767
|
onListItemSelected = props.onListItemSelected,
|
|
761
|
-
|
|
768
|
+
tabIndex = props.tabIndex,
|
|
769
|
+
forwardedProps = _objectWithoutProperties(props, ["children", "className", "isClickable", "itemPadding", "onListItemSelected", "tabIndex"]);
|
|
762
770
|
|
|
763
771
|
var listElementRef = useRef(null);
|
|
764
772
|
|
|
@@ -776,12 +784,13 @@ var InternalList = forwardRef(function (props, ref) {
|
|
|
776
784
|
prefix: CLASSNAME$1,
|
|
777
785
|
itemPadding: itemPadding !== null && itemPadding !== void 0 ? itemPadding : clickable ? Size.big : undefined
|
|
778
786
|
})),
|
|
779
|
-
tabIndex:
|
|
787
|
+
tabIndex: tabIndex,
|
|
780
788
|
ref: mergeRefs(ref, listElementRef)
|
|
781
789
|
}), items);
|
|
782
790
|
});
|
|
783
791
|
InternalList.displayName = COMPONENT_NAME$1;
|
|
784
792
|
InternalList.className = CLASSNAME$1;
|
|
793
|
+
InternalList.defaultProps = DEFAULT_PROPS$1;
|
|
785
794
|
var List = Object.assign(InternalList, {
|
|
786
795
|
useKeyboardListNavigation: useKeyboardListNavigation
|
|
787
796
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"List2.js","sources":["../../../src/hooks/useKeyboardListNavigation.tsx","../../../src/components/list/ListItem.tsx","../../../../../node_modules/react-is/cjs/react-is.production.min.js","../../../../../node_modules/react-is/cjs/react-is.development.js","../../../../../node_modules/react-is/index.js","../../../src/utils/flattenChildren.ts","../../../src/components/list/useInteractiveList.tsx","../../../src/components/list/List.tsx"],"sourcesContent":["import { RefObject, SetStateAction, useEffect, useState } from 'react';\n\nimport get from 'lodash/get';\n\ntype Listener = (evt: KeyboardEvent) => void;\n\ninterface UseKeyboardListNavigationType {\n /** the current active index */\n activeItemIndex: number;\n /** callback to be used when a key is pressed. usually used with the native prop `onKeyDown` */\n onKeyboardNavigation: Listener;\n /** Resets the active index to the initial state */\n resetActiveIndex(): void;\n /** Sets the active index to a given value */\n setActiveItemIndex(value: SetStateAction<number>): void;\n}\n\nexport type useKeyboardListNavigationType = <I>(\n items: I[],\n ref: RefObject<HTMLElement>,\n onListItemSelected: (itemSelected: I) => void,\n onListItemNavigated?: (itemSelected: I) => void,\n onEnterPressed?: (itemSelected: string) => void,\n onBackspacePressed?: Listener,\n keepFocusAfterSelection?: boolean,\n initialIndex?: number,\n preventTabOnEnteredValue?: boolean,\n) => UseKeyboardListNavigationType;\n\nconst INITIAL_INDEX = -1;\n\n/**\n * This custom hook provides the necessary set of functions and values to properly navigate\n * a list using the keyboard.\n *\n * @param items the list of items that will be navigated using the keyboard.\n * @param ref A reference to the element that is controlling the navigation.\n * @param onListItemSelected callback to be executed when the ENTER key is pressed on an item.\n * @param onListItemNavigated callback to be executed when the Arrow keys are pressed.\n * @param onEnterPressed callback to be executed when the ENTER key is pressed.\n * @param onBackspacePressed callback to be executed when the BACKSPACE key is pressed.\n * @param keepFocusAfterSelection determines whether after selecting an item, the focus should be maintained on the current target or not.\n * @param initialIndex where should the navigation start from. it defaults to `-1`, so the first item navigated is the item on position `0`.\n * @param preventTabOnEnteredValue determines whether upon TAB, if there is a value entered, the event is prevented or not.\n * @return useKeyboardListNavigation helpers.\n */\nexport const useKeyboardListNavigation: useKeyboardListNavigationType = (\n items,\n ref,\n onListItemSelected,\n onListItemNavigated,\n onEnterPressed,\n onBackspacePressed,\n keepFocusAfterSelection = false,\n initialIndex = INITIAL_INDEX,\n preventTabOnEnteredValue = true,\n) => {\n const [activeItemIndex, setActiveItemIndex] = useState(initialIndex);\n\n /**\n * This function calculates the next index in the list to be highlighted\n * @param key - key code pressed\n * @return next active index\n */\n const calculateActiveIndex = (key: string): number => {\n switch (key) {\n case 'ArrowDown':\n return activeItemIndex + 1 < items.length ? activeItemIndex + 1 : 0;\n case 'ArrowUp':\n return activeItemIndex - 1 >= 0 ? activeItemIndex - 1 : items.length - 1;\n default:\n return initialIndex;\n }\n };\n\n /**\n * Resets the active index to the initial state\n */\n const resetActiveIndex = () => {\n setActiveItemIndex(initialIndex);\n };\n\n /**\n * Prevents the default event and stops the propagation of said event\n * @param evt - key pressed event\n */\n const preventDefaultAndStopPropagation: Listener = (evt) => {\n evt.preventDefault();\n evt.stopPropagation();\n };\n\n /**\n * Handles navigation with the arrows using the keyboard\n * @param evt - key pressed event\n */\n const onArrowPressed: Listener = (evt) => {\n const { key } = evt;\n const nextActiveIndex = calculateActiveIndex(key);\n setActiveItemIndex(nextActiveIndex);\n preventDefaultAndStopPropagation(evt);\n if (onListItemNavigated) {\n const selectedItem = items[nextActiveIndex];\n onListItemNavigated(selectedItem);\n }\n };\n\n /**\n * Handles the event when the backspace key is pressed\n * @param evt - key pressed event\n */\n const onBackspaceKeyPressed: Listener = (evt) => {\n if (onBackspacePressed) {\n onBackspacePressed(evt);\n }\n };\n\n /**\n * Handles when the ENTER key is pressed\n * @param evt - key pressed event\n */\n const onEnterKeyPressed: Listener = (evt) => {\n if (!onListItemSelected) {\n return;\n }\n\n preventDefaultAndStopPropagation(evt);\n\n if (!keepFocusAfterSelection) {\n (evt.currentTarget as HTMLElement).blur();\n }\n\n const selectedItem = items[activeItemIndex];\n\n if (selectedItem) {\n onListItemSelected(selectedItem);\n resetActiveIndex();\n } else if (activeItemIndex === initialIndex && onEnterPressed) {\n const value = get(evt, 'target.value');\n onEnterPressed(value);\n resetActiveIndex();\n }\n };\n\n /**\n * Handles when the TAB key is pressed\n * @param evt - key pressed event\n */\n const onTabKeyPressed: Listener = (evt) => {\n const value = get(evt, 'target.value');\n\n if (preventTabOnEnteredValue && value && value.length > 0) {\n preventDefaultAndStopPropagation(evt);\n }\n };\n\n /**\n * In order to make it easier in the future to add new events depending on the key\n * a map was created to add these handlers. In the future, if there is another event\n * that we need to manage depending on a specific key, we just need to add the key code\n * here, and as a value, the handler for said key.\n */\n const eventsForKeyPressed: Record<string, Listener> = {\n ArrowDown: onArrowPressed,\n Tab: onTabKeyPressed,\n ArrowUp: onArrowPressed,\n Enter: onEnterKeyPressed,\n Backspace: onBackspaceKeyPressed,\n };\n\n /**\n * Calculates the next active item index depending on the key pressed.\n * If the key pressed was ENTER, the function executes the callback `onListItemSelected`\n * and resets the active index, since an item was selected.\n * @param evt - key pressed or key down event\n */\n const onKeyboardNavigation: Listener = (evt) => {\n const { key } = evt;\n const handler = eventsForKeyPressed[key];\n\n if (handler) {\n handler(evt);\n }\n };\n\n useEffect(() => {\n const { current: currentElement } = ref;\n if (!currentElement) {\n return undefined;\n }\n currentElement.addEventListener('focus', resetActiveIndex);\n currentElement.addEventListener('keydown', onKeyboardNavigation);\n return () => {\n currentElement.removeEventListener('focus', resetActiveIndex);\n currentElement.removeEventListener('keydown', onKeyboardNavigation);\n };\n });\n\n return {\n activeItemIndex,\n onKeyboardNavigation,\n resetActiveIndex,\n setActiveItemIndex,\n };\n};\n","import React, { forwardRef, ReactNode, Ref, SyntheticEvent, useMemo } from 'react';\n\nimport classNames from 'classnames';\nimport isEmpty from 'lodash/isEmpty';\n\nimport { ListProps, Size } from '@lumx/react';\nimport {\n Comp,\n GenericProps,\n getRootClassName,\n handleBasicClasses,\n onEnterPressed,\n onButtonPressed,\n} from '@lumx/react/utils';\nimport { renderLink } from '@lumx/react/utils/renderLink';\n\nexport type ListItemSize = Extract<Size, 'tiny' | 'regular' | 'big' | 'huge'>;\n\n/**\n * Defines the props of the component.\n */\nexport interface ListItemProps extends GenericProps {\n /** A component to be rendered after the content. */\n after?: ReactNode;\n /** A component to be rendered before the content. */\n before?: ReactNode;\n /** Content. */\n children: string | ReactNode;\n /** Whether the list item should be highlighted or not. */\n isHighlighted?: boolean;\n /** Whether the component is selected or not. */\n isSelected?: boolean;\n /** Whether link/button is disabled or not. */\n isDisabled?: boolean;\n /** Reference to the <li> element. */\n listItemRef?: Ref<HTMLLIElement>;\n /** Custom react component for the link (can be used to inject react router Link). */\n linkAs?: 'a' | any;\n /** Props that will be passed on to the Link */\n linkProps?: React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>;\n /** Reference to the link element. */\n linkRef?: Ref<HTMLAnchorElement>;\n /** Size variant. */\n size?: ListItemSize;\n\n /** On selected callback. */\n onItemSelected?(evt: SyntheticEvent): void;\n}\n\n/**\n * Component display name.\n */\nconst COMPONENT_NAME = 'ListItem';\n\n/**\n * Component default class name and class prefix.\n */\nconst CLASSNAME = getRootClassName(COMPONENT_NAME);\n\n/**\n * Component default props.\n */\nconst DEFAULT_PROPS: Partial<ListProps> = {\n size: Size.regular,\n};\n\n/**\n * Check if the list item is clickable.\n * @return `true` if the list item is clickable; `false` otherwise.\n */\nexport function isClickable({ linkProps, onItemSelected }: Partial<ListItemProps>): boolean {\n return !isEmpty(linkProps?.href) || !!onItemSelected;\n}\n\n/**\n * ListItem component.\n *\n * @param props Component props.\n * @param ref Component ref.\n * @return React element.\n */\nexport const ListItem: Comp<ListItemProps, HTMLLIElement> = forwardRef((props, ref) => {\n const {\n after,\n before,\n children,\n className,\n isHighlighted,\n isSelected,\n isDisabled,\n linkAs,\n linkProps = {},\n linkRef,\n onItemSelected,\n size,\n ...forwardedProps\n } = props;\n\n const role = linkAs || linkProps.href ? 'link' : 'button';\n const onKeyDown = useMemo(() => {\n if (onItemSelected && role === 'link') return onEnterPressed(onItemSelected as any);\n if (onItemSelected && role === 'button') return onButtonPressed(onItemSelected as any);\n return undefined;\n }, [role, onItemSelected]);\n\n const content = (\n <>\n {before && <div className={`${CLASSNAME}__before`}>{before}</div>}\n <div className={`${CLASSNAME}__content`}>{children}</div>\n {after && <div className={`${CLASSNAME}__after`}>{after}</div>}\n </>\n );\n\n return (\n <li\n ref={ref}\n {...forwardedProps}\n className={classNames(\n className,\n handleBasicClasses({\n prefix: CLASSNAME,\n size,\n }),\n )}\n >\n {isClickable({ linkProps, onItemSelected }) ? (\n /* Clickable list item */\n renderLink(\n {\n linkAs,\n tabIndex: !isDisabled && role === 'button' ? 0 : undefined,\n role,\n 'aria-disabled': isDisabled,\n ...linkProps,\n href: isDisabled ? undefined : linkProps.href,\n className: classNames(\n handleBasicClasses({\n prefix: `${CLASSNAME}__link`,\n isHighlighted,\n isSelected,\n isDisabled,\n }),\n ),\n onClick: isDisabled ? undefined : onItemSelected,\n onKeyDown,\n ref: linkRef,\n },\n content,\n )\n ) : (\n /* Non clickable list item */\n <div className={`${CLASSNAME}__wrapper`}>{content}</div>\n )}\n </li>\n );\n});\nListItem.displayName = COMPONENT_NAME;\nListItem.className = CLASSNAME;\nListItem.defaultProps = DEFAULT_PROPS;\n","/** @license React v16.13.1\n * react-is.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';var b=\"function\"===typeof Symbol&&Symbol.for,c=b?Symbol.for(\"react.element\"):60103,d=b?Symbol.for(\"react.portal\"):60106,e=b?Symbol.for(\"react.fragment\"):60107,f=b?Symbol.for(\"react.strict_mode\"):60108,g=b?Symbol.for(\"react.profiler\"):60114,h=b?Symbol.for(\"react.provider\"):60109,k=b?Symbol.for(\"react.context\"):60110,l=b?Symbol.for(\"react.async_mode\"):60111,m=b?Symbol.for(\"react.concurrent_mode\"):60111,n=b?Symbol.for(\"react.forward_ref\"):60112,p=b?Symbol.for(\"react.suspense\"):60113,q=b?\nSymbol.for(\"react.suspense_list\"):60120,r=b?Symbol.for(\"react.memo\"):60115,t=b?Symbol.for(\"react.lazy\"):60116,v=b?Symbol.for(\"react.block\"):60121,w=b?Symbol.for(\"react.fundamental\"):60117,x=b?Symbol.for(\"react.responder\"):60118,y=b?Symbol.for(\"react.scope\"):60119;\nfunction z(a){if(\"object\"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;exports.Fragment=e;exports.Lazy=t;exports.Memo=r;exports.Portal=d;\nexports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;exports.isAsyncMode=function(a){return A(a)||z(a)===l};exports.isConcurrentMode=A;exports.isContextConsumer=function(a){return z(a)===k};exports.isContextProvider=function(a){return z(a)===h};exports.isElement=function(a){return\"object\"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return z(a)===n};exports.isFragment=function(a){return z(a)===e};exports.isLazy=function(a){return z(a)===t};\nexports.isMemo=function(a){return z(a)===r};exports.isPortal=function(a){return z(a)===d};exports.isProfiler=function(a){return z(a)===g};exports.isStrictMode=function(a){return z(a)===f};exports.isSuspense=function(a){return z(a)===p};\nexports.isValidElementType=function(a){return\"string\"===typeof a||\"function\"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||\"object\"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};exports.typeOf=z;\n","/** @license React v16.13.1\n * react-is.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\n\n\nif (process.env.NODE_ENV !== \"production\") {\n (function() {\n'use strict';\n\n// The Symbol used to tag the ReactElement-like types. If there is no native Symbol\n// nor polyfill, then a plain number is used for performance.\nvar hasSymbol = typeof Symbol === 'function' && Symbol.for;\nvar REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;\nvar REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;\nvar REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;\nvar REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;\nvar REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;\nvar REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;\nvar REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary\n// (unstable) APIs that have been removed. Can we remove the symbols?\n\nvar REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;\nvar REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;\nvar REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;\nvar REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;\nvar REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;\nvar REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;\nvar REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;\nvar REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;\nvar REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;\nvar REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;\nvar REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;\n\nfunction isValidElementType(type) {\n return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.\n type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);\n}\n\nfunction typeOf(object) {\n if (typeof object === 'object' && object !== null) {\n var $$typeof = object.$$typeof;\n\n switch ($$typeof) {\n case REACT_ELEMENT_TYPE:\n var type = object.type;\n\n switch (type) {\n case REACT_ASYNC_MODE_TYPE:\n case REACT_CONCURRENT_MODE_TYPE:\n case REACT_FRAGMENT_TYPE:\n case REACT_PROFILER_TYPE:\n case REACT_STRICT_MODE_TYPE:\n case REACT_SUSPENSE_TYPE:\n return type;\n\n default:\n var $$typeofType = type && type.$$typeof;\n\n switch ($$typeofType) {\n case REACT_CONTEXT_TYPE:\n case REACT_FORWARD_REF_TYPE:\n case REACT_LAZY_TYPE:\n case REACT_MEMO_TYPE:\n case REACT_PROVIDER_TYPE:\n return $$typeofType;\n\n default:\n return $$typeof;\n }\n\n }\n\n case REACT_PORTAL_TYPE:\n return $$typeof;\n }\n }\n\n return undefined;\n} // AsyncMode is deprecated along with isAsyncMode\n\nvar AsyncMode = REACT_ASYNC_MODE_TYPE;\nvar ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;\nvar ContextConsumer = REACT_CONTEXT_TYPE;\nvar ContextProvider = REACT_PROVIDER_TYPE;\nvar Element = REACT_ELEMENT_TYPE;\nvar ForwardRef = REACT_FORWARD_REF_TYPE;\nvar Fragment = REACT_FRAGMENT_TYPE;\nvar Lazy = REACT_LAZY_TYPE;\nvar Memo = REACT_MEMO_TYPE;\nvar Portal = REACT_PORTAL_TYPE;\nvar Profiler = REACT_PROFILER_TYPE;\nvar StrictMode = REACT_STRICT_MODE_TYPE;\nvar Suspense = REACT_SUSPENSE_TYPE;\nvar hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated\n\nfunction isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint\n\n console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}\nfunction isConcurrentMode(object) {\n return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;\n}\nfunction isContextConsumer(object) {\n return typeOf(object) === REACT_CONTEXT_TYPE;\n}\nfunction isContextProvider(object) {\n return typeOf(object) === REACT_PROVIDER_TYPE;\n}\nfunction isElement(object) {\n return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;\n}\nfunction isForwardRef(object) {\n return typeOf(object) === REACT_FORWARD_REF_TYPE;\n}\nfunction isFragment(object) {\n return typeOf(object) === REACT_FRAGMENT_TYPE;\n}\nfunction isLazy(object) {\n return typeOf(object) === REACT_LAZY_TYPE;\n}\nfunction isMemo(object) {\n return typeOf(object) === REACT_MEMO_TYPE;\n}\nfunction isPortal(object) {\n return typeOf(object) === REACT_PORTAL_TYPE;\n}\nfunction isProfiler(object) {\n return typeOf(object) === REACT_PROFILER_TYPE;\n}\nfunction isStrictMode(object) {\n return typeOf(object) === REACT_STRICT_MODE_TYPE;\n}\nfunction isSuspense(object) {\n return typeOf(object) === REACT_SUSPENSE_TYPE;\n}\n\nexports.AsyncMode = AsyncMode;\nexports.ConcurrentMode = ConcurrentMode;\nexports.ContextConsumer = ContextConsumer;\nexports.ContextProvider = ContextProvider;\nexports.Element = Element;\nexports.ForwardRef = ForwardRef;\nexports.Fragment = Fragment;\nexports.Lazy = Lazy;\nexports.Memo = Memo;\nexports.Portal = Portal;\nexports.Profiler = Profiler;\nexports.StrictMode = StrictMode;\nexports.Suspense = Suspense;\nexports.isAsyncMode = isAsyncMode;\nexports.isConcurrentMode = isConcurrentMode;\nexports.isContextConsumer = isContextConsumer;\nexports.isContextProvider = isContextProvider;\nexports.isElement = isElement;\nexports.isForwardRef = isForwardRef;\nexports.isFragment = isFragment;\nexports.isLazy = isLazy;\nexports.isMemo = isMemo;\nexports.isPortal = isPortal;\nexports.isProfiler = isProfiler;\nexports.isStrictMode = isStrictMode;\nexports.isSuspense = isSuspense;\nexports.isValidElementType = isValidElementType;\nexports.typeOf = typeOf;\n })();\n}\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-is.production.min.js');\n} else {\n module.exports = require('./cjs/react-is.development.js');\n}\n","import get from 'lodash/get';\nimport { Children, Key, ReactChild, ReactNode, cloneElement, isValidElement } from 'react';\nimport { isFragment } from 'react-is';\n\n/**\n * Flatten list of react nodes removing fragments and adding keys.\n * based on: https://github.com/grrowl/react-keyed-flatten-children/blob/5d421644a449765ddd62b659946196b4b5d7b135/index.ts\n *\n * @param children React nodes to flatten.\n * @return Flattened react nodes.\n */\nexport function flattenChildren(children: ReactNode) {\n function recur(nodes: ReactNode, keys: Key[] = []) {\n return Children.toArray(nodes).reduce((acc: ReactChild[], node, index) => {\n const nodeKeys = keys.concat(get(node, 'key') ?? index);\n if (isFragment(node)) {\n acc.push(...recur(node.props.children, nodeKeys));\n } else if (isValidElement(node)) {\n acc.push(cloneElement(node, { key: nodeKeys.join('.') }));\n } else if (typeof node === 'string' || typeof node === 'number') {\n acc.push(node);\n }\n return acc;\n }, []);\n }\n return recur(children);\n}\n","import { ListItemProps } from '@lumx/react';\nimport { isClickable } from '@lumx/react/components/list/ListItem';\n\nimport { isComponent } from '@lumx/react/utils';\nimport { flattenChildren } from '@lumx/react/utils/flattenChildren';\nimport { mergeRefs } from '@lumx/react/utils/mergeRefs';\nimport get from 'lodash/get';\nimport {\n cloneElement,\n Key,\n ReactElement,\n ReactNode,\n RefObject,\n SyntheticEvent,\n useEffect,\n useMemo,\n useState,\n} from 'react';\n\ntype Listener = (evt: KeyboardEvent) => void;\n\ninterface Options {\n /** List of items to navigate on. */\n items: ReactNode[] | ReactNode;\n /** Reference to the list-like element controlling the navigation. */\n ref: RefObject<HTMLElement>;\n\n /**\n * On list item navigated callback (triggered on ARROW key navigation).\n *\n * @param index Index of the navigated item among the sibling items.\n * @param key React key of the navigated item.\n */\n onListItemNavigated?(index: number, key: Key | null): void;\n\n /**\n * On list item selected callback (via ENTER key or click).\n *\n * @param index Index of the selected item among the sibling items.\n * @param key React key of the selected item.\n * @param evt Source event (either mouse or keyboard event).\n */\n onListItemSelected?(index: number, key: Key | null, evt: SyntheticEvent): void;\n}\n\ninterface Output {\n /** List of items transformed to accommodate keyboard navigation. */\n items: ReactNode[];\n /** Whether the list contains clickable items or not. */\n hasClickableItem: boolean;\n}\n\nexport type useInteractiveList = (options: Options) => Output;\n\nconst INITIAL_INDEX = -1;\n\nfunction onKeyboardFocus(props: any, handler: (evt: FocusEvent) => void) {\n let isMouseDown = false;\n return {\n onFocus(evt: FocusEvent) {\n props.onFocus?.(evt);\n if (!isMouseDown) {\n handler(evt);\n }\n },\n onMouseDown(evt: MouseEvent) {\n props.onMouseDown?.(evt);\n isMouseDown = true;\n },\n onMouseUp(evt: MouseEvent) {\n props.onMouseUp?.(evt);\n isMouseDown = false;\n },\n };\n}\n\nconst isNavigableItem = (node: ReactNode): node is ReactElement => {\n return isComponent('ListItem')(node) && isClickable(node.props) && !node.props.isDisabled;\n};\n\n/**\n * This custom hook detects clickable list item in a list and make them navigable with the keyboard.\n *\n * @param options See {@link Options}\n * @return See {@link Output}\n */\nexport const useInteractiveList: useInteractiveList = (options) => {\n const { ref, onListItemSelected, onListItemNavigated } = options;\n const items = useMemo(() => flattenChildren(options.items), [options.items]);\n const [activeItemIndex, setActiveItemIndex] = useState(INITIAL_INDEX);\n\n // Attach listeners to the list.\n useEffect(() => {\n const { current: listElement } = ref;\n if (!listElement) {\n return undefined;\n }\n\n /**\n * This function calculates the next index in the list to be active\n * @param index current index\n * @param code key code pressed\n * @return next index\n */\n const getNextIndex = (index: number, key: string): number => {\n switch (key) {\n case 'ArrowDown':\n return index + 1 < items.length ? index + 1 : 0;\n case 'ArrowUp':\n return index - 1 >= 0 ? index - 1 : items.length - 1;\n default:\n return INITIAL_INDEX;\n }\n };\n\n /**\n * Resets the active index to the initial state\n */\n const resetActiveIndex = () => {\n setActiveItemIndex(INITIAL_INDEX);\n };\n\n /**\n * Handles navigation with the arrows using the keyboard\n * @param evt Key event\n */\n const onArrowPressed: Listener = (evt) => {\n const { key } = evt;\n if (key !== 'ArrowUp' && key !== 'ArrowDown') {\n return;\n }\n\n let nextIndex = activeItemIndex;\n let iterations = 0;\n\n // Move to next navigable item.\n do {\n nextIndex = getNextIndex(nextIndex, key);\n iterations += 1;\n } while (\n nextIndex !== INITIAL_INDEX &&\n nextIndex !== activeItemIndex &&\n !isNavigableItem(items[nextIndex] as any) &&\n iterations < items.length\n );\n\n setActiveItemIndex(nextIndex);\n evt.preventDefault();\n evt.stopPropagation();\n onListItemNavigated?.(nextIndex, get(items, [nextIndex, 'key']));\n };\n\n /**\n * Reset active list item index when focusing outside the list.\n * @param evt Focus out event\n */\n const onFocusOut = (evt: FocusEvent) => {\n if (!evt.relatedTarget || !listElement.contains(evt.relatedTarget as any)) {\n resetActiveIndex();\n }\n };\n\n listElement.addEventListener('focusout', onFocusOut);\n listElement.addEventListener('keydown', onArrowPressed);\n return () => {\n listElement.removeEventListener('focusout', onFocusOut);\n listElement.removeEventListener('keydown', onArrowPressed);\n };\n }, [ref, activeItemIndex, items, onListItemNavigated]);\n\n return useMemo(() => {\n let hasClickableItem = false;\n const transformedItems = items.map((item, index) => {\n // Ignore if list not clickable or item is not a simple list item.\n if (!isNavigableItem(item)) {\n return item;\n }\n\n hasClickableItem = true;\n const isHighlighted = index === activeItemIndex;\n\n // Clone list item: inject ref, add tab index and active state.\n return cloneElement<ListItemProps>(item, {\n ...item.props,\n isHighlighted: item.props.isHighlighted ?? isHighlighted,\n linkRef: mergeRefs(item.props.linkRef, (element: any) => {\n if (isHighlighted) {\n element?.focus();\n }\n }),\n onItemSelected(evt) {\n item.props.onItemSelected?.();\n onListItemSelected?.(index, item.key, evt);\n },\n ...onKeyboardFocus(item.props, () => {\n setActiveItemIndex(index);\n }),\n });\n });\n return { items: transformedItems, hasClickableItem };\n }, [items, activeItemIndex, onListItemSelected]);\n};\n","import { Size } from '@lumx/react';\n\nimport { useKeyboardListNavigation } from '@lumx/react/hooks/useKeyboardListNavigation';\nimport { Comp, GenericProps, getRootClassName, handleBasicClasses } from '@lumx/react/utils';\nimport { mergeRefs } from '@lumx/react/utils/mergeRefs';\n\nimport classNames from 'classnames';\nimport React, { forwardRef, Key, ReactNode, SyntheticEvent, useRef } from 'react';\nimport { useInteractiveList } from './useInteractiveList';\n\n/**\n * Defines the props of the component.\n */\nexport interface ListProps extends GenericProps {\n /** List content (should be ListItem, ListSubheader or ListDivider). */\n children: ReactNode;\n /**\n * Whether the list items are clickable.\n * @deprecated not needed anymore.\n */\n isClickable?: boolean;\n /** Item padding size. */\n itemPadding?: Extract<Size, 'big' | 'huge'>;\n /**\n * On list item selected callback.\n *\n * @param key React key of the selected item.\n * @param index Index of the selected item among the sibling items.\n * @param evt Source event (either mouse or keyboard event).\n */\n onListItemSelected?(key: Key, index: number, evt: SyntheticEvent): void;\n}\n\n/**\n * Component display name.\n */\nconst COMPONENT_NAME = 'List';\n\n/**\n * Component default class name and class prefix.\n */\nconst CLASSNAME = getRootClassName(COMPONENT_NAME);\n\n/* eslint-disable jsx-a11y/no-noninteractive-tabindex */\n/**\n * List component.\n *\n * @param props Component props.\n * @param ref Component ref.\n * @return React element.\n */\nconst InternalList: Comp<ListProps, HTMLUListElement> = forwardRef((props, ref) => {\n const { children, className, isClickable, itemPadding, onListItemSelected, ...forwardedProps } = props;\n const listElementRef = useRef<HTMLUListElement>(null);\n\n const { items, hasClickableItem } = useInteractiveList({\n items: children,\n ref: listElementRef,\n onListItemSelected,\n });\n const clickable = hasClickableItem || isClickable;\n\n return (\n <ul\n {...forwardedProps}\n className={classNames(\n className,\n handleBasicClasses({\n prefix: CLASSNAME,\n itemPadding: itemPadding ?? (clickable ? Size.big : undefined),\n }),\n )}\n tabIndex={clickable ? 0 : -1}\n ref={mergeRefs(ref, listElementRef)}\n >\n {items}\n </ul>\n );\n});\nInternalList.displayName = COMPONENT_NAME;\nInternalList.className = CLASSNAME;\n\nexport const List = Object.assign(InternalList, { useKeyboardListNavigation });\n"],"names":["INITIAL_INDEX","useKeyboardListNavigation","items","ref","onListItemSelected","onListItemNavigated","onEnterPressed","onBackspacePressed","keepFocusAfterSelection","initialIndex","preventTabOnEnteredValue","useState","activeItemIndex","setActiveItemIndex","calculateActiveIndex","key","length","resetActiveIndex","preventDefaultAndStopPropagation","evt","preventDefault","stopPropagation","onArrowPressed","nextActiveIndex","selectedItem","onBackspaceKeyPressed","onEnterKeyPressed","currentTarget","blur","value","get","onTabKeyPressed","eventsForKeyPressed","ArrowDown","Tab","ArrowUp","Enter","Backspace","onKeyboardNavigation","handler","useEffect","currentElement","current","undefined","addEventListener","removeEventListener","COMPONENT_NAME","CLASSNAME","getRootClassName","DEFAULT_PROPS","size","Size","regular","isClickable","linkProps","onItemSelected","isEmpty","href","ListItem","forwardRef","props","after","before","children","className","isHighlighted","isSelected","isDisabled","linkAs","linkRef","forwardedProps","role","onKeyDown","useMemo","onButtonPressed","content","classNames","handleBasicClasses","prefix","renderLink","tabIndex","onClick","displayName","defaultProps","require$$0","require$$1","flattenChildren","recur","nodes","keys","Children","toArray","reduce","acc","node","index","nodeKeys","concat","isFragment","push","isValidElement","cloneElement","join","onKeyboardFocus","isMouseDown","onFocus","onMouseDown","onMouseUp","isNavigableItem","isComponent","useInteractiveList","options","listElement","getNextIndex","nextIndex","iterations","onFocusOut","relatedTarget","contains","hasClickableItem","transformedItems","map","item","mergeRefs","element","focus","InternalList","itemPadding","listElementRef","useRef","clickable","big","List","Object","assign"],"mappings":";;;;;;;;;;;;;AA6BA,IAAMA,aAAa,GAAG,CAAC,CAAvB;AAEA;;;;;;;;;;;;;;;;AAeO,IAAMC,yBAAwD,GAAG,SAA3DA,yBAA2D,CACpEC,KADoE,EAEpEC,GAFoE,EAGpEC,kBAHoE,EAIpEC,mBAJoE,EAKpEC,cALoE,EAMpEC,kBANoE,EAUnE;AAAA,MAHDC,uBAGC,uEAHyB,KAGzB;AAAA,MAFDC,YAEC,uEAFcT,aAEd;AAAA,MADDU,wBACC,uEAD0B,IAC1B;;AAAA,kBAC6CC,QAAQ,CAACF,YAAD,CADrD;AAAA;AAAA,MACMG,eADN;AAAA,MACuBC,kBADvB;AAGD;;;;;;;AAKA,MAAMC,oBAAoB,GAAG,SAAvBA,oBAAuB,CAACC,GAAD,EAAyB;AAClD,YAAQA,GAAR;AACI,WAAK,WAAL;AACI,eAAOH,eAAe,GAAG,CAAlB,GAAsBV,KAAK,CAACc,MAA5B,GAAqCJ,eAAe,GAAG,CAAvD,GAA2D,CAAlE;;AACJ,WAAK,SAAL;AACI,eAAOA,eAAe,GAAG,CAAlB,IAAuB,CAAvB,GAA2BA,eAAe,GAAG,CAA7C,GAAiDV,KAAK,CAACc,MAAN,GAAe,CAAvE;;AACJ;AACI,eAAOP,YAAP;AANR;AAQH,GATD;AAWA;;;;;AAGA,MAAMQ,gBAAgB,GAAG,SAAnBA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;AACAgF,YAAY,CAAC9D,SAAb,GAAyBjB,WAAzB;IAEaqF,IAAI,GAAGC,MAAM,CAACC,MAAP,CAAcR,YAAd,EAA4B;AAAE7H,EAAAA,yBAAyB,EAAzBA;AAAF,CAA5B;;;;"}
|
|
1
|
+
{"version":3,"file":"List2.js","sources":["../../../src/hooks/useKeyboardListNavigation.tsx","../../../src/components/list/ListItem.tsx","../../../../../node_modules/react-is/cjs/react-is.production.min.js","../../../../../node_modules/react-is/cjs/react-is.development.js","../../../../../node_modules/react-is/index.js","../../../src/utils/flattenChildren.ts","../../../src/components/list/useInteractiveList.tsx","../../../src/components/list/List.tsx"],"sourcesContent":["import { RefObject, SetStateAction, useEffect, useState } from 'react';\n\nimport get from 'lodash/get';\n\ntype Listener = (evt: KeyboardEvent) => void;\n\ninterface UseKeyboardListNavigationType {\n /** the current active index */\n activeItemIndex: number;\n /** callback to be used when a key is pressed. usually used with the native prop `onKeyDown` */\n onKeyboardNavigation: Listener;\n /** Resets the active index to the initial state */\n resetActiveIndex(): void;\n /** Sets the active index to a given value */\n setActiveItemIndex(value: SetStateAction<number>): void;\n}\n\nexport type useKeyboardListNavigationType = <I>(\n items: I[],\n ref: RefObject<HTMLElement>,\n onListItemSelected: (itemSelected: I) => void,\n onListItemNavigated?: (itemSelected: I) => void,\n onEnterPressed?: (itemSelected: string) => void,\n onBackspacePressed?: Listener,\n keepFocusAfterSelection?: boolean,\n initialIndex?: number,\n preventTabOnEnteredValue?: boolean,\n) => UseKeyboardListNavigationType;\n\nconst INITIAL_INDEX = -1;\n\n/**\n * This custom hook provides the necessary set of functions and values to properly navigate\n * a list using the keyboard.\n *\n * @param items the list of items that will be navigated using the keyboard.\n * @param ref A reference to the element that is controlling the navigation.\n * @param onListItemSelected callback to be executed when the ENTER key is pressed on an item.\n * @param onListItemNavigated callback to be executed when the Arrow keys are pressed.\n * @param onEnterPressed callback to be executed when the ENTER key is pressed.\n * @param onBackspacePressed callback to be executed when the BACKSPACE key is pressed.\n * @param keepFocusAfterSelection determines whether after selecting an item, the focus should be maintained on the current target or not.\n * @param initialIndex where should the navigation start from. it defaults to `-1`, so the first item navigated is the item on position `0`.\n * @param preventTabOnEnteredValue determines whether upon TAB, if there is a value entered, the event is prevented or not.\n * @return useKeyboardListNavigation helpers.\n */\nexport const useKeyboardListNavigation: useKeyboardListNavigationType = (\n items,\n ref,\n onListItemSelected,\n onListItemNavigated,\n onEnterPressed,\n onBackspacePressed,\n keepFocusAfterSelection = false,\n initialIndex = INITIAL_INDEX,\n preventTabOnEnteredValue = true,\n) => {\n const [activeItemIndex, setActiveItemIndex] = useState(initialIndex);\n\n /**\n * This function calculates the next index in the list to be highlighted\n * @param key - key code pressed\n * @return next active index\n */\n const calculateActiveIndex = (key: string): number => {\n switch (key) {\n case 'ArrowDown':\n return activeItemIndex + 1 < items.length ? activeItemIndex + 1 : 0;\n case 'ArrowUp':\n return activeItemIndex - 1 >= 0 ? activeItemIndex - 1 : items.length - 1;\n default:\n return initialIndex;\n }\n };\n\n /**\n * Resets the active index to the initial state\n */\n const resetActiveIndex = () => {\n setActiveItemIndex(initialIndex);\n };\n\n /**\n * Prevents the default event and stops the propagation of said event\n * @param evt - key pressed event\n */\n const preventDefaultAndStopPropagation: Listener = (evt) => {\n evt.preventDefault();\n evt.stopPropagation();\n };\n\n /**\n * Handles navigation with the arrows using the keyboard\n * @param evt - key pressed event\n */\n const onArrowPressed: Listener = (evt) => {\n const { key } = evt;\n const nextActiveIndex = calculateActiveIndex(key);\n setActiveItemIndex(nextActiveIndex);\n preventDefaultAndStopPropagation(evt);\n if (onListItemNavigated) {\n const selectedItem = items[nextActiveIndex];\n onListItemNavigated(selectedItem);\n }\n };\n\n /**\n * Handles the event when the backspace key is pressed\n * @param evt - key pressed event\n */\n const onBackspaceKeyPressed: Listener = (evt) => {\n if (onBackspacePressed) {\n onBackspacePressed(evt);\n }\n };\n\n /**\n * Handles when the ENTER key is pressed\n * @param evt - key pressed event\n */\n const onEnterKeyPressed: Listener = (evt) => {\n if (!onListItemSelected) {\n return;\n }\n\n preventDefaultAndStopPropagation(evt);\n\n if (!keepFocusAfterSelection) {\n (evt.currentTarget as HTMLElement).blur();\n }\n\n const selectedItem = items[activeItemIndex];\n\n if (selectedItem) {\n onListItemSelected(selectedItem);\n resetActiveIndex();\n } else if (activeItemIndex === initialIndex && onEnterPressed) {\n const value = get(evt, 'target.value');\n onEnterPressed(value);\n resetActiveIndex();\n }\n };\n\n /**\n * Handles when the TAB key is pressed\n * @param evt - key pressed event\n */\n const onTabKeyPressed: Listener = (evt) => {\n const value = get(evt, 'target.value');\n\n if (preventTabOnEnteredValue && value && value.length > 0) {\n preventDefaultAndStopPropagation(evt);\n }\n };\n\n /**\n * In order to make it easier in the future to add new events depending on the key\n * a map was created to add these handlers. In the future, if there is another event\n * that we need to manage depending on a specific key, we just need to add the key code\n * here, and as a value, the handler for said key.\n */\n const eventsForKeyPressed: Record<string, Listener> = {\n ArrowDown: onArrowPressed,\n Tab: onTabKeyPressed,\n ArrowUp: onArrowPressed,\n Enter: onEnterKeyPressed,\n Backspace: onBackspaceKeyPressed,\n };\n\n /**\n * Calculates the next active item index depending on the key pressed.\n * If the key pressed was ENTER, the function executes the callback `onListItemSelected`\n * and resets the active index, since an item was selected.\n * @param evt - key pressed or key down event\n */\n const onKeyboardNavigation: Listener = (evt) => {\n const { key } = evt;\n const handler = eventsForKeyPressed[key];\n\n if (handler) {\n handler(evt);\n }\n };\n\n useEffect(() => {\n const { current: currentElement } = ref;\n if (!currentElement) {\n return undefined;\n }\n currentElement.addEventListener('focus', resetActiveIndex);\n currentElement.addEventListener('keydown', onKeyboardNavigation);\n return () => {\n currentElement.removeEventListener('focus', resetActiveIndex);\n currentElement.removeEventListener('keydown', onKeyboardNavigation);\n };\n });\n\n return {\n activeItemIndex,\n onKeyboardNavigation,\n resetActiveIndex,\n setActiveItemIndex,\n };\n};\n","import React, { forwardRef, ReactNode, Ref, SyntheticEvent, useMemo } from 'react';\n\nimport classNames from 'classnames';\nimport isEmpty from 'lodash/isEmpty';\n\nimport { ListProps, Size } from '@lumx/react';\nimport {\n Comp,\n GenericProps,\n getRootClassName,\n handleBasicClasses,\n onEnterPressed,\n onButtonPressed,\n} from '@lumx/react/utils';\nimport { renderLink } from '@lumx/react/utils/renderLink';\n\nexport type ListItemSize = Extract<Size, 'tiny' | 'regular' | 'big' | 'huge'>;\n\n/**\n * Defines the props of the component.\n */\nexport interface ListItemProps extends GenericProps {\n /** A component to be rendered after the content. */\n after?: ReactNode;\n /** A component to be rendered before the content. */\n before?: ReactNode;\n /** Content. */\n children: string | ReactNode;\n /** Whether the list item should be highlighted or not. */\n isHighlighted?: boolean;\n /** Whether the component is selected or not. */\n isSelected?: boolean;\n /** Whether link/button is disabled or not. */\n isDisabled?: boolean;\n /** Reference to the <li> element. */\n listItemRef?: Ref<HTMLLIElement>;\n /** Custom react component for the link (can be used to inject react router Link). */\n linkAs?: 'a' | any;\n /** Props that will be passed on to the Link */\n linkProps?: React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>;\n /** Reference to the link element. */\n linkRef?: Ref<HTMLAnchorElement>;\n /** Size variant. */\n size?: ListItemSize;\n\n /** On selected callback. */\n onItemSelected?(evt: SyntheticEvent): void;\n}\n\n/**\n * Component display name.\n */\nconst COMPONENT_NAME = 'ListItem';\n\n/**\n * Component default class name and class prefix.\n */\nconst CLASSNAME = getRootClassName(COMPONENT_NAME);\n\n/**\n * Component default props.\n */\nconst DEFAULT_PROPS: Partial<ListProps> = {\n size: Size.regular,\n};\n\n/**\n * Check if the list item is clickable.\n * @return `true` if the list item is clickable; `false` otherwise.\n */\nexport function isClickable({ linkProps, onItemSelected }: Partial<ListItemProps>): boolean {\n return !isEmpty(linkProps?.href) || !!onItemSelected;\n}\n\n/**\n * ListItem component.\n *\n * @param props Component props.\n * @param ref Component ref.\n * @return React element.\n */\nexport const ListItem: Comp<ListItemProps, HTMLLIElement> = forwardRef((props, ref) => {\n const {\n after,\n before,\n children,\n className,\n isHighlighted,\n isSelected,\n isDisabled,\n linkAs,\n linkProps = {},\n linkRef,\n onItemSelected,\n size,\n ...forwardedProps\n } = props;\n\n const role = linkAs || linkProps.href ? 'link' : 'button';\n const onKeyDown = useMemo(() => {\n if (onItemSelected && role === 'link') return onEnterPressed(onItemSelected as any);\n if (onItemSelected && role === 'button') return onButtonPressed(onItemSelected as any);\n return undefined;\n }, [role, onItemSelected]);\n\n const content = (\n <>\n {before && <div className={`${CLASSNAME}__before`}>{before}</div>}\n <div className={`${CLASSNAME}__content`}>{children}</div>\n {after && <div className={`${CLASSNAME}__after`}>{after}</div>}\n </>\n );\n\n return (\n <li\n ref={ref}\n {...forwardedProps}\n className={classNames(\n className,\n handleBasicClasses({\n prefix: CLASSNAME,\n size,\n }),\n )}\n >\n {isClickable({ linkProps, onItemSelected }) ? (\n /* Clickable list item */\n renderLink(\n {\n linkAs,\n tabIndex: !isDisabled && role === 'button' ? 0 : undefined,\n role,\n 'aria-disabled': isDisabled,\n ...linkProps,\n href: isDisabled ? undefined : linkProps.href,\n className: classNames(\n handleBasicClasses({\n prefix: `${CLASSNAME}__link`,\n isHighlighted,\n isSelected,\n isDisabled,\n }),\n ),\n onClick: isDisabled ? undefined : onItemSelected,\n onKeyDown,\n ref: linkRef,\n },\n content,\n )\n ) : (\n /* Non clickable list item */\n <div className={`${CLASSNAME}__wrapper`}>{content}</div>\n )}\n </li>\n );\n});\nListItem.displayName = COMPONENT_NAME;\nListItem.className = CLASSNAME;\nListItem.defaultProps = DEFAULT_PROPS;\n","/** @license React v16.13.1\n * react-is.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';var b=\"function\"===typeof Symbol&&Symbol.for,c=b?Symbol.for(\"react.element\"):60103,d=b?Symbol.for(\"react.portal\"):60106,e=b?Symbol.for(\"react.fragment\"):60107,f=b?Symbol.for(\"react.strict_mode\"):60108,g=b?Symbol.for(\"react.profiler\"):60114,h=b?Symbol.for(\"react.provider\"):60109,k=b?Symbol.for(\"react.context\"):60110,l=b?Symbol.for(\"react.async_mode\"):60111,m=b?Symbol.for(\"react.concurrent_mode\"):60111,n=b?Symbol.for(\"react.forward_ref\"):60112,p=b?Symbol.for(\"react.suspense\"):60113,q=b?\nSymbol.for(\"react.suspense_list\"):60120,r=b?Symbol.for(\"react.memo\"):60115,t=b?Symbol.for(\"react.lazy\"):60116,v=b?Symbol.for(\"react.block\"):60121,w=b?Symbol.for(\"react.fundamental\"):60117,x=b?Symbol.for(\"react.responder\"):60118,y=b?Symbol.for(\"react.scope\"):60119;\nfunction z(a){if(\"object\"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;exports.Fragment=e;exports.Lazy=t;exports.Memo=r;exports.Portal=d;\nexports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;exports.isAsyncMode=function(a){return A(a)||z(a)===l};exports.isConcurrentMode=A;exports.isContextConsumer=function(a){return z(a)===k};exports.isContextProvider=function(a){return z(a)===h};exports.isElement=function(a){return\"object\"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return z(a)===n};exports.isFragment=function(a){return z(a)===e};exports.isLazy=function(a){return z(a)===t};\nexports.isMemo=function(a){return z(a)===r};exports.isPortal=function(a){return z(a)===d};exports.isProfiler=function(a){return z(a)===g};exports.isStrictMode=function(a){return z(a)===f};exports.isSuspense=function(a){return z(a)===p};\nexports.isValidElementType=function(a){return\"string\"===typeof a||\"function\"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||\"object\"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};exports.typeOf=z;\n","/** @license React v16.13.1\n * react-is.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\n\n\nif (process.env.NODE_ENV !== \"production\") {\n (function() {\n'use strict';\n\n// The Symbol used to tag the ReactElement-like types. If there is no native Symbol\n// nor polyfill, then a plain number is used for performance.\nvar hasSymbol = typeof Symbol === 'function' && Symbol.for;\nvar REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;\nvar REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;\nvar REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;\nvar REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;\nvar REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;\nvar REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;\nvar REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary\n// (unstable) APIs that have been removed. Can we remove the symbols?\n\nvar REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;\nvar REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;\nvar REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;\nvar REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;\nvar REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;\nvar REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;\nvar REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;\nvar REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;\nvar REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;\nvar REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;\nvar REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;\n\nfunction isValidElementType(type) {\n return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.\n type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);\n}\n\nfunction typeOf(object) {\n if (typeof object === 'object' && object !== null) {\n var $$typeof = object.$$typeof;\n\n switch ($$typeof) {\n case REACT_ELEMENT_TYPE:\n var type = object.type;\n\n switch (type) {\n case REACT_ASYNC_MODE_TYPE:\n case REACT_CONCURRENT_MODE_TYPE:\n case REACT_FRAGMENT_TYPE:\n case REACT_PROFILER_TYPE:\n case REACT_STRICT_MODE_TYPE:\n case REACT_SUSPENSE_TYPE:\n return type;\n\n default:\n var $$typeofType = type && type.$$typeof;\n\n switch ($$typeofType) {\n case REACT_CONTEXT_TYPE:\n case REACT_FORWARD_REF_TYPE:\n case REACT_LAZY_TYPE:\n case REACT_MEMO_TYPE:\n case REACT_PROVIDER_TYPE:\n return $$typeofType;\n\n default:\n return $$typeof;\n }\n\n }\n\n case REACT_PORTAL_TYPE:\n return $$typeof;\n }\n }\n\n return undefined;\n} // AsyncMode is deprecated along with isAsyncMode\n\nvar AsyncMode = REACT_ASYNC_MODE_TYPE;\nvar ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;\nvar ContextConsumer = REACT_CONTEXT_TYPE;\nvar ContextProvider = REACT_PROVIDER_TYPE;\nvar Element = REACT_ELEMENT_TYPE;\nvar ForwardRef = REACT_FORWARD_REF_TYPE;\nvar Fragment = REACT_FRAGMENT_TYPE;\nvar Lazy = REACT_LAZY_TYPE;\nvar Memo = REACT_MEMO_TYPE;\nvar Portal = REACT_PORTAL_TYPE;\nvar Profiler = REACT_PROFILER_TYPE;\nvar StrictMode = REACT_STRICT_MODE_TYPE;\nvar Suspense = REACT_SUSPENSE_TYPE;\nvar hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated\n\nfunction isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint\n\n console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}\nfunction isConcurrentMode(object) {\n return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;\n}\nfunction isContextConsumer(object) {\n return typeOf(object) === REACT_CONTEXT_TYPE;\n}\nfunction isContextProvider(object) {\n return typeOf(object) === REACT_PROVIDER_TYPE;\n}\nfunction isElement(object) {\n return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;\n}\nfunction isForwardRef(object) {\n return typeOf(object) === REACT_FORWARD_REF_TYPE;\n}\nfunction isFragment(object) {\n return typeOf(object) === REACT_FRAGMENT_TYPE;\n}\nfunction isLazy(object) {\n return typeOf(object) === REACT_LAZY_TYPE;\n}\nfunction isMemo(object) {\n return typeOf(object) === REACT_MEMO_TYPE;\n}\nfunction isPortal(object) {\n return typeOf(object) === REACT_PORTAL_TYPE;\n}\nfunction isProfiler(object) {\n return typeOf(object) === REACT_PROFILER_TYPE;\n}\nfunction isStrictMode(object) {\n return typeOf(object) === REACT_STRICT_MODE_TYPE;\n}\nfunction isSuspense(object) {\n return typeOf(object) === REACT_SUSPENSE_TYPE;\n}\n\nexports.AsyncMode = AsyncMode;\nexports.ConcurrentMode = ConcurrentMode;\nexports.ContextConsumer = ContextConsumer;\nexports.ContextProvider = ContextProvider;\nexports.Element = Element;\nexports.ForwardRef = ForwardRef;\nexports.Fragment = Fragment;\nexports.Lazy = Lazy;\nexports.Memo = Memo;\nexports.Portal = Portal;\nexports.Profiler = Profiler;\nexports.StrictMode = StrictMode;\nexports.Suspense = Suspense;\nexports.isAsyncMode = isAsyncMode;\nexports.isConcurrentMode = isConcurrentMode;\nexports.isContextConsumer = isContextConsumer;\nexports.isContextProvider = isContextProvider;\nexports.isElement = isElement;\nexports.isForwardRef = isForwardRef;\nexports.isFragment = isFragment;\nexports.isLazy = isLazy;\nexports.isMemo = isMemo;\nexports.isPortal = isPortal;\nexports.isProfiler = isProfiler;\nexports.isStrictMode = isStrictMode;\nexports.isSuspense = isSuspense;\nexports.isValidElementType = isValidElementType;\nexports.typeOf = typeOf;\n })();\n}\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-is.production.min.js');\n} else {\n module.exports = require('./cjs/react-is.development.js');\n}\n","import get from 'lodash/get';\nimport { Children, Key, ReactChild, ReactNode, cloneElement, isValidElement } from 'react';\nimport { isFragment } from 'react-is';\n\n/**\n * Flatten list of react nodes removing fragments and adding keys.\n * based on: https://github.com/grrowl/react-keyed-flatten-children/blob/5d421644a449765ddd62b659946196b4b5d7b135/index.ts\n *\n * @param children React nodes to flatten.\n * @return Flattened react nodes.\n */\nexport function flattenChildren(children: ReactNode) {\n function recur(nodes: ReactNode, keys: Key[] = []) {\n return Children.toArray(nodes).reduce((acc: ReactChild[], node, index) => {\n const nodeKeys = keys.concat(get(node, 'key') ?? index);\n if (isFragment(node)) {\n acc.push(...recur(node.props.children, nodeKeys));\n } else if (isValidElement(node)) {\n acc.push(cloneElement(node, { key: nodeKeys.join('.') }));\n } else if (typeof node === 'string' || typeof node === 'number') {\n acc.push(node);\n }\n return acc;\n }, []);\n }\n return recur(children);\n}\n","import { ListItemProps } from '@lumx/react';\nimport { isClickable } from '@lumx/react/components/list/ListItem';\n\nimport { isComponent } from '@lumx/react/utils';\nimport { flattenChildren } from '@lumx/react/utils/flattenChildren';\nimport { mergeRefs } from '@lumx/react/utils/mergeRefs';\nimport get from 'lodash/get';\nimport {\n cloneElement,\n Key,\n ReactElement,\n ReactNode,\n RefObject,\n SyntheticEvent,\n useEffect,\n useMemo,\n useState,\n} from 'react';\n\ntype Listener = (evt: KeyboardEvent) => void;\n\ninterface Options {\n /** List of items to navigate on. */\n items: ReactNode[] | ReactNode;\n /** Reference to the list-like element controlling the navigation. */\n ref: RefObject<HTMLElement>;\n\n /**\n * On list item navigated callback (triggered on ARROW key navigation).\n *\n * @param index Index of the navigated item among the sibling items.\n * @param key React key of the navigated item.\n */\n onListItemNavigated?(index: number, key: Key | null): void;\n\n /**\n * On list item selected callback (via ENTER key or click).\n *\n * @param index Index of the selected item among the sibling items.\n * @param key React key of the selected item.\n * @param evt Source event (either mouse or keyboard event).\n */\n onListItemSelected?(index: number, key: Key | null, evt: SyntheticEvent): void;\n}\n\ninterface Output {\n /** List of items transformed to accommodate keyboard navigation. */\n items: ReactNode[];\n /** Whether the list contains clickable items or not. */\n hasClickableItem: boolean;\n}\n\nexport type useInteractiveList = (options: Options) => Output;\n\nconst INITIAL_INDEX = -1;\n\nfunction onKeyboardFocus(props: any, handler: (evt: FocusEvent) => void) {\n let isMouseDown = false;\n return {\n onFocus(evt: FocusEvent) {\n props.onFocus?.(evt);\n if (!isMouseDown) {\n handler(evt);\n }\n },\n onMouseDown(evt: MouseEvent) {\n props.onMouseDown?.(evt);\n isMouseDown = true;\n },\n onMouseUp(evt: MouseEvent) {\n props.onMouseUp?.(evt);\n isMouseDown = false;\n },\n };\n}\n\nconst isNavigableItem = (node: ReactNode): node is ReactElement => {\n return isComponent('ListItem')(node) && isClickable(node.props) && !node.props.isDisabled;\n};\n\n/**\n * This custom hook detects clickable list item in a list and make them navigable with the keyboard.\n *\n * @param options See {@link Options}\n * @return See {@link Output}\n */\nexport const useInteractiveList: useInteractiveList = (options) => {\n const { ref, onListItemSelected, onListItemNavigated } = options;\n const items = useMemo(() => flattenChildren(options.items), [options.items]);\n const [activeItemIndex, setActiveItemIndex] = useState(INITIAL_INDEX);\n\n // Attach listeners to the list.\n useEffect(() => {\n const { current: listElement } = ref;\n if (!listElement) {\n return undefined;\n }\n\n /**\n * This function calculates the next index in the list to be active\n * @param index current index\n * @param code key code pressed\n * @return next index\n */\n const getNextIndex = (index: number, key: string): number => {\n switch (key) {\n case 'ArrowDown':\n return index + 1 < items.length ? index + 1 : 0;\n case 'ArrowUp':\n return index - 1 >= 0 ? index - 1 : items.length - 1;\n default:\n return INITIAL_INDEX;\n }\n };\n\n /**\n * Resets the active index to the initial state\n */\n const resetActiveIndex = () => {\n setActiveItemIndex(INITIAL_INDEX);\n };\n\n /**\n * Handles navigation with the arrows using the keyboard\n * @param evt Key event\n */\n const onArrowPressed: Listener = (evt) => {\n const { key } = evt;\n if (key !== 'ArrowUp' && key !== 'ArrowDown') {\n return;\n }\n\n let nextIndex = activeItemIndex;\n let iterations = 0;\n\n // Move to next navigable item.\n do {\n nextIndex = getNextIndex(nextIndex, key);\n iterations += 1;\n } while (\n nextIndex !== INITIAL_INDEX &&\n nextIndex !== activeItemIndex &&\n !isNavigableItem(items[nextIndex] as any) &&\n iterations < items.length\n );\n\n setActiveItemIndex(nextIndex);\n evt.preventDefault();\n evt.stopPropagation();\n onListItemNavigated?.(nextIndex, get(items, [nextIndex, 'key']));\n };\n\n /**\n * Reset active list item index when focusing outside the list.\n * @param evt Focus out event\n */\n const onFocusOut = (evt: FocusEvent) => {\n if (!evt.relatedTarget || !listElement.contains(evt.relatedTarget as any)) {\n resetActiveIndex();\n }\n };\n\n listElement.addEventListener('focusout', onFocusOut);\n listElement.addEventListener('keydown', onArrowPressed);\n return () => {\n listElement.removeEventListener('focusout', onFocusOut);\n listElement.removeEventListener('keydown', onArrowPressed);\n };\n }, [ref, activeItemIndex, items, onListItemNavigated]);\n\n return useMemo(() => {\n let hasClickableItem = false;\n const transformedItems = items.map((item, index) => {\n // Ignore if list not clickable or item is not a simple list item.\n if (!isNavigableItem(item)) {\n return item;\n }\n\n hasClickableItem = true;\n const isHighlighted = index === activeItemIndex;\n\n // Clone list item: inject ref, add tab index and active state.\n return cloneElement<ListItemProps>(item, {\n ...item.props,\n isHighlighted: item.props.isHighlighted ?? isHighlighted,\n linkRef: mergeRefs(item.props.linkRef, (element: any) => {\n if (isHighlighted) {\n element?.focus();\n }\n }),\n onItemSelected(evt) {\n item.props.onItemSelected?.();\n onListItemSelected?.(index, item.key, evt);\n },\n ...onKeyboardFocus(item.props, () => {\n setActiveItemIndex(index);\n }),\n });\n });\n return { items: transformedItems, hasClickableItem };\n }, [items, activeItemIndex, onListItemSelected]);\n};\n","import { Size } from '@lumx/react';\n\nimport { useKeyboardListNavigation } from '@lumx/react/hooks/useKeyboardListNavigation';\nimport { Comp, GenericProps, getRootClassName, handleBasicClasses } from '@lumx/react/utils';\nimport { mergeRefs } from '@lumx/react/utils/mergeRefs';\n\nimport classNames from 'classnames';\nimport React, { forwardRef, Key, ReactNode, SyntheticEvent, useRef } from 'react';\nimport { useInteractiveList } from './useInteractiveList';\n\n/**\n * Defines the props of the component.\n */\nexport interface ListProps extends GenericProps {\n /** List content (should be ListItem, ListSubheader or ListDivider). */\n children: ReactNode;\n /**\n * Whether the list items are clickable.\n * @deprecated not needed anymore.\n */\n isClickable?: boolean;\n /** Item padding size. */\n itemPadding?: Extract<Size, 'big' | 'huge'>;\n /** Tab index of the list. Default to -1 */\n tabIndex?: number;\n /**\n * On list item selected callback.\n *\n * @param key React key of the selected item.\n * @param index Index of the selected item among the sibling items.\n * @param evt Source event (either mouse or keyboard event).\n */\n onListItemSelected?(key: Key, index: number, evt: SyntheticEvent): void;\n}\n\n/**\n * Component display name.\n */\nconst COMPONENT_NAME = 'List';\n\n/**\n * Component default class name and class prefix.\n */\nconst CLASSNAME = getRootClassName(COMPONENT_NAME);\n\n/**\n * Component default props.\n */\nconst DEFAULT_PROPS: Partial<ListProps> = {\n tabIndex: -1,\n};\n\n/* eslint-disable jsx-a11y/no-noninteractive-tabindex */\n/**\n * List component.\n *\n * @param props Component props.\n * @param ref Component ref.\n * @return React element.\n */\nconst InternalList: Comp<ListProps, HTMLUListElement> = forwardRef((props, ref) => {\n const { children, className, isClickable, itemPadding, onListItemSelected, tabIndex, ...forwardedProps } = props;\n const listElementRef = useRef<HTMLUListElement>(null);\n\n const { items, hasClickableItem } = useInteractiveList({\n items: children,\n ref: listElementRef,\n onListItemSelected,\n });\n const clickable = hasClickableItem || isClickable;\n\n return (\n <ul\n {...forwardedProps}\n className={classNames(\n className,\n handleBasicClasses({\n prefix: CLASSNAME,\n itemPadding: itemPadding ?? (clickable ? Size.big : undefined),\n }),\n )}\n tabIndex={tabIndex}\n ref={mergeRefs(ref, listElementRef)}\n >\n {items}\n </ul>\n );\n});\nInternalList.displayName = COMPONENT_NAME;\nInternalList.className = CLASSNAME;\nInternalList.defaultProps = DEFAULT_PROPS;\n\nexport const List = Object.assign(InternalList, { useKeyboardListNavigation });\n"],"names":["INITIAL_INDEX","useKeyboardListNavigation","items","ref","onListItemSelected","onListItemNavigated","onEnterPressed","onBackspacePressed","keepFocusAfterSelection","initialIndex","preventTabOnEnteredValue","useState","activeItemIndex","setActiveItemIndex","calculateActiveIndex","key","length","resetActiveIndex","preventDefaultAndStopPropagation","evt","preventDefault","stopPropagation","onArrowPressed","nextActiveIndex","selectedItem","onBackspaceKeyPressed","onEnterKeyPressed","currentTarget","blur","value","get","onTabKeyPressed","eventsForKeyPressed","ArrowDown","Tab","ArrowUp","Enter","Backspace","onKeyboardNavigation","handler","useEffect","currentElement","current","undefined","addEventListener","removeEventListener","COMPONENT_NAME","CLASSNAME","getRootClassName","DEFAULT_PROPS","size","Size","regular","isClickable","linkProps","onItemSelected","isEmpty","href","ListItem","forwardRef","props","after","before","children","className","isHighlighted","isSelected","isDisabled","linkAs","linkRef","forwardedProps","role","onKeyDown","useMemo","onButtonPressed","content","classNames","handleBasicClasses","prefix","renderLink","tabIndex","onClick","displayName","defaultProps","require$$0","require$$1","flattenChildren","recur","nodes","keys","Children","toArray","reduce","acc","node","index","nodeKeys","concat","isFragment","push","isValidElement","cloneElement","join","onKeyboardFocus","isMouseDown","onFocus","onMouseDown","onMouseUp","isNavigableItem","isComponent","useInteractiveList","options","listElement","getNextIndex","nextIndex","iterations","onFocusOut","relatedTarget","contains","hasClickableItem","transformedItems","map","item","mergeRefs","element","focus","InternalList","itemPadding","listElementRef","useRef","clickable","big","List","Object","assign"],"mappings":";;;;;;;;;;;;;AA6BA,IAAMA,aAAa,GAAG,CAAC,CAAvB;AAEA;;;;;;;;;;;;;;;;AAeO,IAAMC,yBAAwD,GAAG,SAA3DA,yBAA2D,CACpEC,KADoE,EAEpEC,GAFoE,EAGpEC,kBAHoE,EAIpEC,mBAJoE,EAKpEC,cALoE,EAMpEC,kBANoE,EAUnE;AAAA,MAHDC,uBAGC,uEAHyB,KAGzB;AAAA,MAFDC,YAEC,uEAFcT,aAEd;AAAA,MADDU,wBACC,uEAD0B,IAC1B;;AAAA,kBAC6CC,QAAQ,CAACF,YAAD,CADrD;AAAA;AAAA,MACMG,eADN;AAAA,MACuBC,kBADvB;AAGD;;;;;;;AAKA,MAAMC,oBAAoB,GAAG,SAAvBA,oBAAuB,CAACC,GAAD,EAAyB;AAClD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