next-ui-lib 0.1.33 → 0.1.34

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.
@@ -11,7 +11,8 @@ export interface LeaderboardProps {
11
11
  loading?: boolean;
12
12
  buttonColor?: ButtonColor;
13
13
  buttonLabel?: string;
14
+ customClass?: string;
14
15
  }
15
- declare const Leaderboard: ({ profiles, loading, buttonColor, buttonLabel, }: LeaderboardProps) => JSX.Element;
16
+ declare const Leaderboard: ({ profiles, loading, buttonColor, buttonLabel, customClass, }: LeaderboardProps) => JSX.Element;
16
17
  export { Leaderboard };
17
18
  //# sourceMappingURL=leaderboard.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"leaderboard.d.ts","sourceRoot":"","sources":["../../../src/components/leaderboard/leaderboard.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAU,MAAM,wBAAwB,CAAC;AAGxE,MAAM,WAAW,OAAO;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,QAAA,MAAM,WAAW,GAAI,kDAKlB,gBAAgB,gBAiDlB,CAAC;AAEF,OAAO,EAAE,WAAW,EAAE,CAAC"}
1
+ {"version":3,"file":"leaderboard.d.ts","sourceRoot":"","sources":["../../../src/components/leaderboard/leaderboard.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAU,MAAM,wBAAwB,CAAC;AAGxE,MAAM,WAAW,OAAO;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,QAAA,MAAM,WAAW,GAAI,+DAMlB,gBAAgB,gBAkDlB,CAAC;AAEF,OAAO,EAAE,WAAW,EAAE,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { StoryObj } from '@storybook/react';
2
2
  declare const meta: {
3
3
  title: string;
4
- component: ({ profiles, loading, buttonColor, buttonLabel, }: import('./leaderboard').LeaderboardProps) => JSX.Element;
4
+ component: ({ profiles, loading, buttonColor, buttonLabel, customClass, }: import('./leaderboard').LeaderboardProps) => JSX.Element;
5
5
  tags: string[];
6
6
  };
7
7
  export default meta;
package/dist/ui.cjs.js CHANGED
@@ -719,4 +719,4 @@ button {
719
719
  px-4 sm:px-6 py-4 sm:py-6 rounded-xl
720
720
  flex flex-col relative
721
721
  ${s}
722
- `,children:[(e||i||f&&d==="top-right")&&v.jsxs(bn,{className:"mb-4 flex items-start justify-between",children:[v.jsxs("div",{className:"flex items-center gap-3",children:[a&&v.jsx(Je,{color:r,iconSrc:a,onClick:()=>{}}),v.jsxs("div",{children:[e&&v.jsx(wn,{className:"text-main text-xl font-gabaritoBold font-medium leading-5 sm:text-lg md:text-xl",children:e}),i&&v.jsx(pn,{className:"text-sm sm:text-base text-gray-600",children:i})]})]}),f&&d==="top-right"&&v.jsx(We,{label:o,size:m,onClick:k,color:l,variant:t})]}),n&&v.jsx(yn,{className:"flex flex-col gap-4 font-regular h-full",children:n}),f&&d==="bottom-right"&&v.jsx(_n,{className:"flex justify-end pt-2",children:v.jsx(We,{label:o,size:m,onClick:k,color:l,variant:t})})]})},Qa=({bgIconColor:e="amber",iconSrc:i="",label:n="",percentage:a=0,showCard:s=!1,showPercentage:f=!1,loading:o=!1})=>{const d=v.jsxs("div",{className:"flex w-full items-center pt-1",children:[v.jsx(Je,{color:e,iconSrc:i,loading:o,onClick:()=>{}}),v.jsxs("div",{className:"flex flex-col ml-3 flex-1",children:[v.jsxs("div",{className:"flex justify-between mb-1 items-end",children:[n&&(o?v.jsx("p",{className:"h-4 w-16 font-gabaritoMedium my-1 rounded-sm animate-pulse",style:{backgroundColor:"#F1F1F1",border:"1px solid #e9e9e9"}}):v.jsx("p",{className:"text-sec text-md",children:n})),f&&v.jsxs("span",{className:"text-base text-gray-500",children:[a,"%"]})]}),o?v.jsx("div",{className:"relative w-full h-4 rounded-2xl overflow-hidden animate-pulse",style:{backgroundColor:"#F1F1F1"}}):v.jsx("div",{className:"relative w-full h-4 rounded-2xl overflow-hidden",style:{backgroundColor:Fn.Gray.value},children:v.jsx("div",{className:"absolute top-0 left-0 h-full rounded-2xl transition-all duration-300",style:{width:`${a}%`,backgroundColor:"#FFC801",boxShadow:"0 1px 2px #CC9F00"}})})]})]});return s?v.jsx(Ze,{children:d}):d},ef=({color:e="lightBlue"})=>{const[i,n]=Y.useState(!1),a={lightBlue:"bg-blue-500",amber:"bg-amber-500",cyan:"bg-cyan-500"},s=f=>{n(f.target.checked)};return v.jsxs("div",{className:"inline-block relative w-12 h-6",children:[v.jsx("input",{checked:i,onChange:s,className:"absolute opacity-0 w-0 h-0",id:`react-switch-${e}`,type:"checkbox"}),v.jsx("label",{className:"block overflow-hidden h-6 rounded-full cursor-pointer bg-gray-300",htmlFor:`react-switch-${e}`,children:v.jsx("span",{className:`block h-6 w-6 rounded-full shadow transform transition-transform duration-200 ${i?`translate-x-full ${a[e]}`:"bg-white"}`})})]})},nf=({color:e="amber",completed:i,size:n=20,loading:a=!1})=>{const s=Pi[e];return a?v.jsx("div",{className:"rounded-full animate-pulse",style:{width:n,height:n,backgroundColor:"#F1F1F1",border:"1px solid #e9e9e9"}}):i?v.jsx("div",{className:"flex items-center justify-center border-[1px] rounded-full",style:{width:n,height:n,backgroundColor:s?.value,borderColor:s?.dark},children:v.jsx("img",{src:"src/assets/icons/check.svg",alt:"Icon",width:n*.8,height:n*.8,className:"inline select-none pointer-events-none"})}):v.jsx("div",{className:"border-[1px] rounded-full",style:{width:n,height:n,backgroundColor:"#E5E5E5",borderColor:"#ccc"}})},af=({label:e="",color:i="amber",records:n={},emojiId:a="pancakes",loading:s=!1})=>v.jsxs("div",{className:"flex w-full rounded-lg pt-1",children:[v.jsx(Je,{emojiId:a,color:i,loading:s,onClick:()=>{}}),v.jsxs("div",{className:"w-3/4 h-12 rounded-lg ml-2 flex flex-col justify-between",children:[s?v.jsx("p",{className:"h-4 w-16 mt-1 rounded-sm",style:{backgroundColor:"#F1F1F1",border:"1px solid #e9e9e9"}}):v.jsx("p",{className:"text-sec mb-1",children:e}),v.jsx("div",{className:"flex space-x-2",children:Object.entries(n).map(([f,o])=>v.jsx(nf,{color:i,completed:o,loading:s}))})]})]}),ff=({profiles:e,loading:i=!1,buttonColor:n="lightBlue",buttonLabel:a="more"})=>v.jsx(Ze,{title:"Leaderboard",button:!0,buttonColor:n,buttonLabel:a,buttonSize:"small",children:v.jsx("section",{className:"flex flex-col space-y-2",children:i?[...Array(10)].map((s,f)=>v.jsxs("article",{className:"flex w-full rounded-md h-1/3 space-x-2 animate-pulse",children:[v.jsx("div",{className:"w-12 h-12 bg-[#F0F0F1] rounded-full"}),v.jsxs("div",{className:"flex flex-col w-3/4 space-y-2 justify-center",children:[v.jsx("span",{className:"h-4 bg-[#F0F0F1] rounded-sm w-1/2"}),v.jsx("span",{className:"h-4 bg-[#F0F0F1] rounded-sm w-4/5"})]})]},f)):e.map((s,f)=>v.jsxs("article",{className:`flex items-center py-1 rounded-lg cursor-pointer ${s.selected?"border-2 border-[#ffd700] bg-[#ffecb3] hover:border-[#FFC200] hover:bg-[#FFE08A]":"hover:bg-gray-100 hover:cursor-pointer"}`,children:[v.jsx("p",{className:"text-lg font-bold text-sec w-4",children:f+1}),v.jsx("div",{className:"ml-2 w-10 h-10 bg-gray-300 rounded-full overflow-hidden",children:v.jsx("img",{src:s.avatarUrl,alt:`${s.username} avatar`,className:"inline select-none pointer-events-none object-cover"})}),v.jsx("p",{className:"ml-2 flex-grow text-lg font-gabaritoMedium text-sec",children:s.username}),v.jsxs("p",{className:"text-sm font-regular text-sec",children:[s.xp," XP"]})]},f))})});exports.Button=We;exports.Card=Ze;exports.Leaderboard=ff;exports.ProgressBar=Qa;exports.Toggle=ef;exports.WeekStreak=af;
722
+ `,children:[(e||i||f&&d==="top-right")&&v.jsxs(bn,{className:"mb-4 flex items-start justify-between",children:[v.jsxs("div",{className:"flex items-center gap-3",children:[a&&v.jsx(Je,{color:r,iconSrc:a,onClick:()=>{}}),v.jsxs("div",{children:[e&&v.jsx(wn,{className:"text-main text-xl font-gabaritoBold font-medium leading-5 sm:text-lg md:text-xl",children:e}),i&&v.jsx(pn,{className:"text-sm sm:text-base text-gray-600",children:i})]})]}),f&&d==="top-right"&&v.jsx(We,{label:o,size:m,onClick:k,color:l,variant:t})]}),n&&v.jsx(yn,{className:"flex flex-col gap-4 font-regular h-full",children:n}),f&&d==="bottom-right"&&v.jsx(_n,{className:"flex justify-end pt-2",children:v.jsx(We,{label:o,size:m,onClick:k,color:l,variant:t})})]})},Qa=({bgIconColor:e="amber",iconSrc:i="",label:n="",percentage:a=0,showCard:s=!1,showPercentage:f=!1,loading:o=!1})=>{const d=v.jsxs("div",{className:"flex w-full items-center pt-1",children:[v.jsx(Je,{color:e,iconSrc:i,loading:o,onClick:()=>{}}),v.jsxs("div",{className:"flex flex-col ml-3 flex-1",children:[v.jsxs("div",{className:"flex justify-between mb-1 items-end",children:[n&&(o?v.jsx("p",{className:"h-4 w-16 font-gabaritoMedium my-1 rounded-sm animate-pulse",style:{backgroundColor:"#F1F1F1",border:"1px solid #e9e9e9"}}):v.jsx("p",{className:"text-sec text-md",children:n})),f&&v.jsxs("span",{className:"text-base text-gray-500",children:[a,"%"]})]}),o?v.jsx("div",{className:"relative w-full h-4 rounded-2xl overflow-hidden animate-pulse",style:{backgroundColor:"#F1F1F1"}}):v.jsx("div",{className:"relative w-full h-4 rounded-2xl overflow-hidden",style:{backgroundColor:Fn.Gray.value},children:v.jsx("div",{className:"absolute top-0 left-0 h-full rounded-2xl transition-all duration-300",style:{width:`${a}%`,backgroundColor:"#FFC801",boxShadow:"0 1px 2px #CC9F00"}})})]})]});return s?v.jsx(Ze,{children:d}):d},ef=({color:e="lightBlue"})=>{const[i,n]=Y.useState(!1),a={lightBlue:"bg-blue-500",amber:"bg-amber-500",cyan:"bg-cyan-500"},s=f=>{n(f.target.checked)};return v.jsxs("div",{className:"inline-block relative w-12 h-6",children:[v.jsx("input",{checked:i,onChange:s,className:"absolute opacity-0 w-0 h-0",id:`react-switch-${e}`,type:"checkbox"}),v.jsx("label",{className:"block overflow-hidden h-6 rounded-full cursor-pointer bg-gray-300",htmlFor:`react-switch-${e}`,children:v.jsx("span",{className:`block h-6 w-6 rounded-full shadow transform transition-transform duration-200 ${i?`translate-x-full ${a[e]}`:"bg-white"}`})})]})},nf=({color:e="amber",completed:i,size:n=20,loading:a=!1})=>{const s=Pi[e];return a?v.jsx("div",{className:"rounded-full animate-pulse",style:{width:n,height:n,backgroundColor:"#F1F1F1",border:"1px solid #e9e9e9"}}):i?v.jsx("div",{className:"flex items-center justify-center border-[1px] rounded-full",style:{width:n,height:n,backgroundColor:s?.value,borderColor:s?.dark},children:v.jsx("img",{src:"src/assets/icons/check.svg",alt:"Icon",width:n*.8,height:n*.8,className:"inline select-none pointer-events-none"})}):v.jsx("div",{className:"border-[1px] rounded-full",style:{width:n,height:n,backgroundColor:"#E5E5E5",borderColor:"#ccc"}})},af=({label:e="",color:i="amber",records:n={},emojiId:a="pancakes",loading:s=!1})=>v.jsxs("div",{className:"flex w-full rounded-lg pt-1",children:[v.jsx(Je,{emojiId:a,color:i,loading:s,onClick:()=>{}}),v.jsxs("div",{className:"w-3/4 h-12 rounded-lg ml-2 flex flex-col justify-between",children:[s?v.jsx("p",{className:"h-4 w-16 mt-1 rounded-sm",style:{backgroundColor:"#F1F1F1",border:"1px solid #e9e9e9"}}):v.jsx("p",{className:"text-sec mb-1",children:e}),v.jsx("div",{className:"flex space-x-2",children:Object.entries(n).map(([f,o])=>v.jsx(nf,{color:i,completed:o,loading:s}))})]})]}),ff=({profiles:e,loading:i=!1,buttonColor:n="lightBlue",buttonLabel:a="more",customClass:s=""})=>v.jsx(Ze,{title:"Leaderboard",button:!0,buttonColor:n,buttonLabel:a,buttonSize:"small",customClass:s,children:v.jsx("section",{className:"flex flex-col space-y-2",children:i?[...Array(10)].map((f,o)=>v.jsxs("article",{className:"flex w-full rounded-md h-1/3 space-x-2 animate-pulse",children:[v.jsx("div",{className:"w-12 h-12 bg-[#F0F0F1] rounded-full"}),v.jsxs("div",{className:"flex flex-col w-3/4 space-y-2 justify-center",children:[v.jsx("span",{className:"h-4 bg-[#F0F0F1] rounded-sm w-1/2"}),v.jsx("span",{className:"h-4 bg-[#F0F0F1] rounded-sm w-4/5"})]})]},o)):e.map((f,o)=>v.jsxs("article",{className:`flex items-center py-1 rounded-lg cursor-pointer ${f.selected?"border-2 border-[#ffd700] bg-[#ffecb3] hover:border-[#FFC200] hover:bg-[#FFE08A]":"hover:bg-gray-100 hover:cursor-pointer"}`,children:[v.jsx("p",{className:"text-lg font-bold text-sec w-4",children:o+1}),v.jsx("div",{className:"ml-2 w-10 h-10 bg-gray-300 rounded-full overflow-hidden",children:v.jsx("img",{src:f.avatarUrl,alt:`${f.username} avatar`,className:"inline select-none pointer-events-none object-cover"})}),v.jsx("p",{className:"ml-2 flex-grow text-lg font-gabaritoMedium text-sec",children:f.username}),v.jsxs("p",{className:"text-sm font-regular text-sec",children:[f.xp," XP"]})]},o))})});exports.Button=We;exports.Card=Ze;exports.Leaderboard=ff;exports.ProgressBar=Qa;exports.Toggle=ef;exports.WeekStreak=af;
package/dist/ui.es.js CHANGED
@@ -6141,7 +6141,8 @@ const Cn = ({
6141
6141
  profiles: e,
6142
6142
  loading: i = !1,
6143
6143
  buttonColor: n = "lightBlue",
6144
- buttonLabel: a = "more"
6144
+ buttonLabel: a = "more",
6145
+ customClass: s = ""
6145
6146
  }) => /* @__PURE__ */ w(
6146
6147
  Cn,
6147
6148
  {
@@ -6150,7 +6151,8 @@ const Cn = ({
6150
6151
  buttonColor: n,
6151
6152
  buttonLabel: a,
6152
6153
  buttonSize: "small",
6153
- children: /* @__PURE__ */ w("section", { className: "flex flex-col space-y-2", children: i ? [...Array(10)].map((s, f) => /* @__PURE__ */ P(
6154
+ customClass: s,
6155
+ children: /* @__PURE__ */ w("section", { className: "flex flex-col space-y-2", children: i ? [...Array(10)].map((f, o) => /* @__PURE__ */ P(
6154
6156
  "article",
6155
6157
  {
6156
6158
  className: "flex w-full rounded-md h-1/3 space-x-2 animate-pulse",
@@ -6162,29 +6164,29 @@ const Cn = ({
6162
6164
  ] })
6163
6165
  ]
6164
6166
  },
6165
- f
6166
- )) : e.map((s, f) => /* @__PURE__ */ P(
6167
+ o
6168
+ )) : e.map((f, o) => /* @__PURE__ */ P(
6167
6169
  "article",
6168
6170
  {
6169
- className: `flex items-center py-1 rounded-lg cursor-pointer ${s.selected ? "border-2 border-[#ffd700] bg-[#ffecb3] hover:border-[#FFC200] hover:bg-[#FFE08A]" : "hover:bg-gray-100 hover:cursor-pointer"}`,
6171
+ className: `flex items-center py-1 rounded-lg cursor-pointer ${f.selected ? "border-2 border-[#ffd700] bg-[#ffecb3] hover:border-[#FFC200] hover:bg-[#FFE08A]" : "hover:bg-gray-100 hover:cursor-pointer"}`,
6170
6172
  children: [
6171
- /* @__PURE__ */ w("p", { className: "text-lg font-bold text-sec w-4", children: f + 1 }),
6173
+ /* @__PURE__ */ w("p", { className: "text-lg font-bold text-sec w-4", children: o + 1 }),
6172
6174
  /* @__PURE__ */ w("div", { className: "ml-2 w-10 h-10 bg-gray-300 rounded-full overflow-hidden", children: /* @__PURE__ */ w(
6173
6175
  "img",
6174
6176
  {
6175
- src: s.avatarUrl,
6176
- alt: `${s.username} avatar`,
6177
+ src: f.avatarUrl,
6178
+ alt: `${f.username} avatar`,
6177
6179
  className: "inline select-none pointer-events-none object-cover"
6178
6180
  }
6179
6181
  ) }),
6180
- /* @__PURE__ */ w("p", { className: "ml-2 flex-grow text-lg font-gabaritoMedium text-sec", children: s.username }),
6182
+ /* @__PURE__ */ w("p", { className: "ml-2 flex-grow text-lg font-gabaritoMedium text-sec", children: f.username }),
6181
6183
  /* @__PURE__ */ P("p", { className: "text-sm font-regular text-sec", children: [
6182
- s.xp,
6184
+ f.xp,
6183
6185
  " XP"
6184
6186
  ] })
6185
6187
  ]
6186
6188
  },
6187
- f
6189
+ o
6188
6190
  )) })
6189
6191
  }
6190
6192
  );
package/dist/ui.umd.js CHANGED
@@ -719,4 +719,4 @@ button {
719
719
  px-4 sm:px-6 py-4 sm:py-6 rounded-xl
720
720
  flex flex-col relative
721
721
  ${s}
722
- `,children:[(e||i||f&&d==="top-right")&&v.jsxs(un,{className:"mb-4 flex items-start justify-between",children:[v.jsxs("div",{className:"flex items-center gap-3",children:[a&&v.jsx(Ne,{color:r,iconSrc:a,onClick:()=>{}}),v.jsxs("div",{children:[e&&v.jsx(cn,{className:"text-main text-xl font-gabaritoBold font-medium leading-5 sm:text-lg md:text-xl",children:e}),i&&v.jsx(vn,{className:"text-sm sm:text-base text-gray-600",children:i})]})]}),f&&d==="top-right"&&v.jsx(Be,{label:o,size:m,onClick:k,color:l,variant:t})]}),n&&v.jsx(mn,{className:"flex flex-col gap-4 font-regular h-full",children:n}),f&&d==="bottom-right"&&v.jsx(kn,{className:"flex justify-end pt-2",children:v.jsx(Be,{label:o,size:m,onClick:k,color:l,variant:t})})]})},Ua=({bgIconColor:e="amber",iconSrc:i="",label:n="",percentage:a=0,showCard:s=!1,showPercentage:f=!1,loading:o=!1})=>{const d=v.jsxs("div",{className:"flex w-full items-center pt-1",children:[v.jsx(Ne,{color:e,iconSrc:i,loading:o,onClick:()=>{}}),v.jsxs("div",{className:"flex flex-col ml-3 flex-1",children:[v.jsxs("div",{className:"flex justify-between mb-1 items-end",children:[n&&(o?v.jsx("p",{className:"h-4 w-16 font-gabaritoMedium my-1 rounded-sm animate-pulse",style:{backgroundColor:"#F1F1F1",border:"1px solid #e9e9e9"}}):v.jsx("p",{className:"text-sec text-md",children:n})),f&&v.jsxs("span",{className:"text-base text-gray-500",children:[a,"%"]})]}),o?v.jsx("div",{className:"relative w-full h-4 rounded-2xl overflow-hidden animate-pulse",style:{backgroundColor:"#F1F1F1"}}):v.jsx("div",{className:"relative w-full h-4 rounded-2xl overflow-hidden",style:{backgroundColor:Sn.Gray.value},children:v.jsx("div",{className:"absolute top-0 left-0 h-full rounded-2xl transition-all duration-300",style:{width:`${a}%`,backgroundColor:"#FFC801",boxShadow:"0 1px 2px #CC9F00"}})})]})]});return s?v.jsx(Je,{children:d}):d},Ka=({color:e="lightBlue"})=>{const[i,n]=K.useState(!1),a={lightBlue:"bg-blue-500",amber:"bg-amber-500",cyan:"bg-cyan-500"},s=f=>{n(f.target.checked)};return v.jsxs("div",{className:"inline-block relative w-12 h-6",children:[v.jsx("input",{checked:i,onChange:s,className:"absolute opacity-0 w-0 h-0",id:`react-switch-${e}`,type:"checkbox"}),v.jsx("label",{className:"block overflow-hidden h-6 rounded-full cursor-pointer bg-gray-300",htmlFor:`react-switch-${e}`,children:v.jsx("span",{className:`block h-6 w-6 rounded-full shadow transform transition-transform duration-200 ${i?`translate-x-full ${a[e]}`:"bg-white"}`})})]})},Ja=({color:e="amber",completed:i,size:n=20,loading:a=!1})=>{const s=Qe[e];return a?v.jsx("div",{className:"rounded-full animate-pulse",style:{width:n,height:n,backgroundColor:"#F1F1F1",border:"1px solid #e9e9e9"}}):i?v.jsx("div",{className:"flex items-center justify-center border-[1px] rounded-full",style:{width:n,height:n,backgroundColor:s?.value,borderColor:s?.dark},children:v.jsx("img",{src:"src/assets/icons/check.svg",alt:"Icon",width:n*.8,height:n*.8,className:"inline select-none pointer-events-none"})}):v.jsx("div",{className:"border-[1px] rounded-full",style:{width:n,height:n,backgroundColor:"#E5E5E5",borderColor:"#ccc"}})},Ya=({label:e="",color:i="amber",records:n={},emojiId:a="pancakes",loading:s=!1})=>v.jsxs("div",{className:"flex w-full rounded-lg pt-1",children:[v.jsx(Ne,{emojiId:a,color:i,loading:s,onClick:()=>{}}),v.jsxs("div",{className:"w-3/4 h-12 rounded-lg ml-2 flex flex-col justify-between",children:[s?v.jsx("p",{className:"h-4 w-16 mt-1 rounded-sm",style:{backgroundColor:"#F1F1F1",border:"1px solid #e9e9e9"}}):v.jsx("p",{className:"text-sec mb-1",children:e}),v.jsx("div",{className:"flex space-x-2",children:Object.entries(n).map(([f,o])=>v.jsx(Ja,{color:i,completed:o,loading:s}))})]})]}),Za=({profiles:e,loading:i=!1,buttonColor:n="lightBlue",buttonLabel:a="more"})=>v.jsx(Je,{title:"Leaderboard",button:!0,buttonColor:n,buttonLabel:a,buttonSize:"small",children:v.jsx("section",{className:"flex flex-col space-y-2",children:i?[...Array(10)].map((s,f)=>v.jsxs("article",{className:"flex w-full rounded-md h-1/3 space-x-2 animate-pulse",children:[v.jsx("div",{className:"w-12 h-12 bg-[#F0F0F1] rounded-full"}),v.jsxs("div",{className:"flex flex-col w-3/4 space-y-2 justify-center",children:[v.jsx("span",{className:"h-4 bg-[#F0F0F1] rounded-sm w-1/2"}),v.jsx("span",{className:"h-4 bg-[#F0F0F1] rounded-sm w-4/5"})]})]},f)):e.map((s,f)=>v.jsxs("article",{className:`flex items-center py-1 rounded-lg cursor-pointer ${s.selected?"border-2 border-[#ffd700] bg-[#ffecb3] hover:border-[#FFC200] hover:bg-[#FFE08A]":"hover:bg-gray-100 hover:cursor-pointer"}`,children:[v.jsx("p",{className:"text-lg font-bold text-sec w-4",children:f+1}),v.jsx("div",{className:"ml-2 w-10 h-10 bg-gray-300 rounded-full overflow-hidden",children:v.jsx("img",{src:s.avatarUrl,alt:`${s.username} avatar`,className:"inline select-none pointer-events-none object-cover"})}),v.jsx("p",{className:"ml-2 flex-grow text-lg font-gabaritoMedium text-sec",children:s.username}),v.jsxs("p",{className:"text-sm font-regular text-sec",children:[s.xp," XP"]})]},f))})});T.Button=Be,T.Card=Je,T.Leaderboard=Za,T.ProgressBar=Ua,T.Toggle=Ka,T.WeekStreak=Ya,Object.defineProperty(T,Symbol.toStringTag,{value:"Module"})}));
722
+ `,children:[(e||i||f&&d==="top-right")&&v.jsxs(un,{className:"mb-4 flex items-start justify-between",children:[v.jsxs("div",{className:"flex items-center gap-3",children:[a&&v.jsx(Ne,{color:r,iconSrc:a,onClick:()=>{}}),v.jsxs("div",{children:[e&&v.jsx(cn,{className:"text-main text-xl font-gabaritoBold font-medium leading-5 sm:text-lg md:text-xl",children:e}),i&&v.jsx(vn,{className:"text-sm sm:text-base text-gray-600",children:i})]})]}),f&&d==="top-right"&&v.jsx(Be,{label:o,size:m,onClick:k,color:l,variant:t})]}),n&&v.jsx(mn,{className:"flex flex-col gap-4 font-regular h-full",children:n}),f&&d==="bottom-right"&&v.jsx(kn,{className:"flex justify-end pt-2",children:v.jsx(Be,{label:o,size:m,onClick:k,color:l,variant:t})})]})},Ua=({bgIconColor:e="amber",iconSrc:i="",label:n="",percentage:a=0,showCard:s=!1,showPercentage:f=!1,loading:o=!1})=>{const d=v.jsxs("div",{className:"flex w-full items-center pt-1",children:[v.jsx(Ne,{color:e,iconSrc:i,loading:o,onClick:()=>{}}),v.jsxs("div",{className:"flex flex-col ml-3 flex-1",children:[v.jsxs("div",{className:"flex justify-between mb-1 items-end",children:[n&&(o?v.jsx("p",{className:"h-4 w-16 font-gabaritoMedium my-1 rounded-sm animate-pulse",style:{backgroundColor:"#F1F1F1",border:"1px solid #e9e9e9"}}):v.jsx("p",{className:"text-sec text-md",children:n})),f&&v.jsxs("span",{className:"text-base text-gray-500",children:[a,"%"]})]}),o?v.jsx("div",{className:"relative w-full h-4 rounded-2xl overflow-hidden animate-pulse",style:{backgroundColor:"#F1F1F1"}}):v.jsx("div",{className:"relative w-full h-4 rounded-2xl overflow-hidden",style:{backgroundColor:Sn.Gray.value},children:v.jsx("div",{className:"absolute top-0 left-0 h-full rounded-2xl transition-all duration-300",style:{width:`${a}%`,backgroundColor:"#FFC801",boxShadow:"0 1px 2px #CC9F00"}})})]})]});return s?v.jsx(Je,{children:d}):d},Ka=({color:e="lightBlue"})=>{const[i,n]=K.useState(!1),a={lightBlue:"bg-blue-500",amber:"bg-amber-500",cyan:"bg-cyan-500"},s=f=>{n(f.target.checked)};return v.jsxs("div",{className:"inline-block relative w-12 h-6",children:[v.jsx("input",{checked:i,onChange:s,className:"absolute opacity-0 w-0 h-0",id:`react-switch-${e}`,type:"checkbox"}),v.jsx("label",{className:"block overflow-hidden h-6 rounded-full cursor-pointer bg-gray-300",htmlFor:`react-switch-${e}`,children:v.jsx("span",{className:`block h-6 w-6 rounded-full shadow transform transition-transform duration-200 ${i?`translate-x-full ${a[e]}`:"bg-white"}`})})]})},Ja=({color:e="amber",completed:i,size:n=20,loading:a=!1})=>{const s=Qe[e];return a?v.jsx("div",{className:"rounded-full animate-pulse",style:{width:n,height:n,backgroundColor:"#F1F1F1",border:"1px solid #e9e9e9"}}):i?v.jsx("div",{className:"flex items-center justify-center border-[1px] rounded-full",style:{width:n,height:n,backgroundColor:s?.value,borderColor:s?.dark},children:v.jsx("img",{src:"src/assets/icons/check.svg",alt:"Icon",width:n*.8,height:n*.8,className:"inline select-none pointer-events-none"})}):v.jsx("div",{className:"border-[1px] rounded-full",style:{width:n,height:n,backgroundColor:"#E5E5E5",borderColor:"#ccc"}})},Ya=({label:e="",color:i="amber",records:n={},emojiId:a="pancakes",loading:s=!1})=>v.jsxs("div",{className:"flex w-full rounded-lg pt-1",children:[v.jsx(Ne,{emojiId:a,color:i,loading:s,onClick:()=>{}}),v.jsxs("div",{className:"w-3/4 h-12 rounded-lg ml-2 flex flex-col justify-between",children:[s?v.jsx("p",{className:"h-4 w-16 mt-1 rounded-sm",style:{backgroundColor:"#F1F1F1",border:"1px solid #e9e9e9"}}):v.jsx("p",{className:"text-sec mb-1",children:e}),v.jsx("div",{className:"flex space-x-2",children:Object.entries(n).map(([f,o])=>v.jsx(Ja,{color:i,completed:o,loading:s}))})]})]}),Za=({profiles:e,loading:i=!1,buttonColor:n="lightBlue",buttonLabel:a="more",customClass:s=""})=>v.jsx(Je,{title:"Leaderboard",button:!0,buttonColor:n,buttonLabel:a,buttonSize:"small",customClass:s,children:v.jsx("section",{className:"flex flex-col space-y-2",children:i?[...Array(10)].map((f,o)=>v.jsxs("article",{className:"flex w-full rounded-md h-1/3 space-x-2 animate-pulse",children:[v.jsx("div",{className:"w-12 h-12 bg-[#F0F0F1] rounded-full"}),v.jsxs("div",{className:"flex flex-col w-3/4 space-y-2 justify-center",children:[v.jsx("span",{className:"h-4 bg-[#F0F0F1] rounded-sm w-1/2"}),v.jsx("span",{className:"h-4 bg-[#F0F0F1] rounded-sm w-4/5"})]})]},o)):e.map((f,o)=>v.jsxs("article",{className:`flex items-center py-1 rounded-lg cursor-pointer ${f.selected?"border-2 border-[#ffd700] bg-[#ffecb3] hover:border-[#FFC200] hover:bg-[#FFE08A]":"hover:bg-gray-100 hover:cursor-pointer"}`,children:[v.jsx("p",{className:"text-lg font-bold text-sec w-4",children:o+1}),v.jsx("div",{className:"ml-2 w-10 h-10 bg-gray-300 rounded-full overflow-hidden",children:v.jsx("img",{src:f.avatarUrl,alt:`${f.username} avatar`,className:"inline select-none pointer-events-none object-cover"})}),v.jsx("p",{className:"ml-2 flex-grow text-lg font-gabaritoMedium text-sec",children:f.username}),v.jsxs("p",{className:"text-sm font-regular text-sec",children:[f.xp," XP"]})]},o))})});T.Button=Be,T.Card=Je,T.Leaderboard=Za,T.ProgressBar=Ua,T.Toggle=Ka,T.WeekStreak=Ya,Object.defineProperty(T,Symbol.toStringTag,{value:"Module"})}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-ui-lib",
3
- "version": "0.1.33",
3
+ "version": "0.1.34",
4
4
  "type": "module",
5
5
  "types": "dist/index.d.ts",
6
6
  "exports": {