@popsure/dirty-swan 0.66.26 → 0.66.27
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/index.js +6 -5
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/components/table/components/TableCell/ButtonCell/ButtonCell.js +3 -3
- package/dist/esm/components/table/components/TableCell/ButtonCell/ButtonCell.js.map +1 -1
- package/dist/esm/components/table/components/TableCell/TableCell.js +3 -2
- package/dist/esm/components/table/components/TableCell/TableCell.js.map +1 -1
- package/package.json +1 -1
- package/src/lib/components/table/components/TableCell/ButtonCell/ButtonCell.module.scss +5 -0
- package/src/lib/components/table/components/TableCell/ButtonCell/ButtonCell.tsx +1 -0
- package/src/lib/components/table/components/TableCell/TableCell.module.scss +6 -0
- package/src/lib/components/table/components/TableCell/TableCell.tsx +1 -0
|
@@ -8,14 +8,14 @@ import '../../../../../_commonjsHelpers-BFTU3MAI.js';
|
|
|
8
8
|
import '../../../../icon/IconWrapper/IconWrapper.js';
|
|
9
9
|
import '../../../../../tslib.es6-CVlKGIvp.js';
|
|
10
10
|
|
|
11
|
-
var css_248z = ".ButtonCell-module_buttonCell__x4NNi {\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: calc(100% + 40px);\n margin-left: -20px;\n margin-right: -20px;\n padding: 16px 24px;\n border-radius: 12px;\n border: 1px solid #e7e7ed;\n background-color: transparent;\n color: #26262e;\n cursor: pointer;\n transition: border-color 0.3s ease-in-out, background-color 0.3s ease-in-out;\n text-align: left;\n}\n.ButtonCell-module_buttonCell__x4NNi:hover:not(:disabled):not(.ButtonCell-module_selected__22pF_) {\n background-color: #FAF8F5;\n}\n.ButtonCell-module_buttonCell__x4NNi:focus-visible {\n outline: 1px solid #26262e;\n outline-offset: 0;\n}\n@media (max-width: 34rem) {\n .ButtonCell-module_buttonCell__x4NNi {\n pointer-events: none;\n }\n}\n\n.ButtonCell-module_selected__22pF_ {\n border: 1px solid #26262e;\n background-color: #FAF8F5;\n}\n\n.ButtonCell-module_disabled__1TmtK {\n background-color: #f7f7fd;\n cursor: default;\n opacity: 1;\n pointer-events: none;\n}";
|
|
12
|
-
var styles = {"buttonCell":"ButtonCell-module_buttonCell__x4NNi","selected":"ButtonCell-module_selected__22pF_","disabled":"ButtonCell-module_disabled__1TmtK"};
|
|
11
|
+
var css_248z = ".ButtonCell-module_wrapper__1H62k {\n height: 100%;\n}\n\n.ButtonCell-module_buttonCell__x4NNi {\n flex: 1;\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: calc(100% + 40px);\n margin-left: -20px;\n margin-right: -20px;\n padding: 16px 24px;\n border-radius: 12px;\n border: 1px solid #e7e7ed;\n background-color: transparent;\n color: #26262e;\n cursor: pointer;\n transition: border-color 0.3s ease-in-out, background-color 0.3s ease-in-out;\n text-align: left;\n}\n.ButtonCell-module_buttonCell__x4NNi:hover:not(:disabled):not(.ButtonCell-module_selected__22pF_) {\n background-color: #FAF8F5;\n}\n.ButtonCell-module_buttonCell__x4NNi:focus-visible {\n outline: 1px solid #26262e;\n outline-offset: 0;\n}\n@media (max-width: 34rem) {\n .ButtonCell-module_buttonCell__x4NNi {\n pointer-events: none;\n }\n}\n\n.ButtonCell-module_selected__22pF_ {\n border: 1px solid #26262e;\n background-color: #FAF8F5;\n}\n\n.ButtonCell-module_disabled__1TmtK {\n background-color: #f7f7fd;\n cursor: default;\n opacity: 1;\n pointer-events: none;\n}";
|
|
12
|
+
var styles = {"wrapper":"ButtonCell-module_wrapper__1H62k","buttonCell":"ButtonCell-module_buttonCell__x4NNi","selected":"ButtonCell-module_selected__22pF_","disabled":"ButtonCell-module_disabled__1TmtK"};
|
|
13
13
|
styleInject(css_248z);
|
|
14
14
|
|
|
15
15
|
var ButtonCell = function (_a) {
|
|
16
16
|
var _b;
|
|
17
17
|
var isSelected = _a.isSelected, onClick = _a.onClick, buttonCaption = _a.buttonCaption, price = _a.price, disabled = _a.disabled, className = _a.className, dataCy = _a.dataCy, dataTestId = _a.dataTestId;
|
|
18
|
-
return (jsx("div", { className: classNames("w100 d-flex fd-column ai-start jc-center gap8", className), "data-cy": dataCy, "data-testid": dataTestId, children: jsxs("button", { className: classNames('w100 wmx5', styles.buttonCell, (_b = {},
|
|
18
|
+
return (jsx("div", { className: classNames("w100 d-flex fd-column ai-start jc-center gap8", styles.wrapper, className), "data-cy": dataCy, "data-testid": dataTestId, children: jsxs("button", { className: classNames('w100 wmx5', styles.buttonCell, (_b = {},
|
|
19
19
|
_b[styles.selected] = isSelected,
|
|
20
20
|
_b[styles.disabled] = disabled,
|
|
21
21
|
_b)), type: "button", onClick: onClick, disabled: disabled, children: [jsxs("div", { className: "d-flex fd-column ai-start", children: [jsx("span", { className: "p-p fw-bold", children: buttonCaption }), price && jsx("span", { className: "p-p", children: price })] }), !disabled && (isSelected ? (jsx(CircleSelectedIcon, { size: 16 })) : (jsx(CircleUnselectedIcon, { size: 16 })))] }) }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonCell.js","sources":["../../../../../../../../src/lib/components/table/components/TableCell/ButtonCell/ButtonCell.tsx"],"sourcesContent":["import classNames from 'classnames';\n\nimport styles from './ButtonCell.module.scss';\nimport { CircleSelectedIcon, CircleUnselectedIcon } from '../../../../icon';\nimport { ReactNode } from 'react';\n\nexport type ButtonCellProps = {\n buttonCaption: ReactNode;\n disabled?: boolean;\n isSelected?: boolean;\n onClick: () => void;\n price?: ReactNode;\n className?: string;\n dataTestId?: string;\n dataCy?: string;\n};\n\nexport const ButtonCell = ({\n isSelected,\n onClick,\n buttonCaption,\n price,\n disabled,\n className,\n dataCy,\n dataTestId,\n}: ButtonCellProps) => {\n return (\n <div\n className={classNames(\n \"w100 d-flex fd-column ai-start jc-center gap8\",\n className,\n )}\n data-cy={dataCy}\n data-testid={dataTestId}\n >\n <button\n className={classNames('w100 wmx5', styles.buttonCell, {\n [styles.selected]: isSelected,\n [styles.disabled]: disabled,\n })}\n type=\"button\"\n onClick={onClick}\n disabled={disabled}\n >\n <div className=\"d-flex fd-column ai-start\">\n <span className=\"p-p fw-bold\">{buttonCaption}</span>\n {price && <span className=\"p-p\">{price}</span>}\n </div>\n {!disabled && (isSelected ? (\n <CircleSelectedIcon size={16} />\n ) : (\n <CircleUnselectedIcon size={16} />\n ))}\n </button>\n </div>\n );\n};\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;;;;;;;;;;AAiBO,IAAM,UAAU,GAAG,UAAC,EAST,EAAA;;QARhB,UAAU,GAAA,EAAA,CAAA,UAAA,EACV,OAAO,GAAA,EAAA,CAAA,OAAA,EACP,aAAa,GAAA,EAAA,CAAA,aAAA,EACb,KAAK,GAAA,EAAA,CAAA,KAAA,EACL,QAAQ,GAAA,EAAA,CAAA,QAAA,EACR,SAAS,GAAA,EAAA,CAAA,SAAA,EACT,MAAM,GAAA,EAAA,CAAA,MAAA,EACN,UAAU,GAAA,EAAA,CAAA,UAAA;
|
|
1
|
+
{"version":3,"file":"ButtonCell.js","sources":["../../../../../../../../src/lib/components/table/components/TableCell/ButtonCell/ButtonCell.tsx"],"sourcesContent":["import classNames from 'classnames';\n\nimport styles from './ButtonCell.module.scss';\nimport { CircleSelectedIcon, CircleUnselectedIcon } from '../../../../icon';\nimport { ReactNode } from 'react';\n\nexport type ButtonCellProps = {\n buttonCaption: ReactNode;\n disabled?: boolean;\n isSelected?: boolean;\n onClick: () => void;\n price?: ReactNode;\n className?: string;\n dataTestId?: string;\n dataCy?: string;\n};\n\nexport const ButtonCell = ({\n isSelected,\n onClick,\n buttonCaption,\n price,\n disabled,\n className,\n dataCy,\n dataTestId,\n}: ButtonCellProps) => {\n return (\n <div\n className={classNames(\n \"w100 d-flex fd-column ai-start jc-center gap8\",\n styles.wrapper,\n className,\n )}\n data-cy={dataCy}\n data-testid={dataTestId}\n >\n <button\n className={classNames('w100 wmx5', styles.buttonCell, {\n [styles.selected]: isSelected,\n [styles.disabled]: disabled,\n })}\n type=\"button\"\n onClick={onClick}\n disabled={disabled}\n >\n <div className=\"d-flex fd-column ai-start\">\n <span className=\"p-p fw-bold\">{buttonCaption}</span>\n {price && <span className=\"p-p\">{price}</span>}\n </div>\n {!disabled && (isSelected ? (\n <CircleSelectedIcon size={16} />\n ) : (\n <CircleUnselectedIcon size={16} />\n ))}\n </button>\n </div>\n );\n};\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;;;;;;;;;;AAiBO,IAAM,UAAU,GAAG,UAAC,EAST,EAAA;;QARhB,UAAU,GAAA,EAAA,CAAA,UAAA,EACV,OAAO,GAAA,EAAA,CAAA,OAAA,EACP,aAAa,GAAA,EAAA,CAAA,aAAA,EACb,KAAK,GAAA,EAAA,CAAA,KAAA,EACL,QAAQ,GAAA,EAAA,CAAA,QAAA,EACR,SAAS,GAAA,EAAA,CAAA,SAAA,EACT,MAAM,GAAA,EAAA,CAAA,MAAA,EACN,UAAU,GAAA,EAAA,CAAA,UAAA;AAEV,IAAA,QACEA,GAAA,CAAA,KAAA,EAAA,EACE,SAAS,EAAE,UAAU,CACnB,+CAA+C,EAC/C,MAAM,CAAC,OAAO,EACd,SAAS,CACV,EAAA,SAAA,EACQ,MAAM,EAAA,aAAA,EACF,UAAU,EAAA,QAAA,EAEvBC,IAAA,CAAA,QAAA,EAAA,EACE,SAAS,EAAE,UAAU,CAAC,WAAW,EAAE,MAAM,CAAC,UAAU,GAAA,EAAA,GAAA,EAAA;AAClD,gBAAA,EAAA,CAAC,MAAM,CAAC,QAAQ,CAAA,GAAG,UAAU;AAC7B,gBAAA,EAAA,CAAC,MAAM,CAAC,QAAQ,CAAA,GAAG,QAAQ;AAC3B,gBAAA,EAAA,EAAA,EACF,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,EAAA,QAAA,EAAA,CAElBA,IAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAC,2BAA2B,EAAA,QAAA,EAAA,CACxCD,GAAA,CAAA,MAAA,EAAA,EAAM,SAAS,EAAC,aAAa,EAAA,QAAA,EAAE,aAAa,EAAA,CAAQ,EACnD,KAAK,IAAIA,GAAA,CAAA,MAAA,EAAA,EAAM,SAAS,EAAC,KAAK,YAAE,KAAK,EAAA,CAAQ,CAAA,EAAA,CAC1C,EACL,CAAC,QAAQ,KAAK,UAAU,IACvBA,GAAA,CAAC,kBAAkB,EAAA,EAAC,IAAI,EAAE,EAAE,EAAA,CAAI,KAEhCA,GAAA,CAAC,oBAAoB,EAAA,EAAC,IAAI,EAAE,EAAE,GAAI,CACnC,CAAC,CAAA,EAAA,CACK,EAAA,CACL;AAEV;;;;"}
|
|
@@ -27,8 +27,8 @@ import '../../../icon/icons/ChevronRight.js';
|
|
|
27
27
|
import '../../../icon/icons/CircleSelected.js';
|
|
28
28
|
import '../../../icon/icons/CircleUnselected.js';
|
|
29
29
|
|
|
30
|
-
var css_248z = ".TableCell-module_th__2rjCU {\n vertical-align: middle;\n scroll-snap-align: end;\n width: 50%;\n padding: 28px 24px;\n}\n@media (min-width: 34rem) {\n .TableCell-module_th__2rjCU {\n width: auto;\n scroll-snap-align: unset;\n }\n}\n.TableCell-module_thNavigation__qZ2sY {\n width: 100%;\n}\n@media (min-width: 34rem) {\n .TableCell-module_thNavigation__qZ2sY {\n width: auto;\n }\n}\n\n.TableCell-module_navigationTitle__2FiRB {\n padding-left: 0;\n}\n\n.TableCell-module_headerCell__aVTIn {\n vertical-align: top;\n}\n\n.TableCell-module_subtitleCell__1DzfG {\n vertical-align: middle;\n}\n\n.TableCell-module_fixedCell__cL3-m {\n position: sticky;\n left: 0;\n z-index: 2;\n padding-left: 0;\n}\n\n.TableCell-module_selectedColumnTop__1GcJz {\n border-radius: 16px 16px 0 0;\n}\n\n.TableCell-module_selectedColumnBottom__qiMke {\n border-radius: 0 0 16px 16px;\n}\n\n.TableCell-module_fixedCard__2LO8s {\n position: sticky;\n left: 0;\n right: 0;\n z-index: 2;\n width: 100%;\n}";
|
|
31
|
-
var styles = {"th":"TableCell-module_th__2rjCU","thNavigation":"TableCell-module_thNavigation__qZ2sY","navigationTitle":"TableCell-module_navigationTitle__2FiRB","headerCell":"TableCell-module_headerCell__aVTIn","subtitleCell":"TableCell-module_subtitleCell__1DzfG","fixedCell":"TableCell-module_fixedCell__cL3-m","selectedColumnTop":"TableCell-module_selectedColumnTop__1GcJz","selectedColumnBottom":"TableCell-module_selectedColumnBottom__qiMke","fixedCard":"TableCell-module_fixedCard__2LO8s"};
|
|
30
|
+
var css_248z = ".TableCell-module_th__2rjCU {\n vertical-align: middle;\n scroll-snap-align: end;\n width: 50%;\n padding: 28px 24px;\n}\n@media (min-width: 34rem) {\n .TableCell-module_th__2rjCU {\n width: auto;\n scroll-snap-align: unset;\n }\n}\n.TableCell-module_thNavigation__qZ2sY {\n width: 100%;\n}\n@media (min-width: 34rem) {\n .TableCell-module_thNavigation__qZ2sY {\n width: auto;\n }\n}\n\n.TableCell-module_navigationTitle__2FiRB {\n padding-left: 0;\n}\n\n.TableCell-module_headerCell__aVTIn {\n vertical-align: top;\n}\n\n.TableCell-module_subtitleCell__1DzfG {\n vertical-align: middle;\n}\n\n.TableCell-module_fixedCell__cL3-m {\n position: sticky;\n left: 0;\n z-index: 2;\n padding-left: 0;\n}\n\n.TableCell-module_buttonCell__15CRG {\n height: 1px;\n}\n\n.TableCell-module_selectedColumnTop__1GcJz {\n border-radius: 16px 16px 0 0;\n}\n\n.TableCell-module_selectedColumnBottom__qiMke {\n border-radius: 0 0 16px 16px;\n}\n\n.TableCell-module_fixedCard__2LO8s {\n position: sticky;\n left: 0;\n right: 0;\n z-index: 2;\n width: 100%;\n}";
|
|
31
|
+
var styles = {"th":"TableCell-module_th__2rjCU","thNavigation":"TableCell-module_thNavigation__qZ2sY","navigationTitle":"TableCell-module_navigationTitle__2FiRB","headerCell":"TableCell-module_headerCell__aVTIn","subtitleCell":"TableCell-module_subtitleCell__1DzfG","fixedCell":"TableCell-module_fixedCell__cL3-m","buttonCell":"TableCell-module_buttonCell__15CRG","selectedColumnTop":"TableCell-module_selectedColumnTop__1GcJz","selectedColumnBottom":"TableCell-module_selectedColumnBottom__qiMke","fixedCard":"TableCell-module_fixedCard__2LO8s"};
|
|
32
32
|
styleInject(css_248z);
|
|
33
33
|
|
|
34
34
|
var TableCell = React__default.memo(function (_a) {
|
|
@@ -55,6 +55,7 @@ var TableCell = React__default.memo(function (_a) {
|
|
|
55
55
|
_b[styles.navigationTitle] = isNavigation && isTopLeftCell,
|
|
56
56
|
_b[styles.fixedCell] = isFirstCellInRow && colSpan < 1,
|
|
57
57
|
_b[styles.fixedCard] = cellProps.type === 'CARD',
|
|
58
|
+
_b[styles.buttonCell] = cellProps.type === 'BUTTON',
|
|
58
59
|
_b[styles.selectedColumnTop] = selectedColumnPosition === 'top',
|
|
59
60
|
_b[styles.selectedColumnBottom] = selectedColumnPosition === 'bottom',
|
|
60
61
|
_b)), colSpan: isBelowDesktop && cellProps.type === 'CARD' ? 2 : colSpan, children: [!cellProps.type && (jsx(BaseCell, __assign({}, cellProps, { fontVariant: (_c = cellProps.fontVariant) !== null && _c !== void 0 ? _c : (isTopLeftCell ? 'TITLE' : 'NORMAL') }))), cellProps.type === 'CTA' && (jsx(CTACell, __assign({}, cellProps, { centered: isNavigation }))), cellProps.type === 'BUTTON' && jsx(ButtonCell, __assign({}, cellProps)), cellProps.type === 'CARD' && jsx(CardCell, __assign({}, cellProps))] })));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableCell.js","sources":["../../../../../../../src/lib/components/table/components/TableCell/TableCell.tsx"],"sourcesContent":["import classNames from 'classnames';\n\nimport styles from './TableCell.module.scss';\nimport { BaseCell } from './BaseCell/BaseCell';\nimport { TableCellData } from '../../types';\nimport { CTACell } from './CTACell/CTACell';\nimport { CardCell } from './CardCell/CardCell';\nimport { ButtonCell } from './ButtonCell/ButtonCell';\nimport React from 'react';\n\ntype ExtraTableCellProps = {\n isHeader?: boolean;\n isFirstCellInRow?: boolean;\n isTopLeftCell?: boolean;\n isNavigation?: boolean;\n isSelectedColumn?: boolean;\n selectedColumnPosition?: 'top' | 'bottom' | 'middle';\n imageComponent?: (args: any) => JSX.Element;\n isBelowDesktop?: boolean;\n};\n\nexport type TableCellProps = TableCellData & ExtraTableCellProps;\n\nconst TableCell = React.memo(\n ({\n isFirstCellInRow = false,\n isHeader = false,\n isNavigation = false,\n isSelectedColumn = false,\n selectedColumnPosition,\n isTopLeftCell = false,\n colSpan = 0,\n isBelowDesktop,\n ...cellProps\n }: TableCellProps) => {\n // prettier-ignore\n const Tag = isNavigation\n ? 'div'\n : isHeader || isFirstCellInRow ? 'th' : 'td';\n\n // prettier-ignore\n const thScope = isHeader\n ? 'col'\n : isFirstCellInRow ? 'row' : undefined;\n\n const scope = {\n scope: thScope,\n };\n\n return (\n <Tag\n {...scope}\n className={classNames(isSelectedColumn ? 'bg-orange-50' : 'bg-white', styles.th, {\n 'ta-left': isFirstCellInRow,\n [styles.headerCell]: isHeader,\n [styles.subtitleCell]:\n !cellProps.type && cellProps.fontVariant === 'SUBTITLE',\n [styles.thNavigation]: isNavigation,\n [styles.navigationTitle]: isNavigation && isTopLeftCell,\n [styles.fixedCell]: isFirstCellInRow && colSpan < 1 ,\n [styles.fixedCard]: cellProps.type === 'CARD',\n [styles.selectedColumnTop]: selectedColumnPosition === 'top',\n [styles.selectedColumnBottom]: selectedColumnPosition === 'bottom',\n })}\n colSpan={isBelowDesktop && cellProps.type === 'CARD' ? 2 : colSpan}\n >\n {!cellProps.type && (\n <BaseCell\n {...cellProps}\n fontVariant={\n cellProps.fontVariant ?? (isTopLeftCell ? 'TITLE' : 'NORMAL')\n }\n />\n )}\n {cellProps.type === 'CTA' && (\n <CTACell {...cellProps} centered={isNavigation} />\n )}\n {cellProps.type === 'BUTTON' && <ButtonCell {...cellProps} />}\n {cellProps.type === 'CARD' && <CardCell {...cellProps} />}\n </Tag>\n );\n }\n);\n\nexport { TableCell };\n"],"names":["React","_jsxs","_jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;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AgB,GAAG,cAAc,GAAG,UAAU,EAAE,MAAM,CAAC,EAAE,GAAA,EAAA,GAAA;AAC7E,gBAAA,SAAS,EAAE;;AACX,YAAA,EAAA,CAAC,MAAM,CAAC,UAAU,CAAA,GAAG,QAAQ;AAC7B,YAAA,EAAA,CAAC,MAAM,CAAC,YAAY,CAAA,GAClB,CAAC,SAAS,CAAC,IAAI,IAAI,SAAS,CAAC,WAAW,KAAK,UAAU;AACzD,YAAA,EAAA,CAAC,MAAM,CAAC,YAAY,CAAA,GAAG,YAAY;AACnC,YAAA,EAAA,CAAC,MAAM,CAAC,eAAe,CAAA,GAAG,YAAY,IAAI,aAAa;YACvD,EAAA,CAAC,MAAM,CAAC,SAAS,CAAA,GAAG,gBAAgB,IAAI,OAAO,GAAG,CAAC;YACnD,EAAA,CAAC,MAAM,CAAC,SAAS,CAAA,GAAG,SAAS,CAAC,IAAI,KAAK,MAAM;
|
|
1
|
+
{"version":3,"file":"TableCell.js","sources":["../../../../../../../src/lib/components/table/components/TableCell/TableCell.tsx"],"sourcesContent":["import classNames from 'classnames';\n\nimport styles from './TableCell.module.scss';\nimport { BaseCell } from './BaseCell/BaseCell';\nimport { TableCellData } from '../../types';\nimport { CTACell } from './CTACell/CTACell';\nimport { CardCell } from './CardCell/CardCell';\nimport { ButtonCell } from './ButtonCell/ButtonCell';\nimport React from 'react';\n\ntype ExtraTableCellProps = {\n isHeader?: boolean;\n isFirstCellInRow?: boolean;\n isTopLeftCell?: boolean;\n isNavigation?: boolean;\n isSelectedColumn?: boolean;\n selectedColumnPosition?: 'top' | 'bottom' | 'middle';\n imageComponent?: (args: any) => JSX.Element;\n isBelowDesktop?: boolean;\n};\n\nexport type TableCellProps = TableCellData & ExtraTableCellProps;\n\nconst TableCell = React.memo(\n ({\n isFirstCellInRow = false,\n isHeader = false,\n isNavigation = false,\n isSelectedColumn = false,\n selectedColumnPosition,\n isTopLeftCell = false,\n colSpan = 0,\n isBelowDesktop,\n ...cellProps\n }: TableCellProps) => {\n // prettier-ignore\n const Tag = isNavigation\n ? 'div'\n : isHeader || isFirstCellInRow ? 'th' : 'td';\n\n // prettier-ignore\n const thScope = isHeader\n ? 'col'\n : isFirstCellInRow ? 'row' : undefined;\n\n const scope = {\n scope: thScope,\n };\n\n return (\n <Tag\n {...scope}\n className={classNames(isSelectedColumn ? 'bg-orange-50' : 'bg-white', styles.th, {\n 'ta-left': isFirstCellInRow,\n [styles.headerCell]: isHeader,\n [styles.subtitleCell]:\n !cellProps.type && cellProps.fontVariant === 'SUBTITLE',\n [styles.thNavigation]: isNavigation,\n [styles.navigationTitle]: isNavigation && isTopLeftCell,\n [styles.fixedCell]: isFirstCellInRow && colSpan < 1 ,\n [styles.fixedCard]: cellProps.type === 'CARD',\n [styles.buttonCell]: cellProps.type === 'BUTTON',\n [styles.selectedColumnTop]: selectedColumnPosition === 'top',\n [styles.selectedColumnBottom]: selectedColumnPosition === 'bottom',\n })}\n colSpan={isBelowDesktop && cellProps.type === 'CARD' ? 2 : colSpan}\n >\n {!cellProps.type && (\n <BaseCell\n {...cellProps}\n fontVariant={\n cellProps.fontVariant ?? (isTopLeftCell ? 'TITLE' : 'NORMAL')\n }\n />\n )}\n {cellProps.type === 'CTA' && (\n <CTACell {...cellProps} centered={isNavigation} />\n )}\n {cellProps.type === 'BUTTON' && <ButtonCell {...cellProps} />}\n {cellProps.type === 'CARD' && <CardCell {...cellProps} />}\n </Tag>\n );\n }\n);\n\nexport { TableCell };\n"],"names":["React","_jsxs","_jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuBA,IAAM,SAAS,GAAGA,cAAK,CAAC,IAAI,CAC1B,UAAC,EAUgB,EAAA;;;IATf,IAAA,EAAA,GAAA,EAAA,CAAA,gBAAwB,EAAxB,gBAAgB,GAAA,EAAA,KAAA,MAAA,GAAG,KAAK,GAAA,EAAA,EACxB,EAAA,GAAA,EAAA,CAAA,QAAgB,EAAhB,QAAQ,GAAA,EAAA,KAAA,MAAA,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V,CAAC;;;;"}
|
package/package.json
CHANGED
|
@@ -42,6 +42,12 @@
|
|
|
42
42
|
padding-left: 0;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
+
// Lets the ButtonCell stretch (height: 100%) so buttons in the same row match
|
|
46
|
+
// the tallest one; the cell still grows with its content.
|
|
47
|
+
.buttonCell {
|
|
48
|
+
height: 1px;
|
|
49
|
+
}
|
|
50
|
+
|
|
45
51
|
.selectedColumnTop {
|
|
46
52
|
border-radius: 16px 16px 0 0;
|
|
47
53
|
}
|
|
@@ -59,6 +59,7 @@ const TableCell = React.memo(
|
|
|
59
59
|
[styles.navigationTitle]: isNavigation && isTopLeftCell,
|
|
60
60
|
[styles.fixedCell]: isFirstCellInRow && colSpan < 1 ,
|
|
61
61
|
[styles.fixedCard]: cellProps.type === 'CARD',
|
|
62
|
+
[styles.buttonCell]: cellProps.type === 'BUTTON',
|
|
62
63
|
[styles.selectedColumnTop]: selectedColumnPosition === 'top',
|
|
63
64
|
[styles.selectedColumnBottom]: selectedColumnPosition === 'bottom',
|
|
64
65
|
})}
|