@jamsrui/avatar 0.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.
Files changed (56) hide show
  1. package/README.md +40 -0
  2. package/dist/avatar-6BB4Uuc1.d.ts +35 -0
  3. package/dist/avatar-CYA1oDzH.d.mts +35 -0
  4. package/dist/avatar-config.d.mts +19 -0
  5. package/dist/avatar-config.d.ts +19 -0
  6. package/dist/avatar-config.js +1 -0
  7. package/dist/avatar-config.mjs +1 -0
  8. package/dist/avatar-context.d.mts +16 -0
  9. package/dist/avatar-context.d.ts +16 -0
  10. package/dist/avatar-context.js +1 -0
  11. package/dist/avatar-context.mjs +1 -0
  12. package/dist/avatar-fallback.d.mts +10 -0
  13. package/dist/avatar-fallback.d.ts +10 -0
  14. package/dist/avatar-fallback.js +1 -0
  15. package/dist/avatar-fallback.mjs +1 -0
  16. package/dist/avatar-img.d.mts +10 -0
  17. package/dist/avatar-img.d.ts +10 -0
  18. package/dist/avatar-img.js +1 -0
  19. package/dist/avatar-img.mjs +1 -0
  20. package/dist/avatar.d.mts +7 -0
  21. package/dist/avatar.d.ts +7 -0
  22. package/dist/avatar.js +1 -0
  23. package/dist/avatar.mjs +1 -0
  24. package/dist/chunk-2PZ2EQYL.mjs +1 -0
  25. package/dist/chunk-3PXJHT2I.mjs +1 -0
  26. package/dist/chunk-66YE63BY.mjs +1 -0
  27. package/dist/chunk-6YOKQYAL.js +1 -0
  28. package/dist/chunk-AJJHRECE.js +1 -0
  29. package/dist/chunk-E37RG5B5.js +1 -0
  30. package/dist/chunk-G5QLB3IV.js +1 -0
  31. package/dist/chunk-GXVNM3CJ.mjs +1 -0
  32. package/dist/chunk-IIR3HXSG.js +1 -0
  33. package/dist/chunk-KQ4XRJDH.js +1 -0
  34. package/dist/chunk-NMBSOBOU.js +1 -0
  35. package/dist/chunk-NMVVIIUJ.mjs +1 -0
  36. package/dist/chunk-NZUTFQXP.js +1 -0
  37. package/dist/chunk-TSGQ56WY.mjs +1 -0
  38. package/dist/chunk-VPCQCOSP.mjs +1 -0
  39. package/dist/chunk-W3QSAO35.mjs +1 -0
  40. package/dist/index.d.mts +9 -0
  41. package/dist/index.d.ts +9 -0
  42. package/dist/index.js +1 -0
  43. package/dist/index.mjs +1 -0
  44. package/dist/styles.d.mts +189 -0
  45. package/dist/styles.d.ts +189 -0
  46. package/dist/styles.js +1 -0
  47. package/dist/styles.mjs +1 -0
  48. package/dist/use-avatar.d.mts +7 -0
  49. package/dist/use-avatar.d.ts +7 -0
  50. package/dist/use-avatar.js +1 -0
  51. package/dist/use-avatar.mjs +1 -0
  52. package/dist/utils.d.mts +12 -0
  53. package/dist/utils.d.ts +12 -0
  54. package/dist/utils.js +1 -0
  55. package/dist/utils.mjs +1 -0
  56. package/package.json +49 -0
package/README.md ADDED
@@ -0,0 +1,40 @@
1
+ # πŸš€ **JamsrUI**
2
+
3
+ **A comprehensive React UI component library designed for developers, with Tailwind CSS integration for seamless styling.**
4
+
5
+
6
+ ## πŸ“– **Overview**
7
+
8
+ [JamsrUI](https://jamsr-ui.jamsrworld.com) is designed to help developers build modern, fast and visually appealing web applications with ease.
9
+
10
+ ## πŸš€ Getting Started
11
+
12
+ Boost & Build your websites using [JamsrUI](https://jamsr-ui.jamsrworld.com).
13
+
14
+ ## ✨ Features
15
+
16
+ - πŸš€ **Production-Ready**: Optimized for modern React projects.
17
+ - 🎨 **Customizable**: Easily override styles and themes.
18
+ - πŸ› οΈ **Reusable Components**: Save time with prebuilt, efficient UI elements.
19
+ - ⚑ **Developer-Friendly**: Simple API and well-documented usage.
20
+ - πŸ“¦ **Lightweight**: Minimal dependencies for fast performance.
21
+ - πŸ–₯️ **Modern Design**: Clean, responsive, and user-friendly components.
22
+
23
+ ## 🌱 Community
24
+
25
+ We’re thrilled to see the community actively engage with **JamsrUI**! Whether you're sharing feedback, reporting bugs, requesting features, or showcasing projects built with JamsrUI, your involvement helps us grow and improve.
26
+
27
+ ### How to Engage
28
+
29
+ - πŸ’¬ **Report Bugs**: [GitHub Issues](https://github.com/jamsrworld/jamsr-ui/issues)
30
+ - πŸš€ **Request Features**: Share ideas for new components.
31
+ - 🀝 **Showcase Projects**: Let us know how you use JamsrUI.
32
+
33
+ ## Contributing
34
+
35
+ We welcome contributions from developers of all skill levels!
36
+
37
+ ## ⭐ Support the Project
38
+
39
+ If you find **JamsrUI** helpful, consider giving it a ⭐ on [GitHub](https://github.com/jamsrworld/jamsr-ui).
40
+
@@ -0,0 +1,35 @@
1
+ import * as react from 'react';
2
+ import { PropGetter, UIProps, SlotsToClassNames } from '@jamsrui/utils';
3
+ import { AvatarFallback } from './avatar-fallback.js';
4
+ import { AvatarImage } from './avatar-img.js';
5
+ import { AvatarVariants, AvatarSlots } from './styles.js';
6
+
7
+ declare const useAvatar: (props: useAvatar.Props) => {
8
+ getRootProps: PropGetter<Avatar.Props>;
9
+ getImgProps: PropGetter<AvatarImage.Props>;
10
+ getFallbackProps: PropGetter<AvatarFallback.Props>;
11
+ fallBackString: string;
12
+ hasImage: number | boolean;
13
+ };
14
+ declare namespace useAvatar {
15
+ interface Props extends AvatarVariants, UIProps<"img"> {
16
+ fallback?: string | ((_: {
17
+ alt: string;
18
+ name?: string;
19
+ }) => string);
20
+ classNames?: SlotsToClassNames<AvatarSlots>;
21
+ slotProps?: {
22
+ root?: Omit<Avatar.Props, "classNames" | "slotProps">;
23
+ fallback?: AvatarFallback.Props;
24
+ };
25
+ name?: string;
26
+ }
27
+ }
28
+
29
+ declare const Avatar: (props: Avatar.Props) => react.JSX.Element;
30
+ declare namespace Avatar {
31
+ interface Props extends useAvatar.Props {
32
+ }
33
+ }
34
+
35
+ export { Avatar as A, useAvatar as u };
@@ -0,0 +1,35 @@
1
+ import * as react from 'react';
2
+ import { PropGetter, UIProps, SlotsToClassNames } from '@jamsrui/utils';
3
+ import { AvatarFallback } from './avatar-fallback.mjs';
4
+ import { AvatarImage } from './avatar-img.mjs';
5
+ import { AvatarVariants, AvatarSlots } from './styles.mjs';
6
+
7
+ declare const useAvatar: (props: useAvatar.Props) => {
8
+ getRootProps: PropGetter<Avatar.Props>;
9
+ getImgProps: PropGetter<AvatarImage.Props>;
10
+ getFallbackProps: PropGetter<AvatarFallback.Props>;
11
+ fallBackString: string;
12
+ hasImage: number | boolean;
13
+ };
14
+ declare namespace useAvatar {
15
+ interface Props extends AvatarVariants, UIProps<"img"> {
16
+ fallback?: string | ((_: {
17
+ alt: string;
18
+ name?: string;
19
+ }) => string);
20
+ classNames?: SlotsToClassNames<AvatarSlots>;
21
+ slotProps?: {
22
+ root?: Omit<Avatar.Props, "classNames" | "slotProps">;
23
+ fallback?: AvatarFallback.Props;
24
+ };
25
+ name?: string;
26
+ }
27
+ }
28
+
29
+ declare const Avatar: (props: Avatar.Props) => react.JSX.Element;
30
+ declare namespace Avatar {
31
+ interface Props extends useAvatar.Props {
32
+ }
33
+ }
34
+
35
+ export { Avatar as A, useAvatar as u };
@@ -0,0 +1,19 @@
1
+ import { A as Avatar } from './avatar-CYA1oDzH.mjs';
2
+ import * as react from 'react';
3
+ import { GlobalConfigProps } from '@jamsrui/core';
4
+ import '@jamsrui/utils';
5
+ import './avatar-fallback.mjs';
6
+ import './avatar-img.mjs';
7
+ import './styles.mjs';
8
+ import 'tailwind-variants';
9
+
10
+ declare const useAvatarConfig: () => AvatarConfig.Props;
11
+ declare const AvatarConfig: (props: AvatarConfig.Props & {
12
+ merge?: boolean;
13
+ }) => react.JSX.Element;
14
+ declare namespace AvatarConfig {
15
+ interface Props extends Avatar.Props, GlobalConfigProps<Avatar.Props> {
16
+ }
17
+ }
18
+
19
+ export { AvatarConfig, useAvatarConfig };
@@ -0,0 +1,19 @@
1
+ import { A as Avatar } from './avatar-6BB4Uuc1.js';
2
+ import * as react from 'react';
3
+ import { GlobalConfigProps } from '@jamsrui/core';
4
+ import '@jamsrui/utils';
5
+ import './avatar-fallback.js';
6
+ import './avatar-img.js';
7
+ import './styles.js';
8
+ import 'tailwind-variants';
9
+
10
+ declare const useAvatarConfig: () => AvatarConfig.Props;
11
+ declare const AvatarConfig: (props: AvatarConfig.Props & {
12
+ merge?: boolean;
13
+ }) => react.JSX.Element;
14
+ declare namespace AvatarConfig {
15
+ interface Props extends Avatar.Props, GlobalConfigProps<Avatar.Props> {
16
+ }
17
+ }
18
+
19
+ export { AvatarConfig, useAvatarConfig };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkNMBSOBOUjs = require('./chunk-NMBSOBOU.js');exports.AvatarConfig = _chunkNMBSOBOUjs.a; exports.useAvatarConfig = _chunkNMBSOBOUjs.b;
@@ -0,0 +1 @@
1
+ import{a,b}from"./chunk-GXVNM3CJ.mjs";export{a as AvatarConfig,b as useAvatarConfig};
@@ -0,0 +1,16 @@
1
+ import * as react from 'react';
2
+ import { u as useAvatar } from './avatar-CYA1oDzH.mjs';
3
+ import '@jamsrui/utils';
4
+ import './avatar-fallback.mjs';
5
+ import './avatar-img.mjs';
6
+ import './styles.mjs';
7
+ import 'tailwind-variants';
8
+
9
+ declare const useAvatarContext: () => AvatarContext.Props;
10
+ declare const AvatarContext: react.Context<AvatarContext.Props | null>;
11
+ declare namespace AvatarContext {
12
+ interface Props extends ReturnType<typeof useAvatar> {
13
+ }
14
+ }
15
+
16
+ export { AvatarContext, useAvatarContext };
@@ -0,0 +1,16 @@
1
+ import * as react from 'react';
2
+ import { u as useAvatar } from './avatar-6BB4Uuc1.js';
3
+ import '@jamsrui/utils';
4
+ import './avatar-fallback.js';
5
+ import './avatar-img.js';
6
+ import './styles.js';
7
+ import 'tailwind-variants';
8
+
9
+ declare const useAvatarContext: () => AvatarContext.Props;
10
+ declare const AvatarContext: react.Context<AvatarContext.Props | null>;
11
+ declare namespace AvatarContext {
12
+ interface Props extends ReturnType<typeof useAvatar> {
13
+ }
14
+ }
15
+
16
+ export { AvatarContext, useAvatarContext };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkKQ4XRJDHjs = require('./chunk-KQ4XRJDH.js');exports.AvatarContext = _chunkKQ4XRJDHjs.a; exports.useAvatarContext = _chunkKQ4XRJDHjs.b;
@@ -0,0 +1 @@
1
+ import{a,b}from"./chunk-66YE63BY.mjs";export{a as AvatarContext,b as useAvatarContext};
@@ -0,0 +1,10 @@
1
+ import * as react from 'react';
2
+ import { UIProps } from '@jamsrui/utils';
3
+
4
+ declare const AvatarFallback: (props: AvatarFallback.Props) => react.ReactElement<unknown, string | react.JSXElementConstructor<any>> | null;
5
+ declare namespace AvatarFallback {
6
+ interface Props extends UIProps<"div"> {
7
+ }
8
+ }
9
+
10
+ export { AvatarFallback };
@@ -0,0 +1,10 @@
1
+ import * as react from 'react';
2
+ import { UIProps } from '@jamsrui/utils';
3
+
4
+ declare const AvatarFallback: (props: AvatarFallback.Props) => react.ReactElement<unknown, string | react.JSXElementConstructor<any>> | null;
5
+ declare namespace AvatarFallback {
6
+ interface Props extends UIProps<"div"> {
7
+ }
8
+ }
9
+
10
+ export { AvatarFallback };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkAJJHRECEjs = require('./chunk-AJJHRECE.js');require('./chunk-KQ4XRJDH.js');exports.AvatarFallback = _chunkAJJHRECEjs.a;
@@ -0,0 +1 @@
1
+ import{a}from"./chunk-W3QSAO35.mjs";import"./chunk-66YE63BY.mjs";export{a as AvatarFallback};
@@ -0,0 +1,10 @@
1
+ import * as react from 'react';
2
+ import { UIProps } from '@jamsrui/utils';
3
+
4
+ declare const AvatarImage: (props: AvatarImage.Props) => react.ReactElement<unknown, string | react.JSXElementConstructor<any>> | null;
5
+ declare namespace AvatarImage {
6
+ interface Props extends UIProps<"img"> {
7
+ }
8
+ }
9
+
10
+ export { AvatarImage };
@@ -0,0 +1,10 @@
1
+ import * as react from 'react';
2
+ import { UIProps } from '@jamsrui/utils';
3
+
4
+ declare const AvatarImage: (props: AvatarImage.Props) => react.ReactElement<unknown, string | react.JSXElementConstructor<any>> | null;
5
+ declare namespace AvatarImage {
6
+ interface Props extends UIProps<"img"> {
7
+ }
8
+ }
9
+
10
+ export { AvatarImage };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkIIR3HXSGjs = require('./chunk-IIR3HXSG.js');require('./chunk-KQ4XRJDH.js');exports.AvatarImage = _chunkIIR3HXSGjs.a;
@@ -0,0 +1 @@
1
+ import{a}from"./chunk-NMVVIIUJ.mjs";import"./chunk-66YE63BY.mjs";export{a as AvatarImage};
@@ -0,0 +1,7 @@
1
+ import 'react';
2
+ export { A as Avatar } from './avatar-CYA1oDzH.mjs';
3
+ import '@jamsrui/utils';
4
+ import './avatar-fallback.mjs';
5
+ import './avatar-img.mjs';
6
+ import './styles.mjs';
7
+ import 'tailwind-variants';
@@ -0,0 +1,7 @@
1
+ import 'react';
2
+ export { A as Avatar } from './avatar-6BB4Uuc1.js';
3
+ import '@jamsrui/utils';
4
+ import './avatar-fallback.js';
5
+ import './avatar-img.js';
6
+ import './styles.js';
7
+ import 'tailwind-variants';
package/dist/avatar.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkNZUTFQXPjs = require('./chunk-NZUTFQXP.js');require('./chunk-NMBSOBOU.js');require('./chunk-AJJHRECE.js');require('./chunk-IIR3HXSG.js');require('./chunk-KQ4XRJDH.js');require('./chunk-6YOKQYAL.js');require('./chunk-G5QLB3IV.js');require('./chunk-E37RG5B5.js');exports.Avatar = _chunkNZUTFQXPjs.a;
@@ -0,0 +1 @@
1
+ import{a}from"./chunk-VPCQCOSP.mjs";import"./chunk-GXVNM3CJ.mjs";import"./chunk-W3QSAO35.mjs";import"./chunk-NMVVIIUJ.mjs";import"./chunk-66YE63BY.mjs";import"./chunk-2PZ2EQYL.mjs";import"./chunk-3PXJHT2I.mjs";import"./chunk-TSGQ56WY.mjs";export{a as Avatar};
@@ -0,0 +1 @@
1
+ import{a as g}from"./chunk-3PXJHT2I.mjs";import{b as f}from"./chunk-TSGQ56WY.mjs";import{useCallback as l,useEffect as G,useMemo as V,useState as T}from"react";import{cn as v,dataAttrDev as c,mapPropsVariants as M,mergeProps as E}from"@jamsrui/utils";var B=F=>{let[x,P]=M(F,f.variantKeys),{classNames:t,slotProps:r,children:b,alt:s="",fallback:e,onError:k,name:A,src:m,...n}=x,N=typeof b=="string"&&g(b)||s.length>0&&g(s)||"",C=P.color??"default",o=f({...P,color:C}),[p,i]=T(m),u=p?.length??!1;G(()=>{i(m)},[m]);let d=l(a=>{k?.(a);let h=typeof e=="function"?e({alt:s,name:A}):e;i(h||void 0)},[s,e,A,k]),y=l(a=>({...E(r?.root,a),"data-slot":c("root"),"data-component":c("avatar"),className:o.root({className:v(r?.root?.className,t?.root,a.className)})}),[t?.root,r?.root,o]),S=l(()=>({draggable:"false",...n,"data-slot":c("img"),onError:d,src:p,alt:s,className:o.img({className:v(t?.img,n.className)})}),[s,t?.img,d,n,p,o]),I=l(a=>({...E(r?.fallback,a),"data-slot":c("fallback"),className:o.fallback({className:v(r?.fallback?.className,t?.fallback,a.className)})}),[t?.fallback,r?.fallback,o]);return V(()=>({getRootProps:y,getImgProps:S,getFallbackProps:I,fallBackString:N,hasImage:u}),[N,I,S,y,u])};export{B as a};
@@ -0,0 +1 @@
1
+ var t=r=>r.charAt(0).toUpperCase(),e=r=>["A","N","H","L","Q"].includes(r)?"primary":["F","G","T","I","J"].includes(r)?"secondary":["K","D","Y","B","O"].includes(r)?"success":["P","E","R","S","U"].includes(r)?"warning":["V","W","X","M","Z"].includes(r)?"danger":"default";export{t as a,e as b};
@@ -0,0 +1 @@
1
+ import{createContext as e,use as r}from"react";var a=e(null),n=()=>{let t=r(a);if(!t)throw new Error("useAvatarContext must be used within a AvatarContext");return t};export{a,n as b};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkG5QLB3IVjs = require('./chunk-G5QLB3IV.js');var _chunkE37RG5B5js = require('./chunk-E37RG5B5.js');var _react = require('react');var _utils = require('@jamsrui/utils');var B=F=>{let[x,P]=_utils.mapPropsVariants.call(void 0, F,_chunkE37RG5B5js.b.variantKeys),{classNames:t,slotProps:r,children:b,alt:s="",fallback:e,onError:k,name:A,src:m,...n}=x,N=typeof b=="string"&&_chunkG5QLB3IVjs.a.call(void 0, b)||s.length>0&&_chunkG5QLB3IVjs.a.call(void 0, s)||"",C=_nullishCoalesce(P.color, () => ("default")),o=_chunkE37RG5B5js.b.call(void 0, {...P,color:C}),[p,i]=_react.useState.call(void 0, m),u=_nullishCoalesce(_optionalChain([p, 'optionalAccess', _ => _.length]), () => (!1));_react.useEffect.call(void 0, ()=>{i(m)},[m]);let d=_react.useCallback.call(void 0, a=>{_optionalChain([k, 'optionalCall', _2 => _2(a)]);let h=typeof e=="function"?e({alt:s,name:A}):e;i(h||void 0)},[s,e,A,k]),y=_react.useCallback.call(void 0, a=>({..._utils.mergeProps.call(void 0, _optionalChain([r, 'optionalAccess', _3 => _3.root]),a),"data-slot":_utils.dataAttrDev.call(void 0, "root"),"data-component":_utils.dataAttrDev.call(void 0, "avatar"),className:o.root({className:_utils.cn.call(void 0, _optionalChain([r, 'optionalAccess', _4 => _4.root, 'optionalAccess', _5 => _5.className]),_optionalChain([t, 'optionalAccess', _6 => _6.root]),a.className)})}),[_optionalChain([t, 'optionalAccess', _7 => _7.root]),_optionalChain([r, 'optionalAccess', _8 => _8.root]),o]),S=_react.useCallback.call(void 0, ()=>({draggable:"false",...n,"data-slot":_utils.dataAttrDev.call(void 0, "img"),onError:d,src:p,alt:s,className:o.img({className:_utils.cn.call(void 0, _optionalChain([t, 'optionalAccess', _9 => _9.img]),n.className)})}),[s,_optionalChain([t, 'optionalAccess', _10 => _10.img]),d,n,p,o]),I=_react.useCallback.call(void 0, a=>({..._utils.mergeProps.call(void 0, _optionalChain([r, 'optionalAccess', _11 => _11.fallback]),a),"data-slot":_utils.dataAttrDev.call(void 0, "fallback"),className:o.fallback({className:_utils.cn.call(void 0, _optionalChain([r, 'optionalAccess', _12 => _12.fallback, 'optionalAccess', _13 => _13.className]),_optionalChain([t, 'optionalAccess', _14 => _14.fallback]),a.className)})}),[_optionalChain([t, 'optionalAccess', _15 => _15.fallback]),_optionalChain([r, 'optionalAccess', _16 => _16.fallback]),o]);return _react.useMemo.call(void 0, ()=>({getRootProps:y,getImgProps:S,getFallbackProps:I,fallBackString:N,hasImage:u}),[N,I,S,y,u])};exports.a = B;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkKQ4XRJDHjs = require('./chunk-KQ4XRJDH.js');var _hooks = require('@jamsrui/hooks');var _icons = require('@jamsrui/icons');var f=a=>{let{getFallbackProps:t,fallBackString:e,hasImage:o}=_chunkKQ4XRJDHjs.b.call(void 0, ),l=e||React.createElement(_icons.AvatarIcon,null),n=_hooks.useRenderElement.call(void 0, "div",{props:[t(a),{children:l}]});return o?null:n};exports.a = f;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _utils = require('@jamsrui/utils');var o="",a= exports.b =_utils.tv.call(void 0, {slots:{root:"relative flex-shrink-0 overflow-hidden rounded-full bg-surface object-cover text-md font-medium [&>img]:size-full [&>img]:object-cover",img:"select-none",fallback:"absolute inset-0 flex items-center justify-center"},variants:{size:{xs:{root:"size-6"},sm:{root:"size-8"},md:{root:"size-10"},lg:{root:"size-12"},xl:{root:"size-16"}},color:{default:{root:"bg-default text-default-foreground ring-default"},primary:{root:"bg-primary text-primary-foreground ring-primary"},secondary:{root:"bg-secondary text-secondary-foreground ring-secondary"},success:{root:"bg-success text-success-foreground ring-success"},warning:{root:"bg-warning text-warning-foreground ring-warning"},danger:{root:"bg-danger text-danger-foreground ring-danger"}},isBordered:{true:{root:"ring-2"},false:{root:"border-transparent"}},radius:_utils.radiusVariant.call(void 0, "base")},defaultVariants:{bordered:!1,size:"md",color:"default",radius:"full"}});exports.a = o; exports.b = a;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var t=r=>r.charAt(0).toUpperCase(),e= exports.b =r=>["A","N","H","L","Q"].includes(r)?"primary":["F","G","T","I","J"].includes(r)?"secondary":["K","D","Y","B","O"].includes(r)?"success":["P","E","R","S","U"].includes(r)?"warning":["V","W","X","M","Z"].includes(r)?"danger":"default";exports.a = t; exports.b = e;
@@ -0,0 +1 @@
1
+ import{createConfigContext as a}from"@jamsrui/utils";var[r,t]=a({displayName:"AvatarConfig"});export{r as a,t as b};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkKQ4XRJDHjs = require('./chunk-KQ4XRJDH.js');var _hooks = require('@jamsrui/hooks');var n=r=>{let{getImgProps:t,hasImage:o}=_chunkKQ4XRJDHjs.b.call(void 0, ),a=_hooks.useRenderElement.call(void 0, "img",{props:[t(r)]});return o?a:null};exports.a = n;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _react = require('react');var a=_react.createContext.call(void 0, null),n= exports.b =()=>{let t=_react.use.call(void 0, a);if(!t)throw new Error("useAvatarContext must be used within a AvatarContext");return t};exports.a = a; exports.b = n;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _utils = require('@jamsrui/utils');var[r,t]=_utils.createConfigContext.call(void 0, {displayName:"AvatarConfig"});exports.a = r; exports.b = t;
@@ -0,0 +1 @@
1
+ import{b as e}from"./chunk-66YE63BY.mjs";import{useRenderElement as m}from"@jamsrui/hooks";var n=r=>{let{getImgProps:t,hasImage:o}=e(),a=m("img",{props:[t(r)]});return o?a:null};export{n as a};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkNMBSOBOUjs = require('./chunk-NMBSOBOU.js');var _chunkAJJHRECEjs = require('./chunk-AJJHRECE.js');var _chunkIIR3HXSGjs = require('./chunk-IIR3HXSG.js');var _chunkKQ4XRJDHjs = require('./chunk-KQ4XRJDH.js');var _chunk6YOKQYALjs = require('./chunk-6YOKQYAL.js');var _hooks = require('@jamsrui/hooks');var _utils = require('@jamsrui/utils');var b=r=>{let{children:p}=r,t=_chunkNMBSOBOUjs.b.call(void 0, ),c=_utils.mergeConfigProps.call(void 0, t,t,r),o=_chunk6YOKQYALjs.a.call(void 0, c),{getRootProps:i}=o,v=React.createElement(React.Fragment,null,React.createElement(_chunkIIR3HXSGjs.a,null),React.createElement(_chunkAJJHRECEjs.a,null,p)),f=_hooks.useRenderElement.call(void 0, "div",{props:[i({}),{children:v}]});return React.createElement(_chunkKQ4XRJDHjs.a,{value:o},f)};exports.a = b;
@@ -0,0 +1 @@
1
+ import{radiusVariant as r,tv as e}from"@jamsrui/utils";var o="",a=e({slots:{root:"relative flex-shrink-0 overflow-hidden rounded-full bg-surface object-cover text-md font-medium [&>img]:size-full [&>img]:object-cover",img:"select-none",fallback:"absolute inset-0 flex items-center justify-center"},variants:{size:{xs:{root:"size-6"},sm:{root:"size-8"},md:{root:"size-10"},lg:{root:"size-12"},xl:{root:"size-16"}},color:{default:{root:"bg-default text-default-foreground ring-default"},primary:{root:"bg-primary text-primary-foreground ring-primary"},secondary:{root:"bg-secondary text-secondary-foreground ring-secondary"},success:{root:"bg-success text-success-foreground ring-success"},warning:{root:"bg-warning text-warning-foreground ring-warning"},danger:{root:"bg-danger text-danger-foreground ring-danger"}},isBordered:{true:{root:"ring-2"},false:{root:"border-transparent"}},radius:r("base")},defaultVariants:{bordered:!1,size:"md",color:"default",radius:"full"}});export{o as a,a as b};
@@ -0,0 +1 @@
1
+ import{b as e}from"./chunk-GXVNM3CJ.mjs";import{a as n}from"./chunk-W3QSAO35.mjs";import{a as m}from"./chunk-NMVVIIUJ.mjs";import{a}from"./chunk-66YE63BY.mjs";import{a as s}from"./chunk-2PZ2EQYL.mjs";import{useRenderElement as A}from"@jamsrui/hooks";import{mergeConfigProps as l}from"@jamsrui/utils";var b=r=>{let{children:p}=r,t=e(),c=l(t,t,r),o=s(c),{getRootProps:i}=o,v=React.createElement(React.Fragment,null,React.createElement(m,null),React.createElement(n,null,p)),f=A("div",{props:[i({}),{children:v}]});return React.createElement(a,{value:o},f)};export{b as a};
@@ -0,0 +1 @@
1
+ import{b as r}from"./chunk-66YE63BY.mjs";import{useRenderElement as s}from"@jamsrui/hooks";import{AvatarIcon as p}from"@jamsrui/icons";var f=a=>{let{getFallbackProps:t,fallBackString:e,hasImage:o}=r(),l=e||React.createElement(p,null),n=s("div",{props:[t(a),{children:l}]});return o?null:n};export{f as a};
@@ -0,0 +1,9 @@
1
+ export { A as Avatar } from './avatar-CYA1oDzH.mjs';
2
+ export { AvatarConfig, useAvatarConfig } from './avatar-config.mjs';
3
+ import 'react';
4
+ import '@jamsrui/utils';
5
+ import './avatar-fallback.mjs';
6
+ import './avatar-img.mjs';
7
+ import './styles.mjs';
8
+ import 'tailwind-variants';
9
+ import '@jamsrui/core';
@@ -0,0 +1,9 @@
1
+ export { A as Avatar } from './avatar-6BB4Uuc1.js';
2
+ export { AvatarConfig, useAvatarConfig } from './avatar-config.js';
3
+ import 'react';
4
+ import '@jamsrui/utils';
5
+ import './avatar-fallback.js';
6
+ import './avatar-img.js';
7
+ import './styles.js';
8
+ import 'tailwind-variants';
9
+ import '@jamsrui/core';
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";var _chunkNZUTFQXPjs = require('./chunk-NZUTFQXP.js');var _chunkNMBSOBOUjs = require('./chunk-NMBSOBOU.js');require('./chunk-AJJHRECE.js');require('./chunk-IIR3HXSG.js');require('./chunk-KQ4XRJDH.js');require('./chunk-6YOKQYAL.js');require('./chunk-G5QLB3IV.js');require('./chunk-E37RG5B5.js');exports.Avatar = _chunkNZUTFQXPjs.a; exports.AvatarConfig = _chunkNMBSOBOUjs.a; exports.useAvatarConfig = _chunkNMBSOBOUjs.b;
package/dist/index.mjs ADDED
@@ -0,0 +1 @@
1
+ "use client";import{a as o}from"./chunk-VPCQCOSP.mjs";import{a as r,b as a}from"./chunk-GXVNM3CJ.mjs";import"./chunk-W3QSAO35.mjs";import"./chunk-NMVVIIUJ.mjs";import"./chunk-66YE63BY.mjs";import"./chunk-2PZ2EQYL.mjs";import"./chunk-3PXJHT2I.mjs";import"./chunk-TSGQ56WY.mjs";export{o as Avatar,r as AvatarConfig,a as useAvatarConfig};
@@ -0,0 +1,189 @@
1
+ import * as tailwind_variants from 'tailwind-variants';
2
+ import { VariantProps } from '@jamsrui/utils';
3
+
4
+ declare const test = "";
5
+ declare const avatarVariants: tailwind_variants.TVReturnType<{
6
+ size: {
7
+ xs: {
8
+ root: string;
9
+ };
10
+ sm: {
11
+ root: string;
12
+ };
13
+ md: {
14
+ root: string;
15
+ };
16
+ lg: {
17
+ root: string;
18
+ };
19
+ xl: {
20
+ root: string;
21
+ };
22
+ };
23
+ color: {
24
+ default: {
25
+ root: string;
26
+ };
27
+ primary: {
28
+ root: string;
29
+ };
30
+ secondary: {
31
+ root: string;
32
+ };
33
+ success: {
34
+ root: string;
35
+ };
36
+ warning: {
37
+ root: string;
38
+ };
39
+ danger: {
40
+ root: string;
41
+ };
42
+ };
43
+ isBordered: {
44
+ true: {
45
+ root: string;
46
+ };
47
+ false: {
48
+ root: string;
49
+ };
50
+ };
51
+ radius: {
52
+ sm: {};
53
+ md: {};
54
+ lg: {};
55
+ xl: {};
56
+ "2xl": {};
57
+ "3xl": {};
58
+ full: {};
59
+ none: {};
60
+ };
61
+ }, {
62
+ root: string;
63
+ img: string;
64
+ fallback: string;
65
+ }, undefined, {
66
+ size: {
67
+ xs: {
68
+ root: string;
69
+ };
70
+ sm: {
71
+ root: string;
72
+ };
73
+ md: {
74
+ root: string;
75
+ };
76
+ lg: {
77
+ root: string;
78
+ };
79
+ xl: {
80
+ root: string;
81
+ };
82
+ };
83
+ color: {
84
+ default: {
85
+ root: string;
86
+ };
87
+ primary: {
88
+ root: string;
89
+ };
90
+ secondary: {
91
+ root: string;
92
+ };
93
+ success: {
94
+ root: string;
95
+ };
96
+ warning: {
97
+ root: string;
98
+ };
99
+ danger: {
100
+ root: string;
101
+ };
102
+ };
103
+ isBordered: {
104
+ true: {
105
+ root: string;
106
+ };
107
+ false: {
108
+ root: string;
109
+ };
110
+ };
111
+ radius: {
112
+ sm: {};
113
+ md: {};
114
+ lg: {};
115
+ xl: {};
116
+ "2xl": {};
117
+ "3xl": {};
118
+ full: {};
119
+ none: {};
120
+ };
121
+ }, {
122
+ root: string;
123
+ img: string;
124
+ fallback: string;
125
+ }, tailwind_variants.TVReturnType<{
126
+ size: {
127
+ xs: {
128
+ root: string;
129
+ };
130
+ sm: {
131
+ root: string;
132
+ };
133
+ md: {
134
+ root: string;
135
+ };
136
+ lg: {
137
+ root: string;
138
+ };
139
+ xl: {
140
+ root: string;
141
+ };
142
+ };
143
+ color: {
144
+ default: {
145
+ root: string;
146
+ };
147
+ primary: {
148
+ root: string;
149
+ };
150
+ secondary: {
151
+ root: string;
152
+ };
153
+ success: {
154
+ root: string;
155
+ };
156
+ warning: {
157
+ root: string;
158
+ };
159
+ danger: {
160
+ root: string;
161
+ };
162
+ };
163
+ isBordered: {
164
+ true: {
165
+ root: string;
166
+ };
167
+ false: {
168
+ root: string;
169
+ };
170
+ };
171
+ radius: {
172
+ sm: {};
173
+ md: {};
174
+ lg: {};
175
+ xl: {};
176
+ "2xl": {};
177
+ "3xl": {};
178
+ full: {};
179
+ none: {};
180
+ };
181
+ }, {
182
+ root: string;
183
+ img: string;
184
+ fallback: string;
185
+ }, undefined, unknown, unknown, undefined>>;
186
+ type AvatarVariants = VariantProps<typeof avatarVariants>;
187
+ type AvatarSlots = keyof ReturnType<typeof avatarVariants>;
188
+
189
+ export { type AvatarSlots, type AvatarVariants, avatarVariants, test };
@@ -0,0 +1,189 @@
1
+ import * as tailwind_variants from 'tailwind-variants';
2
+ import { VariantProps } from '@jamsrui/utils';
3
+
4
+ declare const test = "";
5
+ declare const avatarVariants: tailwind_variants.TVReturnType<{
6
+ size: {
7
+ xs: {
8
+ root: string;
9
+ };
10
+ sm: {
11
+ root: string;
12
+ };
13
+ md: {
14
+ root: string;
15
+ };
16
+ lg: {
17
+ root: string;
18
+ };
19
+ xl: {
20
+ root: string;
21
+ };
22
+ };
23
+ color: {
24
+ default: {
25
+ root: string;
26
+ };
27
+ primary: {
28
+ root: string;
29
+ };
30
+ secondary: {
31
+ root: string;
32
+ };
33
+ success: {
34
+ root: string;
35
+ };
36
+ warning: {
37
+ root: string;
38
+ };
39
+ danger: {
40
+ root: string;
41
+ };
42
+ };
43
+ isBordered: {
44
+ true: {
45
+ root: string;
46
+ };
47
+ false: {
48
+ root: string;
49
+ };
50
+ };
51
+ radius: {
52
+ sm: {};
53
+ md: {};
54
+ lg: {};
55
+ xl: {};
56
+ "2xl": {};
57
+ "3xl": {};
58
+ full: {};
59
+ none: {};
60
+ };
61
+ }, {
62
+ root: string;
63
+ img: string;
64
+ fallback: string;
65
+ }, undefined, {
66
+ size: {
67
+ xs: {
68
+ root: string;
69
+ };
70
+ sm: {
71
+ root: string;
72
+ };
73
+ md: {
74
+ root: string;
75
+ };
76
+ lg: {
77
+ root: string;
78
+ };
79
+ xl: {
80
+ root: string;
81
+ };
82
+ };
83
+ color: {
84
+ default: {
85
+ root: string;
86
+ };
87
+ primary: {
88
+ root: string;
89
+ };
90
+ secondary: {
91
+ root: string;
92
+ };
93
+ success: {
94
+ root: string;
95
+ };
96
+ warning: {
97
+ root: string;
98
+ };
99
+ danger: {
100
+ root: string;
101
+ };
102
+ };
103
+ isBordered: {
104
+ true: {
105
+ root: string;
106
+ };
107
+ false: {
108
+ root: string;
109
+ };
110
+ };
111
+ radius: {
112
+ sm: {};
113
+ md: {};
114
+ lg: {};
115
+ xl: {};
116
+ "2xl": {};
117
+ "3xl": {};
118
+ full: {};
119
+ none: {};
120
+ };
121
+ }, {
122
+ root: string;
123
+ img: string;
124
+ fallback: string;
125
+ }, tailwind_variants.TVReturnType<{
126
+ size: {
127
+ xs: {
128
+ root: string;
129
+ };
130
+ sm: {
131
+ root: string;
132
+ };
133
+ md: {
134
+ root: string;
135
+ };
136
+ lg: {
137
+ root: string;
138
+ };
139
+ xl: {
140
+ root: string;
141
+ };
142
+ };
143
+ color: {
144
+ default: {
145
+ root: string;
146
+ };
147
+ primary: {
148
+ root: string;
149
+ };
150
+ secondary: {
151
+ root: string;
152
+ };
153
+ success: {
154
+ root: string;
155
+ };
156
+ warning: {
157
+ root: string;
158
+ };
159
+ danger: {
160
+ root: string;
161
+ };
162
+ };
163
+ isBordered: {
164
+ true: {
165
+ root: string;
166
+ };
167
+ false: {
168
+ root: string;
169
+ };
170
+ };
171
+ radius: {
172
+ sm: {};
173
+ md: {};
174
+ lg: {};
175
+ xl: {};
176
+ "2xl": {};
177
+ "3xl": {};
178
+ full: {};
179
+ none: {};
180
+ };
181
+ }, {
182
+ root: string;
183
+ img: string;
184
+ fallback: string;
185
+ }, undefined, unknown, unknown, undefined>>;
186
+ type AvatarVariants = VariantProps<typeof avatarVariants>;
187
+ type AvatarSlots = keyof ReturnType<typeof avatarVariants>;
188
+
189
+ export { type AvatarSlots, type AvatarVariants, avatarVariants, test };
package/dist/styles.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkE37RG5B5js = require('./chunk-E37RG5B5.js');exports.avatarVariants = _chunkE37RG5B5js.b; exports.test = _chunkE37RG5B5js.a;
@@ -0,0 +1 @@
1
+ import{a,b}from"./chunk-TSGQ56WY.mjs";export{b as avatarVariants,a as test};
@@ -0,0 +1,7 @@
1
+ import '@jamsrui/utils';
2
+ export { u as useAvatar } from './avatar-CYA1oDzH.mjs';
3
+ import './avatar-fallback.mjs';
4
+ import './avatar-img.mjs';
5
+ import './styles.mjs';
6
+ import 'react';
7
+ import 'tailwind-variants';
@@ -0,0 +1,7 @@
1
+ import '@jamsrui/utils';
2
+ export { u as useAvatar } from './avatar-6BB4Uuc1.js';
3
+ import './avatar-fallback.js';
4
+ import './avatar-img.js';
5
+ import './styles.js';
6
+ import 'react';
7
+ import 'tailwind-variants';
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk6YOKQYALjs = require('./chunk-6YOKQYAL.js');require('./chunk-G5QLB3IV.js');require('./chunk-E37RG5B5.js');exports.useAvatar = _chunk6YOKQYALjs.a;
@@ -0,0 +1 @@
1
+ import{a}from"./chunk-2PZ2EQYL.mjs";import"./chunk-3PXJHT2I.mjs";import"./chunk-TSGQ56WY.mjs";export{a as useAvatar};
@@ -0,0 +1,12 @@
1
+ import { A as Avatar } from './avatar-CYA1oDzH.mjs';
2
+ import 'react';
3
+ import '@jamsrui/utils';
4
+ import './avatar-fallback.mjs';
5
+ import './avatar-img.mjs';
6
+ import './styles.mjs';
7
+ import 'tailwind-variants';
8
+
9
+ declare const getFirstChar: (name: string) => string;
10
+ declare const getColorByName: (name: string) => Avatar.Props["color"];
11
+
12
+ export { getColorByName, getFirstChar };
@@ -0,0 +1,12 @@
1
+ import { A as Avatar } from './avatar-6BB4Uuc1.js';
2
+ import 'react';
3
+ import '@jamsrui/utils';
4
+ import './avatar-fallback.js';
5
+ import './avatar-img.js';
6
+ import './styles.js';
7
+ import 'tailwind-variants';
8
+
9
+ declare const getFirstChar: (name: string) => string;
10
+ declare const getColorByName: (name: string) => Avatar.Props["color"];
11
+
12
+ export { getColorByName, getFirstChar };
package/dist/utils.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkG5QLB3IVjs = require('./chunk-G5QLB3IV.js');exports.getColorByName = _chunkG5QLB3IVjs.b; exports.getFirstChar = _chunkG5QLB3IVjs.a;
package/dist/utils.mjs ADDED
@@ -0,0 +1 @@
1
+ import{a,b}from"./chunk-3PXJHT2I.mjs";export{b as getColorByName,a as getFirstChar};
package/package.json ADDED
@@ -0,0 +1,49 @@
1
+ {
2
+ "name": "@jamsrui/avatar",
3
+ "version": "0.0.2",
4
+ "peerDependencies": {
5
+ "react": ">=19"
6
+ },
7
+ "dependencies": {
8
+ "@jamsrui/hooks": "^0.0.2",
9
+ "@jamsrui/utils": "^0.0.2",
10
+ "@jamsrui/icons": "^0.0.2",
11
+ "@jamsrui/core": "^0.0.2"
12
+ },
13
+ "exports": {
14
+ ".": {
15
+ "types": "./dist/index.d.ts",
16
+ "import": "./dist/index.mjs",
17
+ "require": "./dist/index.js"
18
+ }
19
+ },
20
+ "description": "A modern and beautiful Next.js UI components library.",
21
+ "keywords": [
22
+ "react",
23
+ "ui",
24
+ "UI components",
25
+ "Next.js",
26
+ "React",
27
+ "JamsrUI",
28
+ "jamsr-ui",
29
+ "TypeScript"
30
+ ],
31
+ "sideEffects": false,
32
+ "license": "MIT",
33
+ "author": "@jamsrworld",
34
+ "repository": {
35
+ "type": "git",
36
+ "url": "https://github.com/jamsrworld/jamsr-ui"
37
+ },
38
+ "bugs": {
39
+ "url": "https://github.com/jamsrworld/jamsr-ui/issues"
40
+ },
41
+ "homepage": "https://jamsr-ui.jamsrworld.com",
42
+ "files": [
43
+ "dist",
44
+ "README",
45
+ "README.md",
46
+ "package.json",
47
+ "LICENSE"
48
+ ]
49
+ }