@gadagi/ui-navigation 1.0.1 → 1.0.2
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/NavItem.d.ts +9 -0
- package/dist/NavItem.d.ts.map +1 -0
- package/dist/Navigation.d.ts +9 -0
- package/dist/Navigation.d.ts.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1 -1
- package/package.json +1 -9
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { NavItem as NavItemType } from '@gadagi/types';
|
|
3
|
+
interface NavItemProps {
|
|
4
|
+
item: NavItemType;
|
|
5
|
+
collapsed?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare const NavItem: React.FC<NavItemProps>;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=NavItem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NavItem.d.ts","sourceRoot":"","sources":["../src/NavItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AAGvD,UAAU,YAAY;IACpB,IAAI,EAAE,WAAW,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,eAAO,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CA8B1C,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { NavigationConfig } from '@gadagi/types';
|
|
3
|
+
interface NavigationProps {
|
|
4
|
+
config: NavigationConfig;
|
|
5
|
+
defaultCollapsed?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare const Navigation: React.FC<NavigationProps>;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=Navigation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Navigation.d.ts","sourceRoot":"","sources":["../src/Navigation.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAIjD,UAAU,eAAe;IACvB,MAAM,EAAE,gBAAgB,CAAC;IACzB,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CA4ChD,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAS,WAAW,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see index.js.LICENSE.txt */
|
|
2
|
-
!function(e,
|
|
2
|
+
!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r(require("react"),require("@gadagi/design-system"),require("react-router-dom")):"function"==typeof define&&define.amd?define(["react",,"react-router-dom"],r):"object"==typeof exports?exports.gadagiUiNavigation=r(require("react"),require("@gadagi/design-system"),require("react-router-dom")):e.gadagiUiNavigation=r(e.React,e[void 0],e[void 0])}(this,(e,r,t)=>(()=>{"use strict";var o={698(e,r){var t=Symbol.for("react.transitional.element"),o=Symbol.for("react.fragment");function i(e,r,o){var i=null;if(void 0!==o&&(i=""+o),void 0!==r.key&&(i=""+r.key),"key"in r)for(var n in o={},r)"key"!==n&&(o[n]=r[n]);else o=r;return r=o.ref,{$$typeof:t,type:e,key:i,ref:void 0!==r?r:null,props:o}}r.Fragment=o,r.jsx=i,r.jsxs=i},848(e,r,t){e.exports=t(698)},158(e){e.exports=r},12(r){r.exports=e},590(e){e.exports=t}},i={};function n(e){var r=i[e];if(void 0!==r)return r.exports;var t=i[e]={exports:{}};return o[e](t,t.exports,n),t.exports}n.d=(e,r)=>{for(var t in r)n.o(r,t)&&!n.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a={};n.r(a),n.d(a,{NavItem:()=>c,Navigation:()=>f});var s=n(848),d=n(12),l=n(158),p=n(590);const c=({item:e,collapsed:r})=>(0,s.jsxs)(p.NavLink,{to:e.path,style:({isActive:e})=>({display:"flex",alignItems:"center",gap:"10px",padding:r?"10px 12px":"10px 16px",borderRadius:"6px",textDecoration:"none",fontSize:l.typography.fontSize.sm,fontWeight:l.typography.fontWeight.medium,color:e?l.colors.primary[600]:l.colors.neutral[600],background:e?l.colors.primary[50]:"transparent",transition:"background 0.15s, color 0.15s",justifyContent:r?"center":void 0}),children:[e.icon&&(0,s.jsx)("span",{style:{fontSize:"16px",flexShrink:0},children:e.icon}),!r&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{style:{flex:1},children:e.label}),void 0!==e.badge&&e.badge>0&&(0,s.jsx)(l.Badge,{variant:"info",children:e.badge})]})]}),f=({config:e,defaultCollapsed:r=!1})=>{const[t,o]=(0,d.useState)(r);return(0,s.jsxs)("nav",{style:{width:t?"56px":"240px",minHeight:"100vh",background:"#fff",borderRight:`1px solid ${l.colors.neutral[200]}`,padding:"12px 8px",display:"flex",flexDirection:"column",gap:"2px",transition:"width 0.2s ease",overflowX:"hidden"},children:[(0,s.jsx)("button",{onClick:()=>o(e=>!e),style:{alignSelf:t?"center":"flex-end",background:"transparent",border:"none",cursor:"pointer",padding:"6px",color:l.colors.neutral[400],fontSize:"18px",lineHeight:1,marginBottom:"8px"},title:t?"Expand":"Collapse",children:t?"->":"<-"}),e.items.map(e=>(0,s.jsx)(c,{item:e,collapsed:t},e.id))]})};return a})());
|
package/package.json
CHANGED
|
@@ -1,17 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gadagi/ui-navigation",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Sidebar navigation for gadagi micro-frontends",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
|
-
"module": "dist/index.esm.js",
|
|
7
6
|
"types": "dist/index.d.ts",
|
|
8
|
-
"exports": {
|
|
9
|
-
".": {
|
|
10
|
-
"types": "./dist/index.d.ts",
|
|
11
|
-
"import": "./dist/index.esm.js",
|
|
12
|
-
"require": "./dist/index.js"
|
|
13
|
-
}
|
|
14
|
-
},
|
|
15
7
|
"files": ["dist"],
|
|
16
8
|
"scripts": {
|
|
17
9
|
"build": "webpack --mode production && tsc -p tsconfig.build.json --emitDeclarationOnly",
|