@yahoo/uds-v5-wip 1.1.3 → 1.2.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/dist/accordion.js +9 -9
- package/dist/components/dist/alert.js +2 -2
- package/dist/components/dist/avatar-group.js +6 -6
- package/dist/components/dist/avatar.js +3 -3
- package/dist/components/dist/badge.js +2 -2
- package/dist/components/dist/breadcrumb.js +17 -17
- package/dist/components/dist/button.js +5 -5
- package/dist/components/dist/card.js +4 -4
- package/dist/components/dist/collapsible.js +3 -3
- package/dist/components/dist/command.js +21 -21
- package/dist/components/dist/control-color.js +6 -6
- package/dist/components/dist/control-curve.js +4 -4
- package/dist/components/dist/control-folder.js +6 -6
- package/dist/components/dist/control-group.js +3 -3
- package/dist/components/dist/control-knob.js +8 -8
- package/dist/components/dist/control-panel.js +3 -3
- package/dist/components/dist/control-select.js +8 -8
- package/dist/components/dist/control-slider.js +8 -8
- package/dist/components/dist/control-spring.js +12 -12
- package/dist/components/dist/control-stepper.js +6 -6
- package/dist/components/dist/control-toggle.js +3 -3
- package/dist/components/dist/createSlot.js +2 -2
- package/dist/components/dist/dropdown.js +10 -10
- package/dist/components/dist/empty-state.js +6 -6
- package/dist/components/dist/grid.js +2 -2
- package/dist/components/dist/hstack.js +1 -1
- package/dist/components/dist/input.js +1 -1
- package/dist/components/dist/item.js +8 -8
- package/dist/components/dist/list.js +1 -1
- package/dist/components/dist/modal.js +8 -8
- package/dist/components/dist/nav-header.js +3 -3
- package/dist/components/dist/preset-bar.js +10 -10
- package/dist/components/dist/presets/index.js +1 -1
- package/dist/components/dist/progress.js +6 -6
- package/dist/components/dist/sheet.js +8 -8
- package/dist/components/dist/sidebar.js +42 -42
- package/dist/components/dist/skeleton.js +1 -1
- package/dist/components/dist/slider.js +5 -5
- package/dist/components/dist/spinner.js +2 -2
- package/dist/components/dist/switch.js +5 -5
- package/dist/components/dist/tabs.js +8 -8
- package/dist/components/dist/toast.js +7 -7
- package/dist/components/dist/tooltip.js +3 -3
- package/dist/components/dist/vstack.js +1 -1
- package/dist/components/presets/index.js +1 -1
- package/dist/config.d.ts +976 -976
- package/dist/core/dist/createComponent.d.ts +2 -1
- package/dist/core/dist/createComponentExample.d.ts +2 -1
- package/dist/core/dist/createProvider.d.ts +2 -1
- package/dist/core/dist/generated/stylePropsTwMap.d.ts +2 -1
- package/dist/core/dist/getComponentStyles.d.ts +2 -1
- package/dist/core/dist/getStyles.d.ts +2 -1
- package/dist/core/dist/macros.d.ts +2 -1
- package/dist/core/dist/propMappings.d.ts +2 -1
- package/dist/core/dist/resolveMotionState.d.ts +2 -1
- package/dist/core/dist/transformPreset.d.ts +2 -1
- package/dist/core/dist/withDefaultStyleProps.d.ts +2 -1
- package/dist/foundational-presets/dist/boldVibrant.d.ts +991 -990
- package/dist/foundational-presets/dist/brutalist.d.ts +991 -990
- package/dist/foundational-presets/dist/candy.d.ts +991 -990
- package/dist/foundational-presets/dist/cleanMinimalist.d.ts +991 -990
- package/dist/foundational-presets/dist/corporate.d.ts +991 -990
- package/dist/foundational-presets/dist/darkMoody.d.ts +991 -990
- package/dist/foundational-presets/dist/defaultPreset.d.ts +977 -976
- package/dist/foundational-presets/dist/forest.d.ts +991 -990
- package/dist/foundational-presets/dist/highContrast.d.ts +991 -990
- package/dist/foundational-presets/dist/lavender.d.ts +991 -990
- package/dist/foundational-presets/dist/luxury.d.ts +991 -990
- package/dist/foundational-presets/dist/monochrome.d.ts +991 -990
- package/dist/foundational-presets/dist/motion.d.ts +2 -1
- package/dist/foundational-presets/dist/neonCyber.d.ts +991 -990
- package/dist/foundational-presets/dist/newspaper.d.ts +991 -990
- package/dist/foundational-presets/dist/ocean.d.ts +991 -990
- package/dist/foundational-presets/dist/slate.d.ts +991 -990
- package/dist/foundational-presets/dist/sunset.d.ts +991 -990
- package/dist/foundational-presets/dist/terminal.d.ts +991 -990
- package/dist/foundational-presets/dist/warmOrganic.d.ts +991 -990
- package/dist/loader/dist/loader.d.ts +2 -1
- package/dist/loader/dist/next.d.ts +2 -1
- package/dist/presets/dist/boldVibrant.d.ts +1 -2
- package/dist/presets/dist/brutalist.d.ts +1 -2
- package/dist/presets/dist/candy.d.ts +1 -2
- package/dist/presets/dist/cleanMinimalist.d.ts +1 -2
- package/dist/presets/dist/corporate.d.ts +1 -2
- package/dist/presets/dist/darkMoody.d.ts +1 -2
- package/dist/presets/dist/defaultPreset.d.ts +1 -2
- package/dist/presets/dist/defaultPreset.js +1 -1
- package/dist/presets/dist/forest.d.ts +1 -2
- package/dist/presets/dist/highContrast.d.ts +1 -2
- package/dist/presets/dist/lavender.d.ts +1 -2
- package/dist/presets/dist/luxury.d.ts +1 -2
- package/dist/presets/dist/monochrome.d.ts +1 -2
- package/dist/presets/dist/neonCyber.d.ts +1 -2
- package/dist/presets/dist/newspaper.d.ts +1 -2
- package/dist/presets/dist/ocean.d.ts +1 -2
- package/dist/presets/dist/slate.d.ts +1 -2
- package/dist/presets/dist/sunset.d.ts +1 -2
- package/dist/presets/dist/terminal.d.ts +1 -2
- package/dist/presets/dist/warmOrganic.d.ts +1 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
|
@@ -10,31 +10,31 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
10
10
|
const Accordion = createComponent(({ props, items, defaultOpenId = null }) => {
|
|
11
11
|
const accordionId = useId();
|
|
12
12
|
const [openId, setOpenId] = useState(defaultOpenId);
|
|
13
|
-
return
|
|
13
|
+
return jsx("div", {
|
|
14
14
|
...props.root,
|
|
15
15
|
children: items.map((item) => {
|
|
16
16
|
const isOpen = openId === item.id;
|
|
17
17
|
const contentId = `${accordionId}-content-${item.id}`;
|
|
18
|
-
return
|
|
18
|
+
return jsxs("div", {
|
|
19
19
|
...props.item,
|
|
20
|
-
children: [
|
|
20
|
+
children: [jsxs("button", {
|
|
21
21
|
type: "button",
|
|
22
22
|
onClick: () => setOpenId(isOpen ? null : item.id),
|
|
23
23
|
"aria-expanded": isOpen,
|
|
24
24
|
"aria-controls": contentId,
|
|
25
25
|
...props.trigger,
|
|
26
|
-
children: [
|
|
26
|
+
children: [jsx("span", {
|
|
27
27
|
...props.triggerText,
|
|
28
28
|
children: item.title
|
|
29
|
-
}),
|
|
29
|
+
}), jsx("span", {
|
|
30
30
|
"data-state": isOpen ? "open" : "closed",
|
|
31
31
|
...props.icon,
|
|
32
|
-
children:
|
|
32
|
+
children: jsx("svg", {
|
|
33
33
|
width: "16",
|
|
34
34
|
height: "16",
|
|
35
35
|
viewBox: "0 0 16 16",
|
|
36
36
|
fill: "none",
|
|
37
|
-
children:
|
|
37
|
+
children: jsx("path", {
|
|
38
38
|
d: "M4 6L8 10L12 6",
|
|
39
39
|
stroke: "currentColor",
|
|
40
40
|
strokeWidth: "1.5",
|
|
@@ -43,11 +43,11 @@ const Accordion = createComponent(({ props, items, defaultOpenId = null }) => {
|
|
|
43
43
|
})
|
|
44
44
|
})
|
|
45
45
|
})]
|
|
46
|
-
}), isOpen &&
|
|
46
|
+
}), isOpen && jsx("div", {
|
|
47
47
|
id: contentId,
|
|
48
48
|
"aria-hidden": !isOpen,
|
|
49
49
|
...props.content,
|
|
50
|
-
children:
|
|
50
|
+
children: jsx("span", {
|
|
51
51
|
...props.contentText,
|
|
52
52
|
children: item.content
|
|
53
53
|
})
|
|
@@ -5,9 +5,9 @@ import { jsx } from "react/jsx-runtime";
|
|
|
5
5
|
/**
|
|
6
6
|
* @description A message that communicates important information to the user
|
|
7
7
|
*/
|
|
8
|
-
const Alert = createComponent(({ props, children }) =>
|
|
8
|
+
const Alert = createComponent(({ props, children }) => jsx("div", {
|
|
9
9
|
...props.root,
|
|
10
|
-
children:
|
|
10
|
+
children: jsx("span", {
|
|
11
11
|
...props.text,
|
|
12
12
|
children
|
|
13
13
|
})
|
|
@@ -11,25 +11,25 @@ const AvatarGroup = createComponent(({ props, children, maxVisible, label }) =>
|
|
|
11
11
|
const total = childArray.length;
|
|
12
12
|
const visible = maxVisible != null ? childArray.slice(0, maxVisible) : childArray;
|
|
13
13
|
const overflow = maxVisible != null ? total - maxVisible : 0;
|
|
14
|
-
return
|
|
14
|
+
return jsxs("div", {
|
|
15
15
|
...props.root,
|
|
16
|
-
children: [
|
|
16
|
+
children: [jsxs("div", {
|
|
17
17
|
style: {
|
|
18
18
|
display: "flex",
|
|
19
19
|
alignItems: "center"
|
|
20
20
|
},
|
|
21
|
-
children: [visible.map((child, i) =>
|
|
21
|
+
children: [visible.map((child, i) => jsx("div", {
|
|
22
22
|
style: { marginLeft: i > 0 ? "-8px" : void 0 },
|
|
23
23
|
children: child
|
|
24
|
-
}, i)), overflow > 0 &&
|
|
24
|
+
}, i)), overflow > 0 && jsx("div", {
|
|
25
25
|
...props.overflow,
|
|
26
26
|
style: { marginLeft: "-8px" },
|
|
27
|
-
children:
|
|
27
|
+
children: jsxs("span", {
|
|
28
28
|
...props.overflowText,
|
|
29
29
|
children: ["+", overflow]
|
|
30
30
|
})
|
|
31
31
|
})]
|
|
32
|
-
}), label &&
|
|
32
|
+
}), label && jsx("span", {
|
|
33
33
|
...props.label,
|
|
34
34
|
children: label
|
|
35
35
|
})]
|
|
@@ -5,13 +5,13 @@ import { jsx } from "react/jsx-runtime";
|
|
|
5
5
|
/**
|
|
6
6
|
* @description A circular representation of a user, displaying an image or initials as fallback
|
|
7
7
|
*/
|
|
8
|
-
const Avatar = createComponent(({ props, src, alt, initials }) =>
|
|
8
|
+
const Avatar = createComponent(({ props, src, alt, initials }) => jsx("div", {
|
|
9
9
|
...props.root,
|
|
10
|
-
children: src ?
|
|
10
|
+
children: src ? jsx("img", {
|
|
11
11
|
...props.image,
|
|
12
12
|
src,
|
|
13
13
|
alt: alt ?? initials ?? ""
|
|
14
|
-
}) :
|
|
14
|
+
}) : jsx("span", {
|
|
15
15
|
...props.fallbackText,
|
|
16
16
|
children: initials
|
|
17
17
|
})
|
|
@@ -5,9 +5,9 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
5
5
|
/**
|
|
6
6
|
* @description A small label for status, category, or metadata
|
|
7
7
|
*/
|
|
8
|
-
const Badge = createComponent(({ props, children }) =>
|
|
8
|
+
const Badge = createComponent(({ props, children }) => jsxs("span", {
|
|
9
9
|
...props.root,
|
|
10
|
-
children: [
|
|
10
|
+
children: [jsx("span", { ...props.dot }), jsx("span", {
|
|
11
11
|
...props.text,
|
|
12
12
|
children
|
|
13
13
|
})]
|
|
@@ -2,7 +2,7 @@ import { createComponent } from "../../core/dist/createComponent.js";
|
|
|
2
2
|
import "../../core/dist/index.js";
|
|
3
3
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
//#region ../components/dist/breadcrumb.js
|
|
5
|
-
const DefaultSeparator = () =>
|
|
5
|
+
const DefaultSeparator = () => jsx("svg", {
|
|
6
6
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7
7
|
width: 16,
|
|
8
8
|
height: 16,
|
|
@@ -13,14 +13,14 @@ const DefaultSeparator = () => /* @__PURE__ */ jsx("svg", {
|
|
|
13
13
|
strokeLinecap: "round",
|
|
14
14
|
strokeLinejoin: "round",
|
|
15
15
|
"aria-hidden": "true",
|
|
16
|
-
children:
|
|
16
|
+
children: jsx("path", { d: "m9 18 6-6-6-6" })
|
|
17
17
|
});
|
|
18
|
-
const DefaultEllipsis = (props) =>
|
|
18
|
+
const DefaultEllipsis = (props) => jsxs(Fragment, { children: [jsx("span", {
|
|
19
19
|
...props,
|
|
20
20
|
role: "presentation",
|
|
21
21
|
"aria-hidden": "true",
|
|
22
22
|
children: "…"
|
|
23
|
-
}),
|
|
23
|
+
}), jsx("span", {
|
|
24
24
|
style: {
|
|
25
25
|
position: "absolute",
|
|
26
26
|
width: 1,
|
|
@@ -46,7 +46,7 @@ const Breadcrumb = createComponent(({ props, items, separator, maxItems, renderE
|
|
|
46
46
|
collapsedItems = items.slice(1, items.length - (maxItems - 1));
|
|
47
47
|
visibleItems = [first, ...tail];
|
|
48
48
|
} else visibleItems = items;
|
|
49
|
-
const separatorContent = separator ??
|
|
49
|
+
const separatorContent = separator ?? jsx(DefaultSeparator, {});
|
|
50
50
|
const showEllipsis = collapsedItems.length > 0;
|
|
51
51
|
const renderItems = () => {
|
|
52
52
|
const elements = [];
|
|
@@ -54,51 +54,51 @@ const Breadcrumb = createComponent(({ props, items, separator, maxItems, renderE
|
|
|
54
54
|
const item = visibleItems[i];
|
|
55
55
|
const isLast = i === visibleItems.length - 1;
|
|
56
56
|
if (showEllipsis && i === 1) {
|
|
57
|
-
elements.push(
|
|
57
|
+
elements.push(jsx("li", {
|
|
58
58
|
role: "presentation",
|
|
59
59
|
"aria-hidden": "true",
|
|
60
60
|
...props.separator,
|
|
61
61
|
children: separatorContent
|
|
62
62
|
}, "ellipsis-sep"));
|
|
63
|
-
elements.push(
|
|
63
|
+
elements.push(jsx("li", {
|
|
64
64
|
role: "presentation",
|
|
65
65
|
...props.item,
|
|
66
66
|
children: renderEllipsis ? renderEllipsis({
|
|
67
67
|
className: props.ellipsis?.className ?? "",
|
|
68
68
|
collapsedItems
|
|
69
|
-
}) :
|
|
69
|
+
}) : jsx(DefaultEllipsis, { ...props.ellipsis })
|
|
70
70
|
}, "ellipsis"));
|
|
71
71
|
}
|
|
72
|
-
if (i > 0) elements.push(
|
|
72
|
+
if (i > 0) elements.push(jsx("li", {
|
|
73
73
|
role: "presentation",
|
|
74
74
|
"aria-hidden": "true",
|
|
75
75
|
...props.separator,
|
|
76
76
|
children: separatorContent
|
|
77
77
|
}, `sep-${i}`));
|
|
78
|
-
if (isLast && !item.href) elements.push(
|
|
78
|
+
if (isLast && !item.href) elements.push(jsx("li", {
|
|
79
79
|
...props.item,
|
|
80
|
-
children:
|
|
80
|
+
children: jsx("span", {
|
|
81
81
|
"aria-current": "page",
|
|
82
82
|
...props.page,
|
|
83
83
|
children: item.label
|
|
84
84
|
})
|
|
85
85
|
}, `item-${i}`));
|
|
86
|
-
else if (item.href) elements.push(
|
|
86
|
+
else if (item.href) elements.push(jsx("li", {
|
|
87
87
|
...props.item,
|
|
88
88
|
children: renderLink ? renderLink({
|
|
89
89
|
href: item.href,
|
|
90
90
|
className: props.link?.className,
|
|
91
91
|
...props.link,
|
|
92
92
|
children: item.label
|
|
93
|
-
}) :
|
|
93
|
+
}) : jsx("a", {
|
|
94
94
|
href: item.href,
|
|
95
95
|
...props.link,
|
|
96
96
|
children: item.label
|
|
97
97
|
})
|
|
98
98
|
}, `item-${i}`));
|
|
99
|
-
else elements.push(
|
|
99
|
+
else elements.push(jsx("li", {
|
|
100
100
|
...props.item,
|
|
101
|
-
children:
|
|
101
|
+
children: jsx("span", {
|
|
102
102
|
...props.page,
|
|
103
103
|
children: item.label
|
|
104
104
|
})
|
|
@@ -106,10 +106,10 @@ const Breadcrumb = createComponent(({ props, items, separator, maxItems, renderE
|
|
|
106
106
|
}
|
|
107
107
|
return elements;
|
|
108
108
|
};
|
|
109
|
-
return
|
|
109
|
+
return jsx("nav", {
|
|
110
110
|
...props.root,
|
|
111
111
|
"aria-label": "Breadcrumb",
|
|
112
|
-
children:
|
|
112
|
+
children: jsx("ol", {
|
|
113
113
|
...props.list,
|
|
114
114
|
children: renderItems()
|
|
115
115
|
})
|
|
@@ -7,24 +7,24 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
|
7
7
|
* @description A styled button with predefined variants (e.g. brand, ghost, destructive). Use for labeled text actions like "Submit", "Add to Cart", "Cancel". Do NOT use for custom-styled interactive elements like color swatches, size chips, or icon-only buttons — use Pressable instead.
|
|
8
8
|
*/
|
|
9
9
|
const Button = createComponent(({ props, children, asChild, onPress, startIcon, endIcon, ...nativeProps }) => {
|
|
10
|
-
const content =
|
|
11
|
-
startIcon &&
|
|
10
|
+
const content = jsxs(Fragment, { children: [
|
|
11
|
+
startIcon && jsx("span", {
|
|
12
12
|
...props.startIcon,
|
|
13
13
|
children: startIcon
|
|
14
14
|
}),
|
|
15
15
|
children,
|
|
16
|
-
endIcon &&
|
|
16
|
+
endIcon && jsx("span", {
|
|
17
17
|
...props.endIcon,
|
|
18
18
|
children: endIcon
|
|
19
19
|
})
|
|
20
20
|
] });
|
|
21
|
-
if (asChild) return
|
|
21
|
+
if (asChild) return jsx(ButtonSlot, {
|
|
22
22
|
onClick: onPress,
|
|
23
23
|
...props.root,
|
|
24
24
|
...nativeProps,
|
|
25
25
|
children: content
|
|
26
26
|
});
|
|
27
|
-
return
|
|
27
|
+
return jsx("button", {
|
|
28
28
|
onClick: onPress,
|
|
29
29
|
...props.root,
|
|
30
30
|
...nativeProps,
|
|
@@ -5,19 +5,19 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
5
5
|
/**
|
|
6
6
|
* @description A contained surface for grouping related content with optional title, content, and actions
|
|
7
7
|
*/
|
|
8
|
-
const Card = createComponent(({ props, children, title, content, actions }) =>
|
|
8
|
+
const Card = createComponent(({ props, children, title, content, actions }) => jsxs("div", {
|
|
9
9
|
...props.root,
|
|
10
10
|
children: [
|
|
11
|
-
title &&
|
|
11
|
+
title && jsx("div", {
|
|
12
12
|
...props.title,
|
|
13
13
|
children: title
|
|
14
14
|
}),
|
|
15
|
-
content &&
|
|
15
|
+
content && jsx("div", {
|
|
16
16
|
...props.content,
|
|
17
17
|
children: content
|
|
18
18
|
}),
|
|
19
19
|
children,
|
|
20
|
-
actions &&
|
|
20
|
+
actions && jsx("div", {
|
|
21
21
|
...props.actions,
|
|
22
22
|
children: actions
|
|
23
23
|
})
|
|
@@ -20,15 +20,15 @@ const Collapsible = createComponent(({ props, trigger, children, defaultOpen = f
|
|
|
20
20
|
isControlled,
|
|
21
21
|
onOpenChange
|
|
22
22
|
]);
|
|
23
|
-
return
|
|
23
|
+
return jsxs("div", {
|
|
24
24
|
...props.root,
|
|
25
|
-
children: [
|
|
25
|
+
children: [jsx("button", {
|
|
26
26
|
...props.trigger,
|
|
27
27
|
type: "button",
|
|
28
28
|
onClick: toggle,
|
|
29
29
|
"aria-expanded": isOpen,
|
|
30
30
|
children: trigger
|
|
31
|
-
}), isOpen &&
|
|
31
|
+
}), isOpen && jsx("div", {
|
|
32
32
|
...props.content,
|
|
33
33
|
children
|
|
34
34
|
})]
|
|
@@ -64,7 +64,7 @@ const [CommandProvider, useCommand] = createProvider("Command", ({ children }) =
|
|
|
64
64
|
items: items.current,
|
|
65
65
|
visibleCount
|
|
66
66
|
},
|
|
67
|
-
render:
|
|
67
|
+
render: jsx(Fragment, { children })
|
|
68
68
|
};
|
|
69
69
|
});
|
|
70
70
|
function CommandRoot({ slotProps, label, children }) {
|
|
@@ -96,7 +96,7 @@ function CommandRoot({ slotProps, label, children }) {
|
|
|
96
96
|
container.querySelector("[data-command-item][aria-selected=\"true\"]")?.click();
|
|
97
97
|
}
|
|
98
98
|
}, [ctx]);
|
|
99
|
-
return
|
|
99
|
+
return jsx("div", {
|
|
100
100
|
ref: rootRef,
|
|
101
101
|
role: "listbox",
|
|
102
102
|
"aria-label": label ?? "Command menu",
|
|
@@ -122,9 +122,9 @@ const Command = createComponent(({ props, children, value: controlledValue, onVa
|
|
|
122
122
|
controlledValue,
|
|
123
123
|
onValueChange
|
|
124
124
|
]);
|
|
125
|
-
return
|
|
125
|
+
return jsx(CommandConfigContext.Provider, {
|
|
126
126
|
value: config,
|
|
127
|
-
children:
|
|
127
|
+
children: jsx(CommandProvider, { children: jsx(CommandRoot, {
|
|
128
128
|
slotProps: props,
|
|
129
129
|
label,
|
|
130
130
|
children
|
|
@@ -153,21 +153,21 @@ const CommandDialog = createComponent(({ props, children, open: controlledOpen,
|
|
|
153
153
|
};
|
|
154
154
|
}, [open, setOpen]);
|
|
155
155
|
if (!open) return null;
|
|
156
|
-
return createPortal(
|
|
156
|
+
return createPortal(jsxs("div", {
|
|
157
157
|
...props.overlay,
|
|
158
|
-
children: [
|
|
158
|
+
children: [jsx("button", {
|
|
159
159
|
type: "button",
|
|
160
160
|
"aria-label": "Close command menu",
|
|
161
161
|
tabIndex: -1,
|
|
162
162
|
onClick: () => setOpen(false),
|
|
163
163
|
...props.dismiss
|
|
164
|
-
}),
|
|
164
|
+
}), jsx("div", {
|
|
165
165
|
ref: panelRef,
|
|
166
166
|
role: "dialog",
|
|
167
167
|
"aria-modal": "true",
|
|
168
168
|
tabIndex: -1,
|
|
169
169
|
...props.dialogPanel,
|
|
170
|
-
children:
|
|
170
|
+
children: jsx(Command, {
|
|
171
171
|
filter,
|
|
172
172
|
shouldFilter,
|
|
173
173
|
loop: loop ?? true,
|
|
@@ -190,11 +190,11 @@ const CommandInput = createComponent(({ props, placeholder, value: controlledVal
|
|
|
190
190
|
setSearch(v);
|
|
191
191
|
onValueChange?.(v);
|
|
192
192
|
}, [setSearch, onValueChange]);
|
|
193
|
-
return
|
|
193
|
+
return jsxs("div", {
|
|
194
194
|
...props.inputWrapper,
|
|
195
|
-
children: [
|
|
195
|
+
children: [jsx("span", {
|
|
196
196
|
...props.searchIcon,
|
|
197
|
-
children:
|
|
197
|
+
children: jsxs("svg", {
|
|
198
198
|
width: "16",
|
|
199
199
|
height: "16",
|
|
200
200
|
viewBox: "0 0 24 24",
|
|
@@ -203,18 +203,18 @@ const CommandInput = createComponent(({ props, placeholder, value: controlledVal
|
|
|
203
203
|
strokeWidth: "2",
|
|
204
204
|
strokeLinecap: "round",
|
|
205
205
|
strokeLinejoin: "round",
|
|
206
|
-
children: [
|
|
206
|
+
children: [jsx("circle", {
|
|
207
207
|
cx: "11",
|
|
208
208
|
cy: "11",
|
|
209
209
|
r: "8"
|
|
210
|
-
}),
|
|
210
|
+
}), jsx("line", {
|
|
211
211
|
x1: "21",
|
|
212
212
|
y1: "21",
|
|
213
213
|
x2: "16.65",
|
|
214
214
|
y2: "16.65"
|
|
215
215
|
})]
|
|
216
216
|
})
|
|
217
|
-
}),
|
|
217
|
+
}), jsx("input", {
|
|
218
218
|
type: "text",
|
|
219
219
|
placeholder: placeholder ?? "Type a command or search...",
|
|
220
220
|
value: inputValue,
|
|
@@ -231,7 +231,7 @@ const CommandInput = createComponent(({ props, placeholder, value: controlledVal
|
|
|
231
231
|
* @description Scrollable container for command results
|
|
232
232
|
*/
|
|
233
233
|
const CommandList = createComponent(({ props, children }) => {
|
|
234
|
-
return
|
|
234
|
+
return jsx("fieldset", {
|
|
235
235
|
...props.list,
|
|
236
236
|
children
|
|
237
237
|
});
|
|
@@ -242,7 +242,7 @@ const CommandList = createComponent(({ props, children }) => {
|
|
|
242
242
|
const CommandEmpty = createComponent(({ props, children }) => {
|
|
243
243
|
const ctx = useCommand();
|
|
244
244
|
if (ctx.visibleCount > 0 || !ctx.search) return null;
|
|
245
|
-
return
|
|
245
|
+
return jsx("div", {
|
|
246
246
|
...props.empty,
|
|
247
247
|
children: children ?? "No results found."
|
|
248
248
|
});
|
|
@@ -259,10 +259,10 @@ const CommandGroup = createComponent(({ props, children, heading }) => {
|
|
|
259
259
|
if (el.querySelectorAll("[data-command-item]").length > 0) el.removeAttribute("hidden");
|
|
260
260
|
else el.setAttribute("hidden", "");
|
|
261
261
|
});
|
|
262
|
-
return
|
|
262
|
+
return jsxs("fieldset", {
|
|
263
263
|
ref: groupRef,
|
|
264
264
|
...props.group,
|
|
265
|
-
children: [heading &&
|
|
265
|
+
children: [heading && jsx("div", {
|
|
266
266
|
...props.groupHeading,
|
|
267
267
|
children: heading
|
|
268
268
|
}), children]
|
|
@@ -299,7 +299,7 @@ const CommandItem = createComponent(({ props, children, onSelect, value, keyword
|
|
|
299
299
|
keywords
|
|
300
300
|
]);
|
|
301
301
|
if (!(!ctx.shouldFilter || !ctx.search || ctx.filter(textValue, ctx.search, keywords) > 0)) return null;
|
|
302
|
-
return
|
|
302
|
+
return jsx("div", {
|
|
303
303
|
ref: itemRef,
|
|
304
304
|
role: "option",
|
|
305
305
|
tabIndex: 0,
|
|
@@ -324,7 +324,7 @@ const CommandItem = createComponent(({ props, children, onSelect, value, keyword
|
|
|
324
324
|
* @description Displays a keyboard shortcut hint alongside a command item
|
|
325
325
|
*/
|
|
326
326
|
const CommandShortcut = createComponent(({ props, children }) => {
|
|
327
|
-
return
|
|
327
|
+
return jsx("span", {
|
|
328
328
|
...props.shortcut,
|
|
329
329
|
children
|
|
330
330
|
});
|
|
@@ -335,7 +335,7 @@ const CommandShortcut = createComponent(({ props, children }) => {
|
|
|
335
335
|
const CommandSeparator = createComponent(({ props }) => {
|
|
336
336
|
const ctx = useCommand();
|
|
337
337
|
if (ctx.search && ctx.visibleCount === 0) return null;
|
|
338
|
-
return
|
|
338
|
+
return jsx("hr", { ...props.separator });
|
|
339
339
|
});
|
|
340
340
|
//#endregion
|
|
341
341
|
export { Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandProvider, CommandSeparator, CommandShortcut, useCommand };
|
|
@@ -21,19 +21,19 @@ const ControlColor = createComponent(({ props, value, onChange, label }) => {
|
|
|
21
21
|
const val = e.target.value;
|
|
22
22
|
if (HEX_PATTERN.test(val)) onChange(val);
|
|
23
23
|
}, [onChange]);
|
|
24
|
-
return
|
|
24
|
+
return jsxs("div", {
|
|
25
25
|
...props.root,
|
|
26
|
-
children: [label &&
|
|
26
|
+
children: [label && jsx("span", {
|
|
27
27
|
...props.label,
|
|
28
28
|
children: label
|
|
29
|
-
}),
|
|
29
|
+
}), jsxs("div", {
|
|
30
30
|
...props.endContent,
|
|
31
|
-
children: [
|
|
31
|
+
children: [jsx("button", {
|
|
32
32
|
type: "button",
|
|
33
33
|
onClick: handleSwatchClick,
|
|
34
34
|
style: { backgroundColor: value },
|
|
35
35
|
...props.swatch,
|
|
36
|
-
children:
|
|
36
|
+
children: jsx("input", {
|
|
37
37
|
ref: nativeInputRef,
|
|
38
38
|
type: "color",
|
|
39
39
|
value: HEX_PATTERN.test(value) ? value : DEFAULT_HEX,
|
|
@@ -48,7 +48,7 @@ const ControlColor = createComponent(({ props, value, onChange, label }) => {
|
|
|
48
48
|
tabIndex: -1,
|
|
49
49
|
"aria-hidden": true
|
|
50
50
|
})
|
|
51
|
-
}),
|
|
51
|
+
}), jsx("input", {
|
|
52
52
|
type: "text",
|
|
53
53
|
defaultValue: value,
|
|
54
54
|
onBlur: handleTextChange,
|
|
@@ -46,9 +46,9 @@ const ControlCurve = createComponent(({ props, config, width: rawWidth = 280, he
|
|
|
46
46
|
height
|
|
47
47
|
]);
|
|
48
48
|
const targetY = height - height * .7;
|
|
49
|
-
return
|
|
49
|
+
return jsx("div", {
|
|
50
50
|
...props.root,
|
|
51
|
-
children:
|
|
51
|
+
children: jsxs("svg", {
|
|
52
52
|
width,
|
|
53
53
|
height,
|
|
54
54
|
viewBox: `0 0 ${width} ${height}`,
|
|
@@ -57,7 +57,7 @@ const ControlCurve = createComponent(({ props, config, width: rawWidth = 280, he
|
|
|
57
57
|
width: "100%",
|
|
58
58
|
height: "auto"
|
|
59
59
|
},
|
|
60
|
-
children: [
|
|
60
|
+
children: [jsx("line", {
|
|
61
61
|
x1: 0,
|
|
62
62
|
y1: targetY,
|
|
63
63
|
x2: width,
|
|
@@ -66,7 +66,7 @@ const ControlCurve = createComponent(({ props, config, width: rawWidth = 280, he
|
|
|
66
66
|
strokeWidth: .5,
|
|
67
67
|
strokeDasharray: "4 2",
|
|
68
68
|
opacity: .3
|
|
69
|
-
}),
|
|
69
|
+
}), jsx("path", {
|
|
70
70
|
d: path,
|
|
71
71
|
fill: "none",
|
|
72
72
|
stroke: "var(--uds-bg-brand)",
|
|
@@ -12,25 +12,25 @@ const ControlFolder = createComponent(({ props, label, defaultOpen = false, chil
|
|
|
12
12
|
const toggle = useCallback(() => {
|
|
13
13
|
setIsOpen((prev) => !prev);
|
|
14
14
|
}, []);
|
|
15
|
-
return
|
|
15
|
+
return jsxs("div", {
|
|
16
16
|
...props.root,
|
|
17
|
-
children: [
|
|
17
|
+
children: [jsxs("button", {
|
|
18
18
|
type: "button",
|
|
19
19
|
onClick: toggle,
|
|
20
20
|
"aria-expanded": isOpen,
|
|
21
21
|
...props.header,
|
|
22
|
-
children: [
|
|
22
|
+
children: [jsx("span", {
|
|
23
23
|
style: { transform: isOpen ? "rotate(90deg)" : "rotate(0deg)" },
|
|
24
24
|
...props.chevron,
|
|
25
25
|
children: "▶"
|
|
26
|
-
}),
|
|
26
|
+
}), jsx("span", {
|
|
27
27
|
...props.label,
|
|
28
28
|
children: label
|
|
29
29
|
})]
|
|
30
|
-
}),
|
|
30
|
+
}), jsx("div", {
|
|
31
31
|
style: { maxHeight: isOpen ? 1e3 : 0 },
|
|
32
32
|
...props.content,
|
|
33
|
-
children:
|
|
33
|
+
children: jsx("div", {
|
|
34
34
|
...props.children,
|
|
35
35
|
children
|
|
36
36
|
})
|
|
@@ -56,19 +56,19 @@ const ControlGroup = createComponent(({ props, options, value, onChange, type =
|
|
|
56
56
|
onChange,
|
|
57
57
|
disabled
|
|
58
58
|
]);
|
|
59
|
-
return
|
|
59
|
+
return jsxs("div", {
|
|
60
60
|
ref: rootRef,
|
|
61
61
|
role: type === "single" ? "radiogroup" : "group",
|
|
62
62
|
"data-disabled": disabled || void 0,
|
|
63
63
|
style: { position: "relative" },
|
|
64
64
|
...props.root,
|
|
65
|
-
children: [type === "single" &&
|
|
65
|
+
children: [type === "single" && jsx("div", {
|
|
66
66
|
style: indicatorStyle,
|
|
67
67
|
...props.indicator
|
|
68
68
|
}), options.map((option) => {
|
|
69
69
|
const active = isActive(option.id);
|
|
70
70
|
const className = active ? [props.item?.className, props.activeItem?.className].filter(Boolean).join(" ") : props.item?.className;
|
|
71
|
-
return
|
|
71
|
+
return jsx("button", {
|
|
72
72
|
type: "button",
|
|
73
73
|
"aria-pressed": active,
|
|
74
74
|
"data-state": active ? "active" : "inactive",
|
|
@@ -91,14 +91,14 @@ const ControlKnob = createComponent(({ props, value: rawValue, onChange, min = 0
|
|
|
91
91
|
const trackPath = describeArc(cx, cy, radius, START_ANGLE, END_ANGLE);
|
|
92
92
|
const fillPath = currentAngle > START_ANGLE ? describeArc(cx, cy, radius, START_ANGLE, currentAngle) : "";
|
|
93
93
|
const thumbPos = polarToCartesian(cx, cy, radius, currentAngle);
|
|
94
|
-
return
|
|
94
|
+
return jsxs("div", {
|
|
95
95
|
...props.root,
|
|
96
96
|
children: [
|
|
97
|
-
label &&
|
|
97
|
+
label && jsx("span", {
|
|
98
98
|
...props.label,
|
|
99
99
|
children: label
|
|
100
100
|
}),
|
|
101
|
-
|
|
101
|
+
jsx("div", {
|
|
102
102
|
role: "slider",
|
|
103
103
|
tabIndex: 0,
|
|
104
104
|
"aria-valuemin": min,
|
|
@@ -109,25 +109,25 @@ const ControlKnob = createComponent(({ props, value: rawValue, onChange, min = 0
|
|
|
109
109
|
onPointerMove: handlePointerMove,
|
|
110
110
|
onPointerUp: handlePointerUp,
|
|
111
111
|
style: { touchAction: "none" },
|
|
112
|
-
children:
|
|
112
|
+
children: jsxs("svg", {
|
|
113
113
|
ref: svgRef,
|
|
114
114
|
width: dialSize,
|
|
115
115
|
height: dialSize,
|
|
116
116
|
viewBox: `0 0 ${dialSize} ${dialSize}`,
|
|
117
117
|
children: [
|
|
118
|
-
|
|
118
|
+
jsx("path", {
|
|
119
119
|
d: trackPath,
|
|
120
120
|
strokeWidth,
|
|
121
121
|
strokeLinecap: "round",
|
|
122
122
|
...props.track
|
|
123
123
|
}),
|
|
124
|
-
fillPath &&
|
|
124
|
+
fillPath && jsx("path", {
|
|
125
125
|
d: fillPath,
|
|
126
126
|
strokeWidth,
|
|
127
127
|
strokeLinecap: "round",
|
|
128
128
|
...props.fill
|
|
129
129
|
}),
|
|
130
|
-
|
|
130
|
+
jsx("circle", {
|
|
131
131
|
cx: thumbPos.x,
|
|
132
132
|
cy: thumbPos.y,
|
|
133
133
|
r: thumbRadius,
|
|
@@ -137,7 +137,7 @@ const ControlKnob = createComponent(({ props, value: rawValue, onChange, min = 0
|
|
|
137
137
|
]
|
|
138
138
|
})
|
|
139
139
|
}),
|
|
140
|
-
|
|
140
|
+
jsx("span", {
|
|
141
141
|
...props.value,
|
|
142
142
|
children: value
|
|
143
143
|
})
|
|
@@ -7,12 +7,12 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
7
7
|
* @description A titled container for grouping property controls and settings
|
|
8
8
|
*/
|
|
9
9
|
const ControlPanel = createComponent(({ props, title, children }) => {
|
|
10
|
-
return
|
|
10
|
+
return jsxs("div", {
|
|
11
11
|
...props.root,
|
|
12
|
-
children: [title &&
|
|
12
|
+
children: [title && jsx("span", {
|
|
13
13
|
...props.title,
|
|
14
14
|
children: title
|
|
15
|
-
}),
|
|
15
|
+
}), jsx("div", {
|
|
16
16
|
...props.items,
|
|
17
17
|
children
|
|
18
18
|
})]
|