@telia-ace/knowledge-widget-ui 0.0.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.
@@ -0,0 +1,4 @@
1
+ import { default as React } from 'react';
2
+
3
+ declare const _default: React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<HTMLUListElement>>;
4
+ export default _default;
@@ -0,0 +1,13 @@
1
+ import { ItemRenderer } from '../../../../ui/src/index.ts';
2
+ import { default as React } from 'react';
3
+
4
+ type Props = {
5
+ trigger: React.ReactElement;
6
+ header?: React.ReactElement;
7
+ items?: any[];
8
+ renderItem?: ItemRenderer;
9
+ className?: string;
10
+ children?: React.ReactNode;
11
+ };
12
+ declare const DropdownActions: React.FC<Props>;
13
+ export default DropdownActions;
@@ -0,0 +1,18 @@
1
+ import { default as React } from 'react';
2
+ import { FavoriteActions } from '../hooks';
3
+
4
+ type Props = {
5
+ isFavorite: boolean;
6
+ actions: FavoriteActions;
7
+ id: string;
8
+ addFavoriteTooltip?: string;
9
+ removeFavoriteCancelLabel?: string;
10
+ removeFavoriteConfirmLabel?: string;
11
+ removeFavoriteHeader?: string;
12
+ removeFavoriteLabel?: string;
13
+ removeFavoriteTooltip?: string;
14
+ buttonLabel?: string;
15
+ guideTitle?: string;
16
+ };
17
+ declare const FavoriteButton: React.FC<Props>;
18
+ export default FavoriteButton;
@@ -0,0 +1,12 @@
1
+ import { default as React } from 'react';
2
+
3
+ export type Props = {
4
+ onFeedback?: (feedback: 'positive' | 'negative') => void;
5
+ positive?: string;
6
+ negative?: string;
7
+ header?: string;
8
+ selected?: 'positive' | 'negative';
9
+ direction?: 'horizontal' | 'vertical';
10
+ } & any;
11
+ declare const _default: React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<HTMLDivElement>>;
12
+ export default _default;
@@ -0,0 +1,47 @@
1
+ import { Guide } from '../../../core/src/index.ts';
2
+ import { DispatchAction, ItemRenderer } from '../../../../ui/src/index.ts';
3
+ import { Params } from '../../../../utilities/src/index.ts';
4
+ import { default as React } from 'react';
5
+ import { Props as MetadataProps } from './metadata';
6
+
7
+ type Routing = {
8
+ guide?: string;
9
+ page?: string;
10
+ };
11
+ type ParamMappers = {
12
+ guide?: (guide: Guide) => Params;
13
+ page?: () => Params;
14
+ };
15
+ export type Props = {
16
+ paramMappers?: ParamMappers;
17
+ routing?: Routing;
18
+ pageLabel?: string;
19
+ symbolSize?: number;
20
+ renderItem?: ItemRenderer;
21
+ pageRole?: 'link' | 'button';
22
+ pageCaret?: 'right' | 'down';
23
+ showTags?: boolean;
24
+ showFavoriteToggle?: boolean;
25
+ addFavoriteTooltip?: string;
26
+ removeFavoriteCancelLabel?: string;
27
+ removeFavoriteConfirmLabel?: string;
28
+ removeFavoriteHeader?: string;
29
+ removeFavoriteLabel?: string;
30
+ removeFavoriteTooltip?: string;
31
+ metadata?: Partial<MetadataProps>;
32
+ dispatch?: DispatchAction;
33
+ localPaging?: boolean;
34
+ expandable?: boolean;
35
+ searchResultsEmptyLabel?: string;
36
+ onItemClick?: (e: React.MouseEvent, guide: Guide) => void;
37
+ } & any;
38
+ export declare const AccordionListItem: React.ForwardRefExoticComponent<{
39
+ title: string;
40
+ id: string;
41
+ route: string;
42
+ symbolSize?: number | undefined;
43
+ collapseUri?: string | undefined;
44
+ children?: React.ReactNode;
45
+ } & React.RefAttributes<HTMLLIElement>>;
46
+ declare const _default: React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<HTMLDivElement>>;
47
+ export default _default;
@@ -0,0 +1,11 @@
1
+ export { default as DialogLink } from './dialog-link';
2
+ export { default as DialogList } from './dialog-list';
3
+ export { default as DrawerList } from './drawer-list';
4
+ export { default as DropdownActions } from './dropdown-actions';
5
+ export { default as DropdownList } from './dropdown-list';
6
+ export { default as FavoriteButton } from './favorite-button';
7
+ export { default as Feedback } from './feedback';
8
+ export { AccordionListItem, default as GuideList } from './guide-list';
9
+ export { default as Loader, Wrapper as LoaderWrapper } from './loader';
10
+ export { default as Metadata } from './metadata';
11
+ export { default as NotificationList } from './notification-list';
@@ -0,0 +1,13 @@
1
+ import { default as React } from 'react';
2
+
3
+ type Props = {
4
+ loading: boolean | undefined;
5
+ };
6
+ export declare const Wrapper: import('@emotion/styled').StyledComponent<{
7
+ theme?: import('@emotion/react').Theme | undefined;
8
+ as?: React.ElementType<any> | undefined;
9
+ } & {
10
+ 'data-loading': boolean;
11
+ }, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
12
+ declare const Loader: React.FC<Props>;
13
+ export default Loader;
@@ -0,0 +1,18 @@
1
+ import { DateFormats } from '../../../../ui/src/index.ts';
2
+ import { default as React } from 'react';
3
+
4
+ export type Props = {
5
+ className?: string;
6
+ modified?: string;
7
+ published?: string;
8
+ modifiedBy?: string | null;
9
+ publishedBy?: string | null;
10
+ showModified?: boolean;
11
+ showPublished?: boolean;
12
+ modifiedLabel?: string;
13
+ publishedLabel?: string;
14
+ byLabel?: string;
15
+ format?: DateFormats;
16
+ };
17
+ declare const Metadata: React.FC<Props>;
18
+ export default Metadata;
@@ -0,0 +1,20 @@
1
+ import { Notification } from '../../../core/src/index.ts';
2
+ import { Symbol } from '../../../../ui/src/index.ts';
3
+ import { default as React } from 'react';
4
+
5
+ type Props = {
6
+ className?: string;
7
+ showHeader?: boolean;
8
+ loading: boolean;
9
+ notificationList?: {
10
+ id: string;
11
+ title?: string;
12
+ symbol?: Symbol;
13
+ notifications: Notification[];
14
+ defaultHeaderOptions?: {
15
+ visible: boolean;
16
+ };
17
+ };
18
+ };
19
+ declare const NotificationList: React.FC<Props>;
20
+ export default NotificationList;
@@ -0,0 +1,5 @@
1
+ export { default as useArrowKeys } from './use-arrow-keys';
2
+ export { default as useDebounce } from './use-debounce';
3
+ export { default as useFavorites } from './use-favorites';
4
+ export type { FavoriteActions } from './use-favorites';
5
+ export { default as useHover } from './use-hover';
@@ -0,0 +1,3 @@
1
+ type ArrowKey = 'up' | 'down' | 'left' | 'right';
2
+ declare const useArrowKeys: () => ArrowKey | null;
3
+ export default useArrowKeys;
@@ -0,0 +1,2 @@
1
+ declare const useDebounce: (value: string, delay: number) => string;
2
+ export default useDebounce;
@@ -0,0 +1,8 @@
1
+ export type FavoriteActions = {
2
+ addFavorite: (guideId: string) => Promise<string[]>;
3
+ clearFavorites: () => Promise<string[]>;
4
+ removeFavorite: (guideId: string) => Promise<string[]>;
5
+ toggleFavorite: (guideId: string) => Promise<string[]>;
6
+ };
7
+ declare const useFavorites: () => [string[], FavoriteActions];
8
+ export default useFavorites;
@@ -0,0 +1,5 @@
1
+ declare const _default: () => [
2
+ boolean,
3
+ React.MutableRefObject<HTMLElement | undefined>
4
+ ];
5
+ export default _default;
package/index.d.ts ADDED
@@ -0,0 +1,8 @@
1
+ import { AccordionListItem, DialogLink, DialogList, DrawerList, DropdownActions, DropdownList, FavoriteButton, Feedback, GuideList, Loader, LoaderWrapper, Metadata, NotificationList } from './components';
2
+ import { FavoriteActions, useArrowKeys, useDebounce, useFavorites, useHover } from './hooks';
3
+ import { loadingOpacity, SmallCaret, StyledHeaderText, StyledListButton } from './styles';
4
+ import { guideRenderInstructions } from './utils';
5
+
6
+ export * from '../../../ui/src/index.ts';
7
+ export { useFavorites, useDebounce, useArrowKeys, useHover, guideRenderInstructions, Metadata, NotificationList, AccordionListItem, GuideList, DialogLink, DialogList, FavoriteButton, Feedback, Loader, LoaderWrapper, DrawerList, DropdownActions, DropdownList, SmallCaret, StyledHeaderText, StyledListButton, loadingOpacity, };
8
+ export type { FavoriteActions };