@indico-data/design-system 2.43.0 → 2.44.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/lib/assets/fonts/noto/a.woff2 +0 -0
- package/lib/assets/fonts/noto/b.woff2 +0 -0
- package/lib/assets/fonts/noto/c.woff2 +0 -0
- package/lib/assets/fonts/noto/d.woff2 +0 -0
- package/lib/assets/fonts/noto/e.woff2 +0 -0
- package/lib/assets/fonts/noto/f.woff2 +0 -0
- package/lib/assets/fonts/noto/g.woff2 +0 -0
- package/lib/assets/fonts/noto/h.woff2 +0 -0
- package/lib/assets/fonts/noto/notosans.css +79 -0
- package/lib/components/button/Button.stories.d.ts +11 -13
- package/lib/components/button/enums.d.ts +2 -4
- package/lib/components/button/types.d.ts +6 -7
- package/lib/components/forms/date/iconTriggerDatePicker/IconTriggerDatePicker.d.ts +1 -1
- package/lib/components/forms/date/inputDatePicker/SingleInputDatePicker.d.ts +1 -1
- package/lib/components/forms/input/Input.d.ts +1 -1
- package/lib/index.css +1775 -1017
- package/lib/index.d.ts +148 -885
- package/lib/index.esm.css +1775 -1017
- package/lib/index.esm.js +17829 -24248
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +16041 -22502
- package/lib/index.js.map +1 -1
- package/lib/legacy/components/Tooltip/Tooltip.d.ts +1 -1
- package/lib/legacy/components/index.d.ts +1 -12
- package/lib/legacy/components/loading-indicators/BarSpinner/BarSpinner.d.ts +1 -1
- package/lib/legacy/components/loading-indicators/CirclePulse/CirclePulse.d.ts +1 -1
- package/lib/legacy/components/loading-indicators/CircleSpinner/CircleSpinner.d.ts +1 -1
- package/lib/legacy/components/loading-indicators/index.d.ts +0 -4
- package/lib/legacy/components/modals/ConfirmModal/ConfirmModal.d.ts +1 -1
- package/lib/legacy/components/modals/ModalBase/ModalBase.d.ts +1 -1
- package/lib/stylesAndAnimations/colors/constants.d.ts +0 -1
- package/lib/types.d.ts +1 -3
- package/package.json +1 -1
- package/src/components/button/Button.mdx +28 -78
- package/src/components/button/Button.stories.tsx +312 -176
- package/src/components/button/Button.tsx +23 -16
- package/src/components/button/__tests__/Button.test.tsx +66 -58
- package/src/components/button/enums.ts +2 -6
- package/src/components/button/styles/Button.scss +119 -137
- package/src/components/button/styles/_variables.scss +115 -148
- package/src/components/button/types.ts +6 -8
- package/src/components/card/Card.stories.tsx +1 -1
- package/src/components/card/styles/Card.scss +11 -11
- package/src/components/floatUI/FloatUI.mdx +5 -5
- package/src/components/floatUI/FloatUI.stories.tsx +8 -8
- package/src/components/floatUI/__tests__/FloatUI.test.tsx +3 -3
- package/src/components/floatUI/styles/FloatUI.scss +1 -2
- package/src/components/floatUI/styles/_variables.scss +11 -7
- package/src/components/forms/checkbox/styles/Checkbox.scss +8 -14
- package/src/components/forms/date/datePicker/__tests__/DatePicker.test.tsx +23 -3
- package/src/components/forms/date/datePicker/styles/DatePicker.scss +9 -5
- package/src/components/forms/date/iconTriggerDatePicker/IconTriggerDatePicker.tsx +4 -4
- package/src/components/forms/date/inputDatePicker/SingleInputDatePicker.tsx +1 -1
- package/src/components/forms/form/styles/Form.scss +84 -2
- package/src/components/forms/input/Input.tsx +2 -2
- package/src/components/forms/input/styles/Input.scss +3 -67
- package/src/components/forms/numberInput/NumberInput.tsx +1 -1
- package/src/components/forms/numberInput/styles/NumberInput.scss +4 -67
- package/src/components/forms/passwordInput/PasswordInput.tsx +1 -1
- package/src/components/forms/passwordInput/styles/PasswordInput.scss +3 -67
- package/src/components/forms/radio/styles/Radio.scss +6 -10
- package/src/components/forms/select/styles/Select.scss +30 -44
- package/src/components/forms/textarea/styles/Textarea.scss +1 -49
- package/src/components/forms/toggle/styles/Toggle.scss +13 -12
- package/src/components/grid/styles/Grid.scss +3 -3
- package/src/components/icons/__tests__/Icon.test.tsx +1 -1
- package/src/components/menu/Menu.stories.tsx +3 -3
- package/src/components/menu/Menu.test.tsx +9 -9
- package/src/components/menu/styles/Menu.scss +5 -0
- package/src/components/menu/styles/_variables.scss +11 -6
- package/src/components/pill/styles/Pill.scss +4 -5
- package/src/components/skeleton/styles/Skeleton.scss +2 -2
- package/src/components/table/LoadingComponent.tsx +0 -2
- package/src/components/table/styles/Table.scss +6 -0
- package/src/components/table/styles/_variables.scss +9 -8
- package/src/index.ts +0 -45
- package/src/legacy/components/Tooltip/Tooltip.styles.ts +0 -12
- package/src/legacy/components/Tooltip/Tooltip.tsx +2 -4
- package/src/legacy/components/index.ts +1 -30
- package/src/legacy/components/loading-indicators/BarSpinner/BarSpinner.styles.ts +0 -3
- package/src/legacy/components/loading-indicators/BarSpinner/BarSpinner.tsx +1 -1
- package/src/legacy/components/loading-indicators/CirclePulse/CirclePulse.styles.ts +0 -4
- package/src/legacy/components/loading-indicators/CirclePulse/CirclePulse.tsx +1 -6
- package/src/legacy/components/loading-indicators/CircleSpinner/CircleSpinner.tsx +2 -2
- package/src/legacy/components/loading-indicators/index.ts +0 -4
- package/src/legacy/components/modals/ConfirmModal/ConfirmModal.styles.ts +1 -4
- package/src/legacy/components/modals/ConfirmModal/ConfirmModal.tsx +12 -19
- package/src/legacy/components/modals/ModalBase/ModalBase.styles.tsx +0 -7
- package/src/legacy/components/modals/ModalBase/ModalBase.tsx +1 -1
- package/src/storybookDocs/Permafrost.mdx +92 -0
- package/src/styles/_colors.scss +7 -3
- package/src/styles/_sheets.scss +3 -3
- package/src/styles/assets/fonts/noto/a.woff2 +0 -0
- package/src/styles/assets/fonts/noto/b.woff2 +0 -0
- package/src/styles/assets/fonts/noto/c.woff2 +0 -0
- package/src/styles/assets/fonts/noto/d.woff2 +0 -0
- package/src/styles/assets/fonts/noto/e.woff2 +0 -0
- package/src/styles/assets/fonts/noto/f.woff2 +0 -0
- package/src/styles/assets/fonts/noto/g.woff2 +0 -0
- package/src/styles/assets/fonts/noto/h.woff2 +0 -0
- package/src/styles/assets/fonts/noto/notosans.css +79 -0
- package/src/styles/globals.scss +5 -16
- package/src/styles/index.scss +1 -2
- package/src/styles/storybook.scss +1 -1
- package/src/styles/variables/_borders.scss +6 -6
- package/src/styles/variables/_dropshadows.scss +2 -0
- package/src/styles/variables/_padding.scss +5 -1
- package/src/styles/variables/_typography.scss +7 -1
- package/src/styles/variables/themes/dark.scss +147 -83
- package/src/styles/variables/themes/light.scss +1 -2
- package/src/stylesAndAnimations/colors/Colors.tsx +5 -9
- package/src/stylesAndAnimations/colors/UtilityClasses.tsx +23 -14
- package/src/stylesAndAnimations/colors/constants.ts +183 -114
- package/src/stylesAndAnimations/sizing/Sizing.tsx +2 -2
- package/src/types.ts +1 -7
- package/lib/assets/fonts/mulish/a.woff2 +0 -0
- package/lib/assets/fonts/mulish/b.woff2 +0 -0
- package/lib/assets/fonts/mulish/c.woff2 +0 -0
- package/lib/assets/fonts/mulish/d.woff2 +0 -0
- package/lib/assets/fonts/mulish/mulish.css +0 -98
- package/lib/legacy/components/Accordion/Accordion.d.ts +0 -9
- package/lib/legacy/components/Accordion/Accordion.stories.d.ts +0 -25
- package/lib/legacy/components/Accordion/Accordion.styles.d.ts +0 -1
- package/lib/legacy/components/Accordion/index.d.ts +0 -1
- package/lib/legacy/components/ListTable/Header/Header.d.ts +0 -21
- package/lib/legacy/components/ListTable/Header/Header.styles.d.ts +0 -1
- package/lib/legacy/components/ListTable/Header/index.d.ts +0 -1
- package/lib/legacy/components/ListTable/ListTable.d.ts +0 -41
- package/lib/legacy/components/ListTable/ListTable.stories.d.ts +0 -54
- package/lib/legacy/components/ListTable/ListTable.styles.d.ts +0 -1
- package/lib/legacy/components/ListTable/index.d.ts +0 -1
- package/lib/legacy/components/ListTable/mock-data/index.d.ts +0 -1
- package/lib/legacy/components/ListTable/mock-data/mock-data.d.ts +0 -54
- package/lib/legacy/components/LoadingAwareContainer/LoadingAwareContainer.d.ts +0 -15
- package/lib/legacy/components/LoadingAwareContainer/LoadingAwareContainer.stories.d.ts +0 -22
- package/lib/legacy/components/LoadingAwareContainer/LoadingAwareContainer.styles.d.ts +0 -2
- package/lib/legacy/components/LoadingAwareContainer/index.d.ts +0 -1
- package/lib/legacy/components/Pagination/Pagination.d.ts +0 -18
- package/lib/legacy/components/Pagination/Pagination.stories.d.ts +0 -18
- package/lib/legacy/components/Pagination/Pagination.styles.d.ts +0 -1
- package/lib/legacy/components/Pagination/index.d.ts +0 -1
- package/lib/legacy/components/Toggle/Toggle.d.ts +0 -12
- package/lib/legacy/components/Toggle/Toggle.stories.d.ts +0 -21
- package/lib/legacy/components/Toggle/Toggle.styles.d.ts +0 -1
- package/lib/legacy/components/Toggle/index.d.ts +0 -1
- package/lib/legacy/components/basic-section/Section/Section.d.ts +0 -8
- package/lib/legacy/components/basic-section/Section/Section.stories.d.ts +0 -13
- package/lib/legacy/components/basic-section/Section/Section.styles.d.ts +0 -1
- package/lib/legacy/components/basic-section/Section/index.d.ts +0 -1
- package/lib/legacy/components/basic-section/SectionBlock/SectionBlock.d.ts +0 -9
- package/lib/legacy/components/basic-section/SectionBlock/SectionBlock.styles.d.ts +0 -1
- package/lib/legacy/components/basic-section/SectionBlock/index.d.ts +0 -1
- package/lib/legacy/components/basic-section/SectionBody/SectionBody.d.ts +0 -7
- package/lib/legacy/components/basic-section/SectionBody/SectionBody.stories.d.ts +0 -10
- package/lib/legacy/components/basic-section/SectionBody/SectionBody.styles.d.ts +0 -1
- package/lib/legacy/components/basic-section/SectionBody/index.d.ts +0 -1
- package/lib/legacy/components/basic-section/SectionHeader/SectionHeader.d.ts +0 -8
- package/lib/legacy/components/basic-section/SectionHeader/SectionHeader.stories.d.ts +0 -14
- package/lib/legacy/components/basic-section/SectionHeader/SectionHeader.styles.d.ts +0 -1
- package/lib/legacy/components/basic-section/SectionHeader/index.d.ts +0 -1
- package/lib/legacy/components/basic-section/SectionTable/SectionTable.d.ts +0 -1
- package/lib/legacy/components/basic-section/SectionTable/SectionTable.styles.d.ts +0 -1
- package/lib/legacy/components/basic-section/SectionTable/index.d.ts +0 -1
- package/lib/legacy/components/basic-section/index.d.ts +0 -5
- package/lib/legacy/components/buttons/Button/Button.d.ts +0 -21
- package/lib/legacy/components/buttons/Button/Button.stories.d.ts +0 -25
- package/lib/legacy/components/buttons/Button/Button.styles.d.ts +0 -1
- package/lib/legacy/components/buttons/Button/index.d.ts +0 -1
- package/lib/legacy/components/buttons/IconButton/IconButton.d.ts +0 -32
- package/lib/legacy/components/buttons/IconButton/IconButton.stories.d.ts +0 -43
- package/lib/legacy/components/buttons/IconButton/IconButton.styles.d.ts +0 -5
- package/lib/legacy/components/buttons/IconButton/index.d.ts +0 -1
- package/lib/legacy/components/buttons/commonStyles.d.ts +0 -9
- package/lib/legacy/components/buttons/index.d.ts +0 -2
- package/lib/legacy/components/buttons/types.d.ts +0 -3
- package/lib/legacy/components/dropdowns/BorderSelect/BorderSelect.d.ts +0 -19
- package/lib/legacy/components/dropdowns/BorderSelect/BorderSelect.stories.d.ts +0 -31
- package/lib/legacy/components/dropdowns/BorderSelect/BorderSelect.styles.d.ts +0 -2
- package/lib/legacy/components/dropdowns/BorderSelect/index.d.ts +0 -1
- package/lib/legacy/components/dropdowns/MultiCombobox/MultiCombobox.d.ts +0 -23
- package/lib/legacy/components/dropdowns/MultiCombobox/MultiCombobox.stories.d.ts +0 -46
- package/lib/legacy/components/dropdowns/MultiCombobox/MultiCombobox.styles.d.ts +0 -4
- package/lib/legacy/components/dropdowns/MultiCombobox/index.d.ts +0 -1
- package/lib/legacy/components/dropdowns/Select/Select.d.ts +0 -19
- package/lib/legacy/components/dropdowns/Select/Select.stories.d.ts +0 -34
- package/lib/legacy/components/dropdowns/Select/Select.styles.d.ts +0 -1
- package/lib/legacy/components/dropdowns/Select/index.d.ts +0 -1
- package/lib/legacy/components/dropdowns/SingleCombobox/SingleCombobox.d.ts +0 -20
- package/lib/legacy/components/dropdowns/SingleCombobox/SingleCombobox.stories.d.ts +0 -31
- package/lib/legacy/components/dropdowns/SingleCombobox/SingleCombobox.styles.d.ts +0 -4
- package/lib/legacy/components/dropdowns/SingleCombobox/index.d.ts +0 -1
- package/lib/legacy/components/dropdowns/commonStyles.d.ts +0 -1
- package/lib/legacy/components/dropdowns/index.d.ts +0 -4
- package/lib/legacy/components/dropdowns/types.d.ts +0 -45
- package/lib/legacy/components/dropdowns/useCombobox.d.ts +0 -25
- package/lib/legacy/components/dropdowns/utils.d.ts +0 -20
- package/lib/legacy/components/inputs/EditableInput/EditableInput.d.ts +0 -13
- package/lib/legacy/components/inputs/EditableInput/EditableInput.stories.d.ts +0 -14
- package/lib/legacy/components/inputs/EditableInput/EditableInput.styles.d.ts +0 -1
- package/lib/legacy/components/inputs/EditableInput/index.d.ts +0 -1
- package/lib/legacy/components/inputs/NumberInput/NumberInput.d.ts +0 -23
- package/lib/legacy/components/inputs/NumberInput/NumberInput.stories.d.ts +0 -28
- package/lib/legacy/components/inputs/NumberInput/NumberInput.styles.d.ts +0 -1
- package/lib/legacy/components/inputs/NumberInput/index.d.ts +0 -1
- package/lib/legacy/components/inputs/RadioButtons/RadioButtons.d.ts +0 -25
- package/lib/legacy/components/inputs/RadioButtons/RadioButtons.stories.d.ts +0 -15
- package/lib/legacy/components/inputs/RadioButtons/RadioButtons.styles.d.ts +0 -13
- package/lib/legacy/components/inputs/RadioButtons/index.d.ts +0 -1
- package/lib/legacy/components/inputs/RadioGroup/RadioGroup.d.ts +0 -27
- package/lib/legacy/components/inputs/RadioGroup/RadioGroup.stories.d.ts +0 -16
- package/lib/legacy/components/inputs/RadioGroup/RadioGroup.styles.d.ts +0 -1
- package/lib/legacy/components/inputs/RadioGroup/index.d.ts +0 -1
- package/lib/legacy/components/inputs/SearchInput/SearchInput.d.ts +0 -17
- package/lib/legacy/components/inputs/SearchInput/SearchInput.stories.d.ts +0 -30
- package/lib/legacy/components/inputs/SearchInput/SearchInput.styles.d.ts +0 -1
- package/lib/legacy/components/inputs/SearchInput/index.d.ts +0 -1
- package/lib/legacy/components/inputs/TextInput/TextInput.d.ts +0 -24
- package/lib/legacy/components/inputs/TextInput/TextInput.stories.d.ts +0 -62
- package/lib/legacy/components/inputs/TextInput/TextInput.styles.d.ts +0 -2
- package/lib/legacy/components/inputs/TextInput/index.d.ts +0 -1
- package/lib/legacy/components/inputs/index.d.ts +0 -6
- package/lib/legacy/components/inputs/inputsCommon.styles.d.ts +0 -4
- package/lib/legacy/components/loading-indicators/LoadingIndicator/LoadingIndicator.d.ts +0 -10
- package/lib/legacy/components/loading-indicators/LoadingIndicator/LoadingIndicator.stories.d.ts +0 -11
- package/lib/legacy/components/loading-indicators/LoadingIndicator/LoadingIndicator.styles.d.ts +0 -7
- package/lib/legacy/components/loading-indicators/LoadingIndicator/index.d.ts +0 -1
- package/lib/legacy/components/loading-indicators/LoadingList/LoadingList.d.ts +0 -1
- package/lib/legacy/components/loading-indicators/LoadingList/LoadingList.stories.d.ts +0 -10
- package/lib/legacy/components/loading-indicators/LoadingList/LoadingList.styles.d.ts +0 -1
- package/lib/legacy/components/loading-indicators/LoadingList/index.d.ts +0 -1
- package/lib/legacy/components/loading-indicators/PercentageRing/PercentageRing.d.ts +0 -12
- package/lib/legacy/components/loading-indicators/PercentageRing/PercentageRing.stories.d.ts +0 -10
- package/lib/legacy/components/loading-indicators/PercentageRing/PercentageRing.styles.d.ts +0 -1
- package/lib/legacy/components/loading-indicators/PercentageRing/index.d.ts +0 -1
- package/lib/legacy/components/loading-indicators/RandomLoadingMessage/RandomLoadingMessage.d.ts +0 -1
- package/lib/legacy/components/loading-indicators/RandomLoadingMessage/RandomLoadingMessage.stories.d.ts +0 -10
- package/lib/legacy/components/loading-indicators/RandomLoadingMessage/index.d.ts +0 -1
- package/lib/legacy/components/loading-indicators/RandomLoadingMessage/random-messages.d.ts +0 -2
- package/lib/legacy/components/text-truncate/TextTruncate.d.ts +0 -8
- package/lib/legacy/components/text-truncate/TextTruncate.stories.d.ts +0 -6
- package/lib/legacy/components/text-truncate/TextTruncate.styles.d.ts +0 -1
- package/lib/legacy/components/text-truncate/TextTruncate.test.d.ts +0 -1
- package/lib/legacy/components/text-truncate/index.d.ts +0 -1
- package/lib/legacy/components/user-feedback/Shrug/Shrug.d.ts +0 -14
- package/lib/legacy/components/user-feedback/Shrug/Shrug.stories.d.ts +0 -31
- package/lib/legacy/components/user-feedback/Shrug/Shrug.styles.d.ts +0 -1
- package/lib/legacy/components/user-feedback/Shrug/index.d.ts +0 -1
- package/lib/legacy/components/user-feedback/index.d.ts +0 -1
- package/lib/legacy/styles/globals/buttons.d.ts +0 -1
- package/lib/legacy/styles/globals/forms.d.ts +0 -1
- package/lib/legacy/styles/globals/index.d.ts +0 -1
- package/lib/legacy/styles/globals/layout.d.ts +0 -1
- package/lib/legacy/styles/globals/lists.d.ts +0 -1
- package/lib/legacy/styles/globals/margin-padding.d.ts +0 -1
- package/lib/legacy/styles/globals/media.d.ts +0 -1
- package/lib/legacy/styles/globals/tables.d.ts +0 -1
- package/lib/legacy/styles/globals/typography.d.ts +0 -1
- package/lib/legacy/styles/globals/utility-classes.d.ts +0 -1
- package/lib/legacy/styles/index.d.ts +0 -1
- package/lib/legacy/tokens/animation.d.ts +0 -4
- package/lib/legacy/tokens/breakpoints.d.ts +0 -10
- package/lib/legacy/tokens/colors.d.ts +0 -144
- package/lib/legacy/tokens/index.d.ts +0 -8
- package/lib/legacy/tokens/margin.d.ts +0 -4
- package/lib/legacy/tokens/numbers.d.ts +0 -10
- package/lib/legacy/tokens/padding.d.ts +0 -4
- package/lib/legacy/tokens/spacings.d.ts +0 -5
- package/lib/legacy/tokens/typography.d.ts +0 -61
- package/lib/legacy/utils/color.d.ts +0 -21
- package/lib/legacy/utils/index.d.ts +0 -4
- package/lib/legacy/utils/number.d.ts +0 -21
- package/lib/legacy/utils/string.d.ts +0 -12
- package/src/legacy/components/Accordion/Accordion.stories.tsx +0 -47
- package/src/legacy/components/Accordion/Accordion.styles.ts +0 -35
- package/src/legacy/components/Accordion/Accordion.tsx +0 -30
- package/src/legacy/components/Accordion/index.ts +0 -1
- package/src/legacy/components/ListTable/Header/Header.styles.ts +0 -62
- package/src/legacy/components/ListTable/Header/Header.tsx +0 -66
- package/src/legacy/components/ListTable/Header/index.ts +0 -1
- package/src/legacy/components/ListTable/ListTable.stories.tsx +0 -302
- package/src/legacy/components/ListTable/ListTable.styles.ts +0 -76
- package/src/legacy/components/ListTable/ListTable.tsx +0 -140
- package/src/legacy/components/ListTable/index.ts +0 -1
- package/src/legacy/components/ListTable/mock-data/index.ts +0 -1
- package/src/legacy/components/ListTable/mock-data/mock-data.ts +0 -291
- package/src/legacy/components/LoadingAwareContainer/LoadingAwareContainer.stories.tsx +0 -45
- package/src/legacy/components/LoadingAwareContainer/LoadingAwareContainer.styles.ts +0 -16
- package/src/legacy/components/LoadingAwareContainer/LoadingAwareContainer.tsx +0 -36
- package/src/legacy/components/LoadingAwareContainer/index.ts +0 -1
- package/src/legacy/components/Pagination/Pagination.stories.tsx +0 -45
- package/src/legacy/components/Pagination/Pagination.styles.ts +0 -51
- package/src/legacy/components/Pagination/Pagination.tsx +0 -118
- package/src/legacy/components/Pagination/index.ts +0 -1
- package/src/legacy/components/Toggle/Toggle.stories.tsx +0 -56
- package/src/legacy/components/Toggle/Toggle.styles.ts +0 -86
- package/src/legacy/components/Toggle/Toggle.tsx +0 -69
- package/src/legacy/components/Toggle/index.ts +0 -1
- package/src/legacy/components/basic-section/Section/Section.stories.tsx +0 -14
- package/src/legacy/components/basic-section/Section/Section.styles.ts +0 -8
- package/src/legacy/components/basic-section/Section/Section.tsx +0 -30
- package/src/legacy/components/basic-section/Section/index.ts +0 -1
- package/src/legacy/components/basic-section/SectionBlock/SectionBlock.styles.ts +0 -15
- package/src/legacy/components/basic-section/SectionBlock/SectionBlock.tsx +0 -37
- package/src/legacy/components/basic-section/SectionBlock/index.ts +0 -1
- package/src/legacy/components/basic-section/SectionBody/SectionBody.stories.tsx +0 -16
- package/src/legacy/components/basic-section/SectionBody/SectionBody.styles.ts +0 -18
- package/src/legacy/components/basic-section/SectionBody/SectionBody.tsx +0 -30
- package/src/legacy/components/basic-section/SectionBody/index.ts +0 -1
- package/src/legacy/components/basic-section/SectionHeader/SectionHeader.stories.tsx +0 -17
- package/src/legacy/components/basic-section/SectionHeader/SectionHeader.styles.ts +0 -5
- package/src/legacy/components/basic-section/SectionHeader/SectionHeader.tsx +0 -30
- package/src/legacy/components/basic-section/SectionHeader/index.ts +0 -1
- package/src/legacy/components/basic-section/SectionTable/SectionTable.styles.ts +0 -236
- package/src/legacy/components/basic-section/SectionTable/SectionTable.tsx +0 -233
- package/src/legacy/components/basic-section/SectionTable/index.ts +0 -1
- package/src/legacy/components/basic-section/index.ts +0 -5
- package/src/legacy/components/buttons/Button/Button.stories.tsx +0 -80
- package/src/legacy/components/buttons/Button/Button.styles.ts +0 -99
- package/src/legacy/components/buttons/Button/Button.tsx +0 -74
- package/src/legacy/components/buttons/Button/index.ts +0 -1
- package/src/legacy/components/buttons/IconButton/IconButton.stories.tsx +0 -96
- package/src/legacy/components/buttons/IconButton/IconButton.styles.ts +0 -109
- package/src/legacy/components/buttons/IconButton/IconButton.tsx +0 -114
- package/src/legacy/components/buttons/IconButton/index.ts +0 -1
- package/src/legacy/components/buttons/commonStyles.ts +0 -104
- package/src/legacy/components/buttons/index.ts +0 -2
- package/src/legacy/components/buttons/types.ts +0 -3
- package/src/legacy/components/dropdowns/BorderSelect/BorderSelect.stories.tsx +0 -22
- package/src/legacy/components/dropdowns/BorderSelect/BorderSelect.styles.ts +0 -73
- package/src/legacy/components/dropdowns/BorderSelect/BorderSelect.tsx +0 -85
- package/src/legacy/components/dropdowns/BorderSelect/index.ts +0 -1
- package/src/legacy/components/dropdowns/MultiCombobox/MultiCombobox.stories.tsx +0 -147
- package/src/legacy/components/dropdowns/MultiCombobox/MultiCombobox.styles.ts +0 -91
- package/src/legacy/components/dropdowns/MultiCombobox/MultiCombobox.tsx +0 -123
- package/src/legacy/components/dropdowns/MultiCombobox/index.ts +0 -1
- package/src/legacy/components/dropdowns/Select/Select.stories.tsx +0 -54
- package/src/legacy/components/dropdowns/Select/Select.styles.ts +0 -73
- package/src/legacy/components/dropdowns/Select/Select.tsx +0 -69
- package/src/legacy/components/dropdowns/Select/index.ts +0 -1
- package/src/legacy/components/dropdowns/SingleCombobox/SingleCombobox.stories.tsx +0 -61
- package/src/legacy/components/dropdowns/SingleCombobox/SingleCombobox.styles.ts +0 -56
- package/src/legacy/components/dropdowns/SingleCombobox/SingleCombobox.tsx +0 -103
- package/src/legacy/components/dropdowns/SingleCombobox/index.ts +0 -1
- package/src/legacy/components/dropdowns/commonStyles.ts +0 -65
- package/src/legacy/components/dropdowns/index.ts +0 -4
- package/src/legacy/components/dropdowns/types.ts +0 -45
- package/src/legacy/components/dropdowns/useCombobox.ts +0 -32
- package/src/legacy/components/dropdowns/utils.tsx +0 -25
- package/src/legacy/components/inputs/EditableInput/EditableInput.stories.tsx +0 -26
- package/src/legacy/components/inputs/EditableInput/EditableInput.styles.ts +0 -21
- package/src/legacy/components/inputs/EditableInput/EditableInput.tsx +0 -103
- package/src/legacy/components/inputs/EditableInput/index.ts +0 -1
- package/src/legacy/components/inputs/NumberInput/NumberInput.stories.tsx +0 -72
- package/src/legacy/components/inputs/NumberInput/NumberInput.styles.ts +0 -66
- package/src/legacy/components/inputs/NumberInput/NumberInput.tsx +0 -154
- package/src/legacy/components/inputs/NumberInput/index.ts +0 -1
- package/src/legacy/components/inputs/RadioButtons/RadioButtons.stories.tsx +0 -84
- package/src/legacy/components/inputs/RadioButtons/RadioButtons.styles.ts +0 -82
- package/src/legacy/components/inputs/RadioButtons/RadioButtons.tsx +0 -63
- package/src/legacy/components/inputs/RadioButtons/index.tsx +0 -1
- package/src/legacy/components/inputs/RadioGroup/RadioGroup.stories.tsx +0 -66
- package/src/legacy/components/inputs/RadioGroup/RadioGroup.styles.ts +0 -11
- package/src/legacy/components/inputs/RadioGroup/RadioGroup.tsx +0 -119
- package/src/legacy/components/inputs/RadioGroup/index.ts +0 -1
- package/src/legacy/components/inputs/SearchInput/SearchInput.stories.tsx +0 -37
- package/src/legacy/components/inputs/SearchInput/SearchInput.styles.ts +0 -51
- package/src/legacy/components/inputs/SearchInput/SearchInput.tsx +0 -73
- package/src/legacy/components/inputs/SearchInput/index.ts +0 -1
- package/src/legacy/components/inputs/TextInput/TextInput.stories.tsx +0 -104
- package/src/legacy/components/inputs/TextInput/TextInput.styles.ts +0 -74
- package/src/legacy/components/inputs/TextInput/TextInput.tsx +0 -116
- package/src/legacy/components/inputs/TextInput/index.ts +0 -1
- package/src/legacy/components/inputs/index.ts +0 -6
- package/src/legacy/components/inputs/inputsCommon.styles.ts +0 -57
- package/src/legacy/components/loading-indicators/LoadingIndicator/LoadingIndicator.stories.tsx +0 -22
- package/src/legacy/components/loading-indicators/LoadingIndicator/LoadingIndicator.styles.ts +0 -81
- package/src/legacy/components/loading-indicators/LoadingIndicator/LoadingIndicator.tsx +0 -61
- package/src/legacy/components/loading-indicators/LoadingIndicator/index.ts +0 -1
- package/src/legacy/components/loading-indicators/LoadingList/LoadingList.stories.tsx +0 -14
- package/src/legacy/components/loading-indicators/LoadingList/LoadingList.styles.ts +0 -42
- package/src/legacy/components/loading-indicators/LoadingList/LoadingList.tsx +0 -9
- package/src/legacy/components/loading-indicators/LoadingList/index.ts +0 -1
- package/src/legacy/components/loading-indicators/PercentageRing/PercentageRing.stories.tsx +0 -18
- package/src/legacy/components/loading-indicators/PercentageRing/PercentageRing.styles.ts +0 -27
- package/src/legacy/components/loading-indicators/PercentageRing/PercentageRing.tsx +0 -76
- package/src/legacy/components/loading-indicators/PercentageRing/index.ts +0 -1
- package/src/legacy/components/loading-indicators/RandomLoadingMessage/RandomLoadingMessage.stories.tsx +0 -16
- package/src/legacy/components/loading-indicators/RandomLoadingMessage/RandomLoadingMessage.tsx +0 -18
- package/src/legacy/components/loading-indicators/RandomLoadingMessage/index.ts +0 -1
- package/src/legacy/components/loading-indicators/RandomLoadingMessage/random-messages.js +0 -67
- package/src/legacy/components/text-truncate/TextTruncate.stories.tsx +0 -19
- package/src/legacy/components/text-truncate/TextTruncate.styles.ts +0 -3
- package/src/legacy/components/text-truncate/TextTruncate.test.tsx +0 -17
- package/src/legacy/components/text-truncate/TextTruncate.tsx +0 -23
- package/src/legacy/components/text-truncate/index.ts +0 -1
- package/src/legacy/components/user-feedback/Shrug/Shrug.stories.tsx +0 -38
- package/src/legacy/components/user-feedback/Shrug/Shrug.styles.ts +0 -25
- package/src/legacy/components/user-feedback/Shrug/Shrug.tsx +0 -45
- package/src/legacy/components/user-feedback/Shrug/index.ts +0 -1
- package/src/legacy/components/user-feedback/index.ts +0 -1
- package/src/legacy/styles/globals/buttons.ts +0 -154
- package/src/legacy/styles/globals/forms.ts +0 -53
- package/src/legacy/styles/globals/index.tsx +0 -22
- package/src/legacy/styles/globals/layout.ts +0 -22
- package/src/legacy/styles/globals/lists.ts +0 -23
- package/src/legacy/styles/globals/margin-padding.ts +0 -33
- package/src/legacy/styles/globals/media.ts +0 -13
- package/src/legacy/styles/globals/tables.ts +0 -30
- package/src/legacy/styles/globals/typography.ts +0 -82
- package/src/legacy/styles/globals/utility-classes.ts +0 -76
- package/src/legacy/styles/index.ts +0 -1
- package/src/legacy/tokens/animation.ts +0 -6
- package/src/legacy/tokens/breakpoints.ts +0 -11
- package/src/legacy/tokens/colors.ts +0 -293
- package/src/legacy/tokens/index.ts +0 -20
- package/src/legacy/tokens/margin.ts +0 -5
- package/src/legacy/tokens/numbers.js +0 -41
- package/src/legacy/tokens/padding.ts +0 -5
- package/src/legacy/tokens/spacings.ts +0 -5
- package/src/legacy/tokens/typography.ts +0 -43
- package/src/legacy/utils/color.ts +0 -139
- package/src/legacy/utils/index.ts +0 -5
- package/src/legacy/utils/number.ts +0 -29
- package/src/legacy/utils/string.ts +0 -87
- package/src/styles/assets/fonts/mulish/a.woff2 +0 -0
- package/src/styles/assets/fonts/mulish/b.woff2 +0 -0
- package/src/styles/assets/fonts/mulish/c.woff2 +0 -0
- package/src/styles/assets/fonts/mulish/d.woff2 +0 -0
- package/src/styles/assets/fonts/mulish/mulish.css +0 -98
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Adds custom props to a react-select component
|
|
5
|
-
*
|
|
6
|
-
* @example
|
|
7
|
-
* type Props = ComboboxProps & {
|
|
8
|
-
* multiValueProps: {
|
|
9
|
-
* 'data-cy': string;
|
|
10
|
-
* };
|
|
11
|
-
*
|
|
12
|
-
* <StyledMultiCombobox
|
|
13
|
-
* ...
|
|
14
|
-
* components={{
|
|
15
|
-
* MultiValue: addCustomProps(MultiValue, { ...multiValueProps }),
|
|
16
|
-
* ...
|
|
17
|
-
*
|
|
18
|
-
* @see {@link https://gist.github.com/MikaelCarpenter/1fe226967b00eea82e6a4760b244ada1}
|
|
19
|
-
*/
|
|
20
|
-
export const addCustomProps =
|
|
21
|
-
(Component: any, customProps: { [key: string]: string }) => (props: any) => {
|
|
22
|
-
return (
|
|
23
|
-
<Component {...props} innerProps={Object.assign({}, props.innerProps, { ...customProps })} />
|
|
24
|
-
);
|
|
25
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
// TODO: This component's migration was fast-tracked for Insights. Assess for potential refactor and documentation.
|
|
2
|
-
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import { Meta, StoryObj } from '@storybook/react';
|
|
5
|
-
|
|
6
|
-
import { EditableInput } from './EditableInput';
|
|
7
|
-
|
|
8
|
-
const meta = {
|
|
9
|
-
component: EditableInput,
|
|
10
|
-
title: 'legacy/inputs/EditableInput',
|
|
11
|
-
args: {
|
|
12
|
-
children: <h2>Input-Value</h2>,
|
|
13
|
-
},
|
|
14
|
-
argTypes: {},
|
|
15
|
-
} satisfies Meta<typeof EditableInput>;
|
|
16
|
-
|
|
17
|
-
export default meta;
|
|
18
|
-
type Story = StoryObj<typeof EditableInput>;
|
|
19
|
-
|
|
20
|
-
export const Normal: Story = {};
|
|
21
|
-
|
|
22
|
-
export const MinLengthEight: Story = {
|
|
23
|
-
args: {
|
|
24
|
-
minLength: 8,
|
|
25
|
-
},
|
|
26
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import styled from 'styled-components';
|
|
2
|
-
|
|
3
|
-
const transitionDuration = '200ms';
|
|
4
|
-
|
|
5
|
-
export const StyledEditableInput = styled.span`
|
|
6
|
-
&:hover .pencil-icon {
|
|
7
|
-
opacity: 1;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
[role='textbox'] > * {
|
|
11
|
-
display: inline-block;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.pencil-icon {
|
|
15
|
-
margin-left: 0.25em;
|
|
16
|
-
margin-right: 3px;
|
|
17
|
-
opacity: 0;
|
|
18
|
-
|
|
19
|
-
transition: opacity ${transitionDuration};
|
|
20
|
-
}
|
|
21
|
-
`;
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
// TODO: This component's migration was fast-tracked for Insights. Assess for potential refactor and documentation.
|
|
2
|
-
|
|
3
|
-
import React, { MutableRefObject, useEffect, useRef, useState } from 'react';
|
|
4
|
-
|
|
5
|
-
// todo: how to handle/inform user when length is too short?
|
|
6
|
-
|
|
7
|
-
import classNames from 'classnames';
|
|
8
|
-
|
|
9
|
-
import { stringUtils } from '@/legacy/utils';
|
|
10
|
-
|
|
11
|
-
import { Icon } from '@/components';
|
|
12
|
-
import { PermafrostComponent } from '@/types';
|
|
13
|
-
|
|
14
|
-
import { StyledEditableInput } from './EditableInput.styles';
|
|
15
|
-
|
|
16
|
-
type Props = PermafrostComponent & {
|
|
17
|
-
children: React.ReactNode | string;
|
|
18
|
-
minLength?: number;
|
|
19
|
-
onUpdate?(newValue: string): void;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Wrapper component which enables text editing in place directly on a child component,
|
|
24
|
-
* element, or plain text.
|
|
25
|
-
*/
|
|
26
|
-
export function EditableInput(props: Props) {
|
|
27
|
-
const { children, className, minLength = 3, onUpdate } = props;
|
|
28
|
-
|
|
29
|
-
const [initialValue, setInitialValue] = useState('');
|
|
30
|
-
|
|
31
|
-
// used as unique css class name
|
|
32
|
-
const { current: id } = useRef(stringUtils.createRandomString());
|
|
33
|
-
|
|
34
|
-
const editableEl = useRef() as MutableRefObject<HTMLSpanElement>;
|
|
35
|
-
|
|
36
|
-
const handleBlur = () => {
|
|
37
|
-
const node = editableEl.current.children[0] as HTMLElement;
|
|
38
|
-
const currentValue = node.innerText || editableEl.current.innerText;
|
|
39
|
-
|
|
40
|
-
if (minLength && currentValue.length < minLength) {
|
|
41
|
-
// revert to last good value
|
|
42
|
-
|
|
43
|
-
if (node) {
|
|
44
|
-
node.textContent = initialValue;
|
|
45
|
-
} else {
|
|
46
|
-
editableEl.current.textContent = initialValue;
|
|
47
|
-
}
|
|
48
|
-
} else if (currentValue !== initialValue) {
|
|
49
|
-
// allow updated value
|
|
50
|
-
setInitialValue(currentValue);
|
|
51
|
-
|
|
52
|
-
if (onUpdate) onUpdate(currentValue);
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
const handleKeypress = (event: React.KeyboardEvent) => {
|
|
57
|
-
if (event.key === 'Enter') {
|
|
58
|
-
editableEl.current.blur();
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
// Records the initial value for the text, in order to check length and compare to current text.
|
|
63
|
-
// Also ensures the size of the icon is relative to the text inside the editable element (which
|
|
64
|
-
// is the icon’s *sibling*, not ancestor).
|
|
65
|
-
useEffect(() => {
|
|
66
|
-
const style = document.createElement('style');
|
|
67
|
-
const node = editableEl.current.children[0] as HTMLElement;
|
|
68
|
-
document.head.appendChild(style);
|
|
69
|
-
|
|
70
|
-
if (node) {
|
|
71
|
-
const { fontSize } = getComputedStyle(node);
|
|
72
|
-
|
|
73
|
-
style?.sheet?.insertRule(`.${id} .pencil-icon { font-size: calc(${fontSize} * 0.8) }`);
|
|
74
|
-
|
|
75
|
-
setInitialValue(node.innerText);
|
|
76
|
-
} else {
|
|
77
|
-
style?.sheet?.insertRule(`.${id} .pencil-icon { font-size: 0.8em }`);
|
|
78
|
-
setInitialValue(editableEl.current.innerText);
|
|
79
|
-
}
|
|
80
|
-
}, []);
|
|
81
|
-
|
|
82
|
-
return (
|
|
83
|
-
<StyledEditableInput
|
|
84
|
-
className={classNames('EditableInput-container', id, className)}
|
|
85
|
-
data-cy={props['data-cy']}
|
|
86
|
-
id={props.id}
|
|
87
|
-
>
|
|
88
|
-
<span
|
|
89
|
-
role="textbox"
|
|
90
|
-
tabIndex={0}
|
|
91
|
-
contentEditable
|
|
92
|
-
suppressContentEditableWarning={true}
|
|
93
|
-
ref={editableEl}
|
|
94
|
-
onKeyDown={handleKeypress}
|
|
95
|
-
onBlur={handleBlur}
|
|
96
|
-
>
|
|
97
|
-
{children}
|
|
98
|
-
</span>
|
|
99
|
-
|
|
100
|
-
<Icon name="fa-pencil-alt" className="pencil-icon" />
|
|
101
|
-
</StyledEditableInput>
|
|
102
|
-
);
|
|
103
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { EditableInput } from './EditableInput';
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
// TODO: This component's migration was fast-tracked for Insights. Assess for potential refactor and documentation.
|
|
2
|
-
|
|
3
|
-
import { Meta, StoryObj } from '@storybook/react';
|
|
4
|
-
|
|
5
|
-
import { NumberInput } from './NumberInput';
|
|
6
|
-
|
|
7
|
-
const meta = {
|
|
8
|
-
component: NumberInput,
|
|
9
|
-
title: 'legacy/inputs/NumberInput',
|
|
10
|
-
argTypes: {
|
|
11
|
-
className: { control: { disable: true } },
|
|
12
|
-
value: { control: { disable: true } },
|
|
13
|
-
},
|
|
14
|
-
} satisfies Meta<typeof NumberInput>;
|
|
15
|
-
|
|
16
|
-
export default meta;
|
|
17
|
-
type Story = StoryObj<typeof NumberInput>;
|
|
18
|
-
|
|
19
|
-
export const Base: Story = {
|
|
20
|
-
args: { label: 'Default Number Field' },
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export const Required: Story = {
|
|
24
|
-
args: {
|
|
25
|
-
label: 'Required Number Field',
|
|
26
|
-
required: true,
|
|
27
|
-
},
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
export const Disabled: Story = {
|
|
31
|
-
args: {
|
|
32
|
-
label: 'Disabled Number Field',
|
|
33
|
-
disabled: true,
|
|
34
|
-
},
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
export const WithMinimum: Story = {
|
|
38
|
-
args: {
|
|
39
|
-
label: 'Positive Number Field',
|
|
40
|
-
min: 0,
|
|
41
|
-
},
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
export const WithMaximum: Story = {
|
|
45
|
-
args: {
|
|
46
|
-
label: 'Under 10 Number Field',
|
|
47
|
-
max: 9,
|
|
48
|
-
},
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
export const WithMinMax: Story = {
|
|
52
|
-
args: {
|
|
53
|
-
label: 'Select a number between 15 and 20',
|
|
54
|
-
min: 15,
|
|
55
|
-
max: 20,
|
|
56
|
-
},
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
export const WithDecimalStep: Story = {
|
|
60
|
-
args: {
|
|
61
|
-
label: 'Enter a number',
|
|
62
|
-
step: '0.1',
|
|
63
|
-
},
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
export const WithPlaceholderText: Story = {
|
|
67
|
-
args: {
|
|
68
|
-
label: 'Minimum Price',
|
|
69
|
-
step: '0.1',
|
|
70
|
-
placeholder: 'none',
|
|
71
|
-
},
|
|
72
|
-
};
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import styled from 'styled-components';
|
|
2
|
-
|
|
3
|
-
import { COLORS } from '@/legacy/tokens';
|
|
4
|
-
|
|
5
|
-
import { inputCommon, labelCommon } from '../inputsCommon.styles';
|
|
6
|
-
|
|
7
|
-
export const StyledNumberField = styled.div`
|
|
8
|
-
position: relative;
|
|
9
|
-
|
|
10
|
-
min-height: 40px;
|
|
11
|
-
|
|
12
|
-
&:not(.hiddenLabel) {
|
|
13
|
-
margin-top: 35px;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
input {
|
|
17
|
-
${inputCommon};
|
|
18
|
-
|
|
19
|
-
padding: 5px 0 10px;
|
|
20
|
-
margin-top: 0;
|
|
21
|
-
|
|
22
|
-
-moz-appearance: textfield;
|
|
23
|
-
|
|
24
|
-
&::-webkit-inner-spin-button,
|
|
25
|
-
&::-webkit-outer-spin-button {
|
|
26
|
-
appearance: none;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
&::placeholder {
|
|
30
|
-
opacity: 0.5;
|
|
31
|
-
color: ${COLORS.lightFontColor};
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
&:disabled {
|
|
35
|
-
background-color: transparent;
|
|
36
|
-
opacity: 0.7;
|
|
37
|
-
|
|
38
|
-
pointer-events: none;
|
|
39
|
-
|
|
40
|
-
~ .spin-buttons {
|
|
41
|
-
opacity: 0.7;
|
|
42
|
-
|
|
43
|
-
pointer-events: none;
|
|
44
|
-
cursor: not-allowed;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
label {
|
|
50
|
-
${labelCommon};
|
|
51
|
-
|
|
52
|
-
position: absolute;
|
|
53
|
-
top: -24px;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.spin-buttons {
|
|
57
|
-
position: absolute;
|
|
58
|
-
right: 0;
|
|
59
|
-
bottom: 0;
|
|
60
|
-
|
|
61
|
-
display: flex;
|
|
62
|
-
flex-direction: column;
|
|
63
|
-
|
|
64
|
-
margin-bottom: 0.5em;
|
|
65
|
-
}
|
|
66
|
-
`;
|
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
// TODO: This component's migration was fast-tracked for Insights. Assess for potential refactor and documentation.
|
|
2
|
-
|
|
3
|
-
import React, { ChangeEvent, useEffect, useRef, useState } from 'react';
|
|
4
|
-
import classNames from 'classnames';
|
|
5
|
-
import { v4 as uuid } from 'uuid';
|
|
6
|
-
|
|
7
|
-
import { Button } from '@/legacy/components/buttons';
|
|
8
|
-
import { Icon } from '@/components';
|
|
9
|
-
import { PermafrostComponent } from '@/types';
|
|
10
|
-
|
|
11
|
-
import { StyledNumberField } from './NumberInput.styles';
|
|
12
|
-
|
|
13
|
-
export type Props = PermafrostComponent & {
|
|
14
|
-
autoFocus?: boolean;
|
|
15
|
-
decrement?(): void;
|
|
16
|
-
disabled?: boolean;
|
|
17
|
-
hiddenLabel?: boolean;
|
|
18
|
-
increment?(): void;
|
|
19
|
-
label: string;
|
|
20
|
-
max?: number;
|
|
21
|
-
min?: number;
|
|
22
|
-
onChange(value: number | ''): void;
|
|
23
|
-
placeholder?: string;
|
|
24
|
-
required?: boolean;
|
|
25
|
-
step?: string;
|
|
26
|
-
tabIndex?: number;
|
|
27
|
-
value: number | '';
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Basic numeric input field. A label is required, but may be visually hidden
|
|
32
|
-
* using the `hiddenLabel` property.
|
|
33
|
-
*/
|
|
34
|
-
export function NumberInput(props: Props): React.ReactElement {
|
|
35
|
-
// ensures unique value to associate label with input
|
|
36
|
-
const fieldId = uuid();
|
|
37
|
-
const {
|
|
38
|
-
autoFocus,
|
|
39
|
-
className,
|
|
40
|
-
disabled,
|
|
41
|
-
hiddenLabel,
|
|
42
|
-
id,
|
|
43
|
-
label,
|
|
44
|
-
max,
|
|
45
|
-
min,
|
|
46
|
-
onChange,
|
|
47
|
-
placeholder,
|
|
48
|
-
required,
|
|
49
|
-
step,
|
|
50
|
-
tabIndex,
|
|
51
|
-
value,
|
|
52
|
-
} = props;
|
|
53
|
-
|
|
54
|
-
const [currentValue, setCurrentValue] = useState<number | ''>(
|
|
55
|
-
value ? value : value === 0 ? 0 : '',
|
|
56
|
-
);
|
|
57
|
-
|
|
58
|
-
const inputEl = useRef<HTMLInputElement>(null);
|
|
59
|
-
|
|
60
|
-
const increment = () => {
|
|
61
|
-
const input = inputEl.current;
|
|
62
|
-
if (input) {
|
|
63
|
-
input.stepUp();
|
|
64
|
-
// convert string value to number
|
|
65
|
-
setCurrentValue(+input.value);
|
|
66
|
-
}
|
|
67
|
-
if (props.increment) props.increment();
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
const decrement = () => {
|
|
71
|
-
const input = inputEl.current;
|
|
72
|
-
if (input) {
|
|
73
|
-
input.stepDown();
|
|
74
|
-
// convert string value to number
|
|
75
|
-
setCurrentValue(+input.value);
|
|
76
|
-
}
|
|
77
|
-
if (props.decrement) props.decrement();
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
const handleChange = (event: ChangeEvent<HTMLInputElement>) => {
|
|
81
|
-
const targetValue = event?.target?.value;
|
|
82
|
-
setCurrentValue(targetValue === '' ? '' : +targetValue);
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
// When external state changes, we update local state to match, if not already
|
|
86
|
-
useEffect(() => {
|
|
87
|
-
if (currentValue === value) {
|
|
88
|
-
return;
|
|
89
|
-
}
|
|
90
|
-
setCurrentValue(value);
|
|
91
|
-
}, [value]);
|
|
92
|
-
|
|
93
|
-
// todo: this is problematic because it means on mount the onChange handler will always be fired
|
|
94
|
-
// therefore - if the onChange is some heavy operation or call to the BE - that will automatically get called
|
|
95
|
-
// without the user even doing anything
|
|
96
|
-
useEffect(() => {
|
|
97
|
-
// We must debounce the min/max evaluation until after the user has finished typing
|
|
98
|
-
const delayDebounceFn = setTimeout(() => {
|
|
99
|
-
if ((min || min === 0) && +currentValue < min) {
|
|
100
|
-
setCurrentValue('');
|
|
101
|
-
onChange('');
|
|
102
|
-
} else if ((max || max === 0) && +currentValue > max) {
|
|
103
|
-
setCurrentValue('');
|
|
104
|
-
onChange('');
|
|
105
|
-
} else if (+currentValue < 0) {
|
|
106
|
-
setCurrentValue('');
|
|
107
|
-
onChange('');
|
|
108
|
-
} else {
|
|
109
|
-
onChange(currentValue);
|
|
110
|
-
}
|
|
111
|
-
}, 1000);
|
|
112
|
-
return () => clearTimeout(delayDebounceFn);
|
|
113
|
-
}, [currentValue]);
|
|
114
|
-
|
|
115
|
-
return (
|
|
116
|
-
<StyledNumberField
|
|
117
|
-
className={classNames(className, {
|
|
118
|
-
hiddenLabel,
|
|
119
|
-
})}
|
|
120
|
-
data-cy={props['data-cy']}
|
|
121
|
-
id={id}
|
|
122
|
-
>
|
|
123
|
-
<input
|
|
124
|
-
tabIndex={tabIndex}
|
|
125
|
-
autoFocus={autoFocus}
|
|
126
|
-
id={fieldId}
|
|
127
|
-
type="number"
|
|
128
|
-
value={currentValue}
|
|
129
|
-
disabled={disabled}
|
|
130
|
-
max={max}
|
|
131
|
-
min={min}
|
|
132
|
-
onChange={handleChange}
|
|
133
|
-
placeholder={placeholder}
|
|
134
|
-
required={required}
|
|
135
|
-
step={step}
|
|
136
|
-
aria-label={hiddenLabel ? label : ''}
|
|
137
|
-
ref={inputEl}
|
|
138
|
-
/>
|
|
139
|
-
|
|
140
|
-
{!hiddenLabel && <label htmlFor={fieldId}>{label}</label>}
|
|
141
|
-
|
|
142
|
-
{/* since user can increment/decrement using arrow keys, these don’t need to be tabbable */}
|
|
143
|
-
<div className="spin-buttons">
|
|
144
|
-
<Button variant="no-style" onClick={increment} tabindex={-1}>
|
|
145
|
-
<Icon name="fa-caret-up" ariaLabel="increase" />
|
|
146
|
-
</Button>
|
|
147
|
-
|
|
148
|
-
<Button variant="no-style" onClick={decrement} tabindex={-1}>
|
|
149
|
-
<Icon name="fa-caret-down" ariaLabel="decrease" />
|
|
150
|
-
</Button>
|
|
151
|
-
</div>
|
|
152
|
-
</StyledNumberField>
|
|
153
|
-
);
|
|
154
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { NumberInput } from './NumberInput';
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
// TODO: This component's migration was fast-tracked for Insights. Assess for potential refactor and documentation.
|
|
2
|
-
|
|
3
|
-
import { Meta, StoryObj } from '@storybook/react';
|
|
4
|
-
import React, { useState } from 'react';
|
|
5
|
-
|
|
6
|
-
import { COLORS } from '@/legacy/tokens';
|
|
7
|
-
import { Radio, RadioGroup } from './RadioButtons';
|
|
8
|
-
|
|
9
|
-
const meta = {
|
|
10
|
-
component: RadioGroup,
|
|
11
|
-
title: 'legacy/inputs/RadioButtons',
|
|
12
|
-
args: {},
|
|
13
|
-
tags: ['autodocs'],
|
|
14
|
-
} satisfies Meta<typeof RadioGroup>;
|
|
15
|
-
|
|
16
|
-
export default meta;
|
|
17
|
-
type Story = StoryObj<typeof RadioGroup>;
|
|
18
|
-
|
|
19
|
-
function StoryRender(props: any) {
|
|
20
|
-
const [value, setValue] = useState<string>('andy');
|
|
21
|
-
return (
|
|
22
|
-
<RadioGroup
|
|
23
|
-
{...props}
|
|
24
|
-
defaultValue="andy"
|
|
25
|
-
value={value}
|
|
26
|
-
onChange={(value: string) => setValue(value)}
|
|
27
|
-
>
|
|
28
|
-
<Radio value="andy">Andy</Radio>
|
|
29
|
-
<Radio value="jess">Jess</Radio>
|
|
30
|
-
<Radio value="mike">Mike</Radio>
|
|
31
|
-
</RadioGroup>
|
|
32
|
-
);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export const Normal: Story = {
|
|
36
|
-
args: {
|
|
37
|
-
label: 'Select a person:',
|
|
38
|
-
},
|
|
39
|
-
render: (args) => {
|
|
40
|
-
return <StoryRender {...args} />;
|
|
41
|
-
},
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
export const CustomColors: Story = {
|
|
45
|
-
args: {
|
|
46
|
-
label: 'Select a person:',
|
|
47
|
-
color: `${COLORS.red}`,
|
|
48
|
-
labelColor: `${COLORS.black}`,
|
|
49
|
-
hoverAndSelectedColor: `${COLORS.blueDarknut}`,
|
|
50
|
-
focusRingColor: `${COLORS.blueDarknut}`,
|
|
51
|
-
},
|
|
52
|
-
render: (args) => {
|
|
53
|
-
return <StoryRender {...args} />;
|
|
54
|
-
},
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
export const WithHiddenLabel: Story = {
|
|
58
|
-
args: {
|
|
59
|
-
['aria-label']: 'Select a person:',
|
|
60
|
-
},
|
|
61
|
-
render: (args) => {
|
|
62
|
-
return <StoryRender {...args} />;
|
|
63
|
-
},
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
export const Horizontal: Story = {
|
|
67
|
-
args: {
|
|
68
|
-
label: 'Select a person:',
|
|
69
|
-
orientation: 'horizontal',
|
|
70
|
-
},
|
|
71
|
-
render: (args) => {
|
|
72
|
-
return <StoryRender {...args} />;
|
|
73
|
-
},
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
export const Disabled: Story = {
|
|
77
|
-
args: {
|
|
78
|
-
label: 'Select a person:',
|
|
79
|
-
isDisabled: true,
|
|
80
|
-
},
|
|
81
|
-
render: (args) => {
|
|
82
|
-
return <StoryRender {...args} />;
|
|
83
|
-
},
|
|
84
|
-
};
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import styled from 'styled-components';
|
|
2
|
-
|
|
3
|
-
import { ANIMATION, COLORS, SPACING } from '@/legacy/tokens';
|
|
4
|
-
import { AbstractRadioGroup } from '../RadioGroup';
|
|
5
|
-
|
|
6
|
-
const radioSize = '20px';
|
|
7
|
-
const strokeWidth = 2;
|
|
8
|
-
|
|
9
|
-
export const StyledRadioGroup = styled(AbstractRadioGroup)<{
|
|
10
|
-
hideFocusRing: boolean;
|
|
11
|
-
color: string;
|
|
12
|
-
labelColor: string;
|
|
13
|
-
hoverAndSelectedColor: string;
|
|
14
|
-
focusRingColor: string;
|
|
15
|
-
}>`
|
|
16
|
-
color: ${(props) => props.color || 'currentColor'};
|
|
17
|
-
|
|
18
|
-
.groupLabel {
|
|
19
|
-
margin-bottom: ${SPACING.sm};
|
|
20
|
-
font-size: 16px;
|
|
21
|
-
color: ${(props) => props.labelColor || COLORS.lightGray};
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
// this is the Radio component; something gets cranky and styles end up
|
|
25
|
-
// not applied if we create a separate StyledComponent for Radio.
|
|
26
|
-
label {
|
|
27
|
-
display: flex;
|
|
28
|
-
align-items: center;
|
|
29
|
-
|
|
30
|
-
margin-bottom: ${SPACING.sm};
|
|
31
|
-
|
|
32
|
-
&.disabled {
|
|
33
|
-
cursor: not-allowed;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
&:not(.disabled) {
|
|
37
|
-
cursor: pointer;
|
|
38
|
-
|
|
39
|
-
&.selected,
|
|
40
|
-
&:hover {
|
|
41
|
-
color: ${(props) => props.hoverAndSelectedColor || COLORS.white};
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
transition: color ${ANIMATION.duration} ${ANIMATION.timing};
|
|
46
|
-
|
|
47
|
-
svg {
|
|
48
|
-
width: ${radioSize};
|
|
49
|
-
height: ${radioSize};
|
|
50
|
-
|
|
51
|
-
margin-top: 1px;
|
|
52
|
-
margin-right: ${SPACING.sm};
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
.radioCircle {
|
|
56
|
-
stroke-width: ${strokeWidth};
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
.radioDot {
|
|
60
|
-
opacity: 0;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.focusRing {
|
|
64
|
-
opacity: 0;
|
|
65
|
-
|
|
66
|
-
stroke: ${(props) => props.focusRingColor || COLORS.curiousBlue};
|
|
67
|
-
stroke-width: ${strokeWidth};
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
&.selected {
|
|
71
|
-
.radioDot {
|
|
72
|
-
opacity: 1;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
&.focused {
|
|
77
|
-
.focusRing {
|
|
78
|
-
opacity: ${(props) => (props.hideFocusRing ? 0 : 1)};
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
`;
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
// TODO: This component's migration was fast-tracked for Insights. Assess for potential refactor and documentation.
|
|
2
|
-
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import { AriaRadioProps, RadioGroupProps } from '@react-types/radio';
|
|
5
|
-
|
|
6
|
-
import { AbstractRadio } from '@/legacy/components';
|
|
7
|
-
import { PermafrostComponent } from '@/types';
|
|
8
|
-
import { StyledRadioGroup } from './RadioButtons.styles';
|
|
9
|
-
|
|
10
|
-
type Props = {
|
|
11
|
-
['aria-label']: string;
|
|
12
|
-
children?: React.ReactNode;
|
|
13
|
-
hideFocusRing: boolean;
|
|
14
|
-
color: string;
|
|
15
|
-
labelColor: string;
|
|
16
|
-
hoverAndSelectedColor: string;
|
|
17
|
-
focusRingColor: string;
|
|
18
|
-
value: string;
|
|
19
|
-
} & RadioGroupProps &
|
|
20
|
-
PermafrostComponent;
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Renders a group of radio buttons.
|
|
24
|
-
*
|
|
25
|
-
* A group label must be included: either pass a string or markup into the
|
|
26
|
-
* `label` prop, or include an `aria-label` or `aria-labelledby` attribute.
|
|
27
|
-
*/
|
|
28
|
-
export function RadioGroup({ children, ...props }: Props) {
|
|
29
|
-
const { value, color, hideFocusRing, labelColor, hoverAndSelectedColor, focusRingColor } = props;
|
|
30
|
-
return (
|
|
31
|
-
<StyledRadioGroup
|
|
32
|
-
{...props}
|
|
33
|
-
hideFocusRing={hideFocusRing}
|
|
34
|
-
data-cy={props['data-cy']}
|
|
35
|
-
color={color}
|
|
36
|
-
labelColor={labelColor}
|
|
37
|
-
hoverAndSelectedColor={hoverAndSelectedColor}
|
|
38
|
-
focusRingColor={focusRingColor}
|
|
39
|
-
value={value}
|
|
40
|
-
>
|
|
41
|
-
{children}
|
|
42
|
-
</StyledRadioGroup>
|
|
43
|
-
);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* A single radio button and its label.
|
|
48
|
-
*/
|
|
49
|
-
export function Radio({ children, ...props }: AriaRadioProps) {
|
|
50
|
-
return (
|
|
51
|
-
<AbstractRadio {...props}>
|
|
52
|
-
<svg viewBox="0 0 20 20" aria-hidden="true" focusable="false" overflow="visible">
|
|
53
|
-
<circle cx={10} cy={10} r={9} fill="none" stroke="currentColor" className="radioCircle" />
|
|
54
|
-
|
|
55
|
-
<circle cx={10} cy={10} r={5} fill="currentColor" stroke="none" className="radioDot" />
|
|
56
|
-
|
|
57
|
-
<circle cx={10} cy={10} r={12} fill="none" className="focusRing" />
|
|
58
|
-
</svg>
|
|
59
|
-
|
|
60
|
-
{children}
|
|
61
|
-
</AbstractRadio>
|
|
62
|
-
);
|
|
63
|
-
}
|