@flipdish/portal-library 1.0.78 → 2.0.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/dist/Icons/AccessTimeIcon/index.d.ts +2 -0
- package/dist/Icons/AccessTimeIcon/index.js +2 -0
- package/dist/Icons/CalenderTodayIcon/index.d.ts +2 -0
- package/dist/Icons/CalenderTodayIcon/index.js +2 -0
- package/dist/Icons/CalenderTodayIcon/index.js.map +1 -0
- package/dist/Icons/DoneIcon/index.d.ts +2 -0
- package/dist/Icons/DoneIcon/index.js +2 -0
- package/dist/Icons/DoneIcon/index.js.map +1 -0
- package/dist/Icons/SearchIcon/index.d.ts +2 -0
- package/dist/Icons/SearchIcon/index.js +2 -0
- package/dist/Icons/SearchIcon/index.js.map +1 -0
- package/dist/Icons/logo/Deliveroo/index.d.ts +8 -0
- package/dist/Icons/logo/Deliveroo/index.js +2 -0
- package/dist/Icons/logo/Deliveroo/index.js.map +1 -0
- package/dist/components/Chip/index.js +2 -0
- package/dist/components/Chip/index.js.map +1 -0
- package/dist/components/FDErrorBoundary/index.d.ts +9 -0
- package/dist/components/FDErrorBoundary/index.js +2 -0
- package/dist/components/FDErrorBoundary/index.js.map +1 -0
- package/dist/components/FlipdishLogoLoader/index.js +2 -0
- package/dist/components/FlipdishLogoLoader/index.js.map +1 -0
- package/dist/components/FlipdishStaffContainer/index.js +2 -0
- package/dist/components/FlipdishStaffContainer/index.js.map +1 -0
- package/dist/components/Form/FormItemLayout/index.d.ts +16 -0
- package/dist/components/{ui/Form/FormItemLayout.js → Form/FormItemLayout/index.js} +1 -1
- package/dist/components/Form/FormItemLayout/index.js.map +1 -0
- package/dist/components/Form/GenericAutocompleteField/index.js +2 -0
- package/dist/components/Form/GenericAutocompleteField/index.js.map +1 -0
- package/dist/components/{ui/Form/GenericFormContainer.js → Form/GenericFormContainer/index.js} +1 -1
- package/dist/components/Form/GenericFormContainer/index.js.map +1 -0
- package/dist/components/Form/GenericTextField/index.js +2 -0
- package/dist/components/Form/GenericTextField/index.js.map +1 -0
- package/dist/components/{ui/Form/PaginatedAutocompleteField.d.ts → Form/PaginatedAutocompleteField/index.d.ts} +1 -1
- package/dist/components/Form/PaginatedAutocompleteField/index.js +2 -0
- package/dist/components/Form/PaginatedAutocompleteField/index.js.map +1 -0
- package/dist/components/{ui/GenericDatePickerField → GenericDatePickerField}/GenericDateFieldBase.d.ts +3 -1
- package/dist/components/GenericDatePickerField/GenericDateFieldBase.js +2 -0
- package/dist/components/GenericDatePickerField/GenericDateFieldBase.js.map +1 -0
- package/dist/components/{ui/GenericDatePickerField/GenericDatePickerField.js → GenericDatePickerField/index.js} +1 -1
- package/dist/components/GenericDatePickerField/index.js.map +1 -0
- package/dist/components/{ui/GenericDateTimePickerField/GenericDateTimePickerField.js → GenericDateTimePickerField/index.js} +1 -1
- package/dist/components/GenericDateTimePickerField/index.js.map +1 -0
- package/dist/components/GenericRadioButtons/index.js +2 -0
- package/dist/components/GenericRadioButtons/index.js.map +1 -0
- package/dist/components/GenericTable/HighlightScrollbar.d.ts +11 -0
- package/dist/components/GenericTable/HighlightScrollbar.js.map +1 -0
- package/dist/components/{ui/GenericTable/GenericTable.d.ts → GenericTable/index.d.ts} +1 -1
- package/dist/components/{ui/GenericTable/GenericTable.js → GenericTable/index.js} +3 -3
- package/dist/components/GenericTable/index.js.map +1 -0
- package/dist/components/GenericTableBody/index.d.ts +37 -0
- package/dist/components/GenericTableBody/index.js +2 -0
- package/dist/components/GenericTableBody/index.js.map +1 -0
- package/dist/components/{ui/GenericTableBodyRow/GenericTableBodyRow.js → GenericTableBodyRow/index.js} +1 -1
- package/dist/components/GenericTableBodyRow/index.js.map +1 -0
- package/dist/components/{ui/GenericTableTitle/GenericTableTitle.js → GenericTableTitle/index.js} +1 -1
- package/dist/components/GenericTableTitle/index.js.map +1 -0
- package/dist/components/{ui/LazyComponent/LazyComponent.js → LazyComponent/index.js} +1 -1
- package/dist/components/LazyComponent/index.js.map +1 -0
- package/dist/components/{ui/ListItemLink/ListItemLink.js → ListItemLink/index.js} +1 -1
- package/dist/components/ListItemLink/index.js.map +1 -0
- package/dist/components/ListItemLinkButton/index.js +2 -0
- package/dist/components/ListItemLinkButton/index.js.map +1 -0
- package/dist/components/{ui/NoResults/NoResults.js → NoResults/index.js} +1 -1
- package/dist/components/NoResults/index.js.map +1 -0
- package/dist/components/NotFoundPage/index.js +2 -0
- package/dist/components/NotFoundPage/index.js.map +1 -0
- package/dist/components/PageLayout/DocumentTitle.d.ts +6 -0
- package/dist/components/PageLayout/DocumentTitle.js +2 -0
- package/dist/components/PageLayout/DocumentTitle.js.map +1 -0
- package/dist/components/PageLayout/FullWidthContainer.d.ts +13 -0
- package/dist/components/PageLayout/FullWidthContainer.js.map +1 -0
- package/dist/components/PageLayout/GlobalSpacingStyles.d.ts +5 -0
- package/dist/components/PageLayout/GlobalSpacingStyles.js +2 -0
- package/dist/components/PageLayout/GlobalSpacingStyles.js.map +1 -0
- package/dist/components/{ui/PageLayout/PageLayout.d.ts → PageLayout/index.d.ts} +9 -1
- package/dist/components/PageLayout/index.js +2 -0
- package/dist/components/PageLayout/index.js.map +1 -0
- package/dist/components/{ui/PortalMock/PortalMock.js → PortalMock/index.js} +1 -1
- package/dist/components/PortalMock/index.js.map +1 -0
- package/dist/components/{ui/Spacer/Spacer.js → Spacer/index.js} +1 -1
- package/dist/components/Spacer/index.js.map +1 -0
- package/dist/components/{ui/Switch/Switch.js → Switch/index.js} +1 -1
- package/dist/components/Switch/index.js.map +1 -0
- package/dist/components/Tooltip/index.js +2 -0
- package/dist/components/Tooltip/index.js.map +1 -0
- package/dist/custom-hooks/useMicroFrontendAttributes.js.map +1 -0
- package/dist/custom-hooks/useRenderValidText.js +2 -0
- package/dist/custom-hooks/useRenderValidText.js.map +1 -0
- package/dist/custom-hooks/useToasts.js.map +1 -0
- package/dist/localization/de.json.js +2 -0
- package/dist/localization/de.json.js.map +1 -0
- package/dist/localization/dev-lang.json.js +2 -0
- package/dist/localization/dev-lang.json.js.map +1 -0
- package/dist/localization/en-US.json.js +2 -0
- package/dist/localization/en-US.json.js.map +1 -0
- package/dist/localization/en.json.d.ts +63 -0
- package/dist/localization/es-MX.json.js +2 -0
- package/dist/localization/es-MX.json.js.map +1 -0
- package/dist/localization/es.json.js +2 -0
- package/dist/localization/es.json.js.map +1 -0
- package/dist/localization/fr.json.js +2 -0
- package/dist/localization/fr.json.js.map +1 -0
- package/dist/localization/it.json.js +2 -0
- package/dist/localization/it.json.js.map +1 -0
- package/dist/localization/nl.json.js +2 -0
- package/dist/localization/nl.json.js.map +1 -0
- package/dist/localization/pt.json.js +2 -0
- package/dist/localization/pt.json.js.map +1 -0
- package/dist/providers/DateTimeLocalizationProvider.js.map +1 -0
- package/dist/providers/TranslationProvider.d.ts +25 -0
- package/dist/providers/TranslationProvider.js +1 -1
- package/dist/providers/TranslationProvider.js.map +1 -1
- package/dist/stories/utilities/MockPageContent.d.ts +5 -0
- package/dist/stories/utilities/MockPageContent.js +2 -0
- package/dist/stories/utilities/MockPageContent.js.map +1 -0
- package/dist/themes/flipdishPublicTheme.d.ts +5 -0
- package/dist/themes/flipdishPublicTheme.js +2 -0
- package/dist/themes/flipdishPublicTheme.js.map +1 -0
- package/dist/utilities/formValidation.d.ts +6 -0
- package/dist/utilities/formValidation.js.map +1 -0
- package/dist/{components/genericUtilities/index.js → utilities/genericUtilities.js} +1 -1
- package/dist/utilities/genericUtilities.js.map +1 -0
- package/dist/{components/renderUtilities → utilities}/renderUtilities.d.ts +4 -4
- package/dist/utilities/renderUtilities.js +2 -0
- package/dist/utilities/renderUtilities.js.map +1 -0
- package/dist/utilities/validation.d.ts +3 -0
- package/package.json +30 -1
- package/dist/assets/images/fd-loader.gif.cjs.js +0 -2
- package/dist/assets/images/fd-loader.gif.cjs.js.map +0 -1
- package/dist/components/custom-hooks/useMicroFrontendAttributes.cjs.js +0 -2
- package/dist/components/custom-hooks/useMicroFrontendAttributes.cjs.js.map +0 -1
- package/dist/components/custom-hooks/useMicroFrontendAttributes.js.map +0 -1
- package/dist/components/custom-hooks/useRenderValidText.cjs.js +0 -2
- package/dist/components/custom-hooks/useRenderValidText.cjs.js.map +0 -1
- package/dist/components/custom-hooks/useRenderValidText.js +0 -2
- package/dist/components/custom-hooks/useRenderValidText.js.map +0 -1
- package/dist/components/custom-hooks/useToasts.cjs.js +0 -2
- package/dist/components/custom-hooks/useToasts.cjs.js.map +0 -1
- package/dist/components/custom-hooks/useToasts.js.map +0 -1
- package/dist/components/genericUtilities/index.cjs.js +0 -2
- package/dist/components/genericUtilities/index.cjs.js.map +0 -1
- package/dist/components/genericUtilities/index.js.map +0 -1
- package/dist/components/index.cjs.js +0 -2
- package/dist/components/index.cjs.js.map +0 -1
- package/dist/components/index.d.ts +0 -38
- package/dist/components/index.js +0 -2
- package/dist/components/renderUtilities/renderUtilities.cjs.js +0 -2
- package/dist/components/renderUtilities/renderUtilities.cjs.js.map +0 -1
- package/dist/components/renderUtilities/renderUtilities.js +0 -2
- package/dist/components/renderUtilities/renderUtilities.js.map +0 -1
- package/dist/components/themes/flipdishPublicTheme.cjs.js +0 -2
- package/dist/components/themes/flipdishPublicTheme.cjs.js.map +0 -1
- package/dist/components/themes/flipdishPublicTheme.d.ts +0 -28
- package/dist/components/themes/flipdishPublicTheme.js +0 -2
- package/dist/components/themes/flipdishPublicTheme.js.map +0 -1
- package/dist/components/ui/Chip/Chip.cjs.js +0 -2
- package/dist/components/ui/Chip/Chip.cjs.js.map +0 -1
- package/dist/components/ui/Chip/Chip.js +0 -2
- package/dist/components/ui/Chip/Chip.js.map +0 -1
- package/dist/components/ui/DateTimeLocalizationProvider/DateTimeLocalizationProvider.cjs.js +0 -2
- package/dist/components/ui/DateTimeLocalizationProvider/DateTimeLocalizationProvider.cjs.js.map +0 -1
- package/dist/components/ui/DateTimeLocalizationProvider/DateTimeLocalizationProvider.js.map +0 -1
- package/dist/components/ui/FDErrorBoundary/FDErrorBoundary.cjs.js +0 -2
- package/dist/components/ui/FDErrorBoundary/FDErrorBoundary.cjs.js.map +0 -1
- package/dist/components/ui/FDErrorBoundary/FDErrorBoundary.js +0 -2
- package/dist/components/ui/FDErrorBoundary/FDErrorBoundary.js.map +0 -1
- package/dist/components/ui/FlipdishLogoLoader/FlipdishLogoLoader.cjs.js +0 -2
- package/dist/components/ui/FlipdishLogoLoader/FlipdishLogoLoader.cjs.js.map +0 -1
- package/dist/components/ui/FlipdishLogoLoader/FlipdishLogoLoader.js +0 -2
- package/dist/components/ui/FlipdishLogoLoader/FlipdishLogoLoader.js.map +0 -1
- package/dist/components/ui/FlipdishStaffContainer/FlipdishStaffContainer.cjs.js +0 -2
- package/dist/components/ui/FlipdishStaffContainer/FlipdishStaffContainer.cjs.js.map +0 -1
- package/dist/components/ui/FlipdishStaffContainer/FlipdishStaffContainer.js +0 -2
- package/dist/components/ui/FlipdishStaffContainer/FlipdishStaffContainer.js.map +0 -1
- package/dist/components/ui/Form/FormItemLayout.cjs.js +0 -2
- package/dist/components/ui/Form/FormItemLayout.cjs.js.map +0 -1
- package/dist/components/ui/Form/FormItemLayout.js.map +0 -1
- package/dist/components/ui/Form/GenericAutocompleteField.cjs.js +0 -2
- package/dist/components/ui/Form/GenericAutocompleteField.cjs.js.map +0 -1
- package/dist/components/ui/Form/GenericAutocompleteField.js +0 -2
- package/dist/components/ui/Form/GenericAutocompleteField.js.map +0 -1
- package/dist/components/ui/Form/GenericFormContainer.cjs.js +0 -2
- package/dist/components/ui/Form/GenericFormContainer.cjs.js.map +0 -1
- package/dist/components/ui/Form/GenericFormContainer.js.map +0 -1
- package/dist/components/ui/Form/GenericTextField.cjs.js +0 -2
- package/dist/components/ui/Form/GenericTextField.cjs.js.map +0 -1
- package/dist/components/ui/Form/GenericTextField.js +0 -2
- package/dist/components/ui/Form/GenericTextField.js.map +0 -1
- package/dist/components/ui/Form/PaginatedAutocompleteField.cjs.js +0 -2
- package/dist/components/ui/Form/PaginatedAutocompleteField.cjs.js.map +0 -1
- package/dist/components/ui/Form/PaginatedAutocompleteField.js +0 -2
- package/dist/components/ui/Form/PaginatedAutocompleteField.js.map +0 -1
- package/dist/components/ui/Form/utilities/formValidation.cjs.js +0 -2
- package/dist/components/ui/Form/utilities/formValidation.cjs.js.map +0 -1
- package/dist/components/ui/Form/utilities/formValidation.d.ts +0 -6
- package/dist/components/ui/Form/utilities/formValidation.js.map +0 -1
- package/dist/components/ui/GenericDatePickerField/GenericDateFieldBase.cjs.js +0 -2
- package/dist/components/ui/GenericDatePickerField/GenericDateFieldBase.cjs.js.map +0 -1
- package/dist/components/ui/GenericDatePickerField/GenericDateFieldBase.js +0 -2
- package/dist/components/ui/GenericDatePickerField/GenericDateFieldBase.js.map +0 -1
- package/dist/components/ui/GenericDatePickerField/GenericDatePickerField.cjs.js +0 -2
- package/dist/components/ui/GenericDatePickerField/GenericDatePickerField.cjs.js.map +0 -1
- package/dist/components/ui/GenericDatePickerField/GenericDatePickerField.js.map +0 -1
- package/dist/components/ui/GenericDateTimePickerField/GenericDateTimePickerField.cjs.js +0 -2
- package/dist/components/ui/GenericDateTimePickerField/GenericDateTimePickerField.cjs.js.map +0 -1
- package/dist/components/ui/GenericDateTimePickerField/GenericDateTimePickerField.js.map +0 -1
- package/dist/components/ui/GenericRadioButtons/GenericRadioButtons.cjs.js +0 -2
- package/dist/components/ui/GenericRadioButtons/GenericRadioButtons.cjs.js.map +0 -1
- package/dist/components/ui/GenericRadioButtons/GenericRadioButtons.js +0 -2
- package/dist/components/ui/GenericRadioButtons/GenericRadioButtons.js.map +0 -1
- package/dist/components/ui/GenericTable/GenericTable.cjs.js +0 -18
- package/dist/components/ui/GenericTable/GenericTable.cjs.js.map +0 -1
- package/dist/components/ui/GenericTable/GenericTable.js.map +0 -1
- package/dist/components/ui/GenericTable/HighlightScrollbar.cjs.js +0 -2
- package/dist/components/ui/GenericTable/HighlightScrollbar.cjs.js.map +0 -1
- package/dist/components/ui/GenericTable/HighlightScrollbar.js.map +0 -1
- package/dist/components/ui/GenericTable/types.d.ts +0 -13
- package/dist/components/ui/GenericTableBody/GenericTableBody.cjs.js +0 -2
- package/dist/components/ui/GenericTableBody/GenericTableBody.cjs.js.map +0 -1
- package/dist/components/ui/GenericTableBody/GenericTableBody.d.ts +0 -16
- package/dist/components/ui/GenericTableBody/GenericTableBody.js +0 -2
- package/dist/components/ui/GenericTableBody/GenericTableBody.js.map +0 -1
- package/dist/components/ui/GenericTableBodyRow/GenericTableBodyRow.cjs.js +0 -2
- package/dist/components/ui/GenericTableBodyRow/GenericTableBodyRow.cjs.js.map +0 -1
- package/dist/components/ui/GenericTableBodyRow/GenericTableBodyRow.js.map +0 -1
- package/dist/components/ui/GenericTableTitle/GenericTableTitle.cjs.js +0 -2
- package/dist/components/ui/GenericTableTitle/GenericTableTitle.cjs.js.map +0 -1
- package/dist/components/ui/GenericTableTitle/GenericTableTitle.js.map +0 -1
- package/dist/components/ui/LazyComponent/LazyComponent.cjs.js +0 -2
- package/dist/components/ui/LazyComponent/LazyComponent.cjs.js.map +0 -1
- package/dist/components/ui/LazyComponent/LazyComponent.js.map +0 -1
- package/dist/components/ui/ListItemLink/ListItemLink.cjs.js +0 -2
- package/dist/components/ui/ListItemLink/ListItemLink.cjs.js.map +0 -1
- package/dist/components/ui/ListItemLink/ListItemLink.js.map +0 -1
- package/dist/components/ui/ListItemLinkButton/ListItemLinkButton.cjs.js +0 -2
- package/dist/components/ui/ListItemLinkButton/ListItemLinkButton.cjs.js.map +0 -1
- package/dist/components/ui/ListItemLinkButton/ListItemLinkButton.js +0 -2
- package/dist/components/ui/ListItemLinkButton/ListItemLinkButton.js.map +0 -1
- package/dist/components/ui/NoResults/NoResults.cjs.js +0 -2
- package/dist/components/ui/NoResults/NoResults.cjs.js.map +0 -1
- package/dist/components/ui/NoResults/NoResults.js.map +0 -1
- package/dist/components/ui/NotFoundPage/NotFoundPage.cjs.js +0 -2
- package/dist/components/ui/NotFoundPage/NotFoundPage.cjs.js.map +0 -1
- package/dist/components/ui/NotFoundPage/NotFoundPage.js +0 -2
- package/dist/components/ui/NotFoundPage/NotFoundPage.js.map +0 -1
- package/dist/components/ui/PageLayout/DocumentTitle.cjs.js +0 -2
- package/dist/components/ui/PageLayout/DocumentTitle.cjs.js.map +0 -1
- package/dist/components/ui/PageLayout/DocumentTitle.js +0 -2
- package/dist/components/ui/PageLayout/DocumentTitle.js.map +0 -1
- package/dist/components/ui/PageLayout/FullWidthContainer.cjs.js +0 -2
- package/dist/components/ui/PageLayout/FullWidthContainer.cjs.js.map +0 -1
- package/dist/components/ui/PageLayout/FullWidthContainer.js.map +0 -1
- package/dist/components/ui/PageLayout/PageLayout.cjs.js +0 -2
- package/dist/components/ui/PageLayout/PageLayout.cjs.js.map +0 -1
- package/dist/components/ui/PageLayout/PageLayout.js +0 -2
- package/dist/components/ui/PageLayout/PageLayout.js.map +0 -1
- package/dist/components/ui/PortalMock/PortalMock.cjs.js +0 -2
- package/dist/components/ui/PortalMock/PortalMock.cjs.js.map +0 -1
- package/dist/components/ui/PortalMock/PortalMock.js.map +0 -1
- package/dist/components/ui/Spacer/Spacer.cjs.js +0 -2
- package/dist/components/ui/Spacer/Spacer.cjs.js.map +0 -1
- package/dist/components/ui/Spacer/Spacer.js.map +0 -1
- package/dist/components/ui/Switch/Switch.cjs.js +0 -2
- package/dist/components/ui/Switch/Switch.cjs.js.map +0 -1
- package/dist/components/ui/Switch/Switch.js.map +0 -1
- package/dist/components/ui/Tooltip/Tooltip.cjs.js +0 -2
- package/dist/components/ui/Tooltip/Tooltip.cjs.js.map +0 -1
- package/dist/components/ui/Tooltip/Tooltip.js +0 -2
- package/dist/components/ui/Tooltip/Tooltip.js.map +0 -1
- package/dist/localization/en.json.cjs.js +0 -2
- package/dist/localization/en.json.cjs.js.map +0 -1
- package/dist/providers/ToastProvider.cjs.js +0 -2
- package/dist/providers/ToastProvider.cjs.js.map +0 -1
- package/dist/providers/TranslationProvider.cjs.js +0 -2
- package/dist/providers/TranslationProvider.cjs.js.map +0 -1
- package/dist/utilities/validation.cjs.js +0 -2
- package/dist/utilities/validation.cjs.js.map +0 -1
- /package/dist/{components → Icons/AccessTimeIcon}/index.js.map +0 -0
- /package/dist/components/{ui/Chip/Chip.d.ts → Chip/index.d.ts} +0 -0
- /package/dist/components/{ui/FlipdishLogoLoader/FlipdishLogoLoader.d.ts → FlipdishLogoLoader/index.d.ts} +0 -0
- /package/dist/components/{ui/FlipdishStaffContainer/FlipdishStaffContainer.d.ts → FlipdishStaffContainer/index.d.ts} +0 -0
- /package/dist/components/{ui/Form/GenericAutocompleteField.d.ts → Form/GenericAutocompleteField/index.d.ts} +0 -0
- /package/dist/components/{ui/Form/GenericFormContainer.d.ts → Form/GenericFormContainer/index.d.ts} +0 -0
- /package/dist/components/{ui/Form/GenericTextField.d.ts → Form/GenericTextField/index.d.ts} +0 -0
- /package/dist/components/{ui/GenericDatePickerField/GenericDatePickerField.d.ts → GenericDatePickerField/index.d.ts} +0 -0
- /package/dist/components/{ui/GenericDateTimePickerField/GenericDateTimePickerField.d.ts → GenericDateTimePickerField/index.d.ts} +0 -0
- /package/dist/components/{ui/GenericRadioButtons/GenericRadioButtons.d.ts → GenericRadioButtons/index.d.ts} +0 -0
- /package/dist/components/{ui/GenericTable → GenericTable}/HighlightScrollbar.js +0 -0
- /package/dist/components/{ui/GenericTableBodyRow/GenericTableBodyRow.d.ts → GenericTableBodyRow/index.d.ts} +0 -0
- /package/dist/components/{ui/GenericTableTitle/GenericTableTitle.d.ts → GenericTableTitle/index.d.ts} +0 -0
- /package/dist/components/{ui/LazyComponent/LazyComponent.d.ts → LazyComponent/index.d.ts} +0 -0
- /package/dist/components/{ui/ListItemLink/ListItemLink.d.ts → ListItemLink/index.d.ts} +0 -0
- /package/dist/components/{ui/ListItemLinkButton/ListItemLinkButton.d.ts → ListItemLinkButton/index.d.ts} +0 -0
- /package/dist/components/{ui/NoResults/NoResults.d.ts → NoResults/index.d.ts} +0 -0
- /package/dist/components/{ui/NotFoundPage/NotFoundPage.d.ts → NotFoundPage/index.d.ts} +0 -0
- /package/dist/components/{ui/PageLayout → PageLayout}/FullWidthContainer.js +0 -0
- /package/dist/components/{ui/PortalMock/PortalMock.d.ts → PortalMock/index.d.ts} +0 -0
- /package/dist/components/{ui/Spacer/Spacer.d.ts → Spacer/index.d.ts} +0 -0
- /package/dist/components/{ui/Switch/Switch.d.ts → Switch/index.d.ts} +0 -0
- /package/dist/components/{ui/Tooltip/Tooltip.d.ts → Tooltip/index.d.ts} +0 -0
- /package/dist/{components/custom-hooks → custom-hooks}/useMicroFrontendAttributes.d.ts +0 -0
- /package/dist/{components/custom-hooks → custom-hooks}/useMicroFrontendAttributes.js +0 -0
- /package/dist/{components/custom-hooks → custom-hooks}/useRenderValidText.d.ts +0 -0
- /package/dist/{components/custom-hooks → custom-hooks}/useToasts.d.ts +0 -0
- /package/dist/{components/custom-hooks → custom-hooks}/useToasts.js +0 -0
- /package/dist/{components/ui/DateTimeLocalizationProvider → providers}/DateTimeLocalizationProvider.d.ts +0 -0
- /package/dist/{components/ui/DateTimeLocalizationProvider → providers}/DateTimeLocalizationProvider.js +0 -0
- /package/dist/{components/ui/Form/utilities → utilities}/formValidation.js +0 -0
- /package/dist/{components/genericUtilities/index.d.ts → utilities/genericUtilities.d.ts} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TranslationProvider.js","sources":["../../src/providers/TranslationProvider.tsx"],"sourcesContent":["import { createContext, useCallback, useContext, useEffect, useMemo, useState } from 'react';\nimport en from '../../../../localization/en.json';\nimport { getMicroFrontendAttribute } from '../
|
|
1
|
+
{"version":3,"file":"TranslationProvider.js","sources":["../../src/providers/TranslationProvider.tsx"],"sourcesContent":["import { createContext, useCallback, useContext, useEffect, useMemo, useState } from 'react';\nimport en from '../../../../localization/en.json';\nimport { getMicroFrontendAttribute } from '../utilities/renderUtilities';\n\nexport type TranslationId = keyof typeof en;\n\ntype Translation = { value: string };\n\ninterface TranslationBase {\n translations: Record<string, Translation>;\n}\n\nconst TranslationContext = createContext<TranslationBase>({} as unknown as TranslationBase);\n\ntype TranslationProp = {\n children: JSX.Element;\n} & TranslationBase;\n\nexport const TranslationProvider = ({ children, translations }: TranslationProp): JSX.Element => {\n const value = useMemo(() => ({ translations }), [translations]);\n return <TranslationContext.Provider value={value}>{children}</TranslationContext.Provider>;\n};\n\nexport const useTranslation = (): {\n translate: (key: TranslationId, data?: Record<string, string | number>) => string;\n translations: Record<string, Translation>;\n} => {\n const { translations } = useContext(TranslationContext);\n\n const translate = useCallback(\n (key: TranslationId, data?: Record<string, string | number>): string => {\n let translation = translations?.[key]?.value || en[key]?.value || key;\n if (data && translation) {\n Object.keys(data)?.forEach((key) => {\n translation = translation.replace(new RegExp(`{${key}}`, 'g'), `${data[key]}`);\n });\n }\n return translation;\n },\n [translations],\n );\n return { translate, translations };\n};\n\nconst languagesToLoad = ['nl', 'en-US', 'de', 'fr', 'it', 'es', 'pt', 'es-MX', 'dev-lang'];\n\nexport const useLoadTranslations = () => {\n const [translations, setTranslations] = useState<{\n loading: boolean;\n translations?: Record<string, { value: string }>;\n }>({ loading: true, translations: {} });\n const languageFromParentDiv = getMicroFrontendAttribute('data-language') || '';\n\n useEffect(() => {\n const fetchJSONData = async () => {\n // en loaded as default fallback already\n const shouldLoadLanguage = languagesToLoad.includes(languageFromParentDiv);\n if (shouldLoadLanguage) {\n import(`../../../../localization/${languageFromParentDiv}.json`)\n .then((response) => response.default) // Access the default export of the module\n .then((text) => {\n setTranslations({ loading: false, translations: text });\n })\n .catch((error) => {\n setTranslations({ loading: false });\n window.fdlogger?.error(`Error while fetching ${languageFromParentDiv || 'en'} language JSON data: ${error.message}`);\n });\n } else {\n setTranslations({ loading: false });\n }\n };\n\n void fetchJSONData();\n }, [languageFromParentDiv]);\n\n return {\n translations: translations.translations || {},\n loading: translations.loading,\n };\n};\n"],"names":["TranslationContext","createContext","TranslationProvider","children","translations","value","useMemo","_jsx","Provider","useTranslation","useContext","translate","useCallback","key","data","translation","en","Object","keys","forEach","replace","RegExp","languagesToLoad","useLoadTranslations","setTranslations","useState","loading","languageFromParentDiv","getMicroFrontendAttribute","useEffect","async","includes","__variableDynamicImportRuntime0__","then","response","default","text","catch","error","window","fdlogger","message","fetchJSONData"],"mappings":"+QAYA,MAAMA,EAAqBC,EAA+B,CAAA,GAM7CC,EAAsB,EAAGC,WAAUC,mBAC5C,MAAMC,EAAQC,GAAQ,KAAO,CAAEF,kBAAiB,CAACA,IACjD,OAAOG,EAACP,EAAmBQ,SAAQ,CAACH,MAAOA,EAAKF,SAAGA,GAAuC,EAGjFM,EAAiB,KAI1B,MAAML,aAAEA,GAAiBM,EAAWV,GAcpC,MAAO,CAAEW,UAZSC,GACd,CAACC,EAAoBC,KACjB,IAAIC,EAAcX,IAAeS,IAAMR,OAASW,EAAGH,IAAMR,OAASQ,EAMlE,OALIC,GAAQC,GACRE,OAAOC,KAAKJ,IAAOK,SAASN,IACxBE,EAAcA,EAAYK,QAAQ,IAAIC,OAAO,IAAIR,KAAQ,KAAM,GAAGC,EAAKD,KAAO,IAG/EE,CAAW,GAEtB,CAACX,IAEeA,eAAc,EAGhCkB,EAAkB,CAAC,KAAM,QAAS,KAAM,KAAM,KAAM,KAAM,KAAM,QAAS,YAElEC,EAAsB,KAC/B,MAAOnB,EAAcoB,GAAmBC,EAGrC,CAAEC,SAAS,EAAMtB,aAAc,CAAE,IAC9BuB,EAAwBC,EAA0B,kBAAoB,GAwB5E,OAtBAC,GAAU,KACgBC,WAESR,EAAgBS,SAASJ,0hCAEhDK,CAAO,4BAA4BL,UAC9BM,MAAMC,GAAaA,EAASC,UAC5BF,MAAMG,IACHZ,EAAgB,CAAEE,SAAS,EAAOtB,aAAcgC,GAAO,IAE1DC,OAAOC,IACJd,EAAgB,CAAEE,SAAS,IAC3Ba,OAAOC,UAAUF,MAAM,wBAAwBX,GAAyB,4BAA4BW,EAAMG,UAAU,IAG5HjB,EAAgB,CAAEE,SAAS,GAC9B,EAGAgB,EAAe,GACrB,CAACf,IAEG,CACHvB,aAAcA,EAAaA,cAAgB,CAAE,EAC7CsB,QAAStB,EAAasB,QACzB"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsxs as t,jsx as a}from"react/jsx-runtime";import e from"@mui/material/Button";import r from"@mui/material/Card";import i from"@mui/material/CardActions";import o from"@mui/material/CardContent";import m from"@mui/material/CardMedia";import n from"@mui/material/Typography";const d=()=>t(r,{sx:{maxWidth:345},children:[a(m,{component:"img",height:"140",image:"https://images.unsplash.com/photo-1551632436-cbf8dd35adfa?q=80&w=2671&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D",alt:"green iguana"}),t(o,{children:[a(n,{gutterBottom:!0,variant:"h5",component:"div",children:"Cafe Shirley"}),a(n,{variant:"body2",sx:{color:"text.secondary"},children:"Nestled in the heart of the city, Cafe Shirley offers a cozy retreat from the hustle and bustle. With its warm ambiance, aromatic coffee, and delectable pastries, it's the perfect spot to unwind."})]}),a(i,{children:a(e,{size:"small",variant:"contained",children:"Learn More"})})]});export{d as default};
|
|
2
|
+
//# sourceMappingURL=MockPageContent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MockPageContent.js","sources":["../../../src/stories/utilities/MockPageContent.tsx"],"sourcesContent":["import Button from '@mui/material/Button';\nimport Card from '@mui/material/Card';\nimport CardActions from '@mui/material/CardActions';\nimport CardContent from '@mui/material/CardContent';\nimport CardMedia from '@mui/material/CardMedia';\nimport Typography from '@mui/material/Typography';\n\nconst MockPageContent = () => {\n return (\n <Card sx={{ maxWidth: 345 }}>\n <CardMedia\n component=\"img\"\n height=\"140\"\n image=\"https://images.unsplash.com/photo-1551632436-cbf8dd35adfa?q=80&w=2671&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\"\n alt=\"green iguana\"\n />\n <CardContent>\n <Typography gutterBottom variant=\"h5\" component=\"div\">\n Cafe Shirley\n </Typography>\n <Typography variant=\"body2\" sx={{ color: 'text.secondary' }}>\n Nestled in the heart of the city, Cafe Shirley offers a cozy retreat from the hustle and bustle. With its warm ambiance, aromatic\n coffee, and delectable pastries, it's the perfect spot to unwind.\n </Typography>\n </CardContent>\n <CardActions>\n <Button size=\"small\" variant=\"contained\">\n Learn More\n </Button>\n </CardActions>\n </Card>\n );\n};\n\nexport default MockPageContent;\n"],"names":["MockPageContent","_jsxs","Card","sx","maxWidth","children","_jsx","CardMedia","component","height","image","alt","CardContent","Typography","gutterBottom","variant","color","CardActions","Button","size"],"mappings":"yRAOM,MAAAA,EAAkB,IAEhBC,EAACC,EAAK,CAAAC,GAAI,CAAEC,SAAU,KAClBC,SAAA,CAAAC,EAACC,EACG,CAAAC,UAAU,MACVC,OAAO,MACPC,MAAM,sKACNC,IAAI,iBAERV,EAACW,EAAW,CAAAP,SAAA,CACRC,EAACO,EAAU,CAACC,cAAa,EAAAC,QAAQ,KAAKP,UAAU,MAEnCH,SAAA,iBACbC,EAACO,EAAU,CAACE,QAAQ,QAAQZ,GAAI,CAAEa,MAAO,kBAG5BX,SAAA,2MAEjBC,EAACW,YACGX,EAACY,GAAOC,KAAK,QAAQJ,QAAQ"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import e from"@mui/material/styles/createTheme";const o=e({typography:{body1:{fontFamily:"'Roboto', sans-serif"},body2:{fontFamily:"'Roboto', sans-serif"},h1:{fontFamily:"clarendon-text-pro,Domine,serif"},h2:{fontFamily:"clarendon-text-pro,Domine,serif"},h3:{fontFamily:"clarendon-text-pro,Domine,serif"},h4:{fontFamily:"clarendon-text-pro,Domine,serif"},h5:{fontFamily:"clarendon-text-pro,Domine,serif"},h6:{fontFamily:"clarendon-text-pro,Domine,serif"}},palette:{success:{main:"#20C26E",dark:"#137442",light:"#D2F3E2"},error:{main:"#CA0030",dark:"#79001D",light:"#FADBE2"},warning:{main:"#FFBC2C",dark:"#FF7A00",light:"#FFF2D5"}}}),t=e(o,{palette:{black:o.palette.augmentColor({color:{main:"#000000"},name:"black"}),white:o.palette.augmentColor({color:{main:"#ffffff"},name:"white"}),flippyBlue:o.palette.augmentColor({color:{main:"#0b75d7",light:"#e3f2fe"},name:"flippyBlue"}),freezerBurn:o.palette.augmentColor({color:{main:"#a5e2f6"},name:"freezerBurn"}),spricyCarrot:o.palette.augmentColor({color:{main:"#f7742b"},name:"spricyCarrot"}),pebble:o.palette.augmentColor({color:{main:"#eeebe3"},name:"pebble"}),donutPanic:o.palette.augmentColor({color:{main:"#ffbae4"},name:"donutPanic"}),eletricLime:o.palette.augmentColor({color:{main:"#cff27d"},name:"eletricLime"}),pending:o.palette.augmentColor({color:{main:"#DEACFA",dark:"#A56AC6",light:"#FCF7FE"},name:"pending"}),alternateBackground:o.palette.augmentColor({color:{main:"#F7F7F7"},name:"alternateBackground"})}});var r=e(t,{palette:{primary:{main:t.palette.flippyBlue.main},secondary:{main:t.palette.spricyCarrot.main}},shape:{borderRadius:"4px"},components:{MuiButton:{styleOverrides:{root:{padding:"12px 24px",textTransform:"none"}}},MuiCard:{styleOverrides:{root:{boxShadow:"none",borderWidth:"1px",borderStyle:"solid",borderColor:t.palette.divider}}},MuiChip:{styleOverrides:{root:{fontWeight:"bold",paddingLeft:"6px",paddingRight:"6px"}}},MuiListItemButton:{styleOverrides:{root:{"&:hover":{backgroundColor:"#eaf2ff"},"&:not(:last-child)":{borderBottom:`1px solid ${t.palette.divider}`}}}},MuiTableRow:{styleOverrides:{root:{"&.MuiTableRow-hover:hover":{backgroundColor:t.palette.flippyBlue.light,cursor:"pointer"}}}}}});export{r as default};
|
|
2
|
+
//# sourceMappingURL=flipdishPublicTheme.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flipdishPublicTheme.js","sources":["../../src/themes/flipdishPublicTheme.ts"],"sourcesContent":["import createTheme, { type ThemeOptions } from '@mui/material/styles/createTheme';\n\n// Colours and fonts as per our brand guidelines\nconst fontTheme = createTheme({\n typography: {\n body1: {\n fontFamily: \"'Roboto', sans-serif\",\n },\n body2: {\n fontFamily: \"'Roboto', sans-serif\",\n },\n h1: {\n fontFamily: 'clarendon-text-pro,Domine,serif',\n },\n h2: {\n fontFamily: 'clarendon-text-pro,Domine,serif',\n },\n h3: {\n fontFamily: 'clarendon-text-pro,Domine,serif',\n },\n h4: {\n fontFamily: 'clarendon-text-pro,Domine,serif',\n },\n h5: {\n fontFamily: 'clarendon-text-pro,Domine,serif',\n },\n h6: {\n fontFamily: 'clarendon-text-pro,Domine,serif',\n },\n },\n palette: {\n success: {\n main: '#20C26E',\n dark: '#137442',\n light: '#D2F3E2',\n },\n error: {\n main: '#CA0030',\n dark: '#79001D',\n light: '#FADBE2',\n },\n warning: {\n main: '#FFBC2C',\n dark: '#FF7A00',\n light: '#FFF2D5',\n },\n },\n});\n\nconst theme = createTheme(fontTheme as ThemeOptions, {\n palette: {\n // Primary\n black: fontTheme.palette.augmentColor({\n color: {\n main: '#000000',\n },\n name: 'black',\n }),\n white: fontTheme.palette.augmentColor({\n color: {\n main: '#ffffff',\n },\n name: 'white',\n }),\n flippyBlue: fontTheme.palette.augmentColor({\n color: {\n main: '#0b75d7',\n light: '#e3f2fe',\n },\n name: 'flippyBlue',\n }),\n // Core\n freezerBurn: fontTheme.palette.augmentColor({\n color: {\n main: '#a5e2f6',\n },\n name: 'freezerBurn',\n }),\n spricyCarrot: fontTheme.palette.augmentColor({\n color: {\n main: '#f7742b',\n },\n name: 'spricyCarrot',\n }),\n pebble: fontTheme.palette.augmentColor({\n color: {\n main: '#eeebe3',\n },\n name: 'pebble',\n }),\n // Secondary\n donutPanic: fontTheme.palette.augmentColor({\n color: {\n main: '#ffbae4',\n },\n name: 'donutPanic',\n }),\n eletricLime: fontTheme.palette.augmentColor({\n color: {\n main: '#cff27d',\n },\n name: 'eletricLime',\n }),\n pending: fontTheme.palette.augmentColor({\n color: {\n main: '#DEACFA',\n dark: '#A56AC6',\n light: '#FCF7FE',\n },\n name: 'pending',\n }),\n alternateBackground: fontTheme.palette.augmentColor({\n color: {\n main: '#F7F7F7',\n },\n name: 'alternateBackground',\n }),\n },\n});\n\nexport default createTheme(theme as ThemeOptions, {\n palette: {\n primary: {\n main: theme.palette.flippyBlue.main,\n },\n secondary: {\n main: theme.palette.spricyCarrot.main,\n },\n },\n shape: {\n borderRadius: '4px',\n },\n components: {\n MuiButton: {\n styleOverrides: {\n root: {\n padding: '12px 24px',\n textTransform: 'none',\n },\n },\n },\n MuiCard: {\n styleOverrides: {\n root: {\n boxShadow: 'none',\n borderWidth: '1px',\n borderStyle: 'solid',\n borderColor: theme.palette.divider,\n },\n },\n },\n MuiChip: {\n styleOverrides: {\n root: {\n fontWeight: 'bold',\n paddingLeft: '6px',\n paddingRight: '6px',\n },\n },\n },\n MuiListItemButton: {\n styleOverrides: {\n root: {\n '&:hover': {\n backgroundColor: '#eaf2ff',\n },\n '&:not(:last-child)': {\n borderBottom: `1px solid ${theme.palette.divider}`,\n },\n },\n },\n },\n MuiTableRow: {\n styleOverrides: {\n root: {\n '&.MuiTableRow-hover:hover': {\n backgroundColor: theme.palette.flippyBlue.light,\n cursor: 'pointer',\n },\n },\n },\n },\n },\n});\n"],"names":["fontTheme","createTheme","typography","body1","fontFamily","body2","h1","h2","h3","h4","h5","h6","palette","success","main","dark","light","error","warning","theme","black","augmentColor","color","name","white","flippyBlue","freezerBurn","spricyCarrot","pebble","donutPanic","eletricLime","pending","alternateBackground","flipdishPublicTheme","primary","secondary","shape","borderRadius","components","MuiButton","styleOverrides","root","padding","textTransform","MuiCard","boxShadow","borderWidth","borderStyle","borderColor","divider","MuiChip","fontWeight","paddingLeft","paddingRight","MuiListItemButton","backgroundColor","borderBottom","MuiTableRow","cursor"],"mappings":"gDAGA,MAAMA,EAAYC,EAAY,CAC1BC,WAAY,CACRC,MAAO,CACHC,WAAY,wBAEhBC,MAAO,CACHD,WAAY,wBAEhBE,GAAI,CACAF,WAAY,mCAEhBG,GAAI,CACAH,WAAY,mCAEhBI,GAAI,CACAJ,WAAY,mCAEhBK,GAAI,CACAL,WAAY,mCAEhBM,GAAI,CACAN,WAAY,mCAEhBO,GAAI,CACAP,WAAY,oCAGpBQ,QAAS,CACLC,QAAS,CACLC,KAAM,UACNC,KAAM,UACNC,MAAO,WAEXC,MAAO,CACHH,KAAM,UACNC,KAAM,UACNC,MAAO,WAEXE,QAAS,CACLJ,KAAM,UACNC,KAAM,UACNC,MAAO,cAKbG,EAAQlB,EAAYD,EAA2B,CACjDY,QAAS,CAELQ,MAAOpB,EAAUY,QAAQS,aAAa,CAClCC,MAAO,CACHR,KAAM,WAEVS,KAAM,UAEVC,MAAOxB,EAAUY,QAAQS,aAAa,CAClCC,MAAO,CACHR,KAAM,WAEVS,KAAM,UAEVE,WAAYzB,EAAUY,QAAQS,aAAa,CACvCC,MAAO,CACHR,KAAM,UACNE,MAAO,WAEXO,KAAM,eAGVG,YAAa1B,EAAUY,QAAQS,aAAa,CACxCC,MAAO,CACHR,KAAM,WAEVS,KAAM,gBAEVI,aAAc3B,EAAUY,QAAQS,aAAa,CACzCC,MAAO,CACHR,KAAM,WAEVS,KAAM,iBAEVK,OAAQ5B,EAAUY,QAAQS,aAAa,CACnCC,MAAO,CACHR,KAAM,WAEVS,KAAM,WAGVM,WAAY7B,EAAUY,QAAQS,aAAa,CACvCC,MAAO,CACHR,KAAM,WAEVS,KAAM,eAEVO,YAAa9B,EAAUY,QAAQS,aAAa,CACxCC,MAAO,CACHR,KAAM,WAEVS,KAAM,gBAEVQ,QAAS/B,EAAUY,QAAQS,aAAa,CACpCC,MAAO,CACHR,KAAM,UACNC,KAAM,UACNC,MAAO,WAEXO,KAAM,YAEVS,oBAAqBhC,EAAUY,QAAQS,aAAa,CAChDC,MAAO,CACHR,KAAM,WAEVS,KAAM,2BAKlB,IAAeU,EAAAhC,EAAYkB,EAAuB,CAC9CP,QAAS,CACLsB,QAAS,CACLpB,KAAMK,EAAMP,QAAQa,WAAWX,MAEnCqB,UAAW,CACPrB,KAAMK,EAAMP,QAAQe,aAAab,OAGzCsB,MAAO,CACHC,aAAc,OAElBC,WAAY,CACRC,UAAW,CACPC,eAAgB,CACZC,KAAM,CACFC,QAAS,YACTC,cAAe,UAI3BC,QAAS,CACLJ,eAAgB,CACZC,KAAM,CACFI,UAAW,OACXC,YAAa,MACbC,YAAa,QACbC,YAAa7B,EAAMP,QAAQqC,WAIvCC,QAAS,CACLV,eAAgB,CACZC,KAAM,CACFU,WAAY,OACZC,YAAa,MACbC,aAAc,SAI1BC,kBAAmB,CACfd,eAAgB,CACZC,KAAM,CACF,UAAW,CACPc,gBAAiB,WAErB,qBAAsB,CAClBC,aAAc,aAAarC,EAAMP,QAAQqC,cAKzDQ,YAAa,CACTjB,eAAgB,CACZC,KAAM,CACF,4BAA6B,CACzBc,gBAAiBpC,EAAMP,QAAQa,WAAWT,MAC1C0C,OAAQ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formValidation.js","sources":["../../src/utilities/formValidation.tsx"],"sourcesContent":["export const formikValidate = {\n Required: (value: string): string | undefined => {\n if (value.length === 0) {\n return 'Required';\n }\n },\n AtLeastOneSelected: (value: Array<string | number>): string | undefined => {\n if (value.length === 0) {\n return 'Required';\n }\n },\n};\n"],"names":["formikValidate","Required","value","length","AtLeastOneSelected"],"mappings":"AAAa,MAAAA,EAAiB,CAC1BC,SAAWC,IACP,GAAqB,IAAjBA,EAAMC,OACN,MAAO,UACV,EAELC,mBAAqBF,IACjB,GAAqB,IAAjBA,EAAMC,OACN,MAAO,UACV"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import o from"lodash.debounce";const e=(e,r)=>o(e,r);export{e as debounce};
|
|
2
|
-
//# sourceMappingURL=
|
|
2
|
+
//# sourceMappingURL=genericUtilities.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"genericUtilities.js","sources":["../../src/utilities/genericUtilities.ts"],"sourcesContent":["import lodashDebounce from 'lodash.debounce';\n\n/**\n * Creates a debounced function that delays invoking the provided function until after `waitMs` milliseconds\n * have elapsed since the last time the debounced function was invoked.\n *\n * @param func - The function to debounce\n * @param waitMs - The number of milliseconds to delay\n * @returns A debounced version of the provided function\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const debounce = (func: (...args: any[]) => void, waitMs: number) => lodashDebounce(func, waitMs);\n"],"names":["debounce","func","waitMs","lodashDebounce"],"mappings":"+BAWa,MAAAA,EAAW,CAACC,EAAgCC,IAAmBC,EAAeF,EAAMC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
|
|
3
|
-
declare const getMicroFrontendAttribute: (key: string) => string
|
|
3
|
+
declare const getMicroFrontendAttribute: (key: string) => string;
|
|
4
4
|
/**
|
|
5
5
|
* Retrieves the AppId.
|
|
6
6
|
*
|
|
@@ -9,7 +9,7 @@ declare const getMicroFrontendAttribute: (key: string) => string | null;
|
|
|
9
9
|
*
|
|
10
10
|
* @warning Your component will not re-render if the value changes. Use 'useMicroFrontendAttributes' custom hook instead if you care about reactivity.
|
|
11
11
|
*/
|
|
12
|
-
declare const getAppId: () => string
|
|
12
|
+
declare const getAppId: () => string;
|
|
13
13
|
/**
|
|
14
14
|
* Retrieves the OrgId.
|
|
15
15
|
*
|
|
@@ -18,7 +18,7 @@ declare const getAppId: () => string | null;
|
|
|
18
18
|
*
|
|
19
19
|
* @warning Your component will not re-render if the value changes. Use 'useMicroFrontendAttributes' custom hook instead if you care about reactivity.
|
|
20
20
|
*/
|
|
21
|
-
declare const getOrgId: () => string
|
|
21
|
+
declare const getOrgId: () => string;
|
|
22
22
|
/**
|
|
23
23
|
* Retrieves the BrandId.
|
|
24
24
|
*
|
|
@@ -27,7 +27,7 @@ declare const getOrgId: () => string | null;
|
|
|
27
27
|
*
|
|
28
28
|
* @warning Your component will not re-render if the value changes. Use 'useMicroFrontendAttributes' custom hook instead if you care about reactivity.
|
|
29
29
|
*/
|
|
30
|
-
declare const getBrandId: () => string
|
|
30
|
+
declare const getBrandId: () => string;
|
|
31
31
|
/**
|
|
32
32
|
* Retrieves the isFlipdishStaff attribute.
|
|
33
33
|
*
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{lazy as e}from"react";const t=e=>{const t=document.getElementById("flipdish-micro-frontend");return t?.getAttribute(e)||""},r=()=>import.meta.env.VITE_APPID_OVERRIDE||t("data-appId"),a=()=>import.meta.env.VITE_ORGID_OVERRIDE||t("data-orgId"),o=()=>import.meta.env.VITE_BRANDID_OVERRIDE||t("data-brandId"),n=()=>{const e=import.meta.env.VITE_ISFLIPDISHSTAFFOVERRIDE||t("data-isFlipdishStaff");return"true"===e?.toString()},s=t=>e((async()=>{const e=JSON.parse(window.sessionStorage.getItem("page-has-been-force-refreshed")||"false");try{const e=await t();return window.sessionStorage.setItem("page-has-been-force-refreshed","false"),e}catch(t){if(!e)return window.sessionStorage.setItem("page-has-been-force-refreshed","true"),window.location.reload();throw t}}));export{r as getAppId,o as getBrandId,n as getIsFlipdishStaff,t as getMicroFrontendAttribute,a as getOrgId,s as lazyWithRetry};
|
|
2
|
+
//# sourceMappingURL=renderUtilities.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderUtilities.js","sources":["../../src/utilities/renderUtilities.ts"],"sourcesContent":["import { lazy } from 'react';\n\nexport const getMicroFrontendAttribute = (key: string): string => {\n const microFrontendDiv = document.getElementById('flipdish-micro-frontend');\n return microFrontendDiv?.getAttribute(key) || '';\n};\n\n/**\n * Retrieves the AppId.\n *\n * Attempts to get the value from the environment variable `VITE_APPID_OVERRIDE`.\n * If the environment variable is not set, it falls back to retrieving from a micro frontend attribute `data-appId`.\n *\n * @warning Your component will not re-render if the value changes. Use 'useMicroFrontendAttributes' custom hook instead if you care about reactivity.\n */\nexport const getAppId = (): string => {\n return import.meta.env.VITE_APPID_OVERRIDE || getMicroFrontendAttribute('data-appId');\n};\n\n/**\n * Retrieves the OrgId.\n *\n * Attempts to get the value from the environment variable `VITE_ORGID_OVERRIDE`.\n * If the environment variable is not set, it falls back to retrieving from a micro frontend attribute `data-orgId`.\n *\n * @warning Your component will not re-render if the value changes. Use 'useMicroFrontendAttributes' custom hook instead if you care about reactivity.\n */\nexport const getOrgId = (): string => {\n //TODO: change to kebab case to satisfy html attribute requirements\n return import.meta.env.VITE_ORGID_OVERRIDE || getMicroFrontendAttribute('data-orgId');\n};\n\n/**\n * Retrieves the BrandId.\n *\n * Attempts to get the value from the environment variable `VITE_BRANDID_OVERRIDE`.\n * If the environment variable is not set, it falls back to retrieving from a micro frontend attribute `data-brandId`.\n *\n * @warning Your component will not re-render if the value changes. Use 'useMicroFrontendAttributes' custom hook instead if you care about reactivity.\n */\nexport const getBrandId = (): string => {\n //TODO: change to kebab case to satisfy html attribute requirements\n return import.meta.env.VITE_BRANDID_OVERRIDE || getMicroFrontendAttribute('data-brandId');\n};\n\n/**\n * Retrieves the isFlipdishStaff attribute.\n *\n * Attempts to get the value from the environment variable `VITE_ISFLIPDISHSTAFFOVERRIDE`.\n * If the environment variable is not set, it falls back to retrieving from a micro frontend attribute `data-isFlipdishStaff`.\n *\n * @warning Your component will not re-render if the value changes. Use 'useMicroFrontendAttributes' custom hook instead if you care about reactivity.\n */\nexport const getIsFlipdishStaff = (): boolean => {\n const stringValue = import.meta.env.VITE_ISFLIPDISHSTAFFOVERRIDE || getMicroFrontendAttribute('data-isFlipdishStaff');\n return stringValue?.toString() === 'true';\n};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const lazyWithRetry = (componentImport: () => any) =>\n lazy(async () => {\n const pageHasAlreadyBeenForceRefreshed = JSON.parse(window.sessionStorage.getItem('page-has-been-force-refreshed') || 'false');\n\n try {\n const component = await componentImport();\n window.sessionStorage.setItem('page-has-been-force-refreshed', 'false');\n\n return component;\n } catch (error) {\n if (!pageHasAlreadyBeenForceRefreshed) {\n // Assuming that the user is not on the latest version of the application.\n // Let's refresh the page immediately.\n window.sessionStorage.setItem('page-has-been-force-refreshed', 'true');\n return window.location.reload();\n }\n\n // The page has already been reloaded\n // Assuming that user is already using the latest version of the application.\n // Let's let the application crash and raise the error.\n throw error;\n }\n });\n"],"names":["getMicroFrontendAttribute","key","microFrontendDiv","document","getElementById","getAttribute","getAppId","env","VITE_APPID_OVERRIDE","getOrgId","VITE_ORGID_OVERRIDE","getBrandId","VITE_BRANDID_OVERRIDE","getIsFlipdishStaff","stringValue","VITE_ISFLIPDISHSTAFFOVERRIDE","toString","lazyWithRetry","componentImport","lazy","async","pageHasAlreadyBeenForceRefreshed","JSON","parse","window","sessionStorage","getItem","component","setItem","error","location","reload"],"mappings":"6BAEa,MAAAA,EAA6BC,IACtC,MAAMC,EAAmBC,SAASC,eAAe,2BACjD,OAAOF,GAAkBG,aAAaJ,IAAQ,EAAE,EAWvCK,EAAW,gBACDC,IAAIC,qBAAuBR,EAA0B,cAW/DS,EAAW,gBAEDF,IAAIG,qBAAuBV,EAA0B,cAW/DW,EAAa,gBAEHJ,IAAIK,uBAAyBZ,EAA0B,gBAWjEa,EAAqB,KAC9B,MAAMC,cAA0BP,IAAIQ,8BAAgCf,EAA0B,wBAC9F,MAAmC,SAA5Bc,GAAaE,UAAqB,EAIhCC,EAAiBC,GAC1BC,GAAKC,UACD,MAAMC,EAAmCC,KAAKC,MAAMC,OAAOC,eAAeC,QAAQ,kCAAoC,SAEtH,IACI,MAAMC,QAAkBT,IAGxB,OAFAM,OAAOC,eAAeG,QAAQ,gCAAiC,SAExDD,CACV,CAAC,MAAOE,GACL,IAAKR,EAID,OADAG,OAAOC,eAAeG,QAAQ,gCAAiC,QACxDJ,OAAOM,SAASC,SAM3B,MAAMF,CACT"}
|
package/package.json
CHANGED
|
@@ -1,9 +1,36 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flipdish/portal-library",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist"
|
|
6
6
|
],
|
|
7
|
+
"type": "module",
|
|
8
|
+
"exports": {
|
|
9
|
+
"./components/*": {
|
|
10
|
+
"types": "./dist/components/*/index.d.ts",
|
|
11
|
+
"import": "./dist/components/*/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./utilities/*": {
|
|
14
|
+
"types": "./dist/utilities/*.d.ts",
|
|
15
|
+
"import": "./dist/utilities/*.js"
|
|
16
|
+
},
|
|
17
|
+
"./providers/*": {
|
|
18
|
+
"types": "./dist/providers/*.d.ts",
|
|
19
|
+
"import": "./dist/providers/*.js"
|
|
20
|
+
},
|
|
21
|
+
"./custom-hooks/*": {
|
|
22
|
+
"types": "./dist/custom-hooks/*.d.ts",
|
|
23
|
+
"import": "./dist/custom-hooks/*.js"
|
|
24
|
+
},
|
|
25
|
+
"./themes/*": {
|
|
26
|
+
"types": "./dist/themes/*.d.ts",
|
|
27
|
+
"import": "./dist/themes/*.js"
|
|
28
|
+
},
|
|
29
|
+
"./icons/*": {
|
|
30
|
+
"types": "./dist/icons/*/index.d.ts",
|
|
31
|
+
"import": "./dist/icons/*/index.js"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
7
34
|
"peerDependencies": {
|
|
8
35
|
"@actions/core": "^1.11.1",
|
|
9
36
|
"@emotion/react": "11.14.0",
|
|
@@ -24,6 +51,7 @@
|
|
|
24
51
|
"devDependencies": {
|
|
25
52
|
"@chromatic-com/storybook": "^3.2.5",
|
|
26
53
|
"@rollup/plugin-commonjs": "^28.0.1",
|
|
54
|
+
"@rollup/plugin-dynamic-import-vars": "^2.1.5",
|
|
27
55
|
"@rollup/plugin-json": "^6.1.0",
|
|
28
56
|
"@rollup/plugin-node-resolve": "^15.3.0",
|
|
29
57
|
"@rollup/plugin-terser": "^0.4.4",
|
|
@@ -78,6 +106,7 @@
|
|
|
78
106
|
"preview": "vite preview",
|
|
79
107
|
"test:run": "vitest run",
|
|
80
108
|
"test:watch": "vitest",
|
|
109
|
+
"test:coverage": "vitest run --coverage --pool=threads",
|
|
81
110
|
"variables:generate": "node domains.js",
|
|
82
111
|
"typecheck": "tsc --noEmit",
|
|
83
112
|
"storybook": "storybook dev -p 6006",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fd-loader.gif.cjs.js","sources":["../../../src/assets/images/fd-loader.gif"],"sourcesContent":["export default \"7cb5b036a5bc98d2.gif\""],"names":[],"mappings":"4BAAe"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var t=require("react");const e=["orgId","appId",{key:"isFlipdishStaff",type:"boolean"}],n=(t,e)=>t||"boolean"===e?"boolean"===e?"true"===t:"number"===e?Number(t):t:null,o=t=>[...e.map((t=>"string"==typeof t?t:t.key)),...t.map((t=>"string"==typeof t?t:t.key))];module.exports=(r=[])=>{const[s,i]=t.useState((()=>(t=>{const e=o(t),n={};return e.forEach((t=>{const e="string"==typeof t?t:t.key;n[e]=null})),n})(r)));return t.useEffect((()=>{const t=document.getElementById("flipdish-micro-frontend");if(!t)return void console.warn("Micro-frontend div not found");const s=o(r),u=[...e,...r],c=()=>{i((e=>{const o={...e};let r=!1;return s.forEach((e=>{const{value:s,key:i}=((t,e,o)=>{const r=((t,e)=>e.find((e=>"string"==typeof e?e===t:e.key===t)))(t,o),s=(t=>t&&"string"!=typeof t&&"type"in t?t.type:"string")(r),i="string"==typeof t?t:t.key,u=(void 0)[`VITE_${i.toUpperCase()}_OVERRIDE`],c=`data-${i}`,a=e.getAttribute(c);return{value:n(u?u.toString():a,s),key:i}})(e,t,u);o[i]!==s&&(o[i]=s,r=!0)})),r?o:e}))};c();const a=new MutationObserver(c);return a.observe(t,{attributes:!0}),()=>a.disconnect()}),[r]),s};
|
|
2
|
-
//# sourceMappingURL=useMicroFrontendAttributes.cjs.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useMicroFrontendAttributes.cjs.js","sources":["../../../src/components/custom-hooks/useMicroFrontendAttributes.tsx"],"sourcesContent":["import { useEffect, useState } from 'react';\n\ntype KeyType = 'string' | 'boolean' | 'number';\n\ninterface KeyConfig {\n key: string;\n type?: KeyType; // type is optional, defaults to 'string'\n}\n\nconst ALWAYS_RETURN_KEYS: (string | KeyConfig)[] = ['orgId', 'appId', { key: 'isFlipdishStaff', type: 'boolean' }] as const;\n\ntype AlwaysReturnKeys = (typeof ALWAYS_RETURN_KEYS)[number] extends KeyConfig\n ? (typeof ALWAYS_RETURN_KEYS)[number]['key']\n : (typeof ALWAYS_RETURN_KEYS)[number];\n\ntype ExtractKey<T> = T extends KeyConfig ? T['key'] : T;\n\ntype AttributeValue = string | boolean | number | null;\n\n// Utility functions moved outside\ntype KeyArg<T> = string | T | AlwaysReturnKeys;\nconst getKeyConfig = <T extends string | KeyConfig>(key: KeyArg<T>, allConfigs: (string | KeyConfig)[]) => {\n return allConfigs.find((config) => (typeof config === 'string' ? config === key : config.key === key));\n};\n\nconst getValueType = (keyConfig: KeyConfig | string | undefined): KeyType => {\n return keyConfig && typeof keyConfig !== 'string' && 'type' in keyConfig ? keyConfig.type : 'string';\n};\n\nconst parseValue = (value: string | null, type: KeyType): AttributeValue => {\n if (!value && type !== 'boolean') return null;\n if (type === 'boolean') return value === 'true';\n if (type === 'number') return Number(value);\n return value;\n};\n\nconst getAllKeys = <T extends string | KeyConfig>(customKeys: (T | KeyConfig)[]): (string | T | AlwaysReturnKeys)[] => {\n return [\n ...ALWAYS_RETURN_KEYS.map((key) => (typeof key === 'string' ? key : key.key)),\n ...customKeys.map((key) => (typeof key === 'string' ? key : key.key)),\n ];\n};\n\nconst getInitialState = <T extends string | KeyConfig>(customKeys: (T | KeyConfig)[]): Record<ExtractKey<AlwaysReturnKeys | T>, AttributeValue> => {\n const allKeys = getAllKeys(customKeys);\n const initialState = {} as Record<ExtractKey<AlwaysReturnKeys | T>, AttributeValue>;\n allKeys.forEach((key) => {\n const typedKey = (typeof key === 'string' ? key : key.key) as ExtractKey<AlwaysReturnKeys | T>;\n initialState[typedKey] = null;\n });\n return initialState;\n};\n\nconst processAttribute = <T extends string | KeyConfig>(\n key: string | T | AlwaysReturnKeys,\n microFrontendDiv: HTMLElement,\n allConfigs: (string | KeyConfig)[],\n): { value: AttributeValue; key: ExtractKey<AlwaysReturnKeys | T> } => {\n const keyConfig = getKeyConfig(key, allConfigs);\n const type = getValueType(keyConfig);\n const keyString = typeof key === 'string' ? key : key.key;\n\n const envVar = import.meta.env[`VITE_${keyString.toUpperCase()}_OVERRIDE`] as string | undefined | null;\n const attributeKey = `data-${keyString}`;\n const domValue = microFrontendDiv.getAttribute(attributeKey);\n\n const value = envVar ? parseValue(envVar.toString(), type) : parseValue(domValue, type);\n return { value, key: keyString as ExtractKey<AlwaysReturnKeys | T> };\n};\n\n/**\n * Custom hook to manage micro-frontend attributes.\n *\n * This hook initializes and updates a set of attributes based on a combination of predefined keys (ALWAYS_RETURN_KEYS)\n * and custom keys provided as arguments. The attributes are fetched from environment variables or DOM attributes\n * and are updated dynamically using a MutationObserver.\n *\n * @template T - The type of custom keys, which can be either a string or a KeyConfig object.\n *\n * @param {Array<T | KeyConfig>} [customKeys=[]] - An array of custom keys or KeyConfig objects to be included in the attributes.\n *\n * @returns {Record<ExtractKey<AlwaysReturnKeys | T>, string | boolean | number | null>} - A record of attributes with their values.\n *\n * @example\n * const attributes = useMicroFrontendAttributes(['customKey1', { key: 'customKey2', type: 'boolean' }]);\n * console.log(attributes);\n */\nconst useMicroFrontendAttributes = <T extends string | KeyConfig>(\n customKeys: (T | KeyConfig)[] = [],\n): Record<ExtractKey<AlwaysReturnKeys | T>, AttributeValue> => {\n const [attributes, setAttributes] = useState(() => getInitialState(customKeys));\n\n useEffect(() => {\n const microFrontendDiv = document.getElementById('flipdish-micro-frontend');\n if (!microFrontendDiv) {\n console.warn('Micro-frontend div not found');\n return;\n }\n\n const allKeys = getAllKeys(customKeys);\n const allConfigs = [...ALWAYS_RETURN_KEYS, ...customKeys];\n\n const updateValues = () => {\n setAttributes((prev) => {\n const newAttributes = { ...prev };\n let isChanged = false;\n\n allKeys.forEach((key) => {\n const { value, key: typedKey } = processAttribute(key, microFrontendDiv, allConfigs);\n if (newAttributes[typedKey] !== value) {\n newAttributes[typedKey] = value;\n isChanged = true;\n }\n });\n\n return isChanged ? newAttributes : prev;\n });\n };\n\n updateValues();\n\n const observer = new MutationObserver(updateValues);\n observer.observe(microFrontendDiv, { attributes: true });\n\n return () => observer.disconnect();\n }, [customKeys]);\n\n return attributes;\n};\n\nexport default useMicroFrontendAttributes;\n"],"names":["ALWAYS_RETURN_KEYS","key","type","parseValue","value","Number","getAllKeys","customKeys","map","attributes","setAttributes","useState","allKeys","initialState","forEach","typedKey","getInitialState","useEffect","microFrontendDiv","document","getElementById","console","warn","allConfigs","updateValues","prev","newAttributes","isChanged","keyConfig","find","config","getKeyConfig","getValueType","keyString","envVar","undefined","toUpperCase","attributeKey","domValue","getAttribute","toString","processAttribute","observer","MutationObserver","observe","disconnect"],"mappings":"oCASA,MAAMA,EAA6C,CAAC,QAAS,QAAS,CAAEC,IAAK,kBAAmBC,KAAM,YAoBhGC,EAAa,CAACC,EAAsBF,IACjCE,GAAkB,YAATF,EACD,YAATA,EAAqC,SAAVE,EAClB,WAATF,EAA0BG,OAAOD,GAC9BA,EAHkC,KAMvCE,EAA4CC,GACvC,IACAP,EAAmBQ,KAAKP,GAAwB,iBAARA,EAAmBA,EAAMA,EAAIA,SACrEM,EAAWC,KAAKP,GAAwB,iBAARA,EAAmBA,EAAMA,EAAIA,sBAgDrC,CAC/BM,EAAgC,MAEhC,MAAOE,EAAYC,GAAiBC,EAAQA,UAAC,IA/CzB,CAA+BJ,IACnD,MAAMK,EAAUN,EAAWC,GACrBM,EAAe,CAAA,EAKrB,OAJAD,EAAQE,SAASb,IACb,MAAMc,EAA2B,iBAARd,EAAmBA,EAAMA,EAAIA,IACtDY,EAAaE,GAAY,IAAI,IAE1BF,CAAY,EAwCgCG,CAAgBT,KAqCnE,OAnCAU,EAAAA,WAAU,KACN,MAAMC,EAAmBC,SAASC,eAAe,2BACjD,IAAKF,EAED,YADAG,QAAQC,KAAK,gCAIjB,MAAMV,EAAUN,EAAWC,GACrBgB,EAAa,IAAIvB,KAAuBO,GAExCiB,EAAe,KACjBd,GAAee,IACX,MAAMC,EAAgB,IAAKD,GAC3B,IAAIE,GAAY,EAUhB,OARAf,EAAQE,SAASb,IACb,MAAMG,MAAEA,EAAOH,IAAKc,GAvDf,EACrBd,EACAiB,EACAK,KAEA,MAAMK,EArCW,EAA+B3B,EAAgBsB,IACzDA,EAAWM,MAAMC,GAA8B,iBAAXA,EAAsBA,IAAW7B,EAAM6B,EAAO7B,MAAQA,IAoC/E8B,CAAa9B,EAAKsB,GAC9BrB,EAlCW,CAAC0B,GACXA,GAAkC,iBAAdA,GAA0B,SAAUA,EAAYA,EAAU1B,KAAO,SAiC/E8B,CAAaJ,GACpBK,EAA2B,iBAARhC,EAAmBA,EAAMA,EAAIA,IAEhDiC,QAASC,GAAgB,QAAQF,EAAUG,0BAC3CC,EAAe,QAAQJ,IACvBK,EAAWpB,EAAiBqB,aAAaF,GAG/C,MAAO,CAAEjC,MADcD,EAAT+B,EAAoBA,EAAOM,WAA+BF,EAAnBpC,GACrCD,IAAKgC,EAA+C,EAyCnBQ,CAAiBxC,EAAKiB,EAAkBK,GACrEG,EAAcX,KAAcX,IAC5BsB,EAAcX,GAAYX,EAC1BuB,GAAY,EACf,IAGEA,EAAYD,EAAgBD,CAAI,GACzC,EAGND,IAEA,MAAMkB,EAAW,IAAIC,iBAAiBnB,GAGtC,OAFAkB,EAASE,QAAQ1B,EAAkB,CAAET,YAAY,IAE1C,IAAMiC,EAASG,YAAY,GACnC,CAACtC,IAEGE,CAAU"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useMicroFrontendAttributes.js","sources":["../../../src/components/custom-hooks/useMicroFrontendAttributes.tsx"],"sourcesContent":["import { useEffect, useState } from 'react';\n\ntype KeyType = 'string' | 'boolean' | 'number';\n\ninterface KeyConfig {\n key: string;\n type?: KeyType; // type is optional, defaults to 'string'\n}\n\nconst ALWAYS_RETURN_KEYS: (string | KeyConfig)[] = ['orgId', 'appId', { key: 'isFlipdishStaff', type: 'boolean' }] as const;\n\ntype AlwaysReturnKeys = (typeof ALWAYS_RETURN_KEYS)[number] extends KeyConfig\n ? (typeof ALWAYS_RETURN_KEYS)[number]['key']\n : (typeof ALWAYS_RETURN_KEYS)[number];\n\ntype ExtractKey<T> = T extends KeyConfig ? T['key'] : T;\n\ntype AttributeValue = string | boolean | number | null;\n\n// Utility functions moved outside\ntype KeyArg<T> = string | T | AlwaysReturnKeys;\nconst getKeyConfig = <T extends string | KeyConfig>(key: KeyArg<T>, allConfigs: (string | KeyConfig)[]) => {\n return allConfigs.find((config) => (typeof config === 'string' ? config === key : config.key === key));\n};\n\nconst getValueType = (keyConfig: KeyConfig | string | undefined): KeyType => {\n return keyConfig && typeof keyConfig !== 'string' && 'type' in keyConfig ? keyConfig.type : 'string';\n};\n\nconst parseValue = (value: string | null, type: KeyType): AttributeValue => {\n if (!value && type !== 'boolean') return null;\n if (type === 'boolean') return value === 'true';\n if (type === 'number') return Number(value);\n return value;\n};\n\nconst getAllKeys = <T extends string | KeyConfig>(customKeys: (T | KeyConfig)[]): (string | T | AlwaysReturnKeys)[] => {\n return [\n ...ALWAYS_RETURN_KEYS.map((key) => (typeof key === 'string' ? key : key.key)),\n ...customKeys.map((key) => (typeof key === 'string' ? key : key.key)),\n ];\n};\n\nconst getInitialState = <T extends string | KeyConfig>(customKeys: (T | KeyConfig)[]): Record<ExtractKey<AlwaysReturnKeys | T>, AttributeValue> => {\n const allKeys = getAllKeys(customKeys);\n const initialState = {} as Record<ExtractKey<AlwaysReturnKeys | T>, AttributeValue>;\n allKeys.forEach((key) => {\n const typedKey = (typeof key === 'string' ? key : key.key) as ExtractKey<AlwaysReturnKeys | T>;\n initialState[typedKey] = null;\n });\n return initialState;\n};\n\nconst processAttribute = <T extends string | KeyConfig>(\n key: string | T | AlwaysReturnKeys,\n microFrontendDiv: HTMLElement,\n allConfigs: (string | KeyConfig)[],\n): { value: AttributeValue; key: ExtractKey<AlwaysReturnKeys | T> } => {\n const keyConfig = getKeyConfig(key, allConfigs);\n const type = getValueType(keyConfig);\n const keyString = typeof key === 'string' ? key : key.key;\n\n const envVar = import.meta.env[`VITE_${keyString.toUpperCase()}_OVERRIDE`] as string | undefined | null;\n const attributeKey = `data-${keyString}`;\n const domValue = microFrontendDiv.getAttribute(attributeKey);\n\n const value = envVar ? parseValue(envVar.toString(), type) : parseValue(domValue, type);\n return { value, key: keyString as ExtractKey<AlwaysReturnKeys | T> };\n};\n\n/**\n * Custom hook to manage micro-frontend attributes.\n *\n * This hook initializes and updates a set of attributes based on a combination of predefined keys (ALWAYS_RETURN_KEYS)\n * and custom keys provided as arguments. The attributes are fetched from environment variables or DOM attributes\n * and are updated dynamically using a MutationObserver.\n *\n * @template T - The type of custom keys, which can be either a string or a KeyConfig object.\n *\n * @param {Array<T | KeyConfig>} [customKeys=[]] - An array of custom keys or KeyConfig objects to be included in the attributes.\n *\n * @returns {Record<ExtractKey<AlwaysReturnKeys | T>, string | boolean | number | null>} - A record of attributes with their values.\n *\n * @example\n * const attributes = useMicroFrontendAttributes(['customKey1', { key: 'customKey2', type: 'boolean' }]);\n * console.log(attributes);\n */\nconst useMicroFrontendAttributes = <T extends string | KeyConfig>(\n customKeys: (T | KeyConfig)[] = [],\n): Record<ExtractKey<AlwaysReturnKeys | T>, AttributeValue> => {\n const [attributes, setAttributes] = useState(() => getInitialState(customKeys));\n\n useEffect(() => {\n const microFrontendDiv = document.getElementById('flipdish-micro-frontend');\n if (!microFrontendDiv) {\n console.warn('Micro-frontend div not found');\n return;\n }\n\n const allKeys = getAllKeys(customKeys);\n const allConfigs = [...ALWAYS_RETURN_KEYS, ...customKeys];\n\n const updateValues = () => {\n setAttributes((prev) => {\n const newAttributes = { ...prev };\n let isChanged = false;\n\n allKeys.forEach((key) => {\n const { value, key: typedKey } = processAttribute(key, microFrontendDiv, allConfigs);\n if (newAttributes[typedKey] !== value) {\n newAttributes[typedKey] = value;\n isChanged = true;\n }\n });\n\n return isChanged ? newAttributes : prev;\n });\n };\n\n updateValues();\n\n const observer = new MutationObserver(updateValues);\n observer.observe(microFrontendDiv, { attributes: true });\n\n return () => observer.disconnect();\n }, [customKeys]);\n\n return attributes;\n};\n\nexport default useMicroFrontendAttributes;\n"],"names":["ALWAYS_RETURN_KEYS","key","type","parseValue","value","Number","getAllKeys","customKeys","map","useMicroFrontendAttributes","attributes","setAttributes","useState","allKeys","initialState","forEach","typedKey","getInitialState","useEffect","microFrontendDiv","document","getElementById","console","warn","allConfigs","updateValues","prev","newAttributes","isChanged","keyConfig","find","config","getKeyConfig","getValueType","keyString","envVar","env","toUpperCase","attributeKey","domValue","getAttribute","toString","processAttribute","observer","MutationObserver","observe","disconnect"],"mappings":"gDASA,MAAMA,EAA6C,CAAC,QAAS,QAAS,CAAEC,IAAK,kBAAmBC,KAAM,YAoBhGC,EAAa,CAACC,EAAsBF,IACjCE,GAAkB,YAATF,EACD,YAATA,EAAqC,SAAVE,EAClB,WAATF,EAA0BG,OAAOD,GAC9BA,EAHkC,KAMvCE,EAA4CC,GACvC,IACAP,EAAmBQ,KAAKP,GAAwB,iBAARA,EAAmBA,EAAMA,EAAIA,SACrEM,EAAWC,KAAKP,GAAwB,iBAARA,EAAmBA,EAAMA,EAAIA,OAgDlEQ,EAA6B,CAC/BF,EAAgC,MAEhC,MAAOG,EAAYC,GAAiBC,GAAS,IA/CzB,CAA+BL,IACnD,MAAMM,EAAUP,EAAWC,GACrBO,EAAe,CAAA,EAKrB,OAJAD,EAAQE,SAASd,IACb,MAAMe,EAA2B,iBAARf,EAAmBA,EAAMA,EAAIA,IACtDa,EAAaE,GAAY,IAAI,IAE1BF,CAAY,EAwCgCG,CAAgBV,KAqCnE,OAnCAW,GAAU,KACN,MAAMC,EAAmBC,SAASC,eAAe,2BACjD,IAAKF,EAED,YADAG,QAAQC,KAAK,gCAIjB,MAAMV,EAAUP,EAAWC,GACrBiB,EAAa,IAAIxB,KAAuBO,GAExCkB,EAAe,KACjBd,GAAee,IACX,MAAMC,EAAgB,IAAKD,GAC3B,IAAIE,GAAY,EAUhB,OARAf,EAAQE,SAASd,IACb,MAAMG,MAAEA,EAAOH,IAAKe,GAvDf,EACrBf,EACAkB,EACAK,KAEA,MAAMK,EArCW,EAA+B5B,EAAgBuB,IACzDA,EAAWM,MAAMC,GAA8B,iBAAXA,EAAsBA,IAAW9B,EAAM8B,EAAO9B,MAAQA,IAoC/E+B,CAAa/B,EAAKuB,GAC9BtB,EAlCW,CAAC2B,GACXA,GAAkC,iBAAdA,GAA0B,SAAUA,EAAYA,EAAU3B,KAAO,SAiC/E+B,CAAaJ,GACpBK,EAA2B,iBAARjC,EAAmBA,EAAMA,EAAIA,IAEhDkC,cAAqBC,IAAI,QAAQF,EAAUG,0BAC3CC,EAAe,QAAQJ,IACvBK,EAAWpB,EAAiBqB,aAAaF,GAG/C,MAAO,CAAElC,MADcD,EAATgC,EAAoBA,EAAOM,WAA+BF,EAAnBrC,GACrCD,IAAKiC,EAA+C,EAyCnBQ,CAAiBzC,EAAKkB,EAAkBK,GACrEG,EAAcX,KAAcZ,IAC5BuB,EAAcX,GAAYZ,EAC1BwB,GAAY,EACf,IAGEA,EAAYD,EAAgBD,CAAI,GACzC,EAGND,IAEA,MAAMkB,EAAW,IAAIC,iBAAiBnB,GAGtC,OAFAkB,EAASE,QAAQ1B,EAAkB,CAAET,YAAY,IAE1C,IAAMiC,EAASG,YAAY,GACnC,CAACvC,IAEGG,CAAU"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var r=require("react/jsx-runtime"),e=require("react"),s=require("../../providers/TranslationProvider.cjs.js");module.exports=({fieldError:t,showError:a,touched:o,value:i})=>{const[u,c]=e.useState(""),{translate:l}=s.useTranslation(),n=()=>!a&&o&&i?r.jsx("span",{style:{color:"#1dc798"},children:l("Valid")}):a?t:"";return e.useEffect((()=>{c(n())}),[t,i,a,o]),u};
|
|
2
|
-
//# sourceMappingURL=useRenderValidText.cjs.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useRenderValidText.cjs.js","sources":["../../../src/components/custom-hooks/useRenderValidText.tsx"],"sourcesContent":["import { useEffect, useState } from 'react';\nimport { useTranslation } from '../../providers/TranslationProvider';\n\ntype ValidationState = {\n fieldError?: string;\n showError?: boolean;\n touched: boolean;\n value: string;\n};\n\ntype ValidationElement = JSX.Element | string | undefined;\n\n/**\n * @description Custom hook for rendering validation text in form fields\n * @description Handles different validation states with separate methods for better clarity\n */\nconst useRenderValidText = ({ fieldError, showError, touched, value }: ValidationState) => {\n const [validTextElement, setValidTextElement] = useState<ValidationElement>('');\n const { translate } = useTranslation();\n\n const renderValidState = (): ValidationElement => {\n return <span style={{ color: '#1dc798' }}>{translate('Valid')}</span>;\n };\n\n const renderErrorState = (): ValidationElement => {\n return fieldError;\n };\n\n const renderEmptyState = (): ValidationElement => {\n return '';\n };\n\n const determineValidationState = (): ValidationElement => {\n if (!showError && touched && value) {\n return renderValidState();\n }\n\n if (showError) {\n return renderErrorState();\n }\n\n return renderEmptyState();\n };\n\n useEffect(() => {\n setValidTextElement(determineValidationState());\n }, [fieldError, value, showError, touched]);\n\n return validTextElement;\n};\n\nexport default useRenderValidText;\n"],"names":["fieldError","showError","touched","value","validTextElement","setValidTextElement","useState","translate","useTranslation","determineValidationState","_jsx","style","color","children","useEffect"],"mappings":"0IAgB2B,EAAGA,aAAYC,YAAWC,UAASC,YAC1D,MAAOC,EAAkBC,GAAuBC,EAAQA,SAAoB,KACtEC,UAAEA,GAAcC,EAAAA,iBAchBC,EAA2B,KACxBR,GAAaC,GAAWC,EAZtBO,MAAM,OAAA,CAAAC,MAAO,CAAEC,MAAO,WAAWC,SAAGN,EAAU,WAgBjDN,EAZGD,EAIA,GAmBX,OAJAc,EAAAA,WAAU,KACNT,EAAoBI,IAA2B,GAChD,CAACT,EAAYG,EAAOF,EAAWC,IAE3BE,CAAgB"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsx as r}from"react/jsx-runtime";import{useState as o,useEffect as t}from"react";import{useTranslation as e}from"../../providers/TranslationProvider.js";const a=({fieldError:a,showError:s,touched:i,value:l})=>{const[n,c]=o(""),{translate:d}=e(),m=()=>!s&&i&&l?r("span",{style:{color:"#1dc798"},children:d("Valid")}):s?a:"";return t((()=>{c(m())}),[a,l,s,i]),n};export{a as default};
|
|
2
|
-
//# sourceMappingURL=useRenderValidText.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useRenderValidText.js","sources":["../../../src/components/custom-hooks/useRenderValidText.tsx"],"sourcesContent":["import { useEffect, useState } from 'react';\nimport { useTranslation } from '../../providers/TranslationProvider';\n\ntype ValidationState = {\n fieldError?: string;\n showError?: boolean;\n touched: boolean;\n value: string;\n};\n\ntype ValidationElement = JSX.Element | string | undefined;\n\n/**\n * @description Custom hook for rendering validation text in form fields\n * @description Handles different validation states with separate methods for better clarity\n */\nconst useRenderValidText = ({ fieldError, showError, touched, value }: ValidationState) => {\n const [validTextElement, setValidTextElement] = useState<ValidationElement>('');\n const { translate } = useTranslation();\n\n const renderValidState = (): ValidationElement => {\n return <span style={{ color: '#1dc798' }}>{translate('Valid')}</span>;\n };\n\n const renderErrorState = (): ValidationElement => {\n return fieldError;\n };\n\n const renderEmptyState = (): ValidationElement => {\n return '';\n };\n\n const determineValidationState = (): ValidationElement => {\n if (!showError && touched && value) {\n return renderValidState();\n }\n\n if (showError) {\n return renderErrorState();\n }\n\n return renderEmptyState();\n };\n\n useEffect(() => {\n setValidTextElement(determineValidationState());\n }, [fieldError, value, showError, touched]);\n\n return validTextElement;\n};\n\nexport default useRenderValidText;\n"],"names":["useRenderValidText","fieldError","showError","touched","value","validTextElement","setValidTextElement","useState","translate","useTranslation","determineValidationState","_jsx","style","color","children","useEffect"],"mappings":"gKAgBA,MAAMA,EAAqB,EAAGC,aAAYC,YAAWC,UAASC,YAC1D,MAAOC,EAAkBC,GAAuBC,EAA4B,KACtEC,UAAEA,GAAcC,IAchBC,EAA2B,KACxBR,GAAaC,GAAWC,EAZtBO,EAAM,OAAA,CAAAC,MAAO,CAAEC,MAAO,WAAWC,SAAGN,EAAU,WAgBjDN,EAZGD,EAIA,GAmBX,OAJAc,GAAU,KACNT,EAAoBI,IAA2B,GAChD,CAACT,EAAYG,EAAOF,EAAWC,IAE3BE,CAAgB"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var s=require("notistack");module.exports=()=>{const{enqueueSnackbar:o,closeSnackbar:r}=s.useSnackbar(),a=(s,r,a=void 0)=>o(s,{autoHideDuration:a?.durationMs,persist:a?.persist,variant:r});return{dismissAllToasts:()=>{r()},dismissToast:s=>{r(s)},showDefaultToast:(s,o=void 0)=>a(s,"default",o),showSuccessToast:(s,o=void 0)=>a(s,"success",o),showErrorToast:(s,o=void 0)=>a(s,"error",o)}};
|
|
2
|
-
//# sourceMappingURL=useToasts.cjs.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useToasts.cjs.js","sources":["../../../src/components/custom-hooks/useToasts.tsx"],"sourcesContent":["import { useSnackbar, type SnackbarKey, type VariantType } from 'notistack';\n\n/**\n * Configuration options for toast notifications\n * @interface ToastOptions\n * @property {boolean} [persist] - If true, the toast will not auto-dismiss\n * @property {number} [durationMs] - Duration in milliseconds before the toast auto-dismisses\n */\nexport interface ToastOptions {\n /** If true, the toast will not auto-dismiss */\n persist?: boolean;\n /** Duration in milliseconds before the toast auto-dismisses */\n durationMs?: number;\n}\n\n/**\n * Type alias for toast notification keys\n * Used to uniquely identify toast notifications for dismissal\n */\nexport type ToastKey = SnackbarKey;\n\n/**\n * Interface defining the return value of the useToasts hook\n */\nexport interface UseToastsReturn {\n /** Dismisses all active toast notifications */\n dismissAllToasts: () => void;\n /** Dismisses a specific toast by its key */\n dismissToast: (key: string) => void;\n /** Shows a default toast notification */\n showDefaultToast: (message: string, options?: ToastOptions) => ToastKey;\n /** Shows a success toast notification */\n showSuccessToast: (message: string, options?: ToastOptions) => ToastKey;\n /** Shows an error toast notification */\n showErrorToast: (message: string, options?: ToastOptions) => ToastKey;\n}\n\n/**\n * Custom hook for managing toast notifications\n * Provides methods to show different types of toasts (default, success, error)\n * and dismiss them individually or all at once\n *\n * @example\n * ```tsx\n * const { showSuccessToast, showErrorToast, dismissAllToasts } = useToasts();\n *\n * // Show a success toast that auto-dismisses after 3 seconds\n * const toastKey = showSuccessToast('Operation successful', { durationMs: 3000 });\n *\n * // Show a persistent error toast\n * const errorToastKey = showErrorToast('Error occurred', { persist: true });\n *\n * // Later, dismiss a specific toast using its key\n * dismissToast(toastKey);\n *\n * // Or dismiss all toasts\n * dismissAllToasts();\n * ```\n */\nconst useToasts = (): UseToastsReturn => {\n const { enqueueSnackbar, closeSnackbar } = useSnackbar();\n\n /**\n * Dismisses all currently active toast notifications\n */\n const dismissAllToasts = () => {\n closeSnackbar();\n };\n\n /**\n * Dismisses a specific toast notification by its key\n * @param {string} key - Unique identifier of the toast to dismiss\n */\n const dismissToast = (key: string) => {\n closeSnackbar(key);\n };\n\n /**\n * Internal method to show a toast notification with specified variant and options\n * @param {string} message - The message to display in the toast\n * @param {VariantType} variant - The type of toast (default, success, error)\n * @param {ToastOptions} [options] - Configuration options for the toast\n * @returns {ToastKey} A unique key that can be used to dismiss this toast later\n */\n const showToast = (message: string, variant: VariantType, options: ToastOptions | undefined = undefined): ToastKey => {\n return enqueueSnackbar(message, {\n autoHideDuration: options?.durationMs,\n persist: options?.persist,\n variant,\n });\n };\n\n /**\n * Shows a default toast notification\n * @param {string} message - The message to display\n * @param {ToastOptions} [options] - Configuration options for the toast\n * @returns {ToastKey} A unique key that can be used to dismiss this toast later\n */\n const showDefaultToast = (message: string, options: ToastOptions | undefined = undefined): ToastKey => {\n return showToast(message, 'default', options);\n };\n\n /**\n * Shows a success toast notification\n * @param {string} message - The message to display\n * @param {ToastOptions} [options] - Configuration options for the toast\n * @returns {ToastKey} A unique key that can be used to dismiss this toast later\n */\n const showSuccessToast = (message: string, options: ToastOptions | undefined = undefined): ToastKey => {\n return showToast(message, 'success', options);\n };\n\n /**\n * Shows an error toast notification\n * @param {string} message - The message to display\n * @param {ToastOptions} [options] - Configuration options for the toast\n * @returns {ToastKey} A unique key that can be used to dismiss this toast later\n */\n const showErrorToast = (message: string, options: ToastOptions | undefined = undefined): ToastKey => {\n return showToast(message, 'error', options);\n };\n\n return { dismissAllToasts, dismissToast, showDefaultToast, showSuccessToast, showErrorToast };\n};\n\nexport default useToasts;\n"],"names":["enqueueSnackbar","closeSnackbar","useSnackbar","showToast","message","variant","options","undefined","autoHideDuration","durationMs","persist","dismissAllToasts","dismissToast","key","showDefaultToast","showSuccessToast","showErrorToast"],"mappings":"uDA2DkB,KACd,MAAMA,gBAAEA,EAAeC,cAAEA,GAAkBC,EAAWA,cAwBhDC,EAAY,CAACC,EAAiBC,EAAsBC,OAAoCC,IACnFP,EAAgBI,EAAS,CAC5BI,iBAAkBF,GAASG,WAC3BC,QAASJ,GAASI,QAClBL,YAkCR,MAAO,CAAEM,iBAzDgB,KACrBV,GAAe,EAwDQW,aAjDLC,IAClBZ,EAAcY,EAAI,EAgDmBC,iBAxBhB,CAACV,EAAiBE,OAAoCC,IACpEJ,EAAUC,EAAS,UAAWE,GAuBkBS,iBAdlC,CAACX,EAAiBE,OAAoCC,IACpEJ,EAAUC,EAAS,UAAWE,GAaoCU,eAJtD,CAACZ,EAAiBE,OAAoCC,IAClEJ,EAAUC,EAAS,QAASE,GAGsD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useToasts.js","sources":["../../../src/components/custom-hooks/useToasts.tsx"],"sourcesContent":["import { useSnackbar, type SnackbarKey, type VariantType } from 'notistack';\n\n/**\n * Configuration options for toast notifications\n * @interface ToastOptions\n * @property {boolean} [persist] - If true, the toast will not auto-dismiss\n * @property {number} [durationMs] - Duration in milliseconds before the toast auto-dismisses\n */\nexport interface ToastOptions {\n /** If true, the toast will not auto-dismiss */\n persist?: boolean;\n /** Duration in milliseconds before the toast auto-dismisses */\n durationMs?: number;\n}\n\n/**\n * Type alias for toast notification keys\n * Used to uniquely identify toast notifications for dismissal\n */\nexport type ToastKey = SnackbarKey;\n\n/**\n * Interface defining the return value of the useToasts hook\n */\nexport interface UseToastsReturn {\n /** Dismisses all active toast notifications */\n dismissAllToasts: () => void;\n /** Dismisses a specific toast by its key */\n dismissToast: (key: string) => void;\n /** Shows a default toast notification */\n showDefaultToast: (message: string, options?: ToastOptions) => ToastKey;\n /** Shows a success toast notification */\n showSuccessToast: (message: string, options?: ToastOptions) => ToastKey;\n /** Shows an error toast notification */\n showErrorToast: (message: string, options?: ToastOptions) => ToastKey;\n}\n\n/**\n * Custom hook for managing toast notifications\n * Provides methods to show different types of toasts (default, success, error)\n * and dismiss them individually or all at once\n *\n * @example\n * ```tsx\n * const { showSuccessToast, showErrorToast, dismissAllToasts } = useToasts();\n *\n * // Show a success toast that auto-dismisses after 3 seconds\n * const toastKey = showSuccessToast('Operation successful', { durationMs: 3000 });\n *\n * // Show a persistent error toast\n * const errorToastKey = showErrorToast('Error occurred', { persist: true });\n *\n * // Later, dismiss a specific toast using its key\n * dismissToast(toastKey);\n *\n * // Or dismiss all toasts\n * dismissAllToasts();\n * ```\n */\nconst useToasts = (): UseToastsReturn => {\n const { enqueueSnackbar, closeSnackbar } = useSnackbar();\n\n /**\n * Dismisses all currently active toast notifications\n */\n const dismissAllToasts = () => {\n closeSnackbar();\n };\n\n /**\n * Dismisses a specific toast notification by its key\n * @param {string} key - Unique identifier of the toast to dismiss\n */\n const dismissToast = (key: string) => {\n closeSnackbar(key);\n };\n\n /**\n * Internal method to show a toast notification with specified variant and options\n * @param {string} message - The message to display in the toast\n * @param {VariantType} variant - The type of toast (default, success, error)\n * @param {ToastOptions} [options] - Configuration options for the toast\n * @returns {ToastKey} A unique key that can be used to dismiss this toast later\n */\n const showToast = (message: string, variant: VariantType, options: ToastOptions | undefined = undefined): ToastKey => {\n return enqueueSnackbar(message, {\n autoHideDuration: options?.durationMs,\n persist: options?.persist,\n variant,\n });\n };\n\n /**\n * Shows a default toast notification\n * @param {string} message - The message to display\n * @param {ToastOptions} [options] - Configuration options for the toast\n * @returns {ToastKey} A unique key that can be used to dismiss this toast later\n */\n const showDefaultToast = (message: string, options: ToastOptions | undefined = undefined): ToastKey => {\n return showToast(message, 'default', options);\n };\n\n /**\n * Shows a success toast notification\n * @param {string} message - The message to display\n * @param {ToastOptions} [options] - Configuration options for the toast\n * @returns {ToastKey} A unique key that can be used to dismiss this toast later\n */\n const showSuccessToast = (message: string, options: ToastOptions | undefined = undefined): ToastKey => {\n return showToast(message, 'success', options);\n };\n\n /**\n * Shows an error toast notification\n * @param {string} message - The message to display\n * @param {ToastOptions} [options] - Configuration options for the toast\n * @returns {ToastKey} A unique key that can be used to dismiss this toast later\n */\n const showErrorToast = (message: string, options: ToastOptions | undefined = undefined): ToastKey => {\n return showToast(message, 'error', options);\n };\n\n return { dismissAllToasts, dismissToast, showDefaultToast, showSuccessToast, showErrorToast };\n};\n\nexport default useToasts;\n"],"names":["useToasts","enqueueSnackbar","closeSnackbar","useSnackbar","showToast","message","variant","options","undefined","autoHideDuration","durationMs","persist","dismissAllToasts","dismissToast","key","showDefaultToast","showSuccessToast","showErrorToast"],"mappings":"wCA2DM,MAAAA,EAAY,KACd,MAAMC,gBAAEA,EAAeC,cAAEA,GAAkBC,IAwBrCC,EAAY,CAACC,EAAiBC,EAAsBC,OAAoCC,IACnFP,EAAgBI,EAAS,CAC5BI,iBAAkBF,GAASG,WAC3BC,QAASJ,GAASI,QAClBL,YAkCR,MAAO,CAAEM,iBAzDgB,KACrBV,GAAe,EAwDQW,aAjDLC,IAClBZ,EAAcY,EAAI,EAgDmBC,iBAxBhB,CAACV,EAAiBE,OAAoCC,IACpEJ,EAAUC,EAAS,UAAWE,GAuBkBS,iBAdlC,CAACX,EAAiBE,OAAoCC,IACpEJ,EAAUC,EAAS,UAAWE,GAaoCU,eAJtD,CAACZ,EAAiBE,OAAoCC,IAClEJ,EAAUC,EAAS,QAASE,GAGsD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":["../../../src/components/genericUtilities/index.ts"],"sourcesContent":["import lodashDebounce from 'lodash.debounce';\n\n/**\n * Creates a debounced function that delays invoking the provided function until after `waitMs` milliseconds\n * have elapsed since the last time the debounced function was invoked.\n *\n * @param func - The function to debounce\n * @param waitMs - The number of milliseconds to delay\n * @returns A debounced version of the provided function\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const debounce = (func: (...args: any[]) => void, waitMs: number) => lodashDebounce(func, waitMs);\n"],"names":["func","waitMs","lodashDebounce"],"mappings":"+DAWwB,CAACA,EAAgCC,IAAmBC,EAAeF,EAAMC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/genericUtilities/index.ts"],"sourcesContent":["import lodashDebounce from 'lodash.debounce';\n\n/**\n * Creates a debounced function that delays invoking the provided function until after `waitMs` milliseconds\n * have elapsed since the last time the debounced function was invoked.\n *\n * @param func - The function to debounce\n * @param waitMs - The number of milliseconds to delay\n * @returns A debounced version of the provided function\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const debounce = (func: (...args: any[]) => void, waitMs: number) => lodashDebounce(func, waitMs);\n"],"names":["debounce","func","waitMs","lodashDebounce"],"mappings":"+BAWa,MAAAA,EAAW,CAACC,EAAgCC,IAAmBC,EAAeF,EAAMC"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var e=require("./themes/flipdishPublicTheme.cjs.js"),i=require("./ui/NotFoundPage/NotFoundPage.cjs.js"),r=require("./ui/FlipdishStaffContainer/FlipdishStaffContainer.cjs.js"),t=require("./ui/PageLayout/PageLayout.cjs.js"),s=require("./ui/PortalMock/PortalMock.cjs.js"),o=require("./ui/LazyComponent/LazyComponent.cjs.js"),c=require("./ui/Spacer/Spacer.cjs.js"),u=require("./ui/Chip/Chip.cjs.js"),a=require("./ui/Switch/Switch.cjs.js"),n=require("./ui/Tooltip/Tooltip.cjs.js"),d=require("./ui/Form/utilities/formValidation.cjs.js"),l=require("./ui/Form/GenericAutocompleteField.cjs.js"),p=require("./ui/Form/GenericFormContainer.cjs.js"),j=require("./ui/Form/GenericTextField.cjs.js"),x=require("./ui/Form/PaginatedAutocompleteField.cjs.js"),m=require("./ui/FlipdishLogoLoader/FlipdishLogoLoader.cjs.js"),T=require("./ui/GenericDatePickerField/GenericDatePickerField.cjs.js"),q=require("./ui/GenericDateTimePickerField/GenericDateTimePickerField.cjs.js"),F=require("./ui/GenericRadioButtons/GenericRadioButtons.cjs.js"),L=require("./ui/DateTimeLocalizationProvider/DateTimeLocalizationProvider.cjs.js"),G=require("./ui/GenericTable/GenericTable.cjs.js"),h=require("./ui/GenericTableBody/GenericTableBody.cjs.js"),g=require("./ui/GenericTableBodyRow/GenericTableBodyRow.cjs.js"),P=require("./ui/GenericTableTitle/GenericTableTitle.cjs.js"),k=require("./ui/ListItemLink/ListItemLink.cjs.js"),b=require("./ui/ListItemLinkButton/ListItemLinkButton.cjs.js"),I=require("./ui/NoResults/NoResults.cjs.js"),y=require("@mui/icons-material/Search"),f=require("@mui/icons-material/CalendarToday"),B=require("@mui/icons-material/AccessTime"),C=require("@mui/icons-material/Done"),R=require("./custom-hooks/useRenderValidText.cjs.js"),S=require("./custom-hooks/useMicroFrontendAttributes.cjs.js"),A=require("./custom-hooks/useToasts.cjs.js"),D=require("./renderUtilities/renderUtilities.cjs.js"),z=require("./genericUtilities/index.cjs.js"),v=require("../providers/ToastProvider.cjs.js");exports.flipdishPublicTheme=e,exports.NotFoundPage=i,exports.FlipdishStaffContainer=r,exports.PageLayout=t.default,exports.PortalMock=s,exports.LazyComponent=o,exports.Spacer=c,exports.Chip=u.default,exports.Switch=a,exports.Tooltip=n,exports.formikValidate=d.formikValidate,exports.GenericAutocompleteField=l,exports.GenericFormContainer=p,exports.GenericTextField=j,exports.PaginatedAutocompleteField=x,exports.FlipdishLogoLoader=m,exports.GenericDatePickerField=T,exports.GenericDateTimePickerField=q,exports.GenericRadioButtons=F,exports.DateTimeLocalizationProvider=L,exports.GenericTable=G,exports.GenericTableBody=h,exports.GenericTableBodyRow=g,exports.GenericTableTitle=P,exports.ListItemLink=k,exports.ListItemLinkButton=b.ListItemLinkButton,exports.NoResults=I,exports.SearchIcon=y,exports.CalendarTodayIcon=f,exports.AccessTimeIcon=B,exports.DoneIcon=C,exports.useRenderValidText=R,exports.useMicroFrontendAttributes=S,exports.useToasts=A,exports.getAppId=D.getAppId,exports.getBrandId=D.getBrandId,exports.getIsFlipdishStaff=D.getIsFlipdishStaff,exports.getMicroFrontendAttribute=D.getMicroFrontendAttribute,exports.getOrgId=D.getOrgId,exports.lazyWithRetry=D.lazyWithRetry,exports.debounce=z.debounce,exports.ToastProvider=v;
|
|
2
|
-
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
export { default as flipdishPublicTheme } from './themes/flipdishPublicTheme.js';
|
|
2
|
-
export { default as NotFoundPage } from './ui/NotFoundPage/NotFoundPage.js';
|
|
3
|
-
export { default as FlipdishStaffContainer } from './ui/FlipdishStaffContainer/FlipdishStaffContainer.js';
|
|
4
|
-
export { default as PageLayout } from './ui/PageLayout/PageLayout.js';
|
|
5
|
-
export { default as PortalMock } from './ui/PortalMock/PortalMock.js';
|
|
6
|
-
export { default as LazyComponent } from './ui/LazyComponent/LazyComponent.js';
|
|
7
|
-
export { default as Spacer } from './ui/Spacer/Spacer.js';
|
|
8
|
-
export { default as Chip } from './ui/Chip/Chip.js';
|
|
9
|
-
export { default as Switch } from './ui/Switch/Switch.js';
|
|
10
|
-
export { default as Tooltip } from './ui/Tooltip/Tooltip.js';
|
|
11
|
-
export { formikValidate } from './ui/Form/utilities/formValidation.js';
|
|
12
|
-
export { default as GenericAutocompleteField } from './ui/Form/GenericAutocompleteField.js';
|
|
13
|
-
export { default as GenericFormContainer } from './ui/Form/GenericFormContainer.js';
|
|
14
|
-
export { default as GenericTextField } from './ui/Form/GenericTextField.js';
|
|
15
|
-
export { default as PaginatedAutocompleteField } from './ui/Form/PaginatedAutocompleteField.js';
|
|
16
|
-
export { default as FlipdishLogoLoader } from './ui/FlipdishLogoLoader/FlipdishLogoLoader.js';
|
|
17
|
-
export { default as GenericDatePickerField } from './ui/GenericDatePickerField/GenericDatePickerField.js';
|
|
18
|
-
export { default as GenericDateTimePickerField } from './ui/GenericDateTimePickerField/GenericDateTimePickerField.js';
|
|
19
|
-
export { default as GenericRadioButtons } from './ui/GenericRadioButtons/GenericRadioButtons.js';
|
|
20
|
-
export { default as DateTimeLocalizationProvider } from './ui/DateTimeLocalizationProvider/DateTimeLocalizationProvider.js';
|
|
21
|
-
export { GenericTableColumns } from './ui/GenericTable/types.js';
|
|
22
|
-
export { default as GenericTable } from './ui/GenericTable/GenericTable.js';
|
|
23
|
-
export { default as GenericTableBody } from './ui/GenericTableBody/GenericTableBody.js';
|
|
24
|
-
export { default as GenericTableBodyRow } from './ui/GenericTableBodyRow/GenericTableBodyRow.js';
|
|
25
|
-
export { default as GenericTableTitle } from './ui/GenericTableTitle/GenericTableTitle.js';
|
|
26
|
-
export { default as ListItemLink } from './ui/ListItemLink/ListItemLink.js';
|
|
27
|
-
export { default as ListItemLinkButton } from './ui/ListItemLinkButton/ListItemLinkButton.js';
|
|
28
|
-
export { default as NoResults } from './ui/NoResults/NoResults.js';
|
|
29
|
-
export { default as SearchIcon } from '@mui/icons-material/Search';
|
|
30
|
-
export { default as CalendarTodayIcon } from '@mui/icons-material/CalendarToday';
|
|
31
|
-
export { default as AccessTimeIcon } from '@mui/icons-material/AccessTime';
|
|
32
|
-
export { default as DoneIcon } from '@mui/icons-material/Done';
|
|
33
|
-
export { default as useRenderValidText } from './custom-hooks/useRenderValidText.js';
|
|
34
|
-
export { default as useMicroFrontendAttributes } from './custom-hooks/useMicroFrontendAttributes.js';
|
|
35
|
-
export { default as useToasts } from './custom-hooks/useToasts.js';
|
|
36
|
-
export { getAppId, getBrandId, getIsFlipdishStaff, getMicroFrontendAttribute, getOrgId, lazyWithRetry } from './renderUtilities/renderUtilities.js';
|
|
37
|
-
export { debounce } from './genericUtilities/index.js';
|
|
38
|
-
export { default as ToastProvider } from '../providers/ToastProvider.js';
|
package/dist/components/index.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export{default as flipdishPublicTheme}from"./themes/flipdishPublicTheme.js";export{default as NotFoundPage}from"./ui/NotFoundPage/NotFoundPage.js";export{default as FlipdishStaffContainer}from"./ui/FlipdishStaffContainer/FlipdishStaffContainer.js";export{default as PageLayout}from"./ui/PageLayout/PageLayout.js";export{default as PortalMock}from"./ui/PortalMock/PortalMock.js";export{default as LazyComponent}from"./ui/LazyComponent/LazyComponent.js";export{default as Spacer}from"./ui/Spacer/Spacer.js";export{default as Chip}from"./ui/Chip/Chip.js";export{default as Switch}from"./ui/Switch/Switch.js";export{default as Tooltip}from"./ui/Tooltip/Tooltip.js";export{formikValidate}from"./ui/Form/utilities/formValidation.js";export{default as GenericAutocompleteField}from"./ui/Form/GenericAutocompleteField.js";export{default as GenericFormContainer}from"./ui/Form/GenericFormContainer.js";export{default as GenericTextField}from"./ui/Form/GenericTextField.js";export{default as PaginatedAutocompleteField}from"./ui/Form/PaginatedAutocompleteField.js";export{default as FlipdishLogoLoader}from"./ui/FlipdishLogoLoader/FlipdishLogoLoader.js";export{default as GenericDatePickerField}from"./ui/GenericDatePickerField/GenericDatePickerField.js";export{default as GenericDateTimePickerField}from"./ui/GenericDateTimePickerField/GenericDateTimePickerField.js";export{default as GenericRadioButtons}from"./ui/GenericRadioButtons/GenericRadioButtons.js";export{default as DateTimeLocalizationProvider}from"./ui/DateTimeLocalizationProvider/DateTimeLocalizationProvider.js";export{default as GenericTable}from"./ui/GenericTable/GenericTable.js";export{default as GenericTableBody}from"./ui/GenericTableBody/GenericTableBody.js";export{default as GenericTableBodyRow}from"./ui/GenericTableBodyRow/GenericTableBodyRow.js";export{default as GenericTableTitle}from"./ui/GenericTableTitle/GenericTableTitle.js";export{default as ListItemLink}from"./ui/ListItemLink/ListItemLink.js";export{ListItemLinkButton}from"./ui/ListItemLinkButton/ListItemLinkButton.js";export{default as NoResults}from"./ui/NoResults/NoResults.js";export{default as SearchIcon}from"@mui/icons-material/Search";export{default as CalendarTodayIcon}from"@mui/icons-material/CalendarToday";export{default as AccessTimeIcon}from"@mui/icons-material/AccessTime";export{default as DoneIcon}from"@mui/icons-material/Done";export{default as useRenderValidText}from"./custom-hooks/useRenderValidText.js";export{default as useMicroFrontendAttributes}from"./custom-hooks/useMicroFrontendAttributes.js";export{default as useToasts}from"./custom-hooks/useToasts.js";export{getAppId,getBrandId,getIsFlipdishStaff,getMicroFrontendAttribute,getOrgId,lazyWithRetry}from"./renderUtilities/renderUtilities.js";export{debounce}from"./genericUtilities/index.js";export{default as ToastProvider}from"../providers/ToastProvider.js";
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var e=require("react");const t=e=>{const t=document.getElementById("flipdish-micro-frontend");return t?.getAttribute(e)};exports.getAppId=()=>(void 0).VITE_APPID_OVERRIDE||t("data-appId"),exports.getBrandId=()=>(void 0).VITE_BRANDID_OVERRIDE||t("data-brandId"),exports.getIsFlipdishStaff=()=>{const e=(void 0).VITE_ISFLIPDISHSTAFFOVERRIDE||t("data-isFlipdishStaff");return"true"===e?.toString()},exports.getMicroFrontendAttribute=t,exports.getOrgId=()=>(void 0).VITE_ORGID_OVERRIDE||t("data-orgId"),exports.lazyWithRetry=t=>e.lazy((async()=>{const e=JSON.parse(window.sessionStorage.getItem("page-has-been-force-refreshed")||"false");try{const e=await t();return window.sessionStorage.setItem("page-has-been-force-refreshed","false"),e}catch(t){if(!e)return window.sessionStorage.setItem("page-has-been-force-refreshed","true"),window.location.reload();throw t}}));
|
|
2
|
-
//# sourceMappingURL=renderUtilities.cjs.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"renderUtilities.cjs.js","sources":["../../../src/components/renderUtilities/renderUtilities.ts"],"sourcesContent":["import { lazy } from 'react';\n\nexport const getMicroFrontendAttribute = (key: string): string | null => {\n const microFrontendDiv = document.getElementById('flipdish-micro-frontend');\n return microFrontendDiv?.getAttribute(key);\n};\n\n/**\n * Retrieves the AppId.\n *\n * Attempts to get the value from the environment variable `VITE_APPID_OVERRIDE`.\n * If the environment variable is not set, it falls back to retrieving from a micro frontend attribute `data-appId`.\n *\n * @warning Your component will not re-render if the value changes. Use 'useMicroFrontendAttributes' custom hook instead if you care about reactivity.\n */\nexport const getAppId = (): string | null => {\n return import.meta.env.VITE_APPID_OVERRIDE || getMicroFrontendAttribute('data-appId');\n};\n\n/**\n * Retrieves the OrgId.\n *\n * Attempts to get the value from the environment variable `VITE_ORGID_OVERRIDE`.\n * If the environment variable is not set, it falls back to retrieving from a micro frontend attribute `data-orgId`.\n *\n * @warning Your component will not re-render if the value changes. Use 'useMicroFrontendAttributes' custom hook instead if you care about reactivity.\n */\nexport const getOrgId = (): string | null => {\n return import.meta.env.VITE_ORGID_OVERRIDE || getMicroFrontendAttribute('data-orgId');\n};\n\n/**\n * Retrieves the BrandId.\n *\n * Attempts to get the value from the environment variable `VITE_BRANDID_OVERRIDE`.\n * If the environment variable is not set, it falls back to retrieving from a micro frontend attribute `data-brandId`.\n *\n * @warning Your component will not re-render if the value changes. Use 'useMicroFrontendAttributes' custom hook instead if you care about reactivity.\n */\nexport const getBrandId = (): string | null => {\n return import.meta.env.VITE_BRANDID_OVERRIDE || getMicroFrontendAttribute('data-brandId');\n};\n\n/**\n * Retrieves the isFlipdishStaff attribute.\n *\n * Attempts to get the value from the environment variable `VITE_ISFLIPDISHSTAFFOVERRIDE`.\n * If the environment variable is not set, it falls back to retrieving from a micro frontend attribute `data-isFlipdishStaff`.\n *\n * @warning Your component will not re-render if the value changes. Use 'useMicroFrontendAttributes' custom hook instead if you care about reactivity.\n */\nexport const getIsFlipdishStaff = (): boolean => {\n const stringValue = import.meta.env.VITE_ISFLIPDISHSTAFFOVERRIDE || getMicroFrontendAttribute('data-isFlipdishStaff');\n return stringValue?.toString() === 'true';\n};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const lazyWithRetry = (componentImport: () => any) =>\n lazy(async () => {\n const pageHasAlreadyBeenForceRefreshed = JSON.parse(window.sessionStorage.getItem('page-has-been-force-refreshed') || 'false');\n\n try {\n const component = await componentImport();\n window.sessionStorage.setItem('page-has-been-force-refreshed', 'false');\n\n return component;\n } catch (error) {\n if (!pageHasAlreadyBeenForceRefreshed) {\n // Assuming that the user is not on the latest version of the application.\n // Let's refresh the page immediately.\n window.sessionStorage.setItem('page-has-been-force-refreshed', 'true');\n return window.location.reload();\n }\n\n // The page has already been reloaded\n // Assuming that user is already using the latest version of the application.\n // Let's let the application crash and raise the error.\n throw error;\n }\n });\n"],"names":["getMicroFrontendAttribute","key","microFrontendDiv","document","getElementById","getAttribute","undefined","VITE_APPID_OVERRIDE","VITE_BRANDID_OVERRIDE","stringValue","VITE_ISFLIPDISHSTAFFOVERRIDE","toString","VITE_ORGID_OVERRIDE","componentImport","lazy","async","pageHasAlreadyBeenForceRefreshed","JSON","parse","window","sessionStorage","getItem","component","setItem","error","location","reload"],"mappings":"oCAEa,MAAAA,EAA6BC,IACtC,MAAMC,EAAmBC,SAASC,eAAe,2BACjD,OAAOF,GAAkBG,aAAaJ,EAAI,mBAWtB,UACbK,GAAgBC,qBAAuBP,EAA0B,iCAuBlD,UACfM,GAAgBE,uBAAyBR,EAA0B,2CAW5C,KAC9B,MAAMS,QAAcH,GAAgBI,8BAAgCV,EAA0B,wBAC9F,MAAmC,SAA5BS,GAAaE,UAAqB,uDA1BrB,UACbL,GAAgBM,qBAAuBZ,EAA0B,oCA6B9Ca,GAC1BC,EAAAA,MAAKC,UACD,MAAMC,EAAmCC,KAAKC,MAAMC,OAAOC,eAAeC,QAAQ,kCAAoC,SAEtH,IACI,MAAMC,QAAkBT,IAGxB,OAFAM,OAAOC,eAAeG,QAAQ,gCAAiC,SAExDD,CACV,CAAC,MAAOE,GACL,IAAKR,EAID,OADAG,OAAOC,eAAeG,QAAQ,gCAAiC,QACxDJ,OAAOM,SAASC,SAM3B,MAAMF,CACT"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{lazy as e}from"react";const t=e=>{const t=document.getElementById("flipdish-micro-frontend");return t?.getAttribute(e)},r=()=>import.meta.env.VITE_APPID_OVERRIDE||t("data-appId"),a=()=>import.meta.env.VITE_ORGID_OVERRIDE||t("data-orgId"),o=()=>import.meta.env.VITE_BRANDID_OVERRIDE||t("data-brandId"),n=()=>{const e=import.meta.env.VITE_ISFLIPDISHSTAFFOVERRIDE||t("data-isFlipdishStaff");return"true"===e?.toString()},s=t=>e((async()=>{const e=JSON.parse(window.sessionStorage.getItem("page-has-been-force-refreshed")||"false");try{const e=await t();return window.sessionStorage.setItem("page-has-been-force-refreshed","false"),e}catch(t){if(!e)return window.sessionStorage.setItem("page-has-been-force-refreshed","true"),window.location.reload();throw t}}));export{r as getAppId,o as getBrandId,n as getIsFlipdishStaff,t as getMicroFrontendAttribute,a as getOrgId,s as lazyWithRetry};
|
|
2
|
-
//# sourceMappingURL=renderUtilities.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"renderUtilities.js","sources":["../../../src/components/renderUtilities/renderUtilities.ts"],"sourcesContent":["import { lazy } from 'react';\n\nexport const getMicroFrontendAttribute = (key: string): string | null => {\n const microFrontendDiv = document.getElementById('flipdish-micro-frontend');\n return microFrontendDiv?.getAttribute(key);\n};\n\n/**\n * Retrieves the AppId.\n *\n * Attempts to get the value from the environment variable `VITE_APPID_OVERRIDE`.\n * If the environment variable is not set, it falls back to retrieving from a micro frontend attribute `data-appId`.\n *\n * @warning Your component will not re-render if the value changes. Use 'useMicroFrontendAttributes' custom hook instead if you care about reactivity.\n */\nexport const getAppId = (): string | null => {\n return import.meta.env.VITE_APPID_OVERRIDE || getMicroFrontendAttribute('data-appId');\n};\n\n/**\n * Retrieves the OrgId.\n *\n * Attempts to get the value from the environment variable `VITE_ORGID_OVERRIDE`.\n * If the environment variable is not set, it falls back to retrieving from a micro frontend attribute `data-orgId`.\n *\n * @warning Your component will not re-render if the value changes. Use 'useMicroFrontendAttributes' custom hook instead if you care about reactivity.\n */\nexport const getOrgId = (): string | null => {\n return import.meta.env.VITE_ORGID_OVERRIDE || getMicroFrontendAttribute('data-orgId');\n};\n\n/**\n * Retrieves the BrandId.\n *\n * Attempts to get the value from the environment variable `VITE_BRANDID_OVERRIDE`.\n * If the environment variable is not set, it falls back to retrieving from a micro frontend attribute `data-brandId`.\n *\n * @warning Your component will not re-render if the value changes. Use 'useMicroFrontendAttributes' custom hook instead if you care about reactivity.\n */\nexport const getBrandId = (): string | null => {\n return import.meta.env.VITE_BRANDID_OVERRIDE || getMicroFrontendAttribute('data-brandId');\n};\n\n/**\n * Retrieves the isFlipdishStaff attribute.\n *\n * Attempts to get the value from the environment variable `VITE_ISFLIPDISHSTAFFOVERRIDE`.\n * If the environment variable is not set, it falls back to retrieving from a micro frontend attribute `data-isFlipdishStaff`.\n *\n * @warning Your component will not re-render if the value changes. Use 'useMicroFrontendAttributes' custom hook instead if you care about reactivity.\n */\nexport const getIsFlipdishStaff = (): boolean => {\n const stringValue = import.meta.env.VITE_ISFLIPDISHSTAFFOVERRIDE || getMicroFrontendAttribute('data-isFlipdishStaff');\n return stringValue?.toString() === 'true';\n};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const lazyWithRetry = (componentImport: () => any) =>\n lazy(async () => {\n const pageHasAlreadyBeenForceRefreshed = JSON.parse(window.sessionStorage.getItem('page-has-been-force-refreshed') || 'false');\n\n try {\n const component = await componentImport();\n window.sessionStorage.setItem('page-has-been-force-refreshed', 'false');\n\n return component;\n } catch (error) {\n if (!pageHasAlreadyBeenForceRefreshed) {\n // Assuming that the user is not on the latest version of the application.\n // Let's refresh the page immediately.\n window.sessionStorage.setItem('page-has-been-force-refreshed', 'true');\n return window.location.reload();\n }\n\n // The page has already been reloaded\n // Assuming that user is already using the latest version of the application.\n // Let's let the application crash and raise the error.\n throw error;\n }\n });\n"],"names":["getMicroFrontendAttribute","key","microFrontendDiv","document","getElementById","getAttribute","getAppId","env","VITE_APPID_OVERRIDE","getOrgId","VITE_ORGID_OVERRIDE","getBrandId","VITE_BRANDID_OVERRIDE","getIsFlipdishStaff","stringValue","VITE_ISFLIPDISHSTAFFOVERRIDE","toString","lazyWithRetry","componentImport","lazy","async","pageHasAlreadyBeenForceRefreshed","JSON","parse","window","sessionStorage","getItem","component","setItem","error","location","reload"],"mappings":"6BAEa,MAAAA,EAA6BC,IACtC,MAAMC,EAAmBC,SAASC,eAAe,2BACjD,OAAOF,GAAkBG,aAAaJ,EAAI,EAWjCK,EAAW,gBACDC,IAAIC,qBAAuBR,EAA0B,cAW/DS,EAAW,gBACDF,IAAIG,qBAAuBV,EAA0B,cAW/DW,EAAa,gBACHJ,IAAIK,uBAAyBZ,EAA0B,gBAWjEa,EAAqB,KAC9B,MAAMC,cAA0BP,IAAIQ,8BAAgCf,EAA0B,wBAC9F,MAAmC,SAA5Bc,GAAaE,UAAqB,EAIhCC,EAAiBC,GAC1BC,GAAKC,UACD,MAAMC,EAAmCC,KAAKC,MAAMC,OAAOC,eAAeC,QAAQ,kCAAoC,SAEtH,IACI,MAAMC,QAAkBT,IAGxB,OAFAM,OAAOC,eAAeG,QAAQ,gCAAiC,SAExDD,CACV,CAAC,MAAOE,GACL,IAAKR,EAID,OADAG,OAAOC,eAAeG,QAAQ,gCAAiC,QACxDJ,OAAOM,SAASC,SAM3B,MAAMF,CACT"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";require("@mui/material/styles");var e=require("@mui/material/styles/createTheme");const o=e({typography:{body1:{fontFamily:"'Roboto', sans-serif"},body2:{fontFamily:"'Roboto', sans-serif"},h1:{fontFamily:"clarendon-text-pro,Domine,serif"},h2:{fontFamily:"clarendon-text-pro,Domine,serif"},h3:{fontFamily:"clarendon-text-pro,Domine,serif"},h4:{fontFamily:"clarendon-text-pro,Domine,serif"},h5:{fontFamily:"clarendon-text-pro,Domine,serif"},h6:{fontFamily:"clarendon-text-pro,Domine,serif"}},palette:{success:{main:"#20C26E",dark:"#137442",light:"#D2F3E2"},error:{main:"#CA0030",dark:"#79001D",light:"#FADBE2"},warning:{main:"#FFBC2C",dark:"#FF7A00",light:"#FFF2D5"}}}),t=e(o,{palette:{black:o.palette.augmentColor({color:{main:"#000000"},name:"black"}),white:o.palette.augmentColor({color:{main:"#ffffff"},name:"white"}),flippyBlue:o.palette.augmentColor({color:{main:"#0b75d7",light:"#e3f2fe"},name:"flippyBlue"}),freezerBurn:o.palette.augmentColor({color:{main:"#a5e2f6"},name:"freezerBurn"}),spricyCarrot:o.palette.augmentColor({color:{main:"#f7742b"},name:"spricyCarrot"}),pebble:o.palette.augmentColor({color:{main:"#eeebe3"},name:"pebble"}),donutPanic:o.palette.augmentColor({color:{main:"#ffbae4"},name:"donutPanic"}),eletricLime:o.palette.augmentColor({color:{main:"#cff27d"},name:"eletricLime"}),pending:o.palette.augmentColor({color:{main:"#DEACFA",dark:"#A56AC6",light:"#FCF7FE"},name:"pending"}),alternateBackground:o.palette.augmentColor({color:{main:"#F7F7F7"},name:"alternateBackground"})}});var r=e(t,{palette:{primary:{main:t.palette.flippyBlue.main},secondary:{main:t.palette.spricyCarrot.main}},shape:{borderRadius:"4px"},components:{MuiButton:{styleOverrides:{root:{padding:"12px 24px",textTransform:"none"}}},MuiCard:{styleOverrides:{root:{boxShadow:"none",borderWidth:"1px",borderStyle:"solid",borderColor:t.palette.divider}}},MuiChip:{styleOverrides:{root:{fontWeight:"bold",paddingLeft:"6px",paddingRight:"6px"}}},MuiListItemButton:{styleOverrides:{root:{"&:hover":{backgroundColor:"#eaf2ff"},"&:not(:last-child)":{borderBottom:`1px solid ${t.palette.divider}`}}}},MuiTableRow:{styleOverrides:{root:{"&.MuiTableRow-hover:hover":{backgroundColor:t.palette.flippyBlue.light,cursor:"pointer"}}}}}});module.exports=r;
|
|
2
|
-
//# sourceMappingURL=flipdishPublicTheme.cjs.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"flipdishPublicTheme.cjs.js","sources":["../../../src/components/themes/flipdishPublicTheme.ts"],"sourcesContent":["import { type Breakpoint } from '@mui/material/styles';\nimport createTheme, { type ThemeOptions } from '@mui/material/styles/createTheme';\n\n// Colours and fonts as per our brand guidelines\nconst fontTheme = createTheme({\n typography: {\n body1: {\n fontFamily: \"'Roboto', sans-serif\",\n },\n body2: {\n fontFamily: \"'Roboto', sans-serif\",\n },\n h1: {\n fontFamily: 'clarendon-text-pro,Domine,serif',\n },\n h2: {\n fontFamily: 'clarendon-text-pro,Domine,serif',\n },\n h3: {\n fontFamily: 'clarendon-text-pro,Domine,serif',\n },\n h4: {\n fontFamily: 'clarendon-text-pro,Domine,serif',\n },\n h5: {\n fontFamily: 'clarendon-text-pro,Domine,serif',\n },\n h6: {\n fontFamily: 'clarendon-text-pro,Domine,serif',\n },\n },\n palette: {\n success: {\n main: '#20C26E',\n dark: '#137442',\n light: '#D2F3E2',\n },\n error: {\n main: '#CA0030',\n dark: '#79001D',\n light: '#FADBE2',\n },\n warning: {\n main: '#FFBC2C',\n dark: '#FF7A00',\n light: '#FFF2D5',\n },\n },\n});\n\nconst theme = createTheme(fontTheme as ThemeOptions, {\n palette: {\n // Primary\n black: fontTheme.palette.augmentColor({\n color: {\n main: '#000000',\n },\n name: 'black',\n }),\n white: fontTheme.palette.augmentColor({\n color: {\n main: '#ffffff',\n },\n name: 'white',\n }),\n flippyBlue: fontTheme.palette.augmentColor({\n color: {\n main: '#0b75d7',\n light: '#e3f2fe',\n },\n name: 'flippyBlue',\n }),\n // Core\n freezerBurn: fontTheme.palette.augmentColor({\n color: {\n main: '#a5e2f6',\n },\n name: 'freezerBurn',\n }),\n spricyCarrot: fontTheme.palette.augmentColor({\n color: {\n main: '#f7742b',\n },\n name: 'spricyCarrot',\n }),\n pebble: fontTheme.palette.augmentColor({\n color: {\n main: '#eeebe3',\n },\n name: 'pebble',\n }),\n // Secondary\n donutPanic: fontTheme.palette.augmentColor({\n color: {\n main: '#ffbae4',\n },\n name: 'donutPanic',\n }),\n eletricLime: fontTheme.palette.augmentColor({\n color: {\n main: '#cff27d',\n },\n name: 'eletricLime',\n }),\n pending: fontTheme.palette.augmentColor({\n color: {\n main: '#DEACFA',\n dark: '#A56AC6',\n light: '#FCF7FE',\n },\n name: 'pending',\n }),\n alternateBackground: fontTheme.palette.augmentColor({\n color: {\n main: '#F7F7F7',\n },\n name: 'alternateBackground',\n }),\n },\n});\n\nexport default createTheme(theme as ThemeOptions, {\n palette: {\n primary: {\n main: theme.palette.flippyBlue.main,\n },\n secondary: {\n main: theme.palette.spricyCarrot.main,\n },\n },\n shape: {\n borderRadius: '4px',\n },\n components: {\n MuiButton: {\n styleOverrides: {\n root: {\n padding: '12px 24px',\n textTransform: 'none',\n },\n },\n },\n MuiCard: {\n styleOverrides: {\n root: {\n boxShadow: 'none',\n borderWidth: '1px',\n borderStyle: 'solid',\n borderColor: theme.palette.divider,\n },\n },\n },\n MuiChip: {\n styleOverrides: {\n root: {\n fontWeight: 'bold',\n paddingLeft: '6px',\n paddingRight: '6px',\n },\n },\n },\n MuiListItemButton: {\n styleOverrides: {\n root: {\n '&:hover': {\n backgroundColor: '#eaf2ff',\n },\n '&:not(:last-child)': {\n borderBottom: `1px solid ${theme.palette.divider}`,\n },\n },\n },\n },\n MuiTableRow: {\n styleOverrides: {\n root: {\n '&.MuiTableRow-hover:hover': {\n backgroundColor: theme.palette.flippyBlue.light,\n cursor: 'pointer',\n },\n },\n },\n },\n },\n});\n\ndeclare module '@mui/material/styles' {\n interface Palette {\n black: Palette['primary'];\n white: Palette['primary'];\n flippyBlue: Palette['primary'];\n freezerBurn: Palette['primary'];\n spricyCarrot: Palette['primary'];\n pebble: Palette['primary'];\n donutPanic: Palette['primary'];\n eletricLime: Palette['primary'];\n pending: Palette['primary'];\n alternateBackground: Palette['primary'];\n }\n interface Theme {\n breakpoints: {\n up: (key: number | Breakpoint) => string;\n down: (key: number | Breakpoint) => string;\n only: (key: number | Breakpoint) => string;\n };\n }\n}\n"],"names":["fontTheme","createTheme","typography","body1","fontFamily","body2","h1","h2","h3","h4","h5","h6","palette","success","main","dark","light","error","warning","theme","black","augmentColor","color","name","white","flippyBlue","freezerBurn","spricyCarrot","pebble","donutPanic","eletricLime","pending","alternateBackground","flipdishPublicTheme","primary","secondary","shape","borderRadius","components","MuiButton","styleOverrides","root","padding","textTransform","MuiCard","boxShadow","borderWidth","borderStyle","borderColor","divider","MuiChip","fontWeight","paddingLeft","paddingRight","MuiListItemButton","backgroundColor","borderBottom","MuiTableRow","cursor"],"mappings":"+FAIA,MAAMA,EAAYC,EAAY,CAC1BC,WAAY,CACRC,MAAO,CACHC,WAAY,wBAEhBC,MAAO,CACHD,WAAY,wBAEhBE,GAAI,CACAF,WAAY,mCAEhBG,GAAI,CACAH,WAAY,mCAEhBI,GAAI,CACAJ,WAAY,mCAEhBK,GAAI,CACAL,WAAY,mCAEhBM,GAAI,CACAN,WAAY,mCAEhBO,GAAI,CACAP,WAAY,oCAGpBQ,QAAS,CACLC,QAAS,CACLC,KAAM,UACNC,KAAM,UACNC,MAAO,WAEXC,MAAO,CACHH,KAAM,UACNC,KAAM,UACNC,MAAO,WAEXE,QAAS,CACLJ,KAAM,UACNC,KAAM,UACNC,MAAO,cAKbG,EAAQlB,EAAYD,EAA2B,CACjDY,QAAS,CAELQ,MAAOpB,EAAUY,QAAQS,aAAa,CAClCC,MAAO,CACHR,KAAM,WAEVS,KAAM,UAEVC,MAAOxB,EAAUY,QAAQS,aAAa,CAClCC,MAAO,CACHR,KAAM,WAEVS,KAAM,UAEVE,WAAYzB,EAAUY,QAAQS,aAAa,CACvCC,MAAO,CACHR,KAAM,UACNE,MAAO,WAEXO,KAAM,eAGVG,YAAa1B,EAAUY,QAAQS,aAAa,CACxCC,MAAO,CACHR,KAAM,WAEVS,KAAM,gBAEVI,aAAc3B,EAAUY,QAAQS,aAAa,CACzCC,MAAO,CACHR,KAAM,WAEVS,KAAM,iBAEVK,OAAQ5B,EAAUY,QAAQS,aAAa,CACnCC,MAAO,CACHR,KAAM,WAEVS,KAAM,WAGVM,WAAY7B,EAAUY,QAAQS,aAAa,CACvCC,MAAO,CACHR,KAAM,WAEVS,KAAM,eAEVO,YAAa9B,EAAUY,QAAQS,aAAa,CACxCC,MAAO,CACHR,KAAM,WAEVS,KAAM,gBAEVQ,QAAS/B,EAAUY,QAAQS,aAAa,CACpCC,MAAO,CACHR,KAAM,UACNC,KAAM,UACNC,MAAO,WAEXO,KAAM,YAEVS,oBAAqBhC,EAAUY,QAAQS,aAAa,CAChDC,MAAO,CACHR,KAAM,WAEVS,KAAM,2BAKlB,IAAeU,EAAAhC,EAAYkB,EAAuB,CAC9CP,QAAS,CACLsB,QAAS,CACLpB,KAAMK,EAAMP,QAAQa,WAAWX,MAEnCqB,UAAW,CACPrB,KAAMK,EAAMP,QAAQe,aAAab,OAGzCsB,MAAO,CACHC,aAAc,OAElBC,WAAY,CACRC,UAAW,CACPC,eAAgB,CACZC,KAAM,CACFC,QAAS,YACTC,cAAe,UAI3BC,QAAS,CACLJ,eAAgB,CACZC,KAAM,CACFI,UAAW,OACXC,YAAa,MACbC,YAAa,QACbC,YAAa7B,EAAMP,QAAQqC,WAIvCC,QAAS,CACLV,eAAgB,CACZC,KAAM,CACFU,WAAY,OACZC,YAAa,MACbC,aAAc,SAI1BC,kBAAmB,CACfd,eAAgB,CACZC,KAAM,CACF,UAAW,CACPc,gBAAiB,WAErB,qBAAsB,CAClBC,aAAc,aAAarC,EAAMP,QAAQqC,cAKzDQ,YAAa,CACTjB,eAAgB,CACZC,KAAM,CACF,4BAA6B,CACzBc,gBAAiBpC,EAAMP,QAAQa,WAAWT,MAC1C0C,OAAQ"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import * as _mui_material_styles from '@mui/material/styles';
|
|
2
|
-
import { Breakpoint } from '@mui/material/styles';
|
|
3
|
-
|
|
4
|
-
declare const _default: _mui_material_styles.Theme;
|
|
5
|
-
|
|
6
|
-
declare module '@mui/material/styles' {
|
|
7
|
-
interface Palette {
|
|
8
|
-
black: Palette['primary'];
|
|
9
|
-
white: Palette['primary'];
|
|
10
|
-
flippyBlue: Palette['primary'];
|
|
11
|
-
freezerBurn: Palette['primary'];
|
|
12
|
-
spricyCarrot: Palette['primary'];
|
|
13
|
-
pebble: Palette['primary'];
|
|
14
|
-
donutPanic: Palette['primary'];
|
|
15
|
-
eletricLime: Palette['primary'];
|
|
16
|
-
pending: Palette['primary'];
|
|
17
|
-
alternateBackground: Palette['primary'];
|
|
18
|
-
}
|
|
19
|
-
interface Theme {
|
|
20
|
-
breakpoints: {
|
|
21
|
-
up: (key: number | Breakpoint) => string;
|
|
22
|
-
down: (key: number | Breakpoint) => string;
|
|
23
|
-
only: (key: number | Breakpoint) => string;
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export { _default as default };
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import"@mui/material/styles";import e from"@mui/material/styles/createTheme";const o=e({typography:{body1:{fontFamily:"'Roboto', sans-serif"},body2:{fontFamily:"'Roboto', sans-serif"},h1:{fontFamily:"clarendon-text-pro,Domine,serif"},h2:{fontFamily:"clarendon-text-pro,Domine,serif"},h3:{fontFamily:"clarendon-text-pro,Domine,serif"},h4:{fontFamily:"clarendon-text-pro,Domine,serif"},h5:{fontFamily:"clarendon-text-pro,Domine,serif"},h6:{fontFamily:"clarendon-text-pro,Domine,serif"}},palette:{success:{main:"#20C26E",dark:"#137442",light:"#D2F3E2"},error:{main:"#CA0030",dark:"#79001D",light:"#FADBE2"},warning:{main:"#FFBC2C",dark:"#FF7A00",light:"#FFF2D5"}}}),t=e(o,{palette:{black:o.palette.augmentColor({color:{main:"#000000"},name:"black"}),white:o.palette.augmentColor({color:{main:"#ffffff"},name:"white"}),flippyBlue:o.palette.augmentColor({color:{main:"#0b75d7",light:"#e3f2fe"},name:"flippyBlue"}),freezerBurn:o.palette.augmentColor({color:{main:"#a5e2f6"},name:"freezerBurn"}),spricyCarrot:o.palette.augmentColor({color:{main:"#f7742b"},name:"spricyCarrot"}),pebble:o.palette.augmentColor({color:{main:"#eeebe3"},name:"pebble"}),donutPanic:o.palette.augmentColor({color:{main:"#ffbae4"},name:"donutPanic"}),eletricLime:o.palette.augmentColor({color:{main:"#cff27d"},name:"eletricLime"}),pending:o.palette.augmentColor({color:{main:"#DEACFA",dark:"#A56AC6",light:"#FCF7FE"},name:"pending"}),alternateBackground:o.palette.augmentColor({color:{main:"#F7F7F7"},name:"alternateBackground"})}});var r=e(t,{palette:{primary:{main:t.palette.flippyBlue.main},secondary:{main:t.palette.spricyCarrot.main}},shape:{borderRadius:"4px"},components:{MuiButton:{styleOverrides:{root:{padding:"12px 24px",textTransform:"none"}}},MuiCard:{styleOverrides:{root:{boxShadow:"none",borderWidth:"1px",borderStyle:"solid",borderColor:t.palette.divider}}},MuiChip:{styleOverrides:{root:{fontWeight:"bold",paddingLeft:"6px",paddingRight:"6px"}}},MuiListItemButton:{styleOverrides:{root:{"&:hover":{backgroundColor:"#eaf2ff"},"&:not(:last-child)":{borderBottom:`1px solid ${t.palette.divider}`}}}},MuiTableRow:{styleOverrides:{root:{"&.MuiTableRow-hover:hover":{backgroundColor:t.palette.flippyBlue.light,cursor:"pointer"}}}}}});export{r as default};
|
|
2
|
-
//# sourceMappingURL=flipdishPublicTheme.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"flipdishPublicTheme.js","sources":["../../../src/components/themes/flipdishPublicTheme.ts"],"sourcesContent":["import { type Breakpoint } from '@mui/material/styles';\nimport createTheme, { type ThemeOptions } from '@mui/material/styles/createTheme';\n\n// Colours and fonts as per our brand guidelines\nconst fontTheme = createTheme({\n typography: {\n body1: {\n fontFamily: \"'Roboto', sans-serif\",\n },\n body2: {\n fontFamily: \"'Roboto', sans-serif\",\n },\n h1: {\n fontFamily: 'clarendon-text-pro,Domine,serif',\n },\n h2: {\n fontFamily: 'clarendon-text-pro,Domine,serif',\n },\n h3: {\n fontFamily: 'clarendon-text-pro,Domine,serif',\n },\n h4: {\n fontFamily: 'clarendon-text-pro,Domine,serif',\n },\n h5: {\n fontFamily: 'clarendon-text-pro,Domine,serif',\n },\n h6: {\n fontFamily: 'clarendon-text-pro,Domine,serif',\n },\n },\n palette: {\n success: {\n main: '#20C26E',\n dark: '#137442',\n light: '#D2F3E2',\n },\n error: {\n main: '#CA0030',\n dark: '#79001D',\n light: '#FADBE2',\n },\n warning: {\n main: '#FFBC2C',\n dark: '#FF7A00',\n light: '#FFF2D5',\n },\n },\n});\n\nconst theme = createTheme(fontTheme as ThemeOptions, {\n palette: {\n // Primary\n black: fontTheme.palette.augmentColor({\n color: {\n main: '#000000',\n },\n name: 'black',\n }),\n white: fontTheme.palette.augmentColor({\n color: {\n main: '#ffffff',\n },\n name: 'white',\n }),\n flippyBlue: fontTheme.palette.augmentColor({\n color: {\n main: '#0b75d7',\n light: '#e3f2fe',\n },\n name: 'flippyBlue',\n }),\n // Core\n freezerBurn: fontTheme.palette.augmentColor({\n color: {\n main: '#a5e2f6',\n },\n name: 'freezerBurn',\n }),\n spricyCarrot: fontTheme.palette.augmentColor({\n color: {\n main: '#f7742b',\n },\n name: 'spricyCarrot',\n }),\n pebble: fontTheme.palette.augmentColor({\n color: {\n main: '#eeebe3',\n },\n name: 'pebble',\n }),\n // Secondary\n donutPanic: fontTheme.palette.augmentColor({\n color: {\n main: '#ffbae4',\n },\n name: 'donutPanic',\n }),\n eletricLime: fontTheme.palette.augmentColor({\n color: {\n main: '#cff27d',\n },\n name: 'eletricLime',\n }),\n pending: fontTheme.palette.augmentColor({\n color: {\n main: '#DEACFA',\n dark: '#A56AC6',\n light: '#FCF7FE',\n },\n name: 'pending',\n }),\n alternateBackground: fontTheme.palette.augmentColor({\n color: {\n main: '#F7F7F7',\n },\n name: 'alternateBackground',\n }),\n },\n});\n\nexport default createTheme(theme as ThemeOptions, {\n palette: {\n primary: {\n main: theme.palette.flippyBlue.main,\n },\n secondary: {\n main: theme.palette.spricyCarrot.main,\n },\n },\n shape: {\n borderRadius: '4px',\n },\n components: {\n MuiButton: {\n styleOverrides: {\n root: {\n padding: '12px 24px',\n textTransform: 'none',\n },\n },\n },\n MuiCard: {\n styleOverrides: {\n root: {\n boxShadow: 'none',\n borderWidth: '1px',\n borderStyle: 'solid',\n borderColor: theme.palette.divider,\n },\n },\n },\n MuiChip: {\n styleOverrides: {\n root: {\n fontWeight: 'bold',\n paddingLeft: '6px',\n paddingRight: '6px',\n },\n },\n },\n MuiListItemButton: {\n styleOverrides: {\n root: {\n '&:hover': {\n backgroundColor: '#eaf2ff',\n },\n '&:not(:last-child)': {\n borderBottom: `1px solid ${theme.palette.divider}`,\n },\n },\n },\n },\n MuiTableRow: {\n styleOverrides: {\n root: {\n '&.MuiTableRow-hover:hover': {\n backgroundColor: theme.palette.flippyBlue.light,\n cursor: 'pointer',\n },\n },\n },\n },\n },\n});\n\ndeclare module '@mui/material/styles' {\n interface Palette {\n black: Palette['primary'];\n white: Palette['primary'];\n flippyBlue: Palette['primary'];\n freezerBurn: Palette['primary'];\n spricyCarrot: Palette['primary'];\n pebble: Palette['primary'];\n donutPanic: Palette['primary'];\n eletricLime: Palette['primary'];\n pending: Palette['primary'];\n alternateBackground: Palette['primary'];\n }\n interface Theme {\n breakpoints: {\n up: (key: number | Breakpoint) => string;\n down: (key: number | Breakpoint) => string;\n only: (key: number | Breakpoint) => string;\n };\n }\n}\n"],"names":["fontTheme","createTheme","typography","body1","fontFamily","body2","h1","h2","h3","h4","h5","h6","palette","success","main","dark","light","error","warning","theme","black","augmentColor","color","name","white","flippyBlue","freezerBurn","spricyCarrot","pebble","donutPanic","eletricLime","pending","alternateBackground","flipdishPublicTheme","primary","secondary","shape","borderRadius","components","MuiButton","styleOverrides","root","padding","textTransform","MuiCard","boxShadow","borderWidth","borderStyle","borderColor","divider","MuiChip","fontWeight","paddingLeft","paddingRight","MuiListItemButton","backgroundColor","borderBottom","MuiTableRow","cursor"],"mappings":"6EAIA,MAAMA,EAAYC,EAAY,CAC1BC,WAAY,CACRC,MAAO,CACHC,WAAY,wBAEhBC,MAAO,CACHD,WAAY,wBAEhBE,GAAI,CACAF,WAAY,mCAEhBG,GAAI,CACAH,WAAY,mCAEhBI,GAAI,CACAJ,WAAY,mCAEhBK,GAAI,CACAL,WAAY,mCAEhBM,GAAI,CACAN,WAAY,mCAEhBO,GAAI,CACAP,WAAY,oCAGpBQ,QAAS,CACLC,QAAS,CACLC,KAAM,UACNC,KAAM,UACNC,MAAO,WAEXC,MAAO,CACHH,KAAM,UACNC,KAAM,UACNC,MAAO,WAEXE,QAAS,CACLJ,KAAM,UACNC,KAAM,UACNC,MAAO,cAKbG,EAAQlB,EAAYD,EAA2B,CACjDY,QAAS,CAELQ,MAAOpB,EAAUY,QAAQS,aAAa,CAClCC,MAAO,CACHR,KAAM,WAEVS,KAAM,UAEVC,MAAOxB,EAAUY,QAAQS,aAAa,CAClCC,MAAO,CACHR,KAAM,WAEVS,KAAM,UAEVE,WAAYzB,EAAUY,QAAQS,aAAa,CACvCC,MAAO,CACHR,KAAM,UACNE,MAAO,WAEXO,KAAM,eAGVG,YAAa1B,EAAUY,QAAQS,aAAa,CACxCC,MAAO,CACHR,KAAM,WAEVS,KAAM,gBAEVI,aAAc3B,EAAUY,QAAQS,aAAa,CACzCC,MAAO,CACHR,KAAM,WAEVS,KAAM,iBAEVK,OAAQ5B,EAAUY,QAAQS,aAAa,CACnCC,MAAO,CACHR,KAAM,WAEVS,KAAM,WAGVM,WAAY7B,EAAUY,QAAQS,aAAa,CACvCC,MAAO,CACHR,KAAM,WAEVS,KAAM,eAEVO,YAAa9B,EAAUY,QAAQS,aAAa,CACxCC,MAAO,CACHR,KAAM,WAEVS,KAAM,gBAEVQ,QAAS/B,EAAUY,QAAQS,aAAa,CACpCC,MAAO,CACHR,KAAM,UACNC,KAAM,UACNC,MAAO,WAEXO,KAAM,YAEVS,oBAAqBhC,EAAUY,QAAQS,aAAa,CAChDC,MAAO,CACHR,KAAM,WAEVS,KAAM,2BAKlB,IAAeU,EAAAhC,EAAYkB,EAAuB,CAC9CP,QAAS,CACLsB,QAAS,CACLpB,KAAMK,EAAMP,QAAQa,WAAWX,MAEnCqB,UAAW,CACPrB,KAAMK,EAAMP,QAAQe,aAAab,OAGzCsB,MAAO,CACHC,aAAc,OAElBC,WAAY,CACRC,UAAW,CACPC,eAAgB,CACZC,KAAM,CACFC,QAAS,YACTC,cAAe,UAI3BC,QAAS,CACLJ,eAAgB,CACZC,KAAM,CACFI,UAAW,OACXC,YAAa,MACbC,YAAa,QACbC,YAAa7B,EAAMP,QAAQqC,WAIvCC,QAAS,CACLV,eAAgB,CACZC,KAAM,CACFU,WAAY,OACZC,YAAa,MACbC,aAAc,SAI1BC,kBAAmB,CACfd,eAAgB,CACZC,KAAM,CACF,UAAW,CACPc,gBAAiB,WAErB,qBAAsB,CAClBC,aAAc,aAAarC,EAAMP,QAAQqC,cAKzDQ,YAAa,CACTjB,eAAgB,CACZC,KAAM,CACF,4BAA6B,CACzBc,gBAAiBpC,EAAMP,QAAQa,WAAWT,MAC1C0C,OAAQ"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("@mui/material/Chip"),l=require("@mui/material/styles");const o=["filled","outlined"],t=(e,r,l)=>({blue:{filled:{backgroundColor:r.palette.flippyBlue.light,color:r.palette.flippyBlue.dark},outlined:{borderColor:r.palette.flippyBlue.dark,color:r.palette.flippyBlue.dark}},success:{filled:{backgroundColor:r.palette.success.light,color:r.palette.success.dark},outlined:{borderColor:r.palette.success.main,color:r.palette.success.main}},warning:{filled:{backgroundColor:r.palette.warning.light,color:r.palette.warning.dark},outlined:{borderColor:r.palette.warning.main,color:r.palette.warning.dark}},error:{filled:{backgroundColor:r.palette.error.light,color:r.palette.error.dark},outlined:{borderColor:r.palette.error.main,color:r.palette.error.main}},default:{filled:{},outlined:{}}}[e][l]),a=l.styled(r,{shouldForwardProp:e=>"colour"!==e&&"rounded"!==e})((({theme:e,colour:r,rounded:l,variant:a=o[0]})=>({borderRadius:l?"100px":"5px","& .MuiChip-icon":{color:"inherit"},...t(r,e,a)})));exports.CHIP_VARIANTS=o,exports.default=({label:r,color:l="default",size:o="medium",variant:t="filled",icon:i,rounded:d=!0})=>e.jsx(a,{icon:i,label:r,colour:l,size:o,variant:t,rounded:d});
|
|
2
|
-
//# sourceMappingURL=Chip.cjs.js.map
|