@flipdish/ui-library 0.50.0 → 0.52.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/README.md +17 -16
- package/dist/components/atoms/Checkbox/index.cjs +11 -3
- package/dist/components/atoms/Checkbox/index.cjs.map +1 -1
- package/dist/components/atoms/Checkbox/index.d.ts.map +1 -1
- package/dist/components/atoms/Checkbox/index.js +12 -4
- package/dist/components/atoms/Checkbox/index.js.map +1 -1
- package/dist/components/atoms/Slider/index.cjs +2 -2
- package/dist/components/atoms/Slider/index.cjs.map +1 -1
- package/dist/components/atoms/Slider/index.d.ts +3 -1
- package/dist/components/atoms/Slider/index.d.ts.map +1 -1
- package/dist/components/atoms/Slider/index.js +2 -2
- package/dist/components/atoms/Slider/index.js.map +1 -1
- package/dist/components/forms/Form/hooks/useForm.cjs +26 -0
- package/dist/components/forms/Form/hooks/useForm.cjs.map +1 -0
- package/dist/components/forms/Form/hooks/useForm.d.ts +13 -0
- package/dist/components/forms/Form/hooks/useForm.d.ts.map +1 -0
- package/dist/components/forms/Form/hooks/useForm.js +24 -0
- package/dist/components/forms/Form/hooks/useForm.js.map +1 -0
- package/dist/components/forms/Form/hooks/useSubmitInTurn/useSubmitInTurn.cjs +28 -0
- package/dist/components/forms/Form/hooks/useSubmitInTurn/useSubmitInTurn.cjs.map +1 -0
- package/dist/components/forms/Form/hooks/useSubmitInTurn/useSubmitInTurn.d.ts +10 -0
- package/dist/components/forms/Form/hooks/useSubmitInTurn/useSubmitInTurn.d.ts.map +1 -0
- package/dist/components/forms/Form/hooks/useSubmitInTurn/useSubmitInTurn.js +26 -0
- package/dist/components/forms/Form/hooks/useSubmitInTurn/useSubmitInTurn.js.map +1 -0
- package/dist/components/forms/Form/index.cjs +43 -0
- package/dist/components/forms/Form/index.cjs.map +1 -0
- package/dist/components/forms/Form/index.d.ts +30 -0
- package/dist/components/forms/Form/index.d.ts.map +1 -0
- package/dist/components/forms/Form/index.js +40 -0
- package/dist/components/forms/Form/index.js.map +1 -0
- package/dist/components/forms/Form/utilities/formSubmit.utils.cjs +23 -0
- package/dist/components/forms/Form/utilities/formSubmit.utils.cjs.map +1 -0
- package/dist/components/forms/Form/utilities/formSubmit.utils.d.ts +14 -0
- package/dist/components/forms/Form/utilities/formSubmit.utils.d.ts.map +1 -0
- package/dist/components/forms/Form/utilities/formSubmit.utils.js +21 -0
- package/dist/components/forms/Form/utilities/formSubmit.utils.js.map +1 -0
- package/dist/components/forms/FormFooter/hooks/useDestructiveConfirmation.cjs +39 -0
- package/dist/components/forms/FormFooter/hooks/useDestructiveConfirmation.cjs.map +1 -0
- package/dist/components/forms/FormFooter/hooks/useDestructiveConfirmation.d.ts +17 -0
- package/dist/components/forms/FormFooter/hooks/useDestructiveConfirmation.d.ts.map +1 -0
- package/dist/components/forms/FormFooter/hooks/useDestructiveConfirmation.js +37 -0
- package/dist/components/forms/FormFooter/hooks/useDestructiveConfirmation.js.map +1 -0
- package/dist/components/forms/FormFooter/hooks/useHasFieldError.cjs +26 -0
- package/dist/components/forms/FormFooter/hooks/useHasFieldError.cjs.map +1 -0
- package/dist/components/forms/FormFooter/hooks/useHasFieldError.d.ts +9 -0
- package/dist/components/forms/FormFooter/hooks/useHasFieldError.d.ts.map +1 -0
- package/dist/components/forms/FormFooter/hooks/useHasFieldError.js +24 -0
- package/dist/components/forms/FormFooter/hooks/useHasFieldError.js.map +1 -0
- package/dist/components/forms/FormFooter/index.cjs +41 -0
- package/dist/components/forms/FormFooter/index.cjs.map +1 -0
- package/dist/components/forms/FormFooter/index.d.ts +52 -0
- package/dist/components/forms/FormFooter/index.d.ts.map +1 -0
- package/dist/components/forms/FormFooter/index.js +39 -0
- package/dist/components/forms/FormFooter/index.js.map +1 -0
- package/dist/components/forms/FormFooter/utilities/formFooter.utils.cjs +21 -0
- package/dist/components/forms/FormFooter/utilities/formFooter.utils.cjs.map +1 -0
- package/dist/components/forms/FormFooter/utilities/formFooter.utils.d.ts +12 -0
- package/dist/components/forms/FormFooter/utilities/formFooter.utils.d.ts.map +1 -0
- package/dist/components/forms/FormFooter/utilities/formFooter.utils.js +19 -0
- package/dist/components/forms/FormFooter/utilities/formFooter.utils.js.map +1 -0
- package/dist/components/forms/FormSection/FormSection.styles.cjs +15 -0
- package/dist/components/forms/FormSection/FormSection.styles.cjs.map +1 -0
- package/dist/components/forms/FormSection/FormSection.styles.d.ts +9 -0
- package/dist/components/forms/FormSection/FormSection.styles.d.ts.map +1 -0
- package/dist/components/forms/FormSection/FormSection.styles.js +13 -0
- package/dist/components/forms/FormSection/FormSection.styles.js.map +1 -0
- package/dist/components/forms/FormSection/index.cjs +43 -0
- package/dist/components/forms/FormSection/index.cjs.map +1 -0
- package/dist/components/forms/FormSection/index.d.ts +41 -0
- package/dist/components/forms/FormSection/index.d.ts.map +1 -0
- package/dist/components/forms/FormSection/index.js +41 -0
- package/dist/components/forms/FormSection/index.js.map +1 -0
- package/dist/components/forms/__internal__/formField/hooks/useFocusTarget.cjs +28 -0
- package/dist/components/forms/__internal__/formField/hooks/useFocusTarget.cjs.map +1 -0
- package/dist/components/forms/__internal__/formField/hooks/useFocusTarget.d.ts +12 -0
- package/dist/components/forms/__internal__/formField/hooks/useFocusTarget.d.ts.map +1 -0
- package/dist/components/forms/__internal__/formField/hooks/useFocusTarget.js +26 -0
- package/dist/components/forms/__internal__/formField/hooks/useFocusTarget.js.map +1 -0
- package/dist/components/forms/__internal__/formField/hooks/useFocusThroughSubmit.cjs +68 -0
- package/dist/components/forms/__internal__/formField/hooks/useFocusThroughSubmit.cjs.map +1 -0
- package/dist/components/forms/__internal__/formField/hooks/useFocusThroughSubmit.d.ts +26 -0
- package/dist/components/forms/__internal__/formField/hooks/useFocusThroughSubmit.d.ts.map +1 -0
- package/dist/components/forms/__internal__/formField/hooks/useFocusThroughSubmit.js +66 -0
- package/dist/components/forms/__internal__/formField/hooks/useFocusThroughSubmit.js.map +1 -0
- package/dist/components/forms/__internal__/formField/hooks/useFormField.cjs +142 -0
- package/dist/components/forms/__internal__/formField/hooks/useFormField.cjs.map +1 -0
- package/dist/components/forms/__internal__/formField/hooks/useFormField.d.ts +35 -0
- package/dist/components/forms/__internal__/formField/hooks/useFormField.d.ts.map +1 -0
- package/dist/components/forms/__internal__/formField/hooks/useFormField.js +140 -0
- package/dist/components/forms/__internal__/formField/hooks/useFormField.js.map +1 -0
- package/dist/components/forms/__internal__/formField/providers/FieldElements.context.cjs +12 -0
- package/dist/components/forms/__internal__/formField/providers/FieldElements.context.cjs.map +1 -0
- package/dist/components/forms/__internal__/formField/providers/FieldElements.context.d.ts +7 -0
- package/dist/components/forms/__internal__/formField/providers/FieldElements.context.d.ts.map +1 -0
- package/dist/components/forms/__internal__/formField/providers/FieldElements.context.js +10 -0
- package/dist/components/forms/__internal__/formField/providers/FieldElements.context.js.map +1 -0
- package/dist/components/forms/__internal__/formField/utilities/fieldElements.utils.cjs +39 -0
- package/dist/components/forms/__internal__/formField/utilities/fieldElements.utils.cjs.map +1 -0
- package/dist/components/forms/__internal__/formField/utilities/fieldElements.utils.d.ts +21 -0
- package/dist/components/forms/__internal__/formField/utilities/fieldElements.utils.d.ts.map +1 -0
- package/dist/components/forms/__internal__/formField/utilities/fieldElements.utils.js +37 -0
- package/dist/components/forms/__internal__/formField/utilities/fieldElements.utils.js.map +1 -0
- package/dist/components/forms/__internal__/formField/utilities/fieldValue.utils.cjs +40 -0
- package/dist/components/forms/__internal__/formField/utilities/fieldValue.utils.cjs.map +1 -0
- package/dist/components/forms/__internal__/formField/utilities/fieldValue.utils.d.ts +18 -0
- package/dist/components/forms/__internal__/formField/utilities/fieldValue.utils.d.ts.map +1 -0
- package/dist/components/forms/__internal__/formField/utilities/fieldValue.utils.js +37 -0
- package/dist/components/forms/__internal__/formField/utilities/fieldValue.utils.js.map +1 -0
- package/dist/components/forms/__internal__/formField/utilities/formFocus.utils.cjs +21 -0
- package/dist/components/forms/__internal__/formField/utilities/formFocus.utils.cjs.map +1 -0
- package/dist/components/forms/__internal__/formField/utilities/formFocus.utils.d.ts +11 -0
- package/dist/components/forms/__internal__/formField/utilities/formFocus.utils.d.ts.map +1 -0
- package/dist/components/forms/__internal__/formField/utilities/formFocus.utils.js +19 -0
- package/dist/components/forms/__internal__/formField/utilities/formFocus.utils.js.map +1 -0
- package/dist/components/forms/__internal__/formField/utilities/validationQueue.utils.cjs +128 -0
- package/dist/components/forms/__internal__/formField/utilities/validationQueue.utils.cjs.map +1 -0
- package/dist/components/forms/__internal__/formField/utilities/validationQueue.utils.d.ts +72 -0
- package/dist/components/forms/__internal__/formField/utilities/validationQueue.utils.d.ts.map +1 -0
- package/dist/components/forms/__internal__/formField/utilities/validationQueue.utils.js +121 -0
- package/dist/components/forms/__internal__/formField/utilities/validationQueue.utils.js.map +1 -0
- package/dist/components/forms/fields/FormCheckbox/index.cjs +34 -0
- package/dist/components/forms/fields/FormCheckbox/index.cjs.map +1 -0
- package/dist/components/forms/fields/FormCheckbox/index.d.ts +16 -0
- package/dist/components/forms/fields/FormCheckbox/index.d.ts.map +1 -0
- package/dist/components/forms/fields/FormCheckbox/index.js +32 -0
- package/dist/components/forms/fields/FormCheckbox/index.js.map +1 -0
- package/dist/components/forms/fields/FormCheckboxGroup/index.cjs +33 -0
- package/dist/components/forms/fields/FormCheckboxGroup/index.cjs.map +1 -0
- package/dist/components/forms/fields/FormCheckboxGroup/index.d.ts +16 -0
- package/dist/components/forms/fields/FormCheckboxGroup/index.d.ts.map +1 -0
- package/dist/components/forms/fields/FormCheckboxGroup/index.js +31 -0
- package/dist/components/forms/fields/FormCheckboxGroup/index.js.map +1 -0
- package/dist/components/forms/fields/FormColorPicker/hooks/useEmptyFieldValue.cjs +26 -0
- package/dist/components/forms/fields/FormColorPicker/hooks/useEmptyFieldValue.cjs.map +1 -0
- package/dist/components/forms/fields/FormColorPicker/hooks/useEmptyFieldValue.d.ts +11 -0
- package/dist/components/forms/fields/FormColorPicker/hooks/useEmptyFieldValue.d.ts.map +1 -0
- package/dist/components/forms/fields/FormColorPicker/hooks/useEmptyFieldValue.js +24 -0
- package/dist/components/forms/fields/FormColorPicker/hooks/useEmptyFieldValue.js.map +1 -0
- package/dist/components/forms/fields/FormColorPicker/index.cjs +33 -0
- package/dist/components/forms/fields/FormColorPicker/index.cjs.map +1 -0
- package/dist/components/forms/fields/FormColorPicker/index.d.ts +21 -0
- package/dist/components/forms/fields/FormColorPicker/index.d.ts.map +1 -0
- package/dist/components/forms/fields/FormColorPicker/index.js +31 -0
- package/dist/components/forms/fields/FormColorPicker/index.js.map +1 -0
- package/dist/components/forms/fields/FormColorPicker/utilities/formColorPicker.utils.cjs +20 -0
- package/dist/components/forms/fields/FormColorPicker/utilities/formColorPicker.utils.cjs.map +1 -0
- package/dist/components/forms/fields/FormColorPicker/utilities/formColorPicker.utils.d.ts +17 -0
- package/dist/components/forms/fields/FormColorPicker/utilities/formColorPicker.utils.d.ts.map +1 -0
- package/dist/components/forms/fields/FormColorPicker/utilities/formColorPicker.utils.js +18 -0
- package/dist/components/forms/fields/FormColorPicker/utilities/formColorPicker.utils.js.map +1 -0
- package/dist/components/forms/fields/FormDatePicker/index.cjs +35 -0
- package/dist/components/forms/fields/FormDatePicker/index.cjs.map +1 -0
- package/dist/components/forms/fields/FormDatePicker/index.d.ts +17 -0
- package/dist/components/forms/fields/FormDatePicker/index.d.ts.map +1 -0
- package/dist/components/forms/fields/FormDatePicker/index.js +33 -0
- package/dist/components/forms/fields/FormDatePicker/index.js.map +1 -0
- package/dist/components/forms/fields/FormDatePicker/utilities/formDatePicker.utils.cjs +23 -0
- package/dist/components/forms/fields/FormDatePicker/utilities/formDatePicker.utils.cjs.map +1 -0
- package/dist/components/forms/fields/FormDatePicker/utilities/formDatePicker.utils.d.ts +9 -0
- package/dist/components/forms/fields/FormDatePicker/utilities/formDatePicker.utils.d.ts.map +1 -0
- package/dist/components/forms/fields/FormDatePicker/utilities/formDatePicker.utils.js +21 -0
- package/dist/components/forms/fields/FormDatePicker/utilities/formDatePicker.utils.js.map +1 -0
- package/dist/components/forms/fields/FormInput/index.cjs +27 -0
- package/dist/components/forms/fields/FormInput/index.cjs.map +1 -0
- package/dist/components/forms/fields/FormInput/index.d.ts +16 -0
- package/dist/components/forms/fields/FormInput/index.d.ts.map +1 -0
- package/dist/components/forms/fields/FormInput/index.js +25 -0
- package/dist/components/forms/fields/FormInput/index.js.map +1 -0
- package/dist/components/forms/fields/FormMultiSelect/index.cjs +44 -0
- package/dist/components/forms/fields/FormMultiSelect/index.cjs.map +1 -0
- package/dist/components/forms/fields/FormMultiSelect/index.d.ts +17 -0
- package/dist/components/forms/fields/FormMultiSelect/index.d.ts.map +1 -0
- package/dist/components/forms/fields/FormMultiSelect/index.js +42 -0
- package/dist/components/forms/fields/FormMultiSelect/index.js.map +1 -0
- package/dist/components/forms/fields/FormRadioCardGroup/index.cjs +36 -0
- package/dist/components/forms/fields/FormRadioCardGroup/index.cjs.map +1 -0
- package/dist/components/forms/fields/FormRadioCardGroup/index.d.ts +29 -0
- package/dist/components/forms/fields/FormRadioCardGroup/index.d.ts.map +1 -0
- package/dist/components/forms/fields/FormRadioCardGroup/index.js +34 -0
- package/dist/components/forms/fields/FormRadioCardGroup/index.js.map +1 -0
- package/dist/components/forms/fields/FormRadioGroup/index.cjs +31 -0
- package/dist/components/forms/fields/FormRadioGroup/index.cjs.map +1 -0
- package/dist/components/forms/fields/FormRadioGroup/index.d.ts +17 -0
- package/dist/components/forms/fields/FormRadioGroup/index.d.ts.map +1 -0
- package/dist/components/forms/fields/FormRadioGroup/index.js +29 -0
- package/dist/components/forms/fields/FormRadioGroup/index.js.map +1 -0
- package/dist/components/forms/fields/FormSelect/index.cjs +30 -0
- package/dist/components/forms/fields/FormSelect/index.cjs.map +1 -0
- package/dist/components/forms/fields/FormSelect/index.d.ts +16 -0
- package/dist/components/forms/fields/FormSelect/index.d.ts.map +1 -0
- package/dist/components/forms/fields/FormSelect/index.js +28 -0
- package/dist/components/forms/fields/FormSelect/index.js.map +1 -0
- package/dist/components/forms/fields/FormSlider/index.cjs +43 -0
- package/dist/components/forms/fields/FormSlider/index.cjs.map +1 -0
- package/dist/components/forms/fields/FormSlider/index.d.ts +17 -0
- package/dist/components/forms/fields/FormSlider/index.d.ts.map +1 -0
- package/dist/components/forms/fields/FormSlider/index.js +41 -0
- package/dist/components/forms/fields/FormSlider/index.js.map +1 -0
- package/dist/components/forms/fields/FormTextArea/index.cjs +27 -0
- package/dist/components/forms/fields/FormTextArea/index.cjs.map +1 -0
- package/dist/components/forms/fields/FormTextArea/index.d.ts +16 -0
- package/dist/components/forms/fields/FormTextArea/index.d.ts.map +1 -0
- package/dist/components/forms/fields/FormTextArea/index.js +25 -0
- package/dist/components/forms/fields/FormTextArea/index.js.map +1 -0
- package/dist/components/forms/fields/FormToggle/index.cjs +32 -0
- package/dist/components/forms/fields/FormToggle/index.cjs.map +1 -0
- package/dist/components/forms/fields/FormToggle/index.d.ts +16 -0
- package/dist/components/forms/fields/FormToggle/index.d.ts.map +1 -0
- package/dist/components/forms/fields/FormToggle/index.js +30 -0
- package/dist/components/forms/fields/FormToggle/index.js.map +1 -0
- package/dist/components/forms/validation/hooks/useSchemaResolver.cjs +39 -0
- package/dist/components/forms/validation/hooks/useSchemaResolver.cjs.map +1 -0
- package/dist/components/forms/validation/hooks/useSchemaResolver.d.ts +15 -0
- package/dist/components/forms/validation/hooks/useSchemaResolver.d.ts.map +1 -0
- package/dist/components/forms/validation/hooks/useSchemaResolver.js +37 -0
- package/dist/components/forms/validation/hooks/useSchemaResolver.js.map +1 -0
- package/dist/components/forms/validation/index.cjs +309 -0
- package/dist/components/forms/validation/index.cjs.map +1 -0
- package/dist/components/forms/validation/index.d.ts +214 -0
- package/dist/components/forms/validation/index.d.ts.map +1 -0
- package/dist/components/forms/validation/index.js +293 -0
- package/dist/components/forms/validation/index.js.map +1 -0
- package/dist/components/forms/validation/utilities/validation.utils.cjs +42 -0
- package/dist/components/forms/validation/utilities/validation.utils.cjs.map +1 -0
- package/dist/components/forms/validation/utilities/validation.utils.d.ts +20 -0
- package/dist/components/forms/validation/utilities/validation.utils.d.ts.map +1 -0
- package/dist/components/forms/validation/utilities/validation.utils.js +39 -0
- package/dist/components/forms/validation/utilities/validation.utils.js.map +1 -0
- package/dist/components/forms/validation/validation.types.d.ts +8 -0
- package/dist/components/forms/validation/validation.types.d.ts.map +1 -0
- package/dist/components/molecules/Alert/index.cjs +5 -25
- package/dist/components/molecules/Alert/index.cjs.map +1 -1
- package/dist/components/molecules/Alert/index.d.ts +9 -94
- package/dist/components/molecules/Alert/index.d.ts.map +1 -1
- package/dist/components/molecules/Alert/index.js +5 -25
- package/dist/components/molecules/Alert/index.js.map +1 -1
- package/dist/components/molecules/Alerts/components/Alert.cjs +39 -0
- package/dist/components/molecules/Alerts/components/Alert.cjs.map +1 -0
- package/dist/components/molecules/Alerts/components/Alert.d.ts +104 -0
- package/dist/components/molecules/Alerts/components/Alert.d.ts.map +1 -0
- package/dist/components/molecules/Alerts/components/Alert.js +36 -0
- package/dist/components/molecules/Alerts/components/Alert.js.map +1 -0
- package/dist/components/molecules/Alerts/components/SaveErrorAlert.cjs +26 -0
- package/dist/components/molecules/Alerts/components/SaveErrorAlert.cjs.map +1 -0
- package/dist/components/molecules/Alerts/components/SaveErrorAlert.d.ts +25 -0
- package/dist/components/molecules/Alerts/components/SaveErrorAlert.d.ts.map +1 -0
- package/dist/components/molecules/Alerts/components/SaveErrorAlert.js +24 -0
- package/dist/components/molecules/Alerts/components/SaveErrorAlert.js.map +1 -0
- package/dist/components/molecules/Alerts/hooks/useAlertActions.cjs +26 -0
- package/dist/components/molecules/Alerts/hooks/useAlertActions.cjs.map +1 -0
- package/dist/components/molecules/Alerts/hooks/useAlertActions.d.ts +13 -0
- package/dist/components/molecules/Alerts/hooks/useAlertActions.d.ts.map +1 -0
- package/dist/components/molecules/Alerts/hooks/useAlertActions.js +24 -0
- package/dist/components/molecules/Alerts/hooks/useAlertActions.js.map +1 -0
- package/dist/components/molecules/Alerts/index.cjs +11 -0
- package/dist/components/molecules/Alerts/index.cjs.map +1 -0
- package/dist/components/molecules/Alerts/index.d.ts +12 -0
- package/dist/components/molecules/Alerts/index.d.ts.map +1 -0
- package/dist/components/molecules/Alerts/index.js +3 -0
- package/dist/components/molecules/Alerts/index.js.map +1 -0
- package/dist/components/molecules/Modal/index.cjs +9 -39
- package/dist/components/molecules/Modal/index.cjs.map +1 -1
- package/dist/components/molecules/Modal/index.d.ts +13 -36
- package/dist/components/molecules/Modal/index.d.ts.map +1 -1
- package/dist/components/molecules/Modal/index.js +8 -38
- package/dist/components/molecules/Modal/index.js.map +1 -1
- package/dist/components/molecules/Modals/components/ConfirmationModal.cjs +32 -0
- package/dist/components/molecules/Modals/components/ConfirmationModal.cjs.map +1 -0
- package/dist/components/molecules/Modals/components/ConfirmationModal.d.ts +28 -0
- package/dist/components/molecules/Modals/components/ConfirmationModal.d.ts.map +1 -0
- package/dist/components/molecules/Modals/components/ConfirmationModal.js +30 -0
- package/dist/components/molecules/Modals/components/ConfirmationModal.js.map +1 -0
- package/dist/components/molecules/Modals/components/Modal.cjs +48 -0
- package/dist/components/molecules/Modals/components/Modal.cjs.map +1 -0
- package/dist/components/molecules/Modals/components/Modal.d.ts +37 -0
- package/dist/components/molecules/Modals/components/Modal.d.ts.map +1 -0
- package/dist/components/molecules/Modals/components/Modal.js +43 -0
- package/dist/components/molecules/Modals/components/Modal.js.map +1 -0
- package/dist/components/molecules/Modals/components/UnsavedChangesModal.cjs +30 -0
- package/dist/components/molecules/Modals/components/UnsavedChangesModal.cjs.map +1 -0
- package/dist/components/molecules/Modals/components/UnsavedChangesModal.d.ts +14 -0
- package/dist/components/molecules/Modals/components/UnsavedChangesModal.d.ts.map +1 -0
- package/dist/components/molecules/Modals/components/UnsavedChangesModal.js +28 -0
- package/dist/components/molecules/Modals/components/UnsavedChangesModal.js.map +1 -0
- package/dist/components/molecules/Modals/index.cjs +15 -0
- package/dist/components/molecules/Modals/index.cjs.map +1 -0
- package/dist/components/molecules/Modals/index.d.ts +14 -0
- package/dist/components/molecules/Modals/index.d.ts.map +1 -0
- package/dist/components/molecules/Modals/index.js +4 -0
- package/dist/components/molecules/Modals/index.js.map +1 -0
- package/dist/components/organisms/ColorPicker/components/ColorPickerField.cjs +13 -3
- package/dist/components/organisms/ColorPicker/components/ColorPickerField.cjs.map +1 -1
- package/dist/components/organisms/ColorPicker/components/ColorPickerField.d.ts +1 -1
- package/dist/components/organisms/ColorPicker/components/ColorPickerField.d.ts.map +1 -1
- package/dist/components/organisms/ColorPicker/components/ColorPickerField.js +13 -3
- package/dist/components/organisms/ColorPicker/components/ColorPickerField.js.map +1 -1
- package/dist/components/organisms/ColorPicker/hooks/useColorFieldEdit.cjs +2 -2
- package/dist/components/organisms/ColorPicker/hooks/useColorFieldEdit.cjs.map +1 -1
- package/dist/components/organisms/ColorPicker/hooks/useColorFieldEdit.d.ts +1 -0
- package/dist/components/organisms/ColorPicker/hooks/useColorFieldEdit.d.ts.map +1 -1
- package/dist/components/organisms/ColorPicker/hooks/useColorFieldEdit.js +2 -2
- package/dist/components/organisms/ColorPicker/hooks/useColorFieldEdit.js.map +1 -1
- package/dist/components/organisms/ColorPicker/hooks/useCssColorField.cjs +1 -1
- package/dist/components/organisms/ColorPicker/hooks/useCssColorField.js +1 -1
- package/dist/components/organisms/ColorPicker/index.cjs +1 -1
- package/dist/components/organisms/ColorPicker/index.d.ts.map +1 -1
- package/dist/components/organisms/ColorPicker/index.js +1 -1
- package/dist/components/organisms/ColorPicker/providers/ColorPicker.provider.d.ts +1 -1
- package/dist/components/organisms/ColorPicker/providers/ColorPicker.provider.d.ts.map +1 -1
- package/dist/components/organisms/ColorPicker/utilities/colorPicker.utils.cjs.map +1 -0
- package/dist/components/organisms/ColorPicker/utilities/colorPicker.utils.d.ts.map +1 -0
- package/dist/components/organisms/ColorPicker/utilities/colorPicker.utils.js.map +1 -0
- package/dist/components/organisms/DatePicker/components/CalendarOverlay.cjs +2 -2
- package/dist/components/organisms/DatePicker/components/CalendarOverlay.cjs.map +1 -1
- package/dist/components/organisms/DatePicker/components/CalendarOverlay.js +1 -1
- package/dist/components/organisms/DatePicker/components/DateRangePicker.cjs +4 -1
- package/dist/components/organisms/DatePicker/components/DateRangePicker.cjs.map +1 -1
- package/dist/components/organisms/DatePicker/components/DateRangePicker.d.ts.map +1 -1
- package/dist/components/organisms/DatePicker/components/DateRangePicker.js +5 -2
- package/dist/components/organisms/DatePicker/components/DateRangePicker.js.map +1 -1
- package/dist/components/organisms/GradientPicker/components/GradientStopRow.cjs +1 -1
- package/dist/components/organisms/GradientPicker/components/GradientStopRow.js +1 -1
- package/dist/hooks/__internal__/useReturnFocus/useReturnFocus.cjs +48 -0
- package/dist/hooks/__internal__/useReturnFocus/useReturnFocus.cjs.map +1 -0
- package/dist/hooks/__internal__/useReturnFocus/useReturnFocus.d.ts +23 -0
- package/dist/hooks/__internal__/useReturnFocus/useReturnFocus.d.ts.map +1 -0
- package/dist/hooks/__internal__/useReturnFocus/useReturnFocus.js +45 -0
- package/dist/hooks/__internal__/useReturnFocus/useReturnFocus.js.map +1 -0
- package/dist/hooks/useUnsavedChangesGuard/index.cjs +28 -0
- package/dist/hooks/useUnsavedChangesGuard/index.cjs.map +1 -0
- package/dist/hooks/useUnsavedChangesGuard/index.d.ts +18 -0
- package/dist/hooks/useUnsavedChangesGuard/index.d.ts.map +1 -0
- package/dist/hooks/useUnsavedChangesGuard/index.js +26 -0
- package/dist/hooks/useUnsavedChangesGuard/index.js.map +1 -0
- package/dist/hooks/useUnsavedChangesGuard/providers/UnsavedChangesGuard.context.cjs +8 -0
- package/dist/hooks/useUnsavedChangesGuard/providers/UnsavedChangesGuard.context.cjs.map +1 -0
- package/dist/hooks/useUnsavedChangesGuard/providers/UnsavedChangesGuard.context.d.ts +13 -0
- package/dist/hooks/useUnsavedChangesGuard/providers/UnsavedChangesGuard.context.d.ts.map +1 -0
- package/dist/hooks/useUnsavedChangesGuard/providers/UnsavedChangesGuard.context.js +6 -0
- package/dist/hooks/useUnsavedChangesGuard/providers/UnsavedChangesGuard.context.js.map +1 -0
- package/dist/localization/en.json.cjs +98 -0
- package/dist/localization/en.json.cjs.map +1 -0
- package/dist/localization/en.json.js +81 -0
- package/dist/localization/en.json.js.map +1 -0
- package/dist/native/components/forms/Form/index.d.ts +12 -0
- package/dist/native/components/forms/FormFooter/index.d.ts +12 -0
- package/dist/native/components/forms/FormSection/index.d.ts +12 -0
- package/dist/native/components/forms/fields/FormCheckbox/index.d.ts +12 -0
- package/dist/native/components/forms/fields/FormCheckboxGroup/index.d.ts +12 -0
- package/dist/native/components/forms/fields/FormColorPicker/index.d.ts +12 -0
- package/dist/native/components/forms/fields/FormDatePicker/index.d.ts +12 -0
- package/dist/native/components/forms/fields/FormInput/index.d.ts +12 -0
- package/dist/native/components/forms/fields/FormMultiSelect/index.d.ts +12 -0
- package/dist/native/components/forms/fields/FormRadioCardGroup/index.d.ts +12 -0
- package/dist/native/components/forms/fields/FormRadioGroup/index.d.ts +12 -0
- package/dist/native/components/forms/fields/FormSelect/index.d.ts +12 -0
- package/dist/native/components/forms/fields/FormSlider/index.d.ts +12 -0
- package/dist/native/components/forms/fields/FormTextArea/index.d.ts +12 -0
- package/dist/native/components/forms/fields/FormToggle/index.d.ts +12 -0
- package/dist/native/components/forms/validation/index.d.ts +12 -0
- package/dist/native/components/molecules/Alerts/index.d.ts +12 -0
- package/dist/native/components/molecules/Modals/index.d.ts +12 -0
- package/dist/native/hooks/useUnsavedChangesGuard/index.d.ts +12 -0
- package/dist/native/providers/UnsavedChangesGuardProvider/index.d.ts +12 -0
- package/dist/providers/UIProvider/hooks/useBrowserRouter.cjs +70 -0
- package/dist/providers/UIProvider/hooks/useBrowserRouter.cjs.map +1 -0
- package/dist/providers/UIProvider/hooks/useBrowserRouter.d.ts +12 -0
- package/dist/providers/UIProvider/hooks/useBrowserRouter.d.ts.map +1 -0
- package/dist/providers/UIProvider/hooks/useBrowserRouter.js +68 -0
- package/dist/providers/UIProvider/hooks/useBrowserRouter.js.map +1 -0
- package/dist/providers/UIProvider/index.cjs +19 -6
- package/dist/providers/UIProvider/index.cjs.map +1 -1
- package/dist/providers/UIProvider/index.d.ts +2 -2
- package/dist/providers/UIProvider/index.d.ts.map +1 -1
- package/dist/providers/UIProvider/index.js +20 -7
- package/dist/providers/UIProvider/index.js.map +1 -1
- package/dist/providers/UnsavedChangesGuardProvider/index.cjs +191 -0
- package/dist/providers/UnsavedChangesGuardProvider/index.cjs.map +1 -0
- package/dist/providers/UnsavedChangesGuardProvider/index.d.ts +10 -0
- package/dist/providers/UnsavedChangesGuardProvider/index.d.ts.map +1 -0
- package/dist/providers/UnsavedChangesGuardProvider/index.js +189 -0
- package/dist/providers/UnsavedChangesGuardProvider/index.js.map +1 -0
- package/dist/providers/UnsavedChangesGuardProvider/unsavedChangesGuard.constants.cjs +7 -0
- package/dist/providers/UnsavedChangesGuardProvider/unsavedChangesGuard.constants.cjs.map +1 -0
- package/dist/providers/UnsavedChangesGuardProvider/unsavedChangesGuard.constants.d.ts +3 -0
- package/dist/providers/UnsavedChangesGuardProvider/unsavedChangesGuard.constants.d.ts.map +1 -0
- package/dist/providers/UnsavedChangesGuardProvider/unsavedChangesGuard.constants.js +5 -0
- package/dist/providers/UnsavedChangesGuardProvider/unsavedChangesGuard.constants.js.map +1 -0
- package/dist/providers/UnsavedChangesGuardProvider/unsavedChangesGuard.types.d.ts +21 -0
- package/dist/providers/UnsavedChangesGuardProvider/unsavedChangesGuard.types.d.ts.map +1 -0
- package/dist/providers/UnsavedChangesGuardProvider/utilities/unsavedChangesGuard.utils.cjs +97 -0
- package/dist/providers/UnsavedChangesGuardProvider/utilities/unsavedChangesGuard.utils.cjs.map +1 -0
- package/dist/providers/UnsavedChangesGuardProvider/utilities/unsavedChangesGuard.utils.d.ts +62 -0
- package/dist/providers/UnsavedChangesGuardProvider/utilities/unsavedChangesGuard.utils.d.ts.map +1 -0
- package/dist/providers/UnsavedChangesGuardProvider/utilities/unsavedChangesGuard.utils.js +88 -0
- package/dist/providers/UnsavedChangesGuardProvider/utilities/unsavedChangesGuard.utils.js.map +1 -0
- package/dist/utilities/__internal__/builtInTextUtils/builtInText.utils.cjs +74 -0
- package/dist/utilities/__internal__/builtInTextUtils/builtInText.utils.cjs.map +1 -0
- package/dist/utilities/__internal__/builtInTextUtils/builtInText.utils.d.ts +51 -0
- package/dist/utilities/__internal__/builtInTextUtils/builtInText.utils.d.ts.map +1 -0
- package/dist/utilities/__internal__/builtInTextUtils/builtInText.utils.js +68 -0
- package/dist/utilities/__internal__/builtInTextUtils/builtInText.utils.js.map +1 -0
- package/package.json +41 -6
- package/dist/components/organisms/ColorPicker/colorPicker.utils.cjs.map +0 -1
- package/dist/components/organisms/ColorPicker/colorPicker.utils.d.ts.map +0 -1
- package/dist/components/organisms/ColorPicker/colorPicker.utils.js.map +0 -1
- /package/dist/components/organisms/ColorPicker/{colorPicker.utils.cjs → utilities/colorPicker.utils.cjs} +0 -0
- /package/dist/components/organisms/ColorPicker/{colorPicker.utils.d.ts → utilities/colorPicker.utils.d.ts} +0 -0
- /package/dist/components/organisms/ColorPicker/{colorPicker.utils.js → utilities/colorPicker.utils.js} +0 -0
|
@@ -1,29 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Button } from '@flipdish/ui-library/components/atoms/Button';
|
|
3
|
-
import { CloseButton } from '@flipdish/ui-library/components/atoms/CloseButton';
|
|
4
|
-
import { FeaturedIcon } from '@flipdish/ui-library/components/atoms/FeaturedIcon';
|
|
5
|
-
import { cx } from '@flipdish/ui-library/utilities/cx';
|
|
6
|
-
import { useResolvedTestId, joinTestId } from '@flipdish/ui-library/utilities/testIdUtils';
|
|
7
|
-
import { getStatusFeaturedIconProps } from '../../__internal__/statusIcon/statusIcon.utils.js';
|
|
1
|
+
import { AlertFloating as AlertFloating$1, AlertFullWidth as AlertFullWidth$1 } from '@flipdish/ui-library/components/molecules/Alerts';
|
|
8
2
|
|
|
9
|
-
/**
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
*/
|
|
14
|
-
const AlertFloating = ({ title, description, confirmLabel, onClose, onConfirm, color = 'default', dismissLabel = 'Dismiss', 'data-testid': dataTestId, }) => {
|
|
15
|
-
const alertTestId = useResolvedTestId({ testId: dataTestId, segment: 'alert-floating', rootName: 'alert-floating' });
|
|
16
|
-
return (jsxs("div", { "data-testid": alertTestId, className: "relative flex flex-col gap-4 rounded-xl border border-primary bg-primary_alt p-4 shadow-xs md:flex-row", children: [jsx(FeaturedIcon, { ...getStatusFeaturedIconProps(color), size: "md" }), jsxs("div", { className: "flex flex-1 flex-col gap-3 md:w-0", children: [jsxs("div", { className: "flex flex-col gap-1 overflow-auto", children: [jsx("p", { className: "pr-8 text-sm font-semibold text-secondary md:truncate md:pr-0", children: title }), jsx("p", { className: "text-sm text-tertiary md:truncate", children: description })] }), (onConfirm || onClose) && (jsxs("div", { className: "flex gap-3", children: [onClose && (jsx(Button, { onClick: onClose, size: "sm", color: "link-gray", "data-testid": joinTestId(alertTestId, 'dismiss'), children: dismissLabel })), onConfirm && (jsx(Button, { onClick: onConfirm, size: "sm", color: "link-color", "data-testid": joinTestId(alertTestId, 'confirm'), children: confirmLabel }))] }))] }), onClose && (jsx(CloseButton, { onClick: onClose, size: "sm", label: dismissLabel, className: "absolute top-2 right-2", "data-testid": joinTestId(alertTestId, 'close') }))] }));
|
|
17
|
-
};
|
|
18
|
-
/**
|
|
19
|
-
* Full-width banner alert for site-wide or layout-level notices with optional confirm and dismiss actions.
|
|
20
|
-
*
|
|
21
|
-
* @summary full-width banner alert for site-wide notices
|
|
22
|
-
*/
|
|
23
|
-
const AlertFullWidth = ({ title, description, confirmLabel, onClose, onConfirm, color = 'default', actionType = 'button', dismissLabel = 'Dismiss', 'data-testid': dataTestId, }) => {
|
|
24
|
-
const alertTestId = useResolvedTestId({ testId: dataTestId, segment: 'alert-full-width', rootName: 'alert-full-width' });
|
|
25
|
-
return (jsx("div", { "data-testid": alertTestId, className: "relative border-t border-primary bg-secondary md:border-t-0 md:border-b", children: jsxs("div", { className: "mx-auto flex max-w-container flex-col gap-4 p-4 md:flex-row md:items-center md:gap-3 md:px-8 md:py-3", children: [jsxs("div", { className: "flex flex-1 flex-col gap-4 md:w-0 md:flex-row md:items-center", children: [jsx(FeaturedIcon, { className: "hidden md:flex", ...getStatusFeaturedIconProps(color), size: "md" }), jsxs("div", { className: "flex flex-col gap-0.5 overflow-hidden lg:flex-row lg:gap-1.5", children: [jsx("p", { className: "pr-8 text-sm font-semibold text-secondary md:truncate md:pr-0", children: title }), jsx("p", { className: "text-sm text-tertiary md:truncate", children: description })] })] }), (onConfirm || onClose) && (jsxs("div", { className: "flex gap-2", children: [jsxs("div", { className: cx('flex w-full gap-3', actionType === 'button' ? 'flex-col-reverse md:flex-row' : 'flex-row'), children: [onClose && (jsx(Button, { onClick: onClose, color: actionType === 'button' ? 'secondary' : 'link-gray', size: "sm", "data-testid": joinTestId(alertTestId, 'dismiss'), children: dismissLabel })), onConfirm && (jsx(Button, { onClick: onConfirm, color: actionType === 'button' ? 'primary' : 'link-color', size: "sm", "data-testid": joinTestId(alertTestId, 'confirm'), children: confirmLabel }))] }), onClose && (jsx(CloseButton, { onClick: onClose, size: "sm", label: dismissLabel, className: "absolute top-2 right-2 shrink-0 md:static", "data-testid": joinTestId(alertTestId, 'close') }))] }))] }) }));
|
|
26
|
-
};
|
|
3
|
+
/** @deprecated Import from `@flipdish/ui-library/components/molecules/Alerts`. Removed in the next major. */
|
|
4
|
+
const AlertFloating = AlertFloating$1;
|
|
5
|
+
/** @deprecated Import from `@flipdish/ui-library/components/molecules/Alerts`. Removed in the next major. */
|
|
6
|
+
const AlertFullWidth = AlertFullWidth$1;
|
|
27
7
|
|
|
28
8
|
export { AlertFloating, AlertFullWidth };
|
|
29
9
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/molecules/Alert/index.tsx"],"sourcesContent":[null],"names":["
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/molecules/Alert/index.tsx"],"sourcesContent":[null],"names":["AlertFloatingNext","AlertFullWidthNext"],"mappings":";;AAWA;AACO,MAAM,aAAa,GAAGA;AAC7B;AACO,MAAM,cAAc,GAAGC;;"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var Button = require('@flipdish/ui-library/components/atoms/Button');
|
|
5
|
+
var CloseButton = require('@flipdish/ui-library/components/atoms/CloseButton');
|
|
6
|
+
var FeaturedIcon = require('@flipdish/ui-library/components/atoms/FeaturedIcon');
|
|
7
|
+
var cx = require('@flipdish/ui-library/utilities/cx');
|
|
8
|
+
var testIdUtils = require('@flipdish/ui-library/utilities/testIdUtils');
|
|
9
|
+
var statusIcon_utils = require('../../../__internal__/statusIcon/statusIcon.utils.cjs');
|
|
10
|
+
var useAlertActions = require('../hooks/useAlertActions.cjs');
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Floating card alert for in-page contextual notices with optional confirm and dismiss actions.
|
|
14
|
+
*
|
|
15
|
+
* @summary in-page alert card with confirm and dismiss actions
|
|
16
|
+
*/
|
|
17
|
+
const AlertFloating = ({ title, description, confirmLabel, onClose, onConfirm, color = 'default', dismissLabel = 'Dismiss', returnFocusTo, 'data-testid': dataTestId, }) => {
|
|
18
|
+
const alertTestId = testIdUtils.useResolvedTestId({ testId: dataTestId, segment: 'alert-floating', rootName: 'alert-floating' });
|
|
19
|
+
const { originRef, leaveThen } = useAlertActions.useAlertActions(returnFocusTo);
|
|
20
|
+
const close = leaveThen(onClose);
|
|
21
|
+
const confirm = leaveThen(onConfirm);
|
|
22
|
+
return (jsxRuntime.jsxs("div", { ref: originRef, "data-testid": alertTestId, className: "relative flex flex-col gap-4 rounded-xl border border-primary bg-primary_alt p-4 shadow-xs md:flex-row", children: [jsxRuntime.jsx(FeaturedIcon.FeaturedIcon, { ...statusIcon_utils.getStatusFeaturedIconProps(color), size: "md" }), jsxRuntime.jsxs("div", { className: "flex flex-1 flex-col gap-3 md:w-0", children: [jsxRuntime.jsxs("div", { className: "flex flex-col gap-1 overflow-auto", children: [jsxRuntime.jsx("p", { className: "pr-8 text-sm font-semibold text-secondary md:truncate md:pr-0", children: title }), jsxRuntime.jsx("p", { className: "text-sm text-tertiary md:truncate", children: description })] }), (onConfirm || onClose) && (jsxRuntime.jsxs("div", { className: "flex gap-3", children: [onClose && (jsxRuntime.jsx(Button.Button, { onClick: close, size: "sm", color: "link-gray", "data-testid": testIdUtils.joinTestId(alertTestId, 'dismiss'), children: dismissLabel })), onConfirm && (jsxRuntime.jsx(Button.Button, { onClick: confirm, size: "sm", color: "link-color", "data-testid": testIdUtils.joinTestId(alertTestId, 'confirm'), children: confirmLabel }))] }))] }), onClose && (jsxRuntime.jsx(CloseButton.CloseButton, { onClick: close, size: "sm", label: dismissLabel, className: "absolute top-2 right-2", "data-testid": testIdUtils.joinTestId(alertTestId, 'close') }))] }));
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Full-width banner alert for site-wide or layout-level notices with optional confirm and dismiss actions.
|
|
26
|
+
*
|
|
27
|
+
* @summary full-width banner alert for site-wide notices
|
|
28
|
+
*/
|
|
29
|
+
const AlertFullWidth = ({ title, description, confirmLabel, onClose, onConfirm, color = 'default', actionType = 'button', dismissLabel = 'Dismiss', returnFocusTo, 'data-testid': dataTestId, }) => {
|
|
30
|
+
const alertTestId = testIdUtils.useResolvedTestId({ testId: dataTestId, segment: 'alert-full-width', rootName: 'alert-full-width' });
|
|
31
|
+
const { originRef, leaveThen } = useAlertActions.useAlertActions(returnFocusTo);
|
|
32
|
+
const close = leaveThen(onClose);
|
|
33
|
+
const confirm = leaveThen(onConfirm);
|
|
34
|
+
return (jsxRuntime.jsx("div", { ref: originRef, "data-testid": alertTestId, className: "relative border-t border-primary bg-secondary md:border-t-0 md:border-b", children: jsxRuntime.jsxs("div", { className: "mx-auto flex max-w-container flex-col gap-4 p-4 md:flex-row md:items-center md:gap-3 md:px-8 md:py-3", children: [jsxRuntime.jsxs("div", { className: "flex flex-1 flex-col gap-4 md:w-0 md:flex-row md:items-center", children: [jsxRuntime.jsx(FeaturedIcon.FeaturedIcon, { className: "hidden md:flex", ...statusIcon_utils.getStatusFeaturedIconProps(color), size: "md" }), jsxRuntime.jsxs("div", { className: "flex flex-col gap-0.5 overflow-hidden lg:flex-row lg:gap-1.5", children: [jsxRuntime.jsx("p", { className: "pr-8 text-sm font-semibold text-secondary md:truncate md:pr-0", children: title }), jsxRuntime.jsx("p", { className: "text-sm text-tertiary md:truncate", children: description })] })] }), (onConfirm || onClose) && (jsxRuntime.jsxs("div", { className: "flex gap-2", children: [jsxRuntime.jsxs("div", { className: cx.cx('flex w-full gap-3', actionType === 'button' ? 'flex-col-reverse md:flex-row' : 'flex-row'), children: [onClose && (jsxRuntime.jsx(Button.Button, { onClick: close, color: actionType === 'button' ? 'secondary' : 'link-gray', size: "sm", "data-testid": testIdUtils.joinTestId(alertTestId, 'dismiss'), children: dismissLabel })), onConfirm && (jsxRuntime.jsx(Button.Button, { onClick: confirm, color: actionType === 'button' ? 'primary' : 'link-color', size: "sm", "data-testid": testIdUtils.joinTestId(alertTestId, 'confirm'), children: confirmLabel }))] }), onClose && (jsxRuntime.jsx(CloseButton.CloseButton, { onClick: close, size: "sm", label: dismissLabel, className: "absolute top-2 right-2 shrink-0 md:static", "data-testid": testIdUtils.joinTestId(alertTestId, 'close') }))] }))] }) }));
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
exports.AlertFloating = AlertFloating;
|
|
38
|
+
exports.AlertFullWidth = AlertFullWidth;
|
|
39
|
+
//# sourceMappingURL=Alert.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Alert.cjs","sources":["../../../../../src/components/molecules/Alerts/components/Alert.tsx"],"sourcesContent":[null],"names":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IC,sBAAU,CAAC,WAAW,EAAE,SAAS,CAAC,EAAA,QAAA,EAE9C,YAAY,EAAA,CACN,CACV,CAAA,EAAA,CACG,EAEL,OAAO,KACNJ,eAACK,uBAAW,EAAA,EACV,OAAO,EAAE,KAAK,EACd,IAAI,EAAC,IAAI,EACT,KAAK,EAAE,YAAY,EACnB,SAAS,EAAC,2CAA2C,EAAA,aAAA,EACxCD,sBAAU,CAAC,WAAW,EAAE,OAAO,CAAC,EAAA,CAC7C,CACH,IACG,CACP,CAAA,EAAA,CACG,EAAA,CACF;AAEV;;;"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { StatusColor } from '../../../__internal__/statusIcon/statusIcon.types';
|
|
3
|
+
export interface AlertFloatingProps {
|
|
4
|
+
/**
|
|
5
|
+
* The title of the alert.
|
|
6
|
+
*/
|
|
7
|
+
title: string;
|
|
8
|
+
/**
|
|
9
|
+
* The description of the alert.
|
|
10
|
+
*/
|
|
11
|
+
description: ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* The label for the confirm button.
|
|
14
|
+
*/
|
|
15
|
+
confirmLabel: string;
|
|
16
|
+
/**
|
|
17
|
+
* The label for the dismiss button.
|
|
18
|
+
* @default "Dismiss"
|
|
19
|
+
*/
|
|
20
|
+
dismissLabel?: string;
|
|
21
|
+
/**
|
|
22
|
+
* The color of the alert.
|
|
23
|
+
* @default "default"
|
|
24
|
+
*/
|
|
25
|
+
color?: StatusColor;
|
|
26
|
+
/**
|
|
27
|
+
* The function to call when the dismiss button is clicked.
|
|
28
|
+
*/
|
|
29
|
+
onClose?: () => void;
|
|
30
|
+
/**
|
|
31
|
+
* The function to call when the confirm button is clicked.
|
|
32
|
+
*/
|
|
33
|
+
onConfirm?: () => void;
|
|
34
|
+
/**
|
|
35
|
+
* A CSS selector for the control that takes focus when a button on the alert is pressed. Set it when pressing one
|
|
36
|
+
* removes the alert, or focus is lost to the top of the page.
|
|
37
|
+
*/
|
|
38
|
+
returnFocusTo?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Overrides the `data-testid` (defaults to `fd-alert-floating`). The confirm,
|
|
41
|
+
* dismiss, and close controls derive their ids from this prefix.
|
|
42
|
+
*/
|
|
43
|
+
'data-testid'?: string;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Floating card alert for in-page contextual notices with optional confirm and dismiss actions.
|
|
47
|
+
*
|
|
48
|
+
* @summary in-page alert card with confirm and dismiss actions
|
|
49
|
+
*/
|
|
50
|
+
export declare const AlertFloating: ({ title, description, confirmLabel, onClose, onConfirm, color, dismissLabel, returnFocusTo, "data-testid": dataTestId, }: AlertFloatingProps) => import("react").JSX.Element;
|
|
51
|
+
export interface AlertFullWidthProps {
|
|
52
|
+
/**
|
|
53
|
+
* The title of the alert.
|
|
54
|
+
*/
|
|
55
|
+
title: string;
|
|
56
|
+
/**
|
|
57
|
+
* The description of the alert.
|
|
58
|
+
*/
|
|
59
|
+
description: ReactNode;
|
|
60
|
+
/**
|
|
61
|
+
* The label for the confirm button.
|
|
62
|
+
*/
|
|
63
|
+
confirmLabel: string;
|
|
64
|
+
/**
|
|
65
|
+
* The label for the dismiss button.
|
|
66
|
+
* @default "Dismiss"
|
|
67
|
+
*/
|
|
68
|
+
dismissLabel?: string;
|
|
69
|
+
/**
|
|
70
|
+
* The type of the action buttons.
|
|
71
|
+
* @default "button"
|
|
72
|
+
*/
|
|
73
|
+
actionType?: 'button' | 'link';
|
|
74
|
+
/**
|
|
75
|
+
* The color of the alert.
|
|
76
|
+
* @default "default"
|
|
77
|
+
*/
|
|
78
|
+
color?: StatusColor;
|
|
79
|
+
/**
|
|
80
|
+
* The function to call when the dismiss button is clicked.
|
|
81
|
+
*/
|
|
82
|
+
onClose?: () => void;
|
|
83
|
+
/**
|
|
84
|
+
* The function to call when the confirm button is clicked.
|
|
85
|
+
*/
|
|
86
|
+
onConfirm?: () => void;
|
|
87
|
+
/**
|
|
88
|
+
* A CSS selector for the control that takes focus when a button on the alert is pressed. Set it when pressing one
|
|
89
|
+
* removes the alert, or focus is lost to the top of the page.
|
|
90
|
+
*/
|
|
91
|
+
returnFocusTo?: string;
|
|
92
|
+
/**
|
|
93
|
+
* Overrides the `data-testid` (defaults to `fd-alert-full-width`). The confirm,
|
|
94
|
+
* dismiss, and close controls derive their ids from this prefix.
|
|
95
|
+
*/
|
|
96
|
+
'data-testid'?: string;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Full-width banner alert for site-wide or layout-level notices with optional confirm and dismiss actions.
|
|
100
|
+
*
|
|
101
|
+
* @summary full-width banner alert for site-wide notices
|
|
102
|
+
*/
|
|
103
|
+
export declare const AlertFullWidth: ({ title, description, confirmLabel, onClose, onConfirm, color, actionType, dismissLabel, returnFocusTo, "data-testid": dataTestId, }: AlertFullWidthProps) => import("react").JSX.Element;
|
|
104
|
+
//# sourceMappingURL=Alert.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Alert.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/Alerts/components/Alert.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mDAAmD,CAAC;AAGrF,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,WAAW,EAAE,SAAS,CAAC;IACvB;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;GAIG;AACH,eAAO,MAAM,aAAa,GAAI,0HAU3B,kBAAkB,gCA+CpB,CAAC;AAEF,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,WAAW,EAAE,SAAS,CAAC;IACvB;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,UAAU,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;IAC/B;;;OAGG;IACH,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;GAIG;AACH,eAAO,MAAM,cAAc,GAAI,sIAW5B,mBAAmB,gCAyDrB,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { Button } from '@flipdish/ui-library/components/atoms/Button';
|
|
3
|
+
import { CloseButton } from '@flipdish/ui-library/components/atoms/CloseButton';
|
|
4
|
+
import { FeaturedIcon } from '@flipdish/ui-library/components/atoms/FeaturedIcon';
|
|
5
|
+
import { cx } from '@flipdish/ui-library/utilities/cx';
|
|
6
|
+
import { useResolvedTestId, joinTestId } from '@flipdish/ui-library/utilities/testIdUtils';
|
|
7
|
+
import { getStatusFeaturedIconProps } from '../../../__internal__/statusIcon/statusIcon.utils.js';
|
|
8
|
+
import { useAlertActions } from '../hooks/useAlertActions.js';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Floating card alert for in-page contextual notices with optional confirm and dismiss actions.
|
|
12
|
+
*
|
|
13
|
+
* @summary in-page alert card with confirm and dismiss actions
|
|
14
|
+
*/
|
|
15
|
+
const AlertFloating = ({ title, description, confirmLabel, onClose, onConfirm, color = 'default', dismissLabel = 'Dismiss', returnFocusTo, 'data-testid': dataTestId, }) => {
|
|
16
|
+
const alertTestId = useResolvedTestId({ testId: dataTestId, segment: 'alert-floating', rootName: 'alert-floating' });
|
|
17
|
+
const { originRef, leaveThen } = useAlertActions(returnFocusTo);
|
|
18
|
+
const close = leaveThen(onClose);
|
|
19
|
+
const confirm = leaveThen(onConfirm);
|
|
20
|
+
return (jsxs("div", { ref: originRef, "data-testid": alertTestId, className: "relative flex flex-col gap-4 rounded-xl border border-primary bg-primary_alt p-4 shadow-xs md:flex-row", children: [jsx(FeaturedIcon, { ...getStatusFeaturedIconProps(color), size: "md" }), jsxs("div", { className: "flex flex-1 flex-col gap-3 md:w-0", children: [jsxs("div", { className: "flex flex-col gap-1 overflow-auto", children: [jsx("p", { className: "pr-8 text-sm font-semibold text-secondary md:truncate md:pr-0", children: title }), jsx("p", { className: "text-sm text-tertiary md:truncate", children: description })] }), (onConfirm || onClose) && (jsxs("div", { className: "flex gap-3", children: [onClose && (jsx(Button, { onClick: close, size: "sm", color: "link-gray", "data-testid": joinTestId(alertTestId, 'dismiss'), children: dismissLabel })), onConfirm && (jsx(Button, { onClick: confirm, size: "sm", color: "link-color", "data-testid": joinTestId(alertTestId, 'confirm'), children: confirmLabel }))] }))] }), onClose && (jsx(CloseButton, { onClick: close, size: "sm", label: dismissLabel, className: "absolute top-2 right-2", "data-testid": joinTestId(alertTestId, 'close') }))] }));
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Full-width banner alert for site-wide or layout-level notices with optional confirm and dismiss actions.
|
|
24
|
+
*
|
|
25
|
+
* @summary full-width banner alert for site-wide notices
|
|
26
|
+
*/
|
|
27
|
+
const AlertFullWidth = ({ title, description, confirmLabel, onClose, onConfirm, color = 'default', actionType = 'button', dismissLabel = 'Dismiss', returnFocusTo, 'data-testid': dataTestId, }) => {
|
|
28
|
+
const alertTestId = useResolvedTestId({ testId: dataTestId, segment: 'alert-full-width', rootName: 'alert-full-width' });
|
|
29
|
+
const { originRef, leaveThen } = useAlertActions(returnFocusTo);
|
|
30
|
+
const close = leaveThen(onClose);
|
|
31
|
+
const confirm = leaveThen(onConfirm);
|
|
32
|
+
return (jsx("div", { ref: originRef, "data-testid": alertTestId, className: "relative border-t border-primary bg-secondary md:border-t-0 md:border-b", children: jsxs("div", { className: "mx-auto flex max-w-container flex-col gap-4 p-4 md:flex-row md:items-center md:gap-3 md:px-8 md:py-3", children: [jsxs("div", { className: "flex flex-1 flex-col gap-4 md:w-0 md:flex-row md:items-center", children: [jsx(FeaturedIcon, { className: "hidden md:flex", ...getStatusFeaturedIconProps(color), size: "md" }), jsxs("div", { className: "flex flex-col gap-0.5 overflow-hidden lg:flex-row lg:gap-1.5", children: [jsx("p", { className: "pr-8 text-sm font-semibold text-secondary md:truncate md:pr-0", children: title }), jsx("p", { className: "text-sm text-tertiary md:truncate", children: description })] })] }), (onConfirm || onClose) && (jsxs("div", { className: "flex gap-2", children: [jsxs("div", { className: cx('flex w-full gap-3', actionType === 'button' ? 'flex-col-reverse md:flex-row' : 'flex-row'), children: [onClose && (jsx(Button, { onClick: close, color: actionType === 'button' ? 'secondary' : 'link-gray', size: "sm", "data-testid": joinTestId(alertTestId, 'dismiss'), children: dismissLabel })), onConfirm && (jsx(Button, { onClick: confirm, color: actionType === 'button' ? 'primary' : 'link-color', size: "sm", "data-testid": joinTestId(alertTestId, 'confirm'), children: confirmLabel }))] }), onClose && (jsx(CloseButton, { onClick: close, size: "sm", label: dismissLabel, className: "absolute top-2 right-2 shrink-0 md:static", "data-testid": joinTestId(alertTestId, 'close') }))] }))] }) }));
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export { AlertFloating, AlertFullWidth };
|
|
36
|
+
//# sourceMappingURL=Alert.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Alert.js","sources":["../../../../../src/components/molecules/Alerts/components/Alert.tsx"],"sourcesContent":[null],"names":["_jsxs","_jsx"],"mappings":";;;;;;;;;AAuDA;;;;AAIG;AACI,MAAM,aAAa,GAAG,CAAC,EAC5B,KAAK,EACL,WAAW,EACX,YAAY,EACZ,OAAO,EACP,SAAS,EACT,KAAK,GAAG,SAAS,EACjB,YAAY,GAAG,SAAS,EACxB,aAAa,EACb,aAAa,EAAE,UAAU,GACN,KAAI;AACvB,IAAA,MAAM,WAAW,GAAG,iBAAiB,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,gBAAgB,EAAE,CAAC;IACpH,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,eAAe,CAAC,aAAa,CAAC;AAC/D,IAAA,MAAM,KAAK,GAAG,SAAS,CAAC,OAAO,CAAC;AAChC,IAAA,MAAM,OAAO,GAAG,SAAS,CAAC,SAAS,CAAC;AAEpC,IAAA,QACEA,IAAA,CAAA,KAAA,EAAA,EACE,GAAG,EAAE,SAAS,iBACD,WAAW,EACxB,SAAS,EAAC,wGAAwG,EAAA,QAAA,EAAA,CAElHC,GAAA,CAAC,YAAY,EAAA,EAAA,GAAK,0BAA0B,CAAC,KAAK,CAAC,EAAE,IAAI,EAAC,IAAI,EAAA,CAAG,EAEjED,cAAK,SAAS,EAAC,mCAAmC,EAAA,QAAA,EAAA,CAChDA,cAAK,SAAS,EAAC,mCAAmC,EAAA,QAAA,EAAA,CAChDC,WAAG,SAAS,EAAC,+DAA+D,EAAA,QAAA,EAAE,KAAK,EAAA,CAAK,EACxFA,GAAA,CAAA,GAAA,EAAA,EAAG,SAAS,EAAC,mCAAmC,EAAA,QAAA,EAAE,WAAW,EAAA,CAAK,IAC9D,EAEL,CAAC,SAAS,IAAI,OAAO,MACpBD,IAAA,CAAA,KAAA,EAAA,EAAK,SAAS,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iBACI,UAAU,CAAC,WAAW,EAAE,SAAS,CAAC,EAAA,QAAA,EAE9C,YAAY,EAAA,CACN,CACV,CAAA,EAAA,CACG,EAEL,OAAO,KACNA,IAAC,WAAW,EAAA,EACV,OAAO,EAAE,KAAK,EACd,IAAI,EAAC,IAAI,EACT,KAAK,EAAE,YAAY,EACnB,SAAS,EAAC,2CAA2C,EAAA,aAAA,EACxC,UAAU,CAAC,WAAW,EAAE,OAAO,CAAC,EAAA,CAC7C,CACH,IACG,CACP,CAAA,EAAA,CACG,EAAA,CACF;AAEV;;"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var testIdUtils = require('@flipdish/ui-library/utilities/testIdUtils');
|
|
5
|
+
var useAlertActions = require('../hooks/useAlertActions.cjs');
|
|
6
|
+
var Alert = require('./Alert.cjs');
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Reports a save that failed outright: announced as an alert with "Try again", while the user's edits stay in place.
|
|
10
|
+
* Render it inside the form or section whose save failed, beside the control that started it.
|
|
11
|
+
*
|
|
12
|
+
* @summary inline alert for a failed save, with a retry
|
|
13
|
+
*/
|
|
14
|
+
const SaveErrorAlert = ({ title, description, onRetry, onDismiss, returnFocusTo = 'button[type="submit"]', 'data-testid': dataTestId, }) => {
|
|
15
|
+
const rootTestId = testIdUtils.useResolvedTestId({ testId: dataTestId, segment: 'save-error-alert', rootName: 'save-error-alert' });
|
|
16
|
+
// Its own form or section only: the default names any submit button, and one elsewhere on the page is not this save's.
|
|
17
|
+
const { originRef, leaveThen } = useAlertActions.useAlertActions(returnFocusTo, 'form, section');
|
|
18
|
+
return (
|
|
19
|
+
// Focus stays where the user was: a field keeps it through the save, so the alert only has to be announced.
|
|
20
|
+
jsxRuntime.jsx("div", { role: "alert", ref: originRef, children: jsxRuntime.jsx(Alert.AlertFloating, { color: "error", title: title, description: description, confirmLabel: "Try again",
|
|
21
|
+
// Both buttons remove the alert, so each hands focus on first.
|
|
22
|
+
onConfirm: leaveThen(onRetry), onClose: leaveThen(onDismiss), "data-testid": rootTestId }) }));
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
exports.SaveErrorAlert = SaveErrorAlert;
|
|
26
|
+
//# sourceMappingURL=SaveErrorAlert.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SaveErrorAlert.cjs","sources":["../../../../../src/components/molecules/Alerts/components/SaveErrorAlert.tsx"],"sourcesContent":[null],"names":["useResolvedTestId","useAlertActions","_jsx","AlertFloating"],"mappings":";;;;;;;AAwBA;;;;;AAKG;MACU,cAAc,GAAG,CAAC,EAC7B,KAAK,EACL,WAAW,EACX,OAAO,EACP,SAAS,EACT,aAAa,GAAG,uBAAuB,EACvC,aAAa,EAAE,UAAU,GACL,KAAI;AACxB,IAAA,MAAM,UAAU,GAAGA,6BAAiB,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,kBAAkB,EAAE,CAAC;;AAEvH,IAAA,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,GAAGC,+BAAe,CAAC,aAAa,EAAE,eAAe,CAAC;IAEhF;;IAEEC,cAAA,CAAA,KAAA,EAAA,EAAK,IAAI,EAAC,OAAO,EAAC,GAAG,EAAE,SAAS,EAAA,QAAA,EAC9BA,cAAA,CAACC,mBAAa,EAAA,EACZ,KAAK,EAAC,OAAO,EACb,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,WAAW,EACxB,YAAY,EAAC,WAAW;;AAExB,YAAA,SAAS,EAAE,SAAS,CAAC,OAAO,CAAC,EAC7B,OAAO,EAAE,SAAS,CAAC,SAAS,CAAC,EAAA,aAAA,EAChB,UAAU,EAAA,CACvB,EAAA,CACE;AAEV;;"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface SaveErrorAlertProps {
|
|
2
|
+
/** What failed, such as "Your changes could not be saved". */
|
|
3
|
+
title: string;
|
|
4
|
+
/** What happened to the user's edits and what to do next. */
|
|
5
|
+
description: string;
|
|
6
|
+
/** Sends the same save again. */
|
|
7
|
+
onRetry: () => void;
|
|
8
|
+
/** Hides the alert; the caller stops rendering it. */
|
|
9
|
+
onDismiss: () => void;
|
|
10
|
+
/**
|
|
11
|
+
* A CSS selector for the control that takes focus when the alert leaves, found in the nearest form or section around
|
|
12
|
+
* it. Defaults to that form's submit button; name the control instead when a single control failed to save.
|
|
13
|
+
*/
|
|
14
|
+
returnFocusTo?: string;
|
|
15
|
+
/** Overrides the root `data-testid` (defaults to `fd-save-error-alert`); the retry, dismiss and close buttons derive theirs from it. */
|
|
16
|
+
'data-testid'?: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Reports a save that failed outright: announced as an alert with "Try again", while the user's edits stay in place.
|
|
20
|
+
* Render it inside the form or section whose save failed, beside the control that started it.
|
|
21
|
+
*
|
|
22
|
+
* @summary inline alert for a failed save, with a retry
|
|
23
|
+
*/
|
|
24
|
+
export declare const SaveErrorAlert: ({ title, description, onRetry, onDismiss, returnFocusTo, "data-testid": dataTestId, }: SaveErrorAlertProps) => import("react").JSX.Element;
|
|
25
|
+
//# sourceMappingURL=SaveErrorAlert.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SaveErrorAlert.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/Alerts/components/SaveErrorAlert.tsx"],"names":[],"mappings":"AAMA,MAAM,WAAW,mBAAmB;IAClC,8DAA8D;IAC9D,KAAK,EAAE,MAAM,CAAC;IACd,6DAA6D;IAC7D,WAAW,EAAE,MAAM,CAAC;IACpB,iCAAiC;IACjC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,sDAAsD;IACtD,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,wIAAwI;IACxI,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;GAKG;AACH,eAAO,MAAM,cAAc,GAAI,uFAO5B,mBAAmB,gCAoBrB,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useResolvedTestId } from '@flipdish/ui-library/utilities/testIdUtils';
|
|
3
|
+
import { useAlertActions } from '../hooks/useAlertActions.js';
|
|
4
|
+
import { AlertFloating } from './Alert.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Reports a save that failed outright: announced as an alert with "Try again", while the user's edits stay in place.
|
|
8
|
+
* Render it inside the form or section whose save failed, beside the control that started it.
|
|
9
|
+
*
|
|
10
|
+
* @summary inline alert for a failed save, with a retry
|
|
11
|
+
*/
|
|
12
|
+
const SaveErrorAlert = ({ title, description, onRetry, onDismiss, returnFocusTo = 'button[type="submit"]', 'data-testid': dataTestId, }) => {
|
|
13
|
+
const rootTestId = useResolvedTestId({ testId: dataTestId, segment: 'save-error-alert', rootName: 'save-error-alert' });
|
|
14
|
+
// Its own form or section only: the default names any submit button, and one elsewhere on the page is not this save's.
|
|
15
|
+
const { originRef, leaveThen } = useAlertActions(returnFocusTo, 'form, section');
|
|
16
|
+
return (
|
|
17
|
+
// Focus stays where the user was: a field keeps it through the save, so the alert only has to be announced.
|
|
18
|
+
jsx("div", { role: "alert", ref: originRef, children: jsx(AlertFloating, { color: "error", title: title, description: description, confirmLabel: "Try again",
|
|
19
|
+
// Both buttons remove the alert, so each hands focus on first.
|
|
20
|
+
onConfirm: leaveThen(onRetry), onClose: leaveThen(onDismiss), "data-testid": rootTestId }) }));
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export { SaveErrorAlert };
|
|
24
|
+
//# sourceMappingURL=SaveErrorAlert.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SaveErrorAlert.js","sources":["../../../../../src/components/molecules/Alerts/components/SaveErrorAlert.tsx"],"sourcesContent":[null],"names":["_jsx"],"mappings":";;;;;AAwBA;;;;;AAKG;MACU,cAAc,GAAG,CAAC,EAC7B,KAAK,EACL,WAAW,EACX,OAAO,EACP,SAAS,EACT,aAAa,GAAG,uBAAuB,EACvC,aAAa,EAAE,UAAU,GACL,KAAI;AACxB,IAAA,MAAM,UAAU,GAAG,iBAAiB,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,kBAAkB,EAAE,CAAC;;AAEvH,IAAA,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,eAAe,CAAC,aAAa,EAAE,eAAe,CAAC;IAEhF;;IAEEA,GAAA,CAAA,KAAA,EAAA,EAAK,IAAI,EAAC,OAAO,EAAC,GAAG,EAAE,SAAS,EAAA,QAAA,EAC9BA,GAAA,CAAC,aAAa,EAAA,EACZ,KAAK,EAAC,OAAO,EACb,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,WAAW,EACxB,YAAY,EAAC,WAAW;;AAExB,YAAA,SAAS,EAAE,SAAS,CAAC,OAAO,CAAC,EAC7B,OAAO,EAAE,SAAS,CAAC,SAAS,CAAC,EAAA,aAAA,EAChB,UAAU,EAAA,CACvB,EAAA,CACE;AAEV;;"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var useReturnFocus = require('../../../../hooks/__internal__/useReturnFocus/useReturnFocus.cjs');
|
|
4
|
+
|
|
5
|
+
// Nearest first, out to the page: the control named by `returnFocusTo` may sit beside the alert or anywhere around it.
|
|
6
|
+
const PAGE_CONTAINERS = 'form, section, main, body';
|
|
7
|
+
/**
|
|
8
|
+
* Wraps an alert's actions so focus leaves for the `returnFocusTo` control before the action runs: an action that
|
|
9
|
+
* removes the alert would otherwise drop focus to the top of the page.
|
|
10
|
+
*
|
|
11
|
+
* @param returnFocusTo The selector the consumer gave, or `undefined` to leave focus alone.
|
|
12
|
+
* @param containerSelector The containers the control is looked for in, nearest first; the whole page unless narrowed.
|
|
13
|
+
* @returns `originRef` for the alert's root, and `leaveThen`, which wraps a handler and keeps an absent one absent.
|
|
14
|
+
*/
|
|
15
|
+
const useAlertActions = (returnFocusTo, containerSelector = PAGE_CONTAINERS) => {
|
|
16
|
+
const { originRef, returnFocus } = useReturnFocus.useReturnFocus(returnFocusTo, containerSelector);
|
|
17
|
+
const leaveThen = (action) => action &&
|
|
18
|
+
(() => {
|
|
19
|
+
returnFocus();
|
|
20
|
+
action();
|
|
21
|
+
});
|
|
22
|
+
return { originRef, leaveThen };
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
exports.useAlertActions = useAlertActions;
|
|
26
|
+
//# sourceMappingURL=useAlertActions.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAlertActions.cjs","sources":["../../../../../src/components/molecules/Alerts/hooks/useAlertActions.ts"],"sourcesContent":[null],"names":["useReturnFocus"],"mappings":";;;;AAEA;AACA,MAAM,eAAe,GAAG,2BAA2B;AAEnD;;;;;;;AAOG;AACI,MAAM,eAAe,GAAG,CAAC,aAAiC,EAAE,iBAAiB,GAAG,eAAe,KAAI;AACxG,IAAA,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,GAAGA,6BAAc,CAAiB,aAAa,EAAE,iBAAiB,CAAC;AACnG,IAAA,MAAM,SAAS,GAAG,CAAC,MAAgC,KACjD,MAAM;AACN,SAAC,MAAK;AACJ,YAAA,WAAW,EAAE;AACb,YAAA,MAAM,EAAE;AACV,QAAA,CAAC,CAAC;AAEJ,IAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE;AACjC;;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wraps an alert's actions so focus leaves for the `returnFocusTo` control before the action runs: an action that
|
|
3
|
+
* removes the alert would otherwise drop focus to the top of the page.
|
|
4
|
+
*
|
|
5
|
+
* @param returnFocusTo The selector the consumer gave, or `undefined` to leave focus alone.
|
|
6
|
+
* @param containerSelector The containers the control is looked for in, nearest first; the whole page unless narrowed.
|
|
7
|
+
* @returns `originRef` for the alert's root, and `leaveThen`, which wraps a handler and keeps an absent one absent.
|
|
8
|
+
*/
|
|
9
|
+
export declare const useAlertActions: (returnFocusTo: string | undefined, containerSelector?: string) => {
|
|
10
|
+
originRef: import("react").RefObject<HTMLDivElement | null>;
|
|
11
|
+
leaveThen: (action: (() => void) | undefined) => (() => void) | undefined;
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=useAlertActions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAlertActions.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/Alerts/hooks/useAlertActions.ts"],"names":[],"mappings":"AAKA;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,GAAI,eAAe,MAAM,GAAG,SAAS,EAAE,0BAAmC;;wBAEzE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS;CAQpD,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { useReturnFocus } from '../../../../hooks/__internal__/useReturnFocus/useReturnFocus.js';
|
|
2
|
+
|
|
3
|
+
// Nearest first, out to the page: the control named by `returnFocusTo` may sit beside the alert or anywhere around it.
|
|
4
|
+
const PAGE_CONTAINERS = 'form, section, main, body';
|
|
5
|
+
/**
|
|
6
|
+
* Wraps an alert's actions so focus leaves for the `returnFocusTo` control before the action runs: an action that
|
|
7
|
+
* removes the alert would otherwise drop focus to the top of the page.
|
|
8
|
+
*
|
|
9
|
+
* @param returnFocusTo The selector the consumer gave, or `undefined` to leave focus alone.
|
|
10
|
+
* @param containerSelector The containers the control is looked for in, nearest first; the whole page unless narrowed.
|
|
11
|
+
* @returns `originRef` for the alert's root, and `leaveThen`, which wraps a handler and keeps an absent one absent.
|
|
12
|
+
*/
|
|
13
|
+
const useAlertActions = (returnFocusTo, containerSelector = PAGE_CONTAINERS) => {
|
|
14
|
+
const { originRef, returnFocus } = useReturnFocus(returnFocusTo, containerSelector);
|
|
15
|
+
const leaveThen = (action) => action &&
|
|
16
|
+
(() => {
|
|
17
|
+
returnFocus();
|
|
18
|
+
action();
|
|
19
|
+
});
|
|
20
|
+
return { originRef, leaveThen };
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export { useAlertActions };
|
|
24
|
+
//# sourceMappingURL=useAlertActions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAlertActions.js","sources":["../../../../../src/components/molecules/Alerts/hooks/useAlertActions.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAEA;AACA,MAAM,eAAe,GAAG,2BAA2B;AAEnD;;;;;;;AAOG;AACI,MAAM,eAAe,GAAG,CAAC,aAAiC,EAAE,iBAAiB,GAAG,eAAe,KAAI;AACxG,IAAA,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,GAAG,cAAc,CAAiB,aAAa,EAAE,iBAAiB,CAAC;AACnG,IAAA,MAAM,SAAS,GAAG,CAAC,MAAgC,KACjD,MAAM;AACN,SAAC,MAAK;AACJ,YAAA,WAAW,EAAE;AACb,YAAA,MAAM,EAAE;AACV,QAAA,CAAC,CAAC;AAEJ,IAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE;AACjC;;"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var Alert = require('./components/Alert.cjs');
|
|
4
|
+
var SaveErrorAlert = require('./components/SaveErrorAlert.cjs');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
exports.AlertFloating = Alert.AlertFloating;
|
|
9
|
+
exports.AlertFullWidth = Alert.AlertFullWidth;
|
|
10
|
+
exports.SaveErrorAlert = SaveErrorAlert.SaveErrorAlert;
|
|
11
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Inline alerts and their ready-made forms: `AlertFloating` and `AlertFullWidth` for a message you word yourself, and
|
|
3
|
+
* the alerts built on them for one job each, such as reporting a save that failed.
|
|
4
|
+
*
|
|
5
|
+
* Explicit named re-exports on purpose: `export *` would publish every symbol of every private sub-component file
|
|
6
|
+
* (import paths are the public API here), so this list is the single source of truth for what Alerts exposes.
|
|
7
|
+
*/
|
|
8
|
+
export type { AlertFloatingProps, AlertFullWidthProps } from './components/Alert';
|
|
9
|
+
export { AlertFloating, AlertFullWidth } from './components/Alert';
|
|
10
|
+
export type { SaveErrorAlertProps } from './components/SaveErrorAlert';
|
|
11
|
+
export { SaveErrorAlert } from './components/SaveErrorAlert';
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/Alerts/index.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,YAAY,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAClF,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACnE,YAAY,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -1,45 +1,15 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var cx = require('@flipdish/ui-library/utilities/cx');
|
|
5
|
-
var testIdUtils = require('@flipdish/ui-library/utilities/testIdUtils');
|
|
6
|
-
var reactAriaComponents = require('react-aria-components');
|
|
3
|
+
var Modals = require('@flipdish/ui-library/components/molecules/Modals');
|
|
7
4
|
|
|
8
|
-
/**
|
|
9
|
-
const DialogTrigger =
|
|
10
|
-
/**
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
*/
|
|
17
|
-
const ModalOverlay = ({ 'data-testid': dataTestId, ...props }) => {
|
|
18
|
-
const rootTestId = testIdUtils.useResolvedTestId({ testId: dataTestId, segment: 'modal', rootName: 'modal' });
|
|
19
|
-
return (jsxRuntime.jsx(testIdUtils.TestIdProvider, { value: rootTestId, children: jsxRuntime.jsx(reactAriaComponents.ModalOverlay, { ...props, "data-testid": rootTestId, className: (state) => cx.cx('fixed inset-0 z-50 flex min-h-dvh w-full items-end justify-center bg-overlay/70 px-4 outline-hidden backdrop-blur-[6px] sm:items-center sm:justify-center sm:px-8',
|
|
20
|
-
// Vertical padding
|
|
21
|
-
'pt-(--modal-pt) pb-(--modal-pb) [--modal-pb:clamp(16px,8vh,64px)] [--modal-pt:16px] sm:[--modal-pb:32px] sm:[--modal-pt:32px]',
|
|
22
|
-
// Animations
|
|
23
|
-
state.isEntering && 'duration-300 ease-out animate-in fade-in', state.isExiting && 'duration-200 ease-in animate-out fade-out', typeof props.className === 'function' ? props.className(state) : props.className) }) }));
|
|
24
|
-
};
|
|
25
|
-
/**
|
|
26
|
-
* Accessible overlay dialog built on react-aria primitives. Compose with `ModalOverlay`,
|
|
27
|
-
* `Dialog`, and optionally `DialogTrigger` to display focused content or actions in an overlay
|
|
28
|
-
* that blocks the rest of the page.
|
|
29
|
-
*
|
|
30
|
-
* @summary accessible overlay dialog for focused content or actions
|
|
31
|
-
*/
|
|
32
|
-
const Modal = (props) => (jsxRuntime.jsx(reactAriaComponents.Modal, { ...props, className: (state) => cx.cx('rounded-xl bg-primary align-middle shadow-xl outline-hidden max-sm:overflow-y-auto sm:rounded-2xl',
|
|
33
|
-
// Max height based on parent's vertical padding
|
|
34
|
-
'max-h-[calc(var(--visual-viewport-height)-var(--modal-pt)-var(--modal-pb))]',
|
|
35
|
-
// Animations
|
|
36
|
-
state.isEntering && 'duration-300 ease-out animate-in zoom-in-95', state.isExiting && 'duration-200 ease-in animate-out zoom-out-95', typeof props.className === 'function' ? props.className(state) : props.className) }));
|
|
37
|
-
/** Scrollable, focus-managed content container that sits inside `Modal` and holds the dialog's content. */
|
|
38
|
-
const Dialog = ({ 'data-testid': dataTestId, ...props }) => {
|
|
39
|
-
const prefix = testIdUtils.useTestIdPrefix();
|
|
40
|
-
const dialogTestId = dataTestId ?? (prefix ? testIdUtils.joinTestId(prefix, 'dialog') : undefined);
|
|
41
|
-
return (jsxRuntime.jsx(reactAriaComponents.Dialog, { ...props, "data-testid": dialogTestId, className: cx.cx('relative max-h-[inherit] w-full overflow-y-auto outline-hidden', props.className) }));
|
|
42
|
-
};
|
|
5
|
+
/** @deprecated Import from `@flipdish/ui-library/components/molecules/Modals`. Removed in the next major. */
|
|
6
|
+
const DialogTrigger = Modals.DialogTrigger;
|
|
7
|
+
/** @deprecated Import from `@flipdish/ui-library/components/molecules/Modals`. Removed in the next major. */
|
|
8
|
+
const ModalOverlay = Modals.ModalOverlay;
|
|
9
|
+
/** @deprecated Import from `@flipdish/ui-library/components/molecules/Modals`. Removed in the next major. */
|
|
10
|
+
const Modal = Modals.Modal;
|
|
11
|
+
/** @deprecated Import from `@flipdish/ui-library/components/molecules/Modals`. Removed in the next major. */
|
|
12
|
+
const Dialog = Modals.Dialog;
|
|
43
13
|
|
|
44
14
|
exports.Dialog = Dialog;
|
|
45
15
|
exports.DialogTrigger = DialogTrigger;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../../src/components/molecules/Modal/index.tsx"],"sourcesContent":[null],"names":["
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../../src/components/molecules/Modal/index.tsx"],"sourcesContent":[null],"names":["DialogTriggerNext","ModalOverlayNext","ModalNext","DialogNext"],"mappings":";;;;AAaA;AACO,MAAM,aAAa,GAAGA;AAC7B;AACO,MAAM,YAAY,GAAGC;AAC5B;AACO,MAAM,KAAK,GAAGC;AACrB;AACO,MAAM,MAAM,GAAGC;;;;;"}
|
|
@@ -1,37 +1,14 @@
|
|
|
1
|
-
import type
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
|
|
14
|
-
* confirmation. Wrap `Modal` and `Dialog` in it; focus trapping, scroll lock and Escape are
|
|
15
|
-
* handled.
|
|
16
|
-
*
|
|
17
|
-
* @summary overlay dialog for focused input or confirmation
|
|
18
|
-
*/
|
|
19
|
-
export declare const ModalOverlay: ({ "data-testid": dataTestId, ...props }: ModalOverlayProps) => import("react").JSX.Element;
|
|
20
|
-
/**
|
|
21
|
-
* Accessible overlay dialog built on react-aria primitives. Compose with `ModalOverlay`,
|
|
22
|
-
* `Dialog`, and optionally `DialogTrigger` to display focused content or actions in an overlay
|
|
23
|
-
* that blocks the rest of the page.
|
|
24
|
-
*
|
|
25
|
-
* @summary accessible overlay dialog for focused content or actions
|
|
26
|
-
*/
|
|
27
|
-
export declare const Modal: (props: AriaModalOverlayProps) => import("react").JSX.Element;
|
|
28
|
-
export interface DialogProps extends AriaDialogProps {
|
|
29
|
-
/**
|
|
30
|
-
* Overrides the derived `data-testid` for the dialog (defaults to `<root>--dialog`,
|
|
31
|
-
* e.g. `fd-modal--dialog`, when nested under `ModalOverlay`).
|
|
32
|
-
*/
|
|
33
|
-
'data-testid'?: string;
|
|
34
|
-
}
|
|
35
|
-
/** Scrollable, focus-managed content container that sits inside `Modal` and holds the dialog's content. */
|
|
36
|
-
export declare const Dialog: ({ "data-testid": dataTestId, ...props }: DialogProps) => import("react").JSX.Element;
|
|
1
|
+
import { type DialogProps as DialogPropsNext, type ModalOverlayProps as ModalOverlayPropsNext } from '@flipdish/ui-library/components/molecules/Modals';
|
|
2
|
+
/** @deprecated Import from `@flipdish/ui-library/components/molecules/Modals`. Removed in the next major. */
|
|
3
|
+
export declare const DialogTrigger: typeof import("react-aria-components").DialogTrigger;
|
|
4
|
+
/** @deprecated Import from `@flipdish/ui-library/components/molecules/Modals`. Removed in the next major. */
|
|
5
|
+
export declare const ModalOverlay: ({ "data-testid": dataTestId, ...props }: ModalOverlayPropsNext) => import("react").JSX.Element;
|
|
6
|
+
/** @deprecated Import from `@flipdish/ui-library/components/molecules/Modals`. Removed in the next major. */
|
|
7
|
+
export declare const Modal: (props: import("react-aria-components").ModalOverlayProps) => import("react").JSX.Element;
|
|
8
|
+
/** @deprecated Import from `@flipdish/ui-library/components/molecules/Modals`. Removed in the next major. */
|
|
9
|
+
export declare const Dialog: ({ "data-testid": dataTestId, ...props }: DialogPropsNext) => import("react").JSX.Element;
|
|
10
|
+
/** @deprecated Import from `@flipdish/ui-library/components/molecules/Modals`. Removed in the next major. */
|
|
11
|
+
export type ModalOverlayProps = ModalOverlayPropsNext;
|
|
12
|
+
/** @deprecated Import from `@flipdish/ui-library/components/molecules/Modals`. Removed in the next major. */
|
|
13
|
+
export type DialogProps = DialogPropsNext;
|
|
37
14
|
//# sourceMappingURL=index.d.ts.map
|