@banzamel/mineralui 1.11.0 → 1.11.1

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/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  Modern React UI framework with a sharp admin aesthetic, theming system, and production-ready components.
4
4
 
5
5
  - npm: `@banzamel/mineralui`
6
- - version: `1.11.0`
6
+ - version: `1.11.1`
7
7
  - peer dependencies: `react >= 19`, `react-dom >= 19`
8
8
  - repository: `https://github.com/Banzamel/mineralui`
9
9
  - homepage: `https://mineralui.io`
@@ -38,10 +38,22 @@ function u({ value: r = 0, max: i = 5, color: a = "warning", size: o = "md", rea
38
38
  }
39
39
  //#endregion
40
40
  //#region src/components/display/MDetailList/MDetailList.tsx
41
- function d({ items: e, size: t = "md", bordered: s = !0, emptyState: u = null, className: d, ...f }) {
42
- return e.length ? /* @__PURE__ */ c("div", {
43
- className: n("detail-list", `size-${t}`, s && "bordered", d),
44
- ...f,
41
+ var d = {
42
+ xs: "xs",
43
+ sm: "xs",
44
+ md: "sm",
45
+ lg: "md",
46
+ xl: "md"
47
+ };
48
+ function f({ items: e, size: t = "md", bordered: s = !0, emptyState: u = null, className: f, ...p }) {
49
+ if (!e.length) return u ? /* @__PURE__ */ c("div", {
50
+ className: n("detail-list", f),
51
+ children: u
52
+ }) : null;
53
+ let m = d[t];
54
+ return /* @__PURE__ */ c("div", {
55
+ className: n("detail-list", `size-${t}`, s && "bordered", f),
56
+ ...p,
45
57
  children: e.map((e) => {
46
58
  let t = e.key ?? e.label?.toString(), n = e.component || e.to || e.href ? /* @__PURE__ */ c(a, {
47
59
  component: e.component,
@@ -58,7 +70,7 @@ function d({ items: e, size: t = "md", bordered: s = !0, emptyState: u = null, c
58
70
  align: "start",
59
71
  children: [/* @__PURE__ */ l(o, { children: [
60
72
  /* @__PURE__ */ c(i, {
61
- size: "sm",
73
+ size: m,
62
74
  tone: "muted",
63
75
  children: e.label
64
76
  }),
@@ -67,7 +79,7 @@ function d({ items: e, size: t = "md", bordered: s = !0, emptyState: u = null, c
67
79
  children: n
68
80
  }),
69
81
  e.helperText && /* @__PURE__ */ c(i, {
70
- size: "sm",
82
+ size: m,
71
83
  tone: "muted",
72
84
  children: e.helperText
73
85
  })
@@ -78,12 +90,9 @@ function d({ items: e, size: t = "md", bordered: s = !0, emptyState: u = null, c
78
90
  })
79
91
  }, t);
80
92
  })
81
- }) : u ? /* @__PURE__ */ c("div", {
82
- className: n("detail-list", d),
83
- children: u
84
- }) : null;
93
+ });
85
94
  }
86
95
  //#endregion
87
- export { u as n, d as t };
96
+ export { u as n, f as t };
88
97
 
89
- //# sourceMappingURL=MDetailList-Gh5Y0UOx.js.map
98
+ //# sourceMappingURL=MDetailList-CELXTmJw.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MDetailList-CELXTmJw.js","names":[],"sources":["../src/components/display/MRating/MRating.tsx","../src/components/display/MDetailList/MDetailList.tsx"],"sourcesContent":["import {useState} from 'react'\nimport type {MRatingProps} from './MRating.types'\nimport {MStarFillIcon, MStarIcon} from '../../../icons'\nimport {cn} from '../../../utils/cn'\nimport './MRating.css'\n\n// Render an interactive star-based rating control.\nexport function MRating({\n value = 0,\n max = 5,\n color = 'warning',\n size = 'md',\n readOnly = false,\n onChange,\n className,\n ...rest\n}: MRatingProps) {\n const [hovered, setHovered] = useState<number | null>(null)\n const displayValue = hovered ?? value\n\n const handleClick = (index: number) => {\n if (readOnly) return\n onChange?.(index)\n }\n\n return (\n <div\n className={cn('rating', `color-${color}`, size, readOnly && 'read-only', className)}\n role=\"radiogroup\"\n aria-label=\"MRating\"\n onMouseLeave={() => setHovered(null)}\n {...rest}\n >\n {Array.from({length: max}, (_, i) => {\n const starIndex = i + 1\n const filled = displayValue >= starIndex\n return (\n <button\n key={i}\n type=\"button\"\n className=\"rating-star\"\n onClick={() => handleClick(starIndex)}\n onMouseEnter={() => !readOnly && setHovered(starIndex)}\n aria-label={`${starIndex} star${starIndex > 1 ? 's' : ''}`}\n tabIndex={readOnly ? -1 : 0}\n disabled={readOnly}\n >\n <span className=\"star-icon\" aria-hidden=\"true\">\n {filled ? <MStarFillIcon /> : <MStarIcon />}\n </span>\n </button>\n )\n })}\n </div>\n )\n}\n","import type {MSize} from '../../../theme'\nimport type {MDetailListProps} from './MDetailList.types'\nimport {cn} from '../../../utils/cn'\nimport {MInline, MStack} from '../../layout'\nimport {MLink, MText} from '../../typography'\nimport type {MTextSize} from '../../typography'\nimport './MDetailList.css'\n\n// Maps the list's outer size to the secondary-text size used for labels and helper text.\n// Labels sit one notch below the value so they read as metadata, not headline copy.\nconst LABEL_SIZE_MAP: Record<MSize, MTextSize> = {\n xs: 'xs',\n sm: 'xs',\n md: 'sm',\n lg: 'md',\n xl: 'md',\n}\n\nexport function MDetailList({\n items,\n size = 'md',\n bordered = true,\n emptyState = null,\n className,\n ...rest\n}: MDetailListProps) {\n if (!items.length) {\n return emptyState ? <div className={cn('detail-list', className)}>{emptyState}</div> : null\n }\n\n const labelSize = LABEL_SIZE_MAP[size]\n\n return (\n <div className={cn('detail-list', `size-${size}`, bordered && 'bordered', className)} {...rest}>\n {items.map((item) => {\n const key = item.key ?? item.label?.toString()\n const value =\n item.component || item.to || item.href ? (\n <MLink\n component={item.component}\n to={item.to}\n href={item.href}\n target={item.target}\n rel={item.rel}\n >\n {item.value}\n </MLink>\n ) : (\n item.value\n )\n\n return (\n <div key={key} className=\"detail-list-item\">\n <MInline justify={'between'} align={'start'}>\n <MStack>\n <MText size={labelSize} tone={'muted'}>\n {item.label}\n </MText>\n {value && <div className=\"detail-list-value\">{value}</div>}\n {item.helperText && (\n <MText size={labelSize} tone={'muted'}>\n {item.helperText}\n </MText>\n )}\n </MStack>\n {item.status && <div className=\"detail-list-status\">{item.status}</div>}\n </MInline>\n </div>\n )\n })}\n </div>\n )\n}\n"],"mappings":";;;;;;;;;AAOA,SAAgB,EAAQ,EACpB,WAAQ,GACR,SAAM,GACN,WAAQ,WACR,UAAO,MACP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kBAAC,GAAD;IACI,WAAW,EAAK;IAChB,IAAI,EAAK;IACT,MAAM,EAAK;IACX,QAAQ,EAAK;IACb,KAAK,EAAK;cAET,EAAK;IACF,CAAA,GAER,EAAK;AAGb,UACI,kBAAC,OAAD;IAAe,WAAU;cACrB,kBAAC,GAAD;KAAS,SAAS;KAAW,OAAO;eAApC,CACI,kBAAC,GAAD,EAAA,UAAA;MACI,kBAAC,GAAD;OAAO,MAAM;OAAW,MAAM;iBACzB,EAAK;OACF,CAAA;MACP,KAAS,kBAAC,OAAD;OAAK,WAAU;iBAAqB;OAAY,CAAA;MACzD,EAAK,cACF,kBAAC,GAAD;OAAO,MAAM;OAAW,MAAM;iBACzB,EAAK;OACF,CAAA;MAEP,EAAA,CAAA,EACR,EAAK,UAAU,kBAAC,OAAD;MAAK,WAAU;gBAAsB,EAAK;MAAa,CAAA,CACjE;;IACR,EAfI,EAeJ;IAEZ;EACA,CAAA"}
@@ -0,0 +1,2 @@
1
+ const e=require(`./icons-BHFwX7ri.cjs`),t=require(`./cn-CU5TNITO.cjs`),n=require(`./MSurface-WsYGNGX5.cjs`),r=require(`./MText-CAbqC2qZ.cjs`),i=require(`./MLink-CZ2FfQ0N.cjs`),a=require(`./MStack-DDn2bYBQ.cjs`);require(`./core-B2klLGki.cjs`);let o=require(`react`),s=require(`react/jsx-runtime`);function c({value:n=0,max:r=5,color:i=`warning`,size:a=`md`,readOnly:c=!1,onChange:l,className:u,...d}){let[f,p]=(0,o.useState)(null),m=f??n,h=e=>{c||l?.(e)};return(0,s.jsx)(`div`,{className:t.t(`rating`,`color-${i}`,a,c&&`read-only`,u),role:`radiogroup`,"aria-label":`MRating`,onMouseLeave:()=>p(null),...d,children:Array.from({length:r},(t,n)=>{let r=n+1,i=m>=r;return(0,s.jsx)(`button`,{type:`button`,className:`rating-star`,onClick:()=>h(r),onMouseEnter:()=>!c&&p(r),"aria-label":`${r} star${r>1?`s`:``}`,tabIndex:c?-1:0,disabled:c,children:(0,s.jsx)(`span`,{className:`star-icon`,"aria-hidden":`true`,children:i?(0,s.jsx)(e.mi,{}):(0,s.jsx)(e.hi,{})})},n)})})}var l={xs:`xs`,sm:`xs`,md:`sm`,lg:`md`,xl:`md`};function u({items:e,size:o=`md`,bordered:c=!0,emptyState:u=null,className:d,...f}){if(!e.length)return u?(0,s.jsx)(`div`,{className:t.t(`detail-list`,d),children:u}):null;let p=l[o];return(0,s.jsx)(`div`,{className:t.t(`detail-list`,`size-${o}`,c&&`bordered`,d),...f,children:e.map(e=>{let t=e.key??e.label?.toString(),o=e.component||e.to||e.href?(0,s.jsx)(i.t,{component:e.component,to:e.to,href:e.href,target:e.target,rel:e.rel,children:e.value}):e.value;return(0,s.jsx)(`div`,{className:`detail-list-item`,children:(0,s.jsxs)(n.n,{justify:`between`,align:`start`,children:[(0,s.jsxs)(a.t,{children:[(0,s.jsx)(r.t,{size:p,tone:`muted`,children:e.label}),o&&(0,s.jsx)(`div`,{className:`detail-list-value`,children:o}),e.helperText&&(0,s.jsx)(r.t,{size:p,tone:`muted`,children:e.helperText})]}),e.status&&(0,s.jsx)(`div`,{className:`detail-list-status`,children:e.status})]})},t)})})}Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return u}});
2
+ //# sourceMappingURL=MDetailList-t0ixZflO.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MDetailList-t0ixZflO.cjs","names":[],"sources":["../src/components/display/MRating/MRating.tsx","../src/components/display/MDetailList/MDetailList.tsx"],"sourcesContent":["import {useState} from 'react'\nimport type {MRatingProps} from './MRating.types'\nimport {MStarFillIcon, MStarIcon} from '../../../icons'\nimport {cn} from '../../../utils/cn'\nimport './MRating.css'\n\n// Render an interactive star-based rating control.\nexport function MRating({\n value = 0,\n max = 5,\n color = 'warning',\n size = 'md',\n readOnly = false,\n onChange,\n className,\n ...rest\n}: MRatingProps) {\n const [hovered, setHovered] = useState<number | null>(null)\n const displayValue = hovered ?? value\n\n const handleClick = (index: number) => {\n if (readOnly) return\n onChange?.(index)\n }\n\n return (\n <div\n className={cn('rating', `color-${color}`, size, readOnly && 'read-only', className)}\n role=\"radiogroup\"\n aria-label=\"MRating\"\n onMouseLeave={() => setHovered(null)}\n {...rest}\n >\n {Array.from({length: max}, (_, i) => {\n const starIndex = i + 1\n const filled = displayValue >= starIndex\n return (\n <button\n key={i}\n type=\"button\"\n className=\"rating-star\"\n onClick={() => handleClick(starIndex)}\n onMouseEnter={() => !readOnly && setHovered(starIndex)}\n aria-label={`${starIndex} star${starIndex > 1 ? 's' : ''}`}\n tabIndex={readOnly ? -1 : 0}\n disabled={readOnly}\n >\n <span className=\"star-icon\" aria-hidden=\"true\">\n {filled ? <MStarFillIcon /> : <MStarIcon />}\n </span>\n </button>\n )\n })}\n </div>\n )\n}\n","import type {MSize} from '../../../theme'\nimport type {MDetailListProps} from './MDetailList.types'\nimport {cn} from '../../../utils/cn'\nimport {MInline, MStack} from '../../layout'\nimport {MLink, MText} from '../../typography'\nimport type {MTextSize} from '../../typography'\nimport './MDetailList.css'\n\n// Maps the list's outer size to the secondary-text size used for labels and helper text.\n// Labels sit one notch below the value so they read as metadata, not headline copy.\nconst LABEL_SIZE_MAP: Record<MSize, MTextSize> = {\n xs: 'xs',\n sm: 'xs',\n md: 'sm',\n lg: 'md',\n xl: 'md',\n}\n\nexport function MDetailList({\n items,\n size = 'md',\n bordered = true,\n emptyState = null,\n className,\n ...rest\n}: MDetailListProps) {\n if (!items.length) {\n return emptyState ? <div className={cn('detail-list', className)}>{emptyState}</div> : null\n }\n\n const labelSize = LABEL_SIZE_MAP[size]\n\n return (\n <div className={cn('detail-list', `size-${size}`, bordered && 'bordered', className)} {...rest}>\n {items.map((item) => {\n const key = item.key ?? item.label?.toString()\n const value =\n item.component || item.to || item.href ? (\n <MLink\n component={item.component}\n to={item.to}\n href={item.href}\n target={item.target}\n rel={item.rel}\n >\n {item.value}\n </MLink>\n ) : (\n item.value\n )\n\n return (\n <div key={key} className=\"detail-list-item\">\n <MInline justify={'between'} align={'start'}>\n <MStack>\n <MText size={labelSize} tone={'muted'}>\n {item.label}\n </MText>\n {value && <div className=\"detail-list-value\">{value}</div>}\n {item.helperText && (\n <MText size={labelSize} tone={'muted'}>\n {item.helperText}\n </MText>\n )}\n </MStack>\n {item.status && <div className=\"detail-list-status\">{item.status}</div>}\n </MInline>\n </div>\n )\n })}\n </div>\n )\n}\n"],"mappings":"wSAOA,SAAgB,EAAQ,CACpB,QAAQ,EACR,MAAM,EACN,QAAQ,UACR,OAAO,KACP,WAAW,GACX,WACA,YACA,GAAG,GACU,CACb,GAAM,CAAC,EAAS,IAAA,EAAA,EAAA,UAAsC,KAAK,CACrD,EAAe,GAAW,EAE1B,EAAe,GAAkB,CAC/B,GACJ,IAAW,EAAM,EAGrB,OACI,EAAA,EAAA,KAAC,MAAD,CACI,UAAW,EAAA,EAAG,SAAU,SAAS,IAAS,EAAM,GAAY,YAAa,EAAU,CACnF,KAAK,aACL,aAAW,UACX,iBAAoB,EAAW,KAAK,CACpC,GAAI,WAEH,MAAM,KAAK,CAAC,OAAQ,EAAI,EAAG,EAAG,IAAM,CACjC,IAAM,EAAY,EAAI,EAChB,EAAS,GAAgB,EAC/B,OACI,EAAA,EAAA,KAAC,SAAD,CAEI,KAAK,SACL,UAAU,cACV,YAAe,EAAY,EAAU,CACrC,iBAAoB,CAAC,GAAY,EAAW,EAAU,CACtD,aAAY,GAAG,EAAU,OAAO,EAAY,EAAI,IAAM,KACtD,SAAU,EAAW,GAAK,EAC1B,SAAU,YAEV,EAAA,EAAA,KAAC,OAAD,CAAM,UAAU,YAAY,cAAY,gBACnC,GAAS,EAAA,EAAA,KAAC,EAAA,GAAD,EAAiB,CAAA,EAAG,EAAA,EAAA,KAAC,EAAA,GAAD,EAAa,CAAA,CACxC,CAAA,CACF,CAZA,EAYA,EAEf,CACA,CAAA,CC3Cd,IAAM,EAA2C,CAC7C,GAAI,KACJ,GAAI,KACJ,G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yM10.js";
15
15
  import { a as E, i as D, n as O, r as k, t as A } from "./MCard-9ucghJJs.js";
16
16
  import { n as j, t as M } from "./MInputCVC-DFtAStrY.js";
17
17
  import { t as N } from "./MAvatar-CIvYzQV4.js";
18
- import { n as ee, t as P } from "./MDetailList-Gh5Y0UOx.js";
18
+ import { n as ee, t as P } from "./MDetailList-CELXTmJw.js";
19
19
  import { t as F } from "./MInputSearch-Dj55a3oO.js";
20
20
  import { t as I } from "./MTreeView-DMTzRk6c.js";
21
21
  import { i as te, r as ne } from "./MDropdownMenu-BgEtrL-T.js";
@@ -1204,4 +1204,4 @@ function Ce({ title: e = "Documents", description: t, color: n = "primary", item
1204
1204
  //#endregion
1205
1205
  export { ge as a, Z as c, ue as d, J as f, ye as i, fe as l, $ as n, pe as o, q as p, Se as r, Q as s, Ce as t, de as u };
1206
1206
 
1207
- //# sourceMappingURL=cards-EAgezJB6.js.map
1207
+ //# sourceMappingURL=cards-CvgcQCAP.js.map