@veracity/vui 2.30.0 → 2.31.0
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/cjs/button/theme.d.ts.map +1 -1
- package/dist/cjs/button/theme.js +0 -2
- package/dist/cjs/button/theme.js.map +1 -1
- package/dist/cjs/sidemenuV2/sidemenuItemV2.d.ts +3 -0
- package/dist/cjs/sidemenuV2/sidemenuItemV2.d.ts.map +1 -1
- package/dist/cjs/sidemenuV2/sidemenuItemV2.js +15 -6
- package/dist/cjs/sidemenuV2/sidemenuItemV2.js.map +1 -1
- package/dist/cjs/sidemenuV2/sidemenuV2.js +1 -1
- package/dist/cjs/sidemenuV2/sidemenuV2.js.map +1 -1
- package/dist/cjs/sidemenuV2/theme.d.ts.map +1 -1
- package/dist/cjs/sidemenuV2/theme.js +2 -3
- package/dist/cjs/sidemenuV2/theme.js.map +1 -1
- package/dist/cjs/tutorial/index.d.ts +0 -1
- package/dist/cjs/tutorial/index.d.ts.map +1 -1
- package/dist/cjs/tutorial/index.js +0 -1
- package/dist/cjs/tutorial/index.js.map +1 -1
- package/dist/cjs/tutorial/tutorial.d.ts +1 -1
- package/dist/cjs/tutorial/tutorial.d.ts.map +1 -1
- package/dist/cjs/tutorial/tutorial.js +2 -6
- package/dist/cjs/tutorial/tutorial.js.map +1 -1
- package/dist/cjs/tutorial/tutorial.types.d.ts +14 -2
- package/dist/cjs/tutorial/tutorial.types.d.ts.map +1 -1
- package/dist/cjs/tutorial/tutorialCard.d.ts +1 -1
- package/dist/cjs/tutorial/tutorialCard.d.ts.map +1 -1
- package/dist/cjs/tutorial/tutorialCard.js +5 -5
- package/dist/cjs/tutorial/tutorialCard.js.map +1 -1
- package/dist/cjs/tutorial/tutorialStep.d.ts +1 -1
- package/dist/cjs/tutorial/tutorialStep.d.ts.map +1 -1
- package/dist/cjs/tutorial/tutorialStep.js +1 -1
- package/dist/cjs/tutorial/tutorialStep.js.map +1 -1
- package/dist/esm/button/theme.d.ts.map +1 -1
- package/dist/esm/button/theme.js +0 -2
- package/dist/esm/button/theme.js.map +1 -1
- package/dist/esm/sidemenuV2/sidemenuItemV2.d.ts +3 -0
- package/dist/esm/sidemenuV2/sidemenuItemV2.d.ts.map +1 -1
- package/dist/esm/sidemenuV2/sidemenuItemV2.js +13 -4
- package/dist/esm/sidemenuV2/sidemenuItemV2.js.map +1 -1
- package/dist/esm/sidemenuV2/sidemenuV2.js +1 -1
- package/dist/esm/sidemenuV2/sidemenuV2.js.map +1 -1
- package/dist/esm/sidemenuV2/theme.d.ts.map +1 -1
- package/dist/esm/sidemenuV2/theme.js +2 -3
- package/dist/esm/sidemenuV2/theme.js.map +1 -1
- package/dist/esm/tutorial/index.d.ts +0 -1
- package/dist/esm/tutorial/index.d.ts.map +1 -1
- package/dist/esm/tutorial/index.js +0 -1
- package/dist/esm/tutorial/index.js.map +1 -1
- package/dist/esm/tutorial/tutorial.d.ts +1 -1
- package/dist/esm/tutorial/tutorial.d.ts.map +1 -1
- package/dist/esm/tutorial/tutorial.js +2 -6
- package/dist/esm/tutorial/tutorial.js.map +1 -1
- package/dist/esm/tutorial/tutorial.types.d.ts +14 -2
- package/dist/esm/tutorial/tutorial.types.d.ts.map +1 -1
- package/dist/esm/tutorial/tutorialCard.d.ts +1 -1
- package/dist/esm/tutorial/tutorialCard.d.ts.map +1 -1
- package/dist/esm/tutorial/tutorialCard.js +4 -4
- package/dist/esm/tutorial/tutorialCard.js.map +1 -1
- package/dist/esm/tutorial/tutorialStep.d.ts +1 -1
- package/dist/esm/tutorial/tutorialStep.d.ts.map +1 -1
- package/dist/esm/tutorial/tutorialStep.js +1 -1
- package/dist/esm/tutorial/tutorialStep.js.map +1 -1
- package/dist/tsconfig.legacy.tsbuildinfo +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/button/theme.ts +0 -2
- package/src/sidemenuV2/sidemenuItemV2.tsx +66 -19
- package/src/sidemenuV2/sidemenuV2.tsx +1 -1
- package/src/sidemenuV2/theme.ts +2 -4
- package/src/tutorial/index.ts +0 -1
- package/src/tutorial/tutorial.tsx +5 -6
- package/src/tutorial/tutorial.types.ts +14 -2
- package/src/tutorial/tutorialCard.tsx +12 -9
- package/src/tutorial/tutorialStep.tsx +6 -4
- package/dist/cjs/tutorial/useTutorial.d.ts +0 -7
- package/dist/cjs/tutorial/useTutorial.d.ts.map +0 -1
- package/dist/cjs/tutorial/useTutorial.js +0 -15
- package/dist/cjs/tutorial/useTutorial.js.map +0 -1
- package/dist/esm/tutorial/useTutorial.d.ts +0 -7
- package/dist/esm/tutorial/useTutorial.d.ts.map +0 -1
- package/dist/esm/tutorial/useTutorial.js +0 -11
- package/dist/esm/tutorial/useTutorial.js.map +0 -1
- package/src/tutorial/useTutorial.ts +0 -16
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@veracity/vui",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.31.0",
|
|
4
4
|
"description": "Veracity UI is a React component library crafted for use within Veracity applications and pages. Based on Styled Components and @xstyled.",
|
|
5
5
|
"module": "./dist/esm/index.js",
|
|
6
6
|
"main": "./dist/cjs/index.js",
|
package/src/button/theme.ts
CHANGED
|
@@ -279,7 +279,6 @@ const variants: Record<string, Record<string, Record<string, string>>> = {
|
|
|
279
279
|
bg: '#ffffff',
|
|
280
280
|
hoverBg: '#D3EEF8',
|
|
281
281
|
activeBg: '#E9F7FC',
|
|
282
|
-
hoverActiveBg: '#D3EEF8',
|
|
283
282
|
disabledBg: '#F8F7F7',
|
|
284
283
|
borderColor: 'transparent',
|
|
285
284
|
hoverBorderColor: '#003591',
|
|
@@ -297,7 +296,6 @@ const variants: Record<string, Record<string, Record<string, string>>> = {
|
|
|
297
296
|
bg: '#0F204B',
|
|
298
297
|
hoverBg: '#003591',
|
|
299
298
|
activeBg: '#0041B2',
|
|
300
|
-
hoverActiveBg: '#003591',
|
|
301
299
|
disabledBg: '#0F204B',
|
|
302
300
|
borderColor: 'transparent',
|
|
303
301
|
hoverBorderColor: '#91FFB4',
|
|
@@ -6,7 +6,7 @@ import type { BadgeProps } from '../badge/badge.types'
|
|
|
6
6
|
import Box from '../box'
|
|
7
7
|
import Button from '../button'
|
|
8
8
|
import type { VuiComponent } from '../core'
|
|
9
|
-
import { omitThemingProps, vui } from '../core'
|
|
9
|
+
import { omitThemingProps, styled, th, vui } from '../core'
|
|
10
10
|
import Icon from '../icon'
|
|
11
11
|
import type { IconProp } from '../icon'
|
|
12
12
|
import Popover from '../popover'
|
|
@@ -21,19 +21,42 @@ interface SidemenuItemContentProps {
|
|
|
21
21
|
icon?: IconProp
|
|
22
22
|
iconSize?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'
|
|
23
23
|
title: string
|
|
24
|
-
isMenuExpanded
|
|
24
|
+
isMenuExpanded?: boolean
|
|
25
|
+
isInPopover?: boolean
|
|
25
26
|
badge?: Pick<BadgeProps, 'text' | 'variant'>
|
|
26
27
|
badgeLinkUrl?: string
|
|
27
28
|
}
|
|
28
29
|
|
|
29
30
|
const SidemenuItemContent = memo<SidemenuItemContentProps>(
|
|
30
|
-
({ icon, iconSize = 'sm', title, isMenuExpanded, badge, badgeLinkUrl }) => {
|
|
31
|
+
({ icon, iconSize = 'sm', title, isMenuExpanded, isInPopover, badge, badgeLinkUrl }) => {
|
|
31
32
|
// Calculate dynamic margins based on menu state
|
|
32
33
|
const iconBaseMarginLeft = 13 / 8 // 1.625rem (13px)
|
|
33
34
|
const iconMarginRight = isMenuExpanded
|
|
34
35
|
? 10 / 8 // 1.25rem (10px) when expanded
|
|
35
36
|
: 20 / 8 // 2.5rem (20px) when collapsed
|
|
36
37
|
|
|
38
|
+
if (isInPopover)
|
|
39
|
+
return (
|
|
40
|
+
<>
|
|
41
|
+
<T isTruncated size="sm" display="inline-block" fontWeight="500" ml={iconBaseMarginLeft}>
|
|
42
|
+
{title}
|
|
43
|
+
</T>
|
|
44
|
+
{badge && typeof badge === 'object' && typeof badge.text === 'string' && badge.text.trim() !== '' && (
|
|
45
|
+
<Badge
|
|
46
|
+
{...badge}
|
|
47
|
+
data-link={btoa(badgeLinkUrl ?? '#')}
|
|
48
|
+
variant={badge.variant ?? 'subtleGreen'}
|
|
49
|
+
size="sm"
|
|
50
|
+
minW="32px"
|
|
51
|
+
fontSize="12px"
|
|
52
|
+
lineHeight="16px"
|
|
53
|
+
ml="10px"
|
|
54
|
+
mr="10px"
|
|
55
|
+
/>
|
|
56
|
+
)}
|
|
57
|
+
</>
|
|
58
|
+
)
|
|
59
|
+
|
|
37
60
|
return (
|
|
38
61
|
<>
|
|
39
62
|
{/* Icon container with responsive margins */}
|
|
@@ -65,6 +88,15 @@ const SidemenuItemContent = memo<SidemenuItemContentProps>(
|
|
|
65
88
|
|
|
66
89
|
SidemenuItemContent.displayName = 'SidemenuItemContent'
|
|
67
90
|
|
|
91
|
+
export const PopoverHovered = styled.div<{ hoverColor: string }>`
|
|
92
|
+
&:hover .vui-sidemenu-item-popover .vui-button.vui-button {
|
|
93
|
+
background: ${p => th.color(p.hoverColor)};
|
|
94
|
+
}
|
|
95
|
+
&:hover div:last-child .tippy-content .vui-sidemenu-item-content > .vui-box > .vui-button.vui-button {
|
|
96
|
+
background: ${p => th.color(p.hoverColor)};
|
|
97
|
+
}
|
|
98
|
+
`
|
|
99
|
+
|
|
68
100
|
/** A menu item. */
|
|
69
101
|
export const SidemenuItemV2 = vui<'button', SidemenuItemV2Props>((props, ref) => {
|
|
70
102
|
const {
|
|
@@ -218,7 +250,6 @@ export const SidemenuItemV2 = vui<'button', SidemenuItemV2Props>((props, ref) =>
|
|
|
218
250
|
bg: 'transparent',
|
|
219
251
|
hoverBg: 'transparent',
|
|
220
252
|
activeBg: 'transparent',
|
|
221
|
-
hoverActiveBg: 'transparent',
|
|
222
253
|
}
|
|
223
254
|
}, [isSubmenuOpen, themeValues.buttonVariant])
|
|
224
255
|
|
|
@@ -226,21 +257,37 @@ export const SidemenuItemV2 = vui<'button', SidemenuItemV2Props>((props, ref) =>
|
|
|
226
257
|
<Box flexDirection="column" ref={ref} w="100%" mt={onBottom ? 'auto' : 0} id={computedItemId}>
|
|
227
258
|
{!isMenuExpanded && children ? (
|
|
228
259
|
<Popover offset={[0, collapsedWidth - expandedWidth - 2]} placement="right-start" trigger="mouseenter">
|
|
229
|
-
|
|
230
|
-
<
|
|
231
|
-
<
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
260
|
+
{({ isOpen }) => (
|
|
261
|
+
<PopoverHovered hoverColor={isDark ?'#003591' : '#d3eef8'}>
|
|
262
|
+
<Popover.Trigger as={Box} className={cs('vui-sidemenu-item-popover', className)}>
|
|
263
|
+
<Button
|
|
264
|
+
{...buttonStyles}
|
|
265
|
+
borderLeft={`3px solid ${isDark ? 'digiGreen.main' : 'seaBlue.main'}`}
|
|
266
|
+
isActive={isExactlyActive}
|
|
267
|
+
>
|
|
268
|
+
<SidemenuItemContent
|
|
269
|
+
icon={icon}
|
|
270
|
+
iconSize={buttonStyles.iconSize}
|
|
271
|
+
title={title}
|
|
272
|
+
isMenuExpanded={isMenuExpanded}
|
|
273
|
+
/>
|
|
274
|
+
</Button>
|
|
275
|
+
</Popover.Trigger>
|
|
276
|
+
<Popover.Content elevation="none" className={cs('vui-sidemenu-item-content', className)}>
|
|
277
|
+
<Box flexDirection="column" justifyContent="start" w="100%">
|
|
278
|
+
<Button
|
|
279
|
+
{...buttonStyles}
|
|
280
|
+
borderLeftColor={'transparent!important'}
|
|
281
|
+
minW={'240px'}
|
|
282
|
+
isActive={isOpen && isExactlyActive}
|
|
283
|
+
>
|
|
284
|
+
<SidemenuItemContent title={title} isInPopover={true} />
|
|
285
|
+
</Button>
|
|
286
|
+
{children}
|
|
287
|
+
</Box>
|
|
288
|
+
</Popover.Content>
|
|
289
|
+
</PopoverHovered>
|
|
290
|
+
)}
|
|
244
291
|
</Popover>
|
|
245
292
|
) : (
|
|
246
293
|
<Button
|
|
@@ -56,7 +56,7 @@ const SidemenuInner = vui<'div', SidemenuV2Props>((props, ref) => {
|
|
|
56
56
|
|
|
57
57
|
// Get state from context
|
|
58
58
|
const context = useSidemenuContext()
|
|
59
|
-
const { isMenuExpanded =
|
|
59
|
+
const { isMenuExpanded = false, setIsExpanded } = context || {}
|
|
60
60
|
|
|
61
61
|
// Get styles configuration early
|
|
62
62
|
const styles = useStyleConfig('SidemenuV2', props)
|
package/src/sidemenuV2/theme.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { colors } from '../theme'
|
|
2
|
-
|
|
3
1
|
const baseStyle = {
|
|
4
2
|
container: {
|
|
5
3
|
display: 'flex',
|
|
@@ -85,10 +83,10 @@ const variants = {
|
|
|
85
83
|
},
|
|
86
84
|
toggleButton: {
|
|
87
85
|
variant: 'tertiaryDark',
|
|
88
|
-
hoverBg:
|
|
86
|
+
hoverBg: 'sandstone.95',
|
|
89
87
|
},
|
|
90
88
|
item: {
|
|
91
|
-
color:
|
|
89
|
+
color: 'darkBlue.main',
|
|
92
90
|
},
|
|
93
91
|
},
|
|
94
92
|
dark: {
|
package/src/tutorial/index.ts
CHANGED
|
@@ -4,7 +4,6 @@ import type { JSXElementConstructor, ReactElement } from 'react'
|
|
|
4
4
|
import { cs } from '../utils'
|
|
5
5
|
import type { CloseEvent, TutorialProps } from './tutorial.types'
|
|
6
6
|
import { TutorialCard } from './tutorialCard'
|
|
7
|
-
import { useTutorial } from './useTutorial'
|
|
8
7
|
|
|
9
8
|
/** Popover Tutorial is used to display information about a new, or existing feature. */
|
|
10
9
|
export function Tutorial({
|
|
@@ -16,17 +15,15 @@ export function Tutorial({
|
|
|
16
15
|
onFinish,
|
|
17
16
|
steps,
|
|
18
17
|
title,
|
|
19
|
-
id,
|
|
20
18
|
placement = 'right',
|
|
21
19
|
showSkipButton,
|
|
20
|
+
isVisible = true,
|
|
21
|
+
includeFinalPage = true,
|
|
22
|
+
useContentTitle = false,
|
|
22
23
|
}: TutorialProps) {
|
|
23
|
-
const { isVisible, setIsVisible, saveDisplayed } = useTutorial(id)
|
|
24
|
-
|
|
25
24
|
const onClose = (e: CloseEvent) => {
|
|
26
|
-
setIsVisible(false)
|
|
27
25
|
if (e === 'dismissed') onDismiss?.()
|
|
28
26
|
if (e === 'finished') onFinish?.()
|
|
29
|
-
saveDisplayed(e)
|
|
30
27
|
}
|
|
31
28
|
|
|
32
29
|
return (
|
|
@@ -41,6 +38,8 @@ export function Tutorial({
|
|
|
41
38
|
showSkipButton={showSkipButton}
|
|
42
39
|
steps={steps}
|
|
43
40
|
title={title}
|
|
41
|
+
includeFinalPage={includeFinalPage}
|
|
42
|
+
useContentTitle={useContentTitle}
|
|
44
43
|
/>
|
|
45
44
|
}
|
|
46
45
|
interactive
|
|
@@ -5,7 +5,7 @@ export type TutorialDataStep = {
|
|
|
5
5
|
/** title of step */
|
|
6
6
|
title: string
|
|
7
7
|
/** Content */
|
|
8
|
-
content?: string
|
|
8
|
+
content?: string | React.ReactNode
|
|
9
9
|
/** Link to page where they can read more */
|
|
10
10
|
readMoreLink?: string
|
|
11
11
|
}
|
|
@@ -35,6 +35,12 @@ export type TutorialProps = {
|
|
|
35
35
|
title: string
|
|
36
36
|
/** Link to page where they can read more */
|
|
37
37
|
readMoreLink?: string
|
|
38
|
+
/** Decides if should show or hide tooltip */
|
|
39
|
+
isVisible?: boolean
|
|
40
|
+
/** Should include last thank you page */
|
|
41
|
+
includeFinalPage?: boolean
|
|
42
|
+
/** Should use dynamic header based on content */
|
|
43
|
+
useContentTitle?: boolean
|
|
38
44
|
}
|
|
39
45
|
|
|
40
46
|
export type TutorialCardProps = {
|
|
@@ -56,6 +62,10 @@ export type TutorialCardProps = {
|
|
|
56
62
|
readMoreLink?: string
|
|
57
63
|
/** Show the Skip button */
|
|
58
64
|
showSkipButton?: boolean
|
|
65
|
+
/** Include the final page */
|
|
66
|
+
includeFinalPage?: boolean
|
|
67
|
+
/** Should use dynamic header based on content */
|
|
68
|
+
useContentTitle?: boolean
|
|
59
69
|
}
|
|
60
70
|
|
|
61
71
|
export type TutorialStepProps = {
|
|
@@ -64,9 +74,11 @@ export type TutorialStepProps = {
|
|
|
64
74
|
/** Title of step */
|
|
65
75
|
title: string
|
|
66
76
|
/** Step content */
|
|
67
|
-
content?: string
|
|
77
|
+
content?: string | React.ReactNode
|
|
68
78
|
/** Link to page where user can read more */
|
|
69
79
|
readMoreLink?: string
|
|
80
|
+
/** Should use dynamic header based on content */
|
|
81
|
+
useContentTitle?: boolean
|
|
70
82
|
}
|
|
71
83
|
|
|
72
84
|
export type TutorialStepWrapper = {
|
|
@@ -15,6 +15,8 @@ export function TutorialCard({
|
|
|
15
15
|
onAction,
|
|
16
16
|
onDismiss,
|
|
17
17
|
onFinish,
|
|
18
|
+
includeFinalPage,
|
|
19
|
+
useContentTitle,
|
|
18
20
|
}: TutorialCardProps) {
|
|
19
21
|
const [steps, setSteps] = useState<TutorialStepWrapper[]>([])
|
|
20
22
|
const [activeStep, setActiveStep] = useState<number>(0)
|
|
@@ -30,12 +32,12 @@ export function TutorialCard({
|
|
|
30
32
|
|
|
31
33
|
if (readMoreLink) finalStep.readMoreLink = readMoreLink
|
|
32
34
|
|
|
33
|
-
setSteps([...s, { step: finalStep, key: propsSteps.length }])
|
|
35
|
+
includeFinalPage ? setSteps([...s, { step: finalStep, key: propsSteps.length }]) : setSteps([...s])
|
|
34
36
|
}
|
|
35
37
|
}, [title, propsSteps])
|
|
36
38
|
|
|
37
39
|
const isStartStep = activeStep === 0
|
|
38
|
-
const isFinalStep = activeStep === propsSteps.length
|
|
40
|
+
const isFinalStep = includeFinalPage ? activeStep === propsSteps.length : activeStep === propsSteps.length - 1
|
|
39
41
|
|
|
40
42
|
return (
|
|
41
43
|
<Card
|
|
@@ -45,8 +47,8 @@ export function TutorialCard({
|
|
|
45
47
|
column
|
|
46
48
|
justifyContent="space-between"
|
|
47
49
|
minH={400}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
+
px={3}
|
|
51
|
+
py={2}
|
|
50
52
|
w={580}
|
|
51
53
|
>
|
|
52
54
|
<Box
|
|
@@ -60,7 +62,7 @@ export function TutorialCard({
|
|
|
60
62
|
row
|
|
61
63
|
style={{ WebkitFlexGrow: '0' }}
|
|
62
64
|
>
|
|
63
|
-
<H4 color={tutorialColors.color}>{title}</H4>
|
|
65
|
+
<H4 color={tutorialColors.color}>{useContentTitle ? steps[activeStep]?.step?.title : title}</H4>
|
|
64
66
|
{!isFinalStep && (
|
|
65
67
|
<Button aria-label="close" icon="uiTimes" onClick={onDismiss} scale={2} variant="tertiaryLight" />
|
|
66
68
|
)}
|
|
@@ -73,6 +75,7 @@ export function TutorialCard({
|
|
|
73
75
|
key={s.step.title}
|
|
74
76
|
readMoreLink={s.step.readMoreLink}
|
|
75
77
|
title={s.step.title}
|
|
78
|
+
useContentTitle={useContentTitle}
|
|
76
79
|
/>
|
|
77
80
|
))}
|
|
78
81
|
</Box>
|
|
@@ -116,17 +119,17 @@ export function TutorialCard({
|
|
|
116
119
|
{(showSkipButton || isFinalStep || !!onAction) && (
|
|
117
120
|
<Box alignItems="center" justifyContent="space-between">
|
|
118
121
|
{showSkipButton && !isFinalStep && (
|
|
119
|
-
<Button
|
|
122
|
+
<Button mx={1} onClick={onDismiss} variant="secondaryLight">
|
|
120
123
|
Skip
|
|
121
124
|
</Button>
|
|
122
125
|
)}
|
|
123
126
|
{isFinalStep && (
|
|
124
|
-
<Button
|
|
125
|
-
|
|
127
|
+
<Button mx={1} onClick={onFinish} variant="primaryLight">
|
|
128
|
+
I got it
|
|
126
129
|
</Button>
|
|
127
130
|
)}
|
|
128
131
|
{!!onAction && (
|
|
129
|
-
<Button mr={
|
|
132
|
+
<Button ml={1} mr={showSkipButton || isFinalStep ? 12 : 2} onClick={onAction} variant="primaryLight">
|
|
130
133
|
{actionLabel}
|
|
131
134
|
</Button>
|
|
132
135
|
)}
|
|
@@ -2,11 +2,13 @@ import { Box, H5, v } from '../index'
|
|
|
2
2
|
import { tutorialColors } from './consts'
|
|
3
3
|
import type { TutorialStepProps } from './tutorial.types'
|
|
4
4
|
|
|
5
|
-
export const TutorialStep = ({ active, content, title }: TutorialStepProps) => (
|
|
5
|
+
export const TutorialStep = ({ active, content, title, useContentTitle }: TutorialStepProps) => (
|
|
6
6
|
<v.div className="vui-tutorialStep" hidden={!active} pb={2}>
|
|
7
|
-
|
|
8
|
-
{
|
|
9
|
-
|
|
7
|
+
{!useContentTitle && (
|
|
8
|
+
<H5 color={tutorialColors.color} fontWeight="medium" mb={1}>
|
|
9
|
+
{title}
|
|
10
|
+
</H5>
|
|
11
|
+
)}
|
|
10
12
|
<Box>{content}</Box>
|
|
11
13
|
</v.div>
|
|
12
14
|
)
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { CloseEvent } from './tutorial.types';
|
|
2
|
-
export declare const useTutorial: (tutorialId: string) => {
|
|
3
|
-
isVisible: boolean;
|
|
4
|
-
setIsVisible: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
5
|
-
saveDisplayed: (e: CloseEvent) => void;
|
|
6
|
-
};
|
|
7
|
-
//# sourceMappingURL=useTutorial.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useTutorial.d.ts","sourceRoot":"","sources":["../../../src/tutorial/useTutorial.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAElD,eAAO,MAAM,WAAW,GAAI,YAAY,MAAM;;;uBAQlB,UAAU;CAGrC,CAAA"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useTutorial = void 0;
|
|
4
|
-
const react_1 = require("react");
|
|
5
|
-
const useTutorial = (tutorialId) => {
|
|
6
|
-
const [isVisible, setIsVisible] = (0, react_1.useState)(false);
|
|
7
|
-
const localStorageId = `vuiTutorial-${tutorialId}`;
|
|
8
|
-
(0, react_1.useEffect)(() => {
|
|
9
|
-
setIsVisible(!window.localStorage.getItem(localStorageId));
|
|
10
|
-
}, []);
|
|
11
|
-
const saveDisplayed = (e) => window.localStorage.setItem(localStorageId, e);
|
|
12
|
-
return { isVisible, setIsVisible, saveDisplayed };
|
|
13
|
-
};
|
|
14
|
-
exports.useTutorial = useTutorial;
|
|
15
|
-
//# sourceMappingURL=useTutorial.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useTutorial.js","sourceRoot":"","sources":["../../../src/tutorial/useTutorial.ts"],"names":[],"mappings":";;;AAAA,iCAA2C;AAIpC,MAAM,WAAW,GAAG,CAAC,UAAkB,EAAE,EAAE;IAChD,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,IAAA,gBAAQ,EAAU,KAAK,CAAC,CAAA;IAC1D,MAAM,cAAc,GAAG,eAAe,UAAU,EAAE,CAAA;IAElD,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,YAAY,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,CAAA;IAC5D,CAAC,EAAE,EAAE,CAAC,CAAA;IAEN,MAAM,aAAa,GAAG,CAAC,CAAa,EAAE,EAAE,CAAC,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC,CAAA;IAEvF,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,CAAA;AACnD,CAAC,CAAA;AAXY,QAAA,WAAW,eAWvB"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { CloseEvent } from './tutorial.types';
|
|
2
|
-
export declare const useTutorial: (tutorialId: string) => {
|
|
3
|
-
isVisible: boolean;
|
|
4
|
-
setIsVisible: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
5
|
-
saveDisplayed: (e: CloseEvent) => void;
|
|
6
|
-
};
|
|
7
|
-
//# sourceMappingURL=useTutorial.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useTutorial.d.ts","sourceRoot":"","sources":["../../../src/tutorial/useTutorial.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAElD,eAAO,MAAM,WAAW,GAAI,YAAY,MAAM;;;uBAQlB,UAAU;CAGrC,CAAA"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { useEffect, useState } from 'react';
|
|
2
|
-
export const useTutorial = (tutorialId) => {
|
|
3
|
-
const [isVisible, setIsVisible] = useState(false);
|
|
4
|
-
const localStorageId = `vuiTutorial-${tutorialId}`;
|
|
5
|
-
useEffect(() => {
|
|
6
|
-
setIsVisible(!window.localStorage.getItem(localStorageId));
|
|
7
|
-
}, []);
|
|
8
|
-
const saveDisplayed = (e) => window.localStorage.setItem(localStorageId, e);
|
|
9
|
-
return { isVisible, setIsVisible, saveDisplayed };
|
|
10
|
-
};
|
|
11
|
-
//# sourceMappingURL=useTutorial.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useTutorial.js","sourceRoot":"","sources":["../../../src/tutorial/useTutorial.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAI3C,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,UAAkB,EAAE,EAAE;IAChD,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAU,KAAK,CAAC,CAAA;IAC1D,MAAM,cAAc,GAAG,eAAe,UAAU,EAAE,CAAA;IAElD,SAAS,CAAC,GAAG,EAAE;QACb,YAAY,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,CAAA;IAC5D,CAAC,EAAE,EAAE,CAAC,CAAA;IAEN,MAAM,aAAa,GAAG,CAAC,CAAa,EAAE,EAAE,CAAC,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC,CAAA;IAEvF,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,CAAA;AACnD,CAAC,CAAA"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { useEffect, useState } from 'react'
|
|
2
|
-
|
|
3
|
-
import type { CloseEvent } from './tutorial.types'
|
|
4
|
-
|
|
5
|
-
export const useTutorial = (tutorialId: string) => {
|
|
6
|
-
const [isVisible, setIsVisible] = useState<boolean>(false)
|
|
7
|
-
const localStorageId = `vuiTutorial-${tutorialId}`
|
|
8
|
-
|
|
9
|
-
useEffect(() => {
|
|
10
|
-
setIsVisible(!window.localStorage.getItem(localStorageId))
|
|
11
|
-
}, [])
|
|
12
|
-
|
|
13
|
-
const saveDisplayed = (e: CloseEvent) => window.localStorage.setItem(localStorageId, e)
|
|
14
|
-
|
|
15
|
-
return { isVisible, setIsVisible, saveDisplayed }
|
|
16
|
-
}
|