@cambly/syntax-core 6.4.0 → 6.5.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.css +87 -105
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +90 -28
- package/dist/index.js +268 -174
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +261 -168
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -389,7 +389,7 @@ type ButtonType = {
|
|
|
389
389
|
*
|
|
390
390
|
* @defaultValue "primary"
|
|
391
391
|
*/
|
|
392
|
-
color?:
|
|
392
|
+
color?: "primary" | "secondary" | "tertiary" | "destructive-primary" | "destructive-secondary" | "destructive-tertiary" | "branded" | "success";
|
|
393
393
|
/**
|
|
394
394
|
* The size of the button
|
|
395
395
|
*
|
|
@@ -503,6 +503,51 @@ type CardType = {
|
|
|
503
503
|
*/
|
|
504
504
|
declare function Card({ children, size, "data-testid": dataTestId, }: CardType): JSX.Element;
|
|
505
505
|
|
|
506
|
+
/**
|
|
507
|
+
* [Checkbox](https://cambly-syntax.vercel.app/?path=/docs/components-checkbox--docs) is a clickable element that will show if an option has been selected or not.
|
|
508
|
+
*/
|
|
509
|
+
declare const Checkbox: ({ checked, "data-testid": dataTestId, disabled, size, label, error, onChange, }: {
|
|
510
|
+
/**
|
|
511
|
+
* Whether or not the box has been clicked
|
|
512
|
+
*
|
|
513
|
+
* @defaultValue false
|
|
514
|
+
*/
|
|
515
|
+
checked: boolean;
|
|
516
|
+
/**
|
|
517
|
+
* Test id for the checkbox
|
|
518
|
+
*/
|
|
519
|
+
"data-testid"?: string | undefined;
|
|
520
|
+
/**
|
|
521
|
+
* The callback to be called when the checkbox value changes
|
|
522
|
+
*/
|
|
523
|
+
onChange: React__default.ChangeEventHandler<HTMLInputElement>;
|
|
524
|
+
/**
|
|
525
|
+
* Whether or not the box is disabled
|
|
526
|
+
*
|
|
527
|
+
* @defaultValue false
|
|
528
|
+
*/
|
|
529
|
+
disabled?: boolean | undefined;
|
|
530
|
+
/**
|
|
531
|
+
* The size of the checkbox and icon
|
|
532
|
+
*
|
|
533
|
+
* * `sm`: 16px
|
|
534
|
+
* * `md`: 24px
|
|
535
|
+
*
|
|
536
|
+
* @defaultValue "md"
|
|
537
|
+
*/
|
|
538
|
+
size?: "sm" | "md" | undefined;
|
|
539
|
+
/**
|
|
540
|
+
* The text accompanying the checkbox
|
|
541
|
+
*/
|
|
542
|
+
label: string;
|
|
543
|
+
/**
|
|
544
|
+
* Whether or not there is an error with the input
|
|
545
|
+
*
|
|
546
|
+
* @defaultValue false
|
|
547
|
+
*/
|
|
548
|
+
error?: boolean | undefined;
|
|
549
|
+
}) => ReactElement;
|
|
550
|
+
|
|
506
551
|
/**
|
|
507
552
|
* [Divider](https://cambly-syntax.vercel.app/?path=/docs/components-divider--docs) is a thin horizontal line to group content in lists and layouts.
|
|
508
553
|
*/
|
|
@@ -538,7 +583,7 @@ declare const Heading: ({ align, as, children, color, size, }: {
|
|
|
538
583
|
*
|
|
539
584
|
* @defaultValue "gray900"
|
|
540
585
|
*/
|
|
541
|
-
color?: "gray200" | "gray900" | "gray700" | "gray800" | "white" | "primary" | "secondary" | "tertiary" | "
|
|
586
|
+
color?: "gray200" | "gray900" | "gray700" | "gray800" | "white" | "primary" | "secondary" | "tertiary" | "destructive-primary" | "destructive-secondary" | "destructive-tertiary" | "branded" | "success" | "inherit" | undefined;
|
|
542
587
|
/**
|
|
543
588
|
* Size of the text.
|
|
544
589
|
*
|
|
@@ -604,49 +649,66 @@ type IconButtonType = {
|
|
|
604
649
|
declare const IconButton: React__default.ForwardRefExoticComponent<IconButtonType & React__default.RefAttributes<HTMLButtonElement>>;
|
|
605
650
|
|
|
606
651
|
/**
|
|
607
|
-
* [
|
|
652
|
+
* [LinkButton](https://cambly-syntax.vercel.app/?path=/docs/components-linkbutton--docs) is a "variation" of Button that should look identical to Button, but should be used to render links instead.
|
|
608
653
|
*/
|
|
609
|
-
declare
|
|
654
|
+
declare function LinkButton({ text, href, target, "data-testid": dataTestId, color, size, fullWidth, startIcon: StartIcon, endIcon: EndIcon, onClick, }: {
|
|
610
655
|
/**
|
|
611
|
-
*
|
|
612
|
-
*
|
|
613
|
-
* @defaultValue false
|
|
656
|
+
* Test id for the button
|
|
614
657
|
*/
|
|
615
|
-
|
|
658
|
+
"data-testid"?: string;
|
|
616
659
|
/**
|
|
617
|
-
*
|
|
660
|
+
* The text to be displayed inside the button
|
|
618
661
|
*/
|
|
619
|
-
|
|
662
|
+
text: string;
|
|
620
663
|
/**
|
|
621
|
-
* The
|
|
664
|
+
* The link that the LinkButton should route to.
|
|
665
|
+
*
|
|
622
666
|
*/
|
|
623
|
-
|
|
667
|
+
href?: string;
|
|
624
668
|
/**
|
|
625
|
-
*
|
|
669
|
+
* The target attribute specifies where to open the linked document.
|
|
626
670
|
*
|
|
627
|
-
* @defaultValue false
|
|
628
671
|
*/
|
|
629
|
-
|
|
672
|
+
target?: "_blank" | "_self" | "_parent" | "_top";
|
|
630
673
|
/**
|
|
631
|
-
* The
|
|
632
|
-
*
|
|
633
|
-
* * `sm`: 16px
|
|
634
|
-
* * `md`: 24px
|
|
674
|
+
* The color of the button
|
|
635
675
|
*
|
|
636
|
-
* @defaultValue "
|
|
676
|
+
* @defaultValue "primary"
|
|
637
677
|
*/
|
|
638
|
-
|
|
678
|
+
color?: "primary" | "secondary" | "tertiary" | "destructive-primary" | "destructive-secondary" | "destructive-tertiary" | "branded" | "success";
|
|
639
679
|
/**
|
|
640
|
-
* The
|
|
680
|
+
* The size of the button
|
|
681
|
+
*
|
|
682
|
+
* * `sm`: 32px
|
|
683
|
+
* * `md`: 40px
|
|
684
|
+
* * `lg`: 48px
|
|
685
|
+
*
|
|
686
|
+
* @defaultValue "md"
|
|
641
687
|
*/
|
|
642
|
-
|
|
688
|
+
size?: (typeof Size)[number];
|
|
643
689
|
/**
|
|
644
|
-
*
|
|
690
|
+
* If `true`, the button will take up the full width of its container
|
|
645
691
|
*
|
|
646
692
|
* @defaultValue false
|
|
647
693
|
*/
|
|
648
|
-
|
|
649
|
-
|
|
694
|
+
fullWidth?: boolean;
|
|
695
|
+
/**
|
|
696
|
+
* The icon to be displayed at the start of the button. Please use a [Rounded Material Icon](https://material.io/resources/icons/?style=round)
|
|
697
|
+
*/
|
|
698
|
+
startIcon?: React__default.ComponentType<{
|
|
699
|
+
className: string;
|
|
700
|
+
}>;
|
|
701
|
+
/**
|
|
702
|
+
* The icon to be displayed at the end of the button. Please use a [Rounded Material Icon](https://material.io/resources/icons/?style=round)
|
|
703
|
+
*/
|
|
704
|
+
endIcon?: React__default.ComponentType<{
|
|
705
|
+
className: string;
|
|
706
|
+
}>;
|
|
707
|
+
/**
|
|
708
|
+
* An optional onClick event. This is used for certain wrapper's support (such as react-router-dom).
|
|
709
|
+
*/
|
|
710
|
+
onClick?: React__default.MouseEventHandler<HTMLAnchorElement>;
|
|
711
|
+
}): JSX.Element;
|
|
650
712
|
|
|
651
713
|
/**
|
|
652
714
|
* [MiniActionCard](https://cambly-syntax.vercel.app/?path=/docs/components-miniactioncard--docs) is component that alerts users to a call to action.
|
|
@@ -940,7 +1002,7 @@ declare const Typography: ({ align, as, children, color, inline, lineClamp, size
|
|
|
940
1002
|
*
|
|
941
1003
|
* @defaultValue "gray900"
|
|
942
1004
|
*/
|
|
943
|
-
color?: "gray200" | "gray900" | "gray700" | "gray800" | "white" | "primary" | "secondary" | "tertiary" | "
|
|
1005
|
+
color?: "gray200" | "gray900" | "gray700" | "gray800" | "white" | "primary" | "secondary" | "tertiary" | "destructive-primary" | "destructive-secondary" | "destructive-tertiary" | "branded" | "success" | "inherit" | undefined;
|
|
944
1006
|
/**
|
|
945
1007
|
* Whether the text should flow inline with other elements.
|
|
946
1008
|
*
|
|
@@ -989,4 +1051,4 @@ declare const Typography: ({ align, as, children, color, inline, lineClamp, size
|
|
|
989
1051
|
weight?: "regular" | "semiBold" | "bold" | "heavy" | undefined;
|
|
990
1052
|
}) => ReactElement;
|
|
991
1053
|
|
|
992
|
-
export { Avatar, Badge, Box, Button, ButtonGroup, Card, Checkbox, Divider, Heading, IconButton, MiniActionCard, Modal, RadioButton, SelectList, TextField, Typography };
|
|
1054
|
+
export { Avatar, Badge, Box, Button, ButtonGroup, Card, Checkbox, Divider, Heading, IconButton, LinkButton, MiniActionCard, Modal, RadioButton, SelectList, TextField, Typography };
|