@sanity/ui 5.0.0-alpha.15 → 5.0.0-alpha.17
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/index.d.ts +103 -22
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +366 -103
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/src/components/avatar/Avatar.tsx +50 -0
- package/src/components/avatar/avatar.css +51 -0
- package/src/components/avatar/avatar.props.ts +57 -0
- package/src/components/avatar-counter/AvatarCounter.tsx +38 -0
- package/src/components/avatar-counter/avatar-counter.css +8 -0
- package/src/components/avatar-counter/avatarCounter.props.ts +44 -0
- package/src/components/avatar-stack/AvatarStack.tsx +60 -0
- package/src/components/avatar-stack/avatar-stack.css +16 -0
- package/src/components/avatar-stack/avatarStack.props.ts +20 -0
- package/src/components/button/Button.tsx +7 -1
- package/src/components/button/button.css +37 -25
- package/src/components/card/Card.tsx +1 -1
- package/src/components/card/card.props.ts +4 -3
- package/src/components/checkbox/Checkbox.tsx +3 -3
- package/src/components/checkbox/checkbox.props.ts +2 -2
- package/src/components/hotkeys/Hotkeys.tsx +29 -0
- package/src/components/hotkeys/hotkeys.css +3 -0
- package/src/components/hotkeys/hotkeys.props.ts +15 -0
- package/src/components/index.css +6 -0
- package/src/components/indicator/indicator.css +1 -1
- package/src/components/kbd/KBD.tsx +33 -0
- package/src/components/kbd/kbd.css +6 -0
- package/src/components/kbd/kbd.props.ts +20 -0
- package/src/components/radio/Radio.tsx +3 -3
- package/src/components/radio/radio.props.ts +2 -2
- package/src/components/select/select.props.ts +1 -0
- package/src/components/spinner/Spinner.tsx +1 -0
- package/src/components/switch/Switch.tsx +3 -3
- package/src/components/switch/switch.props.ts +2 -2
- package/src/components/text-area/TextArea.tsx +32 -0
- package/src/components/text-area/text-area.css +56 -0
- package/src/components/text-area/textArea.props.ts +35 -0
- package/src/components/text-input/TextInput.tsx +1 -1
- package/src/components/text-input/text-input.css +9 -3
- package/src/components/text-input/textInput.props.ts +1 -0
- package/src/css/classes/dynamic/height.css +2 -0
- package/src/css/classes/local/field-sizing.css +3 -0
- package/src/css/classes/local/index.css +1 -1
- package/src/css/tokens/semantic.css +2 -5
- package/src/css/tokens/surface.css +76 -12
- package/src/index.ts +7 -1
- package/src/props/layout.ts +3 -3
- package/src/props/tone.ts +13 -2
- package/src/types/Avatar.ts +14 -0
- package/src/types/Eyebrow.ts +1 -1
- package/src/types/Tone.ts +2 -0
- package/src/version.ts +2 -2
- package/src/css/classes/local/tone.css +0 -75
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import clsx from 'clsx'
|
|
2
|
+
|
|
3
|
+
import {getProps} from '../../utils/getProps'
|
|
4
|
+
import {suffixClassName} from '../../utils/suffixClassName'
|
|
5
|
+
import {Text} from '../text/Text'
|
|
6
|
+
import {type KBDProps, kbdProps} from './kbd.props'
|
|
7
|
+
|
|
8
|
+
const kbdClassName = suffixClassName('sui-KBD')
|
|
9
|
+
|
|
10
|
+
/** @alpha */
|
|
11
|
+
export function KBD(props: KBDProps) {
|
|
12
|
+
const {className, style, text, ...rest} = getProps(props, kbdProps)
|
|
13
|
+
|
|
14
|
+
const kbdClasses = clsx(kbdClassName, 'sui-p1 sui-radius2 sui-display-inline-block')
|
|
15
|
+
|
|
16
|
+
return (
|
|
17
|
+
<Text
|
|
18
|
+
as="kbd"
|
|
19
|
+
className={clsx(kbdClasses, className)}
|
|
20
|
+
style={style}
|
|
21
|
+
data-ui="KBD"
|
|
22
|
+
size={0}
|
|
23
|
+
weight="semibold"
|
|
24
|
+
muted
|
|
25
|
+
trim
|
|
26
|
+
{...rest}
|
|
27
|
+
>
|
|
28
|
+
{text}
|
|
29
|
+
</Text>
|
|
30
|
+
)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export type {KBDProps}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import {type PropDef} from '../../types/PropDef'
|
|
2
|
+
|
|
3
|
+
/** @public */
|
|
4
|
+
export interface KBDProps extends React.ComponentProps<'kbd'> {
|
|
5
|
+
/**
|
|
6
|
+
* Sets KBD's key label.
|
|
7
|
+
*/
|
|
8
|
+
text?: string
|
|
9
|
+
/**
|
|
10
|
+
* Not accepted.
|
|
11
|
+
* @remarks Pass the key label via `text`.
|
|
12
|
+
*/
|
|
13
|
+
children?: never
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const kbdProps: Record<string, PropDef> = {
|
|
17
|
+
text: {
|
|
18
|
+
type: 'string',
|
|
19
|
+
},
|
|
20
|
+
}
|
|
@@ -13,7 +13,7 @@ const radioMarkClassName = suffixClassName('sui-RadioMark')
|
|
|
13
13
|
|
|
14
14
|
/** @beta */
|
|
15
15
|
export function Radio(props: RadioProps) {
|
|
16
|
-
const {className, style, label, disabled,
|
|
16
|
+
const {className, style, label, disabled, hasError, ...rest} = getProps(props, radioProps)
|
|
17
17
|
|
|
18
18
|
return (
|
|
19
19
|
<Label
|
|
@@ -21,7 +21,7 @@ export function Radio(props: RadioProps) {
|
|
|
21
21
|
style={style}
|
|
22
22
|
data-ui="Radio"
|
|
23
23
|
disabled={disabled}
|
|
24
|
-
error={
|
|
24
|
+
error={hasError}
|
|
25
25
|
>
|
|
26
26
|
<VisuallyHidden
|
|
27
27
|
as="input"
|
|
@@ -33,7 +33,7 @@ export function Radio(props: RadioProps) {
|
|
|
33
33
|
|
|
34
34
|
<Box
|
|
35
35
|
as="span"
|
|
36
|
-
className={clsx(radioMarkClassName,
|
|
36
|
+
className={clsx(radioMarkClassName, hasError && 'sui-error')}
|
|
37
37
|
position="relative"
|
|
38
38
|
radius="full"
|
|
39
39
|
width="17px"
|
|
@@ -7,7 +7,7 @@ export interface RadioProps extends React.ComponentProps<'input'>, MarginProps {
|
|
|
7
7
|
* Applies error styling to the radio mark.
|
|
8
8
|
* @remarks Use when form validation fails. Pair with a visible error message. The prop is visual only.
|
|
9
9
|
*/
|
|
10
|
-
|
|
10
|
+
hasError?: boolean
|
|
11
11
|
/**
|
|
12
12
|
* Visible label next to the radio.
|
|
13
13
|
*/
|
|
@@ -15,7 +15,7 @@ export interface RadioProps extends React.ComponentProps<'input'>, MarginProps {
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
export const radioProps: Record<string, PropDef> = {
|
|
18
|
-
|
|
18
|
+
hasError: {
|
|
19
19
|
type: 'boolean',
|
|
20
20
|
},
|
|
21
21
|
label: {
|
|
@@ -5,6 +5,7 @@ import {type PropDef} from '../../types/PropDef'
|
|
|
5
5
|
export interface SelectProps extends React.ComponentProps<'select'>, FormElementDensityProps {
|
|
6
6
|
/**
|
|
7
7
|
* Used to trigger styling for invalid states.
|
|
8
|
+
* @remarks Use when form validation fails. Pair with a visible error message.
|
|
8
9
|
*/
|
|
9
10
|
hasError?: boolean
|
|
10
11
|
}
|
|
@@ -13,7 +13,7 @@ const switchMarkClassName = suffixClassName('sui-SwitchMark')
|
|
|
13
13
|
|
|
14
14
|
/** @beta */
|
|
15
15
|
export function Switch(props: SwitchProps) {
|
|
16
|
-
const {className, style, disabled,
|
|
16
|
+
const {className, style, disabled, hasError, label, ...rest} = getProps(props, switchProps)
|
|
17
17
|
|
|
18
18
|
return (
|
|
19
19
|
<Label
|
|
@@ -21,7 +21,7 @@ export function Switch(props: SwitchProps) {
|
|
|
21
21
|
style={style}
|
|
22
22
|
data-ui="Switch"
|
|
23
23
|
disabled={props.disabled}
|
|
24
|
-
error={
|
|
24
|
+
error={hasError}
|
|
25
25
|
>
|
|
26
26
|
<VisuallyHidden
|
|
27
27
|
as="input"
|
|
@@ -34,7 +34,7 @@ export function Switch(props: SwitchProps) {
|
|
|
34
34
|
|
|
35
35
|
<Flex
|
|
36
36
|
as="span"
|
|
37
|
-
className={clsx(switchMarkClassName,
|
|
37
|
+
className={clsx(switchMarkClassName, hasError && 'sui-error')}
|
|
38
38
|
alignItems="center"
|
|
39
39
|
radius={6}
|
|
40
40
|
aria-hidden="true"
|
|
@@ -7,7 +7,7 @@ export interface SwitchProps extends React.ComponentProps<'input'>, MarginProps
|
|
|
7
7
|
* Applies error styling to the switch track.
|
|
8
8
|
* @remarks Use when form validation fails. Pair with a visible error message. The prop is visual only.
|
|
9
9
|
*/
|
|
10
|
-
|
|
10
|
+
hasError?: boolean
|
|
11
11
|
/**
|
|
12
12
|
* Visible label next to the switch.
|
|
13
13
|
*/
|
|
@@ -15,7 +15,7 @@ export interface SwitchProps extends React.ComponentProps<'input'>, MarginProps
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
export const switchProps: Record<string, PropDef> = {
|
|
18
|
-
|
|
18
|
+
hasError: {
|
|
19
19
|
type: 'boolean',
|
|
20
20
|
},
|
|
21
21
|
label: {
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import clsx from 'clsx'
|
|
2
|
+
|
|
3
|
+
import {getProps} from '../../utils/getProps'
|
|
4
|
+
import {suffixClassName} from '../../utils/suffixClassName'
|
|
5
|
+
import {type TextAreaProps, textAreaProps} from './textArea.props'
|
|
6
|
+
|
|
7
|
+
const textAreaClassName = suffixClassName('sui-TextArea')
|
|
8
|
+
|
|
9
|
+
/** @public */
|
|
10
|
+
export function TextArea({
|
|
11
|
+
autoResize,
|
|
12
|
+
density = 'regular',
|
|
13
|
+
hasError,
|
|
14
|
+
rows = 5,
|
|
15
|
+
...props
|
|
16
|
+
}: TextAreaProps) {
|
|
17
|
+
const {className, style, ...rest} = getProps({autoResize, density, rows, ...props}, textAreaProps)
|
|
18
|
+
|
|
19
|
+
const textAreaClasses = clsx(textAreaClassName, 'sui-radius2', 'sui-width-full', className)
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<textarea
|
|
23
|
+
className={textAreaClasses}
|
|
24
|
+
style={style}
|
|
25
|
+
data-ui="TextArea"
|
|
26
|
+
{...rest}
|
|
27
|
+
aria-invalid={hasError || undefined}
|
|
28
|
+
/>
|
|
29
|
+
)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export type {TextAreaProps}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
.sui-TextArea {
|
|
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
|
+
resize: none;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.sui-TextArea::placeholder {
|
|
13
|
+
color: oklch(from var(--color) l c h / var(--placeholder-opacity));
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Error
|
|
18
|
+
*/
|
|
19
|
+
.sui-TextArea[aria-invalid="true"] {
|
|
20
|
+
--border-color: var(--error-separator);
|
|
21
|
+
--color: var(--error-foreground);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Hover - uses relative border/background colours to darken/lighten in both normal & error state
|
|
26
|
+
*/
|
|
27
|
+
.sui-TextArea:hover {
|
|
28
|
+
border-color: light-dark(
|
|
29
|
+
oklch(from var(--border-color) calc(l - var(--hover-lightness-delta)) c h),
|
|
30
|
+
oklch(from var(--border-color) calc(l + var(--hover-lightness-delta)) c h)
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Disabled, read-only
|
|
36
|
+
*/
|
|
37
|
+
.sui-TextArea:is(:disabled, :read-only) {
|
|
38
|
+
--background-color: var(--inert-background);
|
|
39
|
+
--border-color: var(--separator-low);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Disabled
|
|
44
|
+
*/
|
|
45
|
+
.sui-TextArea:disabled {
|
|
46
|
+
--color: var(--inert-foreground);
|
|
47
|
+
pointer-events: none;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Focus
|
|
52
|
+
*/
|
|
53
|
+
.sui-TextArea:focus-visible {
|
|
54
|
+
outline: var(--focus-outline);
|
|
55
|
+
outline-offset: var(--focus-offset);
|
|
56
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import {formElementDensityProps, type FormElementDensityProps} from '../../props/formElement'
|
|
2
|
+
import {type HeightProps, heightProps} from '../../props/height'
|
|
3
|
+
import {type PropDef} from '../../types/PropDef'
|
|
4
|
+
|
|
5
|
+
/** @public */
|
|
6
|
+
export interface TextAreaProps
|
|
7
|
+
extends
|
|
8
|
+
React.ComponentProps<'textarea'>,
|
|
9
|
+
FormElementDensityProps,
|
|
10
|
+
Pick<HeightProps, 'maxHeight'> {
|
|
11
|
+
/**
|
|
12
|
+
* Sizes the textarea to its content via the CSS `field-sizing` property.
|
|
13
|
+
*/
|
|
14
|
+
autoResize?: boolean
|
|
15
|
+
/**
|
|
16
|
+
* Used to trigger styling for invalid states.
|
|
17
|
+
*/
|
|
18
|
+
hasError?: boolean
|
|
19
|
+
/**
|
|
20
|
+
* The html `rows` attribute. Defaults to 5.
|
|
21
|
+
*/
|
|
22
|
+
rows?: number
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export const textAreaProps: Record<string, PropDef> = {
|
|
26
|
+
autoResize: {
|
|
27
|
+
type: 'boolean',
|
|
28
|
+
className: 'field-sizing-content',
|
|
29
|
+
},
|
|
30
|
+
hasError: {
|
|
31
|
+
type: 'boolean',
|
|
32
|
+
},
|
|
33
|
+
maxHeight: heightProps['maxHeight'] as PropDef,
|
|
34
|
+
...formElementDensityProps,
|
|
35
|
+
}
|
|
@@ -31,15 +31,21 @@
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
|
-
* Disabled
|
|
34
|
+
* Disabled, read-only
|
|
35
35
|
*/
|
|
36
|
-
.sui-TextInput:disabled {
|
|
36
|
+
.sui-TextInput:is(:disabled, :read-only) {
|
|
37
37
|
--background-color: var(--inert-background);
|
|
38
38
|
--border-color: var(--separator-low);
|
|
39
|
-
--color: var(--inert-foreground);
|
|
40
39
|
pointer-events: none;
|
|
41
40
|
}
|
|
42
41
|
|
|
42
|
+
/**
|
|
43
|
+
* Disabled
|
|
44
|
+
*/
|
|
45
|
+
.sui-TextInput:disabled {
|
|
46
|
+
--color: var(--inert-foreground);
|
|
47
|
+
}
|
|
48
|
+
|
|
43
49
|
/**
|
|
44
50
|
* Focus
|
|
45
51
|
*/
|
|
@@ -25,6 +25,7 @@ export interface TextInputProps
|
|
|
25
25
|
extends Omit<React.ComponentProps<'input'>, 'type'>, FormElementDensityProps {
|
|
26
26
|
/**
|
|
27
27
|
* Used to trigger styling for invalid states.
|
|
28
|
+
* @remarks Use when form validation fails. Pair with a visible error message.
|
|
28
29
|
*/
|
|
29
30
|
hasError?: boolean
|
|
30
31
|
/**
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
:root {
|
|
2
|
-
--backdrop: light-dark(var(--white), var(--black));
|
|
3
|
-
--brand-background: #eb5228;
|
|
4
|
-
--brand-foreground: var(--black);
|
|
5
2
|
--placeholder-opacity: 0.64;
|
|
6
3
|
--overlay-opacity: var(--opacity-mid);
|
|
7
4
|
/* State */
|
|
@@ -15,8 +12,8 @@
|
|
|
15
12
|
--focus-outline: 2px solid var(--blue-500);
|
|
16
13
|
--focus-offset: 2px;
|
|
17
14
|
--hover-lightness-delta: 0.125;
|
|
18
|
-
--hover-transition: border-color 100ms linear, background-color 100ms linear;
|
|
19
|
-
--inert-background: light-dark(var(--gray-50), var(--gray-
|
|
15
|
+
--hover-transition: border-color 100ms linear, background-color 100ms linear, transform 100ms linear;
|
|
16
|
+
--inert-background: light-dark(var(--gray-50), var(--gray-800));
|
|
20
17
|
--inert-foreground: light-dark(var(--gray-400), var(--gray-600));
|
|
21
18
|
--fade-in-transition:
|
|
22
19
|
opacity 200ms cubic-bezier(0.34, 1.2, 0.64, 1),
|
|
@@ -1,12 +1,16 @@
|
|
|
1
|
+
/* Untoned surface */
|
|
1
2
|
:root {
|
|
2
|
-
|
|
3
|
+
--backdrop: light-dark(var(--white), var(--black));
|
|
3
4
|
--background-high: light-dark(var(--gray-100), var(--gray-900));
|
|
4
5
|
--background-high-emphasized: light-dark(var(--gray-800), var(--gray-200));
|
|
5
6
|
--background-low: light-dark(var(--gray-50), var(--gray-950));
|
|
6
7
|
--background-low-emphasized: light-dark(var(--gray-600), var(--gray-400));
|
|
8
|
+
--brand-background: #eb5228;
|
|
9
|
+
--brand-foreground: var(--black);
|
|
7
10
|
--separator-high: light-dark(var(--gray-400), var(--gray-600));
|
|
8
11
|
--separator-low: rgb(from var(--separator-high) r g b / var(--opacity-low));
|
|
9
12
|
--foreground-high: light-dark(var(--gray-800), var(--gray-200));
|
|
13
|
+
/* This property stable across all tones */
|
|
10
14
|
--foreground-high-emphasized: light-dark(var(--white), var(--black));
|
|
11
15
|
--foreground-low: light-dark(var(--gray-600), var(--gray-400));
|
|
12
16
|
--foreground-low-emphasized: light-dark(var(--gray-100), var(--gray-900));
|
|
@@ -14,16 +18,76 @@
|
|
|
14
18
|
--form-element-text: var(--regular) 13px / 1.15 var(--sans);
|
|
15
19
|
}
|
|
16
20
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
--background-high: var(--
|
|
20
|
-
--background-high-emphasized: var(--
|
|
21
|
-
--background-low: var(--
|
|
22
|
-
--background-low-emphasized: var(--
|
|
23
|
-
--separator-high: var(--
|
|
21
|
+
/* Default tone mirrors untoned surface except for backgrounds */
|
|
22
|
+
.sui-tone-default {
|
|
23
|
+
--background-high: var(--backdrop);
|
|
24
|
+
--background-high-emphasized: var(--backdrop);
|
|
25
|
+
--background-low: var(--backdrop);
|
|
26
|
+
--background-low-emphasized: var(--backdrop);
|
|
27
|
+
--separator-high: light-dark(var(--gray-400), var(--gray-600));
|
|
28
|
+
--separator-low: rgb(from var(--separator-high) r g b / var(--opacity-low));
|
|
29
|
+
--foreground-high: light-dark(var(--gray-800), var(--gray-200));
|
|
30
|
+
--foreground-low: light-dark(var(--gray-600), var(--gray-400));
|
|
31
|
+
--foreground-low-emphasized: light-dark(var(--gray-100), var(--gray-900));
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/* Toned surfaces */
|
|
35
|
+
.sui-tone-neutral {
|
|
36
|
+
--background-high: light-dark(var(--gray-100), var(--gray-900));
|
|
37
|
+
--background-high-emphasized: light-dark(var(--gray-800), var(--gray-200));
|
|
38
|
+
--background-low: light-dark(var(--gray-50), var(--gray-950));
|
|
39
|
+
--background-low-emphasized: light-dark(var(--gray-600), var(--gray-400));
|
|
40
|
+
--separator-high: light-dark(var(--gray-400), var(--gray-600));
|
|
41
|
+
--separator-low: rgb(from var(--separator-high) r g b / var(--opacity-low));
|
|
42
|
+
--foreground-high: light-dark(var(--gray-800), var(--gray-200));
|
|
43
|
+
--foreground-low: light-dark(var(--gray-600), var(--gray-400));
|
|
44
|
+
--foreground-low-emphasized: light-dark(var(--gray-100), var(--gray-900));
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.sui-tone-suggest {
|
|
48
|
+
--background-high: light-dark(var(--purple-100), var(--purple-900));
|
|
49
|
+
--background-high-emphasized: light-dark(var(--purple-800), var(--purple-200));
|
|
50
|
+
--background-low: light-dark(var(--purple-50), var(--purple-950));
|
|
51
|
+
--background-low-emphasized: light-dark(var(--purple-600), var(--purple-400));
|
|
52
|
+
--separator-high: light-dark(var(--purple-400), var(--purple-600));
|
|
53
|
+
--separator-low: rgb(from var(--separator-high) r g b / var(--opacity-low));
|
|
54
|
+
--foreground-high: light-dark(var(--purple-800), var(--purple-200));
|
|
55
|
+
--foreground-low: light-dark(var(--purple-600), var(--purple-400));
|
|
56
|
+
--foreground-low-emphasized: light-dark(var(--purple-100), var(--purple-900));
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.sui-tone-positive {
|
|
60
|
+
--background-high: light-dark(var(--green-100), var(--green-900));
|
|
61
|
+
--background-high-emphasized: light-dark(var(--green-800), var(--green-200));
|
|
62
|
+
--background-low: light-dark(var(--green-50), var(--green-950));
|
|
63
|
+
--background-low-emphasized: light-dark(var(--green-600), var(--green-400));
|
|
64
|
+
--separator-high: light-dark(var(--green-400), var(--green-600));
|
|
65
|
+
--separator-low: rgb(from var(--separator-high) r g b / var(--opacity-low));
|
|
66
|
+
--foreground-high: light-dark(var(--green-800), var(--green-200));
|
|
67
|
+
--foreground-low: light-dark(var(--green-600), var(--green-400));
|
|
68
|
+
--foreground-low-emphasized: light-dark(var(--green-100), var(--green-900));
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.sui-tone-caution {
|
|
72
|
+
--background-high: light-dark(var(--yellow-100), var(--yellow-900));
|
|
73
|
+
--background-high-emphasized: light-dark(var(--yellow-800), var(--yellow-200));
|
|
74
|
+
--background-low: light-dark(var(--yellow-50), var(--yellow-950));
|
|
75
|
+
--background-low-emphasized: light-dark(var(--yellow-600), var(--yellow-400));
|
|
76
|
+
--separator-high: light-dark(var(--yellow-400), var(--yellow-600));
|
|
77
|
+
--separator-low: rgb(from var(--separator-high) r g b / var(--opacity-low));
|
|
78
|
+
--foreground-high: light-dark(var(--yellow-800), var(--yellow-200));
|
|
79
|
+
--foreground-low: light-dark(var(--yellow-600), var(--yellow-400));
|
|
80
|
+
--foreground-low-emphasized: light-dark(var(--yellow-100), var(--yellow-900));
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.sui-tone-critical {
|
|
84
|
+
--background-high: light-dark(var(--red-100), var(--red-900));
|
|
85
|
+
--background-high-emphasized: light-dark(var(--red-800), var(--red-200));
|
|
86
|
+
--background-low: light-dark(var(--red-50), var(--red-950));
|
|
87
|
+
--background-low-emphasized: light-dark(var(--red-600), var(--red-400));
|
|
88
|
+
--separator-high: light-dark(var(--red-400), var(--red-600));
|
|
24
89
|
--separator-low: rgb(from var(--separator-high) r g b / var(--opacity-low));
|
|
25
|
-
--foreground-high: var(--
|
|
26
|
-
--foreground-
|
|
27
|
-
--foreground-low: var(--
|
|
28
|
-
--foreground-low-emphasized: var(--tone-100);
|
|
90
|
+
--foreground-high: light-dark(var(--red-800), var(--red-200));
|
|
91
|
+
--foreground-low: light-dark(var(--red-600), var(--red-400));
|
|
92
|
+
--foreground-low-emphasized: light-dark(var(--red-100), var(--red-900));
|
|
29
93
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
|
+
export * from './components/avatar/Avatar'
|
|
4
|
+
export * from './components/avatar-counter/AvatarCounter'
|
|
5
|
+
export * from './components/avatar-stack/AvatarStack'
|
|
3
6
|
export * from './components/badge/Badge'
|
|
4
7
|
export * from './components/box/Box'
|
|
5
8
|
export * from './components/button/Button'
|
|
@@ -14,11 +17,13 @@ export * from './components/flex/Flex'
|
|
|
14
17
|
export * from './components/grid/Grid'
|
|
15
18
|
export * from './components/h-stack/HStack'
|
|
16
19
|
export * from './components/heading/Heading'
|
|
20
|
+
export * from './components/hotkeys/Hotkeys'
|
|
17
21
|
export * from './components/icon/Icon'
|
|
18
22
|
export * from './components/icon-button/IconButton'
|
|
19
23
|
export * from './components/indicator/Indicator'
|
|
20
24
|
export * from './components/indicator-stack/IndicatorStack'
|
|
21
25
|
export * from './components/inline/Inline'
|
|
26
|
+
export * from './components/kbd/KBD'
|
|
22
27
|
export * from './components/label/Label'
|
|
23
28
|
export * from './components/link/Link'
|
|
24
29
|
export * from './components/list/List'
|
|
@@ -30,6 +35,7 @@ export * from './components/skip-to-content/SkipToContent'
|
|
|
30
35
|
export * from './components/spinner/Spinner'
|
|
31
36
|
export * from './components/switch/Switch'
|
|
32
37
|
export * from './components/text/Text'
|
|
38
|
+
export * from './components/text-area/TextArea'
|
|
33
39
|
export * from './components/text-input/TextInput'
|
|
34
40
|
export * from './components/tooltip/Tooltip'
|
|
35
41
|
export * from './components/tooltip-group/TooltipGroup'
|
|
@@ -53,6 +59,7 @@ export type {Density} from './types/Density'
|
|
|
53
59
|
export type {DisplayBlock, DisplayFlex, DisplayGrid} from './types/Display'
|
|
54
60
|
export type {EyebrowSize} from './types/Eyebrow'
|
|
55
61
|
export type {AlignItems, FlexDirection, FlexWrap, JustifyContent} from './types/Flex'
|
|
62
|
+
export type {FontWeight} from './types/FontWeight'
|
|
56
63
|
export type {GridAutoFlow} from './types/Grid'
|
|
57
64
|
export type {HeadingSize} from './types/Heading'
|
|
58
65
|
export type {IconSize} from './types/Icon'
|
|
@@ -65,5 +72,4 @@ export type {Shadow} from './types/Shadow'
|
|
|
65
72
|
export type {Space, SpaceAuto, SpaceAutoNegative, SpaceInherit} from './types/Space'
|
|
66
73
|
export type {TextSize} from './types/Text'
|
|
67
74
|
export type {TextAlign} from './types/TextAlign'
|
|
68
|
-
export type {FontWeight} from './types/FontWeight'
|
|
69
75
|
export type {Tone} from './types/Tone'
|
package/src/props/layout.ts
CHANGED
|
@@ -8,14 +8,14 @@ import {type OverflowProps, overflowProps} from './overflow'
|
|
|
8
8
|
import {type PaddingProps, paddingProps} from './padding'
|
|
9
9
|
import {type PositionProps, positionProps} from './position'
|
|
10
10
|
import {type ShadowProps, shadowProps} from './shadow'
|
|
11
|
-
import {type
|
|
11
|
+
import {toneWithDefaultProps, type ToneWithDefaultProps} from './tone'
|
|
12
12
|
import {type WidthProps, widthProps} from './width'
|
|
13
13
|
import {type ZIndexProps, zIndexProps} from './zIndex'
|
|
14
14
|
|
|
15
15
|
/** @public */
|
|
16
16
|
export interface LayoutProps
|
|
17
17
|
extends
|
|
18
|
-
|
|
18
|
+
ToneWithDefaultProps,
|
|
19
19
|
WidthProps,
|
|
20
20
|
HeightProps,
|
|
21
21
|
MarginProps,
|
|
@@ -29,7 +29,7 @@ export interface LayoutProps
|
|
|
29
29
|
ShadowProps {}
|
|
30
30
|
|
|
31
31
|
export const layoutProps: Record<string, PropDef> = {
|
|
32
|
-
...
|
|
32
|
+
...toneWithDefaultProps,
|
|
33
33
|
...widthProps,
|
|
34
34
|
...heightProps,
|
|
35
35
|
...marginProps,
|
package/src/props/tone.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import {type PropDef} from '../types/PropDef'
|
|
2
|
-
import {TONE, type Tone} from '../types/Tone'
|
|
2
|
+
import {TONE_WITH_DEFAULT, TONE, type ToneWithDefault, type Tone} from '../types/Tone'
|
|
3
3
|
|
|
4
4
|
export type ToneProps = {
|
|
5
|
-
/** CSS **background-color** property */
|
|
6
5
|
tone?: Tone
|
|
7
6
|
}
|
|
8
7
|
|
|
@@ -13,3 +12,15 @@ export const toneProps: Record<string, PropDef> = {
|
|
|
13
12
|
values: TONE,
|
|
14
13
|
},
|
|
15
14
|
}
|
|
15
|
+
|
|
16
|
+
export type ToneWithDefaultProps = {
|
|
17
|
+
tone?: ToneWithDefault
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const toneWithDefaultProps: Record<string, PropDef> = {
|
|
21
|
+
tone: {
|
|
22
|
+
type: 'union',
|
|
23
|
+
className: 'tone',
|
|
24
|
+
values: TONE_WITH_DEFAULT,
|
|
25
|
+
},
|
|
26
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export const AVATAR_SIZE = [0, 1, 2] as const
|
|
2
|
+
export type AvatarSize = (typeof AVATAR_SIZE)[number]
|
|
3
|
+
|
|
4
|
+
export const AVATAR_COLOR = [
|
|
5
|
+
'gray',
|
|
6
|
+
'purple',
|
|
7
|
+
'magenta',
|
|
8
|
+
'red',
|
|
9
|
+
'orange',
|
|
10
|
+
'yellow',
|
|
11
|
+
'green',
|
|
12
|
+
'cyan',
|
|
13
|
+
] as const
|
|
14
|
+
export type AvatarColor = (typeof AVATAR_COLOR)[number]
|
package/src/types/Eyebrow.ts
CHANGED
package/src/types/Tone.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 = '500alpha17'
|
|
3
|
+
export const HASH = '1271ff'
|