@gadagi/ui-header 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/index.js +1 -1
- package/package.json +1 -9
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see index.js.LICENSE.txt */
|
|
2
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("@gadagi/design-system")):"function"==typeof define&&define.amd?define(["
|
|
2
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("@gadagi/design-system")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports.gadagiUiHeader=t(require("react"),require("@gadagi/design-system")):e.gadagiUiHeader=t(e.React,e[void 0])}(this,(e,t)=>(()=>{"use strict";var o={698(e,t){var o=Symbol.for("react.transitional.element");function r(e,t,r){var i=null;if(void 0!==r&&(i=""+r),void 0!==t.key&&(i=""+t.key),"key"in t)for(var n in r={},t)"key"!==n&&(r[n]=t[n]);else r=t;return t=r.ref,{$$typeof:o,type:e,key:i,ref:void 0!==t?t:null,props:r}}Symbol.for("react.fragment"),t.jsx=r,t.jsxs=r},848(e,t,o){e.exports=o(698)},158(e){e.exports=t},12(t){t.exports=e}},r={};function i(e){var t=r[e];if(void 0!==t)return t.exports;var n=r[e]={exports:{}};return o[e](n,n.exports,i),n.exports}i.d=(e,t)=>{for(var o in t)i.o(t,o)&&!i.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};i.r(n),i.d(n,{Header:()=>d,UserMenu:()=>p});var s=i(848),a=i(12),l=i(158);const p=({user:e,onLogout:t})=>{const[o,r]=(0,a.useState)(!1),i=`${e.firstName[0]}${e.lastName[0]}`.toUpperCase();return(0,s.jsxs)("div",{style:{position:"relative"},children:[(0,s.jsxs)("button",{onClick:()=>r(e=>!e),style:{display:"flex",alignItems:"center",gap:"8px",background:"transparent",border:"none",cursor:"pointer",color:"#fff"},children:[(0,s.jsx)("div",{style:{width:"32px",height:"32px",borderRadius:"50%",background:l.colors.primary[500],display:"flex",alignItems:"center",justifyContent:"center",fontSize:l.typography.fontSize.sm,fontWeight:l.typography.fontWeight.semibold,color:"#fff"},children:i}),(0,s.jsx)("span",{style:{fontSize:l.typography.fontSize.sm},children:e.firstName})]}),o&&(0,s.jsxs)("div",{style:{position:"absolute",right:0,top:"100%",marginTop:"8px",background:"#fff",border:`1px solid ${l.colors.neutral[200]}`,borderRadius:"8px",padding:"8px",minWidth:"160px",boxShadow:"0 4px 12px rgba(0,0,0,0.1)",zIndex:100},children:[(0,s.jsxs)("div",{style:{padding:"8px 12px",borderBottom:`1px solid ${l.colors.neutral[100]}`,marginBottom:"4px"},children:[(0,s.jsxs)("p",{style:{fontSize:l.typography.fontSize.sm,fontWeight:l.typography.fontWeight.medium,color:l.colors.neutral[800],margin:0},children:[e.firstName," ",e.lastName]}),(0,s.jsx)("p",{style:{fontSize:l.typography.fontSize.xs,color:l.colors.neutral[400],margin:0},children:e.email})]}),(0,s.jsx)(l.Button,{variant:"ghost",size:"sm",fullWidth:!0,onClick:()=>{r(!1),t()},children:"Sign out"})]})]})},d=({appName:e="gadagi Platform",user:t,onLogout:o=()=>{},logo:r})=>(0,s.jsxs)("header",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 1.5rem",height:"56px",background:l.colors.neutral[800],borderBottom:`1px solid ${l.colors.neutral[900]}`,position:"sticky",top:0,zIndex:50},children:[(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[r,(0,s.jsx)("span",{style:{fontSize:l.typography.fontSize.lg,fontWeight:l.typography.fontWeight.semibold,color:"#fff",letterSpacing:"-0.01em"},children:e})]}),(0,s.jsx)("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:t&&(0,s.jsx)(p,{user:t,onLogout:o})})]});return n})());
|
package/package.json
CHANGED
|
@@ -1,17 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gadagi/ui-header",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Top header component 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",
|