@assembly-js/design-system 3.1.11 → 3.1.12

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,17 +1,17 @@
1
1
  // This file is generated by a script. Do not edit this file directly.
2
2
  (function (global, factory) {
3
3
  if (typeof define === "function" && define.amd) {
4
- define(["exports", "react", "../Avatar/Avatar", "../Typography", "clsx", "../Avatar/UserWithCompanyAvatar", "../../common/utils"], factory);
4
+ define(["exports", "react", "../Avatar/Avatar", "../Typography", "../Avatar/UserWithCompanyAvatar", "../../common/utils"], factory);
5
5
  } else if (typeof exports !== "undefined") {
6
- factory(exports, require("react"), require("../Avatar/Avatar"), require("../Typography"), require("clsx"), require("../Avatar/UserWithCompanyAvatar"), require("../../common/utils"));
6
+ factory(exports, require("react"), require("../Avatar/Avatar"), require("../Typography"), require("../Avatar/UserWithCompanyAvatar"), require("../../common/utils"));
7
7
  } else {
8
8
  var mod = {
9
9
  exports: {}
10
10
  };
11
- factory(mod.exports, global.react, global.Avatar, global.Typography, global.clsx, global.UserWithCompanyAvatar, global.utils);
11
+ factory(mod.exports, global.react, global.Avatar, global.Typography, global.UserWithCompanyAvatar, global.utils);
12
12
  global.ListItem = mod.exports;
13
13
  }
14
- })(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _react, _Avatar, _Typography, _clsx, _UserWithCompanyAvatar, _utils) {
14
+ })(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _react, _Avatar, _Typography, _UserWithCompanyAvatar, _utils) {
15
15
  "use strict";
16
16
 
17
17
  Object.defineProperty(_exports, "__esModule", {
@@ -19,15 +19,16 @@
19
19
  });
20
20
  _exports.ListItem = ListItem;
21
21
  _react = _interopRequireDefault(_react);
22
- _clsx = _interopRequireDefault(_clsx);
23
22
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
24
23
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
25
- function ListItem(_ref) {
24
+ function ListItem(props) {
26
25
  var _option$avatarSrc, _option$avatarFallbac, _option$label;
27
- var option = _ref.data,
28
- innerRef = _ref.innerRef,
29
- isFocused = _ref.isFocused,
30
- innerProps = _ref.innerProps;
26
+ var option = props.data,
27
+ innerRef = props.innerRef,
28
+ isFocused = props.isFocused,
29
+ isSelected = props.isSelected,
30
+ innerProps = props.innerProps,
31
+ listClassName = props.listClassName;
31
32
  var avatarSrc = option.avatarSrc,
32
33
  avatarFallbackColor = option.avatarFallbackColor,
33
34
  label = option.label,
@@ -39,13 +40,15 @@
39
40
  key: option.value,
40
41
  ref: innerRef
41
42
  }, innerProps, {
42
- className: (0, _clsx["default"])('cop-flex cop-cursor-pointer cop-items-center cop-gap-3 cop-px-3 hover:cop-bg-gray-100', {
43
+ "data-focused": isFocused || undefined,
44
+ "data-selected": isSelected || undefined,
45
+ className: (0, _utils.cn)('cop-flex cop-cursor-pointer cop-items-center cop-gap-3 cop-px-3 hover:cop-bg-gray-100', {
43
46
  'cop-h-10': !!companyName,
44
47
  // if an option has company name to render, the option should have a height of 40px
45
48
  'cop-h-8': !companyName,
46
49
  // if an option has no company name to render, the option should have a height of 32px
47
50
  'cop-bg-primary': isFocused
48
- })
51
+ }, listClassName)
49
52
  }), option.type !== 'company' ? /*#__PURE__*/_react["default"].createElement(_UserWithCompanyAvatar.UserWithCompanyAvatar, {
50
53
  size: "sm",
51
54
  avatarSrc: (_option$avatarSrc = option.avatarSrc) !== null && _option$avatarSrc !== void 0 ? _option$avatarSrc : '',
@@ -22,7 +22,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
22
22
  _exports.UserCompanySelector = void 0;
23
23
  _react = _interopRequireWildcard(_react);
24
24
  _reactSelect = _interopRequireDefault(_reactSelect);
25
- var _excluded = ["autoFocus", "grouped", "name", "internalUsers", "clientUsers", "companies", "onChange", "onBlur", "placeholder", "styles", "ignoreCompanies", "ignoreFilterClientsByCompany", "limitSelectedOptions", "initialValue", "customLabels", "listHeading"];
25
+ var _excluded = ["autoFocus", "grouped", "name", "internalUsers", "clientUsers", "companies", "onChange", "onBlur", "placeholder", "styles", "ignoreCompanies", "ignoreFilterClientsByCompany", "limitSelectedOptions", "initialValue", "customLabels", "listHeading", "listClassName"];
26
26
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
27
27
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
28
28
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
@@ -93,6 +93,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
93
93
  initialValue = _ref.initialValue,
94
94
  customLabels = _ref.customLabels,
95
95
  listHeading = _ref.listHeading,
96
+ listClassName = _ref.listClassName,
96
97
  others = _objectWithoutProperties(_ref, _excluded);
97
98
  var limitSelectedOptions = limitSelectedOptionsUnvalidated === 0 ? 1000 : Math.min(1000, limitSelectedOptionsUnvalidated);
98
99
  var companiesMap = (0, _react.useMemo)(function () {
@@ -322,7 +323,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
322
323
  },
323
324
  Option: function Option(props) {
324
325
  return /*#__PURE__*/_react["default"].createElement(_ListItem.ListItem, _extends({}, props, {
325
- data: getCompanyData(props.data)
326
+ data: getCompanyData(props.data),
327
+ listClassName: listClassName
326
328
  }));
327
329
  },
328
330
  DropdownIndicator: function DropdownIndicator() {
@@ -345,7 +347,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
345
347
  }));
346
348
  }
347
349
  };
348
- }, [getCompanyData]);
350
+ }, [getCompanyData, listHeading, listClassName]);
349
351
  return /*#__PURE__*/_react["default"].createElement(_reactSelect["default"], _extends({
350
352
  autoFocus: autoFocus,
351
353
  isMulti: true,
@@ -1,4 +1,9 @@
1
1
  import React from 'react';
2
- import { type OptionWithCompanyMetadata } from './types';
3
- import { type GroupBase, type OptionProps } from 'react-select';
4
- export declare function ListItem<_OptionProps extends OptionWithCompanyMetadata, GroupProps extends GroupBase<_OptionProps> = GroupBase<_OptionProps>>({ data: option, innerRef, isFocused, innerProps, }: OptionProps<_OptionProps, true, GroupProps>): React.JSX.Element;
2
+ import { type OptionWithCompanyMetadata, type UserCompanySelectorOption, type UserCompanySelectorGroupedOption } from './types';
3
+ import { type OptionProps } from 'react-select';
4
+ type ListItemProps = OptionProps<UserCompanySelectorOption, true, UserCompanySelectorGroupedOption> & {
5
+ data: OptionWithCompanyMetadata;
6
+ listClassName?: string;
7
+ };
8
+ export declare function ListItem(props: ListItemProps): React.JSX.Element;
9
+ export {};
@@ -41,6 +41,7 @@ export type UserCompanySelectorProps = {
41
41
  groupTermPlural: string;
42
42
  };
43
43
  listHeading?: string;
44
+ listClassName?: string;
44
45
  };
45
46
  /**
46
47
  * @deprecated Use Option instead