@bigbluebutton/bbb-ui-components-react 0.5.0 → 0.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.
Files changed (83) hide show
  1. package/README.md +11 -10
  2. package/dist/components/Accordion.js +53 -1
  3. package/dist/components/Button.js +144 -1
  4. package/dist/components/Checkbox.js +20 -1
  5. package/dist/components/Divider.js +9 -1
  6. package/dist/components/Hint.js +51 -1
  7. package/dist/components/Input.js +220 -0
  8. package/dist/components/Modal.js +222 -1
  9. package/dist/components/Navigation.js +74 -1
  10. package/dist/components/Search.js +130 -1
  11. package/dist/components/Select.js +46 -1
  12. package/dist/components/Spinner.js +34 -1
  13. package/dist/components/TextAreaInput.js +23 -1
  14. package/dist/components/TextInput.js +52 -1
  15. package/dist/components/Toggle.js +42 -1
  16. package/dist/components/Typography.js +42 -1
  17. package/dist/components/index.js +739 -1
  18. package/dist/esm/components/Accordion/component.js +6 -7
  19. package/dist/esm/components/Accordion/constants.js +3 -3
  20. package/dist/esm/components/Accordion/styles.js +58 -17
  21. package/dist/esm/components/Button/component.js +52 -35
  22. package/dist/esm/components/Button/constants.js +21 -20
  23. package/dist/esm/components/Button/styles.js +187 -45
  24. package/dist/esm/components/Checkbox/component.js +3 -14
  25. package/dist/esm/components/Checkbox/constants.js +3 -3
  26. package/dist/esm/components/Checkbox/styles.js +23 -9
  27. package/dist/esm/components/Divider/styles.js +10 -7
  28. package/dist/esm/components/Hint/component.js +3 -14
  29. package/dist/esm/components/Hint/constants.js +3 -3
  30. package/dist/esm/components/Hint/styles.js +58 -13
  31. package/dist/esm/components/Input/component.js +111 -0
  32. package/dist/esm/components/Input/index.js +1 -0
  33. package/dist/esm/components/Input/styles.js +89 -0
  34. package/dist/esm/components/Input/types.js +1 -0
  35. package/dist/esm/components/Modal/component.js +8 -19
  36. package/dist/esm/components/Modal/styles.js +41 -19
  37. package/dist/esm/components/Navigation/component.js +3 -4
  38. package/dist/esm/components/Navigation/styles.js +36 -12
  39. package/dist/esm/components/Search/component.js +16 -17
  40. package/dist/esm/components/Search/styles.js +103 -14
  41. package/dist/esm/components/Select/component.js +5 -16
  42. package/dist/esm/components/Select/styles.js +51 -11
  43. package/dist/esm/components/Spinner/component.js +1 -2
  44. package/dist/esm/components/Spinner/styles.js +39 -29
  45. package/dist/esm/components/TextAreaInput/component.js +4 -15
  46. package/dist/esm/components/TextAreaInput/styles.js +24 -7
  47. package/dist/esm/components/TextInput/component.js +2 -13
  48. package/dist/esm/components/TextInput/styles.js +58 -16
  49. package/dist/esm/components/Toggle/component.js +6 -17
  50. package/dist/esm/components/Toggle/constants.js +3 -3
  51. package/dist/esm/components/Toggle/styles.js +88 -72
  52. package/dist/esm/components/Typography/component.js +3 -14
  53. package/dist/esm/components/Typography/constants.js +1 -1
  54. package/dist/esm/components/Typography/styles.js +50 -17
  55. package/dist/esm/components/index.js +1 -0
  56. package/dist/esm/index.js +1 -1
  57. package/dist/esm/stylesheets/palette.js +49 -0
  58. package/dist/esm/stylesheets/sizing.js +9 -9
  59. package/dist/esm/stylesheets/typography.js +7 -7
  60. package/dist/types/components/Accordion/types.d.ts +8 -0
  61. package/dist/types/components/Button/constants.d.ts +3 -2
  62. package/dist/types/components/Button/styles.d.ts +1 -0
  63. package/dist/types/components/Button/type.d.ts +42 -1
  64. package/dist/types/components/Checkbox/types.d.ts +4 -0
  65. package/dist/types/components/Hint/types.d.ts +5 -0
  66. package/dist/types/components/Input/component.d.ts +12 -0
  67. package/dist/types/components/Input/index.d.ts +1 -0
  68. package/dist/types/components/Input/styles.d.ts +6 -0
  69. package/dist/types/components/Input/types.d.ts +69 -0
  70. package/dist/types/components/Modal/types.d.ts +11 -0
  71. package/dist/types/components/Navigation/types.d.ts +9 -0
  72. package/dist/types/components/Search/types.d.ts +6 -24
  73. package/dist/types/components/Select/types.d.ts +4 -0
  74. package/dist/types/components/Spinner/types.d.ts +3 -0
  75. package/dist/types/components/TextAreaInput/types.d.ts +7 -0
  76. package/dist/types/components/TextInput/types.d.ts +3 -0
  77. package/dist/types/components/Toggle/types.d.ts +6 -0
  78. package/dist/types/components/Typography/types.d.ts +3 -0
  79. package/dist/types/components/index.d.ts +1 -0
  80. package/dist/types/index.d.ts +1 -1
  81. package/dist/types/stylesheets/{pallete.d.ts → palette.d.ts} +9 -9
  82. package/package.json +15 -2
  83. package/dist/esm/stylesheets/pallete.js +0 -46
@@ -11,12 +11,11 @@ import { DEFAULT_TOOLTIP_PLACEMENT } from './constants';
11
11
  * with a smooth animation. It also supports an optional tooltip on the header.
12
12
  *
13
13
  */
14
- function Accordion(_a) {
15
- var _b;
16
- var title = _a.title, _c = _a.tooltipLabel, tooltipLabel = _c === void 0 ? undefined : _c, _d = _a.tooltipPlacement, tooltipPlacement = _d === void 0 ? DEFAULT_TOOLTIP_PLACEMENT : _d, ariaLabel = _a.ariaLabel, ariaLabelledBy = _a.ariaLabelledBy, ariaDescribedBy = _a.ariaDescribedBy, _e = _a.buttonHeader, buttonHeader = _e === void 0 ? null : _e, children = _a.children;
17
- var _f = useState(false), isExpanded = _f[0], setIsExpanded = _f[1];
18
- var contentRef = useRef(null);
19
- var expandButton = (React.createElement(Styled.ExpandButton, { onClick: function () { return setIsExpanded(function (current) { return !current; }); }, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy },
14
+ function Accordion({ title, tooltipLabel = undefined, tooltipPlacement = DEFAULT_TOOLTIP_PLACEMENT, ariaLabel, ariaLabelledBy, ariaDescribedBy, buttonHeader = null, children, }) {
15
+ var _a;
16
+ const [isExpanded, setIsExpanded] = useState(false);
17
+ const contentRef = useRef(null);
18
+ const expandButton = (React.createElement(Styled.ExpandButton, { onClick: () => setIsExpanded((current) => !current), "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy },
20
19
  React.createElement(Styled.ButtonContent, null,
21
20
  React.createElement(Styled.ExpandIcon, { "$expanded": isExpanded },
22
21
  React.createElement(MdExpandMore, null)),
@@ -24,6 +23,6 @@ function Accordion(_a) {
24
23
  buttonHeader)));
25
24
  return (React.createElement(React.Fragment, null,
26
25
  tooltipLabel ? (React.createElement(Tippy, { content: tooltipLabel, placement: tooltipPlacement }, expandButton)) : (expandButton),
27
- React.createElement(Styled.AccordionContent, { ref: contentRef, "$expanded": isExpanded, "$scrollHeight": ((_b = contentRef.current) === null || _b === void 0 ? void 0 : _b.scrollHeight) || 0 }, children)));
26
+ React.createElement(Styled.AccordionContent, { ref: contentRef, "$expanded": isExpanded, "$scrollHeight": ((_a = contentRef.current) === null || _a === void 0 ? void 0 : _a.scrollHeight) || 0 }, children)));
28
27
  }
29
28
  export default Accordion;
@@ -1,9 +1,9 @@
1
- var TOOLTIP_PLACEMENTS = {
1
+ const TOOLTIP_PLACEMENTS = {
2
2
  TOP: 'top',
3
3
  BOTTOM: 'bottom',
4
4
  LEFT: 'left',
5
5
  RIGHT: 'right',
6
6
  };
7
- var TOOLTIP_PLACEMENT_VALUES = Object.values(TOOLTIP_PLACEMENTS);
8
- var DEFAULT_TOOLTIP_PLACEMENT = TOOLTIP_PLACEMENTS.TOP;
7
+ const TOOLTIP_PLACEMENT_VALUES = Object.values(TOOLTIP_PLACEMENTS);
8
+ const DEFAULT_TOOLTIP_PLACEMENT = TOOLTIP_PLACEMENTS.TOP;
9
9
  export { TOOLTIP_PLACEMENTS, TOOLTIP_PLACEMENT_VALUES, DEFAULT_TOOLTIP_PLACEMENT, };
@@ -1,20 +1,61 @@
1
- var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
2
- if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
3
- return cooked;
4
- };
5
1
  import styled from 'styled-components';
6
- import { colorBackgroundLight, colorBrand1, colorTextDefault, colorWhite } from '../../stylesheets/pallete';
2
+ import { colorBackgroundLight, colorBrand1, colorTextDefault, colorWhite } from '../../stylesheets/palette';
7
3
  import { fontSizeDefault } from '../../stylesheets/typography';
8
4
  import { borderRadiusDefault, spacingMedium, spacingSmall } from '../../stylesheets/sizing';
9
- export var ExpandButton = styled.button(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n background: none;\n border: none;\n cursor: pointer;\n padding: ", ";\n background-color: transparent;\n border-radius: ", ";\n\n &:hover {\n background: ", ";\n }\n"], ["\n display: flex;\n align-items: center;\n background: none;\n border: none;\n cursor: pointer;\n padding: ", ";\n background-color: transparent;\n border-radius: ", ";\n\n &:hover {\n background: ", ";\n }\n"])), spacingSmall, borderRadiusDefault, colorBackgroundLight);
10
- export var ButtonContent = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n width: 100%;\n padding: ", ";\n border-radius: ", ";\n gap: ", ";\n"], ["\n display: flex;\n align-items: center;\n width: 100%;\n padding: ", ";\n border-radius: ", ";\n gap: ", ";\n"])), spacingSmall, borderRadiusDefault, spacingMedium);
11
- export var ExpandIcon = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n width: 1.375rem;\n height: 1.375rem;\n aspect-ratio: 1;\n display: flex;\n align-items: center;\n justify-content: center;\n transform: ", ";\n transition: all 0.3s ease;\n border-radius: 50%;\n background-color: ", ";\n\n svg {\n color: ", ";\n font-size: 1.25rem;\n transition: transform 0.3s ease;\n }\n\n &:hover {\n filter: brightness(0.9);\n }\n"], ["\n width: 1.375rem;\n height: 1.375rem;\n aspect-ratio: 1;\n display: flex;\n align-items: center;\n justify-content: center;\n transform: ", ";\n transition: all 0.3s ease;\n border-radius: 50%;\n background-color: ", ";\n\n svg {\n color: ", ";\n font-size: 1.25rem;\n transition: transform 0.3s ease;\n }\n\n &:hover {\n filter: brightness(0.9);\n }\n"])), function (_a) {
12
- var $expanded = _a.$expanded;
13
- return ($expanded ? 'rotate(180deg)' : 'rotate(0deg)');
14
- }, colorBrand1, colorWhite);
15
- export var TitleText = styled.span(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n font-size: ", ";\n font-weight: 400;\n color: ", ";\n overflow: hidden;\n text-overflow: ellipsis;\n"], ["\n font-size: ", ";\n font-weight: 400;\n color: ", ";\n overflow: hidden;\n text-overflow: ellipsis;\n"])), fontSizeDefault, colorTextDefault);
16
- export var AccordionContent = styled.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n max-height: ", ";\n overflow: hidden;\n transition: max-height 0.3s ease-in-out;\n padding: 0px 1rem;\n"], ["\n max-height: ", ";\n overflow: hidden;\n transition: max-height 0.3s ease-in-out;\n padding: 0px 1rem;\n"])), function (_a) {
17
- var $expanded = _a.$expanded, $scrollHeight = _a.$scrollHeight;
18
- return $expanded ? "".concat($scrollHeight, "px") : '0';
19
- });
20
- var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
5
+ export const ExpandButton = styled.button `
6
+ display: flex;
7
+ align-items: center;
8
+ background: none;
9
+ border: none;
10
+ cursor: pointer;
11
+ padding: ${spacingSmall};
12
+ background-color: transparent;
13
+ border-radius: ${borderRadiusDefault};
14
+
15
+ &:hover {
16
+ background: ${colorBackgroundLight};
17
+ }
18
+ `;
19
+ export const ButtonContent = styled.div `
20
+ display: flex;
21
+ align-items: center;
22
+ width: 100%;
23
+ padding: ${spacingSmall};
24
+ border-radius: ${borderRadiusDefault};
25
+ gap: ${spacingMedium};
26
+ `;
27
+ export const ExpandIcon = styled.div `
28
+ width: 1.375rem;
29
+ height: 1.375rem;
30
+ aspect-ratio: 1;
31
+ display: flex;
32
+ align-items: center;
33
+ justify-content: center;
34
+ transform: ${({ $expanded }) => ($expanded ? 'rotate(180deg)' : 'rotate(0deg)')};
35
+ transition: all 0.3s ease;
36
+ border-radius: 50%;
37
+ background-color: ${colorBrand1};
38
+
39
+ svg {
40
+ color: ${colorWhite};
41
+ font-size: 1.25rem;
42
+ transition: transform 0.3s ease;
43
+ }
44
+
45
+ &:hover {
46
+ filter: brightness(0.9);
47
+ }
48
+ `;
49
+ export const TitleText = styled.span `
50
+ font-size: ${fontSizeDefault};
51
+ font-weight: 400;
52
+ color: ${colorTextDefault};
53
+ overflow: hidden;
54
+ text-overflow: ellipsis;
55
+ `;
56
+ export const AccordionContent = styled.div `
57
+ max-height: ${({ $expanded, $scrollHeight }) => $expanded ? `${$scrollHeight}px` : '0'};
58
+ overflow: hidden;
59
+ transition: max-height 0.3s ease-in-out;
60
+ padding: 0px 1rem;
61
+ `;
@@ -1,16 +1,5 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
- import React, { useId } from 'react';
13
- import { MdSettings } from 'react-icons/md';
1
+ import React, { useCallback, useEffect, useId, useRef, useState, } from 'react';
2
+ import { MdSettings, MdCheckCircle } from 'react-icons/md';
14
3
  import { DEFAULT_VARIANT, DEFAULT_COLOR, DEFAULT_SIZE, DEFAULT_LAYOUT, LAYOUTS, DEFAULT_TOOLTIP_PLACEMENT, } from './constants';
15
4
  import * as Styled from './styles';
16
5
  import Tippy from '@tippyjs/react';
@@ -24,46 +13,74 @@ import 'tippy.js/dist/tippy.css';
24
13
  *
25
14
  */
26
15
  function Button(props) {
27
- var _a = props.id, id = _a === void 0 ? '' : _a, dataTest = props.dataTest, label = props.label, tooltipLabel = props.tooltipLabel, _b = props.tooltipPlacement, tooltipPlacement = _b === void 0 ? DEFAULT_TOOLTIP_PLACEMENT : _b, onClick = props.onClick, onKeyDown = props.onKeyDown, _c = props.ariaLabel, ariaLabel = _c === void 0 ? '' : _c, _d = props.ariaLabelledBy, ariaLabelledBy = _d === void 0 ? '' : _d, _e = props.ariaDescribedBy, ariaDescribedBy = _e === void 0 ? '' : _e, _f = props.color, color = _f === void 0 ? DEFAULT_COLOR : _f, _g = props.variant, variant = _g === void 0 ? DEFAULT_VARIANT : _g, _h = props.size, size = _h === void 0 ? DEFAULT_SIZE : _h, _j = props.layout, layout = _j === void 0 ? DEFAULT_LAYOUT : _j, _k = props.disabled, disabled = _k === void 0 ? false : _k, children = props.children;
28
- var accessibilityProps = {};
29
- var generatedId = useId();
30
- var defaultLabelId = "".concat(id || generatedId, "-label");
16
+ const { id = '', dataTest, label, tooltipLabel, tooltipPlacement = DEFAULT_TOOLTIP_PLACEMENT, onClick, onKeyDown, ariaLabel = '', ariaLabelledBy = '', ariaDescribedBy = '', color = DEFAULT_COLOR, variant = DEFAULT_VARIANT, size = DEFAULT_SIZE, layout = DEFAULT_LAYOUT, disabled = false, children, showFeedback = false, feedbackContent = React.createElement(MdCheckCircle, { fontSize: "small" }), feedbackDuration = 2000, } = props;
17
+ const feedbackTimeoutRef = useRef(null);
18
+ const [isFeedbackVisible, setFeedbackVisible] = useState(false);
19
+ useEffect(() => () => {
20
+ if (feedbackTimeoutRef.current)
21
+ clearTimeout(feedbackTimeoutRef.current);
22
+ }, []);
23
+ const handleClick = useCallback((event) => {
24
+ onClick(event);
25
+ if (showFeedback) {
26
+ setFeedbackVisible(true);
27
+ if (feedbackTimeoutRef.current)
28
+ clearTimeout(feedbackTimeoutRef.current);
29
+ feedbackTimeoutRef.current = setTimeout(() => setFeedbackVisible(false), feedbackDuration);
30
+ }
31
+ }, [onClick, showFeedback, feedbackDuration]);
32
+ const accessibilityProps = {};
33
+ const generatedId = useId();
34
+ const defaultLabelId = `${id || generatedId}-label`;
35
+ // Only default aria-labelledby to defaultLabelId when an element with that id is
36
+ // actually rendered (stacked always renders ButtonText; default when labeled, or
37
+ // when the feedback content is taking the label's place). circle never renders a
38
+ // label element, so it must rely on aria-label instead — otherwise aria-labelledby
39
+ // would point at a non-existent id.
40
+ const hasRenderedLabelElement = layout === LAYOUTS.STACKED
41
+ || (layout === LAYOUTS.DEFAULT && (Boolean(label) || isFeedbackVisible));
31
42
  accessibilityProps['aria-label'] = ariaLabel || label;
32
- accessibilityProps['aria-labelledby'] = ariaLabelledBy || defaultLabelId;
43
+ if (ariaLabelledBy) {
44
+ accessibilityProps['aria-labelledby'] = ariaLabelledBy;
45
+ }
46
+ else if (hasRenderedLabelElement) {
47
+ accessibilityProps['aria-labelledby'] = defaultLabelId;
48
+ }
33
49
  if (ariaDescribedBy)
34
50
  accessibilityProps['aria-describedby'] = ariaDescribedBy;
35
- var buttonElement = (function () {
36
- if (props.layout === LAYOUTS.CIRCLE) {
37
- var icon = props.icon;
38
- var testId_1 = dataTest || "button-".concat(id || 'default');
39
- return (React.createElement(Styled.Button, __assign({ id: id, "data-test": testId_1, onClick: onClick, onKeyDown: onKeyDown }, accessibilityProps, { "$color": color, "$variant": variant, "$size": size, "$layout": layout, disabled: disabled }), icon));
51
+ const buttonElement = (() => {
52
+ if (props.layout === LAYOUTS.CIRCLE || props.layout === LAYOUTS.SQUARED) {
53
+ const { icon } = props;
54
+ const testId = dataTest || `button-${id || 'default'}`;
55
+ return (React.createElement(Styled.Button, Object.assign({ id: id, "data-test": testId, onClick: handleClick, onKeyDown: onKeyDown }, accessibilityProps, { "$color": color, "$variant": variant, "$size": size, "$layout": layout, disabled: disabled }), isFeedbackVisible ? (React.createElement(Styled.FeedbackContent, { role: "status", "aria-live": "polite" }, feedbackContent)) : icon));
40
56
  }
41
57
  if (props.layout === LAYOUTS.STACKED) {
42
- var icon = props.icon, _a = props.helperIcon, helperIcon = _a === void 0 ? React.createElement(MdSettings, { fontSize: "small" }) : _a, _b = props.hideHelperIcon, hideHelperIcon = _b === void 0 ? false : _b, _c = props.helperOnClick, helperOnClick_1 = _c === void 0 ? null : _c;
43
- var testId_2 = dataTest || "".concat(LAYOUTS.STACKED, "-button-").concat(id || label || 'default');
44
- return (React.createElement(Styled.ButtonWrapper, { "data-test": testId_2, "$layout": layout },
45
- React.createElement(Styled.Button, __assign({ id: id, onClick: onClick, onKeyDown: onKeyDown }, accessibilityProps, { "$color": color, "$variant": variant, "$size": size, "$layout": layout, disabled: disabled }),
58
+ const { icon, helperIcon = React.createElement(MdSettings, { fontSize: "small" }), hideHelperIcon = false, helperOnClick = null, } = props;
59
+ const testId = dataTest || `${LAYOUTS.STACKED}-button-${id || label || 'default'}`;
60
+ return (React.createElement(Styled.ButtonWrapper, { "data-test": testId, "$layout": layout },
61
+ React.createElement(Styled.Button, Object.assign({ id: id, onClick: handleClick, onKeyDown: onKeyDown }, accessibilityProps, { "$color": color, "$variant": variant, "$size": size, "$layout": layout, disabled: disabled }),
46
62
  !hideHelperIcon && (React.createElement(Styled.HelperIconContainer
47
63
  // Add this property only when there is a onClick function for the auxiliary icon.
48
64
  // It controls whether the auxiliary button is going to have an independent hover state.
49
- , __assign({}, (helperOnClick_1 && { 'data-is-aux-icon': true }), (helperOnClick_1 && { 'aria-label': accessibilityProps['aria-label'] + ' helper' }), (helperOnClick_1 && { role: "button" }), { "$hover": helperOnClick_1 !== null, "$color": color, "$variant": variant, onClick: function (event) {
50
- if (helperOnClick_1) {
51
- helperOnClick_1(event);
65
+ , Object.assign({}, (helperOnClick && { 'data-is-aux-icon': true }), (helperOnClick && { 'aria-label': accessibilityProps['aria-label'] + ' helper' }), (helperOnClick && { role: "button" }), { "$hover": helperOnClick !== null, "$color": color, "$variant": variant, onClick: (event) => {
66
+ if (helperOnClick) {
67
+ helperOnClick(event);
52
68
  event.preventDefault();
53
69
  event.stopPropagation();
54
70
  }
55
71
  } }),
56
72
  React.createElement(Styled.HelperIcon, null, helperIcon))),
57
- icon && React.createElement(Styled.IconWrapper, null, icon)),
73
+ isFeedbackVisible ? (React.createElement(Styled.IconWrapper, null,
74
+ React.createElement(Styled.FeedbackContent, { role: "status", "aria-live": "polite" }, feedbackContent))) : (icon && React.createElement(Styled.IconWrapper, null, icon))),
58
75
  React.createElement(Styled.ButtonText, { id: defaultLabelId }, label)));
59
76
  }
60
- var iconStart = props.iconStart, iconEnd = props.iconEnd;
61
- var testId = dataTest || "button-".concat(id || label || 'default');
62
- return (React.createElement(Styled.Button, __assign({ id: id, "data-test": testId, onClick: onClick, onKeyDown: onKeyDown }, accessibilityProps, { "$color": color, "$variant": variant, "$size": size, "$layout": layout, disabled: disabled }),
77
+ const { iconStart, iconEnd } = props;
78
+ const testId = dataTest || `button-${id || label || 'default'}`;
79
+ return (React.createElement(Styled.Button, Object.assign({ id: id, "data-test": testId, onClick: handleClick, onKeyDown: onKeyDown }, accessibilityProps, { "$color": color, "$variant": variant, "$size": size, "$layout": layout, disabled: disabled }), isFeedbackVisible ? (React.createElement(Styled.FeedbackContent, { id: defaultLabelId, role: "status", "aria-live": "polite" }, feedbackContent)) : (React.createElement(React.Fragment, null,
63
80
  iconStart && iconStart,
64
81
  label && React.createElement("span", { id: defaultLabelId }, label),
65
82
  children,
66
- iconEnd && iconEnd));
83
+ iconEnd && iconEnd))));
67
84
  })();
68
85
  if (tooltipLabel) {
69
86
  return (React.createElement(Tippy, { content: tooltipLabel, placement: tooltipPlacement }, buttonElement));
@@ -1,42 +1,43 @@
1
- import { colorBrand1, colorHoverDark, colorWhite, colorError, colorBorderError, colorErrorDark, colorBackgroundWhite, colorBackgroundBlue, colorHoverLight, colorLightGray, colorNeutral3, colorBackgroundLight, colorBorderSelected, colorTextLight, colorIconDefault, colorGray, colorBrandAux, } from '../../stylesheets/pallete';
1
+ import { colorBrand1, colorHoverDark, colorWhite, colorError, colorBorderError, colorErrorDark, colorBackgroundWhite, colorBackgroundBlue, colorHoverLight, colorLightGray, colorNeutral3, colorBackgroundLight, colorBorderSelected, colorTextLight, colorIconDefault, colorGray, colorBrandAux, } from '../../stylesheets/palette';
2
2
  import { spacingMedium, spacingSmall, spacingSmallMedium } from '../../stylesheets/sizing';
3
- var VARIANTS = {
3
+ const VARIANTS = {
4
4
  PRIMARY: 'primary',
5
5
  SECONDARY: 'secondary',
6
6
  TERTIARY: 'tertiary',
7
7
  SUBTLE: 'subtle',
8
8
  };
9
- var VARIANT_VALUES = Object.values(VARIANTS);
10
- var DEFAULT_VARIANT = VARIANT_VALUES[0];
11
- var COLORS = {
9
+ const VARIANT_VALUES = Object.values(VARIANTS);
10
+ const DEFAULT_VARIANT = VARIANT_VALUES[0];
11
+ const COLORS = {
12
12
  DEFAULT: 'default',
13
13
  DANGER: 'danger',
14
14
  NEUTRAL: 'neutral',
15
15
  };
16
- var COLOR_VALUES = Object.values(COLORS);
17
- var DEFAULT_COLOR = COLOR_VALUES[0];
18
- var SIZES = {
16
+ const COLOR_VALUES = Object.values(COLORS);
17
+ const DEFAULT_COLOR = COLOR_VALUES[0];
18
+ const SIZES = {
19
19
  MEDIUM: 'md',
20
20
  SMALL: 'sm',
21
21
  };
22
- var SIZE_VALUES = Object.values(SIZES);
23
- var DEFAULT_SIZE = SIZE_VALUES[0];
24
- var LAYOUTS = {
22
+ const SIZE_VALUES = Object.values(SIZES);
23
+ const DEFAULT_SIZE = SIZE_VALUES[0];
24
+ const LAYOUTS = {
25
25
  DEFAULT: 'default',
26
26
  STACKED: 'stacked',
27
27
  CIRCLE: 'circle',
28
+ SQUARED: 'squared',
28
29
  };
29
- var LAYOUT_VALUES = Object.values(LAYOUTS);
30
- var DEFAULT_LAYOUT = LAYOUT_VALUES[0];
31
- var TOOLTIP_PLACEMENTS = {
30
+ const LAYOUT_VALUES = Object.values(LAYOUTS);
31
+ const DEFAULT_LAYOUT = LAYOUT_VALUES[0];
32
+ const TOOLTIP_PLACEMENTS = {
32
33
  TOP: 'top',
33
34
  BOTTOM: 'bottom',
34
35
  LEFT: 'left',
35
36
  RIGHT: 'right',
36
37
  };
37
- var TOOLTIP_PLACEMENT_VALUES = Object.values(TOOLTIP_PLACEMENTS);
38
- var DEFAULT_TOOLTIP_PLACEMENT = TOOLTIP_PLACEMENTS.TOP;
39
- var CSS_COLOR_PROPERTIES = {
38
+ const TOOLTIP_PLACEMENT_VALUES = Object.values(TOOLTIP_PLACEMENTS);
39
+ const DEFAULT_TOOLTIP_PLACEMENT = TOOLTIP_PLACEMENTS.TOP;
40
+ const CSS_COLOR_PROPERTIES = {
40
41
  primary: {
41
42
  default: {
42
43
  color: colorWhite,
@@ -157,15 +158,15 @@ var CSS_COLOR_PROPERTIES = {
157
158
  },
158
159
  },
159
160
  };
160
- var CSS_COLOR_PROPERTIES_DISABLED = {
161
+ const CSS_COLOR_PROPERTIES_DISABLED = {
161
162
  color: colorNeutral3,
162
163
  background: colorBackgroundLight,
163
164
  border: false,
164
165
  outline: colorNeutral3,
165
166
  };
166
- var CSS_SIZE_PROPERTIES = {
167
+ const CSS_SIZE_PROPERTIES = {
167
168
  sm: {
168
- padding: "".concat(spacingSmall, " ").concat(spacingSmallMedium),
169
+ padding: `${spacingSmall} ${spacingSmallMedium}`,
169
170
  },
170
171
  md: {
171
172
  padding: spacingMedium
@@ -1,60 +1,202 @@
1
- var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
2
- if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
3
- return cooked;
4
- };
5
1
  import styled, { css } from 'styled-components';
6
2
  import { CSS_COLOR_PROPERTIES, CSS_COLOR_PROPERTIES_DISABLED, CSS_SIZE_PROPERTIES, DEFAULT_COLOR, DEFAULT_SIZE, DEFAULT_VARIANT, VARIANTS, LAYOUTS, } from './constants';
7
- import { borderRadiusDefault, spacingSmall, } from '../../stylesheets/sizing';
8
- import { colorBorderDefault, colorTextDefault } from '../../stylesheets/pallete';
3
+ import { borderRadiusDefault, borderRadiusSmall, spacingSmall, } from '../../stylesheets/sizing';
4
+ import { colorBorderDefault, colorTextDefault } from '../../stylesheets/palette';
9
5
  import { fontSizeSmall } from '../../stylesheets/typography';
10
- var commonButtonStyles = css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n cursor: pointer;\n user-select: none;\n font-weight: 600;\n line-height: normal;\n text-align: center;\n white-space: nowrap;\n text-transform: none;\n position: relative;\n transition: opacity 0.2s ease-in-out;\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n"], ["\n cursor: pointer;\n user-select: none;\n font-weight: 600;\n line-height: normal;\n text-align: center;\n white-space: nowrap;\n text-transform: none;\n position: relative;\n transition: opacity 0.2s ease-in-out;\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n"])), function (_a) {
11
- var _b;
12
- var $size = _a.$size;
13
- var safeSize = $size !== null && $size !== void 0 ? $size : DEFAULT_SIZE;
14
- return "padding: ".concat(((_b = CSS_SIZE_PROPERTIES[safeSize]) !== null && _b !== void 0 ? _b : CSS_SIZE_PROPERTIES[DEFAULT_SIZE]).padding, ";");
15
- }, function (_a) {
16
- var $color = _a.$color, $variant = _a.$variant;
17
- var safeColor = $color || DEFAULT_COLOR;
18
- var safeVariant = $variant || DEFAULT_VARIANT;
19
- var _b = CSS_COLOR_PROPERTIES[safeVariant][safeColor], contentColor = _b.color, iconColor = _b.iconColor, background = _b.background, border = _b.border, hoverColor = _b.hoverColor, hoverBackground = _b.hoverBackground, hoverBorder = _b.hoverBorder, outline = _b.outline;
20
- return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n & span {\n color: ", ";\n }\n ", ";\n ", "\n ", "\n\n &&:hover:not(:has(> [data-is-aux-icon]:hover)),\n &&:active {\n color: ", ";\n ", "\n ", "\n }\n &&:focus {\n border: 1px solid transparent;\n outline: 2px solid ", ";\n }\n "], ["\n & span {\n color: ", ";\n }\n ", ";\n ", "\n ", "\n\n &&:hover:not(:has(> [data-is-aux-icon]:hover)),\n &&:active {\n color: ", ";\n ", "\n ", "\n }\n &&:focus {\n border: 1px solid transparent;\n outline: 2px solid ", ";\n }\n "])), contentColor, iconColor ? "color: ".concat(iconColor) : "color: ".concat(contentColor), background && "background-color: ".concat(background, ";"), border ? "border: 1px solid ".concat(border, ";") : 'border: 1px solid transparent;', hoverColor, hoverBackground && "background-color: ".concat(hoverBackground, ";"), hoverBorder ? "border: 1px solid ".concat(hoverBorder, ";") : 'border: 1px solid transparent;', outline);
21
- }, function (_a) {
22
- var $variant = _a.$variant;
23
- return $variant === VARIANTS.SUBTLE &&
24
- "\n text-decoration: underline;\n ";
25
- }, function (_a) {
26
- var disabled = _a.disabled;
6
+ const commonButtonStyles = css `
7
+ cursor: pointer;
8
+ user-select: none;
9
+ font-weight: 600;
10
+ line-height: normal;
11
+ text-align: center;
12
+ white-space: nowrap;
13
+ text-transform: none;
14
+ position: relative;
15
+ transition: opacity 0.2s ease-in-out;
16
+
17
+ ${({ $size }) => {
18
+ var _a;
19
+ const safeSize = $size !== null && $size !== void 0 ? $size : DEFAULT_SIZE;
20
+ return `padding: ${((_a = CSS_SIZE_PROPERTIES[safeSize]) !== null && _a !== void 0 ? _a : CSS_SIZE_PROPERTIES[DEFAULT_SIZE]).padding};`;
21
+ }}
22
+
23
+ ${({ $color, $variant }) => {
24
+ const safeColor = $color || DEFAULT_COLOR;
25
+ const safeVariant = $variant || DEFAULT_VARIANT;
26
+ const { color: contentColor, iconColor, background, border, hoverColor, hoverBackground, hoverBorder, outline, } = CSS_COLOR_PROPERTIES[safeVariant][safeColor];
27
+ return css `
28
+ & span {
29
+ color: ${contentColor};
30
+ }
31
+ ${iconColor ? `color: ${iconColor}` : `color: ${contentColor}`};
32
+ ${background && `background-color: ${background};`}
33
+ ${border ? `border: 1px solid ${border};` : 'border: 1px solid transparent;'}
34
+
35
+ &&:hover:not(:has(> [data-is-aux-icon]:hover)),
36
+ &&:active {
37
+ color: ${hoverColor};
38
+ ${hoverBackground && `background-color: ${hoverBackground};`}
39
+ ${hoverBorder ? `border: 1px solid ${hoverBorder};` : 'border: 1px solid transparent;'}
40
+ }
41
+ &&:focus {
42
+ border: 1px solid transparent;
43
+ outline: 2px solid ${outline};
44
+ }
45
+ `;
46
+ }}
47
+
48
+ ${({ $variant }) => $variant === VARIANTS.SUBTLE &&
49
+ `
50
+ text-decoration: underline;
51
+ `}
52
+
53
+ ${({ disabled }) => {
27
54
  if (!disabled)
28
55
  return null;
29
- var color = CSS_COLOR_PROPERTIES_DISABLED.color, background = CSS_COLOR_PROPERTIES_DISABLED.background, border = CSS_COLOR_PROPERTIES_DISABLED.border, outline = CSS_COLOR_PROPERTIES_DISABLED.outline;
30
- return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n pointer-events: none;\n cursor: not-allowed;\n & span {\n color: ", ";\n }\n color: ", ";\n ", ";\n border: ", ";\n\n &&:hover,\n &&:active {\n color: ", ";\n ", ";\n border: ", ";\n }\n \n &&:focus {\n outline: 2px solid ", ";\n }\n "], ["\n pointer-events: none;\n cursor: not-allowed;\n & span {\n color: ", ";\n }\n color: ", ";\n ", ";\n border: ", ";\n\n &&:hover,\n &&:active {\n color: ", ";\n ", ";\n border: ", ";\n }\n \n &&:focus {\n outline: 2px solid ", ";\n }\n "])), color, color, background ? "background-color: ".concat(background) : "background-color: none", border ? "1px solid ".concat(border) : 'none', color, background ? "background-color: ".concat(background) : "background-color: none", border ? "1px solid ".concat(border) : 'none', outline);
31
- });
32
- var stackedLayoutStyles = css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n width: 4.5rem;\n height: 4.5rem;\n border-radius: ", " !important;\n border: 1px solid ", " !important;\n padding: ", " !important;\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n"], ["\n width: 4.5rem;\n height: 4.5rem;\n border-radius: ", " !important;\n border: 1px solid ", " !important;\n padding: ", " !important;\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n"])), borderRadiusDefault, colorBorderDefault, spacingSmall);
33
- var circleLayoutStyles = css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n border-radius: 50%;\n width: 3rem;\n height: 3rem;\n aspect-ratio: 1;\n padding: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n"], ["\n border-radius: 50%;\n width: 3rem;\n height: 3rem;\n aspect-ratio: 1;\n padding: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n"])));
34
- var defaultLayoutStyles = css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n display: inline-flex;\n justify-content: center;\n align-items: center;\n gap: ", ";\n border-radius: ", ";\n"], ["\n display: inline-flex;\n justify-content: center;\n align-items: center;\n gap: ", ";\n border-radius: ", ";\n"])), spacingSmall, borderRadiusDefault);
35
- export var ButtonWrapper = styled.div(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (_a) {
36
- var $layout = _a.$layout;
37
- return $layout === LAYOUTS.STACKED && "\n width: 5rem;\n display: flex;\n flex-direction: column;\n gap: ".concat(spacingSmall, ";\n align-items: center;\n ");
38
- });
39
- export var Button = styled.button(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n ", "\n\n ", "\n"], ["\n ", "\n\n ", "\n"])), commonButtonStyles, function (_a) {
40
- var $layout = _a.$layout;
56
+ const { color, background, border, outline } = CSS_COLOR_PROPERTIES_DISABLED;
57
+ return css `
58
+ pointer-events: none;
59
+ cursor: not-allowed;
60
+ & span {
61
+ color: ${color};
62
+ }
63
+ color: ${color};
64
+ ${background ? `background-color: ${background}` : `background-color: none`};
65
+ border: ${border ? `1px solid ${border}` : 'none'};
66
+
67
+ &&:hover,
68
+ &&:active {
69
+ color: ${color};
70
+ ${background ? `background-color: ${background}` : `background-color: none`};
71
+ border: ${border ? `1px solid ${border}` : 'none'};
72
+ }
73
+
74
+ &&:focus {
75
+ outline: 2px solid ${outline};
76
+ }
77
+ `;
78
+ }}
79
+ `;
80
+ const stackedLayoutStyles = css `
81
+ width: 4.5rem;
82
+ height: 4.5rem;
83
+ border-radius: ${borderRadiusDefault} !important;
84
+ border: 1px solid ${colorBorderDefault} !important;
85
+ padding: ${spacingSmall} !important;
86
+ box-sizing: border-box;
87
+ display: flex;
88
+ flex-direction: column;
89
+ justify-content: center;
90
+ align-items: center;
91
+ `;
92
+ const circleLayoutStyles = css `
93
+ border-radius: 50%;
94
+ width: 3rem;
95
+ height: 3rem;
96
+ aspect-ratio: 1;
97
+ padding: 0;
98
+ display: flex;
99
+ justify-content: center;
100
+ align-items: center;
101
+ `;
102
+ // Icon-only, sized by its own (equal, non-text) padding rather than a fixed
103
+ // box — stays compact next to a single line of text instead of forcing a
104
+ // fixed height like circle/stacked do.
105
+ const squaredLayoutStyles = css `
106
+ border-radius: ${borderRadiusSmall};
107
+ aspect-ratio: 1;
108
+ padding: ${spacingSmall};
109
+ display: flex;
110
+ justify-content: center;
111
+ align-items: center;
112
+ `;
113
+ const defaultLayoutStyles = css `
114
+ display: inline-flex;
115
+ justify-content: center;
116
+ align-items: center;
117
+ gap: ${spacingSmall};
118
+ border-radius: ${borderRadiusDefault};
119
+ `;
120
+ export const ButtonWrapper = styled.div `
121
+ ${({ $layout }) => $layout === LAYOUTS.STACKED && `
122
+ width: 5rem;
123
+ display: flex;
124
+ flex-direction: column;
125
+ gap: ${spacingSmall};
126
+ align-items: center;
127
+ `}
128
+ `;
129
+ export const Button = styled.button `
130
+ ${commonButtonStyles}
131
+
132
+ ${({ $layout }) => {
41
133
  switch ($layout) {
42
134
  case LAYOUTS.STACKED:
43
135
  return stackedLayoutStyles;
44
136
  case LAYOUTS.CIRCLE:
45
137
  return circleLayoutStyles;
138
+ case LAYOUTS.SQUARED:
139
+ return squaredLayoutStyles;
46
140
  default:
47
141
  return defaultLayoutStyles;
48
142
  }
49
- });
50
- export var HelperIconContainer = styled.div(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n ", "\n border-radius: 50%;\n padding: 0.2rem;\n position: absolute;\n top: 0.1rem;\n right: 0.1rem;\n & svg {\n font-size: 1.25rem;\n }\n"], ["\n ", "\n border-radius: 50%;\n padding: 0.2rem;\n position: absolute;\n top: 0.1rem;\n right: 0.1rem;\n & svg {\n font-size: 1.25rem;\n }\n"])), function (_a) {
51
- var $hover = _a.$hover, $variant = _a.$variant, $color = _a.$color;
143
+ }}
144
+ `;
145
+ export const HelperIconContainer = styled.div `
146
+ ${({ $hover, $variant, $color }) => {
52
147
  if (!$hover)
53
148
  return null;
54
- return css(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n &&:hover,\n &&:active {\n ", "\n }\n\n &&:focus {\n outline: 1px solid ", ";\n }\n "], ["\n &&:hover,\n &&:active {\n ", "\n }\n\n &&:focus {\n outline: 1px solid ", ";\n }\n "])), CSS_COLOR_PROPERTIES[$variant][$color].hoverBackground &&
55
- "background-color: ".concat(CSS_COLOR_PROPERTIES[$variant][$color].hoverBackground, ";"), CSS_COLOR_PROPERTIES[$variant][$color].outline);
56
- });
57
- export var HelperIcon = styled.div(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: center;\n"], ["\n display: flex;\n align-items: center;\n justify-content: center;\n"])));
58
- export var IconWrapper = styled.div(templateObject_12 || (templateObject_12 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: center;\n flex: 1;\n\n > i {\n font-size: 2rem;\n }\n"], ["\n display: flex;\n align-items: center;\n justify-content: center;\n flex: 1;\n\n > i {\n font-size: 2rem;\n }\n"])));
59
- export var ButtonText = styled.div(templateObject_13 || (templateObject_13 = __makeTemplateObject(["\n color: ", ";\n font-size: ", ";\n width: 100%;\n text-align: center;\n line-height: 1;\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n"], ["\n color: ", ";\n font-size: ", ";\n width: 100%;\n text-align: center;\n line-height: 1;\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n"])), colorTextDefault, fontSizeSmall);
60
- var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13;
149
+ return css `
150
+ &&:hover,
151
+ &&:active {
152
+ ${CSS_COLOR_PROPERTIES[$variant][$color].hoverBackground &&
153
+ `background-color: ${CSS_COLOR_PROPERTIES[$variant][$color].hoverBackground};`}
154
+ }
155
+
156
+ &&:focus {
157
+ outline: 1px solid ${CSS_COLOR_PROPERTIES[$variant][$color].outline};
158
+ }
159
+ `;
160
+ }}
161
+ border-radius: 50%;
162
+ padding: 0.2rem;
163
+ position: absolute;
164
+ top: 0.1rem;
165
+ right: 0.1rem;
166
+ & svg {
167
+ font-size: 1.25rem;
168
+ }
169
+ `;
170
+ export const HelperIcon = styled.div `
171
+ display: flex;
172
+ align-items: center;
173
+ justify-content: center;
174
+ `;
175
+ export const IconWrapper = styled.div `
176
+ display: flex;
177
+ align-items: center;
178
+ justify-content: center;
179
+ flex: 1;
180
+
181
+ > i {
182
+ font-size: 2rem;
183
+ }
184
+ `;
185
+ export const FeedbackContent = styled.span `
186
+ display: inline-flex;
187
+ align-items: center;
188
+ justify-content: center;
189
+ gap: ${spacingSmall};
190
+ `;
191
+ export const ButtonText = styled.div `
192
+ color: ${colorTextDefault};
193
+ font-size: ${fontSizeSmall};
194
+ width: 100%;
195
+ text-align: center;
196
+ line-height: 1;
197
+ overflow: hidden;
198
+ text-overflow: ellipsis;
199
+ display: -webkit-box;
200
+ -webkit-line-clamp: 2;
201
+ -webkit-box-orient: vertical;
202
+ `;
@@ -1,14 +1,3 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
1
  var __rest = (this && this.__rest) || function (s, e) {
13
2
  var t = {};
14
3
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
@@ -33,9 +22,9 @@ import { RadioButtonUnchecked, RadioButtonChecked } from '@mui/icons-material';
33
22
  *
34
23
  */
35
24
  function Checkbox(_a) {
36
- var label = _a.label, _b = _a.layout, layout = _b === void 0 ? DEFAULT_LAYOUT : _b, _c = _a.round, round = _c === void 0 ? false : _c, ariaLabel = _a.ariaLabel, props = __rest(_a, ["label", "layout", "round", "ariaLabel"]);
37
- var id = useId();
38
- var checkbox = (React.createElement(Styled.StyledCheckbox, __assign({}, props, { id: id, "aria-label": ariaLabel, icon: round ? React.createElement(RadioButtonUnchecked, null) : undefined, checkedIcon: round ? React.createElement(RadioButtonChecked, null) : undefined })));
25
+ var { label, layout = DEFAULT_LAYOUT, round = false, ariaLabel } = _a, props = __rest(_a, ["label", "layout", "round", "ariaLabel"]);
26
+ const id = useId();
27
+ const checkbox = (React.createElement(Styled.StyledCheckbox, Object.assign({}, props, { id: id, "aria-label": ariaLabel, icon: round ? React.createElement(RadioButtonUnchecked, null) : undefined, checkedIcon: round ? React.createElement(RadioButtonChecked, null) : undefined })));
39
28
  if (!label) {
40
29
  return checkbox;
41
30
  }
@@ -1,6 +1,6 @@
1
- export var LAYOUTS = {
1
+ export const LAYOUTS = {
2
2
  RIGHT: 'right',
3
3
  LEFT: 'left',
4
4
  };
5
- export var LAYOUT_VALUES = Object.values(LAYOUTS);
6
- export var DEFAULT_LAYOUT = LAYOUT_VALUES[0];
5
+ export const LAYOUT_VALUES = Object.values(LAYOUTS);
6
+ export const DEFAULT_LAYOUT = LAYOUT_VALUES[0];