@cambly/syntax-core 6.8.0 → 6.9.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/index.d.ts CHANGED
@@ -737,7 +737,7 @@ declare const sizeWidth: {
737
737
  };
738
738
  type ModalType = {
739
739
  /**
740
- * The modal's main content.
740
+ * The modal's main content. Should typically take in `Typography`'d text.
741
741
  */
742
742
  children: JSX.Element;
743
743
  /**
@@ -756,9 +756,22 @@ type ModalType = {
756
756
  */
757
757
  image?: JSX.Element;
758
758
  /**
759
- * The footer for the bottom area of the Modal.
760
- * Typically used for rendering buttons.
761
- * If two(2) buttons, put primary button _second_.
759
+ * The footer for the bottom area of the Modal. Typically used for rendering buttons.
760
+ * * Use Syntax `Button` and pass it into footer.
761
+ * * If one button, just pass it in. If two, wrap in a React fragment (`<> </>`)
762
+ * * If two(2) buttons, put primary button _second_.
763
+ *
764
+ <>
765
+ <Button
766
+ text="Cancel"
767
+ color="secondary"
768
+ onClick={() => {}}
769
+ />
770
+ <Button
771
+ text="Confirm"
772
+ onClick={() => {}}
773
+ />
774
+ </>
762
775
  */
763
776
  footer?: JSX.Element;
764
777
  /**
@@ -793,6 +806,36 @@ type ModalType = {
793
806
  };
794
807
  /**
795
808
  * [Modal](https://cambly-syntax.vercel.app/?path=/docs/components-modal--docs) is a dialog that appears on top of the main content and locks user interaction within the modal.
809
+ *
810
+ ```
811
+ const [showModal, setShowModal] = useState(false)
812
+
813
+ return (
814
+ <>
815
+ {showModal && <Modal
816
+ header="header text"
817
+ onDismiss={() => setShowModal(false)}
818
+ footer={
819
+ <>
820
+ <Button
821
+ text="Cancel"
822
+ color="secondary"
823
+ onClick={() => {}}
824
+ />
825
+ <Button
826
+ text="Confirm"
827
+ onClick={() => {}}
828
+ />
829
+ </>
830
+ }
831
+ >
832
+ <Typography>
833
+ Body text goes here!
834
+ </Typography>
835
+ </Modal> }
836
+ </>
837
+ )
838
+ ```
796
839
  */
797
840
  declare function Modal({ header, children, image, onDismiss, footer, accessibilityCloseLabel, size, zIndex, "data-testid": dataTestId, }: ModalType): ReactElement;
798
841
  declare namespace Modal {