jamespot-react-components 1.3.46 → 1.3.48
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/dist/jamespot-react-components.cjs +1182 -1080
- package/dist/jamespot-react-components.js +13504 -13042
- package/dist/scripts/generate.d.ts +1 -0
- package/dist/src/components/JRCAvatars/JRCAvatars.d.ts +2 -1
- package/dist/src/components/JRCButton/types.d.ts +1 -1
- package/dist/src/components/JRCButtonDropdown/JRCButtonDropdown.styles.d.ts +2 -1
- package/dist/src/components/JRCButtonDropdown/JRCButtonDropdown.types.d.ts +8 -6
- package/dist/src/components/JRCDate/JRCDateObject.d.ts +9 -0
- package/dist/src/components/JRCDate/JRCDateObject.stories.d.ts +8 -0
- package/dist/src/components/JRCDot/JRCDot.d.ts +2 -0
- package/dist/src/components/JRCDot/JRCDot.stories.d.ts +8 -0
- package/dist/src/components/JRCDragNDrop/Draggable.d.ts +4 -3
- package/dist/src/components/JRCDragNDrop/JRCDndOneLevel.d.ts +2 -0
- package/dist/src/components/JRCDragNDrop/JRCDndOneLevel.stories.d.ts +30 -0
- package/dist/src/components/JRCDragNDrop/JRCDndTwoLevelWithStack.stories.d.ts +1 -1
- package/dist/src/components/JRCDragNDrop/index.d.ts +5 -3
- package/dist/src/components/JRCDragNDrop/styles.d.ts +21 -0
- package/dist/src/components/JRCDragNDrop/types.d.ts +26 -83
- package/dist/src/components/JRCList/JRCList.styles.d.ts +1 -0
- package/dist/src/components/JRCMetas/JRCMetas.d.ts +4 -0
- package/dist/src/components/JRCMetas/JRCMetas.stories.d.ts +13 -0
- package/dist/src/components/JRCSocialActions/JRCSocialActions.d.ts +10 -0
- package/dist/src/components/JRCStyledHref/JRCStyledHref.d.ts +3 -0
- package/dist/src/components/Widgets/JRCWidgetQuickSurvey/JRCWidgetQuickSurveyEditor.d.ts +2 -1
- package/dist/src/components/Widgets/JRCWidgetQuickSurvey/JRCWidgetQuickSurveyEditorAddEntry.d.ts +1 -3
- package/dist/src/components/Widgets/JRCWidgetQuickSurvey/JRCWidgetQuickSurveyEditorEntries.d.ts +2 -1
- package/dist/src/components/Widgets/JRCWidgetQuickSurvey/JRCWidgetQuickSurveyItemWrapper.d.ts +1 -0
- package/dist/src/components/Widgets/JRCWidgetSurveyDate/JRCWidgetSurveyDate.d.ts +12 -0
- package/dist/src/components/Widgets/JRCWidgetSurveyDate/JRCWidgetSurveyDate.stories.d.ts +5 -0
- package/dist/src/components/Widgets/JRCWidgetSurveyDate/SurveyDateItem.d.ts +16 -0
- package/dist/src/components/Widgets/JRCWidgetSurveyDate/SurveyDateItemRespondents.d.ts +5 -0
- package/dist/src/components/Widgets/JRCWidgetSurveyDate/types.d.ts +18 -0
- package/dist/src/components/index.d.ts +9 -1
- package/dist/src/index.d.ts +0 -1
- package/dist/src/styles/theme.d.ts +1 -0
- package/dist/src/translation/lang.json.d.ts +17 -0
- package/dist/src/types.d.ts +1 -1
- package/dist/src/utils/index.d.ts +3 -1
- package/dist/src/utils/utils.color.d.ts +32 -0
- package/dist/src/utils/utils.date.d.ts +1 -0
- package/dist/src/utils/utils.files.d.ts +1 -1
- package/dist/src/utils/utils.form.d.ts +2 -0
- package/dist/src/utils/utils.image.d.ts +3 -0
- package/package.json +2 -2
- package/scripts/generate.ts +121 -0
- package/dist/src/styles/utils.d.ts +0 -32
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -5,6 +5,7 @@ export type AvatarAudience = {
|
|
|
5
5
|
};
|
|
6
6
|
type JRCAvatarsProps = {
|
|
7
7
|
audience?: AvatarAudience[];
|
|
8
|
+
tooltipOrientation?: 'top' | 'bottom' | 'left' | 'right';
|
|
8
9
|
};
|
|
9
|
-
export declare const JRCAvatars: ({ audience }: JRCAvatarsProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare const JRCAvatars: ({ audience, tooltipOrientation }: JRCAvatarsProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
11
|
export {};
|
|
@@ -17,7 +17,7 @@ export type ButtonType = {
|
|
|
17
17
|
'text-decoration'?: 'underline' | 'none';
|
|
18
18
|
};
|
|
19
19
|
};
|
|
20
|
-
export type ButtonColors = 'primary' | 'primaryLight' | 'valid' | 'validLight' | 'danger' | 'dangerLight' | 'secondary' | 'cancel' | 'neutral' | 'white';
|
|
20
|
+
export type ButtonColors = 'primary' | 'primaryLight' | 'valid' | 'validLight' | 'danger' | 'dangerLight' | 'secondary' | 'cancel' | 'neutral' | 'transparent' | 'white';
|
|
21
21
|
export type ButtonSizes = 'm' | 's';
|
|
22
22
|
export type ButtonProps = ComponentPropsWithoutRef<'button'> & DataCy & {
|
|
23
23
|
/** Color of the background of the button */
|
|
@@ -21,7 +21,8 @@ export declare const MarginLessJRCButton: import('node_modules/styled-components
|
|
|
21
21
|
} & {
|
|
22
22
|
tooltip?: Omit<import('../..').JRCTooltipProps, "children">;
|
|
23
23
|
} & import('react').RefAttributes<HTMLButtonElement>, ButtonProps & {
|
|
24
|
-
small?: boolean;
|
|
24
|
+
$small?: boolean;
|
|
25
|
+
$width?: number;
|
|
25
26
|
}>> & string & Omit<import('react').ForwardRefExoticComponent<Omit<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & import('../../types/dataAttributes').DataCy & {
|
|
26
27
|
color?: import('../JRCButton/types').ButtonColors;
|
|
27
28
|
themeCustom?: ButtonType;
|
|
@@ -28,18 +28,20 @@ export type JRCButtonDropdownProps = {
|
|
|
28
28
|
onClose?: () => void;
|
|
29
29
|
noMargin?: boolean;
|
|
30
30
|
dataCy?: string;
|
|
31
|
+
width?: number;
|
|
31
32
|
};
|
|
32
33
|
export type ButtonProps = {
|
|
33
|
-
borderLeft?: boolean;
|
|
34
|
-
borderRight?: boolean;
|
|
34
|
+
$borderLeft?: boolean;
|
|
35
|
+
$borderRight?: boolean;
|
|
35
36
|
$themeButton: ButtonType;
|
|
36
|
-
open?: boolean;
|
|
37
|
-
darker?: boolean;
|
|
37
|
+
$open?: boolean;
|
|
38
|
+
$darker?: boolean;
|
|
38
39
|
};
|
|
39
40
|
export type OpenDirection = {
|
|
40
|
-
direction: JRCButtonDropdownProps['smallOpenDirection'];
|
|
41
|
+
$direction: JRCButtonDropdownProps['smallOpenDirection'];
|
|
41
42
|
};
|
|
42
|
-
export type MenuWithTitleProps =
|
|
43
|
+
export type MenuWithTitleProps = {
|
|
44
|
+
direction: JRCButtonDropdownProps['smallOpenDirection'];
|
|
43
45
|
label: string;
|
|
44
46
|
themeButton: ButtonProps['$themeButton'];
|
|
45
47
|
children: ReactNode;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { JRCTooltipProps } from '../JRCTooltip/types';
|
|
2
|
+
import { JRCTypographyProps } from '../JRCTypography/JRCTypography.d';
|
|
3
|
+
export type JRCDateObjectProps = {
|
|
4
|
+
dateCreation: string;
|
|
5
|
+
size?: JRCTypographyProps['size'];
|
|
6
|
+
color?: JRCTypographyProps['color'];
|
|
7
|
+
tooltipPosition?: JRCTooltipProps['position'];
|
|
8
|
+
};
|
|
9
|
+
export declare const JRCDateObject: ({ dateCreation, size, color, tooltipPosition, }: JRCDateObjectProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Meta, StoryFn } from '@storybook/react-vite';
|
|
2
|
+
import { JRCDateObject, JRCDateObjectProps } from './JRCDateObject';
|
|
3
|
+
declare const meta: Meta<typeof JRCDateObject>;
|
|
4
|
+
export default meta;
|
|
5
|
+
export declare const RecentDate: StoryFn<JRCDateObjectProps>;
|
|
6
|
+
export declare const DateFromOneHour: StoryFn<JRCDateObjectProps>;
|
|
7
|
+
export declare const DateFromYesterday: StoryFn<JRCDateObjectProps>;
|
|
8
|
+
export declare const DateFromLastMonth: StoryFn<JRCDateObjectProps>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Meta, StoryFn, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { JRCTypographyProps } from '../JRCTypography/JRCTypography.d';
|
|
3
|
+
import { JRCDot } from './JRCDot';
|
|
4
|
+
declare const meta: Meta;
|
|
5
|
+
export default meta;
|
|
6
|
+
export declare const DefaultDot: StoryFn<Omit<JRCTypographyProps, 'children'>>;
|
|
7
|
+
export declare const SmallDot: StoryFn<Omit<JRCTypographyProps, 'children'>>;
|
|
8
|
+
export declare const DotInteraction: StoryObj<typeof JRCDot>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ReactNode, RefObject } from 'react';
|
|
2
2
|
import { BaseDndItem, DndDragItem, ItemTypes } from './types';
|
|
3
3
|
interface DraggableProps {
|
|
4
4
|
type: ItemTypes;
|
|
@@ -7,7 +7,8 @@ interface DraggableProps {
|
|
|
7
7
|
onMove: (dragIndex: number, hoverIndex: number) => void;
|
|
8
8
|
onMoveToSection?: (draggedItem: DndDragItem, targetIndex: number) => void;
|
|
9
9
|
sectionId?: string | number;
|
|
10
|
-
children:
|
|
10
|
+
children: ReactNode | ((dragHandleRef: RefObject<HTMLDivElement | null>) => ReactNode);
|
|
11
|
+
useDragHandle?: boolean;
|
|
11
12
|
}
|
|
12
|
-
export declare const Draggable:
|
|
13
|
+
export declare const Draggable: ({ type, item, index, onMove, onMoveToSection, sectionId, children, useDragHandle, }: DraggableProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
14
|
export {};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { BaseDndItem, JRCDndOneLevelProps } from './types';
|
|
2
|
+
export declare const JRCDndOneLevel: import('react').MemoExoticComponent<(<T extends BaseDndItem = BaseDndItem>({ items, ItemComponent, EmptyStateComponent, onItemMove, onItemRemove, canRemoveItems, showDragHandle, dragHandleOnly, title: titleProp, emptyStateText, $maxHeight, className, }: JRCDndOneLevelProps<T>) => import("react/jsx-runtime").JSX.Element)>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
|
+
import { BaseDndItem, JRCDndOneLevelProps } from './types';
|
|
3
|
+
declare const meta: Meta<JRCDndOneLevelProps<BaseDndItem>>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<JRCDndOneLevelProps<BaseDndItem>>;
|
|
6
|
+
/**
|
|
7
|
+
* Default story with basic drag and drop functionality
|
|
8
|
+
*/
|
|
9
|
+
export declare const Default: Story;
|
|
10
|
+
export declare const WithCustomEmptyState: Story;
|
|
11
|
+
/**
|
|
12
|
+
* Test: Basic drag and drop interaction
|
|
13
|
+
*/
|
|
14
|
+
export declare const DragAndDropBasic: Story;
|
|
15
|
+
/**
|
|
16
|
+
* Test: Complete interactions with drag, drop and remove
|
|
17
|
+
*/
|
|
18
|
+
export declare const DragAndDropInteractions: Story;
|
|
19
|
+
/**
|
|
20
|
+
* Test: Empty state display
|
|
21
|
+
*/
|
|
22
|
+
export declare const EmptyStateTest: Story;
|
|
23
|
+
/**
|
|
24
|
+
* Test: Drag with drag handle
|
|
25
|
+
*/
|
|
26
|
+
export declare const DragWithHandleTest: Story;
|
|
27
|
+
/**
|
|
28
|
+
* Test: Multiple consecutive drags
|
|
29
|
+
*/
|
|
30
|
+
export declare const MultipleConsecutiveDrags: Story;
|
|
@@ -5,7 +5,7 @@ interface StoryDndItem extends BaseDndItem {
|
|
|
5
5
|
content?: string;
|
|
6
6
|
type?: string;
|
|
7
7
|
}
|
|
8
|
-
declare const meta: Meta<JRCDndTwoLevelWithStackProps<
|
|
8
|
+
declare const meta: Meta<JRCDndTwoLevelWithStackProps<BaseDndItem>>;
|
|
9
9
|
export default meta;
|
|
10
10
|
export declare const LoadingState: StoryObj<JRCDndTwoLevelWithStackProps<StoryDndItem>>;
|
|
11
11
|
export declare const HasErrors: StoryObj<JRCDndTwoLevelWithStackProps<StoryDndItem>>;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
export { DndProvider } from './DndProvider';
|
|
2
2
|
export { Draggable } from './Draggable';
|
|
3
3
|
export { Droppable } from './Droppable';
|
|
4
|
-
export {
|
|
4
|
+
export { JRCDndOneLevel } from './JRCDndOneLevel';
|
|
5
5
|
export { JRCDndOneLevelWithStack } from './JRCDndOneLevelWithStack';
|
|
6
|
+
export { JRCDndTwoLevelWithStack } from './JRCDndTwoLevelWithStack';
|
|
7
|
+
export type { BaseDndItem, DndData, DndDragItem, DndEmptyStateComponentProps, DndItemComponentProps, DndOneLevelEmptyStateComponentProps, DndOneLevelItemComponentProps, DndSection, DndSectionComponentProps, ItemTypes, JRCDndOneLevelProps, JRCDndTwoLevelWithStackProps, } from './types';
|
|
6
8
|
export { OneLevelMainDraggable } from './OneLevelMainDraggable';
|
|
7
|
-
export { OneLevelStackDraggable } from './OneLevelStackDraggable';
|
|
8
9
|
export { OneLevelMainDropzone } from './OneLevelMainDropzone';
|
|
9
|
-
export
|
|
10
|
+
export { OneLevelStackDraggable } from './OneLevelStackDraggable';
|
|
10
11
|
export { OneLevelItemTypes } from './types';
|
|
12
|
+
export type { JRCDndOneLevelWithStackProps, OneLevelEmptyStateComponentProps, OneLevelMainItemComponentProps, OneLevelStackItemComponentProps, } from './types';
|
|
@@ -88,3 +88,24 @@ export declare const SectionContent: import('node_modules/styled-components/dist
|
|
|
88
88
|
export declare const EmptyState: import('node_modules/styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
89
89
|
export declare const AddSectionButton: import('node_modules/styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, never>> & string;
|
|
90
90
|
export declare const ErrorMessage: import('node_modules/styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
91
|
+
export declare const OneLevelContainer: import('node_modules/styled-components/dist/types').IStyledComponentBase<"web", import('node_modules/styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
92
|
+
$maxHeight?: string;
|
|
93
|
+
}>> & string;
|
|
94
|
+
export declare const OneLevelHeader: import('node_modules/styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
95
|
+
export declare const OneLevelTitle: import('node_modules/styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('../Common/FastCss').FastCssProps & {
|
|
96
|
+
id?: string;
|
|
97
|
+
className?: string;
|
|
98
|
+
weight?: keyof import('../../styles/theme').FontWeight;
|
|
99
|
+
size?: import('../JRCTypography/JRCTypography.d').TSizes;
|
|
100
|
+
color?: import('../..').ColorsOrShades;
|
|
101
|
+
children: string | import('react').ReactNode;
|
|
102
|
+
variant?: import('../JRCTypography/JRCTypography.d').TVariants;
|
|
103
|
+
align?: "center" | "left" | "right";
|
|
104
|
+
hoverColor?: import('../..').ColorsOrShades;
|
|
105
|
+
ellipsis?: boolean;
|
|
106
|
+
maxWidth?: string | number;
|
|
107
|
+
}, never>> & string & Omit<({ variant, ellipsis, size, weight, color, align, hoverColor, maxWidth, ...props }: import('../..').JRCTypographyProps) => import("react/jsx-runtime").JSX.Element, keyof import('react').Component<any, {}, any>>;
|
|
108
|
+
export declare const OneLevelContent: import('node_modules/styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
109
|
+
export declare const OneLevelList: import('node_modules/styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
110
|
+
export declare const OneLevelItemWrapper: import('node_modules/styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
111
|
+
export declare const OneLevelItemContent: import('node_modules/styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
@@ -12,7 +12,8 @@ export declare enum OneLevelItemTypes {
|
|
|
12
12
|
* L'index signature permet d'accepter n'importe quelle structure d'item.
|
|
13
13
|
*/
|
|
14
14
|
export interface BaseDndItem {
|
|
15
|
-
id: string;
|
|
15
|
+
id: string | number;
|
|
16
|
+
label?: string;
|
|
16
17
|
[key: string]: unknown;
|
|
17
18
|
}
|
|
18
19
|
export interface DndDragItem extends BaseDndItem {
|
|
@@ -69,9 +70,30 @@ export interface JRCDndTwoLevelWithStackProps<T extends BaseDndItem = BaseDndIte
|
|
|
69
70
|
sectionError?: string;
|
|
70
71
|
$maxHeight?: string;
|
|
71
72
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
export interface DndOneLevelItemComponentProps<T extends BaseDndItem = BaseDndItem> {
|
|
74
|
+
item: T;
|
|
75
|
+
isDragging?: boolean;
|
|
76
|
+
dragHandleProps?: Record<string, unknown>;
|
|
77
|
+
onRemove?: (item: T) => void;
|
|
78
|
+
canRemove?: boolean;
|
|
79
|
+
}
|
|
80
|
+
export interface DndOneLevelEmptyStateComponentProps {
|
|
81
|
+
'data-testid'?: string;
|
|
82
|
+
}
|
|
83
|
+
export interface JRCDndOneLevelProps<T extends BaseDndItem = BaseDndItem> {
|
|
84
|
+
items: T[];
|
|
85
|
+
ItemComponent: React.FC<DndOneLevelItemComponentProps<T>>;
|
|
86
|
+
EmptyStateComponent?: React.FC<DndOneLevelEmptyStateComponentProps>;
|
|
87
|
+
onItemMove: (dragIndex: number, hoverIndex: number) => void;
|
|
88
|
+
onItemRemove?: (item: T) => void;
|
|
89
|
+
canRemoveItems?: boolean;
|
|
90
|
+
showDragHandle?: boolean;
|
|
91
|
+
dragHandleOnly?: boolean;
|
|
92
|
+
title?: string;
|
|
93
|
+
emptyStateText?: string;
|
|
94
|
+
$maxHeight?: string;
|
|
95
|
+
className?: string;
|
|
96
|
+
}
|
|
75
97
|
export interface OneLevelMainItemComponentProps<T extends BaseDndItem = BaseDndItem> {
|
|
76
98
|
item: T;
|
|
77
99
|
index: number;
|
|
@@ -98,103 +120,24 @@ export interface OneLevelEmptyStateComponentProps {
|
|
|
98
120
|
* Main props interface for JRCDndOneLevelWithStack component
|
|
99
121
|
*/
|
|
100
122
|
export interface JRCDndOneLevelWithStackProps<TMain extends BaseDndItem = BaseDndItem, TStack extends BaseDndItem = TMain> {
|
|
101
|
-
/**
|
|
102
|
-
* Items in main zone (left) - can be reordered and receive items from stack
|
|
103
|
-
*/
|
|
104
123
|
mainItems: TMain[];
|
|
105
|
-
/**
|
|
106
|
-
* Items in stack (right) - source of items to add to main zone
|
|
107
|
-
*/
|
|
108
124
|
stackItems: TStack[];
|
|
109
|
-
/**
|
|
110
|
-
* Component to render an item in the main zone
|
|
111
|
-
*/
|
|
112
125
|
MainItemComponent: React.FC<OneLevelMainItemComponentProps<TMain>>;
|
|
113
|
-
/**
|
|
114
|
-
* Component to render an item in the stack
|
|
115
|
-
*/
|
|
116
126
|
StackItemComponent: React.FC<OneLevelStackItemComponentProps<TStack>>;
|
|
117
|
-
/**
|
|
118
|
-
* Optional component displayed when main zone is empty
|
|
119
|
-
*/
|
|
120
127
|
EmptyStateComponent?: React.FC<OneLevelEmptyStateComponentProps>;
|
|
121
|
-
/**
|
|
122
|
-
* Called when a stack item is dropped into main zone
|
|
123
|
-
* @param stackItem - The item from stack
|
|
124
|
-
* @param targetIndex - Destination index in mainItems
|
|
125
|
-
* @param sourceIndex - Source index in stackItems
|
|
126
|
-
*/
|
|
127
128
|
onItemAddFromStack: (stackItem: TStack, targetIndex: number, sourceIndex: number) => void;
|
|
128
|
-
/**
|
|
129
|
-
* Called to reorder items in main zone
|
|
130
|
-
* @param dragIndex - Source index of dragged item
|
|
131
|
-
* @param hoverIndex - Target index for the item
|
|
132
|
-
*/
|
|
133
129
|
onItemMove: (dragIndex: number, hoverIndex: number) => void;
|
|
134
|
-
/**
|
|
135
|
-
* Optional callback to remove item from main zone
|
|
136
|
-
* @param item - The item to remove
|
|
137
|
-
* @param index - Index of the item in mainItems
|
|
138
|
-
*/
|
|
139
130
|
onItemRemove?: (item: TMain, index: number) => void;
|
|
140
|
-
/**
|
|
141
|
-
* Stack mode:
|
|
142
|
-
* - true (default): "Fixed/Clone" - items remain in stack after drag
|
|
143
|
-
* - false: "Consumable/Move" - items disappear from stack after drag
|
|
144
|
-
*/
|
|
145
131
|
isStackFixed?: boolean;
|
|
146
|
-
/**
|
|
147
|
-
* Allow reordering in main zone (default: true)
|
|
148
|
-
*/
|
|
149
132
|
canReorder?: boolean;
|
|
150
|
-
/**
|
|
151
|
-
* Show remove button on main items (default: false)
|
|
152
|
-
*/
|
|
153
133
|
canRemoveItems?: boolean;
|
|
154
|
-
/**
|
|
155
|
-
* Function to determine if a stack item is disabled
|
|
156
|
-
* @param item - Stack item to check
|
|
157
|
-
* @param stackIndex - Index of item in stackItems
|
|
158
|
-
* @returns true if item should be disabled (not draggable)
|
|
159
|
-
*/
|
|
160
134
|
isItemDisabled?: (item: TStack, stackIndex: number) => boolean;
|
|
161
|
-
/**
|
|
162
|
-
* Keyboard event handler for stack items.
|
|
163
|
-
* Called when a keyboard event occurs on a focused stack item.
|
|
164
|
-
* Useful for implementing keyboard shortcuts (e.g., ArrowLeft to add item to main zone).
|
|
165
|
-
* @param item - The stack item that received the keyboard event
|
|
166
|
-
* @param index - Index of the item in stackItems
|
|
167
|
-
* @param isDisabled - Whether the item is currently disabled
|
|
168
|
-
* @param event - The keyboard event
|
|
169
|
-
*/
|
|
170
135
|
onStackItemKeyDown?: (item: TStack, index: number, isDisabled: boolean, event: React.KeyboardEvent) => void;
|
|
171
|
-
/**
|
|
172
|
-
* Title for main zone (optional)
|
|
173
|
-
*/
|
|
174
136
|
mainTitle?: string;
|
|
175
|
-
/**
|
|
176
|
-
* Title for stack (optional)
|
|
177
|
-
*/
|
|
178
137
|
stackTitle?: string;
|
|
179
|
-
/**
|
|
180
|
-
* Text displayed when main zone is empty (optional)
|
|
181
|
-
*/
|
|
182
138
|
emptyStateText?: string;
|
|
183
|
-
/**
|
|
184
|
-
* Maximum height for container (optional)
|
|
185
|
-
* Example: "600px", "80vh"
|
|
186
|
-
*/
|
|
187
139
|
$maxHeight?: string;
|
|
188
|
-
/**
|
|
189
|
-
* Optional content to render before the main draggable zone
|
|
190
|
-
*/
|
|
191
140
|
beforeMain?: React.ReactNode;
|
|
192
|
-
/**
|
|
193
|
-
* Optional content to render after the main draggable zone
|
|
194
|
-
*/
|
|
195
141
|
afterMain?: React.ReactNode;
|
|
196
|
-
/**
|
|
197
|
-
* Optional content to render after the stack zone
|
|
198
|
-
*/
|
|
199
142
|
afterStack?: React.ReactNode;
|
|
200
143
|
}
|
|
@@ -10,6 +10,7 @@ export declare const Th: import('node_modules/styled-components/dist/types').ISt
|
|
|
10
10
|
}>> & string;
|
|
11
11
|
export declare const Tr: import('node_modules/styled-components/dist/types').IStyledComponentBase<"web", import('node_modules/styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLTableRowElement>, HTMLTableRowElement>, {
|
|
12
12
|
dragging?: boolean;
|
|
13
|
+
$isHead?: boolean;
|
|
13
14
|
}>> & string;
|
|
14
15
|
export declare const Td: import('node_modules/styled-components/dist/types').IStyledComponentBase<"web", import('node_modules/styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').TdHTMLAttributes<HTMLTableDataCellElement>, HTMLTableDataCellElement>, {
|
|
15
16
|
width?: number | string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Meta, StoryFn } from '@storybook/react-vite';
|
|
2
|
+
import { Metas } from 'jamespot-user-api';
|
|
3
|
+
declare const meta: Meta;
|
|
4
|
+
export default meta;
|
|
5
|
+
export declare const YouTubeMeta: StoryFn<{
|
|
6
|
+
metas: Metas;
|
|
7
|
+
}>;
|
|
8
|
+
export declare const DefaultMeta: StoryFn<{
|
|
9
|
+
metas: Metas;
|
|
10
|
+
}>;
|
|
11
|
+
export declare const JamespotMeta: StoryFn<{
|
|
12
|
+
metas: Metas;
|
|
13
|
+
}>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { JGlobalApi, SocialAction } from 'jamespot-user-api';
|
|
2
|
+
export declare const JRCSocialActions: ({ uri, actions, handlers, onReport, onError, }: {
|
|
3
|
+
uri: string;
|
|
4
|
+
actions: SocialAction[];
|
|
5
|
+
handlers: {
|
|
6
|
+
global: Pick<JGlobalApi, "addAction" | "removeAction" | "getUsers">;
|
|
7
|
+
};
|
|
8
|
+
onReport: (uri: string) => void;
|
|
9
|
+
onError?: (message?: string) => void;
|
|
10
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
|
+
import { Colors } from '../../styles/theme';
|
|
2
3
|
import { DataCy } from '../../types/dataAttributes';
|
|
3
4
|
import { ButtonColors, ButtonSizes, ButtonType } from '../JRCButton/types';
|
|
4
5
|
/**
|
|
@@ -16,6 +17,8 @@ type AnchorProps = {
|
|
|
16
17
|
as?: 'a';
|
|
17
18
|
asBlock?: boolean;
|
|
18
19
|
focusOffset?: string;
|
|
20
|
+
size?: ButtonSizes;
|
|
21
|
+
color?: Colors;
|
|
19
22
|
};
|
|
20
23
|
type ButtonProps = {
|
|
21
24
|
variant?: 'contained' | 'outlined';
|
|
@@ -2,6 +2,7 @@ import { CombinedWidgetContent, WidgetQuickSurveyContent, WidgetQuickSurveyConte
|
|
|
2
2
|
type JRCWidgetSurveyEditorProps = {
|
|
3
3
|
token?: string;
|
|
4
4
|
uniqid: string;
|
|
5
|
+
uri?: string;
|
|
5
6
|
content: WidgetQuickSurveyContent;
|
|
6
7
|
inplace?: boolean;
|
|
7
8
|
onChangeContent: (uniqid: string, content: {
|
|
@@ -14,5 +15,5 @@ type JRCWidgetSurveyEditorProps = {
|
|
|
14
15
|
onSave?: (uniqid: string, content: Partial<CombinedWidgetContent>) => void;
|
|
15
16
|
handleChange: (content: Partial<WidgetQuickSurveyContent>) => void;
|
|
16
17
|
};
|
|
17
|
-
export declare const JRCWidgetQuickSurveyEditor: ({ token, content, inplace, handleChange }: JRCWidgetSurveyEditorProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare const JRCWidgetQuickSurveyEditor: ({ token, uniqid, uri, content, inplace, handleChange, }: JRCWidgetSurveyEditorProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
19
|
export {};
|
package/dist/src/components/Widgets/JRCWidgetQuickSurvey/JRCWidgetQuickSurveyEditorAddEntry.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const JRCWidgetQuickSurveyEditorAddEntry: ({ content, handleNewItem, }: {
|
|
3
|
-
content: WidgetQuickSurveyContent;
|
|
1
|
+
export declare const JRCWidgetQuickSurveyEditorAddEntry: ({ handleNewItem }: {
|
|
4
2
|
handleNewItem: () => void;
|
|
5
3
|
}) => import("react/jsx-runtime").JSX.Element;
|
package/dist/src/components/Widgets/JRCWidgetQuickSurvey/JRCWidgetQuickSurveyEditorEntries.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { WidgetQuickSurveyContent } from 'jamespot-user-api';
|
|
2
|
-
export declare const JRCWidgetQuickSurveyEditorEntries: ({ content, token, handleChange, }: {
|
|
2
|
+
export declare const JRCWidgetQuickSurveyEditorEntries: ({ content, token, handleChange, isStarted, }: {
|
|
3
3
|
content: WidgetQuickSurveyContent;
|
|
4
4
|
token: string;
|
|
5
5
|
handleChange: (content: Partial<WidgetQuickSurveyContent>) => void;
|
|
6
|
+
isStarted?: boolean;
|
|
6
7
|
}) => import("react/jsx-runtime").JSX.Element;
|
package/dist/src/components/Widgets/JRCWidgetQuickSurvey/JRCWidgetQuickSurveyItemWrapper.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ type JRCWidgetQuickSurveyWrapperItemProps = {
|
|
|
16
16
|
handleRemoveImage: (idWidget: number) => void;
|
|
17
17
|
handleAddImageWidget: (index: number, file: jFileLittle) => void;
|
|
18
18
|
handleNewItem: () => void;
|
|
19
|
+
isStarted?: boolean;
|
|
19
20
|
};
|
|
20
21
|
export declare const JRCWidgetQuickSurveyWrapperItem: FC<JRCWidgetQuickSurveyWrapperItemProps>;
|
|
21
22
|
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { SurveyDateResponses } from './types';
|
|
3
|
+
export type JRCWidgetSurveyDateProps = {
|
|
4
|
+
initialDates: string[];
|
|
5
|
+
initialUserDates?: string[];
|
|
6
|
+
userResponses: SurveyDateResponses;
|
|
7
|
+
onChange: (dates: string[]) => void;
|
|
8
|
+
onClickRespondents: (date: string) => void;
|
|
9
|
+
context?: (date: string) => ReactNode;
|
|
10
|
+
isClosed: boolean;
|
|
11
|
+
};
|
|
12
|
+
export declare const JRCWidgetSurveyDate: ({ initialDates, initialUserDates, userResponses, onChange, onClickRespondents, context, isClosed, }: JRCWidgetSurveyDateProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Meta } from '@storybook/react-webpack5';
|
|
2
|
+
import { JRCWidgetSurveyDateProps } from './JRCWidgetSurveyDate';
|
|
3
|
+
declare const _default: Meta;
|
|
4
|
+
export default _default;
|
|
5
|
+
export declare const Primary: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react-webpack5').ReactRenderer, JRCWidgetSurveyDateProps>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { SurveyDateResponse } from './types';
|
|
3
|
+
export type SurveyDateItemProps = {
|
|
4
|
+
label: string;
|
|
5
|
+
date: string;
|
|
6
|
+
response?: SurveyDateResponse;
|
|
7
|
+
totalRespondents: number;
|
|
8
|
+
context?: ReactNode;
|
|
9
|
+
defaultValues?: {
|
|
10
|
+
isChecked: boolean;
|
|
11
|
+
};
|
|
12
|
+
onChange: (date: string) => void;
|
|
13
|
+
onClickRespondents: () => void;
|
|
14
|
+
isClosed: boolean;
|
|
15
|
+
};
|
|
16
|
+
export declare const SurveyDateItem: ({ label, date, response, totalRespondents, context, defaultValues, onChange, onClickRespondents, isClosed, }: SurveyDateItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { JSurveyDateApi, jUserLittle } from 'jamespot-user-api';
|
|
2
|
+
export type SurveyDateListItem = {
|
|
3
|
+
key: string;
|
|
4
|
+
list: string[];
|
|
5
|
+
date: string;
|
|
6
|
+
label: string;
|
|
7
|
+
};
|
|
8
|
+
export type SurveyDateList = Record<string, SurveyDateListItem>;
|
|
9
|
+
export type SurveyDateResponse = {
|
|
10
|
+
list: jUserLittle[];
|
|
11
|
+
total: number;
|
|
12
|
+
};
|
|
13
|
+
export type SurveyDateResponses = Record<string, SurveyDateResponse>;
|
|
14
|
+
export type WidgetSurveyDateHandlers = {
|
|
15
|
+
jamespot: {
|
|
16
|
+
surveyDate: Pick<JSurveyDateApi, 'revive'>;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
@@ -55,6 +55,7 @@ export { JRCAppLeftColumn } from './JRCAppLeftColumn/JRCAppLeftColumn';
|
|
|
55
55
|
export { JRCAttachments } from './JRCAttachments/JRCAttachments';
|
|
56
56
|
export { JRCAudience } from './JRCAudience/JRCAudience';
|
|
57
57
|
export { JRCAvatar } from './JRCAvatar/JRCAvatar';
|
|
58
|
+
export { JRCAvatars } from './JRCAvatars/JRCAvatars';
|
|
58
59
|
export { JRCButton } from './JRCButton/JRCButton';
|
|
59
60
|
export { JRCValidationButton } from './JRCButton/JRCValidationButton';
|
|
60
61
|
export { JRCButtonDownload } from './JRCButtonDownload/JRCButtonDownload';
|
|
@@ -70,8 +71,10 @@ export { JRCColumnRight } from './JRCColumnRight/JRCColumnRight';
|
|
|
70
71
|
export { JRCCommentsBloc } from './JRCCommentsBloc/JRCCommentsBloc';
|
|
71
72
|
export { JRCCropImage } from './JRCCropImage/JRCCropImage';
|
|
72
73
|
export { JRCDate } from './JRCDate/JRCDate';
|
|
74
|
+
export { JRCDateObject } from './JRCDate/JRCDateObject';
|
|
73
75
|
export { JRCDisplayCard } from './JRCDisplayCard/JRCDisplayCard';
|
|
74
|
-
export {
|
|
76
|
+
export { JRCDot } from './JRCDot/JRCDot';
|
|
77
|
+
export { DndProvider, Draggable, Droppable, JRCDndOneLevel, JRCDndOneLevelWithStack, JRCDndTwoLevelWithStack, } from './JRCDragNDrop';
|
|
75
78
|
export { JRCDropDown } from './JRCDropDown/JRCDropDown';
|
|
76
79
|
export { JRCEditor } from './JRCEditor/JRCEditor';
|
|
77
80
|
export { JRCModalSchedule } from './JRCEditor/JRCModalSchedule';
|
|
@@ -94,6 +97,7 @@ export { JRCLoadMore } from './JRCLoadMore/JRCLoadMore';
|
|
|
94
97
|
export { JRCMediaLoader } from './JRCMediaLoader/JRCMediaLoader';
|
|
95
98
|
export { JRCMenu } from './JRCMenu/JRCMenu';
|
|
96
99
|
export { JRCMessage } from './JRCMessage/JRCMessage';
|
|
100
|
+
export { JRCMetas } from './JRCMetas/JRCMetas';
|
|
97
101
|
export { JRCModalContent } from './JRCModal/JRCModalContent';
|
|
98
102
|
export { JRCModalContentForm } from './JRCModal/JRCModalContentForm';
|
|
99
103
|
export { JRCModalLayout } from './JRCModal/JRCModalLayout';
|
|
@@ -109,6 +113,7 @@ export { JRCSidePanelModalForm } from './JRCSidePanelModal/JRCSidePanelModalForm
|
|
|
109
113
|
export { JRCSkeletonLine } from './JRCSkeleton/JRCSkeletonLine';
|
|
110
114
|
export { JRCSkeletonList } from './JRCSkeleton/JRCSkeletonList';
|
|
111
115
|
export { JRCSkeletonSquare } from './JRCSkeleton/JRCSkeletonSquare';
|
|
116
|
+
export { JRCSocialActions } from './JRCSocialActions/JRCSocialActions';
|
|
112
117
|
export { JRCStyledHref } from './JRCStyledHref/JRCStyledHref';
|
|
113
118
|
export { JRCTabPanel, JRCTabs } from './JRCTabs/JRCTabs';
|
|
114
119
|
export { JRCTag } from './JRCTag/JRCTag';
|
|
@@ -116,7 +121,9 @@ export { JRCBaseTooltip } from './JRCTooltip/JRCBaseTooltip';
|
|
|
116
121
|
export { JRCTooltip } from './JRCTooltip/JRCTooltip';
|
|
117
122
|
export { JRCH1, JRCH2, JRCH3, JRCH4, JRCH5, JRCText } from './JRCTypo/JRCTypo';
|
|
118
123
|
export { JRCTypography } from './JRCTypography/JRCTypography';
|
|
124
|
+
export { JRCUserHighlightFields } from './JRCUserHighlightFields/JRCUserHighlightFields';
|
|
119
125
|
export { JRCUserPopup } from './JRCUserPopup/JRCUserPopup';
|
|
126
|
+
export { JRCUserStatusIcon } from './JRCUserStatusIcon/JRCUserStatusIcon';
|
|
120
127
|
export { JRCPageNotLogged } from './Pages/JRCPageNotLogged';
|
|
121
128
|
export { JRCFadeStepper } from './Stepper/JRCFadeStepper';
|
|
122
129
|
export { JRCImageStepper } from './Stepper/JRCImageStepper';
|
|
@@ -165,6 +172,7 @@ export { JRCWidgetQuickSurvey } from './Widgets/JRCWidgetQuickSurvey/JRCWidgetQu
|
|
|
165
172
|
export { JRCWidgetQuickSurveyEditor } from './Widgets/JRCWidgetQuickSurvey/JRCWidgetQuickSurveyEditor';
|
|
166
173
|
export { JRCWidgetArticleSliderEditor } from './Widgets/JRCWidgetSlider/JRCWidgetArticleSliderEditor';
|
|
167
174
|
export { JRCWidgetSlider } from './Widgets/JRCWidgetSlider/JRCWidgetSlider';
|
|
175
|
+
export { JRCWidgetSurveyDate } from './Widgets/JRCWidgetSurveyDate/JRCWidgetSurveyDate';
|
|
168
176
|
export { JRCWidgetDatasourceTableEditor } from './Widgets/JRCWidgetTable/JRCWidgetDatasourceTableEditor';
|
|
169
177
|
export { JRCWidgetExcelDatasourceTableEditor } from './Widgets/JRCWidgetTable/JRCWidgetExcelDatasourceTableEditor';
|
|
170
178
|
export { JRCWidgetTable } from './Widgets/JRCWidgetTable/JRCWidgetTable';
|
package/dist/src/index.d.ts
CHANGED
|
@@ -13,5 +13,4 @@ export { JRCThemeProvider } from './components/JRCThemeProvider/JRCThemeProvider
|
|
|
13
13
|
export * from './hooks';
|
|
14
14
|
export * from './types';
|
|
15
15
|
export { getColor } from './styles/theme';
|
|
16
|
-
export { modifyColorBrightness } from './styles/utils';
|
|
17
16
|
export { Utils } from './utils';
|
|
@@ -20,6 +20,7 @@ export type ThemeConfigOptions = {
|
|
|
20
20
|
forest: string;
|
|
21
21
|
};
|
|
22
22
|
export type Colors = 'primary' | 'primaryLight' | 'primaryTextLight' | 'secondary' | 'headerColor' | 'headerTextColor' | 'headerUserBackground' | 'headerUserTextColor' | 'headerSearchBarTextColor' | 'headerSearchBarBackgroundColor' | 'navBackground' | 'navTextColor' | 'lavender' | 'orange' | 'orangeLight' | 'orangeTextLight' | 'yellow' | 'green' | 'greenLight' | 'greenTextLight' | 'navy' | 'overseas' | 'night1' | 'night2' | 'sandLight' | 'raspberry' | 'sky' | 'sky15' | 'sand' | 'forest' | 'grey0' | 'grey1' | 'grey2' | 'grey3' | 'grey4' | 'grey5' | 'grey6' | 'black' | 'black10' | 'black15' | 'black20' | 'white' | 'transparent' | 'transparentHexa';
|
|
23
|
+
export declare const Palettes: Colors[];
|
|
23
24
|
type ThemeConfigColorType = {
|
|
24
25
|
[color in Colors]: string;
|
|
25
26
|
};
|