@thecb/components 8.4.8-beta.5 → 8.4.8-beta.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thecb/components",
3
- "version": "8.4.8-beta.5",
3
+ "version": "8.4.8-beta.7",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "typings": "dist/index.d.ts",
@@ -12,6 +12,7 @@ export * from "./nav-footer";
12
12
  export * from "./nav-header";
13
13
  export * from "./nav-tabs";
14
14
  export * from "./paragraph";
15
+ export * from "./searchable-select";
15
16
  export * from "./spinner";
16
17
  export * from "./table";
17
18
  export * from "./text";
@@ -0,0 +1,24 @@
1
+ import React from "react";
2
+ import Expand from "../../../util/expand";
3
+ import {
4
+ Field,
5
+ FieldActions,
6
+ SearchableSelectOption
7
+ } from "../../../types/common";
8
+
9
+ export interface SearchableSelectProps {
10
+ items: SearchableSelectOption[];
11
+ selectedItems: SearchableSelectOption[];
12
+ allSelected: boolean;
13
+ toggleSelectAllItems: (isSelectAll: boolean) => void;
14
+ selectItem: (item: SearchableSelectOption) => void;
15
+ fields: {
16
+ searchTerm: Field;
17
+ };
18
+ actions: FieldActions;
19
+ disabled?: boolean;
20
+ placeholder: string;
21
+ }
22
+
23
+ export const SearchableSelect: React.FC<Expand<SearchableSelectProps> &
24
+ React.HTMLAttributes<HTMLElement>>;
@@ -40,7 +40,7 @@ const Module = ({
40
40
  const themedElemType =
41
41
  variant === "small" ? "h6" : variant === "default" ? "h5" : "h2";
42
42
  const computedElemType = as || themedElemType;
43
- const disabledStyles = "opacity: 0.40;";
43
+ const disabledStyles = 'opacity: 0.40;"';
44
44
  const headingText = (
45
45
  <Title
46
46
  weight={themeValues.fontWeight}
@@ -56,7 +56,12 @@ const Module = ({
56
56
  );
57
57
 
58
58
  return (
59
- <Box padding="0" extraStyles={disabled && disabledStyles}>
59
+ <Box
60
+ aria-disabled={disabled}
61
+ extraStyles={disabled && disabledStyles}
62
+ padding="0"
63
+ role={"group"}
64
+ >
60
65
  {heading && !rightTitleContent && headingText}
61
66
  {heading && rightTitleContent && (
62
67
  <Cluster justify="space-between" align="center" nowrap>
@@ -0,0 +1,4 @@
1
+ export default interface SearchableSelectOption {
2
+ name?: string;
3
+ value?: string;
4
+ }
@@ -2,5 +2,6 @@ export { default as Field } from "./Field";
2
2
  export { default as ReduxAction } from "./ReduxAction";
3
3
  export { default as FieldActions } from "./FieldActions";
4
4
  export { default as FormSelectOption } from "./FormSelectOption";
5
+ export { default as SearchableSelectOption } from "./SearchableSelectOption";
5
6
  export { default as ErrorMessageDictionary } from "./ErrorMessageDictionary";
6
7
  export * from "./FieldActions";