@intility/bifrost-react-select 4.0.0-beta.0 → 4.0.0-beta.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,106 @@
1
1
  # @intility/bifrost-react-select
2
2
 
3
+ ## 4.0.0-beta.12
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [18c2b063]
8
+ - @intility/bifrost-react@4.0.0-beta.11
9
+
10
+ ## 4.0.0-beta.11
11
+
12
+ ### Patch Changes
13
+
14
+ - ea861dbc: Update lint config, add displayName for components
15
+ - Updated dependencies [ea861dbc]
16
+ - @intility/bifrost-react@4.0.0-beta.10
17
+
18
+ ## 4.0.0-beta.10
19
+
20
+ ### Patch Changes
21
+
22
+ - Updated dependencies [17165424]
23
+ - @intility/bifrost-react@4.0.0-beta.9
24
+
25
+ ## 4.0.0-beta.9
26
+
27
+ ### Patch Changes
28
+
29
+ - Updated dependencies [5504294e]
30
+ - Updated dependencies [7db473c6]
31
+ - @intility/bifrost-react@4.0.0-beta.8
32
+
33
+ ## 4.0.0-beta.8
34
+
35
+ ### Patch Changes
36
+
37
+ - Updated dependencies [3849abc3]
38
+ - @intility/bifrost-react@4.0.0-beta.7
39
+
40
+ ## 4.0.0-beta.7
41
+
42
+ ### Patch Changes
43
+
44
+ - Updated dependencies [82ab21b5]
45
+ - Updated dependencies [81af701b]
46
+ - @intility/bifrost-react@4.0.0-beta.6
47
+
48
+ ## 4.0.0-beta.6
49
+
50
+ ### Minor Changes
51
+
52
+ - 6b355639: New styling for inputs, now always outlined. Removed `variant` prop from `<Input>`.
53
+
54
+ ### Patch Changes
55
+
56
+ - Updated dependencies [6b355639]
57
+ - Updated dependencies [6b355639]
58
+ - @intility/bifrost-react@4.0.0-beta.5
59
+
60
+ ## 4.0.0-beta.5
61
+
62
+ ### Patch Changes
63
+
64
+ - e410a910: New base color values for light mode #711
65
+ - Updated dependencies [e410a910]
66
+ - @intility/bifrost-react@4.0.0-beta.4
67
+
68
+ ## 4.0.0-beta.4
69
+
70
+ ### Patch Changes
71
+
72
+ - a903f282: fix: export typescript types used in react components
73
+ - Updated dependencies [a903f282]
74
+ - Updated dependencies [19500ce7]
75
+ - Updated dependencies [8263586d]
76
+ - @intility/bifrost-react@4.0.0-beta.3
77
+
78
+ ## 4.0.0-beta.3
79
+
80
+ ### Patch Changes
81
+
82
+ - Updated dependencies [b60c063d]
83
+ - @intility/bifrost-react@4.0.0-beta.2
84
+
85
+ ## 4.0.0-beta.2
86
+
87
+ ### Major Changes
88
+
89
+ - 608d2083: update module output
90
+
91
+ ### Patch Changes
92
+
93
+ - 165904af: use deep imports from @intility/bifrost-react
94
+ - Updated dependencies [165904af]
95
+ - Updated dependencies [608d2083]
96
+ - @intility/bifrost-react@4.0.0-beta.1
97
+
98
+ ## 4.0.0-beta.1
99
+
100
+ ### Patch Changes
101
+
102
+ - 217c8741: Named export for Select and DatePicker
103
+
3
104
  ## 4.0.0-beta.0
4
105
 
5
106
  ### Major Changes
package/dist/Select.d.ts CHANGED
@@ -47,7 +47,7 @@ export type SelectType = {
47
47
  }, IsMulti extends boolean = false, Group extends GroupBase<OptionType> = GroupBase<OptionType>>(props: ReactSelectProps<OptionType, IsMulti, Group> & RefAttributes<SelectInstance<OptionType, IsMulti, Group>> & SelectProps): React.ReactElement | null;
48
48
  displayName?: string;
49
49
  };
50
- declare const SelectComponent: SelectType;
50
+ export declare const Select: SelectType;
51
51
  export type AsyncType = {
52
52
  <OptionType = {
53
53
  label: string;
@@ -82,4 +82,4 @@ export type AsyncCreatableType = {
82
82
  };
83
83
  declare const AsyncCreatableSelect: AsyncCreatableType;
84
84
  export { AsyncSelect, CreatableSelect, AsyncCreatableSelect };
85
- export default SelectComponent;
85
+ export default Select;
package/dist/Select.js CHANGED
@@ -6,8 +6,11 @@ import AsyncReactSelect from "react-select/async";
6
6
  import CreatableReactSelect from "react-select/creatable";
7
7
  import AsyncCreatableReactSelect from "react-select/async-creatable";
8
8
  import classNames from "classnames";
9
- import { Description, Feedback, Label, useUniqueId } from "@intility/bifrost-react";
10
- import { DropdownIndicator, ClearIndicator, CustomInput, CustomMenuList, CustomOption, LoadingIndicator } from "./overrides";
9
+ import Description from "@intility/bifrost-react/Description";
10
+ import Feedback from "@intility/bifrost-react/Feedback";
11
+ import Label from "@intility/bifrost-react/Label";
12
+ import useUniqueId from "@intility/bifrost-react/hooks/useUniqueId";
13
+ import { DropdownIndicator, ClearIndicator, CustomInput, CustomMenuList, CustomOption, LoadingIndicator } from "./overrides/index.js";
11
14
  const ReactSelect = ReactSelectDefaultExport.default ?? ReactSelectDefaultExport;
12
15
  export const selectStyles = {
13
16
  container: (provided)=>({
@@ -19,18 +22,17 @@ export const selectStyles = {
19
22
  control: (provided, state)=>({
20
23
  ...provided,
21
24
  "&:hover": {
22
- borderBottomColor: state.isFocused ? "var(--bfc-base-c-theme)" : "var(--bfc-base-c-inverted-2)",
25
+ borderColor: state.isFocused ? "var(--bfc-theme-3)" : "var(--bfc-base-c-inverted-2)",
23
26
  // Change color of dropdown icon when hover on Select
24
27
  ".bf-select__dropdown-indicator": {
25
28
  color: "var(--bfc-theme-3)"
26
29
  }
27
30
  },
28
31
  backgroundColor: state.isDisabled ? "var(--bfc-base-dimmed)" : "var(--bfc-base-3)",
29
- border: 0,
30
- borderBottomWidth: "2px",
31
- borderBottomStyle: "solid",
32
- borderBottomColor: state.isFocused ? "var(--bfc-base-c-theme)" : state.isDisabled ? "transparent" : "var(--bfc-base-c-wcag)",
33
- boxShadow: state.isFocused && "0 0 0 1px var(--bfc-theme-3)",
32
+ borderWidth: "1px",
33
+ borderStyle: "solid",
34
+ borderColor: state.isFocused ? "var(--bfc-theme-3)" : state.isDisabled ? "transparent" : "var(--bfc-base-c-wcag)",
35
+ boxShadow: "none",
34
36
  borderRadius: state.selectProps.menuIsOpen ? " var(--bf-radius-xs) var(--bf-radius-xs) 0 0" : "var(--bf-radius-xs)",
35
37
  minHeight: "var(--bfs40)",
36
38
  cursor: "text"
@@ -81,7 +83,8 @@ export const selectStyles = {
81
83
  menuList: (provided)=>({
82
84
  ...provided,
83
85
  padding: 0,
84
- boxShadow: "0 0 0 1px var(--bfc-theme-3)",
86
+ border: "1px solid var(--bfc-theme-3)",
87
+ borderTop: "none",
85
88
  borderRadius: "0 0 var(--bf-radius-xs) var(--bf-radius-xs)"
86
89
  }),
87
90
  placeholder: (provided)=>({
@@ -182,7 +185,7 @@ const selectStates = [
182
185
  * Select HOC
183
186
  */ const SelectHOC = (Selector)=>{
184
187
  // @ts-ignore
185
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
188
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, react/display-name
186
189
  const GeneratedSelect = /*#__PURE__*/ forwardRef(({ label, hideLabel = false, isDisabled = false, state, feedback, required = false, description, requiredNoLabel = false, optional = false, inputId, className, style, loading = false, components, ...props }, ref)=>{
187
190
  const selectId = useUniqueId(inputId);
188
191
  return /*#__PURE__*/ _jsxs("div", {
@@ -234,8 +237,8 @@ const selectStates = [
234
237
  };
235
238
  /**
236
239
  * Select component - dropdown list
237
- */ const SelectComponent = SelectHOC(ReactSelect);
238
- SelectComponent.displayName = "Select";
240
+ */ export const Select = SelectHOC(ReactSelect);
241
+ Select.displayName = "Select";
239
242
  const AsyncSelect = SelectHOC(AsyncReactSelect);
240
243
  AsyncSelect.displayName = "AsyncSelect";
241
244
  const CreatableSelect = SelectHOC(CreatableReactSelect);
@@ -243,4 +246,4 @@ CreatableSelect.displayName = "CreatableSelect";
243
246
  const AsyncCreatableSelect = SelectHOC(AsyncCreatableReactSelect);
244
247
  AsyncCreatableSelect.displayName = "AsyncCreatableSelect";
245
248
  export { AsyncSelect, CreatableSelect, AsyncCreatableSelect };
246
- export default SelectComponent;
249
+ export default Select;
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { Icon } from "@intility/bifrost-react";
3
- import bfSpinner from "../assets/bfSpinner";
3
+ import bfSpinner from "../assets/bfSpinner.js";
4
4
  export default function LoadingIndicator() {
5
5
  return /*#__PURE__*/ _jsx(Icon, {
6
6
  icon: bfSpinner,
@@ -1,6 +1,6 @@
1
- export { default as ClearIndicator } from "./ClearIndicator.internal";
2
- export { default as CustomInput } from "./CustomInput.internal";
3
- export { default as LoadingIndicator } from "./LoadingIndicator.internal";
4
- export { default as CustomMenuList } from "./CustomMenuList.internal";
5
- export { default as DropdownIndicator } from "./DropdownIndicator.internal";
6
- export { default as CustomOption } from "./CustomOption.internal";
1
+ export { default as ClearIndicator } from "./ClearIndicator.internal.js";
2
+ export { default as CustomInput } from "./CustomInput.internal.js";
3
+ export { default as LoadingIndicator } from "./LoadingIndicator.internal.js";
4
+ export { default as CustomMenuList } from "./CustomMenuList.internal.js";
5
+ export { default as DropdownIndicator } from "./DropdownIndicator.internal.js";
6
+ export { default as CustomOption } from "./CustomOption.internal.js";
@@ -1,6 +1,6 @@
1
- export { default as ClearIndicator } from "./ClearIndicator.internal";
2
- export { default as CustomInput } from "./CustomInput.internal";
3
- export { default as LoadingIndicator } from "./LoadingIndicator.internal";
4
- export { default as CustomMenuList } from "./CustomMenuList.internal";
5
- export { default as DropdownIndicator } from "./DropdownIndicator.internal";
6
- export { default as CustomOption } from "./CustomOption.internal";
1
+ export { default as ClearIndicator } from "./ClearIndicator.internal.js";
2
+ export { default as CustomInput } from "./CustomInput.internal.js";
3
+ export { default as LoadingIndicator } from "./LoadingIndicator.internal.js";
4
+ export { default as CustomMenuList } from "./CustomMenuList.internal.js";
5
+ export { default as DropdownIndicator } from "./DropdownIndicator.internal.js";
6
+ export { default as CustomOption } from "./CustomOption.internal.js";
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@intility/bifrost-react-select",
3
- "version": "4.0.0-beta.0",
3
+ "version": "4.0.0-beta.12",
4
4
  "description": "React select component for Intility's design system, Bifrost.",
5
5
  "type": "module",
6
- "main": "dist/index.js",
6
+ "main": "dist/Select.js",
7
7
  "scripts": {
8
8
  "build": "run-p build:*",
9
9
  "build:module": "swc ./src -d dist",
@@ -11,11 +11,12 @@
11
11
  "start": "run-p watch:*",
12
12
  "watch:module": "npm run build:module -- --watch",
13
13
  "watch:types": "npm run build:types -- --watch --preserveWatchOutput",
14
- "clean": "rimraf dist"
14
+ "clean": "rimraf dist",
15
+ "lint": "eslint ./src/**/*.{ts,tsx}"
15
16
  },
16
17
  "exports": {
17
18
  "./package.json": "./package.json",
18
- ".": "./dist/index.js"
19
+ ".": "./dist/Select.js"
19
20
  },
20
21
  "homepage": "https://bifrost.intility.com",
21
22
  "keywords": [
@@ -40,7 +41,7 @@
40
41
  "@fortawesome/fontawesome-svg-core": "^6.4.2",
41
42
  "@fortawesome/free-solid-svg-icons": "^6.4.2",
42
43
  "@fortawesome/react-fontawesome": "^0.2.0",
43
- "@intility/bifrost-react": "4.0.0-beta.0",
44
+ "@intility/bifrost-react": "4.0.0-beta.11",
44
45
  "classnames": "^2.2.6",
45
46
  "react-select": "^5.7.7"
46
47
  }
@@ -1,6 +1,7 @@
1
- import Select from "./Select";
2
1
  import { render } from "@testing-library/react";
3
2
 
3
+ import Select from "./Select.js";
4
+
4
5
  let getByTestId, getByText, queryByText, element, customInput, rerender;
5
6
 
6
7
  beforeEach(() => {
package/src/Select.tsx CHANGED
@@ -18,12 +18,10 @@ import AsyncCreatableReactSelect, {
18
18
  AsyncCreatableProps as AsyncCreatableSelectProps,
19
19
  } from "react-select/async-creatable";
20
20
  import classNames from "classnames";
21
- import {
22
- Description,
23
- Feedback,
24
- Label,
25
- useUniqueId,
26
- } from "@intility/bifrost-react";
21
+ import Description from "@intility/bifrost-react/Description";
22
+ import Feedback from "@intility/bifrost-react/Feedback";
23
+ import Label from "@intility/bifrost-react/Label";
24
+ import useUniqueId from "@intility/bifrost-react/hooks/useUniqueId";
27
25
 
28
26
  import {
29
27
  DropdownIndicator,
@@ -32,7 +30,7 @@ import {
32
30
  CustomMenuList,
33
31
  CustomOption,
34
32
  LoadingIndicator,
35
- } from "./overrides";
33
+ } from "./overrides/index.js";
36
34
 
37
35
  const ReactSelect =
38
36
  (
@@ -51,8 +49,8 @@ export const selectStyles = {
51
49
  control: (provided, state) => ({
52
50
  ...provided,
53
51
  "&:hover": {
54
- borderBottomColor: state.isFocused
55
- ? "var(--bfc-base-c-theme)"
52
+ borderColor: state.isFocused
53
+ ? "var(--bfc-theme-3)"
56
54
  : "var(--bfc-base-c-inverted-2)",
57
55
  // Change color of dropdown icon when hover on Select
58
56
  ".bf-select__dropdown-indicator": {
@@ -62,15 +60,14 @@ export const selectStyles = {
62
60
  backgroundColor: state.isDisabled
63
61
  ? "var(--bfc-base-dimmed)"
64
62
  : "var(--bfc-base-3)",
65
- border: 0,
66
- borderBottomWidth: "2px",
67
- borderBottomStyle: "solid",
68
- borderBottomColor: state.isFocused
69
- ? "var(--bfc-base-c-theme)"
63
+ borderWidth: "1px",
64
+ borderStyle: "solid",
65
+ borderColor: state.isFocused
66
+ ? "var(--bfc-theme-3)"
70
67
  : state.isDisabled
71
68
  ? "transparent"
72
69
  : "var(--bfc-base-c-wcag)",
73
- boxShadow: state.isFocused && "0 0 0 1px var(--bfc-theme-3)",
70
+ boxShadow: "none",
74
71
  borderRadius: state.selectProps.menuIsOpen
75
72
  ? " var(--bf-radius-xs) var(--bf-radius-xs) 0 0"
76
73
  : "var(--bf-radius-xs)",
@@ -123,7 +120,8 @@ export const selectStyles = {
123
120
  menuList: (provided) => ({
124
121
  ...provided,
125
122
  padding: 0,
126
- boxShadow: "0 0 0 1px var(--bfc-theme-3)",
123
+ border: "1px solid var(--bfc-theme-3)",
124
+ borderTop: "none",
127
125
  borderRadius: "0 0 var(--bf-radius-xs) var(--bf-radius-xs)",
128
126
  }),
129
127
  placeholder: (provided) => ({
@@ -240,7 +238,7 @@ export type SelectState = (typeof selectStates)[number];
240
238
  */
241
239
  const SelectHOC = <Type, Selector>(Selector: Selector) => {
242
240
  // @ts-ignore
243
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
241
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, react/display-name
244
242
  const GeneratedSelect: Type = forwardRef<any, any>(
245
243
  (
246
244
  {
@@ -357,10 +355,10 @@ export type SelectType = {
357
355
  /**
358
356
  * Select component - dropdown list
359
357
  */
360
- const SelectComponent: SelectType = SelectHOC<SelectType, typeof ReactSelect>(
358
+ export const Select: SelectType = SelectHOC<SelectType, typeof ReactSelect>(
361
359
  ReactSelect,
362
360
  );
363
- SelectComponent.displayName = "Select";
361
+ Select.displayName = "Select";
364
362
 
365
363
  // Async Select
366
364
  export type AsyncType = {
@@ -433,4 +431,4 @@ const AsyncCreatableSelect = SelectHOC<
433
431
  AsyncCreatableSelect.displayName = "AsyncCreatableSelect";
434
432
 
435
433
  export { AsyncSelect, CreatableSelect, AsyncCreatableSelect };
436
- export default SelectComponent;
434
+ export default Select;
@@ -1,6 +1,6 @@
1
1
  import { Icon } from "@intility/bifrost-react";
2
2
 
3
- import bfSpinner from "../assets/bfSpinner";
3
+ import bfSpinner from "../assets/bfSpinner.js";
4
4
 
5
5
  export default function LoadingIndicator() {
6
6
  return (
@@ -1,6 +1,6 @@
1
- export { default as ClearIndicator } from "./ClearIndicator.internal";
2
- export { default as CustomInput } from "./CustomInput.internal";
3
- export { default as LoadingIndicator } from "./LoadingIndicator.internal";
4
- export { default as CustomMenuList } from "./CustomMenuList.internal";
5
- export { default as DropdownIndicator } from "./DropdownIndicator.internal";
6
- export { default as CustomOption } from "./CustomOption.internal";
1
+ export { default as ClearIndicator } from "./ClearIndicator.internal.js";
2
+ export { default as CustomInput } from "./CustomInput.internal.js";
3
+ export { default as LoadingIndicator } from "./LoadingIndicator.internal.js";
4
+ export { default as CustomMenuList } from "./CustomMenuList.internal.js";
5
+ export { default as DropdownIndicator } from "./DropdownIndicator.internal.js";
6
+ export { default as CustomOption } from "./CustomOption.internal.js";
package/tsconfig.json CHANGED
@@ -2,12 +2,12 @@
2
2
  "extends": "../../tsconfig.json",
3
3
  "compilerOptions": {
4
4
  "declaration": true,
5
+ "rootDir": "src",
5
6
  "declarationMap": false,
6
7
  "isolatedModules": false,
7
8
  "noEmit": false,
8
9
  "allowJs": false,
9
10
  "sourceMap": false,
10
- "moduleResolution": "Bundler",
11
11
  "emitDeclarationOnly": true,
12
12
  "outDir": "dist"
13
13
  },
package/dist/index.d.ts DELETED
@@ -1 +0,0 @@
1
- export { default, AsyncSelect, CreatableSelect, AsyncCreatableSelect, selectStyles, selectComponents, } from "./Select";
package/dist/index.js DELETED
@@ -1 +0,0 @@
1
- export { default, AsyncSelect, CreatableSelect, AsyncCreatableSelect, selectStyles, selectComponents } from "./Select";
package/src/index.ts DELETED
@@ -1,8 +0,0 @@
1
- export {
2
- default,
3
- AsyncSelect,
4
- CreatableSelect,
5
- AsyncCreatableSelect,
6
- selectStyles,
7
- selectComponents,
8
- } from "./Select";