@useloops/design-system 1.4.636 → 1.4.637
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as o,jsx as r,Fragment as e}from"react/jsx-runtime";import{useTheme as i}from"@mui/material";import"../../BrandCore/colorRamps.js";import"../../BrandCore/primitiveVariables.js";import"../../BrandCore/semanticColor.js";import"../../BrandCore/types.js";import"../../BrandCore/typography.js";import
|
|
1
|
+
import{jsxs as o,jsx as r,Fragment as e}from"react/jsx-runtime";import{useTheme as i}from"@mui/material";import"../../BrandCore/colorRamps.js";import"../../BrandCore/primitiveVariables.js";import"../../BrandCore/semanticColor.js";import"../../BrandCore/types.js";import"../../BrandCore/typography.js";import s from"../../BrandCore/Icon/Icon.js";import t from"../IconButton/IconButton.js";import n from"../Progress/Progress.js";import a from"../Tooltip/Tooltip.js";import p from"../Typography/Typography.js";import d from"./StyledPill.js";import l from"./useTextTruncation.js";const m=m=>{const c=i(),{label:u,secondaryLabel:g,iconLeft:f,iconRight:x,onDelete:b,active:j,slots:y,loading:h,sizing:B,disabled:C,slotProps:T}=m,{textRef:I,isTruncated:v}=l([u]),z=o(d,{className:"loops-pill",tabIndex:0,...m,sx:{...T?.root?.sx},children:[h&&r(n,{sizing:B||"xl",sx:{color:c.custom.palette.icon.disabled}}),!h&&o(e,{children:[f&&r(s,{disabled:C,size:16,name:f}),"string"==typeof u?r(p,{component:"p",variation:"sm",noWrap:!0,ref:I,disabled:C,sx:{padding:`0 ${c.spacing(c.custom.padding.xs)}`},children:u}):u,"string"==typeof g?r(p,{component:"p",secondary:!0,variation:"sm",monospaced:!0,noWrap:!0,ref:I,disabled:C,sx:{padding:`0 ${c.spacing(c.custom.padding.xs)}`},children:g}):g,x&&r(s,{disabled:C,size:16,name:x}),b&&r(t,{sizing:"xs",onClick:b,shape:"round",disabled:C,variation:"default",sx:{"&.MuiIconButton-root.Mui-disabled":{"&:before":{backgroundColor:"transparent"}}},icon:r(s,{name:"cancel",sx:{color:j?c.custom.palette.blue[1e3]:c.custom.palette.icon.secondary}})})]})]});return v?r(a,{message:u,...y?.tooltip,children:z}):z};export{m as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("react/jsx-runtime"),r=require("@mui/material");require("../../BrandCore/colorRamps.js"),require("../../BrandCore/primitiveVariables.js"),require("../../BrandCore/semanticColor.js"),require("../../BrandCore/types.js"),require("../../BrandCore/typography.js");var s=require("../../BrandCore/Icon/Icon.js"),
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),r=require("@mui/material");require("../../BrandCore/colorRamps.js"),require("../../BrandCore/primitiveVariables.js"),require("../../BrandCore/semanticColor.js"),require("../../BrandCore/types.js"),require("../../BrandCore/typography.js");var s=require("../../BrandCore/Icon/Icon.js"),o=require("../IconButton/IconButton.js"),i=require("../Progress/Progress.js"),a=require("../Tooltip/Tooltip.js"),n=require("../Typography/Typography.js"),t=require("./StyledPill.js"),d=require("./useTextTruncation.js");module.exports=l=>{const c=r.useTheme(),{label:u,secondaryLabel:p,iconLeft:x,iconRight:m,onDelete:j,active:g,slots:b,loading:q,sizing:y,disabled:f,slotProps:h}=l,{textRef:B,isTruncated:C}=d([u]),T=e.jsxs(t,{className:"loops-pill",tabIndex:0,...l,sx:{...h?.root?.sx},children:[q&&e.jsx(i,{sizing:y||"xl",sx:{color:c.custom.palette.icon.disabled}}),!q&&e.jsxs(e.Fragment,{children:[x&&e.jsx(s.default,{disabled:f,size:16,name:x}),"string"==typeof u?e.jsx(n,{component:"p",variation:"sm",noWrap:!0,ref:B,disabled:f,sx:{padding:`0 ${c.spacing(c.custom.padding.xs)}`},children:u}):u,"string"==typeof p?e.jsx(n,{component:"p",secondary:!0,variation:"sm",monospaced:!0,noWrap:!0,ref:B,disabled:f,sx:{padding:`0 ${c.spacing(c.custom.padding.xs)}`},children:p}):p,m&&e.jsx(s.default,{disabled:f,size:16,name:m}),j&&e.jsx(o,{sizing:"xs",onClick:j,shape:"round",disabled:f,variation:"default",sx:{"&.MuiIconButton-root.Mui-disabled":{"&:before":{backgroundColor:"transparent"}}},icon:e.jsx(s.default,{name:"cancel",sx:{color:g?c.custom.palette.blue[1e3]:c.custom.palette.icon.secondary}})})]})]});return C?e.jsx(a,{message:u,...b?.tooltip,children:T}):T};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { BoxProps } from '@mui/material';
|
|
1
2
|
import { SxProps, Theme } from '@mui/material/styles';
|
|
2
3
|
import { IconName } from '../../../BrandCore/Icon.js';
|
|
3
4
|
import { TooltipProps } from '../Tooltip/Tooltip.js';
|
|
@@ -18,6 +19,9 @@ interface PillProps {
|
|
|
18
19
|
slots?: {
|
|
19
20
|
tooltip: Partial<Omit<TooltipProps, 'message'>>;
|
|
20
21
|
};
|
|
22
|
+
slotProps?: {
|
|
23
|
+
root?: BoxProps;
|
|
24
|
+
};
|
|
21
25
|
}
|
|
22
26
|
|
|
23
27
|
export type { PillProps };
|