@cambly/syntax-core 6.0.1 → 6.0.2

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
@@ -2,7 +2,7 @@ import * as React$1 from 'react';
2
2
  import React__default, { ReactNode, AriaRole, ReactElement } from 'react';
3
3
 
4
4
  /**
5
- * Avatar is a circular image that represents a user.
5
+ * [Avatar](https://cambly-syntax.vercel.app/?path=/docs/components-avatar--docs) is a circular image that represents a user.
6
6
  */
7
7
  declare const Avatar: ({ src, accessibilityLabel, size, }: {
8
8
  /**
@@ -28,7 +28,7 @@ declare const Avatar: ({ src, accessibilityLabel, size, }: {
28
28
  }) => JSX.Element;
29
29
 
30
30
  /**
31
- * Badge is a component to display short text and give additional context to features and other components.
31
+ * [Badge](https://cambly-syntax.vercel.app/?path=/docs/components-badge--docs) is a component to display short text and give additional context to features and other components.
32
32
  */
33
33
  declare const Badge: ({ text, color, }: {
34
34
  /**
@@ -53,13 +53,13 @@ type JustifyContent = "start" | "end" | "center" | "between" | "around" | "evenl
53
53
  type Margin = -12 | -11 | -10 | -9 | -8 | -7 | -6 | -5 | -4 | -3 | -2 | -1 | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | "auto";
54
54
  type Padding = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
55
55
  /**
56
- * Box is primitive design component and is used by lots of other components. It keeps details like spacing, borders and colors consistent across all of Syntax.
56
+ * [Box](https://cambly-syntax.vercel.app/?path=/docs/components-box--docs) is primitive design component and is used by lots of other components. It keeps details like spacing, borders and colors consistent across all of Syntax.
57
57
  *
58
58
  * Passthrough props:
59
59
  * * `aria-*`
60
60
  * * `data-testid`
61
61
  */
62
- declare const _default: React$1.ForwardRefExoticComponent<{
62
+ declare const Box: React$1.ForwardRefExoticComponent<{
63
63
  /**
64
64
  * The alignment of the box on the cross axis.
65
65
  *
@@ -447,10 +447,13 @@ type ButtonType = {
447
447
  */
448
448
  type?: "button" | "submit" | "reset";
449
449
  };
450
+ /**
451
+ * [Button](https://cambly-syntax.vercel.app/?path=/docs/components-button--docs) is used to trigger an action or event, such as submitting a form, opening a dialog, canceling an action, or performing a delete operation.
452
+ */
450
453
  declare const Button: React__default.ForwardRefExoticComponent<ButtonType & React__default.RefAttributes<HTMLButtonElement>>;
451
454
 
452
455
  /**
453
- * Group buttons to render them in a row or column with consistent spacing between each button
456
+ * [ButtonGroup](https://cambly-syntax.vercel.app/?path=/docs/components-buttongroup--docs) groups buttons in a row or column with consistent spacing between each button.
454
457
  */
455
458
  declare const ButtonGroup: ({ orientation, size, children, }: {
456
459
  /**
@@ -476,9 +479,6 @@ declare const ButtonGroup: ({ orientation, size, children, }: {
476
479
  }) => ReactElement;
477
480
 
478
481
  declare const CardSizes: readonly ["sm", "lg"];
479
- /**
480
- * Card is a basic container component to apply consistent styling and render child components.
481
- */
482
482
  type CardType = {
483
483
  /**
484
484
  * Test id for the button
@@ -498,10 +498,13 @@ type CardType = {
498
498
  */
499
499
  size?: (typeof CardSizes)[number];
500
500
  };
501
- declare const Card: ({ children, size, "data-testid": dataTestId, }: CardType) => JSX.Element;
501
+ /**
502
+ * [Card](https://cambly-syntax.vercel.app/?path=/docs/components-card--docs) is a basic container component to apply consistent styling and render child components.
503
+ */
504
+ declare function Card({ children, size, "data-testid": dataTestId, }: CardType): JSX.Element;
502
505
 
503
506
  /**
504
- * Divider is a thin horizontal line to group content in lists and layouts.
507
+ * [Divider](https://cambly-syntax.vercel.app/?path=/docs/components-divider--docs) is a thin horizontal line to group content in lists and layouts.
505
508
  */
506
509
  declare function Divider(): React.ReactElement;
507
510
  declare namespace Divider {
@@ -509,7 +512,7 @@ declare namespace Divider {
509
512
  }
510
513
 
511
514
  /**
512
- * Heading enforces a consistent style & accessibility best practices for headings.
515
+ * [Heading](https://cambly-syntax.vercel.app/?path=/docs/components-heading--docs) enforces a consistent style & accessibility best practices for headings.
513
516
  */
514
517
  declare const Heading: ({ align, as, children, color, size, }: {
515
518
  /**
@@ -596,12 +599,12 @@ type IconButtonType = {
596
599
  tooltip?: string;
597
600
  };
598
601
  /**
599
- * IconButton is a clickable element that is used to perform an action.
602
+ * [IconButton](https://cambly-syntax.vercel.app/?path=/docs/components-iconbutton--docs) is a clickable element that is used to perform an action.
600
603
  */
601
604
  declare const IconButton: React__default.ForwardRefExoticComponent<IconButtonType & React__default.RefAttributes<HTMLButtonElement>>;
602
605
 
603
606
  /**
604
- * Checkbox is a clickable element that will show if an option has been selected or not
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.
605
608
  */
606
609
  declare const Checkbox: ({ checked, "data-testid": dataTestId, disabled, size, label, error, onChange, }: {
607
610
  /**
@@ -646,7 +649,7 @@ declare const Checkbox: ({ checked, "data-testid": dataTestId, disabled, size, l
646
649
  }) => ReactElement;
647
650
 
648
651
  /**
649
- * MiniActionCard is component that alerts users to a call to action.
652
+ * [MiniActionCard](https://cambly-syntax.vercel.app/?path=/docs/components-miniactioncard--docs) is component that alerts users to a call to action.
650
653
  */
651
654
  declare const MiniActionCard: ({ children, }: {
652
655
  /**
@@ -716,7 +719,7 @@ type ModalType = {
716
719
  "data-testid"?: string;
717
720
  };
718
721
  /**
719
- * Modal is a dialog that appears on top of the main content and locks user interaction within the modal.
722
+ * [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.
720
723
  */
721
724
  declare function Modal({ header, children, image, onDismiss, footer, accessibilityCloseLabel, size, zIndex, "data-testid": dataTestId, }: ModalType): ReactElement;
722
725
  declare namespace Modal {
@@ -724,7 +727,7 @@ declare namespace Modal {
724
727
  }
725
728
 
726
729
  /**
727
- * RadioButton is a radio button with accompanying text
730
+ * [RadioButton](https://cambly-syntax.vercel.app/?path=/docs/components-radiobutton--docs) is a radio button with accompanying text
728
731
  */
729
732
  declare const RadioButton: ({ checked, "data-testid": dataTestId, disabled, error, id, label, name, onChange, size, value, }: {
730
733
  /**
@@ -780,70 +783,73 @@ declare const RadioButton: ({ checked, "data-testid": dataTestId, disabled, erro
780
783
  value: string;
781
784
  }) => ReactElement;
782
785
 
783
- declare const SelectList: {
784
- ({ children, "data-testid": dataTestId, disabled, errorText, helperText, label, onChange, onClick, placeholderText, selectedValue, size, }: {
785
- /**
786
- * One or more SelectList.Option components.
787
- */
788
- children: ReactNode;
789
- /**
790
- * Test id for the select element
791
- */
792
- "data-testid"?: string | undefined;
793
- /**
794
- * true if the select dropdown is disabled
795
- * @defaultValue false
796
- */
797
- disabled?: boolean | undefined;
798
- /**
799
- * Callback to be called when select is clicked
800
- */
801
- onClick?: React__default.MouseEventHandler<HTMLSelectElement> | undefined;
802
- /**
803
- * Text shown below select box if there is an input error.
804
- */
805
- errorText?: string | undefined;
806
- /**
807
- * Text shown below select box
808
- */
809
- helperText?: string | undefined;
810
- /**
811
- * Text shown above select box
812
- */
813
- label: string;
814
- /**
815
- * The callback to be called when an option is selected
816
- */
817
- onChange: React__default.ChangeEventHandler<HTMLSelectElement>;
818
- /**
819
- * Text showing in select box if no option has been chosen.
820
- * We should always have a placeholder unless there is a default option selected
821
- */
822
- placeholderText?: string | undefined;
823
- /**
824
- * Value of the currently selected option
825
- */
826
- selectedValue?: string | undefined;
827
- /**
828
- * Size of the select box
829
- * * `sm`: 32px
830
- * * `md`: 40px
831
- * * `lg`: 48px
832
- *
833
- * @defaultValue "md"
834
- */
835
- size?: "sm" | "md" | "lg" | undefined;
836
- }): ReactElement;
837
- Option: ({ "data-testid": dataTestId, value, label, disabled, }: {
786
+ /**
787
+ * [SelectList](https://cambly-syntax.vercel.app/?path=/docs/components-selectlist--docs) is a dropdown menu that allows users to select one option from a list.
788
+ */
789
+ declare function SelectList({ children, "data-testid": dataTestId, disabled, errorText, helperText, label, onChange, onClick, placeholderText, selectedValue, size, }: {
790
+ /**
791
+ * One or more SelectList.Option components.
792
+ */
793
+ children: ReactNode;
794
+ /**
795
+ * Test id for the select element
796
+ */
797
+ "data-testid"?: string;
798
+ /**
799
+ * true if the select dropdown is disabled
800
+ * @defaultValue false
801
+ */
802
+ disabled?: boolean;
803
+ /**
804
+ * Callback to be called when select is clicked
805
+ */
806
+ onClick?: React__default.MouseEventHandler<HTMLSelectElement>;
807
+ /**
808
+ * Text shown below select box if there is an input error.
809
+ */
810
+ errorText?: string;
811
+ /**
812
+ * Text shown below select box
813
+ */
814
+ helperText?: string;
815
+ /**
816
+ * Text shown above select box
817
+ */
818
+ label: string;
819
+ /**
820
+ * The callback to be called when an option is selected
821
+ */
822
+ onChange: React__default.ChangeEventHandler<HTMLSelectElement>;
823
+ /**
824
+ * Text showing in select box if no option has been chosen.
825
+ * We should always have a placeholder unless there is a default option selected
826
+ */
827
+ placeholderText?: string;
828
+ /**
829
+ * Value of the currently selected option
830
+ */
831
+ selectedValue?: string;
832
+ /**
833
+ * Size of the select box
834
+ * * `sm`: 32px
835
+ * * `md`: 40px
836
+ * * `lg`: 48px
837
+ *
838
+ * @defaultValue "md"
839
+ */
840
+ size?: "sm" | "md" | "lg";
841
+ }): ReactElement;
842
+ declare namespace SelectList {
843
+ var Option: ({ "data-testid": dataTestId, value, label, disabled, }: {
838
844
  "data-testid"?: string | undefined;
839
845
  value: string;
840
846
  label: string;
841
847
  disabled?: boolean | undefined;
842
848
  }) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>>;
843
- };
849
+ }
844
850
 
845
851
  /**
846
- * Typography is a component that renders text.
852
+ * [Typography](https://cambly-syntax.vercel.app/?path=/docs/components-typography--docs) is a component that renders text.
847
853
  */
848
854
  declare const Typography: ({ align, as, children, color, inline, lineClamp, size, tooltip, transform, underline, weight, }: {
849
855
  /**
@@ -918,4 +924,4 @@ declare const Typography: ({ align, as, children, color, inline, lineClamp, size
918
924
  weight?: "regular" | "semiBold" | "bold" | "heavy" | undefined;
919
925
  }) => ReactElement;
920
926
 
921
- export { Avatar, Badge, _default as Box, Button, ButtonGroup, Card, Checkbox, Divider, Heading, IconButton, MiniActionCard, Modal, RadioButton, SelectList, Typography };
927
+ export { Avatar, Badge, Box, Button, ButtonGroup, Card, Checkbox, Divider, Heading, IconButton, MiniActionCard, Modal, RadioButton, SelectList, Typography };
package/dist/index.js CHANGED
@@ -118,7 +118,7 @@ __export(src_exports, {
118
118
  Box: () => Box_default,
119
119
  Button: () => Button_default,
120
120
  ButtonGroup: () => ButtonGroup_default,
121
- Card: () => Card_default,
121
+ Card: () => Card,
122
122
  Checkbox: () => Checkbox_default,
123
123
  Divider: () => Divider,
124
124
  Heading: () => Heading_default,
@@ -126,7 +126,7 @@ __export(src_exports, {
126
126
  MiniActionCard: () => MiniActionCard_default,
127
127
  Modal: () => Modal,
128
128
  RadioButton: () => RadioButton_default,
129
- SelectList: () => SelectList_default,
129
+ SelectList: () => SelectList,
130
130
  Typography: () => Typography_default
131
131
  });
132
132
  module.exports = __toCommonJS(src_exports);
@@ -235,7 +235,7 @@ var padding_module_default = { "paddingX0": "_paddingX0_1aqye_2", "paddingX1": "
235
235
  // src/Box/Box.tsx
236
236
  var import_react = require("react");
237
237
  var import_jsx_runtime3 = require("react/jsx-runtime");
238
- var Box_default = (0, import_react.forwardRef)(function Box(props, ref) {
238
+ var Box = (0, import_react.forwardRef)(function Box2(props, ref) {
239
239
  var _c;
240
240
  const _a = props, { as: BoxElement = "div", children } = _a, boxProps = __objRest(_a, ["as", "children"]);
241
241
  const _b = boxProps, {
@@ -421,6 +421,7 @@ var Box_default = (0, import_react.forwardRef)(function Box(props, ref) {
421
421
  }, {});
422
422
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(BoxElement, __spreadProps(__spreadValues(__spreadValues({}, parsedProps), passthroughProps), { ref, children }));
423
423
  });
424
+ var Box_default = Box;
424
425
 
425
426
  // src/Badge/Badge.tsx
426
427
  var import_jsx_runtime4 = require("react/jsx-runtime");
@@ -612,11 +613,11 @@ var ButtonGroup_default = ButtonGroup;
612
613
 
613
614
  // src/Card/Card.tsx
614
615
  var import_jsx_runtime7 = require("react/jsx-runtime");
615
- var Card = ({
616
+ function Card({
616
617
  children,
617
618
  size = "sm",
618
619
  "data-testid": dataTestId
619
- }) => {
620
+ }) {
620
621
  const sizeWidth2 = {
621
622
  sm: 352,
622
623
  lg: 744
@@ -634,8 +635,7 @@ var Card = ({
634
635
  children
635
636
  }
636
637
  );
637
- };
638
- var Card_default = Card;
638
+ }
639
639
 
640
640
  // css-module:./Divider.module.css#css-module
641
641
  var Divider_module_default = { "divider": "_divider_1ddgq_1" };
@@ -1216,7 +1216,7 @@ var iconSize3 = {
1216
1216
  md: 24,
1217
1217
  lg: 24
1218
1218
  };
1219
- var SelectList = ({
1219
+ function SelectList({
1220
1220
  children,
1221
1221
  "data-testid": dataTestId,
1222
1222
  disabled = false,
@@ -1228,7 +1228,7 @@ var SelectList = ({
1228
1228
  placeholderText,
1229
1229
  selectedValue = "",
1230
1230
  size = "md"
1231
- }) => {
1231
+ }) {
1232
1232
  const id = (0, import_react9.useId)();
1233
1233
  const { isFocusVisible: isFocusVisible2 } = useFocusVisible();
1234
1234
  const [isFocused, setIsFocused] = (0, import_react9.useState)(false);
@@ -1295,8 +1295,7 @@ var SelectList = ({
1295
1295
  ]
1296
1296
  }
1297
1297
  );
1298
- };
1299
- var SelectList_default = SelectList;
1298
+ }
1300
1299
  SelectList.Option = SelectOption_default;
1301
1300
  // Annotate the CommonJS export names for ESM import in node:
1302
1301
  0 && (module.exports = {