uibee 2.4.7 → 2.4.9

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.
@@ -2,5 +2,6 @@ import { ReactNode } from 'react';
2
2
  export type NavDropdownProps = {
3
3
  children: ReactNode;
4
4
  title: string;
5
+ className?: string;
5
6
  };
6
- export default function NavDropdown({ children, title }: NavDropdownProps): import("react/jsx-runtime").JSX.Element;
7
+ export default function NavDropdown({ children, title, className }: NavDropdownProps): import("react/jsx-runtime").JSX.Element;
@@ -2,14 +2,14 @@
2
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
3
  import { ChevronDown } from 'lucide-react';
4
4
  import React, { useRef, useState } from 'react';
5
- export default function NavDropdown({ children, title }) {
5
+ export default function NavDropdown({ children, title, className }) {
6
6
  const [isMobileDropdownOpen, setIsMobileDropdownOpen] = useState(false);
7
7
  const navItemRef = useRef(null);
8
8
  return (_jsxs(_Fragment, { children: [_jsx("div", { className: 'relative group hidden 800px:block', children: _jsxs("div", { className: 'outline-none', tabIndex: 0, ref: navItemRef, children: [_jsxs("div", { className: `list-none no-underline text-base leading-4 p-3 font-bold cursor-pointer flex flex-row items-center
9
9
  transition-colors`, children: [title, _jsx(ChevronDown, { className: 'w-6 h-6 stroke-login ml-1 text-2xl transition-transform duration-300 ease-in-out' })] }), _jsx("div", { className: `absolute pt-2 -ml-4 -translate-y-4 opacity-0 pointer-events-none
10
10
  transition-all duration-200 ease-in-out z-10
11
11
  group-hover:opacity-100 group-hover:pointer-events-auto group-hover:translate-y-0
12
- group-focus-within:opacity-100 group-focus-within:pointer-events-auto group-focus-within:translate-y-0`, children: _jsx("ul", { className: 'p-3 px-6 pb-4 rounded-[0.4rem] shadow-[0_0.1rem_0.5rem_rgba(3,3,3,0.5)] bg-login-700/98', children: React.Children.map(children, (child, index) => (_jsx("div", { onClick: () => navItemRef.current?.blur(), className: 'group dropdown', children: child }, index))) }) })] }) }), _jsxs("div", { className: 'block 800px:hidden', children: [_jsx("button", { className: 'bg-none border-none cursor-pointer w-full text-left', onClick: (e) => {
12
+ group-focus-within:opacity-100 group-focus-within:pointer-events-auto group-focus-within:translate-y-0`, children: _jsx("ul", { className: `p-3 px-6 pb-4 rounded-[0.4rem] shadow-[0_0.1rem_0.5rem_rgba(3,3,3,0.5)] bg-login-700/98 ${className || ''}`, children: React.Children.map(children, (child, index) => (_jsx("div", { onClick: () => navItemRef.current?.blur(), className: 'group dropdown', children: child }, index))) }) })] }) }), _jsxs("div", { className: 'block 800px:hidden!', children: [_jsx("button", { className: 'bg-none border-none cursor-pointer w-full text-left', onClick: (e) => {
13
13
  e.stopPropagation();
14
14
  setIsMobileDropdownOpen(!isMobileDropdownOpen);
15
15
  }, children: _jsxs("li", { className: `list-none no-underline text-2xl leading-6 overflow-hidden
@@ -1443,6 +1443,11 @@
1443
1443
  display: none;
1444
1444
  }
1445
1445
  }
1446
+ .\38 00px\:hidden\! {
1447
+ @media (width >= 800px) {
1448
+ display: none !important;
1449
+ }
1450
+ }
1446
1451
  .\38 00px\:h-20 {
1447
1452
  @media (width >= 800px) {
1448
1453
  height: calc(var(--spacing) * 20);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uibee",
3
- "version": "2.4.7",
3
+ "version": "2.4.9",
4
4
  "description": "Shared components, functions and hooks for reuse across Login projects",
5
5
  "homepage": "https://github.com/Login-Linjeforening-for-IT/uibee#readme",
6
6
  "bugs": {
@@ -6,9 +6,10 @@ import React, { ReactNode, useRef, useState } from 'react'
6
6
  export type NavDropdownProps = {
7
7
  children: ReactNode
8
8
  title: string
9
+ className?: string
9
10
  }
10
11
 
11
- export default function NavDropdown({ children, title }: NavDropdownProps) {
12
+ export default function NavDropdown({ children, title, className }: NavDropdownProps) {
12
13
  const [isMobileDropdownOpen, setIsMobileDropdownOpen] = useState(false)
13
14
  const navItemRef = useRef<HTMLDivElement>(null)
14
15
 
@@ -28,7 +29,9 @@ export default function NavDropdown({ children, title }: NavDropdownProps) {
28
29
  group-hover:opacity-100 group-hover:pointer-events-auto group-hover:translate-y-0
29
30
  group-focus-within:opacity-100 group-focus-within:pointer-events-auto group-focus-within:translate-y-0`}
30
31
  >
31
- <ul className={'p-3 px-6 pb-4 rounded-[0.4rem] shadow-[0_0.1rem_0.5rem_rgba(3,3,3,0.5)] bg-login-700/98'}>
32
+ <ul className={`p-3 px-6 pb-4 rounded-[0.4rem] shadow-[0_0.1rem_0.5rem_rgba(3,3,3,0.5)] bg-login-700/98 ${
33
+ className || ''}`}
34
+ >
32
35
  {React.Children.map(children, (child, index) => (
33
36
  <div
34
37
  key={index}
@@ -44,7 +47,7 @@ export default function NavDropdown({ children, title }: NavDropdownProps) {
44
47
  </div>
45
48
 
46
49
  {/* Mobile Dropdown */}
47
- <div className={'block 800px:hidden'}>
50
+ <div className={'block 800px:hidden!'}>
48
51
  <button
49
52
  className={'bg-none border-none cursor-pointer w-full text-left'}
50
53
  onClick={(e) => {