@bikdotai/bik-component-library 0.0.617-bug-beta0.7 → 0.0.617-bug-beta0.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../constants/Theme.js"),i=require("../spinner/Spinner.js"),n=require("../tooltips/Tooltip.js"),s=require("../TypographyStyle.js"),l=require("./CardSelector.styled.js");const r=n=>{var r,o;return e.jsx(l.Container,Object.assign({style:{alignItems:n.title&&n.subtitle?"flex-start":"center"},selected:n.selected,disabled:null!==(r=n.disabled)&&void 0!==r&&r,loading:null!==(o=n.loading)&&void 0!==o&&o,onClick:()=>{n.disabled||n.loading||n.onCardClick(n.id)},isTooltipPresent:!!n.tooltip},{children:n.loading?e.jsx(l.Loader,{children:e.jsx(i.Spinner,{size:"large"})}):e.jsxs(e.Fragment,{children:[(null==n?void 0:n.icon)&&e.jsx("div",Object.assign({style:{width:24,height:24}},{children:e.jsx(n.icon,{width:24,color:n.selected?t.COLORS.content.brand:n.disabled?t.COLORS.content.inactive:t.COLORS.content.placeholder})})),e.jsxs("div",Object.assign({"data-test":null==n?void 0:n.dataTestId},{children:[n.title&&e.jsx(s.TitleSmall,Object.assign({style:{color:n.selected?t.COLORS.content.brand:n.disabled?t.COLORS.content.inactive:t.COLORS.content.secondary}},{children:n.title})),n.subtitle&&e.jsx(s.BodyCaption,Object.assign({style:{marginTop:n.title?4:0,color:n.selected?t.COLORS.content.brand:n.disabled?t.COLORS.content.inactive:t.COLORS.content.secondary}},{children:n.subtitle}))]}))]})}))};exports.CardSelector=t=>e.jsx(e.Fragment,{children:t.tooltip?e.jsx(n.Tooltip,Object.assign({title:t.tooltip},{children:e.jsx("span",Object.assign({style:{display:"inline-block"}},{children:e.jsx(r,Object.assign({},t))}))})):e.jsx(r,Object.assign({},t))});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as t,Fragment as e,jsxs as i}from"react/jsx-runtime";import n
|
|
1
|
+
import{jsx as t,Fragment as e,jsxs as i}from"react/jsx-runtime";import{COLORS as n}from"../../constants/Theme.js";import{Spinner as l}from"../spinner/Spinner.js";import{Tooltip as o}from"../tooltips/Tooltip.js";import{TitleSmall as s,BodyCaption as d}from"../TypographyStyle.js";import{Container as c,Loader as r}from"./CardSelector.styled.js";const a=i=>t(e,{children:i.tooltip?t(o,Object.assign({title:i.tooltip},{children:t("span",Object.assign({style:{display:"inline-block"}},{children:t(b,Object.assign({},i))}))})):t(b,Object.assign({},i))}),b=o=>{var a,b;return t(c,Object.assign({style:{alignItems:o.title&&o.subtitle?"flex-start":"center"},selected:o.selected,disabled:null!==(a=o.disabled)&&void 0!==a&&a,loading:null!==(b=o.loading)&&void 0!==b&&b,onClick:()=>{o.disabled||o.loading||o.onCardClick(o.id)},isTooltipPresent:!!o.tooltip},{children:o.loading?t(r,{children:t(l,{size:"large"})}):i(e,{children:[(null==o?void 0:o.icon)&&t("div",Object.assign({style:{width:24,height:24}},{children:t(o.icon,{width:24,color:o.selected?n.content.brand:o.disabled?n.content.inactive:n.content.placeholder})})),i("div",Object.assign({"data-test":null==o?void 0:o.dataTestId},{children:[o.title&&t(s,Object.assign({style:{color:o.selected?n.content.brand:o.disabled?n.content.inactive:n.content.secondary}},{children:o.title})),o.subtitle&&t(d,Object.assign({style:{marginTop:o.title?4:0,color:o.selected?n.content.brand:o.disabled?n.content.inactive:n.content.secondary}},{children:o.subtitle}))]}))]})}))};export{a as CardSelector};
|