@dxos/react-ui-searchlist 0.8.3 → 0.8.4-main.1da679c
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/lib/browser/index.mjs +57 -25
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +57 -25
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/components/SearchList.d.ts.map +1 -1
- package/dist/types/src/components/SearchList.stories.d.ts +10 -8
- package/dist/types/src/components/SearchList.stories.d.ts.map +1 -1
- package/dist/types/src/composites/PopoverCombobox.d.ts +3 -3
- package/dist/types/src/composites/PopoverCombobox.d.ts.map +1 -1
- package/dist/types/src/composites/PopoverCombobox.stories.d.ts +6 -21
- package/dist/types/src/composites/PopoverCombobox.stories.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +5 -6
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +10 -11
- package/src/components/SearchList.stories.tsx +16 -6
- package/src/components/SearchList.tsx +8 -5
- package/src/composites/PopoverCombobox.stories.tsx +9 -4
- package/src/composites/PopoverCombobox.tsx +39 -16
- package/src/index.ts +1 -1
- package/src/translations.ts +5 -3
- package/dist/lib/node/index.cjs +0 -324
- package/dist/lib/node/index.cjs.map +0 -7
- package/dist/lib/node/meta.json +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/react-ui-searchlist",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.4-main.1da679c",
|
|
4
4
|
"description": "A themed ⌘K-style combobox component, triggered by a button (or keyboard shortcut), where values are queried only within the invoked modal.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -10,9 +10,10 @@
|
|
|
10
10
|
"type": "module",
|
|
11
11
|
"exports": {
|
|
12
12
|
".": {
|
|
13
|
+
"source": "./src/index.ts",
|
|
13
14
|
"types": "./dist/types/src/index.d.ts",
|
|
14
15
|
"browser": "./dist/lib/browser/index.mjs",
|
|
15
|
-
"node": "./dist/lib/
|
|
16
|
+
"node": "./dist/lib/node-esm/index.mjs"
|
|
16
17
|
}
|
|
17
18
|
},
|
|
18
19
|
"types": "dist/types/src/index.d.ts",
|
|
@@ -30,23 +31,21 @@
|
|
|
30
31
|
"cmdk": "^0.2.0"
|
|
31
32
|
},
|
|
32
33
|
"devDependencies": {
|
|
33
|
-
"@phosphor-icons/react": "^2.1.5",
|
|
34
34
|
"@types/react": "~18.2.0",
|
|
35
35
|
"@types/react-dom": "~18.2.0",
|
|
36
36
|
"react": "~18.2.0",
|
|
37
37
|
"react-dom": "~18.2.0",
|
|
38
|
-
"vite": "
|
|
39
|
-
"@dxos/random": "0.8.
|
|
40
|
-
"@dxos/react-ui
|
|
41
|
-
"@dxos/react-ui": "0.8.
|
|
42
|
-
"@dxos/storybook-utils": "0.8.
|
|
38
|
+
"vite": "7.1.1",
|
|
39
|
+
"@dxos/random": "0.8.4-main.1da679c",
|
|
40
|
+
"@dxos/react-ui": "0.8.4-main.1da679c",
|
|
41
|
+
"@dxos/react-ui-theme": "0.8.4-main.1da679c",
|
|
42
|
+
"@dxos/storybook-utils": "0.8.4-main.1da679c"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
|
-
"@phosphor-icons/react": "^2.1.5",
|
|
46
45
|
"react": "~18.2.0",
|
|
47
46
|
"react-dom": "~18.2.0",
|
|
48
|
-
"@dxos/react-ui": "0.8.
|
|
49
|
-
"@dxos/react-ui-theme": "0.8.
|
|
47
|
+
"@dxos/react-ui": "0.8.4-main.1da679c",
|
|
48
|
+
"@dxos/react-ui-theme": "0.8.4-main.1da679c"
|
|
50
49
|
},
|
|
51
50
|
"publishConfig": {
|
|
52
51
|
"access": "public"
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
import '@dxos-theme';
|
|
6
6
|
|
|
7
|
-
import
|
|
7
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
|
+
import React from 'react';
|
|
8
9
|
|
|
9
10
|
import { faker } from '@dxos/random';
|
|
10
11
|
import { withTheme } from '@dxos/storybook-utils';
|
|
@@ -21,7 +22,11 @@ const defaultItems: StoryItems = faker.helpers
|
|
|
21
22
|
return acc;
|
|
22
23
|
}, {});
|
|
23
24
|
|
|
24
|
-
|
|
25
|
+
type StoryProps = {
|
|
26
|
+
items: StoryItems;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const DefaultStory = ({ items = defaultItems }: StoryProps) => {
|
|
25
30
|
return (
|
|
26
31
|
<SearchList.Root filter={(value, search) => (items[value].includes(search) ? 1 : 0)}>
|
|
27
32
|
<SearchList.Input placeholder='Search...' />
|
|
@@ -36,12 +41,17 @@ const SearchListStory: FC<{ items: StoryItems }> = ({ items = defaultItems }) =>
|
|
|
36
41
|
);
|
|
37
42
|
};
|
|
38
43
|
|
|
39
|
-
|
|
44
|
+
const meta = {
|
|
40
45
|
title: 'ui/react-ui-searchlist/SearchList',
|
|
41
|
-
component:
|
|
46
|
+
component: SearchList.Root as any,
|
|
47
|
+
render: DefaultStory,
|
|
42
48
|
decorators: [withTheme],
|
|
43
|
-
}
|
|
49
|
+
} satisfies Meta<typeof DefaultStory>;
|
|
50
|
+
|
|
51
|
+
export default meta;
|
|
52
|
+
|
|
53
|
+
type Story = StoryObj<typeof meta>;
|
|
44
54
|
|
|
45
|
-
export const Default = {
|
|
55
|
+
export const Default: Story = {
|
|
46
56
|
args: {},
|
|
47
57
|
};
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { CaretDown } from '@phosphor-icons/react';
|
|
6
5
|
import { createContext } from '@radix-ui/react-context';
|
|
7
6
|
import { useControllableState } from '@radix-ui/react-use-controllable-state';
|
|
8
7
|
import { CommandEmpty, CommandInput, CommandItem, CommandList, CommandRoot } from 'cmdk';
|
|
9
|
-
import React, { type ComponentPropsWithRef,
|
|
8
|
+
import React, { type ComponentPropsWithRef, type PropsWithChildren, forwardRef, useCallback } from 'react';
|
|
10
9
|
|
|
11
10
|
import {
|
|
12
11
|
Button,
|
|
13
12
|
type ButtonProps,
|
|
13
|
+
Icon,
|
|
14
14
|
type TextInputProps,
|
|
15
15
|
type ThemedClassName,
|
|
16
16
|
useDensityContext,
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
useId,
|
|
19
19
|
useThemeContext,
|
|
20
20
|
} from '@dxos/react-ui';
|
|
21
|
-
import {
|
|
21
|
+
import { mx, staticPlaceholderText } from '@dxos/react-ui-theme';
|
|
22
22
|
|
|
23
23
|
type SearchListVariant = 'list' | 'menu' | 'listbox';
|
|
24
24
|
|
|
@@ -136,7 +136,10 @@ const SearchListItem = forwardRef<HTMLDivElement, SearchListItemProps>(
|
|
|
136
136
|
<CommandItem
|
|
137
137
|
{...props}
|
|
138
138
|
onSelect={handleSelect}
|
|
139
|
-
className={mx(
|
|
139
|
+
className={mx(
|
|
140
|
+
'p-1 pis-2 pie-2 rounded-sm select-none cursor-pointer data-[selected]:bg-hoverOverlay',
|
|
141
|
+
classNames,
|
|
142
|
+
)}
|
|
140
143
|
ref={forwardedRef}
|
|
141
144
|
>
|
|
142
145
|
{children}
|
|
@@ -215,7 +218,7 @@ const ComboboxTrigger = forwardRef<HTMLButtonElement, ComboboxTriggerProps>(
|
|
|
215
218
|
>
|
|
216
219
|
{value || placeholder}
|
|
217
220
|
</span>
|
|
218
|
-
<
|
|
221
|
+
<Icon icon='ph--caret-down--bold' size={3} />
|
|
219
222
|
</>
|
|
220
223
|
)}
|
|
221
224
|
</Button>
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import '@dxos-theme';
|
|
6
6
|
|
|
7
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
7
8
|
import React from 'react';
|
|
8
9
|
|
|
9
10
|
import { faker } from '@dxos/random';
|
|
@@ -32,13 +33,17 @@ const DefaultStory = () => {
|
|
|
32
33
|
);
|
|
33
34
|
};
|
|
34
35
|
|
|
35
|
-
|
|
36
|
+
const meta = {
|
|
36
37
|
title: 'ui/react-ui-searchlist/PopoverCombobox',
|
|
37
|
-
component: PopoverCombobox,
|
|
38
|
+
component: PopoverCombobox.Root as any,
|
|
38
39
|
render: DefaultStory,
|
|
39
40
|
decorators: [withTheme],
|
|
40
|
-
}
|
|
41
|
+
} satisfies Meta<typeof DefaultStory>;
|
|
42
|
+
|
|
43
|
+
export default meta;
|
|
44
|
+
|
|
45
|
+
type Story = StoryObj<typeof meta>;
|
|
41
46
|
|
|
42
|
-
export const Default = {
|
|
47
|
+
export const Default: Story = {
|
|
43
48
|
args: {},
|
|
44
49
|
};
|
|
@@ -9,7 +9,6 @@ import {
|
|
|
9
9
|
Popover,
|
|
10
10
|
type PopoverArrowProps,
|
|
11
11
|
type PopoverContentProps,
|
|
12
|
-
type PopoverViewportProps,
|
|
13
12
|
type PopoverVirtualTriggerProps,
|
|
14
13
|
} from '@dxos/react-ui';
|
|
15
14
|
|
|
@@ -100,17 +99,17 @@ const PopoverComboboxContent = forwardRef<HTMLDivElement, PopoverComboboxContent
|
|
|
100
99
|
onFocusOutside,
|
|
101
100
|
onInteractOutside,
|
|
102
101
|
forceMount,
|
|
103
|
-
classNames,
|
|
104
102
|
}}
|
|
103
|
+
classNames={[
|
|
104
|
+
'is-[--radix-popover-trigger-width] max-bs-[--radix-popover-content-available-height] grid grid-rows-[min-content_1fr] overflow-hidden',
|
|
105
|
+
classNames,
|
|
106
|
+
]}
|
|
105
107
|
id={modalId}
|
|
106
108
|
ref={forwardedRef}
|
|
107
109
|
>
|
|
108
|
-
<
|
|
109
|
-
{
|
|
110
|
-
|
|
111
|
-
{children}
|
|
112
|
-
</SearchList.Root>
|
|
113
|
-
</Popover.Viewport>
|
|
110
|
+
<SearchList.Root {...props} classNames='contents density-fine' role='none'>
|
|
111
|
+
{children}
|
|
112
|
+
</SearchList.Root>
|
|
114
113
|
</Popover.Content>
|
|
115
114
|
);
|
|
116
115
|
},
|
|
@@ -134,24 +133,48 @@ const PopoverComboboxVirtualTrigger = Popover.VirtualTrigger;
|
|
|
134
133
|
|
|
135
134
|
type PopoverComboboxInputProps = SearchListInputProps;
|
|
136
135
|
|
|
137
|
-
const PopoverComboboxInput =
|
|
136
|
+
const PopoverComboboxInput = forwardRef<HTMLInputElement, PopoverComboboxInputProps>(
|
|
137
|
+
({ classNames, ...props }, forwardedRef) => {
|
|
138
|
+
return (
|
|
139
|
+
<SearchList.Input
|
|
140
|
+
{...props}
|
|
141
|
+
classNames={[
|
|
142
|
+
'mli-cardSpacingChrome mbs-cardSpacingChrome mbe-0 is-[calc(100%-2*var(--dx-cardSpacingChrome))]',
|
|
143
|
+
classNames,
|
|
144
|
+
]}
|
|
145
|
+
ref={forwardedRef}
|
|
146
|
+
/>
|
|
147
|
+
);
|
|
148
|
+
},
|
|
149
|
+
);
|
|
138
150
|
|
|
139
|
-
type PopoverComboboxListProps = SearchListContentProps
|
|
140
|
-
Pick<PopoverViewportProps, 'constrainBlock' | 'constrainInline'>;
|
|
151
|
+
type PopoverComboboxListProps = SearchListContentProps;
|
|
141
152
|
|
|
142
153
|
const PopoverComboboxList = forwardRef<HTMLDivElement, PopoverComboboxListProps>(
|
|
143
|
-
({
|
|
154
|
+
({ classNames, ...props }, forwardedRef) => {
|
|
144
155
|
return (
|
|
145
|
-
<
|
|
146
|
-
|
|
147
|
-
|
|
156
|
+
<SearchList.Content
|
|
157
|
+
{...props}
|
|
158
|
+
classNames={['min-bs-0 overflow-y-auto plb-cardSpacingChrome', classNames]}
|
|
159
|
+
ref={forwardedRef}
|
|
160
|
+
/>
|
|
148
161
|
);
|
|
149
162
|
},
|
|
150
163
|
);
|
|
151
164
|
|
|
152
165
|
type PopoverComboboxItemProps = SearchListItemProps;
|
|
153
166
|
|
|
154
|
-
const PopoverComboboxItem =
|
|
167
|
+
const PopoverComboboxItem = forwardRef<HTMLDivElement, PopoverComboboxItemProps>(
|
|
168
|
+
({ classNames, ...props }, forwardedRef) => {
|
|
169
|
+
return (
|
|
170
|
+
<SearchList.Item
|
|
171
|
+
{...props}
|
|
172
|
+
classNames={['mli-cardSpacingChrome pli-cardSpacingChrome', classNames]}
|
|
173
|
+
ref={forwardedRef}
|
|
174
|
+
/>
|
|
175
|
+
);
|
|
176
|
+
},
|
|
177
|
+
);
|
|
155
178
|
|
|
156
179
|
type PopoverComboboxArrowProps = PopoverArrowProps;
|
|
157
180
|
|
package/src/index.ts
CHANGED
package/src/translations.ts
CHANGED
|
@@ -2,12 +2,14 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
import { type Resource } from '@dxos/react-ui';
|
|
6
6
|
|
|
7
|
-
export
|
|
7
|
+
export const translationKey = 'react-ui-searchlist';
|
|
8
|
+
|
|
9
|
+
export const translations = [
|
|
8
10
|
{
|
|
9
11
|
'en-US': {
|
|
10
12
|
[translationKey]: {},
|
|
11
13
|
},
|
|
12
14
|
},
|
|
13
|
-
];
|
|
15
|
+
] as const satisfies Resource[];
|
package/dist/lib/node/index.cjs
DELETED
|
@@ -1,324 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var node_exports = {};
|
|
30
|
-
__export(node_exports, {
|
|
31
|
-
Combobox: () => Combobox,
|
|
32
|
-
PopoverCombobox: () => PopoverCombobox,
|
|
33
|
-
SearchList: () => SearchList,
|
|
34
|
-
translations: () => translations_default
|
|
35
|
-
});
|
|
36
|
-
module.exports = __toCommonJS(node_exports);
|
|
37
|
-
var import_tracking = require("@preact-signals/safe-react/tracking");
|
|
38
|
-
var import_react = require("@phosphor-icons/react");
|
|
39
|
-
var import_react_context = require("@radix-ui/react-context");
|
|
40
|
-
var import_react_use_controllable_state = require("@radix-ui/react-use-controllable-state");
|
|
41
|
-
var import_cmdk = require("cmdk");
|
|
42
|
-
var import_react2 = __toESM(require("react"));
|
|
43
|
-
var import_react_ui = require("@dxos/react-ui");
|
|
44
|
-
var import_react_ui_theme = require("@dxos/react-ui-theme");
|
|
45
|
-
var import_tracking2 = require("@preact-signals/safe-react/tracking");
|
|
46
|
-
var import_react_use_controllable_state2 = require("@radix-ui/react-use-controllable-state");
|
|
47
|
-
var import_react3 = __toESM(require("react"));
|
|
48
|
-
var import_react_ui2 = require("@dxos/react-ui");
|
|
49
|
-
var COMBOBOX_NAME = "Combobox";
|
|
50
|
-
var COMBOBOX_TRIGGER_NAME = "ComboboxTrigger";
|
|
51
|
-
var SEARCHLIST_NAME = "SearchList";
|
|
52
|
-
var SEARCHLIST_ITEM_NAME = "SearchListItem";
|
|
53
|
-
var [ComboboxProvider, useComboboxContext] = (0, import_react_context.createContext)(COMBOBOX_NAME, {});
|
|
54
|
-
var SearchListRoot = /* @__PURE__ */ (0, import_react2.forwardRef)(({ children, classNames, ...props }, forwardedRef) => {
|
|
55
|
-
var _effect = (0, import_tracking.useSignals)();
|
|
56
|
-
try {
|
|
57
|
-
return /* @__PURE__ */ import_react2.default.createElement(import_cmdk.CommandRoot, {
|
|
58
|
-
...props,
|
|
59
|
-
className: (0, import_react_ui_theme.mx)("", classNames),
|
|
60
|
-
ref: forwardedRef
|
|
61
|
-
}, children);
|
|
62
|
-
} finally {
|
|
63
|
-
_effect.f();
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
SearchListRoot.displayName = SEARCHLIST_NAME;
|
|
67
|
-
var SearchListInput = /* @__PURE__ */ (0, import_react2.forwardRef)(({ children, classNames, density: propsDensity, elevation: propsElevation, variant, ...props }, forwardedRef) => {
|
|
68
|
-
var _effect = (0, import_tracking.useSignals)();
|
|
69
|
-
try {
|
|
70
|
-
const { hasIosKeyboard } = (0, import_react_ui.useThemeContext)();
|
|
71
|
-
const { tx } = (0, import_react_ui.useThemeContext)();
|
|
72
|
-
const density = (0, import_react_ui.useDensityContext)(propsDensity);
|
|
73
|
-
const elevation = (0, import_react_ui.useElevationContext)(propsElevation);
|
|
74
|
-
return /* @__PURE__ */ import_react2.default.createElement(import_cmdk.CommandInput, {
|
|
75
|
-
...props,
|
|
76
|
-
className: tx("input.input", "input", {
|
|
77
|
-
variant,
|
|
78
|
-
disabled: props.disabled,
|
|
79
|
-
density,
|
|
80
|
-
elevation
|
|
81
|
-
}, "mbe-cardSpacingBlock", classNames),
|
|
82
|
-
...props.autoFocus && !hasIosKeyboard && {
|
|
83
|
-
autoFocus: true
|
|
84
|
-
},
|
|
85
|
-
ref: forwardedRef
|
|
86
|
-
});
|
|
87
|
-
} finally {
|
|
88
|
-
_effect.f();
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
var SearchListContent = /* @__PURE__ */ (0, import_react2.forwardRef)(({ children, classNames, ...props }, forwardedRef) => {
|
|
92
|
-
var _effect = (0, import_tracking.useSignals)();
|
|
93
|
-
try {
|
|
94
|
-
return /* @__PURE__ */ import_react2.default.createElement(import_cmdk.CommandList, {
|
|
95
|
-
...props,
|
|
96
|
-
className: (0, import_react_ui_theme.mx)(classNames),
|
|
97
|
-
ref: forwardedRef
|
|
98
|
-
}, children);
|
|
99
|
-
} finally {
|
|
100
|
-
_effect.f();
|
|
101
|
-
}
|
|
102
|
-
});
|
|
103
|
-
var SearchListEmpty = /* @__PURE__ */ (0, import_react2.forwardRef)(({ children, classNames, ...props }, forwardedRef) => {
|
|
104
|
-
var _effect = (0, import_tracking.useSignals)();
|
|
105
|
-
try {
|
|
106
|
-
return /* @__PURE__ */ import_react2.default.createElement(import_cmdk.CommandEmpty, {
|
|
107
|
-
...props,
|
|
108
|
-
className: (0, import_react_ui_theme.mx)(classNames),
|
|
109
|
-
ref: forwardedRef
|
|
110
|
-
}, children);
|
|
111
|
-
} finally {
|
|
112
|
-
_effect.f();
|
|
113
|
-
}
|
|
114
|
-
});
|
|
115
|
-
var SearchListItem = /* @__PURE__ */ (0, import_react2.forwardRef)(({ children, classNames, onSelect, ...props }, forwardedRef) => {
|
|
116
|
-
var _effect = (0, import_tracking.useSignals)();
|
|
117
|
-
try {
|
|
118
|
-
const { onValueChange, onOpenChange } = useComboboxContext(SEARCHLIST_ITEM_NAME);
|
|
119
|
-
const handleSelect = (0, import_react2.useCallback)((nextValue) => {
|
|
120
|
-
onValueChange?.(nextValue);
|
|
121
|
-
onOpenChange?.(false);
|
|
122
|
-
onSelect?.(nextValue);
|
|
123
|
-
}, [
|
|
124
|
-
onValueChange,
|
|
125
|
-
onOpenChange,
|
|
126
|
-
onSelect
|
|
127
|
-
]);
|
|
128
|
-
return /* @__PURE__ */ import_react2.default.createElement(import_cmdk.CommandItem, {
|
|
129
|
-
...props,
|
|
130
|
-
onSelect: handleSelect,
|
|
131
|
-
className: (0, import_react_ui_theme.mx)("p-1 rounded select-none cursor-pointer data-[selected]:bg-hoverOverlay", classNames),
|
|
132
|
-
ref: forwardedRef
|
|
133
|
-
}, children);
|
|
134
|
-
} finally {
|
|
135
|
-
_effect.f();
|
|
136
|
-
}
|
|
137
|
-
});
|
|
138
|
-
SearchListItem.displayName = SEARCHLIST_ITEM_NAME;
|
|
139
|
-
var ComboboxRoot = ({ modalId: propsModalId, open: propsOpen, defaultOpen, onOpenChange: propsOnOpenChange, value: propsValue, defaultValue, onValueChange: propsOnValueChange, placeholder, children }) => {
|
|
140
|
-
var _effect = (0, import_tracking.useSignals)();
|
|
141
|
-
try {
|
|
142
|
-
const modalId = (0, import_react_ui.useId)(COMBOBOX_NAME, propsModalId);
|
|
143
|
-
const [open = false, onOpenChange] = (0, import_react_use_controllable_state.useControllableState)({
|
|
144
|
-
prop: propsOpen,
|
|
145
|
-
onChange: propsOnOpenChange,
|
|
146
|
-
defaultProp: defaultOpen
|
|
147
|
-
});
|
|
148
|
-
const [value = "", onValueChange] = (0, import_react_use_controllable_state.useControllableState)({
|
|
149
|
-
prop: propsValue,
|
|
150
|
-
onChange: propsOnValueChange,
|
|
151
|
-
defaultProp: defaultValue
|
|
152
|
-
});
|
|
153
|
-
return /* @__PURE__ */ import_react2.default.createElement(ComboboxProvider, {
|
|
154
|
-
isCombobox: true,
|
|
155
|
-
modalId,
|
|
156
|
-
open,
|
|
157
|
-
onOpenChange,
|
|
158
|
-
value,
|
|
159
|
-
onValueChange,
|
|
160
|
-
placeholder
|
|
161
|
-
}, children);
|
|
162
|
-
} finally {
|
|
163
|
-
_effect.f();
|
|
164
|
-
}
|
|
165
|
-
};
|
|
166
|
-
ComboboxRoot.displayName = COMBOBOX_NAME;
|
|
167
|
-
var ComboboxTrigger = /* @__PURE__ */ (0, import_react2.forwardRef)(({ children, onClick, ...props }, forwardedRef) => {
|
|
168
|
-
var _effect = (0, import_tracking.useSignals)();
|
|
169
|
-
try {
|
|
170
|
-
const { modalId, open, onOpenChange, placeholder, value } = useComboboxContext(COMBOBOX_TRIGGER_NAME);
|
|
171
|
-
const handleClick = (0, import_react2.useCallback)((event) => {
|
|
172
|
-
onClick?.(event);
|
|
173
|
-
onOpenChange?.(true);
|
|
174
|
-
}, [
|
|
175
|
-
onClick,
|
|
176
|
-
onOpenChange
|
|
177
|
-
]);
|
|
178
|
-
return /* @__PURE__ */ import_react2.default.createElement(import_react_ui.Button, {
|
|
179
|
-
...props,
|
|
180
|
-
role: "combobox",
|
|
181
|
-
"aria-expanded": open,
|
|
182
|
-
"aria-controls": modalId,
|
|
183
|
-
"aria-haspopup": "dialog",
|
|
184
|
-
onClick: handleClick,
|
|
185
|
-
ref: forwardedRef
|
|
186
|
-
}, children ?? /* @__PURE__ */ import_react2.default.createElement(import_react2.default.Fragment, null, /* @__PURE__ */ import_react2.default.createElement("span", {
|
|
187
|
-
className: (0, import_react_ui_theme.mx)("font-normal text-start flex-1 min-is-0 truncate mie-2", !value && import_react_ui_theme.staticPlaceholderText)
|
|
188
|
-
}, value || placeholder), /* @__PURE__ */ import_react2.default.createElement(import_react.CaretDown, {
|
|
189
|
-
weight: "bold",
|
|
190
|
-
className: (0, import_react_ui_theme.getSize)(3)
|
|
191
|
-
})));
|
|
192
|
-
} finally {
|
|
193
|
-
_effect.f();
|
|
194
|
-
}
|
|
195
|
-
});
|
|
196
|
-
ComboboxTrigger.displayName = COMBOBOX_TRIGGER_NAME;
|
|
197
|
-
var SearchList = {
|
|
198
|
-
Root: SearchListRoot,
|
|
199
|
-
Input: SearchListInput,
|
|
200
|
-
Content: SearchListContent,
|
|
201
|
-
Empty: SearchListEmpty,
|
|
202
|
-
Item: SearchListItem
|
|
203
|
-
};
|
|
204
|
-
var Combobox = {
|
|
205
|
-
Root: ComboboxRoot,
|
|
206
|
-
Trigger: ComboboxTrigger,
|
|
207
|
-
useComboboxContext
|
|
208
|
-
};
|
|
209
|
-
var PopoverComboboxRoot = ({ modal, children, open: propsOpen, onOpenChange: propsOnOpenChange, defaultOpen, ...props }) => {
|
|
210
|
-
var _effect = (0, import_tracking2.useSignals)();
|
|
211
|
-
try {
|
|
212
|
-
const [open, onOpenChange] = (0, import_react_use_controllable_state2.useControllableState)({
|
|
213
|
-
prop: propsOpen,
|
|
214
|
-
onChange: propsOnOpenChange,
|
|
215
|
-
defaultProp: defaultOpen
|
|
216
|
-
});
|
|
217
|
-
return /* @__PURE__ */ import_react3.default.createElement(Combobox.Root, {
|
|
218
|
-
open,
|
|
219
|
-
onOpenChange,
|
|
220
|
-
...props
|
|
221
|
-
}, /* @__PURE__ */ import_react3.default.createElement(import_react_ui2.Popover.Root, {
|
|
222
|
-
open,
|
|
223
|
-
onOpenChange,
|
|
224
|
-
modal
|
|
225
|
-
}, children));
|
|
226
|
-
} finally {
|
|
227
|
-
_effect.f();
|
|
228
|
-
}
|
|
229
|
-
};
|
|
230
|
-
var POPOVER_COMBOBOX_CONTENT_NAME = "PopoverComboboxContent";
|
|
231
|
-
var PopoverComboboxContent = /* @__PURE__ */ (0, import_react3.forwardRef)(({ side = "bottom", collisionPadding = 48, sideOffset, align, alignOffset, avoidCollisions, collisionBoundary, arrowPadding, sticky, hideWhenDetached, onOpenAutoFocus, onCloseAutoFocus, onEscapeKeyDown, onPointerDownOutside, onFocusOutside, onInteractOutside, forceMount, children, classNames, ...props }, forwardedRef) => {
|
|
232
|
-
var _effect = (0, import_tracking2.useSignals)();
|
|
233
|
-
try {
|
|
234
|
-
const { modalId } = Combobox.useComboboxContext(POPOVER_COMBOBOX_CONTENT_NAME);
|
|
235
|
-
return /* @__PURE__ */ import_react3.default.createElement(import_react_ui2.Popover.Content, {
|
|
236
|
-
side,
|
|
237
|
-
sideOffset,
|
|
238
|
-
align,
|
|
239
|
-
alignOffset,
|
|
240
|
-
avoidCollisions,
|
|
241
|
-
collisionBoundary,
|
|
242
|
-
collisionPadding,
|
|
243
|
-
arrowPadding,
|
|
244
|
-
sticky,
|
|
245
|
-
hideWhenDetached,
|
|
246
|
-
onOpenAutoFocus,
|
|
247
|
-
onCloseAutoFocus,
|
|
248
|
-
onEscapeKeyDown,
|
|
249
|
-
onPointerDownOutside,
|
|
250
|
-
onFocusOutside,
|
|
251
|
-
onInteractOutside,
|
|
252
|
-
forceMount,
|
|
253
|
-
classNames,
|
|
254
|
-
id: modalId,
|
|
255
|
-
ref: forwardedRef
|
|
256
|
-
}, /* @__PURE__ */ import_react3.default.createElement(import_react_ui2.Popover.Viewport, null, /* @__PURE__ */ import_react3.default.createElement(SearchList.Root, {
|
|
257
|
-
...props,
|
|
258
|
-
classNames: "contents",
|
|
259
|
-
role: "none"
|
|
260
|
-
}, children)));
|
|
261
|
-
} finally {
|
|
262
|
-
_effect.f();
|
|
263
|
-
}
|
|
264
|
-
});
|
|
265
|
-
PopoverComboboxContent.displayName = POPOVER_COMBOBOX_CONTENT_NAME;
|
|
266
|
-
var PopoverComboboxTrigger = /* @__PURE__ */ (0, import_react3.forwardRef)((props, forwardedRef) => {
|
|
267
|
-
var _effect = (0, import_tracking2.useSignals)();
|
|
268
|
-
try {
|
|
269
|
-
return /* @__PURE__ */ import_react3.default.createElement(import_react_ui2.Popover.Trigger, {
|
|
270
|
-
asChild: true
|
|
271
|
-
}, /* @__PURE__ */ import_react3.default.createElement(Combobox.Trigger, {
|
|
272
|
-
...props,
|
|
273
|
-
ref: forwardedRef
|
|
274
|
-
}));
|
|
275
|
-
} finally {
|
|
276
|
-
_effect.f();
|
|
277
|
-
}
|
|
278
|
-
});
|
|
279
|
-
var PopoverComboboxVirtualTrigger = import_react_ui2.Popover.VirtualTrigger;
|
|
280
|
-
var PopoverComboboxInput = SearchList.Input;
|
|
281
|
-
var PopoverComboboxList = /* @__PURE__ */ (0, import_react3.forwardRef)(({ constrainInline, constrainBlock, ...props }, forwardedRef) => {
|
|
282
|
-
var _effect = (0, import_tracking2.useSignals)();
|
|
283
|
-
try {
|
|
284
|
-
return /* @__PURE__ */ import_react3.default.createElement(import_react_ui2.Popover.Viewport, {
|
|
285
|
-
constrainInline,
|
|
286
|
-
constrainBlock
|
|
287
|
-
}, /* @__PURE__ */ import_react3.default.createElement(SearchList.Content, {
|
|
288
|
-
...props,
|
|
289
|
-
ref: forwardedRef
|
|
290
|
-
}));
|
|
291
|
-
} finally {
|
|
292
|
-
_effect.f();
|
|
293
|
-
}
|
|
294
|
-
});
|
|
295
|
-
var PopoverComboboxItem = SearchList.Item;
|
|
296
|
-
var PopoverComboboxArrow = import_react_ui2.Popover.Arrow;
|
|
297
|
-
var PopoverComboboxEmpty = SearchList.Empty;
|
|
298
|
-
var PopoverCombobox = {
|
|
299
|
-
Root: PopoverComboboxRoot,
|
|
300
|
-
Content: PopoverComboboxContent,
|
|
301
|
-
Trigger: PopoverComboboxTrigger,
|
|
302
|
-
VirtualTrigger: PopoverComboboxVirtualTrigger,
|
|
303
|
-
Input: PopoverComboboxInput,
|
|
304
|
-
List: PopoverComboboxList,
|
|
305
|
-
Item: PopoverComboboxItem,
|
|
306
|
-
Arrow: PopoverComboboxArrow,
|
|
307
|
-
Empty: PopoverComboboxEmpty
|
|
308
|
-
};
|
|
309
|
-
var translationKey = "searchlist";
|
|
310
|
-
var translations_default = [
|
|
311
|
-
{
|
|
312
|
-
"en-US": {
|
|
313
|
-
[translationKey]: {}
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
];
|
|
317
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
318
|
-
0 && (module.exports = {
|
|
319
|
-
Combobox,
|
|
320
|
-
PopoverCombobox,
|
|
321
|
-
SearchList,
|
|
322
|
-
translations
|
|
323
|
-
});
|
|
324
|
-
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/SearchList.tsx", "../../../src/composites/PopoverCombobox.tsx", "../../../src/translations.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { CaretDown } from '@phosphor-icons/react';\nimport { createContext } from '@radix-ui/react-context';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport { CommandEmpty, CommandInput, CommandItem, CommandList, CommandRoot } from 'cmdk';\nimport React, { type ComponentPropsWithRef, forwardRef, type PropsWithChildren, useCallback } from 'react';\n\nimport {\n Button,\n type ButtonProps,\n type TextInputProps,\n type ThemedClassName,\n useDensityContext,\n useElevationContext,\n useId,\n useThemeContext,\n} from '@dxos/react-ui';\nimport { getSize, mx, staticPlaceholderText } from '@dxos/react-ui-theme';\n\ntype SearchListVariant = 'list' | 'menu' | 'listbox';\n\ntype SearchListRootProps = ThemedClassName<ComponentPropsWithRef<typeof CommandRoot>> & {\n variant?: SearchListVariant;\n};\n\ntype ComboboxContextValue = {\n isCombobox: true;\n modalId: string;\n open: boolean;\n onOpenChange: (nextOpen: boolean) => void;\n value: string;\n onValueChange: (nextValue: string) => void;\n placeholder?: string;\n};\n\nconst COMBOBOX_NAME = 'Combobox';\nconst COMBOBOX_TRIGGER_NAME = 'ComboboxTrigger';\nconst SEARCHLIST_NAME = 'SearchList';\nconst SEARCHLIST_ITEM_NAME = 'SearchListItem';\n\nconst [ComboboxProvider, useComboboxContext] = createContext<Partial<ComboboxContextValue>>(COMBOBOX_NAME, {});\n\ntype ComboboxRootProps = PropsWithChildren<\n Partial<ComboboxContextValue & { defaultOpen: boolean; defaultValue: string; placeholder: string }>\n>;\n\nconst SearchListRoot = forwardRef<HTMLDivElement, SearchListRootProps>(\n ({ children, classNames, ...props }, forwardedRef) => {\n return (\n <CommandRoot {...props} className={mx('', classNames)} ref={forwardedRef}>\n {children}\n </CommandRoot>\n );\n },\n);\n\nSearchListRoot.displayName = SEARCHLIST_NAME;\n\ntype CommandInputPrimitiveProps = ComponentPropsWithRef<typeof CommandInput>;\n\n// TODO: Harmonize with other inputs’ `onChange` prop.\ntype SearchListInputProps = Omit<TextInputProps, 'value' | 'defaultValue' | 'onChange'> &\n Pick<CommandInputPrimitiveProps, 'value' | 'onValueChange' | 'defaultValue'>;\n\nconst SearchListInput = forwardRef<HTMLInputElement, SearchListInputProps>(\n ({ children, classNames, density: propsDensity, elevation: propsElevation, variant, ...props }, forwardedRef) => {\n // CHORE(thure): Keep this in-sync with `TextInput`, or submit a PR for `cmdk` to support `asChild` so we don’t have to.\n const { hasIosKeyboard } = useThemeContext();\n const { tx } = useThemeContext();\n const density = useDensityContext(propsDensity);\n const elevation = useElevationContext(propsElevation);\n\n return (\n <CommandInput\n {...props}\n className={tx(\n 'input.input',\n 'input',\n {\n variant,\n disabled: props.disabled,\n density,\n elevation,\n },\n 'mbe-cardSpacingBlock',\n classNames,\n )}\n {...(props.autoFocus && !hasIosKeyboard && { autoFocus: true })}\n ref={forwardedRef}\n />\n );\n },\n);\n\ntype SearchListContentProps = ThemedClassName<ComponentPropsWithRef<typeof CommandList>>;\n\nconst SearchListContent = forwardRef<HTMLDivElement, SearchListContentProps>(\n ({ children, classNames, ...props }, forwardedRef) => {\n return (\n <CommandList {...props} className={mx(classNames)} ref={forwardedRef}>\n {children}\n </CommandList>\n );\n },\n);\n\ntype SearchListEmptyProps = ThemedClassName<ComponentPropsWithRef<typeof CommandEmpty>>;\n\nconst SearchListEmpty = forwardRef<HTMLDivElement, SearchListEmptyProps>(\n ({ children, classNames, ...props }, forwardedRef) => {\n return (\n <CommandEmpty {...props} className={mx(classNames)} ref={forwardedRef}>\n {children}\n </CommandEmpty>\n );\n },\n);\n\ntype SearchListItemProps = ThemedClassName<ComponentPropsWithRef<typeof CommandItem>>;\n\nconst SearchListItem = forwardRef<HTMLDivElement, SearchListItemProps>(\n ({ children, classNames, onSelect, ...props }, forwardedRef) => {\n const { onValueChange, onOpenChange } = useComboboxContext(SEARCHLIST_ITEM_NAME);\n const handleSelect = useCallback(\n (nextValue: string) => {\n onValueChange?.(nextValue);\n onOpenChange?.(false);\n onSelect?.(nextValue);\n },\n [onValueChange, onOpenChange, onSelect],\n );\n return (\n <CommandItem\n {...props}\n onSelect={handleSelect}\n className={mx('p-1 rounded select-none cursor-pointer data-[selected]:bg-hoverOverlay', classNames)}\n ref={forwardedRef}\n >\n {children}\n </CommandItem>\n );\n },\n);\n\nSearchListItem.displayName = SEARCHLIST_ITEM_NAME;\n\nconst ComboboxRoot = ({\n modalId: propsModalId,\n open: propsOpen,\n defaultOpen,\n onOpenChange: propsOnOpenChange,\n value: propsValue,\n defaultValue,\n onValueChange: propsOnValueChange,\n placeholder,\n children,\n}: ComboboxRootProps) => {\n const modalId = useId(COMBOBOX_NAME, propsModalId);\n const [open = false, onOpenChange] = useControllableState({\n prop: propsOpen,\n onChange: propsOnOpenChange,\n defaultProp: defaultOpen,\n });\n const [value = '', onValueChange] = useControllableState({\n prop: propsValue,\n onChange: propsOnValueChange,\n defaultProp: defaultValue,\n });\n return (\n <ComboboxProvider\n isCombobox\n modalId={modalId}\n open={open}\n onOpenChange={onOpenChange}\n value={value}\n onValueChange={onValueChange}\n placeholder={placeholder}\n >\n {children}\n </ComboboxProvider>\n );\n};\n\nComboboxRoot.displayName = COMBOBOX_NAME;\n\ntype ComboboxTriggerProps = ButtonProps;\n\nconst ComboboxTrigger = forwardRef<HTMLButtonElement, ComboboxTriggerProps>(\n ({ children, onClick, ...props }, forwardedRef) => {\n const { modalId, open, onOpenChange, placeholder, value } = useComboboxContext(COMBOBOX_TRIGGER_NAME);\n const handleClick = useCallback(\n (event: Parameters<Exclude<ButtonProps['onClick'], undefined>>[0]) => {\n onClick?.(event);\n onOpenChange?.(true);\n },\n [onClick, onOpenChange],\n );\n return (\n <Button\n {...props}\n role='combobox'\n aria-expanded={open}\n aria-controls={modalId}\n aria-haspopup='dialog'\n onClick={handleClick}\n ref={forwardedRef}\n >\n {children ?? (\n <>\n <span\n className={mx('font-normal text-start flex-1 min-is-0 truncate mie-2', !value && staticPlaceholderText)}\n >\n {value || placeholder}\n </span>\n <CaretDown weight='bold' className={getSize(3)} />\n </>\n )}\n </Button>\n );\n },\n);\n\nComboboxTrigger.displayName = COMBOBOX_TRIGGER_NAME;\n\nexport const SearchList = {\n Root: SearchListRoot,\n Input: SearchListInput,\n Content: SearchListContent,\n Empty: SearchListEmpty,\n Item: SearchListItem,\n};\n\nexport const Combobox = {\n Root: ComboboxRoot,\n Trigger: ComboboxTrigger,\n useComboboxContext,\n};\n\nexport type {\n SearchListRootProps,\n SearchListInputProps,\n SearchListContentProps,\n SearchListEmptyProps,\n SearchListItemProps,\n ComboboxRootProps,\n ComboboxTriggerProps,\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport React, { forwardRef } from 'react';\n\nimport {\n Popover,\n type PopoverArrowProps,\n type PopoverContentProps,\n type PopoverViewportProps,\n type PopoverVirtualTriggerProps,\n} from '@dxos/react-ui';\n\nimport {\n Combobox,\n type ComboboxRootProps,\n type ComboboxTriggerProps,\n SearchList,\n type SearchListContentProps,\n type SearchListEmptyProps,\n type SearchListInputProps,\n type SearchListItemProps,\n type SearchListRootProps,\n} from '../components';\n\ntype PopoverComboboxRootProps = ComboboxRootProps & { modal?: boolean };\n\nconst PopoverComboboxRoot = ({\n modal,\n children,\n open: propsOpen,\n onOpenChange: propsOnOpenChange,\n defaultOpen,\n ...props\n}: PopoverComboboxRootProps) => {\n const [open, onOpenChange] = useControllableState({\n prop: propsOpen,\n onChange: propsOnOpenChange,\n defaultProp: defaultOpen,\n });\n return (\n <Combobox.Root open={open} onOpenChange={onOpenChange} {...props}>\n <Popover.Root open={open} onOpenChange={onOpenChange} modal={modal}>\n {children}\n </Popover.Root>\n </Combobox.Root>\n );\n};\n\ntype PopoverComboboxContentProps = SearchListRootProps & PopoverContentProps;\n\nconst POPOVER_COMBOBOX_CONTENT_NAME = 'PopoverComboboxContent';\n\nconst PopoverComboboxContent = forwardRef<HTMLDivElement, PopoverComboboxContentProps>(\n (\n {\n side = 'bottom',\n collisionPadding = 48,\n sideOffset,\n align,\n alignOffset,\n avoidCollisions,\n collisionBoundary,\n arrowPadding,\n sticky,\n hideWhenDetached,\n onOpenAutoFocus,\n onCloseAutoFocus,\n onEscapeKeyDown,\n onPointerDownOutside,\n onFocusOutside,\n onInteractOutside,\n forceMount,\n children,\n classNames,\n ...props\n },\n forwardedRef,\n ) => {\n const { modalId } = Combobox.useComboboxContext(POPOVER_COMBOBOX_CONTENT_NAME);\n return (\n <Popover.Content\n {...{\n side,\n sideOffset,\n align,\n alignOffset,\n avoidCollisions,\n collisionBoundary,\n collisionPadding,\n arrowPadding,\n sticky,\n hideWhenDetached,\n onOpenAutoFocus,\n onCloseAutoFocus,\n onEscapeKeyDown,\n onPointerDownOutside,\n onFocusOutside,\n onInteractOutside,\n forceMount,\n classNames,\n }}\n id={modalId}\n ref={forwardedRef}\n >\n <Popover.Viewport>\n {/* TODO(thure): This skips over `Command`’s root component, which renders a DOM node probably unnecessarily without supporting `asChild`. */}\n <SearchList.Root {...props} classNames='contents' role='none'>\n {children}\n </SearchList.Root>\n </Popover.Viewport>\n </Popover.Content>\n );\n },\n);\n\nPopoverComboboxContent.displayName = POPOVER_COMBOBOX_CONTENT_NAME;\n\ntype PopoverComboboxTriggerProps = ComboboxTriggerProps;\n\nconst PopoverComboboxTrigger = forwardRef<HTMLButtonElement, PopoverComboboxTriggerProps>((props, forwardedRef) => {\n return (\n <Popover.Trigger asChild>\n <Combobox.Trigger {...props} ref={forwardedRef} />\n </Popover.Trigger>\n );\n});\n\ntype PopoverComboboxVirtualTriggerProps = PopoverVirtualTriggerProps;\n\nconst PopoverComboboxVirtualTrigger = Popover.VirtualTrigger;\n\ntype PopoverComboboxInputProps = SearchListInputProps;\n\nconst PopoverComboboxInput = SearchList.Input;\n\ntype PopoverComboboxListProps = SearchListContentProps &\n Pick<PopoverViewportProps, 'constrainBlock' | 'constrainInline'>;\n\nconst PopoverComboboxList = forwardRef<HTMLDivElement, PopoverComboboxListProps>(\n ({ constrainInline, constrainBlock, ...props }, forwardedRef) => {\n return (\n <Popover.Viewport {...{ constrainInline, constrainBlock }}>\n <SearchList.Content {...props} ref={forwardedRef} />\n </Popover.Viewport>\n );\n },\n);\n\ntype PopoverComboboxItemProps = SearchListItemProps;\n\nconst PopoverComboboxItem = SearchList.Item;\n\ntype PopoverComboboxArrowProps = PopoverArrowProps;\n\nconst PopoverComboboxArrow = Popover.Arrow;\n\ntype PopoverComboboxEmptyProps = SearchListEmptyProps;\n\nconst PopoverComboboxEmpty = SearchList.Empty;\n\nexport const PopoverCombobox = {\n Root: PopoverComboboxRoot,\n Content: PopoverComboboxContent,\n Trigger: PopoverComboboxTrigger,\n VirtualTrigger: PopoverComboboxVirtualTrigger,\n Input: PopoverComboboxInput,\n List: PopoverComboboxList,\n Item: PopoverComboboxItem,\n Arrow: PopoverComboboxArrow,\n Empty: PopoverComboboxEmpty,\n};\n\nexport type {\n PopoverComboboxRootProps,\n PopoverComboboxContentProps,\n PopoverComboboxTriggerProps,\n PopoverComboboxVirtualTriggerProps,\n PopoverComboboxInputProps,\n PopoverComboboxListProps,\n PopoverComboboxItemProps,\n PopoverComboboxArrowProps,\n PopoverComboboxEmptyProps,\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nexport const translationKey = 'searchlist';\n\nexport default [\n {\n 'en-US': {\n [translationKey]: {},\n },\n },\n];\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;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,CAAC,EAAE2G,iBAAiBC,gBAAgB,GAAGzG,MAAAA,GAASC,iBAAAA;;;AAC9C,WACEC,8BAAAA,QAAA,cAAC0E,yBAAQqB,UAAa;MAAEO;MAAiBC;IAAe,GACtDvG,8BAAAA,QAAA,cAACgE,WAAWG,SAAO;MAAE,GAAGrE;MAAOM,KAAKL;;;;;AAG1C,CAAA;AAKF,IAAMyG,sBAAsBxC,WAAWK;AAIvC,IAAMoC,uBAAuB/B,yBAAQgC;AAIrC,IAAMC,uBAAuB3C,WAAWI;AAEjC,IAAMwC,kBAAkB;EAC7B3C,MAAMO;EACNL,SAASS;EACTL,SAASyB;EACTG,gBAAgBD;EAChBhC,OAAOkC;EACPS,MAAMR;EACNhC,MAAMmC;EACNE,OAAOD;EACPrC,OAAOuC;AACT;ACzKO,IAAMG,iBAAiB;AAE9B,IAAA,uBAAe;EACb;IACE,SAAS;MACP,CAACA,cAAAA,GAAiB,CAAC;IACrB;EACF;;",
|
|
6
|
-
"names": ["import_react", "import_react_use_controllable_state", "import_react_ui", "COMBOBOX_NAME", "COMBOBOX_TRIGGER_NAME", "SEARCHLIST_NAME", "SEARCHLIST_ITEM_NAME", "ComboboxProvider", "useComboboxContext", "createContext", "SearchListRoot", "forwardRef", "children", "classNames", "props", "forwardedRef", "React", "CommandRoot", "className", "mx", "ref", "displayName", "SearchListInput", "density", "propsDensity", "elevation", "propsElevation", "variant", "hasIosKeyboard", "useThemeContext", "tx", "useDensityContext", "useElevationContext", "CommandInput", "disabled", "autoFocus", "SearchListContent", "CommandList", "SearchListEmpty", "CommandEmpty", "SearchListItem", "onSelect", "onValueChange", "onOpenChange", "handleSelect", "useCallback", "nextValue", "CommandItem", "ComboboxRoot", "modalId", "propsModalId", "open", "propsOpen", "defaultOpen", "propsOnOpenChange", "value", "propsValue", "defaultValue", "propsOnValueChange", "placeholder", "useId", "useControllableState", "prop", "onChange", "defaultProp", "isCombobox", "ComboboxTrigger", "onClick", "handleClick", "event", "Button", "role", "aria-expanded", "aria-controls", "aria-haspopup", "span", "staticPlaceholderText", "CaretDown", "weight", "getSize", "SearchList", "Root", "Input", "Content", "Empty", "Item", "Combobox", "Trigger", "PopoverComboboxRoot", "modal", "Popover", "POPOVER_COMBOBOX_CONTENT_NAME", "PopoverComboboxContent", "side", "collisionPadding", "sideOffset", "align", "alignOffset", "avoidCollisions", "collisionBoundary", "arrowPadding", "sticky", "hideWhenDetached", "onOpenAutoFocus", "onCloseAutoFocus", "onEscapeKeyDown", "onPointerDownOutside", "onFocusOutside", "onInteractOutside", "forceMount", "id", "Viewport", "PopoverComboboxTrigger", "asChild", "PopoverComboboxVirtualTrigger", "VirtualTrigger", "PopoverComboboxInput", "PopoverComboboxList", "constrainInline", "constrainBlock", "PopoverComboboxItem", "PopoverComboboxArrow", "Arrow", "PopoverComboboxEmpty", "PopoverCombobox", "List", "translationKey"]
|
|
7
|
-
}
|