@synerise/ds-icon-picker 1.6.15 → 1.6.17
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/CHANGELOG.md +8 -0
- package/dist/IconPicker.const.js +6 -2
- package/dist/IconPicker.d.ts +2 -2
- package/dist/IconPicker.js +55 -96
- package/dist/IconPicker.styles.d.ts +14 -14
- package/dist/IconPicker.styles.js +41 -44
- package/dist/IconPicker.types.d.ts +3 -3
- package/dist/IconPicker.types.js +1 -1
- package/dist/_virtual/preload-helper.js +57 -0
- package/dist/components/List/List.d.ts +2 -2
- package/dist/components/List/List.js +33 -44
- package/dist/components/ListItem/ListItem.d.ts +3 -3
- package/dist/components/ListItem/ListItem.js +16 -29
- package/dist/components/ListItem/ListItem.types.d.ts +1 -1
- package/dist/components/ListItem/ListItem.types.js +1 -1
- package/dist/components/Overlay/Overlay.d.ts +3 -3
- package/dist/components/Overlay/Overlay.js +23 -31
- package/dist/components/Overlay/Overlay.types.d.ts +1 -1
- package/dist/components/Overlay/Overlay.types.js +1 -1
- package/dist/components/RowItem.d.ts +2 -2
- package/dist/components/RowItem.js +25 -28
- package/dist/hooks/useGroupItems.d.ts +1 -1
- package/dist/hooks/useGroupItems.js +19 -14
- package/dist/hooks/useIconSourceLoader.d.ts +1 -1
- package/dist/hooks/useIconSourceLoader.js +51 -91
- package/dist/index.js +4 -1
- package/dist/modules.d.js +1 -1
- package/dist/modules.d.ts +0 -0
- package/dist/utils/createItemData.d.ts +1 -1
- package/dist/utils/createItemData.js +10 -9
- package/dist/utils/loadFontAwesome.d.ts +5 -5
- package/dist/utils/loadFontAwesome.js +35 -38
- package/dist/utils/matchesSearchQuery.js +5 -2
- package/dist/utils/prepareItems.d.ts +1 -1
- package/dist/utils/prepareItems.js +14 -12
- package/dist/utils/typeguards.utils.d.ts +1 -1
- package/dist/utils/typeguards.utils.js +14 -8
- package/package.json +12 -12
|
@@ -1,32 +1,24 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { useTheme } from
|
|
3
|
-
import Dropdown from
|
|
4
|
-
import Icon, { SearchM } from
|
|
5
|
-
import List from
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
onClearInput:
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
color: theme.palette['grey-600']
|
|
25
|
-
})
|
|
26
|
-
}), /*#__PURE__*/React.createElement(List, {
|
|
27
|
-
onSelect: onSelect,
|
|
28
|
-
data: data,
|
|
29
|
-
noResultMsg: noResultMsg
|
|
30
|
-
}));
|
|
1
|
+
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useTheme } from "@synerise/ds-core";
|
|
3
|
+
import Dropdown from "@synerise/ds-dropdown";
|
|
4
|
+
import Icon, { SearchM } from "@synerise/ds-icon";
|
|
5
|
+
import List from "../List/List.js";
|
|
6
|
+
const Overlay = ({
|
|
7
|
+
value,
|
|
8
|
+
onSearchChange,
|
|
9
|
+
onClearInput,
|
|
10
|
+
placeholder,
|
|
11
|
+
onSelect,
|
|
12
|
+
data,
|
|
13
|
+
focus,
|
|
14
|
+
noResultMsg
|
|
15
|
+
}) => {
|
|
16
|
+
const theme = useTheme();
|
|
17
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
18
|
+
/* @__PURE__ */ jsx(Dropdown.SearchInput, { onSearchChange, onClearInput, placeholder, value, autofocus: focus, iconLeft: /* @__PURE__ */ jsx(Icon, { component: /* @__PURE__ */ jsx(SearchM, {}), color: theme.palette["grey-600"] }) }),
|
|
19
|
+
/* @__PURE__ */ jsx(List, { onSelect, data, noResultMsg })
|
|
20
|
+
] });
|
|
21
|
+
};
|
|
22
|
+
export {
|
|
23
|
+
Overlay as default
|
|
31
24
|
};
|
|
32
|
-
export default Overlay;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { FilterElement, IconPickerProps, SelectItemHandler, SourceType, ValueTypeForSource } from '../../IconPicker.types';
|
|
2
2
|
export type OverlayType<Source extends SourceType> = Pick<IconPickerProps<Source>, 'noResultMsg' | 'placeholder'> & {
|
|
3
3
|
value: string;
|
|
4
4
|
data: FilterElement<ValueTypeForSource<Source>>[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import React,
|
|
2
|
-
import {
|
|
1
|
+
import { default as React, ReactElement } from 'react';
|
|
2
|
+
import { RowItemProps, SourceType } from '../IconPicker.types';
|
|
3
3
|
export declare const RowItem: React.MemoExoticComponent<(<Source extends SourceType>({ data, index, style, }: RowItemProps<Source>) => ReactElement)>;
|
|
@@ -1,28 +1,25 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
return
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
});
|
|
27
|
-
})));
|
|
28
|
-
}, areEqual);
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { memo } from "react";
|
|
3
|
+
import { areEqual } from "react-window";
|
|
4
|
+
import { ListRow, Title } from "../IconPicker.styles.js";
|
|
5
|
+
import { isCategories } from "../utils/typeguards.utils.js";
|
|
6
|
+
import ListItem from "./ListItem/ListItem.js";
|
|
7
|
+
const RowItem = memo(({
|
|
8
|
+
data,
|
|
9
|
+
index,
|
|
10
|
+
style
|
|
11
|
+
}) => {
|
|
12
|
+
const {
|
|
13
|
+
elementSize,
|
|
14
|
+
itemsPerRow,
|
|
15
|
+
onSelect,
|
|
16
|
+
items
|
|
17
|
+
} = data;
|
|
18
|
+
const rowItems = items[index];
|
|
19
|
+
return /* @__PURE__ */ jsx("div", { style, children: /* @__PURE__ */ jsx(ListRow, { children: isCategories(rowItems) ? /* @__PURE__ */ jsx(Title, { elementSize: `${elementSize}px`, children: rowItems[0].category }) : rowItems.map((item, i) => {
|
|
20
|
+
return /* @__PURE__ */ jsx(ListItem, { element: item, itemsPerRow, onSelect, index: i }, i);
|
|
21
|
+
}) }) });
|
|
22
|
+
}, areEqual);
|
|
23
|
+
export {
|
|
24
|
+
RowItem
|
|
25
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FilterElement, GroupedFilterElement, SourceType, ValueTypeForSource } from '../IconPicker.types';
|
|
2
2
|
export declare const useGroupItems: <Source extends SourceType>(data: FilterElement<ValueTypeForSource<Source>>[], itemsPerRow: number) => GroupedFilterElement<Source>[];
|
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
import { useMemo } from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
return data.reduce(
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { useMemo } from "react";
|
|
2
|
+
const useGroupItems = (data, itemsPerRow) => {
|
|
3
|
+
const groupedData = useMemo(() => {
|
|
4
|
+
return data.reduce((flatItemsAndCategories, group) => {
|
|
5
|
+
const {
|
|
6
|
+
category,
|
|
7
|
+
items
|
|
8
|
+
} = group;
|
|
7
9
|
flatItemsAndCategories.push([{
|
|
8
|
-
category
|
|
10
|
+
category
|
|
9
11
|
}]);
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
for (
|
|
13
|
-
|
|
14
|
-
for (
|
|
15
|
-
|
|
12
|
+
const groupItemsLength = items.length;
|
|
13
|
+
const rowCount = Math.ceil(groupItemsLength / itemsPerRow);
|
|
14
|
+
for (let i = 0; i < rowCount; i += 1) {
|
|
15
|
+
const rowItems = [];
|
|
16
|
+
for (let j = 0; j < itemsPerRow; j += 1) {
|
|
17
|
+
const idx = itemsPerRow * i + j;
|
|
16
18
|
if (idx < groupItemsLength) {
|
|
17
19
|
rowItems.push(items[idx]);
|
|
18
20
|
}
|
|
@@ -23,4 +25,7 @@ export var useGroupItems = function useGroupItems(data, itemsPerRow) {
|
|
|
23
25
|
}, []);
|
|
24
26
|
}, [data, itemsPerRow]);
|
|
25
27
|
return groupedData;
|
|
26
|
-
};
|
|
28
|
+
};
|
|
29
|
+
export {
|
|
30
|
+
useGroupItems
|
|
31
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FilterElement, SourceType, ValueTypeForSource } from '../IconPicker.types';
|
|
2
2
|
export declare const useIconSourceLoader: <Source extends SourceType>(data: SourceType) => FilterElement<ValueTypeForSource<Source>>[];
|
|
@@ -1,96 +1,53 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export var useIconSourceLoader = function useIconSourceLoader(data) {
|
|
12
|
-
var _useState = useState([]),
|
|
13
|
-
items = _useState[0],
|
|
14
|
-
setItems = _useState[1];
|
|
15
|
-
var loadedItems = useCallback(function () {
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useCallback } from "react";
|
|
3
|
+
import Icon from "@synerise/ds-icon";
|
|
4
|
+
import * as medium from "@synerise/ds-icon/dist/icons/M";
|
|
5
|
+
import { loadFontAwesome } from "../utils/loadFontAwesome.js";
|
|
6
|
+
import { prepareItems } from "../utils/prepareItems.js";
|
|
7
|
+
import { isDSSourceType, isFASourceType } from "../utils/typeguards.utils.js";
|
|
8
|
+
const useIconSourceLoader = (data) => {
|
|
9
|
+
const [items, setItems] = useState([]);
|
|
10
|
+
const loadedItems = useCallback(() => {
|
|
16
11
|
if (!items.length) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
keywords: iconData.iconName,
|
|
49
|
-
item: /*#__PURE__*/React.createElement(FontAwesomeIcon, {
|
|
50
|
-
icon: icon(iconData),
|
|
51
|
-
key: iconData.iconName
|
|
52
|
-
}),
|
|
53
|
-
value: [iconData.prefix, iconData.iconName]
|
|
54
|
-
};
|
|
55
|
-
})
|
|
56
|
-
}, {
|
|
57
|
-
category: 'Regular',
|
|
58
|
-
items: Object.values(far).map(function (iconData) {
|
|
59
|
-
return {
|
|
60
|
-
keywords: iconData.iconName,
|
|
61
|
-
item: /*#__PURE__*/React.createElement(FontAwesomeIcon, {
|
|
62
|
-
icon: icon(iconData),
|
|
63
|
-
key: iconData.iconName
|
|
64
|
-
}),
|
|
65
|
-
value: [iconData.prefix, iconData.iconName]
|
|
66
|
-
};
|
|
67
|
-
})
|
|
68
|
-
}]);
|
|
69
|
-
case 2:
|
|
70
|
-
return _context.a(2);
|
|
71
|
-
}
|
|
72
|
-
}, _callee);
|
|
73
|
-
}));
|
|
74
|
-
return function loadFAIcons() {
|
|
75
|
-
return _ref.apply(this, arguments);
|
|
76
|
-
};
|
|
77
|
-
}();
|
|
12
|
+
const loadFAIcons = async () => {
|
|
13
|
+
const {
|
|
14
|
+
fas,
|
|
15
|
+
fab,
|
|
16
|
+
far,
|
|
17
|
+
icon,
|
|
18
|
+
FontAwesomeIcon
|
|
19
|
+
} = await loadFontAwesome();
|
|
20
|
+
setItems([{
|
|
21
|
+
category: "Solid",
|
|
22
|
+
items: Object.values(fas).map((iconData) => ({
|
|
23
|
+
keywords: iconData.iconName,
|
|
24
|
+
item: /* @__PURE__ */ jsx(FontAwesomeIcon, { icon: icon(iconData) }, iconData.iconName),
|
|
25
|
+
value: [iconData.prefix, iconData.iconName]
|
|
26
|
+
}))
|
|
27
|
+
}, {
|
|
28
|
+
category: "Brands",
|
|
29
|
+
items: Object.values(fab).map((iconData) => ({
|
|
30
|
+
keywords: iconData.iconName,
|
|
31
|
+
item: /* @__PURE__ */ jsx(FontAwesomeIcon, { icon: icon(iconData) }, iconData.iconName),
|
|
32
|
+
value: [iconData.prefix, iconData.iconName]
|
|
33
|
+
}))
|
|
34
|
+
}, {
|
|
35
|
+
category: "Regular",
|
|
36
|
+
items: Object.values(far).map((iconData) => ({
|
|
37
|
+
keywords: iconData.iconName,
|
|
38
|
+
item: /* @__PURE__ */ jsx(FontAwesomeIcon, { icon: icon(iconData) }, iconData.iconName),
|
|
39
|
+
value: [iconData.prefix, iconData.iconName]
|
|
40
|
+
}))
|
|
41
|
+
}]);
|
|
42
|
+
};
|
|
78
43
|
if (isDSSourceType(data)) {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
item: /*#__PURE__*/React.createElement(Icon, {
|
|
85
|
-
component: /*#__PURE__*/React.createElement(Component, null)
|
|
86
|
-
}),
|
|
87
|
-
value: /*#__PURE__*/React.createElement(Icon, {
|
|
88
|
-
component: /*#__PURE__*/React.createElement(Component, null)
|
|
89
|
-
})
|
|
90
|
-
};
|
|
91
|
-
});
|
|
44
|
+
const iconItems = Object.entries(medium).map(([name, Component]) => ({
|
|
45
|
+
keywords: name,
|
|
46
|
+
item: /* @__PURE__ */ jsx(Icon, { component: /* @__PURE__ */ jsx(Component, {}) }),
|
|
47
|
+
value: /* @__PURE__ */ jsx(Icon, { component: /* @__PURE__ */ jsx(Component, {}) })
|
|
48
|
+
}));
|
|
92
49
|
setItems([{
|
|
93
|
-
category:
|
|
50
|
+
category: "DS Icons",
|
|
94
51
|
items: iconItems
|
|
95
52
|
}]);
|
|
96
53
|
return;
|
|
@@ -104,4 +61,7 @@ export var useIconSourceLoader = function useIconSourceLoader(data) {
|
|
|
104
61
|
}, [data, items.length]);
|
|
105
62
|
loadedItems();
|
|
106
63
|
return items;
|
|
107
|
-
};
|
|
64
|
+
};
|
|
65
|
+
export {
|
|
66
|
+
useIconSourceLoader
|
|
67
|
+
};
|
package/dist/index.js
CHANGED
package/dist/modules.d.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "@testing-library/jest-dom";
|
|
File without changes
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ListItemData, SourceType } from '../IconPicker.types';
|
|
2
2
|
export declare const createItemData: <Source extends SourceType>(items: ListItemData<Source>["items"], elementSize: ListItemData<Source>["elementSize"], onSelect: ListItemData<Source>["onSelect"], itemsPerRow: ListItemData<Source>["itemsPerRow"]) => ListItemData<Source>;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import memoize from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import memoize from "memoize-one";
|
|
2
|
+
const createItemData = memoize((items, elementSize, onSelect, itemsPerRow) => ({
|
|
3
|
+
items,
|
|
4
|
+
elementSize,
|
|
5
|
+
onSelect,
|
|
6
|
+
itemsPerRow
|
|
7
|
+
}));
|
|
8
|
+
export {
|
|
9
|
+
createItemData
|
|
10
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare const loadFontAwesome: () => Promise<{
|
|
2
|
-
fas: import(
|
|
3
|
-
icon: typeof import(
|
|
4
|
-
fab: import(
|
|
5
|
-
far: import(
|
|
6
|
-
FontAwesomeIcon: typeof import(
|
|
2
|
+
fas: import('@fortawesome/fontawesome-svg-core').IconPack;
|
|
3
|
+
icon: typeof import('@fortawesome/fontawesome-svg-core').icon;
|
|
4
|
+
fab: import('@fortawesome/fontawesome-svg-core').IconPack;
|
|
5
|
+
far: import('@fortawesome/fontawesome-svg-core').IconPack;
|
|
6
|
+
FontAwesomeIcon: typeof import('@fortawesome/react-fontawesome').FontAwesomeIcon;
|
|
7
7
|
}>;
|
|
@@ -1,39 +1,36 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
}, _callee);
|
|
35
|
-
}));
|
|
36
|
-
return function loadFontAwesome() {
|
|
37
|
-
return _ref.apply(this, arguments);
|
|
1
|
+
import { __vitePreload } from "../_virtual/preload-helper.js";
|
|
2
|
+
const loadFontAwesome = async () => {
|
|
3
|
+
const core = __vitePreload(() => import("@fortawesome/fontawesome-svg-core"), true ? [] : void 0);
|
|
4
|
+
const solid = __vitePreload(() => import("@fortawesome/free-solid-svg-icons"), true ? [] : void 0);
|
|
5
|
+
const brands = __vitePreload(() => import("@fortawesome/free-brands-svg-icons"), true ? [] : void 0);
|
|
6
|
+
const regular = __vitePreload(() => import("@fortawesome/free-regular-svg-icons"), true ? [] : void 0);
|
|
7
|
+
const component = __vitePreload(() => import("@fortawesome/react-fontawesome"), true ? [] : void 0);
|
|
8
|
+
const loaded = await Promise.all([core, solid, brands, regular, component]);
|
|
9
|
+
const {
|
|
10
|
+
library,
|
|
11
|
+
icon
|
|
12
|
+
} = loaded[0];
|
|
13
|
+
const {
|
|
14
|
+
fas
|
|
15
|
+
} = loaded[1];
|
|
16
|
+
const {
|
|
17
|
+
fab
|
|
18
|
+
} = loaded[2];
|
|
19
|
+
const {
|
|
20
|
+
far
|
|
21
|
+
} = loaded[3];
|
|
22
|
+
const {
|
|
23
|
+
FontAwesomeIcon
|
|
24
|
+
} = loaded[4];
|
|
25
|
+
library.add(fas, fab, far);
|
|
26
|
+
return {
|
|
27
|
+
fas,
|
|
28
|
+
icon,
|
|
29
|
+
fab,
|
|
30
|
+
far,
|
|
31
|
+
FontAwesomeIcon
|
|
38
32
|
};
|
|
39
|
-
}
|
|
33
|
+
};
|
|
34
|
+
export {
|
|
35
|
+
loadFontAwesome
|
|
36
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DataSource, FilterElement, ValueTypeForSource } from '../IconPicker.types';
|
|
2
2
|
export declare const prepareItems: (data: DataSource[]) => FilterElement<ValueTypeForSource<DataSource[]>>[];
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
const prepareItems = (data) => {
|
|
2
|
+
return data.map((group) => ({
|
|
3
|
+
...group,
|
|
4
|
+
items: group.items.map((item) => {
|
|
5
|
+
return {
|
|
6
|
+
...item,
|
|
7
|
+
value: item.value === void 0 ? item.item : item.value
|
|
8
|
+
};
|
|
9
|
+
})
|
|
10
|
+
}));
|
|
11
|
+
};
|
|
12
|
+
export {
|
|
13
|
+
prepareItems
|
|
14
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Category, DSSource, DataSource, FASource, GroupedFilterElement, SourceType } from '../IconPicker.types';
|
|
2
2
|
export declare const isFASourceType: (data: SourceType) => data is FASource;
|
|
3
3
|
export declare const isDSSourceType: (data: SourceType) => data is DSSource;
|
|
4
4
|
export declare const isData: (data: SourceType) => data is DataSource[];
|
|
@@ -1,12 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
return data ===
|
|
1
|
+
const isFASourceType = (data) => {
|
|
2
|
+
return data === "font-awesome";
|
|
3
3
|
};
|
|
4
|
-
|
|
5
|
-
return data ===
|
|
4
|
+
const isDSSourceType = (data) => {
|
|
5
|
+
return data === "design-system";
|
|
6
6
|
};
|
|
7
|
-
|
|
7
|
+
const isData = (data) => {
|
|
8
8
|
return Array.isArray(data);
|
|
9
9
|
};
|
|
10
|
-
|
|
11
|
-
return !!(
|
|
12
|
-
};
|
|
10
|
+
const isCategories = (element) => {
|
|
11
|
+
return !!("category" in element[0] && element[0].category);
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
isCategories,
|
|
15
|
+
isDSSourceType,
|
|
16
|
+
isData,
|
|
17
|
+
isFASourceType
|
|
18
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-icon-picker",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.17",
|
|
4
4
|
"description": "IconPicker UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -16,10 +16,10 @@
|
|
|
16
16
|
"access": "public"
|
|
17
17
|
},
|
|
18
18
|
"scripts": {
|
|
19
|
-
"build": "
|
|
19
|
+
"build": "vite build",
|
|
20
20
|
"build:css": "node ../../../scripts/style/less.js",
|
|
21
21
|
"build:js": "babel --delete-dir-on-start --root-mode upward src --out-dir dist --extensions '.js,.ts,.tsx'",
|
|
22
|
-
"build:watch": "
|
|
22
|
+
"build:watch": "vite build --watch",
|
|
23
23
|
"defs": "tsc --declaration --outDir dist/ --emitDeclarationOnly",
|
|
24
24
|
"pack:ci": "pnpm pack --pack-destination ../../storybook/storybook-static/static",
|
|
25
25
|
"prepublish": "pnpm run build",
|
|
@@ -32,14 +32,14 @@
|
|
|
32
32
|
"sideEffects": false,
|
|
33
33
|
"types": "dist/index.d.ts",
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@synerise/ds-button": "^1.5.
|
|
36
|
-
"@synerise/ds-button-group": "^1.1.
|
|
37
|
-
"@synerise/ds-dropdown": "^1.3.
|
|
38
|
-
"@synerise/ds-icon": "^1.15.
|
|
39
|
-
"@synerise/ds-popover": "^1.5.
|
|
40
|
-
"@synerise/ds-scrollbar": "^1.2.
|
|
41
|
-
"@synerise/ds-tooltip": "^1.4.
|
|
42
|
-
"@synerise/ds-utils": "^1.7.
|
|
35
|
+
"@synerise/ds-button": "^1.5.19",
|
|
36
|
+
"@synerise/ds-button-group": "^1.1.44",
|
|
37
|
+
"@synerise/ds-dropdown": "^1.3.3",
|
|
38
|
+
"@synerise/ds-icon": "^1.15.2",
|
|
39
|
+
"@synerise/ds-popover": "^1.5.3",
|
|
40
|
+
"@synerise/ds-scrollbar": "^1.2.18",
|
|
41
|
+
"@synerise/ds-tooltip": "^1.4.11",
|
|
42
|
+
"@synerise/ds-utils": "^1.7.1",
|
|
43
43
|
"memoize-one": "^5.1.1",
|
|
44
44
|
"react-window": "^1.8.11"
|
|
45
45
|
},
|
|
@@ -54,5 +54,5 @@
|
|
|
54
54
|
"react-intl": ">=3.12.0 <= 6.8",
|
|
55
55
|
"styled-components": "^5.3.3"
|
|
56
56
|
},
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "c2384982c3533a31eb5e5e0408f8dcecb2b0f399"
|
|
58
58
|
}
|