@redocly/theme 0.40.5 → 0.41.0-rc.1
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/lib/components/Dropdown/DropdownMenu.d.ts +2 -0
- package/lib/components/Dropdown/DropdownMenu.js +3 -1
- package/lib/components/Loaders/SpinnerLoader.d.ts +5 -0
- package/lib/components/Loaders/SpinnerLoader.js +32 -0
- package/lib/components/Search/FilterFields/SearchFilterFieldSelect.d.ts +12 -0
- package/lib/components/Search/FilterFields/SearchFilterFieldSelect.js +113 -0
- package/lib/components/Search/FilterFields/SearchFilterFieldTags.d.ts +10 -0
- package/lib/components/Search/FilterFields/SearchFilterFieldTags.js +37 -0
- package/lib/components/Search/Search.js +1 -1
- package/lib/components/Search/SearchDialog.js +103 -26
- package/lib/components/Search/SearchFilter.d.ts +11 -0
- package/lib/components/Search/SearchFilter.js +71 -0
- package/lib/components/Search/SearchFilterField.d.ts +11 -0
- package/lib/components/Search/SearchFilterField.js +43 -0
- package/lib/components/Search/SearchGroups.d.ts +9 -0
- package/lib/components/Search/SearchGroups.js +69 -0
- package/lib/components/Search/SearchHighlight.d.ts +1 -1
- package/lib/components/Search/SearchHighlight.js +28 -5
- package/lib/components/Search/SearchInput.d.ts +3 -2
- package/lib/components/Search/SearchInput.js +11 -3
- package/lib/components/Search/SearchItem.d.ts +2 -2
- package/lib/components/Search/SearchItem.js +23 -15
- package/lib/components/Search/variables.js +48 -2
- package/lib/components/Segmented/Segmented.d.ts +2 -5
- package/lib/components/Select/Select.d.ts +2 -36
- package/lib/components/Select/Select.js +110 -98
- package/lib/components/Select/SelectInput.d.ts +22 -0
- package/lib/components/Select/SelectInput.js +118 -0
- package/lib/components/Select/variables.js +11 -1
- package/lib/components/Tag/Tag.d.ts +4 -2
- package/lib/components/Tag/Tag.js +40 -4
- package/lib/components/Tag/variables.dark.js +20 -5
- package/lib/components/Tag/variables.js +49 -17
- package/lib/components/VersionPicker/VersionPicker.d.ts +2 -3
- package/lib/components/VersionPicker/VersionPicker.js +13 -30
- package/lib/core/hooks/__mocks__/index.d.ts +1 -1
- package/lib/core/hooks/__mocks__/index.js +1 -1
- package/lib/core/hooks/__mocks__/use-theme-hooks.d.ts +1 -1
- package/lib/core/hooks/__mocks__/use-theme-hooks.js +1 -1
- package/lib/core/hooks/index.d.ts +2 -1
- package/lib/core/hooks/index.js +2 -1
- package/lib/core/hooks/search/use-recent-searches.js +2 -0
- package/lib/core/hooks/{use-search.d.ts → search/use-search-dialog.d.ts} +1 -1
- package/lib/core/hooks/{use-search.js → search/use-search-dialog.js} +5 -5
- package/lib/core/hooks/search/use-search-filter.d.ts +9 -0
- package/lib/core/hooks/search/use-search-filter.js +50 -0
- package/lib/core/types/hooks.d.ts +16 -4
- package/lib/core/types/index.d.ts +1 -1
- package/lib/core/types/index.js +1 -1
- package/lib/core/types/l10n.d.ts +1 -1
- package/lib/core/types/search.d.ts +43 -2
- package/lib/core/types/select.d.ts +29 -0
- package/lib/core/types/{select-option.js → select.js} +1 -1
- package/lib/icons/ResetIcon/ResetIcon.d.ts +9 -0
- package/lib/icons/ResetIcon/ResetIcon.js +22 -0
- package/lib/icons/SettingsIcon/SettingsIcon.d.ts +9 -0
- package/lib/icons/SettingsIcon/SettingsIcon.js +23 -0
- package/lib/index.d.ts +7 -1
- package/lib/index.js +7 -1
- package/package.json +2 -2
- package/src/components/Dropdown/DropdownMenu.tsx +2 -1
- package/src/components/Filter/FilterSelect.tsx +3 -3
- package/src/components/Loaders/SpinnerLoader.tsx +31 -0
- package/src/components/Search/FilterFields/SearchFilterFieldSelect.tsx +134 -0
- package/src/components/Search/FilterFields/SearchFilterFieldTags.tsx +61 -0
- package/src/components/Search/Search.tsx +2 -2
- package/src/components/Search/SearchDialog.tsx +168 -42
- package/src/components/Search/SearchFilter.tsx +90 -0
- package/src/components/Search/SearchFilterField.tsx +84 -0
- package/src/components/Search/SearchGroups.tsx +80 -0
- package/src/components/Search/SearchHighlight.tsx +29 -2
- package/src/components/Search/SearchInput.tsx +17 -3
- package/src/components/Search/SearchItem.tsx +38 -24
- package/src/components/Search/variables.ts +48 -2
- package/src/components/Segmented/Segmented.tsx +2 -2
- package/src/components/Select/Select.tsx +170 -157
- package/src/components/Select/SelectInput.tsx +184 -0
- package/src/components/Select/variables.ts +11 -1
- package/src/components/Tag/Tag.tsx +57 -6
- package/src/components/Tag/variables.dark.ts +20 -5
- package/src/components/Tag/variables.ts +49 -17
- package/src/components/VersionPicker/VersionPicker.tsx +15 -39
- package/src/core/hooks/__mocks__/index.ts +1 -1
- package/src/core/hooks/__mocks__/use-theme-hooks.ts +1 -1
- package/src/core/hooks/index.ts +2 -1
- package/src/core/hooks/search/use-recent-searches.ts +3 -0
- package/src/core/hooks/{use-search.ts → search/use-search-dialog.ts} +1 -1
- package/src/core/hooks/search/use-search-filter.ts +57 -0
- package/src/core/types/hooks.ts +24 -4
- package/src/core/types/index.ts +1 -1
- package/src/core/types/l10n.ts +7 -1
- package/src/core/types/search.ts +54 -2
- package/src/core/types/select.ts +31 -0
- package/src/icons/ResetIcon/ResetIcon.tsx +26 -0
- package/src/icons/SettingsIcon/SettingsIcon.tsx +30 -0
- package/src/index.ts +7 -1
- package/lib/core/types/select-option.d.ts +0 -4
- package/src/core/types/select-option.ts +0 -4
- /package/lib/components/{Loading → Loaders}/Loading.d.ts +0 -0
- /package/lib/components/{Loading → Loaders}/Loading.js +0 -0
- /package/src/components/{Loading → Loaders}/Loading.tsx +0 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
|
|
3
|
+
export type SelectOption<T> = {
|
|
4
|
+
value: T;
|
|
5
|
+
element?: React.ReactNode | JSX.Element | string;
|
|
6
|
+
label?: string;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export type SelectProps<T = any> = {
|
|
10
|
+
value?: SelectOption<T> | SelectOption<T>[] | T | T[];
|
|
11
|
+
options: SelectOption<T>[];
|
|
12
|
+
multiple?: boolean;
|
|
13
|
+
searchable?: boolean;
|
|
14
|
+
dataAttributes?: Record<string, string>;
|
|
15
|
+
className?: string;
|
|
16
|
+
withArrow?: boolean;
|
|
17
|
+
triggerEvent?: 'click' | 'hover';
|
|
18
|
+
placement?: 'top' | 'bottom';
|
|
19
|
+
alignment?: 'start' | 'end';
|
|
20
|
+
onlyIcon?: boolean;
|
|
21
|
+
placeholder?: string;
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
hideCheckmarkIcon?: boolean;
|
|
24
|
+
dataTestId?: string;
|
|
25
|
+
icon?: React.ReactNode;
|
|
26
|
+
footer?: React.ReactNode;
|
|
27
|
+
onChange?: (value: T | T[]) => void;
|
|
28
|
+
renderInput?: () => React.ReactElement;
|
|
29
|
+
renderDivider?: () => React.ReactElement;
|
|
30
|
+
onSearch?: (value: T | null) => void;
|
|
31
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
|
|
4
|
+
import type { IconProps } from '@redocly/theme/icons/types';
|
|
5
|
+
|
|
6
|
+
import { getCssColorVariable } from '@redocly/theme/core/utils';
|
|
7
|
+
|
|
8
|
+
const Icon = (props: IconProps) => (
|
|
9
|
+
<svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" {...props}>
|
|
10
|
+
<path
|
|
11
|
+
d="M9 14C10.1867 14 11.3467 13.6481 12.3334 12.9888C13.3201 12.3295 14.0892 11.3925 14.5433 10.2961C14.9974 9.19975 15.1162 7.99335 14.8847 6.82946C14.6532 5.66558 14.0818 4.59648 13.2426 3.75736C12.4035 2.91825 11.3344 2.3468 10.1705 2.11529C9.00666 1.88378 7.80026 2.0026 6.7039 2.45673C5.60754 2.91085 4.67047 3.67989 4.01118 4.66658C3.35189 5.65328 3 6.81331 3 8V11.1L1.2 9.3L0.5 10L3.5 13L6.5 10L5.8 9.3L4 11.1V8C4 7.0111 4.29324 6.0444 4.84265 5.22215C5.39206 4.39991 6.17295 3.75904 7.08658 3.38061C8.00021 3.00217 9.00555 2.90315 9.97545 3.09608C10.9454 3.289 11.8363 3.76521 12.5355 4.46447C13.2348 5.16373 13.711 6.05465 13.9039 7.02455C14.0969 7.99446 13.9978 8.99979 13.6194 9.91342C13.241 10.8271 12.6001 11.6079 11.7779 12.1574C10.9556 12.7068 9.98891 13 9 13V14Z"
|
|
12
|
+
fill="#1A1C21"
|
|
13
|
+
/>
|
|
14
|
+
</svg>
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
export const ResetIcon = styled(Icon).attrs(() => ({
|
|
18
|
+
'data-component-name': 'icons/ResetIcon/ResetIcon',
|
|
19
|
+
}))<IconProps>`
|
|
20
|
+
path {
|
|
21
|
+
fill: ${({ color }) => getCssColorVariable(color)};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
height: ${({ size }) => size || '16px'};
|
|
25
|
+
width: ${({ size }) => size || '16px'};
|
|
26
|
+
`;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
|
|
4
|
+
import type { IconProps } from '@redocly/theme/icons/types';
|
|
5
|
+
|
|
6
|
+
import { getCssColorVariable } from '@redocly/theme/core/utils';
|
|
7
|
+
|
|
8
|
+
const Icon = (props: IconProps) => (
|
|
9
|
+
<svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" {...props}>
|
|
10
|
+
<path
|
|
11
|
+
d="M15.875 2.5H13.5687C13.2875 1.20625 12.1625 0.25 10.8125 0.25C9.4625 0.25 8.3375 1.20625 8.05625 2.5H0.125V3.625H8.05625C8.3375 4.91875 9.4625 5.875 10.8125 5.875C12.1625 5.875 13.2875 4.91875 13.5687 3.625H15.875V2.5ZM10.8125 4.75C9.85625 4.75 9.125 4.01875 9.125 3.0625C9.125 2.10625 9.85625 1.375 10.8125 1.375C11.7688 1.375 12.5 2.10625 12.5 3.0625C12.5 4.01875 11.7688 4.75 10.8125 4.75Z"
|
|
12
|
+
fill="#22242B"
|
|
13
|
+
/>
|
|
14
|
+
<path
|
|
15
|
+
d="M0.125 11.5H2.43125C2.7125 12.7937 3.8375 13.75 5.1875 13.75C6.5375 13.75 7.6625 12.7937 7.94375 11.5H15.875V10.375H7.94375C7.6625 9.08125 6.5375 8.125 5.1875 8.125C3.8375 8.125 2.7125 9.08125 2.43125 10.375H0.125V11.5ZM5.1875 9.25C6.14375 9.25 6.875 9.98125 6.875 10.9375C6.875 11.8938 6.14375 12.625 5.1875 12.625C4.23125 12.625 3.5 11.8938 3.5 10.9375C3.5 9.98125 4.23125 9.25 5.1875 9.25Z"
|
|
16
|
+
fill="#22242B"
|
|
17
|
+
/>
|
|
18
|
+
</svg>
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
export const SettingsIcon = styled(Icon).attrs(() => ({
|
|
22
|
+
'data-component-name': 'icons/SettingsIcon/SettingsIcon',
|
|
23
|
+
}))<IconProps>`
|
|
24
|
+
path {
|
|
25
|
+
fill: ${({ color }) => getCssColorVariable(color)};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
height: ${({ size }) => size || '16px'};
|
|
29
|
+
width: ${({ size }) => size || '16px'};
|
|
30
|
+
`;
|
package/src/index.ts
CHANGED
|
@@ -13,7 +13,7 @@ export * from '@redocly/theme/components/Badge/Badge';
|
|
|
13
13
|
export * from '@redocly/theme/components/Dropdown/Dropdown';
|
|
14
14
|
export * from '@redocly/theme/components/Dropdown/DropdownMenu';
|
|
15
15
|
export * from '@redocly/theme/components/Dropdown/DropdownMenuItem';
|
|
16
|
-
export * from '@redocly/theme/components/
|
|
16
|
+
export * from '@redocly/theme/components/Loaders/Loading';
|
|
17
17
|
export * from '@redocly/theme/components/Link/Link';
|
|
18
18
|
export * from '@redocly/theme/components/Portal/Portal';
|
|
19
19
|
export * from '@redocly/theme/components/Segmented/Segmented';
|
|
@@ -135,6 +135,10 @@ export * from '@redocly/theme/components/Search/SearchShortcut';
|
|
|
135
135
|
export * from '@redocly/theme/components/Search/SearchTrigger';
|
|
136
136
|
export * from '@redocly/theme/components/Search/SearchRecent';
|
|
137
137
|
export * from '@redocly/theme/components/Search/SearchSuggestedPages';
|
|
138
|
+
export * from '@redocly/theme/components/Search/SearchFilter';
|
|
139
|
+
export * from '@redocly/theme/components/Search/SearchFilterField';
|
|
140
|
+
export * from '@redocly/theme/components/Search/FilterFields/SearchFilterFieldSelect';
|
|
141
|
+
export * from '@redocly/theme/components/Search/FilterFields/SearchFilterFieldTags';
|
|
138
142
|
/* Icons */
|
|
139
143
|
export * from '@redocly/theme/icons/ArrowRightIcon/ArrowRightIcon';
|
|
140
144
|
export * from '@redocly/theme/icons/ArrowUpRightIcon/ArrowUpRightIcon';
|
|
@@ -150,6 +154,7 @@ export * from '@redocly/theme/icons/FolderAddIcon/FolderAddIcon';
|
|
|
150
154
|
export * from '@redocly/theme/icons/FolderIcon/FolderIcon';
|
|
151
155
|
export * from '@redocly/theme/icons/FolderMoveToIcon/FolderMoveToIcon';
|
|
152
156
|
export * from '@redocly/theme/icons/SelectIcon/SelectIcon';
|
|
157
|
+
export * from '@redocly/theme/icons/SettingsIcon/SettingsIcon';
|
|
153
158
|
export * from '@redocly/theme/icons/CloseIcon/CloseIcon';
|
|
154
159
|
export * from '@redocly/theme/icons/CloseOutlineIcon/CloseOutlineIcon';
|
|
155
160
|
export * from '@redocly/theme/icons/CloseFilledIcon/CloseFilledIcon';
|
|
@@ -197,6 +202,7 @@ export * from '@redocly/theme/icons/MobileSidebarIcon/MobileSidebarIcon';
|
|
|
197
202
|
export * from '@redocly/theme/icons/CopyLinkIcon/CopyLinkIcon';
|
|
198
203
|
export * from '@redocly/theme/icons/OverflowMenuHorizontalIcon/OverflowMenuHorizontalIcon';
|
|
199
204
|
export * from '@redocly/theme/icons/RenewIcon/RenewIcon';
|
|
205
|
+
export * from '@redocly/theme/icons/ResetIcon/ResetIcon';
|
|
200
206
|
export * from '@redocly/theme/icons/WarningAltIcon/WarningAltIcon';
|
|
201
207
|
export * from '@redocly/theme/icons/MoonIcon/MoonIcon';
|
|
202
208
|
export * from '@redocly/theme/icons/SunIcon/SunIcon';
|
|
File without changes
|
|
File without changes
|
|
File without changes
|