@scripso-homepad/ui 0.4.35 → 0.4.36

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scripso-homepad/ui",
3
- "version": "0.4.35",
3
+ "version": "0.4.36",
4
4
  "type": "module",
5
5
  "description": "Cross-platform UI components for Homepad (React Web + React Native)",
6
6
  "license": "MIT",
@@ -0,0 +1,32 @@
1
+ type SidebarCollapseIconProps = {
2
+ className?: string;
3
+ size?: number | string;
4
+ strokeWidth?: number | string;
5
+ };
6
+
7
+ /** Shown when the sidebar is open — click collapses it. */
8
+ export function SidebarCollapseIcon({
9
+ className,
10
+ size = 20,
11
+ strokeWidth = 2,
12
+ }: SidebarCollapseIconProps) {
13
+ return (
14
+ <svg
15
+ width={size}
16
+ height={size}
17
+ viewBox="0 0 20 20"
18
+ fill="none"
19
+ xmlns="http://www.w3.org/2000/svg"
20
+ aria-hidden
21
+ className={className}
22
+ >
23
+ <path
24
+ d="M12.5 2.5V17.5M8.33333 12.5L5.83333 10L8.33333 7.5M4.16667 2.5H15.8333C16.7538 2.5 17.5 3.24619 17.5 4.16667V15.8333C17.5 16.7538 16.7538 17.5 15.8333 17.5H4.16667C3.24619 17.5 2.5 16.7538 2.5 15.8333V4.16667C2.5 3.24619 3.24619 2.5 4.16667 2.5Z"
25
+ stroke="currentColor"
26
+ strokeWidth={strokeWidth}
27
+ strokeLinecap="round"
28
+ strokeLinejoin="round"
29
+ />
30
+ </svg>
31
+ );
32
+ }
@@ -0,0 +1,32 @@
1
+ type SidebarExpandIconProps = {
2
+ className?: string;
3
+ size?: number | string;
4
+ strokeWidth?: number | string;
5
+ };
6
+
7
+ /** Shown when the sidebar is closed — click expands it. */
8
+ export function SidebarExpandIcon({
9
+ className,
10
+ size = 20,
11
+ strokeWidth = 2,
12
+ }: SidebarExpandIconProps) {
13
+ return (
14
+ <svg
15
+ width={size}
16
+ height={size}
17
+ viewBox="0 0 20 20"
18
+ fill="none"
19
+ xmlns="http://www.w3.org/2000/svg"
20
+ aria-hidden
21
+ className={className}
22
+ >
23
+ <path
24
+ d="M12.5 2.5V17.5M6.66667 7.5L9.16667 10L6.66667 12.5M4.16667 2.5H15.8333C16.7538 2.5 17.5 3.24619 17.5 4.16667V15.8333C17.5 16.7538 16.7538 17.5 15.8333 17.5H4.16667C3.24619 17.5 2.5 16.7538 2.5 15.8333V4.16667C2.5 3.24619 3.24619 2.5 4.16667 2.5Z"
25
+ stroke="currentColor"
26
+ strokeWidth={strokeWidth}
27
+ strokeLinecap="round"
28
+ strokeLinejoin="round"
29
+ />
30
+ </svg>
31
+ );
32
+ }
package/src/web/index.ts CHANGED
@@ -23,6 +23,8 @@ export type { SidebarUserCardProps } from './layout/SidebarUserCard';
23
23
 
24
24
  export { BellIcon } from './icons/BellIcon';
25
25
  export { BuildingIcon } from './icons/BuildingIcon';
26
+ export { SidebarCollapseIcon } from './icons/SidebarCollapseIcon';
27
+ export { SidebarExpandIcon } from './icons/SidebarExpandIcon';
26
28
  export { TableMoreIcon } from './icons/TableMoreIcon';
27
29
  export { TableSortIcon } from './icons/TableSortIcon';
28
30
  export { TableMenuCheckIcon } from './icons/TableMenuCheckIcon';
@@ -1,6 +1,8 @@
1
- import { PanelLeftClose, PanelLeftOpen, X } from 'lucide-react';
1
+ import { X } from 'lucide-react';
2
2
  import { useCallback, useEffect, useRef, useState, type ReactNode } from 'react';
3
3
 
4
+ import { SidebarCollapseIcon } from '../icons/SidebarCollapseIcon';
5
+ import { SidebarExpandIcon } from '../icons/SidebarExpandIcon';
4
6
  import { useMediaQuery } from '../hooks/useMediaQuery';
5
7
  import { cn } from '../utils/cn';
6
8
  import { isNavItemActive } from './nav-active';
@@ -208,9 +210,9 @@ export function Sidebar({
208
210
  >
209
211
  {isDesktop ? (
210
212
  isExpanded ? (
211
- collapseIcon ?? <PanelLeftClose size={20} strokeWidth={1.75} />
213
+ collapseIcon ?? <SidebarCollapseIcon />
212
214
  ) : (
213
- expandIcon ?? <PanelLeftOpen size={20} strokeWidth={1.75} />
215
+ expandIcon ?? <SidebarExpandIcon />
214
216
  )
215
217
  ) : (
216
218
  closeIcon ?? <X size={20} strokeWidth={1.75} />