@indico-data/design-system 2.1.3 → 2.3.0
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/.yarn/sdks/eslint/bin/eslint.js +8 -1
- package/.yarn/sdks/eslint/package.json +1 -1
- package/.yarn/sdks/prettier/bin/prettier.cjs +8 -1
- package/.yarn/sdks/prettier/index.cjs +8 -1
- package/.yarn/sdks/typescript/bin/tsc +8 -1
- package/.yarn/sdks/typescript/bin/tsserver +8 -1
- package/.yarn/sdks/typescript/package.json +1 -1
- package/.yarnrc.yml +1 -0
- package/lib/build/generated/iconTypes.d.ts +2 -0
- package/lib/index.css +142 -101
- package/lib/index.d.ts +9 -1371
- package/lib/index.esm.css +142 -101
- package/lib/index.esm.js +26604 -12492
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +26647 -12538
- package/lib/index.js.map +1 -1
- package/lib/{components → src/components}/button/types.d.ts +1 -2
- package/lib/src/components/icons/Icon.d.ts +4 -0
- package/lib/src/components/icons/Icon.stories.d.ts +10 -0
- package/lib/src/components/icons/index.d.ts +1 -0
- package/lib/src/components/icons/types.d.ts +10 -0
- package/lib/{components → src/components}/index.d.ts +2 -0
- package/lib/src/components/tables/table/LoadingComponent.d.ts +1 -0
- package/lib/src/components/tables/table/Table.d.ts +78 -0
- package/lib/src/components/tables/table/Table.stories.d.ts +6 -0
- package/lib/src/components/tables/table/index.d.ts +1 -0
- package/lib/src/components/tables/table/sampleData.d.ts +8 -0
- package/lib/src/index.d.ts +8 -0
- package/lib/{legacy → src/legacy}/components/Accordion/Accordion.stories.d.ts +9 -9
- package/lib/src/legacy/components/Accordion/Accordion.styles.d.ts +1 -0
- package/lib/src/legacy/components/ListTable/Header/Header.styles.d.ts +1 -0
- package/lib/{legacy → src/legacy}/components/ListTable/ListTable.stories.d.ts +7 -7
- package/lib/src/legacy/components/ListTable/ListTable.styles.d.ts +1 -0
- package/lib/{legacy → src/legacy}/components/LoadingAwareContainer/LoadingAwareContainer.stories.d.ts +2 -2
- package/lib/src/legacy/components/LoadingAwareContainer/LoadingAwareContainer.styles.d.ts +2 -0
- package/lib/src/legacy/components/Pagination/Pagination.styles.d.ts +1 -0
- package/lib/{legacy → src/legacy}/components/Toggle/Toggle.d.ts +2 -1
- package/lib/src/legacy/components/Toggle/Toggle.stories.d.ts +21 -0
- package/lib/src/legacy/components/Toggle/Toggle.styles.d.ts +1 -0
- package/lib/src/legacy/components/Tooltip/Tooltip.styles.d.ts +1 -0
- package/lib/{legacy → src/legacy}/components/basic-section/Section/Section.stories.d.ts +1 -2
- package/lib/src/legacy/components/basic-section/Section/Section.styles.d.ts +1 -0
- package/lib/src/legacy/components/basic-section/SectionBlock/SectionBlock.styles.d.ts +1 -0
- package/lib/src/legacy/components/basic-section/SectionBody/SectionBody.styles.d.ts +1 -0
- package/lib/{legacy → src/legacy}/components/basic-section/SectionHeader/SectionHeader.stories.d.ts +1 -1
- package/lib/src/legacy/components/basic-section/SectionHeader/SectionHeader.styles.d.ts +1 -0
- package/lib/src/legacy/components/basic-section/SectionTable/SectionTable.styles.d.ts +1 -0
- package/lib/{legacy → src/legacy}/components/buttons/Button/Button.stories.d.ts +1 -1
- package/lib/src/legacy/components/buttons/Button/Button.styles.d.ts +1 -0
- package/lib/{legacy → src/legacy}/components/buttons/IconButton/IconButton.stories.d.ts +3 -3
- package/lib/src/legacy/components/buttons/IconButton/IconButton.styles.d.ts +5 -0
- package/lib/{legacy → src/legacy}/components/dropdowns/BorderSelect/BorderSelect.stories.d.ts +8 -9
- package/lib/src/legacy/components/dropdowns/BorderSelect/BorderSelect.styles.d.ts +2 -0
- package/lib/{legacy → src/legacy}/components/dropdowns/MultiCombobox/MultiCombobox.d.ts +5 -5
- package/lib/{legacy → src/legacy}/components/dropdowns/MultiCombobox/MultiCombobox.stories.d.ts +7 -7
- package/lib/src/legacy/components/dropdowns/MultiCombobox/MultiCombobox.styles.d.ts +4 -0
- package/lib/{legacy → src/legacy}/components/dropdowns/Select/Select.stories.d.ts +6 -7
- package/lib/src/legacy/components/dropdowns/Select/Select.styles.d.ts +1 -0
- package/lib/{legacy → src/legacy}/components/dropdowns/SingleCombobox/SingleCombobox.d.ts +5 -5
- package/lib/{legacy → src/legacy}/components/dropdowns/SingleCombobox/SingleCombobox.stories.d.ts +5 -6
- package/lib/src/legacy/components/dropdowns/SingleCombobox/SingleCombobox.styles.d.ts +4 -0
- package/lib/{legacy → src/legacy}/components/index.d.ts +0 -2
- package/lib/src/legacy/components/inputs/DatePicker/DatePicker.styles.d.ts +1 -0
- package/lib/src/legacy/components/inputs/EditableInput/EditableInput.styles.d.ts +1 -0
- package/lib/{legacy → src/legacy}/components/inputs/NoInputDatePicker/NoInputDatePicker.d.ts +2 -1
- package/lib/src/legacy/components/inputs/NoInputDatePicker/NoInputDatePicker.styles.d.ts +1 -0
- package/lib/{legacy → src/legacy}/components/inputs/NumberInput/NumberInput.stories.d.ts +2 -2
- package/lib/src/legacy/components/inputs/NumberInput/NumberInput.styles.d.ts +1 -0
- package/lib/src/legacy/components/inputs/RadioButtons/RadioButtons.styles.d.ts +13 -0
- package/lib/src/legacy/components/inputs/RadioGroup/RadioGroup.styles.d.ts +1 -0
- package/lib/{legacy → src/legacy}/components/inputs/SearchInput/SearchInput.stories.d.ts +8 -9
- package/lib/src/legacy/components/inputs/SearchInput/SearchInput.styles.d.ts +1 -0
- package/lib/{legacy → src/legacy}/components/inputs/TextInput/TextInput.stories.d.ts +9 -9
- package/lib/src/legacy/components/inputs/TextInput/TextInput.styles.d.ts +2 -0
- package/lib/src/legacy/components/loading-indicators/BarSpinner/BarSpinner.styles.d.ts +1 -0
- package/lib/src/legacy/components/loading-indicators/CirclePulse/CirclePulse.styles.d.ts +7 -0
- package/lib/{legacy → src/legacy}/components/loading-indicators/CircleSpinner/CircleSpinner.d.ts +3 -4
- package/lib/src/legacy/components/loading-indicators/LoadingIndicator/LoadingIndicator.styles.d.ts +7 -0
- package/lib/src/legacy/components/loading-indicators/LoadingList/LoadingList.styles.d.ts +1 -0
- package/lib/src/legacy/components/loading-indicators/PercentageRing/PercentageRing.styles.d.ts +1 -0
- package/lib/{legacy → src/legacy}/components/modals/ConfirmModal/ConfirmModal.stories.d.ts +5 -5
- package/lib/src/legacy/components/modals/ConfirmModal/ConfirmModal.styles.d.ts +1 -0
- package/lib/src/legacy/components/modals/ModalBase/ModalBase.styles.d.ts +4 -0
- package/lib/src/legacy/components/text-truncate/TextTruncate.styles.d.ts +1 -0
- package/lib/{legacy → src/legacy}/components/user-feedback/Shrug/Shrug.stories.d.ts +11 -11
- package/lib/src/legacy/components/user-feedback/Shrug/Shrug.styles.d.ts +1 -0
- package/lib/{legacy → src/legacy}/styles/globals/buttons.d.ts +0 -1
- package/lib/{legacy → src/legacy}/styles/globals/forms.d.ts +0 -1
- package/lib/{legacy → src/legacy}/styles/globals/layout.d.ts +0 -1
- package/lib/{legacy → src/legacy}/styles/globals/lists.d.ts +0 -1
- package/lib/{legacy → src/legacy}/styles/globals/margin-padding.d.ts +0 -1
- package/lib/{legacy → src/legacy}/styles/globals/media.d.ts +0 -1
- package/lib/{legacy → src/legacy}/styles/globals/tables.d.ts +0 -1
- package/lib/{legacy → src/legacy}/styles/globals/typography.d.ts +0 -1
- package/lib/{legacy → src/legacy}/styles/globals/utility-classes.d.ts +0 -1
- package/lib/src/types.d.ts +10 -0
- package/package.json +20 -15
- package/rollup.config.mjs +2 -2
- package/scripts/generateIconTypes.js +50 -0
- package/src/components/button/Button.tsx +1 -2
- package/src/components/button/types.ts +2 -1
- package/src/components/icons/Icon.mdx +49 -0
- package/src/components/icons/Icon.stories.tsx +248 -0
- package/src/components/icons/Icon.tsx +45 -0
- package/src/components/icons/__tests__/Icon.test.tsx +104 -0
- package/src/components/icons/index.ts +1 -0
- package/src/{legacy/components/Icon → components/icons}/indicons.tsx +17 -17
- package/src/components/icons/styles/Icon.scss +23 -0
- package/src/components/icons/types.ts +12 -0
- package/src/components/index.ts +2 -0
- package/src/components/tables/table/LoadingComponent.tsx +5 -0
- package/src/components/tables/table/Table.mdx +15 -0
- package/src/components/tables/table/Table.scss +79 -0
- package/src/components/tables/table/Table.stories.tsx +547 -0
- package/src/components/tables/table/Table.tsx +112 -0
- package/src/components/tables/table/_variables.scss +19 -0
- package/src/components/tables/table/index.ts +1 -0
- package/src/components/tables/table/sampleData.ts +162 -0
- package/src/index.ts +1 -4
- package/src/legacy/components/Accordion/Accordion.tsx +2 -2
- package/src/legacy/components/ListTable/Header/Header.tsx +1 -2
- package/src/legacy/components/ListTable/ListTable.stories.tsx +2 -1
- package/src/legacy/components/Toggle/Toggle.styles.ts +1 -1
- package/src/legacy/components/Toggle/Toggle.tsx +17 -4
- package/src/legacy/components/basic-section/SectionTable/SectionTable.tsx +1 -1
- package/src/legacy/components/buttons/Button/Button.tsx +1 -1
- package/src/legacy/components/buttons/IconButton/IconButton.tsx +2 -2
- package/src/legacy/components/dropdowns/BorderSelect/BorderSelect.tsx +1 -1
- package/src/legacy/components/dropdowns/MultiCombobox/MultiCombobox.stories.tsx +8 -7
- package/src/legacy/components/dropdowns/MultiCombobox/MultiCombobox.styles.ts +3 -1
- package/src/legacy/components/dropdowns/MultiCombobox/MultiCombobox.tsx +2 -2
- package/src/legacy/components/dropdowns/Select/Select.tsx +3 -3
- package/src/legacy/components/dropdowns/SingleCombobox/SingleCombobox.tsx +2 -2
- package/src/legacy/components/index.ts +1 -2
- package/src/legacy/components/inputs/EditableInput/EditableInput.tsx +1 -1
- package/src/legacy/components/inputs/NoInputDatePicker/NoInputDatePicker.stories.tsx +2 -2
- package/src/legacy/components/inputs/NoInputDatePicker/NoInputDatePicker.tsx +5 -4
- package/src/legacy/components/inputs/NumberInput/NumberInput.tsx +1 -1
- package/src/legacy/components/inputs/SearchInput/SearchInput.tsx +1 -1
- package/src/legacy/components/loading-indicators/CircleSpinner/CircleSpinner.tsx +8 -8
- package/src/legacy/components/user-feedback/Shrug/Shrug.styles.ts +2 -0
- package/src/legacy/components/user-feedback/Shrug/Shrug.tsx +4 -4
- package/src/styles/index.scss +2 -2
- package/src/styles/variables/_icons.scss +7 -0
- package/src/styles/variables/index.scss +2 -1
- package/src/types.ts +2 -14
- package/tsconfig.json +1 -1
- package/lib/legacy/components/Accordion/Accordion.styles.d.ts +0 -2
- package/lib/legacy/components/Icon/Icon.d.ts +0 -17
- package/lib/legacy/components/Icon/Icon.stories.d.ts +0 -42
- package/lib/legacy/components/Icon/faIcons.d.ts +0 -76
- package/lib/legacy/components/Icon/index.d.ts +0 -3
- package/lib/legacy/components/Icon/storyHelpers.d.ts +0 -9
- package/lib/legacy/components/ListTable/Header/Header.styles.d.ts +0 -2
- package/lib/legacy/components/ListTable/ListTable.styles.d.ts +0 -2
- package/lib/legacy/components/LoadingAwareContainer/LoadingAwareContainer.styles.d.ts +0 -3
- package/lib/legacy/components/Navigation/Drawer/Drawer.d.ts +0 -16
- package/lib/legacy/components/Navigation/Drawer/Drawer.stories.d.ts +0 -6
- package/lib/legacy/components/Navigation/Drawer/DrawerLinkList.d.ts +0 -9
- package/lib/legacy/components/Navigation/Drawer/DrawerLinkList.styles.d.ts +0 -2
- package/lib/legacy/components/Navigation/Drawer/__mocks__/mocks.d.ts +0 -3
- package/lib/legacy/components/Navigation/Drawer/index.d.ts +0 -1
- package/lib/legacy/components/Navigation/Drawer/types.d.ts +0 -7
- package/lib/legacy/components/Navigation/index.d.ts +0 -1
- package/lib/legacy/components/Pagination/Pagination.styles.d.ts +0 -2
- package/lib/legacy/components/Toggle/Toggle.stories.d.ts +0 -21
- package/lib/legacy/components/Toggle/Toggle.styles.d.ts +0 -2
- package/lib/legacy/components/Tooltip/Tooltip.styles.d.ts +0 -2
- package/lib/legacy/components/basic-section/Section/Section.styles.d.ts +0 -2
- package/lib/legacy/components/basic-section/SectionBlock/SectionBlock.styles.d.ts +0 -2
- package/lib/legacy/components/basic-section/SectionBody/SectionBody.styles.d.ts +0 -2
- package/lib/legacy/components/basic-section/SectionHeader/SectionHeader.styles.d.ts +0 -2
- package/lib/legacy/components/basic-section/SectionTable/SectionTable.styles.d.ts +0 -2
- package/lib/legacy/components/buttons/Button/Button.styles.d.ts +0 -2
- package/lib/legacy/components/buttons/IconButton/IconButton.styles.d.ts +0 -4
- package/lib/legacy/components/dropdowns/BorderSelect/BorderSelect.styles.d.ts +0 -3
- package/lib/legacy/components/dropdowns/MultiCombobox/MultiCombobox.styles.d.ts +0 -3
- package/lib/legacy/components/dropdowns/Select/Select.styles.d.ts +0 -2
- package/lib/legacy/components/dropdowns/SingleCombobox/SingleCombobox.styles.d.ts +0 -3
- package/lib/legacy/components/inputs/DatePicker/DatePicker.styles.d.ts +0 -2
- package/lib/legacy/components/inputs/EditableInput/EditableInput.styles.d.ts +0 -2
- package/lib/legacy/components/inputs/NoInputDatePicker/NoInputDatePicker.styles.d.ts +0 -2
- package/lib/legacy/components/inputs/NumberInput/NumberInput.styles.d.ts +0 -2
- package/lib/legacy/components/inputs/RadioButtons/RadioButtons.styles.d.ts +0 -14
- package/lib/legacy/components/inputs/RadioGroup/RadioGroup.styles.d.ts +0 -2
- package/lib/legacy/components/inputs/SearchInput/SearchInput.styles.d.ts +0 -2
- package/lib/legacy/components/inputs/TextInput/TextInput.styles.d.ts +0 -3
- package/lib/legacy/components/loading-indicators/BarSpinner/BarSpinner.styles.d.ts +0 -2
- package/lib/legacy/components/loading-indicators/CirclePulse/CirclePulse.styles.d.ts +0 -8
- package/lib/legacy/components/loading-indicators/LoadingIndicator/LoadingIndicator.styles.d.ts +0 -8
- package/lib/legacy/components/loading-indicators/LoadingList/LoadingList.styles.d.ts +0 -2
- package/lib/legacy/components/loading-indicators/PercentageRing/PercentageRing.styles.d.ts +0 -2
- package/lib/legacy/components/modals/ConfirmModal/ConfirmModal.styles.d.ts +0 -2
- package/lib/legacy/components/modals/ModalBase/ModalBase.styles.d.ts +0 -4
- package/lib/legacy/components/text-truncate/TextTruncate.styles.d.ts +0 -2
- package/lib/legacy/components/user-feedback/Shrug/Shrug.styles.d.ts +0 -2
- package/lib/types.d.ts +0 -231
- package/src/legacy/components/Icon/Icon.stories.tsx +0 -61
- package/src/legacy/components/Icon/Icon.tsx +0 -76
- package/src/legacy/components/Icon/faIcons.tsx +0 -168
- package/src/legacy/components/Icon/index.ts +0 -3
- package/src/legacy/components/Icon/storyHelpers.tsx +0 -88
- package/src/legacy/components/Navigation/Drawer/Drawer.scss +0 -61
- package/src/legacy/components/Navigation/Drawer/Drawer.stories.tsx +0 -43
- package/src/legacy/components/Navigation/Drawer/Drawer.tsx +0 -107
- package/src/legacy/components/Navigation/Drawer/DrawerLinkList.styles.ts +0 -65
- package/src/legacy/components/Navigation/Drawer/DrawerLinkList.tsx +0 -64
- package/src/legacy/components/Navigation/Drawer/__mocks__/mocks.ts +0 -49
- package/src/legacy/components/Navigation/Drawer/__tests__/Drawer.test.tsx +0 -180
- package/src/legacy/components/Navigation/Drawer/__tests__/DrawerLinkList.test.tsx +0 -66
- package/src/legacy/components/Navigation/Drawer/index.ts +0 -1
- package/src/legacy/components/Navigation/Drawer/types.ts +0 -8
- package/src/legacy/components/Navigation/index.ts +0 -1
- /package/lib/{components → src/components}/button/Button.d.ts +0 -0
- /package/lib/{components → src/components}/button/Button.stories.d.ts +0 -0
- /package/lib/{components → src/components}/button/__tests__/Button.test.d.ts +0 -0
- /package/lib/{components → src/components}/button/enums.d.ts +0 -0
- /package/lib/{components → src/components}/button/index.d.ts +0 -0
- /package/lib/{components → src/components}/grid/col/Col.d.ts +0 -0
- /package/lib/{components → src/components}/grid/col/Col.stories.d.ts +0 -0
- /package/lib/{components → src/components}/grid/container/Container.d.ts +0 -0
- /package/lib/{components → src/components}/grid/container/Container.stories.d.ts +0 -0
- /package/lib/{components → src/components}/grid/index.d.ts +0 -0
- /package/lib/{components → src/components}/grid/row/Row.d.ts +0 -0
- /package/lib/{components → src/components}/grid/row/Row.stories.d.ts +0 -0
- /package/lib/{legacy/components/Navigation/Drawer/__tests__/DrawerLinkList.test.d.ts → src/components/icons/__tests__/Icon.test.d.ts} +0 -0
- /package/lib/{legacy/components/Icon → src/components/icons}/indicons.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/Accordion/Accordion.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/Accordion/index.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/ListTable/Header/Header.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/ListTable/Header/index.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/ListTable/ListTable.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/ListTable/index.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/ListTable/mock-data/index.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/ListTable/mock-data/mock-data.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/LoadingAwareContainer/LoadingAwareContainer.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/LoadingAwareContainer/index.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/Pagination/Pagination.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/Pagination/Pagination.stories.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/Pagination/index.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/Toggle/index.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/Tooltip/Tooltip.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/Tooltip/Tooltip.stories.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/Tooltip/index.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/basic-section/Section/Section.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/basic-section/Section/index.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/basic-section/SectionBlock/SectionBlock.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/basic-section/SectionBlock/index.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/basic-section/SectionBody/SectionBody.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/basic-section/SectionBody/SectionBody.stories.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/basic-section/SectionBody/index.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/basic-section/SectionHeader/SectionHeader.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/basic-section/SectionHeader/index.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/basic-section/SectionTable/SectionTable.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/basic-section/SectionTable/index.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/basic-section/index.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/buttons/Button/Button.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/buttons/Button/index.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/buttons/IconButton/IconButton.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/buttons/IconButton/index.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/buttons/commonStyles.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/buttons/index.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/buttons/types.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/dropdowns/BorderSelect/BorderSelect.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/dropdowns/BorderSelect/index.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/dropdowns/MultiCombobox/index.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/dropdowns/Select/Select.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/dropdowns/Select/index.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/dropdowns/SingleCombobox/index.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/dropdowns/commonStyles.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/dropdowns/index.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/dropdowns/types.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/dropdowns/useCombobox.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/dropdowns/utils.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/inputs/DatePicker/DatePicker.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/inputs/DatePicker/DatePicker.stories.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/inputs/DatePicker/index.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/inputs/EditableInput/EditableInput.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/inputs/EditableInput/EditableInput.stories.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/inputs/EditableInput/index.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/inputs/NoInputDatePicker/NoInputDatePicker.stories.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/inputs/NoInputDatePicker/index.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/inputs/NumberInput/NumberInput.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/inputs/NumberInput/index.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/inputs/RadioButtons/RadioButtons.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/inputs/RadioButtons/RadioButtons.stories.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/inputs/RadioButtons/index.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/inputs/RadioGroup/RadioGroup.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/inputs/RadioGroup/RadioGroup.stories.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/inputs/RadioGroup/index.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/inputs/SearchInput/SearchInput.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/inputs/SearchInput/index.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/inputs/TextInput/TextInput.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/inputs/TextInput/index.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/inputs/index.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/inputs/inputsCommon.styles.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/loading-indicators/BarSpinner/BarSpinner.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/loading-indicators/BarSpinner/BarSpinner.stories.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/loading-indicators/BarSpinner/index.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/loading-indicators/CirclePulse/CirclePulse.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/loading-indicators/CirclePulse/CirclePulse.stories.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/loading-indicators/CirclePulse/index.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/loading-indicators/CircleSpinner/CircleSpinner.stories.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/loading-indicators/CircleSpinner/index.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/loading-indicators/LoadingIndicator/LoadingIndicator.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/loading-indicators/LoadingIndicator/LoadingIndicator.stories.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/loading-indicators/LoadingIndicator/index.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/loading-indicators/LoadingList/LoadingList.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/loading-indicators/LoadingList/LoadingList.stories.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/loading-indicators/LoadingList/index.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/loading-indicators/PercentageRing/PercentageRing.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/loading-indicators/PercentageRing/PercentageRing.stories.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/loading-indicators/PercentageRing/index.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/loading-indicators/RandomLoadingMessage/RandomLoadingMessage.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/loading-indicators/RandomLoadingMessage/RandomLoadingMessage.stories.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/loading-indicators/RandomLoadingMessage/index.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/loading-indicators/RandomLoadingMessage/random-messages.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/loading-indicators/index.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/modals/ConfirmModal/ConfirmModal.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/modals/ConfirmModal/index.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/modals/ModalBase/ModalBase.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/modals/ModalBase/ModalBase.stories.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/modals/ModalBase/index.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/modals/index.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/text-truncate/TextTruncate.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/text-truncate/TextTruncate.stories.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/text-truncate/TextTruncate.test.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/text-truncate/index.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/user-feedback/Shrug/Shrug.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/user-feedback/Shrug/index.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/components/user-feedback/index.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/styles/globals/index.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/styles/index.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/tokens/animation.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/tokens/breakpoints.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/tokens/colors.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/tokens/index.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/tokens/margin.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/tokens/numbers.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/tokens/padding.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/tokens/spacings.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/tokens/typography.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/utils/color.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/utils/index.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/utils/number.d.ts +0 -0
- /package/lib/{legacy → src/legacy}/utils/string.d.ts +0 -0
- /package/lib/{setupTests.d.ts → src/setupTests.d.ts} +0 -0
- /package/lib/{stylesAndAnimations → src/stylesAndAnimations}/borders/BorderColor.d.ts +0 -0
- /package/lib/{stylesAndAnimations → src/stylesAndAnimations}/borders/BorderColor.stories.d.ts +0 -0
- /package/lib/{stylesAndAnimations → src/stylesAndAnimations}/borders/BorderRadius.d.ts +0 -0
- /package/lib/{stylesAndAnimations → src/stylesAndAnimations}/borders/BorderRadius.stories.d.ts +0 -0
- /package/lib/{stylesAndAnimations → src/stylesAndAnimations}/borders/BorderStyles.d.ts +0 -0
- /package/lib/{stylesAndAnimations → src/stylesAndAnimations}/borders/BorderStyles.stories.d.ts +0 -0
- /package/lib/{stylesAndAnimations → src/stylesAndAnimations}/borders/BorderThickness.d.ts +0 -0
- /package/lib/{stylesAndAnimations → src/stylesAndAnimations}/borders/BorderThickness.stories.d.ts +0 -0
- /package/lib/{stylesAndAnimations → src/stylesAndAnimations}/borders/index.d.ts +0 -0
- /package/lib/{stylesAndAnimations → src/stylesAndAnimations}/colors/Colors.d.ts +0 -0
- /package/lib/{stylesAndAnimations → src/stylesAndAnimations}/colors/Colors.stories.d.ts +0 -0
- /package/lib/{stylesAndAnimations → src/stylesAndAnimations}/colors/Swatch.d.ts +0 -0
- /package/lib/{stylesAndAnimations → src/stylesAndAnimations}/colors/UtilityClasses.d.ts +0 -0
- /package/lib/{stylesAndAnimations → src/stylesAndAnimations}/colors/UtilityClasses.stories.d.ts +0 -0
- /package/lib/{stylesAndAnimations → src/stylesAndAnimations}/colors/constants.d.ts +0 -0
- /package/lib/{stylesAndAnimations → src/stylesAndAnimations}/colors/hooks.d.ts +0 -0
- /package/lib/{stylesAndAnimations → src/stylesAndAnimations}/colors/index.d.ts +0 -0
- /package/lib/{stylesAndAnimations → src/stylesAndAnimations}/sizing/Sizing.d.ts +0 -0
- /package/lib/{stylesAndAnimations → src/stylesAndAnimations}/sizing/Sizing.stories.d.ts +0 -0
- /package/lib/{stylesAndAnimations → src/stylesAndAnimations}/sizing/index.d.ts +0 -0
- /package/lib/{stylesAndAnimations → src/stylesAndAnimations}/typography/Typography.d.ts +0 -0
- /package/lib/{stylesAndAnimations → src/stylesAndAnimations}/typography/Typography.stories.d.ts +0 -0
- /package/lib/{stylesAndAnimations → src/stylesAndAnimations}/typography/index.d.ts +0 -0
|
@@ -0,0 +1,547 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { Table } from './Table';
|
|
3
|
+
import { sampleData } from './sampleData';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
|
|
6
|
+
const meta: Meta = {
|
|
7
|
+
title: 'Layout/Table',
|
|
8
|
+
component: Table,
|
|
9
|
+
argTypes: {
|
|
10
|
+
columns: {
|
|
11
|
+
control: false,
|
|
12
|
+
description: 'The columns to display in the table',
|
|
13
|
+
table: {
|
|
14
|
+
category: 'Data',
|
|
15
|
+
type: { summary: 'array' },
|
|
16
|
+
defaultValue: { summary: '[]' },
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
data: {
|
|
20
|
+
control: false,
|
|
21
|
+
description:
|
|
22
|
+
'Its highly recommended that your data have a unique identifier (keyField). The default keyField is id. If you need to override this value then use the keyField proeprty below',
|
|
23
|
+
table: {
|
|
24
|
+
category: 'Data',
|
|
25
|
+
type: { summary: 'array' },
|
|
26
|
+
defaultValue: { summary: '[]' },
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
isDisabled: {
|
|
30
|
+
control: 'boolean',
|
|
31
|
+
description: 'Disables the Table section',
|
|
32
|
+
table: {
|
|
33
|
+
category: 'Styling',
|
|
34
|
+
type: {
|
|
35
|
+
summary: 'boolean',
|
|
36
|
+
},
|
|
37
|
+
defaultValue: { summary: 'false' },
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
isLoading: {
|
|
41
|
+
control: 'boolean',
|
|
42
|
+
description: 'It sets the loading of the table',
|
|
43
|
+
table: {
|
|
44
|
+
category: 'Styling',
|
|
45
|
+
type: {
|
|
46
|
+
summary: 'boolean',
|
|
47
|
+
},
|
|
48
|
+
defaultValue: { summary: 'false' },
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
direction: {
|
|
52
|
+
control: 'select',
|
|
53
|
+
options: ['auto', 'ltr', 'rtl'],
|
|
54
|
+
description:
|
|
55
|
+
'Accepts: ltr, rtl, or auto. When set to auto (default), RDT will attempt to detect direction by checking the HTML and DIV tags. For cases where you need to force rtl, or ltr just set this option manually (i.e. SSR).',
|
|
56
|
+
table: {
|
|
57
|
+
category: 'Accessibility',
|
|
58
|
+
defaultValue: { summary: 'auto' },
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
|
|
62
|
+
title: {
|
|
63
|
+
control: 'text',
|
|
64
|
+
description:
|
|
65
|
+
'The title displayed in the Table Header. If you do not provide the title property the Table Header will not be rendered',
|
|
66
|
+
table: {
|
|
67
|
+
category: 'Styling',
|
|
68
|
+
type: {
|
|
69
|
+
summary: 'string | React Component',
|
|
70
|
+
},
|
|
71
|
+
defaultValue: { summary: '' },
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
responsive: {
|
|
75
|
+
control: 'boolean',
|
|
76
|
+
description: 'Makes the table horizontally scrollable on smaller screen widths',
|
|
77
|
+
table: {
|
|
78
|
+
category: 'Accessibility',
|
|
79
|
+
type: {
|
|
80
|
+
summary: 'boolean',
|
|
81
|
+
},
|
|
82
|
+
defaultValue: { summary: 'true' },
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
dense: {
|
|
86
|
+
control: 'boolean',
|
|
87
|
+
description:
|
|
88
|
+
'Compacts the row height. can be overridden via theming rows.denseHeight. Note: If any custom elements exceed the dense height then the row will only compact to the tallest element any of your cells',
|
|
89
|
+
table: {
|
|
90
|
+
category: 'Accessibility',
|
|
91
|
+
type: {
|
|
92
|
+
summary: 'boolean',
|
|
93
|
+
},
|
|
94
|
+
defaultValue: { summary: 'false' },
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
noHeader: {
|
|
98
|
+
control: 'boolean',
|
|
99
|
+
description:
|
|
100
|
+
'Removes the table header. title, contextTitle and contextActions will be ignored',
|
|
101
|
+
table: {
|
|
102
|
+
category: 'Styling',
|
|
103
|
+
type: {
|
|
104
|
+
summary: 'boolean',
|
|
105
|
+
},
|
|
106
|
+
defaultValue: { summary: 'false' },
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
onSort: {
|
|
110
|
+
control: false,
|
|
111
|
+
description: 'Callback to access the sort state when a column is clicked. Returns',
|
|
112
|
+
table: {
|
|
113
|
+
category: 'Callbacks',
|
|
114
|
+
type: {
|
|
115
|
+
summary: '(selectedColumn, sortDirection, sortedRows) => {}',
|
|
116
|
+
},
|
|
117
|
+
defaultValue: { summary: 'false' },
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
subHeader: {
|
|
121
|
+
control: 'boolean',
|
|
122
|
+
description: 'Show a sub header between the table and table header',
|
|
123
|
+
table: {
|
|
124
|
+
category: 'Styling',
|
|
125
|
+
type: {
|
|
126
|
+
summary: 'boolean',
|
|
127
|
+
},
|
|
128
|
+
defaultValue: { summary: 'false' },
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
subHeaderComponent: {
|
|
132
|
+
control: false,
|
|
133
|
+
description: 'A component you want to render',
|
|
134
|
+
table: {
|
|
135
|
+
category: 'Components',
|
|
136
|
+
type: {
|
|
137
|
+
summary: 'React Component',
|
|
138
|
+
},
|
|
139
|
+
defaultValue: { summary: 'null' },
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
paginationPerPage: {
|
|
143
|
+
control: 'number',
|
|
144
|
+
description: 'The default rows per page to use when the table initially loads',
|
|
145
|
+
table: {
|
|
146
|
+
category: 'Add-Ons',
|
|
147
|
+
type: {
|
|
148
|
+
summary: 'number',
|
|
149
|
+
},
|
|
150
|
+
defaultValue: { summary: '10' },
|
|
151
|
+
},
|
|
152
|
+
},
|
|
153
|
+
noDataComponent: {
|
|
154
|
+
control: false,
|
|
155
|
+
description: 'A custom component to display when there are no records to display',
|
|
156
|
+
table: {
|
|
157
|
+
category: 'Components',
|
|
158
|
+
type: {
|
|
159
|
+
summary: 'string | React Component',
|
|
160
|
+
},
|
|
161
|
+
defaultValue: { summary: 'built-in' },
|
|
162
|
+
},
|
|
163
|
+
},
|
|
164
|
+
expandableRows: {
|
|
165
|
+
control: 'boolean',
|
|
166
|
+
description:
|
|
167
|
+
'Whether to make a row expandable, if true it requires an expandableRowsComponent. It is highly recommended your data set have a unique identifier defined as the keyField for row expansion to work properly.',
|
|
168
|
+
table: {
|
|
169
|
+
category: 'Add-Ons',
|
|
170
|
+
type: {
|
|
171
|
+
summary: 'boolean',
|
|
172
|
+
},
|
|
173
|
+
defaultValue: { summary: 'false' },
|
|
174
|
+
},
|
|
175
|
+
},
|
|
176
|
+
clearSelectedRows: {
|
|
177
|
+
control: 'boolean',
|
|
178
|
+
description:
|
|
179
|
+
'Toggling this property clears the selectedRows. If you use redux or react state you need to make sure that you pass a toggled value or the component will not update',
|
|
180
|
+
table: {
|
|
181
|
+
category: 'Styling',
|
|
182
|
+
type: {
|
|
183
|
+
summary: 'boolean',
|
|
184
|
+
},
|
|
185
|
+
defaultValue: { summary: 'false' },
|
|
186
|
+
},
|
|
187
|
+
},
|
|
188
|
+
pagination: {
|
|
189
|
+
control: 'boolean',
|
|
190
|
+
description:
|
|
191
|
+
'Enable pagination with defaults. by default the total record set will be sliced depending on the page, rows per page. if you wish to use server side pagination then use the paginationServer property',
|
|
192
|
+
table: {
|
|
193
|
+
category: 'Add-Ons',
|
|
194
|
+
type: {
|
|
195
|
+
summary: 'boolean',
|
|
196
|
+
},
|
|
197
|
+
defaultValue: { summary: 'true' },
|
|
198
|
+
},
|
|
199
|
+
},
|
|
200
|
+
selectableRows: {
|
|
201
|
+
control: 'boolean',
|
|
202
|
+
description: 'Whether to show selectable checkboxes',
|
|
203
|
+
table: {
|
|
204
|
+
category: 'Add-Ons',
|
|
205
|
+
type: {
|
|
206
|
+
summary: 'boolean',
|
|
207
|
+
},
|
|
208
|
+
defaultValue: { summary: 'true' },
|
|
209
|
+
},
|
|
210
|
+
},
|
|
211
|
+
|
|
212
|
+
striped: {
|
|
213
|
+
control: 'boolean',
|
|
214
|
+
description: 'Stripe/band color the odd rows',
|
|
215
|
+
table: {
|
|
216
|
+
category: 'Accessibility',
|
|
217
|
+
type: {
|
|
218
|
+
summary: 'boolean',
|
|
219
|
+
},
|
|
220
|
+
defaultValue: { summary: 'true' },
|
|
221
|
+
},
|
|
222
|
+
},
|
|
223
|
+
// hidden props
|
|
224
|
+
onRowDoubleClicked: {
|
|
225
|
+
table: {
|
|
226
|
+
disable: true,
|
|
227
|
+
},
|
|
228
|
+
},
|
|
229
|
+
onRowMouseEnter: {
|
|
230
|
+
table: {
|
|
231
|
+
disable: true,
|
|
232
|
+
},
|
|
233
|
+
},
|
|
234
|
+
onRowMouseLeave: {
|
|
235
|
+
table: {
|
|
236
|
+
disable: true,
|
|
237
|
+
},
|
|
238
|
+
},
|
|
239
|
+
defaultSortFieldId: {
|
|
240
|
+
table: {
|
|
241
|
+
disable: true,
|
|
242
|
+
},
|
|
243
|
+
},
|
|
244
|
+
defaultSortAsc: {
|
|
245
|
+
table: {
|
|
246
|
+
disable: true,
|
|
247
|
+
},
|
|
248
|
+
},
|
|
249
|
+
sortIcon: {
|
|
250
|
+
table: {
|
|
251
|
+
disable: true,
|
|
252
|
+
},
|
|
253
|
+
},
|
|
254
|
+
sortServer: {
|
|
255
|
+
table: {
|
|
256
|
+
disable: true,
|
|
257
|
+
},
|
|
258
|
+
},
|
|
259
|
+
sortFunction: {
|
|
260
|
+
table: {
|
|
261
|
+
disable: true,
|
|
262
|
+
},
|
|
263
|
+
},
|
|
264
|
+
selectableRowsVisibleOnly: {
|
|
265
|
+
table: {
|
|
266
|
+
disable: true,
|
|
267
|
+
},
|
|
268
|
+
},
|
|
269
|
+
selectableRowsHighlight: {
|
|
270
|
+
table: {
|
|
271
|
+
disable: true,
|
|
272
|
+
},
|
|
273
|
+
},
|
|
274
|
+
selectableRowsSingle: {
|
|
275
|
+
table: {
|
|
276
|
+
disable: true,
|
|
277
|
+
},
|
|
278
|
+
},
|
|
279
|
+
selectableRowsNoSelectAll: {
|
|
280
|
+
table: {
|
|
281
|
+
disable: true,
|
|
282
|
+
},
|
|
283
|
+
},
|
|
284
|
+
selectableRowsComponent: {
|
|
285
|
+
table: {
|
|
286
|
+
disable: true,
|
|
287
|
+
},
|
|
288
|
+
},
|
|
289
|
+
selectableRowsComponentProps: {
|
|
290
|
+
table: {
|
|
291
|
+
disable: true,
|
|
292
|
+
},
|
|
293
|
+
},
|
|
294
|
+
selectableRowSelected: {
|
|
295
|
+
table: {
|
|
296
|
+
disable: true,
|
|
297
|
+
},
|
|
298
|
+
},
|
|
299
|
+
selectableRowDisabled: {
|
|
300
|
+
table: {
|
|
301
|
+
disable: true,
|
|
302
|
+
},
|
|
303
|
+
},
|
|
304
|
+
expandableIcon: {
|
|
305
|
+
table: {
|
|
306
|
+
disable: true,
|
|
307
|
+
},
|
|
308
|
+
},
|
|
309
|
+
expandableRowsComponent: {
|
|
310
|
+
table: {
|
|
311
|
+
disable: true,
|
|
312
|
+
},
|
|
313
|
+
},
|
|
314
|
+
expandableRowDisabled: {
|
|
315
|
+
table: {
|
|
316
|
+
disable: true,
|
|
317
|
+
},
|
|
318
|
+
},
|
|
319
|
+
expandableRowExpanded: {
|
|
320
|
+
table: {
|
|
321
|
+
disable: true,
|
|
322
|
+
},
|
|
323
|
+
},
|
|
324
|
+
expandableRowsComponentProps: {
|
|
325
|
+
table: {
|
|
326
|
+
disable: true,
|
|
327
|
+
},
|
|
328
|
+
},
|
|
329
|
+
expandOnRowClicked: {
|
|
330
|
+
table: {
|
|
331
|
+
disable: true,
|
|
332
|
+
},
|
|
333
|
+
},
|
|
334
|
+
expandOnRowDoubleClicked: {
|
|
335
|
+
table: {
|
|
336
|
+
disable: true,
|
|
337
|
+
},
|
|
338
|
+
},
|
|
339
|
+
expandableRowsHideExpander: {
|
|
340
|
+
table: {
|
|
341
|
+
disable: true,
|
|
342
|
+
},
|
|
343
|
+
},
|
|
344
|
+
expandableInheritConditionalStyles: {
|
|
345
|
+
table: {
|
|
346
|
+
disable: true,
|
|
347
|
+
},
|
|
348
|
+
},
|
|
349
|
+
paginationServer: {
|
|
350
|
+
table: {
|
|
351
|
+
disable: true,
|
|
352
|
+
},
|
|
353
|
+
},
|
|
354
|
+
paginationServerOptions: {
|
|
355
|
+
table: {
|
|
356
|
+
disable: true,
|
|
357
|
+
},
|
|
358
|
+
},
|
|
359
|
+
paginationDefaultPage: {
|
|
360
|
+
table: {
|
|
361
|
+
disable: true,
|
|
362
|
+
},
|
|
363
|
+
},
|
|
364
|
+
paginationComponent: {
|
|
365
|
+
table: {
|
|
366
|
+
disable: true,
|
|
367
|
+
},
|
|
368
|
+
},
|
|
369
|
+
paginationComponentOptions: {
|
|
370
|
+
table: {
|
|
371
|
+
disable: true,
|
|
372
|
+
},
|
|
373
|
+
},
|
|
374
|
+
paginationIconFirstPage: {
|
|
375
|
+
table: {
|
|
376
|
+
disable: true,
|
|
377
|
+
},
|
|
378
|
+
},
|
|
379
|
+
paginationIconLastPage: {
|
|
380
|
+
table: {
|
|
381
|
+
disable: true,
|
|
382
|
+
},
|
|
383
|
+
},
|
|
384
|
+
paginationIconNext: {
|
|
385
|
+
table: {
|
|
386
|
+
disable: true,
|
|
387
|
+
},
|
|
388
|
+
},
|
|
389
|
+
paginationIconPrevious: {
|
|
390
|
+
table: {
|
|
391
|
+
disable: true,
|
|
392
|
+
},
|
|
393
|
+
},
|
|
394
|
+
fixedHeader: {
|
|
395
|
+
table: {
|
|
396
|
+
disable: true,
|
|
397
|
+
},
|
|
398
|
+
},
|
|
399
|
+
fixedHeaderScrollHeight: {
|
|
400
|
+
table: {
|
|
401
|
+
disable: true,
|
|
402
|
+
},
|
|
403
|
+
},
|
|
404
|
+
actions: {
|
|
405
|
+
table: {
|
|
406
|
+
disable: true,
|
|
407
|
+
},
|
|
408
|
+
},
|
|
409
|
+
onChangeRowsPerPage: {
|
|
410
|
+
table: {
|
|
411
|
+
disable: true,
|
|
412
|
+
},
|
|
413
|
+
},
|
|
414
|
+
onChangePage: {
|
|
415
|
+
table: {
|
|
416
|
+
disable: true,
|
|
417
|
+
},
|
|
418
|
+
},
|
|
419
|
+
onSelectedRowsChange: {
|
|
420
|
+
table: {
|
|
421
|
+
disable: true,
|
|
422
|
+
},
|
|
423
|
+
},
|
|
424
|
+
paginationResetDefaultPage: {
|
|
425
|
+
table: {
|
|
426
|
+
disable: true,
|
|
427
|
+
},
|
|
428
|
+
},
|
|
429
|
+
onRowExpandToggled: {
|
|
430
|
+
table: {
|
|
431
|
+
disable: true,
|
|
432
|
+
},
|
|
433
|
+
},
|
|
434
|
+
paginationTotalRows: {
|
|
435
|
+
table: {
|
|
436
|
+
disable: true,
|
|
437
|
+
},
|
|
438
|
+
},
|
|
439
|
+
persistTableHead: {
|
|
440
|
+
table: {
|
|
441
|
+
disable: true,
|
|
442
|
+
},
|
|
443
|
+
},
|
|
444
|
+
highlightOnHover: {
|
|
445
|
+
table: {
|
|
446
|
+
disable: true,
|
|
447
|
+
},
|
|
448
|
+
},
|
|
449
|
+
pointerOnHover: {
|
|
450
|
+
table: {
|
|
451
|
+
disable: true,
|
|
452
|
+
},
|
|
453
|
+
},
|
|
454
|
+
keyField: {
|
|
455
|
+
table: {
|
|
456
|
+
disable: true,
|
|
457
|
+
},
|
|
458
|
+
},
|
|
459
|
+
paginationRowsPerPageOptions: {
|
|
460
|
+
table: {
|
|
461
|
+
disable: true,
|
|
462
|
+
},
|
|
463
|
+
},
|
|
464
|
+
onRowClicked: {
|
|
465
|
+
table: {
|
|
466
|
+
disable: true,
|
|
467
|
+
},
|
|
468
|
+
},
|
|
469
|
+
subHeaderAlign: {
|
|
470
|
+
table: {
|
|
471
|
+
disable: true,
|
|
472
|
+
},
|
|
473
|
+
},
|
|
474
|
+
subHeaderWrap: {
|
|
475
|
+
table: {
|
|
476
|
+
disable: true,
|
|
477
|
+
},
|
|
478
|
+
},
|
|
479
|
+
},
|
|
480
|
+
};
|
|
481
|
+
|
|
482
|
+
export default meta;
|
|
483
|
+
|
|
484
|
+
type Story = StoryObj<typeof Table>;
|
|
485
|
+
|
|
486
|
+
interface DataRow {
|
|
487
|
+
name: string;
|
|
488
|
+
class: string;
|
|
489
|
+
age: number;
|
|
490
|
+
weapon: string;
|
|
491
|
+
backstory: string;
|
|
492
|
+
favoriteMeal: string;
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
export const Default: Story = {
|
|
496
|
+
args: {
|
|
497
|
+
pagination: true,
|
|
498
|
+
selectableRows: true,
|
|
499
|
+
isDisabled: false,
|
|
500
|
+
isLoading: false,
|
|
501
|
+
direction: 'ltr',
|
|
502
|
+
striped: true,
|
|
503
|
+
subHeaderAlign: 'center',
|
|
504
|
+
subHeaderWrap: true,
|
|
505
|
+
paginationRowsPerPageOptions: [5, 10, 15, 20],
|
|
506
|
+
responsive: true,
|
|
507
|
+
title: 'Character List',
|
|
508
|
+
dense: true,
|
|
509
|
+
noHeader: false,
|
|
510
|
+
noDataComponent: null,
|
|
511
|
+
expandableRows: false,
|
|
512
|
+
clearSelectedRows: false,
|
|
513
|
+
onSort: false,
|
|
514
|
+
subHeader: false,
|
|
515
|
+
subHeaderComponent: null,
|
|
516
|
+
paginationPerPage: 10,
|
|
517
|
+
columns: [
|
|
518
|
+
{
|
|
519
|
+
name: 'Name',
|
|
520
|
+
selector: (row) => row.name,
|
|
521
|
+
},
|
|
522
|
+
{
|
|
523
|
+
name: 'Class',
|
|
524
|
+
selector: (row) => row.class,
|
|
525
|
+
},
|
|
526
|
+
{
|
|
527
|
+
name: 'Age',
|
|
528
|
+
selector: (row) => row.age,
|
|
529
|
+
sortable: true,
|
|
530
|
+
},
|
|
531
|
+
{
|
|
532
|
+
name: 'Weapon',
|
|
533
|
+
selector: (row) => row.weapon,
|
|
534
|
+
},
|
|
535
|
+
{
|
|
536
|
+
name: 'Backstory',
|
|
537
|
+
selector: (row) => row.backstory,
|
|
538
|
+
},
|
|
539
|
+
{
|
|
540
|
+
name: 'Favorite Meal',
|
|
541
|
+
selector: (row) => row.favoriteMeal,
|
|
542
|
+
},
|
|
543
|
+
],
|
|
544
|
+
data: sampleData as DataRow[],
|
|
545
|
+
},
|
|
546
|
+
render: ({ ...args }) => <Table {...args} />,
|
|
547
|
+
};
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import DataTable, { TableColumn, Direction, Alignment } from 'react-data-table-component';
|
|
3
|
+
import { LoadingComponent } from './LoadingComponent';
|
|
4
|
+
|
|
5
|
+
type LocalDirection = 'auto' | 'ltr' | 'rtl';
|
|
6
|
+
type LocalAlignment = 'left' | 'right' | 'center';
|
|
7
|
+
interface TableProps {
|
|
8
|
+
columns: TableColumn<any>[];
|
|
9
|
+
data: Record<string, any>[];
|
|
10
|
+
responsive?: boolean;
|
|
11
|
+
direction?: LocalDirection;
|
|
12
|
+
subHeaderAlign?: LocalAlignment;
|
|
13
|
+
subHeaderWrap?: boolean;
|
|
14
|
+
pagination?: boolean;
|
|
15
|
+
selectableRows?: boolean;
|
|
16
|
+
keyField?: string;
|
|
17
|
+
title?: string | React.ReactNode;
|
|
18
|
+
striped?: boolean;
|
|
19
|
+
highlightOnHover?: boolean;
|
|
20
|
+
pointerOnHover?: boolean;
|
|
21
|
+
dense?: boolean;
|
|
22
|
+
persistTableHead?: boolean;
|
|
23
|
+
noDataComponent?: string | React.ReactNode;
|
|
24
|
+
isDisabled?: boolean;
|
|
25
|
+
onRowClicked?: (row: Record<string, any>, event: React.MouseEvent) => void;
|
|
26
|
+
onRowDoubleClicked?: (row: Record<string, any>, event: React.MouseEvent) => void;
|
|
27
|
+
onRowMouseEnter?: (row: Record<string, any>, event: React.MouseEvent) => void;
|
|
28
|
+
onRowMouseLeave?: (row: Record<string, any>, event: React.MouseEvent) => void;
|
|
29
|
+
defaultSortFieldId?: string | number;
|
|
30
|
+
defaultSortAsc?: boolean;
|
|
31
|
+
sortIcon?: React.ReactNode;
|
|
32
|
+
sortServer?: boolean;
|
|
33
|
+
sortFunction?: any;
|
|
34
|
+
onSort?: any;
|
|
35
|
+
selectableRowsVisibleOnly?: boolean;
|
|
36
|
+
selectableRowsHighlight?: boolean;
|
|
37
|
+
selectableRowsSingle?: boolean;
|
|
38
|
+
selectableRowsNoSelectAll?: boolean;
|
|
39
|
+
selectableRowsComponent?: any;
|
|
40
|
+
selectableRowsComponentProps?: Record<string, any>;
|
|
41
|
+
clearSelectedRows?: boolean;
|
|
42
|
+
selectableRowSelected?: (row: Record<string, any>) => boolean;
|
|
43
|
+
selectableRowDisabled?: (row: Record<string, any>) => boolean;
|
|
44
|
+
onSelectedRowsChange?: any;
|
|
45
|
+
expandableRows?: boolean;
|
|
46
|
+
expandableIcon?: any;
|
|
47
|
+
expandableRowsComponent?: any;
|
|
48
|
+
expandableRowDisabled?: any;
|
|
49
|
+
expandableRowExpanded?: any;
|
|
50
|
+
expandableRowsComponentProps?: Record<string, any>;
|
|
51
|
+
expandOnRowClicked?: boolean;
|
|
52
|
+
expandOnRowDoubleClicked?: boolean;
|
|
53
|
+
expandableRowsHideExpander?: boolean;
|
|
54
|
+
expandableInheritConditionalStyles?: boolean;
|
|
55
|
+
onRowExpandToggled?: any;
|
|
56
|
+
|
|
57
|
+
paginationServer?: boolean;
|
|
58
|
+
paginationServerOptions?: Record<string, any>;
|
|
59
|
+
paginationDefaultPage?: number;
|
|
60
|
+
paginationResetDefaultPage?: boolean;
|
|
61
|
+
paginationTotalRows?: number;
|
|
62
|
+
paginationPerPage?: number;
|
|
63
|
+
paginationRowsPerPageOptions?: number[];
|
|
64
|
+
paginationComponent?: any;
|
|
65
|
+
paginationComponentOptions?: Record<string, any>;
|
|
66
|
+
paginationIconFirstPage?: any;
|
|
67
|
+
paginationIconLastPage?: any;
|
|
68
|
+
paginationIconNext?: any;
|
|
69
|
+
paginationIconPrevious?: any;
|
|
70
|
+
onChangePage?: any;
|
|
71
|
+
onChangeRowsPerPage?: any;
|
|
72
|
+
|
|
73
|
+
actions?: any;
|
|
74
|
+
noHeader?: boolean;
|
|
75
|
+
fixedHeader?: boolean;
|
|
76
|
+
fixedHeaderScrollHeight?: string;
|
|
77
|
+
subHeader?: boolean;
|
|
78
|
+
subHeaderComponent?: any;
|
|
79
|
+
|
|
80
|
+
isLoading?: boolean;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export const Table = (props: TableProps) => {
|
|
84
|
+
const {
|
|
85
|
+
responsive = true,
|
|
86
|
+
direction = 'auto',
|
|
87
|
+
keyField = 'id',
|
|
88
|
+
striped = true,
|
|
89
|
+
noDataComponent = 'built-in',
|
|
90
|
+
isDisabled,
|
|
91
|
+
isLoading,
|
|
92
|
+
subHeaderAlign = 'left',
|
|
93
|
+
...rest
|
|
94
|
+
} = props;
|
|
95
|
+
return (
|
|
96
|
+
<div className="table-wrapper">
|
|
97
|
+
<DataTable
|
|
98
|
+
responsive={responsive}
|
|
99
|
+
direction={direction as Direction}
|
|
100
|
+
subHeaderAlign={subHeaderAlign as Alignment}
|
|
101
|
+
keyField={keyField}
|
|
102
|
+
striped={striped}
|
|
103
|
+
className={`${striped ? 'pf__table--striped' : ''}`}
|
|
104
|
+
disabled={isDisabled}
|
|
105
|
+
noDataComponent={noDataComponent}
|
|
106
|
+
progressPending={isLoading}
|
|
107
|
+
progressComponent={<LoadingComponent />}
|
|
108
|
+
{...rest}
|
|
109
|
+
/>
|
|
110
|
+
</div>
|
|
111
|
+
);
|
|
112
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// Common Variables
|
|
2
|
+
:root,
|
|
3
|
+
:root [data-theme='light'],
|
|
4
|
+
:root [data-theme='dark'] {
|
|
5
|
+
--pf-table-font-color: var(--pf-gray-color);
|
|
6
|
+
--pf-table-stripe-color: var(--pf-gray-color-100);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
// Light Theme Specific Variables
|
|
10
|
+
:root [data-theme='light'] {
|
|
11
|
+
--pf-table-background-color: var(--pf-white-color);
|
|
12
|
+
--pf-table-stripe-color: var(--pf-gray-color-100);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// Dark Theme Specific Variables
|
|
16
|
+
:root [data-theme='dark'] {
|
|
17
|
+
--pf-table-background-color: var(--pf-primary-color-700);
|
|
18
|
+
--pf-table-stripe-color: var(--pf-primary-color-400);
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Table } from './table';
|