@backstage/ui 0.10.0 → 0.11.0-next.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 +14 -0
- package/css/styles.css +7 -5
- package/dist/components/Header/Header.module.css.esm.js +1 -1
- package/dist/components/SearchField/SearchField.esm.js +14 -21
- package/dist/components/SearchField/SearchField.esm.js.map +1 -1
- package/dist/components/SearchField/SearchField.module.css.esm.js +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @backstage/ui
|
|
2
2
|
|
|
3
|
+
## 0.11.0-next.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 4ea1d15: **BREAKING**: Renamed CSS variable `--bui-bg` to `--bui-bg-surface-0` for consistency.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- 1880402: Fixes app background color on dark mode.
|
|
12
|
+
- 9c76682: build(deps-dev): bump `storybook` from 10.1.9 to 10.1.10
|
|
13
|
+
- b4a4911: Fixed SearchField `startCollapsed` prop not working correctly in Backstage UI. The field now properly starts in a collapsed state, expands when clicked and focused, and collapses back when unfocused with no input. Also fixed CSS logic to work correctly in all layout contexts (flex row, flex column, and regular containers).
|
|
14
|
+
|
|
15
|
+
Affected components: SearchField
|
|
16
|
+
|
|
3
17
|
## 0.10.0
|
|
4
18
|
|
|
5
19
|
### Minor Changes
|
package/css/styles.css
CHANGED
|
@@ -51,9 +51,10 @@
|
|
|
51
51
|
--bui-gray-6: #8c8c8c;
|
|
52
52
|
--bui-gray-7: #757575;
|
|
53
53
|
--bui-gray-8: #595959;
|
|
54
|
-
--bui-bg: var(--bui-gray-1);
|
|
54
|
+
--bui-bg-surface-0: var(--bui-gray-1);
|
|
55
55
|
--bui-bg-surface-1: var(--bui-white);
|
|
56
|
-
--bui-bg-surface-2: var(--bui-gray-
|
|
56
|
+
--bui-bg-surface-2: var(--bui-gray-1);
|
|
57
|
+
--bui-bg-surface-3: var(--bui-gray-2);
|
|
57
58
|
--bui-bg-solid: #1f5493;
|
|
58
59
|
--bui-bg-solid-hover: #163a66;
|
|
59
60
|
--bui-bg-solid-pressed: #0f2b4e;
|
|
@@ -99,9 +100,10 @@
|
|
|
99
100
|
--bui-gray-6: #7b7b7b;
|
|
100
101
|
--bui-gray-7: #9e9e9e;
|
|
101
102
|
--bui-gray-8: #b4b4b4;
|
|
102
|
-
--bui-bg: #333;
|
|
103
|
-
--bui-bg-surface-1:
|
|
103
|
+
--bui-bg-surface-0: #333;
|
|
104
|
+
--bui-bg-surface-1: var(--bui-gray-1);
|
|
104
105
|
--bui-bg-surface-2: var(--bui-gray-2);
|
|
106
|
+
--bui-bg-surface-3: var(--bui-gray-3);
|
|
105
107
|
--bui-bg-solid: #9cc9ff;
|
|
106
108
|
--bui-bg-solid-hover: #83b9fd;
|
|
107
109
|
--bui-bg-solid-pressed: #83b9fd;
|
|
@@ -239,7 +241,7 @@
|
|
|
239
241
|
}
|
|
240
242
|
|
|
241
243
|
body {
|
|
242
|
-
background-color: var(--bui-bg);
|
|
244
|
+
background-color: var(--bui-bg-surface-0);
|
|
243
245
|
color: var(--bui-fg-primary);
|
|
244
246
|
font-family: var(--bui-font-regular);
|
|
245
247
|
font-weight: var(--bui-font-weight-regular);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import styleInject from '../../node_modules_dist/style-inject/dist/style-inject.es.esm.js';
|
|
2
2
|
|
|
3
|
-
var css_248z = "/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n@layer tokens, base, components, utilities;\n\n@layer components {\n .Header-module_bui-HeaderToolbar__1HcPN {\n margin-bottom: var(--bui-space-6);\n\n &::before {\n content: '';\n position: absolute;\n top: 0;\n left: 0px;\n right: 0px;\n height: 16px;\n background-color: var(--bui-bg);\n z-index: 0;\n }\n\n &[data-has-tabs='true'] {\n margin-bottom: 0;\n }\n }\n\n .Header-module_bui-HeaderToolbarWrapper__1WJwf {\n position: relative;\n z-index: 1;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n background-color: var(--bui-bg-surface-1);\n padding-inline: var(--bui-space-5);\n border-bottom: 1px solid var(--bui-border);\n color: var(--bui-fg-primary);\n height: 52px;\n }\n\n .Header-module_bui-HeaderToolbarContent__8b9nS {\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: var(--bui-space-2);\n }\n\n .Header-module_bui-HeaderToolbarName__2E-_b {\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: var(--bui-space-2);\n font-size: var(--bui-font-size-3);\n font-weight: var(--bui-font-weight-regular);\n flex-shrink: 0;\n }\n\n .Header-module_bui-HeaderToolbarIcon__1JjN5 {\n width: 16px;\n height: 16px;\n color: var(--bui-fg-primary);\n\n & svg {\n width: 100%;\n height: 100%;\n }\n }\n\n .Header-module_bui-HeaderToolbarControls__1EtQC {\n position: absolute;\n right: var(--bui-space-5);\n top: 50%;\n transform: translateY(-50%);\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: var(--bui-space-2);\n }\n\n .Header-module_bui-HeaderTabsWrapper__19BXF {\n margin-bottom: var(--bui-space-4);\n padding-inline: var(--bui-space-3);\n border-bottom: 1px solid var(--bui-border);\n background-color: var(--bui-bg-surface-1);\n }\n}\n";
|
|
3
|
+
var css_248z = "/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n@layer tokens, base, components, utilities;\n\n@layer components {\n .Header-module_bui-HeaderToolbar__1HcPN {\n margin-bottom: var(--bui-space-6);\n\n &::before {\n content: '';\n position: absolute;\n top: 0;\n left: 0px;\n right: 0px;\n height: 16px;\n background-color: var(--bui-bg-surface-0);\n z-index: 0;\n }\n\n &[data-has-tabs='true'] {\n margin-bottom: 0;\n }\n }\n\n .Header-module_bui-HeaderToolbarWrapper__1WJwf {\n position: relative;\n z-index: 1;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n background-color: var(--bui-bg-surface-1);\n padding-inline: var(--bui-space-5);\n border-bottom: 1px solid var(--bui-border);\n color: var(--bui-fg-primary);\n height: 52px;\n }\n\n .Header-module_bui-HeaderToolbarContent__8b9nS {\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: var(--bui-space-2);\n }\n\n .Header-module_bui-HeaderToolbarName__2E-_b {\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: var(--bui-space-2);\n font-size: var(--bui-font-size-3);\n font-weight: var(--bui-font-weight-regular);\n flex-shrink: 0;\n }\n\n .Header-module_bui-HeaderToolbarIcon__1JjN5 {\n width: 16px;\n height: 16px;\n color: var(--bui-fg-primary);\n\n & svg {\n width: 100%;\n height: 100%;\n }\n }\n\n .Header-module_bui-HeaderToolbarControls__1EtQC {\n position: absolute;\n right: var(--bui-space-5);\n top: 50%;\n transform: translateY(-50%);\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: var(--bui-space-2);\n }\n\n .Header-module_bui-HeaderTabsWrapper__19BXF {\n margin-bottom: var(--bui-space-4);\n padding-inline: var(--bui-space-3);\n border-bottom: 1px solid var(--bui-border);\n background-color: var(--bui-bg-surface-1);\n }\n}\n";
|
|
4
4
|
var styles = {"bui-HeaderToolbar":"Header-module_bui-HeaderToolbar__1HcPN","bui-HeaderToolbarWrapper":"Header-module_bui-HeaderToolbarWrapper__1WJwf","bui-HeaderToolbarContent":"Header-module_bui-HeaderToolbarContent__8b9nS","bui-HeaderToolbarName":"Header-module_bui-HeaderToolbarName__2E-_b","bui-HeaderToolbarIcon":"Header-module_bui-HeaderToolbarIcon__1JjN5","bui-HeaderToolbarControls":"Header-module_bui-HeaderToolbarControls__1EtQC","bui-HeaderTabsWrapper":"Header-module_bui-HeaderTabsWrapper__19BXF"};
|
|
5
5
|
styleInject(css_248z);
|
|
6
6
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { forwardRef, useState,
|
|
2
|
+
import { forwardRef, useEffect, useState, useRef } from 'react';
|
|
3
3
|
import { SearchField as SearchField$1, Input, Button } from 'react-aria-components';
|
|
4
4
|
import clsx from 'clsx';
|
|
5
5
|
import { FieldLabel } from '../FieldLabel/FieldLabel.esm.js';
|
|
@@ -16,8 +16,6 @@ const SearchField = forwardRef(
|
|
|
16
16
|
"aria-label": ariaLabel,
|
|
17
17
|
"aria-labelledby": ariaLabelledBy
|
|
18
18
|
} = props;
|
|
19
|
-
const [isCollapsed, setIsCollapsed] = useState(false);
|
|
20
|
-
const [shouldCollapse, setShouldCollapse] = useState(true);
|
|
21
19
|
useEffect(() => {
|
|
22
20
|
if (!label && !ariaLabel && !ariaLabelledBy) {
|
|
23
21
|
console.warn(
|
|
@@ -44,25 +42,19 @@ const SearchField = forwardRef(
|
|
|
44
42
|
startCollapsed,
|
|
45
43
|
...rest
|
|
46
44
|
} = cleanedProps;
|
|
45
|
+
const [isFocused, setIsFocused] = useState(false);
|
|
46
|
+
const inputRef = useRef(null);
|
|
47
47
|
const secondaryLabelText = secondaryLabel || (isRequired ? "Required" : null);
|
|
48
|
-
const
|
|
49
|
-
props.onFocusChange?.(
|
|
50
|
-
|
|
51
|
-
if (isFocused) {
|
|
52
|
-
setIsCollapsed(true);
|
|
53
|
-
} else {
|
|
54
|
-
setIsCollapsed(false);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
48
|
+
const handleFocusChange = (isFocused2) => {
|
|
49
|
+
props.onFocusChange?.(isFocused2);
|
|
50
|
+
setIsFocused(isFocused2);
|
|
57
51
|
};
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
if (value.length > 0) {
|
|
61
|
-
setShouldCollapse(false);
|
|
62
|
-
} else {
|
|
63
|
-
setShouldCollapse(true);
|
|
64
|
-
}
|
|
52
|
+
const handleContainerClick = () => {
|
|
53
|
+
inputRef.current?.focus();
|
|
65
54
|
};
|
|
55
|
+
const hasInputRef = !!inputRef.current;
|
|
56
|
+
const hasValue = !!inputRef.current?.value;
|
|
57
|
+
const isCollapsed = hasInputRef ? startCollapsed && !hasValue && !isFocused : startCollapsed && !rest.value && !rest.defaultValue && !isFocused;
|
|
66
58
|
return /* @__PURE__ */ jsxs(
|
|
67
59
|
SearchField$1,
|
|
68
60
|
{
|
|
@@ -71,10 +63,9 @@ const SearchField = forwardRef(
|
|
|
71
63
|
"aria-label": ariaLabel,
|
|
72
64
|
"aria-labelledby": ariaLabelledBy,
|
|
73
65
|
"data-collapsed": isCollapsed,
|
|
74
|
-
onFocusChange: handleClick,
|
|
75
|
-
onChange: handleChange,
|
|
76
66
|
style,
|
|
77
67
|
...rest,
|
|
68
|
+
onFocusChange: handleFocusChange,
|
|
78
69
|
ref,
|
|
79
70
|
children: [
|
|
80
71
|
/* @__PURE__ */ jsx(
|
|
@@ -93,6 +84,7 @@ const SearchField = forwardRef(
|
|
|
93
84
|
styles[classNames.inputWrapper]
|
|
94
85
|
),
|
|
95
86
|
"data-size": dataAttributes["data-size"],
|
|
87
|
+
onClick: handleContainerClick,
|
|
96
88
|
children: [
|
|
97
89
|
icon !== false && /* @__PURE__ */ jsx(
|
|
98
90
|
"div",
|
|
@@ -109,6 +101,7 @@ const SearchField = forwardRef(
|
|
|
109
101
|
/* @__PURE__ */ jsx(
|
|
110
102
|
Input,
|
|
111
103
|
{
|
|
104
|
+
ref: inputRef,
|
|
112
105
|
className: clsx(classNames.input, styles[classNames.input]),
|
|
113
106
|
...icon !== false && { "data-icon": true },
|
|
114
107
|
placeholder
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchField.esm.js","sources":["../../../src/components/SearchField/SearchField.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { forwardRef, useEffect, useState } from 'react';\nimport {\n Input,\n SearchField as AriaSearchField,\n Button,\n} from 'react-aria-components';\nimport clsx from 'clsx';\nimport { FieldLabel } from '../FieldLabel';\nimport { FieldError } from '../FieldError';\nimport { RiSearch2Line, RiCloseCircleLine } from '@remixicon/react';\nimport { useStyles } from '../../hooks/useStyles';\nimport { SearchFieldDefinition } from './definition';\nimport styles from './SearchField.module.css';\n\nimport type { SearchFieldProps } from './types';\n\n/** @public */\nexport const SearchField = forwardRef<HTMLDivElement, SearchFieldProps>(\n (props, ref) => {\n const {\n label,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n } = props;\n\n
|
|
1
|
+
{"version":3,"file":"SearchField.esm.js","sources":["../../../src/components/SearchField/SearchField.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { forwardRef, useEffect, useState, useRef } from 'react';\nimport {\n Input,\n SearchField as AriaSearchField,\n Button,\n} from 'react-aria-components';\nimport clsx from 'clsx';\nimport { FieldLabel } from '../FieldLabel';\nimport { FieldError } from '../FieldError';\nimport { RiSearch2Line, RiCloseCircleLine } from '@remixicon/react';\nimport { useStyles } from '../../hooks/useStyles';\nimport { SearchFieldDefinition } from './definition';\nimport styles from './SearchField.module.css';\n\nimport type { SearchFieldProps } from './types';\n\n/** @public */\nexport const SearchField = forwardRef<HTMLDivElement, SearchFieldProps>(\n (props, ref) => {\n const {\n label,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n } = props;\n\n useEffect(() => {\n if (!label && !ariaLabel && !ariaLabelledBy) {\n console.warn(\n 'SearchField requires either a visible label, aria-label, or aria-labelledby for accessibility',\n );\n }\n }, [label, ariaLabel, ariaLabelledBy]);\n\n const { classNames, dataAttributes, style, cleanedProps } = useStyles(\n SearchFieldDefinition,\n {\n size: 'small',\n placeholder: 'Search',\n startCollapsed: false,\n ...props,\n },\n );\n\n const {\n className,\n description,\n icon,\n isRequired,\n secondaryLabel,\n placeholder,\n startCollapsed,\n ...rest\n } = cleanedProps;\n\n const [isFocused, setIsFocused] = useState(false);\n const inputRef = useRef<HTMLInputElement>(null);\n\n // If a secondary label is provided, use it. Otherwise, use 'Required' if the field is required.\n const secondaryLabelText =\n secondaryLabel || (isRequired ? 'Required' : null);\n\n const handleFocusChange = (isFocused: boolean) => {\n props.onFocusChange?.(isFocused);\n setIsFocused(isFocused);\n };\n\n const handleContainerClick = () => {\n inputRef.current?.focus();\n };\n\n const hasInputRef = !!inputRef.current;\n const hasValue = !!inputRef.current?.value;\n\n const isCollapsed = hasInputRef\n ? startCollapsed && !hasValue && !isFocused\n : startCollapsed && !rest.value && !rest.defaultValue && !isFocused;\n\n return (\n <AriaSearchField\n className={clsx(classNames.root, styles[classNames.root], className)}\n {...dataAttributes}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n data-collapsed={isCollapsed}\n style={style}\n {...rest}\n onFocusChange={handleFocusChange}\n ref={ref}\n >\n <FieldLabel\n label={label}\n secondaryLabel={secondaryLabelText}\n description={description}\n />\n <div\n className={clsx(\n classNames.inputWrapper,\n styles[classNames.inputWrapper],\n )}\n data-size={dataAttributes['data-size']}\n onClick={handleContainerClick}\n >\n {icon !== false && (\n <div\n className={clsx(\n classNames.inputIcon,\n styles[classNames.inputIcon],\n )}\n data-size={dataAttributes['data-size']}\n aria-hidden=\"true\"\n >\n {icon || <RiSearch2Line />}\n </div>\n )}\n <Input\n ref={inputRef}\n className={clsx(classNames.input, styles[classNames.input])}\n {...(icon !== false && { 'data-icon': true })}\n placeholder={placeholder}\n />\n <Button\n className={clsx(classNames.clear, styles[classNames.clear])}\n data-size={dataAttributes['data-size']}\n >\n <RiCloseCircleLine />\n </Button>\n </div>\n <FieldError />\n </AriaSearchField>\n );\n },\n);\n\nSearchField.displayName = 'searchField';\n"],"names":["isFocused","AriaSearchField"],"mappings":";;;;;;;;;;;AAiCO,MAAM,WAAA,GAAc,UAAA;AAAA,EACzB,CAAC,OAAO,GAAA,KAAQ;AACd,IAAA,MAAM;AAAA,MACJ,KAAA;AAAA,MACA,YAAA,EAAc,SAAA;AAAA,MACd,iBAAA,EAAmB;AAAA,KACrB,GAAI,KAAA;AAEJ,IAAA,SAAA,CAAU,MAAM;AACd,MAAA,IAAI,CAAC,KAAA,IAAS,CAAC,SAAA,IAAa,CAAC,cAAA,EAAgB;AAC3C,QAAA,OAAA,CAAQ,IAAA;AAAA,UACN;AAAA,SACF;AAAA,MACF;AAAA,IACF,CAAA,EAAG,CAAC,KAAA,EAAO,SAAA,EAAW,cAAc,CAAC,CAAA;AAErC,IAAA,MAAM,EAAE,UAAA,EAAY,c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AAA,oBAC3C;AAAA;AAAA,iBACF;AAAA,gCACA,GAAA;AAAA,kBAAC,MAAA;AAAA,kBAAA;AAAA,oBACC,WAAW,IAAA,CAAK,UAAA,CAAW,OAAO,MAAA,CAAO,UAAA,CAAW,KAAK,CAAC,CAAA;AAAA,oBAC1D,WAAA,EAAW,eAAe,WAAW,CAAA;AAAA,oBAErC,8BAAC,iBAAA,EAAA,EAAkB;AAAA;AAAA;AACrB;AAAA;AAAA,WACF;AAAA,8BACC,UAAA,EAAA,EAAW;AAAA;AAAA;AAAA,KACd;AAAA,EAEJ;AACF;AAEA,WAAA,CAAY,WAAA,GAAc,aAAA;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import styleInject from '../../node_modules_dist/style-inject/dist/style-inject.es.esm.js';
|
|
2
2
|
|
|
3
|
-
var css_248z = "/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n@layer tokens, base, components, utilities;\n\n@layer components {\n .SearchField-module_bui-SearchField__2TyT_ {\n display: flex;\n flex-direction: column;\n font-family: var(--bui-font-regular);\n width: 100%;\n flex: 1;\n flex-shrink: 0;\n\n &[data-size='small'] {\n --search-field-item-height: 2rem;\n }\n\n &[data-size='medium'] {\n --search-field-item-height: 2.5rem;\n }\n\n &[data-empty] {\n .SearchField-module_bui-SearchFieldClear__1gJQc {\n display: none;\n }\n }\n\n &[data-startCollapsed='true'] {\n transition: flex-basis 0.3s ease-in-out;\n padding: 0;\n flex: 0 1 auto;\n\n &[data-collapsed='true'] {\n
|
|
3
|
+
var css_248z = "/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n@layer tokens, base, components, utilities;\n\n@layer components {\n .SearchField-module_bui-SearchField__2TyT_ {\n display: flex;\n flex-direction: column;\n font-family: var(--bui-font-regular);\n width: 100%;\n flex: 1;\n flex-shrink: 0;\n\n &[data-size='small'] {\n --search-field-item-height: 2rem;\n }\n\n &[data-size='medium'] {\n --search-field-item-height: 2.5rem;\n }\n\n &[data-empty] {\n .SearchField-module_bui-SearchFieldClear__1gJQc {\n display: none;\n }\n }\n\n &[data-startCollapsed='true'] {\n transition: flex-basis 0.3s ease-in-out, width 0.3s ease-in-out,\n max-width 0.3s ease-in-out;\n padding: 0;\n flex: 0 1 auto;\n\n &[data-collapsed='true'] {\n cursor: pointer;\n\n &[data-size='medium'] {\n flex-basis: 2.5rem;\n width: 2.5rem;\n max-width: 2.5rem;\n height: 2.5rem;\n }\n\n &[data-size='small'] {\n flex-basis: 2rem;\n width: 2rem;\n max-width: 2rem;\n height: 2rem;\n }\n\n &[data-size='medium'] .SearchField-module_bui-SearchFieldInput__3Opoj {\n &::placeholder {\n opacity: 0;\n }\n }\n\n &[data-size='small'] .SearchField-module_bui-SearchFieldInput__3Opoj {\n &::placeholder {\n opacity: 0;\n }\n }\n\n .SearchField-module_bui-SearchFieldInputWrapper__1JEG8 {\n .SearchField-module_bui-SearchFieldInput__3Opoj[data-icon] {\n padding-right: 0px;\n }\n }\n }\n\n &[data-collapsed='false'] {\n flex-basis: 200px;\n width: 200px;\n max-width: 200px;\n }\n }\n }\n\n .SearchField-module_bui-SearchFieldInputWrapper__1JEG8 {\n display: flex;\n align-items: center;\n border-radius: var(--bui-radius-2);\n border: 1px solid var(--bui-border);\n background-color: var(--bui-bg-surface-1);\n transition: border-color 0.2s ease-in-out, outline-color 0.2s ease-in-out;\n\n &[data-size='small'] {\n height: 2rem;\n }\n\n &[data-size='medium'] {\n height: 2.5rem;\n }\n\n &:focus-within {\n border-color: var(--bui-border-pressed);\n outline-width: 0px;\n }\n\n &:hover {\n border-color: var(--bui-border-hover);\n }\n\n &[data-invalid] {\n border-color: var(--bui-fg-danger);\n }\n\n &[data-disabled] {\n opacity: 0.5;\n cursor: not-allowed;\n border: 1px solid var(--bui-border-disabled);\n }\n }\n\n .SearchField-module_bui-SearchFieldInputIcon__EA0t9 {\n flex: 0 0 auto;\n display: grid;\n place-content: center;\n color: var(--bui-fg-primary);\n pointer-events: none;\n width: var(--search-field-item-height);\n height: var(--search-field-item-height);\n /* To animate the icon when the input is collapsed */\n transition: opacity 0.2s ease-in-out;\n\n & svg {\n .SearchField-module_bui-SearchField__2TyT_[data-size='small'] & {\n width: 1rem;\n height: 1rem;\n }\n\n .SearchField-module_bui-SearchField__2TyT_[data-size='medium'] & {\n width: 1.25rem;\n height: 1.25rem;\n }\n }\n }\n\n .SearchField-module_bui-SearchFieldInput__3Opoj {\n flex: 1;\n display: flex;\n align-items: center;\n padding: 0;\n border: none;\n background-color: transparent;\n font-size: var(--bui-font-size-3);\n font-family: var(--bui-font-regular);\n font-weight: var(--bui-font-weight-regular);\n color: var(--bui-fg-primary);\n transition: padding 0.3s ease-in-out;\n width: 100%;\n height: 100%;\n outline: none;\n cursor: inherit;\n\n &::-webkit-search-cancel-button,\n &::-webkit-search-decoration {\n -webkit-appearance: none;\n }\n\n &::placeholder {\n color: var(--bui-fg-secondary);\n }\n\n &[data-disabled] {\n cursor: not-allowed;\n }\n\n &:first-child {\n .SearchField-module_bui-SearchField__2TyT_[data-size='small'] & {\n padding-inline: var(--bui-space-3) 0;\n }\n\n .SearchField-module_bui-SearchField__2TyT_[data-size='medium'] & {\n padding-inline: var(--bui-space-3) 0;\n }\n }\n }\n\n .SearchField-module_bui-SearchFieldClear__1gJQc {\n flex: 0 0 auto;\n display: grid;\n place-content: center;\n background-color: transparent;\n border: none;\n padding: 0;\n margin: 0;\n cursor: pointer;\n color: var(--bui-fg-secondary);\n transition: color 0.2s ease-in-out;\n width: var(--search-field-item-height);\n height: var(--search-field-item-height);\n\n &:hover {\n color: var(--bui-fg-primary);\n }\n\n & svg {\n width: 1rem;\n height: 1rem;\n }\n }\n}\n";
|
|
4
4
|
var styles = {"bui-SearchField":"SearchField-module_bui-SearchField__2TyT_","bui-SearchFieldClear":"SearchField-module_bui-SearchFieldClear__1gJQc","bui-SearchFieldInput":"SearchField-module_bui-SearchFieldInput__3Opoj","bui-SearchFieldInputWrapper":"SearchField-module_bui-SearchFieldInputWrapper__1JEG8","bui-SearchFieldInputIcon":"SearchField-module_bui-SearchFieldInputIcon__EA0t9"};
|
|
5
5
|
styleInject(css_248z);
|
|
6
6
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0-next.0",
|
|
4
4
|
"backstage": {
|
|
5
5
|
"role": "web-library"
|
|
6
6
|
},
|
|
@@ -46,11 +46,11 @@
|
|
|
46
46
|
"react-aria-components": "^1.13.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@backstage/cli": "
|
|
49
|
+
"@backstage/cli": "0.35.2-next.0",
|
|
50
50
|
"@types/react": "^18.0.0",
|
|
51
51
|
"@types/react-dom": "^18.0.0",
|
|
52
52
|
"chalk": "^5.4.1",
|
|
53
|
-
"eslint-plugin-storybook": "^
|
|
53
|
+
"eslint-plugin-storybook": "^10.1.9",
|
|
54
54
|
"glob": "^11.0.1",
|
|
55
55
|
"globals": "^15.11.0",
|
|
56
56
|
"lightningcss": "^1.29.1",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"react": "^18.0.2",
|
|
59
59
|
"react-dom": "^18.0.2",
|
|
60
60
|
"react-router-dom": "^6.3.0",
|
|
61
|
-
"storybook": "^
|
|
61
|
+
"storybook": "^10.1.10"
|
|
62
62
|
},
|
|
63
63
|
"peerDependencies": {
|
|
64
64
|
"@types/react": "^17.0.0 || ^18.0.0",
|