@cambly/syntax-core 6.4.0 → 6.6.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
@@ -1,5 +1,5 @@
1
1
  import * as React$1 from 'react';
2
- import React__default, { ReactNode, AriaRole, ReactElement, HTMLInputTypeAttribute } from 'react';
2
+ import React__default, { ReactNode, AriaRole, ReactElement, HtmlHTMLAttributes, HTMLInputTypeAttribute } from 'react';
3
3
 
4
4
  /**
5
5
  * [Avatar](https://cambly-syntax.vercel.app/?path=/docs/components-avatar--docs) is a circular image that represents a user.
@@ -389,7 +389,7 @@ type ButtonType = {
389
389
  *
390
390
  * @defaultValue "primary"
391
391
  */
392
- color?: (typeof Color)[number];
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" | "branded" | "destructive-primary" | "destructive-secondary" | "destructive-tertiary" | "success" | "inherit" | undefined;
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,71 @@ type IconButtonType = {
604
649
  declare const IconButton: React__default.ForwardRefExoticComponent<IconButtonType & React__default.RefAttributes<HTMLButtonElement>>;
605
650
 
606
651
  /**
607
- * [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.
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 const Checkbox: ({ checked, "data-testid": dataTestId, disabled, size, label, error, onChange, }: {
654
+ declare function LinkButton({ text, href, target, rel, "data-testid": dataTestId, color, size, fullWidth, startIcon: StartIcon, endIcon: EndIcon, onClick, }: {
610
655
  /**
611
- * Whether or not the box has been clicked
612
- *
613
- * @defaultValue false
656
+ * Test id for the button
614
657
  */
615
- checked: boolean;
658
+ "data-testid"?: string;
616
659
  /**
617
- * Test id for the checkbox
660
+ * The text to be displayed inside the button
618
661
  */
619
- "data-testid"?: string | undefined;
662
+ text: string;
620
663
  /**
621
- * The callback to be called when the checkbox value changes
664
+ * The link that the LinkButton should route to.
665
+ *
622
666
  */
623
- onChange: React__default.ChangeEventHandler<HTMLInputElement>;
667
+ href?: string;
624
668
  /**
625
- * Whether or not the box is disabled
669
+ * The target attribute specifies where to open the linked document.
626
670
  *
627
- * @defaultValue false
628
671
  */
629
- disabled?: boolean | undefined;
672
+ target?: "_blank" | "_self" | "_parent" | "_top";
630
673
  /**
631
- * The size of the checkbox and icon
674
+ * The target attribute specifies where to open the linked document.
632
675
  *
633
- * * `sm`: 16px
634
- * * `md`: 24px
676
+ */
677
+ rel?: HtmlHTMLAttributes<HTMLAnchorElement>["rel"];
678
+ /**
679
+ * The color of the button
635
680
  *
636
- * @defaultValue "md"
681
+ * @defaultValue "primary"
637
682
  */
638
- size?: "sm" | "md" | undefined;
683
+ color?: "primary" | "secondary" | "tertiary" | "destructive-primary" | "destructive-secondary" | "destructive-tertiary" | "branded" | "success";
639
684
  /**
640
- * The text accompanying the checkbox
685
+ * The size of the button
686
+ *
687
+ * * `sm`: 32px
688
+ * * `md`: 40px
689
+ * * `lg`: 48px
690
+ *
691
+ * @defaultValue "md"
641
692
  */
642
- label: string;
693
+ size?: (typeof Size)[number];
643
694
  /**
644
- * Whether or not there is an error with the input
695
+ * If `true`, the button will take up the full width of its container
645
696
  *
646
697
  * @defaultValue false
647
698
  */
648
- error?: boolean | undefined;
649
- }) => ReactElement;
699
+ fullWidth?: boolean;
700
+ /**
701
+ * The icon to be displayed at the start of the button. Please use a [Rounded Material Icon](https://material.io/resources/icons/?style=round)
702
+ */
703
+ startIcon?: React__default.ComponentType<{
704
+ className: string;
705
+ }>;
706
+ /**
707
+ * The icon to be displayed at the end of the button. Please use a [Rounded Material Icon](https://material.io/resources/icons/?style=round)
708
+ */
709
+ endIcon?: React__default.ComponentType<{
710
+ className: string;
711
+ }>;
712
+ /**
713
+ * An optional onClick event. This is used for certain wrapper's support (such as react-router-dom).
714
+ */
715
+ onClick?: React__default.MouseEventHandler<HTMLAnchorElement>;
716
+ }): JSX.Element;
650
717
 
651
718
  /**
652
719
  * [MiniActionCard](https://cambly-syntax.vercel.app/?path=/docs/components-miniactioncard--docs) is component that alerts users to a call to action.
@@ -940,7 +1007,7 @@ declare const Typography: ({ align, as, children, color, inline, lineClamp, size
940
1007
  *
941
1008
  * @defaultValue "gray900"
942
1009
  */
943
- color?: "gray200" | "gray900" | "gray700" | "gray800" | "white" | "primary" | "secondary" | "tertiary" | "branded" | "destructive-primary" | "destructive-secondary" | "destructive-tertiary" | "success" | "inherit" | undefined;
1010
+ color?: "gray200" | "gray900" | "gray700" | "gray800" | "white" | "primary" | "secondary" | "tertiary" | "destructive-primary" | "destructive-secondary" | "destructive-tertiary" | "branded" | "success" | "inherit" | undefined;
944
1011
  /**
945
1012
  * Whether the text should flow inline with other elements.
946
1013
  *
@@ -989,4 +1056,4 @@ declare const Typography: ({ align, as, children, color, inline, lineClamp, size
989
1056
  weight?: "regular" | "semiBold" | "bold" | "heavy" | undefined;
990
1057
  }) => ReactElement;
991
1058
 
992
- export { Avatar, Badge, Box, Button, ButtonGroup, Card, Checkbox, Divider, Heading, IconButton, MiniActionCard, Modal, RadioButton, SelectList, TextField, Typography };
1059
+ export { Avatar, Badge, Box, Button, ButtonGroup, Card, Checkbox, Divider, Heading, IconButton, LinkButton, MiniActionCard, Modal, RadioButton, SelectList, TextField, Typography };