mywhy-ui 0.5.2 → 0.6.1
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 +2 -1
- package/dist/index.cjs +55 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +20 -1
- package/dist/index.d.ts +20 -1
- package/dist/index.js +55 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -8,7 +8,8 @@ React component library for the [mywhy](https://github.com/mywhy/mywhy) robotics
|
|
|
8
8
|
npm install mywhy-ui
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
**Peer dependencies:** `react >= 18` and `react-dom >= 18`
|
|
11
|
+
**Peer dependencies:** `react >= 18` and `react-dom >= 18`
|
|
12
|
+
**Node.js support:** `>= 24.0.0`
|
|
12
13
|
|
|
13
14
|
## Setup
|
|
14
15
|
|
package/dist/index.cjs
CHANGED
|
@@ -787,6 +787,60 @@ function FormControl({
|
|
|
787
787
|
helperText && !error && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-ink-light", children: helperText })
|
|
788
788
|
] });
|
|
789
789
|
}
|
|
790
|
+
function Navbar({
|
|
791
|
+
left,
|
|
792
|
+
center,
|
|
793
|
+
right,
|
|
794
|
+
brand,
|
|
795
|
+
items,
|
|
796
|
+
sticky = false,
|
|
797
|
+
bordered = true,
|
|
798
|
+
className = "",
|
|
799
|
+
...props
|
|
800
|
+
}) {
|
|
801
|
+
const classes = [
|
|
802
|
+
"w-full",
|
|
803
|
+
"h-16",
|
|
804
|
+
"bg-white",
|
|
805
|
+
bordered ? "border-b border-gray-200" : "",
|
|
806
|
+
sticky ? "sticky top-0" : "",
|
|
807
|
+
"flex items-center px-8 gap-4",
|
|
808
|
+
"z-40",
|
|
809
|
+
className
|
|
810
|
+
].filter(Boolean).join(" ");
|
|
811
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("nav", { className: classes, ...props, children: [
|
|
812
|
+
(brand || left) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-4 flex-shrink-0", children: [
|
|
813
|
+
brand && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-lg font-semibold text-gray-900", children: brand }),
|
|
814
|
+
left && /* @__PURE__ */ jsxRuntime.jsx("div", { children: left })
|
|
815
|
+
] }),
|
|
816
|
+
center && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 flex items-center justify-center", children: center }),
|
|
817
|
+
items && items.length > 0 && !center && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 flex items-center gap-1", children: items.map((item, idx) => /* @__PURE__ */ jsxRuntime.jsx(NavbarItemComponent, { item }, idx)) }),
|
|
818
|
+
right && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-4 flex-shrink-0 ml-auto", children: right })
|
|
819
|
+
] });
|
|
820
|
+
}
|
|
821
|
+
function NavbarItemComponent({ item }) {
|
|
822
|
+
const classes = [
|
|
823
|
+
"px-4 py-2 rounded-md text-sm font-medium",
|
|
824
|
+
"transition-colors",
|
|
825
|
+
item.disabled ? "text-text-muted cursor-not-allowed" : "text-text-secondary hover:bg-surface-hover hover:text-text-primary cursor-pointer"
|
|
826
|
+
].join(" ");
|
|
827
|
+
const content = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
828
|
+
item.icon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mr-2", children: item.icon }),
|
|
829
|
+
item.label
|
|
830
|
+
] });
|
|
831
|
+
if (item.href) {
|
|
832
|
+
return /* @__PURE__ */ jsxRuntime.jsx("a", { href: item.href, className: classes, onClick: item.onClick, children: content });
|
|
833
|
+
}
|
|
834
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
835
|
+
"button",
|
|
836
|
+
{
|
|
837
|
+
className: classes,
|
|
838
|
+
onClick: item.onClick,
|
|
839
|
+
disabled: item.disabled,
|
|
840
|
+
children: content
|
|
841
|
+
}
|
|
842
|
+
);
|
|
843
|
+
}
|
|
790
844
|
function Tabs({
|
|
791
845
|
tabs,
|
|
792
846
|
activeTab,
|
|
@@ -3287,6 +3341,7 @@ exports.Input = Input;
|
|
|
3287
3341
|
exports.Kbd = Kbd;
|
|
3288
3342
|
exports.Link = Link;
|
|
3289
3343
|
exports.MultiSelect = MultiSelect;
|
|
3344
|
+
exports.Navbar = Navbar;
|
|
3290
3345
|
exports.NumberInput = NumberInput;
|
|
3291
3346
|
exports.Pagination = Pagination;
|
|
3292
3347
|
exports.Progress = Progress;
|