@jars-labs/jars-components 1.0.1 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE.md ADDED
@@ -0,0 +1,26 @@
1
+ # License for jars-components
2
+
3
+ ## Code License
4
+
5
+ This software is licensed under the following terms:
6
+
7
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to use the Software within their organization, subject to the following restrictions:
8
+
9
+ 1. The Software may not be used commercially outside of Jars-Labs.
10
+ 2. Redistribution, sublicensing, and modification are not permitted without prior written permission from Jars-Labs.
11
+ 3. The software is provided "as is," without warranty of any kind.
12
+
13
+ ## Asset License
14
+
15
+ The assets included in this package (including, but not limited to, icons, color palettes, and typography) are licensed under the **Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0)** license.
16
+
17
+ Under this license, you are not allowed to:
18
+ 1. Use the assets for any commercial purposes.
19
+ 2. Modify, transform, or build upon the assets.
20
+ 3. Redistribute the assets.
21
+
22
+ For more information, see the [Creative Commons website](https://creativecommons.org/licenses/by-nc-nd/4.0/).
23
+
24
+ ---
25
+
26
+ By using this package, you agree to the terms of both licenses.
@@ -1 +1 @@
1
- {"version":3,"file":"Autocomplete.d.ts","sourceRoot":"","sources":["../../src/Autocomplete/Autocomplete.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAShD,UAAU,iBAAiB;IACzB,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,cAAc,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACvC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,cAAc,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACvC,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;CAC5B;AAED;;;;;;;;;;;;;;;GAeG;AAEH,eAAO,MAAM,YAAY,EAAE,iBAAiB,CAAC,iBAAiB,CA8G7D,CAAA"}
1
+ {"version":3,"file":"Autocomplete.d.ts","sourceRoot":"","sources":["../../src/Autocomplete/Autocomplete.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAShD,UAAU,iBAAiB;IACzB,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,cAAc,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACvC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,cAAc,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACvC,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;CAC5B;AAED;;;;;;;;;;;;;;;GAeG;AAEH,eAAO,MAAM,YAAY,EAAE,iBAAiB,CAAC,iBAAiB,CAmH7D,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../src/Avatar/Avatar.tsx"],"names":[],"mappings":"AACA,OAAO,EAEL,WAAW,IAAI,kBAAkB,EAClC,MAAM,eAAe,CAAA;AACtB,OAAO,KAAK,MAAM,OAAO,CAAA;AAmBzB,MAAM,WAAW,WAAY,SAAQ,kBAAkB;IACrD,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,YAAY,CAAA;CACnD;AAED,QAAA,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CA8BjC,CAAA;AAED,eAAe,MAAM,CAAA"}
1
+ {"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../src/Avatar/Avatar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,WAAW,IAAI,kBAAkB,EAClC,MAAM,eAAe,CAAA;AACtB,OAAO,KAAK,MAAM,OAAO,CAAA;AAmBzB,MAAM,WAAW,WAAY,SAAQ,kBAAkB;IACrD,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,YAAY,CAAA;CACnD;AAED,QAAA,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CA8BjC,CAAA;AAED,eAAe,MAAM,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../src/Icons/Icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAIZ,iBAAiB,EACjB,aAAa,EACd,MAAM,OAAO,CAAA;AAEd,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAE5C,UAAU,kBAAmB,SAAQ,SAAS;IAC5C,KAAK,CAAC,EAAE,aAAa,CAAA;CACtB;AAmBD,QAAA,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAAC,kBAAkB,CAAC,CAgFzD,CAAA;AAGD,eAAe,IAAI,CAAA"}
1
+ {"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../src/Icons/Icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAIZ,iBAAiB,EACjB,aAAa,EACd,MAAM,OAAO,CAAA;AAEd,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAE5C,UAAU,kBAAmB,SAAQ,SAAS;IAC5C,KAAK,CAAC,EAAE,aAAa,CAAA;CACtB;AAmBD,QAAA,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAAC,kBAAkB,CAAC,CAgFzD,CAAA;AAED,eAAe,IAAI,CAAA"}
@@ -13,5 +13,35 @@ export interface InputProps extends TextInputProps {
13
13
  rightSection?: React.ReactNode;
14
14
  hideLabel?: boolean;
15
15
  }
16
- export declare const Input: ({ error, name, placeholder, value, onChange, label, description, leftSection, rightSection, type, holdSpace, hideLabel, ...rest }: InputProps) => import("react/jsx-runtime").JSX.Element;
16
+ /**
17
+ * Input component that extends the TextInput component from Mantine.
18
+ * It includes additional features like error handling, description, and label visibility.
19
+ *
20
+ * @param {string} name - The name of the input field.
21
+ * @param {string} label - The label for the input field.
22
+ * @param {string} placeholder - The placeholder text for the input field.
23
+ * @param {string} value - The value of the input field.
24
+ * @param {function} onChange - The function to call when the input value changes.
25
+ * @param {function} onBlur - The function to call when the input loses focus.
26
+ * @param {string} error - The error message to display.
27
+ * @param {string} description - The description text to display below the input field.
28
+ * @param {boolean} holdSpace - Whether to hold space for the error message even when there is no error.
29
+ * @param {React.ReactNode} leftSection - The icon to display on the left side of the input field.
30
+ * @param {React.ReactNode} rightSection - The icon to display on the right side of the input field.
31
+ * @param {boolean} hideLabel - Whether to hide the label when it's not required.
32
+ * @param {string} type - The type of the input field (default is 'text').
33
+ *
34
+ * @example
35
+ * <Input
36
+ * name="username"
37
+ * label="Username"
38
+ * placeholder="Enter your username"
39
+ * value={username}
40
+ * onChange={(e) => setUsername(e.target.value)}
41
+ * onBlur={() => console.log('Input blurred')}
42
+ * error="Username is required"
43
+ * description="Your unique username"
44
+ * />
45
+ */
46
+ export declare const Input: ({ error, name, placeholder, value, onChange, label, description, leftSection, rightSection, type, holdSpace, hideLabel, disabled, ...rest }: InputProps) => import("react/jsx-runtime").JSX.Element;
17
47
  //# sourceMappingURL=Input.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../src/Input/Input.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAmB,cAAc,EAAE,MAAM,eAAe,CAAA;AAE/D,OAAO,KAA4B,MAAM,OAAO,CAAA;AAMhD,MAAM,WAAW,UAAW,SAAQ,cAAc;IAChD,WAAW,CAAC,EAAE,MAAM,CAAA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;;;;GA6BG;AAEH,eAAO,MAAM,KAAK,gJAef,UAAU,4CA8EZ,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"NavBar.d.ts","sourceRoot":"","sources":["../../src/NavBar/NavBar.tsx"],"names":[],"mappings":"AACA,OAAc,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAIhD,eAAO,MAAM,MAAM,iBAAkB,iBAAiB,4CAcrD,CAAA"}
1
+ {"version":3,"file":"NavBar.d.ts","sourceRoot":"","sources":["../../src/NavBar/NavBar.tsx"],"names":[],"mappings":"AACA,OAAc,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAIhD,eAAO,MAAM,MAAM,iBAAkB,iBAAiB,4CAmBrD,CAAA"}
@@ -0,0 +1,33 @@
1
+ import React from 'react';
2
+ import { Input } from '../Input/Input';
3
+ export interface PasswordInputProps extends React.ComponentProps<typeof Input> {
4
+ }
5
+ /**
6
+ * PasswordInput component
7
+ * It allows toggling visibility of the password.
8
+ * It extends the Input component.
9
+ *
10
+ * @param {string} name - The name of the input password field.
11
+ * @param {string} label - The label for the input password field.
12
+ * @param {string} placeholder - The placeholder text for the input password field.
13
+ * @param {string} value - The value of the input password field.
14
+ * @param {function} onChange - The function to call when the input password value changes.
15
+ * @param {function} onBlur - The function to call when the input password loses focus.
16
+ * @param {string} error - The error message to display.
17
+ *
18
+ * @return Attaches PasswordInput to target element and displays options
19
+ *
20
+ * @example
21
+ * <PasswordInput
22
+ * name="password"
23
+ * label="Password"
24
+ * placeholder="Password"
25
+ * value={password}
26
+ * onChange={(e) => setPassword(e.target.value)}
27
+ * onBlur={() => console.log('Password blurred')}
28
+ * error="Password is required"
29
+ * />
30
+ *
31
+ */
32
+ export declare const PasswordInput: ({ name, label, placeholder, value, onChange, onBlur, error, }: PasswordInputProps) => import("react/jsx-runtime").JSX.Element;
33
+ //# sourceMappingURL=PasswordInput.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PasswordInput.d.ts","sourceRoot":"","sources":["../../src/PasswordInput/PasswordInput.tsx"],"names":[],"mappings":"AACA,OAAO,KAAmB,MAAM,OAAO,CAAA;AAIvC,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAEtC,MAAM,WAAW,kBACf,SAAQ,KAAK,CAAC,cAAc,CAAC,OAAO,KAAK,CAAC;CAAG;AAE/C;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,eAAO,MAAM,aAAa,kEAQvB,kBAAkB,4CAwCpB,CAAA"}
@@ -150,6 +150,10 @@
150
150
  color: var(--color-red-300);
151
151
  }
152
152
 
153
+ .mcfb7df269_labelDisabled {
154
+ color: var(--color-neutral-500);
155
+ }
156
+
153
157
  .mcfb7df269_input:focus,
154
158
  .mcfb7df269_input:hover {
155
159
  border: 1px solid var(--color-primary-300);
package/dist/index.d.ts CHANGED
@@ -79,4 +79,5 @@ export * from './Icons/Upload';
79
79
  export * from './Icons/Visa';
80
80
  export * from './Icons/Warning';
81
81
  export * from './Icons/World';
82
+ export * from './utils/stringUtils';
82
83
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,CAAA;AAGnB,cAAc,uBAAuB,CAAA;AACrC,cAAc,yBAAyB,CAAA;AACvC,cAAc,uBAAuB,CAAA;AACrC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,iBAAiB,CAAA;AAC/B,cAAc,eAAe,CAAA;AAC7B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,aAAa,CAAA;AAC3B,cAAc,yBAAyB,CAAA;AACvC,cAAc,qBAAqB,CAAA;AACnC,cAAc,uBAAuB,CAAA;AACrC,cAAc,qBAAqB,CAAA;AACnC,cAAc,iCAAiC,CAAA;AAC/C,cAAc,uBAAuB,CAAA;AACrC,cAAc,wBAAwB,CAAA;AACtC,cAAc,mCAAmC,CAAA;AACjD,cAAc,eAAe,CA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AAClC,cAAc,cAAc,CAAA;AAC5B,cAAc,kBAAkB,CAAA;AAChC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,cAAc,CAAA;AAC5B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,eAAe,CAAA;AAE7B,cAAc,qBAAqB,CAAA"}
package/dist/index.esm.js CHANGED
@@ -375,6 +375,7 @@ const inputRightIcon = "mcfb7df269_inputRightIcon";
375
375
  const label$6 = "mcfb7df269_label";
376
376
  const labelFocused$1 = "mcfb7df269_labelFocused";
377
377
  const labelError$1 = "mcfb7df269_labelError";
378
+ const labelDisabled$1 = "mcfb7df269_labelDisabled";
378
379
  const description$1 = "mcfb7df269_description";
379
380
  const error$1 = "mcfb7df269_error";
380
381
  const errorText$1 = "mcfb7df269_errorText";
@@ -389,6 +390,7 @@ inputRightIcon,
389
390
  label: label$6,
390
391
  labelFocused: labelFocused$1,
391
392
  labelError: labelError$1,
393
+ labelDisabled: labelDisabled$1,
392
394
  description: description$1,
393
395
  error: error$1,
394
396
  errorText: errorText$1,
@@ -486,32 +488,81 @@ var elementType = {
486
488
  h4: 'h4',
487
489
  };
488
490
  var Text = t.forwardRef(function (props, ref) {
489
- var children = props.children, variant = props.variant, weight = props.weight, color = props.color, style = props.style, className = props.className, rest = __rest(props, ["children", "variant", "weight", "color", "style", "className"]);
491
+ var as = props.as, children = props.children, className = props.className, color = props.color, style = props.style, variant = props.variant, weight = props.weight, rest = __rest(props, ["as", "children", "className", "color", "style", "variant", "weight"]);
490
492
  var combinedStyle = __assign(__assign({}, style), { color: color });
491
493
  var combinedClassName = classNames(className, styles$j['text'], styles$j[variant || ''], styles$j[weight || '']);
492
- return t.createElement(props.as || elementType[variant] || 'p', __assign({ ref: ref, className: combinedClassName, style: combinedStyle }, rest), children);
494
+ return t.createElement(as || elementType[variant] || 'p', __assign({ ref: ref, className: combinedClassName, style: combinedStyle }, rest), children);
493
495
  });
494
496
 
497
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
498
+ function capitalizeFirstSentenceLetter(input) {
499
+ var str;
500
+ if (typeof input !== 'string') {
501
+ if (Array.isArray(input)) {
502
+ str = input.join(' ');
503
+ }
504
+ else {
505
+ return String(input);
506
+ }
507
+ }
508
+ else {
509
+ str = input;
510
+ }
511
+ var lowerCaseString = str.toLowerCase().replace(/_/g, ' ');
512
+ return lowerCaseString.charAt(0).toUpperCase() + lowerCaseString.slice(1);
513
+ }
514
+
515
+ /**
516
+ * Input component that extends the TextInput component from Mantine.
517
+ * It includes additional features like error handling, description, and label visibility.
518
+ *
519
+ * @param {string} name - The name of the input field.
520
+ * @param {string} label - The label for the input field.
521
+ * @param {string} placeholder - The placeholder text for the input field.
522
+ * @param {string} value - The value of the input field.
523
+ * @param {function} onChange - The function to call when the input value changes.
524
+ * @param {function} onBlur - The function to call when the input loses focus.
525
+ * @param {string} error - The error message to display.
526
+ * @param {string} description - The description text to display below the input field.
527
+ * @param {boolean} holdSpace - Whether to hold space for the error message even when there is no error.
528
+ * @param {React.ReactNode} leftSection - The icon to display on the left side of the input field.
529
+ * @param {React.ReactNode} rightSection - The icon to display on the right side of the input field.
530
+ * @param {boolean} hideLabel - Whether to hide the label when it's not required.
531
+ * @param {string} type - The type of the input field (default is 'text').
532
+ *
533
+ * @example
534
+ * <Input
535
+ * name="username"
536
+ * label="Username"
537
+ * placeholder="Enter your username"
538
+ * value={username}
539
+ * onChange={(e) => setUsername(e.target.value)}
540
+ * onBlur={() => console.log('Input blurred')}
541
+ * error="Username is required"
542
+ * description="Your unique username"
543
+ * />
544
+ */
495
545
  var Input = function (_a) {
496
546
  var _b, _c;
497
- var _d = _a.error, error = _d === void 0 ? '' : _d, name = _a.name, placeholder = _a.placeholder, _e = _a.value, value = _e === void 0 ? '' : _e, onChange = _a.onChange, label = _a.label, description = _a.description, leftSection = _a.leftSection, rightSection = _a.rightSection, _f = _a.type, type = _f === void 0 ? 'text' : _f, _g = _a.holdSpace, holdSpace = _g === void 0 ? true : _g, _h = _a.hideLabel, hideLabel = _h === void 0 ? false : _h, rest = __rest(_a, ["error", "name", "placeholder", "value", "onChange", "label", "description", "leftSection", "rightSection", "type", "holdSpace", "hideLabel"]);
498
- var _j = useState(false), isFocused = _j[0], setIsFocused = _j[1];
499
- var _k = useState(false), isHovered = _k[0], setIsHovered = _k[1];
547
+ var _d = _a.error, error = _d === void 0 ? '' : _d, name = _a.name, placeholder = _a.placeholder, _e = _a.value, value = _e === void 0 ? '' : _e, onChange = _a.onChange, label = _a.label, description = _a.description, leftSection = _a.leftSection, rightSection = _a.rightSection, _f = _a.type, type = _f === void 0 ? 'text' : _f, _g = _a.holdSpace, holdSpace = _g === void 0 ? true : _g, _h = _a.hideLabel, hideLabel = _h === void 0 ? false : _h, _j = _a.disabled, disabled = _j === void 0 ? false : _j, rest = __rest(_a, ["error", "name", "placeholder", "value", "onChange", "label", "description", "leftSection", "rightSection", "type", "holdSpace", "hideLabel", "disabled"]);
548
+ var _k = useState(false), isFocused = _k[0], setIsFocused = _k[1];
549
+ var _l = useState(false), isHovered = _l[0], setIsHovered = _l[1];
500
550
  var showLabel = !hideLabel && (isFocused || value.trim());
501
551
  var placeHolderValue = showLabel ? placeholder : label;
502
552
  var ErrorSection = useMemo(function () {
503
- return holdSpace && (jsxs(Flex, { className: styles$k.error, gap: 4, ml: 0, style: { visibility: error ? 'visible' : 'hidden' }, children: [jsx(Info, { width: "18px", height: "18px", viewBox: "0 0 24 24", stroke: "var(--color-red-300)" }), jsx(Text, { variant: "xs", className: classNames(styles$k.errorText), children: error })] }));
553
+ return holdSpace && (jsxs(Flex, { className: styles$k.error, gap: 4, ml: 0, style: { visibility: error ? 'visible' : 'hidden' }, children: [jsx(Info, { width: "18px", height: "18px", viewBox: "0 0 24 24", stroke: "var(--color-red-300)" }), jsx(Text, { variant: "xs", className: classNames(styles$k.errorText), children: capitalizeFirstSentenceLetter(error) })] }));
504
554
  }, [error]);
505
555
  return (jsxs("div", { className: styles$k.container, children: [showLabel && (jsx("label", { className: classNames(styles$k.label, (_b = {},
506
556
  _b[styles$k.labelError] = error && !isFocused,
507
557
  _b[styles$k.labelFocused] = isFocused || isHovered,
558
+ _b[styles$k.labelDisabled] = disabled,
508
559
  _b)), children: label })), jsx("div", { onMouseEnter: function () { return setIsHovered(true); }, onMouseLeave: function () { return setIsHovered(false); }, onFocus: function () { return setIsFocused(true); }, onBlur: function () { return setIsFocused(false); }, children: jsx(TextInput, __assign({ classNames: {
509
560
  input: classNames(styles$k.input, (_c = {},
510
561
  _c[styles$k.inputLeftIcon] = leftSection,
511
562
  _c[styles$k.inputRightIcon] = rightSection,
512
563
  _c[styles$k.inputError] = error,
513
564
  _c)),
514
- }, placeholder: placeHolderValue, name: name, error: ErrorSection, description: !error && jsx(Text, { variant: "xs", children: description }), descriptionProps: { className: styles$k.description }, errorProps: { className: styles$k.error }, inputWrapperOrder: ['label', 'input', 'description', 'error'], value: value, onChange: onChange, leftSection: leftSection, rightSection: rightSection, leftSectionProps: { className: styles$k.leftSection }, rightSectionProps: { className: styles$k.rightSection } }, rest, { type: type })) })] }));
565
+ }, placeholder: placeHolderValue, name: name, error: ErrorSection, description: !error && jsx(Text, { variant: "xs", children: description }), descriptionProps: { className: styles$k.description }, errorProps: { className: styles$k.error }, inputWrapperOrder: ['label', 'input', 'description', 'error'], value: value, onChange: onChange, leftSection: leftSection, rightSection: rightSection, leftSectionProps: { className: styles$k.leftSection }, rightSectionProps: { className: styles$k.rightSection }, type: type, disabled: disabled }, rest)) })] }));
515
566
  };
516
567
 
517
568
  var Loader = function (props) {
@@ -543,8 +594,8 @@ var Autocomplete = function (_a) {
543
594
  var boldedOptions = options.map(function (option) {
544
595
  var index = option.toLowerCase().indexOf(searchValue.toLowerCase());
545
596
  if (index === -1)
546
- return jsx(Dropdown.Option, { value: option, children: option });
547
- return (jsxs(Dropdown.Option, { value: option, onClick: function () { return handleOptionSubmit(option); }, children: [option.slice(0, index), jsx("strong", { children: option.slice(index, index + searchValue.length) }), option.slice(index + searchValue.length)] }));
597
+ return (jsx(Dropdown.Option, { value: option, children: option }, option));
598
+ return (jsxs(Dropdown.Option, { value: option, onClick: function () { return handleOptionSubmit(option); }, children: [option.slice(0, index), jsx("strong", { children: option.slice(index, index + searchValue.length) }), option.slice(index + searchValue.length)] }, option));
548
599
  });
549
600
  var emptyOptions = (jsx(Dropdown.Option, { value: "No options found", style: { cursor: 'not-allowed', pointerEvents: 'none' }, children: "No matches found, try something else." }));
550
601
  var loadingOptions = (jsx(Dropdown.Option, { value: "Loading...", disabled: true, style: { display: 'flex', justifyContent: 'center' }, children: jsx(Loader, {}) }));
@@ -1251,7 +1302,7 @@ var Umbrello = function (props) {
1251
1302
 
1252
1303
  var NavBar = function (_a) {
1253
1304
  var children = _a.children;
1254
- return (jsxs(Flex, { p: "24px 120px", bg: "var(--color-white)", children: [jsx("a", { href: "/dashboard/management-companies", children: jsx(Umbrello, { fill: "var(--color-neutral-600)", width: "200", height: "40", viewBox: "0 0 200 40" }) }), children] }));
1305
+ return (jsxs(Flex, { p: "24px 120px", bg: "var(--color-white)", align: "center", justify: "space-between", children: [jsx("a", { href: "/dashboard/management-companies", children: jsx(Umbrello, { fill: "var(--color-neutral-600)", width: "200", height: "40", viewBox: "0 0 200 40" }) }), children] }));
1255
1306
  };
1256
1307
 
1257
1308
  var Pagination = function (_a) {
@@ -1701,7 +1752,7 @@ var Attachment = function (props) {
1701
1752
 
1702
1753
  var Bell = function (_a) {
1703
1754
  var _b = _a.width, width = _b === void 0 ? '32px' : _b, _c = _a.height, height = _c === void 0 ? '32px' : _c, _d = _a.viewBox, viewBox = _d === void 0 ? '0 0 32 32' : _d, _e = _a.alert, alert = _e === void 0 ? false : _e;
1704
- return (jsxs(Icon, { width: width, height: height, viewBox: viewBox, children: [jsx("path", { d: "M14.1429 27.8572H17.5714", stroke: "black", "stroke-width": "1.5", "stroke-linecap": "round", "stroke-linejoin": "round" }), jsx("path", { d: "M22.7143 15C22.7143 13.1813 21.9919 11.4372 20.7059 10.1512C19.4199 8.86527 17.6758 8.14282 15.8572 8.14282C14.0385 8.14282 12.2944 8.86527 11.0084 10.1512C9.72247 11.4372 9.00002 13.1813 9.00002 15V21C9.00002 21.6819 8.72909 22.3361 8.24686 22.8183C7.76463 23.3005 7.11057 23.5714 6.42859 23.5714H25.2857C24.6038 23.5714 23.9496 23.3005 23.4674 22.8183C22.9852 22.3361 22.7143 21.6819 22.7143 21V15Z", stroke: "black", "stroke-width": "1.5", "stroke-linecap": "round", "stroke-linejoin": "round" }), jsx("path", { d: "M4.71429 14.777C4.71522 13.1453 5.10435 11.5372 5.84956 10.0855C6.59476 8.63384 7.67464 7.38032 9.00001 6.42847", stroke: "black", "stroke-width": "1.5", "stroke-linecap": "round", "stroke-linejoin": "round" }), jsx("path", { d: "M25.8648 10.0855C25.1196 8.63384 24.0396 7.38032 22.7143 6.42847", stroke: "black", "stroke-width": "1.5", "stroke-linecap": "round", "stroke-linejoin": "round" }), alert && (jsx("circle", { cx: "22.2857", cy: "9.14282", r: "5.5", fill: "#7B34D6", stroke: "white" }))] }));
1755
+ return (jsxs(Icon, { width: width, height: height, viewBox: viewBox, children: [jsx("path", { d: "M14.1429 27.8572H17.5714", stroke: "black", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }), jsx("path", { d: "M22.7143 15C22.7143 13.1813 21.9919 11.4372 20.7059 10.1512C19.4199 8.86527 17.6758 8.14282 15.8572 8.14282C14.0385 8.14282 12.2944 8.86527 11.0084 10.1512C9.72247 11.4372 9.00002 13.1813 9.00002 15V21C9.00002 21.6819 8.72909 22.3361 8.24686 22.8183C7.76463 23.3005 7.11057 23.5714 6.42859 23.5714H25.2857C24.6038 23.5714 23.9496 23.3005 23.4674 22.8183C22.9852 22.3361 22.7143 21.6819 22.7143 21V15Z", stroke: "black", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }), jsx("path", { d: "M4.71429 14.777C4.71522 13.1453 5.10435 11.5372 5.84956 10.0855C6.59476 8.63384 7.67464 7.38032 9.00001 6.42847", stroke: "black", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }), jsx("path", { d: "M25.8648 10.0855C25.1196 8.63384 24.0396 7.38032 22.7143 6.42847", stroke: "black", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }), alert && (jsx("circle", { cx: "22.2857", cy: "9.14282", r: "5.5", fill: "#7B34D6", stroke: "white" }))] }));
1705
1756
  };
1706
1757
 
1707
1758
  var Cat = function (props) {
@@ -21931,5 +21982,5 @@ var lottie$1 = /*#__PURE__*/_mergeNamespaces({
21931
21982
  default: lottie
21932
21983
  }, [lottieExports]);
21933
21984
 
21934
- export { Accordion, AccordionControl, AccordionItem, AccordionPanel, ActionIcon, Alert, Animation, Arrow, Attachment, Autocomplete, AvatarPlaceholder, Badge, Bell, Button, Calendar, Card, CardStatus, Cat, Checkbox, Chevron, Clock, Close, Cloud, DateInput, Delete, Document, Dog, Dropdown, EnterCodeInput, EyeHide, EyeShow, FileInput, FileUpload, Fingerprint, Google, Grid, HappyFace, House, HouseTime, Identification, IncrementNumber, Info, Input, Link, LinkModal, Loader, Location, Mail, Menu, MenuTouched, Message, Modal, Multiselect, NavBar, Notification, Open, Pagination, Pets, Phone, Plaid, Plus, RadioButton, Remove, Search, SegmentedControl, Select, StatusBadge, Table, Tabs, Text, Textarea, ThreeDots, ThumbsDown, Tick, ToastContainer, Tooltip, Umbrello, Upload, Visa, Warning, World, badgeVariantMap, cardStatusVariantMap };
21985
+ export { Accordion, AccordionControl, AccordionItem, AccordionPanel, ActionIcon, Alert, Animation, Arrow, Attachment, Autocomplete, AvatarPlaceholder, Badge, Bell, Button, Calendar, Card, CardStatus, Cat, Checkbox, Chevron, Clock, Close, Cloud, DateInput, Delete, Document, Dog, Dropdown, EnterCodeInput, EyeHide, EyeShow, FileInput, FileUpload, Fingerprint, Google, Grid, HappyFace, House, HouseTime, Identification, IncrementNumber, Info, Input, Link, LinkModal, Loader, Location, Mail, Menu, MenuTouched, Message, Modal, Multiselect, NavBar, Notification, Open, Pagination, Pets, Phone, Plaid, Plus, RadioButton, Remove, Search, SegmentedControl, Select, StatusBadge, Table, Tabs, Text, Textarea, ThreeDots, ThumbsDown, Tick, ToastContainer, Tooltip, Umbrello, Upload, Visa, Warning, World, badgeVariantMap, capitalizeFirstSentenceLetter, cardStatusVariantMap };
21935
21986
  //# sourceMappingURL=index.esm.js.map