tc-dazzle-ui 1.2.0 → 1.3.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.
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import './Logo.css';
3
3
  export type LogoSize = 'small' | 'medium' | 'large';
4
- export type LogoVariant = 'full' | 'icon';
4
+ export type LogoVariant = 'full' | 'icon' | 'sandbox';
5
5
  export interface LogoProps {
6
6
  size?: LogoSize;
7
7
  variant?: LogoVariant;
@@ -4,12 +4,14 @@ export interface DropdownMenuItem {
4
4
  id: string;
5
5
  label: string;
6
6
  icon?: React.ReactNode;
7
+ subItems?: DropdownMenuItem[];
7
8
  onClick?: () => void;
8
9
  }
9
10
  export interface DropdownMenuProps {
10
11
  items: DropdownMenuItem[];
11
12
  selectedId?: string;
12
13
  onItemClick?: (item: DropdownMenuItem) => void;
14
+ showIcons?: boolean;
13
15
  className?: string;
14
16
  }
15
17
  export declare const DropdownMenu: React.FC<DropdownMenuProps>;
@@ -5,7 +5,6 @@ import type { GlobalSearchOption } from '../../Atoms';
5
5
  import './MainHeader.css';
6
6
  export interface MainHeaderProps {
7
7
  showSandbox?: boolean;
8
- menuItems?: HeaderMenuItem[];
9
8
  searchFilterOptions?: GlobalSearchOption[];
10
9
  searchPlaceholder?: string;
11
10
  searchFilterPlaceholder?: string;
package/dist/index.esm.js CHANGED
@@ -252,8 +252,10 @@ const CaretDownIcon = (props) => (jsx(IconWrapper, { ...props, children: jsx("sv
252
252
  // TeamConnect Logo Icon (honeycomb hexagon pattern)
253
253
  const TeamConnectIcon = (props) => (jsx(IconWrapper, { ...props, children: jsxs("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsx("path", { d: "M5.5 4L8 2.5L10.5 4V7L8 8.5L5.5 7V4Z", fill: "#E91E63" }), jsx("path", { d: "M10.5 4L13 2.5L15.5 4V7L13 8.5L10.5 7V4Z", fill: "#9C27B0" }), jsx("path", { d: "M3 8.5L5.5 7L8 8.5V11.5L5.5 13L3 11.5V8.5Z", fill: "#7B1FA2" }), jsx("path", { d: "M8 8.5L10.5 7L13 8.5V11.5L10.5 13L8 11.5V8.5Z", fill: "#673AB7" }), jsx("path", { d: "M13 8.5L15.5 7L18 8.5V11.5L15.5 13L13 11.5V8.5Z", fill: "#3F51B5" }), jsx("path", { d: "M5.5 13L8 11.5L10.5 13V16L8 17.5L5.5 16V13Z", fill: "#303F9F" }), jsx("path", { d: "M10.5 13L13 11.5L15.5 13V16L13 17.5L10.5 16V13Z", fill: "#1A237E" })] }) }));
254
254
 
255
- // TeamConnect Logo Icon (honeycomb hexagon pattern)
256
- const LogoIcon = ({ className }) => (jsxs("svg", { className: className, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsx("path", { d: "M5.5 4L8 2.5L10.5 4V7L8 8.5L5.5 7V4Z", fill: "#E91E63" }), jsx("path", { d: "M10.5 4L13 2.5L15.5 4V7L13 8.5L10.5 7V4Z", fill: "#9C27B0" }), jsx("path", { d: "M3 8.5L5.5 7L8 8.5V11.5L5.5 13L3 11.5V8.5Z", fill: "#7B1FA2" }), jsx("path", { d: "M8 8.5L10.5 7L13 8.5V11.5L10.5 13L8 11.5V8.5Z", fill: "#673AB7" }), jsx("path", { d: "M13 8.5L15.5 7L18 8.5V11.5L15.5 13L13 11.5V8.5Z", fill: "#3F51B5" }), jsx("path", { d: "M5.5 13L8 11.5L10.5 13V16L8 17.5L5.5 16V13Z", fill: "#303F9F" }), jsx("path", { d: "M10.5 13L13 11.5L15.5 13V16L13 17.5L10.5 16V13Z", fill: "#1A237E" })] }));
255
+ // TeamConnect Logo Icon - Default (hexagon cluster pattern)
256
+ const LogoIcon = ({ className }) => (jsxs("svg", { className: className, viewBox: "0 0 32 33", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsx("path", { d: "M8.95902 16.0675L11.9454 10.8724L8.95902 5.68262H2.98634L0 10.8724L2.98634 16.0675H8.95902Z", fill: "#EC822A" }), jsx("path", { d: "M18.71 10.3849L21.6963 5.19515L18.71 0H12.7373L9.75098 5.19515L12.7373 10.3849H18.71Z", fill: "#E65A36" }), jsx("path", { d: "M22.5537 17.084L19.5674 22.2737L22.5537 27.4689H28.5264L31.5127 22.2737L28.5264 17.084H22.5537Z", fill: "#002453" }), jsx("path", { d: "M8.95902 17.084H2.98634L0 22.2737L2.98634 27.4689H8.95902L11.9454 22.2737L8.95902 17.084Z", fill: "#67666B" }), jsx("path", { d: "M22.5537 16.0675H28.5264L31.5127 10.8724L28.5264 5.68262H22.5537L19.5674 10.8724L22.5537 16.0675Z", fill: "#1CB3CD" }), jsx("path", { d: "M12.7373 22.6152L9.75098 27.805L12.7373 33.0001H18.71L21.6963 27.805L18.71 22.6152H12.7373Z", fill: "#B41E80" })] }));
257
+ // Sandbox Logo Icon (old honeycomb pattern - for sandbox variant)
258
+ const SandboxLogoIcon = ({ className }) => (jsxs("svg", { className: className, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsx("path", { d: "M5.5 4L8 2.5L10.5 4V7L8 8.5L5.5 7V4Z", fill: "#E91E63" }), jsx("path", { d: "M10.5 4L13 2.5L15.5 4V7L13 8.5L10.5 7V4Z", fill: "#9C27B0" }), jsx("path", { d: "M3 8.5L5.5 7L8 8.5V11.5L5.5 13L3 11.5V8.5Z", fill: "#7B1FA2" }), jsx("path", { d: "M8 8.5L10.5 7L13 8.5V11.5L10.5 13L8 11.5V8.5Z", fill: "#673AB7" }), jsx("path", { d: "M13 8.5L15.5 7L18 8.5V11.5L15.5 13L13 11.5V8.5Z", fill: "#3F51B5" }), jsx("path", { d: "M5.5 13L8 11.5L10.5 13V16L8 17.5L5.5 16V13Z", fill: "#303F9F" }), jsx("path", { d: "M10.5 13L13 11.5L15.5 13V16L13 17.5L10.5 16V13Z", fill: "#1A237E" })] }));
257
259
  const Logo = ({ size = 'medium', variant = 'full', showSandbox = false, className = '', onClick, }) => {
258
260
  const getSizeClass = () => {
259
261
  switch (size) {
@@ -265,12 +267,14 @@ const Logo = ({ size = 'medium', variant = 'full', showSandbox = false, classNam
265
267
  return 'tc-logo--medium';
266
268
  }
267
269
  };
268
- return (jsxs("div", { className: `tc-logo ${getSizeClass()} ${className}`.trim(), onClick: onClick, role: onClick ? 'button' : undefined, tabIndex: onClick ? 0 : undefined, onKeyDown: onClick ? (e) => {
270
+ // Use sandbox icon for sandbox variant, otherwise use default logo
271
+ const IconComponent = variant === 'sandbox' ? SandboxLogoIcon : LogoIcon;
272
+ return (jsxs("div", { className: `tc-logo ${getSizeClass()} ${variant === 'sandbox' ? 'tc-logo--sandbox' : ''} ${className}`.trim(), onClick: onClick, role: onClick ? 'button' : undefined, tabIndex: onClick ? 0 : undefined, onKeyDown: onClick ? (e) => {
269
273
  if (e.key === 'Enter' || e.key === ' ') {
270
274
  e.preventDefault();
271
275
  onClick();
272
276
  }
273
- } : undefined, children: [jsx(LogoIcon, { className: "tc-logo__icon" }), variant === 'full' && (jsxs("span", { className: "tc-logo__text", children: [jsx("span", { className: "tc-logo__text-team", children: "Team" }), jsx("span", { className: "tc-logo__text-connect", children: "Connect" }), showSandbox && (jsx("span", { className: "tc-logo__text-sandbox", children: "SANDBOX" }))] }))] }));
277
+ } : undefined, children: [jsx(IconComponent, { className: "tc-logo__icon" }), variant !== 'icon' && (jsxs("span", { className: "tc-logo__text", children: [jsx("span", { className: "tc-logo__text-team", children: "Team" }), jsx("span", { className: "tc-logo__text-connect", children: "Connect" }), (showSandbox || variant === 'sandbox') && (jsx("span", { className: "tc-logo__text-sandbox", children: "SANDBOX" }))] }))] }));
274
278
  };
275
279
 
276
280
  const Search = ({ placeholder = 'Search', filterPlaceholder = 'All', filterOptions = [
@@ -295,23 +299,39 @@ const Search = ({ placeholder = 'Search', filterPlaceholder = 'All', filterOptio
295
299
  return (jsxs("div", { className: `tc-search ${className}`.trim(), children: [jsx(GlobalSearch, { placeholder: placeholder, filterPlaceholder: filterPlaceholder, filterOptions: filterOptions, filterValue: controlledFilterValue !== undefined ? controlledFilterValue : filterValue, searchValue: controlledSearchValue !== undefined ? controlledSearchValue : searchValue, disabled: disabled, onSearch: handleSearch, onFilterChange: handleFilterChange, onSubmit: handleSubmit }), showInfoIcon && (jsx(IconButton, { icon: jsx(InfoIcon, { size: "medium" }), size: "medium", color: "default", onClick: handleInfoClick, disabled: disabled, ariaLabel: "More information", className: "tc-search__info-button" }))] }));
296
300
  };
297
301
 
302
+ // Chevron Right Icon for submenu indicator
303
+ const ChevronRightIcon = ({ className }) => (jsx("svg", { className: className, viewBox: "0 0 6 10", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", children: jsx("path", { d: "M1 1L5 5L1 9", stroke: "currentColor", strokeWidth: "1.5", fill: "none" }) }));
298
304
  // Default Wrench Icon (from Figma design)
299
305
  const WrenchIcon = ({ className }) => (jsx("svg", { className: className, viewBox: "0 0 14 14", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", children: jsx("path", { d: "M13.6 3.5C13.4 3.3 13.1 3.3 12.9 3.5L10.5 5.9L8.1 3.5L10.5 1.1C10.7 0.9 10.7 0.6 10.5 0.4C9.3 -0.4 7.7 -0.1 6.6 1C5.7 1.9 5.4 3.2 5.8 4.3L0.4 9.7C-0.1 10.2 -0.1 11 0.4 11.5L2.5 13.6C3 14.1 3.8 14.1 4.3 13.6L9.7 8.2C10.8 8.6 12.1 8.3 13 7.4C14.1 6.3 14.4 4.7 13.6 3.5Z" }) }));
300
- const DropdownMenu = ({ items, selectedId, onItemClick, className = '', }) => {
306
+ // Submenu component
307
+ const SubMenu = ({ items, onItemClick, showIcons }) => {
308
+ return (jsx("div", { className: "tc-dropdown-menu__submenu", children: items.map((item) => (jsxs("div", { className: "tc-dropdown-menu__submenu-item", onClick: (e) => {
309
+ var _a;
310
+ e.stopPropagation();
311
+ (_a = item.onClick) === null || _a === void 0 ? void 0 : _a.call(item);
312
+ onItemClick === null || onItemClick === void 0 ? void 0 : onItemClick(item);
313
+ }, role: "menuitem", tabIndex: 0, children: [showIcons && item.icon && (jsx("span", { className: "tc-dropdown-menu__icon", children: item.icon })), jsx("span", { className: "tc-dropdown-menu__label", children: item.label })] }, item.id))) }));
314
+ };
315
+ const DropdownMenu = ({ items, selectedId, onItemClick, showIcons = true, className = '', }) => {
316
+ const [hoveredItemId, setHoveredItemId] = useState(null);
301
317
  const handleItemClick = (item) => {
302
318
  var _a;
303
- (_a = item.onClick) === null || _a === void 0 ? void 0 : _a.call(item);
304
- onItemClick === null || onItemClick === void 0 ? void 0 : onItemClick(item);
319
+ if (!item.subItems || item.subItems.length === 0) {
320
+ (_a = item.onClick) === null || _a === void 0 ? void 0 : _a.call(item);
321
+ onItemClick === null || onItemClick === void 0 ? void 0 : onItemClick(item);
322
+ }
305
323
  };
306
- return (jsx("div", { className: `tc-dropdown-menu ${className}`.trim(), children: items.map((item, index) => {
324
+ return (jsx("div", { className: `tc-dropdown-menu ${className}`.trim(), role: "menu", children: items.map((item, index) => {
307
325
  const isSelected = item.id === selectedId;
308
326
  const isLast = index === items.length - 1;
309
- return (jsx("div", { className: `tc-dropdown-menu__item ${isSelected ? 'tc-dropdown-menu__item--selected' : ''} ${isLast ? 'tc-dropdown-menu__item--last' : ''}`, onClick: () => handleItemClick(item), role: "menuitem", tabIndex: 0, onKeyDown: (e) => {
327
+ const hasSubItems = item.subItems && item.subItems.length > 0;
328
+ const isHovered = hoveredItemId === item.id;
329
+ return (jsxs("div", { className: `tc-dropdown-menu__item ${isSelected ? 'tc-dropdown-menu__item--selected' : ''} ${isLast ? 'tc-dropdown-menu__item--last' : ''} ${hasSubItems ? 'tc-dropdown-menu__item--has-submenu' : ''}`, onClick: () => handleItemClick(item), onMouseEnter: () => setHoveredItemId(item.id), onMouseLeave: () => setHoveredItemId(null), role: "menuitem", tabIndex: 0, onKeyDown: (e) => {
310
330
  if (e.key === 'Enter' || e.key === ' ') {
311
331
  e.preventDefault();
312
332
  handleItemClick(item);
313
333
  }
314
- }, children: jsxs("div", { className: "tc-dropdown-menu__link", children: [jsx("span", { className: "tc-dropdown-menu__icon", children: item.icon || jsx(WrenchIcon, {}) }), jsx("span", { className: "tc-dropdown-menu__label", children: item.label })] }) }, item.id));
334
+ }, children: [jsxs("div", { className: "tc-dropdown-menu__link", children: [showIcons && (jsx("span", { className: "tc-dropdown-menu__icon", children: item.icon || jsx(WrenchIcon, {}) })), jsx("span", { className: "tc-dropdown-menu__label", children: item.label }), hasSubItems && (jsx("span", { className: "tc-dropdown-menu__chevron", children: jsx(ChevronRightIcon, {}) }))] }), hasSubItems && isHovered && (jsx(SubMenu, { items: item.subItems, onItemClick: onItemClick, showIcons: showIcons }))] }, item.id));
315
335
  }) }));
316
336
  };
317
337
 
@@ -356,15 +376,48 @@ const HeaderMenu = ({ items, onItemClick, onDropdownItemClick, className = '', }
356
376
  return (jsx("div", { ref: menuRef, className: `tc-header-menu ${className}`.trim(), children: items.map((item) => {
357
377
  const isOpen = openMenuId === item.id;
358
378
  const hasDropdown = item.dropdownItems && item.dropdownItems.length > 0;
359
- return (jsxs("div", { className: "tc-header-menu__item-wrapper", children: [jsxs("button", { className: `tc-header-menu__item ${isOpen ? 'tc-header-menu__item--active' : ''}`, onClick: () => handleItemClick(item), type: "button", "aria-expanded": hasDropdown ? isOpen : undefined, "aria-haspopup": hasDropdown ? 'menu' : undefined, children: [jsx("span", { className: "tc-header-menu__icon", children: item.icon || defaultIcons[item.id.toLowerCase()] || jsx(BookmarkIcon, {}) }), jsx("span", { className: "tc-header-menu__label", children: item.label })] }), hasDropdown && isOpen && (jsx("div", { className: "tc-header-menu__dropdown", children: jsx(DropdownMenu, { items: item.dropdownItems, onItemClick: (dropdownItem) => handleDropdownItemClick(item, dropdownItem) }) }))] }, item.id));
379
+ return (jsxs("div", { className: "tc-header-menu__item-wrapper", children: [jsxs("button", { className: `tc-header-menu__item ${isOpen ? 'tc-header-menu__item--active' : ''}`, onClick: () => handleItemClick(item), type: "button", "aria-expanded": hasDropdown ? isOpen : undefined, "aria-haspopup": hasDropdown ? 'menu' : undefined, children: [jsx("span", { className: "tc-header-menu__icon", children: item.icon || defaultIcons[item.id.toLowerCase()] || jsx(BookmarkIcon, {}) }), jsx("span", { className: "tc-header-menu__label", children: item.label })] }), hasDropdown && isOpen && (jsx("div", { className: "tc-header-menu__dropdown", children: jsx(DropdownMenu, { items: item.dropdownItems, onItemClick: (dropdownItem) => handleDropdownItemClick(item, dropdownItem), showIcons: false }) }))] }, item.id));
360
380
  }) }));
361
381
  };
362
382
 
363
- // Default menu items matching the Figma design
364
- const defaultMenuItems = [
383
+ // Fixed menu items - always the same
384
+ const menuItems = [
365
385
  { id: 'bookmarks', label: 'Bookmarks', dropdownItems: [] },
366
- { id: 'recent', label: 'Recent', dropdownItems: [] },
367
- { id: 'all', label: 'All', dropdownItems: [] },
386
+ {
387
+ id: 'recent',
388
+ label: 'Recent',
389
+ dropdownItems: [
390
+ { id: 'unsaved-items', label: 'Unsaved Items', subItems: [
391
+ { id: 'no-unsaved', label: 'No Unsaved Items' },
392
+ ] },
393
+ { id: 'recently-viewed', label: 'Recently Viewed', subItems: [] },
394
+ { id: 'recent-searches', label: 'Recent Searches', subItems: [] },
395
+ ]
396
+ },
397
+ {
398
+ id: 'all',
399
+ label: 'All',
400
+ dropdownItems: [
401
+ { id: 'view-full-list', label: 'View Full List' },
402
+ { id: 'accounts', label: 'Accounts' },
403
+ { id: 'action-matrix', label: 'Action Matrix', subItems: [
404
+ { id: 'action-items', label: 'Action Items' },
405
+ ] },
406
+ { id: 'advanced-docket', label: 'Advanced Docket Management', subItems: [
407
+ { id: 'scheduling-orders', label: 'Scheduling Orders' },
408
+ ] },
409
+ { id: 'appointments', label: 'Appointments' },
410
+ { id: 'approvals', label: 'Approvals' },
411
+ { id: 'ap-settings', label: 'AP Settings' },
412
+ { id: 'aries', label: 'ARIES' },
413
+ { id: 'aries-feedback', label: 'ARIES Feedback' },
414
+ { id: 'aries-settings', label: 'ARIES Settings' },
415
+ { id: 'billing-profiles', label: 'Billing Profiles' },
416
+ { id: 'budget-settings', label: 'Budget Settings' },
417
+ { id: 'budget-tests', label: 'Budget Tests' },
418
+ { id: 'cats-matters', label: 'Cats Matters' },
419
+ ]
420
+ },
368
421
  { id: 'tools', label: 'Tools', dropdownItems: [] },
369
422
  { id: 'help', label: 'Help', dropdownItems: [] },
370
423
  { id: 'client', label: 'Client', dropdownItems: [] },
@@ -373,8 +426,8 @@ const defaultMenuItems = [
373
426
  const defaultFilterOptions = [
374
427
  { value: 'all', label: 'All' },
375
428
  ];
376
- const MainHeader = ({ showSandbox = true, menuItems = defaultMenuItems, searchFilterOptions = defaultFilterOptions, searchPlaceholder = 'Search', searchFilterPlaceholder = 'All', onLogoClick, onSearch, onMenuItemClick, onDropdownItemClick, onInfoClick, className = '', }) => {
377
- return (jsxs("header", { className: `tc-main-header ${className}`.trim(), children: [jsx("div", { className: "tc-main-header__logo", children: jsx(Logo, { size: "medium", showSandbox: showSandbox, onClick: onLogoClick }) }), jsx("div", { className: "tc-main-header__search", children: jsx(Search, { placeholder: searchPlaceholder, filterPlaceholder: searchFilterPlaceholder, filterOptions: searchFilterOptions, onSubmit: onSearch, onInfoClick: onInfoClick }) }), jsx("div", { className: "tc-main-header__menu", children: jsx(HeaderMenu, { items: menuItems, onItemClick: onMenuItemClick, onDropdownItemClick: onDropdownItemClick }) })] }));
429
+ const MainHeader = ({ showSandbox = false, searchFilterOptions = defaultFilterOptions, searchPlaceholder = 'Search', searchFilterPlaceholder = 'All', onLogoClick, onSearch, onMenuItemClick, onDropdownItemClick, onInfoClick, className = '', }) => {
430
+ return (jsxs("header", { className: `tc-main-header ${className}`.trim(), children: [jsx("div", { className: "tc-main-header__logo", children: jsx(Logo, { size: "medium", variant: showSandbox ? 'sandbox' : 'full', onClick: onLogoClick }) }), jsx("div", { className: "tc-main-header__search", children: jsx(Search, { placeholder: searchPlaceholder, filterPlaceholder: searchFilterPlaceholder, filterOptions: searchFilterOptions, onSubmit: onSearch, onInfoClick: onInfoClick }) }), jsx("div", { className: "tc-main-header__menu", children: jsx(HeaderMenu, { items: menuItems, onItemClick: onMenuItemClick, onDropdownItemClick: onDropdownItemClick }) })] }));
378
431
  };
379
432
 
380
433
  var x = Object.defineProperty;