@anyknown/ui 0.2.0 → 0.4.0
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/components/badge/Badge.d.ts +3 -1
- package/dist/components/badge/Badge.js +2 -2
- package/dist/components/button/Button.d.ts +6 -2
- package/dist/components/button/Button.js +14 -2
- package/dist/components/checkbox/Checkbox.d.ts +3 -1
- package/dist/components/checkbox/Checkbox.js +2 -2
- package/dist/components/input/Input.d.ts +3 -1
- package/dist/components/input/Input.js +2 -2
- package/dist/components/label/Label.d.ts +3 -1
- package/dist/components/label/Label.js +2 -2
- package/dist/components/switch/Switch.d.ts +3 -1
- package/dist/components/switch/Switch.js +2 -2
- package/dist/components/textarea/Textarea.d.ts +3 -1
- package/dist/components/textarea/Textarea.js +2 -2
- package/dist/themes.stylex.d.ts +8 -0
- package/dist/themes.stylex.js +4 -0
- package/dist/tokens.css +6 -0
- package/dist/tokens.stylex.d.ts +2 -0
- package/dist/tokens.stylex.js +2 -0
- package/package.json +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as stylex from "@stylexjs/stylex";
|
|
2
2
|
import type { ComponentProps } from "react";
|
|
3
|
+
import { type StyleArg } from "../../lib/styled.js";
|
|
3
4
|
declare const DOT_TONES: {
|
|
4
5
|
readonly accent: Readonly<{
|
|
5
6
|
readonly color: stylex.StyleXClassNameFor<"color", string>;
|
|
@@ -18,8 +19,9 @@ export type BadgeProps = Omit<ComponentProps<"span">, "color"> & {
|
|
|
18
19
|
variant?: "neutral" | "accent" | "success" | "danger" | "outline" | "mono";
|
|
19
20
|
dot?: keyof typeof DOT_TONES;
|
|
20
21
|
count?: number;
|
|
22
|
+
sx?: StyleArg;
|
|
21
23
|
};
|
|
22
|
-
export declare function Badge({ variant, dot, count, children, ...props }: BadgeProps): import("react").JSX.Element;
|
|
24
|
+
export declare function Badge({ variant, dot, count, children, sx, ...props }: BadgeProps): import("react").JSX.Element;
|
|
23
25
|
export type ChipProps = BadgeProps & {
|
|
24
26
|
onRemove?: () => void;
|
|
25
27
|
removeLabel: string;
|
|
@@ -71,8 +71,8 @@ const DOT_TONES = {
|
|
|
71
71
|
danger: styles.dotDanger,
|
|
72
72
|
warning: styles.dotWarning,
|
|
73
73
|
};
|
|
74
|
-
export function Badge({ variant = "neutral", dot, count, children, ...props }) {
|
|
75
|
-
return (_jsxs("span", { ...props, ...styled(props, styles.base, styles[variant]), children: [dot != null && _jsx("span", { "aria-hidden": "true", ...stylex.props(styles.dot, DOT_TONES[dot]) }), children, count != null && _jsx("span", { ...stylex.props(styles.count), children: count })] }));
|
|
74
|
+
export function Badge({ variant = "neutral", dot, count, children, sx, ...props }) {
|
|
75
|
+
return (_jsxs("span", { ...props, ...styled(props, styles.base, styles[variant], sx), children: [dot != null && _jsx("span", { "aria-hidden": "true", ...stylex.props(styles.dot, DOT_TONES[dot]) }), children, count != null && _jsx("span", { ...stylex.props(styles.count), children: count })] }));
|
|
76
76
|
}
|
|
77
77
|
export function Chip({ onRemove, removeLabel, variant = "outline", children, ...props }) {
|
|
78
78
|
return (_jsxs(Badge, { variant: variant, ...props, children: [children, onRemove != null && (_jsx("button", { type: "button", "aria-label": removeLabel, onClick: onRemove, ...stylex.props(reset.control, styles.remove), children: _jsx("svg", { width: "8", height: "8", viewBox: "0 0 8 8", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", "aria-hidden": "true", children: _jsx("path", { d: "m1 1 6 6M7 1 1 7" }) }) }))] }));
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { type ComponentProps } from "react";
|
|
2
|
+
import { type StyleArg } from "../../lib/styled.js";
|
|
2
3
|
type ButtonProps = ComponentProps<"button"> & {
|
|
3
4
|
variant?: "primary" | "secondary" | "ghost" | "danger" | "dangerGhost";
|
|
4
|
-
size?: "sm" | "md";
|
|
5
|
+
size?: "xs" | "sm" | "md";
|
|
6
|
+
/** Square, no side padding — for a button whose whole label is one icon. */
|
|
7
|
+
icon?: boolean;
|
|
8
|
+
sx?: StyleArg;
|
|
5
9
|
};
|
|
6
|
-
export declare function Button({ variant, size, children, ref, ...props }: ButtonProps): import("react").JSX.Element;
|
|
10
|
+
export declare function Button({ variant, size, icon, children, ref, sx, ...props }: ButtonProps): import("react").JSX.Element;
|
|
7
11
|
export {};
|
|
@@ -40,6 +40,17 @@ const styles = stylex.create({
|
|
|
40
40
|
minHeight: "1.75rem",
|
|
41
41
|
fontSize: text.xs,
|
|
42
42
|
},
|
|
43
|
+
xs: {
|
|
44
|
+
paddingBlock: 0,
|
|
45
|
+
paddingInline: space.xs,
|
|
46
|
+
minHeight: "1.5rem",
|
|
47
|
+
fontSize: text.xs,
|
|
48
|
+
gap: space.xxs,
|
|
49
|
+
},
|
|
50
|
+
// 圖示鈕:正方,邊長跟著該階的高,沒有左右內距
|
|
51
|
+
iconMd: { paddingInline: 0, width: "2.25rem" },
|
|
52
|
+
iconSm: { paddingInline: 0, width: "1.75rem" },
|
|
53
|
+
iconXs: { paddingInline: 0, width: "1.5rem" },
|
|
43
54
|
// filter = 整塊布的落影(§3.3);ghost 是疏織,不落影
|
|
44
55
|
primary: { color: color.accentText, filter: yarn.shadow },
|
|
45
56
|
secondary: { color: color.text, filter: yarnSecondary.shadow },
|
|
@@ -69,7 +80,8 @@ const SILK = {
|
|
|
69
80
|
danger: { palette: palette(yarnDanger), bandMax: 0.75 },
|
|
70
81
|
dangerGhost: { palette: palette(yarnGhost), ghost: true, bandMax: 0.5 },
|
|
71
82
|
};
|
|
72
|
-
|
|
83
|
+
const ICON_SIZE = { xs: "iconXs", sm: "iconSm", md: "iconMd" };
|
|
84
|
+
export function Button({ variant = "primary", size = "md", icon = false, children, ref, sx, ...props }) {
|
|
73
85
|
// ref callback + cleanup(React 19)管生命週期,不用 effect;
|
|
74
86
|
// useCallback 鎖 identity,只有 variant 變了才重建織體
|
|
75
87
|
const silk = useCallback((node) => {
|
|
@@ -82,5 +94,5 @@ export function Button({ variant = "primary", size = "md", children, ref, ...pro
|
|
|
82
94
|
});
|
|
83
95
|
return () => body.destroy();
|
|
84
96
|
}, [variant]);
|
|
85
|
-
return (_jsxs("button", { type: "button", ...props, ref: (element) => assignRef(ref, element), ...styled(props, styles.base, styles[size], styles[variant]), children: [_jsx("svg", { ref: silk, "aria-hidden": "true", ...stylex.props(styles.silk) }), _jsx("span", { ...stylex.props(styles.label), children: children })] }));
|
|
97
|
+
return (_jsxs("button", { type: "button", ...props, ref: (element) => assignRef(ref, element), ...styled(props, styles.base, styles[size], icon && styles[ICON_SIZE[size]], styles[variant], sx), children: [_jsx("svg", { ref: silk, "aria-hidden": "true", ...stylex.props(styles.silk) }), _jsx("span", { ...stylex.props(styles.label), children: children })] }));
|
|
86
98
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { type ComponentProps, type ReactNode } from "react";
|
|
2
|
+
import { type StyleArg } from "../../lib/styled.js";
|
|
2
3
|
export type CheckboxProps = Omit<ComponentProps<"input">, "type" | "children"> & {
|
|
3
4
|
indeterminate?: boolean;
|
|
4
5
|
label?: ReactNode;
|
|
5
6
|
description?: ReactNode;
|
|
6
7
|
onCheckedChange?: (checked: boolean) => void;
|
|
8
|
+
sx?: StyleArg;
|
|
7
9
|
};
|
|
8
|
-
export declare function Checkbox({ indeterminate, label, description, onCheckedChange, checked, defaultChecked, onChange, ref, ...props }: CheckboxProps): import("react").JSX.Element;
|
|
10
|
+
export declare function Checkbox({ indeterminate, label, description, onCheckedChange, checked, defaultChecked, onChange, ref, sx, ...props }: CheckboxProps): import("react").JSX.Element;
|
|
@@ -77,7 +77,7 @@ const styles = stylex.create({
|
|
|
77
77
|
description: { display: "block", fontSize: text.xs, color: color.textMuted },
|
|
78
78
|
});
|
|
79
79
|
const BUCKETS = [styles.y0, styles.y1, styles.y2, styles.y3, styles.y4];
|
|
80
|
-
export function Checkbox({ indeterminate = false, label, description, onCheckedChange, checked, defaultChecked, onChange, ref, ...props }) {
|
|
80
|
+
export function Checkbox({ indeterminate = false, label, description, onCheckedChange, checked, defaultChecked, onChange, ref, sx, ...props }) {
|
|
81
81
|
const clipId = useSvgId("ak-weave");
|
|
82
82
|
const base = useId();
|
|
83
83
|
const labelId = `${base}label`;
|
|
@@ -95,7 +95,7 @@ export function Checkbox({ indeterminate = false, label, description, onCheckedC
|
|
|
95
95
|
const describedBy = [description != null ? descriptionId : null, field["aria-describedby"]]
|
|
96
96
|
.filter(Boolean)
|
|
97
97
|
.join(" ");
|
|
98
|
-
return (_jsxs("label", { ...stylex.props(styles.root), children: [_jsxs("span", { ...stylex.props(styles.box, filled && styles.boxOn), children: [_jsx("input", { type: "checkbox", ...props, ...field, "aria-invalid": invalid || undefined, "aria-labelledby": label != null ? labelId : undefined, "aria-describedby": describedBy || undefined, ref: setNode, checked: isChecked, onChange: (event) => {
|
|
98
|
+
return (_jsxs("label", { ...stylex.props(styles.root, sx), children: [_jsxs("span", { ...stylex.props(styles.box, filled && styles.boxOn), children: [_jsx("input", { type: "checkbox", ...props, ...field, "aria-invalid": invalid || undefined, "aria-labelledby": label != null ? labelId : undefined, "aria-describedby": describedBy || undefined, ref: setNode, checked: isChecked, onChange: (event) => {
|
|
99
99
|
setChecked(event.currentTarget.checked);
|
|
100
100
|
onChange?.(event);
|
|
101
101
|
}, ...styled(props, styles.input) }), _jsxs("svg", { viewBox: "0 0 24 24", "aria-hidden": "true", ...stylex.props(styles.svg), children: [_jsx("defs", { children: _jsx("clipPath", { id: clipId, children: _jsx("rect", { rx: "3", ...stylex.props(styles.weave, filled && styles.weaveOn) }) }) }), _jsxs("g", { clipPath: `url(#${clipId})`, children: [_jsxs("g", { ...stylex.props(styles.cloth), children: [_jsx("g", { ...stylex.props(styles.un), children: CLOTH.under.map((t, i) => (_jsx("path", { d: t.d, strokeWidth: t.sw }, i))) }), _jsx("g", { ...stylex.props(styles.sh), children: CLOTH.seams.map((t, i) => (_jsx("path", { d: t.d, strokeWidth: t.sw }, i))) }), CLOTH.face.map((t, i) => (_jsx("path", { d: t.d, strokeWidth: t.sw, ...stylex.props(BUCKETS[t.bucket]) }, i))), _jsx("g", { ...stylex.props(styles.hi), children: CLOTH.hi.map((t, i) => (_jsx("path", { d: t.d, strokeWidth: t.sw }, i))) })] }), _jsxs("g", { ...stylex.props(styles.mark), children: [_jsx("path", { d: indeterminate ? DASH_D : CHECK_D, strokeWidth: "2.1", transform: "translate(0.35 0.5)", ...stylex.props(styles.threadShadow) }), _jsx("path", { d: indeterminate ? DASH_D : CHECK_D, strokeWidth: "1.95", ...stylex.props(styles.threadCore) })] })] })] })] }), (label != null || description != null) && (_jsxs("span", { children: [label != null && (_jsx("span", { id: labelId, ...stylex.props(styles.labelText), children: label })), description != null && (_jsx("span", { id: descriptionId, ...stylex.props(styles.description), children: description }))] }))] }));
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as stylex from "@stylexjs/stylex";
|
|
2
2
|
import type { ComponentProps, ReactNode } from "react";
|
|
3
|
+
import { type StyleArg } from "../../lib/styled.js";
|
|
3
4
|
export declare const controlStyles: Readonly<{
|
|
4
5
|
readonly base: Readonly<{
|
|
5
6
|
readonly width: stylex.StyleXClassNameFor<"width", "100%">;
|
|
@@ -44,5 +45,6 @@ export type InputProps = Omit<ComponentProps<"input">, "size"> & {
|
|
|
44
45
|
size?: "sm" | "md";
|
|
45
46
|
invalid?: boolean;
|
|
46
47
|
leadingIcon?: ReactNode;
|
|
48
|
+
sx?: StyleArg;
|
|
47
49
|
};
|
|
48
|
-
export declare function Input({ size, invalid, leadingIcon, ...props }: InputProps): import("react").JSX.Element;
|
|
50
|
+
export declare function Input({ size, invalid, leadingIcon, sx, ...props }: InputProps): import("react").JSX.Element;
|
|
@@ -54,10 +54,10 @@ const styles = stylex.create({
|
|
|
54
54
|
withIconMd: { paddingInlineStart: space.xl },
|
|
55
55
|
withIconSm: { paddingInlineStart: space.lg },
|
|
56
56
|
});
|
|
57
|
-
export function Input({ size = "md", invalid, leadingIcon, ...props }) {
|
|
57
|
+
export function Input({ size = "md", invalid, leadingIcon, sx, ...props }) {
|
|
58
58
|
const { invalid: fieldInvalid, ...field } = useFieldControl(props);
|
|
59
59
|
const isInvalid = invalid ?? fieldInvalid;
|
|
60
|
-
const input = (_jsx("input", { ...props, ...field, "aria-invalid": isInvalid || undefined, ...styled(props, controlStyles.base, controlStyles[size], isInvalid && controlStyles.invalid, Boolean(leadingIcon) && (size === "sm" ? styles.withIconSm : styles.withIconMd)) }));
|
|
60
|
+
const input = (_jsx("input", { ...props, ...field, "aria-invalid": isInvalid || undefined, ...styled(props, controlStyles.base, controlStyles[size], isInvalid && controlStyles.invalid, Boolean(leadingIcon) && (size === "sm" ? styles.withIconSm : styles.withIconMd), sx) }));
|
|
61
61
|
if (!leadingIcon)
|
|
62
62
|
return input;
|
|
63
63
|
return (_jsxs("span", { ...stylex.props(styles.affix), children: [_jsx("span", { "aria-hidden": "true", ...stylex.props(styles.icon), children: leadingIcon }), input] }));
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { ComponentProps } from "react";
|
|
2
|
+
import { type StyleArg } from "../../lib/styled.js";
|
|
2
3
|
export type LabelProps = ComponentProps<"label"> & {
|
|
3
4
|
required?: boolean;
|
|
4
5
|
optional?: boolean;
|
|
5
6
|
optionalLabel?: string;
|
|
7
|
+
sx?: StyleArg;
|
|
6
8
|
};
|
|
7
|
-
export declare function Label({ required, optional, optionalLabel, children, ...props }: LabelProps): import("react").JSX.Element;
|
|
9
|
+
export declare function Label({ required, optional, optionalLabel, children, sx, ...props }: LabelProps): import("react").JSX.Element;
|
|
@@ -16,6 +16,6 @@ const styles = stylex.create({
|
|
|
16
16
|
required: { color: color.danger },
|
|
17
17
|
optional: { fontWeight: 400, fontSize: text.xs, color: color.textFaint },
|
|
18
18
|
});
|
|
19
|
-
export function Label({ required, optional, optionalLabel = "選填", children, ...props }) {
|
|
20
|
-
return (_jsxs("label", { ...props, ...styled(props, styles.base), children: [children, required && (_jsx("span", { "aria-hidden": "true", ...stylex.props(styles.required), children: "*" })), optional && _jsxs("span", { ...stylex.props(styles.optional), children: [" ", optionalLabel] })] }));
|
|
19
|
+
export function Label({ required, optional, optionalLabel = "選填", children, sx, ...props }) {
|
|
20
|
+
return (_jsxs("label", { ...props, ...styled(props, styles.base, sx), children: [children, required && (_jsx("span", { "aria-hidden": "true", ...stylex.props(styles.required), children: "*" })), optional && _jsxs("span", { ...stylex.props(styles.optional), children: [" ", optionalLabel] })] }));
|
|
21
21
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { type ComponentProps, type ReactNode } from "react";
|
|
2
|
+
import { type StyleArg } from "../../lib/styled.js";
|
|
2
3
|
export type SwitchProps = Omit<ComponentProps<"input">, "type" | "role" | "children"> & {
|
|
3
4
|
label?: ReactNode;
|
|
4
5
|
description?: ReactNode;
|
|
5
6
|
onCheckedChange?: (checked: boolean) => void;
|
|
7
|
+
sx?: StyleArg;
|
|
6
8
|
};
|
|
7
|
-
export declare function Switch({ label, description, onCheckedChange, checked, defaultChecked, onChange, ...props }: SwitchProps): import("react").JSX.Element;
|
|
9
|
+
export declare function Switch({ label, description, onCheckedChange, checked, defaultChecked, onChange, sx, ...props }: SwitchProps): import("react").JSX.Element;
|
|
@@ -91,7 +91,7 @@ const styles = stylex.create({
|
|
|
91
91
|
description: { display: "block", fontSize: text.xs, color: color.textMuted },
|
|
92
92
|
});
|
|
93
93
|
const BUCKETS = [styles.y0, styles.y1, styles.y2, styles.y3, styles.y4];
|
|
94
|
-
export function Switch({ label, description, onCheckedChange, checked, defaultChecked, onChange, ...props }) {
|
|
94
|
+
export function Switch({ label, description, onCheckedChange, checked, defaultChecked, onChange, sx, ...props }) {
|
|
95
95
|
const clipId = useSvgId("ak-weave");
|
|
96
96
|
const base = useId();
|
|
97
97
|
const labelId = `${base}label`;
|
|
@@ -101,7 +101,7 @@ export function Switch({ label, description, onCheckedChange, checked, defaultCh
|
|
|
101
101
|
.filter(Boolean)
|
|
102
102
|
.join(" ");
|
|
103
103
|
const [isOn, setOn] = useControllableState(checked, defaultChecked ?? false, onCheckedChange);
|
|
104
|
-
return (_jsxs("label", { ...stylex.props(styles.root), children: [(label != null || description != null) && (_jsxs("span", { children: [label != null && (_jsx("span", { id: labelId, ...stylex.props(styles.labelText), children: label })), description != null && (_jsx("span", { id: descriptionId, ...stylex.props(styles.description), children: description }))] })), _jsxs("span", { ...stylex.props(styles.track), children: [_jsx("input", { type: "checkbox", role: "switch", ...props, ...field, "aria-invalid": invalid || undefined, "aria-labelledby": label != null ? labelId : undefined, "aria-describedby": describedBy || undefined, checked: isOn, "aria-checked": isOn, onChange: (event) => {
|
|
104
|
+
return (_jsxs("label", { ...stylex.props(styles.root, sx), children: [(label != null || description != null) && (_jsxs("span", { children: [label != null && (_jsx("span", { id: labelId, ...stylex.props(styles.labelText), children: label })), description != null && (_jsx("span", { id: descriptionId, ...stylex.props(styles.description), children: description }))] })), _jsxs("span", { ...stylex.props(styles.track), children: [_jsx("input", { type: "checkbox", role: "switch", ...props, ...field, "aria-invalid": invalid || undefined, "aria-labelledby": label != null ? labelId : undefined, "aria-describedby": describedBy || undefined, checked: isOn, "aria-checked": isOn, onChange: (event) => {
|
|
105
105
|
setOn(event.currentTarget.checked);
|
|
106
106
|
onChange?.(event);
|
|
107
107
|
}, ...styled(props, styles.input) }), _jsxs("svg", { viewBox: "0 0 44 22", "aria-hidden": "true", ...stylex.props(styles.svg), children: [_jsx("path", { d: "M11,11 H33", ...stylex.props(styles.guide) }), _jsxs("g", { ...stylex.props(styles.cloth, isOn && styles.clothOn), children: [_jsxs("defs", { children: [_jsx("clipPath", { id: `${clipId}p`, children: _jsx("rect", { x: "1", y: "1", width: "42", height: "20", rx: "10" }) }), _jsx("clipPath", { id: clipId, children: _jsx("rect", { x: "1", y: "-3", height: "28", ...stylex.props(styles.pillclip, isOn && styles.pillclipOn) }) })] }), _jsx("g", { clipPath: `url(#${clipId}p)`, children: _jsxs("g", { clipPath: `url(#${clipId})`, ...stylex.props(styles.yarns), children: [_jsx("g", { ...stylex.props(styles.un), children: CLOTH.under.map((t, i) => (_jsx("path", { d: t.d, strokeWidth: t.sw }, i))) }), _jsx("g", { ...stylex.props(styles.sh), children: CLOTH.seams.map((t, i) => (_jsx("path", { d: t.d, strokeWidth: t.sw }, i))) }), CLOTH.face.map((t, i) => (_jsx("path", { d: t.d, strokeWidth: t.sw, ...stylex.props(BUCKETS[t.bucket]) }, i))), _jsx("g", { ...stylex.props(styles.hi), children: CLOTH.hi.map((t, i) => (_jsx("path", { d: t.d, strokeWidth: t.sw }, i))) })] }) })] }), _jsx("circle", { cx: "11", cy: "11", r: "8.4", ...stylex.props(styles.thumb, isOn && styles.thumbOn) })] })] })] }));
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { ComponentProps } from "react";
|
|
2
|
+
import { type StyleArg } from "../../lib/styled.js";
|
|
2
3
|
export type TextareaProps = ComponentProps<"textarea"> & {
|
|
3
4
|
autoGrow?: boolean;
|
|
4
5
|
maxRows?: number;
|
|
5
6
|
invalid?: boolean;
|
|
7
|
+
sx?: StyleArg;
|
|
6
8
|
};
|
|
7
|
-
export declare function Textarea({ autoGrow, maxRows, invalid, ...props }: TextareaProps): import("react").JSX.Element;
|
|
9
|
+
export declare function Textarea({ autoGrow, maxRows, invalid, sx, ...props }: TextareaProps): import("react").JSX.Element;
|
|
@@ -18,8 +18,8 @@ const styles = stylex.create({
|
|
|
18
18
|
},
|
|
19
19
|
maxRows: (rows) => ({ maxHeight: `calc(${rows} * 1.6em + ${space.md})` }),
|
|
20
20
|
});
|
|
21
|
-
export function Textarea({ autoGrow, maxRows, invalid, ...props }) {
|
|
21
|
+
export function Textarea({ autoGrow, maxRows, invalid, sx, ...props }) {
|
|
22
22
|
const { invalid: fieldInvalid, ...field } = useFieldControl(props);
|
|
23
23
|
const isInvalid = invalid ?? fieldInvalid;
|
|
24
|
-
return (_jsx("textarea", { ...props, ...field, "aria-invalid": isInvalid || undefined, ...styled(props, controlStyles.base, styles.base, autoGrow && styles.autoGrow, maxRows != null && styles.maxRows(maxRows), isInvalid && controlStyles.invalid) }));
|
|
24
|
+
return (_jsx("textarea", { ...props, ...field, "aria-invalid": isInvalid || undefined, ...styled(props, controlStyles.base, styles.base, autoGrow && styles.autoGrow, maxRows != null && styles.maxRows(maxRows), isInvalid && controlStyles.invalid, sx) }));
|
|
25
25
|
}
|
package/dist/themes.stylex.d.ts
CHANGED
|
@@ -17,6 +17,8 @@ export declare const lightColor: stylex.Theme<stylex.VarGroup<Readonly<{
|
|
|
17
17
|
successSubtle: string;
|
|
18
18
|
warning: string;
|
|
19
19
|
warningSubtle: string;
|
|
20
|
+
info: string;
|
|
21
|
+
infoSubtle: string;
|
|
20
22
|
focusRing: string;
|
|
21
23
|
bone: string;
|
|
22
24
|
sheen: string;
|
|
@@ -99,6 +101,8 @@ export declare const darkColor: stylex.Theme<stylex.VarGroup<Readonly<{
|
|
|
99
101
|
successSubtle: string;
|
|
100
102
|
warning: string;
|
|
101
103
|
warningSubtle: string;
|
|
104
|
+
info: string;
|
|
105
|
+
infoSubtle: string;
|
|
102
106
|
focusRing: string;
|
|
103
107
|
bone: string;
|
|
104
108
|
sheen: string;
|
|
@@ -182,6 +186,8 @@ export declare const light: readonly [stylex.Theme<stylex.VarGroup<Readonly<{
|
|
|
182
186
|
successSubtle: string;
|
|
183
187
|
warning: string;
|
|
184
188
|
warningSubtle: string;
|
|
189
|
+
info: string;
|
|
190
|
+
infoSubtle: string;
|
|
185
191
|
focusRing: string;
|
|
186
192
|
bone: string;
|
|
187
193
|
sheen: string;
|
|
@@ -258,6 +264,8 @@ export declare const dark: readonly [stylex.Theme<stylex.VarGroup<Readonly<{
|
|
|
258
264
|
successSubtle: string;
|
|
259
265
|
warning: string;
|
|
260
266
|
warningSubtle: string;
|
|
267
|
+
info: string;
|
|
268
|
+
infoSubtle: string;
|
|
261
269
|
focusRing: string;
|
|
262
270
|
bone: string;
|
|
263
271
|
sheen: string;
|
package/dist/themes.stylex.js
CHANGED
|
@@ -23,6 +23,8 @@ export const lightColor = stylex.createTheme(color, {
|
|
|
23
23
|
successSubtle: "#E7F0EB",
|
|
24
24
|
warning: "#9A6A1B",
|
|
25
25
|
warningSubtle: "#F5EBD9",
|
|
26
|
+
info: "#2C5C86",
|
|
27
|
+
infoSubtle: "#E4EDF5",
|
|
26
28
|
focusRing: "#23705A",
|
|
27
29
|
bone: "#ECE9DF",
|
|
28
30
|
sheen: "#F6F4EC",
|
|
@@ -105,6 +107,8 @@ export const darkColor = stylex.createTheme(color, {
|
|
|
105
107
|
successSubtle: "#22352E",
|
|
106
108
|
warning: "#D9A254",
|
|
107
109
|
warningSubtle: "#3A2F1D",
|
|
110
|
+
info: "#6FA3CE",
|
|
111
|
+
infoSubtle: "#1E2C38",
|
|
108
112
|
focusRing: "#4FA184",
|
|
109
113
|
bone: "#2A2620",
|
|
110
114
|
sheen: "#35302A",
|
package/dist/tokens.css
CHANGED
|
@@ -25,6 +25,8 @@ html {
|
|
|
25
25
|
--ak-success-subtle: #e7f0eb;
|
|
26
26
|
--ak-warning: #9a6a1b;
|
|
27
27
|
--ak-warning-subtle: #f5ebd9;
|
|
28
|
+
--ak-info: #2c5c86;
|
|
29
|
+
--ak-info-subtle: #e4edf5;
|
|
28
30
|
--ak-focus-ring: #23705a;
|
|
29
31
|
--ak-bone: #ece9df;
|
|
30
32
|
--ak-sheen: #f6f4ec;
|
|
@@ -71,6 +73,8 @@ html {
|
|
|
71
73
|
--ak-success-subtle: #22352e;
|
|
72
74
|
--ak-warning: #d9a254;
|
|
73
75
|
--ak-warning-subtle: #3a2f1d;
|
|
76
|
+
--ak-info: #6fa3ce;
|
|
77
|
+
--ak-info-subtle: #1e2c38;
|
|
74
78
|
--ak-focus-ring: #4fa184;
|
|
75
79
|
--ak-bone: #2a2620;
|
|
76
80
|
--ak-sheen: #35302a;
|
|
@@ -106,5 +110,7 @@ html {
|
|
|
106
110
|
--ak-success-subtle: #22352e;
|
|
107
111
|
--ak-warning: #d9a254;
|
|
108
112
|
--ak-warning-subtle: #3a2f1d;
|
|
113
|
+
--ak-info: #6fa3ce;
|
|
114
|
+
--ak-info-subtle: #1e2c38;
|
|
109
115
|
--ak-focus-ring: #4fa184;
|
|
110
116
|
}
|
package/dist/tokens.stylex.d.ts
CHANGED
package/dist/tokens.stylex.js
CHANGED
|
@@ -21,6 +21,8 @@ export const color = stylex.defineVars({
|
|
|
21
21
|
successSubtle: { default: "#E7F0EB", [DARK]: "#22352E" },
|
|
22
22
|
warning: { default: "#9A6A1B", [DARK]: "#D9A254" },
|
|
23
23
|
warningSubtle: { default: "#F5EBD9", [DARK]: "#3A2F1D" },
|
|
24
|
+
info: { default: "#2C5C86", [DARK]: "#6FA3CE" },
|
|
25
|
+
infoSubtle: { default: "#E4EDF5", [DARK]: "#1E2C38" },
|
|
24
26
|
focusRing: { default: "#23705A", [DARK]: "#4FA184" },
|
|
25
27
|
bone: { default: "#ECE9DF", [DARK]: "#2A2620" },
|
|
26
28
|
sheen: { default: "#F6F4EC", [DARK]: "#35302A" },
|