@intility/bifrost-react-select 4.2.3 → 4.3.0

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,13 +1,35 @@
1
1
  # @intility/bifrost-react-select
2
2
 
3
- ## 4.2.3
3
+ ## 4.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 2703b98: Add support for `small` variants for most form field inputs, to match existing `small` button styling.
8
+
9
+ - `<Input>`
10
+ - `<DatePicker>`
11
+ - `<FieldGroup.Item>`
12
+ - `<Select>`
13
+
14
+ ### Patch Changes
15
+
16
+ - f70f414: Use `theme` color for selected checkbox with multi-select
17
+ - c2dfb58: Added translation text for select loading state
18
+
19
+ ## 4.2.4 - 2024-08-07
20
+
21
+ ### Patch Changes
22
+
23
+ - 2308f1a: Update multi-select checkboxes to more closely match bifrost checkbox styling.
24
+
25
+ ## 4.2.3 - 2024-08-06
4
26
 
5
27
  ### Patch Changes
6
28
 
7
29
  - 633e7b2: chore: avoid internal barrel file imports
8
30
  - 899927b: Fix: form field height should follow browser font-size setting. Use `rem` over `px` for height-related units for form fields (input, button, select, datepicker).
9
31
 
10
- ## 4.2.2
32
+ ## 4.2.2 - 2024-07-30
11
33
 
12
34
  ### Patch Changes
13
35
 
@@ -18,31 +40,31 @@
18
40
 
19
41
  - 7b2eacc: Fix: Apparently, Chrome has changed its `<input autocomplete>` behaviour and now appears to only respect `autoComplete="off"`, so lets try that and pray to the browser gods that this will satisfy all of them for the forseeable future. #758
20
42
 
21
- ## 4.2.1
43
+ ## 4.2.1 - 2024-06-21
22
44
 
23
45
  ### Patch Changes
24
46
 
25
47
  - ba934052: Change option hover background to bfc-base-1
26
48
 
27
- ## 4.2.0
49
+ ## 4.2.0 - 2024-06-13
28
50
 
29
51
  ### Minor Changes
30
52
 
31
53
  - 833a15e4: Fix: update Select styling to allow `menuPlacement="top"` and more closely match DatePicker #754
32
54
 
33
- ## 4.1.0
55
+ ## 4.1.0 - 2024-05-31
34
56
 
35
57
  ### Minor Changes
36
58
 
37
59
  - ab69807d: Styling changes for Select input #740
38
60
 
39
- ## 4.0.3
61
+ ## 4.0.3 - 2024-05-16
40
62
 
41
63
  ### Patch Changes
42
64
 
43
65
  - 3db0503a: Fix: `selectComponents` properties should now correcly be non-null
44
66
 
45
- ## 4.0.2
67
+ ## 4.0.2 - 2024-04-10
46
68
 
47
69
  ### Patch Changes
48
70
 
@@ -50,7 +72,7 @@
50
72
  - Updated dependencies [79b9ab5d]
51
73
  - @intility/bifrost-react@4.0.2
52
74
 
53
- ## 4.0.1
75
+ ## 4.0.1 - 2024-04-05
54
76
 
55
77
  ### Patch Changes
56
78
 
@@ -59,7 +81,7 @@
59
81
  - Updated dependencies [611f82ca]
60
82
  - @intility/bifrost-react@4.0.1
61
83
 
62
- ## 4.0.0 (first release)
84
+ ## 4.0.0 - 2024-04-03 (first release, previously part of @intility/bifrost-react)
63
85
 
64
86
  ### Minor Changes
65
87
 
package/dist/Select.d.ts CHANGED
@@ -49,6 +49,8 @@ export type SelectProps = {
49
49
  style?: CSSProperties;
50
50
  /** Displays a loading spinner */
51
51
  loading?: boolean;
52
+ /** Decrease height of the input from `40px` to `32px` */
53
+ small?: boolean;
52
54
  };
53
55
  export type SelectType = {
54
56
  <OptionType = {
package/dist/Select.js CHANGED
@@ -10,6 +10,7 @@ import Description from "@intility/bifrost-react/Description";
10
10
  import Feedback from "@intility/bifrost-react/Feedback";
11
11
  import Label from "@intility/bifrost-react/Label";
12
12
  import useUniqueId from "@intility/bifrost-react/hooks/useUniqueId";
13
+ import useLocale from "@intility/bifrost-react/hooks/useLocale";
13
14
  import DropdownIndicator from "./overrides/DropdownIndicator.internal.js";
14
15
  import CustomInput from "./overrides/CustomInput.internal.js";
15
16
  import CustomMenuList from "./overrides/CustomMenuList.internal.js";
@@ -39,7 +40,7 @@ export const selectStyles = {
39
40
  borderColor: state.isFocused ? "var(--bfc-base-c-inverted)" : state.isDisabled ? "transparent" : "var(--bfc-base-c-wcag)",
40
41
  boxShadow: state.isFocused ? "inset 0 0 0 1px var(--bfc-base-c-inverted)" : "none",
41
42
  borderRadius: "var(--bf-radius-s)",
42
- minHeight: "var(--bfs40)",
43
+ minHeight: undefined,
43
44
  cursor: "text"
44
45
  }),
45
46
  indicatorSeparator: ()=>({
@@ -47,8 +48,7 @@ export const selectStyles = {
47
48
  }),
48
49
  indicatorsContainer: (provided)=>({
49
50
  ...provided,
50
- alignItems: "flex-start",
51
- padding: "0.46875rem 0"
51
+ alignItems: "flex-start"
52
52
  }),
53
53
  clearIndicator: (provided)=>({
54
54
  ...provided,
@@ -58,14 +58,14 @@ export const selectStyles = {
58
58
  color: "var(--bfc-base-c-2)",
59
59
  cursor: "pointer",
60
60
  padding: "var(--bfs4)",
61
- margin: "1px var(--bfs4) 0px 0px"
61
+ margin: "1px 4px 0px 0px"
62
62
  }),
63
63
  dropdownIndicator: (provided, state)=>({
64
64
  ...provided,
65
65
  color: state.isFocused ? "var(--bfc-base-c)" : "var(--bfc-base-c-2)",
66
66
  cursor: "pointer",
67
67
  padding: "var(--bfs4)",
68
- marginRight: "var(--bfs8)"
68
+ marginRight: 8
69
69
  }),
70
70
  input: (provided)=>({
71
71
  ...provided,
@@ -109,10 +109,6 @@ export const selectStyles = {
109
109
  padding: "7px 12px",
110
110
  backgroundColor: state.isDisabled ? "var(--bfc-base-dimmed)" : state.isFocused ? "var(--bfc-base-1)" : "var(--bfc-base-3)",
111
111
  color: "var(--bfc-base-c)",
112
- "& .bf-select-checkbox": {
113
- marginRight: "var(--bfs8)",
114
- color: "var(--bfc-theme)"
115
- },
116
112
  "& .bf-select-selected-icon": {
117
113
  color: "var(--bfc-base-c)",
118
114
  marginLeft: "var(--bfs4)"
@@ -136,7 +132,7 @@ export const selectStyles = {
136
132
  multiValueLabel: (provided)=>({
137
133
  ...provided,
138
134
  fontSize: "var(--bf-font-size-m)",
139
- padding: "2px 4px 2px 8px",
135
+ padding: "1.5px 4px 1.5px 8px",
140
136
  color: "inherit"
141
137
  }),
142
138
  multiValueRemove: (provided, state)=>({
@@ -190,8 +186,9 @@ const selectStates = [
190
186
  */ const SelectHOC = (Selector)=>{
191
187
  // @ts-ignore
192
188
  // eslint-disable-next-line @typescript-eslint/no-explicit-any, react/display-name
193
- 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)=>{
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, small = false, ...props }, ref)=>{
194
190
  const selectId = useUniqueId(inputId);
191
+ const locale = useLocale();
195
192
  return /*#__PURE__*/ _jsxs("div", {
196
193
  className: classNames(className, {
197
194
  "bf-select-container": true
@@ -199,6 +196,8 @@ const selectStates = [
199
196
  "bf-select-disabled": isDisabled
200
197
  }, {
201
198
  "bf-select-alert": !isDisabled && state === "alert"
199
+ }, {
200
+ "bf-select-small": small
202
201
  }),
203
202
  style: style,
204
203
  "data-testid": "bf-select-container",
@@ -229,6 +228,7 @@ const selectStates = [
229
228
  hideSelectedOptions: false,
230
229
  closeMenuOnSelect: props.isMulti ? false : true,
231
230
  isLoading: loading ?? props.isLoading,
231
+ loadingMessage: ()=>locale.loading + "...",
232
232
  ...props
233
233
  }),
234
234
  /*#__PURE__*/ _jsx(Feedback, {
@@ -12,7 +12,8 @@ const CustomOption = (props)=>{
12
12
  children: /*#__PURE__*/ _jsx(Icon, {
13
13
  icon: props.isSelected ? faCheckSquare : faSquare,
14
14
  fixedWidth: true,
15
- className: "bf-select-checkbox"
15
+ marginRight: true,
16
+ color: props.isSelected ? "var(--bfc-theme)" : "var(--bfc-base-c-2)"
16
17
  })
17
18
  }),
18
19
  props.children,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intility/bifrost-react-select",
3
- "version": "4.2.3",
3
+ "version": "4.3.0",
4
4
  "description": "React select component for Intility's design system, Bifrost.",
5
5
  "type": "module",
6
6
  "main": "dist/Select.js",
@@ -36,10 +36,10 @@
36
36
  "peerDependencies": {
37
37
  "react-dom": ">=18.0.0",
38
38
  "react": ">=18.0.0",
39
- "@intility/bifrost-react": "^4.0.2"
39
+ "@intility/bifrost-react": "^4.13.0"
40
40
  },
41
41
  "devDependencies": {
42
- "@intility/bifrost-react": "^4.7.4"
42
+ "@intility/bifrost-react": "^4.13.0"
43
43
  },
44
44
  "dependencies": {
45
45
  "@fortawesome/fontawesome-svg-core": "^6.4.2",