instantsearch-ui-components 0.0.0 → 0.3.0
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/LICENSE +21 -0
- package/README.md +43 -2
- package/dist/cjs/components/Highlight.js +66 -0
- package/dist/cjs/components/index.js +16 -0
- package/dist/cjs/index.js +38 -0
- package/dist/cjs/lib/cx.js +17 -0
- package/dist/cjs/lib/index.js +16 -0
- package/dist/cjs/package.json +1 -0
- package/dist/cjs/types/Renderer.js +1 -0
- package/dist/cjs/types/index.js +16 -0
- package/dist/cjs/version.js +8 -0
- package/dist/es/components/Highlight.d.ts +32 -0
- package/dist/es/components/Highlight.js +59 -0
- package/dist/es/components/index.d.ts +1 -0
- package/dist/es/components/index.js +1 -0
- package/dist/es/index.d.ts +3 -0
- package/dist/es/index.js +3 -0
- package/dist/es/lib/cx.d.ts +3 -0
- package/dist/es/lib/cx.js +11 -0
- package/dist/es/lib/index.d.ts +1 -0
- package/dist/es/lib/index.js +1 -0
- package/dist/es/types/Renderer.d.ts +43 -0
- package/dist/es/types/Renderer.js +1 -0
- package/dist/es/types/index.d.ts +1 -0
- package/dist/es/types/index.js +1 -0
- package/dist/es/version.d.ts +2 -0
- package/dist/es/version.js +1 -0
- package/package.json +45 -2
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2015-present Algolia, Inc.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,44 @@
|
|
|
1
|
-
|
|
1
|
+
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
|
2
|
+
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
- [instantsearch-ui-components](#instantsearch-ui-components)
|
|
5
|
+
- [Contributing](#contributing)
|
|
6
|
+
- [License](#license)
|
|
7
|
+
|
|
8
|
+
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
|
9
|
+
|
|
10
|
+
# instantsearch-ui-components
|
|
11
|
+
|
|
12
|
+
InstantSearch UI Components is an open-source UI library used by InstantSearch to build UI for search and discovery interfaces. It exports UI components that are compatible with InstantSearch.js, React InstantSearch, and Vue InstantSearch.
|
|
13
|
+
|
|
14
|
+
> Note: `instantsearch-ui-components` exists for internal usage and isn't designed for public consumption.
|
|
15
|
+
|
|
16
|
+
## Contributing
|
|
17
|
+
|
|
18
|
+
We welcome all contributors, from casual to regular 💙
|
|
19
|
+
|
|
20
|
+
- **Bug report**. Is something not working as expected? [Send a bug report][contributing-bugreport].
|
|
21
|
+
- **Feature request**. Would you like to add something to the library? [Send a feature request][contributing-featurerequest].
|
|
22
|
+
- **Documentation**. Did you find a typo in the doc? [Open an issue][contributing-newissue] and we'll take care of it.
|
|
23
|
+
- **Development**. If you don't know where to start, you can check the open issues that are [tagged easy][contributing-label-easy], the [bugs][contributing-label-bug] or [chores][contributing-label-chore].
|
|
24
|
+
|
|
25
|
+
To start contributing to code, you need to:
|
|
26
|
+
|
|
27
|
+
1. [Fork the project](https://help.github.com/articles/fork-a-repo/)
|
|
28
|
+
1. [Clone the repository](https://help.github.com/articles/cloning-a-repository/)
|
|
29
|
+
1. Install the dependencies: `yarn`
|
|
30
|
+
|
|
31
|
+
Please read [our contribution process](https://github.com/algolia/instantsearch/blob/master/CONTRIBUTING.md) to learn more.
|
|
32
|
+
|
|
33
|
+
## License
|
|
34
|
+
|
|
35
|
+
InstantSearch UI Components is [MIT licensed](../../LICENSE).
|
|
36
|
+
|
|
37
|
+
<!-- Links -->
|
|
38
|
+
|
|
39
|
+
[contributing-bugreport]: https://github.com/algolia/instantsearch/issues/new?template=BUG_REPORT.yml&labels=triage,Library%3A%20React+InstantSearch
|
|
40
|
+
[contributing-featurerequest]: https://github.com/algolia/instantsearch/discussions/new?category=ideas&labels=triage,Library%3A%20React+InstantSearch&title=Feature%20request%3A%20
|
|
41
|
+
[contributing-newissue]: https://github.com/algolia/instantsearch/issues/new?labels=triage,Library%3A%20React+InstantSearch
|
|
42
|
+
[contributing-label-easy]: https://github.com/algolia/instantsearch/issues?q=is%3Aopen+is%3Aissue+label%3A%22Difficulty%3A+Easy%22+label%3A%22Library%3A%20React+InstantSearch%22
|
|
43
|
+
[contributing-label-bug]: https://github.com/algolia/instantsearch/issues?q=is%3Aissue+is%3Aopen+label%3A%22Type%3A+Bug%22+label%3A%22Library%3A%20React+InstantSearch%22
|
|
44
|
+
[contributing-label-chore]: https://github.com/algolia/instantsearch/issues?q=is%3Aissue+is%3Aopen+label%3A%22Type%3A+Chore%22+label%3A%22Library%3A%20React+InstantSearch%22
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.createHighlightComponent = createHighlightComponent;
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
|
+
var _lib = require("../lib");
|
|
11
|
+
var _excluded = ["parts", "highlightedTagName", "nonHighlightedTagName", "separator", "className", "classNames"];
|
|
12
|
+
function createHighlightPartComponent(_ref) {
|
|
13
|
+
var createElement = _ref.createElement;
|
|
14
|
+
return function HighlightPart(_ref2) {
|
|
15
|
+
var classNames = _ref2.classNames,
|
|
16
|
+
children = _ref2.children,
|
|
17
|
+
highlightedTagName = _ref2.highlightedTagName,
|
|
18
|
+
isHighlighted = _ref2.isHighlighted,
|
|
19
|
+
nonHighlightedTagName = _ref2.nonHighlightedTagName;
|
|
20
|
+
var TagName = isHighlighted ? highlightedTagName : nonHighlightedTagName;
|
|
21
|
+
return createElement(TagName, {
|
|
22
|
+
className: isHighlighted ? classNames.highlighted : classNames.nonHighlighted
|
|
23
|
+
}, children);
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
function createHighlightComponent(_ref3) {
|
|
27
|
+
var createElement = _ref3.createElement,
|
|
28
|
+
Fragment = _ref3.Fragment;
|
|
29
|
+
var HighlightPart = createHighlightPartComponent({
|
|
30
|
+
createElement: createElement,
|
|
31
|
+
Fragment: Fragment
|
|
32
|
+
});
|
|
33
|
+
return function Highlight(userProps) {
|
|
34
|
+
// Not destructured in function signature, to make sure it's not exposed in
|
|
35
|
+
// the type definition.
|
|
36
|
+
var parts = userProps.parts,
|
|
37
|
+
_userProps$highlighte = userProps.highlightedTagName,
|
|
38
|
+
highlightedTagName = _userProps$highlighte === void 0 ? 'mark' : _userProps$highlighte,
|
|
39
|
+
_userProps$nonHighlig = userProps.nonHighlightedTagName,
|
|
40
|
+
nonHighlightedTagName = _userProps$nonHighlig === void 0 ? 'span' : _userProps$nonHighlig,
|
|
41
|
+
_userProps$separator = userProps.separator,
|
|
42
|
+
separator = _userProps$separator === void 0 ? ', ' : _userProps$separator,
|
|
43
|
+
className = userProps.className,
|
|
44
|
+
_userProps$classNames = userProps.classNames,
|
|
45
|
+
classNames = _userProps$classNames === void 0 ? {} : _userProps$classNames,
|
|
46
|
+
props = (0, _objectWithoutProperties2.default)(userProps, _excluded);
|
|
47
|
+
return createElement("span", (0, _extends2.default)({}, props, {
|
|
48
|
+
className: (0, _lib.cx)(classNames.root, className)
|
|
49
|
+
}), parts.map(function (part, partIndex) {
|
|
50
|
+
var isLastPart = partIndex === parts.length - 1;
|
|
51
|
+
return createElement(Fragment, {
|
|
52
|
+
key: partIndex
|
|
53
|
+
}, part.map(function (subPart, subPartIndex) {
|
|
54
|
+
return createElement(HighlightPart, {
|
|
55
|
+
key: subPartIndex,
|
|
56
|
+
classNames: classNames,
|
|
57
|
+
highlightedTagName: highlightedTagName,
|
|
58
|
+
nonHighlightedTagName: nonHighlightedTagName,
|
|
59
|
+
isHighlighted: subPart.isHighlighted
|
|
60
|
+
}, subPart.value);
|
|
61
|
+
}), !isLastPart && createElement("span", {
|
|
62
|
+
className: classNames.separator
|
|
63
|
+
}, separator));
|
|
64
|
+
}));
|
|
65
|
+
};
|
|
66
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _Highlight = require("./Highlight");
|
|
7
|
+
Object.keys(_Highlight).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _Highlight[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function get() {
|
|
13
|
+
return _Highlight[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _components = require("./components");
|
|
7
|
+
Object.keys(_components).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _components[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function get() {
|
|
13
|
+
return _components[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
var _lib = require("./lib");
|
|
18
|
+
Object.keys(_lib).forEach(function (key) {
|
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
|
20
|
+
if (key in exports && exports[key] === _lib[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function get() {
|
|
24
|
+
return _lib[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
var _types = require("./types");
|
|
29
|
+
Object.keys(_types).forEach(function (key) {
|
|
30
|
+
if (key === "default" || key === "__esModule") return;
|
|
31
|
+
if (key in exports && exports[key] === _types[key]) return;
|
|
32
|
+
Object.defineProperty(exports, key, {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: function get() {
|
|
35
|
+
return _types[key];
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.cx = cx;
|
|
7
|
+
function cx() {
|
|
8
|
+
for (var _len = arguments.length, classNames = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
9
|
+
classNames[_key] = arguments[_key];
|
|
10
|
+
}
|
|
11
|
+
return classNames.reduce(function (acc, className) {
|
|
12
|
+
if (Array.isArray(className)) {
|
|
13
|
+
return acc.concat(className);
|
|
14
|
+
}
|
|
15
|
+
return acc.concat([className]);
|
|
16
|
+
}, []).filter(Boolean).join(' ');
|
|
17
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _cx = require("./cx");
|
|
7
|
+
Object.keys(_cx).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _cx[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function get() {
|
|
13
|
+
return _cx[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "type": "commonjs", "sideEffects": false }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _Renderer = require("./Renderer");
|
|
7
|
+
Object.keys(_Renderer).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _Renderer[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function get() {
|
|
13
|
+
return _Renderer[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { ComponentChildren, ComponentProps, ElementType, Renderer } from '../types';
|
|
2
|
+
type HighlightedPart = {
|
|
3
|
+
isHighlighted: boolean;
|
|
4
|
+
value: string;
|
|
5
|
+
};
|
|
6
|
+
export type HighlightClassNames = {
|
|
7
|
+
/**
|
|
8
|
+
* Class names to apply to the root element
|
|
9
|
+
*/
|
|
10
|
+
root: string;
|
|
11
|
+
/**
|
|
12
|
+
* Class names to apply to the highlighted parts
|
|
13
|
+
*/
|
|
14
|
+
highlighted: string;
|
|
15
|
+
/**
|
|
16
|
+
* Class names to apply to the non-highlighted parts
|
|
17
|
+
*/
|
|
18
|
+
nonHighlighted: string;
|
|
19
|
+
/**
|
|
20
|
+
* Class names to apply to the separator between highlighted parts
|
|
21
|
+
*/
|
|
22
|
+
separator: string;
|
|
23
|
+
};
|
|
24
|
+
export type HighlightProps = ComponentProps<'span'> & {
|
|
25
|
+
classNames?: Partial<HighlightClassNames>;
|
|
26
|
+
highlightedTagName?: ElementType;
|
|
27
|
+
nonHighlightedTagName?: ElementType;
|
|
28
|
+
separator?: ComponentChildren;
|
|
29
|
+
parts: HighlightedPart[][];
|
|
30
|
+
};
|
|
31
|
+
export declare function createHighlightComponent({ createElement, Fragment, }: Renderer): (userProps: HighlightProps) => JSX.Element;
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["parts", "highlightedTagName", "nonHighlightedTagName", "separator", "className", "classNames"];
|
|
4
|
+
import { cx } from "../lib/index.js";
|
|
5
|
+
function createHighlightPartComponent(_ref) {
|
|
6
|
+
var createElement = _ref.createElement;
|
|
7
|
+
return function HighlightPart(_ref2) {
|
|
8
|
+
var classNames = _ref2.classNames,
|
|
9
|
+
children = _ref2.children,
|
|
10
|
+
highlightedTagName = _ref2.highlightedTagName,
|
|
11
|
+
isHighlighted = _ref2.isHighlighted,
|
|
12
|
+
nonHighlightedTagName = _ref2.nonHighlightedTagName;
|
|
13
|
+
var TagName = isHighlighted ? highlightedTagName : nonHighlightedTagName;
|
|
14
|
+
return createElement(TagName, {
|
|
15
|
+
className: isHighlighted ? classNames.highlighted : classNames.nonHighlighted
|
|
16
|
+
}, children);
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export function createHighlightComponent(_ref3) {
|
|
20
|
+
var createElement = _ref3.createElement,
|
|
21
|
+
Fragment = _ref3.Fragment;
|
|
22
|
+
var HighlightPart = createHighlightPartComponent({
|
|
23
|
+
createElement: createElement,
|
|
24
|
+
Fragment: Fragment
|
|
25
|
+
});
|
|
26
|
+
return function Highlight(userProps) {
|
|
27
|
+
// Not destructured in function signature, to make sure it's not exposed in
|
|
28
|
+
// the type definition.
|
|
29
|
+
var parts = userProps.parts,
|
|
30
|
+
_userProps$highlighte = userProps.highlightedTagName,
|
|
31
|
+
highlightedTagName = _userProps$highlighte === void 0 ? 'mark' : _userProps$highlighte,
|
|
32
|
+
_userProps$nonHighlig = userProps.nonHighlightedTagName,
|
|
33
|
+
nonHighlightedTagName = _userProps$nonHighlig === void 0 ? 'span' : _userProps$nonHighlig,
|
|
34
|
+
_userProps$separator = userProps.separator,
|
|
35
|
+
separator = _userProps$separator === void 0 ? ', ' : _userProps$separator,
|
|
36
|
+
className = userProps.className,
|
|
37
|
+
_userProps$classNames = userProps.classNames,
|
|
38
|
+
classNames = _userProps$classNames === void 0 ? {} : _userProps$classNames,
|
|
39
|
+
props = _objectWithoutProperties(userProps, _excluded);
|
|
40
|
+
return createElement("span", _extends({}, props, {
|
|
41
|
+
className: cx(classNames.root, className)
|
|
42
|
+
}), parts.map(function (part, partIndex) {
|
|
43
|
+
var isLastPart = partIndex === parts.length - 1;
|
|
44
|
+
return createElement(Fragment, {
|
|
45
|
+
key: partIndex
|
|
46
|
+
}, part.map(function (subPart, subPartIndex) {
|
|
47
|
+
return createElement(HighlightPart, {
|
|
48
|
+
key: subPartIndex,
|
|
49
|
+
classNames: classNames,
|
|
50
|
+
highlightedTagName: highlightedTagName,
|
|
51
|
+
nonHighlightedTagName: nonHighlightedTagName,
|
|
52
|
+
isHighlighted: subPart.isHighlighted
|
|
53
|
+
}, subPart.value);
|
|
54
|
+
}), !isLastPart && createElement("span", {
|
|
55
|
+
className: classNames.separator
|
|
56
|
+
}, separator));
|
|
57
|
+
}));
|
|
58
|
+
};
|
|
59
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Highlight';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Highlight.js";
|
package/dist/es/index.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export function cx() {
|
|
2
|
+
for (var _len = arguments.length, classNames = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
3
|
+
classNames[_key] = arguments[_key];
|
|
4
|
+
}
|
|
5
|
+
return classNames.reduce(function (acc, className) {
|
|
6
|
+
if (Array.isArray(className)) {
|
|
7
|
+
return acc.concat(className);
|
|
8
|
+
}
|
|
9
|
+
return acc.concat([className]);
|
|
10
|
+
}, []).filter(Boolean).join(' ');
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './cx';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./cx.js";
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
declare global {
|
|
2
|
+
namespace JSX {
|
|
3
|
+
interface Element {
|
|
4
|
+
}
|
|
5
|
+
interface IntrinsicElements {
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
type IntrinsicElements = keyof JSX.IntrinsicElements extends never ? Record<string, unknown> : JSX.IntrinsicElements;
|
|
10
|
+
export type Pragma = (type: any, props: Record<string, any> | null, ...children: ComponentChildren[]) => JSX.Element;
|
|
11
|
+
export type PragmaFrag = any;
|
|
12
|
+
type ComponentChild = VNode<any> | object | string | number | boolean | null | undefined;
|
|
13
|
+
export type ComponentChildren = ComponentChild[] | ComponentChild;
|
|
14
|
+
type PropsWithChildren<TProps> = TProps & {
|
|
15
|
+
children?: ComponentChildren;
|
|
16
|
+
};
|
|
17
|
+
type FunctionComponent<TProps = Record<string, any>> = (props: PropsWithChildren<TProps>, context?: any) => JSX.Element;
|
|
18
|
+
export type ElementType<TProps = any> = {
|
|
19
|
+
[TKey in keyof IntrinsicElements]: TProps extends IntrinsicElements[TKey] ? TKey : never;
|
|
20
|
+
}[keyof IntrinsicElements] | FunctionComponent<TProps>;
|
|
21
|
+
export type ComponentProps<TComponent extends keyof IntrinsicElements> = IntrinsicElements[TComponent];
|
|
22
|
+
export type VNode<TProps = any> = {
|
|
23
|
+
type: any;
|
|
24
|
+
props: TProps & {
|
|
25
|
+
children: ComponentChildren;
|
|
26
|
+
key?: string | number | null;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
export type Renderer = {
|
|
30
|
+
/**
|
|
31
|
+
* The function to create virtual nodes.
|
|
32
|
+
*
|
|
33
|
+
* @default preact.createElement
|
|
34
|
+
*/
|
|
35
|
+
createElement: Pragma;
|
|
36
|
+
/**
|
|
37
|
+
* The component to use to create fragments.
|
|
38
|
+
*
|
|
39
|
+
* @default preact.Fragment
|
|
40
|
+
*/
|
|
41
|
+
Fragment: PragmaFrag;
|
|
42
|
+
};
|
|
43
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Renderer';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Renderer.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default '0.3.0';
|
package/package.json
CHANGED
|
@@ -1,5 +1,48 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "instantsearch-ui-components",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"description": "Common UI components for InstantSearch.",
|
|
5
|
+
"types": "dist/es/index.d.ts",
|
|
6
|
+
"main": "dist/cjs/index.js",
|
|
7
|
+
"module": "dist/es/index.js",
|
|
8
|
+
"type": "module",
|
|
9
|
+
"exports": {
|
|
10
|
+
"types": "./dist/es/index.d.ts",
|
|
11
|
+
"require": "./dist/cjs/index.js",
|
|
12
|
+
"default": "./dist/es/index.js"
|
|
13
|
+
},
|
|
14
|
+
"sideEffects": false,
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "https://github.com/algolia/instantsearch"
|
|
19
|
+
},
|
|
20
|
+
"author": {
|
|
21
|
+
"name": "Algolia, Inc.",
|
|
22
|
+
"url": "https://www.algolia.com"
|
|
23
|
+
},
|
|
24
|
+
"keywords": [
|
|
25
|
+
"algolia",
|
|
26
|
+
"components",
|
|
27
|
+
"fast",
|
|
28
|
+
"instantsearch",
|
|
29
|
+
"react",
|
|
30
|
+
"search",
|
|
31
|
+
"jsx",
|
|
32
|
+
"vdom",
|
|
33
|
+
"hyperscript"
|
|
34
|
+
],
|
|
35
|
+
"files": [
|
|
36
|
+
"README.md",
|
|
37
|
+
"dist"
|
|
38
|
+
],
|
|
39
|
+
"scripts": {
|
|
40
|
+
"clean": "rm -rf dist",
|
|
41
|
+
"build": "yarn build:cjs && yarn build:es && yarn build:types",
|
|
42
|
+
"build:es": "BABEL_ENV=es babel src --root-mode upward --extensions '.js,.ts,.tsx' --out-dir dist/es --ignore '**/__tests__/**/*','**/__mocks__/**/*' --quiet",
|
|
43
|
+
"build:cjs": "BABEL_ENV=cjs babel src --root-mode upward --extensions '.js,.ts,.tsx' --out-dir dist/cjs --ignore '**/__tests__/**/*','**/__mocks__/**/*' --quiet && ../../scripts/prepare-cjs.sh",
|
|
44
|
+
"build:types": "tsc -p ./tsconfig.declaration.json --outDir ./dist/es",
|
|
45
|
+
"version": "./scripts/version.cjs"
|
|
46
|
+
},
|
|
47
|
+
"gitHead": "084aff3d29e15cea8125076c46fb753c83d4dcad"
|
|
5
48
|
}
|