@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
@@ -1,17 +1,106 @@
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
- import { colorBorderDefault, colorBorderSelected, colorTextDefault, colorTextLight, colorIconDefault, colorIconBlue, colorBrand1, } from '../../stylesheets/pallete';
2
+ import { colorBorderDefault, colorBorderSelected, colorTextDefault, colorTextLight, colorIconDefault, colorIconBlue, colorBrand1, } from '../../stylesheets/palette';
7
3
  import { spacingSmall, spacingMedium, borderRadiusDefault, } from '../../stylesheets/sizing';
8
4
  import { fontSizeSmall } from '../../stylesheets/typography';
9
- export var Container = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n position: relative;\n width: 100%;\n height: 2.5rem;\n padding: ", " ", ";\n gap: ", ";\n border-radius: ", ";\n border: 1px solid ", ";\n background-color: transparent;\n box-sizing: border-box;\n cursor: text;\n transition: border-color 0.15s ease, box-shadow 0.15s ease;\n\n &:focus-within {\n border-color: ", ";\n box-shadow: 0 0 0 3px var(--color-border-focus-ring, rgba(29, 101, 212, 0.15));\n }\n\n ", "\n"], ["\n display: flex;\n align-items: center;\n position: relative;\n width: 100%;\n height: 2.5rem;\n padding: ", " ", ";\n gap: ", ";\n border-radius: ", ";\n border: 1px solid ", ";\n background-color: transparent;\n box-sizing: border-box;\n cursor: text;\n transition: border-color 0.15s ease, box-shadow 0.15s ease;\n\n &:focus-within {\n border-color: ", ";\n box-shadow: 0 0 0 3px var(--color-border-focus-ring, rgba(29, 101, 212, 0.15));\n }\n\n ", "\n"])), spacingSmall, spacingMedium, spacingSmall, borderRadiusDefault, colorBorderDefault, colorBorderSelected, function (_a) {
10
- var $disabled = _a.$disabled;
11
- return $disabled && css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n opacity: 0.5;\n cursor: not-allowed;\n pointer-events: none;\n "], ["\n opacity: 0.5;\n cursor: not-allowed;\n pointer-events: none;\n "])));
12
- });
13
- export var SearchIconWrapper = styled.span(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n color: ", ";\n width: 1rem;\n height: 1rem;\n"], ["\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n color: ", ";\n width: 1rem;\n height: 1rem;\n"])), colorIconDefault);
14
- export var StyledInput = styled.input(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n flex: 1;\n min-width: 0;\n border: none;\n outline: none;\n background: transparent;\n color: ", ";\n font-size: ", ";\n line-height: 1.5;\n padding: 0;\n\n &::placeholder {\n color: ", ";\n }\n\n &:disabled {\n cursor: not-allowed;\n }\n\n &::-webkit-search-decoration,\n &::-webkit-search-cancel-button,\n &::-webkit-search-results-button,\n &::-webkit-search-results-decoration {\n -webkit-appearance: none;\n appearance: none;\n display: none;\n }\n\n [dir='rtl'] & {\n text-align: right;\n }\n"], ["\n flex: 1;\n min-width: 0;\n border: none;\n outline: none;\n background: transparent;\n color: ", ";\n font-size: ", ";\n line-height: 1.5;\n padding: 0;\n\n &::placeholder {\n color: ", ";\n }\n\n &:disabled {\n cursor: not-allowed;\n }\n\n &::-webkit-search-decoration,\n &::-webkit-search-cancel-button,\n &::-webkit-search-results-button,\n &::-webkit-search-results-decoration {\n -webkit-appearance: none;\n appearance: none;\n display: none;\n }\n\n [dir='rtl'] & {\n text-align: right;\n }\n"])), colorTextDefault, fontSizeSmall, colorTextLight);
15
- export var ActionWrapper = styled.span(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n width: 1rem;\n height: 1rem;\n color: ", ";\n"], ["\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n width: 1rem;\n height: 1rem;\n color: ", ";\n"])), colorBrand1);
16
- export var ClearButton = styled.button(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n background: transparent;\n border: none;\n cursor: pointer;\n padding: 0;\n width: 1rem;\n height: 1rem;\n color: ", ";\n line-height: 1;\n transition: color 0.1s ease;\n\n &:hover {\n color: ", ";\n }\n\n &:focus-visible {\n outline: 2px solid ", ";\n outline-offset: 2px;\n border-radius: 2px;\n }\n"], ["\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n background: transparent;\n border: none;\n cursor: pointer;\n padding: 0;\n width: 1rem;\n height: 1rem;\n color: ", ";\n line-height: 1;\n transition: color 0.1s ease;\n\n &:hover {\n color: ", ";\n }\n\n &:focus-visible {\n outline: 2px solid ", ";\n outline-offset: 2px;\n border-radius: 2px;\n }\n"])), colorIconDefault, colorIconBlue, colorBorderSelected);
17
- var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
5
+ export const Container = styled.div `
6
+ display: flex;
7
+ align-items: center;
8
+ position: relative;
9
+ width: 100%;
10
+ height: 2.5rem;
11
+ padding: ${spacingSmall} ${spacingMedium};
12
+ gap: ${spacingSmall};
13
+ border-radius: ${borderRadiusDefault};
14
+ border: 1px solid ${colorBorderDefault};
15
+ background-color: transparent;
16
+ box-sizing: border-box;
17
+ cursor: text;
18
+ transition: border-color 0.15s ease, box-shadow 0.15s ease;
19
+
20
+ &:focus-within {
21
+ border-color: ${colorBorderSelected};
22
+ box-shadow: 0 0 0 3px var(--color-border-focus-ring, rgba(29, 101, 212, 0.15));
23
+ }
24
+
25
+ ${({ $disabled }) => $disabled &&
26
+ css `
27
+ opacity: 0.5;
28
+ cursor: not-allowed;
29
+ pointer-events: none;
30
+ `}
31
+ `;
32
+ export const SearchIconWrapper = styled.span `
33
+ display: flex;
34
+ align-items: center;
35
+ justify-content: center;
36
+ flex-shrink: 0;
37
+ color: ${colorIconDefault};
38
+ width: 1rem;
39
+ height: 1rem;
40
+ `;
41
+ export const StyledInput = styled.input `
42
+ flex: 1;
43
+ min-width: 0;
44
+ border: none;
45
+ outline: none;
46
+ background: transparent;
47
+ color: ${colorTextDefault};
48
+ font-size: ${fontSizeSmall};
49
+ line-height: 1.5;
50
+ padding: 0;
51
+
52
+ &::placeholder {
53
+ color: ${colorTextLight};
54
+ }
55
+
56
+ &:disabled {
57
+ cursor: not-allowed;
58
+ }
59
+
60
+ &::-webkit-search-decoration,
61
+ &::-webkit-search-cancel-button,
62
+ &::-webkit-search-results-button,
63
+ &::-webkit-search-results-decoration {
64
+ -webkit-appearance: none;
65
+ appearance: none;
66
+ display: none;
67
+ }
68
+
69
+ [dir='rtl'] & {
70
+ text-align: right;
71
+ }
72
+ `;
73
+ export const ActionWrapper = styled.span `
74
+ display: flex;
75
+ align-items: center;
76
+ justify-content: center;
77
+ flex-shrink: 0;
78
+ width: 1rem;
79
+ height: 1rem;
80
+ color: ${colorBrand1};
81
+ `;
82
+ export const ClearButton = styled.button `
83
+ display: flex;
84
+ align-items: center;
85
+ justify-content: center;
86
+ flex-shrink: 0;
87
+ background: transparent;
88
+ border: none;
89
+ cursor: pointer;
90
+ padding: 0;
91
+ width: 1rem;
92
+ height: 1rem;
93
+ color: ${colorIconDefault};
94
+ line-height: 1;
95
+ transition: color 0.1s ease;
96
+
97
+ &:hover {
98
+ color: ${colorIconBlue};
99
+ }
100
+
101
+ &:focus-visible {
102
+ outline: 2px solid ${colorBorderSelected};
103
+ outline-offset: 2px;
104
+ border-radius: 2px;
105
+ }
106
+ `;
@@ -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)
@@ -31,14 +20,14 @@ import * as Styled from './styles';
31
20
  *
32
21
  */
33
22
  function Select(_a) {
34
- var _b = _a.title, title = _b === void 0 ? null : _b, _c = _a.icon, icon = _c === void 0 ? null : _c, children = _a.children, ariaLabel = _a.ariaLabel, props = __rest(_a, ["title", "icon", "children", "ariaLabel"]);
35
- var id = useId();
36
- var selectId = "select-".concat(id);
37
- var labelId = title ? "select-label-".concat(id) : undefined;
23
+ var { title = null, icon = null, children, ariaLabel } = _a, props = __rest(_a, ["title", "icon", "children", "ariaLabel"]);
24
+ const id = useId();
25
+ const selectId = `select-${id}`;
26
+ const labelId = title ? `select-label-${id}` : undefined;
38
27
  return (React.createElement(Styled.SelectContainer, null,
39
28
  title && React.createElement(Styled.Title, { id: labelId, htmlFor: selectId }, title),
40
29
  React.createElement(Styled.SelectWrapper, null,
41
30
  icon && (React.createElement(Styled.SelectorIcon, null, icon)),
42
- React.createElement(Styled.Selector, __assign({}, props, { id: selectId, labelId: labelId, "aria-label": ariaLabel, IconComponent: MdExpandMore }), children))));
31
+ React.createElement(Styled.Selector, Object.assign({}, props, { id: selectId, labelId: labelId, "aria-label": ariaLabel, IconComponent: MdExpandMore }), children))));
43
32
  }
44
33
  export default Select;
@@ -1,15 +1,55 @@
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
2
  import { borderRadiusSmall, spacingMedium, spacingSmall } from '../../stylesheets/sizing';
7
3
  import Select from '@mui/material/Select';
8
- import { colorBorderDefault, colorBrand1, colorDarkGray } from '../../stylesheets/pallete';
4
+ import { colorBorderDefault, colorBorderSelected, colorBrand1, colorDarkGray } from '../../stylesheets/palette';
9
5
  import { fontSizeSmall } from '../../stylesheets/typography';
10
- export var SelectContainer = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n flex-shrink: 0;\n gap: ", ";\n justify-content: start;\n align-items: center;\n"], ["\n display: flex;\n flex-direction: column;\n flex-shrink: 0;\n gap: ", ";\n justify-content: start;\n align-items: center;\n"])), spacingSmall);
11
- export var SelectWrapper = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n flex-direction: row;\n justify-content: center;\n gap: ", "; \n padding: 1px;\n width: 100%;\n"], ["\n display: flex;\n flex-direction: row;\n justify-content: center;\n gap: ", "; \n padding: 1px;\n width: 100%;\n"])), spacingMedium);
12
- export var Selector = styled(Select)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n height: 3.5rem;\n flex: 1;\n border-radius: ", " !important;\n overflow: hidden;\n width: 100%;\n border: 1px solid ", ";\n"], ["\n height: 3.5rem;\n flex: 1;\n border-radius: ", " !important;\n overflow: hidden;\n width: 100%;\n border: 1px solid ", ";\n"])), borderRadiusSmall, colorBorderDefault);
13
- export var Title = styled.label(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n align-self: flex-start;\n color: ", ";\n font-size: ", ";\n font-style: normal;\n font-weight: 400;\n line-height: normal;\n"], ["\n align-self: flex-start;\n color: ", ";\n font-size: ", ";\n font-style: normal;\n font-weight: 400;\n line-height: normal;\n"])), colorDarkGray, fontSizeSmall);
14
- export var SelectorIcon = styled.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n color: ", ";\n"], ["\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n color: ", ";\n"])), colorBrand1);
15
- var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
6
+ export const SelectContainer = styled.div `
7
+ display: flex;
8
+ flex-direction: column;
9
+ flex-shrink: 0;
10
+ gap: ${spacingSmall};
11
+ justify-content: start;
12
+ align-items: center;
13
+ `;
14
+ export const SelectWrapper = styled.div `
15
+ display: flex;
16
+ flex-direction: row;
17
+ justify-content: center;
18
+ gap: ${spacingMedium};
19
+ padding: 1px;
20
+ width: 100%;
21
+ `;
22
+ export const Selector = styled(Select) `
23
+ height: 3.5rem;
24
+ flex: 1;
25
+ border-radius: ${borderRadiusSmall} !important;
26
+ overflow: hidden;
27
+ width: 100%;
28
+
29
+ & .MuiOutlinedInput-notchedOutline {
30
+ border-color: ${colorBorderDefault};
31
+ }
32
+
33
+ &:hover .MuiOutlinedInput-notchedOutline {
34
+ border-color: ${colorBorderSelected};
35
+ }
36
+
37
+ &.Mui-focused .MuiOutlinedInput-notchedOutline {
38
+ border-color: ${colorBorderSelected};
39
+ }
40
+ `;
41
+ export const Title = styled.label `
42
+ align-self: flex-start;
43
+ color: ${colorDarkGray};
44
+ font-size: ${fontSizeSmall};
45
+ font-style: normal;
46
+ font-weight: 400;
47
+ line-height: normal;
48
+ `;
49
+ export const SelectorIcon = styled.div `
50
+ display: flex;
51
+ align-items: center;
52
+ justify-content: center;
53
+ flex-shrink: 0;
54
+ color: ${colorBrand1};
55
+ `;
@@ -6,8 +6,7 @@ import * as Styled from './styles';
6
6
  * This component provides a small, configurable loading indicator for background activity or loading states.
7
7
  *
8
8
  */
9
- var Spinner = function (_a) {
10
- var _b = _a.size, size = _b === void 0 ? 48 : _b, _c = _a.strokeWidth, strokeWidth = _c === void 0 ? 4 : _c, _d = _a.animate, animate = _d === void 0 ? true : _d;
9
+ const Spinner = ({ size = 48, strokeWidth = 4, animate = true, }) => {
11
10
  return (React.createElement(Styled.Wrapper, { "$size": size, role: "progressbar", "aria-label": "Loading", "aria-busy": animate },
12
11
  React.createElement(Styled.StyledSvg, { viewBox: "0 0 50 50", "$animate": animate, focusable: "false", "aria-hidden": "true" },
13
12
  React.createElement(Styled.Path, { className: "path", cx: "25", cy: "25", r: "20", "$animate": animate, "$strokeWidth": strokeWidth }))));
@@ -1,30 +1,40 @@
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, { keyframes, css } from 'styled-components';
6
- import { colorBrand1 } from '../../stylesheets/pallete';
7
- var rotate = keyframes(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n"], ["\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n"])));
8
- var dash = keyframes(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n 0% { stroke-dasharray: 1, 200; stroke-dashoffset: 0; }\n 50% { stroke-dasharray: 100, 200; stroke-dashoffset: -15; }\n 100% { stroke-dasharray: 100, 200; stroke-dashoffset: -125; }\n"], ["\n 0% { stroke-dasharray: 1, 200; stroke-dashoffset: 0; }\n 50% { stroke-dasharray: 100, 200; stroke-dashoffset: -15; }\n 100% { stroke-dasharray: 100, 200; stroke-dashoffset: -125; }\n"])));
9
- export var Wrapper = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n width: ", ";\n height: ", ";\n display: inline-grid;\n place-items: center;\n"], ["\n width: ", ";\n height: ", ";\n display: inline-grid;\n place-items: center;\n"])), function (_a) {
10
- var $size = _a.$size;
11
- return typeof $size === 'number' ? "".concat($size, "px") : $size;
12
- }, function (_a) {
13
- var $size = _a.$size;
14
- return typeof $size === 'number' ? "".concat($size, "px") : $size;
15
- });
16
- export var StyledSvg = styled.svg(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n width: 100%;\n height: 100%;\n transform-origin: center;\n overflow: visible;\n ", "\n"], ["\n width: 100%;\n height: 100%;\n transform-origin: center;\n overflow: visible;\n ", "\n"])), function (_a) {
17
- var $animate = _a.$animate;
18
- return $animate && css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n animation: ", " 1.4s linear infinite;\n "], ["\n animation: ", " 1.4s linear infinite;\n "])), rotate);
19
- });
20
- export var Path = styled.circle(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n fill: none;\n stroke: ", ";\n stroke-width: ", "px;\n stroke-linecap: round;\n ", "\n\n ", "\n"], ["\n fill: none;\n stroke: ", ";\n stroke-width: ", "px;\n stroke-linecap: round;\n ", "\n\n ", "\n"])), colorBrand1, function (_a) {
21
- var $strokeWidth = _a.$strokeWidth;
22
- return $strokeWidth;
23
- }, function (_a) {
24
- var $animate = _a.$animate;
25
- return $animate && css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n animation: ", " 1.4s ease-in-out infinite;\n "], ["\n animation: ", " 1.4s ease-in-out infinite;\n "])), dash);
26
- }, function (_a) {
27
- var $animate = _a.$animate;
28
- return !$animate && css(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n stroke-dasharray: 94.2 31.4;\n stroke-dashoffset: 0;\n "], ["\n stroke-dasharray: 94.2 31.4;\n stroke-dashoffset: 0;\n "])));
29
- });
30
- var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8;
2
+ import { colorBrand1 } from '../../stylesheets/palette';
3
+ const rotate = keyframes `
4
+ 0% { transform: rotate(0deg); }
5
+ 100% { transform: rotate(360deg); }
6
+ `;
7
+ const dash = keyframes `
8
+ 0% { stroke-dasharray: 1, 200; stroke-dashoffset: 0; }
9
+ 50% { stroke-dasharray: 100, 200; stroke-dashoffset: -15; }
10
+ 100% { stroke-dasharray: 100, 200; stroke-dashoffset: -125; }
11
+ `;
12
+ export const Wrapper = styled.div `
13
+ width: ${({ $size }) => typeof $size === 'number' ? `${$size}px` : $size};
14
+ height: ${({ $size }) => typeof $size === 'number' ? `${$size}px` : $size};
15
+ display: inline-grid;
16
+ place-items: center;
17
+ `;
18
+ export const StyledSvg = styled.svg `
19
+ width: 100%;
20
+ height: 100%;
21
+ transform-origin: center;
22
+ overflow: visible;
23
+ ${({ $animate }) => $animate && css `
24
+ animation: ${rotate} 1.4s linear infinite;
25
+ `}
26
+ `;
27
+ export const Path = styled.circle `
28
+ fill: none;
29
+ stroke: ${colorBrand1};
30
+ stroke-width: ${({ $strokeWidth }) => $strokeWidth}px;
31
+ stroke-linecap: round;
32
+ ${({ $animate }) => $animate && css `
33
+ animation: ${dash} 1.4s ease-in-out infinite;
34
+ `}
35
+
36
+ ${({ $animate }) => !$animate && css `
37
+ stroke-dasharray: 94.2 31.4;
38
+ stroke-dashoffset: 0;
39
+ `}
40
+ `;
@@ -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)
@@ -30,14 +19,14 @@ import * as Styled from './styles';
30
19
  *
31
20
  */
32
21
  function TextAreaInput(_a) {
33
- var _b = _a.placeholder, placeholder = _b === void 0 ? '' : _b, _c = _a.rows, rows = _c === void 0 ? 1 : _c, _d = _a.maxLength, maxLength = _d === void 0 ? 250 : _d, _e = _a.autoFocus, autoFocus = _e === void 0 ? true : _e, _f = _a.inputRef, inputRef = _f === void 0 ? undefined : _f, onChange = _a.onChange, onKeyDown = _a.onKeyDown, props = __rest(_a, ["placeholder", "rows", "maxLength", "autoFocus", "inputRef", "onChange", "onKeyDown"]);
34
- var internalRef = useRef(null);
35
- useEffect(function () {
22
+ var { placeholder = '', rows = 1, maxLength = 250, autoFocus = true, inputRef = undefined, onChange, onKeyDown } = _a, props = __rest(_a, ["placeholder", "rows", "maxLength", "autoFocus", "inputRef", "onChange", "onKeyDown"]);
23
+ const internalRef = useRef(null);
24
+ useEffect(() => {
36
25
  if (autoFocus && internalRef.current) {
37
26
  internalRef.current.focus();
38
27
  }
39
28
  }, [autoFocus]);
40
- return (React.createElement(Styled.TextAreaInput, __assign({}, props, { rows: rows, maxLength: maxLength, ref: function (ref) {
29
+ return (React.createElement(Styled.TextAreaInput, Object.assign({}, props, { rows: rows, maxLength: maxLength, ref: (ref) => {
41
30
  internalRef.current = ref;
42
31
  if (typeof inputRef === 'function') {
43
32
  inputRef(ref);
@@ -1,9 +1,26 @@
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 { colorBorderDefault, colorBrand1, colorBrand2, colorLightGray, colorWhite } from '../../stylesheets/pallete';
2
+ import { colorBorderDefault, colorBrand1, colorBrand2, colorLightGray, colorWhite } from '../../stylesheets/palette';
7
3
  import { borderRadiusDefault } from '../../stylesheets/sizing';
8
- export var TextAreaInput = styled.textarea(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n flex: 1;\n background: ", ";\n background-clip: padding-box;\n margin: 0;\n color: ", ";\n padding: calc(.3rem* 2.5) calc(.75rem* 1.25);\n resize: none;\n -webkit-transition: none;\n transition: none;\n border-radius: ", ";\n font-size: 1rem;\n line-height: 1;\n min-height: 2.5rem;\n max-height: 10rem;\n border: 1px solid ", ";\n overflow-y: hidden;\n margin: 0.3em;\n &:focus {\n outline: ", " solid 2px;\n box-shadow: 0 0 0 2px ", " inset 0 0 0 1px ", ";\n }\n"], ["\n flex: 1;\n background: ", ";\n background-clip: padding-box;\n margin: 0;\n color: ", ";\n padding: calc(.3rem* 2.5) calc(.75rem* 1.25);\n resize: none;\n -webkit-transition: none;\n transition: none;\n border-radius: ", ";\n font-size: 1rem;\n line-height: 1;\n min-height: 2.5rem;\n max-height: 10rem;\n border: 1px solid ", ";\n overflow-y: hidden;\n margin: 0.3em;\n &:focus {\n outline: ", " solid 2px;\n box-shadow: 0 0 0 2px ", " inset 0 0 0 1px ", ";\n }\n"])), colorWhite, colorLightGray, borderRadiusDefault, colorBorderDefault, colorBrand1, colorBrand2, colorBrand1);
9
- var templateObject_1;
4
+ export const TextAreaInput = styled.textarea `
5
+ flex: 1;
6
+ background: ${colorWhite};
7
+ background-clip: padding-box;
8
+ margin: 0;
9
+ color: ${colorLightGray};
10
+ padding: calc(.3rem* 2.5) calc(.75rem* 1.25);
11
+ resize: none;
12
+ -webkit-transition: none;
13
+ transition: none;
14
+ border-radius: ${borderRadiusDefault};
15
+ font-size: 1rem;
16
+ line-height: 1;
17
+ min-height: 2.5rem;
18
+ max-height: 10rem;
19
+ border: 1px solid ${colorBorderDefault};
20
+ overflow-y: hidden;
21
+ margin: 0.3em;
22
+ &:focus {
23
+ outline: ${colorBrand1} solid 2px;
24
+ box-shadow: 0 0 0 2px ${colorBrand2} inset 0 0 0 1px ${colorBrand1};
25
+ }
26
+ `;
@@ -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)
@@ -30,10 +19,10 @@ import * as Styled from './styles';
30
19
  *
31
20
  */
32
21
  function TextInput(_a) {
33
- var label = _a.label, helperText = _a.helperText, error = _a.error, placeholder = _a.placeholder, props = __rest(_a, ["label", "helperText", "error", "placeholder"]);
22
+ var { label, helperText, error, placeholder } = _a, props = __rest(_a, ["label", "helperText", "error", "placeholder"]);
34
23
  return (React.createElement(Styled.Container, null,
35
24
  label && React.createElement(Styled.Label, null, label),
36
- React.createElement(Styled.StyledTextField, __assign({}, props, { "$error": error, placeholder: placeholder })),
25
+ React.createElement(Styled.StyledTextField, Object.assign({}, props, { "$error": error, placeholder: placeholder })),
37
26
  helperText && React.createElement(Styled.HelperText, { "$error": error }, helperText)));
38
27
  }
39
28
  export default TextInput;
@@ -1,20 +1,62 @@
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 { TextField } from '@mui/material';
7
- import { colorBorderDefault, colorBorderSelected, colorTextDefault, colorTextLight, colorBorderError, colorError, } from '../../stylesheets/pallete';
3
+ import { colorBorderDefault, colorBorderSelected, colorTextDefault, colorTextLight, colorBorderError, colorError, } from '../../stylesheets/palette';
8
4
  import { fontSizeSmall } from '../../stylesheets/typography';
9
5
  import { borderRadiusDefault, spacingMedium, spacingSmall } from '../../stylesheets/sizing';
10
- export var StyledTextField = styled(TextField)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n .MuiInputBase-root {\n display: flex;\n padding: ", ";\n align-items: center;\n gap: ", ";\n align-self: stretch;\n border-radius: ", ";\n border: 1px solid ", ";\n color: ", ";\n\n &.Mui-focused {\n border-color: ", ";\n color: ", ";\n }\n \n ", "\n }\n\n .MuiInputBase-input {\n padding: 0;\n height: auto;\n }\n\n .MuiOutlinedInput-notchedOutline {\n border: none;\n }\n"], ["\n .MuiInputBase-root {\n display: flex;\n padding: ", ";\n align-items: center;\n gap: ", ";\n align-self: stretch;\n border-radius: ", ";\n border: 1px solid ", ";\n color: ", ";\n\n &.Mui-focused {\n border-color: ", ";\n color: ", ";\n }\n \n ", "\n }\n\n .MuiInputBase-input {\n padding: 0;\n height: auto;\n }\n\n .MuiOutlinedInput-notchedOutline {\n border: none;\n }\n"])), spacingMedium, spacingSmall, borderRadiusDefault, colorBorderDefault, colorTextLight, colorBorderSelected, colorTextDefault, function (_a) {
11
- var $error = _a.$error;
12
- return $error && css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n border-color: ", ";\n "], ["\n border-color: ", ";\n "])), colorBorderError);
13
- });
14
- export var Label = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n color: ", ";\n font-size: ", ";\n font-style: normal;\n font-weight: 400;\n line-height: normal;\n"], ["\n color: ", ";\n font-size: ", ";\n font-style: normal;\n font-weight: 400;\n line-height: normal;\n"])), colorTextDefault, fontSizeSmall);
15
- export var HelperText = styled.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n color: ", ";\n font-size: ", ";\n font-style: normal;\n font-weight: 400;\n line-height: normal;\n padding: 0 ", "; \n\n ", "\n"], ["\n color: ", ";\n font-size: ", ";\n font-style: normal;\n font-weight: 400;\n line-height: normal;\n padding: 0 ", "; \n\n ", "\n"])), colorTextDefault, fontSizeSmall, spacingMedium, function (_a) {
16
- var $error = _a.$error;
17
- return $error && css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n color: ", ";\n "], ["\n color: ", ";\n "])), colorError);
18
- });
19
- export var Container = styled.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n width: 100%;\n gap: ", ";\n"], ["\n display: flex;\n flex-direction: column;\n width: 100%;\n gap: ", ";\n"])), spacingSmall);
20
- var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
6
+ export const StyledTextField = styled(TextField) `
7
+ .MuiInputBase-root {
8
+ display: flex;
9
+ padding: ${spacingMedium};
10
+ align-items: center;
11
+ gap: ${spacingSmall};
12
+ align-self: stretch;
13
+ border-radius: ${borderRadiusDefault};
14
+ border: 1px solid ${colorBorderDefault};
15
+ color: ${colorTextLight};
16
+
17
+ &.Mui-focused {
18
+ border-color: ${colorBorderSelected};
19
+ color: ${colorTextDefault};
20
+ }
21
+
22
+ ${({ $error }) => $error &&
23
+ css `
24
+ border-color: ${colorBorderError};
25
+ `}
26
+ }
27
+
28
+ .MuiInputBase-input {
29
+ padding: 0;
30
+ height: auto;
31
+ }
32
+
33
+ .MuiOutlinedInput-notchedOutline {
34
+ border: none;
35
+ }
36
+ `;
37
+ export const Label = styled.div `
38
+ color: ${colorTextDefault};
39
+ font-size: ${fontSizeSmall};
40
+ font-style: normal;
41
+ font-weight: 400;
42
+ line-height: normal;
43
+ `;
44
+ export const HelperText = styled.div `
45
+ color: ${colorTextDefault};
46
+ font-size: ${fontSizeSmall};
47
+ font-style: normal;
48
+ font-weight: 400;
49
+ line-height: normal;
50
+ padding: 0 ${spacingMedium};
51
+
52
+ ${({ $error }) => $error &&
53
+ css `
54
+ color: ${colorError};
55
+ `}
56
+ `;
57
+ export const Container = styled.div `
58
+ display: flex;
59
+ flex-direction: column;
60
+ width: 100%;
61
+ gap: ${spacingSmall};
62
+ `;
@@ -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)
@@ -31,16 +20,16 @@ import { DEFAULT_TEXT_POSITION } from './constants';
31
20
  *
32
21
  */
33
22
  function Toggle(_a) {
34
- var label = _a.label, helperText = _a.helperText, _b = _a.textPosition, textPosition = _b === void 0 ? DEFAULT_TEXT_POSITION : _b, onChange = _a.onChange, ariaLabel = _a.ariaLabel, ariaLabelledBy = _a.ariaLabelledBy, ariaDescribedBy = _a.ariaDescribedBy, providedId = _a.id, rest = __rest(_a, ["label", "helperText", "textPosition", "onChange", "ariaLabel", "ariaLabelledBy", "ariaDescribedBy", "id"]);
35
- var generatedUniqueId = useId();
36
- var id = providedId !== null && providedId !== void 0 ? providedId : generatedUniqueId;
37
- var labelId = label ? "".concat(id, "-label") : undefined;
38
- var helperTextId = helperText ? "".concat(id, "-helper") : undefined;
23
+ var { label, helperText, textPosition = DEFAULT_TEXT_POSITION, onChange, ariaLabel, ariaLabelledBy, ariaDescribedBy, id: providedId } = _a, rest = __rest(_a, ["label", "helperText", "textPosition", "onChange", "ariaLabel", "ariaLabelledBy", "ariaDescribedBy", "id"]);
24
+ const generatedUniqueId = useId();
25
+ const id = providedId !== null && providedId !== void 0 ? providedId : generatedUniqueId;
26
+ const labelId = label ? `${id}-label` : undefined;
27
+ const helperTextId = helperText ? `${id}-helper` : undefined;
39
28
  return (React.createElement(Styled.ToggleWrapper, { "$textPosition": textPosition },
40
29
  (label || helperText) && (React.createElement(Styled.TextWrapper, { "$textPosition": textPosition, htmlFor: id, "$hasLabel": !!label, "$hasHelperText": !!helperText },
41
30
  label && React.createElement(Styled.Title, { id: labelId }, label),
42
31
  helperText && React.createElement(Styled.HelperText, { id: helperTextId }, helperText))),
43
32
  React.createElement(Styled.ToggleSwitchWrapper, null,
44
- React.createElement(Styled.MaterialToggle, __assign({}, rest, { id: id, onChange: onChange, "aria-label": ariaLabel, "aria-labelledby": ariaLabel ? undefined : ariaLabelledBy || labelId, "aria-describedby": ariaDescribedBy || helperTextId })))));
33
+ React.createElement(Styled.MaterialToggle, Object.assign({}, rest, { id: id, onChange: onChange, "aria-label": ariaLabel, "aria-labelledby": ariaLabel ? undefined : ariaLabelledBy || labelId, "aria-describedby": ariaDescribedBy || helperTextId })))));
45
34
  }
46
35
  export default Toggle;
@@ -1,8 +1,8 @@
1
- export var TEXT_POSITIONS = {
1
+ export const TEXT_POSITIONS = {
2
2
  RIGHT: 'right',
3
3
  LEFT: 'left',
4
4
  TOP: 'top',
5
5
  BOTTOM: 'bottom',
6
6
  };
7
- export var TEXT_POSITIONS_VALUES = Object.values(TEXT_POSITIONS);
8
- export var DEFAULT_TEXT_POSITION = TEXT_POSITIONS_VALUES[0];
7
+ export const TEXT_POSITIONS_VALUES = Object.values(TEXT_POSITIONS);
8
+ export const DEFAULT_TEXT_POSITION = TEXT_POSITIONS_VALUES[0];