app-tutor-ai-consumer 1.22.0 → 1.22.2
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/CHANGELOG.md +13 -0
- package/config/vitest/__mocks__/window.ts +11 -0
- package/config/vitest/vitest.config.mts +1 -0
- package/package.json +1 -1
- package/src/config/datahub/actions.ts +6 -0
- package/src/config/datahub/constants.ts +3 -6
- package/src/config/datahub/entities.ts +2 -1
- package/src/config/datahub/schemas/base-click-schema.ts +48 -0
- package/src/config/datahub/schemas/base-try-schema.ts +64 -0
- package/src/config/datahub/schemas/tutor/__tests__/click-hotmart-tutor.spec.ts +2 -1
- package/src/config/datahub/schemas/tutor/click-hotmart-tutor.ts +2 -1
- package/src/config/datahub/schemas/tutor/click-tutor-minimize.ts +24 -0
- package/src/config/datahub/schemas/tutor/index.ts +1 -0
- package/src/config/datahub/schemas/tutor/try-product-tutor.ts +24 -0
- package/src/config/datahub/types.ts +3 -1
- package/src/config/theme/constants.ts +7 -0
- package/src/development-bootstrap.tsx +3 -0
- package/src/lib/components/button/button-default.tsx +1 -1
- package/src/lib/components/button/button.tsx +16 -14
- package/src/lib/components/button/styles.module.css +6 -0
- package/src/lib/components/errors/generic/generic-error.tsx +9 -25
- package/src/lib/components/icons/copy-solid.svg +5 -0
- package/src/lib/components/icons/icon-names.d.ts +4 -0
- package/src/lib/components/icons/like-solid.svg +5 -0
- package/src/lib/components/icons/send.svg +5 -3
- package/src/lib/components/icons/sparkle-tutor-light.svg +15 -0
- package/src/lib/components/icons/sparkle-tutor.svg +19 -0
- package/src/lib/components/index.ts +1 -0
- package/src/lib/components/tooltip/index.ts +2 -0
- package/src/lib/components/tooltip/styles.module.css +39 -0
- package/src/lib/components/tooltip/tooltip.tsx +41 -0
- package/src/lib/hooks/index.ts +1 -0
- package/src/lib/hooks/use-media-query/index.ts +2 -0
- package/src/lib/hooks/use-media-query/use-media-query.tsx +20 -0
- package/src/main/main.tsx +1 -1
- package/src/modules/messages/components/chat-input/chat-input.tsx +5 -4
- package/src/modules/messages/components/chat-input/styles.module.css +4 -0
- package/src/modules/messages/components/message-actions/message-actions.tsx +21 -14
- package/src/modules/messages/components/message-item/message-item.tsx +1 -1
- package/src/modules/widget/components/ai-avatar/ai-avatar.tsx +19 -8
- package/src/modules/widget/components/avatar-animation/avatar-animation.tsx +1 -1
- package/src/modules/widget/components/greetings-card/greetings-card.tsx +5 -0
- package/src/modules/widget/components/header/header.spec.tsx +34 -6
- package/src/modules/widget/components/header/header.tsx +35 -23
- package/src/modules/widget/components/header/types.ts +1 -1
- package/src/modules/widget/components/information-page/constants.ts +3 -2
- package/src/modules/widget/components/information-page/information-page.tsx +4 -3
- package/src/modules/widget/components/scroll-to-bottom-button/scroll-to-bottom-button.tsx +2 -2
- package/src/modules/widget/components/starter-page/starter-page.spec.tsx +1 -1
- package/src/modules/widget/components/starter-page/starter-page.tsx +24 -22
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
## [1.22.2](https://github.com/Hotmart-Org/app-tutor-ai-consumer/compare/v1.22.1...v1.22.2) (2025-08-07)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
- header qa issues part 1 ([4910041](https://github.com/Hotmart-Org/app-tutor-ai-consumer/commit/4910041905995e3b8161d015b261c82331131d20))
|
|
6
|
+
- qa issues part 2 ([65d5eb6](https://github.com/Hotmart-Org/app-tutor-ai-consumer/commit/65d5eb64768f7496a1f767a6d2bd9e614abef547))
|
|
7
|
+
|
|
8
|
+
## [1.22.1](https://github.com/Hotmart-Org/app-tutor-ai-consumer/compare/v1.22.0...v1.22.1) (2025-08-06)
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
- qa issues part 1 ([6b99c06](https://github.com/Hotmart-Org/app-tutor-ai-consumer/commit/6b99c06114fee13fb4d4dd68e4888392007988a4))
|
|
13
|
+
|
|
1
14
|
# [1.22.0](https://github.com/Hotmart-Org/app-tutor-ai-consumer/compare/v1.21.2...v1.22.0) (2025-08-04)
|
|
2
15
|
|
|
3
16
|
### Features
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
Object.defineProperty(window, 'matchMedia', {
|
|
2
|
+
writable: true,
|
|
3
|
+
value: vi.fn().mockImplementation((query) => ({
|
|
4
|
+
matches: false,
|
|
5
|
+
media: query,
|
|
6
|
+
onchange: null,
|
|
7
|
+
addEventListener: vi.fn(),
|
|
8
|
+
removeEventListener: vi.fn(),
|
|
9
|
+
dispatchEvent: vi.fn()
|
|
10
|
+
}))
|
|
11
|
+
})
|
|
@@ -15,6 +15,7 @@ export default defineConfig({
|
|
|
15
15
|
'./config/vitest/__mocks__/icons.tsx',
|
|
16
16
|
'./config/vitest/__mocks__/animation-avatar.tsx',
|
|
17
17
|
'./config/vitest/__mocks__/intersection-observer.ts',
|
|
18
|
+
'./config/vitest/__mocks__/window.ts',
|
|
18
19
|
'./config/vitest/polyfills/global.js'
|
|
19
20
|
],
|
|
20
21
|
coverage: {
|
package/package.json
CHANGED
|
@@ -8,3 +8,9 @@ export const DataHubActions = {
|
|
|
8
8
|
} as const
|
|
9
9
|
|
|
10
10
|
export type DataHubActionTypes = (typeof DataHubActions)[keyof typeof DataHubActions]
|
|
11
|
+
|
|
12
|
+
export const ActionNames = {
|
|
13
|
+
CLICK_HOTMART_TUTOR: `${DataHubActions.CLICK}_hotmart_tutor`,
|
|
14
|
+
CLICK_TUTOR_MINIMIZE: `${DataHubActions.CLICK}_tutor_minimize`,
|
|
15
|
+
TRY_PRODUCT_TUTOR: `${DataHubActions.TRY}_product_tutor`
|
|
16
|
+
} as const
|
|
@@ -6,10 +6,6 @@ export const System = {
|
|
|
6
6
|
HOTMART_CLUB: 'hotmart_club'
|
|
7
7
|
} as const
|
|
8
8
|
|
|
9
|
-
export const ActionNames = {
|
|
10
|
-
CLICK_HOTMART_TUTOR: 'click_hotmart_tutor'
|
|
11
|
-
} as const
|
|
12
|
-
|
|
13
9
|
export const ScreenNames = {
|
|
14
10
|
NOT_APP_EVENT: 'NOT_APP_EVENT',
|
|
15
11
|
HOME_CONSUMER: 'HOME_CONSUMER'
|
|
@@ -19,7 +15,7 @@ export const Platform = {
|
|
|
19
15
|
WEB: 'WEB'
|
|
20
16
|
} as const
|
|
21
17
|
|
|
22
|
-
export const
|
|
18
|
+
export const Result = {
|
|
23
19
|
SUCCESS: 'SUCCESSFUL',
|
|
24
20
|
FAILURE: 'FAILURE',
|
|
25
21
|
FAILURE_DESCRIPTION: 'NOT_FAILURE_RESULT_EVENT'
|
|
@@ -27,7 +23,8 @@ export const ResultType = {
|
|
|
27
23
|
|
|
28
24
|
export const ComponentNames = {
|
|
29
25
|
BUTTON_LIKE_ANSWER: 'BUTTON_LIKE_ANSWER',
|
|
30
|
-
BUTTON_DISLIKE_ANSWER: 'BUTTON_DISLIKE_ANSWER'
|
|
26
|
+
BUTTON_DISLIKE_ANSWER: 'BUTTON_DISLIKE_ANSWER',
|
|
27
|
+
BUTTON_CLOSE_TUTOR_CHAT: 'BUTTON_CLOSE_TUTOR_CHAT'
|
|
31
28
|
} as const
|
|
32
29
|
|
|
33
30
|
export const ComponentSource = {
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { ScreenNames } from '../constants'
|
|
2
|
+
import { DataHubEntities } from '../entities'
|
|
3
|
+
import type { ComponentNamesType, DataHubEntityTypes, ScreenNamesType } from '../types'
|
|
4
|
+
|
|
5
|
+
import BaseSchema from './base-schema'
|
|
6
|
+
|
|
7
|
+
export type BaseClickSchemaConstructorProps = {
|
|
8
|
+
componentName: ComponentNamesType
|
|
9
|
+
entity?: DataHubEntityTypes
|
|
10
|
+
isLogged?: boolean
|
|
11
|
+
screenName?: ScreenNamesType
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
abstract class BaseClickSchema extends BaseSchema {
|
|
15
|
+
protected componentName: ComponentNamesType
|
|
16
|
+
protected screenName: ScreenNamesType
|
|
17
|
+
|
|
18
|
+
entity: DataHubEntityTypes
|
|
19
|
+
isLogged: boolean
|
|
20
|
+
|
|
21
|
+
constructor(args: BaseClickSchemaConstructorProps) {
|
|
22
|
+
const {
|
|
23
|
+
componentName,
|
|
24
|
+
entity = DataHubEntities.HOME,
|
|
25
|
+
isLogged = true,
|
|
26
|
+
screenName = ScreenNames.HOME_CONSUMER
|
|
27
|
+
} = args
|
|
28
|
+
|
|
29
|
+
super()
|
|
30
|
+
|
|
31
|
+
this.componentName = componentName
|
|
32
|
+
this.entity = entity
|
|
33
|
+
this.isLogged = isLogged
|
|
34
|
+
this.screenName = screenName
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
prepare() {
|
|
38
|
+
return {
|
|
39
|
+
...super.prepare(),
|
|
40
|
+
componentName: this.componentName,
|
|
41
|
+
entity: this.entity,
|
|
42
|
+
isLogged: this.isLogged,
|
|
43
|
+
screenName: this.screenName
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export default BaseClickSchema
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { HttpCodes } from '@/src/lib/utils'
|
|
2
|
+
import { Result } from '../constants'
|
|
3
|
+
import { DataHubEntities } from '../entities'
|
|
4
|
+
import type { DataHubEntityTypes, ResultType } from '../types'
|
|
5
|
+
|
|
6
|
+
import BaseSchema from './base-schema'
|
|
7
|
+
|
|
8
|
+
export type BaseTrySchemaConstructorArgs = {
|
|
9
|
+
componentName: string
|
|
10
|
+
componentSource: string
|
|
11
|
+
entity?: DataHubEntityTypes
|
|
12
|
+
isLogged?: boolean
|
|
13
|
+
result?: ResultType
|
|
14
|
+
statusCode?: number
|
|
15
|
+
failureDescription?: string
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
abstract class BaseTrySchema extends BaseSchema {
|
|
19
|
+
private componentName: string
|
|
20
|
+
private componentSource: string
|
|
21
|
+
private failureDescription: string
|
|
22
|
+
private result: ResultType
|
|
23
|
+
private statusCode: number
|
|
24
|
+
|
|
25
|
+
entity: DataHubEntityTypes
|
|
26
|
+
isLogged: boolean
|
|
27
|
+
|
|
28
|
+
constructor(args: BaseTrySchemaConstructorArgs) {
|
|
29
|
+
const {
|
|
30
|
+
componentName,
|
|
31
|
+
componentSource,
|
|
32
|
+
entity = DataHubEntities.HOME,
|
|
33
|
+
failureDescription = Result.FAILURE_DESCRIPTION,
|
|
34
|
+
isLogged = true,
|
|
35
|
+
result = Result.SUCCESS,
|
|
36
|
+
statusCode = HttpCodes.OK
|
|
37
|
+
} = args
|
|
38
|
+
|
|
39
|
+
super()
|
|
40
|
+
|
|
41
|
+
this.componentName = componentName
|
|
42
|
+
this.componentSource = componentSource
|
|
43
|
+
this.entity = entity
|
|
44
|
+
this.failureDescription = failureDescription
|
|
45
|
+
this.isLogged = isLogged
|
|
46
|
+
this.result = result
|
|
47
|
+
this.statusCode = statusCode
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
prepare(): Record<string, unknown> {
|
|
51
|
+
return {
|
|
52
|
+
...super.prepare(),
|
|
53
|
+
componentName: this.componentName,
|
|
54
|
+
componentSource: this.componentSource,
|
|
55
|
+
entity: this.entity,
|
|
56
|
+
failureDescription: this.failureDescription,
|
|
57
|
+
isLogged: this.isLogged,
|
|
58
|
+
result: this.result,
|
|
59
|
+
statusCode: this.statusCode
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export default BaseTrySchema
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { chance } from '@/src/config/tests'
|
|
2
2
|
import { DataHubStore } from '../../..'
|
|
3
|
-
import { ActionNames
|
|
3
|
+
import { ActionNames } from '../../../actions'
|
|
4
|
+
import { ComponentNames, ScreenNames } from '../../../constants'
|
|
4
5
|
import { DataHubEntities } from '../../../entities'
|
|
5
6
|
import { UserRole } from '../../constants'
|
|
6
7
|
import ClickHotmartTutor from '../click-hotmart-tutor'
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { ActionNames
|
|
1
|
+
import { ActionNames } from '../../actions'
|
|
2
|
+
import { ComponentNames, ScreenNames } from '../../constants'
|
|
2
3
|
import { DataHubEntities } from '../../entities'
|
|
3
4
|
import type {
|
|
4
5
|
ActionNamesType,
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ActionNames } from '../../actions'
|
|
2
|
+
import { ComponentNames } from '../../constants'
|
|
3
|
+
import { DataHubEntities } from '../../entities'
|
|
4
|
+
import type { ActionNamesType } from '../../types'
|
|
5
|
+
import BaseClickSchema from '../base-click-schema'
|
|
6
|
+
|
|
7
|
+
class ClickTutorMinimizeSchema extends BaseClickSchema {
|
|
8
|
+
action: ActionNamesType
|
|
9
|
+
|
|
10
|
+
constructor() {
|
|
11
|
+
super({ componentName: ComponentNames.BUTTON_CLOSE_TUTOR_CHAT })
|
|
12
|
+
|
|
13
|
+
this.action = ActionNames.CLICK_TUTOR_MINIMIZE
|
|
14
|
+
this.entity = DataHubEntities.PRODUCT_CONSUME
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
getDataHubEventData(): Record<string, unknown> {
|
|
18
|
+
return {
|
|
19
|
+
...super.prepare()
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export default ClickTutorMinimizeSchema
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ActionNames } from '../../actions'
|
|
2
|
+
import type { ActionNamesType } from '../../types'
|
|
3
|
+
import type { BaseTrySchemaConstructorArgs } from '../base-try-schema'
|
|
4
|
+
import BaseTrySchema from '../base-try-schema'
|
|
5
|
+
|
|
6
|
+
export type TryProductTutorConstructorArgs = BaseTrySchemaConstructorArgs
|
|
7
|
+
|
|
8
|
+
class TryProductTutor extends BaseTrySchema {
|
|
9
|
+
action: ActionNamesType
|
|
10
|
+
|
|
11
|
+
constructor(args: TryProductTutorConstructorArgs) {
|
|
12
|
+
super(args)
|
|
13
|
+
|
|
14
|
+
this.action = ActionNames.TRY_PRODUCT_TUTOR
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
getDataHubEventData(): Record<string, unknown> {
|
|
18
|
+
return {
|
|
19
|
+
...this.prepare()
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export default TryProductTutor
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { ActionNames
|
|
1
|
+
import type { ActionNames } from './actions'
|
|
2
|
+
import type { ComponentNames, Platform, Result, ScreenNames, System } from './constants'
|
|
2
3
|
import type { DataHubEntities } from './entities'
|
|
3
4
|
|
|
4
5
|
export type ActionNamesType = (typeof ActionNames)[keyof typeof ActionNames]
|
|
@@ -7,6 +8,7 @@ export type PlatformType = (typeof Platform)[keyof typeof Platform]
|
|
|
7
8
|
export type SystemType = (typeof System)[keyof typeof System]
|
|
8
9
|
export type ComponentNamesType = (typeof ComponentNames)[keyof typeof ComponentNames]
|
|
9
10
|
export type ScreenNamesType = (typeof ScreenNames)[keyof typeof ScreenNames]
|
|
11
|
+
export type ResultType = (typeof Result)[keyof typeof Result]
|
|
10
12
|
|
|
11
13
|
export type SchemaType = {
|
|
12
14
|
action: ActionNamesType
|
|
@@ -23,6 +23,9 @@ if (devMode) {
|
|
|
23
23
|
'bg-ai-dark fixed bottom-5 right-5 w-[27rem] h-[min(43rem,calc(100vh-2.5rem))] max-h-[calc(100vh-2.5rem)] z-10 rounded-[0.625rem] border border-neutral-200 shadow-lg overflow-hidden flex flex-col'
|
|
24
24
|
)
|
|
25
25
|
|
|
26
|
+
// Theme setter
|
|
27
|
+
container.setAttribute('data-theme', 'dark')
|
|
28
|
+
|
|
26
29
|
root?.appendChild(container)
|
|
27
30
|
|
|
28
31
|
await window.startChatWidget(rootId, {
|
|
@@ -21,7 +21,7 @@ function ButtonDefault({
|
|
|
21
21
|
<button
|
|
22
22
|
{...props}
|
|
23
23
|
className={clsx(
|
|
24
|
-
'rounded text-base font-medium outline-none focus-visible:ring-2 focus-visible:ring-
|
|
24
|
+
'rounded text-base font-medium outline-none focus-visible:ring-2 focus-visible:ring-neutral-500',
|
|
25
25
|
className
|
|
26
26
|
)}
|
|
27
27
|
type={props.type ?? 'button'}
|
|
@@ -58,9 +58,10 @@ function Button({
|
|
|
58
58
|
show={show}
|
|
59
59
|
className={clsx(
|
|
60
60
|
className,
|
|
61
|
+
styles.gradientButton,
|
|
61
62
|
'group relative inline-flex items-center justify-center overflow-hidden rounded-lg p-[1px]',
|
|
62
63
|
{
|
|
63
|
-
'bg-gradient-to-br from-[var(--ai-color-gradient-primary)] to-[var(--ai-color-gradient-accent)] hover:text-neutral-1000
|
|
64
|
+
'bg-gradient-to-br from-[var(--ai-color-gradient-primary)] to-[var(--ai-color-gradient-accent)] hover:text-neutral-1000':
|
|
64
65
|
!loading,
|
|
65
66
|
'shine-box cursor-not-allowed': loading
|
|
66
67
|
}
|
|
@@ -68,8 +69,11 @@ function Button({
|
|
|
68
69
|
<span
|
|
69
70
|
data-label='text-content'
|
|
70
71
|
className={clsx(
|
|
71
|
-
'
|
|
72
|
-
'
|
|
72
|
+
'rounded-lg transition-all duration-75 ease-in',
|
|
73
|
+
'px-5 py-2.5',
|
|
74
|
+
'text-neutral-1000',
|
|
75
|
+
'bg-[var(--gradient-btn-hover-background)] hover:bg-[linear-gradient(to_right,_rgb(from_var(--gradient-btn-hover-foreground)_r_g_b_/_var(--gradient-btn-hover-foreground-opacity)),_rgb(from_var(--gradient-btn-hover-foreground)_r_g_b_/_var(--gradient-btn-hover-foreground-opacity))),_linear-gradient(to_right,_var(--gradient-btn-hover-background),_var(--gradient-btn-hover-background))] group-hover:bg-[linear-gradient(to_right,_rgb(from_var(--gradient-btn-hover-foreground)_r_g_b_/_var(--gradient-btn-hover-foreground-opacity)),_rgb(from_var(--gradient-btn-hover-foreground)_r_g_b_/_var(--gradient-btn-hover-foreground-opacity))),_linear-gradient(to_right,_var(--gradient-btn-hover-background),_var(--gradient-btn-hover-background))]',
|
|
76
|
+
'flex flex-1 flex-nowrap'
|
|
73
77
|
)}>
|
|
74
78
|
<span className={clsx({ 'opacity-20': loading })}>{children}</span>
|
|
75
79
|
</span>
|
|
@@ -94,20 +98,19 @@ function Button({
|
|
|
94
98
|
)
|
|
95
99
|
case 'secondary':
|
|
96
100
|
return (
|
|
97
|
-
<
|
|
101
|
+
<ButtonDefault
|
|
98
102
|
className={clsx(
|
|
99
|
-
gridClasses,
|
|
100
103
|
defaultPadding,
|
|
101
104
|
defaultClasses,
|
|
102
105
|
defaultBorder,
|
|
103
|
-
'border-neutral-900 bg-transparent text-neutral-900 hover:bg-
|
|
106
|
+
'border-neutral-900 bg-transparent text-neutral-900 hover:bg-[rgb(from_var(--hc-color-neutral-900)_r_g_b_/_0.05)]',
|
|
104
107
|
className
|
|
105
108
|
)}
|
|
106
109
|
{...props}
|
|
107
110
|
disabled={props.disabled || loading}
|
|
108
111
|
aria-busy={loading}>
|
|
109
112
|
<ButtonContent loading={loading}>{children}</ButtonContent>
|
|
110
|
-
</
|
|
113
|
+
</ButtonDefault>
|
|
111
114
|
)
|
|
112
115
|
case 'tertiary':
|
|
113
116
|
return (
|
|
@@ -125,9 +128,8 @@ function Button({
|
|
|
125
128
|
)
|
|
126
129
|
case 'brand':
|
|
127
130
|
return (
|
|
128
|
-
<
|
|
131
|
+
<ButtonDefault
|
|
129
132
|
className={clsx(
|
|
130
|
-
gridClasses,
|
|
131
133
|
defaultPadding,
|
|
132
134
|
defaultClasses,
|
|
133
135
|
defaultBorder,
|
|
@@ -138,15 +140,15 @@ function Button({
|
|
|
138
140
|
disabled={props.disabled || loading}
|
|
139
141
|
aria-busy={loading}>
|
|
140
142
|
<ButtonContent loading={loading}>{children}</ButtonContent>
|
|
141
|
-
</
|
|
143
|
+
</ButtonDefault>
|
|
142
144
|
)
|
|
143
145
|
default:
|
|
144
146
|
return (
|
|
145
|
-
<
|
|
147
|
+
<ButtonDefault
|
|
146
148
|
className={clsx(
|
|
147
|
-
'rounded-full outline-none transition-colors duration-
|
|
149
|
+
'rounded-full outline-none transition-colors duration-100',
|
|
148
150
|
{
|
|
149
|
-
'cursor-pointer
|
|
151
|
+
'cursor-pointer hover:bg-neutral-300 hover:text-current focus:bg-neutral-300 focus:text-current':
|
|
150
152
|
!props.disabled,
|
|
151
153
|
[disabledClasses]: props.disabled
|
|
152
154
|
},
|
|
@@ -157,7 +159,7 @@ function Button({
|
|
|
157
159
|
disabled={props.disabled || loading}
|
|
158
160
|
aria-busy={loading}>
|
|
159
161
|
<ButtonContent loading={loading}>{children}</ButtonContent>
|
|
160
|
-
</
|
|
162
|
+
</ButtonDefault>
|
|
161
163
|
)
|
|
162
164
|
}
|
|
163
165
|
}
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
.gradientButton {
|
|
2
|
+
--gradient-btn-hover-background: var(--hc-color-neutral-100);
|
|
3
|
+
--gradient-btn-hover-foreground: var(--hc-color-neutral-1000);
|
|
4
|
+
--gradient-btn-hover-foreground-opacity: 0.07;
|
|
5
|
+
}
|
|
6
|
+
|
|
1
7
|
.tertiary {
|
|
2
8
|
&:hover {
|
|
3
9
|
background-color: hsl(from currentColor h s calc(l - 30));
|
|
@@ -1,20 +1,17 @@
|
|
|
1
|
-
import clsx from 'clsx'
|
|
2
1
|
import { useTranslation } from 'react-i18next'
|
|
3
2
|
|
|
4
3
|
import ErrorDarkSVG from '@/public/assets/svg/error-dark.svg?url'
|
|
5
4
|
import ErrorLightSVG from '@/public/assets/svg/error-light.svg?url'
|
|
6
5
|
import { Button } from '@/src/lib/components'
|
|
7
|
-
import { PageLayout, TutorWidgetEvents
|
|
6
|
+
import { PageLayout, TutorWidgetEvents } from '@/src/modules/widget'
|
|
8
7
|
import { WidgetHeader } from '@/src/modules/widget/components/header'
|
|
9
8
|
|
|
10
|
-
function GenericError() {
|
|
9
|
+
function GenericError({ isDarkMode = false }: { isDarkMode?: boolean }) {
|
|
11
10
|
const { t } = useTranslation()
|
|
12
|
-
const [settings] = useWidgetSettingsAtom()
|
|
13
|
-
const isDarkMode = settings?.config?.theme === 'dark'
|
|
14
11
|
|
|
15
12
|
return (
|
|
16
13
|
<PageLayout className='p-5'>
|
|
17
|
-
<WidgetHeader enabledButtons={['close']}
|
|
14
|
+
<WidgetHeader enabledButtons={['close']} />
|
|
18
15
|
|
|
19
16
|
<div className='flex h-full flex-col items-center justify-center p-10'>
|
|
20
17
|
<div className='mb-8 flex flex-col items-center gap-1 text-center'>
|
|
@@ -26,38 +23,25 @@ function GenericError() {
|
|
|
26
23
|
height={200}
|
|
27
24
|
/>
|
|
28
25
|
|
|
29
|
-
<h2
|
|
30
|
-
|
|
31
|
-
'text-white': isDarkMode,
|
|
32
|
-
'text-gray-800': !isDarkMode
|
|
33
|
-
})}>
|
|
34
|
-
{t('generic_error.title')}
|
|
35
|
-
</h2>
|
|
36
|
-
|
|
37
|
-
<p
|
|
38
|
-
className={clsx('text-sm', {
|
|
39
|
-
'text-gray-400': isDarkMode,
|
|
40
|
-
'text-gray-500': !isDarkMode
|
|
41
|
-
})}>
|
|
42
|
-
{t('generic_error.description')}
|
|
43
|
-
</p>
|
|
26
|
+
<h2 className='text-xl font-bold text-neutral-900'>{t('generic_error.title')}</h2>
|
|
27
|
+
<p className='text-sm text-neutral-600'>{t('generic_error.description')}</p>
|
|
44
28
|
</div>
|
|
45
29
|
|
|
46
30
|
<div className='flex w-full flex-col gap-4'>
|
|
47
31
|
<Button
|
|
48
32
|
variant='brand'
|
|
49
|
-
className='w-full rounded-lg py-2'
|
|
33
|
+
className='mx-auto w-full max-w-max rounded-lg !px-9 py-2 !font-light'
|
|
50
34
|
onClick={() => window.location.reload()}
|
|
51
35
|
aria-label='Retry Button'>
|
|
52
|
-
|
|
36
|
+
{t('general.buttons.try_again')}
|
|
53
37
|
</Button>
|
|
54
38
|
|
|
55
39
|
<Button
|
|
56
40
|
variant='secondary'
|
|
57
|
-
className='w-full rounded-lg py-2'
|
|
41
|
+
className='mx-auto w-full max-w-max rounded-lg !px-9 py-2 !font-light'
|
|
58
42
|
onClick={() => TutorWidgetEvents['c3po-app-widget-hide'].dispatch()}
|
|
59
43
|
aria-label='Close Button'>
|
|
60
|
-
|
|
44
|
+
{t('general.buttons.close')}
|
|
61
45
|
</Button>
|
|
62
46
|
</div>
|
|
63
47
|
</div>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<svg viewBox="0 0 13 15" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path
|
|
3
|
+
d="M6.32585 0.734428H9.55762C9.88835 0.734428 10.2061 0.867241 10.4404 1.10162L12.2087 2.86984C12.443 3.10422 12.5758 3.42193 12.5758 3.75266V9.48443C12.5758 10.1745 12.0159 10.7344 11.3258 10.7344H6.32585C5.63574 10.7344 5.07585 10.1745 5.07585 9.48443V1.98443C5.07585 1.29432 5.63574 0.734428 6.32585 0.734428ZM2.15918 4.06776H4.24251V5.73443H2.57585V12.4011H7.57585V11.5678H9.24251V12.8178C9.24251 13.5079 8.68262 14.0678 7.99251 14.0678H2.15918C1.46908 14.0678 0.90918 13.5079 0.90918 12.8178V5.31776C0.90918 4.62766 1.46908 4.06776 2.15918 4.06776Z"
|
|
4
|
+
fill="currentColor" />
|
|
5
|
+
</svg>
|
|
@@ -9,13 +9,17 @@ export type ValidIconNames =
|
|
|
9
9
|
| 'chevron-down'
|
|
10
10
|
| 'clone'
|
|
11
11
|
| 'close'
|
|
12
|
+
| 'copy-solid'
|
|
12
13
|
| 'copy'
|
|
13
14
|
| 'double-check'
|
|
14
15
|
| 'gallery'
|
|
15
16
|
| 'info'
|
|
16
17
|
| 'interrogation'
|
|
18
|
+
| 'like-solid'
|
|
17
19
|
| 'like'
|
|
18
20
|
| 'paste'
|
|
19
21
|
| 'send'
|
|
22
|
+
| 'sparkle-tutor-light'
|
|
23
|
+
| 'sparkle-tutor'
|
|
20
24
|
| 'stop'
|
|
21
25
|
| 'warning'
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<svg viewBox="0 0 14 13" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path
|
|
3
|
+
d="M8.40316 0.426269C9.08024 0.565542 9.52034 1.24316 9.38493 1.93953L9.32503 2.24486C9.18701 2.95997 8.9318 3.64027 8.57503 4.25896H12.325C13.0151 4.25896 13.575 4.8348 13.575 5.54456C13.575 6.04005 13.3016 6.47126 12.9006 6.68553C13.1844 6.92122 13.3667 7.2828 13.3667 7.68723C13.3667 8.31396 12.9292 8.83623 12.3537 8.94872C12.4683 9.14424 12.5334 9.3719 12.5334 9.61563C12.5334 10.1861 12.1714 10.6709 11.6714 10.8369C11.6896 10.9253 11.7 11.0191 11.7 11.1155C11.7 11.8253 11.1401 12.4011 10.45 12.4011H7.91097C7.41618 12.4011 6.93441 12.2511 6.52295 11.9699L5.52034 11.2815C4.82503 10.8048 4.40837 10.0013 4.40837 9.14156V8.11576V6.83016V6.16326C4.40837 5.38118 4.75472 4.64464 5.34587 4.15451L5.53857 3.99649C6.22868 3.42868 6.70003 2.63054 6.87191 1.74133L6.9318 1.436C7.06722 0.739634 7.72607 0.286996 8.40316 0.426269ZM1.07503 4.6875H2.7417C3.20264 4.6875 3.57503 5.0705 3.57503 5.54456V11.544C3.57503 12.0181 3.20264 12.4011 2.7417 12.4011H1.07503C0.614095 12.4011 0.241699 12.0181 0.241699 11.544V5.54456C0.241699 5.0705 0.614095 4.6875 1.07503 4.6875Z"
|
|
4
|
+
fill="currentColor" />
|
|
5
|
+
</svg>
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
<svg
|
|
2
|
-
<path
|
|
3
|
-
|
|
1
|
+
<svg viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path fill-rule="evenodd" clip-rule="evenodd"
|
|
3
|
+
d="M13.1236 6.53816L1.66737 0.903633C1.43153 0.787637 1.2011 0.845082 1.02441 1.04583C0.842459 1.25255 0.772227 1.56418 0.928775 1.87216L3.08081 6.10592C3.41727 6.76784 3.41727 7.56083 3.08081 8.22275L0.928776 12.4565C0.772227 12.7645 0.842459 13.0761 1.02441 13.2828C1.2011 13.4836 1.43153 13.541 1.66737 13.425L13.1236 7.7905C13.3469 7.68066 13.4839 7.44778 13.4839 7.16433C13.4839 6.88089 13.3469 6.648 13.1236 6.53816ZM13.4723 5.82916L2.01609 0.194624C0.81102 -0.398066 -0.407713 0.986573 0.224422 2.23019L2.37646 6.46395C2.59855 6.90088 2.59855 7.42779 2.37646 7.86472L0.224423 12.0985C-0.407713 13.3421 0.811018 14.7267 2.01609 14.134L13.4723 8.49951C14.5412 7.9738 14.5412 6.35487 13.4723 5.82916Z"
|
|
4
|
+
fill="currentColor" />
|
|
5
|
+
</svg>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<svg viewBox="0 0 56 56" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<circle cx="28" cy="28.05" r="27" stroke="url(#paint0_linear_23639_22377)" stroke-width="2"/>
|
|
3
|
+
<circle cx="28" cy="28.05" r="23" fill="#E6E9ED"/>
|
|
4
|
+
<path d="M12.3207 28.0869C12.2793 28.082 12.2793 28.0181 12.3207 28.0132C26.995 26.2646 27.3639 17.5043 27.9665 12.331C27.9713 12.2901 28.0287 12.2901 28.0335 12.331C28.6361 17.5043 29.005 26.2646 43.6793 28.0132C43.7207 28.0181 43.7207 28.082 43.6793 28.0869C29.005 29.8354 28.6361 38.5958 28.0335 43.7691C28.0287 43.81 27.9713 43.81 27.9665 43.7691C27.3639 38.5958 26.995 29.8354 12.3207 28.0869Z" fill="url(#paint1_linear_23639_22377)"/>
|
|
5
|
+
<defs>
|
|
6
|
+
<linearGradient id="paint0_linear_23639_22377" x1="0" y1="28.05" x2="56" y2="28.05" gradientUnits="userSpaceOnUse">
|
|
7
|
+
<stop stop-color="#44D0FF"/>
|
|
8
|
+
<stop offset="1" stop-color="#B48EFF"/>
|
|
9
|
+
</linearGradient>
|
|
10
|
+
<linearGradient id="paint1_linear_23639_22377" x1="15" y1="11.8769" x2="40.3572" y2="44.2792" gradientUnits="userSpaceOnUse">
|
|
11
|
+
<stop stop-color="#44D0FF"/>
|
|
12
|
+
<stop offset="1" stop-color="#B48EFF"/>
|
|
13
|
+
</linearGradient>
|
|
14
|
+
</defs>
|
|
15
|
+
</svg>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<svg viewBox="0 0 56 56" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<circle cx="28" cy="28" r="27" stroke="url(#paint0_linear_23573_147690)" stroke-width="2" />
|
|
3
|
+
<circle cx="28" cy="28" r="23" fill="#282C2F" />
|
|
4
|
+
<path
|
|
5
|
+
d="M12.3207 28.0368C12.2793 28.0319 12.2793 27.9681 12.3207 27.9632C26.995 26.2146 27.3639 17.4543 27.9665 12.2809C27.9713 12.24 28.0287 12.24 28.0335 12.2809C28.6361 17.4543 29.005 26.2146 43.6793 27.9632C43.7207 27.9681 43.7207 28.0319 43.6793 28.0368C29.005 29.7854 28.6361 38.5457 28.0335 43.7191C28.0287 43.76 27.9713 43.76 27.9665 43.7191C27.3639 38.5457 26.995 29.7854 12.3207 28.0368Z"
|
|
6
|
+
fill="url(#paint1_linear_23573_147690)" />
|
|
7
|
+
<defs>
|
|
8
|
+
<linearGradient id="paint0_linear_23573_147690" x1="0" y1="28" x2="56" y2="28"
|
|
9
|
+
gradientUnits="userSpaceOnUse">
|
|
10
|
+
<stop stop-color="#44D0FF" />
|
|
11
|
+
<stop offset="1" stop-color="#B48EFF" />
|
|
12
|
+
</linearGradient>
|
|
13
|
+
<linearGradient id="paint1_linear_23573_147690" x1="15" y1="11.8268" x2="40.3572" y2="44.2291"
|
|
14
|
+
gradientUnits="userSpaceOnUse">
|
|
15
|
+
<stop stop-color="#44D0FF" />
|
|
16
|
+
<stop offset="1" stop-color="#B48EFF" />
|
|
17
|
+
</linearGradient>
|
|
18
|
+
</defs>
|
|
19
|
+
</svg>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
.triangle {
|
|
2
|
+
z-index: 5;
|
|
3
|
+
|
|
4
|
+
&:before {
|
|
5
|
+
content: '';
|
|
6
|
+
display: inline-block;
|
|
7
|
+
width: 0;
|
|
8
|
+
height: 0;
|
|
9
|
+
border-style: solid;
|
|
10
|
+
border-width: 0px 0.5rem 0.625rem 0.5rem;
|
|
11
|
+
border-color: transparent transparent var(--hc-color-neutral-300) transparent;
|
|
12
|
+
position: absolute;
|
|
13
|
+
z-index: 4;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.top:before {
|
|
18
|
+
top: 100%;
|
|
19
|
+
left: 50%;
|
|
20
|
+
transform: translateX(-50%) rotateZ(180deg);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.right:before {
|
|
24
|
+
top: 50%;
|
|
25
|
+
right: 97%;
|
|
26
|
+
transform: translateY(-50%) rotateZ(-90deg);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.bottom:before {
|
|
30
|
+
bottom: 100%;
|
|
31
|
+
left: 50%;
|
|
32
|
+
transform: translateX(-50%);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.left:before {
|
|
36
|
+
top: 50%;
|
|
37
|
+
left: 97%;
|
|
38
|
+
transform: translateY(-50%) rotateZ(90deg);
|
|
39
|
+
}
|