@backstage/ui 0.0.0-nightly-20251023023850 → 0.0.0-nightly-20251104024434

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.
Files changed (41) hide show
  1. package/CHANGELOG.md +178 -1
  2. package/dist/components/Avatar/Avatar.esm.js +38 -23
  3. package/dist/components/Avatar/Avatar.esm.js.map +1 -1
  4. package/dist/components/Avatar/Avatar.module.css.esm.js +1 -1
  5. package/dist/components/Checkbox/Checkbox.esm.js +16 -18
  6. package/dist/components/Checkbox/Checkbox.esm.js.map +1 -1
  7. package/dist/components/Checkbox/Checkbox.module.css.esm.js +2 -2
  8. package/dist/components/FieldLabel/FieldLabel.esm.js +10 -2
  9. package/dist/components/FieldLabel/FieldLabel.esm.js.map +1 -1
  10. package/dist/components/Header/Header.esm.js +11 -2
  11. package/dist/components/Header/Header.esm.js.map +1 -1
  12. package/dist/components/Header/HeaderToolbar.esm.js +9 -7
  13. package/dist/components/Header/HeaderToolbar.esm.js.map +1 -1
  14. package/dist/components/HeaderPage/HeaderPage.esm.js +56 -50
  15. package/dist/components/HeaderPage/HeaderPage.esm.js.map +1 -1
  16. package/dist/components/Link/Link.esm.js +11 -39
  17. package/dist/components/Link/Link.esm.js.map +1 -1
  18. package/dist/components/Link/Link.module.css.esm.js +3 -3
  19. package/dist/components/Menu/Menu.esm.js +46 -12
  20. package/dist/components/Menu/Menu.esm.js.map +1 -1
  21. package/dist/components/Skeleton/Skeleton.esm.js +2 -2
  22. package/dist/components/Skeleton/Skeleton.esm.js.map +1 -1
  23. package/dist/components/Switch/Switch.esm.js +2 -2
  24. package/dist/components/Switch/Switch.esm.js.map +1 -1
  25. package/dist/components/TablePagination/TablePagination.esm.js +3 -33
  26. package/dist/components/TablePagination/TablePagination.esm.js.map +1 -1
  27. package/dist/components/Tabs/Tabs.esm.js +9 -7
  28. package/dist/components/Tabs/Tabs.esm.js.map +1 -1
  29. package/dist/components/Text/Text.esm.js +3 -3
  30. package/dist/components/Text/Text.esm.js.map +1 -1
  31. package/dist/components/Text/Text.module.css.esm.js +2 -2
  32. package/dist/components/VisuallyHidden/VisuallyHidden.esm.js +19 -0
  33. package/dist/components/VisuallyHidden/VisuallyHidden.esm.js.map +1 -0
  34. package/dist/components/VisuallyHidden/VisuallyHidden.module.css.esm.js +8 -0
  35. package/dist/components/VisuallyHidden/VisuallyHidden.module.css.esm.js.map +1 -0
  36. package/dist/index.d.ts +61 -26
  37. package/dist/index.esm.js +1 -0
  38. package/dist/index.esm.js.map +1 -1
  39. package/dist/utils/componentDefinitions.esm.js +10 -4
  40. package/dist/utils/componentDefinitions.esm.js.map +1 -1
  41. package/package.json +5 -3
@@ -1,41 +1,11 @@
1
1
  import { jsxs, jsx } from 'react/jsx-runtime';
2
2
  import clsx from 'clsx';
3
- import '../Box/Box.esm.js';
4
- import '../Grid/Grid.esm.js';
5
- import '../Flex/Flex.esm.js';
6
- import '../Container/Container.esm.js';
7
- import '../Avatar/Avatar.esm.js';
8
- import '../Button/Button.esm.js';
9
- import '../Card/Card.esm.js';
10
- import '../Collapsible/Collapsible.esm.js';
11
- import '../Dialog/Dialog.esm.js';
12
- import '../FieldLabel/FieldLabel.esm.js';
13
- import 'react-aria-components';
14
3
  import { useStyles } from '../../hooks/useStyles.esm.js';
15
- import 'react';
16
- import { RiArrowLeftSLine, RiArrowRightSLine } from '@remixicon/react';
17
- import { Text } from '../Text/Text.esm.js';
18
- import 'react-router-dom';
19
- import '../Header/Header.module.css.esm.js';
20
- import '../Tabs/Tabs.esm.js';
21
- import '../Link/Link.esm.js';
22
- import '../HeaderPage/HeaderPage.module.css.esm.js';
23
- import { ButtonIcon } from '../ButtonIcon/ButtonIcon.esm.js';
24
- import '../ButtonLink/ButtonLink.esm.js';
25
- import '../Checkbox/Checkbox.esm.js';
26
- import '../RadioGroup/RadioGroup.esm.js';
27
- import '../Table/Table.module.css.esm.js';
28
- import '../Table/components/Cell.esm.js';
29
- import '@base-ui-components/react/avatar';
30
4
  import styles from './TablePagination.module.css.esm.js';
31
- import '../TagGroup/TagGroup.module.css.esm.js';
32
- import '../TextField/TextField.esm.js';
33
- import '../Tooltip/Tooltip.esm.js';
34
- import '../Menu/Menu.module.css.esm.js';
35
- import '../SearchField/SearchField.esm.js';
5
+ import { RiArrowLeftSLine, RiArrowRightSLine } from '@remixicon/react';
36
6
  import { Select } from '../Select/Select.esm.js';
37
- import '../Skeleton/Skeleton.module.css.esm.js';
38
- import '../Switch/Switch.esm.js';
7
+ import { ButtonIcon } from '../ButtonIcon/ButtonIcon.esm.js';
8
+ import { Text } from '../Text/Text.esm.js';
39
9
 
40
10
  function TablePagination(props) {
41
11
  const { classNames, cleanedProps } = useStyles("TablePagination", {
@@ -1 +1 @@
1
- {"version":3,"file":"TablePagination.esm.js","sources":["../../../src/components/TablePagination/TablePagination.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 clsx from 'clsx';\nimport { Text, ButtonIcon, Select } from '../..';\nimport type { TablePaginationProps } from './types';\nimport { useStyles } from '../../hooks/useStyles';\nimport styles from './TablePagination.module.css';\nimport { RiArrowLeftSLine, RiArrowRightSLine } from '@remixicon/react';\n\n/**\n * Pagination controls for Table components with page navigation and size selection.\n *\n * @public\n */\nexport function TablePagination(props: TablePaginationProps) {\n const { classNames, cleanedProps } = useStyles('TablePagination', {\n showPageSizeOptions: true,\n ...props,\n });\n const {\n className,\n offset,\n pageSize,\n rowCount,\n onNextPage,\n onPreviousPage,\n onPageSizeChange,\n setOffset,\n setPageSize,\n showPageSizeOptions,\n ...rest\n } = cleanedProps;\n\n const currentOffset = offset ?? 0;\n const currentPageSize = pageSize ?? 10;\n\n const fromCount = currentOffset + 1;\n const toCount = Math.min(currentOffset + currentPageSize, rowCount ?? 0);\n\n const nextPage = () => {\n const totalRows = rowCount ?? 0;\n const nextOffset = currentOffset + currentPageSize;\n\n // Check if there are more items to navigate to\n if (nextOffset < totalRows) {\n onNextPage?.(); // Analytics tracking\n setOffset?.(nextOffset); // Navigate to next page\n }\n };\n\n const previousPage = () => {\n // Check if we can go to previous page\n if (currentOffset > 0) {\n onPreviousPage?.(); // Analytics tracking\n const prevOffset = Math.max(0, currentOffset - currentPageSize);\n setOffset?.(prevOffset); // Navigate to previous page\n }\n };\n\n return (\n <div\n className={clsx(classNames.root, styles[classNames.root], className)}\n {...rest}\n >\n <div className={clsx(classNames.left, styles[classNames.left])}>\n {showPageSizeOptions && (\n <Select\n name=\"pageSize\"\n size=\"small\"\n placeholder=\"Show 10 results\"\n options={[\n { label: 'Show 5 results', value: '5' },\n { label: 'Show 10 results', value: '10' },\n { label: 'Show 20 results', value: '20' },\n { label: 'Show 30 results', value: '30' },\n { label: 'Show 40 results', value: '40' },\n { label: 'Show 50 results', value: '50' },\n ]}\n selectedKey={pageSize?.toString()}\n onSelectionChange={value => {\n const newPageSize = Number(value);\n setPageSize?.(newPageSize);\n onPageSizeChange?.(newPageSize);\n }}\n className={clsx(classNames.select, styles[classNames.select])}\n />\n )}\n </div>\n <div className={clsx(classNames.right, styles[classNames.right])}>\n <Text\n as=\"p\"\n variant=\"body-medium\"\n >{`${fromCount} - ${toCount} of ${rowCount}`}</Text>\n <ButtonIcon\n variant=\"secondary\"\n size=\"small\"\n onClick={previousPage}\n isDisabled={currentOffset === 0}\n icon={<RiArrowLeftSLine />}\n aria-label=\"Previous\"\n />\n <ButtonIcon\n variant=\"secondary\"\n size=\"small\"\n onClick={nextPage}\n isDisabled={\n rowCount !== undefined &&\n currentOffset + currentPageSize >= rowCount\n }\n icon={<RiArrowRightSLine />}\n a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AA,SAC9D,EAEJ,CAAA;AAAA,wBACA,IAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,IAAA,CAAK,UAAA,CAAW,OAAO,MAAA,CAAO,UAAA,CAAW,KAAK,CAAC,CAAA,EAC7D,QAAA,EAAA;AAAA,0BAAA,GAAA;AAAA,YAAC,IAAA;AAAA,YAAA;AAAA,cACC,EAAA,EAAG,GAAA;AAAA,cACH,OAAA,EAAQ,aAAA;AAAA,cACR,QAAA,EAAA,CAAA,EAAG,SAAS,CAAA,GAAA,EAAM,OAAO,OAAO,QAAQ,CAAA;AAAA;AAAA,WAAG;AAAA,0BAC7C,GAAA;AAAA,YAAC,UAAA;AAAA,YAAA;AAAA,cACC,OAAA,EAAQ,WAAA;AAAA,cACR,IAAA,EAAK,OAAA;AAAA,cACL,OAAA,EAAS,YAAA;AAAA,cACT,YAAY,aAAA,KAAkB,CAAA;AAAA,cAC9B,IAAA,sBAAO,gBAAA,EAAA,EAAiB,CAAA;AAAA,cACxB,YAAA,EAAW;AAAA;AAAA,WACb;AAAA,0BACA,GAAA;AAAA,YAAC,UAAA;AAAA,YAAA;AAAA,cACC,OAAA,EAAQ,WAAA;AAAA,cACR,IAAA,EAAK,OAAA;AAAA,cACL,OAAA,EAAS,QAAA;AAAA,cACT,UAAA,EACE,QAAA,KAAa,MAAA,IACb,aAAA,GAAgB,eAAA,IAAmB,QAAA;AAAA,cAErC,IAAA,sBAAO,iBAAA,EAAA,EAAkB,CAAA;AAAA,cACzB,YAAA,EAAW;AAAA;AAAA;AACb,SAAA,EACF;AAAA;AAAA;AAAA,GACF;AAEJ;;;;"}
1
+ {"version":3,"file":"TablePagination.esm.js","sources":["../../../src/components/TablePagination/TablePagination.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 clsx from 'clsx';\nimport { Text, ButtonIcon, Select } from '../..';\nimport type { TablePaginationProps } from './types';\nimport { useStyles } from '../../hooks/useStyles';\nimport styles from './TablePagination.module.css';\nimport { RiArrowLeftSLine, RiArrowRightSLine } from '@remixicon/react';\n\n/**\n * Pagination controls for Table components with page navigation and size selection.\n *\n * @public\n */\nexport function TablePagination(props: TablePaginationProps) {\n const { classNames, cleanedProps } = useStyles('TablePagination', {\n showPageSizeOptions: true,\n ...props,\n });\n const {\n className,\n offset,\n pageSize,\n rowCount,\n onNextPage,\n onPreviousPage,\n onPageSizeChange,\n setOffset,\n setPageSize,\n showPageSizeOptions,\n ...rest\n } = cleanedProps;\n\n const currentOffset = offset ?? 0;\n const currentPageSize = pageSize ?? 10;\n\n const fromCount = currentOffset + 1;\n const toCount = Math.min(currentOffset + currentPageSize, rowCount ?? 0);\n\n const nextPage = () => {\n const totalRows = rowCount ?? 0;\n const nextOffset = currentOffset + currentPageSize;\n\n // Check if there are more items to navigate to\n if (nextOffset < totalRows) {\n onNextPage?.(); // Analytics tracking\n setOffset?.(nextOffset); // Navigate to next page\n }\n };\n\n const previousPage = () => {\n // Check if we can go to previous page\n if (currentOffset > 0) {\n onPreviousPage?.(); // Analytics tracking\n const prevOffset = Math.max(0, currentOffset - currentPageSize);\n setOffset?.(prevOffset); // Navigate to previous page\n }\n };\n\n return (\n <div\n className={clsx(classNames.root, styles[classNames.root], className)}\n {...rest}\n >\n <div className={clsx(classNames.left, styles[classNames.left])}>\n {showPageSizeOptions && (\n <Select\n name=\"pageSize\"\n size=\"small\"\n placeholder=\"Show 10 results\"\n options={[\n { label: 'Show 5 results', value: '5' },\n { label: 'Show 10 results', value: '10' },\n { label: 'Show 20 results', value: '20' },\n { label: 'Show 30 results', value: '30' },\n { label: 'Show 40 results', value: '40' },\n { label: 'Show 50 results', value: '50' },\n ]}\n selectedKey={pageSize?.toString()}\n onSelectionChange={value => {\n const newPageSize = Number(value);\n setPageSize?.(newPageSize);\n onPageSizeChange?.(newPageSize);\n }}\n className={clsx(classNames.select, styles[classNames.select])}\n />\n )}\n </div>\n <div className={clsx(classNames.right, styles[classNames.right])}>\n <Text\n as=\"p\"\n variant=\"body-medium\"\n >{`${fromCount} - ${toCount} of ${rowCount}`}</Text>\n <ButtonIcon\n variant=\"secondary\"\n size=\"small\"\n onClick={previousPage}\n isDisabled={currentOffset === 0}\n icon={<RiArrowLeftSLine />}\n aria-label=\"Previous\"\n />\n <ButtonIcon\n variant=\"secondary\"\n size=\"small\"\n onClick={nextPage}\n isDisabled={\n rowCount !== undefined &&\n currentOffset + currentPageSize >= rowCount\n }\n icon={<RiArrowRightSLine />}\n aria-label=\"Next\"\n />\n </div>\n </div>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;AA4BO,SAAS,gBAAgB,KAAA,EAA6B;AAC3D,EAAA,MAAM,EAAE,UAAA,EAAY,YAAA,EAAa,GAAI,UAAU,iBAAA,EAAmB;AAAA,IAChE,mBAAA,EAAqB,IAAA;AAAA,IACrB,GAAG;AAAA,GACJ,CAAA;AACD,EAAA,MAAM;AAAA,IACJ,SAAA;AAAA,IACA,MAAA;AAAA,IACA,QAAA;AAAA,IACA,QAAA;AAAA,IACA,UAAA;AAAA,IACA,cAAA;AAAA,IACA,gBAAA;AAAA,IACA,SAAA;AAAA,IACA,WAAA;AAAA,IACA,mBAAA;AAAA,IACA,GAAG;AAAA,GACL,GAAI,YAAA;AAEJ,EAAA,MAAM,gBAAgB,MAAA,IAAU,CAAA;AAChC,EAAA,MAAM,kBAAkB,QAAA,IAAY,EAAA;AAEpC,EAAA,MAAM,YAAY,aAAA,GAAgB,CAAA;AAClC,EAAA,MAAM,UAAU,IAAA,CAAK,GAAA,CAAI,aAAA,GAAgB,eAAA,EAAiB,YAAY,CAAC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AAAA,cACR,IAAA,EAAK,OAAA;AAAA,cACL,OAAA,EAAS,QAAA;AAAA,cACT,UAAA,EACE,QAAA,KAAa,MAAA,IACb,aAAA,GAAgB,eAAA,IAAmB,QAAA;AAAA,cAErC,IAAA,sBAAO,iBAAA,EAAA,EAAkB,CAAA;AAAA,cACzB,YAAA,EAAW;AAAA;AAAA;AACb,SAAA,EACF;AAAA;AAAA;AAAA,GACF;AAEJ;;;;"}
@@ -26,7 +26,7 @@ const isTabActive = (tabHref, currentPathname, matchStrategy) => {
26
26
  };
27
27
  const Tabs = (props) => {
28
28
  const { classNames, cleanedProps } = useStyles("Tabs", props);
29
- const { children, ...rest } = cleanedProps;
29
+ const { className, children, ...rest } = cleanedProps;
30
30
  const tabsRef = useRef(null);
31
31
  const tabRefs = useRef(/* @__PURE__ */ new Map());
32
32
  const [hoveredKey, setHoveredKey] = useState(null);
@@ -77,7 +77,7 @@ const Tabs = (props) => {
77
77
  return /* @__PURE__ */ jsx(TabsContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(RouterProvider, { navigate, useHref, children: /* @__PURE__ */ jsx(
78
78
  Tabs$1,
79
79
  {
80
- className: clsx(classNames.tabs, styles[classNames.tabs]),
80
+ className: clsx(classNames.tabs, styles[classNames.tabs], className),
81
81
  keyboardActivation: "manual",
82
82
  selectedKey: computedSelectedKey,
83
83
  ref: tabsRef,
@@ -88,7 +88,7 @@ const Tabs = (props) => {
88
88
  };
89
89
  const TabList = (props) => {
90
90
  const { classNames, cleanedProps } = useStyles("Tabs", props);
91
- const { children, ...rest } = cleanedProps;
91
+ const { className, children, ...rest } = cleanedProps;
92
92
  const { setHoveredKey, tabRefs, tabsRef, hoveredKey, prevHoveredKey } = useTabsContext();
93
93
  const handleHover = (key) => {
94
94
  setHoveredKey(key);
@@ -107,7 +107,8 @@ const TabList = (props) => {
107
107
  {
108
108
  className: clsx(
109
109
  classNames.tabListWrapper,
110
- styles[classNames.tabListWrapper]
110
+ styles[classNames.tabListWrapper],
111
+ className
111
112
  ),
112
113
  children: [
113
114
  /* @__PURE__ */ jsx(
@@ -135,6 +136,7 @@ const TabList = (props) => {
135
136
  const Tab = (props) => {
136
137
  const { classNames, cleanedProps } = useStyles("Tabs", props);
137
138
  const {
139
+ className,
138
140
  href,
139
141
  children,
140
142
  id,
@@ -146,7 +148,7 @@ const Tab = (props) => {
146
148
  Tab$1,
147
149
  {
148
150
  id,
149
- className: clsx(classNames.tab, styles[classNames.tab]),
151
+ className: clsx(classNames.tab, styles[classNames.tab], className),
150
152
  ref: (el) => setTabRef(id, el),
151
153
  href,
152
154
  ...rest,
@@ -156,11 +158,11 @@ const Tab = (props) => {
156
158
  };
157
159
  const TabPanel = (props) => {
158
160
  const { classNames, cleanedProps } = useStyles("Tabs", props);
159
- const { children, ...rest } = cleanedProps;
161
+ const { className, children, ...rest } = cleanedProps;
160
162
  return /* @__PURE__ */ jsx(
161
163
  TabPanel$1,
162
164
  {
163
- className: clsx(classNames.panel, styles[classNames.panel]),
165
+ className: clsx(classNames.panel, styles[classNames.panel], className),
164
166
  ...rest,
165
167
  children
166
168
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Tabs.esm.js","sources":["../../../src/components/Tabs/Tabs.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 {\n useRef,\n useState,\n Children,\n cloneElement,\n isValidElement,\n ReactNode,\n createContext,\n useContext,\n} from 'react';\nimport type {\n TabsProps,\n TabListProps,\n TabPanelProps,\n TabsContextValue,\n TabProps,\n} from './types';\nimport { useLocation, useNavigate, useHref } from 'react-router-dom';\nimport { TabsIndicators } from './TabsIndicators';\nimport {\n Tabs as AriaTabs,\n TabList as AriaTabList,\n Tab as AriaTab,\n TabPanel as AriaTabPanel,\n RouterProvider,\n TabProps as AriaTabProps,\n} from 'react-aria-components';\nimport { useStyles } from '../../hooks/useStyles';\nimport styles from './Tabs.module.css';\nimport clsx from 'clsx';\n\nconst TabsContext = createContext<TabsContextValue | undefined>(undefined);\n\nconst useTabsContext = () => {\n const context = useContext(TabsContext);\n if (!context) {\n throw new Error('Tab components must be used within a Tabs component');\n }\n return context;\n};\n\n/**\n * Utility function to determine if a tab should be active based on the matching strategy.\n * This follows the pattern used in WorkaroundNavLink from the sidebar.\n */\nconst isTabActive = (\n tabHref: string,\n currentPathname: string,\n matchStrategy: 'exact' | 'prefix',\n): boolean => {\n if (matchStrategy === 'exact') {\n return tabHref === currentPathname;\n }\n\n // Prefix matching - similar to WorkaroundNavLink behavior\n if (tabHref === currentPathname) {\n return true;\n }\n\n // Check if current path starts with tab href followed by a slash\n // This prevents /foo matching /foobar\n return currentPathname.startsWith(`${tabHref}/`);\n};\n\n/**\n * A component that renders a list of tabs.\n *\n * @public\n */\nexport const Tabs = (props: TabsProps) => {\n const { classNames, cleanedProps } = useStyles('Tabs', props);\n const { children, ...rest } = cleanedProps;\n const tabsRef = useRef<HTMLDivElement>(null);\n const tabRefs = useRef<Map<string, HTMLDivElement>>(new Map());\n const [hoveredKey, setHoveredKey] = useState<string | null>(null);\n const prevHoveredKey = useRef<string | null>(null);\n let navigate = useNavigate();\n const location = useLocation();\n\n const setTabRef = (key: string, element: HTMLDivElement | null) => {\n if (element) {\n tabRefs.current.set(key, element);\n } else {\n tabRefs.current.delete(key);\n }\n };\n\n // If selectedKey is not provided, try to determine it from the current route\n const computedSelectedKey = (() => {\n const childrenArray = Children.toArray(children as ReactNode);\n for (const child of childrenArray) {\n if (isValidElement(child) && child.type === TabList) {\n const tabListChildren = Children.toArray(child.props.children);\n for (const tabChild of tabListChildren) {\n if (isValidElement(tabChild) && tabChild.props.href) {\n // Use tab-specific strategy, defaulting to 'exact'\n const strategy = tabChild.props.matchStrategy || 'exact';\n if (isTabActive(tabChild.props.href, location.pathname, strategy)) {\n return tabChild.props.id;\n }\n }\n }\n\n //No route matches - check if all tabs have hrefs (pure navigation)\n const allTabsHaveHref = tabListChildren.every(\n child => isValidElement(child) && child.props.href,\n );\n\n if (allTabsHaveHref) {\n // Pure navigation tabs, no route match\n return null;\n } else {\n // Mixed tabs or pure local state\n return undefined;\n }\n }\n }\n return undefined;\n })();\n\n if (!children) return null;\n\n const contextValue: TabsContextValue = {\n tabsRef,\n tabRefs,\n hoveredKey,\n prevHoveredKey,\n setHoveredKey,\n setTabRef,\n };\n\n return (\n <TabsContext.Provider value={contextValue}>\n <RouterProvider navigate={navigate} useHref={useHref}>\n <AriaTabs\n className={clsx(classNames.tabs, styles[classNames.tabs])}\n keyboardActivation=\"manual\"\n selectedKey={computedSelectedKey}\n ref={tabsRef}\n {...rest}\n >\n {children as ReactNode}\n </AriaTabs>\n </RouterProvider>\n </TabsContext.Provider>\n );\n};\n\n/**\n * A component that renders a list of tabs.\n *\n * @public\n */\nexport const TabList = (props: TabListProps) => {\n const { classNames, cleanedProps } = useStyles('Tabs', props);\n const { children, ...rest } = cleanedProps;\n const { setHoveredKey, tabRefs, tabsRef, hoveredKey, prevHoveredKey } =\n useTabsContext();\n\n const handleHover = (key: string | null) => {\n setHoveredKey(key);\n };\n\n // Clone children with additional props for hover and ref management\n const enhancedChildren = Children.map(children as ReactNode, child => {\n if (isValidElement(child)) {\n return cloneElement(child, {\n onHoverStart: () => handleHover(child.props.id as string),\n onHoverEnd: () => handleHover(null),\n } as Partial<AriaTabProps>);\n }\n return child;\n });\n\n return (\n <div\n className={clsx(\n classNames.tabListWrapper,\n styles[classNames.tabListWrapper],\n )}\n >\n <AriaTabList\n className={clsx(classNames.tabList, styles[classNames.tabList])}\n aria-label=\"Toolbar tabs\"\n {...rest}\n >\n {enhancedChildren}\n </AriaTabList>\n <TabsIndicators\n tabRefs={tabRefs}\n tabsRef={tabsRef}\n hoveredKey={hoveredKey}\n prevHoveredKey={prevHoveredKey}\n />\n </div>\n );\n};\n\n/**\n * A component that renders a tab.\n *\n * @public\n */\nexport const Tab = (props: TabProps) => {\n const { classNames, cleanedProps } = useStyles('Tabs', props);\n const {\n href,\n children,\n id,\n matchStrategy: _matchStrategy,\n ...rest\n } = cleanedProps;\n const { setTabRef } = useTabsContext();\n\n return (\n <AriaTab\n id={id}\n className={clsx(classNames.tab, styles[classNames.tab])}\n ref={el => setTabRef(id as string, el as HTMLDivElement)}\n href={href}\n {...rest}\n >\n {children}\n </AriaTab>\n );\n};\n\n/**\n * A component that renders the content of a tab.\n *\n * @public\n */\nexport const TabPanel = (props: TabPanelProps) => {\n const { classNames, cleanedProps } = useStyles('Tabs', props);\n const { children, ...rest } = cleanedProps;\n\n return (\n <AriaTabPanel\n className={clsx(classNames.panel, styles[classNames.panel])}\n {...rest}\n >\n {children}\n </AriaTabPanel>\n );\n};\n"],"names":["child","AriaTabs","AriaTabList","AriaTab","AriaTabPanel"],"mappings":";;;;;;;;;AA+CA,MAAM,WAAA,GAAc,cAA4C,MAAS,CAAA;AAEzE,MAAM,iBAAiB,MAAM;AAC3B,EAAA,MAAM,OAAA,GAAU,WAAW,WAAW,CAAA;AACtC,EAAA,IAAI,CAAC,OAAA,EAAS;AACZ,IAAA,MAAM,IAAI,MAAM,qDAAqD,CAAA;AAAA,EACvE;AACA,EAAA,OAAO,OAAA;AACT,CAAA;AAMA,MAAM,WAAA,GAAc,CAClB,OAAA,EACA,eAAA,EACA,aAAA,KACY;AACZ,EAAA,IAAI,kBAAkB,OAAA,EAAS;AAC7B,IAAA,OAAO,OAAA,KAAY,eAAA;AAAA,EACrB;AAGA,EAAA,IAAI,YAAY,eAAA,EAAiB;AAC/B,IAAA,OAAO,IAAA;AAAA,EACT;AAIA,EAAA,OAAO,eAAA,CAAgB,UAAA,CAAW,CAAA,EAAG,OAAO,CAA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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 useRef,\n useState,\n Children,\n cloneElement,\n isValidElement,\n ReactNode,\n createContext,\n useContext,\n} from 'react';\nimport type {\n TabsProps,\n TabListProps,\n TabPanelProps,\n TabsContextValue,\n TabProps,\n} from './types';\nimport { useLocation, useNavigate, useHref } from 'react-router-dom';\nimport { TabsIndicators } from './TabsIndicators';\nimport {\n Tabs as AriaTabs,\n TabList as AriaTabList,\n Tab as AriaTab,\n TabPanel as AriaTabPanel,\n RouterProvider,\n TabProps as AriaTabProps,\n} from 'react-aria-components';\nimport { useStyles } from '../../hooks/useStyles';\nimport styles from './Tabs.module.css';\nimport clsx from 'clsx';\n\nconst TabsContext = createContext<TabsContextValue | undefined>(undefined);\n\nconst useTabsContext = () => {\n const context = useContext(TabsContext);\n if (!context) {\n throw new Error('Tab components must be used within a Tabs component');\n }\n return context;\n};\n\n/**\n * Utility function to determine if a tab should be active based on the matching strategy.\n * This follows the pattern used in WorkaroundNavLink from the sidebar.\n */\nconst isTabActive = (\n tabHref: string,\n currentPathname: string,\n matchStrategy: 'exact' | 'prefix',\n): boolean => {\n if (matchStrategy === 'exact') {\n return tabHref === currentPathname;\n }\n\n // Prefix matching - similar to WorkaroundNavLink behavior\n if (tabHref === currentPathname) {\n return true;\n }\n\n // Check if current path starts with tab href followed by a slash\n // This prevents /foo matching /foobar\n return currentPathname.startsWith(`${tabHref}/`);\n};\n\n/**\n * A component that renders a list of tabs.\n *\n * @public\n */\nexport const Tabs = (props: TabsProps) => {\n const { classNames, cleanedProps } = useStyles('Tabs', props);\n const { className, children, ...rest } = cleanedProps;\n const tabsRef = useRef<HTMLDivElement>(null);\n const tabRefs = useRef<Map<string, HTMLDivElement>>(new Map());\n const [hoveredKey, setHoveredKey] = useState<string | null>(null);\n const prevHoveredKey = useRef<string | null>(null);\n let navigate = useNavigate();\n const location = useLocation();\n\n const setTabRef = (key: string, element: HTMLDivElement | null) => {\n if (element) {\n tabRefs.current.set(key, element);\n } else {\n tabRefs.current.delete(key);\n }\n };\n\n // If selectedKey is not provided, try to determine it from the current route\n const computedSelectedKey = (() => {\n const childrenArray = Children.toArray(children as ReactNode);\n for (const child of childrenArray) {\n if (isValidElement(child) && child.type === TabList) {\n const tabListChildren = Children.toArray(child.props.children);\n for (const tabChild of tabListChildren) {\n if (isValidElement(tabChild) && tabChild.props.href) {\n // Use tab-specific strategy, defaulting to 'exact'\n const strategy = tabChild.props.matchStrategy || 'exact';\n if (isTabActive(tabChild.props.href, location.pathname, strategy)) {\n return tabChild.props.id;\n }\n }\n }\n\n //No route matches - check if all tabs have hrefs (pure navigation)\n const allTabsHaveHref = tabListChildren.every(\n child => isValidElement(child) && child.props.href,\n );\n\n if (allTabsHaveHref) {\n // Pure navigation tabs, no route match\n return null;\n } else {\n // Mixed tabs or pure local state\n return undefined;\n }\n }\n }\n return undefined;\n })();\n\n if (!children) return null;\n\n const contextValue: TabsContextValue = {\n tabsRef,\n tabRefs,\n hoveredKey,\n prevHoveredKey,\n setHoveredKey,\n setTabRef,\n };\n\n return (\n <TabsContext.Provider value={contextValue}>\n <RouterProvider navigate={navigate} useHref={useHref}>\n <AriaTabs\n className={clsx(classNames.tabs, styles[classNames.tabs], className)}\n keyboardActivation=\"manual\"\n selectedKey={computedSelectedKey}\n ref={tabsRef}\n {...rest}\n >\n {children as ReactNode}\n </AriaTabs>\n </RouterProvider>\n </TabsContext.Provider>\n );\n};\n\n/**\n * A component that renders a list of tabs.\n *\n * @public\n */\nexport const TabList = (props: TabListProps) => {\n const { classNames, cleanedProps } = useStyles('Tabs', props);\n const { className, children, ...rest } = cleanedProps;\n const { setHoveredKey, tabRefs, tabsRef, hoveredKey, prevHoveredKey } =\n useTabsContext();\n\n const handleHover = (key: string | null) => {\n setHoveredKey(key);\n };\n\n // Clone children with additional props for hover and ref management\n const enhancedChildren = Children.map(children as ReactNode, child => {\n if (isValidElement(child)) {\n return cloneElement(child, {\n onHoverStart: () => handleHover(child.props.id as string),\n onHoverEnd: () => handleHover(null),\n } as Partial<AriaTabProps>);\n }\n return child;\n });\n\n return (\n <div\n className={clsx(\n classNames.tabListWrapper,\n styles[classNames.tabListWrapper],\n className,\n )}\n >\n <AriaTabList\n className={clsx(classNames.tabList, styles[classNames.tabList])}\n aria-label=\"Toolbar tabs\"\n {...rest}\n >\n {enhancedChildren}\n </AriaTabList>\n <TabsIndicators\n tabRefs={tabRefs}\n tabsRef={tabsRef}\n hoveredKey={hoveredKey}\n prevHoveredKey={prevHoveredKey}\n />\n </div>\n );\n};\n\n/**\n * A component that renders a tab.\n *\n * @public\n */\nexport const Tab = (props: TabProps) => {\n const { classNames, cleanedProps } = useStyles('Tabs', props);\n const {\n className,\n href,\n children,\n id,\n matchStrategy: _matchStrategy,\n ...rest\n } = cleanedProps;\n const { setTabRef } = useTabsContext();\n\n return (\n <AriaTab\n id={id}\n className={clsx(classNames.tab, styles[classNames.tab], className)}\n ref={el => setTabRef(id as string, el as HTMLDivElement)}\n href={href}\n {...rest}\n >\n {children}\n </AriaTab>\n );\n};\n\n/**\n * A component that renders the content of a tab.\n *\n * @public\n */\nexport const TabPanel = (props: TabPanelProps) => {\n const { classNames, cleanedProps } = useStyles('Tabs', props);\n const { className, children, ...rest } = cleanedProps;\n\n return (\n <AriaTabPanel\n className={clsx(classNames.panel, styles[classNames.panel], className)}\n {...rest}\n >\n {children}\n </AriaTabPanel>\n );\n};\n"],"names":["child","AriaTabs","AriaTabList","AriaTab","AriaTabPanel"],"mappings":";;;;;;;;;AA+CA,MAAM,WAAA,GAAc,cAA4C,MAAS,CAAA;AAEzE,MAAM,iBAAiB,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AEH;AAAA;AAAA,GACH;AAEJ;AAOO,MAAM,QAAA,GAAW,CAAC,KAAA,KAAyB;AAChD,EAAA,MAAM,EAAE,UAAA,EAAY,YAAA,EAAa,GAAI,SAAA,CAAU,QAAQ,KAAK,CAAA;AAC5D,EAAA,MAAM,EAAE,SAAA,EAAW,QAAA,EAAU,GAAG,MAAK,GAAI,YAAA;AAEzC,EAAA,uBACE,GAAA;AAAA,IAACC,UAAA;AAAA,IAAA;AAAA,MACC,SAAA,EAAW,KAAK,UAAA,CAAW,KAAA,EAAO,OAAO,UAAA,CAAW,KAAK,GAAG,SAAS,CAAA;AAAA,MACpE,GAAG,IAAA;AAAA,MAEH;AAAA;AAAA,GACH;AAEJ;;;;"}
@@ -2,7 +2,7 @@ import { jsx } from 'react/jsx-runtime';
2
2
  import { forwardRef } from 'react';
3
3
  import clsx from 'clsx';
4
4
  import { useStyles } from '../../hooks/useStyles.esm.js';
5
- import stylesText from './Text.module.css.esm.js';
5
+ import styles from './Text.module.css.esm.js';
6
6
 
7
7
  function TextComponent(props, ref) {
8
8
  const Component = props.as || "span";
@@ -12,12 +12,12 @@ function TextComponent(props, ref) {
12
12
  color: "primary",
13
13
  ...props
14
14
  });
15
- const { className, ...restProps } = cleanedProps;
15
+ const { className, truncate, ...restProps } = cleanedProps;
16
16
  return /* @__PURE__ */ jsx(
17
17
  Component,
18
18
  {
19
19
  ref,
20
- className: clsx(classNames.root, stylesText[classNames.root], className),
20
+ className: clsx(classNames.root, styles[classNames.root], className),
21
21
  ...dataAttributes,
22
22
  ...restProps
23
23
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Text.esm.js","sources":["../../../src/components/Text/Text.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 } from 'react';\nimport clsx from 'clsx';\nimport type { ElementType } from 'react';\nimport type { TextProps } from './types';\nimport { useStyles } from '../../hooks/useStyles';\nimport styles from './Text.module.css';\n\nfunction TextComponent<T extends ElementType = 'span'>(\n props: TextProps<T>,\n ref: React.Ref<any>,\n) {\n const Component = props.as || 'span';\n\n const { classNames, dataAttributes, cleanedProps } = useStyles('Text', {\n variant: 'body-medium',\n weight: 'regular',\n color: 'primary',\n ...props,\n });\n\n const { className, ...restProps } = cleanedProps;\n\n return (\n <Component\n ref={ref}\n className={clsx(classNames.root, styles[classNames.root], className)}\n {...dataAttributes}\n {...restProps}\n />\n );\n}\n\nTextComponent.displayName = 'Text';\n\n/** @public */\nexport const Text = forwardRef(TextComponent) as {\n <T extends ElementType = 'p'>(\n props: TextProps<T> & { ref?: React.ComponentPropsWithRef<T>['ref'] },\n ): React.ReactElement<TextProps<T>, T>;\n displayName: string;\n};\n\nText.displayName = 'Text';\n"],"names":["styles"],"mappings":";;;;;;AAuBA,SAAS,aAAA,CACP,OACA,GAAA,EACA;AACA,EAAA,MAAM,SAAA,GAAY,MAAM,EAAA,IAAM,MAAA;AAE9B,EAAA,MAAM,EAAE,UAAA,EAAY,cAAA,EAAgB,YAAA,EAAa,GAAI,UAAU,MAAA,EAAQ;AAAA,IACrE,OAAA,EAAS,aAAA;AAAA,IACT,MAAA,EAAQ,SAAA;AAAA,IACR,KAAA,EAAO,SAAA;AAAA,IACP,GAAG;AAAA,GACJ,CAAA;AAED,EAAA,MAAM,EAAE,SAAA,EAAW,GAAG,SAAA,EAAU,GAAI,YAAA;AAEpC,EAAA,uBACE,GAAA;AAAA,IAAC,SAAA;AAAA,IAAA;AAAA,MACC,GAAA;AAAA,MACA,SAAA,EAAW,KAAK,UAAA,CAAW,IAAA,EAAMA,WAAO,UAAA,CAAW,IAAI,GAAG,SAAS,CAAA;AAAA,MAClE,GAAG,cAAA;AAAA,MACH,GAAG;AAAA;AAAA,GACN;AAEJ;AAEA,aAAA,CAAc,WAAA,GAAc,MAAA;AAGrB,MAAM,IAAA,GAAO,WAAW,aAAa;AAO5C,IAAA,CAAK,WAAA,GAAc,MAAA;;;;"}
1
+ {"version":3,"file":"Text.esm.js","sources":["../../../src/components/Text/Text.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 } from 'react';\nimport clsx from 'clsx';\nimport type { ElementType } from 'react';\nimport type { TextProps } from './types';\nimport { useStyles } from '../../hooks/useStyles';\nimport styles from './Text.module.css';\n\nfunction TextComponent<T extends ElementType = 'span'>(\n props: TextProps<T>,\n ref: React.Ref<any>,\n) {\n const Component = props.as || 'span';\n\n const { classNames, dataAttributes, cleanedProps } = useStyles('Text', {\n variant: 'body-medium',\n weight: 'regular',\n color: 'primary',\n ...props,\n });\n\n const { className, truncate, ...restProps } = cleanedProps;\n\n return (\n <Component\n ref={ref}\n className={clsx(classNames.root, styles[classNames.root], className)}\n {...dataAttributes}\n {...restProps}\n />\n );\n}\n\nTextComponent.displayName = 'Text';\n\n/** @public */\nexport const Text = forwardRef(TextComponent) as {\n <T extends ElementType = 'p'>(\n props: TextProps<T> & { ref?: React.ComponentPropsWithRef<T>['ref'] },\n ): React.ReactElement<TextProps<T>, T>;\n displayName: string;\n};\n\nText.displayName = 'Text';\n"],"names":[],"mappings":";;;;;;AAuBA,SAAS,aAAA,CACP,OACA,GAAA,EACA;AACA,EAAA,MAAM,SAAA,GAAY,MAAM,EAAA,IAAM,MAAA;AAE9B,EAAA,MAAM,EAAE,UAAA,EAAY,cAAA,EAAgB,YAAA,EAAa,GAAI,UAAU,MAAA,EAAQ;AAAA,IACrE,OAAA,EAAS,aAAA;AAAA,IACT,MAAA,EAAQ,SAAA;AAAA,IACR,KAAA,EAAO,SAAA;AAAA,IACP,GAAG;AAAA,GACJ,CAAA;AAED,EAAA,MAAM,EAAE,SAAA,EAAW,QAAA,EAAU,GAAG,WAAU,GAAI,YAAA;AAE9C,EAAA,uBACE,GAAA;AAAA,IAAC,SAAA;AAAA,IAAA;AAAA,MACC,GAAA;AAAA,MACA,SAAA,EAAW,KAAK,UAAA,CAAW,IAAA,EAAM,OAAO,UAAA,CAAW,IAAI,GAAG,SAAS,CAAA;AAAA,MAClE,GAAG,cAAA;AAAA,MACH,GAAG;AAAA;AAAA,GACN;AAEJ;AAEA,aAAA,CAAc,WAAA,GAAc,MAAA;AAGrB,MAAM,IAAA,GAAO,WAAW,aAAa;AAO5C,IAAA,CAAK,WAAA,GAAc,MAAA;;;;"}
@@ -1,8 +1,8 @@
1
1
  import styleInject from '../../node_modules_dist/style-inject/dist/style-inject.es.esm.js';
2
2
 
3
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 .Text-module_bui-Text__7NvCl {\n font-family: var(--bui-font-regular);\n padding: 0;\n margin: 0;\n }\n\n .Text-module_bui-Text__7NvCl[data-variant='title-large'] {\n font-size: var(--bui-font-size-8);\n line-height: 140%;\n }\n\n .Text-module_bui-Text__7NvCl[data-variant='title-medium'] {\n font-size: var(--bui-font-size-7);\n line-height: 140%;\n }\n\n .Text-module_bui-Text__7NvCl[data-variant='title-small'] {\n font-size: var(--bui-font-size-6);\n line-height: 140%;\n }\n\n .Text-module_bui-Text__7NvCl[data-variant='title-x-small'] {\n font-size: var(--bui-font-size-5);\n line-height: 140%;\n }\n\n .Text-module_bui-Text__7NvCl[data-variant='body-large'] {\n font-size: var(--bui-font-size-4);\n line-height: 140%;\n }\n\n .Text-module_bui-Text__7NvCl[data-variant='body-medium'] {\n font-size: var(--bui-font-size-3);\n line-height: 140%;\n }\n\n .Text-module_bui-Text__7NvCl[data-variant='body-small'] {\n font-size: var(--bui-font-size-2);\n line-height: 140%;\n }\n\n .Text-module_bui-Text__7NvCl[data-variant='body-x-small'] {\n font-size: var(--bui-font-size-1);\n line-height: 140%;\n }\n\n .Text-module_bui-Text__7NvCl[data-weight='regular'] {\n font-weight: var(--bui-font-weight-regular);\n }\n\n .Text-module_bui-Text__7NvCl[data-weight='bold'] {\n font-weight: var(--bui-font-weight-bold);\n }\n\n .Text-module_bui-Text__7NvCl[data-color='primary'] {\n color: var(--bui-fg-primary);\n }\n\n .Text-module_bui-Text__7NvCl[data-color='secondary'] {\n color: var(--bui-fg-secondary);\n }\n\n .Text-module_bui-Text__7NvCl[data-color='danger'] {\n color: var(--bui-fg-danger);\n }\n\n .Text-module_bui-Text__7NvCl[data-color='warning'] {\n color: var(--bui-fg-warning);\n }\n\n .Text-module_bui-Text__7NvCl[data-color='success'] {\n color: var(--bui-fg-success);\n }\n\n .Text-module_bui-Text__7NvCl[data-truncate] {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n .Text-module_bui-Text__7NvCl[data-as='span'],\n .Text-module_bui-Text__7NvCl[data-as='label'],\n .Text-module_bui-Text__7NvCl[data-as='strong'],\n .Text-module_bui-Text__7NvCl[data-as='em'],\n .Text-module_bui-Text__7NvCl[data-as='small'] {\n display: inline-block;\n }\n}\n";
4
- var stylesText = {"bui-Text":"Text-module_bui-Text__7NvCl"};
4
+ var styles = {"bui-Text":"Text-module_bui-Text__7NvCl"};
5
5
  styleInject(css_248z);
6
6
 
7
- export { stylesText as default };
7
+ export { styles as default };
8
8
  //# sourceMappingURL=Text.module.css.esm.js.map
@@ -0,0 +1,19 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { useStyles } from '../../hooks/useStyles.esm.js';
3
+ import styles from './VisuallyHidden.module.css.esm.js';
4
+ import clsx from 'clsx';
5
+
6
+ const VisuallyHidden = (props) => {
7
+ const { classNames, cleanedProps } = useStyles("VisuallyHidden", props);
8
+ const { className, ...rest } = cleanedProps;
9
+ return /* @__PURE__ */ jsx(
10
+ "div",
11
+ {
12
+ className: clsx(classNames.root, styles[classNames.root], className),
13
+ ...rest
14
+ }
15
+ );
16
+ };
17
+
18
+ export { VisuallyHidden };
19
+ //# sourceMappingURL=VisuallyHidden.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VisuallyHidden.esm.js","sources":["../../../src/components/VisuallyHidden/VisuallyHidden.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 { useStyles } from '../../hooks/useStyles';\nimport { VisuallyHiddenProps } from './types';\nimport styles from './VisuallyHidden.module.css';\nimport clsx from 'clsx';\n\n/**\n * Visually hides content while keeping it accessible to screen readers.\n * Useful for descriptive labels and other screen-reader-only content.\n *\n * Note: This component is for content that should ALWAYS remain visually hidden.\n * For skip links that become visible on focus, use a different approach.\n *\n * @public\n */\nexport const VisuallyHidden = (props: VisuallyHiddenProps) => {\n const { classNames, cleanedProps } = useStyles('VisuallyHidden', props);\n const { className, ...rest } = cleanedProps;\n\n return (\n <div\n className={clsx(classNames.root, styles[classNames.root], className)}\n {...rest}\n />\n );\n};\n"],"names":[],"mappings":";;;;;AA8BO,MAAM,cAAA,GAAiB,CAAC,KAAA,KAA+B;AAC5D,EAAA,MAAM,EAAE,UAAA,EAAY,YAAA,EAAa,GAAI,SAAA,CAAU,kBAAkB,KAAK,CAAA;AACtE,EAAA,MAAM,EAAE,SAAA,EAAW,GAAG,IAAA,EAAK,GAAI,YAAA;AAE/B,EAAA,uBACE,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,SAAA,EAAW,KAAK,UAAA,CAAW,IAAA,EAAM,OAAO,UAAA,CAAW,IAAI,GAAG,SAAS,CAAA;AAAA,MAClE,GAAG;AAAA;AAAA,GACN;AAEJ;;;;"}
@@ -0,0 +1,8 @@
1
+ import styleInject from '../../node_modules_dist/style-inject/dist/style-inject.es.esm.js';
2
+
3
+ var css_248z = "/*\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\n@layer tokens, base, components, utilities;\n\n@layer components {\n .VisuallyHidden-module_bui-VisuallyHidden__22L23 {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0 0 0 0);\n clip-path: inset(100%);\n white-space: nowrap;\n border: 0;\n }\n}\n";
4
+ var styles = {"bui-VisuallyHidden":"VisuallyHidden-module_bui-VisuallyHidden__22L23"};
5
+ styleInject(css_248z);
6
+
7
+ export { styles as default };
8
+ //# sourceMappingURL=VisuallyHidden.module.css.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VisuallyHidden.module.css.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
package/dist/index.d.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  import * as react from 'react';
2
2
  import { ReactElement, ReactNode, ElementType, ComponentPropsWithRef, ComponentProps } from 'react';
3
- import { Avatar as Avatar$1 } from '@base-ui-components/react/avatar';
4
- import { ButtonProps as ButtonProps$1, DialogTriggerProps as DialogTriggerProps$1, ModalOverlayProps, HeadingProps, TabsProps as TabsProps$1, TabListProps as TabListProps$1, TabProps as TabProps$1, TabPanelProps as TabPanelProps$1, LinkProps as LinkProps$1, RadioGroupProps as RadioGroupProps$1, RadioProps as RadioProps$1, TableProps, TableHeaderProps, TableBodyProps, ColumnProps as ColumnProps$1, CellProps as CellProps$1, RowProps, TagGroupProps as TagGroupProps$1, TagListProps, TagProps as TagProps$1, TextFieldProps as TextFieldProps$1, TooltipProps as TooltipProps$1, TooltipTriggerComponentProps, MenuTriggerProps as MenuTriggerProps$1, SubmenuTriggerProps as SubmenuTriggerProps$1, MenuProps as MenuProps$1, PopoverProps, ListBoxProps, MenuItemProps as MenuItemProps$1, ListBoxItemProps, MenuSectionProps as MenuSectionProps$1, SeparatorProps, SearchFieldProps as SearchFieldProps$1, SelectProps as SelectProps$1, SwitchProps as SwitchProps$1 } from 'react-aria-components';
3
+ import { ButtonProps as ButtonProps$1, DialogTriggerProps as DialogTriggerProps$1, ModalOverlayProps, HeadingProps, TabsProps as TabsProps$1, TabListProps as TabListProps$1, TabProps as TabProps$1, TabPanelProps as TabPanelProps$1, LinkProps as LinkProps$1, CheckboxProps as CheckboxProps$1, RadioGroupProps as RadioGroupProps$1, RadioProps as RadioProps$1, TableProps, TableHeaderProps, TableBodyProps, ColumnProps as ColumnProps$1, CellProps as CellProps$1, RowProps, TagGroupProps as TagGroupProps$1, TagListProps, TagProps as TagProps$1, TextFieldProps as TextFieldProps$1, TooltipProps as TooltipProps$1, TooltipTriggerComponentProps, MenuTriggerProps as MenuTriggerProps$1, SubmenuTriggerProps as SubmenuTriggerProps$1, MenuProps as MenuProps$1, PopoverProps, ListBoxProps, MenuItemProps as MenuItemProps$1, ListBoxItemProps, MenuSectionProps as MenuSectionProps$1, SeparatorProps, SearchFieldProps as SearchFieldProps$1, SelectProps as SelectProps$1, SwitchProps as SwitchProps$1 } from 'react-aria-components';
5
4
  import * as react_jsx_runtime from 'react/jsx-runtime';
6
5
  import { NavigateOptions } from 'react-router-dom';
7
6
  import { Collapsible as Collapsible$1 } from '@base-ui-components/react/collapsible';
@@ -56,12 +55,11 @@ declare const componentDefinitions: {
56
55
  };
57
56
  readonly Checkbox: {
58
57
  readonly classNames: {
59
- readonly root: "bui-CheckboxRoot";
60
- readonly label: "bui-CheckboxLabel";
58
+ readonly root: "bui-Checkbox";
61
59
  readonly indicator: "bui-CheckboxIndicator";
62
60
  };
63
61
  readonly dataAttributes: {
64
- readonly checked: readonly [true, false];
62
+ readonly selected: readonly [true, false];
65
63
  };
66
64
  };
67
65
  readonly Collapsible: {
@@ -160,6 +158,8 @@ declare const componentDefinitions: {
160
158
  readonly dataAttributes: {
161
159
  readonly variant: readonly ["subtitle", "body", "caption", "label"];
162
160
  readonly weight: readonly ["regular", "bold"];
161
+ readonly color: readonly ["primary", "secondary", "danger", "warning", "success"];
162
+ readonly truncate: readonly [true, false];
163
163
  };
164
164
  };
165
165
  readonly List: {
@@ -326,6 +326,11 @@ declare const componentDefinitions: {
326
326
  readonly arrow: "bui-TooltipArrow";
327
327
  };
328
328
  };
329
+ readonly VisuallyHidden: {
330
+ readonly classNames: {
331
+ readonly root: "bui-VisuallyHidden";
332
+ };
333
+ };
329
334
  };
330
335
 
331
336
  /** @public */
@@ -501,14 +506,31 @@ interface ContainerProps {
501
506
  declare const Container: react.ForwardRefExoticComponent<ContainerProps & react.RefAttributes<HTMLDivElement>>;
502
507
 
503
508
  /** @public */
504
- interface AvatarProps extends React.ComponentPropsWithoutRef<typeof Avatar$1.Root> {
509
+ interface AvatarProps extends React.ComponentPropsWithoutRef<'div'> {
510
+ /**
511
+ * URL of the image to display
512
+ */
505
513
  src: string;
514
+ /**
515
+ * Name of the person - used for generating initials and accessibility labels
516
+ */
506
517
  name: string;
507
- size?: 'small' | 'medium' | 'large';
518
+ /**
519
+ * Size of the avatar
520
+ * @defaultValue 'medium'
521
+ */
522
+ size?: 'x-small' | 'small' | 'medium' | 'large' | 'x-large';
523
+ /**
524
+ * Determines how the avatar is presented to assistive technologies.
525
+ * - 'informative': Avatar is announced as "\{name\}" to screen readers
526
+ * - 'decoration': Avatar is hidden from screen readers (use when name appears in adjacent text)
527
+ * @defaultValue 'informative'
528
+ */
529
+ purpose?: 'decoration' | 'informative';
508
530
  }
509
531
 
510
532
  /** @public */
511
- declare const Avatar: react.ForwardRefExoticComponent<AvatarProps & react.RefAttributes<HTMLSpanElement>>;
533
+ declare const Avatar: react.ForwardRefExoticComponent<AvatarProps & react.RefAttributes<HTMLDivElement>>;
512
534
 
513
535
  /**
514
536
  * Properties for {@link Button}
@@ -641,7 +663,7 @@ declare const DialogBody: react.ForwardRefExoticComponent<DialogBodyProps & reac
641
663
  declare const DialogFooter: react.ForwardRefExoticComponent<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
642
664
 
643
665
  /** @public */
644
- interface FieldLabelProps {
666
+ interface FieldLabelProps extends Pick<React.HTMLAttributes<HTMLDivElement>, 'className'> {
645
667
  /**
646
668
  * The label of the text field
647
669
  */
@@ -745,6 +767,7 @@ interface HeaderProps {
745
767
  customActions?: React.ReactNode;
746
768
  tabs?: HeaderTab[];
747
769
  onTabSelectionChange?: TabsProps$1['onSelectionChange'];
770
+ className?: string;
748
771
  }
749
772
  /**
750
773
  * Represents a tab item in the header navigation.
@@ -785,6 +808,7 @@ interface HeaderPageProps {
785
808
  customActions?: React.ReactNode;
786
809
  tabs?: HeaderTab[];
787
810
  breadcrumbs?: HeaderPageBreadcrumb[];
811
+ className?: string;
788
812
  }
789
813
  /**
790
814
  * Represents a breadcrumb item in the header.
@@ -834,24 +858,15 @@ interface ButtonLinkProps extends LinkProps$1 {
834
858
  declare const ButtonLink: react.ForwardRefExoticComponent<ButtonLinkProps & react.RefAttributes<HTMLAnchorElement>>;
835
859
 
836
860
  /** @public */
837
- interface CheckboxProps {
838
- label?: string;
839
- defaultChecked?: boolean;
840
- checked?: boolean;
841
- onChange?: (checked: boolean) => void;
842
- disabled?: boolean;
843
- required?: boolean;
844
- className?: string;
845
- name?: string;
846
- value?: string;
847
- style?: React.CSSProperties;
861
+ interface CheckboxProps extends CheckboxProps$1 {
862
+ children: React.ReactNode;
848
863
  }
849
864
 
850
865
  /** @public */
851
- declare const Checkbox: react.ForwardRefExoticComponent<CheckboxProps & react.RefAttributes<HTMLButtonElement>>;
866
+ declare const Checkbox: react.ForwardRefExoticComponent<CheckboxProps & react.RefAttributes<HTMLLabelElement>>;
852
867
 
853
868
  /** @public */
854
- interface RadioGroupProps extends Omit<RadioGroupProps$1, 'children'>, Omit<FieldLabelProps, 'htmlFor' | 'id'> {
869
+ interface RadioGroupProps extends Omit<RadioGroupProps$1, 'children'>, Omit<FieldLabelProps, 'htmlFor' | 'id' | 'className'> {
855
870
  children?: ReactNode;
856
871
  }
857
872
  /** @public */
@@ -1051,7 +1066,7 @@ declare const Text: {
1051
1066
  };
1052
1067
 
1053
1068
  /** @public */
1054
- interface TextFieldProps extends TextFieldProps$1, Omit<FieldLabelProps, 'htmlFor' | 'id'> {
1069
+ interface TextFieldProps extends TextFieldProps$1, Omit<FieldLabelProps, 'htmlFor' | 'id' | 'className'> {
1055
1070
  /**
1056
1071
  * The HTML input type for the text field
1057
1072
  *
@@ -1165,7 +1180,7 @@ declare const MenuSection: (props: MenuSectionProps<object>) => react_jsx_runtim
1165
1180
  declare const MenuSeparator: (props: MenuSeparatorProps) => react_jsx_runtime.JSX.Element;
1166
1181
 
1167
1182
  /** @public */
1168
- interface SearchFieldProps extends SearchFieldProps$1, Omit<FieldLabelProps, 'htmlFor' | 'id'> {
1183
+ interface SearchFieldProps extends SearchFieldProps$1, Omit<FieldLabelProps, 'htmlFor' | 'id' | 'className'> {
1169
1184
  /**
1170
1185
  * An icon to render before the input
1171
1186
  */
@@ -1203,7 +1218,7 @@ declare const Link: react.ForwardRefExoticComponent<LinkProps & react.RefAttribu
1203
1218
  interface SelectProps extends SelectProps$1<{
1204
1219
  name: string;
1205
1220
  value: string;
1206
- }>, Omit<FieldLabelProps, 'htmlFor' | 'id'> {
1221
+ }>, Omit<FieldLabelProps, 'htmlFor' | 'id' | 'className'> {
1207
1222
  /**
1208
1223
  * An icon to render before the input
1209
1224
  */
@@ -1247,6 +1262,26 @@ interface SwitchProps extends SwitchProps$1 {
1247
1262
  /** @public */
1248
1263
  declare const Switch: react.ForwardRefExoticComponent<SwitchProps & react.RefAttributes<HTMLLabelElement>>;
1249
1264
 
1265
+ /**
1266
+ * Properties for {@link VisuallyHidden}
1267
+ *
1268
+ * @public
1269
+ */
1270
+ interface VisuallyHiddenProps extends ComponentProps<'div'> {
1271
+ children?: React.ReactNode;
1272
+ }
1273
+
1274
+ /**
1275
+ * Visually hides content while keeping it accessible to screen readers.
1276
+ * Useful for descriptive labels and other screen-reader-only content.
1277
+ *
1278
+ * Note: This component is for content that should ALWAYS remain visually hidden.
1279
+ * For skip links that become visible on focus, use a different approach.
1280
+ *
1281
+ * @public
1282
+ */
1283
+ declare const VisuallyHidden: (props: VisuallyHiddenProps) => react_jsx_runtime.JSX.Element;
1284
+
1250
1285
  /** @public */
1251
1286
  declare const useBreakpoint: () => {
1252
1287
  breakpoint: Breakpoint;
@@ -1254,4 +1289,4 @@ declare const useBreakpoint: () => {
1254
1289
  down: (key: Breakpoint) => boolean;
1255
1290
  };
1256
1291
 
1257
- export { type AlignItems, Avatar, type AvatarProps, type Border, type BorderRadius, Box, type BoxProps, type Breakpoint, Button, ButtonIcon, type ButtonIconProps, ButtonLink, type ButtonLinkProps, type ButtonProps, Card, CardBody, type CardBodyProps, CardFooter, type CardFooterProps, CardHeader, type CardHeaderProps, type CardProps, Cell, CellProfile, type CellProfileProps, type CellProps, Checkbox, type CheckboxProps, type ClassNamesMap, Collapsible, Column, type ColumnProps, type Columns, type ComponentClassNames, type ComponentDefinition, type ComponentDefinitionName, Container, type ContainerProps, type DataAttributeValues, type DataAttributesMap, Dialog, DialogBody, type DialogBodyProps, DialogFooter, DialogHeader, type DialogHeaderProps, type DialogProps, DialogTrigger, type DialogTriggerProps, type Display, FieldLabel, type FieldLabelProps, Flex, type FlexDirection, type FlexProps, type FlexWrap, Grid, type GridItemProps, type GridProps, Header, HeaderPage, type HeaderPageBreadcrumb, type HeaderPageProps, type HeaderProps, type HeaderTab, type JustifyContent, Link, type LinkProps, Menu, MenuAutocomplete, type MenuAutocompleteListBoxProps, MenuAutocompleteListbox, type MenuAutocompleteProps, MenuItem, type MenuItemProps, MenuListBox, MenuListBoxItem, type MenuListBoxItemProps, type MenuListBoxProps, type MenuProps, MenuSection, type MenuSectionProps, MenuSeparator, type MenuSeparatorProps, MenuTrigger, type MenuTriggerProps, Radio, RadioGroup, type RadioGroupProps, type RadioProps, type Responsive, Row, SearchField, type SearchFieldProps, Select, type SelectProps, Skeleton, type SkeletonProps, type Space, type SpaceProps, SubmenuTrigger, type SubmenuTriggerProps, Switch, type SwitchProps, Tab, TabList, type TabListProps, type TabMatchStrategy, TabPanel, type TabPanelProps, type TabProps, Table, TableBody, TableHeader, TablePagination, type TablePaginationProps, Tabs, type TabsProps, Tag, TagGroup, type TagGroupProps, type TagProps, Text, type TextColorStatus, type TextColors, TextField, type TextFieldProps, type TextOwnProps, type TextProps, type TextVariants, type TextWeights, Tooltip, type TooltipProps, TooltipTrigger, type UseTableConfig, type UseTablePagination, type UseTablePaginationConfig, type UseTableResult, type UtilityProps, componentDefinitions, useBreakpoint, useTable };
1292
+ export { type AlignItems, Avatar, type AvatarProps, type Border, type BorderRadius, Box, type BoxProps, type Breakpoint, Button, ButtonIcon, type ButtonIconProps, ButtonLink, type ButtonLinkProps, type ButtonProps, Card, CardBody, type CardBodyProps, CardFooter, type CardFooterProps, CardHeader, type CardHeaderProps, type CardProps, Cell, CellProfile, type CellProfileProps, type CellProps, Checkbox, type CheckboxProps, type ClassNamesMap, Collapsible, Column, type ColumnProps, type Columns, type ComponentClassNames, type ComponentDefinition, type ComponentDefinitionName, Container, type ContainerProps, type DataAttributeValues, type DataAttributesMap, Dialog, DialogBody, type DialogBodyProps, DialogFooter, DialogHeader, type DialogHeaderProps, type DialogProps, DialogTrigger, type DialogTriggerProps, type Display, FieldLabel, type FieldLabelProps, Flex, type FlexDirection, type FlexProps, type FlexWrap, Grid, type GridItemProps, type GridProps, Header, HeaderPage, type HeaderPageBreadcrumb, type HeaderPageProps, type HeaderProps, type HeaderTab, type JustifyContent, Link, type LinkProps, Menu, MenuAutocomplete, type MenuAutocompleteListBoxProps, MenuAutocompleteListbox, type MenuAutocompleteProps, MenuItem, type MenuItemProps, MenuListBox, MenuListBoxItem, type MenuListBoxItemProps, type MenuListBoxProps, type MenuProps, MenuSection, type MenuSectionProps, MenuSeparator, type MenuSeparatorProps, MenuTrigger, type MenuTriggerProps, Radio, RadioGroup, type RadioGroupProps, type RadioProps, type Responsive, Row, SearchField, type SearchFieldProps, Select, type SelectProps, Skeleton, type SkeletonProps, type Space, type SpaceProps, SubmenuTrigger, type SubmenuTriggerProps, Switch, type SwitchProps, Tab, TabList, type TabListProps, type TabMatchStrategy, TabPanel, type TabPanelProps, type TabProps, Table, TableBody, TableHeader, TablePagination, type TablePaginationProps, Tabs, type TabsProps, Tag, TagGroup, type TagGroupProps, type TagProps, Text, type TextColorStatus, type TextColors, TextField, type TextFieldProps, type TextOwnProps, type TextProps, type TextVariants, type TextWeights, Tooltip, type TooltipProps, TooltipTrigger, type UseTableConfig, type UseTablePagination, type UseTablePaginationConfig, type UseTableResult, type UtilityProps, VisuallyHidden, type VisuallyHiddenProps, componentDefinitions, useBreakpoint, useTable };
package/dist/index.esm.js CHANGED
@@ -34,6 +34,7 @@ export { Link } from './components/Link/Link.esm.js';
34
34
  export { Select } from './components/Select/Select.esm.js';
35
35
  export { Skeleton } from './components/Skeleton/Skeleton.esm.js';
36
36
  export { Switch } from './components/Switch/Switch.esm.js';
37
+ export { VisuallyHidden } from './components/VisuallyHidden/VisuallyHidden.esm.js';
37
38
  export { useBreakpoint } from './hooks/useBreakpoint.esm.js';
38
39
  export { componentDefinitions } from './utils/componentDefinitions.esm.js';
39
40
  //# sourceMappingURL=index.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -67,12 +67,11 @@ const componentDefinitions = {
67
67
  },
68
68
  Checkbox: {
69
69
  classNames: {
70
- root: "bui-CheckboxRoot",
71
- label: "bui-CheckboxLabel",
70
+ root: "bui-Checkbox",
72
71
  indicator: "bui-CheckboxIndicator"
73
72
  },
74
73
  dataAttributes: {
75
- checked: [true, false]
74
+ selected: [true, false]
76
75
  }
77
76
  },
78
77
  Collapsible: {
@@ -206,7 +205,9 @@ const componentDefinitions = {
206
205
  },
207
206
  dataAttributes: {
208
207
  variant: ["subtitle", "body", "caption", "label"],
209
- weight: ["regular", "bold"]
208
+ weight: ["regular", "bold"],
209
+ color: ["primary", "secondary", "danger", "warning", "success"],
210
+ truncate: [true, false]
210
211
  }
211
212
  },
212
213
  List: {
@@ -372,6 +373,11 @@ const componentDefinitions = {
372
373
  tooltip: "bui-Tooltip",
373
374
  arrow: "bui-TooltipArrow"
374
375
  }
376
+ },
377
+ VisuallyHidden: {
378
+ classNames: {
379
+ root: "bui-VisuallyHidden"
380
+ }
375
381
  }
376
382
  };
377
383