ui-foundations 0.3.2 → 0.6.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/README.md +181 -37
- package/dist/assets/icons/checkmark.svg +1 -0
- package/dist/core/index.css +8 -7
- package/dist/macros/ui.njk +203 -0
- package/dist/main.css +941 -210
- package/dist/react/accordion.js +36 -0
- package/dist/react/avatar.js +34 -0
- package/dist/react/badge.js +41 -0
- package/dist/react/button.js +4 -6
- package/dist/react/checkbox.js +21 -8
- package/dist/react/divider.js +31 -0
- package/dist/react/icon.js +8 -1
- package/dist/react/index.js +8 -0
- package/dist/react/label.js +1 -1
- package/dist/react/radio.js +45 -0
- package/dist/react/switch.js +9 -8
- package/dist/react/tabs.js +72 -0
- package/dist/react/textarea.js +38 -0
- package/dist/react/tooltip.js +25 -0
- package/dist/react/warn-dev.js +15 -0
- package/dist/tokens/css/{appearance-(modes).tokens.mode-dark.css → appearance-modes.tokens.mode-dark.css} +6 -6
- package/dist/tokens/css/{appearance-(modes).tokens.mode-light.css → appearance-modes.tokens.mode-light.css} +1 -1
- package/dist/tokens/css/{components-(ui).tokens.css → components-ui.tokens.css} +73 -32
- package/dist/tokens/css/core-primitives.tokens.css +240 -0
- package/dist/tokens/css/{semantics-(roles).tokens.css → semantics-roles.tokens.css} +1 -1
- package/dist/tokens/css/themes-brands.tokens.brand-a.css +22 -0
- package/dist/tokens/css/{themes-(brands).tokens.brand-b.css → themes-brands.tokens.brand-b.css} +9 -9
- package/dist/tokens/css/themes-brands.tokens.brand-c.css +22 -0
- package/dist/tokens/json/appearance-modes.tokens.mode-dark.json +121 -0
- package/dist/tokens/json/appearance-modes.tokens.mode-light.json +121 -0
- package/dist/tokens/json/components-ui.tokens.json +713 -0
- package/dist/tokens/json/{core-(primitives).tokens.json → core-primitives.tokens.json} +526 -410
- package/dist/tokens/json/semantics-roles.tokens.json +141 -0
- package/dist/tokens/json/themes-brands.tokens.brand-a.json +81 -0
- package/dist/tokens/json/themes-brands.tokens.brand-b.json +81 -0
- package/dist/tokens/json/themes-brands.tokens.brand-c.json +81 -0
- package/dist/tokens/tokens.yaml +2722 -499
- package/dist/tokens/ts/{appearance-(modes).tokens.mode-dark.ts → appearance-modes.tokens.mode-dark.ts} +6 -6
- package/dist/tokens/ts/{appearance-(modes).tokens.mode-light.ts → appearance-modes.tokens.mode-light.ts} +1 -1
- package/dist/tokens/ts/{components-(ui).tokens.ts → components-ui.tokens.ts} +74 -33
- package/dist/tokens/ts/core-primitives.tokens.ts +265 -0
- package/dist/tokens/ts/{semantics-(roles).tokens.ts → semantics-roles.tokens.ts} +1 -1
- package/dist/tokens/ts/themes-brands.tokens.brand-a.ts +32 -0
- package/dist/tokens/ts/{themes-(brands).tokens.brand-b.ts → themes-brands.tokens.brand-b.ts} +9 -9
- package/dist/tokens/ts/{themes-(brands).tokens.brand-a.ts → themes-brands.tokens.brand-c.ts} +9 -9
- package/dist/ui/index.css +8 -0
- package/dist/ui/patterns/accordion.css +81 -0
- package/dist/ui/patterns/avatar.css +57 -0
- package/dist/ui/patterns/badge.css +49 -0
- package/dist/ui/patterns/checkbox.css +71 -22
- package/dist/ui/patterns/divider.css +25 -0
- package/dist/ui/patterns/radio.css +109 -0
- package/dist/ui/patterns/tabs.css +71 -0
- package/dist/ui/patterns/textarea.css +50 -0
- package/dist/ui/patterns/tooltip.css +64 -0
- package/docs/README.md +38 -0
- package/docs/agentic/README.md +35 -0
- package/docs/agentic/assistant-behavior-rules.md +48 -0
- package/docs/agentic/skills/component-accessibility-audit.md +132 -0
- package/docs/agentic/skills/ux-writing-coach.md +116 -0
- package/docs/foundations/README.md +31 -0
- package/docs/foundations/foundation-001-token-layering.md +6 -0
- package/docs/foundations/foundation-002-naming-and-grouping.md +6 -0
- package/docs/foundations/foundation-003-color-semantics-and-status.md +6 -0
- package/docs/foundations/foundation-004-typography-scale-and-line-height.md +6 -0
- package/docs/foundations/foundation-005-responsive-breakpoints-and-containers.md +6 -0
- package/docs/foundations/foundation-006-z-index-layering.md +6 -0
- package/docs/foundations/foundation-007-typography-selectors-and-specificity.md +7 -1
- package/docs/foundations/foundation-008-mode-activation-and-consumer-control.md +6 -0
- package/docs/foundations/foundation-009-component-boundaries-and-utility.md +6 -0
- package/docs/foundations/foundation-010-implementation-and-pipeline-workflow.md +6 -0
- package/docs/foundations/foundation-011-branching-and-release-governance.md +6 -0
- package/docs/foundations/foundation-012-minimal-markup-and-composition.md +6 -0
- package/package.json +16 -11
- package/dist/tokens/css/core-(primitives).tokens.css +0 -127
- package/dist/tokens/css/themes-(brands).tokens.brand-a.css +0 -22
- package/dist/tokens/json/appearance-(modes).tokens.mode-dark.json +0 -182
- package/dist/tokens/json/appearance-(modes).tokens.mode-light.json +0 -182
- package/dist/tokens/json/components-(ui).tokens.json +0 -739
- package/dist/tokens/json/semantics-(roles).tokens.json +0 -203
- package/dist/tokens/json/themes-(brands).tokens.brand-a.json +0 -115
- package/dist/tokens/json/themes-(brands).tokens.brand-b.json +0 -115
- package/dist/tokens/ts/core-(primitives).tokens.ts +0 -152
- package/docs/agentic/skills/README.md +0 -51
- package/docs/agentic/skills/design-ops-specialist/SKILL.md +0 -60
- package/docs/agentic/skills/design-system-architect/SKILL.md +0 -106
- package/docs/agentic/team-ai-playbook.md +0 -226
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Accordion — expandable/collapsible content sections using native details/summary.
|
|
5
|
+
*
|
|
6
|
+
* @param {object} props
|
|
7
|
+
* @param {string} [props.className=""] - Additional CSS classes
|
|
8
|
+
*/
|
|
9
|
+
export function Accordion({ className = "", children, ...props }) {
|
|
10
|
+
const classes = ["accordion"];
|
|
11
|
+
if (className) classes.push(className);
|
|
12
|
+
|
|
13
|
+
return React.createElement("div", { className: classes.join(" "), ...props }, children);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* AccordionItem — single expandable section.
|
|
18
|
+
*
|
|
19
|
+
* @param {object} props
|
|
20
|
+
* @param {string} props.title - Summary/trigger text
|
|
21
|
+
* @param {boolean} [props.open=false] - Whether expanded
|
|
22
|
+
* @param {boolean} [props.disabled=false] - Whether disabled
|
|
23
|
+
* @param {string} [props.className=""] - Additional CSS classes
|
|
24
|
+
*/
|
|
25
|
+
export function AccordionItem({ title, open = false, disabled = false, className = "", children, ...props }) {
|
|
26
|
+
const classes = ["accordion-item"];
|
|
27
|
+
if (disabled) classes.push("is-disabled");
|
|
28
|
+
if (className) classes.push(className);
|
|
29
|
+
|
|
30
|
+
return React.createElement(
|
|
31
|
+
"details",
|
|
32
|
+
{ className: classes.join(" "), open, ...props },
|
|
33
|
+
React.createElement("summary", null, title),
|
|
34
|
+
React.createElement("div", { className: "accordion-item__content" }, children)
|
|
35
|
+
);
|
|
36
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Avatar — thumbnail representation of a user or entity.
|
|
5
|
+
*
|
|
6
|
+
* @param {object} props
|
|
7
|
+
* @param {string} [props.src] - Image URL
|
|
8
|
+
* @param {string} [props.alt=""] - Alt text for image
|
|
9
|
+
* @param {string} [props.initials=""] - Fallback initials when no image
|
|
10
|
+
* @param {"xs"|"sm"|"md"|"lg"|"xl"} [props.size="md"] - Size variant
|
|
11
|
+
* @param {string} [props.className=""] - Additional CSS classes
|
|
12
|
+
*/
|
|
13
|
+
export function Avatar({
|
|
14
|
+
src,
|
|
15
|
+
alt = "",
|
|
16
|
+
initials = "",
|
|
17
|
+
size = "md",
|
|
18
|
+
className = "",
|
|
19
|
+
...props
|
|
20
|
+
}) {
|
|
21
|
+
const classes = ["avatar"];
|
|
22
|
+
if (size && size !== "md") classes.push(size);
|
|
23
|
+
if (className) classes.push(className);
|
|
24
|
+
|
|
25
|
+
const children = src
|
|
26
|
+
? React.createElement("img", { src, alt })
|
|
27
|
+
: React.createElement("span", { className: "avatar__initials" }, initials);
|
|
28
|
+
|
|
29
|
+
return React.createElement(
|
|
30
|
+
"span",
|
|
31
|
+
{ className: classes.join(" "), role: "img", "aria-label": alt || initials, ...props },
|
|
32
|
+
children
|
|
33
|
+
);
|
|
34
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Icon } from "./icon.js";
|
|
3
|
+
|
|
4
|
+
export function Badge({
|
|
5
|
+
children,
|
|
6
|
+
text,
|
|
7
|
+
variant = "default",
|
|
8
|
+
size = "md",
|
|
9
|
+
startIcon,
|
|
10
|
+
className = "",
|
|
11
|
+
...props
|
|
12
|
+
}) {
|
|
13
|
+
const content = children ?? text;
|
|
14
|
+
const classes = ["badge"];
|
|
15
|
+
|
|
16
|
+
if (variant && variant !== "default") classes.push(variant);
|
|
17
|
+
if (size === "sm") classes.push("sm");
|
|
18
|
+
if (className) classes.push(className);
|
|
19
|
+
|
|
20
|
+
const iconElement =
|
|
21
|
+
startIcon && typeof startIcon === "string"
|
|
22
|
+
? React.createElement(Icon, {
|
|
23
|
+
name: startIcon,
|
|
24
|
+
decorative: true,
|
|
25
|
+
})
|
|
26
|
+
: startIcon && React.isValidElement(startIcon)
|
|
27
|
+
? startIcon
|
|
28
|
+
: null;
|
|
29
|
+
|
|
30
|
+
return React.createElement(
|
|
31
|
+
"span",
|
|
32
|
+
{
|
|
33
|
+
className: classes.join(" "),
|
|
34
|
+
...props,
|
|
35
|
+
},
|
|
36
|
+
iconElement,
|
|
37
|
+
content != null
|
|
38
|
+
? React.createElement("span", { className: "badge__text" }, content)
|
|
39
|
+
: null,
|
|
40
|
+
);
|
|
41
|
+
}
|
package/dist/react/button.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { LabelContent } from "./label.js";
|
|
2
|
+
import { LabelContent, hasTextContent } from "./label.js";
|
|
3
|
+
import { warnDev } from "./warn-dev.js";
|
|
3
4
|
|
|
4
5
|
function normalizeOrientation(value) {
|
|
5
6
|
return value === "vertical" ? "vertical" : "horizontal";
|
|
@@ -28,10 +29,7 @@ export function Button({
|
|
|
28
29
|
if (className) classes.push(className);
|
|
29
30
|
|
|
30
31
|
const content = children ?? label;
|
|
31
|
-
const hasReadableLabel =
|
|
32
|
-
typeof content === "string"
|
|
33
|
-
? content.trim().length > 0
|
|
34
|
-
: content !== null && content !== undefined && content !== false;
|
|
32
|
+
const hasReadableLabel = hasTextContent(content);
|
|
35
33
|
const resolvedIconOnly = iconOnly ?? !hasReadableLabel;
|
|
36
34
|
const iconStart = resolvedIconOnly ? startIcon || endIcon : startIcon;
|
|
37
35
|
const iconEnd = resolvedIconOnly ? undefined : endIcon;
|
|
@@ -49,7 +47,7 @@ export function Button({
|
|
|
49
47
|
}
|
|
50
48
|
|
|
51
49
|
if (resolvedIconOnly && !buttonProps["aria-label"]) {
|
|
52
|
-
|
|
50
|
+
warnDev(
|
|
53
51
|
"[ui-foundations] iconOnly Button should include `ariaLabel` or `aria-label`.",
|
|
54
52
|
);
|
|
55
53
|
}
|
package/dist/react/checkbox.js
CHANGED
|
@@ -1,31 +1,44 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
if (value === null || value === undefined || value === false) return false;
|
|
5
|
-
if (typeof value === "string") return value.trim().length > 0;
|
|
6
|
-
if (Array.isArray(value)) return value.some(hasLabelContent);
|
|
7
|
-
return true;
|
|
8
|
-
}
|
|
2
|
+
import { hasTextContent } from "./label.js";
|
|
3
|
+
import { warnDev } from "./warn-dev.js";
|
|
9
4
|
|
|
10
5
|
export function Checkbox({
|
|
11
6
|
className = "",
|
|
12
7
|
wrapperClassName = "",
|
|
13
8
|
label,
|
|
14
9
|
children,
|
|
10
|
+
indeterminate = false,
|
|
15
11
|
...props
|
|
16
12
|
}) {
|
|
17
13
|
const classes = ["checkbox"];
|
|
14
|
+
if (indeterminate) classes.push("is-indeterminate");
|
|
18
15
|
if (className) classes.push(className);
|
|
19
16
|
|
|
20
17
|
const content = children ?? label;
|
|
21
|
-
const hasLabel =
|
|
18
|
+
const hasLabel = hasTextContent(content);
|
|
22
19
|
const disabled = Boolean(props.disabled);
|
|
20
|
+
const inputRef = React.useRef(null);
|
|
21
|
+
|
|
22
|
+
React.useEffect(() => {
|
|
23
|
+
if (!inputRef.current) return;
|
|
24
|
+
inputRef.current.indeterminate = Boolean(indeterminate);
|
|
25
|
+
}, [indeterminate]);
|
|
26
|
+
|
|
23
27
|
const input = React.createElement("input", {
|
|
24
28
|
type: "checkbox",
|
|
25
29
|
className: classes.join(" "),
|
|
30
|
+
"aria-checked":
|
|
31
|
+
props["aria-checked"] ?? (indeterminate ? "mixed" : undefined),
|
|
32
|
+
ref: inputRef,
|
|
26
33
|
...props,
|
|
27
34
|
});
|
|
28
35
|
|
|
36
|
+
if (!hasLabel && !props["aria-label"] && !props["aria-labelledby"]) {
|
|
37
|
+
warnDev(
|
|
38
|
+
"[ui-foundations] Checkbox should include visible label content or `aria-label`/`aria-labelledby`.",
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
|
|
29
42
|
if (!hasLabel) return input;
|
|
30
43
|
|
|
31
44
|
const wrapperClasses = ["checkbox-field"];
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Divider — visual separator between content sections.
|
|
5
|
+
*
|
|
6
|
+
* @param {object} props
|
|
7
|
+
* @param {"horizontal"|"vertical"} [props.orientation="horizontal"] - Orientation
|
|
8
|
+
* @param {"subtle"|""} [props.variant=""] - Color variant
|
|
9
|
+
* @param {string} [props.className=""] - Additional CSS classes
|
|
10
|
+
*/
|
|
11
|
+
export function Divider({
|
|
12
|
+
orientation = "horizontal",
|
|
13
|
+
variant = "",
|
|
14
|
+
className = "",
|
|
15
|
+
...props
|
|
16
|
+
}) {
|
|
17
|
+
const classes = ["divider"];
|
|
18
|
+
if (variant) classes.push(variant);
|
|
19
|
+
if (className) classes.push(className);
|
|
20
|
+
|
|
21
|
+
const elementProps = {
|
|
22
|
+
className: classes.join(" "),
|
|
23
|
+
...props,
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
if (orientation === "vertical") {
|
|
27
|
+
elementProps["aria-orientation"] = "vertical";
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return React.createElement("hr", elementProps);
|
|
31
|
+
}
|
package/dist/react/icon.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import { warnDev } from "./warn-dev.js";
|
|
2
3
|
|
|
3
4
|
function resolveIconUrl(name, folder, src) {
|
|
4
5
|
if (src) return src;
|
|
@@ -37,8 +38,14 @@ export function Icon({
|
|
|
37
38
|
if (isDecorative) {
|
|
38
39
|
accessibilityProps["aria-hidden"] = true;
|
|
39
40
|
} else {
|
|
41
|
+
const accessibleLabel = label || humanizeName(name);
|
|
42
|
+
if (!accessibleLabel) {
|
|
43
|
+
warnDev(
|
|
44
|
+
"[ui-foundations] Non-decorative Icon should include a readable `label` or `name`.",
|
|
45
|
+
);
|
|
46
|
+
}
|
|
40
47
|
accessibilityProps.role = "img";
|
|
41
|
-
accessibilityProps["aria-label"] =
|
|
48
|
+
accessibilityProps["aria-label"] = accessibleLabel;
|
|
42
49
|
}
|
|
43
50
|
|
|
44
51
|
return React.createElement("span", {
|
package/dist/react/index.js
CHANGED
|
@@ -3,4 +3,12 @@ export { Checkbox } from "./checkbox.js";
|
|
|
3
3
|
export { Icon } from "./icon.js";
|
|
4
4
|
export { Input } from "./input.js";
|
|
5
5
|
export { LabelContent, FieldLabel } from "./label.js";
|
|
6
|
+
export { Radio } from "./radio.js";
|
|
6
7
|
export { Switch } from "./switch.js";
|
|
8
|
+
export { Badge } from "./badge.js";
|
|
9
|
+
export { Divider } from "./divider.js";
|
|
10
|
+
export { TextArea } from "./textarea.js";
|
|
11
|
+
export { Avatar } from "./avatar.js";
|
|
12
|
+
export { Accordion, AccordionItem } from "./accordion.js";
|
|
13
|
+
export { TabList, Tab, TabPanel } from "./tabs.js";
|
|
14
|
+
export { Tooltip } from "./tooltip.js";
|
package/dist/react/label.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { Icon } from "./icon.js";
|
|
3
3
|
|
|
4
|
-
function hasTextContent(value) {
|
|
4
|
+
export function hasTextContent(value) {
|
|
5
5
|
if (value === null || value === undefined || value === false) return false;
|
|
6
6
|
if (typeof value === "string") return value.trim().length > 0;
|
|
7
7
|
if (Array.isArray(value)) return value.some(hasTextContent);
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { hasTextContent } from "./label.js";
|
|
3
|
+
import { warnDev } from "./warn-dev.js";
|
|
4
|
+
|
|
5
|
+
export function Radio({
|
|
6
|
+
className = "",
|
|
7
|
+
wrapperClassName = "",
|
|
8
|
+
label,
|
|
9
|
+
children,
|
|
10
|
+
...props
|
|
11
|
+
}) {
|
|
12
|
+
const classes = ["radio"];
|
|
13
|
+
if (className) classes.push(className);
|
|
14
|
+
|
|
15
|
+
const content = children ?? label;
|
|
16
|
+
const hasLabel = hasTextContent(content);
|
|
17
|
+
const disabled = Boolean(props.disabled);
|
|
18
|
+
|
|
19
|
+
const input = React.createElement("input", {
|
|
20
|
+
type: "radio",
|
|
21
|
+
className: classes.join(" "),
|
|
22
|
+
...props,
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
if (!hasLabel && !props["aria-label"] && !props["aria-labelledby"]) {
|
|
26
|
+
warnDev(
|
|
27
|
+
"[ui-foundations] Radio should include visible label content or `aria-label`/`aria-labelledby`.",
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
if (!hasLabel) return input;
|
|
32
|
+
|
|
33
|
+
const wrapperClasses = ["radio-field"];
|
|
34
|
+
if (disabled) wrapperClasses.push("is-disabled");
|
|
35
|
+
if (wrapperClassName) wrapperClasses.push(wrapperClassName);
|
|
36
|
+
|
|
37
|
+
return React.createElement(
|
|
38
|
+
"label",
|
|
39
|
+
{
|
|
40
|
+
className: wrapperClasses.join(" "),
|
|
41
|
+
},
|
|
42
|
+
input,
|
|
43
|
+
React.createElement("span", { className: "radio-field__text" }, content),
|
|
44
|
+
);
|
|
45
|
+
}
|
package/dist/react/switch.js
CHANGED
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
if (value === null || value === undefined || value === false) return false;
|
|
5
|
-
if (typeof value === "string") return value.trim().length > 0;
|
|
6
|
-
if (Array.isArray(value)) return value.some(hasLabelContent);
|
|
7
|
-
return true;
|
|
8
|
-
}
|
|
2
|
+
import { hasTextContent } from "./label.js";
|
|
3
|
+
import { warnDev } from "./warn-dev.js";
|
|
9
4
|
|
|
10
5
|
export function Switch({
|
|
11
6
|
className = "",
|
|
@@ -19,7 +14,7 @@ export function Switch({
|
|
|
19
14
|
if (className) classes.push(className);
|
|
20
15
|
|
|
21
16
|
const content = children ?? label;
|
|
22
|
-
const hasLabel =
|
|
17
|
+
const hasLabel = hasTextContent(content);
|
|
23
18
|
const disabled = Boolean(props.disabled);
|
|
24
19
|
const input = React.createElement("input", {
|
|
25
20
|
type: "checkbox",
|
|
@@ -28,6 +23,12 @@ export function Switch({
|
|
|
28
23
|
...props,
|
|
29
24
|
});
|
|
30
25
|
|
|
26
|
+
if (!hasLabel && !props["aria-label"] && !props["aria-labelledby"]) {
|
|
27
|
+
warnDev(
|
|
28
|
+
"[ui-foundations] Switch should include visible label content or `aria-label`/`aria-labelledby`.",
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
|
|
31
32
|
if (!hasLabel) return input;
|
|
32
33
|
|
|
33
34
|
const wrapperClasses = ["switch-field"];
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* TabList — container for tab buttons.
|
|
5
|
+
*
|
|
6
|
+
* @param {object} props
|
|
7
|
+
* @param {"horizontal"|"vertical"} [props.orientation="horizontal"]
|
|
8
|
+
* @param {string} [props.ariaLabel=""] - Accessible label
|
|
9
|
+
* @param {string} [props.className=""] - Additional CSS classes
|
|
10
|
+
*/
|
|
11
|
+
export function TabList({ orientation = "horizontal", ariaLabel = "", className = "", children, ...props }) {
|
|
12
|
+
const classes = ["tab-list"];
|
|
13
|
+
if (className) classes.push(className);
|
|
14
|
+
|
|
15
|
+
const elementProps = {
|
|
16
|
+
className: classes.join(" "),
|
|
17
|
+
role: "tablist",
|
|
18
|
+
"aria-orientation": orientation,
|
|
19
|
+
...props,
|
|
20
|
+
};
|
|
21
|
+
if (ariaLabel) elementProps["aria-label"] = ariaLabel;
|
|
22
|
+
|
|
23
|
+
return React.createElement("div", elementProps, children);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Tab — individual tab button.
|
|
28
|
+
*
|
|
29
|
+
* @param {object} props
|
|
30
|
+
* @param {string} props.label - Tab label text
|
|
31
|
+
* @param {boolean} [props.selected=false] - Whether active
|
|
32
|
+
* @param {boolean} [props.disabled=false] - Whether disabled
|
|
33
|
+
* @param {string} [props.controls=""] - ID of controlled panel
|
|
34
|
+
* @param {string} [props.className=""] - Additional CSS classes
|
|
35
|
+
*/
|
|
36
|
+
export function Tab({ label, selected = false, disabled = false, controls = "", className = "", ...props }) {
|
|
37
|
+
const classes = ["tab"];
|
|
38
|
+
if (className) classes.push(className);
|
|
39
|
+
|
|
40
|
+
return React.createElement("button", {
|
|
41
|
+
className: classes.join(" "),
|
|
42
|
+
role: "tab",
|
|
43
|
+
type: "button",
|
|
44
|
+
"aria-selected": String(selected),
|
|
45
|
+
"aria-controls": controls || undefined,
|
|
46
|
+
disabled,
|
|
47
|
+
tabIndex: selected ? 0 : -1,
|
|
48
|
+
...props,
|
|
49
|
+
}, label);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* TabPanel — content panel associated with a tab.
|
|
54
|
+
*
|
|
55
|
+
* @param {object} props
|
|
56
|
+
* @param {string} [props.id=""] - Panel ID (referenced by tab's aria-controls)
|
|
57
|
+
* @param {boolean} [props.hidden=false] - Whether hidden
|
|
58
|
+
* @param {string} [props.className=""] - Additional CSS classes
|
|
59
|
+
*/
|
|
60
|
+
export function TabPanel({ id = "", hidden = false, className = "", children, ...props }) {
|
|
61
|
+
const classes = ["tab-panel"];
|
|
62
|
+
if (className) classes.push(className);
|
|
63
|
+
|
|
64
|
+
return React.createElement("div", {
|
|
65
|
+
className: classes.join(" "),
|
|
66
|
+
role: "tabpanel",
|
|
67
|
+
id: id || undefined,
|
|
68
|
+
hidden,
|
|
69
|
+
tabIndex: 0,
|
|
70
|
+
...props,
|
|
71
|
+
}, children);
|
|
72
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* TextArea — multi-line text input.
|
|
5
|
+
*
|
|
6
|
+
* @param {object} props
|
|
7
|
+
* @param {string} [props.placeholder=""] - Placeholder text
|
|
8
|
+
* @param {string} [props.value] - Controlled value
|
|
9
|
+
* @param {boolean} [props.disabled=false] - Disabled state
|
|
10
|
+
* @param {boolean} [props.readonly=false] - Readonly state
|
|
11
|
+
* @param {number} [props.rows] - Visible rows
|
|
12
|
+
* @param {string} [props.className=""] - Additional CSS classes
|
|
13
|
+
*/
|
|
14
|
+
export function TextArea({
|
|
15
|
+
placeholder = "",
|
|
16
|
+
value,
|
|
17
|
+
disabled = false,
|
|
18
|
+
readonly = false,
|
|
19
|
+
rows,
|
|
20
|
+
className = "",
|
|
21
|
+
...props
|
|
22
|
+
}) {
|
|
23
|
+
const classes = ["textarea"];
|
|
24
|
+
if (className) classes.push(className);
|
|
25
|
+
|
|
26
|
+
const elementProps = {
|
|
27
|
+
className: classes.join(" "),
|
|
28
|
+
placeholder,
|
|
29
|
+
disabled,
|
|
30
|
+
readOnly: readonly,
|
|
31
|
+
...props,
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
if (value !== undefined) elementProps.value = value;
|
|
35
|
+
if (rows) elementProps.rows = rows;
|
|
36
|
+
|
|
37
|
+
return React.createElement("textarea", elementProps);
|
|
38
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Tooltip — contextual help text on hover/focus.
|
|
5
|
+
*
|
|
6
|
+
* @param {object} props
|
|
7
|
+
* @param {string} props.text - Tooltip content
|
|
8
|
+
* @param {"top"|"bottom"|"left"|"right"} [props.placement="top"] - Position
|
|
9
|
+
* @param {string} [props.className=""] - Additional CSS classes
|
|
10
|
+
*/
|
|
11
|
+
export function Tooltip({ text, placement = "top", className = "", children, ...props }) {
|
|
12
|
+
const triggerClasses = ["tooltip-trigger"];
|
|
13
|
+
if (className) triggerClasses.push(className);
|
|
14
|
+
|
|
15
|
+
return React.createElement(
|
|
16
|
+
"span",
|
|
17
|
+
{ className: triggerClasses.join(" "), ...props },
|
|
18
|
+
children,
|
|
19
|
+
React.createElement(
|
|
20
|
+
"span",
|
|
21
|
+
{ className: "tooltip", role: "tooltip", "data-placement": placement },
|
|
22
|
+
text
|
|
23
|
+
)
|
|
24
|
+
);
|
|
25
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Log a warning in non-production environments.
|
|
3
|
+
* Shared across React wrappers to avoid copy-pasting the same guard.
|
|
4
|
+
*/
|
|
5
|
+
export function warnDev(message) {
|
|
6
|
+
if (
|
|
7
|
+
typeof process !== "undefined" &&
|
|
8
|
+
process.env &&
|
|
9
|
+
process.env.NODE_ENV === "production"
|
|
10
|
+
) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
console.warn(message);
|
|
15
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* Auto-generated design tokens from Figma */
|
|
2
|
-
/* Generated on 2026-
|
|
2
|
+
/* Generated on 2026-05-22T09:23:10.603Z */
|
|
3
3
|
|
|
4
4
|
:root[data-mode="dark"] {
|
|
5
5
|
--color-text-default: var(--color-neutral-800);
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
--color-text-success: var(--brand-color-functional-success);
|
|
13
13
|
--color-fill-surface: var(--color-neutral-1000);
|
|
14
14
|
--color-fill-disabled: var(--color-neutral-300);
|
|
15
|
-
--color-fill-hover: var(--color-neutral-alpha-
|
|
15
|
+
--color-fill-hover: var(--color-neutral-alpha-inverse-100);
|
|
16
16
|
--color-fill-brand: var(--brand-color-primary);
|
|
17
17
|
--color-fill-subtle: var(--brand-color-subtle);
|
|
18
18
|
--color-fill-active: var(--brand-color-accent);
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
--color-border-brand: var(--brand-color-primary);
|
|
25
25
|
--color-border-disabled: var(--color-neutral-500);
|
|
26
26
|
--color-border-danger: var(--brand-color-functional-danger);
|
|
27
|
-
--color-overlay-backdrop: var(--color-neutral-alpha-400);
|
|
28
|
-
--color-overlay-hover: var(--color-neutral-alpha-
|
|
29
|
-
--color-overlay-active: var(--color-neutral-alpha-
|
|
30
|
-
--color-overlay-selected: var(--color-neutral-alpha-
|
|
27
|
+
--color-overlay-backdrop: var(--color-neutral-alpha-inverse-400);
|
|
28
|
+
--color-overlay-hover: var(--color-neutral-alpha-inverse-100);
|
|
29
|
+
--color-overlay-active: var(--color-neutral-alpha-inverse-200);
|
|
30
|
+
--color-overlay-selected: var(--color-neutral-alpha-inverse-300);
|
|
31
31
|
--color-focus: var(--brand-color-primary-dark);
|
|
32
32
|
}
|