@sanity/assist 5.0.0 → 5.0.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.
@@ -1,68 +0,0 @@
1
- import {ArrowRightIcon, CheckmarkIcon, SparklesIcon} from '@sanity/icons'
2
- import {Button, Card, Flex, Popover, Stack, Text} from '@sanity/ui'
3
- import {useRef} from 'react'
4
-
5
- import {AssistFeatureBadge} from '../components/AssistFeatureBadge'
6
- import {pluginTitle, releaseAnnouncementUrl} from '../constants'
7
-
8
- export interface FieldActionsOnboardingProps {
9
- dismiss: () => void
10
- }
11
-
12
- export function AssistOnboardingPopover(props: FieldActionsOnboardingProps) {
13
- const {dismiss} = props
14
-
15
- return (
16
- <Popover
17
- content={<AssistIntroCard dismiss={dismiss} />}
18
- open
19
- portal
20
- placeholder="bottom"
21
- tone="default"
22
- width={0}
23
- >
24
- <Card radius={2} shadow={2} style={{padding: 2, lineHeight: 0}}>
25
- <Button disabled fontSize={1} icon={SparklesIcon} mode="bleed" padding={2} />
26
- </Card>
27
- </Popover>
28
- )
29
- }
30
-
31
- function AssistIntroCard(props: {dismiss: () => void}) {
32
- const buttonRef = useRef<HTMLButtonElement>(null)
33
-
34
- return (
35
- <Stack as="section" padding={3} space={3}>
36
- <Stack padding={2} space={4}>
37
- <Flex gap={2} align="center">
38
- <Text as="h1" size={1} weight="semibold">
39
- {pluginTitle}
40
- </Text>
41
- <div aria-hidden style={{margin: '-3px 0', lineHeight: 0}}>
42
- <AssistFeatureBadge />
43
- </div>
44
- </Flex>
45
-
46
- <Stack space={3}>
47
- <Text as="p" muted size={1}>
48
- Manage reusable AI instructions to boost your content creation and reduce amount of
49
- repetitive chores.{' '}
50
- <a href={releaseAnnouncementUrl} target="_blank" rel="noreferrer">
51
- Learn more <ArrowRightIcon />
52
- </a>
53
- </Text>
54
- </Stack>
55
- </Stack>
56
-
57
- <Button
58
- fontSize={1}
59
- icon={CheckmarkIcon}
60
- onClick={props.dismiss}
61
- padding={3}
62
- ref={buttonRef}
63
- text="Ok, good to know!"
64
- tone="primary"
65
- />
66
- </Stack>
67
- )
68
- }
File without changes