@popsure/dirty-swan 0.66.19 → 0.66.21
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 +352 -306
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/lib/components/table/Table.d.ts +2 -1
- package/dist/cjs/lib/components/table/Table.stories.d.ts +9 -1
- package/dist/cjs/lib/components/table/components/TableContents/TableContents.d.ts +2 -1
- package/dist/cjs/lib/components/tabs/Tabs.d.ts +12 -0
- package/dist/cjs/lib/components/tabs/Tabs.stories.d.ts +45 -0
- package/dist/cjs/lib/index.d.ts +3 -2
- package/dist/esm/components/icon/icons/CircleSelected.js +2 -2
- package/dist/esm/components/icon/icons/CircleSelected.js.map +1 -1
- package/dist/esm/components/icon/icons/CircleUnselected.js +2 -2
- package/dist/esm/components/icon/icons/CircleUnselected.js.map +1 -1
- package/dist/esm/components/icon/icons.stories.js +1 -1
- package/dist/esm/components/icon/index.stories.js +1 -1
- package/dist/esm/components/table/Table.js +27 -10
- package/dist/esm/components/table/Table.js.map +1 -1
- package/dist/esm/components/table/Table.stories.js +86 -1
- package/dist/esm/components/table/Table.stories.js.map +1 -1
- package/dist/esm/components/table/Table.test.js +3 -0
- package/dist/esm/components/table/Table.test.js.map +1 -1
- package/dist/esm/components/table/components/TableCell/ButtonCell/ButtonCell.js +9 -8
- package/dist/esm/components/table/components/TableCell/ButtonCell/ButtonCell.js.map +1 -1
- package/dist/esm/components/table/components/TableCell/ButtonCell/ButtonCell.stories.js +4 -2
- package/dist/esm/components/table/components/TableCell/ButtonCell/ButtonCell.stories.js.map +1 -1
- package/dist/esm/components/table/components/TableCell/TableCell.js +2 -0
- package/dist/esm/components/table/components/TableCell/TableCell.js.map +1 -1
- package/dist/esm/components/table/components/TableCell/TableCell.test.js +2 -0
- package/dist/esm/components/table/components/TableCell/TableCell.test.js.map +1 -1
- package/dist/esm/components/table/components/TableContents/TableContents.js +5 -3
- package/dist/esm/components/table/components/TableContents/TableContents.js.map +1 -1
- package/dist/esm/components/table/components/TableContents/TableContents.test.js +15 -0
- package/dist/esm/components/table/components/TableContents/TableContents.test.js.map +1 -1
- package/dist/esm/components/table/components/TableSection/TableSection.js +2 -0
- package/dist/esm/components/table/components/TableSection/TableSection.js.map +1 -1
- package/dist/esm/components/table/components/TableSection/TableSection.test.js +2 -0
- package/dist/esm/components/table/components/TableSection/TableSection.test.js.map +1 -1
- package/dist/esm/components/tabs/Tabs.js +40 -0
- package/dist/esm/components/tabs/Tabs.js.map +1 -0
- package/dist/esm/components/tabs/Tabs.stories.js +77 -0
- package/dist/esm/components/tabs/Tabs.stories.js.map +1 -0
- package/dist/esm/{index-D41W71Hh.js → index-D7G3EuxU.js} +5 -5
- package/dist/esm/{index-D41W71Hh.js.map → index-D7G3EuxU.js.map} +1 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/lib/components/table/Table.d.ts +2 -1
- package/dist/esm/lib/components/table/Table.stories.d.ts +9 -1
- package/dist/esm/lib/components/table/components/TableContents/TableContents.d.ts +2 -1
- package/dist/esm/lib/components/tabs/Tabs.d.ts +12 -0
- package/dist/esm/lib/components/tabs/Tabs.stories.d.ts +45 -0
- package/dist/esm/lib/index.d.ts +3 -2
- package/dist/esm/util/images/index.stories.js +2 -0
- package/dist/esm/util/images/index.stories.js.map +1 -1
- package/package.json +1 -1
- package/src/lib/components/table/Table.stories.tsx +116 -0
- package/src/lib/components/table/Table.tsx +61 -24
- package/src/lib/components/table/components/TableCell/ButtonCell/ButtonCell.module.scss +27 -21
- package/src/lib/components/table/components/TableCell/ButtonCell/ButtonCell.tsx +19 -16
- package/src/lib/components/table/components/TableContents/TableContents.test.tsx +21 -0
- package/src/lib/components/table/components/TableContents/TableContents.tsx +3 -1
- package/src/lib/components/tabs/Tabs.module.scss +26 -0
- package/src/lib/components/tabs/Tabs.stories.tsx +94 -0
- package/src/lib/components/tabs/Tabs.tsx +65 -0
- package/src/lib/index.tsx +4 -0
|
@@ -31,6 +31,8 @@ import '../TableCell/CardCell/CardCell.js';
|
|
|
31
31
|
import '../../../cards/card/index.js';
|
|
32
32
|
import '../../../icon/icons/ChevronRight.js';
|
|
33
33
|
import '../TableCell/ButtonCell/ButtonCell.js';
|
|
34
|
+
import '../../../icon/icons/CircleSelected.js';
|
|
35
|
+
import '../../../icon/icons/CircleUnselected.js';
|
|
34
36
|
import '../../../../useMediaQuery-BlEUymPA.js';
|
|
35
37
|
import '../../../icon/icons/ChevronDown.js';
|
|
36
38
|
import '../../../icon/icons/ChevronUp.js';
|
|
@@ -82,5 +84,18 @@ describe('TableContents', function () {
|
|
|
82
84
|
expect(screen.queryByText('Section 2')).not.toBeInTheDocument();
|
|
83
85
|
expect(screen.queryByText('Item 2.1.1')).not.toBeInTheDocument();
|
|
84
86
|
});
|
|
87
|
+
it('shows the header row only in the first section when showHeader is set', function () {
|
|
88
|
+
var container = customRender(jsx(TableContents, { showHeader: true, tableData: mockData, title: "Table" })).container;
|
|
89
|
+
var tableHeaders = container.querySelectorAll('thead');
|
|
90
|
+
expect(tableHeaders).toHaveLength(2);
|
|
91
|
+
expect(tableHeaders[0]).not.toHaveClass('sr-only');
|
|
92
|
+
expect(tableHeaders[1]).toHaveClass('sr-only');
|
|
93
|
+
});
|
|
94
|
+
it('keeps every header row hidden when showHeader is not set', function () {
|
|
95
|
+
var container = customRender(jsx(TableContents, { tableData: mockData, title: "Table" })).container;
|
|
96
|
+
container.querySelectorAll('thead').forEach(function (tableHeader) {
|
|
97
|
+
expect(tableHeader).toHaveClass('sr-only');
|
|
98
|
+
});
|
|
99
|
+
});
|
|
85
100
|
});
|
|
86
101
|
//# sourceMappingURL=TableContents.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableContents.test.js","sources":["../../../../../../../src/lib/components/table/components/TableContents/TableContents.test.tsx"],"sourcesContent":["import { fireEvent, render, screen } from '../../../../util/testUtils';\nimport { TableContents, TableContentsProps } from './TableContents';\n\nconst mockData: TableContentsProps['tableData'] = [\n {\n rows: [\n [{ text: 'Item 1.1.1' }, { text: 'Item 1.1.2' }],\n [{ text: 'Item 1.2.1' }, { text: 'Item 1.2.2' }],\n ],\n },\n {\n section: {\n title: 'Section 2',\n },\n rows: [\n [{ text: 'Item 2.1.1' }, { text: 'Item 2.1.2' }],\n [{ text: 'Item 2.2.1' }, { text: 'Item 2.2.2' }],\n ],\n },\n];\n\ndescribe('TableContents', () => {\n it('renders the table sections with sections', () => {\n render(\n <TableContents collapsibleSections tableData={mockData} title=\"Table\" />\n );\n\n expect(screen.getByText('Section 2')).toBeInTheDocument();\n });\n\n it('renders the table sections with sections data', () => {\n render(\n <TableContents collapsibleSections tableData={mockData} title=\"Table\" />\n );\n\n expect(screen.getByText('Item 1.2.1')).toBeInTheDocument();\n expect(screen.getByText('Item 1.2.2')).toBeInTheDocument();\n expect(screen.getByText('Item 2.1.2')).toBeInTheDocument();\n expect(screen.getByText('Item 2.2.1')).toBeInTheDocument();\n });\n\n it('renders collapsible section headers as buttons and toggles them', () => {\n render(\n <TableContents collapsibleSections tableData={mockData} title=\"Table\" />\n );\n\n const sectionButton = screen.getByRole('button', { name: 'Section 2' });\n expect(sectionButton).toHaveAttribute('aria-expanded', 'false');\n\n fireEvent.click(sectionButton);\n expect(sectionButton).toHaveAttribute('aria-expanded', 'true');\n });\n\n it('renders section headers without a button when not collapsible', () => {\n render(<TableContents tableData={mockData} title=\"Table\" />);\n\n expect(\n screen.queryByRole('button', { name: 'Section 2' })\n ).not.toBeInTheDocument();\n expect(screen.getByText('Section 2')).toBeInTheDocument();\n });\n\n it('hides the table sections when hideDetails and shouldHideDetails is true', () => {\n render(\n <TableContents\n hideDetails\n shouldHideDetails\n tableData={mockData}\n title=\"Table\"\n />\n );\n\n expect(screen.queryByText('Section 2')).not.toBeInTheDocument();\n expect(screen.queryByText('Item 2.1.1')).not.toBeInTheDocument();\n });\n});\n"],"names":["render","_jsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"TableContents.test.js","sources":["../../../../../../../src/lib/components/table/components/TableContents/TableContents.test.tsx"],"sourcesContent":["import { fireEvent, render, screen } from '../../../../util/testUtils';\nimport { TableContents, TableContentsProps } from './TableContents';\n\nconst mockData: TableContentsProps['tableData'] = [\n {\n rows: [\n [{ text: 'Item 1.1.1' }, { text: 'Item 1.1.2' }],\n [{ text: 'Item 1.2.1' }, { text: 'Item 1.2.2' }],\n ],\n },\n {\n section: {\n title: 'Section 2',\n },\n rows: [\n [{ text: 'Item 2.1.1' }, { text: 'Item 2.1.2' }],\n [{ text: 'Item 2.2.1' }, { text: 'Item 2.2.2' }],\n ],\n },\n];\n\ndescribe('TableContents', () => {\n it('renders the table sections with sections', () => {\n render(\n <TableContents collapsibleSections tableData={mockData} title=\"Table\" />\n );\n\n expect(screen.getByText('Section 2')).toBeInTheDocument();\n });\n\n it('renders the table sections with sections data', () => {\n render(\n <TableContents collapsibleSections tableData={mockData} title=\"Table\" />\n );\n\n expect(screen.getByText('Item 1.2.1')).toBeInTheDocument();\n expect(screen.getByText('Item 1.2.2')).toBeInTheDocument();\n expect(screen.getByText('Item 2.1.2')).toBeInTheDocument();\n expect(screen.getByText('Item 2.2.1')).toBeInTheDocument();\n });\n\n it('renders collapsible section headers as buttons and toggles them', () => {\n render(\n <TableContents collapsibleSections tableData={mockData} title=\"Table\" />\n );\n\n const sectionButton = screen.getByRole('button', { name: 'Section 2' });\n expect(sectionButton).toHaveAttribute('aria-expanded', 'false');\n\n fireEvent.click(sectionButton);\n expect(sectionButton).toHaveAttribute('aria-expanded', 'true');\n });\n\n it('renders section headers without a button when not collapsible', () => {\n render(<TableContents tableData={mockData} title=\"Table\" />);\n\n expect(\n screen.queryByRole('button', { name: 'Section 2' })\n ).not.toBeInTheDocument();\n expect(screen.getByText('Section 2')).toBeInTheDocument();\n });\n\n it('hides the table sections when hideDetails and shouldHideDetails is true', () => {\n render(\n <TableContents\n hideDetails\n shouldHideDetails\n tableData={mockData}\n title=\"Table\"\n />\n );\n\n expect(screen.queryByText('Section 2')).not.toBeInTheDocument();\n expect(screen.queryByText('Item 2.1.1')).not.toBeInTheDocument();\n });\n\n it('shows the header row only in the first section when showHeader is set', () => {\n const { container } = render(\n <TableContents showHeader tableData={mockData} title=\"Table\" />\n );\n\n const tableHeaders = container.querySelectorAll('thead');\n expect(tableHeaders).toHaveLength(2);\n expect(tableHeaders[0]).not.toHaveClass('sr-only');\n expect(tableHeaders[1]).toHaveClass('sr-only');\n });\n\n it('keeps every header row hidden when showHeader is not set', () => {\n const { container } = render(\n <TableContents tableData={mockData} title=\"Table\" />\n );\n\n container.querySelectorAll('thead').forEach((tableHeader) => {\n expect(tableHeader).toHaveClass('sr-only');\n });\n });\n});\n"],"names":["render","_jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAM,QAAQ,GAAoC;AAChD,IAAA;AACE,QAAA,IAAI,EAAE;YACJ,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;YAChD,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;AACjD,SAAA;AACF,KAAA;AACD,IAAA;AACE,QAAA,OAAO,EAAE;AACP,YAAA,KAAK,EAAE,WAAW;AACnB,SAAA;AACD,QAAA,IAAI,EAAE;YACJ,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;YAChD,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;AACjD,SAAA;AACF,KAAA;CACF;AAED,QAAQ,CAAC,eAAe,EAAE,YAAA;IACxB,EAAE,CAAC,0CAA0C,EAAE,YAAA;AAC7C,QAAAA,YAAM,CACJC,GAAA,CAAC,aAAa,EAAA,EAAC,mBAAmB,EAAA,IAA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,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,SAAS,CAAC;AAChD,IAAA,CAAC,CAAC;IAEF,EAAE,CAAC,0DAA0D,EAAE,YAAA;AACrD,QAAA,IAAA,SAAS,GAAKD,YAAM,CAC1BC,GAAA,CAAC,aAAa,EAAA,EAAC,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAC,OAAO,EAAA,CAAG,CACrD,UAFgB;QAIjB,SAAS,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,UAAC,WAAW,EAAA;YACtD,MAAM,CAAC,WAAW,CAAC,CAAC,WAAW,CAAC,SAAS,CAAC;AAC5C,QAAA,CAAC,CAAC;AACJ,IAAA,CAAC,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -27,4 +27,6 @@ import '../TableCell/CardCell/CardCell.js';
|
|
|
27
27
|
import '../../../cards/card/index.js';
|
|
28
28
|
import '../../../icon/icons/ChevronRight.js';
|
|
29
29
|
import '../TableCell/ButtonCell/ButtonCell.js';
|
|
30
|
+
import '../../../icon/icons/CircleSelected.js';
|
|
31
|
+
import '../../../icon/icons/CircleUnselected.js';
|
|
30
32
|
//# sourceMappingURL=TableSection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableSection.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TableSection.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -30,6 +30,8 @@ import '../TableCell/CardCell/CardCell.js';
|
|
|
30
30
|
import '../../../cards/card/index.js';
|
|
31
31
|
import '../../../icon/icons/ChevronRight.js';
|
|
32
32
|
import '../TableCell/ButtonCell/ButtonCell.js';
|
|
33
|
+
import '../../../icon/icons/CircleSelected.js';
|
|
34
|
+
import '../../../icon/icons/CircleUnselected.js';
|
|
33
35
|
import '../../../../useMediaQuery-BlEUymPA.js';
|
|
34
36
|
|
|
35
37
|
var tableCellRows = [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableSection.test.js","sources":["../../../../../../../src/lib/components/table/components/TableSection/TableSection.test.tsx"],"sourcesContent":["import { render, screen } from '../../../../util/testUtils';\nimport { TableSection, TableSectionProps } from './TableSection';\n\nconst tableCellRows: TableSectionProps['tableCellRows'] = [\n [{ text: 'Cell 1.1' }, { text: 'Cell 1.2' }, { text: 'Cell 1.3' }],\n [{ text: 'Cell 2.1' }, { text: 'Cell 2.2' }, { text: 'Cell 2.3' }],\n];\n\nconst mockTitle = 'Test Table';\n\nconst mockOpenModal = jest.fn();\n\nconst defaultProps: TableSectionProps = {\n tableCellRows,\n title: mockTitle,\n openModal: mockOpenModal,\n};\n\ndescribe('TableSection', () => {\n it('renders the table caption', () => {\n render(<TableSection {...defaultProps} />);\n\n expect(screen.getByText(mockTitle)).toBeInTheDocument();\n });\n\n it('renders the table with correct data', () => {\n render(<TableSection {...defaultProps} />);\n\n expect(screen.getByText('Cell 1.1')).toBeInTheDocument();\n expect(screen.getByText('Cell 1.2')).toBeInTheDocument();\n expect(screen.getByText('Cell 1.3')).toBeInTheDocument();\n\n expect(screen.getByText('Cell 2.1')).toBeInTheDocument();\n expect(screen.getByText('Cell 2.2')).toBeInTheDocument();\n expect(screen.getByText('Cell 2.3')).toBeInTheDocument();\n });\n\n it('should render table headers', () => {\n const { container } = render(<TableSection {...defaultProps} />);\n\n const thElements = container.querySelectorAll('th');\n\n expect(thElements.length).toBe(4);\n expect(thElements[0]).toHaveTextContent('Cell 1.1');\n expect(thElements[3]).toHaveTextContent('Cell 2.1');\n });\n\n it('should render table data cells', () => {\n const { container } = render(<TableSection {...defaultProps} />);\n\n const tdElements = container.querySelectorAll('td');\n expect(tdElements.length).toBe(2);\n expect(tdElements[0]).toHaveTextContent('Cell 2.2');\n expect(tdElements[1]).toHaveTextContent('Cell 2.3');\n });\n});\n"],"names":["render","_jsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"TableSection.test.js","sources":["../../../../../../../src/lib/components/table/components/TableSection/TableSection.test.tsx"],"sourcesContent":["import { render, screen } from '../../../../util/testUtils';\nimport { TableSection, TableSectionProps } from './TableSection';\n\nconst tableCellRows: TableSectionProps['tableCellRows'] = [\n [{ text: 'Cell 1.1' }, { text: 'Cell 1.2' }, { text: 'Cell 1.3' }],\n [{ text: 'Cell 2.1' }, { text: 'Cell 2.2' }, { text: 'Cell 2.3' }],\n];\n\nconst mockTitle = 'Test Table';\n\nconst mockOpenModal = jest.fn();\n\nconst defaultProps: TableSectionProps = {\n tableCellRows,\n title: mockTitle,\n openModal: mockOpenModal,\n};\n\ndescribe('TableSection', () => {\n it('renders the table caption', () => {\n render(<TableSection {...defaultProps} />);\n\n expect(screen.getByText(mockTitle)).toBeInTheDocument();\n });\n\n it('renders the table with correct data', () => {\n render(<TableSection {...defaultProps} />);\n\n expect(screen.getByText('Cell 1.1')).toBeInTheDocument();\n expect(screen.getByText('Cell 1.2')).toBeInTheDocument();\n expect(screen.getByText('Cell 1.3')).toBeInTheDocument();\n\n expect(screen.getByText('Cell 2.1')).toBeInTheDocument();\n expect(screen.getByText('Cell 2.2')).toBeInTheDocument();\n expect(screen.getByText('Cell 2.3')).toBeInTheDocument();\n });\n\n it('should render table headers', () => {\n const { container } = render(<TableSection {...defaultProps} />);\n\n const thElements = container.querySelectorAll('th');\n\n expect(thElements.length).toBe(4);\n expect(thElements[0]).toHaveTextContent('Cell 1.1');\n expect(thElements[3]).toHaveTextContent('Cell 2.1');\n });\n\n it('should render table data cells', () => {\n const { container } = render(<TableSection {...defaultProps} />);\n\n const tdElements = container.querySelectorAll('td');\n expect(tdElements.length).toBe(2);\n expect(tdElements[0]).toHaveTextContent('Cell 2.2');\n expect(tdElements[1]).toHaveTextContent('Cell 2.3');\n });\n});\n"],"names":["render","_jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAM,aAAa,GAAuC;AACxD,IAAA,CAA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MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC,iBAAiB,EAAE;AAC1D,IAAA,CAAC,CAAC;IAEF,EAAE,CAAC,6BAA6B,EAAE,YAAA;QACxB,IAAA,SAAS,GAAKD,YAAM,CAACC,GAAA,CAAC,YAAY,EAAA,QAAA,CAAA,EAAA,EAAK,YAAY,CAAA,CAAI,CAAC,CAAA,SAA/C;QAEjB,IAAM,UAAU,GAAG,SAAS,CAAC,gBAAgB,CAAC,IAAI,CAAC;QAEnD,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;QACjC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC,UAAU,CAAC;QACnD,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC,UAAU,CAAC;AACrD,IAAA,CAAC,CAAC;IAEF,EAAE,CAAC,gCAAgC,EAAE,YAAA;QAC3B,IAAA,SAAS,GAAKD,YAAM,CAACC,GAAA,CAAC,YAAY,EAAA,QAAA,CAAA,EAAA,EAAK,YAAY,CAAA,CAAI,CAAC,CAAA,SAA/C;QAEjB,IAAM,UAAU,GAAG,SAAS,CAAC,gBAAgB,CAAC,IAAI,CAAC;QACnD,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;QACjC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC,UAAU,CAAC;QACnD,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC,UAAU,CAAC;AACrD,IAAA,CAAC,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { c as classNames } from '../../index-DLQEsiym.js';
|
|
3
|
+
import { useRef, useCallback } from 'react';
|
|
4
|
+
import { s as styleInject } from '../../style-inject.es-tgCJW-Cu.js';
|
|
5
|
+
import '../../_commonjsHelpers-BFTU3MAI.js';
|
|
6
|
+
|
|
7
|
+
var css_248z = ".Tabs-module_fw-normal__11b64 {\n font-weight: 400 !important;\n}\n\n.Tabs-module_fw-bold__2B416 {\n font-weight: 600 !important;\n}\n\n.Tabs-module_tabs__1Orza {\n display: flex;\n column-gap: 24px;\n}\n\n.Tabs-module_tab__3b1j3 {\n border: none;\n border-bottom: 2px solid transparent;\n font-weight: 600;\n padding: 0 0 4px;\n color: #b8b8c0;\n}\n.Tabs-module_tab__3b1j3:hover, .Tabs-module_tabActive__ZvZyX {\n color: #26262e;\n border-bottom-color: #26262e;\n}\n.Tabs-module_tab__3b1j3:focus-visible {\n outline: 1px solid #26262e;\n outline-offset: 2px;\n border-radius: 2px;\n}";
|
|
8
|
+
var styles = {"tabs":"Tabs-module_tabs__1Orza","tab":"Tabs-module_tab__3b1j3","tabActive":"Tabs-module_tabActive__ZvZyX"};
|
|
9
|
+
styleInject(css_248z);
|
|
10
|
+
|
|
11
|
+
var Tabs = function (_a) {
|
|
12
|
+
var tabs = _a.tabs, activeIndex = _a.activeIndex, onTabChange = _a.onTabChange, className = _a.className;
|
|
13
|
+
var tabRefs = useRef([]);
|
|
14
|
+
var setTabRef = useCallback(function (index) { return function (el) {
|
|
15
|
+
tabRefs.current[index] = el;
|
|
16
|
+
}; }, []);
|
|
17
|
+
var handleKeyDown = function (e, index) {
|
|
18
|
+
var _a;
|
|
19
|
+
var count = tabs.length;
|
|
20
|
+
var nextIndex = null;
|
|
21
|
+
if (e.key === 'ArrowRight')
|
|
22
|
+
nextIndex = (index + 1) % count;
|
|
23
|
+
if (e.key === 'ArrowLeft')
|
|
24
|
+
nextIndex = (index - 1 + count) % count;
|
|
25
|
+
if (nextIndex !== null) {
|
|
26
|
+
e.preventDefault();
|
|
27
|
+
onTabChange(nextIndex);
|
|
28
|
+
(_a = tabRefs.current[nextIndex]) === null || _a === void 0 ? void 0 : _a.focus({ preventScroll: true });
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
return (jsx("div", { className: classNames(styles.tabs, className), role: "tablist", children: tabs.map(function (tab, index) {
|
|
32
|
+
var _a;
|
|
33
|
+
return (jsx("button", { ref: setTabRef(index), type: "button", role: "tab", "aria-selected": activeIndex === index, tabIndex: activeIndex === index ? 0 : -1, className: classNames('p-p bg-transparent c-pointer', styles.tab, (_a = {},
|
|
34
|
+
_a[styles.tabActive] = activeIndex === index,
|
|
35
|
+
_a)), onClick: function () { return onTabChange(index); }, onKeyDown: function (e) { return handleKeyDown(e, index); }, children: tab.label }, tab.id));
|
|
36
|
+
}) }));
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export { Tabs };
|
|
40
|
+
//# sourceMappingURL=Tabs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tabs.js","sources":["../../../../../src/lib/components/tabs/Tabs.tsx"],"sourcesContent":["import classNames from 'classnames';\nimport { KeyboardEvent, useCallback, useRef } from 'react';\n\nimport styles from './Tabs.module.scss';\n\nexport interface TabItem {\n id: string;\n label: string;\n}\n\nexport interface TabsProps {\n tabs: TabItem[];\n activeIndex: number;\n onTabChange: (index: number) => void;\n className?: string;\n}\n\nconst Tabs = ({ tabs, activeIndex, onTabChange, className }: TabsProps) => {\n const tabRefs = useRef<(HTMLButtonElement | null)[]>([]);\n\n const setTabRef = useCallback(\n (index: number) => (el: HTMLButtonElement | null) => {\n tabRefs.current[index] = el;\n },\n []\n );\n\n const handleKeyDown = (e: KeyboardEvent, index: number) => {\n const count = tabs.length;\n let nextIndex: number | null = null;\n\n if (e.key === 'ArrowRight') nextIndex = (index + 1) % count;\n if (e.key === 'ArrowLeft') nextIndex = (index - 1 + count) % count;\n\n if (nextIndex !== null) {\n e.preventDefault();\n onTabChange(nextIndex);\n tabRefs.current[nextIndex]?.focus({ preventScroll: true });\n }\n };\n\n return (\n <div className={classNames(styles.tabs, className)} role=\"tablist\">\n {tabs.map((tab, index) => (\n <button\n ref={setTabRef(index)}\n key={tab.id}\n type=\"button\"\n role=\"tab\"\n aria-selected={activeIndex === index}\n tabIndex={activeIndex === index ? 0 : -1}\n className={classNames('p-p bg-transparent c-pointer', styles.tab, {\n [styles.tabActive]: activeIndex === index,\n })}\n onClick={() => onTabChange(index)}\n onKeyDown={(e) => handleKeyDown(e, index)}\n >\n {tab.label}\n </button>\n ))}\n </div>\n );\n};\n\nexport { Tabs };\n"],"names":["_jsx"],"mappings":";;;;;;;;;;AAiBA,IAAM,IAAI,GAAG,UAAC,EAAwD,EAAA;QAAtD,IAAI,GAAA,EAAA,CAAA,IAAA,EAAE,WAAW,GAAA,EAAA,CAAA,WAAA,EAAE,WAAW,GAAA,EAAA,CAAA,WAAA,EAAE,SAAS,GAAA,EAAA,CAAA,SAAA;AACvD,IAAA,IAAM,OAAO,GAAG,MAAM,CAA+B,EAAE,CAAC;IAExD,IAAM,SAAS,GAAG,WAAW,CAC3B,UAAC,KAAa,EAAA,EAAK,OAAA,UAAC,EAA4B,EAAA;AAC9C,QAAA,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,EAAE;AAC7B,IAAA,CAAC,CAAA,CAFkB,CAElB,EACD,EAAE,CACH;AAED,IAAA,IAAM,aAAa,GAAG,UAAC,CAAgB,EAAE,KAAa,EAAA;;AACpD,QAAA,IAAM,KAAK,GAAG,IAAI,CAAC,MAAM;QACzB,IAAI,SAAS,GAAkB,IAAI;AAEnC,QAAA,IAAI,CAAC,CAAC,GAAG,KAAK,YAAY;YAAE,SAAS,GAAG,CAAC,KAAK,GAAG,CAAC,IAAI,KAAK;AAC3D,QAAA,IAAI,CAAC,CAAC,GAAG,KAAK,WAAW;YAAE,SAAS,GAAG,CAAC,KAAK,GAAG,CAAC,GAAG,KAAK,IAAI,KAAK;AAElE,QAAA,IAAI,SAAS,KAAK,IAAI,EAAE;YACtB,CAAC,CAAC,cAAc,EAAE;YAClB,WAAW,CAAC,SAAS,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';
|
|
5
|
+
import '../../_commonjsHelpers-BFTU3MAI.js';
|
|
6
|
+
import '../../style-inject.es-tgCJW-Cu.js';
|
|
7
|
+
|
|
8
|
+
var story = {
|
|
9
|
+
title: 'JSX/Tabs',
|
|
10
|
+
component: Tabs,
|
|
11
|
+
argTypes: {
|
|
12
|
+
tabs: {
|
|
13
|
+
description: 'Array of tab items with id and label',
|
|
14
|
+
},
|
|
15
|
+
activeIndex: {
|
|
16
|
+
description: 'The currently active tab index',
|
|
17
|
+
},
|
|
18
|
+
onTabChange: {
|
|
19
|
+
action: true,
|
|
20
|
+
table: {
|
|
21
|
+
category: 'Callbacks',
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
className: {
|
|
25
|
+
description: 'Optional CSS class to apply to the tabs container',
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
args: {
|
|
29
|
+
tabs: [
|
|
30
|
+
{ id: 'basic', label: 'Basic' },
|
|
31
|
+
{ id: 'standard', label: 'Standard' },
|
|
32
|
+
{ id: 'premium', label: 'Premium' },
|
|
33
|
+
],
|
|
34
|
+
activeIndex: 0,
|
|
35
|
+
},
|
|
36
|
+
parameters: {
|
|
37
|
+
componentSubtitle: 'A horizontal tab bar for switching between content sections.',
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
var Default = {
|
|
41
|
+
render: function (_a) {
|
|
42
|
+
var tabs = _a.tabs, activeIndex = _a.activeIndex, onTabChange = _a.onTabChange;
|
|
43
|
+
var _b = useState(activeIndex), index = _b[0], setIndex = _b[1];
|
|
44
|
+
var handleChange = function (newIndex) {
|
|
45
|
+
onTabChange === null || onTabChange === void 0 ? void 0 : onTabChange(newIndex);
|
|
46
|
+
setIndex(newIndex);
|
|
47
|
+
};
|
|
48
|
+
return jsx(Tabs, { tabs: tabs, activeIndex: index, onTabChange: handleChange });
|
|
49
|
+
},
|
|
50
|
+
name: 'Default',
|
|
51
|
+
};
|
|
52
|
+
var TwoTabs = {
|
|
53
|
+
render: function () {
|
|
54
|
+
var _a = useState(0), index = _a[0], setIndex = _a[1];
|
|
55
|
+
return (jsx(Tabs, { tabs: [
|
|
56
|
+
{ id: 'monthly', label: 'Monthly' },
|
|
57
|
+
{ id: 'yearly', label: 'Yearly' },
|
|
58
|
+
], activeIndex: index, onTabChange: setIndex }));
|
|
59
|
+
},
|
|
60
|
+
name: 'Two Tabs',
|
|
61
|
+
};
|
|
62
|
+
var ManyTabs = {
|
|
63
|
+
render: function () {
|
|
64
|
+
var _a = useState(0), index = _a[0], setIndex = _a[1];
|
|
65
|
+
return (jsx(Tabs, { tabs: [
|
|
66
|
+
{ id: 'overview', label: 'Overview' },
|
|
67
|
+
{ id: 'coverage', label: 'Coverage' },
|
|
68
|
+
{ id: 'pricing', label: 'Pricing' },
|
|
69
|
+
{ id: 'reviews', label: 'Reviews' },
|
|
70
|
+
{ id: 'faq', label: 'FAQ' },
|
|
71
|
+
], activeIndex: index, onTabChange: setIndex }));
|
|
72
|
+
},
|
|
73
|
+
name: 'Many Tabs',
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
export { Default, ManyTabs, TwoTabs, story as default };
|
|
77
|
+
//# sourceMappingURL=Tabs.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tabs.stories.js","sources":["../../../../../src/lib/components/tabs/Tabs.stories.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { Tabs, TabsProps } from './Tabs';\n\nconst story = {\n title: 'JSX/Tabs',\n component: Tabs,\n argTypes: {\n tabs: {\n description: 'Array of tab items with id and label',\n },\n activeIndex: {\n description: 'The currently active tab index',\n },\n onTabChange: {\n action: true,\n table: {\n category: 'Callbacks',\n },\n },\n className: {\n description: 'Optional CSS class to apply to the tabs container',\n },\n },\n args: {\n tabs: [\n { id: 'basic', label: 'Basic' },\n { id: 'standard', label: 'Standard' },\n { id: 'premium', label: 'Premium' },\n ],\n activeIndex: 0,\n },\n parameters: {\n componentSubtitle:\n 'A horizontal tab bar for switching between content sections.',\n },\n};\n\nexport const Default = {\n render: ({ tabs, activeIndex, onTabChange }: TabsProps) => {\n const [index, setIndex] = useState(activeIndex);\n\n const handleChange = (newIndex: number) => {\n onTabChange?.(newIndex);\n setIndex(newIndex);\n };\n\n return <Tabs tabs={tabs} activeIndex={index} onTabChange={handleChange} />;\n },\n\n name: 'Default',\n};\n\nexport const TwoTabs = {\n render: () => {\n const [index, setIndex] = useState(0);\n\n return (\n <Tabs\n tabs={[\n { id: 'monthly', label: 'Monthly' },\n { id: 'yearly', label: 'Yearly' },\n ]}\n activeIndex={index}\n onTabChange={setIndex}\n />\n );\n },\n\n name: 'Two Tabs',\n};\n\nexport const ManyTabs = {\n render: () => {\n const [index, setIndex] = useState(0);\n\n return (\n <Tabs\n tabs={[\n { id: 'overview', label: 'Overview' },\n { id: 'coverage', label: 'Coverage' },\n { id: 'pricing', label: 'Pricing' },\n { id: 'reviews', label: 'Reviews' },\n { id: 'faq', label: 'FAQ' },\n ]}\n activeIndex={index}\n onTabChange={setIndex}\n />\n );\n },\n\n name: 'Many Tabs',\n};\n\nexport default story;\n"],"names":["_jsx"],"mappings":";;;;;;;AAGA,IAAM,KAAK,GAAG;AACZ,IAAA,KAAK,EAAE,UAAU;AACjB,IAAA,SAAS,EAAE,IAAI;AACf,IAAA,QAAQ,EAAE;AACR,QAAA,IAAI,EAAE;AACJ,YAAA,WAAW,EAAE,sCAAsC;AACpD,SAAA;AACD,QAAA,WAAW,EAAE;AACX,YAAA,WAAW,EAAE,gCAAgC;AAC9C,SAAA;AACD,QAAA,WAAW,EAAE;AACX,YAAA,MAAM,EAAE,IAAI;AACZ,YAAA,KAAK,EAAE;AACL,gBAAA,QAAQ,EAAE,WAAW;AACtB,aAAA;AACF,SAAA;AACD,QAAA,SAAS,EAAE;AACT,YAAA,WAAW,EAAE,mDAAmD;AACjE,SAAA;AACF,KAAA;AACD,IAAA,IAAI,EAAE;AACJ,QAAA,IAAI,EAAE;AACJ,YAAA,EAAE,EAAE,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AE,KAAK,EAAE,SAAS,EAAE;AACnC,gBAAA,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE;aAClC,EACD,WAAW,EAAE,KAAK,EAClB,WAAW,EAAE,QAAQ,EAAA,CACrB;IAEN,CAAC;AAED,IAAA,IAAI,EAAE,UAAU;;AAGX,IAAM,QAAQ,GAAG;AACtB,IAAA,MAAM,EAAE,YAAA;QACA,IAAA,EAAA,GAAoB,QAAQ,CAAC,CAAC,CAAC,EAA9B,KAAK,GAAA,EAAA,CAAA,CAAA,CAAA,EAAE,QAAQ,GAAA,EAAA,CAAA,CAAA,CAAe;AAErC,QAAA,QACEA,GAAA,CAAC,IAAI,EAAA,EACH,IAAI,EAAE;AACJ,gBAAA,EAAE,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE;AACrC,gBAAA,EAAE,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE;AACrC,gBAAA,EAAE,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE;AACnC,gBAAA,EAAE,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE;AACnC,gBAAA,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE;aAC5B,EACD,WAAW,EAAE,KAAK,EAClB,WAAW,EAAE,QAAQ,EAAA,CACrB;IAEN,CAAC;AAED,IAAA,IAAI,EAAE,WAAW;;;;;"}
|
|
@@ -89,9 +89,9 @@ import ChevronsLeft from './components/icon/icons/ChevronsLeft.js';
|
|
|
89
89
|
import ChevronsRight from './components/icon/icons/ChevronsRight.js';
|
|
90
90
|
import ChevronsUp from './components/icon/icons/ChevronsUp.js';
|
|
91
91
|
import Chrome from './components/icon/icons/Chrome.js';
|
|
92
|
-
import
|
|
92
|
+
import CircleSelectedIcon from './components/icon/icons/CircleSelected.js';
|
|
93
93
|
import CircleSmall from './components/icon/icons/CircleSmall.js';
|
|
94
|
-
import
|
|
94
|
+
import CircleUnselectedIcon from './components/icon/icons/CircleUnselected.js';
|
|
95
95
|
import Circle from './components/icon/icons/Circle.js';
|
|
96
96
|
import Clipboard from './components/icon/icons/Clipboard.js';
|
|
97
97
|
import ClockTime from './components/icon/icons/ClockTime.js';
|
|
@@ -477,9 +477,9 @@ var icons = /*#__PURE__*/Object.freeze({
|
|
|
477
477
|
ChevronsUpIcon: ChevronsUp,
|
|
478
478
|
ChromeIcon: Chrome,
|
|
479
479
|
CircleIcon: Circle,
|
|
480
|
-
CircleSelectedIcon:
|
|
480
|
+
CircleSelectedIcon: CircleSelectedIcon,
|
|
481
481
|
CircleSmallIcon: CircleSmall,
|
|
482
|
-
CircleUnselectedIcon:
|
|
482
|
+
CircleUnselectedIcon: CircleUnselectedIcon,
|
|
483
483
|
ClipboardIcon: Clipboard,
|
|
484
484
|
ClockTimeIcon: ClockTime,
|
|
485
485
|
CloudDrizzleIcon: CloudDrizzle,
|
|
@@ -788,4 +788,4 @@ var icons = /*#__PURE__*/Object.freeze({
|
|
|
788
788
|
});
|
|
789
789
|
|
|
790
790
|
export { icons as i };
|
|
791
|
-
//# sourceMappingURL=index-
|
|
791
|
+
//# sourceMappingURL=index-D7G3EuxU.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-
|
|
1
|
+
{"version":3,"file":"index-D7G3EuxU.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/esm/index.js
CHANGED
|
@@ -31,6 +31,7 @@ export { Toggle } from './components/input/toggle/index.js';
|
|
|
31
31
|
export { T as Toaster, t as toast } from './index-CT0_LjIR.js';
|
|
32
32
|
export { Accordion } from './components/accordion/index.js';
|
|
33
33
|
export { Table } from './components/table/Table.js';
|
|
34
|
+
export { Tabs } from './components/tabs/Tabs.js';
|
|
34
35
|
import { useEffect } from 'react';
|
|
35
36
|
export { u as useMediaQuery } from './useMediaQuery-BlEUymPA.js';
|
|
36
37
|
export { u as useOnClickOutside } from './useOnClickOutside-B5hujnpp.js';
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/lib/hooks/useFocusWithin.ts"],"sourcesContent":["import { useEffect } from 'react';\n\nexport const useFocusWithin = (\n ref: HTMLElement | null,\n callback: (isFocusWithin: boolean) => void\n) => {\n useEffect(() => {\n const handleOnFocusIn = () => {\n if (!ref) {\n return;\n }\n\n const hasFocus = ref?.contains(document.activeElement);\n\n callback(Boolean(hasFocus));\n };\n\n document.addEventListener('focusin', handleOnFocusIn);\n\n return () => document?.removeEventListener('focusin', handleOnFocusIn);\n }, [callback, ref]);\n};\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/lib/hooks/useFocusWithin.ts"],"sourcesContent":["import { useEffect } from 'react';\n\nexport const useFocusWithin = (\n ref: HTMLElement | null,\n callback: (isFocusWithin: boolean) => void\n) => {\n useEffect(() => {\n const handleOnFocusIn = () => {\n if (!ref) {\n return;\n }\n\n const hasFocus = ref?.contains(document.activeElement);\n\n callback(Boolean(hasFocus));\n };\n\n document.addEventListener('focusin', handleOnFocusIn);\n\n return () => document?.removeEventListener('focusin', handleOnFocusIn);\n }, [callback, ref]);\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEO,IAAM,cAAc,GAAG,UAC5B,GAAuB,EACvB,QAA0C,EAAA;AAE1C,IAAA,SAAS,CAAC,YAAA;AACR,QAAA,IAAM,eAAe,GAAG,YAAA;YACtB,IAAI,CAAC,GAAG,EAAE;gBACR;YACF;AAEA,YAAA,IAAM,QAAQ,GAAG,GAAG,KAAA,IAAA,IAAH,GAAG,KAAA,MAAA,GAAA,MAAA,GAAH,GAAG,CAAE,QAAQ,CAAC,QAAQ,CAAC,aAAa,CAAC;AAEtD,YAAA,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;AAC7B,QAAA,CAAC;AAED,QAAA,QAAQ,CAAC,gBAAgB,CAAC,SAAS,EAAE,eAAe,CAAC;AAErD,QAAA,OAAO,cAAM,OAAA,QAAQ,KAAA,IAAA,IAAR,QAAQ,uBAAR,QAAQ,CAAE,mBAAmB,CAAC,SAAS,EAAE,eAAe,CAAC,CAAA,CAAzD,CAAyD;AACxE,IAAA,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;AACrB;;;;"}
|
|
@@ -26,6 +26,7 @@ export interface TableProps {
|
|
|
26
26
|
hideTableNavigation?: boolean;
|
|
27
27
|
hideStickyHeader?: boolean;
|
|
28
28
|
showSelectedColumn?: boolean;
|
|
29
|
+
mobileNavigationMode?: 'arrows' | 'tabs';
|
|
29
30
|
}
|
|
30
|
-
declare const Table: ({ cellReplacements, className, collapsibleSections, hideColumns, hideDetails, hideRows, imageComponent, modalContentRenderer, onModalOpen, onSelectionChanged, scrollOnOpen, scrollTopOffset, stickyHeaderTopOffset, tableData, textOverrides: definedTextOverrides, title, activeSection: externalActiveSection, hideTableNavigation, hideStickyHeader, showSelectedColumn, }: TableProps) => JSX.Element;
|
|
31
|
+
declare const Table: ({ cellReplacements, className, collapsibleSections, hideColumns, hideDetails, hideRows, imageComponent, modalContentRenderer, onModalOpen, onSelectionChanged, scrollOnOpen, scrollTopOffset, stickyHeaderTopOffset, tableData, textOverrides: definedTextOverrides, title, activeSection: externalActiveSection, hideTableNavigation, hideStickyHeader, showSelectedColumn, mobileNavigationMode, }: TableProps) => JSX.Element;
|
|
31
32
|
export { Table };
|
|
@@ -2,7 +2,7 @@ import { TableProps } from './Table';
|
|
|
2
2
|
import { TableData } from './types';
|
|
3
3
|
declare const story: {
|
|
4
4
|
title: string;
|
|
5
|
-
component: ({ cellReplacements, className, collapsibleSections, hideColumns, hideDetails, hideRows, imageComponent, modalContentRenderer, onModalOpen, onSelectionChanged, scrollOnOpen, scrollTopOffset, stickyHeaderTopOffset, tableData, textOverrides: definedTextOverrides, title, activeSection: externalActiveSection, hideTableNavigation, hideStickyHeader, showSelectedColumn, }: TableProps) => JSX.Element;
|
|
5
|
+
component: ({ cellReplacements, className, collapsibleSections, hideColumns, hideDetails, hideRows, imageComponent, modalContentRenderer, onModalOpen, onSelectionChanged, scrollOnOpen, scrollTopOffset, stickyHeaderTopOffset, tableData, textOverrides: definedTextOverrides, title, activeSection: externalActiveSection, hideTableNavigation, hideStickyHeader, showSelectedColumn, mobileNavigationMode, }: TableProps) => JSX.Element;
|
|
6
6
|
argTypes: {
|
|
7
7
|
tableData: {
|
|
8
8
|
subContent: string;
|
|
@@ -91,9 +91,17 @@ export declare const TwoPlanQuoteWebsite: {
|
|
|
91
91
|
render: () => JSX.Element;
|
|
92
92
|
name: string;
|
|
93
93
|
};
|
|
94
|
+
export declare const TwoPlanQuote: {
|
|
95
|
+
render: () => JSX.Element;
|
|
96
|
+
name: string;
|
|
97
|
+
};
|
|
94
98
|
export declare const ThreePlanQuoteWebsite: {
|
|
95
99
|
render: () => JSX.Element;
|
|
96
100
|
name: string;
|
|
97
101
|
};
|
|
102
|
+
export declare const TabsNavigationMobile: {
|
|
103
|
+
render: () => JSX.Element;
|
|
104
|
+
name: string;
|
|
105
|
+
};
|
|
98
106
|
export declare const TableDataType: () => JSX.Element;
|
|
99
107
|
export default story;
|
|
@@ -17,6 +17,7 @@ export interface TableContentsProps {
|
|
|
17
17
|
cellReplacements?: CellReplacements;
|
|
18
18
|
imageComponent?: (args: any) => JSX.Element;
|
|
19
19
|
selectedColumn?: number;
|
|
20
|
+
showHeader?: boolean;
|
|
20
21
|
}
|
|
21
|
-
declare const TableContents: ({ className, collapsibleSections, scrollOnOpen, scrollTopOffset, stickyHeaderRef, tableData, hideColumns, hideDetails, hideRows, isMobile, openModal, shouldHideDetails, title, cellReplacements, imageComponent, selectedColumn, }: TableContentsProps) => JSX.Element;
|
|
22
|
+
declare const TableContents: ({ className, collapsibleSections, scrollOnOpen, scrollTopOffset, stickyHeaderRef, tableData, hideColumns, hideDetails, hideRows, isMobile, openModal, shouldHideDetails, title, cellReplacements, imageComponent, selectedColumn, showHeader, }: TableContentsProps) => JSX.Element;
|
|
22
23
|
export { TableContents };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface TabItem {
|
|
2
|
+
id: string;
|
|
3
|
+
label: string;
|
|
4
|
+
}
|
|
5
|
+
export interface TabsProps {
|
|
6
|
+
tabs: TabItem[];
|
|
7
|
+
activeIndex: number;
|
|
8
|
+
onTabChange: (index: number) => void;
|
|
9
|
+
className?: string;
|
|
10
|
+
}
|
|
11
|
+
declare const Tabs: ({ tabs, activeIndex, onTabChange, className }: TabsProps) => JSX.Element;
|
|
12
|
+
export { Tabs };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { TabsProps } from './Tabs';
|
|
2
|
+
declare const story: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: ({ tabs, activeIndex, onTabChange, className }: TabsProps) => JSX.Element;
|
|
5
|
+
argTypes: {
|
|
6
|
+
tabs: {
|
|
7
|
+
description: string;
|
|
8
|
+
};
|
|
9
|
+
activeIndex: {
|
|
10
|
+
description: string;
|
|
11
|
+
};
|
|
12
|
+
onTabChange: {
|
|
13
|
+
action: boolean;
|
|
14
|
+
table: {
|
|
15
|
+
category: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
className: {
|
|
19
|
+
description: string;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
args: {
|
|
23
|
+
tabs: {
|
|
24
|
+
id: string;
|
|
25
|
+
label: string;
|
|
26
|
+
}[];
|
|
27
|
+
activeIndex: number;
|
|
28
|
+
};
|
|
29
|
+
parameters: {
|
|
30
|
+
componentSubtitle: string;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
export declare const Default: {
|
|
34
|
+
render: ({ tabs, activeIndex, onTabChange }: TabsProps) => JSX.Element;
|
|
35
|
+
name: string;
|
|
36
|
+
};
|
|
37
|
+
export declare const TwoTabs: {
|
|
38
|
+
render: () => JSX.Element;
|
|
39
|
+
name: string;
|
|
40
|
+
};
|
|
41
|
+
export declare const ManyTabs: {
|
|
42
|
+
render: () => JSX.Element;
|
|
43
|
+
name: string;
|
|
44
|
+
};
|
|
45
|
+
export default story;
|
package/dist/esm/lib/index.d.ts
CHANGED
|
@@ -28,6 +28,7 @@ import { Toaster, toast } from './components/toast';
|
|
|
28
28
|
import { IconWrapperProps } from './components/icon/IconWrapper';
|
|
29
29
|
import { Accordion, AccordionProps } from './components/accordion';
|
|
30
30
|
import { Table, TableData, TableProps } from './components/table/Table';
|
|
31
|
+
import { Tabs, TabsProps, TabItem } from './components/tabs/Tabs';
|
|
31
32
|
import { useEscapeKey } from './hooks/useEscapeKey';
|
|
32
33
|
import { useFocusWithin } from './hooks/useFocusWithin';
|
|
33
34
|
import { useMediaQuery } from './hooks/useMediaQuery';
|
|
@@ -41,6 +42,6 @@ import { LogoInverted } from './components/logo/LogoInverted';
|
|
|
41
42
|
import { LogoPositiveColor } from './components/logo/LogoPositiveColor';
|
|
42
43
|
import { LogoPositiveBlack } from './components/logo/LogoPositiveBlack';
|
|
43
44
|
export * from './components/icon';
|
|
44
|
-
export { Accordion, DateSelector, SignaturePad, AutocompleteAddress, Input, MultiDropzone, DownloadButton, IbanInput, BottomModal, RegularModal, BottomOrRegularModal, FullScreenModal, InfoCard, Card, CardButton, Button, CurrencyInput, AutoSuggestMultiSelect, Chip, AutoSuggestInput, ComparisonTable, TableRating, TableTrueFalse, TableRowHeader, TableButton, TableInfoButton, SearchableDropdown, SegmentedControl, Checkbox, Radio, Link, InformationBox, Badge, images, illustrations, Spinner, Table, Toggle, Toaster, toast, useEscapeKey, useFocusWithin, useOnClickOutside, useMediaQuery, LogoColor, LogoWhite, LogoBlack, LogoOrangeBox, LogoInvertedColor, LogoInverted, LogoPositiveColor, LogoPositiveBlack, };
|
|
45
|
-
export type { AccordionProps, SearchableDropdownProps, SearchableDropdownOption, BadgeProps, IllustrationKeys, InformationBoxProps, InputProps, FileType, MultiDropzoneProps, TableHeader, UploadedFile, UploadStatus, CardProps, IconWrapperProps, TableData, TableProps, };
|
|
45
|
+
export { Accordion, DateSelector, SignaturePad, AutocompleteAddress, Input, MultiDropzone, DownloadButton, IbanInput, BottomModal, RegularModal, BottomOrRegularModal, FullScreenModal, InfoCard, Card, CardButton, Button, CurrencyInput, AutoSuggestMultiSelect, Chip, AutoSuggestInput, ComparisonTable, TableRating, TableTrueFalse, TableRowHeader, TableButton, TableInfoButton, SearchableDropdown, SegmentedControl, Checkbox, Radio, Link, InformationBox, Badge, images, illustrations, Spinner, Table, Tabs, Toggle, Toaster, toast, useEscapeKey, useFocusWithin, useOnClickOutside, useMediaQuery, LogoColor, LogoWhite, LogoBlack, LogoOrangeBox, LogoInvertedColor, LogoInverted, LogoPositiveColor, LogoPositiveBlack, };
|
|
46
|
+
export type { AccordionProps, SearchableDropdownProps, SearchableDropdownOption, BadgeProps, IllustrationKeys, InformationBoxProps, InputProps, FileType, MultiDropzoneProps, TableHeader, UploadedFile, UploadStatus, CardProps, IconWrapperProps, TabItem, TabsProps, TableData, TableProps, };
|
|
46
47
|
export type { DownloadStatus } from './models/download';
|
|
@@ -39,6 +39,8 @@ import '../../components/table/components/TableCell/CardCell/CardCell.js';
|
|
|
39
39
|
import '../../components/cards/card/index.js';
|
|
40
40
|
import '../../components/icon/icons/ChevronRight.js';
|
|
41
41
|
import '../../components/table/components/TableCell/ButtonCell/ButtonCell.js';
|
|
42
|
+
import '../../components/icon/icons/CircleSelected.js';
|
|
43
|
+
import '../../components/icon/icons/CircleUnselected.js';
|
|
42
44
|
|
|
43
45
|
var css_248z = ".style-module_searchBar__1ADz1 {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n border-bottom: 1px solid #e7e7ed;\n padding: 4px 20px;\n z-index: 9;\n}\n\n.style-module_imageWrapper__1t-SZ {\n width: 32px;\n height: 32px;\n}\n.style-module_imageWrapper__1t-SZ img {\n width: 100%;\n}";
|
|
44
46
|
var styles = {"searchBar":"style-module_searchBar__1ADz1","imageWrapper":"style-module_imageWrapper__1t-SZ"};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.stories.js","sources":["../../../../../src/lib/util/images/index.stories.tsx"],"sourcesContent":["import { ChangeEvent, useState } from 'react';\nimport { illustrations } from '../../util/images';\nimport classNames from 'classnames';\nimport { Button, Input } from '../..';\nimport styles from './style.module.scss';\n\nconst story = {\n title: 'Utils/Illustrations',\n parameters: {\n docs: {\n description: {\n component:\n 'Use the `illustrations` object export to access our list of available images.',\n },\n },\n },\n};\n\nconst initialImages = Object.entries(illustrations);\n\nexport const Illustrations = () => {\n const [value, setValue] = useState('');\n const [options, setOptions] = useState(initialImages);\n\n const clearSearch = () => {\n setValue('');\n setOptions(initialImages);\n };\n\n const handleOnSearch = (event: ChangeEvent<HTMLInputElement>) => {\n const searchValue = event.target.value;\n setValue(event.target.value);\n\n if (searchValue === '') {\n setOptions(initialImages);\n return;\n }\n\n setOptions(\n initialImages.filter(([key]) =>\n key.toLowerCase().includes(searchValue.toLowerCase())\n )\n );\n };\n\n return (\n <div>\n <div className={classNames(styles.searchBar, 'bg-white')}>\n <div className=\"d-flex gap8 wmx12 m-auto\">\n <Input\n className=\"w70\"\n onChange={handleOnSearch}\n placeholder=\"Search icon\"\n value={value}\n />\n <Button className=\"w30\" disabled={!value} onClick={clearSearch}>\n Clear search\n </Button>\n </div>\n </div>\n\n <div className=\"d-flex f-wrap mt80\">\n {options.map(([iconKey, src]) => (\n <div key={iconKey} className=\"w20 p8\">\n <div className=\"br4 p24 pt16 pb16 bg-neutral-50 w100 d-flex fd-column ai-center\">\n <div className={styles.imageWrapper}>\n <img src={src} alt={iconKey} />\n </div>\n <span className=\"p-p--small mt16\">{iconKey}</span>\n </div>\n </div>\n ))}\n </div>\n </div>\n );\n};\n\nexport default story;\n"],"names":["_jsxs","_jsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.stories.js","sources":["../../../../../src/lib/util/images/index.stories.tsx"],"sourcesContent":["import { ChangeEvent, useState } from 'react';\nimport { illustrations } from '../../util/images';\nimport classNames from 'classnames';\nimport { Button, Input } from '../..';\nimport styles from './style.module.scss';\n\nconst story = {\n title: 'Utils/Illustrations',\n parameters: {\n docs: {\n description: {\n component:\n 'Use the `illustrations` object export to access our list of available images.',\n },\n },\n },\n};\n\nconst initialImages = Object.entries(illustrations);\n\nexport const Illustrations = () => {\n const [value, setValue] = useState('');\n const [options, setOptions] = useState(initialImages);\n\n const clearSearch = () => {\n setValue('');\n setOptions(initialImages);\n };\n\n const handleOnSearch = (event: ChangeEvent<HTMLInputElement>) => {\n const searchValue = event.target.value;\n setValue(event.target.value);\n\n if (searchValue === '') {\n setOptions(initialImages);\n return;\n }\n\n setOptions(\n initialImages.filter(([key]) =>\n key.toLowerCase().includes(searchValue.toLowerCase())\n )\n );\n };\n\n return (\n <div>\n <div className={classNames(styles.searchBar, 'bg-white')}>\n <div className=\"d-flex gap8 wmx12 m-auto\">\n <Input\n className=\"w70\"\n onChange={handleOnSearch}\n placeholder=\"Search icon\"\n value={value}\n />\n <Button className=\"w30\" disabled={!value} onClick={clearSearch}>\n Clear search\n </Button>\n </div>\n </div>\n\n <div className=\"d-flex f-wrap mt80\">\n {options.map(([iconKey, src]) => (\n <div key={iconKey} className=\"w20 p8\">\n <div className=\"br4 p24 pt16 pb16 bg-neutral-50 w100 d-flex fd-column ai-center\">\n <div className={styles.imageWrapper}>\n <img src={src} alt={iconKey} />\n </div>\n <span className=\"p-p--small mt16\">{iconKey}</span>\n </div>\n </div>\n ))}\n </div>\n </div>\n );\n};\n\n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HANGED
|
@@ -733,6 +733,103 @@ export const TwoPlanQuoteWebsite = {
|
|
|
733
733
|
name: 'Two Plan - Website',
|
|
734
734
|
};
|
|
735
735
|
|
|
736
|
+
const getTwoPlanQuoteData = (
|
|
737
|
+
selectedPlan: number,
|
|
738
|
+
setSelectedPlan: (plan: number) => void
|
|
739
|
+
): TableData => [
|
|
740
|
+
{
|
|
741
|
+
rows: [
|
|
742
|
+
[
|
|
743
|
+
{ text: 'Select a plan' },
|
|
744
|
+
{
|
|
745
|
+
type: 'BUTTON',
|
|
746
|
+
buttonCaption: 'Basic',
|
|
747
|
+
price: '€99/mo',
|
|
748
|
+
isSelected: selectedPlan === 1,
|
|
749
|
+
onClick: () => setSelectedPlan(1),
|
|
750
|
+
},
|
|
751
|
+
{
|
|
752
|
+
type: 'BUTTON',
|
|
753
|
+
buttonCaption: 'Advanced',
|
|
754
|
+
price: '€134/mo',
|
|
755
|
+
isSelected: selectedPlan === 2,
|
|
756
|
+
onClick: () => setSelectedPlan(2),
|
|
757
|
+
},
|
|
758
|
+
],
|
|
759
|
+
[
|
|
760
|
+
{ text: 'Your contribution' },
|
|
761
|
+
{ text: '€99', description: 'per month', fontVariant: 'PRICE' },
|
|
762
|
+
{ text: '€134', description: 'per month', fontVariant: 'PRICE' },
|
|
763
|
+
],
|
|
764
|
+
[
|
|
765
|
+
{ text: 'Outpatient treatments', modalContent: 'Outpatient info' },
|
|
766
|
+
{ checkmarkValue: true },
|
|
767
|
+
{ checkmarkValue: true },
|
|
768
|
+
],
|
|
769
|
+
[
|
|
770
|
+
{ text: 'Inpatient treatments', modalContent: 'Inpatient info' },
|
|
771
|
+
{ checkmarkValue: false },
|
|
772
|
+
{ checkmarkValue: true },
|
|
773
|
+
],
|
|
774
|
+
[
|
|
775
|
+
{ text: 'Dental care', modalContent: 'Dental info' },
|
|
776
|
+
{ text: '50%' },
|
|
777
|
+
{ text: '80%' },
|
|
778
|
+
],
|
|
779
|
+
],
|
|
780
|
+
},
|
|
781
|
+
{
|
|
782
|
+
section: {
|
|
783
|
+
title: 'Coverage details',
|
|
784
|
+
},
|
|
785
|
+
rows: [
|
|
786
|
+
[
|
|
787
|
+
{ text: 'Annual limit' },
|
|
788
|
+
{ text: 'Up to €10,000' },
|
|
789
|
+
{ text: 'Unlimited' },
|
|
790
|
+
],
|
|
791
|
+
[
|
|
792
|
+
{ text: 'Deductible' },
|
|
793
|
+
{ text: '€500' },
|
|
794
|
+
{ text: '€250' },
|
|
795
|
+
],
|
|
796
|
+
[
|
|
797
|
+
{ text: 'Preventive care' },
|
|
798
|
+
{ checkmarkValue: true },
|
|
799
|
+
{ checkmarkValue: true },
|
|
800
|
+
],
|
|
801
|
+
[
|
|
802
|
+
{ text: 'Alternative medicine' },
|
|
803
|
+
{ checkmarkValue: false },
|
|
804
|
+
{ checkmarkValue: true },
|
|
805
|
+
],
|
|
806
|
+
],
|
|
807
|
+
},
|
|
808
|
+
];
|
|
809
|
+
|
|
810
|
+
const TwoPlanQuoteStory = () => {
|
|
811
|
+
const [selectedPlan, setSelectedPlan] = useState(1);
|
|
812
|
+
|
|
813
|
+
return (
|
|
814
|
+
<div style={{ maxWidth: 900 }}>
|
|
815
|
+
<Table
|
|
816
|
+
tableData={getTwoPlanQuoteData(selectedPlan, setSelectedPlan)}
|
|
817
|
+
title="Two plan quote"
|
|
818
|
+
collapsibleSections
|
|
819
|
+
showSelectedColumn
|
|
820
|
+
activeSection={selectedPlan}
|
|
821
|
+
onSelectionChanged={setSelectedPlan}
|
|
822
|
+
/>
|
|
823
|
+
</div>
|
|
824
|
+
);
|
|
825
|
+
};
|
|
826
|
+
|
|
827
|
+
export const TwoPlanQuote = {
|
|
828
|
+
render: () => <TwoPlanQuoteStory />,
|
|
829
|
+
|
|
830
|
+
name: 'Two Plan Quote',
|
|
831
|
+
};
|
|
832
|
+
|
|
736
833
|
const threePlanWebsiteData: TableData = [
|
|
737
834
|
{
|
|
738
835
|
rows: [
|
|
@@ -854,6 +951,25 @@ export const ThreePlanQuoteWebsite = {
|
|
|
854
951
|
name: 'Three Plan - Website',
|
|
855
952
|
};
|
|
856
953
|
|
|
954
|
+
export const TabsNavigationMobile = {
|
|
955
|
+
render: () => (
|
|
956
|
+
<div style={{ maxWidth: 900 }}>
|
|
957
|
+
<p className="p-p tc-neutral-500 mb16">
|
|
958
|
+
Resize the browser to a mobile width to see tabs instead of
|
|
959
|
+
left/right arrow buttons.
|
|
960
|
+
</p>
|
|
961
|
+
<Table
|
|
962
|
+
tableData={threePlanWebsiteData}
|
|
963
|
+
title="Tabs navigation (mobile)"
|
|
964
|
+
collapsibleSections
|
|
965
|
+
mobileNavigationMode="tabs"
|
|
966
|
+
/>
|
|
967
|
+
</div>
|
|
968
|
+
),
|
|
969
|
+
|
|
970
|
+
name: 'Tabs Navigation (Mobile)',
|
|
971
|
+
};
|
|
972
|
+
|
|
857
973
|
export const TableDataType = () => {
|
|
858
974
|
return (
|
|
859
975
|
<pre>
|