@cambly/syntax-core 6.8.0 → 6.10.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 +53 -10
- package/dist/index.js.map +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -35,7 +35,7 @@ declare const Badge: ({ icon: Icon, text, color, }: {
|
|
|
35
35
|
* The icon to be displayed. Please use a [Material Icon](https://material.io/resources/icons/)
|
|
36
36
|
*/
|
|
37
37
|
icon?: React$1.ComponentType<{
|
|
38
|
-
className
|
|
38
|
+
className?: string | undefined;
|
|
39
39
|
}> | undefined;
|
|
40
40
|
/**
|
|
41
41
|
* The text to display inside the badge
|
|
@@ -432,13 +432,13 @@ type ButtonType = {
|
|
|
432
432
|
* The icon to be displayed at the start of the button. Please use a [Rounded Material Icon](https://material.io/resources/icons/?style=round)
|
|
433
433
|
*/
|
|
434
434
|
startIcon?: React__default.ComponentType<{
|
|
435
|
-
className
|
|
435
|
+
className?: string;
|
|
436
436
|
}>;
|
|
437
437
|
/**
|
|
438
438
|
* The icon to be displayed at the end of the button. Please use a [Rounded Material Icon](https://material.io/resources/icons/?style=round)
|
|
439
439
|
*/
|
|
440
440
|
endIcon?: React__default.ComponentType<{
|
|
441
|
-
className
|
|
441
|
+
className?: string;
|
|
442
442
|
}>;
|
|
443
443
|
/**
|
|
444
444
|
* The callback to be called when the button is clicked
|
|
@@ -632,7 +632,7 @@ type IconButtonType = {
|
|
|
632
632
|
* The icon to be displayed. Please use a [Rounded Material Icon](https://material.io/resources/icons/?style=round)
|
|
633
633
|
*/
|
|
634
634
|
icon: React__default.ComponentType<{
|
|
635
|
-
className
|
|
635
|
+
className?: string;
|
|
636
636
|
}>;
|
|
637
637
|
/**
|
|
638
638
|
* If `true`, the button will be disabled
|
|
@@ -707,13 +707,13 @@ declare function LinkButton({ text, href, target, rel, "data-testid": dataTestId
|
|
|
707
707
|
* The icon to be displayed at the start of the button. Please use a [Rounded Material Icon](https://material.io/resources/icons/?style=round)
|
|
708
708
|
*/
|
|
709
709
|
startIcon?: React__default.ComponentType<{
|
|
710
|
-
className
|
|
710
|
+
className?: string;
|
|
711
711
|
}>;
|
|
712
712
|
/**
|
|
713
713
|
* The icon to be displayed at the end of the button. Please use a [Rounded Material Icon](https://material.io/resources/icons/?style=round)
|
|
714
714
|
*/
|
|
715
715
|
endIcon?: React__default.ComponentType<{
|
|
716
|
-
className
|
|
716
|
+
className?: string;
|
|
717
717
|
}>;
|
|
718
718
|
/**
|
|
719
719
|
* An optional onClick event. This is used for certain wrapper's support (such as react-router-dom).
|
|
@@ -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
|
-
*
|
|
761
|
-
* If
|
|
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 {
|