@sanity/ui 3.0.0-static.13 → 3.0.0-static.15
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/_chunks-cjs/_visual-editing.js +101 -106
- package/dist/_chunks-cjs/_visual-editing.js.map +1 -1
- package/dist/_chunks-es/_visual-editing.mjs +101 -106
- package/dist/_chunks-es/_visual-editing.mjs.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/css.js.map +1 -1
- package/dist/css.mjs.map +1 -1
- package/package.json +1 -1
- package/src/css/aspects/margin/margin.style.ts +0 -3
- package/src/ui/primitives/popover/popover.tsx +7 -6
- package/src/ui/primitives/popover/{popoverCard.tsx → popoverLayer.tsx} +14 -28
- package/src/ui/primitives/tooltip/tooltip.tsx +21 -24
- package/src/ui/primitives/tooltip/{tooltipCard.tsx → tooltipLayer.tsx} +14 -27
- package/src/css/aspects/height/rules.ts +0 -7
- package/src/css/aspects/width/rules.ts +0 -8
- package/src/css/components/menu/rules.ts +0 -15
- package/src/css/primitives/avatar/rules.ts +0 -176
- package/src/css/primitives/button/rules.ts +0 -302
- package/src/css/primitives/checkbox/rules.ts +0 -152
- package/src/css/primitives/code/rules.ts +0 -96
- package/src/css/primitives/container/rules.ts +0 -8
- package/src/css/primitives/heading/rules.ts +0 -155
- package/src/css/primitives/kbd/rules.ts +0 -20
- package/src/css/primitives/label/rules.ts +0 -137
- package/src/css/primitives/radio/rules.ts +0 -121
- package/src/css/primitives/select/rules.ts +0 -22
- package/src/css/primitives/switch/rules.ts +0 -340
- package/src/css/primitives/text/rules.ts +0 -164
- package/src/css/primitives/textArea/rules.ts +0 -7
- package/src/css/primitives/textInput/rules.ts +0 -224
- package/src/css/primitives/tooltip/rules.ts +0 -19
package/package.json
CHANGED
|
@@ -27,7 +27,7 @@ import {Z_OFFSETS} from '../../constants'
|
|
|
27
27
|
import {useArrayProp, usePrefersReducedMotion} from '../../hooks'
|
|
28
28
|
import {origin} from '../../middleware/origin'
|
|
29
29
|
import type {ComponentType, Placement, PopoverMargins, Props} from '../../types'
|
|
30
|
-
import {type LayerOwnProps,
|
|
30
|
+
import {type LayerOwnProps, Portal, useBoundaryElement, useLayer} from '../../utils'
|
|
31
31
|
import {CardProvider, useCard} from '../card'
|
|
32
32
|
import {
|
|
33
33
|
DEFAULT_FALLBACK_PLACEMENTS,
|
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
DEFAULT_POPOVER_PADDING,
|
|
37
37
|
} from './constants'
|
|
38
38
|
import {size} from './floating-ui/size'
|
|
39
|
-
import {
|
|
39
|
+
import {PopoverLayer} from './popoverLayer'
|
|
40
40
|
import type {PopoverUpdateCallback} from './types'
|
|
41
41
|
|
|
42
42
|
/** @public */
|
|
@@ -353,12 +353,12 @@ export function Popover<E extends PopoverElementType = typeof DEFAULT_POPOVER_EL
|
|
|
353
353
|
}
|
|
354
354
|
|
|
355
355
|
const popover = (
|
|
356
|
-
|
|
356
|
+
<>
|
|
357
357
|
{/* Optional transparent blocking overlay at the top-most z-index layer. Must be positioned
|
|
358
358
|
before the below popover card. */}
|
|
359
359
|
{modal && <ViewportOverlay />}
|
|
360
360
|
|
|
361
|
-
<
|
|
361
|
+
<PopoverLayer
|
|
362
362
|
{...rest}
|
|
363
363
|
__unstable_margins={margins}
|
|
364
364
|
animate={animate}
|
|
@@ -381,10 +381,11 @@ export function Popover<E extends PopoverElementType = typeof DEFAULT_POPOVER_EL
|
|
|
381
381
|
strategy={strategy}
|
|
382
382
|
x={x}
|
|
383
383
|
y={y}
|
|
384
|
+
zOffset={zOffset}
|
|
384
385
|
>
|
|
385
386
|
{content}
|
|
386
|
-
</
|
|
387
|
-
|
|
387
|
+
</PopoverLayer>
|
|
388
|
+
</>
|
|
388
389
|
)
|
|
389
390
|
|
|
390
391
|
const children =
|
|
@@ -4,9 +4,8 @@ import {motion} from 'framer-motion'
|
|
|
4
4
|
import {CSSProperties, ForwardedRef, useMemo} from 'react'
|
|
5
5
|
|
|
6
6
|
import {POPOVER_MOTION_PROPS} from '../../constants'
|
|
7
|
-
import {Placement, PopoverMargins
|
|
8
|
-
import {Arrow,
|
|
9
|
-
import {Card, CardElementType, CardOwnProps} from '../card'
|
|
7
|
+
import {Placement, PopoverMargins} from '../../types'
|
|
8
|
+
import {Arrow, Layer, LayerOwnProps, LayerProps} from '../../utils'
|
|
10
9
|
import {Flex} from '../flex'
|
|
11
10
|
import {
|
|
12
11
|
DEFAULT_POPOVER_ARROW_HEIGHT,
|
|
@@ -16,10 +15,10 @@ import {
|
|
|
16
15
|
} from './constants'
|
|
17
16
|
|
|
18
17
|
/** @internal */
|
|
19
|
-
export const
|
|
18
|
+
export const DEFAULT_POPOVER_LAYER_ELEMENT = 'div'
|
|
20
19
|
|
|
21
20
|
/** @internal */
|
|
22
|
-
export type
|
|
21
|
+
export type PopoverLayerOwnProps = LayerOwnProps & {
|
|
23
22
|
/** @beta*/
|
|
24
23
|
__unstable_margins?: PopoverMargins
|
|
25
24
|
animate?: boolean
|
|
@@ -37,20 +36,10 @@ export type PopoverCardOwnProps = CardOwnProps & {
|
|
|
37
36
|
}
|
|
38
37
|
|
|
39
38
|
/** @internal */
|
|
40
|
-
export type
|
|
39
|
+
export type PopoverLayerProps = PopoverLayerOwnProps & LayerProps<'div'>
|
|
41
40
|
|
|
42
41
|
/** @internal */
|
|
43
|
-
export
|
|
44
|
-
PopoverCardOwnProps,
|
|
45
|
-
E
|
|
46
|
-
>
|
|
47
|
-
|
|
48
|
-
const MotionCard = motion.create(Card)
|
|
49
|
-
|
|
50
|
-
/** @internal */
|
|
51
|
-
export function PopoverCard<E extends PopoverCardElementType = typeof DEFAULT_POPOVER_CARD_ELEMENT>(
|
|
52
|
-
props: PopoverCardProps<E>,
|
|
53
|
-
) {
|
|
42
|
+
export function PopoverLayer(props: PopoverLayerProps) {
|
|
54
43
|
const {
|
|
55
44
|
__unstable_margins: marginsProp,
|
|
56
45
|
animate,
|
|
@@ -58,7 +47,6 @@ export function PopoverCard<E extends PopoverCardElementType = typeof DEFAULT_PO
|
|
|
58
47
|
arrowRef,
|
|
59
48
|
arrowX,
|
|
60
49
|
arrowY,
|
|
61
|
-
as = DEFAULT_POPOVER_CARD_ELEMENT,
|
|
62
50
|
children,
|
|
63
51
|
maxWidth,
|
|
64
52
|
padding,
|
|
@@ -75,9 +63,7 @@ export function PopoverCard<E extends PopoverCardElementType = typeof DEFAULT_PO
|
|
|
75
63
|
x: xProp,
|
|
76
64
|
y: yProp,
|
|
77
65
|
...rest
|
|
78
|
-
} = props
|
|
79
|
-
|
|
80
|
-
const layer = useLayer()
|
|
66
|
+
} = props
|
|
81
67
|
|
|
82
68
|
// Get margins: [top, right, bottom, left]
|
|
83
69
|
const margins: PopoverMargins = useMemo(
|
|
@@ -94,14 +80,12 @@ export function PopoverCard<E extends PopoverCardElementType = typeof DEFAULT_PO
|
|
|
94
80
|
left: x,
|
|
95
81
|
originX,
|
|
96
82
|
originY,
|
|
97
|
-
position: strategy,
|
|
98
83
|
top: y,
|
|
99
84
|
width: referenceWidth,
|
|
100
|
-
zIndex: layer.zIndex ?? 100,
|
|
101
85
|
willChange: animate ? 'transform' : undefined,
|
|
102
86
|
...style,
|
|
103
87
|
}),
|
|
104
|
-
[animate,
|
|
88
|
+
[animate, originX, originY, referenceWidth, style, x, y],
|
|
105
89
|
)
|
|
106
90
|
|
|
107
91
|
const arrowStyle: CSSProperties = useMemo(
|
|
@@ -115,15 +99,17 @@ export function PopoverCard<E extends PopoverCardElementType = typeof DEFAULT_PO
|
|
|
115
99
|
)
|
|
116
100
|
|
|
117
101
|
return (
|
|
118
|
-
|
|
102
|
+
// @ts-expect-error - TODO: fix this
|
|
103
|
+
<Layer
|
|
119
104
|
className={popoverCard()}
|
|
120
105
|
data-ui="Popover"
|
|
121
106
|
{...rest}
|
|
122
|
-
as={
|
|
107
|
+
as={motion.div}
|
|
123
108
|
data-context-tone={tone}
|
|
124
109
|
data-placement={placement}
|
|
125
110
|
direction="column"
|
|
126
111
|
display="flex"
|
|
112
|
+
position={strategy}
|
|
127
113
|
radius={radius}
|
|
128
114
|
shadow={shadow}
|
|
129
115
|
sizing="border"
|
|
@@ -156,8 +142,8 @@ export function PopoverCard<E extends PopoverCardElementType = typeof DEFAULT_PO
|
|
|
156
142
|
radius={DEFAULT_POPOVER_ARROW_RADIUS}
|
|
157
143
|
/>
|
|
158
144
|
)}
|
|
159
|
-
</
|
|
145
|
+
</Layer>
|
|
160
146
|
)
|
|
161
147
|
}
|
|
162
148
|
|
|
163
|
-
|
|
149
|
+
PopoverLayer.displayName = 'PopoverCard'
|
|
@@ -35,7 +35,7 @@ import {useArrayProp, usePrefersReducedMotion} from '../../hooks'
|
|
|
35
35
|
import {useDelayedState} from '../../hooks/useDelayedState'
|
|
36
36
|
import {origin} from '../../middleware/origin'
|
|
37
37
|
import type {ComponentType, Placement, Props} from '../../types'
|
|
38
|
-
import {
|
|
38
|
+
import {type LayerOwnProps, Portal, useBoundaryElement, usePortal} from '../../utils'
|
|
39
39
|
import {getElementRef} from '../../utils/getElementRef'
|
|
40
40
|
import {CardProvider, useCard} from '../card'
|
|
41
41
|
import {Delay} from '../types'
|
|
@@ -44,8 +44,8 @@ import {
|
|
|
44
44
|
DEFAULT_TOOLTIP_DISTANCE,
|
|
45
45
|
DEFAULT_TOOLTIP_PADDING,
|
|
46
46
|
} from './constants'
|
|
47
|
-
import {TooltipCard} from './tooltipCard'
|
|
48
47
|
import {useTooltipDelayGroup} from './tooltipDelayGroup'
|
|
48
|
+
import {TooltipLayer} from './tooltipLayer'
|
|
49
49
|
|
|
50
50
|
/** @public */
|
|
51
51
|
export const DEFAULT_TOOLTIP_ELEMENT = 'div'
|
|
@@ -190,6 +190,7 @@ export function Tooltip<E extends TooltipElementType = typeof DEFAULT_TOOLTIP_EL
|
|
|
190
190
|
placement: placementProp,
|
|
191
191
|
whileElementsMounted: autoUpdate,
|
|
192
192
|
elements: {reference: referenceElement},
|
|
193
|
+
transform: false,
|
|
193
194
|
})
|
|
194
195
|
|
|
195
196
|
const arrowX = middlewareData.arrow?.x
|
|
@@ -381,37 +382,33 @@ export function Tooltip<E extends TooltipElementType = typeof DEFAULT_TOOLTIP_EL
|
|
|
381
382
|
if (disabled) return child
|
|
382
383
|
|
|
383
384
|
const node = (
|
|
384
|
-
<
|
|
385
|
+
<TooltipLayer
|
|
385
386
|
data-ui="Tooltip"
|
|
387
|
+
{...rest}
|
|
388
|
+
animate={animate}
|
|
389
|
+
arrow={arrowProp}
|
|
390
|
+
arrowRef={setArrow}
|
|
391
|
+
arrowX={arrowX}
|
|
392
|
+
arrowY={arrowY}
|
|
393
|
+
as={as}
|
|
386
394
|
className={composeClassNames(className, tooltip())}
|
|
395
|
+
originX={originX}
|
|
396
|
+
originY={originY}
|
|
397
|
+
padding={padding}
|
|
398
|
+
placement={placement}
|
|
399
|
+
radius={radius}
|
|
387
400
|
ref={setFloating}
|
|
401
|
+
scheme={scheme}
|
|
402
|
+
shadow={shadow}
|
|
388
403
|
style={{
|
|
389
404
|
...floatingStyles,
|
|
390
405
|
maxWidth: tooltipMaxWidth > 0 ? `${tooltipMaxWidth}px` : undefined,
|
|
391
406
|
}}
|
|
407
|
+
tone={tone}
|
|
392
408
|
zOffset={zOffset}
|
|
393
409
|
>
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
animate={animate}
|
|
397
|
-
arrow={arrowProp}
|
|
398
|
-
arrowRef={setArrow}
|
|
399
|
-
arrowX={arrowX}
|
|
400
|
-
arrowY={arrowY}
|
|
401
|
-
as={as}
|
|
402
|
-
originX={originX}
|
|
403
|
-
originY={originY}
|
|
404
|
-
padding={padding}
|
|
405
|
-
placement={placement}
|
|
406
|
-
radius={radius}
|
|
407
|
-
ref={setFloating}
|
|
408
|
-
scheme={scheme}
|
|
409
|
-
shadow={shadow}
|
|
410
|
-
tone={tone}
|
|
411
|
-
>
|
|
412
|
-
{content}
|
|
413
|
-
</TooltipCard>
|
|
414
|
-
</Layer>
|
|
410
|
+
{content}
|
|
411
|
+
</TooltipLayer>
|
|
415
412
|
)
|
|
416
413
|
|
|
417
414
|
const children =
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import {tooltipCard} from '@sanity/ui/css'
|
|
2
|
-
import {motion} from 'framer-motion'
|
|
2
|
+
import {motion, MotionStyle} from 'framer-motion'
|
|
3
3
|
import {type CSSProperties, ForwardedRef, useMemo} from 'react'
|
|
4
4
|
|
|
5
5
|
import {POPOVER_MOTION_PROPS} from '../../constants'
|
|
6
|
-
import {Placement
|
|
7
|
-
import {Arrow} from '../../utils'
|
|
8
|
-
import {Card, CardOwnProps} from '../card'
|
|
6
|
+
import {Placement} from '../../types'
|
|
7
|
+
import {Arrow, Layer, LayerOwnProps, LayerProps} from '../../utils'
|
|
9
8
|
import {
|
|
10
9
|
DEFAULT_TOOLTIP_ARROW_HEIGHT,
|
|
11
10
|
DEFAULT_TOOLTIP_ARROW_RADIUS,
|
|
@@ -13,10 +12,10 @@ import {
|
|
|
13
12
|
} from './constants'
|
|
14
13
|
|
|
15
14
|
/* @internal */
|
|
16
|
-
export const
|
|
15
|
+
export const DEFAULT_TOOLTIP_LAYER_ELEMENT = 'div'
|
|
17
16
|
|
|
18
17
|
/* @internal */
|
|
19
|
-
export interface
|
|
18
|
+
export interface TooltipLayerOwnProps extends LayerOwnProps {
|
|
20
19
|
animate?: boolean
|
|
21
20
|
arrow: boolean
|
|
22
21
|
arrowRef: ForwardedRef<HTMLDivElement>
|
|
@@ -28,29 +27,16 @@ export interface TooltipCardOwnProps extends CardOwnProps {
|
|
|
28
27
|
}
|
|
29
28
|
|
|
30
29
|
/** @internal */
|
|
31
|
-
export type
|
|
30
|
+
export type TooltipLayerProps = TooltipLayerOwnProps & LayerProps<'div'>
|
|
32
31
|
|
|
33
32
|
/** @internal */
|
|
34
|
-
export
|
|
35
|
-
TooltipCardOwnProps,
|
|
36
|
-
E
|
|
37
|
-
>
|
|
38
|
-
|
|
39
|
-
const MotionCard = motion.create(Card)
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* @internal
|
|
43
|
-
*/
|
|
44
|
-
export function TooltipCard<E extends TooltipCardElementType = typeof DEFAULT_TOOLTIP_CARD_ELEMENT>(
|
|
45
|
-
props: TooltipCardProps<E>,
|
|
46
|
-
) {
|
|
33
|
+
export function TooltipLayer(props: TooltipLayerProps) {
|
|
47
34
|
const {
|
|
48
35
|
animate,
|
|
49
36
|
arrow,
|
|
50
37
|
arrowRef,
|
|
51
38
|
arrowX,
|
|
52
39
|
arrowY,
|
|
53
|
-
as = DEFAULT_TOOLTIP_CARD_ELEMENT,
|
|
54
40
|
children,
|
|
55
41
|
originX,
|
|
56
42
|
originY,
|
|
@@ -62,9 +48,9 @@ export function TooltipCard<E extends TooltipCardElementType = typeof DEFAULT_TO
|
|
|
62
48
|
style,
|
|
63
49
|
tone = 'inherit',
|
|
64
50
|
...rest
|
|
65
|
-
} = props
|
|
51
|
+
} = props
|
|
66
52
|
|
|
67
|
-
const rootStyle:
|
|
53
|
+
const rootStyle: MotionStyle = useMemo(
|
|
68
54
|
() => ({
|
|
69
55
|
originX,
|
|
70
56
|
originY,
|
|
@@ -85,10 +71,11 @@ export function TooltipCard<E extends TooltipCardElementType = typeof DEFAULT_TO
|
|
|
85
71
|
)
|
|
86
72
|
|
|
87
73
|
return (
|
|
88
|
-
|
|
74
|
+
// @ts-expect-error - TODO: fix this
|
|
75
|
+
<Layer
|
|
89
76
|
data-ui="Tooltip__card"
|
|
90
77
|
{...rest}
|
|
91
|
-
as={
|
|
78
|
+
as={motion.div}
|
|
92
79
|
className={tooltipCard()}
|
|
93
80
|
data-animate={animate ? '' : undefined}
|
|
94
81
|
data-placement={placement}
|
|
@@ -115,8 +102,8 @@ export function TooltipCard<E extends TooltipCardElementType = typeof DEFAULT_TO
|
|
|
115
102
|
radius={DEFAULT_TOOLTIP_ARROW_RADIUS}
|
|
116
103
|
/>
|
|
117
104
|
)}
|
|
118
|
-
</
|
|
105
|
+
</Layer>
|
|
119
106
|
)
|
|
120
107
|
}
|
|
121
108
|
|
|
122
|
-
|
|
109
|
+
TooltipLayer.displayName = 'TooltipLayer'
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import {Rules} from '../../types'
|
|
2
|
-
import {vars} from '../../vars'
|
|
3
|
-
|
|
4
|
-
export const menuRules: Rules = {
|
|
5
|
-
'menu': {
|
|
6
|
-
outline: 'none',
|
|
7
|
-
},
|
|
8
|
-
|
|
9
|
-
'menu-divider': {
|
|
10
|
-
height: `1px`,
|
|
11
|
-
border: 0,
|
|
12
|
-
backgroundColor: vars.color.border,
|
|
13
|
-
margin: 0,
|
|
14
|
-
},
|
|
15
|
-
}
|
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
import {AVATAR_SIZE, THEME_COLOR_AVATAR_COLORS} from '@sanity/ui/theme'
|
|
2
|
-
|
|
3
|
-
import {responsiveRules} from '../../responsiveRules'
|
|
4
|
-
import {Properties, Rules} from '../../types'
|
|
5
|
-
import {varNames} from '../../varNames'
|
|
6
|
-
import {vars} from '../../vars'
|
|
7
|
-
|
|
8
|
-
export const avatarRules: Rules = {
|
|
9
|
-
'avatar': {
|
|
10
|
-
'backgroundColor': vars.color.avatar.bg,
|
|
11
|
-
'position': 'relative',
|
|
12
|
-
'boxSizing': 'border-box',
|
|
13
|
-
'userSelect': 'none',
|
|
14
|
-
'boxShadow': `0 0 0 1px ${vars.color.bg}`,
|
|
15
|
-
'lineHeight': 0,
|
|
16
|
-
|
|
17
|
-
'width': vars.avatar.size,
|
|
18
|
-
'height': vars.avatar.size,
|
|
19
|
-
'borderRadius': vars.avatar.size,
|
|
20
|
-
|
|
21
|
-
'@nest': {
|
|
22
|
-
'&[data-status="inactive"]': {
|
|
23
|
-
opacity: 0.5,
|
|
24
|
-
},
|
|
25
|
-
|
|
26
|
-
// &:is(button)
|
|
27
|
-
'&:is(button)': {
|
|
28
|
-
WebkitFontSmoothing: 'inherit',
|
|
29
|
-
appearance: 'none',
|
|
30
|
-
margin: 0,
|
|
31
|
-
padding: 0,
|
|
32
|
-
border: 0,
|
|
33
|
-
font: 'inherit',
|
|
34
|
-
color: 'inherit',
|
|
35
|
-
outline: 'none',
|
|
36
|
-
},
|
|
37
|
-
|
|
38
|
-
'&:is(button):focus': {
|
|
39
|
-
outline: 'var(--avatar-focus-ring-width) solid var(--color-focus-ring)',
|
|
40
|
-
outlineOffset: 'var(--avatar-focus-ring-offset)',
|
|
41
|
-
},
|
|
42
|
-
|
|
43
|
-
'&:is(button):focus:not(:focus-visible)': {
|
|
44
|
-
boxShadow: 'none',
|
|
45
|
-
},
|
|
46
|
-
|
|
47
|
-
':disabled &, [data-disabled] &': {
|
|
48
|
-
[varNames.color.avatar.bg]: vars.color.border,
|
|
49
|
-
[varNames.color.avatar.fg]: vars.color.bg,
|
|
50
|
-
},
|
|
51
|
-
|
|
52
|
-
...THEME_COLOR_AVATAR_COLORS.reduce(
|
|
53
|
-
(acc, color) => {
|
|
54
|
-
return {
|
|
55
|
-
...acc,
|
|
56
|
-
[`&.${color}`]: {
|
|
57
|
-
[varNames.color.avatar.bg]: vars.color.avatar[color].bg,
|
|
58
|
-
[varNames.color.avatar.fg]: vars.color.avatar[color].fg,
|
|
59
|
-
},
|
|
60
|
-
}
|
|
61
|
-
},
|
|
62
|
-
{} as Record<string, Properties>,
|
|
63
|
-
),
|
|
64
|
-
},
|
|
65
|
-
},
|
|
66
|
-
|
|
67
|
-
...(AVATAR_SIZE.reduce((acc, size) => {
|
|
68
|
-
return {
|
|
69
|
-
...acc,
|
|
70
|
-
...responsiveRules(`avatar-${size}`, {
|
|
71
|
-
[varNames.avatar.distance]: vars.avatar.sizes[size].distance,
|
|
72
|
-
[varNames.avatar.size]: vars.avatar.sizes[size].size,
|
|
73
|
-
}),
|
|
74
|
-
}
|
|
75
|
-
}, {} as Rules) as Rules),
|
|
76
|
-
|
|
77
|
-
'avatar-arrow': {
|
|
78
|
-
'position': 'absolute',
|
|
79
|
-
'boxSizing': 'border-box',
|
|
80
|
-
'zIndex': 0,
|
|
81
|
-
'opacity': 0,
|
|
82
|
-
'transition': 'all 0.2s linear',
|
|
83
|
-
'transform': 'rotate(-90deg) translate3d(0, 6px, 0)',
|
|
84
|
-
'left': 0,
|
|
85
|
-
'right': 0,
|
|
86
|
-
'top': 0,
|
|
87
|
-
'bottom': 0,
|
|
88
|
-
|
|
89
|
-
'@nest': {
|
|
90
|
-
'& > svg': {
|
|
91
|
-
display: 'block',
|
|
92
|
-
width: '11px',
|
|
93
|
-
height: '7px',
|
|
94
|
-
position: 'absolute',
|
|
95
|
-
top: '-5px',
|
|
96
|
-
left: '50%',
|
|
97
|
-
transform: 'translateX(-6px)',
|
|
98
|
-
},
|
|
99
|
-
|
|
100
|
-
'[data-arrow-position="inside"] > &': {
|
|
101
|
-
transform: 'rotate(-90deg) translate3d(0, 6px, 0)',
|
|
102
|
-
opacity: 0,
|
|
103
|
-
},
|
|
104
|
-
|
|
105
|
-
'[data-arrow-position="top"] > &': {
|
|
106
|
-
opacity: 1,
|
|
107
|
-
transform: 'rotate(0deg)',
|
|
108
|
-
},
|
|
109
|
-
|
|
110
|
-
'[data-arrow-position="bottom"] > &': {
|
|
111
|
-
opacity: 1,
|
|
112
|
-
transform: 'rotate(-180deg)',
|
|
113
|
-
},
|
|
114
|
-
},
|
|
115
|
-
},
|
|
116
|
-
|
|
117
|
-
'avatar-image': {
|
|
118
|
-
'@nest': {
|
|
119
|
-
'& > img': {
|
|
120
|
-
display: 'block',
|
|
121
|
-
position: 'absolute',
|
|
122
|
-
width: vars.avatar.size,
|
|
123
|
-
height: vars.avatar.size,
|
|
124
|
-
borderRadius: vars.avatar.size,
|
|
125
|
-
},
|
|
126
|
-
|
|
127
|
-
'& > span': {
|
|
128
|
-
display: 'block',
|
|
129
|
-
position: 'absolute',
|
|
130
|
-
width: vars.avatar.size,
|
|
131
|
-
height: vars.avatar.size,
|
|
132
|
-
borderRadius: vars.avatar.size,
|
|
133
|
-
boxShadow: [
|
|
134
|
-
`inset 0 0 0 1px ${vars.color.avatar.bg}`,
|
|
135
|
-
`inset 0 0 0 1.75px ${vars.color.bg}`,
|
|
136
|
-
].join(', '),
|
|
137
|
-
},
|
|
138
|
-
|
|
139
|
-
'[data-image-error] &': {
|
|
140
|
-
display: 'none',
|
|
141
|
-
},
|
|
142
|
-
},
|
|
143
|
-
},
|
|
144
|
-
|
|
145
|
-
'avatar-initials': {
|
|
146
|
-
color: vars.color.avatar.fg,
|
|
147
|
-
borderRadius: vars.avatar.size,
|
|
148
|
-
},
|
|
149
|
-
|
|
150
|
-
'avatar-counter': {
|
|
151
|
-
'color': vars.color.fg,
|
|
152
|
-
'backgroundColor': vars.color.bg,
|
|
153
|
-
'boxShadow': [`0 0 0 1px ${vars.color.bg}`, `inset 0 0 0 1px ${vars.color.border}`].join(', '),
|
|
154
|
-
'userSelect': 'none',
|
|
155
|
-
'borderRadius': vars.avatar.size,
|
|
156
|
-
'height': vars.avatar.size,
|
|
157
|
-
|
|
158
|
-
'@nest': {
|
|
159
|
-
'&&': {
|
|
160
|
-
minWidth: vars.avatar.size,
|
|
161
|
-
},
|
|
162
|
-
|
|
163
|
-
'[data-hide-inner-stroke] &': {
|
|
164
|
-
boxShadow: `0 0 0 1px ${vars.color.bg}`,
|
|
165
|
-
},
|
|
166
|
-
},
|
|
167
|
-
},
|
|
168
|
-
|
|
169
|
-
'avatar-stack': {
|
|
170
|
-
'@nest': {
|
|
171
|
-
'& > div + div': {
|
|
172
|
-
marginLeft: vars.avatar.distance,
|
|
173
|
-
},
|
|
174
|
-
},
|
|
175
|
-
},
|
|
176
|
-
}
|