mywhy-ui 0.5.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/dist/index.d.cts CHANGED
@@ -154,6 +154,25 @@ interface FormControlProps extends React$1.HTMLAttributes<HTMLDivElement> {
154
154
  }
155
155
  declare function FormControl({ label, description, error, required, helperText, children, className, ...props }: FormControlProps): react_jsx_runtime.JSX.Element;
156
156
 
157
+ interface NavbarItem {
158
+ label: React$1.ReactNode;
159
+ href?: string;
160
+ onClick?: () => void;
161
+ icon?: React$1.ReactNode;
162
+ disabled?: boolean;
163
+ }
164
+ interface NavbarProps extends React$1.HTMLAttributes<HTMLDivElement> {
165
+ left?: React$1.ReactNode;
166
+ center?: React$1.ReactNode;
167
+ right?: React$1.ReactNode;
168
+ brand?: React$1.ReactNode;
169
+ items?: NavbarItem[];
170
+ sticky?: boolean;
171
+ bordered?: boolean;
172
+ className?: string;
173
+ }
174
+ declare function Navbar({ left, center, right, brand, items, sticky, bordered, className, ...props }: NavbarProps): react_jsx_runtime.JSX.Element;
175
+
157
176
  interface TabItem {
158
177
  label: React$1.ReactNode;
159
178
  value: string;
@@ -514,4 +533,4 @@ declare function useToast(): {
514
533
  removeToast: (id: string) => void;
515
534
  };
516
535
 
517
- export { Alert, type AlertProps, type AlertTheme, Avatar, type AvatarProps, type AvatarShape, type AvatarSize, type AvatarTheme, Badge, type BadgeProps, type BadgeTheme, type BreadcrumbItem, Breadcrumbs, type BreadcrumbsProps, Button, type ButtonProps, type ButtonSize, type ButtonTheme, type ButtonVariant, Card, type CardProps, Checkbox, type CheckboxProps, CodeBlock, type CodeBlockLanguage, type CodeBlockProps, ConnectionIcon, ConnectionIndicator, type ConnectionIndicatorProps, DatePicker, type DatePickerProps, Dialog, type DialogProps, Dropdown, type DropdownItem, type DropdownProps, EmptyState, type EmptyStateProps, FileUploader, type FileUploaderProps, FormControl, type FormControlProps, Input, type InputProps, type InputSize, Kbd, type KbdProps, type KbdSize, type KbdTheme, Link, type LinkProps, MultiSelect, type MultiSelectOption, type MultiSelectProps, NumberInput, type NumberInputProps, type NumberInputSize, Pagination, type PaginationProps, Progress, type ProgressProps, ROS2Diagnostics, type ROS2DiagnosticsProps, Rating, type RatingProps, type RobotStatus, Select, type SelectOption, type SelectProps, type SelectSize, Sidebar, type SidebarItem, type SidebarProps, type SidebarSection, Slider, type SliderProps, Spinner, type SpinnerProps, StatusBadge, type StatusBadgeProps, Switch, type SwitchProps, type TabItem, Table, type TableColumn, type TableProps, Tabs, type TabsProps, Textarea, type TextareaProps, type TextareaSize, TimePicker, type TimePickerProps, Timeline, type TimelineItem, type TimelineProps, type TimelineStatus, Toast, ToastContainer, type ToastContainerProps, type ToastEntry, type ToastProps, type ToastType, Tooltip, type TooltipPlacement, type TooltipProps, type UseDisclosureReturn, useDisclosure, useToast };
536
+ export { Alert, type AlertProps, type AlertTheme, Avatar, type AvatarProps, type AvatarShape, type AvatarSize, type AvatarTheme, Badge, type BadgeProps, type BadgeTheme, type BreadcrumbItem, Breadcrumbs, type BreadcrumbsProps, Button, type ButtonProps, type ButtonSize, type ButtonTheme, type ButtonVariant, Card, type CardProps, Checkbox, type CheckboxProps, CodeBlock, type CodeBlockLanguage, type CodeBlockProps, ConnectionIcon, ConnectionIndicator, type ConnectionIndicatorProps, DatePicker, type DatePickerProps, Dialog, type DialogProps, Dropdown, type DropdownItem, type DropdownProps, EmptyState, type EmptyStateProps, FileUploader, type FileUploaderProps, FormControl, type FormControlProps, Input, type InputProps, type InputSize, Kbd, type KbdProps, type KbdSize, type KbdTheme, Link, type LinkProps, MultiSelect, type MultiSelectOption, type MultiSelectProps, Navbar, type NavbarItem, type NavbarProps, NumberInput, type NumberInputProps, type NumberInputSize, Pagination, type PaginationProps, Progress, type ProgressProps, ROS2Diagnostics, type ROS2DiagnosticsProps, Rating, type RatingProps, type RobotStatus, Select, type SelectOption, type SelectProps, type SelectSize, Sidebar, type SidebarItem, type SidebarProps, type SidebarSection, Slider, type SliderProps, Spinner, type SpinnerProps, StatusBadge, type StatusBadgeProps, Switch, type SwitchProps, type TabItem, Table, type TableColumn, type TableProps, Tabs, type TabsProps, Textarea, type TextareaProps, type TextareaSize, TimePicker, type TimePickerProps, Timeline, type TimelineItem, type TimelineProps, type TimelineStatus, Toast, ToastContainer, type ToastContainerProps, type ToastEntry, type ToastProps, type ToastType, Tooltip, type TooltipPlacement, type TooltipProps, type UseDisclosureReturn, useDisclosure, useToast };
package/dist/index.d.ts CHANGED
@@ -154,6 +154,25 @@ interface FormControlProps extends React$1.HTMLAttributes<HTMLDivElement> {
154
154
  }
155
155
  declare function FormControl({ label, description, error, required, helperText, children, className, ...props }: FormControlProps): react_jsx_runtime.JSX.Element;
156
156
 
157
+ interface NavbarItem {
158
+ label: React$1.ReactNode;
159
+ href?: string;
160
+ onClick?: () => void;
161
+ icon?: React$1.ReactNode;
162
+ disabled?: boolean;
163
+ }
164
+ interface NavbarProps extends React$1.HTMLAttributes<HTMLDivElement> {
165
+ left?: React$1.ReactNode;
166
+ center?: React$1.ReactNode;
167
+ right?: React$1.ReactNode;
168
+ brand?: React$1.ReactNode;
169
+ items?: NavbarItem[];
170
+ sticky?: boolean;
171
+ bordered?: boolean;
172
+ className?: string;
173
+ }
174
+ declare function Navbar({ left, center, right, brand, items, sticky, bordered, className, ...props }: NavbarProps): react_jsx_runtime.JSX.Element;
175
+
157
176
  interface TabItem {
158
177
  label: React$1.ReactNode;
159
178
  value: string;
@@ -514,4 +533,4 @@ declare function useToast(): {
514
533
  removeToast: (id: string) => void;
515
534
  };
516
535
 
517
- export { Alert, type AlertProps, type AlertTheme, Avatar, type AvatarProps, type AvatarShape, type AvatarSize, type AvatarTheme, Badge, type BadgeProps, type BadgeTheme, type BreadcrumbItem, Breadcrumbs, type BreadcrumbsProps, Button, type ButtonProps, type ButtonSize, type ButtonTheme, type ButtonVariant, Card, type CardProps, Checkbox, type CheckboxProps, CodeBlock, type CodeBlockLanguage, type CodeBlockProps, ConnectionIcon, ConnectionIndicator, type ConnectionIndicatorProps, DatePicker, type DatePickerProps, Dialog, type DialogProps, Dropdown, type DropdownItem, type DropdownProps, EmptyState, type EmptyStateProps, FileUploader, type FileUploaderProps, FormControl, type FormControlProps, Input, type InputProps, type InputSize, Kbd, type KbdProps, type KbdSize, type KbdTheme, Link, type LinkProps, MultiSelect, type MultiSelectOption, type MultiSelectProps, NumberInput, type NumberInputProps, type NumberInputSize, Pagination, type PaginationProps, Progress, type ProgressProps, ROS2Diagnostics, type ROS2DiagnosticsProps, Rating, type RatingProps, type RobotStatus, Select, type SelectOption, type SelectProps, type SelectSize, Sidebar, type SidebarItem, type SidebarProps, type SidebarSection, Slider, type SliderProps, Spinner, type SpinnerProps, StatusBadge, type StatusBadgeProps, Switch, type SwitchProps, type TabItem, Table, type TableColumn, type TableProps, Tabs, type TabsProps, Textarea, type TextareaProps, type TextareaSize, TimePicker, type TimePickerProps, Timeline, type TimelineItem, type TimelineProps, type TimelineStatus, Toast, ToastContainer, type ToastContainerProps, type ToastEntry, type ToastProps, type ToastType, Tooltip, type TooltipPlacement, type TooltipProps, type UseDisclosureReturn, useDisclosure, useToast };
536
+ export { Alert, type AlertProps, type AlertTheme, Avatar, type AvatarProps, type AvatarShape, type AvatarSize, type AvatarTheme, Badge, type BadgeProps, type BadgeTheme, type BreadcrumbItem, Breadcrumbs, type BreadcrumbsProps, Button, type ButtonProps, type ButtonSize, type ButtonTheme, type ButtonVariant, Card, type CardProps, Checkbox, type CheckboxProps, CodeBlock, type CodeBlockLanguage, type CodeBlockProps, ConnectionIcon, ConnectionIndicator, type ConnectionIndicatorProps, DatePicker, type DatePickerProps, Dialog, type DialogProps, Dropdown, type DropdownItem, type DropdownProps, EmptyState, type EmptyStateProps, FileUploader, type FileUploaderProps, FormControl, type FormControlProps, Input, type InputProps, type InputSize, Kbd, type KbdProps, type KbdSize, type KbdTheme, Link, type LinkProps, MultiSelect, type MultiSelectOption, type MultiSelectProps, Navbar, type NavbarItem, type NavbarProps, NumberInput, type NumberInputProps, type NumberInputSize, Pagination, type PaginationProps, Progress, type ProgressProps, ROS2Diagnostics, type ROS2DiagnosticsProps, Rating, type RatingProps, type RobotStatus, Select, type SelectOption, type SelectProps, type SelectSize, Sidebar, type SidebarItem, type SidebarProps, type SidebarSection, Slider, type SliderProps, Spinner, type SpinnerProps, StatusBadge, type StatusBadgeProps, Switch, type SwitchProps, type TabItem, Table, type TableColumn, type TableProps, Tabs, type TabsProps, Textarea, type TextareaProps, type TextareaSize, TimePicker, type TimePickerProps, Timeline, type TimelineItem, type TimelineProps, type TimelineStatus, Toast, ToastContainer, type ToastContainerProps, type ToastEntry, type ToastProps, type ToastType, Tooltip, type TooltipPlacement, type TooltipProps, type UseDisclosureReturn, useDisclosure, useToast };
package/dist/index.js CHANGED
@@ -780,6 +780,58 @@ function FormControl({
780
780
  helperText && !error && /* @__PURE__ */ jsx("p", { className: "text-xs text-ink-light", children: helperText })
781
781
  ] });
782
782
  }
783
+ function Navbar({
784
+ left,
785
+ center,
786
+ right,
787
+ brand,
788
+ items,
789
+ sticky = false,
790
+ bordered = true,
791
+ className = "",
792
+ ...props
793
+ }) {
794
+ const classes = [
795
+ "w-full h-16 bg-surface",
796
+ bordered ? "border-b border-outline" : "",
797
+ sticky ? "sticky top-0" : "",
798
+ "flex items-center px-6 gap-4",
799
+ "z-40",
800
+ className
801
+ ].filter(Boolean).join(" ");
802
+ return /* @__PURE__ */ jsxs("nav", { className: classes, ...props, children: [
803
+ (brand || left) && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-4 flex-shrink-0", children: [
804
+ brand && /* @__PURE__ */ jsx("div", { className: "text-lg font-semibold text-text-primary", children: brand }),
805
+ left && /* @__PURE__ */ jsx("div", { children: left })
806
+ ] }),
807
+ center && /* @__PURE__ */ jsx("div", { className: "flex-1 flex items-center justify-center", children: center }),
808
+ items && items.length > 0 && !center && /* @__PURE__ */ jsx("div", { className: "flex-1 flex items-center gap-1", children: items.map((item, idx) => /* @__PURE__ */ jsx(NavbarItemComponent, { item }, idx)) }),
809
+ right && /* @__PURE__ */ jsx("div", { className: "flex items-center gap-4 flex-shrink-0 ml-auto", children: right })
810
+ ] });
811
+ }
812
+ function NavbarItemComponent({ item }) {
813
+ const classes = [
814
+ "px-4 py-2 rounded-md text-sm font-medium",
815
+ "transition-colors",
816
+ item.disabled ? "text-text-muted cursor-not-allowed" : "text-text-secondary hover:bg-surface-hover hover:text-text-primary cursor-pointer"
817
+ ].join(" ");
818
+ const content = /* @__PURE__ */ jsxs(Fragment, { children: [
819
+ item.icon && /* @__PURE__ */ jsx("span", { className: "mr-2", children: item.icon }),
820
+ item.label
821
+ ] });
822
+ if (item.href) {
823
+ return /* @__PURE__ */ jsx("a", { href: item.href, className: classes, onClick: item.onClick, children: content });
824
+ }
825
+ return /* @__PURE__ */ jsx(
826
+ "button",
827
+ {
828
+ className: classes,
829
+ onClick: item.onClick,
830
+ disabled: item.disabled,
831
+ children: content
832
+ }
833
+ );
834
+ }
783
835
  function Tabs({
784
836
  tabs,
785
837
  activeTab,
@@ -3260,6 +3312,6 @@ function useToast() {
3260
3312
  return { toasts, addToast, removeToast };
3261
3313
  }
3262
3314
 
3263
- export { Alert, Avatar, Badge, Breadcrumbs, Button, Card, Checkbox, CodeBlock, ConnectionIcon, ConnectionIndicator, DatePicker, Dialog, Dropdown, EmptyState, FileUploader, FormControl, Input, Kbd, Link, MultiSelect, NumberInput, Pagination, Progress, ROS2Diagnostics, Rating, Select_default as Select, Sidebar, Slider, Spinner, StatusBadge, Switch, Table, Tabs, Textarea, TimePicker, Timeline, Toast, ToastContainer, Tooltip, useDisclosure, useToast };
3315
+ export { Alert, Avatar, Badge, Breadcrumbs, Button, Card, Checkbox, CodeBlock, ConnectionIcon, ConnectionIndicator, DatePicker, Dialog, Dropdown, EmptyState, FileUploader, FormControl, Input, Kbd, Link, MultiSelect, Navbar, NumberInput, Pagination, Progress, ROS2Diagnostics, Rating, Select_default as Select, Sidebar, Slider, Spinner, StatusBadge, Switch, Table, Tabs, Textarea, TimePicker, Timeline, Toast, ToastContainer, Tooltip, useDisclosure, useToast };
3264
3316
  //# sourceMappingURL=index.js.map
3265
3317
  //# sourceMappingURL=index.js.map