1mpacto-react-ui 2.0.28 → 2.0.30
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/components/fin/Chat/BubbleChatOption.cjs +1 -1
- package/dist/components/fin/Chat/BubbleChatOption.mjs +5 -4
- package/dist/package.json.cjs +1 -1
- package/dist/package.json.d.ts +1 -1
- package/dist/package.json.mjs +1 -1
- package/dist/src/components/index.d.ts +2 -1
- package/dist/src/interfaces/components/fin/Chat/index.d.ts +125 -2
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),s=require("react"),i=require("./style.module.scss.cjs"),N=require("../../Button/Button.cjs"),o=require("./Icons.cjs"),p=({id:n,icon:u,type:l,header:r,content:d,options:f,optionDirection:m,onClick:c,onCopy:x,onDislike:j,onLike:h,onReply:b})=>e.jsxs("div",{id:n,className:i.default.container,children:[e.jsxs("div",{className:i.default["container-card"],children:[s.isValidElement(u)&&e.jsx("div",{className:i.default.icon,children:u}),s.isValidElement(r)&&r,s.isValidElement(d)&&d,e.jsxs("div",{className:m==="column"?i.default["option-column"]:i.default["option-row"],children:[(l==="action"||l==="suggestion")&&f?.map((t,a)=>e.jsxs("button",{className:i.default["button-option"],onClick:()=>{typeof c=="function"&&c(t)},children:[e.jsxs("div",{className:i.default["left-section"],children:[s.isValidElement(t?.iconLeft)&&t.iconLeft,e.jsxs("div",{className:i.default["option-content"],children:[e.jsx("p",{className:l==="action"?i.default["text-action"]:i.default["text-suggestion"],children:t.title}),t?.subtitle&&e.jsx("p",{className:i.default["text-subtitle"],children:t.subtitle})]})]}),s.isValidElement(t?.iconRight)&&e.jsx("div",{className:i.default["right-section"],children:e.jsx("div",{className:i.default["icon-right"],children:t.iconRight})})]},a)),l==="system"&&f?.map((t,a)=>s.createElement(N.default,{...t,variants:t?.variants||"primary-fin-primary-500",size:t?.size||"fin-s",id:t.id,key:a,onClick:()=>{typeof c=="function"&&c(t)}},t.title))]})]}),e.jsxs("div",{className:i.default["container-action"],children:[e.jsx("button",{id:`${n}-like`,className:i.default["button-action"],onClick:h,children:e.jsx(o.LikeIcon,{})}),e.jsx("button",{id:`${n}-dislike`,className:i.default["button-action"],onClick:j,children:e.jsx(o.DislikeIcon,{})}),e.jsx("button",{id:`${n}-copy`,className:i.default["button-action"],onClick:x,children:e.jsx(o.CopyIcon,{})}),e.jsx("button",{id:`${n}-reply`,className:i.default["button-action"],onClick:b,children:e.jsx(o.ReplyIcon,{})})]})]});exports.default=p;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),s=require("react"),i=require("./style.module.scss.cjs"),N=require("../../Button/Button.cjs"),o=require("./Icons.cjs"),p=({id:n,icon:u,type:l,header:r,content:d,options:f,optionDirection:m,onClick:c,onCopy:x,onDislike:j,onLike:h,onReply:b})=>e.jsxs("div",{id:n,className:i.default.container,children:[e.jsxs("div",{className:i.default["container-card"],children:[s.isValidElement(u)&&e.jsx("div",{className:i.default.icon,children:u}),s.isValidElement(r)&&r,s.isValidElement(d)&&d,e.jsxs("div",{className:m==="column"?i.default["option-column"]:i.default["option-row"],children:[(l==="action"||l==="suggestion")&&f?.map((t,a)=>e.jsxs("button",{id:t.id,className:i.default["button-option"],onClick:()=>{typeof c=="function"&&c(t)},children:[e.jsxs("div",{className:i.default["left-section"],children:[s.isValidElement(t?.iconLeft)&&t.iconLeft,e.jsxs("div",{className:i.default["option-content"],children:[e.jsx("p",{className:l==="action"?i.default["text-action"]:i.default["text-suggestion"],children:t.title}),t?.subtitle&&e.jsx("p",{className:i.default["text-subtitle"],children:t.subtitle})]})]}),s.isValidElement(t?.iconRight)&&e.jsx("div",{className:i.default["right-section"],children:e.jsx("div",{className:i.default["icon-right"],children:t.iconRight})})]},a)),l==="system"&&f?.map((t,a)=>s.createElement(N.default,{...t,variants:t?.variants||"primary-fin-primary-500",size:t?.size||"fin-s",id:t.id,key:a,onClick:()=>{typeof c=="function"&&c(t)}},t.title))]})]}),e.jsxs("div",{className:i.default["container-action"],children:[e.jsx("button",{id:`${n}-like`,className:i.default["button-action"],onClick:h,children:e.jsx(o.LikeIcon,{})}),e.jsx("button",{id:`${n}-dislike`,className:i.default["button-action"],onClick:j,children:e.jsx(o.DislikeIcon,{})}),e.jsx("button",{id:`${n}-copy`,className:i.default["button-action"],onClick:x,children:e.jsx(o.CopyIcon,{})}),e.jsx("button",{id:`${n}-reply`,className:i.default["button-action"],onClick:b,children:e.jsx(o.ReplyIcon,{})})]})]});exports.default=p;
|
|
@@ -10,9 +10,9 @@ const z = ({
|
|
|
10
10
|
header: a,
|
|
11
11
|
content: u,
|
|
12
12
|
options: h,
|
|
13
|
-
optionDirection:
|
|
13
|
+
optionDirection: d,
|
|
14
14
|
onClick: l,
|
|
15
|
-
onCopy:
|
|
15
|
+
onCopy: p,
|
|
16
16
|
onDislike: f,
|
|
17
17
|
onLike: N,
|
|
18
18
|
onReply: b
|
|
@@ -21,10 +21,11 @@ const z = ({
|
|
|
21
21
|
c(m) && /* @__PURE__ */ t("div", { className: i.icon, children: m }),
|
|
22
22
|
c(a) && a,
|
|
23
23
|
c(u) && u,
|
|
24
|
-
/* @__PURE__ */ e("div", { className:
|
|
24
|
+
/* @__PURE__ */ e("div", { className: d === "column" ? i["option-column"] : i["option-row"], children: [
|
|
25
25
|
(s === "action" || s === "suggestion") && h?.map((n, r) => /* @__PURE__ */ e(
|
|
26
26
|
"button",
|
|
27
27
|
{
|
|
28
|
+
id: n.id,
|
|
28
29
|
className: i["button-option"],
|
|
29
30
|
onClick: () => {
|
|
30
31
|
typeof l == "function" && l(n);
|
|
@@ -61,7 +62,7 @@ const z = ({
|
|
|
61
62
|
/* @__PURE__ */ e("div", { className: i["container-action"], children: [
|
|
62
63
|
/* @__PURE__ */ t("button", { id: `${o}-like`, className: i["button-action"], onClick: N, children: /* @__PURE__ */ t(k, {}) }),
|
|
63
64
|
/* @__PURE__ */ t("button", { id: `${o}-dislike`, className: i["button-action"], onClick: f, children: /* @__PURE__ */ t(y, {}) }),
|
|
64
|
-
/* @__PURE__ */ t("button", { id: `${o}-copy`, className: i["button-action"], onClick:
|
|
65
|
+
/* @__PURE__ */ t("button", { id: `${o}-copy`, className: i["button-action"], onClick: p, children: /* @__PURE__ */ t(x, {}) }),
|
|
65
66
|
/* @__PURE__ */ t("button", { id: `${o}-reply`, className: i["button-action"], onClick: b, children: /* @__PURE__ */ t(C, {}) })
|
|
66
67
|
] })
|
|
67
68
|
] });
|
package/dist/package.json.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="2.0.
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="2.0.30",o={version:e};exports.default=o;exports.version=e;
|
package/dist/package.json.d.ts
CHANGED
package/dist/package.json.mjs
CHANGED
|
@@ -85,8 +85,9 @@ import { default as InputInnerLabel } from './Input/InputInnerLabel';
|
|
|
85
85
|
import { default as Text } from './Text/Text';
|
|
86
86
|
import { default as Slider } from './Slider/Slider';
|
|
87
87
|
import { BubbleChat, BubbleChatOption, BubbleChatUser } from './fin';
|
|
88
|
+
import { IBubbleChat, IBubbleChatOption, IDataOptionBubbleChat, IBubbleChatUser } from '../interfaces/components/fin/Chat';
|
|
88
89
|
import * as utilTable from '@tanstack/react-table';
|
|
89
90
|
import type * as SelectDropdownContainerType from 'react-select';
|
|
90
91
|
import type * as FilterContainerType from '../interfaces/components/FilterContainer';
|
|
91
92
|
export { TPublish, Button, Popover, Calendar, CalendarRange, DatePicker, DateRangePicker, FilterDate, InputFloatingInner, InputReguler, Pagination, Tabs, TabPanel, Table, TableVirtualization, ListVirtualization, SelectDropdownContainer, utilTable, Switch, ButtonIcon, Badges, Chips, RadioCheckbox, RadioCheckboxLabel, Breadcrumbs, Sidebar, Collapse, ModalDialog, SelectDropdownContainerComponents, Timeline, FilterContainer, NumberFormat, PatternFormat, DefaultCheckedChecboxIcon, DefaultRadioChecboxIcon, ConfigTable, PortalComponent, AlertContainer, UploadFile, TruncateComponent, UploadImage, Textarea, DoughnutChart, MonthYearPicker, CheckboxTable, InputNative, UploadMultipleFile, ErrorMessage, TextareaFloatingInner, Step, LineChart, Tooltip, ButtonPopover, GradientLineChart, GradientBarChart, PieChart, StepIndicator, TextEditor, CollapseV2, TableSubComponent, TimeRange, TextareaInnerLabel, InputInnerLabel, Text, Slider, BubbleChat, BubbleChatOption, BubbleChatUser, };
|
|
92
|
-
export type { ITableColumnDef, IRefPopover, IRefTableVirtualization, IRefListVirtualization, IRefSelectDropdownContainer, IChildrenSelectDropdownContainer, ISidebarModule, SelectDropdownContainerType, FilterContainerType, IInputReguler, IInputFloatingInner, ITableConfig, TButtonVariants, TButtonSize, ITabsList, TTypeEventTabs, ITextarea, IListVirtualization, ITableVirtualization, IRefSidebar, IChildrenIconCompany, ICloneElementSidebar, IDataDoughnutChart, IDataInnerLabelDoughnutChart, ISelectDropdownContainer, IDatePicker, IPopover, IInputNative, IUploadMultipleFileValue, IDataStepList, IDataLineChart, IChips, IRefButtonPopover, TGradientLineChartCustomTooltip, IGradientLineChart, IGradientLineChartDataSet, IGradientLineChartData, TGradientBarChartCustomTooltip, IGradientBarChart, IGradientBarChartDataSet, IGradientBarChartData, IFilterDateButtonList, TKeyFilterDateButtonListType, IDataGradientBarChartCustomTooltip, IDataGradientLineChartCustomTooltip, IPieChart, IPieChartDataSet, IPieChartData, TPieChartCustomTooltip, IDataPieChartCustomTooltip, IPieChartThreshold, ITextEditorProps, ICollapse, ITableColumnBreakpoint, TTableRenderSubComponent, TTableHandlerRowClick, TKeyLocale, ITimeRangeListTime, ITimeRange, TTimeRangeValue, IButton, TButtonIconVariants, TButtonIconSize, IButtonIcon, ISidebar, ISlider, };
|
|
93
|
+
export type { ITableColumnDef, IRefPopover, IRefTableVirtualization, IRefListVirtualization, IRefSelectDropdownContainer, IChildrenSelectDropdownContainer, ISidebarModule, SelectDropdownContainerType, FilterContainerType, IInputReguler, IInputFloatingInner, ITableConfig, TButtonVariants, TButtonSize, ITabsList, TTypeEventTabs, ITextarea, IListVirtualization, ITableVirtualization, IRefSidebar, IChildrenIconCompany, ICloneElementSidebar, IDataDoughnutChart, IDataInnerLabelDoughnutChart, ISelectDropdownContainer, IDatePicker, IPopover, IInputNative, IUploadMultipleFileValue, IDataStepList, IDataLineChart, IChips, IRefButtonPopover, TGradientLineChartCustomTooltip, IGradientLineChart, IGradientLineChartDataSet, IGradientLineChartData, TGradientBarChartCustomTooltip, IGradientBarChart, IGradientBarChartDataSet, IGradientBarChartData, IFilterDateButtonList, TKeyFilterDateButtonListType, IDataGradientBarChartCustomTooltip, IDataGradientLineChartCustomTooltip, IPieChart, IPieChartDataSet, IPieChartData, TPieChartCustomTooltip, IDataPieChartCustomTooltip, IPieChartThreshold, ITextEditorProps, ICollapse, ITableColumnBreakpoint, TTableRenderSubComponent, TTableHandlerRowClick, TKeyLocale, ITimeRangeListTime, ITimeRange, TTimeRangeValue, IButton, TButtonIconVariants, TButtonIconSize, IButtonIcon, ISidebar, ISlider, IBubbleChat, IBubbleChatOption, IDataOptionBubbleChat, IBubbleChatUser, };
|
|
@@ -1,39 +1,162 @@
|
|
|
1
1
|
import { IButton } from '../../Button';
|
|
2
|
+
/**
|
|
3
|
+
* [ID] : Struktur dasar untuk satu bubble chat.
|
|
4
|
+
* [EN] : Base structure for a single chat bubble.
|
|
5
|
+
*/
|
|
2
6
|
export interface IBubble {
|
|
7
|
+
/**
|
|
8
|
+
* [ID] : ID unik bubble.
|
|
9
|
+
* [EN] : Unique identifier of the bubble.
|
|
10
|
+
*/
|
|
3
11
|
id?: string;
|
|
12
|
+
/**
|
|
13
|
+
* [ID] : Isi konten bubble, bisa berupa node tunggal atau array node.
|
|
14
|
+
* [EN] : Bubble content, can be a single node or an array of nodes.
|
|
15
|
+
*/
|
|
4
16
|
content?: React.ReactNode | React.ReactNode[];
|
|
17
|
+
/**
|
|
18
|
+
* [ID] : Handler saat aksi copy konten dipicu.
|
|
19
|
+
* [EN] : Handler triggered when the copy content action fires.
|
|
20
|
+
*/
|
|
5
21
|
onCopy?: () => void;
|
|
6
22
|
}
|
|
23
|
+
/**
|
|
24
|
+
* [ID] : Bubble chat pihak lain (system/bot), dilengkapi aksi like/dislike/reply.
|
|
25
|
+
* [EN] : Chat bubble from the other party (system/bot), with like/dislike/reply actions.
|
|
26
|
+
*/
|
|
7
27
|
export interface IBubbleChat extends IBubble {
|
|
28
|
+
/**
|
|
29
|
+
* [ID] : Ikon yang ditampilkan pada bubble.
|
|
30
|
+
* [EN] : Icon displayed on the bubble.
|
|
31
|
+
*/
|
|
8
32
|
icon?: React.ReactNode;
|
|
33
|
+
/**
|
|
34
|
+
* [ID] : Header/judul bubble, bisa berupa node tunggal atau array node.
|
|
35
|
+
* [EN] : Bubble header/title, can be a single node or an array of nodes.
|
|
36
|
+
*/
|
|
9
37
|
header?: React.ReactNode | React.ReactNode[];
|
|
38
|
+
/**
|
|
39
|
+
* [ID] : Handler saat aksi like dipicu.
|
|
40
|
+
* [EN] : Handler triggered when the like action fires.
|
|
41
|
+
*/
|
|
10
42
|
onLike?: () => void;
|
|
43
|
+
/**
|
|
44
|
+
* [ID] : Handler saat aksi dislike dipicu.
|
|
45
|
+
* [EN] : Handler triggered when the dislike action fires.
|
|
46
|
+
*/
|
|
11
47
|
onDislike?: () => void;
|
|
48
|
+
/**
|
|
49
|
+
* [ID] : Handler saat aksi reply dipicu.
|
|
50
|
+
* [EN] : Handler triggered when the reply action fires.
|
|
51
|
+
*/
|
|
12
52
|
onReply?: () => void;
|
|
13
53
|
}
|
|
54
|
+
/**
|
|
55
|
+
* [ID] : Bubble chat milik user, dengan slot konten tambahan di atas dan bawah.
|
|
56
|
+
* [EN] : Chat bubble owned by the user, with extra content slots above and below.
|
|
57
|
+
*/
|
|
14
58
|
export interface IBubbleChatUser extends IBubble {
|
|
59
|
+
/**
|
|
60
|
+
* [ID] : Konten tambahan di atas bubble utama.
|
|
61
|
+
* [EN] : Extra content rendered above the main bubble.
|
|
62
|
+
*/
|
|
15
63
|
otherContentTop?: React.ReactNode | React.ReactNode[];
|
|
64
|
+
/**
|
|
65
|
+
* [ID] : Konten tambahan di bawah bubble utama.
|
|
66
|
+
* [EN] : Extra content rendered below the main bubble.
|
|
67
|
+
*/
|
|
16
68
|
otherContentBottom?: React.ReactNode | React.ReactNode[];
|
|
17
69
|
}
|
|
70
|
+
/**
|
|
71
|
+
* [ID] : Data satu opsi yang ditampilkan dalam bubble chat opsi (system/suggestion/action).
|
|
72
|
+
* [EN] : Data of a single option rendered inside an option chat bubble (system/suggestion/action).
|
|
73
|
+
*/
|
|
18
74
|
export interface IDataOptionBubbleChat {
|
|
75
|
+
/**
|
|
76
|
+
* [ID] : ID unik opsi.
|
|
77
|
+
* [EN] : Unique identifier of the option.
|
|
78
|
+
*/
|
|
19
79
|
id: string;
|
|
80
|
+
/**
|
|
81
|
+
* [ID] : Judul opsi.
|
|
82
|
+
* [EN] : Title of the option.
|
|
83
|
+
*/
|
|
20
84
|
title: string;
|
|
85
|
+
/**
|
|
86
|
+
* [ID] : Subjudul/deskripsi tambahan opsi.
|
|
87
|
+
* [EN] : Subtitle/additional description of the option.
|
|
88
|
+
*/
|
|
21
89
|
subtitle?: string;
|
|
90
|
+
/**
|
|
91
|
+
* [ID] : Ikon di sisi kanan opsi.
|
|
92
|
+
* [EN] : Icon rendered on the right side of the option.
|
|
93
|
+
*/
|
|
22
94
|
iconRight?: React.ReactNode;
|
|
95
|
+
/**
|
|
96
|
+
* [ID] : Ikon di sisi kiri opsi.
|
|
97
|
+
* [EN] : Icon rendered on the left side of the option.
|
|
98
|
+
*/
|
|
23
99
|
iconLeft?: React.ReactNode;
|
|
24
100
|
}
|
|
101
|
+
/**
|
|
102
|
+
* [ID] : Struktur dasar internal untuk bubble chat yang memiliki daftar opsi.
|
|
103
|
+
* [EN] : Internal base structure for a chat bubble that carries a list of options.
|
|
104
|
+
*/
|
|
25
105
|
interface IBaseBubbleChatOption extends IBubbleChat {
|
|
106
|
+
/**
|
|
107
|
+
* [ID] : Arah tata letak daftar opsi (kolom atau baris).
|
|
108
|
+
* [EN] : Layout direction of the option list (column or row).
|
|
109
|
+
*/
|
|
26
110
|
optionDirection?: 'column' | 'row';
|
|
27
111
|
}
|
|
112
|
+
/**
|
|
113
|
+
* [ID] : Bubble chat opsi bertipe system, opsi ditampilkan sebagai tombol.
|
|
114
|
+
* [EN] : System-type option chat bubble, options rendered as buttons.
|
|
115
|
+
*/
|
|
28
116
|
interface ISystemBubbleChatOption extends IBaseBubbleChatOption {
|
|
117
|
+
/**
|
|
118
|
+
* [ID] : Penanda tipe bubble opsi sebagai system.
|
|
119
|
+
* [EN] : Discriminator marking the option bubble as system type.
|
|
120
|
+
*/
|
|
29
121
|
type: 'system';
|
|
30
|
-
|
|
31
|
-
|
|
122
|
+
/**
|
|
123
|
+
* [ID] : Daftar opsi, gabungan properti tombol (tanpa children) dan data opsi.
|
|
124
|
+
* [EN] : List of options, combining button props (without children) and option data.
|
|
125
|
+
*/
|
|
126
|
+
options?: (Omit<IButton, 'children'> & IDataOptionBubbleChat)[];
|
|
127
|
+
/**
|
|
128
|
+
* [ID] : Handler saat salah satu opsi diklik.
|
|
129
|
+
* [EN] : Handler triggered when one of the options is clicked.
|
|
130
|
+
* @param data - [ID] : Data opsi (gabungan properti tombol dan data opsi) yang diklik.
|
|
131
|
+
* [EN] : Option data (button props combined with option data) that was clicked.
|
|
132
|
+
*/
|
|
133
|
+
onClick?: (data: Omit<IButton, 'children'> & IDataOptionBubbleChat) => void;
|
|
32
134
|
}
|
|
135
|
+
/**
|
|
136
|
+
* [ID] : Bubble chat opsi bertipe suggestion/action.
|
|
137
|
+
* [EN] : Suggestion/action-type option chat bubble.
|
|
138
|
+
*/
|
|
33
139
|
interface IOtherBubbleChatOption extends IBaseBubbleChatOption {
|
|
140
|
+
/**
|
|
141
|
+
* [ID] : Penanda tipe bubble opsi sebagai suggestion atau action.
|
|
142
|
+
* [EN] : Discriminator marking the option bubble as suggestion or action type.
|
|
143
|
+
*/
|
|
34
144
|
type: 'suggestion' | 'action';
|
|
145
|
+
/**
|
|
146
|
+
* [ID] : Daftar opsi yang ditampilkan.
|
|
147
|
+
* [EN] : List of options to render.
|
|
148
|
+
*/
|
|
35
149
|
options?: IDataOptionBubbleChat[];
|
|
150
|
+
/**
|
|
151
|
+
* [ID] : Handler saat salah satu opsi diklik.
|
|
152
|
+
* [EN] : Handler triggered when one of the options is clicked.
|
|
153
|
+
* @param data - [ID] : Data opsi yang diklik. [EN] : Option data that was clicked.
|
|
154
|
+
*/
|
|
36
155
|
onClick?: (data: IDataOptionBubbleChat) => void;
|
|
37
156
|
}
|
|
157
|
+
/**
|
|
158
|
+
* [ID] : Union tipe bubble chat opsi, bisa system atau suggestion/action.
|
|
159
|
+
* [EN] : Union type of option chat bubbles, either system or suggestion/action.
|
|
160
|
+
*/
|
|
38
161
|
export type IBubbleChatOption = ISystemBubbleChatOption | IOtherBubbleChatOption;
|
|
39
162
|
export {};
|