@popsure/dirty-swan 0.55.1 → 0.55.3
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 +14 -13
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/lib/components/table/components/TableCell/ButtonCell/ButtonCell.d.ts +1 -1
- package/dist/cjs/lib/components/table/components/TableCell/ButtonCell/ButtonCell.stories.d.ts +1 -1
- package/dist/cjs/lib/components/table/components/TableCell/CTACell/CTACell.d.ts +1 -1
- package/dist/cjs/lib/components/table/components/TableCell/CTACell/CTACell.stories.d.ts +1 -1
- package/dist/esm/{TableSection-d7dbad68.js → TableSection-a1be2bd3.js} +1 -1
- package/dist/esm/{TableSection-d7dbad68.js.map → TableSection-a1be2bd3.js.map} +1 -1
- package/dist/esm/components/autocompleteAddress/index.js +7 -6
- package/dist/esm/components/autocompleteAddress/index.js.map +1 -1
- package/dist/esm/components/table/Table.js +2 -2
- package/dist/esm/components/table/Table.js.map +1 -1
- package/dist/esm/components/table/Table.stories.js +1 -1
- package/dist/esm/components/table/Table.test.js +1 -1
- package/dist/esm/components/table/components/TableCell/ButtonCell/ButtonCell.js +4 -4
- package/dist/esm/components/table/components/TableCell/ButtonCell/ButtonCell.js.map +1 -1
- package/dist/esm/components/table/components/TableCell/ButtonCell/ButtonCell.stories.js +1 -1
- package/dist/esm/components/table/components/TableCell/CTACell/CTACell.js +3 -4
- package/dist/esm/components/table/components/TableCell/CTACell/CTACell.js.map +1 -1
- package/dist/esm/components/table/components/TableContents/TableContents.js +1 -1
- package/dist/esm/components/table/components/TableContents/TableContents.test.js +1 -1
- package/dist/esm/components/table/components/TableSection/TableSection.js +1 -1
- package/dist/esm/components/table/components/TableSection/TableSection.test.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/lib/components/table/components/TableCell/ButtonCell/ButtonCell.d.ts +1 -1
- package/dist/esm/lib/components/table/components/TableCell/ButtonCell/ButtonCell.stories.d.ts +1 -1
- package/dist/esm/lib/components/table/components/TableCell/CTACell/CTACell.d.ts +1 -1
- package/dist/esm/lib/components/table/components/TableCell/CTACell/CTACell.stories.d.ts +1 -1
- package/package.json +1 -1
- package/src/lib/components/autocompleteAddress/index.tsx +1 -1
- package/src/lib/components/table/Table.tsx +1 -1
- package/src/lib/components/table/components/TableCell/ButtonCell/ButtonCell.tsx +4 -2
- package/src/lib/components/table/components/TableCell/CTACell/CTACell.tsx +7 -2
|
@@ -7,7 +7,7 @@ import ChevronDownIcon from '../icon/icons/ChevronDown.js';
|
|
|
7
7
|
import ChevronUpIcon from '../icon/icons/ChevronUp.js';
|
|
8
8
|
import { Card } from '../cards/card/index.js';
|
|
9
9
|
import { s as styleInject } from '../../style-inject.es-1f59c1d0.js';
|
|
10
|
-
import { u as useMediaQuery, i as isBaseCell, T as TableSection } from '../../TableSection-
|
|
10
|
+
import { u as useMediaQuery, i as isBaseCell, T as TableSection } from '../../TableSection-a1be2bd3.js';
|
|
11
11
|
import { TableContents } from './components/TableContents/TableContents.js';
|
|
12
12
|
import { c as classNames } from '../../index-6ea95111.js';
|
|
13
13
|
import { u as useTableNavigation } from '../../useTableNavigation-f929fbc9.js';
|
|
@@ -81,7 +81,7 @@ var Table = function (_a) {
|
|
|
81
81
|
});
|
|
82
82
|
},
|
|
83
83
|
}
|
|
84
|
-
: {}), activeCellProps, { imageComponent: imageComponent, isNavigation: true })) })] })) : (jsx("div", { "aria-hidden": true, className: styles.stickyHeader, style: { top: "".concat(stickyHeaderTopOffset, "px") }, children: jsx("div", { className: styles.container, ref: headerRef, children: jsx(TableSection, { cellReplacements: cellReplacements, className: className, hideColumns: hideColumns, openModal: handleOpenModal, tableCellRows: [(_j = (_h = tableData === null || tableData === void 0 ? void 0 : tableData[0]) === null || _h === void 0 ? void 0 : _h.rows) === null || _j === void 0 ? void 0 : _j[0]], title: title, imageComponent: imageComponent }) }) })), jsx("div", { ref: containerRef, className: classNames(styles.container, 'pb8'), children: jsx(TableContents, { tableData: tableData, title: title, className: className, collapsibleSections: collapsibleSections, hideColumns: hideColumns, hideDetails: hideDetails, isMobile: isMobile, shouldHideDetails: shouldHideDetails, openModal: handleOpenModal, cellReplacements: cellReplacements, imageComponent: imageComponent }) }), hideDetails && (jsx(Card, { "data-testid": "show-hide-details", classNames: {
|
|
84
|
+
: {}), activeCellProps, { imageComponent: imageComponent, isNavigation: true })) })] })) : (jsx("div", { "aria-hidden": true, className: styles.stickyHeader, style: { top: "".concat(stickyHeaderTopOffset, "px") }, children: jsx("div", { className: styles.container, ref: headerRef, children: jsx(TableSection, { cellReplacements: cellReplacements, className: className, hideColumns: hideColumns, openModal: handleOpenModal, tableCellRows: [(_j = (_h = tableData === null || tableData === void 0 ? void 0 : tableData[0]) === null || _h === void 0 ? void 0 : _h.rows) === null || _j === void 0 ? void 0 : _j[0]], title: title, imageComponent: imageComponent }) }) })), jsx("div", { ref: containerRef, className: classNames(styles.container, 'pb8'), children: jsx(TableContents, { tableData: tableData, title: title, className: className, collapsibleSections: collapsibleSections, hideColumns: hideColumns, hideDetails: hideDetails, isMobile: isMobile, shouldHideDetails: shouldHideDetails, openModal: handleOpenModal, cellReplacements: cellReplacements, imageComponent: imageComponent }) }), (tableData === null || tableData === void 0 ? void 0 : tableData.length) > 1 && hideDetails && (jsx(Card, { "data-testid": "show-hide-details", classNames: {
|
|
85
85
|
buttonWrapper: 'm8 mt32',
|
|
86
86
|
title: 'd-flex gap8 ai-center jc-center fw-bold',
|
|
87
87
|
wrapper: 'bg-grey-200',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Table.js","sources":["../../../../../src/lib/components/table/Table.tsx"],"sourcesContent":["import { TableCell } from './components/TableCell/TableCell';\nimport { BottomOrRegularModal } from '../modal';\nimport { ReactNode, useCallback, useRef, useState } from 'react';\nimport { ChevronDownIcon, ChevronUpIcon } from '../icon';\nimport { Card } from '../cards/card';\n\nimport styles from './Table.module.scss';\nimport { useMediaQuery } from '../../hooks/useMediaQuery';\nimport { TableContents } from './components/TableContents/TableContents';\nimport classNames from 'classnames';\nimport { useTableNavigation } from './utils/useTableNavigation/useTableNavigation';\nimport { TableControls } from './components/TableControls/TableControls';\nimport { TableSection } from './components/TableSection/TableSection';\nimport { useScrollSync } from './utils/useScrollSync/useScrollSync';\nimport {\n CellReplacements,\n isBaseCell,\n ModalData,\n ModalFunction,\n TableCellData,\n TableData,\n} from './types';\n\ntype TextOverrides = {\n showDetails?: string;\n hideDetails?: string;\n};\n\nexport interface TableProps {\n cellReplacements?: CellReplacements;\n className?: string;\n collapsibleSections?: boolean;\n hideColumns?: number[];\n hideDetails?: boolean;\n imageComponent?: (args: any) => JSX.Element;\n modalContentRenderer?: (content: ReactNode) => ReactNode;\n onModalOpen?: ModalFunction;\n onSelectionChanged?: (index: number) => void;\n stickyHeaderTopOffset?: number;\n tableData: TableData;\n textOverrides?: TextOverrides;\n title: string;\n}\n\nconst defaultTextOverrides = {\n showDetails: 'Show details',\n hideDetails: 'Hide details',\n};\n\nconst Table = ({\n cellReplacements,\n className,\n collapsibleSections,\n hideColumns = [],\n hideDetails,\n imageComponent,\n modalContentRenderer,\n onModalOpen,\n onSelectionChanged,\n stickyHeaderTopOffset = 0,\n tableData,\n textOverrides: definedTextOverrides,\n title,\n}: TableProps) => {\n const textOverrides = { ...defaultTextOverrides, ...definedTextOverrides };\n const isMobile = useMediaQuery('BELOW_MOBILE');\n const [infoModalData, setInfoModalData] = useState<ModalData | null>(null);\n const [shouldHideDetails, setShouldHideDetails] = useState(true);\n const containerRef = useRef<HTMLDivElement | null>(null);\n const headerRef = useRef<HTMLDivElement | null>(null);\n const columnsLength = tableData[0].rows[0].length;\n\n useScrollSync(headerRef, containerRef, !isMobile);\n\n const { activeSection, navigateTable } = useTableNavigation({\n enabled: isMobile,\n containerRef,\n onSelectionChanged,\n });\n\n const titleCell = {\n text: '',\n ...tableData?.[0]?.rows?.[0]?.[0] || {},\n };\n const currentActiveSection = tableData?.[0]?.rows?.[0]?.[activeSection];\n const currentActiveSectionReplacements =\n (currentActiveSection.cellId &&\n cellReplacements?.[currentActiveSection.cellId]) ||\n {};\n\n const activeCellProps = {\n ...currentActiveSection,\n ...currentActiveSectionReplacements,\n } as TableCellData;\n\n const handleOpenModal: ModalFunction = useCallback(({ body, title }) => {\n onModalOpen?.({ body, title });\n setInfoModalData({ body, title });\n }, []);\n\n return (\n <div className={classNames(styles.wrapper, 'bg-white')}>\n {isMobile ? (\n <>\n {titleCell?.text && (\n <TableCell\n {...titleCell}\n align='left'\n isNavigation\n isTopLeftCell\n type={undefined}\n />\n )}\n\n <TableControls\n activeSection={activeSection}\n columnsLength={columnsLength}\n navigateTable={navigateTable}\n stickyHeaderTopOffset={stickyHeaderTopOffset}\n >\n <TableCell\n {...(isBaseCell(currentActiveSection)\n ? {\n openModal: (body: ReactNode) =>\n handleOpenModal({\n body,\n title: currentActiveSection?.text,\n }),\n }\n : {})}\n {...activeCellProps}\n imageComponent={imageComponent}\n isNavigation\n />\n </TableControls>\n </>\n ) : (\n <div\n aria-hidden\n className={styles.stickyHeader}\n style={{ top: `${stickyHeaderTopOffset}px` }}\n >\n <div className={styles.container} ref={headerRef}>\n <TableSection\n cellReplacements={cellReplacements}\n className={className}\n hideColumns={hideColumns}\n openModal={handleOpenModal}\n tableCellRows={[tableData?.[0]?.rows?.[0]]}\n title={title}\n imageComponent={imageComponent}\n />\n </div>\n </div>\n )}\n\n <div ref={containerRef} className={classNames(styles.container, 'pb8')}>\n <TableContents\n tableData={tableData}\n title={title}\n className={className}\n collapsibleSections={collapsibleSections}\n hideColumns={hideColumns}\n hideDetails={hideDetails}\n isMobile={isMobile}\n shouldHideDetails={shouldHideDetails}\n openModal={handleOpenModal}\n cellReplacements={cellReplacements}\n imageComponent={imageComponent}\n />\n </div>\n\n {hideDetails && (\n <Card\n data-testid=\"show-hide-details\"\n classNames={{\n buttonWrapper: 'm8 mt32',\n title: 'd-flex gap8 ai-center jc-center fw-bold',\n wrapper: 'bg-grey-200',\n }}\n title={\n <>\n {shouldHideDetails\n ? textOverrides.showDetails\n : textOverrides.hideDetails}\n {shouldHideDetails ? (\n <ChevronDownIcon size={20} />\n ) : (\n <ChevronUpIcon size={20} />\n )}\n </>\n }\n actionIcon={null}\n dropShadow={false}\n titleVariant=\"small\"\n density=\"compact\"\n onClick={() => setShouldHideDetails((current) => !current)}\n />\n )}\n\n <BottomOrRegularModal\n isOpen={infoModalData?.body ? true : false}\n title={infoModalData?.title}\n onClose={() => setInfoModalData(null)}\n >\n <div className=\"pt8 p24 wmn6\">\n {modalContentRenderer\n ? modalContentRenderer(infoModalData?.body)\n : infoModalData?.body}\n </div>\n </BottomOrRegularModal>\n </div>\n );\n};\n\nexport { Table };\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CA,IAAM,oBAAoB,GAAG;IAC3B,WAAW,EAAE,cAAc;IAC3B,WAAW,EAAE,cAAc;CAC5B,CAAC;IAEI,KAAK,GAAG,UAAC,EAcF;;QAbX,gBAAgB,sBAAA,EAChB,SAAS,eAAA,EACT,mBAAmB,yBAAA,EACnB,mBAAgB,EAAhB,WAAW,mBAAG,EAAE,KAAA,EAChB,WAAW,iBAAA,EACX,cAAc,oBAAA,EACd,oBAAoB,0BAAA,EACpB,WAAW,iBAAA,EACX,kBAAkB,wBAAA,EAClB,6BAAyB,EAAzB,qBAAqB,mBAAG,CAAC,KAAA,EACzB,SAAS,eAAA,EACM,oBAAoB,mBAAA,EACnC,KAAK,WAAA;IAEL,IAAM,aAAa,yBAAQ,oBAAoB,GAAK,oBAAoB,CAAE,CAAC;IAC3E,IAAM,QAAQ,GAAG,aAAa,CAAC,cAAc,CAAC,CAAC;IACzC,IAAA,KAAoC,QAAQ,CAAmB,IAAI,CAAC,EAAnE,aAAa,QAAA,EAAE,gBAAgB,QAAoC,CAAC;IACrE,IAAA,KAA4C,QAAQ,CAAC,IAAI,CAAC,EAAzD,iBAAiB,QAAA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,CAAC,IAAI,CAAC,GAAA,YAErCA,aAAK,SAAS,EAAC,cAAc,YAC1B,oBAAoB;0BACjB,oBAAoB,CAAC,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,IAAI,CAAC;0BACzC,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,IAAI,GACnB,GACe,IACnB,EACN;AACJ;;;;"}
|
|
1
|
+
{"version":3,"file":"Table.js","sources":["../../../../../src/lib/components/table/Table.tsx"],"sourcesContent":["import { TableCell } from './components/TableCell/TableCell';\nimport { BottomOrRegularModal } from '../modal';\nimport { ReactNode, useCallback, useRef, useState } from 'react';\nimport { ChevronDownIcon, ChevronUpIcon } from '../icon';\nimport { Card } from '../cards/card';\n\nimport styles from './Table.module.scss';\nimport { useMediaQuery } from '../../hooks/useMediaQuery';\nimport { TableContents } from './components/TableContents/TableContents';\nimport classNames from 'classnames';\nimport { useTableNavigation } from './utils/useTableNavigation/useTableNavigation';\nimport { TableControls } from './components/TableControls/TableControls';\nimport { TableSection } from './components/TableSection/TableSection';\nimport { useScrollSync } from './utils/useScrollSync/useScrollSync';\nimport {\n CellReplacements,\n isBaseCell,\n ModalData,\n ModalFunction,\n TableCellData,\n TableData,\n} from './types';\n\ntype TextOverrides = {\n showDetails?: string;\n hideDetails?: string;\n};\n\nexport interface TableProps {\n cellReplacements?: CellReplacements;\n className?: string;\n collapsibleSections?: boolean;\n hideColumns?: number[];\n hideDetails?: boolean;\n imageComponent?: (args: any) => JSX.Element;\n modalContentRenderer?: (content: ReactNode) => ReactNode;\n onModalOpen?: ModalFunction;\n onSelectionChanged?: (index: number) => void;\n stickyHeaderTopOffset?: number;\n tableData: TableData;\n textOverrides?: TextOverrides;\n title: string;\n}\n\nconst defaultTextOverrides = {\n showDetails: 'Show details',\n hideDetails: 'Hide details',\n};\n\nconst Table = ({\n cellReplacements,\n className,\n collapsibleSections,\n hideColumns = [],\n hideDetails,\n imageComponent,\n modalContentRenderer,\n onModalOpen,\n onSelectionChanged,\n stickyHeaderTopOffset = 0,\n tableData,\n textOverrides: definedTextOverrides,\n title,\n}: TableProps) => {\n const textOverrides = { ...defaultTextOverrides, ...definedTextOverrides };\n const isMobile = useMediaQuery('BELOW_MOBILE');\n const [infoModalData, setInfoModalData] = useState<ModalData | null>(null);\n const [shouldHideDetails, setShouldHideDetails] = useState(true);\n const containerRef = useRef<HTMLDivElement | null>(null);\n const headerRef = useRef<HTMLDivElement | null>(null);\n const columnsLength = tableData[0].rows[0].length;\n\n useScrollSync(headerRef, containerRef, !isMobile);\n\n const { activeSection, navigateTable } = useTableNavigation({\n enabled: isMobile,\n containerRef,\n onSelectionChanged,\n });\n\n const titleCell = {\n text: '',\n ...tableData?.[0]?.rows?.[0]?.[0] || {},\n };\n const currentActiveSection = tableData?.[0]?.rows?.[0]?.[activeSection];\n const currentActiveSectionReplacements =\n (currentActiveSection.cellId &&\n cellReplacements?.[currentActiveSection.cellId]) ||\n {};\n\n const activeCellProps = {\n ...currentActiveSection,\n ...currentActiveSectionReplacements,\n } as TableCellData;\n\n const handleOpenModal: ModalFunction = useCallback(({ body, title }) => {\n onModalOpen?.({ body, title });\n setInfoModalData({ body, title });\n }, []);\n\n return (\n <div className={classNames(styles.wrapper, 'bg-white')}>\n {isMobile ? (\n <>\n {titleCell?.text && (\n <TableCell\n {...titleCell}\n align='left'\n isNavigation\n isTopLeftCell\n type={undefined}\n />\n )}\n\n <TableControls\n activeSection={activeSection}\n columnsLength={columnsLength}\n navigateTable={navigateTable}\n stickyHeaderTopOffset={stickyHeaderTopOffset}\n >\n <TableCell\n {...(isBaseCell(currentActiveSection)\n ? {\n openModal: (body: ReactNode) =>\n handleOpenModal({\n body,\n title: currentActiveSection?.text,\n }),\n }\n : {})}\n {...activeCellProps}\n imageComponent={imageComponent}\n isNavigation\n />\n </TableControls>\n </>\n ) : (\n <div\n aria-hidden\n className={styles.stickyHeader}\n style={{ top: `${stickyHeaderTopOffset}px` }}\n >\n <div className={styles.container} ref={headerRef}>\n <TableSection\n cellReplacements={cellReplacements}\n className={className}\n hideColumns={hideColumns}\n openModal={handleOpenModal}\n tableCellRows={[tableData?.[0]?.rows?.[0]]}\n title={title}\n imageComponent={imageComponent}\n />\n </div>\n </div>\n )}\n\n <div ref={containerRef} className={classNames(styles.container, 'pb8')}>\n <TableContents\n tableData={tableData}\n title={title}\n className={className}\n collapsibleSections={collapsibleSections}\n hideColumns={hideColumns}\n hideDetails={hideDetails}\n isMobile={isMobile}\n shouldHideDetails={shouldHideDetails}\n openModal={handleOpenModal}\n cellReplacements={cellReplacements}\n imageComponent={imageComponent}\n />\n </div>\n\n {tableData?.length > 1 && hideDetails && (\n <Card\n data-testid=\"show-hide-details\"\n classNames={{\n buttonWrapper: 'm8 mt32',\n title: 'd-flex gap8 ai-center jc-center fw-bold',\n wrapper: 'bg-grey-200',\n }}\n title={\n <>\n {shouldHideDetails\n ? textOverrides.showDetails\n : textOverrides.hideDetails}\n {shouldHideDetails ? (\n <ChevronDownIcon size={20} />\n ) : (\n <ChevronUpIcon size={20} />\n )}\n </>\n }\n actionIcon={null}\n dropShadow={false}\n titleVariant=\"small\"\n density=\"compact\"\n onClick={() => setShouldHideDetails((current) => !current)}\n />\n )}\n\n <BottomOrRegularModal\n isOpen={infoModalData?.body ? true : false}\n title={infoModalData?.title}\n onClose={() => setInfoModalData(null)}\n >\n <div className=\"pt8 p24 wmn6\">\n {modalContentRenderer\n ? modalContentRenderer(infoModalData?.body)\n : infoModalData?.body}\n </div>\n </BottomOrRegularModal>\n </div>\n );\n};\n\nexport { Table };\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CA,IAAM,oBAAoB,GAAG;IAC3B,WAAW,EAAE,cAAc;IAC3B,WAAW,EAAE,cAAc;CAC5B,CAAC;IAEI,KAAK,GAAG,UAAC,EAcF;;QAbX,gBAAgB,sBAAA,EAChB,SAAS,eAAA,EACT,mBAAmB,yBAAA,EACnB,mBAAgB,E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AAW;8BACzB,aAAa,CAAC,WAAW,EAC5B,iBAAiB,IAChBC,IAAC,eAAe,IAAC,IAAI,EAAE,EAAE,GAAI,KAE7BA,IAAC,aAAa,IAAC,IAAI,EAAE,EAAE,GAAI,CAC5B,IACA,EAEL,UAAU,EAAE,IAAI,EAChB,UAAU,EAAE,KAAK,EACjB,YAAY,EAAC,OAAO,EACpB,OAAO,EAAC,SAAS,EACjB,OAAO,EAAE,cAAM,OAAA,oBAAoB,CAAC,UAAC,OAAO,IAAK,OAAA,CAAC,OAAO,GAAA,CAAC,GAAA,GAC1D,CACH,EAEDA,IAAC,oBAAoB,IACnB,MAAM,EAAE,CAAA,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,IAAI,IAAG,IAAI,GAAG,KAAK,EAC1C,KAAK,EAAE,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,KAAK,EAC3B,OAAO,EAAE,cAAM,OAAA,gBAAgB,CAAC,IAAI,CAAC,GAAA,YAErCA,aAAK,SAAS,EAAC,cAAc,YAC1B,oBAAoB;0BACjB,oBAAoB,CAAC,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,IAAI,CAAC;0BACzC,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,IAAI,GACnB,GACe,IACnB,EACN;AACJ;;;;"}
|
|
@@ -33,7 +33,7 @@ import '../modal/genericModal/index.js';
|
|
|
33
33
|
import '../modal/regularModal/index.js';
|
|
34
34
|
import '../icon/icons/ChevronDown.js';
|
|
35
35
|
import '../icon/icons/ChevronUp.js';
|
|
36
|
-
import '../../TableSection-
|
|
36
|
+
import '../../TableSection-a1be2bd3.js';
|
|
37
37
|
import './components/TableContents/TableContents.js';
|
|
38
38
|
import './components/TableContents/Collapsible.js';
|
|
39
39
|
import '../../useTableNavigation-f929fbc9.js';
|
|
@@ -33,7 +33,7 @@ import '../modal/genericModal/index.js';
|
|
|
33
33
|
import '../modal/regularModal/index.js';
|
|
34
34
|
import '../icon/icons/ChevronDown.js';
|
|
35
35
|
import '../icon/icons/ChevronUp.js';
|
|
36
|
-
import '../../TableSection-
|
|
36
|
+
import '../../TableSection-a1be2bd3.js';
|
|
37
37
|
import './components/TableContents/TableContents.js';
|
|
38
38
|
import './components/TableContents/Collapsible.js';
|
|
39
39
|
import '../../useTableNavigation-f929fbc9.js';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { b as __rest, a as __assign } from '../../../../../tslib.es6-a39f91fc.js';
|
|
2
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
2
|
import { c as classNames } from '../../../../../index-6ea95111.js';
|
|
4
3
|
import { s as styleInject } from '../../../../../style-inject.es-1f59c1d0.js';
|
|
5
4
|
import { Button } from '../../../../button/index.js';
|
|
5
|
+
import '../../../../../tslib.es6-a39f91fc.js';
|
|
6
6
|
import 'react';
|
|
7
7
|
|
|
8
8
|
var css_248z = ".ButtonCell-module_buttonCell__x4NNi {\n color: #26262e;\n border: 1px solid #d2d2d8;\n transition: all 0.3s ease-in-out;\n}\n.ButtonCell-module_buttonCell__x4NNi:disabled {\n border: none;\n background-color: #f5f6fb;\n color: #26262e;\n opacity: 1;\n cursor: default;\n}\n.ButtonCell-module_buttonCell__x4NNi:disabled:hover {\n background-color: #f5f6fb;\n}\n@media (max-width: 34rem) {\n .ButtonCell-module_buttonCell__x4NNi {\n pointer-events: none;\n }\n}\n\n.ButtonCell-module_withoutPrice__2rpe9 {\n height: 64px;\n}\n\n.ButtonCell-module_withPrice__3bd_t {\n height: 75px;\n}\n\n.ButtonCell-module_selected__22pF_ {\n transition: all 0.3 ease-in-out;\n border: 2px solid #8e8cee;\n background-color: #f7f7ff;\n}";
|
|
@@ -11,12 +11,12 @@ styleInject(css_248z);
|
|
|
11
11
|
|
|
12
12
|
var ButtonCell = function (_a) {
|
|
13
13
|
var _b;
|
|
14
|
-
var isSelected = _a.isSelected, onClick = _a.onClick, buttonCaption = _a.buttonCaption, price = _a.price, disabled = _a.disabled, className = _a.className,
|
|
15
|
-
return (jsx("div",
|
|
14
|
+
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;
|
|
15
|
+
return (jsx("div", { className: classNames("w100 d-flex fd-column ai-center jc-center gap8", className), "data-cy": dataCy, "data-testid": dataTestId, children: jsxs(Button, { className: classNames('w100 wmx5 d-flex fd-column', styles.buttonCell, (_b = {},
|
|
16
16
|
_b[styles.selected] = isSelected,
|
|
17
17
|
_b[styles.withoutPrice] = !price,
|
|
18
18
|
_b[styles.withPrice] = !!price,
|
|
19
|
-
_b)), variant: "filledWhite", type: "submit", onClick: onClick, disabled: disabled, children: [buttonCaption, price && jsx("span", { className: "p-p tc-purple-500", children: price })] }) }))
|
|
19
|
+
_b)), variant: "filledWhite", type: "submit", onClick: onClick, disabled: disabled, children: [buttonCaption, price && jsx("span", { className: "p-p tc-purple-500", children: price })] }) }));
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
export { ButtonCell };
|
|
@@ -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 { Button } from '../../../../button';\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
|
|
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 { Button } from '../../../../button';\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={\n classNames(\n \"w100 d-flex fd-column ai-center jc-center gap8\",\n className,\n )\n }\n data-cy={dataCy}\n data-testid={dataTestId}\n >\n <Button\n className={classNames('w100 wmx5 d-flex fd-column', styles.buttonCell, {\n [styles.selected]: isSelected,\n [styles.withoutPrice]: !price,\n [styles.withPrice]: !!price,\n })}\n variant=\"filledWhite\"\n type=\"submit\"\n onClick={onClick}\n disabled={disabled}\n >\n {buttonCaption}\n {price && <span className=\"p-p tc-purple-500\">{price}</span>}\n </Button>\n </div>\n );\n};\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;;;;;;;IAiBa,UAAU,GAAG,UAAC,EAST;;QARhB,UAAU,gBAAA,EACV,OAAO,aAAA,EACP,aAAa,mBAAA,EACb,KAAK,WAAA,EACL,QAAQ,cAAA,EACR,SAAS,eAAA,EACT,MAAM,YAAA,EACN,UAAU,gBAAA;IAEV,QACEA,aACE,SAAS,EACP,UAAU,CACR,gDAAgD,EAChD,SAAS,CACV,aAEM,MAAM,iBACF,UAAU,YAEvBC,KAAC,MAAM,IACL,SAAS,EAAE,UAAU,CAAC,4BAA4B,EAAE,MAAM,CAAC,UAAU;gBACnE,GAAC,MAAM,CAAC,QAAQ,IAAG,UAAU;gBAC7B,GAAC,MAAM,CAAC,YAAY,IAAG,CAAC,KAAK;gBAC7B,GAAC,MAAM,CAAC,SAAS,IAAG,CAAC,CAAC,KAAK;oBAC3B,EACF,OAAO,EAAC,aAAa,EACrB,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,aAEjB,aAAa,EACb,KAAK,IAAID,cAAM,SAAS,EAAC,mBAAmB,YAAE,KAAK,GAAQ,IACrD,GACL,EACN;AACJ;;;;"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { ButtonCell } from './ButtonCell.js';
|
|
3
|
-
import '../../../../../tslib.es6-a39f91fc.js';
|
|
4
3
|
import '../../../../../index-6ea95111.js';
|
|
5
4
|
import '../../../../../style-inject.es-1f59c1d0.js';
|
|
6
5
|
import '../../../../button/index.js';
|
|
6
|
+
import '../../../../../tslib.es6-a39f91fc.js';
|
|
7
7
|
import 'react';
|
|
8
8
|
|
|
9
9
|
var story = {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { b as __rest, a as __assign } from '../../../../../tslib.es6-a39f91fc.js';
|
|
2
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
2
|
import { c as classNames } from '../../../../../index-6ea95111.js';
|
|
4
3
|
import { s as styleInject } from '../../../../../style-inject.es-1f59c1d0.js';
|
|
@@ -10,14 +9,14 @@ styleInject(css_248z);
|
|
|
10
9
|
|
|
11
10
|
var CTACell = function (_a) {
|
|
12
11
|
var _b;
|
|
13
|
-
var title = _a.title, price = _a.price, icon = _a.icon, grey = _a.grey, narrow = _a.narrow, href = _a.href, buttonCaption = _a.buttonCaption, imageComponent = _a.imageComponent, className = _a.className,
|
|
12
|
+
var title = _a.title, price = _a.price, icon = _a.icon, grey = _a.grey, narrow = _a.narrow, href = _a.href, buttonCaption = _a.buttonCaption, imageComponent = _a.imageComponent, className = _a.className, dataCy = _a.dataCy, dataTestId = _a.dataTestId;
|
|
14
13
|
var renderedIcon = (jsx(IconRenderer, { icon: icon, imageComponent: imageComponent }));
|
|
15
|
-
return (jsxs("div",
|
|
14
|
+
return (jsxs("div", { className: classNames(className, "ta-center"), "data-cy": dataCy, "data-testid": dataTestId, children: [jsxs("div", { className: "d-flex jc-center ai-center gap8", children: [renderedIcon, jsxs("p", { className: "p-h3", children: [title, price && jsxs("span", { className: "tc-purple-500", children: [" ", price] })] })] }), jsx("a", { className: classNames('mt16 w100 wmx3', (_b = {
|
|
16
15
|
'p-btn--primary': !grey,
|
|
17
16
|
'p-btn--secondary-grey': grey
|
|
18
17
|
},
|
|
19
18
|
_b[styles.narrow] = narrow,
|
|
20
|
-
_b)), href: href, target: "_blank", rel: "noopener noreferrer", children: buttonCaption })] }))
|
|
19
|
+
_b)), href: href, target: "_blank", rel: "noopener noreferrer", children: buttonCaption })] }));
|
|
21
20
|
};
|
|
22
21
|
|
|
23
22
|
export { CTACell };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CTACell.js","sources":["../../../../../../../../src/lib/components/table/components/TableCell/CTACell/CTACell.tsx"],"sourcesContent":["import classNames from 'classnames';\nimport { ReactNode } from 'react';\n\nimport styles from './CTACell.module.scss';\nimport { IconRenderer } from '../../IconRenderer/IconRenderer';\n\nexport type CTACellProps = {\n title: ReactNode;\n price?: ReactNode;\n icon?: ReactNode;\n imageComponent?: (args: any) => JSX.Element;\n buttonCaption?: ReactNode;\n grey?: boolean;\n narrow?: boolean;\n href: string;\n className?: string;\n dataTestId?: string;\n dataCy?: string;\n};\n\nexport const CTACell = ({\n title,\n price,\n icon,\n grey,\n narrow,\n href,\n buttonCaption,\n imageComponent,\n className,\n
|
|
1
|
+
{"version":3,"file":"CTACell.js","sources":["../../../../../../../../src/lib/components/table/components/TableCell/CTACell/CTACell.tsx"],"sourcesContent":["import classNames from 'classnames';\nimport { ReactNode } from 'react';\n\nimport styles from './CTACell.module.scss';\nimport { IconRenderer } from '../../IconRenderer/IconRenderer';\n\nexport type CTACellProps = {\n title: ReactNode;\n price?: ReactNode;\n icon?: ReactNode;\n imageComponent?: (args: any) => JSX.Element;\n buttonCaption?: ReactNode;\n grey?: boolean;\n narrow?: boolean;\n href: string;\n className?: string;\n dataTestId?: string;\n dataCy?: string;\n};\n\nexport const CTACell = ({\n title,\n price,\n icon,\n grey,\n narrow,\n href,\n buttonCaption,\n imageComponent,\n className,\n dataCy,\n dataTestId,\n}: CTACellProps) => {\n const renderedIcon = (\n <IconRenderer icon={icon} imageComponent={imageComponent} />\n );\n\n return (\n <div\n className={classNames(className, \"ta-center\")}\n data-cy={dataCy}\n data-testid={dataTestId}\n >\n <div className=\"d-flex jc-center ai-center gap8\">\n {renderedIcon}\n <p className=\"p-h3\">\n {title}\n {price && <span className=\"tc-purple-500\"> {price}</span>}\n </p>\n </div>\n\n <a\n className={classNames('mt16 w100 wmx3', {\n 'p-btn--primary': !grey,\n 'p-btn--secondary-grey': grey,\n [styles.narrow]: narrow,\n })}\n href={href}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n {buttonCaption}\n </a>\n </div>\n );\n};\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;;;;;IAoBa,OAAO,GAAG,UAAC,EAYT;;QAXb,KAAK,WAAA,EACL,KAAK,WAAA,EACL,IAAI,UAAA,EACJ,IAAI,UAAA,EACJ,MAAM,YAAA,EACN,IAAI,UAAA,EACJ,aAAa,mBAAA,EACb,cAAc,oBAAA,EACd,SAAS,eAAA,EACT,MAAM,YAAA,EACN,UAAU,gBAAA;IAEV,IAAM,YAAY,IAChBA,IAAC,YAAY,IAAC,IAAI,EAAE,IAAI,EAAE,cAAc,EAAE,cAAc,GAAI,CAC7D,CAAC;IAEF,QACEC,cACE,SAAS,EAAE,UAAU,CAAC,SAAS,EAAE,WAAW,CAAC,aACpC,MAAM,iBACF,UAAU,aAEvBA,cAAK,SAAS,EAAC,iCAAiC,aAC7C,YAAY,EACbA,YAAG,SAAS,EAAC,MAAM,aAChB,KAAK,EACL,KAAK,IAAIA,eAAM,SAAS,EAAC,eAAe,kBAAG,KAAK,IAAQ,IACvD,IACA,EAEND,WACE,SAAS,EAAE,UAAU,CAAC,gBAAgB;wBACpC,gBAAgB,EAAE,CAAC,IAAI;wBACvB,uBAAuB,EAAE,IAAI;;oBAC7B,GAAC,MAAM,CAAC,MAAM,IAAG,MAAM;wBACvB,EACF,IAAI,EAAE,IAAI,EACV,MAAM,EAAC,QAAQ,EACf,GAAG,EAAC,qBAAqB,YAExB,aAAa,GACZ,IACA,EACN;AACJ;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as __assign, _ as __spreadArray } from '../../../../tslib.es6-a39f91fc.js';
|
|
2
2
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
3
|
import { useState } from 'react';
|
|
4
|
-
import { T as TableSection } from '../../../../TableSection-
|
|
4
|
+
import { T as TableSection } from '../../../../TableSection-a1be2bd3.js';
|
|
5
5
|
import ChevronDownIcon from '../../../icon/icons/ChevronDown.js';
|
|
6
6
|
import ChevronUpIcon from '../../../icon/icons/ChevronUp.js';
|
|
7
7
|
import { Card } from '../../../cards/card/index.js';
|
|
@@ -6,7 +6,7 @@ import 'react';
|
|
|
6
6
|
import 'react-dom';
|
|
7
7
|
import '../../../../_commonjsHelpers-4730bd53.js';
|
|
8
8
|
import 'react-dom/test-utils';
|
|
9
|
-
import '../../../../TableSection-
|
|
9
|
+
import '../../../../TableSection-a1be2bd3.js';
|
|
10
10
|
import '../../../../index-6ea95111.js';
|
|
11
11
|
import '../../../../style-inject.es-1f59c1d0.js';
|
|
12
12
|
import '../TableCell/TableCell.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import '../../../../tslib.es6-a39f91fc.js';
|
|
2
2
|
import 'react/jsx-runtime';
|
|
3
3
|
import '../../../../index-6ea95111.js';
|
|
4
|
-
export { T as TableSection } from '../../../../TableSection-
|
|
4
|
+
export { T as TableSection } from '../../../../TableSection-a1be2bd3.js';
|
|
5
5
|
import '../TableCell/TableCell.js';
|
|
6
6
|
import 'react';
|
|
7
7
|
import '../../../../style-inject.es-1f59c1d0.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as __assign } from '../../../../tslib.es6-a39f91fc.js';
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { c as customRender, s as screen } from '../../../../customRender-d03c10b6.js';
|
|
4
|
-
import { T as TableSection } from '../../../../TableSection-
|
|
4
|
+
import { T as TableSection } from '../../../../TableSection-a1be2bd3.js';
|
|
5
5
|
import 'react';
|
|
6
6
|
import 'react-dom';
|
|
7
7
|
import '../../../../_commonjsHelpers-4730bd53.js';
|
package/dist/esm/index.js
CHANGED
|
@@ -445,7 +445,7 @@ import './components/table/components/TableCell/CTACell/CTACell.js';
|
|
|
445
445
|
import './components/table/components/IconRenderer/IconRenderer.js';
|
|
446
446
|
import './components/table/components/TableCell/CardCell/CardCell.js';
|
|
447
447
|
import './components/table/components/TableCell/ButtonCell/ButtonCell.js';
|
|
448
|
-
import './TableSection-
|
|
448
|
+
import './TableSection-a1be2bd3.js';
|
|
449
449
|
import './components/table/components/TableContents/TableContents.js';
|
|
450
450
|
import './components/table/components/TableContents/Collapsible.js';
|
|
451
451
|
import './useTableNavigation-f929fbc9.js';
|
|
@@ -9,4 +9,4 @@ export type ButtonCellProps = {
|
|
|
9
9
|
dataTestId?: string;
|
|
10
10
|
dataCy?: string;
|
|
11
11
|
};
|
|
12
|
-
export declare const ButtonCell: ({ isSelected, onClick, buttonCaption, price, disabled, className,
|
|
12
|
+
export declare const ButtonCell: ({ isSelected, onClick, buttonCaption, price, disabled, className, dataCy, dataTestId, }: ButtonCellProps) => JSX.Element;
|
package/dist/esm/lib/components/table/components/TableCell/ButtonCell/ButtonCell.stories.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ButtonCell } from './ButtonCell';
|
|
2
2
|
declare const story: {
|
|
3
3
|
title: string;
|
|
4
|
-
component: ({ isSelected, onClick, buttonCaption, price, disabled, className,
|
|
4
|
+
component: ({ isSelected, onClick, buttonCaption, price, disabled, className, dataCy, dataTestId, }: import("./ButtonCell").ButtonCellProps) => JSX.Element;
|
|
5
5
|
argTypes: {};
|
|
6
6
|
args: {
|
|
7
7
|
buttonCaption: string;
|
|
@@ -12,4 +12,4 @@ export type CTACellProps = {
|
|
|
12
12
|
dataTestId?: string;
|
|
13
13
|
dataCy?: string;
|
|
14
14
|
};
|
|
15
|
-
export declare const CTACell: ({ title, price, icon, grey, narrow, href, buttonCaption, imageComponent, className,
|
|
15
|
+
export declare const CTACell: ({ title, price, icon, grey, narrow, href, buttonCaption, imageComponent, className, dataCy, dataTestId, }: CTACellProps) => JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CTACell } from './CTACell';
|
|
2
2
|
declare const story: {
|
|
3
3
|
title: string;
|
|
4
|
-
component: ({ title, price, icon, grey, narrow, href, buttonCaption, imageComponent, className,
|
|
4
|
+
component: ({ title, price, icon, grey, narrow, href, buttonCaption, imageComponent, className, dataCy, dataTestId, }: import("./CTACell").CTACellProps) => JSX.Element;
|
|
5
5
|
argTypes: {};
|
|
6
6
|
args: {
|
|
7
7
|
title: string;
|
package/package.json
CHANGED
|
@@ -101,7 +101,7 @@ const AutocompleteAddress = ({
|
|
|
101
101
|
const marker = useRef<google.maps.Marker | null>(null);
|
|
102
102
|
const [address, setAddress] = useState(initialAddress);
|
|
103
103
|
const [hasLoadedGoogleAPI, setHasLoadedGoogleAPI] = useState(
|
|
104
|
-
window.google !== undefined
|
|
104
|
+
window.google?.maps !== undefined
|
|
105
105
|
);
|
|
106
106
|
|
|
107
107
|
loadGoogleMapsApiDynamically(() => {
|
|
@@ -22,7 +22,8 @@ export const ButtonCell = ({
|
|
|
22
22
|
price,
|
|
23
23
|
disabled,
|
|
24
24
|
className,
|
|
25
|
-
|
|
25
|
+
dataCy,
|
|
26
|
+
dataTestId,
|
|
26
27
|
}: ButtonCellProps) => {
|
|
27
28
|
return (
|
|
28
29
|
<div
|
|
@@ -32,7 +33,8 @@ export const ButtonCell = ({
|
|
|
32
33
|
className,
|
|
33
34
|
)
|
|
34
35
|
}
|
|
35
|
-
{
|
|
36
|
+
data-cy={dataCy}
|
|
37
|
+
data-testid={dataTestId}
|
|
36
38
|
>
|
|
37
39
|
<Button
|
|
38
40
|
className={classNames('w100 wmx5 d-flex fd-column', styles.buttonCell, {
|
|
@@ -28,14 +28,19 @@ export const CTACell = ({
|
|
|
28
28
|
buttonCaption,
|
|
29
29
|
imageComponent,
|
|
30
30
|
className,
|
|
31
|
-
|
|
31
|
+
dataCy,
|
|
32
|
+
dataTestId,
|
|
32
33
|
}: CTACellProps) => {
|
|
33
34
|
const renderedIcon = (
|
|
34
35
|
<IconRenderer icon={icon} imageComponent={imageComponent} />
|
|
35
36
|
);
|
|
36
37
|
|
|
37
38
|
return (
|
|
38
|
-
<div
|
|
39
|
+
<div
|
|
40
|
+
className={classNames(className, "ta-center")}
|
|
41
|
+
data-cy={dataCy}
|
|
42
|
+
data-testid={dataTestId}
|
|
43
|
+
>
|
|
39
44
|
<div className="d-flex jc-center ai-center gap8">
|
|
40
45
|
{renderedIcon}
|
|
41
46
|
<p className="p-h3">
|