@sanity/ui 5.0.0-alpha.1 → 5.0.0-alpha.11
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/README.md +1 -1
- package/dist/LazyRefractor-CQ22IeXB.js +19 -0
- package/dist/LazyRefractor-CQ22IeXB.js.map +1 -0
- package/dist/cli/install.js +2 -1
- package/dist/index.d.ts +662 -796
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2081 -1758
- package/dist/index.js.map +1 -1
- package/dist/polyfills.d.ts +1 -0
- package/dist/polyfills.js +5 -0
- package/dist/polyfills.js.map +1 -0
- package/dist/styles.css +1 -1
- package/package.json +16 -9
- package/src/cli/install.ts +2 -1
- package/src/components/badge/Badge.tsx +53 -0
- package/src/components/badge/badge.css +6 -0
- package/src/components/badge/badge.props.ts +31 -0
- package/src/components/box/box.css +5 -0
- package/src/components/box/box.props.ts +7 -2
- package/src/components/button/button.props.ts +27 -9
- package/src/components/card/card.props.ts +6 -2
- package/src/components/checkbox/Checkbox.tsx +4 -3
- package/src/components/checkbox/checkbox.props.ts +11 -3
- package/src/components/code/code.props.ts +10 -3
- package/src/components/container/Container.tsx +5 -1
- package/src/components/container/container.css +4 -0
- package/src/components/container/container.props.ts +6 -2
- package/src/components/dialog/Dialog.tsx +139 -0
- package/src/components/dialog/dialog.css +49 -0
- package/src/components/dialog/dialog.props.ts +45 -0
- package/src/components/eyebrow/Eyebrow.tsx +1 -1
- package/src/components/eyebrow/eyebrow.props.ts +6 -2
- package/src/components/flex/flex.css +5 -0
- package/src/components/flex/flex.props.ts +6 -2
- package/src/components/grid/grid.css +5 -0
- package/src/components/grid/grid.props.ts +6 -2
- package/src/components/h-stack/HStack.tsx +8 -14
- package/src/components/h-stack/hStack.props.ts +5 -13
- package/src/components/heading/Heading.tsx +1 -1
- package/src/components/heading/heading.props.ts +8 -2
- package/src/components/icon/icon.props.ts +6 -2
- package/src/components/icon-button/iconButton.props.ts +7 -2
- package/src/components/index.css +4 -0
- package/src/components/indicator/indicator.props.ts +6 -2
- package/src/components/indicator-stack/indicatorStack.props.ts +3 -1
- package/src/components/inline/inline.props.ts +6 -2
- package/src/components/label/label.props.ts +7 -1
- package/src/components/link/link.props.ts +4 -4
- package/src/components/list/list.props.ts +27 -9
- package/src/components/popover/Popover.tsx +85 -0
- package/src/components/popover/popover.css +21 -0
- package/src/components/popover/popover.props.ts +38 -0
- package/src/components/press-area/pressArea.props.ts +3 -1
- package/src/components/radio/Radio.tsx +1 -1
- package/src/components/radio/radio.props.ts +7 -2
- package/src/components/select/Select.tsx +47 -0
- package/src/components/select/select.css +67 -0
- package/src/components/select/select.props.ts +25 -0
- package/src/components/skip-to-content/skipToContent.props.ts +9 -3
- package/src/components/spinner/Spinner.tsx +1 -1
- package/src/components/spinner/spinner.props.ts +3 -0
- package/src/components/switch/Switch.tsx +1 -1
- package/src/components/switch/switch.props.ts +7 -2
- package/src/components/text/Text.tsx +1 -1
- package/src/components/text/text.props.ts +6 -2
- package/src/components/tooltip/Tooltip.tsx +59 -55
- package/src/components/tooltip/tooltip.css +19 -40
- package/src/components/tooltip/tooltip.props.ts +24 -8
- package/src/components/tooltip-group/TooltipGroup.tsx +2 -5
- package/src/components/tooltip-group/tooltipGroup.props.ts +3 -1
- package/src/components/v-stack/VStack.tsx +8 -14
- package/src/components/v-stack/vStack.props.ts +5 -13
- package/src/components/visually-hidden/visuallyHidden.props.ts +6 -2
- package/src/css/classes/generic/display.css +8 -8
- package/src/css/classes/generic/placement.css +31 -0
- package/src/css/classes/local/animation.css +4 -0
- package/src/css/classes/local/index.css +2 -0
- package/src/css/classes/local/top-anchor.css +4 -0
- package/src/css/classes/system/shadow.css +6 -6
- package/src/css/global/reset.css +32 -19
- package/src/css/tokens/semantic.css +4 -0
- package/src/css/tokens/surface.css +2 -0
- package/src/hooks/useIsClient.ts +10 -0
- package/src/index.ts +8 -0
- package/src/polyfills.ts +17 -0
- package/src/props/formElement.ts +34 -0
- package/src/types/FormElement.ts +2 -0
- package/src/utils/getProps.ts +1 -1
- package/src/utils/mergeTriggerProps.ts +66 -0
- package/src/utils/renderPortal.tsx +14 -0
- package/src/version.ts +2 -2
- package/dist/_chunks-es/LazyRefractor.js +0 -20
- package/dist/_chunks-es/LazyRefractor.js.map +0 -1
|
@@ -3,9 +3,14 @@ import {type PropDef} from '../../types/PropDef'
|
|
|
3
3
|
|
|
4
4
|
/** @beta */
|
|
5
5
|
export interface SwitchProps extends React.ComponentProps<'input'>, MarginProps {
|
|
6
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* Applies error styling to the switch track.
|
|
8
|
+
* @remarks Use when form validation fails. Pair with a visible error message. The prop is visual only.
|
|
9
|
+
*/
|
|
7
10
|
error?: boolean
|
|
8
|
-
/**
|
|
11
|
+
/**
|
|
12
|
+
* Visible label next to the switch.
|
|
13
|
+
*/
|
|
9
14
|
label: React.ReactNode
|
|
10
15
|
}
|
|
11
16
|
|
|
@@ -40,7 +40,7 @@ export function Text<T extends ElementType = 'span'>({
|
|
|
40
40
|
|
|
41
41
|
return (
|
|
42
42
|
<Component
|
|
43
|
-
className={clsx(textClassName, 'sui-overflow-hidden', className)}
|
|
43
|
+
className={clsx(textClassName, props.truncate && 'sui-overflow-hidden', className)}
|
|
44
44
|
style={style}
|
|
45
45
|
data-ui="Text"
|
|
46
46
|
{...rest}
|
|
@@ -5,9 +5,13 @@ import {TEXT_SIZE, type TextSize} from '../../types/Text'
|
|
|
5
5
|
|
|
6
6
|
/** @public */
|
|
7
7
|
export interface TextProps<T extends React.ElementType = 'span'> extends TypographyProps {
|
|
8
|
-
/**
|
|
8
|
+
/**
|
|
9
|
+
* HTML element to render.
|
|
10
|
+
*/
|
|
9
11
|
as?: T
|
|
10
|
-
/**
|
|
12
|
+
/**
|
|
13
|
+
* Sets font size.
|
|
14
|
+
*/
|
|
11
15
|
size?: Responsive<TextSize>
|
|
12
16
|
}
|
|
13
17
|
|
|
@@ -1,93 +1,97 @@
|
|
|
1
1
|
import clsx from 'clsx'
|
|
2
|
-
import {cloneElement,
|
|
2
|
+
import {cloneElement, useId, useState, type ToggleEvent} from 'react'
|
|
3
3
|
|
|
4
|
+
import {useIsClient} from '../../hooks/useIsClient'
|
|
4
5
|
import {getProps} from '../../utils/getProps'
|
|
6
|
+
import {mergeTriggerProps} from '../../utils/mergeTriggerProps'
|
|
7
|
+
import {renderPortal} from '../../utils/renderPortal'
|
|
5
8
|
import {suffixClassName} from '../../utils/suffixClassName'
|
|
6
|
-
import {Box} from '../box/Box'
|
|
7
9
|
import {type TooltipProps, tooltipProps} from './tooltip.props'
|
|
8
10
|
|
|
9
11
|
const tooltipClassName = suffixClassName('sui-Tooltip')
|
|
10
|
-
const tooltipDismissedClassName = suffixClassName('sui-Tooltip-Dismissed')
|
|
11
12
|
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
function TooltipRoot({
|
|
14
|
+
placement = 'bottom',
|
|
15
|
+
...props
|
|
16
|
+
}: TooltipProps & {
|
|
17
|
+
triggerProps?: Record<string, unknown>
|
|
18
|
+
}) {
|
|
14
19
|
const {
|
|
15
20
|
children,
|
|
16
21
|
className,
|
|
17
22
|
style,
|
|
18
|
-
disabled,
|
|
19
23
|
id: idProp,
|
|
20
|
-
|
|
24
|
+
anchorName,
|
|
25
|
+
content,
|
|
26
|
+
portal,
|
|
27
|
+
triggerProps: forwardedTriggerProps,
|
|
21
28
|
...rest
|
|
22
29
|
} = getProps({placement, ...props}, tooltipProps)
|
|
23
30
|
const reactId = useId()
|
|
24
31
|
const id = idProp || reactId
|
|
25
32
|
const [dismissed, setDismissed] = useState(false)
|
|
33
|
+
const isClient = useIsClient()
|
|
26
34
|
|
|
27
|
-
|
|
28
|
-
if (dismissed) {
|
|
29
|
-
return
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
const handleKeyDown = (e: KeyboardEvent) => {
|
|
33
|
-
if (e.key === 'Escape') {
|
|
34
|
-
setDismissed(true)
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
window.addEventListener('keydown', handleKeyDown)
|
|
39
|
-
return () => window.removeEventListener('keydown', handleKeyDown)
|
|
40
|
-
}, [dismissed])
|
|
41
|
-
|
|
42
|
-
const trigger = cloneElement(children, {
|
|
35
|
+
const triggerProps = {
|
|
43
36
|
'aria-describedby': id,
|
|
44
|
-
'
|
|
37
|
+
'interestfor': id,
|
|
38
|
+
'style': {anchorName: `--anchor-${anchorName || id}`},
|
|
39
|
+
'onMouseLeave': () => {
|
|
45
40
|
setDismissed(false)
|
|
46
|
-
children.props.onMouseEnter?.(e)
|
|
47
41
|
},
|
|
48
|
-
'
|
|
42
|
+
'onBlur': () => {
|
|
49
43
|
setDismissed(false)
|
|
50
|
-
children.props.onFocus?.(e)
|
|
51
44
|
},
|
|
52
|
-
'onClick': (
|
|
45
|
+
'onClick': () => {
|
|
53
46
|
setDismissed(true)
|
|
54
|
-
|
|
47
|
+
document.getElementById(id)?.hidePopover()
|
|
55
48
|
},
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
-
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const trigger = children.type.forwardsTriggerProps
|
|
52
|
+
? cloneElement(children, {triggerProps})
|
|
53
|
+
: cloneElement(children, mergeTriggerProps(children.props, forwardedTriggerProps, triggerProps))
|
|
61
54
|
|
|
62
|
-
|
|
63
|
-
|
|
55
|
+
const handleBeforeToggle = (e: ToggleEvent) => {
|
|
56
|
+
if (e.newState === 'open' && dismissed) {
|
|
57
|
+
e.preventDefault()
|
|
58
|
+
}
|
|
64
59
|
}
|
|
65
60
|
|
|
66
61
|
return (
|
|
67
62
|
<>
|
|
68
63
|
{trigger}
|
|
69
64
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
65
|
+
{renderPortal(
|
|
66
|
+
<div
|
|
67
|
+
className={clsx(
|
|
68
|
+
tooltipClassName,
|
|
69
|
+
'sui-px2 sui-py1 sui-radius2 sui-position-fixed sui-shadow2',
|
|
70
|
+
className,
|
|
71
|
+
)}
|
|
72
|
+
style={{
|
|
73
|
+
...style,
|
|
74
|
+
positionAnchor: `--anchor-${anchorName || id}`,
|
|
75
|
+
}}
|
|
76
|
+
data-ui="Tooltip"
|
|
77
|
+
role="tooltip"
|
|
78
|
+
popover="hint"
|
|
79
|
+
id={id}
|
|
80
|
+
onBeforeToggle={handleBeforeToggle}
|
|
81
|
+
{...rest}
|
|
82
|
+
>
|
|
83
|
+
{content}
|
|
84
|
+
</div>,
|
|
85
|
+
isClient,
|
|
86
|
+
portal,
|
|
87
|
+
)}
|
|
89
88
|
</>
|
|
90
89
|
)
|
|
91
90
|
}
|
|
92
91
|
|
|
92
|
+
/** @beta */
|
|
93
|
+
export const Tooltip = Object.assign(TooltipRoot, {
|
|
94
|
+
forwardsTriggerProps: true,
|
|
95
|
+
}) as typeof TooltipRoot
|
|
96
|
+
|
|
93
97
|
export type {TooltipProps}
|
|
@@ -1,52 +1,31 @@
|
|
|
1
|
+
[interestfor] {
|
|
2
|
+
--tooltip-delay: var(--tooltip-delay-group, 500ms);
|
|
3
|
+
/* The interestfor polyfill looks for intereset delay variables */
|
|
4
|
+
--interest-delay-start: var(--tooltip-delay);
|
|
5
|
+
--interest-delay-end: 0ms;
|
|
6
|
+
interest-delay-start: var(--tooltip-delay);
|
|
7
|
+
interest-delay-end: 0ms;
|
|
8
|
+
}
|
|
9
|
+
|
|
1
10
|
.sui-Tooltip {
|
|
2
|
-
--tooltip-delay-open: var(--tooltip-delay-group, 500ms);
|
|
3
|
-
--tooltip-delay-close: var(--tooltip-delay-group, 100ms);
|
|
4
11
|
background: var(--backdrop);
|
|
12
|
+
visibility: hidden;
|
|
5
13
|
opacity: 0;
|
|
6
14
|
scale: 0.9;
|
|
7
|
-
|
|
8
|
-
transition:
|
|
9
|
-
opacity 200ms cubic-bezier(0.34, 1.2, 0.64, 1) var(--tooltip-delay-close),
|
|
10
|
-
scale 200ms cubic-bezier(0.34, 1.2, 0.64, 1) var(--tooltip-delay-close),
|
|
11
|
-
visibility 0s linear calc(var(--tooltip-delay-close) + 200ms);
|
|
15
|
+
transition: none;
|
|
12
16
|
}
|
|
13
17
|
|
|
14
|
-
|
|
18
|
+
.sui-Tooltip:popover-open {
|
|
15
19
|
visibility: visible;
|
|
16
20
|
opacity: 1;
|
|
17
21
|
scale: 1;
|
|
18
|
-
transition:
|
|
19
|
-
opacity 200ms cubic-bezier(0.34, 1.2, 0.64, 1) var(--tooltip-delay-open),
|
|
20
|
-
scale 200ms cubic-bezier(0.34, 1.2, 0.64, 1) var(--tooltip-delay-open),
|
|
21
|
-
visibility 0s linear var(--tooltip-delay-open);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
[aria-describedby]:is(:hover, :focus-visible) + .sui-Tooltip-Dismissed[role="tooltip"] {
|
|
25
|
-
transition: none;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.sui-Tooltip[class*='placement-bottom'],
|
|
29
|
-
.sui-Tooltip[class*='placement-top'] {
|
|
30
|
-
margin-block: var(--space-1);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.sui-Tooltip[class*='placement-left'],
|
|
34
|
-
.sui-Tooltip[class*='placement-right'] {
|
|
35
|
-
margin-inline: var(--space-1);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.sui-Tooltip[class*='bottom'] {
|
|
39
|
-
transform-origin: center top;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.sui-Tooltip[class*='top'] {
|
|
43
|
-
transform-origin: center bottom;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
.sui-Tooltip[class*='left'] {
|
|
47
|
-
transform-origin: right center;
|
|
22
|
+
transition: var(--fade-in-transition);
|
|
48
23
|
}
|
|
49
24
|
|
|
50
|
-
|
|
51
|
-
|
|
25
|
+
@starting-style {
|
|
26
|
+
.sui-Tooltip:popover-open {
|
|
27
|
+
visibility: hidden;
|
|
28
|
+
opacity: 0;
|
|
29
|
+
scale: 0.9;
|
|
30
|
+
}
|
|
52
31
|
}
|
|
@@ -1,19 +1,35 @@
|
|
|
1
1
|
import {type PlacementProps, placementProps} from '../../props/placement'
|
|
2
2
|
import {type PropDef} from '../../types/PropDef'
|
|
3
3
|
|
|
4
|
-
/** @
|
|
5
|
-
export interface TooltipProps
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
/** @beta */
|
|
5
|
+
export interface TooltipProps
|
|
6
|
+
extends Omit<React.ComponentProps<'div'>, 'children' | 'content'>, PlacementProps {
|
|
7
|
+
/**
|
|
8
|
+
* Shared anchor identifier.
|
|
9
|
+
*/
|
|
10
|
+
anchorName?: React.ReactNode
|
|
11
|
+
/**
|
|
12
|
+
* The trigger element.
|
|
13
|
+
*/
|
|
14
|
+
children: React.ReactElement<Record<string, unknown>>
|
|
15
|
+
/**
|
|
16
|
+
* The tooltip label.
|
|
17
|
+
*/
|
|
18
|
+
content?: React.ReactNode
|
|
19
|
+
/**
|
|
20
|
+
* Renders the label into `document.body` through a React portal instead of inline.
|
|
21
|
+
*/
|
|
22
|
+
portal?: boolean
|
|
10
23
|
}
|
|
11
24
|
|
|
12
25
|
export const tooltipProps: Record<string, PropDef> = {
|
|
13
|
-
|
|
26
|
+
anchorName: {
|
|
14
27
|
type: 'string',
|
|
15
28
|
},
|
|
16
|
-
|
|
29
|
+
content: {
|
|
30
|
+
type: 'string',
|
|
31
|
+
},
|
|
32
|
+
portal: {
|
|
17
33
|
type: 'boolean',
|
|
18
34
|
},
|
|
19
35
|
...placementProps,
|
|
@@ -23,10 +23,7 @@ export function TooltipGroup<T extends ElementType = 'div'>(
|
|
|
23
23
|
return
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
if (
|
|
27
|
-
e.propertyName === 'visibility' &&
|
|
28
|
-
window.getComputedStyle(tooltip).visibility !== 'hidden'
|
|
29
|
-
) {
|
|
26
|
+
if (e.propertyName === 'opacity' && window.getComputedStyle(tooltip).opacity !== '0') {
|
|
30
27
|
setIsActive(true)
|
|
31
28
|
}
|
|
32
29
|
}
|
|
@@ -49,7 +46,7 @@ export function TooltipGroup<T extends ElementType = 'div'>(
|
|
|
49
46
|
style={{
|
|
50
47
|
...style,
|
|
51
48
|
...(isActive && {
|
|
52
|
-
'--tooltip-delay-group':
|
|
49
|
+
'--tooltip-delay-group': '0ms',
|
|
53
50
|
}),
|
|
54
51
|
}}
|
|
55
52
|
data-ui="TooltipGroup"
|
|
@@ -1,31 +1,25 @@
|
|
|
1
1
|
import clsx from 'clsx'
|
|
2
2
|
import type {ComponentPropsWithRef, ElementType} from 'react'
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import type {ComponentProps} from '../../utils/getProps'
|
|
5
5
|
import {suffixClassName} from '../../utils/suffixClassName'
|
|
6
6
|
import {Flex} from '../flex/Flex'
|
|
7
|
-
import {type VStackProps
|
|
7
|
+
import {type VStackProps} from './vStack.props'
|
|
8
8
|
|
|
9
9
|
const vStackClassName = suffixClassName('sui-VStack')
|
|
10
10
|
|
|
11
11
|
/** @public */
|
|
12
|
-
export function VStack<T extends ElementType = 'div'>(
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const Component = as || 'div'
|
|
17
|
-
|
|
12
|
+
export function VStack<T extends ElementType = 'div'>({
|
|
13
|
+
className,
|
|
14
|
+
...props
|
|
15
|
+
}: VStackProps<T> & Omit<ComponentPropsWithRef<T>, keyof VStackProps<T>>) {
|
|
18
16
|
return (
|
|
19
17
|
<Flex
|
|
20
|
-
as={Component}
|
|
21
18
|
className={clsx(vStackClassName, className)}
|
|
22
|
-
style={style}
|
|
23
19
|
data-ui="VStack"
|
|
24
20
|
flexDirection="column"
|
|
25
|
-
{...
|
|
26
|
-
|
|
27
|
-
{children}
|
|
28
|
-
</Flex>
|
|
21
|
+
{...(props as ComponentProps)}
|
|
22
|
+
/>
|
|
29
23
|
)
|
|
30
24
|
}
|
|
31
25
|
|
|
@@ -1,15 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {type PropDef} from '../../types/PropDef'
|
|
1
|
+
import type {FlexProps} from '../flex/flex.props'
|
|
3
2
|
|
|
4
3
|
/** @public */
|
|
5
|
-
export interface VStackProps<T extends React.ElementType = 'div'> extends Pick<
|
|
6
|
-
|
|
7
|
-
as
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export const vStackProps: Record<string, PropDef> = {
|
|
11
|
-
as: {
|
|
12
|
-
type: 'string',
|
|
13
|
-
},
|
|
14
|
-
gap: gapProps['gap'] as PropDef,
|
|
15
|
-
}
|
|
4
|
+
export interface VStackProps<T extends React.ElementType = 'div'> extends Pick<
|
|
5
|
+
FlexProps<T>,
|
|
6
|
+
'as' | 'gap'
|
|
7
|
+
> {}
|
|
@@ -2,9 +2,13 @@ import {type PropDef} from '../../types/PropDef'
|
|
|
2
2
|
|
|
3
3
|
/** @public */
|
|
4
4
|
export interface VisuallyHiddenProps<T extends React.ElementType = 'span'> {
|
|
5
|
-
/**
|
|
5
|
+
/**
|
|
6
|
+
* HTML element to render.
|
|
7
|
+
*/
|
|
6
8
|
as?: T
|
|
7
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* If true, the element becomes visible on `:focus-visible`.
|
|
11
|
+
*/
|
|
8
12
|
visibleOnFocus?: boolean
|
|
9
13
|
}
|
|
10
14
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
@breakpoints {
|
|
2
|
-
.sui-display-block { display: block; }
|
|
3
|
-
.sui-display-inline-block { display: inline-block; }
|
|
4
|
-
.sui-display-inline { display: inline; }
|
|
5
|
-
.sui-display-flex { display: flex; }
|
|
6
|
-
.sui-display-inline-flex { display: inline-flex; }
|
|
7
|
-
.sui-display-grid { display: grid; }
|
|
8
|
-
.sui-display-inline-grid { display: inline-grid; }
|
|
9
|
-
.sui-display-none { display: none; }
|
|
2
|
+
.sui-display-block:not([hidden]) { display: block; }
|
|
3
|
+
.sui-display-inline-block:not([hidden]) { display: inline-block; }
|
|
4
|
+
.sui-display-inline:not([hidden]) { display: inline; }
|
|
5
|
+
.sui-display-flex:not([hidden]) { display: flex; }
|
|
6
|
+
.sui-display-inline-flex:not([hidden]) { display: inline-flex; }
|
|
7
|
+
.sui-display-grid:not([hidden]) { display: grid; }
|
|
8
|
+
.sui-display-inline-grid:not([hidden]) { display: inline-grid; }
|
|
9
|
+
.sui-display-none:not([hidden]) { display: none; }
|
|
10
10
|
}
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
[class*='placement-'] {
|
|
2
|
+
inset: auto;
|
|
3
|
+
margin: 0;
|
|
4
|
+
}
|
|
5
|
+
|
|
1
6
|
@position-try --top-center {
|
|
2
7
|
top: auto;
|
|
3
8
|
right: auto;
|
|
@@ -169,3 +174,29 @@
|
|
|
169
174
|
bottom: anchor(bottom);
|
|
170
175
|
position-try-fallbacks: --left-end;
|
|
171
176
|
}
|
|
177
|
+
|
|
178
|
+
[class*="placement-bottom"],
|
|
179
|
+
[class*="placement-top"] {
|
|
180
|
+
margin-block: var(--space-1);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
[class*="placement-left"],
|
|
184
|
+
[class*="placement-right"] {
|
|
185
|
+
margin-inline: var(--space-1);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
[class*="placement-bottom"] {
|
|
189
|
+
transform-origin: center top;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
[class*="placement-top"] {
|
|
193
|
+
transform-origin: center bottom;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
[class*="placement-left"] {
|
|
197
|
+
transform-origin: right center;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
[class*="placement-right"] {
|
|
201
|
+
transform-origin: left center;
|
|
202
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
.sui-shadow0 { box-shadow: var(--
|
|
2
|
-
.sui-shadow1 { box-shadow: var(--
|
|
3
|
-
.sui-shadow2 { box-shadow: var(--
|
|
4
|
-
.sui-shadow3 { box-shadow: var(--
|
|
5
|
-
.sui-shadow4 { box-shadow: var(--
|
|
6
|
-
.sui-shadow5 { box-shadow: var(--
|
|
1
|
+
.sui-shadow0 { box-shadow: var(--shadow-0); }
|
|
2
|
+
.sui-shadow1 { box-shadow: var(--shadow-1); }
|
|
3
|
+
.sui-shadow2 { box-shadow: var(--shadow-2); }
|
|
4
|
+
.sui-shadow3 { box-shadow: var(--shadow-3); }
|
|
5
|
+
.sui-shadow4 { box-shadow: var(--shadow-4); }
|
|
6
|
+
.sui-shadow5 { box-shadow: var(--shadow-5); }
|
package/src/css/global/reset.css
CHANGED
|
@@ -17,46 +17,59 @@
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
/* Prevent adjustments of font size after orientation changes in iOS. */
|
|
20
|
-
html {
|
|
20
|
+
:where(html) {
|
|
21
21
|
-webkit-text-size-adjust: 100%;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
body {
|
|
24
|
+
:where(body) {
|
|
25
25
|
background: light-dark(var(--white), var(--black));
|
|
26
26
|
font-family: var(--sans);
|
|
27
27
|
-webkit-font-smoothing: antialiased;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
/* Display multimedia as block by default */
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
31
|
+
:where(
|
|
32
|
+
audio,
|
|
33
|
+
canvas,
|
|
34
|
+
embed,
|
|
35
|
+
iframe,
|
|
36
|
+
img,
|
|
37
|
+
object,
|
|
38
|
+
picture,
|
|
39
|
+
video
|
|
40
|
+
){
|
|
39
41
|
display: block;
|
|
40
42
|
max-width: 100%;
|
|
41
43
|
}
|
|
42
|
-
img,
|
|
43
|
-
picture,
|
|
44
|
-
video {
|
|
44
|
+
:where(img, picture, video) {
|
|
45
45
|
block-size: auto;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
/* Inherit typography in form controls */
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
:where(
|
|
50
|
+
button,
|
|
51
|
+
input,
|
|
52
|
+
select,
|
|
53
|
+
textarea
|
|
54
|
+
) {
|
|
55
|
+
appearance: none;
|
|
56
|
+
color: inherit;
|
|
53
57
|
font: inherit;
|
|
54
58
|
line-height: inherit;
|
|
55
|
-
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/* Remove user agent reduced opacity on disabled form elements */
|
|
62
|
+
:where(
|
|
63
|
+
button,
|
|
64
|
+
input,
|
|
65
|
+
select,
|
|
66
|
+
textarea
|
|
67
|
+
):disabled {
|
|
68
|
+
opacity: 1;
|
|
56
69
|
}
|
|
57
70
|
|
|
58
71
|
/* Remove excess space for table borders */
|
|
59
|
-
table {
|
|
72
|
+
:where(table) {
|
|
60
73
|
border-collapse: collapse;
|
|
61
74
|
border-spacing: 0;
|
|
62
75
|
}
|
|
@@ -18,4 +18,8 @@
|
|
|
18
18
|
--hover-transition: border-color 100ms linear, background-color 100ms linear;
|
|
19
19
|
--inert-background: light-dark(var(--gray-50), var(--gray-950));
|
|
20
20
|
--inert-foreground: light-dark(var(--gray-400), var(--gray-600));
|
|
21
|
+
--fade-in-transition:
|
|
22
|
+
opacity 200ms cubic-bezier(0.34, 1.2, 0.64, 1),
|
|
23
|
+
scale 200ms cubic-bezier(0.34, 1.2, 0.64, 1), visibility 0s linear,
|
|
24
|
+
display 200ms linear allow-discrete;
|
|
21
25
|
}
|
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
--foreground-high-emphasized: light-dark(var(--white), var(--black));
|
|
11
11
|
--foreground-low: light-dark(var(--gray-600), var(--gray-400));
|
|
12
12
|
--foreground-low-emphasized: light-dark(var(--gray-100), var(--gray-900));
|
|
13
|
+
/* Used to create equivalent text + block size for form elements vs UI v3/4. Can drop once migration is complete. */
|
|
14
|
+
--form-element-text: var(--regular) 13px / 1.15 var(--sans);
|
|
13
15
|
}
|
|
14
16
|
|
|
15
17
|
[class*='sui-tone'] {
|