@backstage/ui 0.15.1-next.0 → 0.16.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 +167 -0
- package/dist/components/Combobox/Combobox.esm.js +150 -52
- package/dist/components/Combobox/Combobox.esm.js.map +1 -1
- package/dist/components/Combobox/Combobox.module.css.esm.js +2 -2
- package/dist/components/Combobox/ComboboxItem.esm.js +76 -0
- package/dist/components/Combobox/ComboboxItem.esm.js.map +1 -0
- package/dist/components/Combobox/ComboboxListBox.esm.js +215 -17
- package/dist/components/Combobox/ComboboxListBox.esm.js.map +1 -1
- package/dist/components/Combobox/definition.esm.js +62 -3
- package/dist/components/Combobox/definition.esm.js.map +1 -1
- package/dist/components/Combobox/useAsyncComboboxState.esm.js +133 -0
- package/dist/components/Combobox/useAsyncComboboxState.esm.js.map +1 -0
- package/dist/components/Header/HeaderNav.esm.js +0 -1
- package/dist/components/Header/HeaderNav.esm.js.map +1 -1
- package/dist/components/Select/Select.esm.js +87 -19
- package/dist/components/Select/Select.esm.js.map +1 -1
- package/dist/components/Select/Select.module.css.esm.js +2 -2
- package/dist/components/Select/SelectContent.esm.js +70 -18
- package/dist/components/Select/SelectContent.esm.js.map +1 -1
- package/dist/components/Select/SelectItem.esm.js +76 -0
- package/dist/components/Select/SelectItem.esm.js.map +1 -0
- package/dist/components/Select/SelectListBox.esm.js +175 -19
- package/dist/components/Select/SelectListBox.esm.js.map +1 -1
- package/dist/components/Select/SelectTrigger.esm.js +1 -1
- package/dist/components/Select/SelectTrigger.esm.js.map +1 -1
- package/dist/components/Select/definition.esm.js +72 -9
- package/dist/components/Select/definition.esm.js.map +1 -1
- package/dist/components/Skeleton/Skeleton.module.css.esm.js +2 -2
- package/dist/components/Skeleton/definition.esm.js +1 -0
- package/dist/components/Skeleton/definition.esm.js.map +1 -1
- package/dist/components/Table/Table.module.css.esm.js +2 -2
- package/dist/components/Table/components/Table.esm.js +60 -57
- package/dist/components/Table/components/Table.esm.js.map +1 -1
- package/dist/components/Table/definition.esm.js +2 -1
- package/dist/components/Table/definition.esm.js.map +1 -1
- package/dist/components/TablePagination/TablePagination.esm.js +4 -1
- package/dist/components/TablePagination/TablePagination.esm.js.map +1 -1
- package/dist/components/Tabs/TabsIndicators.esm.js +155 -108
- package/dist/components/Tabs/TabsIndicators.esm.js.map +1 -1
- package/dist/css/styles.css +4 -4
- package/dist/hooks/useCollectionAdapter.esm.js +67 -0
- package/dist/hooks/useCollectionAdapter.esm.js.map +1 -0
- package/dist/hooks/useDelayedVisibility.esm.js +17 -0
- package/dist/hooks/useDelayedVisibility.esm.js.map +1 -0
- package/dist/hooks/useTrackedSelectionKeys.esm.js +23 -0
- package/dist/hooks/useTrackedSelectionKeys.esm.js.map +1 -0
- package/dist/index.d.ts +742 -77
- package/dist/index.esm.js +5 -2
- package/dist/index.esm.js.map +1 -1
- package/dist/utils/selectableCollection.esm.js +75 -0
- package/dist/utils/selectableCollection.esm.js.map +1 -0
- package/package.json +4 -4
|
@@ -1,28 +1,61 @@
|
|
|
1
|
-
import { jsx,
|
|
2
|
-
import { ListBox,
|
|
3
|
-
import
|
|
1
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import { ListBox, Collection, ListBoxLoadMoreItem, Text, ListBoxSection, Header } from 'react-aria-components';
|
|
3
|
+
import clsx from 'clsx';
|
|
4
4
|
import { useDefinition } from '../../hooks/useDefinition/useDefinition.esm.js';
|
|
5
|
-
import { SelectListBoxDefinition,
|
|
5
|
+
import { SelectListBoxDefinition, SelectItemTextDefinition, SelectListBoxItemDefinition, SelectSectionDefinition } from './definition.esm.js';
|
|
6
|
+
import { normalizeOptions } from '../../utils/selectableCollection.esm.js';
|
|
7
|
+
import { SelectItem } from './SelectItem.esm.js';
|
|
8
|
+
import { Skeleton } from '../Skeleton/Skeleton.esm.js';
|
|
9
|
+
import '../Skeleton/Skeleton.module.css.esm.js';
|
|
10
|
+
import { useDelayedVisibility } from '../../hooks/useDelayedVisibility.esm.js';
|
|
6
11
|
|
|
12
|
+
const loadingRowWidths = ["70%", "55%", "65%"];
|
|
13
|
+
const loadingIndicatorDelayMs = 300;
|
|
14
|
+
function LoadingRows({
|
|
15
|
+
count,
|
|
16
|
+
className,
|
|
17
|
+
rowClassName
|
|
18
|
+
}) {
|
|
19
|
+
return /* @__PURE__ */ jsx("div", { className, "aria-hidden": "true", children: loadingRowWidths.slice(0, count).map((width) => /* @__PURE__ */ jsx("div", { className: rowClassName, children: /* @__PURE__ */ jsx(Skeleton, { width, height: "0.75rem" }) }, width)) });
|
|
20
|
+
}
|
|
7
21
|
const NoResults = () => {
|
|
8
22
|
const { ownProps } = useDefinition(SelectListBoxDefinition, {});
|
|
9
23
|
const { classes } = ownProps;
|
|
10
24
|
return /* @__PURE__ */ jsx("div", { className: classes.noResults, children: "No results found." });
|
|
11
25
|
};
|
|
12
|
-
function
|
|
13
|
-
const { ownProps } = useDefinition(
|
|
26
|
+
function PlainOptionItem({ option }) {
|
|
27
|
+
const { ownProps } = useDefinition(SelectItemTextDefinition, {
|
|
28
|
+
title: option.label,
|
|
29
|
+
description: option.description,
|
|
30
|
+
leadingIcon: option.leadingIcon
|
|
31
|
+
});
|
|
14
32
|
const { classes } = ownProps;
|
|
15
|
-
|
|
16
|
-
|
|
33
|
+
const {
|
|
34
|
+
ownProps: { classes: legacyOptionClasses }
|
|
35
|
+
} = useDefinition(SelectListBoxItemDefinition, {});
|
|
36
|
+
return /* @__PURE__ */ jsx(
|
|
37
|
+
SelectItem,
|
|
17
38
|
{
|
|
18
|
-
id: option.
|
|
19
|
-
|
|
39
|
+
id: option.id,
|
|
40
|
+
value: option,
|
|
20
41
|
className: classes.root,
|
|
42
|
+
textValue: option.label,
|
|
21
43
|
isDisabled: option.disabled,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
/* @__PURE__ */ jsx(
|
|
25
|
-
|
|
44
|
+
showSelectionIndicator: true,
|
|
45
|
+
children: /* @__PURE__ */ jsxs("div", { className: classes.content, children: [
|
|
46
|
+
option.leadingIcon && /* @__PURE__ */ jsx("div", { className: classes.leadingIcon, children: option.leadingIcon }),
|
|
47
|
+
/* @__PURE__ */ jsxs("div", { className: classes.text, children: [
|
|
48
|
+
/* @__PURE__ */ jsx(
|
|
49
|
+
Text,
|
|
50
|
+
{
|
|
51
|
+
slot: "label",
|
|
52
|
+
className: clsx(classes.title, legacyOptionClasses.label),
|
|
53
|
+
children: option.label
|
|
54
|
+
}
|
|
55
|
+
),
|
|
56
|
+
option.description && /* @__PURE__ */ jsx(Text, { slot: "description", className: classes.description, children: option.description })
|
|
57
|
+
] })
|
|
58
|
+
] })
|
|
26
59
|
}
|
|
27
60
|
);
|
|
28
61
|
}
|
|
@@ -31,15 +64,138 @@ function SelectSectionItems({ section }) {
|
|
|
31
64
|
const { classes } = ownProps;
|
|
32
65
|
return /* @__PURE__ */ jsxs(ListBoxSection, { className: classes.root, children: [
|
|
33
66
|
/* @__PURE__ */ jsx(Header, { className: classes.header, children: section.title }),
|
|
34
|
-
section.options.map((option) => /* @__PURE__ */ jsx(
|
|
67
|
+
section.options.map((option) => /* @__PURE__ */ jsx(PlainOptionItem, { option }, option.id))
|
|
35
68
|
] });
|
|
36
69
|
}
|
|
70
|
+
function renderSelectOption(item) {
|
|
71
|
+
if ("options" in item) {
|
|
72
|
+
return /* @__PURE__ */ jsx(SelectSectionItems, { section: item }, item.title);
|
|
73
|
+
}
|
|
74
|
+
return /* @__PURE__ */ jsx(PlainOptionItem, { option: item }, item.id);
|
|
75
|
+
}
|
|
76
|
+
function SelectCollection({
|
|
77
|
+
normalizedOptions,
|
|
78
|
+
retainedOptions,
|
|
79
|
+
items,
|
|
80
|
+
children,
|
|
81
|
+
dependencies
|
|
82
|
+
}) {
|
|
83
|
+
if (normalizedOptions) {
|
|
84
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
85
|
+
normalizedOptions.map(renderSelectOption),
|
|
86
|
+
Array.from(retainedOptions ?? [], (option) => /* @__PURE__ */ jsx(PlainOptionItem, { option }, option.id))
|
|
87
|
+
] });
|
|
88
|
+
}
|
|
89
|
+
if (items) {
|
|
90
|
+
const renderItem = (item) => {
|
|
91
|
+
if (typeof children === "function") {
|
|
92
|
+
return children(item);
|
|
93
|
+
}
|
|
94
|
+
return /* @__PURE__ */ jsx(PlainOptionItem, { option: item });
|
|
95
|
+
};
|
|
96
|
+
return /* @__PURE__ */ jsx(Collection, { items, dependencies, children: renderItem });
|
|
97
|
+
}
|
|
98
|
+
return children;
|
|
99
|
+
}
|
|
100
|
+
function SelectEmptyState({
|
|
101
|
+
isLoading,
|
|
102
|
+
className,
|
|
103
|
+
rowClassName
|
|
104
|
+
}) {
|
|
105
|
+
if (!isLoading) {
|
|
106
|
+
return /* @__PURE__ */ jsx(NoResults, {});
|
|
107
|
+
}
|
|
108
|
+
return /* @__PURE__ */ jsx(LoadingRows, { count: 3, className, rowClassName });
|
|
109
|
+
}
|
|
110
|
+
function SelectLoadMoreIndicator({
|
|
111
|
+
loading,
|
|
112
|
+
isCollectionLoading,
|
|
113
|
+
isIndicatorVisible,
|
|
114
|
+
className,
|
|
115
|
+
rowClassName
|
|
116
|
+
}) {
|
|
117
|
+
if (!loading?.onLoadMore || isCollectionLoading) {
|
|
118
|
+
return null;
|
|
119
|
+
}
|
|
120
|
+
const onLoadMore = loading.state === "loadingMore" ? void 0 : loading.onLoadMore;
|
|
121
|
+
return /* @__PURE__ */ jsx(
|
|
122
|
+
ListBoxLoadMoreItem,
|
|
123
|
+
{
|
|
124
|
+
isLoading: isIndicatorVisible,
|
|
125
|
+
onLoadMore,
|
|
126
|
+
scrollOffset: 0,
|
|
127
|
+
children: /* @__PURE__ */ jsx(
|
|
128
|
+
LoadingRows,
|
|
129
|
+
{
|
|
130
|
+
count: 1,
|
|
131
|
+
className,
|
|
132
|
+
rowClassName
|
|
133
|
+
}
|
|
134
|
+
)
|
|
135
|
+
}
|
|
136
|
+
);
|
|
137
|
+
}
|
|
37
138
|
function SelectListBox(props) {
|
|
38
139
|
const { ownProps } = useDefinition(SelectListBoxDefinition, props);
|
|
39
|
-
const {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
140
|
+
const {
|
|
141
|
+
classes,
|
|
142
|
+
options,
|
|
143
|
+
items,
|
|
144
|
+
children,
|
|
145
|
+
dependencies,
|
|
146
|
+
loading,
|
|
147
|
+
isStale,
|
|
148
|
+
retainedOptions
|
|
149
|
+
} = ownProps;
|
|
150
|
+
const normalizedOptions = options && normalizeOptions(options);
|
|
151
|
+
const isCollectionLoading = loading?.state === "loading" || loading?.state === "filtering" || loading?.state === "sorting";
|
|
152
|
+
const isBusy = isCollectionLoading || loading?.state === "loadingMore";
|
|
153
|
+
const showStale = useDelayedVisibility(
|
|
154
|
+
isStale ?? false,
|
|
155
|
+
loadingIndicatorDelayMs
|
|
156
|
+
);
|
|
157
|
+
const showLoadMoreIndicator = useDelayedVisibility(
|
|
158
|
+
loading?.state === "loadingMore",
|
|
159
|
+
loadingIndicatorDelayMs
|
|
160
|
+
);
|
|
161
|
+
const listBox = /* @__PURE__ */ jsxs(
|
|
162
|
+
ListBox,
|
|
163
|
+
{
|
|
164
|
+
className: classes.root,
|
|
165
|
+
"data-stale": showStale || void 0,
|
|
166
|
+
renderEmptyState: () => /* @__PURE__ */ jsx(
|
|
167
|
+
SelectEmptyState,
|
|
168
|
+
{
|
|
169
|
+
isLoading: isCollectionLoading,
|
|
170
|
+
className: classes.loading,
|
|
171
|
+
rowClassName: classes.loadingRow
|
|
172
|
+
}
|
|
173
|
+
),
|
|
174
|
+
children: [
|
|
175
|
+
/* @__PURE__ */ jsx(
|
|
176
|
+
SelectCollection,
|
|
177
|
+
{
|
|
178
|
+
normalizedOptions,
|
|
179
|
+
retainedOptions,
|
|
180
|
+
items,
|
|
181
|
+
dependencies,
|
|
182
|
+
children
|
|
183
|
+
}
|
|
184
|
+
),
|
|
185
|
+
/* @__PURE__ */ jsx(
|
|
186
|
+
SelectLoadMoreIndicator,
|
|
187
|
+
{
|
|
188
|
+
loading,
|
|
189
|
+
isCollectionLoading,
|
|
190
|
+
isIndicatorVisible: showLoadMoreIndicator,
|
|
191
|
+
className: classes.loading,
|
|
192
|
+
rowClassName: classes.loadingRow
|
|
193
|
+
}
|
|
194
|
+
)
|
|
195
|
+
]
|
|
196
|
+
}
|
|
197
|
+
);
|
|
198
|
+
return /* @__PURE__ */ jsx("div", { "aria-busy": isBusy || void 0, children: listBox });
|
|
43
199
|
}
|
|
44
200
|
|
|
45
201
|
export { SelectListBox };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectListBox.esm.js","sources":["../../../src/components/Select/SelectListBox.tsx"],"sourcesContent":["/*\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\nimport {\n ListBox,\n ListBoxItem,\n ListBoxSection,\n Header,\n Text,\n} from 'react-aria-components';\nimport { RiCheckLine } from '@remixicon/react';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport {\n SelectListBoxDefinition,\n SelectListBoxItemDefinition,\n SelectSectionDefinition,\n} from './definition';\nimport type { Option, OptionSection, SelectOwnProps } from './types';\n\ninterface SelectListBoxProps {\n options?: SelectOwnProps['options'];\n}\n\nconst NoResults = () => {\n const { ownProps } = useDefinition(SelectListBoxDefinition, {});\n const { classes } = ownProps;\n\n return <div className={classes.noResults}>No results found.</div>;\n};\n\nfunction SelectItem({ option }: { option: Option }) {\n const { ownProps } = useDefinition(SelectListBoxItemDefinition, {});\n const { classes } = ownProps;\n\n return (\n <ListBoxItem\n id={option.value}\n textValue={option.label}\n className={classes.root}\n isDisabled={option.disabled}\n >\n <div className={classes.indicator}>\n <RiCheckLine />\n </div>\n <Text slot=\"label\" className={classes.label}>\n {option.label}\n </Text>\n </ListBoxItem>\n );\n}\n\nfunction SelectSectionItems({ section }: { section: OptionSection }) {\n const { ownProps } = useDefinition(SelectSectionDefinition, {});\n const { classes } = ownProps;\n\n return (\n <ListBoxSection className={classes.root}>\n <Header className={classes.header}>{section.title}</Header>\n {section.options.map(option => (\n <SelectItem key={option.value} option={option} />\n ))}\n </ListBoxSection>\n );\n}\n\nexport function SelectListBox(props: SelectListBoxProps) {\n const { ownProps } = useDefinition(SelectListBoxDefinition, props);\n const { classes, options } = ownProps;\n\n return (\n <ListBox className={classes.root} renderEmptyState={() => <NoResults />}>\n {options?.map(item =>\n 'options' in item ? (\n <SelectSectionItems key={item.title} section={item} />\n ) : (\n <SelectItem key={item.value} option={item} />\n ),\n )}\n </ListBox>\n );\n}\n"],"names":[],"mappings":";;;;;;AAoCA,MAAM,YAAY,MAAM;AACtB,EAAA,MAAM,EAAE,QAAA,EAAS,GAAI,aAAA,CAAc,uBAAA,EAAyB,EAAE,CAAA;AAC9D,EAAA,MAAM,EAAE,SAAQ,GAAI,QAAA;AAEpB,EAAA,uBAAO,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,OAAA,CAAQ,WAAW,QAAA,EAAA,mBAAA,EAAiB,CAAA;AAC7D,CAAA;AAEA,SAAS,UAAA,CAAW,EAAE,MAAA,EAAO,EAAuB;AAClD,EAAA,MAAM,EAAE,QAAA,EAAS,GAAI,aAAA,CAAc,2BAAA,EAA6B,EAAE,CAAA;AAClE,EAAA,MAAM,EAAE,SAAQ,GAAI,QAAA;AAEpB,EAAA,uBACE,IAAA;AAAA,IAAC,WAAA;AAAA,IAAA;AAAA,MACC,IAAI,MAAA,CAAO,KAAA;AAAA,MACX,WAAW,MAAA,CAAO,KAAA;AAAA,MAClB,WAAW,OAAA,CAAQ,IAAA;AAAA,MACn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A,mBACX,GAAA,CAAC,sBAAoC,OAAA,EAAS,IAAA,EAAA,EAArB,IAAA,CAAK,KAAsB,oBAEpD,GAAA,CAAC,UAAA,EAAA,EAA4B,MAAA,EAAQ,IAAA,EAAA,EAApB,KAAK,KAAqB;AAAA,GAE/C,EACF,CAAA;AAEJ;;;;"}
|
|
1
|
+
{"version":3,"file":"SelectListBox.esm.js","sources":["../../../src/components/Select/SelectListBox.tsx"],"sourcesContent":["/*\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\nimport {\n Collection,\n Header,\n ListBox,\n ListBoxLoadMoreItem,\n ListBoxSection,\n Text,\n} from 'react-aria-components';\nimport clsx from 'clsx';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport {\n SelectItemTextDefinition,\n SelectListBoxDefinition,\n SelectListBoxItemDefinition,\n SelectSectionDefinition,\n} from './definition';\nimport { normalizeOptions } from '../../utils/selectableCollection';\nimport type {\n CollectionItem,\n LoadingConfig,\n NormalizedOption,\n NormalizedOptionSection,\n} from '../../types/selectableCollection';\nimport type { SelectListBoxOwnProps } from './types';\nimport { SelectItem } from './SelectItem';\nimport { Skeleton } from '../Skeleton';\nimport { useDelayedVisibility } from '../../hooks/useDelayedVisibility';\n\nconst loadingRowWidths = ['70%', '55%', '65%'];\nconst loadingIndicatorDelayMs = 300;\n\nfunction LoadingRows({\n count,\n className,\n rowClassName,\n}: {\n count: number;\n className: string;\n rowClassName: string;\n}) {\n return (\n <div className={className} aria-hidden=\"true\">\n {loadingRowWidths.slice(0, count).map(width => (\n <div key={width} className={rowClassName}>\n <Skeleton width={width} height=\"0.75rem\" />\n </div>\n ))}\n </div>\n );\n}\n\nconst NoResults = () => {\n const { ownProps } = useDefinition(SelectListBoxDefinition, {});\n const { classes } = ownProps;\n\n return <div className={classes.noResults}>No results found.</div>;\n};\n\nfunction PlainOptionItem({ option }: { option: NormalizedOption }) {\n const { ownProps } = useDefinition(SelectItemTextDefinition, {\n title: option.label,\n description: option.description,\n leadingIcon: option.leadingIcon,\n });\n const { classes } = ownProps;\n // Keep the original plain-option label class available for existing themes.\n const {\n ownProps: { classes: legacyOptionClasses },\n } = useDefinition(SelectListBoxItemDefinition, {});\n\n return (\n <SelectItem\n id={option.id}\n value={option}\n className={classes.root}\n textValue={option.label}\n isDisabled={option.disabled}\n showSelectionIndicator\n >\n <div className={classes.content}>\n {option.leadingIcon && (\n <div className={classes.leadingIcon}>{option.leadingIcon}</div>\n )}\n <div className={classes.text}>\n <Text\n slot=\"label\"\n className={clsx(classes.title, legacyOptionClasses.label)}\n >\n {option.label}\n </Text>\n {option.description && (\n <Text slot=\"description\" className={classes.description}>\n {option.description}\n </Text>\n )}\n </div>\n </div>\n </SelectItem>\n );\n}\n\nfunction SelectSectionItems({ section }: { section: NormalizedOptionSection }) {\n const { ownProps } = useDefinition(SelectSectionDefinition, {});\n const { classes } = ownProps;\n\n return (\n <ListBoxSection className={classes.root}>\n <Header className={classes.header}>{section.title}</Header>\n {section.options.map(option => (\n <PlainOptionItem key={option.id} option={option} />\n ))}\n </ListBoxSection>\n );\n}\n\nfunction renderSelectOption(item: NormalizedOption | NormalizedOptionSection) {\n if ('options' in item) {\n return <SelectSectionItems key={item.title} section={item} />;\n }\n\n return <PlainOptionItem key={item.id} option={item} />;\n}\n\nfunction SelectCollection<T extends CollectionItem>({\n normalizedOptions,\n retainedOptions,\n items,\n children,\n dependencies,\n}: {\n normalizedOptions?: Array<NormalizedOption | NormalizedOptionSection>;\n retainedOptions?: ReadonlyArray<NormalizedOption>;\n items?: Iterable<T>;\n children?: React.ReactNode | ((item: T) => React.ReactElement);\n dependencies?: ReadonlyArray<unknown>;\n}) {\n if (normalizedOptions) {\n return (\n <>\n {normalizedOptions.map(renderSelectOption)}\n {Array.from(retainedOptions ?? [], option => (\n <PlainOptionItem key={option.id} option={option} />\n ))}\n </>\n );\n }\n\n if (items) {\n const renderItem = (item: T) => {\n if (typeof children === 'function') {\n return children(item);\n }\n\n return <PlainOptionItem option={item as unknown as NormalizedOption} />;\n };\n\n return (\n <Collection items={items} dependencies={dependencies}>\n {renderItem}\n </Collection>\n );\n }\n\n return children as React.ReactNode;\n}\n\nfunction SelectEmptyState({\n isLoading,\n className,\n rowClassName,\n}: {\n isLoading: boolean;\n className: string;\n rowClassName: string;\n}) {\n if (!isLoading) {\n return <NoResults />;\n }\n\n return (\n <LoadingRows count={3} className={className} rowClassName={rowClassName} />\n );\n}\n\nfunction SelectLoadMoreIndicator({\n loading,\n isCollectionLoading,\n isIndicatorVisible,\n className,\n rowClassName,\n}: {\n loading?: LoadingConfig;\n isCollectionLoading: boolean;\n isIndicatorVisible: boolean;\n className: string;\n rowClassName: string;\n}) {\n if (!loading?.onLoadMore || isCollectionLoading) {\n return null;\n }\n\n const onLoadMore =\n loading.state === 'loadingMore' ? undefined : loading.onLoadMore;\n\n return (\n <ListBoxLoadMoreItem\n isLoading={isIndicatorVisible}\n onLoadMore={onLoadMore}\n scrollOffset={0}\n >\n <LoadingRows\n count={1}\n className={className}\n rowClassName={rowClassName}\n />\n </ListBoxLoadMoreItem>\n );\n}\n\nexport function SelectListBox<T extends CollectionItem = NormalizedOption>(\n props: SelectListBoxOwnProps<T>,\n) {\n const { ownProps } = useDefinition(SelectListBoxDefinition, props);\n const {\n classes,\n options,\n items,\n children,\n dependencies,\n loading,\n isStale,\n retainedOptions,\n } = ownProps;\n const normalizedOptions = options && normalizeOptions(options);\n const isCollectionLoading =\n loading?.state === 'loading' ||\n loading?.state === 'filtering' ||\n loading?.state === 'sorting';\n const isBusy = isCollectionLoading || loading?.state === 'loadingMore';\n const showStale = useDelayedVisibility(\n isStale ?? false,\n loadingIndicatorDelayMs,\n );\n const showLoadMoreIndicator = useDelayedVisibility(\n loading?.state === 'loadingMore',\n loadingIndicatorDelayMs,\n );\n\n const listBox = (\n <ListBox\n className={classes.root}\n data-stale={showStale || undefined}\n renderEmptyState={() => (\n <SelectEmptyState\n isLoading={isCollectionLoading}\n className={classes.loading}\n rowClassName={classes.loadingRow}\n />\n )}\n >\n <SelectCollection\n normalizedOptions={normalizedOptions}\n retainedOptions={retainedOptions}\n items={items}\n dependencies={dependencies}\n >\n {children}\n </SelectCollection>\n <SelectLoadMoreIndicator\n loading={loading}\n isCollectionLoading={isCollectionLoading}\n isIndicatorVisible={showLoadMoreIndicator}\n className={classes.loading}\n rowClassName={classes.loadingRow}\n />\n </ListBox>\n );\n\n return <div aria-busy={isBusy || undefined}>{listBox}</div>;\n}\n"],"names":[],"mappings":";;;;;;;;;;;AA4CA,MAAM,gBAAA,GAAmB,CAAC,KAAA,EAAO,KAAA,EAAO,KAAK,CAAA;AAC7C,MAAM,uBAAA,GAA0B,GAAA;AAEhC,SAAS,WAAA,CAAY;AAAA,EACnB,KAAA;AAAA,EACA,SAAA;AAAA,EACA;AACF,CAAA,EAIG;AACD,EAAA,uBACE,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAsB,aAAA,EAAY,MAAA,EACpC,2BAAiB,KAAA,CAAM,CAAA,EAAG,KAAK,CAAA,CAAE,GAAA,CAAI,CAAA,KAAA,yBACnC,KAAA,EAAA,EAAgB,SAAA,EAAW,YAAA,EAC1B,QAAA,kBAAA,GAAA,CAAC,QAAA,EAAA,EAAS,KAAA,EAAc,QAAO,SAAA,EAAU,CAAA,EAAA,EADjC,KAEV,CACD,CAAA,EACH,CAAA;AAEJ;AAEA,MAAM,YAAY,MAAM;AACtB,EAAA,MAAM,EAAE,QAAA,EAAS,GAAI,aAAA,CAAc,uBAAA,EAAyB,EAAE,CAAA;AAC9D,EAAA,MAAM,EAAE,SAAQ,GAAI,QAAA;A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AAW,OAAA,CAAQ,IAAA;AAAA,MACnB,cAAY,SAAA,IAAa,MAAA;AAAA,MACzB,kBAAkB,sBAChB,GAAA;AAAA,QAAC,gBAAA;AAAA,QAAA;AAAA,UACC,SAAA,EAAW,mBAAA;AAAA,UACX,WAAW,OAAA,CAAQ,OAAA;AAAA,UACnB,cAAc,OAAA,CAAQ;AAAA;AAAA,OACxB;AAAA,MAGF,QAAA,EAAA;AAAA,wBAAA,GAAA;AAAA,UAAC,gBAAA;AAAA,UAAA;AAAA,YACC,iBAAA;AAAA,YACA,eAAA;AAAA,YACA,KAAA;AAAA,YACA,YAAA;AAAA,YAEC;AAAA;AAAA,SACH;AAAA,wBACA,GAAA;AAAA,UAAC,uBAAA;AAAA,UAAA;AAAA,YACC,OAAA;AAAA,YACA,mBAAA;AAAA,YACA,kBAAA,EAAoB,qBAAA;AAAA,YACpB,WAAW,OAAA,CAAQ,OAAA;AAAA,YACnB,cAAc,OAAA,CAAQ;AAAA;AAAA;AACxB;AAAA;AAAA,GACF;AAGF,EAAA,uBAAO,GAAA,CAAC,KAAA,EAAA,EAAI,WAAA,EAAW,MAAA,IAAU,QAAY,QAAA,EAAA,OAAA,EAAQ,CAAA;AACvD;;;;"}
|
|
@@ -12,7 +12,7 @@ function SelectTrigger(props) {
|
|
|
12
12
|
const { classes, icon } = ownProps;
|
|
13
13
|
return /* @__PURE__ */ jsxs(Button, { className: classes.root, ...dataAttributes, children: [
|
|
14
14
|
icon,
|
|
15
|
-
/* @__PURE__ */ jsx(SelectValue, { className: classes.value }),
|
|
15
|
+
/* @__PURE__ */ jsx(SelectValue, { className: classes.value, children: ({ isPlaceholder, selectedText, defaultChildren }) => isPlaceholder ? defaultChildren : selectedText }),
|
|
16
16
|
/* @__PURE__ */ jsx("div", { className: classes.chevron, children: /* @__PURE__ */ jsx(RiArrowDownSLine, { "aria-hidden": "true" }) })
|
|
17
17
|
] });
|
|
18
18
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectTrigger.esm.js","sources":["../../../src/components/Select/SelectTrigger.tsx"],"sourcesContent":["/*\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\nimport { ReactNode } from 'react';\nimport { Button, SelectValue } from 'react-aria-components';\nimport { RiArrowDownSLine } from '@remixicon/react';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport { SelectTriggerDefinition } from './definition';\n\ninterface SelectTriggerProps {\n icon?: ReactNode;\n}\n\nexport function SelectTrigger(props: SelectTriggerProps) {\n const { ownProps, dataAttributes } = useDefinition(\n SelectTriggerDefinition,\n props,\n );\n const { classes, icon } = ownProps;\n\n return (\n <Button className={classes.root} {...dataAttributes}>\n {icon}\n <SelectValue className={classes.value}
|
|
1
|
+
{"version":3,"file":"SelectTrigger.esm.js","sources":["../../../src/components/Select/SelectTrigger.tsx"],"sourcesContent":["/*\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\nimport { ReactNode } from 'react';\nimport { Button, SelectValue } from 'react-aria-components';\nimport { RiArrowDownSLine } from '@remixicon/react';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport { SelectTriggerDefinition } from './definition';\n\ninterface SelectTriggerProps {\n icon?: ReactNode;\n}\n\nexport function SelectTrigger(props: SelectTriggerProps) {\n const { ownProps, dataAttributes } = useDefinition(\n SelectTriggerDefinition,\n props,\n );\n const { classes, icon } = ownProps;\n\n return (\n <Button className={classes.root} {...dataAttributes}>\n {icon}\n <SelectValue className={classes.value}>\n {({ isPlaceholder, selectedText, defaultChildren }) =>\n isPlaceholder ? defaultChildren : selectedText\n }\n </SelectValue>\n <div className={classes.chevron}>\n <RiArrowDownSLine aria-hidden=\"true\" />\n </div>\n </Button>\n );\n}\n"],"names":[],"mappings":";;;;;;AA0BO,SAAS,cAAc,KAAA,EAA2B;AACvD,EAAA,MAAM,EAAE,QAAA,EAAU,cAAA,EAAe,GAAI,aAAA;AAAA,IACnC,uBAAA;AAAA,IACA;AAAA,GACF;AACA,EAAA,MAAM,EAAE,OAAA,EAAS,IAAA,EAAK,GAAI,QAAA;AAE1B,EAAA,4BACG,MAAA,EAAA,EAAO,SAAA,EAAW,OAAA,CAAQ,IAAA,EAAO,GAAG,cAAA,EAClC,QAAA,EAAA;AAAA,IAAA,IAAA;AAAA,oBACD,GAAA,CAAC,WAAA,EAAA,EAAY,SAAA,EAAW,OAAA,CAAQ,KAAA,EAC7B,QAAA,EAAA,CAAC,EAAE,aAAA,EAAe,YAAA,EAAc,eAAA,EAAgB,KAC/C,aAAA,GAAgB,kBAAkB,YAAA,EAEtC,CAAA;AAAA,oBACA,GAAA,CAAC,SAAI,SAAA,EAAW,OAAA,CAAQ,SACtB,QAAA,kBAAA,GAAA,CAAC,gBAAA,EAAA,EAAiB,aAAA,EAAY,MAAA,EAAO,CAAA,EACvC;AAAA,GAAA,EACF,CAAA;AAEJ;;;;"}
|
|
@@ -18,6 +18,11 @@ const SelectDefinition = defineComponent()({
|
|
|
18
18
|
icon: {},
|
|
19
19
|
size: { dataAttribute: true, default: "small" },
|
|
20
20
|
options: {},
|
|
21
|
+
items: {},
|
|
22
|
+
children: {},
|
|
23
|
+
dependencies: {},
|
|
24
|
+
search: {},
|
|
25
|
+
loading: {},
|
|
21
26
|
searchable: {},
|
|
22
27
|
searchPlaceholder: {},
|
|
23
28
|
label: {},
|
|
@@ -45,14 +50,22 @@ const SelectContentDefinition = defineComponent()(
|
|
|
45
50
|
{
|
|
46
51
|
styles,
|
|
47
52
|
classNames: {
|
|
48
|
-
root: "bui-
|
|
53
|
+
root: "bui-SelectContent",
|
|
54
|
+
searchWrapper: "bui-SelectSearchWrapper",
|
|
55
|
+
results: "bui-SelectResults",
|
|
49
56
|
search: "bui-SelectSearch",
|
|
50
57
|
searchClear: "bui-SelectSearchClear"
|
|
51
58
|
},
|
|
52
59
|
propDefs: {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
60
|
+
search: {},
|
|
61
|
+
options: {},
|
|
62
|
+
items: {},
|
|
63
|
+
children: {},
|
|
64
|
+
dependencies: {},
|
|
65
|
+
loading: {},
|
|
66
|
+
isStale: {},
|
|
67
|
+
visibleIds: {},
|
|
68
|
+
retainedOptions: {}
|
|
56
69
|
}
|
|
57
70
|
}
|
|
58
71
|
);
|
|
@@ -61,22 +74,72 @@ const SelectListBoxDefinition = defineComponent()(
|
|
|
61
74
|
styles,
|
|
62
75
|
classNames: {
|
|
63
76
|
root: "bui-SelectList",
|
|
64
|
-
noResults: "bui-SelectNoResults"
|
|
77
|
+
noResults: "bui-SelectNoResults",
|
|
78
|
+
loading: "bui-SelectLoading",
|
|
79
|
+
loadingRow: "bui-SelectLoadingRow"
|
|
65
80
|
},
|
|
66
81
|
propDefs: {
|
|
67
|
-
options: {}
|
|
82
|
+
options: {},
|
|
83
|
+
items: {},
|
|
84
|
+
children: {},
|
|
85
|
+
dependencies: {},
|
|
86
|
+
loading: {},
|
|
87
|
+
isStale: {},
|
|
88
|
+
retainedOptions: {}
|
|
68
89
|
}
|
|
69
90
|
}
|
|
70
91
|
);
|
|
71
92
|
const SelectListBoxItemDefinition = defineComponent()({
|
|
72
93
|
styles,
|
|
73
94
|
classNames: {
|
|
74
|
-
root: "bui-SelectItem",
|
|
75
|
-
indicator: "bui-SelectItemIndicator",
|
|
76
95
|
label: "bui-SelectItemLabel"
|
|
77
96
|
},
|
|
78
97
|
propDefs: {}
|
|
79
98
|
});
|
|
99
|
+
const SelectItemDefinition = defineComponent()({
|
|
100
|
+
styles,
|
|
101
|
+
classNames: {
|
|
102
|
+
root: "bui-SelectItem",
|
|
103
|
+
indicator: "bui-SelectItemIndicator",
|
|
104
|
+
content: "bui-SelectItemContent"
|
|
105
|
+
},
|
|
106
|
+
propDefs: {
|
|
107
|
+
children: {},
|
|
108
|
+
showSelectionIndicator: {},
|
|
109
|
+
className: {}
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
const SelectItemTextDefinition = defineComponent()({
|
|
113
|
+
styles,
|
|
114
|
+
classNames: {
|
|
115
|
+
root: "bui-SelectItemText",
|
|
116
|
+
content: "bui-SelectItemContent",
|
|
117
|
+
leadingIcon: "bui-SelectItemLeadingIcon",
|
|
118
|
+
text: "bui-SelectItemTextContent",
|
|
119
|
+
title: "bui-SelectItemTitle",
|
|
120
|
+
description: "bui-SelectItemDescription"
|
|
121
|
+
},
|
|
122
|
+
propDefs: {
|
|
123
|
+
title: {},
|
|
124
|
+
description: {},
|
|
125
|
+
leadingIcon: {},
|
|
126
|
+
className: {}
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
const SelectItemProfileDefinition = defineComponent()({
|
|
130
|
+
styles,
|
|
131
|
+
classNames: {
|
|
132
|
+
root: "bui-SelectItemProfile",
|
|
133
|
+
content: "bui-SelectItemContent",
|
|
134
|
+
avatar: "bui-SelectItemAvatar",
|
|
135
|
+
name: "bui-SelectItemTitle"
|
|
136
|
+
},
|
|
137
|
+
propDefs: {
|
|
138
|
+
name: {},
|
|
139
|
+
src: {},
|
|
140
|
+
className: {}
|
|
141
|
+
}
|
|
142
|
+
});
|
|
80
143
|
const SelectSectionDefinition = defineComponent()(
|
|
81
144
|
{
|
|
82
145
|
styles,
|
|
@@ -88,5 +151,5 @@ const SelectSectionDefinition = defineComponent()(
|
|
|
88
151
|
}
|
|
89
152
|
);
|
|
90
153
|
|
|
91
|
-
export { SelectContentDefinition, SelectDefinition, SelectListBoxDefinition, SelectListBoxItemDefinition, SelectSectionDefinition, SelectTriggerDefinition };
|
|
154
|
+
export { SelectContentDefinition, SelectDefinition, SelectItemDefinition, SelectItemProfileDefinition, SelectItemTextDefinition, SelectListBoxDefinition, SelectListBoxItemDefinition, SelectSectionDefinition, SelectTriggerDefinition };
|
|
92
155
|
//# sourceMappingURL=definition.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/Select/definition.ts"],"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 { defineComponent } from '../../hooks/useDefinition';\nimport type {\n SelectOwnProps,\n SelectTriggerOwnProps,\n SelectContentOwnProps,\n SelectListBoxOwnProps,\n SelectListBoxItemOwnProps,\n SelectSectionOwnProps,\n} from './types';\nimport styles from './Select.module.css';\n\n
|
|
1
|
+
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/Select/definition.ts"],"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 { defineComponent } from '../../hooks/useDefinition';\nimport type {\n SelectOwnProps,\n SelectTriggerOwnProps,\n SelectContentOwnProps,\n SelectListBoxOwnProps,\n SelectListBoxItemOwnProps,\n SelectItemOwnProps,\n SelectItemProfileOwnProps,\n SelectItemTextOwnProps,\n SelectSectionOwnProps,\n} from './types';\nimport styles from './Select.module.css';\n\n/** @public */\nexport const SelectDefinition = defineComponent<SelectOwnProps>()({\n styles,\n classNames: {\n root: 'bui-Select',\n popover: 'bui-SelectPopover',\n },\n propDefs: {\n icon: {},\n size: { dataAttribute: true, default: 'small' },\n options: {},\n items: {},\n children: {},\n dependencies: {},\n search: {},\n loading: {},\n searchable: {},\n searchPlaceholder: {},\n label: {},\n secondaryLabel: {},\n description: {},\n isRequired: {},\n className: {},\n },\n});\n\n/** @public */\nexport const SelectTriggerDefinition = defineComponent<SelectTriggerOwnProps>()(\n {\n styles,\n classNames: {\n root: 'bui-SelectTrigger',\n chevron: 'bui-SelectTriggerChevron',\n value: 'bui-SelectValue',\n },\n bg: 'consumer',\n propDefs: {\n icon: {},\n },\n },\n);\n\n/** @public */\nexport const SelectContentDefinition = defineComponent<SelectContentOwnProps>()(\n {\n styles,\n classNames: {\n root: 'bui-SelectContent',\n searchWrapper: 'bui-SelectSearchWrapper',\n results: 'bui-SelectResults',\n search: 'bui-SelectSearch',\n searchClear: 'bui-SelectSearchClear',\n },\n propDefs: {\n search: {},\n options: {},\n items: {},\n children: {},\n dependencies: {},\n loading: {},\n isStale: {},\n visibleIds: {},\n retainedOptions: {},\n },\n },\n);\n\n/** @public */\nexport const SelectListBoxDefinition = defineComponent<SelectListBoxOwnProps>()(\n {\n styles,\n classNames: {\n root: 'bui-SelectList',\n noResults: 'bui-SelectNoResults',\n loading: 'bui-SelectLoading',\n loadingRow: 'bui-SelectLoadingRow',\n },\n propDefs: {\n options: {},\n items: {},\n children: {},\n dependencies: {},\n loading: {},\n isStale: {},\n retainedOptions: {},\n },\n },\n);\n\n/** @public */\nexport const SelectListBoxItemDefinition =\n defineComponent<SelectListBoxItemOwnProps>()({\n styles,\n classNames: {\n label: 'bui-SelectItemLabel',\n },\n propDefs: {},\n });\n\n/** @public */\nexport const SelectItemDefinition = defineComponent<SelectItemOwnProps>()({\n styles,\n classNames: {\n root: 'bui-SelectItem',\n indicator: 'bui-SelectItemIndicator',\n content: 'bui-SelectItemContent',\n },\n propDefs: {\n children: {},\n showSelectionIndicator: {},\n className: {},\n },\n});\n\n/** @public */\nexport const SelectItemTextDefinition =\n defineComponent<SelectItemTextOwnProps>()({\n styles,\n classNames: {\n root: 'bui-SelectItemText',\n content: 'bui-SelectItemContent',\n leadingIcon: 'bui-SelectItemLeadingIcon',\n text: 'bui-SelectItemTextContent',\n title: 'bui-SelectItemTitle',\n description: 'bui-SelectItemDescription',\n },\n propDefs: {\n title: {},\n description: {},\n leadingIcon: {},\n className: {},\n },\n });\n\n/** @public */\nexport const SelectItemProfileDefinition =\n defineComponent<SelectItemProfileOwnProps>()({\n styles,\n classNames: {\n root: 'bui-SelectItemProfile',\n content: 'bui-SelectItemContent',\n avatar: 'bui-SelectItemAvatar',\n name: 'bui-SelectItemTitle',\n },\n propDefs: {\n name: {},\n src: {},\n className: {},\n },\n });\n\n/** @public */\nexport const SelectSectionDefinition = defineComponent<SelectSectionOwnProps>()(\n {\n styles,\n classNames: {\n root: 'bui-SelectSection',\n header: 'bui-SelectSectionHeader',\n },\n propDefs: {},\n },\n);\n"],"names":[],"mappings":";;;;;;;;;;AA+BO,MAAM,gBAAA,GAAmB,iBAAgC,CAAE;AAAA,EAChE,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,YAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACX;AAAA,EACA,QAAA,EAAU;AAAA,IACR,MAAM,EAAC;AAAA,IACP,IAAA,EAAM,EAAE,aAAA,EAAe,IAAA,EAAM,SAAS,OAAA,EAAQ;AAAA,IAC9C,SAAS,EAAC;AAAA,IACV,OAAO,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ACR;AAAA,EACA,QAAA,EAAU;AAAA,IACR,MAAM,EAAC;AAAA,IACP,KAAK,EAAC;AAAA,IACN,WAAW;AAAC;AAEhB,CAAC;AAGI,MAAM,0BAA0B,eAAA,EAAuC;AAAA,EAC5E;AAAA,IACE,MAAA;AAAA,IACA,UAAA,EAAY;AAAA,MACV,IAAA,EAAM,mBAAA;AAAA,MACN,MAAA,EAAQ;AAAA,KACV;AAAA,IACA,UAAU;AAAC;AAEf;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
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 .Skeleton_bui-
|
|
4
|
-
var styles = {"bui-Skeleton":"Skeleton_bui-
|
|
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 .Skeleton_bui-Skeleton__d4ef51c389 {\n animation: var(--bui-animate-pulse);\n background-color: var(--bui-bg-neutral-2);\n border-radius: var(--bui-radius-2);\n\n &[data-on-bg='neutral-1'] {\n background-color: var(--bui-bg-neutral-2);\n }\n\n &[data-on-bg='neutral-2'] {\n background-color: var(--bui-bg-neutral-3);\n }\n\n &[data-on-bg='neutral-3'] {\n background-color: var(--bui-bg-neutral-4);\n }\n }\n\n .Skeleton_bui-Skeleton__d4ef51c389[data-rounded='true'] {\n border-radius: var(--bui-radius-full);\n }\n}\n";
|
|
4
|
+
var styles = {"bui-Skeleton":"Skeleton_bui-Skeleton__d4ef51c389"};
|
|
5
5
|
styleInject(css_248z);
|
|
6
6
|
|
|
7
7
|
export { styles as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/Skeleton/definition.ts"],"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 { defineComponent } from '../../hooks/useDefinition';\nimport type { SkeletonOwnProps } from './types';\nimport styles from './Skeleton.module.css';\n\n/**\n * Component definition for Skeleton\n * @public\n */\nexport const SkeletonDefinition = defineComponent<SkeletonOwnProps>()({\n styles,\n classNames: {\n root: 'bui-Skeleton',\n },\n propDefs: {\n width: { default: 80 },\n height: { default: 24 },\n rounded: { dataAttribute: true, default: false },\n className: {},\n style: {},\n },\n});\n"],"names":[],"mappings":";;;;;;;;;;AAwBO,MAAM,kBAAA,GAAqB,iBAAkC,CAAE;AAAA,EACpE,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM;AAAA,GACR;AAAA,EACA,QAAA,EAAU;AAAA,IACR,KAAA,EAAO,EAAE,OAAA,EAAS,EAAA,EAAG;AAAA,IACrB,MAAA,EAAQ,EAAE,OAAA,EAAS,EAAA,EAAG;AAAA,IACtB,OAAA,EAAS,EAAE,aAAA,EAAe,IAAA,EAAM,SAAS,KAAA,EAAM;AAAA,IAC/C,WAAW,EAAC;AAAA,IACZ,OAAO;AAAC;AAEZ,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/Skeleton/definition.ts"],"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 { defineComponent } from '../../hooks/useDefinition';\nimport type { SkeletonOwnProps } from './types';\nimport styles from './Skeleton.module.css';\n\n/**\n * Component definition for Skeleton\n * @public\n */\nexport const SkeletonDefinition = defineComponent<SkeletonOwnProps>()({\n styles,\n classNames: {\n root: 'bui-Skeleton',\n },\n bg: 'consumer',\n propDefs: {\n width: { default: 80 },\n height: { default: 24 },\n rounded: { dataAttribute: true, default: false },\n className: {},\n style: {},\n },\n});\n"],"names":[],"mappings":";;;;;;;;;;AAwBO,MAAM,kBAAA,GAAqB,iBAAkC,CAAE;AAAA,EACpE,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM;AAAA,GACR;AAAA,EACA,EAAA,EAAI,UAAA;AAAA,EACJ,QAAA,EAAU;AAAA,IACR,KAAA,EAAO,EAAE,OAAA,EAAS,EAAA,EAAG;AAAA,IACrB,MAAA,EAAQ,EAAE,OAAA,EAAS,EAAA,EAAG;AAAA,IACtB,OAAA,EAAS,EAAE,aAAA,EAAe,IAAA,EAAM,SAAS,KAAA,EAAM;AAAA,IAC/C,WAAW,EAAC;AAAA,IACZ,OAAO;AAAC;AAEZ,CAAC;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
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 .Table_bui-
|
|
4
|
-
var styles = {"bui-TableWrapper":"Table_bui-
|
|
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 .Table_bui-TableWrapper__3451e436bc {\n display: flex;\n flex-direction: column;\n }\n\n .Table_bui-TableResizableContainer__3451e436bc {\n display: flex;\n flex-direction: column;\n flex: 1;\n min-height: 0;\n overflow: hidden;\n }\n\n .Table_bui-TableScrollContainer__3451e436bc {\n overflow: auto;\n flex: 1;\n min-height: 0;\n }\n\n .Table_bui-Table__3451e436bc {\n /* Establishes containing block for react-aria's absolutely positioned hidden checkbox inputs, preventing them from escaping to a distant ancestor and creating phantom scroll height. */\n position: relative;\n width: 100%;\n caption-side: bottom;\n border-collapse: collapse;\n table-layout: fixed;\n transition: opacity 0.2s ease-in-out;\n\n &[data-stale='true'],\n &[data-ispending='true'] {\n opacity: 0.6;\n }\n }\n\n .Table_bui-TableHeader__3451e436bc {\n border-bottom: 1px solid var(--bui-border-2);\n transition: color 0.2s ease-in-out;\n }\n\n .Table_bui-TableHead__3451e436bc {\n text-align: left;\n padding: var(--bui-space-3);\n font-size: var(--bui-font-size-3);\n color: var(--bui-fg-primary);\n }\n\n .Table_bui-TableHeadSelection__3451e436bc {\n width: 40px;\n }\n\n .Table_bui-TableHeadContent__3451e436bc {\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: var(--bui-space-1);\n }\n\n .Table_bui-TableHeadLabel__3451e436bc {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n min-width: 0;\n }\n\n .Table_bui-TableHeadSortButton__3451e436bc {\n cursor: pointer;\n user-select: none;\n display: inline-flex;\n align-items: center;\n gap: var(--bui-space-1);\n opacity: 0;\n transition: opacity 0.1s ease-in-out;\n color: var(--bui-fg-secondary);\n\n .Table_bui-TableHead__3451e436bc:hover &,\n [data-sort-direction='ascending'] &,\n [data-sort-direction='descending'] & {\n opacity: 1;\n }\n\n & svg {\n transition: transform 0.1s ease-in-out;\n }\n [data-sort-direction='descending'] & svg {\n transform: rotate(180deg);\n }\n }\n\n .Table_bui-TableBody__3451e436bc {\n color: var(--bui-fg-primary);\n }\n\n .Table_bui-TableRow__3451e436bc {\n border-bottom: 1px solid var(--bui-border-2);\n transition: color 0.2s ease-in-out;\n cursor: default;\n\n &:hover {\n background-color: var(--bui-bg-neutral-1-hover);\n }\n\n &[data-selected] {\n background-color: var(--bui-bg-neutral-1-pressed);\n }\n\n &[data-pressed] {\n background-color: var(--bui-bg-neutral-1-pressed);\n }\n\n &[data-on-bg='neutral-1'] {\n &:hover {\n background-color: var(--bui-bg-neutral-2-hover);\n }\n\n &[data-selected] {\n background-color: var(--bui-bg-neutral-2-pressed);\n }\n\n &[data-pressed] {\n background-color: var(--bui-bg-neutral-2-pressed);\n }\n\n &[data-disabled] {\n background-color: var(--bui-bg-neutral-2-disabled);\n }\n }\n\n &[data-on-bg='neutral-2'] {\n &:hover {\n background-color: var(--bui-bg-neutral-3-hover);\n }\n\n &[data-selected] {\n background-color: var(--bui-bg-neutral-3-pressed);\n }\n\n &[data-pressed] {\n background-color: var(--bui-bg-neutral-3-pressed);\n }\n\n &[data-disabled] {\n background-color: var(--bui-bg-neutral-3-disabled);\n }\n }\n\n &[data-on-bg='neutral-3'] {\n &:hover {\n background-color: var(--bui-bg-neutral-4-hover);\n }\n\n &[data-selected] {\n background-color: var(--bui-bg-neutral-4-pressed);\n }\n\n &[data-pressed] {\n background-color: var(--bui-bg-neutral-4-pressed);\n }\n\n &[data-disabled] {\n background-color: var(--bui-bg-neutral-4-disabled);\n }\n }\n\n &[data-href],\n &[data-selection-mode],\n &[data-react-aria-pressable='true'] {\n cursor: pointer;\n }\n\n &[data-disabled] {\n background-color: var(--bui-bg-neutral-1-disabled);\n cursor: not-allowed;\n }\n }\n\n .Table_bui-TableCell__3451e436bc {\n padding: var(--bui-space-3);\n font-size: var(--bui-font-size-3);\n font-family: var(--bui-font-regular);\n font-weight: var(--bui-font-weight-regular);\n min-width: 0;\n overflow: hidden;\n }\n\n .Table_bui-TableCellSelection__3451e436bc {\n width: 40px;\n }\n\n .Table_bui-TableCellContentWrapper__3451e436bc {\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: var(--bui-space-2);\n min-width: 0;\n width: 100%;\n max-width: 100%;\n }\n\n .Table_bui-TableCellIcon__3451e436bc,\n .Table_bui-TableCellIcon__3451e436bc svg {\n display: inline-flex;\n align-items: center;\n color: var(--bui-fg-primary);\n }\n\n .Table_bui-TableCellContent__3451e436bc {\n display: flex;\n flex-direction: column;\n gap: var(--bui-space-0_5);\n min-width: 0;\n flex: 1;\n overflow: hidden;\n max-width: 100%;\n }\n\n .Table_bui-TableCellContent__3451e436bc > * {\n min-width: 0;\n max-width: 100%;\n }\n\n .Table_bui-TableCellProfile__3451e436bc {\n display: flex;\n flex-direction: row;\n gap: var(--bui-space-2);\n align-items: center;\n }\n}\n";
|
|
4
|
+
var styles = {"bui-TableWrapper":"Table_bui-TableWrapper__3451e436bc","bui-TableResizableContainer":"Table_bui-TableResizableContainer__3451e436bc","bui-TableScrollContainer":"Table_bui-TableScrollContainer__3451e436bc","bui-Table":"Table_bui-Table__3451e436bc","bui-TableHeader":"Table_bui-TableHeader__3451e436bc","bui-TableHead":"Table_bui-TableHead__3451e436bc","bui-TableHeadSelection":"Table_bui-TableHeadSelection__3451e436bc","bui-TableHeadContent":"Table_bui-TableHeadContent__3451e436bc","bui-TableHeadLabel":"Table_bui-TableHeadLabel__3451e436bc","bui-TableHeadSortButton":"Table_bui-TableHeadSortButton__3451e436bc","bui-TableBody":"Table_bui-TableBody__3451e436bc","bui-TableRow":"Table_bui-TableRow__3451e436bc","bui-TableCell":"Table_bui-TableCell__3451e436bc","bui-TableCellSelection":"Table_bui-TableCellSelection__3451e436bc","bui-TableCellContentWrapper":"Table_bui-TableCellContentWrapper__3451e436bc","bui-TableCellIcon":"Table_bui-TableCellIcon__3451e436bc","bui-TableCellContent":"Table_bui-TableCellContent__3451e436bc","bui-TableCellProfile":"Table_bui-TableCellProfile__3451e436bc"};
|
|
5
5
|
styleInject(css_248z);
|
|
6
6
|
|
|
7
7
|
export { styles as default };
|