@sanity/ui 5.0.0-alpha.10 → 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/dist/LazyRefractor-CQ22IeXB.js +19 -0
- package/dist/LazyRefractor-CQ22IeXB.js.map +1 -0
- package/dist/index.d.ts +405 -825
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2033 -1972
- package/dist/index.js.map +1 -1
- package/dist/polyfills.d.ts +1 -1
- package/dist/polyfills.js +4 -4
- package/dist/polyfills.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +8 -7
- package/src/components/box/Box.tsx +1 -6
- package/src/components/box/box.css +5 -0
- package/src/components/checkbox/Checkbox.tsx +1 -1
- package/src/components/container/Container.tsx +5 -1
- package/src/components/container/container.css +4 -0
- package/src/components/flex/Flex.tsx +1 -6
- package/src/components/flex/flex.css +5 -0
- package/src/components/grid/Grid.tsx +1 -6
- package/src/components/grid/grid.css +5 -0
- package/src/components/h-stack/HStack.tsx +8 -14
- package/src/components/h-stack/hStack.props.ts +5 -15
- package/src/components/index.css +1 -0
- 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/v-stack/VStack.tsx +8 -14
- package/src/components/v-stack/vStack.props.ts +5 -15
- package/src/css/classes/system/shadow.css +6 -6
- package/src/css/global/reset.css +12 -1
- package/src/css/tokens/surface.css +2 -0
- package/src/index.ts +3 -0
- package/src/polyfills.ts +2 -0
- package/src/props/formElement.ts +34 -0
- package/src/types/FormElement.ts +2 -0
- package/src/utils/getProps.ts +1 -1
- package/src/version.ts +2 -2
- package/dist/_chunks-es/LazyRefractor.js +0 -20
- package/dist/_chunks-es/LazyRefractor.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sanity/ui",
|
|
3
|
-
"version": "5.0.0-alpha.
|
|
3
|
+
"version": "5.0.0-alpha.11",
|
|
4
4
|
"description": "Sanity UI Library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"components",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
}
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@sanity-labs/design-tokens": "0.0.2-alpha.
|
|
51
|
+
"@sanity-labs/design-tokens": "0.0.2-alpha.5",
|
|
52
52
|
"@sanity/icons": "^5.2.1",
|
|
53
53
|
"clsx": "^2.1.1",
|
|
54
54
|
"comment-json": "^5.0.0",
|
|
@@ -58,24 +58,25 @@
|
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"@sanity/browserslist-config": "^1.0.5",
|
|
61
|
-
"@sanity/pkg-utils": "^10.8.2",
|
|
62
61
|
"@sanity/tsconfig": "^1.0.0",
|
|
62
|
+
"@sanity/tsdown-config": "^0.28.0",
|
|
63
63
|
"@types/node": "^25.5.2",
|
|
64
64
|
"@types/postcss-import": "^14.0.3",
|
|
65
65
|
"@types/postcss-prefix-selector": "^1.16.3",
|
|
66
66
|
"@types/react": "^19.2.17",
|
|
67
67
|
"@types/react-dom": "^19.2.3",
|
|
68
68
|
"autoprefixer": "^10.4.27",
|
|
69
|
-
"babel-plugin-react-compiler": "^1.0.0",
|
|
70
69
|
"concurrently": "^9.2.1",
|
|
71
70
|
"cssnano": "^8.0.0",
|
|
71
|
+
"oxc-transform-react": "^0.149.0",
|
|
72
72
|
"postcss": "^8.5.14",
|
|
73
73
|
"postcss-cli": "^11.0.1",
|
|
74
74
|
"postcss-import": "^16.1.1",
|
|
75
75
|
"postcss-prefix-selector": "^2.1.1",
|
|
76
76
|
"postcss-selector-parser": "^7.1.1",
|
|
77
77
|
"rimraf": "^6.1.3",
|
|
78
|
-
"
|
|
78
|
+
"tsdown": "^0.23.0",
|
|
79
|
+
"typescript": "~6.0.2",
|
|
79
80
|
"vitest": "^4.1.1"
|
|
80
81
|
},
|
|
81
82
|
"peerDependencies": {
|
|
@@ -89,11 +90,11 @@
|
|
|
89
90
|
"build": "pnpm run sync-version && pnpm run clean && pnpm run build:css && pnpm run build:js && pnpm run build:cli",
|
|
90
91
|
"build:cli": "tsc -p tsconfig.cli.json",
|
|
91
92
|
"build:css": "NODE_ENV=production postcss src/index.css -o dist/styles.css",
|
|
92
|
-
"build:js": "
|
|
93
|
+
"build:js": "tsdown",
|
|
93
94
|
"clean": "rimraf dist",
|
|
94
95
|
"dev": "concurrently -n css,js \"pnpm run dev:css\" \"pnpm run dev:js\"",
|
|
95
96
|
"dev:css": "postcss src/index.css -o dist/styles.css --watch",
|
|
96
|
-
"dev:js": "
|
|
97
|
+
"dev:js": "tsdown --watch",
|
|
97
98
|
"sync-version": "node scripts/write-version.js",
|
|
98
99
|
"test": "vitest run",
|
|
99
100
|
"ts:check": "tsc --noEmit"
|
|
@@ -10,14 +10,9 @@ const boxClassName = suffixClassName('sui-Box')
|
|
|
10
10
|
/** @public */
|
|
11
11
|
export function Box<T extends ElementType = 'div'>({
|
|
12
12
|
display = 'block',
|
|
13
|
-
minHeight = '0',
|
|
14
|
-
minWidth = '0',
|
|
15
13
|
...props
|
|
16
14
|
}: BoxProps<T> & Omit<ComponentPropsWithRef<T>, keyof BoxProps<T>>) {
|
|
17
|
-
const {as, children, className, style, ...rest} = getProps(
|
|
18
|
-
{display, minHeight, minWidth, ...props},
|
|
19
|
-
boxProps,
|
|
20
|
-
)
|
|
15
|
+
const {as, children, className, style, ...rest} = getProps({display, ...props}, boxProps)
|
|
21
16
|
const Component = as || 'div'
|
|
22
17
|
|
|
23
18
|
return (
|
|
@@ -10,9 +10,13 @@ const containerClassName = suffixClassName('sui-Container')
|
|
|
10
10
|
/** @public */
|
|
11
11
|
export function Container<T extends ElementType = 'div'>({
|
|
12
12
|
marginX = 'auto',
|
|
13
|
+
size = 2,
|
|
13
14
|
...props
|
|
14
15
|
}: ContainerProps<T> & Omit<ComponentPropsWithRef<T>, keyof ContainerProps<T>>) {
|
|
15
|
-
const {as, children, className, style, ...rest} = getProps(
|
|
16
|
+
const {as, children, className, style, ...rest} = getProps(
|
|
17
|
+
{marginX, size, ...props},
|
|
18
|
+
containerProps,
|
|
19
|
+
)
|
|
16
20
|
const Component = as || 'div'
|
|
17
21
|
|
|
18
22
|
return (
|
|
@@ -10,14 +10,9 @@ const flexClassName = suffixClassName('sui-Flex')
|
|
|
10
10
|
/** @public */
|
|
11
11
|
export function Flex<T extends ElementType = 'div'>({
|
|
12
12
|
display = 'flex',
|
|
13
|
-
minHeight = '0',
|
|
14
|
-
minWidth = '0',
|
|
15
13
|
...props
|
|
16
14
|
}: FlexProps<T> & Omit<ComponentPropsWithRef<T>, keyof FlexProps<T>>) {
|
|
17
|
-
const {as, children, className, style, ...rest} = getProps(
|
|
18
|
-
{display, minHeight, minWidth, ...props},
|
|
19
|
-
flexProps,
|
|
20
|
-
)
|
|
15
|
+
const {as, children, className, style, ...rest} = getProps({display, ...props}, flexProps)
|
|
21
16
|
const Component = as || 'div'
|
|
22
17
|
|
|
23
18
|
return (
|
|
@@ -10,14 +10,9 @@ const gridClassName = suffixClassName('sui-Grid')
|
|
|
10
10
|
/** @public */
|
|
11
11
|
export function Grid<T extends ElementType = 'div'>({
|
|
12
12
|
display = 'grid',
|
|
13
|
-
minHeight = '0',
|
|
14
|
-
minWidth = '0',
|
|
15
13
|
...props
|
|
16
14
|
}: GridProps<T> & Omit<ComponentPropsWithRef<T>, keyof GridProps<T>>) {
|
|
17
|
-
const {as, children, className, style, ...rest} = getProps(
|
|
18
|
-
{display, minHeight, minWidth, ...props},
|
|
19
|
-
gridProps,
|
|
20
|
-
)
|
|
15
|
+
const {as, children, className, style, ...rest} = getProps({display, ...props}, gridProps)
|
|
21
16
|
const Component = as || 'div'
|
|
22
17
|
|
|
23
18
|
return (
|
|
@@ -1,33 +1,27 @@
|
|
|
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 HStackProps
|
|
7
|
+
import {type HStackProps} from './hStack.props'
|
|
8
8
|
|
|
9
9
|
const hStackClassName = suffixClassName('sui-HStack')
|
|
10
10
|
|
|
11
11
|
/** @public */
|
|
12
|
-
export function HStack<T extends ElementType = 'div'>(
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const Component = as || 'div'
|
|
17
|
-
|
|
12
|
+
export function HStack<T extends ElementType = 'div'>({
|
|
13
|
+
className,
|
|
14
|
+
...props
|
|
15
|
+
}: HStackProps<T> & Omit<ComponentPropsWithRef<T>, keyof HStackProps<T>>) {
|
|
18
16
|
return (
|
|
19
17
|
<Flex
|
|
20
|
-
as={Component}
|
|
21
18
|
className={clsx(hStackClassName, className)}
|
|
22
|
-
style={style}
|
|
23
19
|
data-ui="HStack"
|
|
24
20
|
display="inline-flex"
|
|
25
21
|
alignItems="center"
|
|
26
22
|
flexWrap="wrap"
|
|
27
|
-
{...
|
|
28
|
-
|
|
29
|
-
{children}
|
|
30
|
-
</Flex>
|
|
23
|
+
{...(props as ComponentProps)}
|
|
24
|
+
/>
|
|
31
25
|
)
|
|
32
26
|
}
|
|
33
27
|
|
|
@@ -1,17 +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 HStackProps<T extends React.ElementType = 'div'> extends Pick<
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
as?: T
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export const hStackProps: Record<string, PropDef> = {
|
|
13
|
-
as: {
|
|
14
|
-
type: 'string',
|
|
15
|
-
},
|
|
16
|
-
gap: gapProps['gap'] as PropDef,
|
|
17
|
-
}
|
|
4
|
+
export interface HStackProps<T extends React.ElementType = 'div'> extends Pick<
|
|
5
|
+
FlexProps<T>,
|
|
6
|
+
'as' | 'gap'
|
|
7
|
+
> {}
|
package/src/components/index.css
CHANGED
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
@import './popover/popover.css';
|
|
21
21
|
@import './press-area/press-area.css';
|
|
22
22
|
@import './radio/radio.css';
|
|
23
|
+
@import './select/select.css';
|
|
23
24
|
@import './spinner/spinner.css';
|
|
24
25
|
@import './skip-to-content/skip-to-content.css';
|
|
25
26
|
@import './switch/switch.css';
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import SelectIcon from '@sanity/icons/Select'
|
|
2
|
+
import clsx from 'clsx'
|
|
3
|
+
import {useId} from 'react'
|
|
4
|
+
|
|
5
|
+
import {getProps} from '../../utils/getProps'
|
|
6
|
+
import {suffixClassName} from '../../utils/suffixClassName'
|
|
7
|
+
import {Icon} from '../icon/Icon'
|
|
8
|
+
import {type SelectProps, selectProps} from './select.props'
|
|
9
|
+
|
|
10
|
+
const selectClassName = suffixClassName('sui-Select')
|
|
11
|
+
|
|
12
|
+
/** @public */
|
|
13
|
+
export function Select({density = 'regular', hasError = false, ...props}: SelectProps) {
|
|
14
|
+
const {children, className, style, ...rest} = getProps({density, ...props}, selectProps)
|
|
15
|
+
|
|
16
|
+
const anchorId = useId()
|
|
17
|
+
const anchorName = `--anchor-${anchorId}`
|
|
18
|
+
|
|
19
|
+
const selectClasses = clsx(
|
|
20
|
+
selectClassName,
|
|
21
|
+
hasError && 'sui-error',
|
|
22
|
+
'sui-radius2',
|
|
23
|
+
'sui-width-full',
|
|
24
|
+
className,
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
const iconClasses = `sui-position-absolute sui-display-flex sui-align-items-center sui-px1`
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<>
|
|
31
|
+
<select
|
|
32
|
+
data-ui="Select"
|
|
33
|
+
className={selectClasses}
|
|
34
|
+
style={{...style, anchorName}}
|
|
35
|
+
{...rest}
|
|
36
|
+
aria-invalid={hasError || undefined}
|
|
37
|
+
>
|
|
38
|
+
{children}
|
|
39
|
+
</select>
|
|
40
|
+
<div className={iconClasses} data-ui="Select-icon" style={{positionAnchor: anchorName}}>
|
|
41
|
+
<Icon icon={SelectIcon} size={1} />
|
|
42
|
+
</div>
|
|
43
|
+
</>
|
|
44
|
+
)
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export type {SelectProps}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
.sui-Select {
|
|
2
|
+
--background-color: var(--backdrop);
|
|
3
|
+
--border-color: var(--separator-high);
|
|
4
|
+
--color: var(--foreground-high);
|
|
5
|
+
background-color: var(--background-color);
|
|
6
|
+
border: 1px solid var(--border-color);
|
|
7
|
+
font: var(--form-element-text);
|
|
8
|
+
color: var(--color);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
[data-ui="Select-icon"] {
|
|
12
|
+
--background-color: var(--backdrop);
|
|
13
|
+
background-color: var(--background-color);
|
|
14
|
+
pointer-events: none;
|
|
15
|
+
/* reduce block size by 1px at each end and inset from right to not interrupt Select’s border */
|
|
16
|
+
top: calc(anchor(top) + 1px);
|
|
17
|
+
bottom: calc(anchor(bottom) + 1px);
|
|
18
|
+
right: calc(anchor(right) + 2px);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Error
|
|
23
|
+
*/
|
|
24
|
+
.sui-Select.sui-error {
|
|
25
|
+
--border-color: var(--error-separator);
|
|
26
|
+
--color: var(--error-foreground);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.sui-Select.sui-error + [data-ui="Select-icon"] svg {
|
|
30
|
+
color: var(--error-foreground);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Hover - uses relative border/background colours to darken/lighten in both normal & error state
|
|
35
|
+
*/
|
|
36
|
+
.sui-Select:hover {
|
|
37
|
+
border-color: light-dark(
|
|
38
|
+
oklch(from var(--border-color) calc(l - var(--hover-lightness-delta)) c h),
|
|
39
|
+
oklch(from var(--border-color) calc(l + var(--hover-lightness-delta)) c h)
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Disabled
|
|
45
|
+
*/
|
|
46
|
+
.sui-Select:disabled {
|
|
47
|
+
--background-color: var(--inert-background);
|
|
48
|
+
--border-color: var(--separator-low);
|
|
49
|
+
--color: var(--inert-foreground);
|
|
50
|
+
pointer-events: none;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.sui-Select:disabled + [data-ui="Select-icon"] {
|
|
54
|
+
--background-color: var(--inert-background);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.sui-Select:disabled + [data-ui="Select-icon"] svg {
|
|
58
|
+
color: var(--inert-foreground);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Focus
|
|
63
|
+
*/
|
|
64
|
+
.sui-Select:focus-visible {
|
|
65
|
+
outline: var(--focus-outline);
|
|
66
|
+
outline-offset: var(--focus-offset);
|
|
67
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import {formElementDensityProps, type FormElementDensityProps} from '../../props/formElement'
|
|
2
|
+
import {type PropDef} from '../../types/PropDef'
|
|
3
|
+
|
|
4
|
+
/** @public */
|
|
5
|
+
export type SelectProps = React.ComponentProps<'select'> &
|
|
6
|
+
FormElementDensityProps & {
|
|
7
|
+
/**
|
|
8
|
+
* Disables the select element, blocking interactions and hiding it from screen readers.
|
|
9
|
+
*/
|
|
10
|
+
disabled?: boolean
|
|
11
|
+
/**
|
|
12
|
+
* Used to trigger styling for invalid states.
|
|
13
|
+
*/
|
|
14
|
+
hasError?: boolean
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const selectProps: Record<string, PropDef> = {
|
|
18
|
+
disabled: {
|
|
19
|
+
type: 'boolean',
|
|
20
|
+
},
|
|
21
|
+
hasError: {
|
|
22
|
+
type: 'boolean',
|
|
23
|
+
},
|
|
24
|
+
...formElementDensityProps,
|
|
25
|
+
}
|
|
@@ -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,17 +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
|
-
|
|
8
|
-
|
|
9
|
-
as?: T
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export const vStackProps: Record<string, PropDef> = {
|
|
13
|
-
as: {
|
|
14
|
-
type: 'string',
|
|
15
|
-
},
|
|
16
|
-
gap: gapProps['gap'] as PropDef,
|
|
17
|
-
}
|
|
4
|
+
export interface VStackProps<T extends React.ElementType = 'div'> extends Pick<
|
|
5
|
+
FlexProps<T>,
|
|
6
|
+
'as' | 'gap'
|
|
7
|
+
> {}
|
|
@@ -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
|
@@ -52,9 +52,20 @@
|
|
|
52
52
|
select,
|
|
53
53
|
textarea
|
|
54
54
|
) {
|
|
55
|
+
appearance: none;
|
|
56
|
+
color: inherit;
|
|
55
57
|
font: inherit;
|
|
56
58
|
line-height: inherit;
|
|
57
|
-
|
|
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;
|
|
58
69
|
}
|
|
59
70
|
|
|
60
71
|
/* Remove excess space for table borders */
|
|
@@ -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'] {
|
package/src/index.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
1
3
|
export * from './components/box/Box'
|
|
2
4
|
export * from './components/button/Button'
|
|
3
5
|
export * from './components/card/Card'
|
|
@@ -22,6 +24,7 @@ export * from './components/list/List'
|
|
|
22
24
|
export * from './components/popover/Popover'
|
|
23
25
|
export * from './components/press-area/PressArea'
|
|
24
26
|
export * from './components/radio/Radio'
|
|
27
|
+
export * from './components/select/Select'
|
|
25
28
|
export * from './components/skip-to-content/SkipToContent'
|
|
26
29
|
export * from './components/spinner/Spinner'
|
|
27
30
|
export * from './components/switch/Switch'
|
package/src/polyfills.ts
CHANGED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import {FORM_ELEMENT_DENSITY, type FormElementDensity} from '../types/FormElement'
|
|
2
|
+
import type {PropDef} from '../types/PropDef'
|
|
3
|
+
import {paddingProps} from './padding'
|
|
4
|
+
|
|
5
|
+
/** @public */
|
|
6
|
+
export type FormElementDensityProps = {
|
|
7
|
+
/**
|
|
8
|
+
* Sets padding, gap, and other spacing values on the form element.
|
|
9
|
+
*/
|
|
10
|
+
density?: FormElementDensity
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const formElementDensityProps: Record<string, PropDef> = {
|
|
14
|
+
density: {
|
|
15
|
+
type: 'composite',
|
|
16
|
+
values: FORM_ELEMENT_DENSITY,
|
|
17
|
+
composition: {
|
|
18
|
+
paddingX: {
|
|
19
|
+
propDef: paddingProps['paddingX'] as PropDef,
|
|
20
|
+
mapping: {
|
|
21
|
+
regular: 2,
|
|
22
|
+
loose: 3,
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
paddingY: {
|
|
26
|
+
propDef: paddingProps['paddingY'] as PropDef,
|
|
27
|
+
mapping: {
|
|
28
|
+
regular: 1,
|
|
29
|
+
loose: 2,
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
}
|
package/src/utils/getProps.ts
CHANGED
package/src/version.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// This file is generated by scripts/write-version.js. Do not edit.
|
|
2
|
-
export const VERSION = '
|
|
3
|
-
export const HASH = '
|
|
2
|
+
export const VERSION = '500alpha11'
|
|
3
|
+
export const HASH = '8b95a0'
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import { c } from "react/compiler-runtime";
|
|
4
|
-
import { hasLanguage, Refractor } from "react-refractor";
|
|
5
|
-
function LazyRefractor(t0) {
|
|
6
|
-
const $ = c(5), {
|
|
7
|
-
language,
|
|
8
|
-
value
|
|
9
|
-
} = t0;
|
|
10
|
-
if (!hasLanguage(language)) {
|
|
11
|
-
let t12;
|
|
12
|
-
return $[0] !== value ? (t12 = /* @__PURE__ */ jsx("code", { children: value }), $[0] = value, $[1] = t12) : t12 = $[1], t12;
|
|
13
|
-
}
|
|
14
|
-
let t1;
|
|
15
|
-
return $[2] !== language || $[3] !== value ? (t1 = /* @__PURE__ */ jsx(Refractor, { inline: !0, language, value }), $[2] = language, $[3] = value, $[4] = t1) : t1 = $[4], t1;
|
|
16
|
-
}
|
|
17
|
-
export {
|
|
18
|
-
LazyRefractor as default
|
|
19
|
-
};
|
|
20
|
-
//# sourceMappingURL=LazyRefractor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LazyRefractor.js","sources":["../../src/components/code/LazyRefractor.tsx"],"sourcesContent":["import {hasLanguage, Refractor, type RefractorProps} from 'react-refractor'\n\nexport default function LazyRefractor({language, value}: RefractorProps) {\n if (!hasLanguage(language)) {\n return <code>{value}</code>\n }\n\n return <Refractor inline language={language} value={value} />\n}\n"],"names":["LazyRefractor","t0","$","_c","language","value","hasLanguage","t1"],"mappings":";;;;AAEA,SAAeA,cAAAC,IAAA;AAAA,QAAAC,IAAAC,EAAA,CAAA,GAAuB;AAAA,IAAAC;AAAAA,IAAAC;AAAAA,EAAAA,IAAAJ;AACpC,MAAI,CAACK,YAAYF,QAAQ,GAAC;AAAA,QAAAG;AAAA,WAAAL,SAAAG,SACjBE,MAAA,oBAAA,QAAA,EAAOF,iBAAM,GAAOH,OAAAG,OAAAH,OAAAK,OAAAA,MAAAL,EAAA,CAAA,GAApBK;AAAAA,EAAoB;AAC5B,MAAAA;AAAA,SAAAL,EAAA,CAAA,MAAAE,YAAAF,SAAAG,SAEME,yBAAC,WAAA,EAAU,YAAiBH,UAAiBC,MAAAA,CAAK,GAAIH,OAAAE,UAAAF,OAAAG,OAAAH,OAAAK,MAAAA,KAAAL,EAAA,CAAA,GAAtDK;AAAsD;"}
|