@bikdotai/bik-component-library 0.0.559-6 → 0.0.559-8
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/cjs/components/states/StateComponent.d.ts +1 -0
- package/dist/cjs/components/states/StateComponent.js +1 -1
- package/dist/cjs/components/states-modal/StateModalComponent.d.ts +2 -0
- package/dist/cjs/components/states-modal/StateModalComponent.js +1 -1
- package/dist/cjs/components/tag/Tag.d.ts +1 -1
- package/dist/cjs/components/tag/Tag.js +1 -1
- package/dist/cjs/components/tag/Tag.styled.d.ts +1 -0
- package/dist/cjs/components/tag/Tag.styled.js +1 -1
- package/dist/cjs/components/tag/model.d.ts +1 -0
- package/dist/esm/components/states/StateComponent.d.ts +1 -0
- package/dist/esm/components/states/StateComponent.js +1 -1
- package/dist/esm/components/states-modal/StateModalComponent.d.ts +2 -0
- package/dist/esm/components/states-modal/StateModalComponent.js +1 -1
- package/dist/esm/components/tag/Tag.d.ts +1 -1
- package/dist/esm/components/tag/Tag.js +1 -1
- package/dist/esm/components/tag/Tag.styled.d.ts +1 -0
- package/dist/esm/components/tag/Tag.styled.js +1 -1
- package/dist/esm/components/tag/model.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t,n,s=require("react/jsx-runtime"),o=require("../../constants/Theme.js"),r=require("../../assets/icons/errorIcon.svg.js"),i=require("../../assets/icons/successIcon.svg.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t,n,s=require("react/jsx-runtime"),o=require("../../constants/Theme.js"),r=require("../../assets/icons/errorIcon.svg.js"),i=require("../../assets/icons/successIcon.svg.js"),c=require("../../assets/icons/warningIcon.svg.js"),a=require("../button/Button.js"),u=require("../spinner/Spinner.js"),d=require("../TypographyStyle.js"),l=require("./StateComponent.styled.js");exports.StateInterface=void 0,(e=exports.StateInterface||(exports.StateInterface={})).SUCCESS="success",e.ERROR="error",e.WARNING="warning",e.LOADING="loading",exports.ButtonActions=void 0,(t=exports.ButtonActions||(exports.ButtonActions={})).CANCEL="cancel",t.OTHER="other",exports.ButtonTypes=void 0,(n=exports.ButtonTypes||(exports.ButtonTypes={})).SINGLE="SINGLE",n.DOUBLE="DOUBLE";exports.StateComponent=e=>{var t;const n=()=>x==exports.StateInterface.SUCCESS?s.jsx(i.default,{}):x==exports.StateInterface.WARNING?s.jsx(c.default,{}):x==exports.StateInterface.ERROR?s.jsx(r.default,{}):x===exports.StateInterface.LOADING?s.jsx(u.Spinner,{size:"large"}):void 0,{states:x,heading:p,subline:j,icon:S=n(),isButtonEnabled:h,type:g,buttonText:y,buttonType:B,onButtonClick:I,leadingIcon:L,width:O,headerImage:C,iconWidth:b,iconHeight:T,closeButtonType:A}=e;return s.jsxs(l.StateComponentContainer,Object.assign({width:O},{children:[s.jsx(l.StateIcon,Object.assign({iconWidth:b,iconHeight:T},{children:C?s.jsx("img",{src:C,width:"100%",height:"auto",alt:""}):S})),s.jsxs(l.StateHeading,Object.assign({size:e.size},{children:["SMALL"===e.size&&s.jsx(d.TitleRegular,{children:p}),"SMALL"!==e.size&&s.jsx(d.TitleMedium,{children:p})]})),s.jsxs(l.StateSubline,{children:["SMALL"!==e.size&&s.jsx(d.BodyPrimary,Object.assign({color:o.COLORS.content.secondary},{children:j})),"SMALL"===e.size&&s.jsx(d.BodySecondary,Object.assign({color:o.COLORS.content.secondary},{children:j}))]}),null!==(t=e.children)&&void 0!==t?t:s.jsx(s.Fragment,{}),h&&s.jsx(s.Fragment,{children:s.jsxs(l.ButtonContainer,Object.assign({size:e.size},{children:[g==exports.ButtonTypes.DOUBLE&&s.jsx(a.Button,{onClick:()=>I&&I(exports.ButtonActions.CANCEL),buttonType:A||"secondary",buttonText:"Cancel",matchParentWidth:!0}),s.jsx(a.Button,{onClick:()=>I&&I(exports.ButtonActions.OTHER),buttonType:null!=B?B:"primary",LeadingIcon:L,buttonText:null!=y?y:"Retry",matchParentWidth:!0})]}))})]}))};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ReactJSXElement } from '@emotion/react/types/jsx-namespace';
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import { Type } from '../button/model';
|
|
3
4
|
import { ButtonActions, ButtonTypes, StateInterface } from '../states/StateComponent';
|
|
4
5
|
export type StateModalComponentProps = {
|
|
5
6
|
states: StateInterface;
|
|
@@ -18,5 +19,6 @@ export type StateModalComponentProps = {
|
|
|
18
19
|
headerImage?: string;
|
|
19
20
|
iconWidth?: number;
|
|
20
21
|
iconHeight?: number;
|
|
22
|
+
closeButtonType?: Type;
|
|
21
23
|
};
|
|
22
24
|
export declare const StateModalComponent: React.FC<React.PropsWithChildren<StateModalComponentProps>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),n=require("../../constants/zindex.js"),s=require("../../assets/icons/errorIcon.svg.js"),i=require("../../assets/icons/successIcon.svg.js"),o=require("../../assets/icons/warningIcon.svg.js"),r=require("../modals/styledModal.js"),a=require("../spinner/Spinner.js"),c=require("../states/StateComponent.js");exports.StateModalComponent=d=>{const l=()=>u==c.StateInterface.SUCCESS?e.jsx(i.default,{}):u==c.StateInterface.WARNING?e.jsx(o.default,{}):u==c.StateInterface.ERROR?e.jsx(s.default,{}):u===c.StateInterface.LOADING?e.jsx(a.Spinner,{size:"large"}):void 0,{states:u,heading:I,subline:j,icon:S=l(),isButtonEnabled:g,type:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),n=require("../../constants/zindex.js"),s=require("../../assets/icons/errorIcon.svg.js"),i=require("../../assets/icons/successIcon.svg.js"),o=require("../../assets/icons/warningIcon.svg.js"),r=require("../modals/styledModal.js"),a=require("../spinner/Spinner.js"),c=require("../states/StateComponent.js");exports.StateModalComponent=d=>{const l=()=>u==c.StateInterface.SUCCESS?e.jsx(i.default,{}):u==c.StateInterface.WARNING?e.jsx(o.default,{}):u==c.StateInterface.ERROR?e.jsx(s.default,{}):u===c.StateInterface.LOADING?e.jsx(a.Spinner,{size:"large"}):void 0,{states:u,heading:I,subline:j,icon:S=l(),isButtonEnabled:g,type:p,buttonText:x,onButtonClick:h,leadingIcon:C,width:f,zIndex:y,headerImage:O,iconHeight:b,iconWidth:m,closeButtonType:q}=d,[B,v]=t.useState(!0);return e.jsx(r.StyledModal,Object.assign({open:B,onClose:function(){d.onClose&&d.onClose(),v(!1)},closeOnOutsideClick:!(u===c.StateInterface.LOADING),centralContainerStyles:{display:"flex",alignItems:"center",justifyContent:"center",width:f},hideCrossButton:u===c.StateInterface.LOADING,zIndex:y||n.ComponentZindex.STATE_MODAL},{children:e.jsx(c.StateComponent,Object.assign({states:u,heading:I,subline:j,isButtonEnabled:g,leadingIcon:C,type:p,buttonText:x,onButtonClick:h,icon:S,width:f||400,headerImage:O,iconHeight:b,iconWidth:m,closeButtonType:q},{children:d.children}))}))};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TagProps } from './model';
|
|
2
2
|
export declare const Tag: {
|
|
3
|
-
({ tagText, LeadingIcon, TrailingIcon, onLeadingIconClicked, leadingIconId, trailingIconId, onTrailingIconClicked, theme, type, variant, version, cursor, }: TagProps): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
({ tagText, LeadingIcon, TrailingIcon, onLeadingIconClicked, leadingIconId, trailingIconId, onTrailingIconClicked, theme, type, variant, version, cursor, alignIcon, }: TagProps): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
displayName: string;
|
|
5
5
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),i=require("react"),n=require("../TypographyStyle.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),i=require("react"),n=require("../TypographyStyle.js"),a=require("./model.js"),r=require("./Tag.styled.js"),t=require("./themes.js");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=s(i);const l=i=>{let{tagText:s,LeadingIcon:l,TrailingIcon:o,onLeadingIconClicked:d,leadingIconId:g,trailingIconId:p,onTrailingIconClicked:j,theme:u="light",type:y="neutral",variant:m="regular",version:h,cursor:b,alignIcon:x}=i,T=s;const I=u;let O=y;a.ValidTagTypeMap[m][y]||(O="neutral"),"circle"===m&&"number"==typeof T&&T>99&&(T="99+");const f={height:"compressed"===m?11:16,width:"compressed"===m?11:16,color:t.getTagIconColor(u,O),style:{display:"block"}};return e.jsx(r.Tag,Object.assign({cursor:b,theme:I,type:y,variant:m,version:h,alignIcon:x},{children:e.jsxs("div",Object.assign({className:"container"},{children:[l&&e.jsx("button",Object.assign({className:"icon-leading",onClick:d,id:`${g}-wrapper`||"leading-icon-wrapper"},{children:c.default.createElement(l,Object.assign(Object.assign({},f),{id:g||"leading-icon"}))})),""!==T&&("ai"===y&&"light"===u?"compressed"===m?e.jsx(n.AiBodyTiny,{children:T}):e.jsx(n.AiBodyCaption,{children:T}):"compressed"===m?e.jsx(n.BodyTiny,Object.assign({className:"text"},{children:T})):e.jsx(n.BodyCaption,Object.assign({className:"text"},{children:T}))),o&&e.jsx("button",Object.assign({className:"icon-trailing",onClick:j,id:`${p}-wrapper`||"trailing-icon-wrapper"},{children:c.default.createElement(o,Object.assign(Object.assign({},f),{id:p||"trailing-icon"}))}))]}))}))};l.displayName="Tag",exports.Tag=l;
|
|
@@ -9,4 +9,5 @@ export declare const Tag: import("@emotion/styled").StyledComponent<{
|
|
|
9
9
|
variant: TagVariant;
|
|
10
10
|
version?: "1.0" | "2.0" | undefined;
|
|
11
11
|
cursor?: string | undefined;
|
|
12
|
+
alignIcon?: string | undefined;
|
|
12
13
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var c=require("@emotion/styled/base"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var c=require("@emotion/styled/base"),l=require("./themes.js");function e(c){return c&&"object"==typeof c&&"default"in c?c:{default:c}}const t=e(c).default("div","production"===process.env.NODE_ENV?{target:"e930jd90"}:{target:"e930jd90",label:"Tag"})("cursor:",(c=>{var l;return null!==(l=c.cursor)&&void 0!==l?l:"default"}),";",(c=>"regular"===c.variant?"display: block;\n\t\t min-height: 26px;\n\t\t":"min-height: 20px;")," .container{display:flex;align-items:",(c=>c.alignIcon?c.alignIcon:"center"),";gap:6px;padding:",(c=>l.getPadding(c.variant)),";background:",(c=>l.getBackgroundColor(c.theme,c.type)),";border-radius:",(c=>"regular"===c.variant?"4px":"12px"),";",(c=>"light"===c.theme&&`border: ${"2.0"===c.version?.5:1}px solid ${l.generateBorder(c.type,c.theme)};`)," .text{color:",(c=>l.getTextColor(c.theme,c.type)),";}.icon-trailing{all:unset;display:flex;}.icon-leading{all:unset;display:flex;}}"+("production"===process.env.NODE_ENV?"":"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlRhZy5zdHlsZWQudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUU4QiIsImZpbGUiOiJUYWcuc3R5bGVkLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcclxuaW1wb3J0IHsgZ2VuZXJhdGVCb3JkZXIsIGdldEJhY2tncm91bmRDb2xvciwgZ2V0UGFkZGluZywgZ2V0VGV4dENvbG9yLCB9IGZyb20gJy4vdGhlbWVzJztcclxuZXhwb3J0IGNvbnN0IFRhZyA9IHN0eWxlZC5kaXYgYFxuXHRjdXJzb3I6ICR7KHByb3BzKSA9PiB7IHZhciBfYTsgcmV0dXJuIChf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HRcdGFsbDogdW5zZXQ7XG5cdFx0XHRkaXNwbGF5OiBmbGV4O1xuXHRcdH1cblxuXHRcdC5pY29uLWxlYWRpbmcge1xuXHRcdFx0YWxsOiB1bnNldDtcblx0XHRcdGRpc3BsYXk6IGZsZXg7XG5cdFx0fVxuXHR9XG5gO1xyXG4vLyMgc291cmNlTWFwcGluZ1VSTD1UYWcuc3R5bGVkLmpzLm1hcCJdfQ== */"));exports.Tag=t;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as n,jsx as t,Fragment as e}from"react/jsx-runtime";import{COLORS as i}from"../../constants/Theme.js";import o from"../../assets/icons/errorIcon.svg.js";import s from"../../assets/icons/successIcon.svg.js";import r from"../../assets/icons/warningIcon.svg.js";import{Button as c}from"../button/Button.js";import{Spinner as a}from"../spinner/Spinner.js";import{TitleRegular as l,TitleMedium as d,BodyPrimary as h,BodySecondary as m}from"../TypographyStyle.js";import{StateComponentContainer as
|
|
1
|
+
import{jsxs as n,jsx as t,Fragment as e}from"react/jsx-runtime";import{COLORS as i}from"../../constants/Theme.js";import o from"../../assets/icons/errorIcon.svg.js";import s from"../../assets/icons/successIcon.svg.js";import r from"../../assets/icons/warningIcon.svg.js";import{Button as c}from"../button/Button.js";import{Spinner as a}from"../spinner/Spinner.js";import{TitleRegular as l,TitleMedium as d,BodyPrimary as h,BodySecondary as m}from"../TypographyStyle.js";import{StateComponentContainer as u,StateIcon as g,StateHeading as p,StateSubline as L,ButtonContainer as b}from"./StateComponent.styled.js";var j,O,S;!function(n){n.SUCCESS="success",n.ERROR="error",n.WARNING="warning",n.LOADING="loading"}(j||(j={})),function(n){n.CANCEL="cancel",n.OTHER="other"}(O||(O={})),function(n){n.SINGLE="SINGLE",n.DOUBLE="DOUBLE"}(S||(S={}));const y=y=>{var E;const C=()=>f==j.SUCCESS?t(s,{}):f==j.WARNING?t(r,{}):f==j.ERROR?t(o,{}):f===j.LOADING?t(a,{size:"large"}):void 0,{states:f,heading:I,subline:R,icon:T=C(),isButtonEnabled:A,type:N,buttonText:z,buttonType:v,onButtonClick:B,leadingIcon:G,width:W,headerImage:w,iconWidth:x,iconHeight:D,closeButtonType:U}=y;return n(u,Object.assign({width:W},{children:[t(g,Object.assign({iconWidth:x,iconHeight:D},{children:w?t("img",{src:w,width:"100%",height:"auto",alt:""}):T})),n(p,Object.assign({size:y.size},{children:["SMALL"===y.size&&t(l,{children:I}),"SMALL"!==y.size&&t(d,{children:I})]})),n(L,{children:["SMALL"!==y.size&&t(h,Object.assign({color:i.content.secondary},{children:R})),"SMALL"===y.size&&t(m,Object.assign({color:i.content.secondary},{children:R}))]}),null!==(E=y.children)&&void 0!==E?E:t(e,{}),A&&t(e,{children:n(b,Object.assign({size:y.size},{children:[N==S.DOUBLE&&t(c,{onClick:()=>B&&B(O.CANCEL),buttonType:U||"secondary",buttonText:"Cancel",matchParentWidth:!0}),t(c,{onClick:()=>B&&B(O.OTHER),buttonType:null!=v?v:"primary",LeadingIcon:G,buttonText:null!=z?z:"Retry",matchParentWidth:!0})]}))})]}))};export{O as ButtonActions,S as ButtonTypes,y as StateComponent,j as StateInterface};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ReactJSXElement } from '@emotion/react/types/jsx-namespace';
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import { Type } from '../button/model';
|
|
3
4
|
import { ButtonActions, ButtonTypes, StateInterface } from '../states/StateComponent';
|
|
4
5
|
export type StateModalComponentProps = {
|
|
5
6
|
states: StateInterface;
|
|
@@ -18,5 +19,6 @@ export type StateModalComponentProps = {
|
|
|
18
19
|
headerImage?: string;
|
|
19
20
|
iconWidth?: number;
|
|
20
21
|
iconHeight?: number;
|
|
22
|
+
closeButtonType?: Type;
|
|
21
23
|
};
|
|
22
24
|
export declare const StateModalComponent: React.FC<React.PropsWithChildren<StateModalComponentProps>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as t}from"react/jsx-runtime";import{useState as n}from"react";import{ComponentZindex as e}from"../../constants/zindex.js";import o from"../../assets/icons/errorIcon.svg.js";import s from"../../assets/icons/successIcon.svg.js";import i from"../../assets/icons/warningIcon.svg.js";import{StyledModal as r}from"../modals/styledModal.js";import{Spinner as c}from"../spinner/Spinner.js";import{StateInterface as a,StateComponent as
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import{useState as n}from"react";import{ComponentZindex as e}from"../../constants/zindex.js";import o from"../../assets/icons/errorIcon.svg.js";import s from"../../assets/icons/successIcon.svg.js";import i from"../../assets/icons/warningIcon.svg.js";import{StyledModal as r}from"../modals/styledModal.js";import{Spinner as c}from"../spinner/Spinner.js";import{StateInterface as a,StateComponent as l}from"../states/StateComponent.js";const d=d=>{const m=()=>p==a.SUCCESS?t(s,{}):p==a.WARNING?t(i,{}):p==a.ERROR?t(o,{}):p===a.LOADING?t(c,{size:"large"}):void 0,{states:p,heading:u,subline:g,icon:h=m(),isButtonEnabled:I,type:f,buttonText:C,onButtonClick:j,leadingIcon:O,width:b,zIndex:x,headerImage:y,iconHeight:B,iconWidth:S,closeButtonType:A}=d,[T,E]=n(!0);return t(r,Object.assign({open:T,onClose:function(){d.onClose&&d.onClose(),E(!1)},closeOnOutsideClick:!(p===a.LOADING),centralContainerStyles:{display:"flex",alignItems:"center",justifyContent:"center",width:b},hideCrossButton:p===a.LOADING,zIndex:x||e.STATE_MODAL},{children:t(l,Object.assign({states:p,heading:u,subline:g,isButtonEnabled:I,leadingIcon:O,type:f,buttonText:C,onButtonClick:j,icon:h,width:b||400,headerImage:y,iconHeight:B,iconWidth:S,closeButtonType:A},{children:d.children}))}))};export{d as StateModalComponent};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TagProps } from './model';
|
|
2
2
|
export declare const Tag: {
|
|
3
|
-
({ tagText, LeadingIcon, TrailingIcon, onLeadingIconClicked, leadingIconId, trailingIconId, onTrailingIconClicked, theme, type, variant, version, cursor, }: TagProps): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
({ tagText, LeadingIcon, TrailingIcon, onLeadingIconClicked, leadingIconId, trailingIconId, onTrailingIconClicked, theme, type, variant, version, cursor, alignIcon, }: TagProps): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
displayName: string;
|
|
5
5
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as i}from"react/jsx-runtime";import n from"react";import{AiBodyTiny as r,AiBodyCaption as t,BodyTiny as a,BodyCaption as c}from"../TypographyStyle.js";import{ValidTagTypeMap as s}from"./model.js";import{Tag as o}from"./Tag.styled.js";import{getTagIconColor as l}from"./themes.js";const
|
|
1
|
+
import{jsx as e,jsxs as i}from"react/jsx-runtime";import n from"react";import{AiBodyTiny as r,AiBodyCaption as t,BodyTiny as a,BodyCaption as c}from"../TypographyStyle.js";import{ValidTagTypeMap as s}from"./model.js";import{Tag as o}from"./Tag.styled.js";import{getTagIconColor as l}from"./themes.js";const g=g=>{let{tagText:d,LeadingIcon:m,TrailingIcon:p,onLeadingIconClicked:h,leadingIconId:j,trailingIconId:b,onTrailingIconClicked:u,theme:y="light",type:I="neutral",variant:O="regular",version:f,cursor:T,alignIcon:k}=g,v=d;const w=y;let N=I;s[O][I]||(N="neutral"),"circle"===O&&"number"==typeof v&&v>99&&(v="99+");const x={height:"compressed"===O?11:16,width:"compressed"===O?11:16,color:l(y,N),style:{display:"block"}};return e(o,Object.assign({cursor:T,theme:w,type:I,variant:O,version:f,alignIcon:k},{children:i("div",Object.assign({className:"container"},{children:[m&&e("button",Object.assign({className:"icon-leading",onClick:h,id:`${j}-wrapper`||"leading-icon-wrapper"},{children:n.createElement(m,Object.assign(Object.assign({},x),{id:j||"leading-icon"}))})),""!==v&&("ai"===I&&"light"===y?e("compressed"===O?r:t,{children:v}):e("compressed"===O?a:c,Object.assign({className:"text"},{children:v}))),p&&e("button",Object.assign({className:"icon-trailing",onClick:u,id:`${b}-wrapper`||"trailing-icon-wrapper"},{children:n.createElement(p,Object.assign(Object.assign({},x),{id:b||"trailing-icon"}))}))]}))}))};g.displayName="Tag";export{g as Tag};
|
|
@@ -9,4 +9,5 @@ export declare const Tag: import("@emotion/styled").StyledComponent<{
|
|
|
9
9
|
variant: TagVariant;
|
|
10
10
|
version?: "1.0" | "2.0" | undefined;
|
|
11
11
|
cursor?: string | undefined;
|
|
12
|
+
alignIcon?: string | undefined;
|
|
12
13
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import c from"@emotion/styled/base";import{getPadding as l,getBackgroundColor as b,generateBorder as d,getTextColor as
|
|
1
|
+
import c from"@emotion/styled/base";import{getPadding as l,getBackgroundColor as b,generateBorder as d,getTextColor as n}from"./themes.js";const t=c("div","production"===process.env.NODE_ENV?{target:"e930jd90"}:{target:"e930jd90",label:"Tag"})("cursor:",(c=>{var l;return null!==(l=c.cursor)&&void 0!==l?l:"default"}),";",(c=>"regular"===c.variant?"display: block;\n\t\t min-height: 26px;\n\t\t":"min-height: 20px;")," .container{display:flex;align-items:",(c=>c.alignIcon?c.alignIcon:"center"),";gap:6px;padding:",(c=>l(c.variant)),";background:",(c=>b(c.theme,c.type)),";border-radius:",(c=>"regular"===c.variant?"4px":"12px"),";",(c=>"light"===c.theme&&`border: ${"2.0"===c.version?.5:1}px solid ${d(c.type,c.theme)};`)," .text{color:",(c=>n(c.theme,c.type)),";}.icon-trailing{all:unset;display:flex;}.icon-leading{all:unset;display:flex;}}"+("production"===process.env.NODE_ENV?"":"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlRhZy5zdHlsZWQudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUU4QiIsImZpbGUiOiJUYWcuc3R5bGVkLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcclxuaW1wb3J0IHsgZ2VuZX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