@activecollab/components 1.0.321 → 1.0.323

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.
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
- var _excluded = ["children", "type", "size", "invalid", "open", "endAdornment"];
3
+ var _excluded = ["children", "type", "size", "invalid", "open", "endAdornment", "typographyProps"];
4
4
  import React, { forwardRef } from "react";
5
5
  import { Typography } from "../Typography/Typography";
6
6
  import { StyledCaretIcon, StyledSelectTrigger } from "./Styles";
@@ -15,6 +15,7 @@ export var SelectTrigger = /*#__PURE__*/forwardRef(function (_ref, ref) {
15
15
  _ref$open = _ref.open,
16
16
  open = _ref$open === void 0 ? false : _ref$open,
17
17
  endAdornment = _ref.endAdornment,
18
+ typographyProps = _ref.typographyProps,
18
19
  rest = _objectWithoutPropertiesLoose(_ref, _excluded);
19
20
  return /*#__PURE__*/React.createElement(StyledSelectTrigger, _extends({
20
21
  ref: ref,
@@ -22,12 +23,12 @@ export var SelectTrigger = /*#__PURE__*/forwardRef(function (_ref, ref) {
22
23
  type: type,
23
24
  $size: size,
24
25
  $invalid: invalid
25
- }, rest), /*#__PURE__*/React.createElement(Typography, {
26
+ }, rest), /*#__PURE__*/React.createElement(Typography, _extends({
26
27
  as: "div",
27
28
  overflow: "truncate",
28
29
  whitespace: "no-wrap",
29
30
  variant: size === "small" || size === "regular" ? "Body 2" : "Body 1"
30
- }, children), endAdornment ? endAdornment : /*#__PURE__*/React.createElement(StyledCaretIcon, {
31
+ }, typographyProps), children), endAdornment ? endAdornment : /*#__PURE__*/React.createElement(StyledCaretIcon, {
31
32
  $open: open
32
33
  }));
33
34
  });
@@ -1 +1 @@
1
- {"version":3,"file":"SelectTrigger.js","names":["React","forwardRef","Typography","StyledCaretIcon","StyledSelectTrigger","SelectTrigger","ref","children","type","size","invalid","open","endAdornment","rest","displayName"],"sources":["../../../../src/components/SelectTrigger/SelectTrigger.tsx"],"sourcesContent":["import React, { forwardRef, ComponentPropsWithoutRef } from \"react\";\nimport { Typography } from \"../Typography/Typography\";\nimport { StyledCaretIcon, StyledSelectTrigger } from \"./Styles\";\n\nexport type Size = \"regular\" | \"big\" | \"small\";\n\nexport interface SelectTriggerProps extends ComponentPropsWithoutRef<\"button\"> {\n size?: Size;\n invalid?: boolean;\n endAdornment?: JSX.Element;\n open?: boolean;\n}\n\nexport const SelectTrigger = forwardRef<HTMLButtonElement, SelectTriggerProps>(\n (\n {\n children,\n type = \"button\",\n size = \"regular\",\n invalid = false,\n open = false,\n endAdornment,\n ...rest\n },\n ref\n ) => {\n return (\n <StyledSelectTrigger\n ref={ref}\n role=\"button\"\n type={type}\n $size={size}\n $invalid={invalid}\n {...rest}\n >\n <Typography\n as=\"div\"\n overflow=\"truncate\"\n whitespace=\"no-wrap\"\n variant={size === \"small\" || size === \"regular\" ? \"Body 2\" : \"Body 1\"}\n >\n {children}\n </Typography>\n\n {endAdornment ? endAdornment : <StyledCaretIcon $open={open} />}\n </StyledSelectTrigger>\n );\n }\n);\n\nSelectTrigger.displayName = \"SelectTrigger\";\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAkC,OAAO;AACnE,SAASC,UAAU,QAAQ,0BAA0B;AACrD,SAASC,eAAe,EAAEC,mBAAmB,QAAQ,UAAU;AAW/D,OAAO,IAAMC,aAAa,gBAAGJ,UAAU,CACrC,gBAUEK,GAAG,EACA;EAAA,IATDC,QAAQ,QAARA,QAAQ;IAAA,iBACRC,IAAI;IAAJA,IAAI,0BAAG,QAAQ;IAAA,iBACfC,IAAI;IAAJA,IAAI,0BAAG,SAAS;IAAA,oBAChBC,OAAO;IAAPA,OAAO,6BAAG,KAAK;IAAA,iBACfC,IAAI;IAAJA,IAAI,0BAAG,KAAK;IACZC,YAAY,QAAZA,YAAY;IACTC,IAAI;EAIT,oBACE,oBAAC,mBAAmB;IAClB,GAAG,EAAEP,GAAI;IACT,IAAI,EAAC,QAAQ;IACb,IAAI,EAAEE,IAAK;IACX,KAAK,EAAEC,IAAK;IACZ,QAAQ,EAAEC;EAAQ,GACdG,IAAI,gBAER,oBAAC,UAAU;IACT,EAAE,EAAC,KAAK;IACR,QAAQ,EAAC,UAAU;IACnB,UAAU,EAAC,SAAS;IACpB,OAAO,EAAEJ,IAAI,KAAK,OAAO,IAAIA,IAAI,KAAK,SAAS,GAAG,QAAQ,GAAG;EAAS,GAErEF,QAAQ,CACE,EAEZK,YAAY,GAAGA,YAAY,gBAAG,oBAAC,eAAe;IAAC,KAAK,EAAED;EAAK,EAAG,CAC3C;AAE1B,CAAC,CACF;AAEDN,aAAa,CAACS,WAAW,GAAG,eAAe"}
1
+ {"version":3,"file":"SelectTrigger.js","names":["React","forwardRef","Typography","StyledCaretIcon","StyledSelectTrigger","SelectTrigger","ref","children","type","size","invalid","open","endAdornment","typographyProps","rest","displayName"],"sources":["../../../../src/components/SelectTrigger/SelectTrigger.tsx"],"sourcesContent":["import React, { forwardRef, ComponentPropsWithoutRef } from \"react\";\nimport { ITypographyProps, Typography } from \"../Typography/Typography\";\nimport { StyledCaretIcon, StyledSelectTrigger } from \"./Styles\";\n\nexport type Size = \"regular\" | \"big\" | \"small\";\n\nexport interface SelectTriggerProps extends ComponentPropsWithoutRef<\"button\"> {\n size?: Size;\n invalid?: boolean;\n endAdornment?: JSX.Element;\n open?: boolean;\n typographyProps?: ITypographyProps;\n}\n\nexport const SelectTrigger = forwardRef<HTMLButtonElement, SelectTriggerProps>(\n (\n {\n children,\n type = \"button\",\n size = \"regular\",\n invalid = false,\n open = false,\n endAdornment,\n typographyProps,\n ...rest\n },\n ref\n ) => {\n return (\n <StyledSelectTrigger\n ref={ref}\n role=\"button\"\n type={type}\n $size={size}\n $invalid={invalid}\n {...rest}\n >\n <Typography\n as=\"div\"\n overflow=\"truncate\"\n whitespace=\"no-wrap\"\n variant={size === \"small\" || size === \"regular\" ? \"Body 2\" : \"Body 1\"}\n {...typographyProps}\n >\n {children}\n </Typography>\n\n {endAdornment ? endAdornment : <StyledCaretIcon $open={open} />}\n </StyledSelectTrigger>\n );\n }\n);\n\nSelectTrigger.displayName = \"SelectTrigger\";\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAkC,OAAO;AACnE,SAA2BC,UAAU,QAAQ,0BAA0B;AACvE,SAASC,eAAe,EAAEC,mBAAmB,QAAQ,UAAU;AAY/D,OAAO,IAAMC,aAAa,gBAAGJ,UAAU,CACrC,gBAWEK,GAAG,EACA;EAAA,IAVDC,QAAQ,QAARA,QAAQ;IAAA,iBACRC,IAAI;IAAJA,IAAI,0BAAG,QAAQ;IAAA,iBACfC,IAAI;IAAJA,IAAI,0BAAG,SAAS;IAAA,oBAChBC,OAAO;IAAPA,OAAO,6BAAG,KAAK;IAAA,iBACfC,IAAI;IAAJA,IAAI,0BAAG,KAAK;IACZC,YAAY,QAAZA,YAAY;IACZC,eAAe,QAAfA,eAAe;IACZC,IAAI;EAIT,oBACE,oBAAC,mBAAmB;IAClB,GAAG,EAAER,GAAI;IACT,IAAI,EAAC,QAAQ;IACb,IAAI,EAAEE,IAAK;IACX,KAAK,EAAEC,IAAK;IACZ,QAAQ,EAAEC;EAAQ,GACdI,IAAI,gBAER,oBAAC,UAAU;IACT,EAAE,EAAC,KAAK;IACR,QAAQ,EAAC,UAAU;IACnB,UAAU,EAAC,SAAS;IACpB,OAAO,EAAEL,IAAI,KAAK,OAAO,IAAIA,IAAI,KAAK,SAAS,GAAG,QAAQ,GAAG;EAAS,GAClEI,eAAe,GAElBN,QAAQ,CACE,EAEZK,YAAY,GAAGA,YAAY,gBAAG,oBAAC,eAAe;IAAC,KAAK,EAAED;EAAK,EAAG,CAC3C;AAE1B,CAAC,CACF;AAEDN,aAAa,CAACU,WAAW,GAAG,eAAe"}
package/dist/index.js CHANGED
@@ -9422,10 +9422,10 @@
9422
9422
 
9423
9423
  var burstScale = styled.keyframes(["from{transform:scale(0);}to{transform:scale(1);}"]);
9424
9424
  var burstAnimation = styled.keyframes(["from{stroke-dashoffset:0;}to{stroke-dashoffset:8;}"]);
9425
- var StyledCompleteCheckbox = styled__default["default"].div.withConfig({
9425
+ var StyledCompleteCheckbox = styled__default["default"].button.withConfig({
9426
9426
  displayName: "Styles__StyledCompleteCheckbox",
9427
9427
  componentId: "sc-1801dzg-0"
9428
- })(["", " border-color:var(--color-theme-600);transition:ease 0.3s all;svg{", " top:50%;left:50%;transform:translate(-50%,-50%);}svg path{fill:none;stroke:#32b370;stroke-width:3;transform:scale(0);}", " svg polyline{fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;transition:0.3s;stroke-dasharray:13;stroke-dashoffset:13;stroke:#d2d2d2;", "}", " ", " ", " ", " ", ""], {
9428
+ })(["", " border-color:var(--color-theme-600);transition:ease 0.3s all;background-color:transparent;svg{", " top:50%;left:50%;transform:translate(-50%,-50%);}svg path{fill:none;stroke:#32b370;stroke-width:3;transform:scale(0);}", " svg polyline{fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;transition:0.3s;stroke-dasharray:13;stroke-dashoffset:13;stroke:#d2d2d2;", "}", " ", " ", " ", " ", ""], {
9429
9429
  "width": "1.5rem",
9430
9430
  "height": "1.5rem",
9431
9431
  "borderRadius": "9999px",
@@ -9446,7 +9446,7 @@
9446
9446
  "borderStyle": "solid"
9447
9447
  }), props.$primary && styled.css(["box-shadow:inset 0 0 0 12px var(--color-primary);"]), props.$primary && styled.css(["stroke:var(--color-theme-100);"]));
9448
9448
  }, function (props) {
9449
- return !props.$completed && !props.$disabled && styled.css(["&:hover{border:1px solid var(--color-primary);box-shadow:inset 0 0 0 2px var(--color-primary);border-width:0px;", " svg polyline{stroke-dashoffset:0;}}"], !props.$primary && styled.css(["border:1px solid #84cc7c;box-shadow:inset 0 0 0 2px #84cc7c;"]));
9449
+ return !props.$completed && !props.$disabled && styled.css(["&:hover,&:focus-visible{border:1px solid var(--color-primary);box-shadow:inset 0 0 0 2px var(--color-primary);border-width:0px;outline:none;", " svg polyline{stroke-dashoffset:0;}}"], !props.$primary && styled.css(["border:1px solid #84cc7c;box-shadow:inset 0 0 0 2px #84cc7c;"]));
9450
9450
  }, function (props) {
9451
9451
  return props.$animation && styled.css(["svg path{animation:", " 0.6s ease 0s 1 normal,", " 0.4s ease 0.2s 1 normal;}"], burstScale, burstAnimation);
9452
9452
  }, function (props) {
@@ -14071,7 +14071,7 @@
14071
14071
  });
14072
14072
  StyledCaretIcon.displayName = "StyledCaretIcon";
14073
14073
 
14074
- var _excluded$i = ["children", "type", "size", "invalid", "open", "endAdornment"];
14074
+ var _excluded$i = ["children", "type", "size", "invalid", "open", "endAdornment", "typographyProps"];
14075
14075
  var SelectTrigger = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
14076
14076
  var children = _ref.children,
14077
14077
  _ref$type = _ref.type,
@@ -14083,6 +14083,7 @@
14083
14083
  _ref$open = _ref.open,
14084
14084
  open = _ref$open === void 0 ? false : _ref$open,
14085
14085
  endAdornment = _ref.endAdornment,
14086
+ typographyProps = _ref.typographyProps,
14086
14087
  rest = _objectWithoutProperties(_ref, _excluded$i);
14087
14088
  return /*#__PURE__*/React__default["default"].createElement(StyledSelectTrigger, _extends({
14088
14089
  ref: ref,
@@ -14090,12 +14091,12 @@
14090
14091
  type: type,
14091
14092
  $size: size,
14092
14093
  $invalid: invalid
14093
- }, rest), /*#__PURE__*/React__default["default"].createElement(Typography, {
14094
+ }, rest), /*#__PURE__*/React__default["default"].createElement(Typography, _extends({
14094
14095
  as: "div",
14095
14096
  overflow: "truncate",
14096
14097
  whitespace: "no-wrap",
14097
14098
  variant: size === "small" || size === "regular" ? "Body 2" : "Body 1"
14098
- }, children), endAdornment ? endAdornment : /*#__PURE__*/React__default["default"].createElement(StyledCaretIcon, {
14099
+ }, typographyProps), children), endAdornment ? endAdornment : /*#__PURE__*/React__default["default"].createElement(StyledCaretIcon, {
14099
14100
  $open: open
14100
14101
  }));
14101
14102
  });
@@ -14465,6 +14466,9 @@
14465
14466
  if (e.key === "Enter" && type === "multiple") {
14466
14467
  setValue("");
14467
14468
  }
14469
+ if (e.key === "Enter" && !open) {
14470
+ setOpen(true);
14471
+ }
14468
14472
  }, [open, selectedName, type]);
14469
14473
  React.useEffect(function () {
14470
14474
  var _childNode$current, _childNode$current2;
@@ -14677,7 +14681,7 @@
14677
14681
  }, startAdornment, /*#__PURE__*/React__default["default"].createElement(StyledInput$2, {
14678
14682
  className: "c-combo-box-input",
14679
14683
  onBlur: handleBlur,
14680
- onFocus: onOpen,
14684
+ onClick: onOpen,
14681
14685
  ref: handleRef,
14682
14686
  value: loading && loadingText ? loadingText : value,
14683
14687
  onKeyDown: handleOnKeyDown,
@@ -14701,7 +14705,7 @@
14701
14705
  }))))) : /*#__PURE__*/React__default["default"].createElement(StyledComboBoxInput, {
14702
14706
  className: classNames__default["default"]("c-combo-box-input", inputWrapperClassName),
14703
14707
  onBlur: handleBlur,
14704
- onFocus: onOpen,
14708
+ onClick: onOpen,
14705
14709
  wrapRef: comboBoxRef,
14706
14710
  ref: handleRef,
14707
14711
  value: loading && loadingText ? loadingText : value,