@redneckz/wildless-cms-uni-blocks 0.14.945 → 0.14.947
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/bundle/bundle.umd.js +6 -6
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/ui-kit/SearchBar/SearchBar.d.ts +2 -1
- package/bundle/ui-kit/SearchDialog/SearchDialog.d.ts +2 -0
- package/dist/components/Footer/renderLogoSearchBar.js +2 -2
- package/dist/components/Footer/renderLogoSearchBar.js.map +1 -1
- package/dist/ui-kit/SearchBar/SearchBar.d.ts +2 -1
- package/dist/ui-kit/SearchBar/SearchBar.js +1 -1
- package/dist/ui-kit/SearchBar/SearchBar.js.map +1 -1
- package/dist/ui-kit/SearchDialog/SearchDialog.d.ts +2 -0
- package/dist/ui-kit/SearchDialog/SearchDialog.js +2 -2
- package/dist/ui-kit/SearchDialog/SearchDialog.js.map +1 -1
- package/fonts/notosanssc/notosanssc.css +32 -0
- package/fonts/notosanssc/notosansscbold.ttf +0 -0
- package/fonts/notosanssc/notosansscbold.woff +0 -0
- package/fonts/notosanssc/notosansscbold.woff2 +0 -0
- package/fonts/notosanssc/notosanssclight.ttf +0 -0
- package/fonts/notosanssc/notosanssclight.woff +0 -0
- package/fonts/notosanssc/notosanssclight.woff2 +0 -0
- package/fonts/notosanssc/notosansscmedium.ttf +0 -0
- package/fonts/notosanssc/notosansscmedium.woff +0 -0
- package/fonts/notosanssc/notosansscmedium.woff2 +0 -0
- package/fonts/notosanssc/notosansscregular.ttf +0 -0
- package/fonts/notosanssc/notosansscregular.woff +0 -0
- package/fonts/notosanssc/notosansscregular.woff2 +0 -0
- package/lib/common.css +1 -1
- package/lib/components/Footer/renderLogoSearchBar.js +2 -2
- package/lib/components/Footer/renderLogoSearchBar.js.map +1 -1
- package/lib/ui-kit/SearchBar/SearchBar.d.ts +2 -1
- package/lib/ui-kit/SearchBar/SearchBar.js +1 -1
- package/lib/ui-kit/SearchBar/SearchBar.js.map +1 -1
- package/lib/ui-kit/SearchDialog/SearchDialog.d.ts +2 -0
- package/lib/ui-kit/SearchDialog/SearchDialog.js +2 -2
- package/lib/ui-kit/SearchDialog/SearchDialog.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +1 -1
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/ui-kit/SearchBar/SearchBar.d.ts +2 -1
- package/mobile/bundle/ui-kit/SearchDialog/SearchDialog.d.ts +2 -0
- package/mobile/dist/ui-kit/SearchBar/SearchBar.d.ts +2 -1
- package/mobile/dist/ui-kit/SearchBar/SearchBar.js +1 -1
- package/mobile/dist/ui-kit/SearchBar/SearchBar.js.map +1 -1
- package/mobile/dist/ui-kit/SearchDialog/SearchDialog.d.ts +2 -0
- package/mobile/dist/ui-kit/SearchDialog/SearchDialog.js +2 -2
- package/mobile/dist/ui-kit/SearchDialog/SearchDialog.js.map +1 -1
- package/mobile/fonts/notosanssc/notosanssc.css +32 -0
- package/mobile/fonts/notosanssc/notosansscbold.ttf +0 -0
- package/mobile/fonts/notosanssc/notosansscbold.woff +0 -0
- package/mobile/fonts/notosanssc/notosansscbold.woff2 +0 -0
- package/mobile/fonts/notosanssc/notosanssclight.ttf +0 -0
- package/mobile/fonts/notosanssc/notosanssclight.woff +0 -0
- package/mobile/fonts/notosanssc/notosanssclight.woff2 +0 -0
- package/mobile/fonts/notosanssc/notosansscmedium.ttf +0 -0
- package/mobile/fonts/notosanssc/notosansscmedium.woff +0 -0
- package/mobile/fonts/notosanssc/notosansscmedium.woff2 +0 -0
- package/mobile/fonts/notosanssc/notosansscregular.ttf +0 -0
- package/mobile/fonts/notosanssc/notosansscregular.woff +0 -0
- package/mobile/fonts/notosanssc/notosansscregular.woff2 +0 -0
- package/mobile/lib/common.css +1 -1
- package/mobile/lib/ui-kit/SearchBar/SearchBar.d.ts +2 -1
- package/mobile/lib/ui-kit/SearchBar/SearchBar.js +1 -1
- package/mobile/lib/ui-kit/SearchBar/SearchBar.js.map +1 -1
- package/mobile/lib/ui-kit/SearchDialog/SearchDialog.d.ts +2 -0
- package/mobile/lib/ui-kit/SearchDialog/SearchDialog.js +2 -2
- package/mobile/lib/ui-kit/SearchDialog/SearchDialog.js.map +1 -1
- package/mobile/src/common.css +1 -0
- package/mobile/src/ui-kit/SearchBar/SearchBar.tsx +3 -1
- package/mobile/src/ui-kit/SearchDialog/SearchDialog.tsx +39 -28
- package/package.json +2 -1
- package/src/common.css +1 -0
- package/src/components/Footer/renderLogoSearchBar.tsx +7 -2
- package/src/ui-kit/SearchBar/SearchBar.tsx +3 -1
- package/src/ui-kit/SearchDialog/SearchDialog.tsx +39 -28
- package/tailwind.config.cjs +1 -1
|
@@ -5,14 +5,19 @@ import { SearchBar } from '../../ui-kit/SearchBar/SearchBar';
|
|
|
5
5
|
import { LEFT_COLUMN_STYLE } from './leftColumnStyle';
|
|
6
6
|
|
|
7
7
|
export const renderLogoSearchBar = (common?: CommonData, navigationItems?: TopMenuItemProps[]) => {
|
|
8
|
-
const { logo } = common ?? {};
|
|
8
|
+
const { logo, search } = common ?? {};
|
|
9
9
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
10
10
|
const { dataHeader, dataFooter, ...logoProps } = logo ?? {};
|
|
11
11
|
|
|
12
12
|
return (
|
|
13
13
|
<div className="flex items-stretch gap-3xl">
|
|
14
14
|
<Logo className={LEFT_COLUMN_STYLE} logo={logoProps} data={dataFooter} showTitle={false} />
|
|
15
|
-
<SearchBar
|
|
15
|
+
<SearchBar
|
|
16
|
+
className="grow"
|
|
17
|
+
navigationItems={navigationItems}
|
|
18
|
+
placeholder={search?.placeholder}
|
|
19
|
+
{...common}
|
|
20
|
+
/>
|
|
16
21
|
</div>
|
|
17
22
|
);
|
|
18
23
|
};
|
|
@@ -3,13 +3,14 @@ import { useCallback, useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
|
3
3
|
import { type SearchHeaderProps } from '../../data/CommonData';
|
|
4
4
|
import { type TopMenuItemProps } from '../../data/NavigationData';
|
|
5
5
|
import { type ComponentType } from '../../model/ComponentType';
|
|
6
|
+
import { type PlaceholderProps } from '../../model/PlaceholderProps';
|
|
6
7
|
import { style } from '../../utils/style';
|
|
7
8
|
import { CloseButton } from '../DialogManager/CloseButton';
|
|
8
9
|
import { useDialog } from '../DialogManager/useDialog';
|
|
9
10
|
import { SearchDialog } from '../SearchDialog/SearchDialog';
|
|
10
11
|
import { SearchInput } from '../SearchDialog/SearchInput';
|
|
11
12
|
|
|
12
|
-
interface SearchBarProps extends ComponentType {
|
|
13
|
+
interface SearchBarProps extends ComponentType, PlaceholderProps {
|
|
13
14
|
search?: SearchHeaderProps;
|
|
14
15
|
navigationItems?: TopMenuItemProps[];
|
|
15
16
|
}
|
|
@@ -38,6 +39,7 @@ export const SearchBar = JSX<SearchBarProps>(({ className, search, ...rest }) =>
|
|
|
38
39
|
value={value}
|
|
39
40
|
placeholder={search?.placeholder}
|
|
40
41
|
onChange={handleInitialInputChange}
|
|
42
|
+
{...rest}
|
|
41
43
|
/>
|
|
42
44
|
<CloseButton className="absolute top-0 right-0 sm:hidden" onClose={resetQueryOnDialogClose} />
|
|
43
45
|
</div>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { useMemo } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
|
+
import type { SearchHeaderProps } from '../../data/CommonData';
|
|
3
4
|
import { type TopMenuItemProps } from '../../data/NavigationData';
|
|
4
5
|
import { env } from '../../Env';
|
|
5
6
|
import { type LinkProps } from '../../model/LinkProps';
|
|
@@ -15,38 +16,48 @@ import { SearchInput } from './SearchInput';
|
|
|
15
16
|
export interface SearchDialogProps extends OnCloseProps {
|
|
16
17
|
initialQuery?: string;
|
|
17
18
|
navigationItems?: TopMenuItemProps[];
|
|
19
|
+
search?: SearchHeaderProps;
|
|
18
20
|
}
|
|
19
21
|
|
|
20
22
|
const IS_SINGLE_SEARCH_INDEX = Boolean(env.SINGLE_SEARCH_INDEX);
|
|
21
23
|
|
|
22
|
-
export const SearchDialog = JSX<SearchDialogProps>(
|
|
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
|
-
|
|
49
|
-
}
|
|
24
|
+
export const SearchDialog = JSX<SearchDialogProps>(
|
|
25
|
+
({ initialQuery, navigationItems, onClose, search }) => {
|
|
26
|
+
const basePath = getBasePath(env.SITE_URL);
|
|
27
|
+
|
|
28
|
+
const basePathList = useMemo(
|
|
29
|
+
() => (IS_SINGLE_SEARCH_INDEX ? [basePath] : navigationItems?.map((_) => _.href || '/')),
|
|
30
|
+
[navigationItems],
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
const [searchResult, searchInputProps] = useSearch({
|
|
34
|
+
basePathList,
|
|
35
|
+
initialQuery,
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
const searchItems = useMemo(
|
|
39
|
+
() => combineTopItemsAndSearchResult(navigationItems)(searchResult),
|
|
40
|
+
[navigationItems, searchResult],
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
return (
|
|
44
|
+
<Dialog
|
|
45
|
+
maxWidth="none"
|
|
46
|
+
head={
|
|
47
|
+
<SearchInput
|
|
48
|
+
className="mt-s"
|
|
49
|
+
autoFocus={true}
|
|
50
|
+
placeholder={search?.placeholder}
|
|
51
|
+
{...searchInputProps}
|
|
52
|
+
/>
|
|
53
|
+
}
|
|
54
|
+
onClose={onClose}
|
|
55
|
+
>
|
|
56
|
+
<Sitemap navigationItems={searchItems} isSearchPanel={true} />
|
|
57
|
+
</Dialog>
|
|
58
|
+
);
|
|
59
|
+
},
|
|
60
|
+
);
|
|
50
61
|
|
|
51
62
|
const combineTopItemsAndSearchResult =
|
|
52
63
|
(topItems: TopMenuItemProps[] | undefined) =>
|
package/tailwind.config.cjs
CHANGED
|
@@ -67,7 +67,7 @@ module.exports = {
|
|
|
67
67
|
},
|
|
68
68
|
flexShrink: { '1/2': '0.5' },
|
|
69
69
|
fontFamily: {
|
|
70
|
-
sans: ['Ubuntu', ...defaultTheme.fontFamily.sans],
|
|
70
|
+
sans: ['Ubuntu', 'NotoSansSC', ...defaultTheme.fontFamily.sans],
|
|
71
71
|
mohave: ['Mohave', ...defaultTheme.fontFamily.sans],
|
|
72
72
|
},
|
|
73
73
|
fontSize: {
|