@launchpad-ui/filter 0.11.14 → 0.11.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +21 -43
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +19 -48
- package/dist/index.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +12 -12
package/dist/index.es.js
CHANGED
|
@@ -7,34 +7,22 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
|
7
7
|
import { Button, IconButton } from "@launchpad-ui/button";
|
|
8
8
|
import { Menu, MenuDivider, MenuItem, MenuSearch } from "@launchpad-ui/menu";
|
|
9
9
|
import { Tooltip } from "@launchpad-ui/tooltip";
|
|
10
|
-
import { VisuallyHidden } from "
|
|
11
|
-
const appliedButton = "vLReaG_appliedButton";
|
|
12
|
-
const appliedDescription = "vLReaG_appliedDescription";
|
|
13
|
-
const appliedName = "vLReaG_appliedName";
|
|
14
|
-
const button = "vLReaG_button";
|
|
15
|
-
const buttonContainer = "vLReaG_buttonContainer";
|
|
16
|
-
const clear = "vLReaG_clear";
|
|
17
|
-
const clearTooltip = "vLReaG_clearTooltip";
|
|
18
|
-
const description = "vLReaG_description";
|
|
19
|
-
const filter = "vLReaG_filter";
|
|
20
|
-
const filterClearButton = "vLReaG_filterClearButton";
|
|
21
|
-
const isClearable = "vLReaG_isClearable";
|
|
22
|
-
const name = "vLReaG_name";
|
|
10
|
+
import { VisuallyHidden } from "react-aria/VisuallyHidden";
|
|
23
11
|
var Filter_module_default = {
|
|
24
|
-
appliedButton,
|
|
25
|
-
appliedDescription,
|
|
26
|
-
appliedName,
|
|
27
|
-
button,
|
|
28
|
-
buttonContainer,
|
|
29
|
-
clear,
|
|
30
|
-
clearTooltip,
|
|
31
|
-
description,
|
|
32
|
-
filter,
|
|
33
|
-
filterClearButton,
|
|
34
|
-
isClearable,
|
|
35
|
-
name
|
|
12
|
+
appliedButton: "vLReaG_appliedButton",
|
|
13
|
+
appliedDescription: "vLReaG_appliedDescription",
|
|
14
|
+
appliedName: "vLReaG_appliedName",
|
|
15
|
+
button: "vLReaG_button",
|
|
16
|
+
buttonContainer: "vLReaG_buttonContainer",
|
|
17
|
+
clear: "vLReaG_clear",
|
|
18
|
+
clearTooltip: "vLReaG_clearTooltip",
|
|
19
|
+
description: "vLReaG_description",
|
|
20
|
+
filter: "vLReaG_filter",
|
|
21
|
+
filterClearButton: "vLReaG_filterClearButton",
|
|
22
|
+
isClearable: "vLReaG_isClearable",
|
|
23
|
+
name: "vLReaG_name"
|
|
36
24
|
};
|
|
37
|
-
|
|
25
|
+
var AppliedFilterButton = /* @__PURE__ */ forwardRef((props, ref) => {
|
|
38
26
|
const { name: name$1, className, children, onClickFilterButton, "data-test-id": testId = "applied-filter-button" } = props;
|
|
39
27
|
const hasDescription = Children.count(children) !== 0;
|
|
40
28
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -66,7 +54,7 @@ const AppliedFilterButton = /* @__PURE__ */ forwardRef((props, ref) => {
|
|
|
66
54
|
});
|
|
67
55
|
});
|
|
68
56
|
AppliedFilterButton.displayName = "AppliedFilterButton";
|
|
69
|
-
|
|
57
|
+
var FilterMenu = ({ options, onClearFilter, enableSearch, searchValue, searchPlaceholder, searchAriaLabel, searchId, onSelect, onSearchChange, isLoading = false, disabledOptionTooltip, enableVirtualization, size, "data-test-id": testId = "filter-menu" }) => {
|
|
70
58
|
const filterOptions = isLoading ? [{
|
|
71
59
|
name: "loading...",
|
|
72
60
|
value: "loading...",
|
|
@@ -107,13 +95,8 @@ const FilterMenu = ({ options, onClearFilter, enableSearch, searchValue, searchP
|
|
|
107
95
|
})]
|
|
108
96
|
})] });
|
|
109
97
|
};
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
* @deprecated use `Menu` from `@launchpad-ui/components` instead
|
|
113
|
-
*
|
|
114
|
-
* https://launchpad.launchdarkly.com/?path=/docs/components-collections-menu--docs
|
|
115
|
-
*/
|
|
116
|
-
const AppliedFilter = ({ searchValue, onSearchChange, searchPlaceholder, name: name$1, description: description$1, options, className, isEmpty, isLoading, onClickFilterButton, onClearFilter, searchAriaLabel, searchId, "data-test-id": testId = "applied-filter",...props }) => {
|
|
98
|
+
var SEARCH_INPUT_THRESHOLD$1 = 4;
|
|
99
|
+
var AppliedFilter = ({ searchValue, onSearchChange, searchPlaceholder, name: name$1, description: description$1, options, className, isEmpty, isLoading, onClickFilterButton, onClearFilter, searchAriaLabel, searchId, "data-test-id": testId = "applied-filter", ...props }) => {
|
|
117
100
|
const enableSearch = onSearchChange && (!!searchValue || options.length > SEARCH_INPUT_THRESHOLD$1 || !isEmpty);
|
|
118
101
|
return /* @__PURE__ */ jsxs(Dropdown, {
|
|
119
102
|
targetClassName: className,
|
|
@@ -138,8 +121,8 @@ const AppliedFilter = ({ searchValue, onSearchChange, searchPlaceholder, name: n
|
|
|
138
121
|
})]
|
|
139
122
|
});
|
|
140
123
|
};
|
|
141
|
-
|
|
142
|
-
const { children, name: name$1, hideName, isClearable: isClearable$1, clearTooltip: clearTooltip$1 = "Clear filter", onClear, disabled, isSelected, onClickFilterButton, className, "data-test-id": testId = "filter-button", ariaLabel = "Clear filter"
|
|
124
|
+
var FilterButton = /* @__PURE__ */ forwardRef((props, ref) => {
|
|
125
|
+
const { children, name: name$1, hideName, isClearable: isClearable$1, clearTooltip: clearTooltip$1 = "Clear filter", onClear, disabled, isSelected, onClickFilterButton, className, "data-test-id": testId = "filter-button", ariaLabel = "Clear filter", ...rest } = props;
|
|
143
126
|
const nameId = useId();
|
|
144
127
|
const descriptionId = useId();
|
|
145
128
|
const hasDescription = Children.count(children) !== 0;
|
|
@@ -201,13 +184,8 @@ const FilterButton = /* @__PURE__ */ forwardRef((props, ref) => {
|
|
|
201
184
|
});
|
|
202
185
|
});
|
|
203
186
|
FilterButton.displayName = "FilterButton";
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
* @deprecated use `Menu` from `@launchpad-ui/components` instead
|
|
207
|
-
*
|
|
208
|
-
* https://launchpad.launchdarkly.com/?path=/docs/components-collections-menu--docs
|
|
209
|
-
*/
|
|
210
|
-
const Filter = ({ searchValue, onSearchChange, searchPlaceholder, searchAriaLabel, name: name$1, hideName, description: description$1, options, isClearable: isClearable$1, onClear, isSelected, className, isEmpty, searchId, isLoading, onClickFilterButton, disabledOptionTooltip, "data-test-id": testId = "filter", size, disabled, enableVirtualization, clearAriaLabel,...props }) => {
|
|
187
|
+
var SEARCH_INPUT_THRESHOLD = 4;
|
|
188
|
+
var Filter = ({ searchValue, onSearchChange, searchPlaceholder, searchAriaLabel, name: name$1, hideName, description: description$1, options, isClearable: isClearable$1, onClear, isSelected, className, isEmpty, searchId, isLoading, onClickFilterButton, disabledOptionTooltip, "data-test-id": testId = "filter", size, disabled, enableVirtualization, clearAriaLabel, ...props }) => {
|
|
211
189
|
const enableSearch = onSearchChange && (!!searchValue || options.length > SEARCH_INPUT_THRESHOLD || !isEmpty);
|
|
212
190
|
const dropdownClasses = cx(Filter_module_default.filter, className);
|
|
213
191
|
const handleClear = (event) => {
|
package/dist/index.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es.js","names":["event: MouseEvent<HTMLButtonElement>","event: SyntheticEvent"],"sources":["../src/styles/Filter.module.css","../src/AppliedFilterButton.tsx","../src/FilterMenu.tsx","../src/AppliedFilter.tsx","../src/FilterButton.tsx","../src/Filter.tsx"],"sourcesContent":[":root,\n[data-theme='default'] {\n\t--lp-component-filter-color-bg-clearable: rgb(0 0 0 / 0.15);\n\t--lp-component-filter-color-bg-clearable-focus: rgb(0 0 0 / 0.2);\n\t--lp-component-filter-color-border-clearable-focus: var(--lp-color-gray-800);\n}\n\n[data-theme='dark'] {\n\t--lp-component-filter-color-bg-clearable: rgb(248 248 248 / 0.15);\n\t--lp-component-filter-color-bg-clearable-focus: rgb(248 248 248 / 0.2);\n\t--lp-component-filter-color-border-clearable-focus: var(--lp-color-gray-500);\n}\n\n.filter {\n\tfont-family: var(--lp-font-family-base);\n}\n\n.buttonContainer {\n\tcursor: pointer;\n\tdisplay: inline-flex;\n\talign-items: center;\n\tposition: relative;\n}\n\n.button {\n\tborder-radius: var(--lp-border-radius-medium);\n\tpadding-top: 0;\n\tpadding-bottom: 0;\n\tline-height: 2rem;\n\tdisplay: flex;\n\talign-items: center;\n\tmargin: 0;\n\tcolor: var(--lp-color-text-ui-primary-base);\n\tbackground-color: var(--lp-color-bg-interactive-secondary-base);\n}\n\n.appliedButton {\n\tcolor: var(--lp-color-text-ui-primary-base);\n\theight: 1.25rem;\n\tbackground-color: var(--lp-color-bg-interactive-secondary-hover);\n\tpadding: 0.125rem 0.375rem;\n\tborder-radius: 0.125rem;\n\tdisplay: flex;\n}\n\n.button,\n.appliedButton {\n\tfont-family: inherit;\n\tfont-size: 0.8125rem;\n\tcursor: pointer;\n\tborder-width: var(--lp-border-width-200);\n\tborder-style: solid;\n\tborder-color: transparent;\n\n\t&:hover {\n\t\tbackground-color: var(--lp-color-bg-interactive-secondary-hover);\n\t\tborder-color: var(--lp-color-border-interactive-secondary-hover);\n\t}\n\n\t&:focus-visible {\n\t\toutline: none;\n\t\tborder-color: var(--lp-color-border-interactive-secondary-focus);\n\t\tbox-shadow:\n\t\t\t0 0 0 2px var(--lp-color-bg-ui-primary),\n\t\t\t0 0 0 4px var(--lp-color-shadow-interactive-focus);\n\t}\n}\n\n.name {\n\tmargin-right: 0.3125rem;\n\tfont-weight: var(--lp-font-weight-medium);\n}\n\n.appliedName {\n\tmargin-right: 0.1875rem;\n}\n\n.description {\n\tcolor: var(--lp-color-text-ui-primary-base);\n\tfont-weight: var(--lp-font-weight-medium);\n}\n\n.description,\n.appliedDescription {\n\tmargin-right: 0.3125rem;\n\tmax-width: 10rem;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n}\n\n.clear {\n\tcursor: pointer;\n\tpadding: 0.1875rem;\n}\n\n.button.isClearable {\n\tpadding-right: 1.9375rem;\n\tbackground-color: var(--lp-component-filter-color-bg-clearable);\n\n\t&:focus,\n\t&:hover,\n\t&:active {\n\t\tbackground-color: var(--lp-component-filter-color-bg-clearable-focus);\n\t\tborder-color: var(--lp-component-filter-color-border-clearable-focus);\n\t}\n}\n\n.button:hover:not(.isClearable),\n.button:focus:not(.isClearable),\n[data-state='open'] .button:not(.isClearable) {\n\tbackground-color: var(--lp-color-bg-interactive-secondary-hover);\n\tborder-color: var(--lp-color-border-interactive-secondary-hover);\n}\n\n.button:focus:not(:focus-visible):not(.isClearable) {\n\t&:hover {\n\t\tbackground-color: var(--lp-color-bg-interactive-secondary-hover);\n\t}\n}\n\n.clearTooltip {\n\tline-height: 1;\n\tposition: absolute;\n\tright: 0.4375rem;\n}\n\n.filterClearButton {\n\ttext-decoration: none;\n\tcolor: var(--lp-color-text-interactive-destructive);\n\tfont-size: 0.8125rem;\n\tfont-weight: var(--lp-font-weight-medium);\n\tpadding: 0.625rem;\n\twidth: 100%;\n\tborder-bottom: 1px solid var(--lp-color-border-interactive-secondary-base);\n}\n\n.filterClearButton:active,\n.filterClearButton:focus,\n.filterClearButton:hover {\n\toutline: none;\n\tbox-shadow: unset;\n\tcolor: var(--lp-color-text-interactive-destructive);\n}\n\n.filterClearButton:active {\n\tborder-bottom-color: var(--lp-color-border-interactive-secondary-active);\n\tbackground-color: var(--lp-color-bg-interactive-secondary-active);\n}\n\n.filterClearButton:focus {\n\tborder-bottom-color: var(--lp-color-border-interactive-secondary-focus);\n\tbackground-color: var(--lp-color-bg-interactive-secondary-focus);\n}\n\n.filterClearButton:hover {\n\tborder-bottom-color: var(--lp-color-border-interactive-secondary-hover);\n\tbackground-color: var(--lp-color-bg-interactive-secondary-hover);\n}\n","import type { ReactNode } from 'react';\n\nimport { Icon } from '@launchpad-ui/icons';\nimport { cx } from 'classix';\nimport { Children, forwardRef } from 'react';\n\nimport styles from './styles/Filter.module.css';\n\ntype AppliedFilterButtonProps = {\n\tname?: ReactNode;\n\tclassName?: string;\n\tchildren: ReactNode;\n\tonClickFilterButton?(): void;\n\t'data-test-id'?: string;\n};\n\ntype Ref = HTMLButtonElement;\n\nconst AppliedFilterButton = forwardRef<Ref, AppliedFilterButtonProps>((props, ref) => {\n\tconst {\n\t\tname,\n\t\tclassName,\n\t\tchildren,\n\t\tonClickFilterButton,\n\t\t'data-test-id': testId = 'applied-filter-button',\n\t} = props;\n\n\tconst hasDescription = Children.count(children) !== 0;\n\n\treturn (\n\t\t<div data-test-id={testId}>\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\taria-haspopup\n\t\t\t\tclassName={cx(styles.appliedButton, className)}\n\t\t\t\tref={ref}\n\t\t\t\tonClick={onClickFilterButton}\n\t\t\t>\n\t\t\t\t{name && (\n\t\t\t\t\t<span className={styles.appliedName} data-test-id={`${testId}-name`}>\n\t\t\t\t\t\t{name}\n\t\t\t\t\t\t{hasDescription && ':'}\n\t\t\t\t\t</span>\n\t\t\t\t)}\n\t\t\t\t{hasDescription && (\n\t\t\t\t\t<span className={styles.appliedDescription} data-test-id={`${testId}-description`}>\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</span>\n\t\t\t\t)}\n\t\t\t\t<Icon name=\"chevron-down\" size=\"small\" data-test-id={`${testId}-expand`} />\n\t\t\t</button>\n\t\t</div>\n\t);\n});\n\nAppliedFilterButton.displayName = 'AppliedFilterButton';\n\nexport type { AppliedFilterButtonProps };\nexport { AppliedFilterButton };\n","import type { MenuProps } from '@launchpad-ui/menu';\nimport type { ChangeEvent, ReactNode } from 'react';\n\nimport { Button } from '@launchpad-ui/button';\nimport { Icon } from '@launchpad-ui/icons';\nimport { Menu, MenuDivider, MenuItem, MenuSearch } from '@launchpad-ui/menu';\n\nimport styles from './styles/Filter.module.css';\n\n// biome-ignore lint/suspicious/noExplicitAny: ignore\ntype FilterOption<T = any> = {\n\tname?: ReactNode;\n\tisDisabled?: boolean;\n\tisDivider?: boolean;\n\tisChecked?: boolean;\n\tvalue: T | null;\n\tprojKey?: string;\n\tnested?: boolean;\n\tgroupHeader?: boolean;\n};\n\ntype FilterMenuProps = Pick<MenuProps<string>, 'enableVirtualization' | 'size' | 'data-test-id'> & {\n\toptions: FilterOption[];\n\tonClearFilter?(): void;\n\tenableSearch?: boolean;\n\tsearchValue?: string;\n\tsearchId?: string;\n\tsearchPlaceholder?: string;\n\tsearchAriaLabel?: string;\n\tonSearchChange?(event: ChangeEvent<HTMLInputElement>): void;\n\tonSelect?(): void;\n\tisLoading?: boolean;\n\tdisabledOptionTooltip?: string;\n};\n\nconst FilterMenu = ({\n\toptions,\n\tonClearFilter,\n\tenableSearch,\n\tsearchValue,\n\tsearchPlaceholder,\n\tsearchAriaLabel,\n\tsearchId,\n\tonSelect,\n\tonSearchChange,\n\tisLoading = false,\n\tdisabledOptionTooltip,\n\tenableVirtualization,\n\tsize,\n\t'data-test-id': testId = 'filter-menu',\n}: FilterMenuProps) => {\n\tconst filterOptions = isLoading\n\t\t? [{ name: 'loading...', value: 'loading...', isDisabled: true }]\n\t\t: options;\n\n\treturn (\n\t\t<>\n\t\t\t{onClearFilter && (\n\t\t\t\t<Button\n\t\t\t\t\ttabIndex={0}\n\t\t\t\t\tclassName={styles.filterClearButton}\n\t\t\t\t\tonClick={onClearFilter}\n\t\t\t\t\tkind=\"link\"\n\t\t\t\t\tdata-test-id=\"clear-filter-button\"\n\t\t\t\t>\n\t\t\t\t\tCLEAR FILTER\n\t\t\t\t</Button>\n\t\t\t)}\n\t\t\t<Menu\n\t\t\t\tenableVirtualization={enableVirtualization}\n\t\t\t\tsize={size}\n\t\t\t\tdata-test-id={testId}\n\t\t\t\tonSelect={onSelect}\n\t\t\t>\n\t\t\t\t{enableSearch && (\n\t\t\t\t\t<MenuSearch\n\t\t\t\t\t\tvalue={searchValue}\n\t\t\t\t\t\tid={searchId}\n\t\t\t\t\t\tplaceholder={searchPlaceholder}\n\t\t\t\t\t\tonChange={onSearchChange}\n\t\t\t\t\t\tariaLabel={searchAriaLabel}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t\t{filterOptions.map((option, index) => {\n\t\t\t\t\tif (option.isDivider) {\n\t\t\t\t\t\t// biome-ignore lint/suspicious/noArrayIndexKey: ignore\n\t\t\t\t\t\treturn <MenuDivider key={`divider-${index}`} />;\n\t\t\t\t\t}\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\titem={option}\n\t\t\t\t\t\t\tdisabled={option.isDisabled}\n\t\t\t\t\t\t\ticon={option.isChecked ? <Icon name=\"check\" /> : undefined}\n\t\t\t\t\t\t\tkey={option.value}\n\t\t\t\t\t\t\trole=\"menuitemradio\"\n\t\t\t\t\t\t\taria-checked={option.isChecked ? 'true' : undefined}\n\t\t\t\t\t\t\tnested={option.nested}\n\t\t\t\t\t\t\tgroupHeader={option.groupHeader}\n\t\t\t\t\t\t\ttooltip={\n\t\t\t\t\t\t\t\toption.isDisabled && disabledOptionTooltip ? disabledOptionTooltip : undefined\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttooltipPlacement=\"right\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{option.name}\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t);\n\t\t\t\t})}\n\t\t\t</Menu>\n\t\t</>\n\t);\n};\n\nexport { FilterMenu };\nexport type { FilterOption, FilterMenuProps };\n","import type { ChangeEvent, ReactNode } from 'react';\nimport type { FilterOption } from './FilterMenu';\n\nimport { Dropdown } from '@launchpad-ui/dropdown';\n\nimport { AppliedFilterButton } from './AppliedFilterButton';\nimport { FilterMenu } from './FilterMenu';\n\nconst SEARCH_INPUT_THRESHOLD = 4;\n\ntype AppliedFilterProps = {\n\tsearchValue?: string;\n\tonSearchChange?(event: ChangeEvent<HTMLInputElement>): void;\n\tonClearFilter?(): void;\n\tsearchPlaceholder?: string;\n\tname?: ReactNode;\n\tdescription: ReactNode;\n\toptions: FilterOption[];\n\tclassName?: string;\n\tonStateChange?({ isOpen }: { isOpen?: boolean }): void;\n\tonSelect?(item: FilterOption): void;\n\tisEmpty?: boolean;\n\tisLoading?: boolean;\n\tonClickFilterButton?(): void;\n\tsearchAriaLabel?: string;\n\tsearchId?: string;\n\t'data-test-id'?: string;\n};\n\n/**\n * @deprecated use `Menu` from `@launchpad-ui/components` instead\n *\n * https://launchpad.launchdarkly.com/?path=/docs/components-collections-menu--docs\n */\nconst AppliedFilter = ({\n\tsearchValue,\n\tonSearchChange,\n\tsearchPlaceholder,\n\tname,\n\tdescription,\n\toptions,\n\tclassName,\n\tisEmpty,\n\tisLoading,\n\tonClickFilterButton,\n\tonClearFilter,\n\tsearchAriaLabel,\n\tsearchId,\n\t'data-test-id': testId = 'applied-filter',\n\t...props\n}: AppliedFilterProps) => {\n\tconst enableSearch =\n\t\tonSearchChange && (!!searchValue || options.length > SEARCH_INPUT_THRESHOLD || !isEmpty);\n\n\treturn (\n\t\t<Dropdown targetClassName={className} placement=\"bottom-start\" enableArrow={false} {...props}>\n\t\t\t<AppliedFilterButton\n\t\t\t\tdata-test-id={testId}\n\t\t\t\tname={name}\n\t\t\t\tonClickFilterButton={onClickFilterButton}\n\t\t\t>\n\t\t\t\t{description}\n\t\t\t</AppliedFilterButton>\n\t\t\t<FilterMenu\n\t\t\t\toptions={options}\n\t\t\t\tsearchValue={searchValue}\n\t\t\t\tsearchPlaceholder={searchPlaceholder}\n\t\t\t\tenableSearch={enableSearch}\n\t\t\t\tsearchAriaLabel={searchAriaLabel}\n\t\t\t\tsearchId={searchId}\n\t\t\t\tonSearchChange={onSearchChange}\n\t\t\t\tonClearFilter={onClearFilter}\n\t\t\t\tisLoading={isLoading}\n\t\t\t/>\n\t\t</Dropdown>\n\t);\n};\n\nexport type { AppliedFilterProps };\nexport { AppliedFilter };\n","import type { JSX, MouseEvent, ReactNode, SyntheticEvent } from 'react';\n\nimport { IconButton } from '@launchpad-ui/button';\nimport { Icon } from '@launchpad-ui/icons';\nimport { Tooltip } from '@launchpad-ui/tooltip';\nimport { VisuallyHidden } from '@react-aria/visually-hidden';\nimport { cx } from 'classix';\nimport { Children, forwardRef, useId } from 'react';\n\nimport styles from './styles/Filter.module.css';\n\ntype FilterButtonProps = {\n\tname: ReactNode;\n\thideName?: boolean;\n\tisClearable?: boolean;\n\tonClear?(event: SyntheticEvent): void;\n\tclassName?: string;\n\tisSelected?: boolean;\n\tclearTooltip?: string | JSX.Element;\n\tchildren?: ReactNode;\n\tdisabled?: boolean;\n\tonClickFilterButton?(): void;\n\t'data-test-id'?: string;\n\tariaLabel?: string;\n};\n\ntype Ref = HTMLButtonElement;\n\nconst FilterButton = forwardRef<Ref, FilterButtonProps>((props, ref) => {\n\tconst {\n\t\tchildren,\n\t\tname,\n\t\thideName,\n\t\tisClearable,\n\t\tclearTooltip = 'Clear filter',\n\t\tonClear,\n\t\tdisabled,\n\t\tisSelected,\n\t\tonClickFilterButton,\n\t\tclassName,\n\t\t'data-test-id': testId = 'filter-button',\n\t\tariaLabel = 'Clear filter',\n\t\t...rest\n\t} = props;\n\tconst nameId = useId();\n\tconst descriptionId = useId();\n\n\tconst hasDescription = Children.count(children) !== 0;\n\n\tconst nameElement = (\n\t\t<span className={styles.name}>\n\t\t\t{name}\n\t\t\t{hasDescription && ':'}\n\t\t</span>\n\t);\n\n\tconst isDisabled = disabled;\n\n\tconst handleClick = (event: MouseEvent<HTMLButtonElement>) => {\n\t\tif (isDisabled) return event.preventDefault();\n\t\tonClickFilterButton?.();\n\t};\n\n\treturn (\n\t\t<div className={styles.buttonContainer} data-test-id={testId}>\n\t\t\t<button\n\t\t\t\t{...rest}\n\t\t\t\ttype=\"button\"\n\t\t\t\taria-labelledby={`${nameId} ${hasDescription ? descriptionId : ''}`}\n\t\t\t\taria-haspopup\n\t\t\t\tdisabled={isDisabled}\n\t\t\t\taria-disabled={isDisabled}\n\t\t\t\tclassName={cx(styles.button, className, (isClearable || isSelected) && styles.isClearable)}\n\t\t\t\tref={ref}\n\t\t\t\tonClick={handleClick}\n\t\t\t>\n\t\t\t\t{hideName ? (\n\t\t\t\t\t<VisuallyHidden id={nameId}>{nameElement}</VisuallyHidden>\n\t\t\t\t) : (\n\t\t\t\t\t<span id={nameId}>{nameElement}</span>\n\t\t\t\t)}\n\t\t\t\t{hasDescription && (\n\t\t\t\t\t<span id={descriptionId} className={styles.description}>\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</span>\n\t\t\t\t)}\n\t\t\t\t{!isClearable && <Icon name=\"chevron-down\" size=\"small\" />}\n\t\t\t</button>\n\t\t\t{isClearable && (\n\t\t\t\t<Tooltip targetClassName={styles.clearTooltip} content={clearTooltip}>\n\t\t\t\t\t<IconButton\n\t\t\t\t\t\taria-label={ariaLabel}\n\t\t\t\t\t\tclassName={styles.clear}\n\t\t\t\t\t\tdata-test-id=\"clear-filter-button\"\n\t\t\t\t\t\ticon={<Icon name=\"cancel\" size=\"small\" />}\n\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\tonClick={onClear}\n\t\t\t\t\t/>\n\t\t\t\t</Tooltip>\n\t\t\t)}\n\t\t</div>\n\t);\n});\n\nFilterButton.displayName = 'FilterButton';\n\nexport { FilterButton };\nexport type { FilterButtonProps };\n","import type { MenuProps } from '@launchpad-ui/menu';\nimport type { ChangeEvent, ReactNode, SyntheticEvent } from 'react';\nimport type { FilterOption } from './FilterMenu';\n\nimport { Dropdown } from '@launchpad-ui/dropdown';\nimport { cx } from 'classix';\n\nimport { FilterButton } from './FilterButton';\nimport { FilterMenu } from './FilterMenu';\nimport styles from './styles/Filter.module.css';\n\nconst SEARCH_INPUT_THRESHOLD = 4;\n\ntype FilterProps = Pick<MenuProps<string>, 'size' | 'enableVirtualization'> & {\n\tsearchValue?: string;\n\tonSearchChange?(event: ChangeEvent<HTMLInputElement>): void;\n\tsearchPlaceholder?: string;\n\tsearchAriaLabel?: string;\n\tname: ReactNode;\n\thideName?: boolean;\n\tdescription: ReactNode;\n\toptions: FilterOption[];\n\tisClearable?: boolean;\n\tonClear?(): void;\n\tclassName?: string;\n\tonStateChange?({ isOpen }: { isOpen?: boolean }): void;\n\tisSelected?: boolean;\n\tsearchId?: string;\n\tonSelect?(item: FilterOption): void;\n\tisEmpty?: boolean;\n\tisLoading?: boolean;\n\tdisabled?: boolean;\n\tonClickFilterButton?(): void;\n\tdisabledOptionTooltip?: string;\n\t'data-test-id'?: string;\n\ttriggerTestId?: string;\n\tclearAriaLabel?: string;\n};\n\n/**\n * @deprecated use `Menu` from `@launchpad-ui/components` instead\n *\n * https://launchpad.launchdarkly.com/?path=/docs/components-collections-menu--docs\n */\nconst Filter = ({\n\tsearchValue,\n\tonSearchChange,\n\tsearchPlaceholder,\n\tsearchAriaLabel,\n\tname,\n\thideName,\n\tdescription,\n\toptions,\n\tisClearable,\n\tonClear,\n\tisSelected,\n\tclassName,\n\tisEmpty,\n\tsearchId,\n\tisLoading,\n\tonClickFilterButton,\n\tdisabledOptionTooltip,\n\t'data-test-id': testId = 'filter',\n\tsize,\n\tdisabled,\n\tenableVirtualization,\n\tclearAriaLabel,\n\t...props\n}: FilterProps) => {\n\tconst enableSearch =\n\t\tonSearchChange && (!!searchValue || options.length > SEARCH_INPUT_THRESHOLD || !isEmpty);\n\n\tconst dropdownClasses = cx(styles.filter, className);\n\n\tconst handleClear = (event: SyntheticEvent) => {\n\t\tevent.preventDefault();\n\t\tonClear?.();\n\t};\n\n\treturn (\n\t\t<Dropdown\n\t\t\ttargetTestId={testId}\n\t\t\tdisabled={disabled}\n\t\t\ttargetClassName={dropdownClasses}\n\t\t\t{...props}\n\t\t>\n\t\t\t<FilterButton\n\t\t\t\tisClearable={isClearable}\n\t\t\t\tonClear={handleClear}\n\t\t\t\tname={name}\n\t\t\t\thideName={hideName}\n\t\t\t\tdisabled={disabled}\n\t\t\t\tisSelected={isSelected}\n\t\t\t\tonClickFilterButton={onClickFilterButton}\n\t\t\t\tariaLabel={clearAriaLabel}\n\t\t\t>\n\t\t\t\t{description}\n\t\t\t</FilterButton>\n\t\t\t<FilterMenu\n\t\t\t\toptions={options}\n\t\t\t\tsearchId={searchId}\n\t\t\t\tsearchValue={searchValue}\n\t\t\t\tsearchPlaceholder={searchPlaceholder}\n\t\t\t\tsearchAriaLabel={searchAriaLabel}\n\t\t\t\tenableSearch={enableSearch}\n\t\t\t\tonSearchChange={onSearchChange}\n\t\t\t\tisLoading={isLoading}\n\t\t\t\tdisabledOptionTooltip={disabledOptionTooltip}\n\t\t\t\tsize={size}\n\t\t\t\tenableVirtualization={enableVirtualization}\n\t\t\t/>\n\t\t</Dropdown>\n\t);\n};\n\nexport { Filter };\nexport type { FilterProps };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACkBA,MAAM,sCAAsB,WAA0C,CAAC,OAAO,QAAQ;CACrF,MAAM,EACL,MAAA,QACA,WACA,UACA,qBACA,gBAAgB,SAAS,yBACzB,GAAG;CAEJ,MAAM,iBAAiB,SAAS,MAAM,SAAS,KAAK;AAEpD,wBACC,IAAC,OAAA;EAAI,gBAAc;4BAClB,KAAC,UAAA;GACA,MAAK;GACL,iBAAA;GACA,WAAW,GAAG,sBAAO,eAAe,UAAU;GACzC;GACL,SAAS;;IAER,0BACA,KAAC,QAAA;KAAK,WAAW,sBAAO;KAAa,iBAAe,EAAE,OAAO;gBAC3D,QACA,kBAAkB,GAAA;MACb;IAEP,kCACA,IAAC,QAAA;KAAK,WAAW,sBAAO;KAAoB,iBAAe,EAAE,OAAO;KAClE;MACK;oBAER,IAAC,MAAA;KAAK,MAAK;KAAe,MAAK;KAAQ,iBAAe,EAAE,OAAO;;;;GAE3D;AAEP,EAAC;AAEF,oBAAoB,cAAc;ACpBlC,MAAM,aAAa,CAAC,EACnB,SACA,eACA,cACA,aACA,mBACA,iBACA,UACA,UACA,gBACA,YAAY,OACZ,uBACA,sBACA,MACA,gBAAgB,SAAS,eACR,KAAK;CACtB,MAAM,gBAAgB,YACnB,CAAC;EAAE,MAAM;EAAc,OAAO;EAAc,YAAY;CAAO,CAAA,IAC/D;AAEH,wBAC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A,aAAA,eACA,SACA,YACA,WACA,SACA,UACA,WACA,qBACA,uBACA,gBAAgB,SAAS,UACzB,MACA,UACA,sBACA,eACA,GAAG,OACU,KAAK;CAClB,MAAM,eACL,qBAAqB,eAAe,QAAQ,SAAS,2BAA2B;CAEjF,MAAM,kBAAkB,GAAG,sBAAO,QAAQ,UAAU;CAEpD,MAAM,cAAc,CAACC,UAA0B;AAC9C,QAAM,gBAAgB;AACtB,aAAW;CACX;AAED,wBACC,KAAC,UAAA;EACA,cAAc;EACJ;EACV,iBAAiB;EACjB,GAAI;6BAEJ,IAAC,cAAA;GACa,aAAA;GACb,SAAS;GACH,MAAA;GACI;GACA;GACE;GACS;GACrB,WAAW;aAEV;IACa,kBACf,IAAC,YAAA;GACS;GACC;GACG;GACM;GACF;GACH;GACE;GACL;GACY;GACjB;GACgB;IACrB;GACQ;AAEZ"}
|
|
1
|
+
{"version":3,"file":"index.es.js","names":[],"sources":["../src/styles/Filter.module.css","../src/AppliedFilterButton.tsx","../src/FilterMenu.tsx","../src/AppliedFilter.tsx","../src/FilterButton.tsx","../src/Filter.tsx"],"sourcesContent":[":root,\n[data-theme='default'] {\n\t--lp-component-filter-color-bg-clearable: rgb(0 0 0 / 0.15);\n\t--lp-component-filter-color-bg-clearable-focus: rgb(0 0 0 / 0.2);\n\t--lp-component-filter-color-border-clearable-focus: var(--lp-color-gray-800);\n}\n\n[data-theme='dark'] {\n\t--lp-component-filter-color-bg-clearable: rgb(248 248 248 / 0.15);\n\t--lp-component-filter-color-bg-clearable-focus: rgb(248 248 248 / 0.2);\n\t--lp-component-filter-color-border-clearable-focus: var(--lp-color-gray-500);\n}\n\n.filter {\n\tfont-family: var(--lp-font-family-base);\n}\n\n.buttonContainer {\n\tcursor: pointer;\n\tdisplay: inline-flex;\n\talign-items: center;\n\tposition: relative;\n}\n\n.button {\n\tborder-radius: var(--lp-border-radius-medium);\n\tpadding-top: 0;\n\tpadding-bottom: 0;\n\tline-height: 2rem;\n\tdisplay: flex;\n\talign-items: center;\n\tmargin: 0;\n\tcolor: var(--lp-color-text-ui-primary-base);\n\tbackground-color: var(--lp-color-bg-interactive-secondary-base);\n}\n\n.appliedButton {\n\tcolor: var(--lp-color-text-ui-primary-base);\n\theight: 1.25rem;\n\tbackground-color: var(--lp-color-bg-interactive-secondary-hover);\n\tpadding: 0.125rem 0.375rem;\n\tborder-radius: 0.125rem;\n\tdisplay: flex;\n}\n\n.button,\n.appliedButton {\n\tfont-family: inherit;\n\tfont-size: 0.8125rem;\n\tcursor: pointer;\n\tborder-width: var(--lp-border-width-200);\n\tborder-style: solid;\n\tborder-color: transparent;\n\n\t&:hover {\n\t\tbackground-color: var(--lp-color-bg-interactive-secondary-hover);\n\t\tborder-color: var(--lp-color-border-interactive-secondary-hover);\n\t}\n\n\t&:focus-visible {\n\t\toutline: none;\n\t\tborder-color: var(--lp-color-border-interactive-secondary-focus);\n\t\tbox-shadow:\n\t\t\t0 0 0 2px var(--lp-color-bg-ui-primary),\n\t\t\t0 0 0 4px var(--lp-color-shadow-interactive-focus);\n\t}\n}\n\n.name {\n\tmargin-right: 0.3125rem;\n\tfont-weight: var(--lp-font-weight-medium);\n}\n\n.appliedName {\n\tmargin-right: 0.1875rem;\n}\n\n.description {\n\tcolor: var(--lp-color-text-ui-primary-base);\n\tfont-weight: var(--lp-font-weight-medium);\n}\n\n.description,\n.appliedDescription {\n\tmargin-right: 0.3125rem;\n\tmax-width: 10rem;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n}\n\n.clear {\n\tcursor: pointer;\n\tpadding: 0.1875rem;\n}\n\n.button.isClearable {\n\tpadding-right: 1.9375rem;\n\tbackground-color: var(--lp-component-filter-color-bg-clearable);\n\n\t&:focus,\n\t&:hover,\n\t&:active {\n\t\tbackground-color: var(--lp-component-filter-color-bg-clearable-focus);\n\t\tborder-color: var(--lp-component-filter-color-border-clearable-focus);\n\t}\n}\n\n.button:hover:not(.isClearable),\n.button:focus:not(.isClearable),\n[data-state='open'] .button:not(.isClearable) {\n\tbackground-color: var(--lp-color-bg-interactive-secondary-hover);\n\tborder-color: var(--lp-color-border-interactive-secondary-hover);\n}\n\n.button:focus:not(:focus-visible):not(.isClearable) {\n\t&:hover {\n\t\tbackground-color: var(--lp-color-bg-interactive-secondary-hover);\n\t}\n}\n\n.clearTooltip {\n\tline-height: 1;\n\tposition: absolute;\n\tright: 0.4375rem;\n}\n\n.filterClearButton {\n\ttext-decoration: none;\n\tcolor: var(--lp-color-text-interactive-destructive);\n\tfont-size: 0.8125rem;\n\tfont-weight: var(--lp-font-weight-medium);\n\tpadding: 0.625rem;\n\twidth: 100%;\n\tborder-bottom: 1px solid var(--lp-color-border-interactive-secondary-base);\n}\n\n.filterClearButton:active,\n.filterClearButton:focus,\n.filterClearButton:hover {\n\toutline: none;\n\tbox-shadow: unset;\n\tcolor: var(--lp-color-text-interactive-destructive);\n}\n\n.filterClearButton:active {\n\tborder-bottom-color: var(--lp-color-border-interactive-secondary-active);\n\tbackground-color: var(--lp-color-bg-interactive-secondary-active);\n}\n\n.filterClearButton:focus {\n\tborder-bottom-color: var(--lp-color-border-interactive-secondary-focus);\n\tbackground-color: var(--lp-color-bg-interactive-secondary-focus);\n}\n\n.filterClearButton:hover {\n\tborder-bottom-color: var(--lp-color-border-interactive-secondary-hover);\n\tbackground-color: var(--lp-color-bg-interactive-secondary-hover);\n}\n","import type { ReactNode } from 'react';\n\nimport { Icon } from '@launchpad-ui/icons';\nimport { cx } from 'classix';\nimport { Children, forwardRef } from 'react';\n\nimport styles from './styles/Filter.module.css';\n\ntype AppliedFilterButtonProps = {\n\tname?: ReactNode;\n\tclassName?: string;\n\tchildren: ReactNode;\n\tonClickFilterButton?(): void;\n\t'data-test-id'?: string;\n};\n\ntype Ref = HTMLButtonElement;\n\nconst AppliedFilterButton = forwardRef<Ref, AppliedFilterButtonProps>((props, ref) => {\n\tconst {\n\t\tname,\n\t\tclassName,\n\t\tchildren,\n\t\tonClickFilterButton,\n\t\t'data-test-id': testId = 'applied-filter-button',\n\t} = props;\n\n\tconst hasDescription = Children.count(children) !== 0;\n\n\treturn (\n\t\t<div data-test-id={testId}>\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\taria-haspopup\n\t\t\t\tclassName={cx(styles.appliedButton, className)}\n\t\t\t\tref={ref}\n\t\t\t\tonClick={onClickFilterButton}\n\t\t\t>\n\t\t\t\t{name && (\n\t\t\t\t\t<span className={styles.appliedName} data-test-id={`${testId}-name`}>\n\t\t\t\t\t\t{name}\n\t\t\t\t\t\t{hasDescription && ':'}\n\t\t\t\t\t</span>\n\t\t\t\t)}\n\t\t\t\t{hasDescription && (\n\t\t\t\t\t<span className={styles.appliedDescription} data-test-id={`${testId}-description`}>\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</span>\n\t\t\t\t)}\n\t\t\t\t<Icon name=\"chevron-down\" size=\"small\" data-test-id={`${testId}-expand`} />\n\t\t\t</button>\n\t\t</div>\n\t);\n});\n\nAppliedFilterButton.displayName = 'AppliedFilterButton';\n\nexport type { AppliedFilterButtonProps };\nexport { AppliedFilterButton };\n","import type { MenuProps } from '@launchpad-ui/menu';\nimport type { ChangeEvent, ReactNode } from 'react';\n\nimport { Button } from '@launchpad-ui/button';\nimport { Icon } from '@launchpad-ui/icons';\nimport { Menu, MenuDivider, MenuItem, MenuSearch } from '@launchpad-ui/menu';\n\nimport styles from './styles/Filter.module.css';\n\n// biome-ignore lint/suspicious/noExplicitAny: ignore\ntype FilterOption<T = any> = {\n\tname?: ReactNode;\n\tisDisabled?: boolean;\n\tisDivider?: boolean;\n\tisChecked?: boolean;\n\tvalue: T | null;\n\tprojKey?: string;\n\tnested?: boolean;\n\tgroupHeader?: boolean;\n};\n\ntype FilterMenuProps = Pick<MenuProps<string>, 'enableVirtualization' | 'size' | 'data-test-id'> & {\n\toptions: FilterOption[];\n\tonClearFilter?(): void;\n\tenableSearch?: boolean;\n\tsearchValue?: string;\n\tsearchId?: string;\n\tsearchPlaceholder?: string;\n\tsearchAriaLabel?: string;\n\tonSearchChange?(event: ChangeEvent<HTMLInputElement>): void;\n\tonSelect?(): void;\n\tisLoading?: boolean;\n\tdisabledOptionTooltip?: string;\n};\n\nconst FilterMenu = ({\n\toptions,\n\tonClearFilter,\n\tenableSearch,\n\tsearchValue,\n\tsearchPlaceholder,\n\tsearchAriaLabel,\n\tsearchId,\n\tonSelect,\n\tonSearchChange,\n\tisLoading = false,\n\tdisabledOptionTooltip,\n\tenableVirtualization,\n\tsize,\n\t'data-test-id': testId = 'filter-menu',\n}: FilterMenuProps) => {\n\tconst filterOptions = isLoading\n\t\t? [{ name: 'loading...', value: 'loading...', isDisabled: true }]\n\t\t: options;\n\n\treturn (\n\t\t<>\n\t\t\t{onClearFilter && (\n\t\t\t\t<Button\n\t\t\t\t\ttabIndex={0}\n\t\t\t\t\tclassName={styles.filterClearButton}\n\t\t\t\t\tonClick={onClearFilter}\n\t\t\t\t\tkind=\"link\"\n\t\t\t\t\tdata-test-id=\"clear-filter-button\"\n\t\t\t\t>\n\t\t\t\t\tCLEAR FILTER\n\t\t\t\t</Button>\n\t\t\t)}\n\t\t\t<Menu\n\t\t\t\tenableVirtualization={enableVirtualization}\n\t\t\t\tsize={size}\n\t\t\t\tdata-test-id={testId}\n\t\t\t\tonSelect={onSelect}\n\t\t\t>\n\t\t\t\t{enableSearch && (\n\t\t\t\t\t<MenuSearch\n\t\t\t\t\t\tvalue={searchValue}\n\t\t\t\t\t\tid={searchId}\n\t\t\t\t\t\tplaceholder={searchPlaceholder}\n\t\t\t\t\t\tonChange={onSearchChange}\n\t\t\t\t\t\tariaLabel={searchAriaLabel}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t\t{filterOptions.map((option, index) => {\n\t\t\t\t\tif (option.isDivider) {\n\t\t\t\t\t\t// biome-ignore lint/suspicious/noArrayIndexKey: ignore\n\t\t\t\t\t\treturn <MenuDivider key={`divider-${index}`} />;\n\t\t\t\t\t}\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\titem={option}\n\t\t\t\t\t\t\tdisabled={option.isDisabled}\n\t\t\t\t\t\t\ticon={option.isChecked ? <Icon name=\"check\" /> : undefined}\n\t\t\t\t\t\t\tkey={option.value}\n\t\t\t\t\t\t\trole=\"menuitemradio\"\n\t\t\t\t\t\t\taria-checked={option.isChecked ? 'true' : undefined}\n\t\t\t\t\t\t\tnested={option.nested}\n\t\t\t\t\t\t\tgroupHeader={option.groupHeader}\n\t\t\t\t\t\t\ttooltip={\n\t\t\t\t\t\t\t\toption.isDisabled && disabledOptionTooltip ? disabledOptionTooltip : undefined\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttooltipPlacement=\"right\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{option.name}\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t);\n\t\t\t\t})}\n\t\t\t</Menu>\n\t\t</>\n\t);\n};\n\nexport { FilterMenu };\nexport type { FilterOption, FilterMenuProps };\n","import type { ChangeEvent, ReactNode } from 'react';\nimport type { FilterOption } from './FilterMenu';\n\nimport { Dropdown } from '@launchpad-ui/dropdown';\n\nimport { AppliedFilterButton } from './AppliedFilterButton';\nimport { FilterMenu } from './FilterMenu';\n\nconst SEARCH_INPUT_THRESHOLD = 4;\n\ntype AppliedFilterProps = {\n\tsearchValue?: string;\n\tonSearchChange?(event: ChangeEvent<HTMLInputElement>): void;\n\tonClearFilter?(): void;\n\tsearchPlaceholder?: string;\n\tname?: ReactNode;\n\tdescription: ReactNode;\n\toptions: FilterOption[];\n\tclassName?: string;\n\tonStateChange?({ isOpen }: { isOpen?: boolean }): void;\n\tonSelect?(item: FilterOption): void;\n\tisEmpty?: boolean;\n\tisLoading?: boolean;\n\tonClickFilterButton?(): void;\n\tsearchAriaLabel?: string;\n\tsearchId?: string;\n\t'data-test-id'?: string;\n};\n\n/**\n * @deprecated use `Menu` from `@launchpad-ui/components` instead\n *\n * https://launchpad.launchdarkly.com/?path=/docs/components-collections-menu--docs\n */\nconst AppliedFilter = ({\n\tsearchValue,\n\tonSearchChange,\n\tsearchPlaceholder,\n\tname,\n\tdescription,\n\toptions,\n\tclassName,\n\tisEmpty,\n\tisLoading,\n\tonClickFilterButton,\n\tonClearFilter,\n\tsearchAriaLabel,\n\tsearchId,\n\t'data-test-id': testId = 'applied-filter',\n\t...props\n}: AppliedFilterProps) => {\n\tconst enableSearch =\n\t\tonSearchChange && (!!searchValue || options.length > SEARCH_INPUT_THRESHOLD || !isEmpty);\n\n\treturn (\n\t\t<Dropdown targetClassName={className} placement=\"bottom-start\" enableArrow={false} {...props}>\n\t\t\t<AppliedFilterButton\n\t\t\t\tdata-test-id={testId}\n\t\t\t\tname={name}\n\t\t\t\tonClickFilterButton={onClickFilterButton}\n\t\t\t>\n\t\t\t\t{description}\n\t\t\t</AppliedFilterButton>\n\t\t\t<FilterMenu\n\t\t\t\toptions={options}\n\t\t\t\tsearchValue={searchValue}\n\t\t\t\tsearchPlaceholder={searchPlaceholder}\n\t\t\t\tenableSearch={enableSearch}\n\t\t\t\tsearchAriaLabel={searchAriaLabel}\n\t\t\t\tsearchId={searchId}\n\t\t\t\tonSearchChange={onSearchChange}\n\t\t\t\tonClearFilter={onClearFilter}\n\t\t\t\tisLoading={isLoading}\n\t\t\t/>\n\t\t</Dropdown>\n\t);\n};\n\nexport type { AppliedFilterProps };\nexport { AppliedFilter };\n","import type { JSX, MouseEvent, ReactNode, SyntheticEvent } from 'react';\n\nimport { IconButton } from '@launchpad-ui/button';\nimport { Icon } from '@launchpad-ui/icons';\nimport { Tooltip } from '@launchpad-ui/tooltip';\nimport { cx } from 'classix';\nimport { Children, forwardRef, useId } from 'react';\nimport { VisuallyHidden } from 'react-aria/VisuallyHidden';\n\nimport styles from './styles/Filter.module.css';\n\ntype FilterButtonProps = {\n\tname: ReactNode;\n\thideName?: boolean;\n\tisClearable?: boolean;\n\tonClear?(event: SyntheticEvent): void;\n\tclassName?: string;\n\tisSelected?: boolean;\n\tclearTooltip?: string | JSX.Element;\n\tchildren?: ReactNode;\n\tdisabled?: boolean;\n\tonClickFilterButton?(): void;\n\t'data-test-id'?: string;\n\tariaLabel?: string;\n};\n\ntype Ref = HTMLButtonElement;\n\nconst FilterButton = forwardRef<Ref, FilterButtonProps>((props, ref) => {\n\tconst {\n\t\tchildren,\n\t\tname,\n\t\thideName,\n\t\tisClearable,\n\t\tclearTooltip = 'Clear filter',\n\t\tonClear,\n\t\tdisabled,\n\t\tisSelected,\n\t\tonClickFilterButton,\n\t\tclassName,\n\t\t'data-test-id': testId = 'filter-button',\n\t\tariaLabel = 'Clear filter',\n\t\t...rest\n\t} = props;\n\tconst nameId = useId();\n\tconst descriptionId = useId();\n\n\tconst hasDescription = Children.count(children) !== 0;\n\n\tconst nameElement = (\n\t\t<span className={styles.name}>\n\t\t\t{name}\n\t\t\t{hasDescription && ':'}\n\t\t</span>\n\t);\n\n\tconst isDisabled = disabled;\n\n\tconst handleClick = (event: MouseEvent<HTMLButtonElement>) => {\n\t\tif (isDisabled) return event.preventDefault();\n\t\tonClickFilterButton?.();\n\t};\n\n\treturn (\n\t\t<div className={styles.buttonContainer} data-test-id={testId}>\n\t\t\t<button\n\t\t\t\t{...rest}\n\t\t\t\ttype=\"button\"\n\t\t\t\taria-labelledby={`${nameId} ${hasDescription ? descriptionId : ''}`}\n\t\t\t\taria-haspopup\n\t\t\t\tdisabled={isDisabled}\n\t\t\t\taria-disabled={isDisabled}\n\t\t\t\tclassName={cx(styles.button, className, (isClearable || isSelected) && styles.isClearable)}\n\t\t\t\tref={ref}\n\t\t\t\tonClick={handleClick}\n\t\t\t>\n\t\t\t\t{hideName ? (\n\t\t\t\t\t<VisuallyHidden id={nameId}>{nameElement}</VisuallyHidden>\n\t\t\t\t) : (\n\t\t\t\t\t<span id={nameId}>{nameElement}</span>\n\t\t\t\t)}\n\t\t\t\t{hasDescription && (\n\t\t\t\t\t<span id={descriptionId} className={styles.description}>\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</span>\n\t\t\t\t)}\n\t\t\t\t{!isClearable && <Icon name=\"chevron-down\" size=\"small\" />}\n\t\t\t</button>\n\t\t\t{isClearable && (\n\t\t\t\t<Tooltip targetClassName={styles.clearTooltip} content={clearTooltip}>\n\t\t\t\t\t<IconButton\n\t\t\t\t\t\taria-label={ariaLabel}\n\t\t\t\t\t\tclassName={styles.clear}\n\t\t\t\t\t\tdata-test-id=\"clear-filter-button\"\n\t\t\t\t\t\ticon={<Icon name=\"cancel\" size=\"small\" />}\n\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\tonClick={onClear}\n\t\t\t\t\t/>\n\t\t\t\t</Tooltip>\n\t\t\t)}\n\t\t</div>\n\t);\n});\n\nFilterButton.displayName = 'FilterButton';\n\nexport { FilterButton };\nexport type { FilterButtonProps };\n","import type { MenuProps } from '@launchpad-ui/menu';\nimport type { ChangeEvent, ReactNode, SyntheticEvent } from 'react';\nimport type { FilterOption } from './FilterMenu';\n\nimport { Dropdown } from '@launchpad-ui/dropdown';\nimport { cx } from 'classix';\n\nimport { FilterButton } from './FilterButton';\nimport { FilterMenu } from './FilterMenu';\nimport styles from './styles/Filter.module.css';\n\nconst SEARCH_INPUT_THRESHOLD = 4;\n\ntype FilterProps = Pick<MenuProps<string>, 'size' | 'enableVirtualization'> & {\n\tsearchValue?: string;\n\tonSearchChange?(event: ChangeEvent<HTMLInputElement>): void;\n\tsearchPlaceholder?: string;\n\tsearchAriaLabel?: string;\n\tname: ReactNode;\n\thideName?: boolean;\n\tdescription: ReactNode;\n\toptions: FilterOption[];\n\tisClearable?: boolean;\n\tonClear?(): void;\n\tclassName?: string;\n\tonStateChange?({ isOpen }: { isOpen?: boolean }): void;\n\tisSelected?: boolean;\n\tsearchId?: string;\n\tonSelect?(item: FilterOption): void;\n\tisEmpty?: boolean;\n\tisLoading?: boolean;\n\tdisabled?: boolean;\n\tonClickFilterButton?(): void;\n\tdisabledOptionTooltip?: string;\n\t'data-test-id'?: string;\n\ttriggerTestId?: string;\n\tclearAriaLabel?: string;\n};\n\n/**\n * @deprecated use `Menu` from `@launchpad-ui/components` instead\n *\n * https://launchpad.launchdarkly.com/?path=/docs/components-collections-menu--docs\n */\nconst Filter = ({\n\tsearchValue,\n\tonSearchChange,\n\tsearchPlaceholder,\n\tsearchAriaLabel,\n\tname,\n\thideName,\n\tdescription,\n\toptions,\n\tisClearable,\n\tonClear,\n\tisSelected,\n\tclassName,\n\tisEmpty,\n\tsearchId,\n\tisLoading,\n\tonClickFilterButton,\n\tdisabledOptionTooltip,\n\t'data-test-id': testId = 'filter',\n\tsize,\n\tdisabled,\n\tenableVirtualization,\n\tclearAriaLabel,\n\t...props\n}: FilterProps) => {\n\tconst enableSearch =\n\t\tonSearchChange && (!!searchValue || options.length > SEARCH_INPUT_THRESHOLD || !isEmpty);\n\n\tconst dropdownClasses = cx(styles.filter, className);\n\n\tconst handleClear = (event: SyntheticEvent) => {\n\t\tevent.preventDefault();\n\t\tonClear?.();\n\t};\n\n\treturn (\n\t\t<Dropdown\n\t\t\ttargetTestId={testId}\n\t\t\tdisabled={disabled}\n\t\t\ttargetClassName={dropdownClasses}\n\t\t\t{...props}\n\t\t>\n\t\t\t<FilterButton\n\t\t\t\tisClearable={isClearable}\n\t\t\t\tonClear={handleClear}\n\t\t\t\tname={name}\n\t\t\t\thideName={hideName}\n\t\t\t\tdisabled={disabled}\n\t\t\t\tisSelected={isSelected}\n\t\t\t\tonClickFilterButton={onClickFilterButton}\n\t\t\t\tariaLabel={clearAriaLabel}\n\t\t\t>\n\t\t\t\t{description}\n\t\t\t</FilterButton>\n\t\t\t<FilterMenu\n\t\t\t\toptions={options}\n\t\t\t\tsearchId={searchId}\n\t\t\t\tsearchValue={searchValue}\n\t\t\t\tsearchPlaceholder={searchPlaceholder}\n\t\t\t\tsearchAriaLabel={searchAriaLabel}\n\t\t\t\tenableSearch={enableSearch}\n\t\t\t\tonSearchChange={onSearchChange}\n\t\t\t\tisLoading={isLoading}\n\t\t\t\tdisabledOptionTooltip={disabledOptionTooltip}\n\t\t\t\tsize={size}\n\t\t\t\tenableVirtualization={enableVirtualization}\n\t\t\t/>\n\t\t</Dropdown>\n\t);\n};\n\nexport { Filter };\nexport type { FilterProps };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;ACkBA,IAAM,sBAAsB,4BAA2C,OAAO,QAAQ;CACrF,MAAM,EACL,MAAA,QACA,WACA,UACA,qBACA,gBAAgB,SAAS,4BACtB;CAEJ,MAAM,iBAAiB,SAAS,MAAM,SAAS,KAAK;AAEpD,QACC,oBAAC,OAAA;EAAI,gBAAc;YAClB,qBAAC,UAAA;GACA,MAAK;GACL,iBAAA;GACA,WAAW,GAAG,sBAAO,eAAe,UAAU;GACzC;GACL,SAAS;;IAER,UACA,qBAAC,QAAA;KAAK,WAAW,sBAAO;KAAa,gBAAc,GAAG,OAAO;gBAC3D,QACA,kBAAkB,IAAA;MACb;IAEP,kBACA,oBAAC,QAAA;KAAK,WAAW,sBAAO;KAAoB,gBAAc,GAAG,OAAO;KAClE;MACK;IAER,oBAAC,MAAA;KAAK,MAAK;KAAe,MAAK;KAAQ,gBAAc,GAAG,OAAO;;;;GAE3D;EAEN;AAEF,oBAAoB,cAAc;ACpBlC,IAAM,cAAc,EACnB,SACA,eACA,cACA,aACA,mBACA,iBACA,UACA,UACA,gBACA,YAAY,OACZ,uBACA,sBACA,MACA,gBAAgB,SAAS,oBACH;CACtB,MAAM,gBAAgB,YACnB,CAAC;EAAE,MAAM;EAAc,OAAO;EAAc,YAAY;EAAM,CAAC,GAC/D;AAEH,QACC,qBAAA,UAAA,EAAA,UAAA,CACE,iBACA,oBAAC,QAAA;EACA,UAAU;EACV,WAAW,sBAAO;EAClB,SAAS;EACT,MAAK;EACL,gBAAa;YACb;GAEQ,EAEV,qBAAC,MAAA;EACsB;EAChB;EACN,gBAAc;EACJ;aAET,gBACA,oBAAC,YAAA;GACA,OAAO;GACP,IAAI;GACJ,aAAa;GACb,UAAU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C,QAAM,gBAAgB;AACtB,aAAW;;AAGZ,QACC,qBAAC,UAAA;EACA,cAAc;EACJ;EACV,iBAAiB;EACjB,GAAI;aAEJ,oBAAC,cAAA;GACa,aAAA;GACb,SAAS;GACH,MAAA;GACI;GACA;GACE;GACS;GACrB,WAAW;aAEV;IACa,EACf,oBAAC,YAAA;GACS;GACC;GACG;GACM;GACF;GACH;GACE;GACL;GACY;GACjB;GACgB;IACrB,CAAA;GACQ"}
|
package/dist/index.js
CHANGED
|
@@ -1,33 +1,14 @@
|
|
|
1
1
|
require('./style.css');
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
get: ((k) => from[k]).bind(null, key),
|
|
13
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
19
|
-
value: mod,
|
|
20
|
-
enumerable: true
|
|
21
|
-
}) : target, mod));
|
|
22
|
-
const __launchpad_ui_dropdown = __toESM(require("@launchpad-ui/dropdown"));
|
|
23
|
-
const __launchpad_ui_icons = __toESM(require("@launchpad-ui/icons"));
|
|
24
|
-
const classix = __toESM(require("classix"));
|
|
25
|
-
const react = __toESM(require("react"));
|
|
26
|
-
const react_jsx_runtime = __toESM(require("react/jsx-runtime"));
|
|
27
|
-
const __launchpad_ui_button = __toESM(require("@launchpad-ui/button"));
|
|
28
|
-
const __launchpad_ui_menu = __toESM(require("@launchpad-ui/menu"));
|
|
29
|
-
const __launchpad_ui_tooltip = __toESM(require("@launchpad-ui/tooltip"));
|
|
30
|
-
const __react_aria_visually_hidden = __toESM(require("@react-aria/visually-hidden"));
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
let __launchpad_ui_dropdown = require("@launchpad-ui/dropdown");
|
|
4
|
+
let __launchpad_ui_icons = require("@launchpad-ui/icons");
|
|
5
|
+
let classix = require("classix");
|
|
6
|
+
let react = require("react");
|
|
7
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
8
|
+
let __launchpad_ui_button = require("@launchpad-ui/button");
|
|
9
|
+
let __launchpad_ui_menu = require("@launchpad-ui/menu");
|
|
10
|
+
let __launchpad_ui_tooltip = require("@launchpad-ui/tooltip");
|
|
11
|
+
let react_aria_VisuallyHidden = require("react-aria/VisuallyHidden");
|
|
31
12
|
const appliedButton = "vLReaG_appliedButton";
|
|
32
13
|
const appliedDescription = "vLReaG_appliedDescription";
|
|
33
14
|
const appliedName = "vLReaG_appliedName";
|
|
@@ -54,7 +35,7 @@ var Filter_module_default = {
|
|
|
54
35
|
isClearable,
|
|
55
36
|
name
|
|
56
37
|
};
|
|
57
|
-
|
|
38
|
+
var AppliedFilterButton = /* @__PURE__ */ (0, react.forwardRef)((props, ref) => {
|
|
58
39
|
const { name: name$1, className, children, onClickFilterButton, "data-test-id": testId = "applied-filter-button" } = props;
|
|
59
40
|
const hasDescription = react.Children.count(children) !== 0;
|
|
60
41
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
@@ -86,7 +67,7 @@ const AppliedFilterButton = /* @__PURE__ */ (0, react.forwardRef)((props, ref) =
|
|
|
86
67
|
});
|
|
87
68
|
});
|
|
88
69
|
AppliedFilterButton.displayName = "AppliedFilterButton";
|
|
89
|
-
|
|
70
|
+
var FilterMenu = ({ options, onClearFilter, enableSearch, searchValue, searchPlaceholder, searchAriaLabel, searchId, onSelect, onSearchChange, isLoading = false, disabledOptionTooltip, enableVirtualization, size, "data-test-id": testId = "filter-menu" }) => {
|
|
90
71
|
const filterOptions = isLoading ? [{
|
|
91
72
|
name: "loading...",
|
|
92
73
|
value: "loading...",
|
|
@@ -127,13 +108,8 @@ const FilterMenu = ({ options, onClearFilter, enableSearch, searchValue, searchP
|
|
|
127
108
|
})]
|
|
128
109
|
})] });
|
|
129
110
|
};
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
* @deprecated use `Menu` from `@launchpad-ui/components` instead
|
|
133
|
-
*
|
|
134
|
-
* https://launchpad.launchdarkly.com/?path=/docs/components-collections-menu--docs
|
|
135
|
-
*/
|
|
136
|
-
const AppliedFilter = ({ searchValue, onSearchChange, searchPlaceholder, name: name$1, description: description$1, options, className, isEmpty, isLoading, onClickFilterButton, onClearFilter, searchAriaLabel, searchId, "data-test-id": testId = "applied-filter",...props }) => {
|
|
111
|
+
var SEARCH_INPUT_THRESHOLD$1 = 4;
|
|
112
|
+
var AppliedFilter = ({ searchValue, onSearchChange, searchPlaceholder, name: name$1, description: description$1, options, className, isEmpty, isLoading, onClickFilterButton, onClearFilter, searchAriaLabel, searchId, "data-test-id": testId = "applied-filter", ...props }) => {
|
|
137
113
|
const enableSearch = onSearchChange && (!!searchValue || options.length > SEARCH_INPUT_THRESHOLD$1 || !isEmpty);
|
|
138
114
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__launchpad_ui_dropdown.Dropdown, {
|
|
139
115
|
targetClassName: className,
|
|
@@ -158,8 +134,8 @@ const AppliedFilter = ({ searchValue, onSearchChange, searchPlaceholder, name: n
|
|
|
158
134
|
})]
|
|
159
135
|
});
|
|
160
136
|
};
|
|
161
|
-
|
|
162
|
-
const { children, name: name$1, hideName, isClearable: isClearable$1, clearTooltip: clearTooltip$1 = "Clear filter", onClear, disabled, isSelected, onClickFilterButton, className, "data-test-id": testId = "filter-button", ariaLabel = "Clear filter"
|
|
137
|
+
var FilterButton = /* @__PURE__ */ (0, react.forwardRef)((props, ref) => {
|
|
138
|
+
const { children, name: name$1, hideName, isClearable: isClearable$1, clearTooltip: clearTooltip$1 = "Clear filter", onClear, disabled, isSelected, onClickFilterButton, className, "data-test-id": testId = "filter-button", ariaLabel = "Clear filter", ...rest } = props;
|
|
163
139
|
const nameId = (0, react.useId)();
|
|
164
140
|
const descriptionId = (0, react.useId)();
|
|
165
141
|
const hasDescription = react.Children.count(children) !== 0;
|
|
@@ -186,7 +162,7 @@ const FilterButton = /* @__PURE__ */ (0, react.forwardRef)((props, ref) => {
|
|
|
186
162
|
ref,
|
|
187
163
|
onClick: handleClick,
|
|
188
164
|
children: [
|
|
189
|
-
hideName ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
165
|
+
hideName ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_aria_VisuallyHidden.VisuallyHidden, {
|
|
190
166
|
id: nameId,
|
|
191
167
|
children: nameElement
|
|
192
168
|
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
@@ -221,13 +197,8 @@ const FilterButton = /* @__PURE__ */ (0, react.forwardRef)((props, ref) => {
|
|
|
221
197
|
});
|
|
222
198
|
});
|
|
223
199
|
FilterButton.displayName = "FilterButton";
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
* @deprecated use `Menu` from `@launchpad-ui/components` instead
|
|
227
|
-
*
|
|
228
|
-
* https://launchpad.launchdarkly.com/?path=/docs/components-collections-menu--docs
|
|
229
|
-
*/
|
|
230
|
-
const Filter = ({ searchValue, onSearchChange, searchPlaceholder, searchAriaLabel, name: name$1, hideName, description: description$1, options, isClearable: isClearable$1, onClear, isSelected, className, isEmpty, searchId, isLoading, onClickFilterButton, disabledOptionTooltip, "data-test-id": testId = "filter", size, disabled, enableVirtualization, clearAriaLabel,...props }) => {
|
|
200
|
+
var SEARCH_INPUT_THRESHOLD = 4;
|
|
201
|
+
var Filter = ({ searchValue, onSearchChange, searchPlaceholder, searchAriaLabel, name: name$1, hideName, description: description$1, options, isClearable: isClearable$1, onClear, isSelected, className, isEmpty, searchId, isLoading, onClickFilterButton, disabledOptionTooltip, "data-test-id": testId = "filter", size, disabled, enableVirtualization, clearAriaLabel, ...props }) => {
|
|
231
202
|
const enableSearch = onSearchChange && (!!searchValue || options.length > SEARCH_INPUT_THRESHOLD || !isEmpty);
|
|
232
203
|
const dropdownClasses = (0, classix.cx)(Filter_module_default.filter, className);
|
|
233
204
|
const handleClear = (event) => {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["event: MouseEvent<HTMLButtonElement>","event: SyntheticEvent"],"sources":["../src/styles/Filter.module.css","../src/AppliedFilterButton.tsx","../src/FilterMenu.tsx","../src/AppliedFilter.tsx","../src/FilterButton.tsx","../src/Filter.tsx"],"sourcesContent":[":root,\n[data-theme='default'] {\n\t--lp-component-filter-color-bg-clearable: rgb(0 0 0 / 0.15);\n\t--lp-component-filter-color-bg-clearable-focus: rgb(0 0 0 / 0.2);\n\t--lp-component-filter-color-border-clearable-focus: var(--lp-color-gray-800);\n}\n\n[data-theme='dark'] {\n\t--lp-component-filter-color-bg-clearable: rgb(248 248 248 / 0.15);\n\t--lp-component-filter-color-bg-clearable-focus: rgb(248 248 248 / 0.2);\n\t--lp-component-filter-color-border-clearable-focus: var(--lp-color-gray-500);\n}\n\n.filter {\n\tfont-family: var(--lp-font-family-base);\n}\n\n.buttonContainer {\n\tcursor: pointer;\n\tdisplay: inline-flex;\n\talign-items: center;\n\tposition: relative;\n}\n\n.button {\n\tborder-radius: var(--lp-border-radius-medium);\n\tpadding-top: 0;\n\tpadding-bottom: 0;\n\tline-height: 2rem;\n\tdisplay: flex;\n\talign-items: center;\n\tmargin: 0;\n\tcolor: var(--lp-color-text-ui-primary-base);\n\tbackground-color: var(--lp-color-bg-interactive-secondary-base);\n}\n\n.appliedButton {\n\tcolor: var(--lp-color-text-ui-primary-base);\n\theight: 1.25rem;\n\tbackground-color: var(--lp-color-bg-interactive-secondary-hover);\n\tpadding: 0.125rem 0.375rem;\n\tborder-radius: 0.125rem;\n\tdisplay: flex;\n}\n\n.button,\n.appliedButton {\n\tfont-family: inherit;\n\tfont-size: 0.8125rem;\n\tcursor: pointer;\n\tborder-width: var(--lp-border-width-200);\n\tborder-style: solid;\n\tborder-color: transparent;\n\n\t&:hover {\n\t\tbackground-color: var(--lp-color-bg-interactive-secondary-hover);\n\t\tborder-color: var(--lp-color-border-interactive-secondary-hover);\n\t}\n\n\t&:focus-visible {\n\t\toutline: none;\n\t\tborder-color: var(--lp-color-border-interactive-secondary-focus);\n\t\tbox-shadow:\n\t\t\t0 0 0 2px var(--lp-color-bg-ui-primary),\n\t\t\t0 0 0 4px var(--lp-color-shadow-interactive-focus);\n\t}\n}\n\n.name {\n\tmargin-right: 0.3125rem;\n\tfont-weight: var(--lp-font-weight-medium);\n}\n\n.appliedName {\n\tmargin-right: 0.1875rem;\n}\n\n.description {\n\tcolor: var(--lp-color-text-ui-primary-base);\n\tfont-weight: var(--lp-font-weight-medium);\n}\n\n.description,\n.appliedDescription {\n\tmargin-right: 0.3125rem;\n\tmax-width: 10rem;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n}\n\n.clear {\n\tcursor: pointer;\n\tpadding: 0.1875rem;\n}\n\n.button.isClearable {\n\tpadding-right: 1.9375rem;\n\tbackground-color: var(--lp-component-filter-color-bg-clearable);\n\n\t&:focus,\n\t&:hover,\n\t&:active {\n\t\tbackground-color: var(--lp-component-filter-color-bg-clearable-focus);\n\t\tborder-color: var(--lp-component-filter-color-border-clearable-focus);\n\t}\n}\n\n.button:hover:not(.isClearable),\n.button:focus:not(.isClearable),\n[data-state='open'] .button:not(.isClearable) {\n\tbackground-color: var(--lp-color-bg-interactive-secondary-hover);\n\tborder-color: var(--lp-color-border-interactive-secondary-hover);\n}\n\n.button:focus:not(:focus-visible):not(.isClearable) {\n\t&:hover {\n\t\tbackground-color: var(--lp-color-bg-interactive-secondary-hover);\n\t}\n}\n\n.clearTooltip {\n\tline-height: 1;\n\tposition: absolute;\n\tright: 0.4375rem;\n}\n\n.filterClearButton {\n\ttext-decoration: none;\n\tcolor: var(--lp-color-text-interactive-destructive);\n\tfont-size: 0.8125rem;\n\tfont-weight: var(--lp-font-weight-medium);\n\tpadding: 0.625rem;\n\twidth: 100%;\n\tborder-bottom: 1px solid var(--lp-color-border-interactive-secondary-base);\n}\n\n.filterClearButton:active,\n.filterClearButton:focus,\n.filterClearButton:hover {\n\toutline: none;\n\tbox-shadow: unset;\n\tcolor: var(--lp-color-text-interactive-destructive);\n}\n\n.filterClearButton:active {\n\tborder-bottom-color: var(--lp-color-border-interactive-secondary-active);\n\tbackground-color: var(--lp-color-bg-interactive-secondary-active);\n}\n\n.filterClearButton:focus {\n\tborder-bottom-color: var(--lp-color-border-interactive-secondary-focus);\n\tbackground-color: var(--lp-color-bg-interactive-secondary-focus);\n}\n\n.filterClearButton:hover {\n\tborder-bottom-color: var(--lp-color-border-interactive-secondary-hover);\n\tbackground-color: var(--lp-color-bg-interactive-secondary-hover);\n}\n","import type { ReactNode } from 'react';\n\nimport { Icon } from '@launchpad-ui/icons';\nimport { cx } from 'classix';\nimport { Children, forwardRef } from 'react';\n\nimport styles from './styles/Filter.module.css';\n\ntype AppliedFilterButtonProps = {\n\tname?: ReactNode;\n\tclassName?: string;\n\tchildren: ReactNode;\n\tonClickFilterButton?(): void;\n\t'data-test-id'?: string;\n};\n\ntype Ref = HTMLButtonElement;\n\nconst AppliedFilterButton = forwardRef<Ref, AppliedFilterButtonProps>((props, ref) => {\n\tconst {\n\t\tname,\n\t\tclassName,\n\t\tchildren,\n\t\tonClickFilterButton,\n\t\t'data-test-id': testId = 'applied-filter-button',\n\t} = props;\n\n\tconst hasDescription = Children.count(children) !== 0;\n\n\treturn (\n\t\t<div data-test-id={testId}>\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\taria-haspopup\n\t\t\t\tclassName={cx(styles.appliedButton, className)}\n\t\t\t\tref={ref}\n\t\t\t\tonClick={onClickFilterButton}\n\t\t\t>\n\t\t\t\t{name && (\n\t\t\t\t\t<span className={styles.appliedName} data-test-id={`${testId}-name`}>\n\t\t\t\t\t\t{name}\n\t\t\t\t\t\t{hasDescription && ':'}\n\t\t\t\t\t</span>\n\t\t\t\t)}\n\t\t\t\t{hasDescription && (\n\t\t\t\t\t<span className={styles.appliedDescription} data-test-id={`${testId}-description`}>\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</span>\n\t\t\t\t)}\n\t\t\t\t<Icon name=\"chevron-down\" size=\"small\" data-test-id={`${testId}-expand`} />\n\t\t\t</button>\n\t\t</div>\n\t);\n});\n\nAppliedFilterButton.displayName = 'AppliedFilterButton';\n\nexport type { AppliedFilterButtonProps };\nexport { AppliedFilterButton };\n","import type { MenuProps } from '@launchpad-ui/menu';\nimport type { ChangeEvent, ReactNode } from 'react';\n\nimport { Button } from '@launchpad-ui/button';\nimport { Icon } from '@launchpad-ui/icons';\nimport { Menu, MenuDivider, MenuItem, MenuSearch } from '@launchpad-ui/menu';\n\nimport styles from './styles/Filter.module.css';\n\n// biome-ignore lint/suspicious/noExplicitAny: ignore\ntype FilterOption<T = any> = {\n\tname?: ReactNode;\n\tisDisabled?: boolean;\n\tisDivider?: boolean;\n\tisChecked?: boolean;\n\tvalue: T | null;\n\tprojKey?: string;\n\tnested?: boolean;\n\tgroupHeader?: boolean;\n};\n\ntype FilterMenuProps = Pick<MenuProps<string>, 'enableVirtualization' | 'size' | 'data-test-id'> & {\n\toptions: FilterOption[];\n\tonClearFilter?(): void;\n\tenableSearch?: boolean;\n\tsearchValue?: string;\n\tsearchId?: string;\n\tsearchPlaceholder?: string;\n\tsearchAriaLabel?: string;\n\tonSearchChange?(event: ChangeEvent<HTMLInputElement>): void;\n\tonSelect?(): void;\n\tisLoading?: boolean;\n\tdisabledOptionTooltip?: string;\n};\n\nconst FilterMenu = ({\n\toptions,\n\tonClearFilter,\n\tenableSearch,\n\tsearchValue,\n\tsearchPlaceholder,\n\tsearchAriaLabel,\n\tsearchId,\n\tonSelect,\n\tonSearchChange,\n\tisLoading = false,\n\tdisabledOptionTooltip,\n\tenableVirtualization,\n\tsize,\n\t'data-test-id': testId = 'filter-menu',\n}: FilterMenuProps) => {\n\tconst filterOptions = isLoading\n\t\t? [{ name: 'loading...', value: 'loading...', isDisabled: true }]\n\t\t: options;\n\n\treturn (\n\t\t<>\n\t\t\t{onClearFilter && (\n\t\t\t\t<Button\n\t\t\t\t\ttabIndex={0}\n\t\t\t\t\tclassName={styles.filterClearButton}\n\t\t\t\t\tonClick={onClearFilter}\n\t\t\t\t\tkind=\"link\"\n\t\t\t\t\tdata-test-id=\"clear-filter-button\"\n\t\t\t\t>\n\t\t\t\t\tCLEAR FILTER\n\t\t\t\t</Button>\n\t\t\t)}\n\t\t\t<Menu\n\t\t\t\tenableVirtualization={enableVirtualization}\n\t\t\t\tsize={size}\n\t\t\t\tdata-test-id={testId}\n\t\t\t\tonSelect={onSelect}\n\t\t\t>\n\t\t\t\t{enableSearch && (\n\t\t\t\t\t<MenuSearch\n\t\t\t\t\t\tvalue={searchValue}\n\t\t\t\t\t\tid={searchId}\n\t\t\t\t\t\tplaceholder={searchPlaceholder}\n\t\t\t\t\t\tonChange={onSearchChange}\n\t\t\t\t\t\tariaLabel={searchAriaLabel}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t\t{filterOptions.map((option, index) => {\n\t\t\t\t\tif (option.isDivider) {\n\t\t\t\t\t\t// biome-ignore lint/suspicious/noArrayIndexKey: ignore\n\t\t\t\t\t\treturn <MenuDivider key={`divider-${index}`} />;\n\t\t\t\t\t}\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\titem={option}\n\t\t\t\t\t\t\tdisabled={option.isDisabled}\n\t\t\t\t\t\t\ticon={option.isChecked ? <Icon name=\"check\" /> : undefined}\n\t\t\t\t\t\t\tkey={option.value}\n\t\t\t\t\t\t\trole=\"menuitemradio\"\n\t\t\t\t\t\t\taria-checked={option.isChecked ? 'true' : undefined}\n\t\t\t\t\t\t\tnested={option.nested}\n\t\t\t\t\t\t\tgroupHeader={option.groupHeader}\n\t\t\t\t\t\t\ttooltip={\n\t\t\t\t\t\t\t\toption.isDisabled && disabledOptionTooltip ? disabledOptionTooltip : undefined\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttooltipPlacement=\"right\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{option.name}\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t);\n\t\t\t\t})}\n\t\t\t</Menu>\n\t\t</>\n\t);\n};\n\nexport { FilterMenu };\nexport type { FilterOption, FilterMenuProps };\n","import type { ChangeEvent, ReactNode } from 'react';\nimport type { FilterOption } from './FilterMenu';\n\nimport { Dropdown } from '@launchpad-ui/dropdown';\n\nimport { AppliedFilterButton } from './AppliedFilterButton';\nimport { FilterMenu } from './FilterMenu';\n\nconst SEARCH_INPUT_THRESHOLD = 4;\n\ntype AppliedFilterProps = {\n\tsearchValue?: string;\n\tonSearchChange?(event: ChangeEvent<HTMLInputElement>): void;\n\tonClearFilter?(): void;\n\tsearchPlaceholder?: string;\n\tname?: ReactNode;\n\tdescription: ReactNode;\n\toptions: FilterOption[];\n\tclassName?: string;\n\tonStateChange?({ isOpen }: { isOpen?: boolean }): void;\n\tonSelect?(item: FilterOption): void;\n\tisEmpty?: boolean;\n\tisLoading?: boolean;\n\tonClickFilterButton?(): void;\n\tsearchAriaLabel?: string;\n\tsearchId?: string;\n\t'data-test-id'?: string;\n};\n\n/**\n * @deprecated use `Menu` from `@launchpad-ui/components` instead\n *\n * https://launchpad.launchdarkly.com/?path=/docs/components-collections-menu--docs\n */\nconst AppliedFilter = ({\n\tsearchValue,\n\tonSearchChange,\n\tsearchPlaceholder,\n\tname,\n\tdescription,\n\toptions,\n\tclassName,\n\tisEmpty,\n\tisLoading,\n\tonClickFilterButton,\n\tonClearFilter,\n\tsearchAriaLabel,\n\tsearchId,\n\t'data-test-id': testId = 'applied-filter',\n\t...props\n}: AppliedFilterProps) => {\n\tconst enableSearch =\n\t\tonSearchChange && (!!searchValue || options.length > SEARCH_INPUT_THRESHOLD || !isEmpty);\n\n\treturn (\n\t\t<Dropdown targetClassName={className} placement=\"bottom-start\" enableArrow={false} {...props}>\n\t\t\t<AppliedFilterButton\n\t\t\t\tdata-test-id={testId}\n\t\t\t\tname={name}\n\t\t\t\tonClickFilterButton={onClickFilterButton}\n\t\t\t>\n\t\t\t\t{description}\n\t\t\t</AppliedFilterButton>\n\t\t\t<FilterMenu\n\t\t\t\toptions={options}\n\t\t\t\tsearchValue={searchValue}\n\t\t\t\tsearchPlaceholder={searchPlaceholder}\n\t\t\t\tenableSearch={enableSearch}\n\t\t\t\tsearchAriaLabel={searchAriaLabel}\n\t\t\t\tsearchId={searchId}\n\t\t\t\tonSearchChange={onSearchChange}\n\t\t\t\tonClearFilter={onClearFilter}\n\t\t\t\tisLoading={isLoading}\n\t\t\t/>\n\t\t</Dropdown>\n\t);\n};\n\nexport type { AppliedFilterProps };\nexport { AppliedFilter };\n","import type { JSX, MouseEvent, ReactNode, SyntheticEvent } from 'react';\n\nimport { IconButton } from '@launchpad-ui/button';\nimport { Icon } from '@launchpad-ui/icons';\nimport { Tooltip } from '@launchpad-ui/tooltip';\nimport { VisuallyHidden } from '@react-aria/visually-hidden';\nimport { cx } from 'classix';\nimport { Children, forwardRef, useId } from 'react';\n\nimport styles from './styles/Filter.module.css';\n\ntype FilterButtonProps = {\n\tname: ReactNode;\n\thideName?: boolean;\n\tisClearable?: boolean;\n\tonClear?(event: SyntheticEvent): void;\n\tclassName?: string;\n\tisSelected?: boolean;\n\tclearTooltip?: string | JSX.Element;\n\tchildren?: ReactNode;\n\tdisabled?: boolean;\n\tonClickFilterButton?(): void;\n\t'data-test-id'?: string;\n\tariaLabel?: string;\n};\n\ntype Ref = HTMLButtonElement;\n\nconst FilterButton = forwardRef<Ref, FilterButtonProps>((props, ref) => {\n\tconst {\n\t\tchildren,\n\t\tname,\n\t\thideName,\n\t\tisClearable,\n\t\tclearTooltip = 'Clear filter',\n\t\tonClear,\n\t\tdisabled,\n\t\tisSelected,\n\t\tonClickFilterButton,\n\t\tclassName,\n\t\t'data-test-id': testId = 'filter-button',\n\t\tariaLabel = 'Clear filter',\n\t\t...rest\n\t} = props;\n\tconst nameId = useId();\n\tconst descriptionId = useId();\n\n\tconst hasDescription = Children.count(children) !== 0;\n\n\tconst nameElement = (\n\t\t<span className={styles.name}>\n\t\t\t{name}\n\t\t\t{hasDescription && ':'}\n\t\t</span>\n\t);\n\n\tconst isDisabled = disabled;\n\n\tconst handleClick = (event: MouseEvent<HTMLButtonElement>) => {\n\t\tif (isDisabled) return event.preventDefault();\n\t\tonClickFilterButton?.();\n\t};\n\n\treturn (\n\t\t<div className={styles.buttonContainer} data-test-id={testId}>\n\t\t\t<button\n\t\t\t\t{...rest}\n\t\t\t\ttype=\"button\"\n\t\t\t\taria-labelledby={`${nameId} ${hasDescription ? descriptionId : ''}`}\n\t\t\t\taria-haspopup\n\t\t\t\tdisabled={isDisabled}\n\t\t\t\taria-disabled={isDisabled}\n\t\t\t\tclassName={cx(styles.button, className, (isClearable || isSelected) && styles.isClearable)}\n\t\t\t\tref={ref}\n\t\t\t\tonClick={handleClick}\n\t\t\t>\n\t\t\t\t{hideName ? (\n\t\t\t\t\t<VisuallyHidden id={nameId}>{nameElement}</VisuallyHidden>\n\t\t\t\t) : (\n\t\t\t\t\t<span id={nameId}>{nameElement}</span>\n\t\t\t\t)}\n\t\t\t\t{hasDescription && (\n\t\t\t\t\t<span id={descriptionId} className={styles.description}>\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</span>\n\t\t\t\t)}\n\t\t\t\t{!isClearable && <Icon name=\"chevron-down\" size=\"small\" />}\n\t\t\t</button>\n\t\t\t{isClearable && (\n\t\t\t\t<Tooltip targetClassName={styles.clearTooltip} content={clearTooltip}>\n\t\t\t\t\t<IconButton\n\t\t\t\t\t\taria-label={ariaLabel}\n\t\t\t\t\t\tclassName={styles.clear}\n\t\t\t\t\t\tdata-test-id=\"clear-filter-button\"\n\t\t\t\t\t\ticon={<Icon name=\"cancel\" size=\"small\" />}\n\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\tonClick={onClear}\n\t\t\t\t\t/>\n\t\t\t\t</Tooltip>\n\t\t\t)}\n\t\t</div>\n\t);\n});\n\nFilterButton.displayName = 'FilterButton';\n\nexport { FilterButton };\nexport type { FilterButtonProps };\n","import type { MenuProps } from '@launchpad-ui/menu';\nimport type { ChangeEvent, ReactNode, SyntheticEvent } from 'react';\nimport type { FilterOption } from './FilterMenu';\n\nimport { Dropdown } from '@launchpad-ui/dropdown';\nimport { cx } from 'classix';\n\nimport { FilterButton } from './FilterButton';\nimport { FilterMenu } from './FilterMenu';\nimport styles from './styles/Filter.module.css';\n\nconst SEARCH_INPUT_THRESHOLD = 4;\n\ntype FilterProps = Pick<MenuProps<string>, 'size' | 'enableVirtualization'> & {\n\tsearchValue?: string;\n\tonSearchChange?(event: ChangeEvent<HTMLInputElement>): void;\n\tsearchPlaceholder?: string;\n\tsearchAriaLabel?: string;\n\tname: ReactNode;\n\thideName?: boolean;\n\tdescription: ReactNode;\n\toptions: FilterOption[];\n\tisClearable?: boolean;\n\tonClear?(): void;\n\tclassName?: string;\n\tonStateChange?({ isOpen }: { isOpen?: boolean }): void;\n\tisSelected?: boolean;\n\tsearchId?: string;\n\tonSelect?(item: FilterOption): void;\n\tisEmpty?: boolean;\n\tisLoading?: boolean;\n\tdisabled?: boolean;\n\tonClickFilterButton?(): void;\n\tdisabledOptionTooltip?: string;\n\t'data-test-id'?: string;\n\ttriggerTestId?: string;\n\tclearAriaLabel?: string;\n};\n\n/**\n * @deprecated use `Menu` from `@launchpad-ui/components` instead\n *\n * https://launchpad.launchdarkly.com/?path=/docs/components-collections-menu--docs\n */\nconst Filter = ({\n\tsearchValue,\n\tonSearchChange,\n\tsearchPlaceholder,\n\tsearchAriaLabel,\n\tname,\n\thideName,\n\tdescription,\n\toptions,\n\tisClearable,\n\tonClear,\n\tisSelected,\n\tclassName,\n\tisEmpty,\n\tsearchId,\n\tisLoading,\n\tonClickFilterButton,\n\tdisabledOptionTooltip,\n\t'data-test-id': testId = 'filter',\n\tsize,\n\tdisabled,\n\tenableVirtualization,\n\tclearAriaLabel,\n\t...props\n}: FilterProps) => {\n\tconst enableSearch =\n\t\tonSearchChange && (!!searchValue || options.length > SEARCH_INPUT_THRESHOLD || !isEmpty);\n\n\tconst dropdownClasses = cx(styles.filter, className);\n\n\tconst handleClear = (event: SyntheticEvent) => {\n\t\tevent.preventDefault();\n\t\tonClear?.();\n\t};\n\n\treturn (\n\t\t<Dropdown\n\t\t\ttargetTestId={testId}\n\t\t\tdisabled={disabled}\n\t\t\ttargetClassName={dropdownClasses}\n\t\t\t{...props}\n\t\t>\n\t\t\t<FilterButton\n\t\t\t\tisClearable={isClearable}\n\t\t\t\tonClear={handleClear}\n\t\t\t\tname={name}\n\t\t\t\thideName={hideName}\n\t\t\t\tdisabled={disabled}\n\t\t\t\tisSelected={isSelected}\n\t\t\t\tonClickFilterButton={onClickFilterButton}\n\t\t\t\tariaLabel={clearAriaLabel}\n\t\t\t>\n\t\t\t\t{description}\n\t\t\t</FilterButton>\n\t\t\t<FilterMenu\n\t\t\t\toptions={options}\n\t\t\t\tsearchId={searchId}\n\t\t\t\tsearchValue={searchValue}\n\t\t\t\tsearchPlaceholder={searchPlaceholder}\n\t\t\t\tsearchAriaLabel={searchAriaLabel}\n\t\t\t\tenableSearch={enableSearch}\n\t\t\t\tonSearchChange={onSearchChange}\n\t\t\t\tisLoading={isLoading}\n\t\t\t\tdisabledOptionTooltip={disabledOptionTooltip}\n\t\t\t\tsize={size}\n\t\t\t\tenableVirtualization={enableVirtualization}\n\t\t\t/>\n\t\t</Dropdown>\n\t);\n};\n\nexport { Filter };\nexport type { FilterProps };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACkBA,MAAM,sCAAsB,CAAA,GAAA,MAAA,YAA0C,CAAC,OAAO,QAAQ;CAC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AAC,qBAAA,MAAA;KAAK,MAAK;KAAS,MAAK;MAAU;IACzC,MAAK;IACL,SAAS;;IAED;GAEN;AAEP,EAAC;AAEF,aAAa,cAAc;AC7F3B,MAAM,yBAAyB;;;;;;AAiC/B,MAAM,SAAS,CAAC,EACf,aACA,gBACA,mBACA,iBACA,MAAA,QACA,UACA,aAAA,eACA,SACA,aAAA,eACA,SACA,YACA,WACA,SACA,UACA,WACA,qBACA,uBACA,gBAAgB,SAAS,UACzB,MACA,UACA,sBACA,eACA,GAAG,OACU,KAAK;CAClB,MAAM,eACL,qBAAqB,eAAe,QAAQ,SAAS,2BAA2B;CAEjF,MAAM,kBAAkB,CAAA,GAAA,QAAA,IAAG,sBAAO,QAAQ,UAAU;CAEpD,MAAM,cAAc,CAACC,UAA0B;AAC9C,QAAM,gBAAgB;AACtB,aAAW;CACX;AAED,wBACC,CAAA,GAAA,kBAAA,MAAC,wBAAA,UAAA;EACA,cAAc;EACJ;EACV,iBAAiB;EACjB,GAAI;6BAEJ,CAAA,GAAA,kBAAA,KAAC,cAAA;GACa,aAAA;GACb,SAAS;GACH,MAAA;GACI;GACA;GACE;GACS;GACrB,WAAW;aAEV;IACa,kBACf,CAAA,GAAA,kBAAA,KAAC,YAAA;GACS;GACC;GACG;GACM;GACF;GACH;GACE;GACL;GACY;GACjB;GACgB;IACrB;GACQ;AAEZ"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/styles/Filter.module.css","../src/AppliedFilterButton.tsx","../src/FilterMenu.tsx","../src/AppliedFilter.tsx","../src/FilterButton.tsx","../src/Filter.tsx"],"sourcesContent":[":root,\n[data-theme='default'] {\n\t--lp-component-filter-color-bg-clearable: rgb(0 0 0 / 0.15);\n\t--lp-component-filter-color-bg-clearable-focus: rgb(0 0 0 / 0.2);\n\t--lp-component-filter-color-border-clearable-focus: var(--lp-color-gray-800);\n}\n\n[data-theme='dark'] {\n\t--lp-component-filter-color-bg-clearable: rgb(248 248 248 / 0.15);\n\t--lp-component-filter-color-bg-clearable-focus: rgb(248 248 248 / 0.2);\n\t--lp-component-filter-color-border-clearable-focus: var(--lp-color-gray-500);\n}\n\n.filter {\n\tfont-family: var(--lp-font-family-base);\n}\n\n.buttonContainer {\n\tcursor: pointer;\n\tdisplay: inline-flex;\n\talign-items: center;\n\tposition: relative;\n}\n\n.button {\n\tborder-radius: var(--lp-border-radius-medium);\n\tpadding-top: 0;\n\tpadding-bottom: 0;\n\tline-height: 2rem;\n\tdisplay: flex;\n\talign-items: center;\n\tmargin: 0;\n\tcolor: var(--lp-color-text-ui-primary-base);\n\tbackground-color: var(--lp-color-bg-interactive-secondary-base);\n}\n\n.appliedButton {\n\tcolor: var(--lp-color-text-ui-primary-base);\n\theight: 1.25rem;\n\tbackground-color: var(--lp-color-bg-interactive-secondary-hover);\n\tpadding: 0.125rem 0.375rem;\n\tborder-radius: 0.125rem;\n\tdisplay: flex;\n}\n\n.button,\n.appliedButton {\n\tfont-family: inherit;\n\tfont-size: 0.8125rem;\n\tcursor: pointer;\n\tborder-width: var(--lp-border-width-200);\n\tborder-style: solid;\n\tborder-color: transparent;\n\n\t&:hover {\n\t\tbackground-color: var(--lp-color-bg-interactive-secondary-hover);\n\t\tborder-color: var(--lp-color-border-interactive-secondary-hover);\n\t}\n\n\t&:focus-visible {\n\t\toutline: none;\n\t\tborder-color: var(--lp-color-border-interactive-secondary-focus);\n\t\tbox-shadow:\n\t\t\t0 0 0 2px var(--lp-color-bg-ui-primary),\n\t\t\t0 0 0 4px var(--lp-color-shadow-interactive-focus);\n\t}\n}\n\n.name {\n\tmargin-right: 0.3125rem;\n\tfont-weight: var(--lp-font-weight-medium);\n}\n\n.appliedName {\n\tmargin-right: 0.1875rem;\n}\n\n.description {\n\tcolor: var(--lp-color-text-ui-primary-base);\n\tfont-weight: var(--lp-font-weight-medium);\n}\n\n.description,\n.appliedDescription {\n\tmargin-right: 0.3125rem;\n\tmax-width: 10rem;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n}\n\n.clear {\n\tcursor: pointer;\n\tpadding: 0.1875rem;\n}\n\n.button.isClearable {\n\tpadding-right: 1.9375rem;\n\tbackground-color: var(--lp-component-filter-color-bg-clearable);\n\n\t&:focus,\n\t&:hover,\n\t&:active {\n\t\tbackground-color: var(--lp-component-filter-color-bg-clearable-focus);\n\t\tborder-color: var(--lp-component-filter-color-border-clearable-focus);\n\t}\n}\n\n.button:hover:not(.isClearable),\n.button:focus:not(.isClearable),\n[data-state='open'] .button:not(.isClearable) {\n\tbackground-color: var(--lp-color-bg-interactive-secondary-hover);\n\tborder-color: var(--lp-color-border-interactive-secondary-hover);\n}\n\n.button:focus:not(:focus-visible):not(.isClearable) {\n\t&:hover {\n\t\tbackground-color: var(--lp-color-bg-interactive-secondary-hover);\n\t}\n}\n\n.clearTooltip {\n\tline-height: 1;\n\tposition: absolute;\n\tright: 0.4375rem;\n}\n\n.filterClearButton {\n\ttext-decoration: none;\n\tcolor: var(--lp-color-text-interactive-destructive);\n\tfont-size: 0.8125rem;\n\tfont-weight: var(--lp-font-weight-medium);\n\tpadding: 0.625rem;\n\twidth: 100%;\n\tborder-bottom: 1px solid var(--lp-color-border-interactive-secondary-base);\n}\n\n.filterClearButton:active,\n.filterClearButton:focus,\n.filterClearButton:hover {\n\toutline: none;\n\tbox-shadow: unset;\n\tcolor: var(--lp-color-text-interactive-destructive);\n}\n\n.filterClearButton:active {\n\tborder-bottom-color: var(--lp-color-border-interactive-secondary-active);\n\tbackground-color: var(--lp-color-bg-interactive-secondary-active);\n}\n\n.filterClearButton:focus {\n\tborder-bottom-color: var(--lp-color-border-interactive-secondary-focus);\n\tbackground-color: var(--lp-color-bg-interactive-secondary-focus);\n}\n\n.filterClearButton:hover {\n\tborder-bottom-color: var(--lp-color-border-interactive-secondary-hover);\n\tbackground-color: var(--lp-color-bg-interactive-secondary-hover);\n}\n","import type { ReactNode } from 'react';\n\nimport { Icon } from '@launchpad-ui/icons';\nimport { cx } from 'classix';\nimport { Children, forwardRef } from 'react';\n\nimport styles from './styles/Filter.module.css';\n\ntype AppliedFilterButtonProps = {\n\tname?: ReactNode;\n\tclassName?: string;\n\tchildren: ReactNode;\n\tonClickFilterButton?(): void;\n\t'data-test-id'?: string;\n};\n\ntype Ref = HTMLButtonElement;\n\nconst AppliedFilterButton = forwardRef<Ref, AppliedFilterButtonProps>((props, ref) => {\n\tconst {\n\t\tname,\n\t\tclassName,\n\t\tchildren,\n\t\tonClickFilterButton,\n\t\t'data-test-id': testId = 'applied-filter-button',\n\t} = props;\n\n\tconst hasDescription = Children.count(children) !== 0;\n\n\treturn (\n\t\t<div data-test-id={testId}>\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\taria-haspopup\n\t\t\t\tclassName={cx(styles.appliedButton, className)}\n\t\t\t\tref={ref}\n\t\t\t\tonClick={onClickFilterButton}\n\t\t\t>\n\t\t\t\t{name && (\n\t\t\t\t\t<span className={styles.appliedName} data-test-id={`${testId}-name`}>\n\t\t\t\t\t\t{name}\n\t\t\t\t\t\t{hasDescription && ':'}\n\t\t\t\t\t</span>\n\t\t\t\t)}\n\t\t\t\t{hasDescription && (\n\t\t\t\t\t<span className={styles.appliedDescription} data-test-id={`${testId}-description`}>\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</span>\n\t\t\t\t)}\n\t\t\t\t<Icon name=\"chevron-down\" size=\"small\" data-test-id={`${testId}-expand`} />\n\t\t\t</button>\n\t\t</div>\n\t);\n});\n\nAppliedFilterButton.displayName = 'AppliedFilterButton';\n\nexport type { AppliedFilterButtonProps };\nexport { AppliedFilterButton };\n","import type { MenuProps } from '@launchpad-ui/menu';\nimport type { ChangeEvent, ReactNode } from 'react';\n\nimport { Button } from '@launchpad-ui/button';\nimport { Icon } from '@launchpad-ui/icons';\nimport { Menu, MenuDivider, MenuItem, MenuSearch } from '@launchpad-ui/menu';\n\nimport styles from './styles/Filter.module.css';\n\n// biome-ignore lint/suspicious/noExplicitAny: ignore\ntype FilterOption<T = any> = {\n\tname?: ReactNode;\n\tisDisabled?: boolean;\n\tisDivider?: boolean;\n\tisChecked?: boolean;\n\tvalue: T | null;\n\tprojKey?: string;\n\tnested?: boolean;\n\tgroupHeader?: boolean;\n};\n\ntype FilterMenuProps = Pick<MenuProps<string>, 'enableVirtualization' | 'size' | 'data-test-id'> & {\n\toptions: FilterOption[];\n\tonClearFilter?(): void;\n\tenableSearch?: boolean;\n\tsearchValue?: string;\n\tsearchId?: string;\n\tsearchPlaceholder?: string;\n\tsearchAriaLabel?: string;\n\tonSearchChange?(event: ChangeEvent<HTMLInputElement>): void;\n\tonSelect?(): void;\n\tisLoading?: boolean;\n\tdisabledOptionTooltip?: string;\n};\n\nconst FilterMenu = ({\n\toptions,\n\tonClearFilter,\n\tenableSearch,\n\tsearchValue,\n\tsearchPlaceholder,\n\tsearchAriaLabel,\n\tsearchId,\n\tonSelect,\n\tonSearchChange,\n\tisLoading = false,\n\tdisabledOptionTooltip,\n\tenableVirtualization,\n\tsize,\n\t'data-test-id': testId = 'filter-menu',\n}: FilterMenuProps) => {\n\tconst filterOptions = isLoading\n\t\t? [{ name: 'loading...', value: 'loading...', isDisabled: true }]\n\t\t: options;\n\n\treturn (\n\t\t<>\n\t\t\t{onClearFilter && (\n\t\t\t\t<Button\n\t\t\t\t\ttabIndex={0}\n\t\t\t\t\tclassName={styles.filterClearButton}\n\t\t\t\t\tonClick={onClearFilter}\n\t\t\t\t\tkind=\"link\"\n\t\t\t\t\tdata-test-id=\"clear-filter-button\"\n\t\t\t\t>\n\t\t\t\t\tCLEAR FILTER\n\t\t\t\t</Button>\n\t\t\t)}\n\t\t\t<Menu\n\t\t\t\tenableVirtualization={enableVirtualization}\n\t\t\t\tsize={size}\n\t\t\t\tdata-test-id={testId}\n\t\t\t\tonSelect={onSelect}\n\t\t\t>\n\t\t\t\t{enableSearch && (\n\t\t\t\t\t<MenuSearch\n\t\t\t\t\t\tvalue={searchValue}\n\t\t\t\t\t\tid={searchId}\n\t\t\t\t\t\tplaceholder={searchPlaceholder}\n\t\t\t\t\t\tonChange={onSearchChange}\n\t\t\t\t\t\tariaLabel={searchAriaLabel}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t\t{filterOptions.map((option, index) => {\n\t\t\t\t\tif (option.isDivider) {\n\t\t\t\t\t\t// biome-ignore lint/suspicious/noArrayIndexKey: ignore\n\t\t\t\t\t\treturn <MenuDivider key={`divider-${index}`} />;\n\t\t\t\t\t}\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\titem={option}\n\t\t\t\t\t\t\tdisabled={option.isDisabled}\n\t\t\t\t\t\t\ticon={option.isChecked ? <Icon name=\"check\" /> : undefined}\n\t\t\t\t\t\t\tkey={option.value}\n\t\t\t\t\t\t\trole=\"menuitemradio\"\n\t\t\t\t\t\t\taria-checked={option.isChecked ? 'true' : undefined}\n\t\t\t\t\t\t\tnested={option.nested}\n\t\t\t\t\t\t\tgroupHeader={option.groupHeader}\n\t\t\t\t\t\t\ttooltip={\n\t\t\t\t\t\t\t\toption.isDisabled && disabledOptionTooltip ? disabledOptionTooltip : undefined\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttooltipPlacement=\"right\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{option.name}\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t);\n\t\t\t\t})}\n\t\t\t</Menu>\n\t\t</>\n\t);\n};\n\nexport { FilterMenu };\nexport type { FilterOption, FilterMenuProps };\n","import type { ChangeEvent, ReactNode } from 'react';\nimport type { FilterOption } from './FilterMenu';\n\nimport { Dropdown } from '@launchpad-ui/dropdown';\n\nimport { AppliedFilterButton } from './AppliedFilterButton';\nimport { FilterMenu } from './FilterMenu';\n\nconst SEARCH_INPUT_THRESHOLD = 4;\n\ntype AppliedFilterProps = {\n\tsearchValue?: string;\n\tonSearchChange?(event: ChangeEvent<HTMLInputElement>): void;\n\tonClearFilter?(): void;\n\tsearchPlaceholder?: string;\n\tname?: ReactNode;\n\tdescription: ReactNode;\n\toptions: FilterOption[];\n\tclassName?: string;\n\tonStateChange?({ isOpen }: { isOpen?: boolean }): void;\n\tonSelect?(item: FilterOption): void;\n\tisEmpty?: boolean;\n\tisLoading?: boolean;\n\tonClickFilterButton?(): void;\n\tsearchAriaLabel?: string;\n\tsearchId?: string;\n\t'data-test-id'?: string;\n};\n\n/**\n * @deprecated use `Menu` from `@launchpad-ui/components` instead\n *\n * https://launchpad.launchdarkly.com/?path=/docs/components-collections-menu--docs\n */\nconst AppliedFilter = ({\n\tsearchValue,\n\tonSearchChange,\n\tsearchPlaceholder,\n\tname,\n\tdescription,\n\toptions,\n\tclassName,\n\tisEmpty,\n\tisLoading,\n\tonClickFilterButton,\n\tonClearFilter,\n\tsearchAriaLabel,\n\tsearchId,\n\t'data-test-id': testId = 'applied-filter',\n\t...props\n}: AppliedFilterProps) => {\n\tconst enableSearch =\n\t\tonSearchChange && (!!searchValue || options.length > SEARCH_INPUT_THRESHOLD || !isEmpty);\n\n\treturn (\n\t\t<Dropdown targetClassName={className} placement=\"bottom-start\" enableArrow={false} {...props}>\n\t\t\t<AppliedFilterButton\n\t\t\t\tdata-test-id={testId}\n\t\t\t\tname={name}\n\t\t\t\tonClickFilterButton={onClickFilterButton}\n\t\t\t>\n\t\t\t\t{description}\n\t\t\t</AppliedFilterButton>\n\t\t\t<FilterMenu\n\t\t\t\toptions={options}\n\t\t\t\tsearchValue={searchValue}\n\t\t\t\tsearchPlaceholder={searchPlaceholder}\n\t\t\t\tenableSearch={enableSearch}\n\t\t\t\tsearchAriaLabel={searchAriaLabel}\n\t\t\t\tsearchId={searchId}\n\t\t\t\tonSearchChange={onSearchChange}\n\t\t\t\tonClearFilter={onClearFilter}\n\t\t\t\tisLoading={isLoading}\n\t\t\t/>\n\t\t</Dropdown>\n\t);\n};\n\nexport type { AppliedFilterProps };\nexport { AppliedFilter };\n","import type { JSX, MouseEvent, ReactNode, SyntheticEvent } from 'react';\n\nimport { IconButton } from '@launchpad-ui/button';\nimport { Icon } from '@launchpad-ui/icons';\nimport { Tooltip } from '@launchpad-ui/tooltip';\nimport { cx } from 'classix';\nimport { Children, forwardRef, useId } from 'react';\nimport { VisuallyHidden } from 'react-aria/VisuallyHidden';\n\nimport styles from './styles/Filter.module.css';\n\ntype FilterButtonProps = {\n\tname: ReactNode;\n\thideName?: boolean;\n\tisClearable?: boolean;\n\tonClear?(event: SyntheticEvent): void;\n\tclassName?: string;\n\tisSelected?: boolean;\n\tclearTooltip?: string | JSX.Element;\n\tchildren?: ReactNode;\n\tdisabled?: boolean;\n\tonClickFilterButton?(): void;\n\t'data-test-id'?: string;\n\tariaLabel?: string;\n};\n\ntype Ref = HTMLButtonElement;\n\nconst FilterButton = forwardRef<Ref, FilterButtonProps>((props, ref) => {\n\tconst {\n\t\tchildren,\n\t\tname,\n\t\thideName,\n\t\tisClearable,\n\t\tclearTooltip = 'Clear filter',\n\t\tonClear,\n\t\tdisabled,\n\t\tisSelected,\n\t\tonClickFilterButton,\n\t\tclassName,\n\t\t'data-test-id': testId = 'filter-button',\n\t\tariaLabel = 'Clear filter',\n\t\t...rest\n\t} = props;\n\tconst nameId = useId();\n\tconst descriptionId = useId();\n\n\tconst hasDescription = Children.count(children) !== 0;\n\n\tconst nameElement = (\n\t\t<span className={styles.name}>\n\t\t\t{name}\n\t\t\t{hasDescription && ':'}\n\t\t</span>\n\t);\n\n\tconst isDisabled = disabled;\n\n\tconst handleClick = (event: MouseEvent<HTMLButtonElement>) => {\n\t\tif (isDisabled) return event.preventDefault();\n\t\tonClickFilterButton?.();\n\t};\n\n\treturn (\n\t\t<div className={styles.buttonContainer} data-test-id={testId}>\n\t\t\t<button\n\t\t\t\t{...rest}\n\t\t\t\ttype=\"button\"\n\t\t\t\taria-labelledby={`${nameId} ${hasDescription ? descriptionId : ''}`}\n\t\t\t\taria-haspopup\n\t\t\t\tdisabled={isDisabled}\n\t\t\t\taria-disabled={isDisabled}\n\t\t\t\tclassName={cx(styles.button, className, (isClearable || isSelected) && styles.isClearable)}\n\t\t\t\tref={ref}\n\t\t\t\tonClick={handleClick}\n\t\t\t>\n\t\t\t\t{hideName ? (\n\t\t\t\t\t<VisuallyHidden id={nameId}>{nameElement}</VisuallyHidden>\n\t\t\t\t) : (\n\t\t\t\t\t<span id={nameId}>{nameElement}</span>\n\t\t\t\t)}\n\t\t\t\t{hasDescription && (\n\t\t\t\t\t<span id={descriptionId} className={styles.description}>\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</span>\n\t\t\t\t)}\n\t\t\t\t{!isClearable && <Icon name=\"chevron-down\" size=\"small\" />}\n\t\t\t</button>\n\t\t\t{isClearable && (\n\t\t\t\t<Tooltip targetClassName={styles.clearTooltip} content={clearTooltip}>\n\t\t\t\t\t<IconButton\n\t\t\t\t\t\taria-label={ariaLabel}\n\t\t\t\t\t\tclassName={styles.clear}\n\t\t\t\t\t\tdata-test-id=\"clear-filter-button\"\n\t\t\t\t\t\ticon={<Icon name=\"cancel\" size=\"small\" />}\n\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\tonClick={onClear}\n\t\t\t\t\t/>\n\t\t\t\t</Tooltip>\n\t\t\t)}\n\t\t</div>\n\t);\n});\n\nFilterButton.displayName = 'FilterButton';\n\nexport { FilterButton };\nexport type { FilterButtonProps };\n","import type { MenuProps } from '@launchpad-ui/menu';\nimport type { ChangeEvent, ReactNode, SyntheticEvent } from 'react';\nimport type { FilterOption } from './FilterMenu';\n\nimport { Dropdown } from '@launchpad-ui/dropdown';\nimport { cx } from 'classix';\n\nimport { FilterButton } from './FilterButton';\nimport { FilterMenu } from './FilterMenu';\nimport styles from './styles/Filter.module.css';\n\nconst SEARCH_INPUT_THRESHOLD = 4;\n\ntype FilterProps = Pick<MenuProps<string>, 'size' | 'enableVirtualization'> & {\n\tsearchValue?: string;\n\tonSearchChange?(event: ChangeEvent<HTMLInputElement>): void;\n\tsearchPlaceholder?: string;\n\tsearchAriaLabel?: string;\n\tname: ReactNode;\n\thideName?: boolean;\n\tdescription: ReactNode;\n\toptions: FilterOption[];\n\tisClearable?: boolean;\n\tonClear?(): void;\n\tclassName?: string;\n\tonStateChange?({ isOpen }: { isOpen?: boolean }): void;\n\tisSelected?: boolean;\n\tsearchId?: string;\n\tonSelect?(item: FilterOption): void;\n\tisEmpty?: boolean;\n\tisLoading?: boolean;\n\tdisabled?: boolean;\n\tonClickFilterButton?(): void;\n\tdisabledOptionTooltip?: string;\n\t'data-test-id'?: string;\n\ttriggerTestId?: string;\n\tclearAriaLabel?: string;\n};\n\n/**\n * @deprecated use `Menu` from `@launchpad-ui/components` instead\n *\n * https://launchpad.launchdarkly.com/?path=/docs/components-collections-menu--docs\n */\nconst Filter = ({\n\tsearchValue,\n\tonSearchChange,\n\tsearchPlaceholder,\n\tsearchAriaLabel,\n\tname,\n\thideName,\n\tdescription,\n\toptions,\n\tisClearable,\n\tonClear,\n\tisSelected,\n\tclassName,\n\tisEmpty,\n\tsearchId,\n\tisLoading,\n\tonClickFilterButton,\n\tdisabledOptionTooltip,\n\t'data-test-id': testId = 'filter',\n\tsize,\n\tdisabled,\n\tenableVirtualization,\n\tclearAriaLabel,\n\t...props\n}: FilterProps) => {\n\tconst enableSearch =\n\t\tonSearchChange && (!!searchValue || options.length > SEARCH_INPUT_THRESHOLD || !isEmpty);\n\n\tconst dropdownClasses = cx(styles.filter, className);\n\n\tconst handleClear = (event: SyntheticEvent) => {\n\t\tevent.preventDefault();\n\t\tonClear?.();\n\t};\n\n\treturn (\n\t\t<Dropdown\n\t\t\ttargetTestId={testId}\n\t\t\tdisabled={disabled}\n\t\t\ttargetClassName={dropdownClasses}\n\t\t\t{...props}\n\t\t>\n\t\t\t<FilterButton\n\t\t\t\tisClearable={isClearable}\n\t\t\t\tonClear={handleClear}\n\t\t\t\tname={name}\n\t\t\t\thideName={hideName}\n\t\t\t\tdisabled={disabled}\n\t\t\t\tisSelected={isSelected}\n\t\t\t\tonClickFilterButton={onClickFilterButton}\n\t\t\t\tariaLabel={clearAriaLabel}\n\t\t\t>\n\t\t\t\t{description}\n\t\t\t</FilterButton>\n\t\t\t<FilterMenu\n\t\t\t\toptions={options}\n\t\t\t\tsearchId={searchId}\n\t\t\t\tsearchValue={searchValue}\n\t\t\t\tsearchPlaceholder={searchPlaceholder}\n\t\t\t\tsearchAriaLabel={searchAriaLabel}\n\t\t\t\tenableSearch={enableSearch}\n\t\t\t\tonSearchChange={onSearchChange}\n\t\t\t\tisLoading={isLoading}\n\t\t\t\tdisabledOptionTooltip={disabledOptionTooltip}\n\t\t\t\tsize={size}\n\t\t\t\tenableVirtualization={enableVirtualization}\n\t\t\t/>\n\t\t</Dropdown>\n\t);\n};\n\nexport { Filter };\nexport type { FilterProps };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACkBA,IAAM,sBAAsB,iBAAA,GAAA,MAAA,aAA2C,OAAO,QAAQ;CACrF,MAAM,EACL,MAAA,QACA,WACA,UACA,qBACA,gBAAgB,SAAS,4BACtB;CAEJ,MAAM,iBAAiB,MAAA,SAAS,MAAM,SAAS,KAAK;AAEpD,QACC,iBAAA,GAAA,kBAAA,KAAC,OAAA;EAAI,gBAAc;YAClB,iBAAA,GAAA,kBAAA,MAAC,UAAA;GACA,MAAK;GACL,iBAAA;GACA,YAAA,GAAA,QAAA,IAAc,sBAAO,eAAe,UAAU;GACzC;GACL,SAAS;;IAER,UACA,iBAAA,GAAA,kBAAA,MAAC,QAAA;KAAK,WAAW,sBAAO;KAAa,gBAAc,GAAG,OAAO;gBAC3D,QACA,kBAAkB,IAAA;MACb;IAEP,kBACA,iBAAA,GAAA,kBAAA,KAAC,QAAA;KAAK,WAAW,sBAAO;KAAoB,gBAAc,GAAG,OAAO;KAClE;MACK;IAER,iBAAA,GAAA,kBAAA,KAAC,qBAAA,MAAA;KAAK,MAAK;KAAe,MAAK;KAAQ,gBAAc,GAAG,OAAO;;;;GAE3D;EAEN;AAEF,oBAAoB,cAAc;AC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B,WAAW;aAEV;IACa,EACf,iBAAA,GAAA,kBAAA,KAAC,YAAA;GACS;GACC;GACG;GACM;GACF;GACH;GACE;GACL;GACY;GACjB;GACgB;IACrB,CAAA;GACQ"}
|
package/dist/style.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
:root,[data-theme=default]{--lp-component-filter-color-bg-clearable:#00000026;--lp-component-filter-color-bg-clearable-focus:#0003;--lp-component-filter-color-border-clearable-focus:var(--lp-color-gray-800)}[data-theme=dark]{--lp-component-filter-color-bg-clearable:#f8f8f826;--lp-component-filter-color-bg-clearable-focus:#f8f8f833;--lp-component-filter-color-border-clearable-focus:var(--lp-color-gray-500)}.vLReaG_filter{font-family:var(--lp-font-family-base)}.vLReaG_buttonContainer{cursor:pointer;align-items:center;display:inline-flex;position:relative}.vLReaG_button{border-radius:var(--lp-border-radius-medium);color:var(--lp-color-text-ui-primary-base);background-color:var(--lp-color-bg-interactive-secondary-base);align-items:center;margin:0;padding-top:0;padding-bottom:0;line-height:2rem;display:flex}.vLReaG_appliedButton{color:var(--lp-color-text-ui-primary-base);background-color:var(--lp-color-bg-interactive-secondary-hover);border-radius:.125rem;height:1.25rem;padding:.125rem .375rem;display:flex}.vLReaG_button,.vLReaG_appliedButton{cursor:pointer;border-width:var(--lp-border-width-200);border-style:solid;border-color:#0000;font-family:inherit;font-size:.8125rem}:is(.vLReaG_button,.vLReaG_appliedButton):hover{background-color:var(--lp-color-bg-interactive-secondary-hover);border-color:var(--lp-color-border-interactive-secondary-hover)}:is(.vLReaG_button,.vLReaG_appliedButton):focus-visible{border-color:var(--lp-color-border-interactive-secondary-focus);box-shadow:0 0 0 2px var(--lp-color-bg-ui-primary),0 0 0 4px var(--lp-color-shadow-interactive-focus);outline:none}.vLReaG_name{font-weight:var(--lp-font-weight-medium);margin-right:.3125rem}.vLReaG_appliedName{margin-right:.1875rem}.vLReaG_description{color:var(--lp-color-text-ui-primary-base);font-weight:var(--lp-font-weight-medium)}.vLReaG_description,.vLReaG_appliedDescription{text-overflow:ellipsis;white-space:nowrap;max-width:10rem;margin-right:.3125rem;overflow:hidden}.vLReaG_clear{cursor:pointer;padding:.1875rem}.vLReaG_button.vLReaG_isClearable{background-color:var(--lp-component-filter-color-bg-clearable);padding-right:1.9375rem}.vLReaG_button.vLReaG_isClearable:focus,.vLReaG_button.vLReaG_isClearable:hover,.vLReaG_button.vLReaG_isClearable:active{background-color:var(--lp-component-filter-color-bg-clearable-focus);border-color:var(--lp-component-filter-color-border-clearable-focus)}.vLReaG_button:hover:not(.vLReaG_isClearable),.vLReaG_button:focus:not(.vLReaG_isClearable),[data-state=open] .vLReaG_button:not(.vLReaG_isClearable){background-color:var(--lp-color-bg-interactive-secondary-hover);border-color:var(--lp-color-border-interactive-secondary-hover)}.vLReaG_button:focus:not(:focus-visible):not(.vLReaG_isClearable):hover{background-color:var(--lp-color-bg-interactive-secondary-hover)}.vLReaG_clearTooltip{line-height:1;position:absolute;right:.4375rem}.vLReaG_filterClearButton{color:var(--lp-color-text-interactive-destructive);font-size:.8125rem;font-weight:var(--lp-font-weight-medium);border-bottom:1px solid var(--lp-color-border-interactive-secondary-base);width:100%;padding:.625rem;text-decoration:none}.vLReaG_filterClearButton:active,.vLReaG_filterClearButton:focus,.vLReaG_filterClearButton:hover{box-shadow:unset;color:var(--lp-color-text-interactive-destructive);outline:none}.vLReaG_filterClearButton:active{border-bottom-color:var(--lp-color-border-interactive-secondary-active);background-color:var(--lp-color-bg-interactive-secondary-active)}.vLReaG_filterClearButton:focus{border-bottom-color:var(--lp-color-border-interactive-secondary-focus);background-color:var(--lp-color-bg-interactive-secondary-focus)}.vLReaG_filterClearButton:hover{border-bottom-color:var(--lp-color-border-interactive-secondary-hover);background-color:var(--lp-color-bg-interactive-secondary-hover)}
|
|
1
|
+
:root,[data-theme=default]{--lp-component-filter-color-bg-clearable:#00000026;--lp-component-filter-color-bg-clearable-focus:#0003;--lp-component-filter-color-border-clearable-focus:var(--lp-color-gray-800)}[data-theme=dark]{--lp-component-filter-color-bg-clearable:#f8f8f826;--lp-component-filter-color-bg-clearable-focus:#f8f8f833;--lp-component-filter-color-border-clearable-focus:var(--lp-color-gray-500)}.vLReaG_filter{font-family:var(--lp-font-family-base)}.vLReaG_buttonContainer{cursor:pointer;align-items:center;display:inline-flex;position:relative}.vLReaG_button{border-radius:var(--lp-border-radius-medium);color:var(--lp-color-text-ui-primary-base);background-color:var(--lp-color-bg-interactive-secondary-base);align-items:center;margin:0;padding-top:0;padding-bottom:0;line-height:2rem;display:flex}.vLReaG_appliedButton{color:var(--lp-color-text-ui-primary-base);background-color:var(--lp-color-bg-interactive-secondary-hover);border-radius:.125rem;height:1.25rem;padding:.125rem .375rem;display:flex}.vLReaG_button,.vLReaG_appliedButton{cursor:pointer;border-width:var(--lp-border-width-200);border-style:solid;border-color:#0000;font-family:inherit;font-size:.8125rem}:is(.vLReaG_button,.vLReaG_appliedButton):hover{background-color:var(--lp-color-bg-interactive-secondary-hover);border-color:var(--lp-color-border-interactive-secondary-hover)}:is(.vLReaG_button,.vLReaG_appliedButton):focus-visible{border-color:var(--lp-color-border-interactive-secondary-focus);box-shadow:0 0 0 2px var(--lp-color-bg-ui-primary), 0 0 0 4px var(--lp-color-shadow-interactive-focus);outline:none}.vLReaG_name{font-weight:var(--lp-font-weight-medium);margin-right:.3125rem}.vLReaG_appliedName{margin-right:.1875rem}.vLReaG_description{color:var(--lp-color-text-ui-primary-base);font-weight:var(--lp-font-weight-medium)}.vLReaG_description,.vLReaG_appliedDescription{text-overflow:ellipsis;white-space:nowrap;max-width:10rem;margin-right:.3125rem;overflow:hidden}.vLReaG_clear{cursor:pointer;padding:.1875rem}.vLReaG_button.vLReaG_isClearable{background-color:var(--lp-component-filter-color-bg-clearable);padding-right:1.9375rem}.vLReaG_button.vLReaG_isClearable:focus,.vLReaG_button.vLReaG_isClearable:hover,.vLReaG_button.vLReaG_isClearable:active{background-color:var(--lp-component-filter-color-bg-clearable-focus);border-color:var(--lp-component-filter-color-border-clearable-focus)}.vLReaG_button:hover:not(.vLReaG_isClearable),.vLReaG_button:focus:not(.vLReaG_isClearable),[data-state=open] .vLReaG_button:not(.vLReaG_isClearable){background-color:var(--lp-color-bg-interactive-secondary-hover);border-color:var(--lp-color-border-interactive-secondary-hover)}.vLReaG_button:focus:not(:focus-visible):not(.vLReaG_isClearable):hover{background-color:var(--lp-color-bg-interactive-secondary-hover)}.vLReaG_clearTooltip{line-height:1;position:absolute;right:.4375rem}.vLReaG_filterClearButton{color:var(--lp-color-text-interactive-destructive);font-size:.8125rem;font-weight:var(--lp-font-weight-medium);border-bottom:1px solid var(--lp-color-border-interactive-secondary-base);width:100%;padding:.625rem;text-decoration:none}.vLReaG_filterClearButton:active,.vLReaG_filterClearButton:focus,.vLReaG_filterClearButton:hover{box-shadow:unset;color:var(--lp-color-text-interactive-destructive);outline:none}.vLReaG_filterClearButton:active{border-bottom-color:var(--lp-color-border-interactive-secondary-active);background-color:var(--lp-color-bg-interactive-secondary-active)}.vLReaG_filterClearButton:focus{border-bottom-color:var(--lp-color-border-interactive-secondary-focus);background-color:var(--lp-color-bg-interactive-secondary-focus)}.vLReaG_filterClearButton:hover{border-bottom-color:var(--lp-color-border-interactive-secondary-hover);background-color:var(--lp-color-bg-interactive-secondary-hover)}
|
|
2
2
|
/*$vite$:1*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@launchpad-ui/filter",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.15",
|
|
4
4
|
"description": "filter a list of results",
|
|
5
5
|
"repository": "launchdarkly/launchpad-ui",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -20,22 +20,22 @@
|
|
|
20
20
|
],
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"classix": "2.2.0",
|
|
23
|
-
"@launchpad-ui/button": "~0.15.
|
|
24
|
-
"@launchpad-ui/dropdown": "~0.10.
|
|
25
|
-
"@launchpad-ui/icons": "~0.25.
|
|
26
|
-
"@launchpad-ui/menu": "~0.16.
|
|
23
|
+
"@launchpad-ui/button": "~0.15.15",
|
|
24
|
+
"@launchpad-ui/dropdown": "~0.10.15",
|
|
25
|
+
"@launchpad-ui/icons": "~0.25.6",
|
|
26
|
+
"@launchpad-ui/menu": "~0.16.15",
|
|
27
27
|
"@launchpad-ui/tokens": "~0.15.1",
|
|
28
|
-
"@launchpad-ui/tooltip": "~0.12.
|
|
28
|
+
"@launchpad-ui/tooltip": "~0.12.3"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"
|
|
32
|
-
"react": "
|
|
33
|
-
"react-dom": "19.2.
|
|
31
|
+
"react": "19.2.6",
|
|
32
|
+
"react-aria": "3.48.0",
|
|
33
|
+
"react-dom": "19.2.6"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"
|
|
37
|
-
"react": "
|
|
38
|
-
"react-dom": "19.2.
|
|
36
|
+
"react": "19.2.6",
|
|
37
|
+
"react-aria": "3.48.0",
|
|
38
|
+
"react-dom": "19.2.6"
|
|
39
39
|
},
|
|
40
40
|
"exports": {
|
|
41
41
|
".": {
|