@backstage/ui 0.0.0-nightly-20250814024559 → 0.0.0-nightly-20250815024739
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 +1 -1
- package/css/styles.css +1 -1
- package/dist/components/Avatar/Avatar.esm.js.map +1 -1
- package/dist/components/Box/Box.esm.js.map +1 -1
- package/dist/components/Box/Box.props.esm.js.map +1 -1
- package/dist/components/Button/Button.esm.js.map +1 -1
- package/dist/components/ButtonIcon/ButtonIcon.esm.js.map +1 -1
- package/dist/components/ButtonLink/ButtonLink.esm.js.map +1 -1
- package/dist/components/Card/Card.esm.js.map +1 -1
- package/dist/components/Checkbox/Checkbox.esm.js.map +1 -1
- package/dist/components/Collapsible/Collapsible.esm.js.map +1 -1
- package/dist/components/Container/Container.esm.js.map +1 -1
- package/dist/components/FieldError/FieldError.esm.js.map +1 -1
- package/dist/components/FieldLabel/FieldLabel.esm.js.map +1 -1
- package/dist/components/Flex/Flex.esm.js.map +1 -1
- package/dist/components/Flex/Flex.props.esm.js.map +1 -1
- package/dist/components/Grid/Grid.esm.js.map +1 -1
- package/dist/components/Grid/Grid.props.esm.js.map +1 -1
- package/dist/components/Header/Header.esm.js.map +1 -1
- package/dist/components/Header/HeaderToolbar.esm.js.map +1 -1
- package/dist/components/HeaderPage/HeaderPage.esm.js +1 -1
- package/dist/components/HeaderPage/HeaderPage.esm.js.map +1 -1
- package/dist/components/Icon/Icon.esm.js.map +1 -1
- package/dist/components/Icon/context.esm.js.map +1 -1
- package/dist/components/Icon/icons.esm.js +1 -1
- package/dist/components/Icon/icons.esm.js.map +1 -1
- package/dist/components/Icon/provider.esm.js.map +1 -1
- package/dist/components/Link/Link.esm.js.map +1 -1
- package/dist/components/Menu/Combobox.esm.js.map +1 -1
- package/dist/components/Menu/Menu.esm.js.map +1 -1
- package/dist/components/RadioGroup/RadioGroup.esm.js.map +1 -1
- package/dist/components/ScrollArea/ScrollArea.esm.js.map +1 -1
- package/dist/components/SearchField/SearchField.esm.js.map +1 -1
- package/dist/components/Select/Select.esm.js.map +1 -1
- package/dist/components/Skeleton/Skeleton.esm.js.map +1 -1
- package/dist/components/Switch/Switch.esm.js.map +1 -1
- package/dist/components/Table/components/Cell.esm.js.map +1 -1
- package/dist/components/Table/components/CellProfile.esm.js.map +1 -1
- package/dist/components/Table/components/Column.esm.js.map +1 -1
- package/dist/components/Table/components/Row.esm.js.map +1 -1
- package/dist/components/Table/components/Table.esm.js.map +1 -1
- package/dist/components/Table/components/TableBody.esm.js.map +1 -1
- package/dist/components/Table/components/TableHeader.esm.js.map +1 -1
- package/dist/components/Table/hooks/useTable.esm.js.map +1 -1
- package/dist/components/TablePagination/TablePagination.esm.js.map +1 -1
- package/dist/components/Tabs/Tabs.esm.js.map +1 -1
- package/dist/components/Tabs/TabsIndicators.esm.js.map +1 -1
- package/dist/components/Text/Text.esm.js.map +1 -1
- package/dist/components/TextField/TextField.esm.js.map +1 -1
- package/dist/components/Tooltip/Tooltip.esm.js.map +1 -1
- package/dist/hooks/useBreakpoint.esm.js.map +1 -1
- package/dist/hooks/useIsomorphicLayoutEffect.esm.js.map +1 -1
- package/dist/hooks/useMediaQuery.esm.js.map +1 -1
- package/dist/hooks/useStyles.esm.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/props/display.props.esm.js.map +1 -1
- package/dist/props/gap-props.esm.js.map +1 -1
- package/dist/props/height.props.esm.js.map +1 -1
- package/dist/props/margin.props.esm.js.map +1 -1
- package/dist/props/padding.props.esm.js.map +1 -1
- package/dist/props/position.props.esm.js.map +1 -1
- package/dist/props/prop-def.esm.js.map +1 -1
- package/dist/props/spacing.props.esm.js.map +1 -1
- package/dist/props/width.props.esm.js.map +1 -1
- package/dist/utils/componentDefinitions.esm.js.map +1 -1
- package/dist/utils/extractProps.esm.js.map +1 -1
- package/dist/utils/isExternalLink.esm.js.map +1 -1
- package/package.json +3 -13
|
@@ -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';\n\nimport { useStyles } from '../../hooks/useStyles';\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 { children, ...rest } = props;\n const { classNames } = useStyles('Tabs');\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 }\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={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 { children, ...rest } = props;\n const { classNames } = useStyles('Tabs');\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 className={classNames.tabListWrapper}>\n <AriaTabList\n className={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 { href, children, id, matchStrategy: _matchStrategy, ...rest } = props;\n const { classNames } = useStyles('Tabs');\n const { setTabRef } = useTabsContext();\n\n return (\n <AriaTab\n id={id}\n className={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 { children, ...rest } = props;\n const { classNames } = useStyles('Tabs');\n\n return (\n <AriaTabPanel className={classNames.panel} {...rest}>\n {children}\n </AriaTabPanel>\n );\n};\n"],"names":["AriaTabs","AriaTabList","AriaTab","AriaTabPanel"],"mappings":";;;;;;;AA8CA,MAAM,WAAA,GAAc,cAA4C,KAAS,CAAA,CAAA;AAEzE,MAAM,iBAAiB,MAAM;AAC3B,EAAM,MAAA,OAAA,GAAU,WAAW,WAAW,CAAA;AACtC,EAAA,IAAI,CAAC,OAAS,EAAA;AACZ,IAAM,MAAA,IAAI,MAAM,qDAAqD,CAAA;AAAA;AAEvE,EAAO,OAAA,OAAA;AACT,CAAA;AAMA,MAAM,WAAc,GAAA,CAClB,OACA,EAAA,eAAA,EACA,aACY,KAAA;AACZ,EAAA,IAAI,kBAAkB,OAAS,EAAA;AAC7B,IAAA,OAAO,OAAY,KAAA,eAAA;AAAA;AAIrB,EAAA,IAAI,YAA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AAW,UAAW,CAAA,GAAA;AAAA,MACtB,GAAK,EAAA,CAAA,EAAA,KAAM,SAAU,CAAA,EAAA,EAAc,EAAoB,CAAA;AAAA,MACvD,IAAA;AAAA,MACC,GAAG,IAAA;AAAA,MAEH;AAAA;AAAA,GACH;AAEJ;AAOa,MAAA,QAAA,GAAW,CAAC,KAAyB,KAAA;AAChD,EAAA,MAAM,EAAE,QAAA,EAAU,GAAG,IAAA,EAAS,GAAA,KAAA;AAC9B,EAAA,MAAM,EAAE,UAAA,EAAe,GAAA,SAAA,CAAU,MAAM,CAAA;AAEvC,EAAA,2BACGC,UAAa,EAAA,EAAA,SAAA,EAAW,WAAW,KAAQ,EAAA,GAAG,MAC5C,QACH,EAAA,CAAA;AAEJ;;;;"}
|
|
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';\n\nimport { useStyles } from '../../hooks/useStyles';\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 { children, ...rest } = props;\n const { classNames } = useStyles('Tabs');\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 }\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={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 { children, ...rest } = props;\n const { classNames } = useStyles('Tabs');\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 className={classNames.tabListWrapper}>\n <AriaTabList\n className={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 { href, children, id, matchStrategy: _matchStrategy, ...rest } = props;\n const { classNames } = useStyles('Tabs');\n const { setTabRef } = useTabsContext();\n\n return (\n <AriaTab\n id={id}\n className={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 { children, ...rest } = props;\n const { classNames } = useStyles('Tabs');\n\n return (\n <AriaTabPanel className={classNames.panel} {...rest}>\n {children}\n </AriaTabPanel>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QACV,GAAG,IAAA;AAAA,QAEH,QAAA,EAAA;AAAA;AAAA,KACH;AAAA,oBACA,GAAA;AAAA,MAAC,cAAA;AAAA,MAAA;AAAA,QACC,OAAA;AAAA,QACA,OAAA;AAAA,QACA,UAAA;AAAA,QACA;AAAA;AAAA;AACF,GAAA,EACF,CAAA;AAEJ;AAOO,MAAM,GAAA,GAAM,CAAC,KAAA,KAAoB;AACtC,EAAA,MAAM,EAAE,MAAM,QAAA,EAAU,EAAA,EAAI,eAAe,cAAA,EAAgB,GAAG,MAAK,GAAI,KAAA;AACvE,EAAA,MAAM,EAAE,UAAA,EAAW,GAAI,SAAA,CAAU,MAAM,CAAA;AACvC,EAAA,MAAM,EAAE,SAAA,EAAU,GAAI,cAAA,EAAe;AAErC,EAAA,uBACE,GAAA;AAAA,IAACC,KAAA;AAAA,IAAA;AAAA,MACC,EAAA;AAAA,MACA,WAAW,UAAA,CAAW,GAAA;AAAA,MACtB,GAAA,EAAK,CAAA,EAAA,KAAM,SAAA,CAAU,EAAA,EAAc,EAAoB,CAAA;AAAA,MACvD,IAAA;AAAA,MACC,GAAG,IAAA;AAAA,MAEH;AAAA;AAAA,GACH;AAEJ;AAOO,MAAM,QAAA,GAAW,CAAC,KAAA,KAAyB;AAChD,EAAA,MAAM,EAAE,QAAA,EAAU,GAAG,IAAA,EAAK,GAAI,KAAA;AAC9B,EAAA,MAAM,EAAE,UAAA,EAAW,GAAI,SAAA,CAAU,MAAM,CAAA;AAEvC,EAAA,2BACGC,UAAA,EAAA,EAAa,SAAA,EAAW,WAAW,KAAA,EAAQ,GAAG,MAC5C,QAAA,EACH,CAAA;AAEJ;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabsIndicators.esm.js","sources":["../../../src/components/Tabs/TabsIndicators.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 { TabListStateContext } from 'react-aria-components';\nimport { useStyles } from '../../hooks/useStyles';\nimport { useContext, useEffect, useCallback, useRef } from 'react';\nimport type { TabsIndicatorsProps } from './types';\n\n/**\n * A component that renders the indicators for the toolbar.\n *\n * @internal\n */\nexport const TabsIndicators = (props: TabsIndicatorsProps) => {\n const { tabRefs, tabsRef, hoveredKey, prevHoveredKey } = props;\n const { classNames } = useStyles('Tabs');\n const state = useContext(TabListStateContext);\n const prevSelectedKey = useRef<string | null>(null);\n\n const updateCSSVariables = useCallback(() => {\n if (!tabsRef.current) return;\n\n const tabsRect = tabsRef.current.getBoundingClientRect();\n\n // Set active tab variables\n if (state?.selectedKey) {\n const activeTab = tabRefs.current.get(state.selectedKey.toString());\n\n if (activeTab) {\n const activeRect = activeTab.getBoundingClientRect();\n const relativeLeft = activeRect.left - tabsRect.left;\n const relativeTop = activeRect.top - tabsRect.top;\n\n // Control transition timing based on whether this is the first time setting active tab\n const isFirstActiveTab = prevSelectedKey.current === null;\n\n if (isFirstActiveTab) {\n // First time setting active tab: no transitions for position\n tabsRef.current.style.setProperty(\n '--active-transition-duration',\n '0s',\n );\n // Enable transitions on next frame for future tab switches\n requestAnimationFrame(() => {\n if (tabsRef.current) {\n tabsRef.current.style.setProperty(\n '--active-transition-duration',\n '0.25s',\n );\n }\n });\n } else {\n // Switching between tabs: full transitions\n tabsRef.current.style.setProperty(\n '--active-transition-duration',\n '0.25s',\n );\n }\n\n // Update previous selected key for next time\n prevSelectedKey.current = state.selectedKey.toString();\n\n tabsRef.current.style.setProperty(\n '--active-tab-left',\n `${relativeLeft}px`,\n );\n tabsRef.current.style.setProperty(\n '--active-tab-right',\n `${relativeLeft + activeRect.width}px`,\n );\n tabsRef.current.style.setProperty(\n '--active-tab-top',\n `${relativeTop}px`,\n );\n tabsRef.current.style.setProperty(\n '--active-tab-bottom',\n `${relativeTop + activeRect.height}px`,\n );\n tabsRef.current.style.setProperty(\n '--active-tab-width',\n `${activeRect.width}px`,\n );\n tabsRef.current.style.setProperty(\n '--active-tab-height',\n `${activeRect.height}px`,\n );\n }\n }\n\n // Set hovered tab variables\n if (hoveredKey) {\n const hoveredTab = tabRefs.current.get(hoveredKey);\n if (hoveredTab) {\n const hoveredRect = hoveredTab.getBoundingClientRect();\n const relativeLeft = hoveredRect.left - tabsRect.left;\n const relativeTop = hoveredRect.top - tabsRect.top;\n\n tabsRef.current.style.setProperty(\n '--hovered-tab-left',\n `${relativeLeft}px`,\n );\n tabsRef.current.style.setProperty(\n '--hovered-tab-right',\n `${relativeLeft + hoveredRect.width}px`,\n );\n tabsRef.current.style.setProperty(\n '--hovered-tab-top',\n `${relativeTop}px`,\n );\n tabsRef.current.style.setProperty(\n '--hovered-tab-bottom',\n `${relativeTop + hoveredRect.height}px`,\n );\n tabsRef.current.style.setProperty(\n '--hovered-tab-width',\n `${hoveredRect.width}px`,\n );\n tabsRef.current.style.setProperty(\n '--hovered-tab-height',\n `${hoveredRect.height}px`,\n );\n // Control transition timing based on whether this is a new hover session\n const isNewHoverSession = prevHoveredKey.current === null;\n\n if (isNewHoverSession) {\n // Starting new hover session: no transitions for position\n tabsRef.current.style.setProperty(\n '--hovered-transition-duration',\n '0s',\n );\n // Enable transitions on next frame for future tab switches\n requestAnimationFrame(() => {\n if (tabsRef.current) {\n tabsRef.current.style.setProperty(\n '--hovered-transition-duration',\n '0.2s',\n );\n }\n });\n } else {\n // Moving between tabs in same session: full transitions\n tabsRef.current.style.setProperty(\n '--hovered-transition-duration',\n '0.2s',\n );\n }\n\n // Update previous hover key for next time\n prevHoveredKey.current = hoveredKey;\n\n tabsRef.current.style.setProperty('--hovered-tab-opacity', '1');\n }\n } else {\n // When not hovering, hide with opacity and reset for next hover session\n tabsRef.current.style.setProperty('--hovered-tab-opacity', '0');\n\n // Reset previous hover key so next hover is treated as new session\n prevHoveredKey.current = null;\n }\n }, [state?.selectedKey, hoveredKey, tabRefs.current]);\n\n useEffect(() => {\n updateCSSVariables();\n }, [updateCSSVariables, tabRefs.current.size]);\n\n useEffect(() => {\n const handleResize = () => updateCSSVariables();\n window.addEventListener('resize', handleResize);\n return () => window.removeEventListener('resize', handleResize);\n }, [updateCSSVariables]);\n\n return (\n <>\n <div className={classNames.tabActive} />\n <div className={classNames.tabHovered} />\n </>\n );\n};\n"],"names":[],"mappings":";;;;;AA0Ba,MAAA,cAAA,GAAiB,CAAC,KAA+B,KAAA;AAC5D,EAAA,MAAM,EAAE,OAAA,EAAS,OAAS,EAAA,UAAA,EAAY,gBAAmB,GAAA,KAAA;AACzD,EAAA,MAAM,EAAE,UAAA,EAAe,GAAA,SAAA,CAAU,MAAM,CAAA;AACvC,EAAM,MAAA,KAAA,GAAQ,WAAW,mBAAmB,CAAA;AAC5C,EAAM,MAAA,eAAA,GAAkB,OAAsB,IAAI,CAAA;AAElD,EAAM,MAAA,kBAAA,GAAqB,YAAY,MAAM;AAC3C,IAAI,IAAA,CAAC,QAAQ,OAAS,EAAA;AAEtB,IAAM,MAAA,QAAA,GAAW,OAAQ,CAAA,OAAA,CAAQ,qBAAsB,EAAA;AAGvD,IAAA,IAAI,OAAO,WAAa,EAAA;AACtB,MAAA,MAAM,YAAY,OAAQ,CAAA,OAAA,CAAQ,IAAI,KAAM,CAAA,WAAA,CAAY,UAAU,CAAA;AAElE,MAAA,IAAI,SAAW,EAAA;AACb,QAAM,MAAA,UAAA,GAAa,UAAU,qBAAsB,EAAA;AACnD,QAAM,MAAA,YAAA,GAAe,UAAW,CAAA,IAAA,GAAO,QAAS,CAAA,IAAA;AAChD,QAAM,MAAA,WAAA,GAAc,UAAW,CAAA,GAAA,GAAM,QAAS,CAAA,GAAA;AAG9C,QAAM,MAAA,gBAAA,GAAmB,gB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A,CAAA,QAAA,EAAA,EAAA,QAAA,EAAA;AAAA,oBAAC,GAAA,CAAA,KAAA,EAAA,EAAI,SAAW,EAAA,UAAA,CAAW,SAAW,EAAA,CAAA;AAAA,oBACrC,GAAA,CAAA,KAAA,EAAA,EAAI,SAAW,EAAA,UAAA,CAAW,UAAY,EAAA;AAAA,GACzC,EAAA,CAAA;AAEJ;;;;"}
|
|
1
|
+
{"version":3,"file":"TabsIndicators.esm.js","sources":["../../../src/components/Tabs/TabsIndicators.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 { TabListStateContext } from 'react-aria-components';\nimport { useStyles } from '../../hooks/useStyles';\nimport { useContext, useEffect, useCallback, useRef } from 'react';\nimport type { TabsIndicatorsProps } from './types';\n\n/**\n * A component that renders the indicators for the toolbar.\n *\n * @internal\n */\nexport const TabsIndicators = (props: TabsIndicatorsProps) => {\n const { tabRefs, tabsRef, hoveredKey, prevHoveredKey } = props;\n const { classNames } = useStyles('Tabs');\n const state = useContext(TabListStateContext);\n const prevSelectedKey = useRef<string | null>(null);\n\n const updateCSSVariables = useCallback(() => {\n if (!tabsRef.current) return;\n\n const tabsRect = tabsRef.current.getBoundingClientRect();\n\n // Set active tab variables\n if (state?.selectedKey) {\n const activeTab = tabRefs.current.get(state.selectedKey.toString());\n\n if (activeTab) {\n const activeRect = activeTab.getBoundingClientRect();\n const relativeLeft = activeRect.left - tabsRect.left;\n const relativeTop = activeRect.top - tabsRect.top;\n\n // Control transition timing based on whether this is the first time setting active tab\n const isFirstActiveTab = prevSelectedKey.current === null;\n\n if (isFirstActiveTab) {\n // First time setting active tab: no transitions for position\n tabsRef.current.style.setProperty(\n '--active-transition-duration',\n '0s',\n );\n // Enable transitions on next frame for future tab switches\n requestAnimationFrame(() => {\n if (tabsRef.current) {\n tabsRef.current.style.setProperty(\n '--active-transition-duration',\n '0.25s',\n );\n }\n });\n } else {\n // Switching between tabs: full transitions\n tabsRef.current.style.setProperty(\n '--active-transition-duration',\n '0.25s',\n );\n }\n\n // Update previous selected key for next time\n prevSelectedKey.current = state.selectedKey.toString();\n\n tabsRef.current.style.setProperty(\n '--active-tab-left',\n `${relativeLeft}px`,\n );\n tabsRef.current.style.setProperty(\n '--active-tab-right',\n `${relativeLeft + activeRect.width}px`,\n );\n tabsRef.current.style.setProperty(\n '--active-tab-top',\n `${relativeTop}px`,\n );\n tabsRef.current.style.setProperty(\n '--active-tab-bottom',\n `${relativeTop + activeRect.height}px`,\n );\n tabsRef.current.style.setProperty(\n '--active-tab-width',\n `${activeRect.width}px`,\n );\n tabsRef.current.style.setProperty(\n '--active-tab-height',\n `${activeRect.height}px`,\n );\n }\n }\n\n // Set hovered tab variables\n if (hoveredKey) {\n const hoveredTab = tabRefs.current.get(hoveredKey);\n if (hoveredTab) {\n const hoveredRect = hoveredTab.getBoundingClientRect();\n const relativeLeft = hoveredRect.left - tabsRect.left;\n const relativeTop = hoveredRect.top - tabsRect.top;\n\n tabsRef.current.style.setProperty(\n '--hovered-tab-left',\n `${relativeLeft}px`,\n );\n tabsRef.current.style.setProperty(\n '--hovered-tab-right',\n `${relativeLeft + hoveredRect.width}px`,\n );\n tabsRef.current.style.setProperty(\n '--hovered-tab-top',\n `${relativeTop}px`,\n );\n tabsRef.current.style.setProperty(\n '--hovered-tab-bottom',\n `${relativeTop + hoveredRect.height}px`,\n );\n tabsRef.current.style.setProperty(\n '--hovered-tab-width',\n `${hoveredRect.width}px`,\n );\n tabsRef.current.style.setProperty(\n '--hovered-tab-height',\n `${hoveredRect.height}px`,\n );\n // Control transition timing based on whether this is a new hover session\n const isNewHoverSession = prevHoveredKey.current === null;\n\n if (isNewHoverSession) {\n // Starting new hover session: no transitions for position\n tabsRef.current.style.setProperty(\n '--hovered-transition-duration',\n '0s',\n );\n // Enable transitions on next frame for future tab switches\n requestAnimationFrame(() => {\n if (tabsRef.current) {\n tabsRef.current.style.setProperty(\n '--hovered-transition-duration',\n '0.2s',\n );\n }\n });\n } else {\n // Moving between tabs in same session: full transitions\n tabsRef.current.style.setProperty(\n '--hovered-transition-duration',\n '0.2s',\n );\n }\n\n // Update previous hover key for next time\n prevHoveredKey.current = hoveredKey;\n\n tabsRef.current.style.setProperty('--hovered-tab-opacity', '1');\n }\n } else {\n // When not hovering, hide with opacity and reset for next hover session\n tabsRef.current.style.setProperty('--hovered-tab-opacity', '0');\n\n // Reset previous hover key so next hover is treated as new session\n prevHoveredKey.current = null;\n }\n }, [state?.selectedKey, hoveredKey, tabRefs.current]);\n\n useEffect(() => {\n updateCSSVariables();\n }, [updateCSSVariables, tabRefs.current.size]);\n\n useEffect(() => {\n const handleResize = () => updateCSSVariables();\n window.addEventListener('resize', handleResize);\n return () => window.removeEventListener('resize', handleResize);\n }, [updateCSSVariables]);\n\n return (\n <>\n <div className={classNames.tabActive} />\n <div className={classNames.tabHovered} />\n </>\n );\n};\n"],"names":[],"mappings":";;;;;AA0BO,MAAM,cAAA,GAAiB,CAAC,KAAA,KAA+B;AAC5D,EAAA,MAAM,EAAE,OAAA,EAAS,OAAA,EAAS,UAAA,EAAY,gBAAe,GAAI,KAAA;AACzD,EAAA,MAAM,EAAE,UAAA,EAAW,GAAI,SAAA,CAAU,MAAM,CAAA;AACvC,EAAA,MAAM,KAAA,GAAQ,WAAW,mBAAmB,CAAA;AAC5C,EAAA,MAAM,eAAA,GAAkB,OAAsB,IAAI,CAAA;AAElD,EAAA,MAAM,kBAAA,GAAqB,YAAY,MAAM;AAC3C,IAAA,IAAI,CAAC,QAAQ,OAAA,EAAS;AAEtB,IAAA,MAAM,QAAA,GAAW,OAA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IAC3B;AAAA,EACF,GAAG,CAAC,KAAA,EAAO,aAAa,UAAA,EAAY,OAAA,CAAQ,OAAO,CAAC,CAAA;AAEpD,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,kBAAA,EAAmB;AAAA,EACrB,GAAG,CAAC,kBAAA,EAAoB,OAAA,CAAQ,OAAA,CAAQ,IAAI,CAAC,CAAA;AAE7C,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,MAAM,YAAA,GAAe,MAAM,kBAAA,EAAmB;AAC9C,IAAA,MAAA,CAAO,gBAAA,CAAiB,UAAU,YAAY,CAAA;AAC9C,IAAA,OAAO,MAAM,MAAA,CAAO,mBAAA,CAAoB,QAAA,EAAU,YAAY,CAAA;AAAA,EAChE,CAAA,EAAG,CAAC,kBAAkB,CAAC,CAAA;AAEvB,EAAA,uBACE,IAAA,CAAA,QAAA,EAAA,EACE,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,UAAA,CAAW,SAAA,EAAW,CAAA;AAAA,oBACtC,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,UAAA,CAAW,UAAA,EAAY;AAAA,GAAA,EACzC,CAAA;AAEJ;;;;"}
|
|
@@ -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';\n\nfunction TextComponent<T extends ElementType = 'span'>(\n {\n as,\n variant = 'body-medium',\n weight = 'regular',\n color = 'primary',\n className,\n truncate,\n style,\n ...restProps\n }: TextProps<T>,\n ref: React.Ref<any>,\n) {\n const Component = as || 'span';\n\n const { classNames, dataAttributes } = useStyles('Text', {\n variant,\n weight,\n color,\n });\n\n return (\n <Component\n ref={ref}\n className={clsx(classNames.root, className)}\n data-truncate={truncate}\n data-as={as}\n {...dataAttributes}\n style={style}\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":";;;;;AAsBA,SAAS,
|
|
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';\n\nfunction TextComponent<T extends ElementType = 'span'>(\n {\n as,\n variant = 'body-medium',\n weight = 'regular',\n color = 'primary',\n className,\n truncate,\n style,\n ...restProps\n }: TextProps<T>,\n ref: React.Ref<any>,\n) {\n const Component = as || 'span';\n\n const { classNames, dataAttributes } = useStyles('Text', {\n variant,\n weight,\n color,\n });\n\n return (\n <Component\n ref={ref}\n className={clsx(classNames.root, className)}\n data-truncate={truncate}\n data-as={as}\n {...dataAttributes}\n style={style}\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":";;;;;AAsBA,SAAS,aAAA,CACP;AAAA,EACE,EAAA;AAAA,EACA,OAAA,GAAU,aAAA;AAAA,EACV,MAAA,GAAS,SAAA;AAAA,EACT,KAAA,GAAQ,SAAA;AAAA,EACR,SAAA;AAAA,EACA,QAAA;AAAA,EACA,KAAA;AAAA,EACA,GAAG;AACL,CAAA,EACA,GAAA,EACA;AACA,EAAA,MAAM,YAAY,EAAA,IAAM,MAAA;AAExB,EAAA,MAAM,EAAE,UAAA,EAAY,cAAA,EAAe,GAAI,UAAU,MAAA,EAAQ;AAAA,IACvD,OAAA;AAAA,IACA,MAAA;AAAA,IACA;AAAA,GACD,CAAA;AAED,EAAA,uBACE,GAAA;AAAA,IAAC,SAAA;AAAA,IAAA;AAAA,MACC,GAAA;AAAA,MACA,SAAA,EAAW,IAAA,CAAK,UAAA,CAAW,IAAA,EAAM,SAAS,CAAA;AAAA,MAC1C,eAAA,EAAe,QAAA;AAAA,MACf,SAAA,EAAS,EAAA;AAAA,MACR,GAAG,cAAA;AAAA,MACJ,KAAA;AAAA,MACC,GAAG;AAAA;AAAA,GACN;AAEJ;AAEA,aAAA,CAAc,WAAA,GAAc,MAAA;AAGrB,MAAM,IAAA,GAAO,WAAW,aAAa;AAO5C,IAAA,CAAK,WAAA,GAAc,MAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextField.esm.js","sources":["../../../src/components/TextField/TextField.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { forwardRef, useEffect } from 'react';\nimport { Input, TextField as AriaTextField } from 'react-aria-components';\nimport clsx from 'clsx';\nimport { FieldLabel } from '../FieldLabel';\nimport { FieldError } from '../FieldError';\n\nimport type { TextFieldProps } from './types';\nimport { useStyles } from '../../hooks/useStyles';\n\n/** @public */\nexport const TextField = forwardRef<HTMLDivElement, TextFieldProps>(\n (props, ref) => {\n const {\n className,\n icon,\n size = 'small',\n label,\n secondaryLabel,\n description,\n isRequired,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n placeholder,\n ...rest\n } = props;\n\n useEffect(() => {\n if (!label && !ariaLabel && !ariaLabelledBy) {\n console.warn(\n 'TextField requires either a visible label, aria-label, or aria-labelledby for accessibility',\n );\n }\n }, [label, ariaLabel, ariaLabelledBy]);\n\n const { classNames, dataAttributes } = useStyles('TextField', {\n size,\n });\n\n // If a secondary label is provided, use it. Otherwise, use 'Required' if the field is required.\n const secondaryLabelText =\n secondaryLabel || (isRequired ? 'Required' : null);\n\n return (\n <AriaTextField\n className={clsx(classNames.root, className)}\n {...dataAttributes}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n {...rest}\n ref={ref}\n >\n <FieldLabel\n label={label}\n secondaryLabel={secondaryLabelText}\n description={description}\n />\n <div\n className={classNames.inputWrapper}\n data-size={dataAttributes['data-size']}\n >\n {icon && (\n <div\n className={classNames.inputIcon}\n data-size={dataAttributes['data-size']}\n aria-hidden=\"true\"\n >\n {icon}\n </div>\n )}\n <Input\n className={classNames.input}\n {...(icon && { 'data-icon': true })}\n placeholder={placeholder}\n />\n </div>\n <FieldError />\n </AriaTextField>\n );\n },\n);\n\nTextField.displayName = 'TextField';\n"],"names":["AriaTextField"],"mappings":";;;;;;;;AA0BO,MAAM,
|
|
1
|
+
{"version":3,"file":"TextField.esm.js","sources":["../../../src/components/TextField/TextField.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { forwardRef, useEffect } from 'react';\nimport { Input, TextField as AriaTextField } from 'react-aria-components';\nimport clsx from 'clsx';\nimport { FieldLabel } from '../FieldLabel';\nimport { FieldError } from '../FieldError';\n\nimport type { TextFieldProps } from './types';\nimport { useStyles } from '../../hooks/useStyles';\n\n/** @public */\nexport const TextField = forwardRef<HTMLDivElement, TextFieldProps>(\n (props, ref) => {\n const {\n className,\n icon,\n size = 'small',\n label,\n secondaryLabel,\n description,\n isRequired,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n placeholder,\n ...rest\n } = props;\n\n useEffect(() => {\n if (!label && !ariaLabel && !ariaLabelledBy) {\n console.warn(\n 'TextField requires either a visible label, aria-label, or aria-labelledby for accessibility',\n );\n }\n }, [label, ariaLabel, ariaLabelledBy]);\n\n const { classNames, dataAttributes } = useStyles('TextField', {\n size,\n });\n\n // If a secondary label is provided, use it. Otherwise, use 'Required' if the field is required.\n const secondaryLabelText =\n secondaryLabel || (isRequired ? 'Required' : null);\n\n return (\n <AriaTextField\n className={clsx(classNames.root, className)}\n {...dataAttributes}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n {...rest}\n ref={ref}\n >\n <FieldLabel\n label={label}\n secondaryLabel={secondaryLabelText}\n description={description}\n />\n <div\n className={classNames.inputWrapper}\n data-size={dataAttributes['data-size']}\n >\n {icon && (\n <div\n className={classNames.inputIcon}\n data-size={dataAttributes['data-size']}\n aria-hidden=\"true\"\n >\n {icon}\n </div>\n )}\n <Input\n className={classNames.input}\n {...(icon && { 'data-icon': true })}\n placeholder={placeholder}\n />\n </div>\n <FieldError />\n </AriaTextField>\n );\n },\n);\n\nTextField.displayName = 'TextField';\n"],"names":["AriaTextField"],"mappings":";;;;;;;;AA0BO,MAAM,SAAA,GAAY,UAAA;AAAA,EACvB,CAAC,OAAO,GAAA,KAAQ;AACd,IAAA,MAAM;AAAA,MACJ,SAAA;AAAA,MACA,IAAA;AAAA,MACA,IAAA,GAAO,OAAA;AAAA,MACP,KAAA;AAAA,MACA,cAAA;AAAA,MACA,WAAA;AAAA,MACA,UAAA;AAAA,MACA,YAAA,EAAc,SAAA;AAAA,MACd,iBAAA,EAAmB,cAAA;AAAA,MACnB,WAAA;AAAA,MACA,GAAG;AAAA,KACL,GAAI,KAAA;AAEJ,IAAA,SAAA,CAAU,MAAM;AACd,MAAA,IAAI,CAAC,KAAA,IAAS,CAAC,SAAA,IAAa,CAAC,cAAA,EAAgB;AAC3C,QAAA,OAAA,CAAQ,IAAA;AAAA,UACN;AAAA,SACF;AAAA,MACF;AAAA,IACF,CAAA,EAAG,CAAC,KAAA,EAAO,SAAA,EAAW,cAAc,CAAC,CAAA;AAErC,IAAA,MAAM,EAAE,UAAA,EAAY,cAAA,EAAe,GAAI,UAAU,WAAA,EAAa;AAAA,MAC5D;AAAA,KACD,CAAA;AAGD,IAAA,MAAM,kBAAA,GACJ,cAAA,KAAmB,UAAA,GAAa,UAAA,GAAa,IAAA,CAAA;AAE/C,IAAA,uBACE,IAAA;AAAA,MAACA,WAAA;AAAA,MAAA;AAAA,QACC,SAAA,EAAW,IAAA,CAAK,UAAA,CAAW,IAAA,EAAM,SAAS,CAAA;AAAA,QACzC,GAAG,cAAA;AAAA,QACJ,YAAA,EAAY,SAAA;AAAA,QACZ,iBAAA,EAAiB,cAAA;AAAA,QAChB,GAAG,IAAA;AAAA,QACJ,GAAA;AAAA,QAEA,QAAA,EAAA;AAAA,0BAAA,GAAA;AAAA,YAAC,UAAA;AAAA,YAAA;AAAA,cACC,KAAA;AAAA,cACA,cAAA,EAAgB,kBAAA;AAAA,cAChB;AAAA;AAAA,WACF;AAAA,0BACA,IAAA;AAAA,YAAC,KAAA;AAAA,YAAA;AAAA,cACC,WAAW,UAAA,CAAW,YAAA;AAAA,cACtB,WAAA,EAAW,eAAe,WAAW,CAAA;AAAA,cAEpC,QAAA,EAAA;AAAA,gBAAA,IAAA,oBACC,GAAA;AAAA,kBAAC,KAAA;AAAA,kBAAA;AAAA,oBACC,WAAW,UAAA,CAAW,SAAA;AAAA,oBACtB,WAAA,EAAW,eAAe,WAAW,CAAA;AAAA,oBACrC,aAAA,EAAY,MAAA;AAAA,oBAEX,QAAA,EAAA;AAAA;AAAA,iBACH;AAAA,gCAEF,GAAA;AAAA,kBAAC,KAAA;AAAA,kBAAA;AAAA,oBACC,WAAW,UAAA,CAAW,KAAA;AAAA,oBACrB,GAAI,IAAA,IAAQ,EAAE,WAAA,EAAa,IAAA,EAAK;AAAA,oBACjC;AAAA;AAAA;AACF;AAAA;AAAA,WACF;AAAA,8BACC,UAAA,EAAA,EAAW;AAAA;AAAA;AAAA,KACd;AAAA,EAEJ;AACF;AAEA,SAAA,CAAU,WAAA,GAAc,WAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.esm.js","sources":["../../../src/components/Tooltip/Tooltip.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 {\n OverlayArrow,\n Tooltip as AriaTooltip,\n TooltipTrigger as AriaTooltipTrigger,\n TooltipTriggerComponentProps,\n} from 'react-aria-components';\nimport clsx from 'clsx';\nimport { TooltipProps } from './types';\nimport { useStyles } from '../../hooks/useStyles';\n\n/** @public */\nexport const TooltipTrigger = (props: TooltipTriggerComponentProps) => {\n const { delay = 600 } = props;\n\n return <AriaTooltipTrigger delay={delay} {...props} />;\n};\n\n/** @public */\nexport const Tooltip = forwardRef<HTMLDivElement, TooltipProps>(\n ({ className, children, ...rest }, ref) => {\n const { classNames } = useStyles('Tooltip');\n\n return (\n <AriaTooltip\n className={clsx(classNames.tooltip, className)}\n {...rest}\n ref={ref}\n >\n <OverlayArrow className={classNames.arrow}>\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\">\n <path d=\"M10.3356 7.39793L15.1924 3.02682C15.9269 2.36577 16.8801 2 17.8683 2H20V7.94781e-07L1.74846e-07 -9.53674e-07L0 2L1.4651 2C2.4532 2 3.4064 2.36577 4.1409 3.02682L8.9977 7.39793C9.378 7.7402 9.9553 7.74021 10.3356 7.39793Z\" />\n <path d=\"M11.0046 8.14124C10.2439 8.82575 9.08939 8.82578 8.32869 8.14122L3.47189 3.77011C2.92109 3.27432 2.20619 2.99999 1.46509 2.99999L4.10999 3L8.99769 7.39793C9.37799 7.7402 9.95529 7.7402 10.3356 7.39793L15.2226 3L17.8683 2.99999C17.1271 2.99999 16.4122 3.27432 15.8614 3.77011L11.0046 8.14124Z\" />\n </svg>\n </OverlayArrow>\n {children}\n </AriaTooltip>\n );\n },\n);\n\nTooltip.displayName = 'Tooltip';\n"],"names":["AriaTooltipTrigger","AriaTooltip"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"Tooltip.esm.js","sources":["../../../src/components/Tooltip/Tooltip.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 {\n OverlayArrow,\n Tooltip as AriaTooltip,\n TooltipTrigger as AriaTooltipTrigger,\n TooltipTriggerComponentProps,\n} from 'react-aria-components';\nimport clsx from 'clsx';\nimport { TooltipProps } from './types';\nimport { useStyles } from '../../hooks/useStyles';\n\n/** @public */\nexport const TooltipTrigger = (props: TooltipTriggerComponentProps) => {\n const { delay = 600 } = props;\n\n return <AriaTooltipTrigger delay={delay} {...props} />;\n};\n\n/** @public */\nexport const Tooltip = forwardRef<HTMLDivElement, TooltipProps>(\n ({ className, children, ...rest }, ref) => {\n const { classNames } = useStyles('Tooltip');\n\n return (\n <AriaTooltip\n className={clsx(classNames.tooltip, className)}\n {...rest}\n ref={ref}\n >\n <OverlayArrow className={classNames.arrow}>\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\">\n <path d=\"M10.3356 7.39793L15.1924 3.02682C15.9269 2.36577 16.8801 2 17.8683 2H20V7.94781e-07L1.74846e-07 -9.53674e-07L0 2L1.4651 2C2.4532 2 3.4064 2.36577 4.1409 3.02682L8.9977 7.39793C9.378 7.7402 9.9553 7.74021 10.3356 7.39793Z\" />\n <path d=\"M11.0046 8.14124C10.2439 8.82575 9.08939 8.82578 8.32869 8.14122L3.47189 3.77011C2.92109 3.27432 2.20619 2.99999 1.46509 2.99999L4.10999 3L8.99769 7.39793C9.37799 7.7402 9.95529 7.7402 10.3356 7.39793L15.2226 3L17.8683 2.99999C17.1271 2.99999 16.4122 3.27432 15.8614 3.77011L11.0046 8.14124Z\" />\n </svg>\n </OverlayArrow>\n {children}\n </AriaTooltip>\n );\n },\n);\n\nTooltip.displayName = 'Tooltip';\n"],"names":["AriaTooltipTrigger","AriaTooltip"],"mappings":";;;;;;AA4BO,MAAM,cAAA,GAAiB,CAAC,KAAA,KAAwC;AACrE,EAAA,MAAM,EAAE,KAAA,GAAQ,GAAA,EAAI,GAAI,KAAA;AAExB,EAAA,uBAAO,GAAA,CAACA,gBAAA,EAAA,EAAmB,KAAA,EAAe,GAAG,KAAA,EAAO,CAAA;AACtD;AAGO,MAAM,OAAA,GAAU,UAAA;AAAA,EACrB,CAAC,EAAE,SAAA,EAAW,UAAU,GAAG,IAAA,IAAQ,GAAA,KAAQ;AACzC,IAAA,MAAM,EAAE,UAAA,EAAW,GAAI,SAAA,CAAU,SAAS,CAAA;AAE1C,IAAA,uBACE,IAAA;AAAA,MAACC,SAAA;AAAA,MAAA;AAAA,QACC,SAAA,EAAW,IAAA,CAAK,UAAA,CAAW,OAAA,EAAS,SAAS,CAAA;AAAA,QAC5C,GAAG,IAAA;AAAA,QACJ,GAAA;AAAA,QAEA,QAAA,EAAA;AAAA,0BAAA,GAAA,CAAC,YAAA,EAAA,EAAa,SAAA,EAAW,UAAA,CAAW,KAAA,EAClC,QAAA,kBAAA,IAAA,CAAC,KAAA,EAAA,EAAI,KAAA,EAAM,IAAA,EAAK,MAAA,EAAO,IAAA,EAAK,OAAA,EAAQ,WAAA,EAAY,MAAK,MAAA,EACnD,QAAA,EAAA;AAAA,4BAAA,GAAA,CAAC,MAAA,EAAA,EAAK,GAAE,8NAAA,EAA+N,CAAA;AAAA,4BACvO,GAAA,CAAC,MAAA,EAAA,EAAK,CAAA,EAAE,qSAAA,EAAsS;AAAA,WAAA,EAChT,CAAA,EACF,CAAA;AAAA,UACC;AAAA;AAAA;AAAA,KACH;AAAA,EAEJ;AACF;AAEA,OAAA,CAAQ,WAAA,GAAc,SAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useBreakpoint.esm.js","sources":["../../src/hooks/useBreakpoint.ts"],"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 */\nimport { useMediaQuery } from './useMediaQuery';\nimport type { Breakpoint } from '../types';\n\nexport const breakpoints: { name: string; id: Breakpoint; value: number }[] = [\n { name: 'Initial', id: 'initial', value: 0 },\n { name: 'Extra Small', id: 'xs', value: 640 },\n { name: 'Small', id: 'sm', value: 768 },\n { name: 'Medium', id: 'md', value: 1024 },\n { name: 'Large', id: 'lg', value: 1280 },\n { name: 'Extra Large', id: 'xl', value: 1536 },\n];\n\n/** @public */\nexport const useBreakpoint = () => {\n // Call all media queries at the top level\n const matches = breakpoints.map(breakpoint => {\n return useMediaQuery(`(min-width: ${breakpoint.value}px)`);\n });\n\n // Pre-calculate all the up/down values we need\n const upMatches = new Map(\n breakpoints.map(bp => [bp.id, useMediaQuery(`(min-width: ${bp.value}px)`)]),\n );\n\n const downMatches = new Map(\n breakpoints.map(bp => [\n bp.id,\n useMediaQuery(`(max-width: ${bp.value - 1}px)`),\n ]),\n );\n\n let breakpoint: Breakpoint = breakpoints[0].id;\n for (let i = matches.length - 1; i >= 0; i--) {\n if (matches[i]) {\n breakpoint = breakpoints[i].id;\n break;\n }\n }\n\n return {\n breakpoint,\n up: (key: Breakpoint): boolean => {\n return upMatches.get(key) ?? false;\n },\n down: (key: Breakpoint): boolean => {\n return downMatches.get(key) ?? false;\n },\n };\n};\n"],"names":["breakpoint"],"mappings":";;AAkBO,MAAM,
|
|
1
|
+
{"version":3,"file":"useBreakpoint.esm.js","sources":["../../src/hooks/useBreakpoint.ts"],"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 */\nimport { useMediaQuery } from './useMediaQuery';\nimport type { Breakpoint } from '../types';\n\nexport const breakpoints: { name: string; id: Breakpoint; value: number }[] = [\n { name: 'Initial', id: 'initial', value: 0 },\n { name: 'Extra Small', id: 'xs', value: 640 },\n { name: 'Small', id: 'sm', value: 768 },\n { name: 'Medium', id: 'md', value: 1024 },\n { name: 'Large', id: 'lg', value: 1280 },\n { name: 'Extra Large', id: 'xl', value: 1536 },\n];\n\n/** @public */\nexport const useBreakpoint = () => {\n // Call all media queries at the top level\n const matches = breakpoints.map(breakpoint => {\n return useMediaQuery(`(min-width: ${breakpoint.value}px)`);\n });\n\n // Pre-calculate all the up/down values we need\n const upMatches = new Map(\n breakpoints.map(bp => [bp.id, useMediaQuery(`(min-width: ${bp.value}px)`)]),\n );\n\n const downMatches = new Map(\n breakpoints.map(bp => [\n bp.id,\n useMediaQuery(`(max-width: ${bp.value - 1}px)`),\n ]),\n );\n\n let breakpoint: Breakpoint = breakpoints[0].id;\n for (let i = matches.length - 1; i >= 0; i--) {\n if (matches[i]) {\n breakpoint = breakpoints[i].id;\n break;\n }\n }\n\n return {\n breakpoint,\n up: (key: Breakpoint): boolean => {\n return upMatches.get(key) ?? false;\n },\n down: (key: Breakpoint): boolean => {\n return downMatches.get(key) ?? false;\n },\n };\n};\n"],"names":["breakpoint"],"mappings":";;AAkBO,MAAM,WAAA,GAAiE;AAAA,EAC5E,EAAE,I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KAAA,IAAS,IAAI,OAAA,CAAQ,MAAA,GAAS,CAAA,EAAG,CAAA,IAAK,GAAG,CAAA,EAAA,EAAK;AAC5C,IAAA,IAAI,OAAA,CAAQ,CAAC,CAAA,EAAG;AACd,MAAA,UAAA,GAAa,WAAA,CAAY,CAAC,CAAA,CAAE,EAAA;AAC5B,MAAA;AAAA,IACF;AAAA,EACF;AAEA,EAAA,OAAO;AAAA,IACL,UAAA;AAAA,IACA,EAAA,EAAI,CAAC,GAAA,KAA6B;AAChC,MAAA,OAAO,SAAA,CAAU,GAAA,CAAI,GAAG,CAAA,IAAK,KAAA;AAAA,IAC/B,CAAA;AAAA,IACA,IAAA,EAAM,CAAC,GAAA,KAA6B;AAClC,MAAA,OAAO,WAAA,CAAY,GAAA,CAAI,GAAG,CAAA,IAAK,KAAA;AAAA,IACjC;AAAA,GACF;AACF;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useIsomorphicLayoutEffect.esm.js","sources":["../../src/hooks/useIsomorphicLayoutEffect.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 */\nimport { useEffect, useLayoutEffect } from 'react';\n\nexport const useIsomorphicLayoutEffect =\n typeof window !== 'undefined' ? useLayoutEffect : useEffect;\n"],"names":[],"mappings":";;AAiBO,MAAM,
|
|
1
|
+
{"version":3,"file":"useIsomorphicLayoutEffect.esm.js","sources":["../../src/hooks/useIsomorphicLayoutEffect.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 */\nimport { useEffect, useLayoutEffect } from 'react';\n\nexport const useIsomorphicLayoutEffect =\n typeof window !== 'undefined' ? useLayoutEffect : useEffect;\n"],"names":[],"mappings":";;AAiBO,MAAM,yBAAA,GACX,OAAO,MAAA,KAAW,WAAA,GAAc,eAAA,GAAkB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMediaQuery.esm.js","sources":["../../src/hooks/useMediaQuery.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 */\nimport { useState } from 'react';\n\nimport { useIsomorphicLayoutEffect } from './useIsomorphicLayoutEffect';\n\ntype UseMediaQueryOptions = {\n defaultValue?: boolean;\n initializeWithValue?: boolean;\n};\n\nconst IS_SERVER = typeof window === 'undefined';\n\nexport function useMediaQuery(\n query: string,\n {\n defaultValue = false,\n initializeWithValue = true,\n }: UseMediaQueryOptions = {},\n): boolean {\n const getMatches = (query: string): boolean => {\n if (IS_SERVER) {\n return defaultValue;\n }\n return window.matchMedia(query).matches;\n };\n\n const [matches, setMatches] = useState<boolean>(() => {\n if (initializeWithValue) {\n return getMatches(query);\n }\n return defaultValue;\n });\n\n // Handles the change event of the media query.\n function handleChange() {\n setMatches(getMatches(query));\n }\n\n useIsomorphicLayoutEffect(() => {\n const matchMedia = window.matchMedia(query);\n\n // Triggered at the first client-side load and if query changes\n handleChange();\n\n // Use deprecated `addListener` and `removeListener` to support Safari < 14 (#135)\n if (matchMedia.addListener) {\n matchMedia.addListener(handleChange);\n } else {\n matchMedia.addEventListener('change', handleChange);\n }\n\n return () => {\n if (matchMedia.removeListener) {\n matchMedia.removeListener(handleChange);\n } else {\n matchMedia.removeEventListener('change', handleChange);\n }\n };\n }, [query]);\n\n return matches;\n}\n"],"names":["query"],"mappings":";;;AAwBA,MAAM,SAAA,GAAY,OAAO,
|
|
1
|
+
{"version":3,"file":"useMediaQuery.esm.js","sources":["../../src/hooks/useMediaQuery.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 */\nimport { useState } from 'react';\n\nimport { useIsomorphicLayoutEffect } from './useIsomorphicLayoutEffect';\n\ntype UseMediaQueryOptions = {\n defaultValue?: boolean;\n initializeWithValue?: boolean;\n};\n\nconst IS_SERVER = typeof window === 'undefined';\n\nexport function useMediaQuery(\n query: string,\n {\n defaultValue = false,\n initializeWithValue = true,\n }: UseMediaQueryOptions = {},\n): boolean {\n const getMatches = (query: string): boolean => {\n if (IS_SERVER) {\n return defaultValue;\n }\n return window.matchMedia(query).matches;\n };\n\n const [matches, setMatches] = useState<boolean>(() => {\n if (initializeWithValue) {\n return getMatches(query);\n }\n return defaultValue;\n });\n\n // Handles the change event of the media query.\n function handleChange() {\n setMatches(getMatches(query));\n }\n\n useIsomorphicLayoutEffect(() => {\n const matchMedia = window.matchMedia(query);\n\n // Triggered at the first client-side load and if query changes\n handleChange();\n\n // Use deprecated `addListener` and `removeListener` to support Safari < 14 (#135)\n if (matchMedia.addListener) {\n matchMedia.addListener(handleChange);\n } else {\n matchMedia.addEventListener('change', handleChange);\n }\n\n return () => {\n if (matchMedia.removeListener) {\n matchMedia.removeListener(handleChange);\n } else {\n matchMedia.removeEventListener('change', handleChange);\n }\n };\n }, [query]);\n\n return matches;\n}\n"],"names":["query"],"mappings":";;;AAwBA,MAAM,SAAA,GAAY,OAAO,MAAA,KAAW,WAAA;AAE7B,SAAS,cACd,KAAA,EACA;AAAA,EACE,YAAA,GAAe,KAAA;AAAA,EACf,mBAAA,GAAsB;AACxB,CAAA,GAA0B,EAAC,EAClB;AACT,EAAA,MAAM,UAAA,GAAa,CAACA,MAAAA,KAA2B;AAC7C,IAAA,IAAI,SAAA,EAAW;AACb,MAAA,OAAO,YAAA;AAAA,IACT;AACA,IAAA,OAAO,MAAA,CAAO,UAAA,CAAWA,MAAK,CAAA,CAAE,OAAA;AAAA,EAClC,CAAA;AAEA,EAAA,MAAM,CAAC,OAAA,EAAS,UAAU,CAAA,GAAI,SAAkB,MAAM;AACpD,IAAA,IAAI,mBAAA,EAAqB;AACvB,MAAA,OAAO,WAAW,KAAK,CAAA;AAAA,IACzB;AACA,IAAA,OAAO,YAAA;AAAA,EACT,CAAC,CAAA;AAGD,EAAA,SAAS,YAAA,GAAe;AACtB,IAAA,UAAA,CAAW,UAAA,CAAW,KAAK,CAAC,CAAA;AAAA,EAC9B;AAEA,EAAA,yBAAA,CAA0B,MAAM;AAC9B,IAAA,MAAM,UAAA,GAAa,MAAA,CAAO,UAAA,CAAW,KAAK,CAAA;AAG1C,IAAA,YAAA,EAAa;AAGb,IAAA,IAAI,WAAW,WAAA,EAAa;AAC1B,MAAA,UAAA,CAAW,YAAY,YAAY,CAAA;AAAA,IACrC,CAAA,MAAO;AACL,MAAA,UAAA,CAAW,gBAAA,CAAiB,UAAU,YAAY,CAAA;AAAA,IACpD;AAEA,IAAA,OAAO,MAAM;AACX,MAAA,IAAI,WAAW,cAAA,EAAgB;AAC7B,QAAA,UAAA,CAAW,eAAe,YAAY,CAAA;AAAA,MACxC,CAAA,MAAO;AACL,QAAA,UAAA,CAAW,mBAAA,CAAoB,UAAU,YAAY,CAAA;AAAA,MACvD;AAAA,IACF,CAAA;AAAA,EACF,CAAA,EAAG,CAAC,KAAK,CAAC,CAAA;AAEV,EAAA,OAAO,OAAA;AACT;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useStyles.esm.js","sources":["../../src/hooks/useStyles.ts"],"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 */\nimport { useBreakpoint, breakpoints } from './useBreakpoint';\nimport { componentDefinitions } from '../utils/componentDefinitions';\nimport type { ComponentDefinitionName, ComponentClassNames } from '../types';\n\n/**\n * Resolve a responsive value based on the current breakpoint\n * @param value - The responsive value (string or object with breakpoint keys)\n * @param breakpoint - The current breakpoint\n * @returns The resolved value for the current breakpoint\n */\nfunction resolveResponsiveValue(\n value: string | Record<string, string>,\n breakpoint: string,\n): string | undefined {\n if (typeof value === 'string') {\n return value;\n }\n\n if (typeof value === 'object' && value !== null) {\n const index = breakpoints.findIndex(b => b.id === breakpoint);\n\n // Look for value at current breakpoint or smaller\n for (let i = index; i >= 0; i--) {\n if (value[breakpoints[i].id]) {\n return value[breakpoints[i].id];\n }\n }\n\n // If no value found, check from smallest breakpoint up\n for (let i = 0; i < breakpoints.length; i++) {\n if (value[breakpoints[i].id]) {\n return value[breakpoints[i].id];\n }\n }\n }\n\n return undefined;\n}\n\n/**\n * React hook to get class names and data attributes for a component with responsive support\n * @param componentName - The name of the component\n * @param props - Object with prop values (can be responsive)\n * @returns Object with classNames and dataAttributes\n */\nexport function useStyles<T extends ComponentDefinitionName>(\n componentName: T,\n props: Record<string, any> = {},\n): {\n classNames: ComponentClassNames<T>;\n dataAttributes: Record<string, string>;\n resolvedProps: Record<string, string>;\n} {\n const { breakpoint } = useBreakpoint();\n const classNames = componentDefinitions[componentName]\n .classNames as ComponentClassNames<T>;\n\n // Resolve responsive values and generate data attributes\n const dataAttributes: Record<string, string> = {};\n const resolvedProps: Record<string, string> = {};\n\n for (const [key, value] of Object.entries(props)) {\n if (value !== undefined && value !== null) {\n const resolvedValue = resolveResponsiveValue(value, breakpoint);\n if (resolvedValue !== undefined) {\n resolvedProps[key] = resolvedValue;\n dataAttributes[`data-${key}`] = resolvedValue;\n }\n }\n }\n\n return {\n classNames,\n dataAttributes,\n resolvedProps, // Also return resolved props for convenience\n };\n}\n"],"names":[],"mappings":";;;AAyBA,SAAS,sBAAA,CACP,OACA,
|
|
1
|
+
{"version":3,"file":"useStyles.esm.js","sources":["../../src/hooks/useStyles.ts"],"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 */\nimport { useBreakpoint, breakpoints } from './useBreakpoint';\nimport { componentDefinitions } from '../utils/componentDefinitions';\nimport type { ComponentDefinitionName, ComponentClassNames } from '../types';\n\n/**\n * Resolve a responsive value based on the current breakpoint\n * @param value - The responsive value (string or object with breakpoint keys)\n * @param breakpoint - The current breakpoint\n * @returns The resolved value for the current breakpoint\n */\nfunction resolveResponsiveValue(\n value: string | Record<string, string>,\n breakpoint: string,\n): string | undefined {\n if (typeof value === 'string') {\n return value;\n }\n\n if (typeof value === 'object' && value !== null) {\n const index = breakpoints.findIndex(b => b.id === breakpoint);\n\n // Look for value at current breakpoint or smaller\n for (let i = index; i >= 0; i--) {\n if (value[breakpoints[i].id]) {\n return value[breakpoints[i].id];\n }\n }\n\n // If no value found, check from smallest breakpoint up\n for (let i = 0; i < breakpoints.length; i++) {\n if (value[breakpoints[i].id]) {\n return value[breakpoints[i].id];\n }\n }\n }\n\n return undefined;\n}\n\n/**\n * React hook to get class names and data attributes for a component with responsive support\n * @param componentName - The name of the component\n * @param props - Object with prop values (can be responsive)\n * @returns Object with classNames and dataAttributes\n */\nexport function useStyles<T extends ComponentDefinitionName>(\n componentName: T,\n props: Record<string, any> = {},\n): {\n classNames: ComponentClassNames<T>;\n dataAttributes: Record<string, string>;\n resolvedProps: Record<string, string>;\n} {\n const { breakpoint } = useBreakpoint();\n const classNames = componentDefinitions[componentName]\n .classNames as ComponentClassNames<T>;\n\n // Resolve responsive values and generate data attributes\n const dataAttributes: Record<string, string> = {};\n const resolvedProps: Record<string, string> = {};\n\n for (const [key, value] of Object.entries(props)) {\n if (value !== undefined && value !== null) {\n const resolvedValue = resolveResponsiveValue(value, breakpoint);\n if (resolvedValue !== undefined) {\n resolvedProps[key] = resolvedValue;\n dataAttributes[`data-${key}`] = resolvedValue;\n }\n }\n }\n\n return {\n classNames,\n dataAttributes,\n resolvedProps, // Also return resolved props for convenience\n };\n}\n"],"names":[],"mappings":";;;AAyBA,SAAS,sBAAA,CACP,OACA,UAAA,EACoB;AACpB,EAAA,IAAI,OAAO,UAAU,QAAA,EAAU;AAC7B,IAAA,OAAO,KAAA;AAAA,EACT;AAEA,EAAA,IAAI,OAAO,KAAA,KAAU,QAAA,IAAY,KAAA,KAAU,IAAA,EAAM;AAC/C,IAAA,MAAM,QAAQ,WAAA,CAAY,SAAA,CAAU,CAAA,CAAA,KAAK,CAA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CAAE,CAAA,GAAI,aAAA;AAAA,MAClC;AAAA,IACF;AAAA,EACF;AAEA,EAAA,OAAO;AAAA,IACL,UAAA;AAAA,IACA,cAAA;AAAA,IACA;AAAA;AAAA,GACF;AACF;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { ReactNode, ReactElement, ElementType, ComponentPropsWithRef,
|
|
2
|
+
import { ReactNode, ReactElement, ElementType, ComponentPropsWithRef, ForwardRefExoticComponent, ComponentProps, RefAttributes } from 'react';
|
|
3
3
|
import { RemixiconComponentType } from '@remixicon/react';
|
|
4
4
|
import { Avatar as Avatar$1 } from '@base-ui-components/react/avatar';
|
|
5
5
|
import { ButtonProps as ButtonProps$1, 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, RowProps, CellProps as CellProps$1, TextFieldProps as TextFieldProps$1, TooltipProps as TooltipProps$1, TooltipTriggerComponentProps, SearchFieldProps as SearchFieldProps$1, SelectProps as SelectProps$1, SwitchProps as SwitchProps$1 } from 'react-aria-components';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"display.props.esm.js","sources":["../../src/props/display.props.ts"],"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 type { PropDef, GetPropDefTypes } from './prop-def';\n\nconst displayValues = ['none', 'inline', 'inline-block', 'block'] as const;\n\n/** @public */\nconst displayPropDefs = {\n display: {\n type: 'enum',\n className: 'bui-display',\n values: displayValues,\n responsive: true,\n },\n} satisfies {\n display: PropDef<(typeof displayValues)[number]>;\n};\n\n/** @public */\ntype DisplayProps = GetPropDefTypes<typeof displayPropDefs>;\n\nexport { displayPropDefs };\nexport type { DisplayProps };\n"],"names":[],"mappings":"AAkBA,MAAM,
|
|
1
|
+
{"version":3,"file":"display.props.esm.js","sources":["../../src/props/display.props.ts"],"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 type { PropDef, GetPropDefTypes } from './prop-def';\n\nconst displayValues = ['none', 'inline', 'inline-block', 'block'] as const;\n\n/** @public */\nconst displayPropDefs = {\n display: {\n type: 'enum',\n className: 'bui-display',\n values: displayValues,\n responsive: true,\n },\n} satisfies {\n display: PropDef<(typeof displayValues)[number]>;\n};\n\n/** @public */\ntype DisplayProps = GetPropDefTypes<typeof displayPropDefs>;\n\nexport { displayPropDefs };\nexport type { DisplayProps };\n"],"names":[],"mappings":"AAkBA,MAAM,aAAA,GAAgB,CAAC,MAAA,EAAQ,QAAA,EAAU,gBAAgB,OAAO,CAAA;AAGhE,MAAM,eAAA,GAAkB;AAAA,EACtB,OAAA,EAAS;AAAA,IACP,IAAA,EAAM,MAAA;AAAA,IACN,SAAA,EAAW,aAAA;AAAA,IACX,MAAA,EAAQ,aAAA;AAAA,IACR,UAAA,EAAY;AAAA;AAEhB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gap-props.esm.js","sources":["../../src/props/gap-props.ts"],"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 */\nimport { PropDef } from './prop-def';\nimport { GetPropDefTypes } from './prop-def';\nimport { spacingValues } from './spacing.props';\n\n/** @public */\nconst gapPropDefs = {\n gap: {\n type: 'enum | string',\n className: 'bui-gap',\n customProperties: ['--gap'],\n values: spacingValues,\n responsive: true,\n default: '4',\n },\n} satisfies {\n gap: PropDef<(typeof spacingValues)[number]>;\n};\n\n/** @public */\ntype GapProps = GetPropDefTypes<typeof gapPropDefs>;\n\nexport { gapPropDefs };\nexport type { GapProps };\n"],"names":[],"mappings":";;AAoBA,MAAM,
|
|
1
|
+
{"version":3,"file":"gap-props.esm.js","sources":["../../src/props/gap-props.ts"],"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 */\nimport { PropDef } from './prop-def';\nimport { GetPropDefTypes } from './prop-def';\nimport { spacingValues } from './spacing.props';\n\n/** @public */\nconst gapPropDefs = {\n gap: {\n type: 'enum | string',\n className: 'bui-gap',\n customProperties: ['--gap'],\n values: spacingValues,\n responsive: true,\n default: '4',\n },\n} satisfies {\n gap: PropDef<(typeof spacingValues)[number]>;\n};\n\n/** @public */\ntype GapProps = GetPropDefTypes<typeof gapPropDefs>;\n\nexport { gapPropDefs };\nexport type { GapProps };\n"],"names":[],"mappings":";;AAoBA,MAAM,WAAA,GAAc;AAAA,EAClB,GAAA,EAAK;AAAA,IACH,IAAA,EAAM,eAAA;AAAA,IACN,SAAA,EAAW,SAAA;AAAA,IACX,gBAAA,EAAkB,CAAC,OAAO,CAAA;AAAA,IAC1B,MAAA,EAAQ,aAAA;AAAA,IACR,UAAA,EAAY,IAAA;AAAA,IACZ,OAAA,EAAS;AAAA;AAEb;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"height.props.esm.js","sources":["../../src/props/height.props.ts"],"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 */\nimport type { PropDef, GetPropDefTypes } from './prop-def';\n\n/** @public */\nconst heightPropDefs = {\n height: {\n type: 'string',\n className: 'bui-h',\n customProperties: ['--height'],\n responsive: true,\n },\n minHeight: {\n type: 'string',\n className: 'bui-min-h',\n customProperties: ['--min-height'],\n responsive: true,\n },\n maxHeight: {\n type: 'string',\n className: 'bui-max-h',\n customProperties: ['--max-height'],\n responsive: true,\n },\n} satisfies {\n height: PropDef<string>;\n minHeight: PropDef<string>;\n maxHeight: PropDef<string>;\n};\n\n/** @public */\ntype HeightProps = GetPropDefTypes<typeof heightPropDefs>;\n\nexport { heightPropDefs };\nexport type { HeightProps };\n"],"names":[],"mappings":"AAkBA,MAAM,
|
|
1
|
+
{"version":3,"file":"height.props.esm.js","sources":["../../src/props/height.props.ts"],"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 */\nimport type { PropDef, GetPropDefTypes } from './prop-def';\n\n/** @public */\nconst heightPropDefs = {\n height: {\n type: 'string',\n className: 'bui-h',\n customProperties: ['--height'],\n responsive: true,\n },\n minHeight: {\n type: 'string',\n className: 'bui-min-h',\n customProperties: ['--min-height'],\n responsive: true,\n },\n maxHeight: {\n type: 'string',\n className: 'bui-max-h',\n customProperties: ['--max-height'],\n responsive: true,\n },\n} satisfies {\n height: PropDef<string>;\n minHeight: PropDef<string>;\n maxHeight: PropDef<string>;\n};\n\n/** @public */\ntype HeightProps = GetPropDefTypes<typeof heightPropDefs>;\n\nexport { heightPropDefs };\nexport type { HeightProps };\n"],"names":[],"mappings":"AAkBA,MAAM,cAAA,GAAiB;AAAA,EACrB,MAAA,EAAQ;AAAA,IACN,IAAA,EAAM,QAAA;AAAA,IACN,SAAA,EAAW,OAAA;AAAA,IACX,gBAAA,EAAkB,CAAC,UAAU,CAAA;AAAA,IAC7B,UAAA,EAAY;AAAA,GACd;AAAA,EACA,SAAA,EAAW;AAAA,IACT,IAAA,EAAM,QAAA;AAAA,IACN,SAAA,EAAW,WAAA;AAAA,IACX,gBAAA,EAAkB,CAAC,cAAc,CAAA;AAAA,IACjC,UAAA,EAAY;AAAA,GACd;AAAA,EACA,SAAA,EAAW;AAAA,IACT,IAAA,EAAM,QAAA;AAAA,IACN,SAAA,EAAW,WAAA;AAAA,IACX,gBAAA,EAAkB,CAAC,cAAc,CAAA;AAAA,IACjC,UAAA,EAAY;AAAA;AAEhB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"margin.props.esm.js","sources":["../../src/props/margin.props.ts"],"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 */\nimport type { PropDef, GetPropDefTypes } from './prop-def';\n\n/** @public */\nconst marginPropDefs = (spacingValues: string[]) =>\n ({\n m: {\n type: 'enum | string',\n values: spacingValues,\n className: 'bui-m',\n customProperties: ['--m'],\n responsive: true,\n },\n mx: {\n type: 'enum | string',\n values: spacingValues,\n className: 'bui-mx',\n customProperties: ['--mx'],\n responsive: true,\n },\n my: {\n type: 'enum | string',\n values: spacingValues,\n className: 'bui-my',\n customProperties: ['--my'],\n responsive: true,\n },\n mt: {\n type: 'enum | string',\n values: spacingValues,\n className: 'bui-mt',\n customProperties: ['--mt'],\n responsive: true,\n },\n mr: {\n type: 'enum | string',\n values: spacingValues,\n className: 'bui-mr',\n customProperties: ['--mr'],\n responsive: true,\n },\n mb: {\n type: 'enum | string',\n values: spacingValues,\n className: 'bui-mb',\n customProperties: ['--mb'],\n responsive: true,\n },\n ml: {\n type: 'enum | string',\n values: spacingValues,\n className: 'bui-ml',\n customProperties: ['--ml'],\n responsive: true,\n },\n } satisfies {\n m: PropDef<(typeof spacingValues)[number]>;\n mx: PropDef<(typeof spacingValues)[number]>;\n my: PropDef<(typeof spacingValues)[number]>;\n mt: PropDef<(typeof spacingValues)[number]>;\n mr: PropDef<(typeof spacingValues)[number]>;\n mb: PropDef<(typeof spacingValues)[number]>;\n ml: PropDef<(typeof spacingValues)[number]>;\n });\n\n/** @public */\ntype MarginProps = GetPropDefTypes<typeof marginPropDefs>;\n\nexport { marginPropDefs };\nexport type { MarginProps };\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"margin.props.esm.js","sources":["../../src/props/margin.props.ts"],"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 */\nimport type { PropDef, GetPropDefTypes } from './prop-def';\n\n/** @public */\nconst marginPropDefs = (spacingValues: string[]) =>\n ({\n m: {\n type: 'enum | string',\n values: spacingValues,\n className: 'bui-m',\n customProperties: ['--m'],\n responsive: true,\n },\n mx: {\n type: 'enum | string',\n values: spacingValues,\n className: 'bui-mx',\n customProperties: ['--mx'],\n responsive: true,\n },\n my: {\n type: 'enum | string',\n values: spacingValues,\n className: 'bui-my',\n customProperties: ['--my'],\n responsive: true,\n },\n mt: {\n type: 'enum | string',\n values: spacingValues,\n className: 'bui-mt',\n customProperties: ['--mt'],\n responsive: true,\n },\n mr: {\n type: 'enum | string',\n values: spacingValues,\n className: 'bui-mr',\n customProperties: ['--mr'],\n responsive: true,\n },\n mb: {\n type: 'enum | string',\n values: spacingValues,\n className: 'bui-mb',\n customProperties: ['--mb'],\n responsive: true,\n },\n ml: {\n type: 'enum | string',\n values: spacingValues,\n className: 'bui-ml',\n customProperties: ['--ml'],\n responsive: true,\n },\n } satisfies {\n m: PropDef<(typeof spacingValues)[number]>;\n mx: PropDef<(typeof spacingValues)[number]>;\n my: PropDef<(typeof spacingValues)[number]>;\n mt: PropDef<(typeof spacingValues)[number]>;\n mr: PropDef<(typeof spacingValues)[number]>;\n mb: PropDef<(typeof spacingValues)[number]>;\n ml: PropDef<(typeof spacingValues)[number]>;\n });\n\n/** @public */\ntype MarginProps = GetPropDefTypes<typeof marginPropDefs>;\n\nexport { marginPropDefs };\nexport type { MarginProps };\n"],"names":[],"mappings":"AAkBA,MAAM,cAAA,GAAiB,CAAC,aAAA,MACrB;AAAA,EACC,CAAA,EAAG;AAAA,IACD,IAAA,EAAM,eAAA;AAAA,IACN,MAAA,EAAQ,aAAA;AAAA,IACR,SAAA,EAAW,OAAA;AAAA,IACX,gBAAA,EAAkB,CAAC,KAAK,CAAA;AAAA,IACxB,UAAA,EAAY;AAAA,GACd;AAAA,EACA,EAAA,EAAI;AAAA,IACF,IAAA,EAAM,eAAA;AAAA,IACN,MAAA,EAAQ,aAAA;AAAA,IACR,SAAA,EAAW,QAAA;AAAA,IACX,gBAAA,EAAkB,CAAC,MAAM,CAAA;AAAA,IACzB,UAAA,EAAY;AAAA,GACd;AAAA,EACA,EAAA,EAAI;AAAA,IACF,IAAA,EAAM,eAAA;AAAA,IACN,MAAA,EAAQ,aAAA;AAAA,IACR,SAAA,EAAW,QAAA;AAAA,IACX,gBAAA,EAAkB,CAAC,MAAM,CAAA;AAAA,IACzB,UAAA,EAAY;AAAA,GACd;AAAA,EACA,EAAA,EAAI;AAAA,IACF,IAAA,EAAM,eAAA;AAAA,IACN,MAAA,EAAQ,aAAA;AAAA,IACR,SAAA,EAAW,QAAA;AAAA,IACX,gBAAA,EAAkB,CAAC,MAAM,CAAA;AAAA,IACzB,UAAA,EAAY;AAAA,GACd;AAAA,EACA,EAAA,EAAI;AAAA,IACF,IAAA,EAAM,eAAA;AAAA,IACN,MAAA,EAAQ,aAAA;AAAA,IACR,SAAA,EAAW,QAAA;AAAA,IACX,gBAAA,EAAkB,CAAC,MAAM,CAAA;AAAA,IACzB,UAAA,EAAY;AAAA,GACd;AAAA,EACA,EAAA,EAAI;AAAA,IACF,IAAA,EAAM,eAAA;AAAA,IACN,MAAA,EAAQ,aAAA;AAAA,IACR,SAAA,EAAW,QAAA;AAAA,IACX,gBAAA,EAAkB,CAAC,MAAM,CAAA;AAAA,IACzB,UAAA,EAAY;AAAA,GACd;AAAA,EACA,EAAA,EAAI;AAAA,IACF,IAAA,EAAM,eAAA;AAAA,IACN,MAAA,EAAQ,aAAA;AAAA,IACR,SAAA,EAAW,QAAA;AAAA,IACX,gBAAA,EAAkB,CAAC,MAAM,CAAA;AAAA,IACzB,UAAA,EAAY;AAAA;AAEhB,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"padding.props.esm.js","sources":["../../src/props/padding.props.ts"],"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 */\nimport { PropDef } from './prop-def';\nimport { GetPropDefTypes } from './prop-def';\n\n/** @public */\nconst paddingPropDefs = (spacingValues: string[]) =>\n ({\n p: {\n type: 'enum | string',\n className: 'bui-p',\n customProperties: ['--p'],\n values: spacingValues,\n responsive: true,\n },\n px: {\n type: 'enum | string',\n className: 'bui-px',\n customProperties: ['--px'],\n values: spacingValues,\n responsive: true,\n },\n py: {\n type: 'enum | string',\n className: 'bui-py',\n customProperties: ['--py'],\n values: spacingValues,\n responsive: true,\n },\n pt: {\n type: 'enum | string',\n className: 'bui-pt',\n customProperties: ['--pt'],\n values: spacingValues,\n responsive: true,\n },\n pr: {\n type: 'enum | string',\n className: 'bui-pr',\n customProperties: ['--pr'],\n values: spacingValues,\n responsive: true,\n },\n pb: {\n type: 'enum | string',\n className: 'bui-pb',\n customProperties: ['--pb'],\n values: spacingValues,\n responsive: true,\n },\n pl: {\n type: 'enum | string',\n className: 'bui-pl',\n customProperties: ['--pl'],\n values: spacingValues,\n responsive: true,\n },\n } satisfies {\n p: PropDef<(typeof spacingValues)[number]>;\n px: PropDef<(typeof spacingValues)[number]>;\n py: PropDef<(typeof spacingValues)[number]>;\n pt: PropDef<(typeof spacingValues)[number]>;\n pr: PropDef<(typeof spacingValues)[number]>;\n pb: PropDef<(typeof spacingValues)[number]>;\n pl: PropDef<(typeof spacingValues)[number]>;\n });\n\n/** @public */\ntype PaddingProps = GetPropDefTypes<typeof paddingPropDefs>;\n\nexport { paddingPropDefs };\nexport type { PaddingProps };\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"padding.props.esm.js","sources":["../../src/props/padding.props.ts"],"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 */\nimport { PropDef } from './prop-def';\nimport { GetPropDefTypes } from './prop-def';\n\n/** @public */\nconst paddingPropDefs = (spacingValues: string[]) =>\n ({\n p: {\n type: 'enum | string',\n className: 'bui-p',\n customProperties: ['--p'],\n values: spacingValues,\n responsive: true,\n },\n px: {\n type: 'enum | string',\n className: 'bui-px',\n customProperties: ['--px'],\n values: spacingValues,\n responsive: true,\n },\n py: {\n type: 'enum | string',\n className: 'bui-py',\n customProperties: ['--py'],\n values: spacingValues,\n responsive: true,\n },\n pt: {\n type: 'enum | string',\n className: 'bui-pt',\n customProperties: ['--pt'],\n values: spacingValues,\n responsive: true,\n },\n pr: {\n type: 'enum | string',\n className: 'bui-pr',\n customProperties: ['--pr'],\n values: spacingValues,\n responsive: true,\n },\n pb: {\n type: 'enum | string',\n className: 'bui-pb',\n customProperties: ['--pb'],\n values: spacingValues,\n responsive: true,\n },\n pl: {\n type: 'enum | string',\n className: 'bui-pl',\n customProperties: ['--pl'],\n values: spacingValues,\n responsive: true,\n },\n } satisfies {\n p: PropDef<(typeof spacingValues)[number]>;\n px: PropDef<(typeof spacingValues)[number]>;\n py: PropDef<(typeof spacingValues)[number]>;\n pt: PropDef<(typeof spacingValues)[number]>;\n pr: PropDef<(typeof spacingValues)[number]>;\n pb: PropDef<(typeof spacingValues)[number]>;\n pl: PropDef<(typeof spacingValues)[number]>;\n });\n\n/** @public */\ntype PaddingProps = GetPropDefTypes<typeof paddingPropDefs>;\n\nexport { paddingPropDefs };\nexport type { PaddingProps };\n"],"names":[],"mappings":"AAmBA,MAAM,eAAA,GAAkB,CAAC,aAAA,MACtB;AAAA,EACC,CAAA,EAAG;AAAA,IACD,IAAA,EAAM,eAAA;AAAA,IACN,SAAA,EAAW,OAAA;AAAA,IACX,gBAAA,EAAkB,CAAC,KAAK,CAAA;AAAA,IACxB,MAAA,EAAQ,aAAA;AAAA,IACR,UAAA,EAAY;AAAA,GACd;AAAA,EACA,EAAA,EAAI;AAAA,IACF,IAAA,EAAM,eAAA;AAAA,IACN,SAAA,EAAW,QAAA;AAAA,IACX,gBAAA,EAAkB,CAAC,MAAM,CAAA;AAAA,IACzB,MAAA,EAAQ,aAAA;AAAA,IACR,UAAA,EAAY;AAAA,GACd;AAAA,EACA,EAAA,EAAI;AAAA,IACF,IAAA,EAAM,eAAA;AAAA,IACN,SAAA,EAAW,QAAA;AAAA,IACX,gBAAA,EAAkB,CAAC,MAAM,CAAA;AAAA,IACzB,MAAA,EAAQ,aAAA;AAAA,IACR,UAAA,EAAY;AAAA,GACd;AAAA,EACA,EAAA,EAAI;AAAA,IACF,IAAA,EAAM,eAAA;AAAA,IACN,SAAA,EAAW,QAAA;AAAA,IACX,gBAAA,EAAkB,CAAC,MAAM,CAAA;AAAA,IACzB,MAAA,EAAQ,aAAA;AAAA,IACR,UAAA,EAAY;AAAA,GACd;AAAA,EACA,EAAA,EAAI;AAAA,IACF,IAAA,EAAM,eAAA;AAAA,IACN,SAAA,EAAW,QAAA;AAAA,IACX,gBAAA,EAAkB,CAAC,MAAM,CAAA;AAAA,IACzB,MAAA,EAAQ,aAAA;AAAA,IACR,UAAA,EAAY;AAAA,GACd;AAAA,EACA,EAAA,EAAI;AAAA,IACF,IAAA,EAAM,eAAA;AAAA,IACN,SAAA,EAAW,QAAA;AAAA,IACX,gBAAA,EAAkB,CAAC,MAAM,CAAA;AAAA,IACzB,MAAA,EAAQ,aAAA;AAAA,IACR,UAAA,EAAY;AAAA,GACd;AAAA,EACA,EAAA,EAAI;AAAA,IACF,IAAA,EAAM,eAAA;AAAA,IACN,SAAA,EAAW,QAAA;AAAA,IACX,gBAAA,EAAkB,CAAC,MAAM,CAAA;AAAA,IACzB,MAAA,EAAQ,aAAA;AAAA,IACR,UAAA,EAAY;AAAA;AAEhB,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"position.props.esm.js","sources":["../../src/props/position.props.ts"],"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 */\nimport type { PropDef, GetPropDefTypes } from './prop-def';\n\n/** @public */\nconst positionValues = [\n 'static',\n 'relative',\n 'absolute',\n 'fixed',\n 'sticky',\n] as const;\n\n/** @public */\nconst positionPropDefs = {\n position: {\n type: 'enum',\n className: 'bui-position',\n values: positionValues,\n responsive: true,\n },\n} satisfies {\n position: PropDef<(typeof positionValues)[number]>;\n};\n\n// Use all of the imported prop defs to ensure that JSDoc works\n/** @public */\ntype PositionProps = GetPropDefTypes<typeof positionPropDefs>;\n\nexport { positionPropDefs };\nexport type { PositionProps };\n"],"names":[],"mappings":"AAkBA,MAAM,
|
|
1
|
+
{"version":3,"file":"position.props.esm.js","sources":["../../src/props/position.props.ts"],"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 */\nimport type { PropDef, GetPropDefTypes } from './prop-def';\n\n/** @public */\nconst positionValues = [\n 'static',\n 'relative',\n 'absolute',\n 'fixed',\n 'sticky',\n] as const;\n\n/** @public */\nconst positionPropDefs = {\n position: {\n type: 'enum',\n className: 'bui-position',\n values: positionValues,\n responsive: true,\n },\n} satisfies {\n position: PropDef<(typeof positionValues)[number]>;\n};\n\n// Use all of the imported prop defs to ensure that JSDoc works\n/** @public */\ntype PositionProps = GetPropDefTypes<typeof positionPropDefs>;\n\nexport { positionPropDefs };\nexport type { PositionProps };\n"],"names":[],"mappings":"AAkBA,MAAM,cAAA,GAAiB;AAAA,EACrB,QAAA;AAAA,EACA,UAAA;AAAA,EACA,UAAA;AAAA,EACA,OAAA;AAAA,EACA;AACF,CAAA;AAGA,MAAM,gBAAA,GAAmB;AAAA,EACvB,QAAA,EAAU;AAAA,IACR,IAAA,EAAM,MAAA;AAAA,IACN,SAAA,EAAW,cAAA;AAAA,IACX,MAAA,EAAQ,cAAA;AAAA,IACR,UAAA,EAAY;AAAA;AAEhB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prop-def.esm.js","sources":["../../src/props/prop-def.ts"],"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 */\nimport type { ReactNode } from 'react';\nimport type { Breakpoint, Responsive } from '../types';\n\n/** @public */\nconst breakpoints = ['initial', 'xs', 'sm', 'md', 'lg', 'xl'] as Breakpoint[];\n\n/** @public */\nexport type BooleanPropDef = {\n type: 'boolean';\n default?: boolean;\n required?: boolean;\n className?: string;\n};\n\n/** @public */\nexport type StringPropDef = {\n type: 'string';\n default?: string;\n required?: boolean;\n};\n\n/** @public */\nexport type ReactNodePropDef = {\n type: 'ReactNode';\n default?: ReactNode;\n required?: boolean;\n};\n\n/** @public */\nexport type EnumPropDef<T> = {\n type: 'enum';\n values: readonly T[];\n default?: T;\n required?: boolean;\n};\n\n/** @public */\nexport type EnumOrStringPropDef<T> = {\n type: 'enum | string';\n values: readonly T[];\n default?: T | string;\n required?: boolean;\n};\n\n/** @public */\nexport type NonStylingPropDef = {\n className?: never;\n customProperties?: never;\n parseValue?: never;\n};\n\n/** @public */\nexport type StylingPropDef = {\n className: string;\n parseValue?: (value: string) => string | undefined;\n};\n\n/** @public */\nexport type ArbitraryStylingPropDef = {\n className: string;\n customProperties: `--${string}`[];\n parseValue?: (value: string) => string | undefined;\n};\n\n/** @public */\nexport type RegularPropDef<T> =\n | ReactNodePropDef\n | BooleanPropDef\n | (StringPropDef & ArbitraryStylingPropDef)\n | (StringPropDef & NonStylingPropDef)\n | (EnumPropDef<T> & StylingPropDef)\n | (EnumPropDef<T> & NonStylingPropDef)\n | (EnumOrStringPropDef<T> & ArbitraryStylingPropDef)\n | (EnumOrStringPropDef<T> & NonStylingPropDef);\n\n/** @public */\ntype ResponsivePropDef<T = any> = RegularPropDef<T> & {\n responsive: true;\n};\n\n/** @public */\ntype PropDef<T = any> = RegularPropDef<T> | ResponsivePropDef<T>;\n\n/** @public */\nexport type GetPropDefType<Def> = Def extends BooleanPropDef\n ? Def extends ResponsivePropDef\n ? Responsive<boolean>\n : boolean\n : Def extends StringPropDef\n ? Def extends ResponsivePropDef\n ? Responsive<string>\n : string\n : Def extends ReactNodePropDef\n ? Def extends ResponsivePropDef\n ? Responsive<ReactNode>\n : ReactNode\n : Def extends EnumOrStringPropDef<infer Type>\n ? Def extends ResponsivePropDef<infer Type extends string>\n ? Responsive<string | Type>\n : string | Type\n : Def extends EnumPropDef<infer Type>\n ? Def extends ResponsivePropDef<infer Type>\n ? Responsive<Type>\n : Type\n : never;\n\n/** @public */\ntype GetPropDefTypes<P> = {\n [K in keyof P]?: GetPropDefType<P[K]>;\n};\n\nexport { breakpoints };\nexport type {\n PropDef,\n GetPropDefTypes,\n ResponsivePropDef,\n Breakpoint,\n Responsive,\n};\n"],"names":[],"mappings":"AAmBA,MAAM,cAAc,CAAC,SAAA,EAAW,MAAM,
|
|
1
|
+
{"version":3,"file":"prop-def.esm.js","sources":["../../src/props/prop-def.ts"],"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 */\nimport type { ReactNode } from 'react';\nimport type { Breakpoint, Responsive } from '../types';\n\n/** @public */\nconst breakpoints = ['initial', 'xs', 'sm', 'md', 'lg', 'xl'] as Breakpoint[];\n\n/** @public */\nexport type BooleanPropDef = {\n type: 'boolean';\n default?: boolean;\n required?: boolean;\n className?: string;\n};\n\n/** @public */\nexport type StringPropDef = {\n type: 'string';\n default?: string;\n required?: boolean;\n};\n\n/** @public */\nexport type ReactNodePropDef = {\n type: 'ReactNode';\n default?: ReactNode;\n required?: boolean;\n};\n\n/** @public */\nexport type EnumPropDef<T> = {\n type: 'enum';\n values: readonly T[];\n default?: T;\n required?: boolean;\n};\n\n/** @public */\nexport type EnumOrStringPropDef<T> = {\n type: 'enum | string';\n values: readonly T[];\n default?: T | string;\n required?: boolean;\n};\n\n/** @public */\nexport type NonStylingPropDef = {\n className?: never;\n customProperties?: never;\n parseValue?: never;\n};\n\n/** @public */\nexport type StylingPropDef = {\n className: string;\n parseValue?: (value: string) => string | undefined;\n};\n\n/** @public */\nexport type ArbitraryStylingPropDef = {\n className: string;\n customProperties: `--${string}`[];\n parseValue?: (value: string) => string | undefined;\n};\n\n/** @public */\nexport type RegularPropDef<T> =\n | ReactNodePropDef\n | BooleanPropDef\n | (StringPropDef & ArbitraryStylingPropDef)\n | (StringPropDef & NonStylingPropDef)\n | (EnumPropDef<T> & StylingPropDef)\n | (EnumPropDef<T> & NonStylingPropDef)\n | (EnumOrStringPropDef<T> & ArbitraryStylingPropDef)\n | (EnumOrStringPropDef<T> & NonStylingPropDef);\n\n/** @public */\ntype ResponsivePropDef<T = any> = RegularPropDef<T> & {\n responsive: true;\n};\n\n/** @public */\ntype PropDef<T = any> = RegularPropDef<T> | ResponsivePropDef<T>;\n\n/** @public */\nexport type GetPropDefType<Def> = Def extends BooleanPropDef\n ? Def extends ResponsivePropDef\n ? Responsive<boolean>\n : boolean\n : Def extends StringPropDef\n ? Def extends ResponsivePropDef\n ? Responsive<string>\n : string\n : Def extends ReactNodePropDef\n ? Def extends ResponsivePropDef\n ? Responsive<ReactNode>\n : ReactNode\n : Def extends EnumOrStringPropDef<infer Type>\n ? Def extends ResponsivePropDef<infer Type extends string>\n ? Responsive<string | Type>\n : string | Type\n : Def extends EnumPropDef<infer Type>\n ? Def extends ResponsivePropDef<infer Type>\n ? Responsive<Type>\n : Type\n : never;\n\n/** @public */\ntype GetPropDefTypes<P> = {\n [K in keyof P]?: GetPropDefType<P[K]>;\n};\n\nexport { breakpoints };\nexport type {\n PropDef,\n GetPropDefTypes,\n ResponsivePropDef,\n Breakpoint,\n Responsive,\n};\n"],"names":[],"mappings":"AAmBA,MAAM,cAAc,CAAC,SAAA,EAAW,MAAM,IAAA,EAAM,IAAA,EAAM,MAAM,IAAI;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spacing.props.esm.js","sources":["../../src/props/spacing.props.ts"],"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 */\nimport { paddingPropDefs } from './padding.props';\nimport { marginPropDefs } from './margin.props';\n\nexport const spacingValues = [\n '0.5',\n '1',\n '1.5',\n '2',\n '3',\n '4',\n '5',\n '6',\n '7',\n '8',\n '9',\n '10',\n '11',\n '12',\n '13',\n '14',\n];\n\nexport const spacingPropDefs = {\n ...paddingPropDefs(spacingValues),\n ...marginPropDefs(spacingValues),\n};\n"],"names":[],"mappings":";;;AAkBO,MAAM,
|
|
1
|
+
{"version":3,"file":"spacing.props.esm.js","sources":["../../src/props/spacing.props.ts"],"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 */\nimport { paddingPropDefs } from './padding.props';\nimport { marginPropDefs } from './margin.props';\n\nexport const spacingValues = [\n '0.5',\n '1',\n '1.5',\n '2',\n '3',\n '4',\n '5',\n '6',\n '7',\n '8',\n '9',\n '10',\n '11',\n '12',\n '13',\n '14',\n];\n\nexport const spacingPropDefs = {\n ...paddingPropDefs(spacingValues),\n ...marginPropDefs(spacingValues),\n};\n"],"names":[],"mappings":";;;AAkBO,MAAM,aAAA,GAAgB;AAAA,EAC3B,KAAA;AAAA,EACA,GAAA;AAAA,EACA,KAAA;AAAA,EACA,GAAA;AAAA,EACA,GAAA;AAAA,EACA,GAAA;AAAA,EACA,GAAA;AAAA,EACA,GAAA;AAAA,EACA,GAAA;AAAA,EACA,GAAA;AAAA,EACA,GAAA;AAAA,EACA,IAAA;AAAA,EACA,IAAA;AAAA,EACA,IAAA;AAAA,EACA,IAAA;AAAA,EACA;AACF;AAEO,MAAM,eAAA,GAAkB;AAAA,EAC7B,GAAG,gBAAgB,aAAa,CAAA;AAAA,EAChC,GAAG,eAAe,aAAa;AACjC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"width.props.esm.js","sources":["../../src/props/width.props.ts"],"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 */\nimport type { GetPropDefTypes, PropDef } from './prop-def';\n\n/** @public */\nconst widthPropDefs = {\n width: {\n type: 'string',\n className: 'bui-w',\n customProperties: ['--width'],\n responsive: true,\n },\n minWidth: {\n type: 'string',\n className: 'bui-min-w',\n customProperties: ['--min-width'],\n responsive: true,\n },\n maxWidth: {\n type: 'string',\n className: 'bui-max-w',\n customProperties: ['--max-width'],\n responsive: true,\n },\n} satisfies {\n width: PropDef<string>;\n minWidth: PropDef<string>;\n maxWidth: PropDef<string>;\n};\n\n/** @public */\ntype WidthProps = GetPropDefTypes<typeof widthPropDefs>;\n\nexport { widthPropDefs };\nexport type { WidthProps };\n"],"names":[],"mappings":"AAkBA,MAAM,
|
|
1
|
+
{"version":3,"file":"width.props.esm.js","sources":["../../src/props/width.props.ts"],"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 */\nimport type { GetPropDefTypes, PropDef } from './prop-def';\n\n/** @public */\nconst widthPropDefs = {\n width: {\n type: 'string',\n className: 'bui-w',\n customProperties: ['--width'],\n responsive: true,\n },\n minWidth: {\n type: 'string',\n className: 'bui-min-w',\n customProperties: ['--min-width'],\n responsive: true,\n },\n maxWidth: {\n type: 'string',\n className: 'bui-max-w',\n customProperties: ['--max-width'],\n responsive: true,\n },\n} satisfies {\n width: PropDef<string>;\n minWidth: PropDef<string>;\n maxWidth: PropDef<string>;\n};\n\n/** @public */\ntype WidthProps = GetPropDefTypes<typeof widthPropDefs>;\n\nexport { widthPropDefs };\nexport type { WidthProps };\n"],"names":[],"mappings":"AAkBA,MAAM,aAAA,GAAgB;AAAA,EACpB,KAAA,EAAO;AAAA,IACL,IAAA,EAAM,QAAA;AAAA,IACN,SAAA,EAAW,OAAA;AAAA,IACX,gBAAA,EAAkB,CAAC,SAAS,CAAA;AAAA,IAC5B,UAAA,EAAY;AAAA,GACd;AAAA,EACA,QAAA,EAAU;AAAA,IACR,IAAA,EAAM,QAAA;AAAA,IACN,SAAA,EAAW,WAAA;AAAA,IACX,gBAAA,EAAkB,CAAC,aAAa,CAAA;AAAA,IAChC,UAAA,EAAY;AAAA,GACd;AAAA,EACA,QAAA,EAAU;AAAA,IACR,IAAA,EAAM,QAAA;AAAA,IACN,SAAA,EAAW,WAAA;AAAA,IACX,gBAAA,EAAkB,CAAC,aAAa,CAAA;AAAA,IAChC,UAAA,EAAY;AAAA;AAEhB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"componentDefinitions.esm.js","sources":["../../src/utils/componentDefinitions.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 type { ComponentDefinition } from '../types';\n\n/**\n * Component definitions for the Backstage UI library\n * @public\n */\nexport const componentDefinitions = {\n Avatar: {\n classNames: {\n root: 'bui-AvatarRoot',\n image: 'bui-AvatarImage',\n fallback: 'bui-AvatarFallback',\n },\n dataAttributes: {\n size: ['small', 'medium', 'large'] as const,\n },\n },\n Box: {\n classNames: {\n root: 'bui-Box',\n },\n },\n Button: {\n classNames: {\n root: 'bui-Button',\n },\n dataAttributes: {\n size: ['small', 'medium', 'large'] as const,\n variant: ['primary', 'secondary', 'tertiary'] as const,\n },\n },\n ButtonIcon: {\n classNames: {\n root: 'bui-ButtonIcon',\n },\n },\n ButtonLink: {\n classNames: {\n root: 'bui-ButtonLink',\n },\n },\n Card: {\n classNames: {\n root: 'bui-Card',\n header: 'bui-CardHeader',\n body: 'bui-CardBody',\n footer: 'bui-CardFooter',\n },\n },\n Checkbox: {\n classNames: {\n root: 'bui-CheckboxRoot',\n label: 'bui-CheckboxLabel',\n indicator: 'bui-CheckboxIndicator',\n },\n dataAttributes: {\n checked: [true, false] as const,\n },\n },\n Collapsible: {\n classNames: {\n root: 'bui-CollapsibleRoot',\n trigger: 'bui-CollapsibleTrigger',\n panel: 'bui-CollapsiblePanel',\n },\n },\n Container: {\n classNames: {\n root: 'bui-Container',\n },\n },\n FieldLabel: {\n classNames: {\n root: 'bui-FieldLabelWrapper',\n label: 'bui-FieldLabel',\n secondaryLabel: 'bui-FieldSecondaryLabel',\n description: 'bui-FieldDescription',\n },\n },\n Flex: {\n classNames: {\n root: 'bui-Flex',\n },\n },\n Grid: {\n classNames: {\n root: 'bui-Grid',\n item: 'bui-GridItem',\n },\n },\n Header: {\n classNames: {\n toolbar: 'bui-HeaderToolbar',\n toolbarWrapper: 'bui-HeaderToolbarWrapper',\n toolbarContent: 'bui-HeaderToolbarContent',\n toolbarControls: 'bui-HeaderToolbarControls',\n toolbarIcon: 'bui-HeaderToolbarIcon',\n toolbarName: 'bui-HeaderToolbarName',\n tabsWrapper: 'bui-HeaderTabsWrapper',\n },\n },\n HeaderPage: {\n classNames: {\n root: 'bui-HeaderPage',\n content: 'bui-HeaderPageContent',\n breadcrumbs: 'bui-HeaderPageBreadcrumbs',\n tabsWrapper: 'bui-HeaderPageTabsWrapper',\n controls: 'bui-HeaderPageControls',\n },\n },\n Heading: {\n classNames: {\n root: 'bui-Heading',\n },\n dataAttributes: {\n variant: ['title1', 'title2', 'title3', 'subtitle'] as const,\n color: ['primary', 'secondary', 'muted'] as const,\n truncate: [true, false] as const,\n },\n },\n Icon: {\n classNames: {\n root: 'bui-Icon',\n },\n },\n Link: {\n classNames: {\n root: 'bui-Link',\n },\n dataAttributes: {\n variant: ['subtitle', 'body', 'caption', 'label'] as const,\n weight: ['regular', 'bold'] as const,\n },\n },\n List: {\n classNames: {\n root: 'bui-List',\n row: 'bui-ListRow',\n label: 'bui-ListLabel',\n },\n },\n Menu: {\n classNames: {\n trigger: 'bui-MenuTrigger',\n backdrop: 'bui-MenuBackdrop',\n positioner: 'bui-MenuPositioner',\n popup: 'bui-MenuPopup',\n arrow: 'bui-MenuArrow',\n item: 'bui-MenuItem',\n group: 'bui-MenuGroup',\n groupLabel: 'bui-MenuGroupLabel',\n radioGroup: 'bui-MenuRadioGroup',\n radioItem: 'bui-MenuRadioItem',\n radioItemIndicator: 'bui-MenuRadioItemIndicator',\n checkboxItem: 'bui-MenuCheckboxItem',\n checkboxItemIndicator: 'bui-MenuCheckboxItemIndicator',\n submenuTrigger: 'bui-MenuSubmenuTrigger',\n separator: 'bui-MenuSeparator',\n },\n },\n Popover: {\n classNames: {\n root: 'bui-Popover',\n },\n },\n RadioGroup: {\n classNames: {\n root: 'bui-RadioGroup',\n content: 'bui-RadioGroupContent',\n radio: 'bui-Radio',\n },\n },\n ScrollArea: {\n classNames: {\n root: 'bui-ScrollAreaRoot',\n viewport: 'bui-ScrollAreaViewport',\n scrollbar: 'bui-ScrollAreaScrollbar',\n thumb: 'bui-ScrollAreaThumb',\n },\n },\n SearchField: {\n classNames: {\n root: 'bui-SearchField',\n clear: 'bui-InputClear',\n },\n dataAttributes: {\n startCollapsed: [true, false] as const,\n },\n },\n Select: {\n classNames: {\n root: 'bui-Select',\n trigger: 'bui-SelectTrigger',\n value: 'bui-SelectValue',\n icon: 'bui-SelectIcon',\n list: 'bui-SelectList',\n item: 'bui-SelectItem',\n itemIndicator: 'bui-SelectItemIndicator',\n itemLabel: 'bui-SelectItemLabel',\n },\n dataAttributes: {\n size: ['small', 'medium'] as const,\n },\n },\n Skeleton: {\n classNames: {\n root: 'bui-Skeleton',\n },\n },\n Switch: {\n classNames: {\n root: 'bui-Switch',\n indicator: 'bui-SwitchIndicator',\n },\n },\n Table: {\n classNames: {\n table: 'bui-Table',\n header: 'bui-TableHeader',\n body: 'bui-TableBody',\n row: 'bui-TableRow',\n head: 'bui-TableHead',\n headSortButton: 'bui-TableHeadSortButton',\n caption: 'bui-TableCaption',\n cell: 'bui-TableCell',\n cellContentWrapper: 'bui-TableCellContentWrapper',\n cellContent: 'bui-TableCellContent',\n cellIcon: 'bui-TableCellIcon',\n cellProfileAvatar: 'bui-TableCellProfileAvatar',\n cellProfileAvatarImage: 'bui-TableCellProfileAvatarImage',\n cellProfileAvatarFallback: 'bui-TableCellProfileAvatarFallback',\n cellProfileName: 'bui-TableCellProfileName',\n cellProfileLink: 'bui-TableCellProfileLink',\n },\n },\n Tabs: {\n classNames: {\n tabs: 'bui-Tabs',\n tabList: 'bui-TabList',\n tabListWrapper: 'bui-TabListWrapper',\n tab: 'bui-Tab',\n tabActive: 'bui-TabActive',\n tabHovered: 'bui-TabHovered',\n panel: 'bui-TabPanel',\n },\n },\n Text: {\n classNames: {\n root: 'bui-Text',\n },\n dataAttributes: {\n variant: ['subtitle', 'body', 'caption', 'label'] as const,\n weight: ['regular', 'bold'] as const,\n color: ['primary', 'secondary', 'danger', 'warning', 'success'] as const,\n truncate: [true, false] as const,\n },\n },\n TextField: {\n classNames: {\n root: 'bui-TextField',\n inputWrapper: 'bui-InputWrapper',\n input: 'bui-Input',\n inputIcon: 'bui-InputIcon',\n },\n dataAttributes: {\n invalid: [true, false] as const,\n disabled: [true, false] as const,\n },\n },\n Tooltip: {\n classNames: {\n tooltip: 'bui-Tooltip',\n arrow: 'bui-TooltipArrow',\n },\n },\n} as const satisfies Record<string, ComponentDefinition>;\n"],"names":[],"mappings":"AAsBO,MAAM,oBAAuB,GAAA;AAAA,EAClC,MAAQ,EAAA;AAAA,IACN,UAAY,EAAA;AAAA,MACV,IAAM,EAAA,gBAAA;AAAA,MACN,KAAO,EAAA,iBAAA;AAAA,MACP,QAAU,EAAA;AAAA,KACZ;AAAA,IACA,cAAgB,EAAA;AAAA,MACd,IAAM,EAAA,CAAC,OAAS,EAAA,QAAA,EAAU,OAAO;AAAA;AACnC,GACF;AAAA,EACA,GAAK,EAAA;AAAA,IACH,UAAY,EAA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A;AAAA,MACjB,eAAiB,EAAA;AAAA;AACnB,GACF;AAAA,EACA,IAAM,EAAA;AAAA,IACJ,UAAY,EAAA;AAAA,MACV,IAAM,EAAA,UAAA;AAAA,MACN,OAAS,EAAA,aAAA;AAAA,MACT,cAAgB,EAAA,oBAAA;AAAA,MAChB,GAAK,EAAA,SAAA;AAAA,MACL,SAAW,EAAA,eAAA;AAAA,MACX,UAAY,EAAA,gBAAA;AAAA,MACZ,KAAO,EAAA;AAAA;AACT,GACF;AAAA,EACA,IAAM,EAAA;AAAA,IACJ,UAAY,EAAA;AAAA,MACV,IAAM,EAAA;AAAA,KACR;AAAA,IACA,cAAgB,EAAA;AAAA,MACd,OAAS,EAAA,CAAC,UAAY,EAAA,MAAA,EAAQ,WAAW,OAAO,CAAA;AAAA,MAChD,MAAA,EAAQ,CAAC,SAAA,EAAW,MAAM,CAAA;AAAA,MAC1B,OAAO,CAAC,SAAA,EAAW,WAAa,EAAA,QAAA,EAAU,WAAW,SAAS,CAAA;AAAA,MAC9D,QAAA,EAAU,CAAC,IAAA,EAAM,KAAK;AAAA;AACxB,GACF;AAAA,EACA,SAAW,EAAA;AAAA,IACT,UAAY,EAAA;AAAA,MACV,IAAM,EAAA,eAAA;AAAA,MACN,YAAc,EAAA,kBAAA;AAAA,MACd,KAAO,EAAA,WAAA;AAAA,MACP,SAAW,EAAA;AAAA,KACb;AAAA,IACA,cAAgB,EAAA;AAAA,MACd,OAAA,EAAS,CAAC,IAAA,EAAM,KAAK,CAAA;AAAA,MACrB,QAAA,EAAU,CAAC,IAAA,EAAM,KAAK;AAAA;AACxB,GACF;AAAA,EACA,OAAS,EAAA;AAAA,IACP,UAAY,EAAA;AAAA,MACV,OAAS,EAAA,aAAA;AAAA,MACT,KAAO,EAAA;AAAA;AACT;AAEJ;;;;"}
|
|
1
|
+
{"version":3,"file":"componentDefinitions.esm.js","sources":["../../src/utils/componentDefinitions.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 type { ComponentDefinition } from '../types';\n\n/**\n * Component definitions for the Backstage UI library\n * @public\n */\nexport const componentDefinitions = {\n Avatar: {\n classNames: {\n root: 'bui-AvatarRoot',\n image: 'bui-AvatarImage',\n fallback: 'bui-AvatarFallback',\n },\n dataAttributes: {\n size: ['small', 'medium', 'large'] as const,\n },\n },\n Box: {\n classNames: {\n root: 'bui-Box',\n },\n },\n Button: {\n classNames: {\n root: 'bui-Button',\n },\n dataAttributes: {\n size: ['small', 'medium', 'large'] as const,\n variant: ['primary', 'secondary', 'tertiary'] as const,\n },\n },\n ButtonIcon: {\n classNames: {\n root: 'bui-ButtonIcon',\n },\n },\n ButtonLink: {\n classNames: {\n root: 'bui-ButtonLink',\n },\n },\n Card: {\n classNames: {\n root: 'bui-Card',\n header: 'bui-CardHeader',\n body: 'bui-CardBody',\n footer: 'bui-CardFooter',\n },\n },\n Checkbox: {\n classNames: {\n root: 'bui-CheckboxRoot',\n label: 'bui-CheckboxLabel',\n indicator: 'bui-CheckboxIndicator',\n },\n dataAttributes: {\n checked: [true, false] as const,\n },\n },\n Collapsible: {\n classNames: {\n root: 'bui-CollapsibleRoot',\n trigger: 'bui-CollapsibleTrigger',\n panel: 'bui-CollapsiblePanel',\n },\n },\n Container: {\n classNames: {\n root: 'bui-Container',\n },\n },\n FieldLabel: {\n classNames: {\n root: 'bui-FieldLabelWrapper',\n label: 'bui-FieldLabel',\n secondaryLabel: 'bui-FieldSecondaryLabel',\n description: 'bui-FieldDescription',\n },\n },\n Flex: {\n classNames: {\n root: 'bui-Flex',\n },\n },\n Grid: {\n classNames: {\n root: 'bui-Grid',\n item: 'bui-GridItem',\n },\n },\n Header: {\n classNames: {\n toolbar: 'bui-HeaderToolbar',\n toolbarWrapper: 'bui-HeaderToolbarWrapper',\n toolbarContent: 'bui-HeaderToolbarContent',\n toolbarControls: 'bui-HeaderToolbarControls',\n toolbarIcon: 'bui-HeaderToolbarIcon',\n toolbarName: 'bui-HeaderToolbarName',\n tabsWrapper: 'bui-HeaderTabsWrapper',\n },\n },\n HeaderPage: {\n classNames: {\n root: 'bui-HeaderPage',\n content: 'bui-HeaderPageContent',\n breadcrumbs: 'bui-HeaderPageBreadcrumbs',\n tabsWrapper: 'bui-HeaderPageTabsWrapper',\n controls: 'bui-HeaderPageControls',\n },\n },\n Heading: {\n classNames: {\n root: 'bui-Heading',\n },\n dataAttributes: {\n variant: ['title1', 'title2', 'title3', 'subtitle'] as const,\n color: ['primary', 'secondary', 'muted'] as const,\n truncate: [true, false] as const,\n },\n },\n Icon: {\n classNames: {\n root: 'bui-Icon',\n },\n },\n Link: {\n classNames: {\n root: 'bui-Link',\n },\n dataAttributes: {\n variant: ['subtitle', 'body', 'caption', 'label'] as const,\n weight: ['regular', 'bold'] as const,\n },\n },\n List: {\n classNames: {\n root: 'bui-List',\n row: 'bui-ListRow',\n label: 'bui-ListLabel',\n },\n },\n Menu: {\n classNames: {\n trigger: 'bui-MenuTrigger',\n backdrop: 'bui-MenuBackdrop',\n positioner: 'bui-MenuPositioner',\n popup: 'bui-MenuPopup',\n arrow: 'bui-MenuArrow',\n item: 'bui-MenuItem',\n group: 'bui-MenuGroup',\n groupLabel: 'bui-MenuGroupLabel',\n radioGroup: 'bui-MenuRadioGroup',\n radioItem: 'bui-MenuRadioItem',\n radioItemIndicator: 'bui-MenuRadioItemIndicator',\n checkboxItem: 'bui-MenuCheckboxItem',\n checkboxItemIndicator: 'bui-MenuCheckboxItemIndicator',\n submenuTrigger: 'bui-MenuSubmenuTrigger',\n separator: 'bui-MenuSeparator',\n },\n },\n Popover: {\n classNames: {\n root: 'bui-Popover',\n },\n },\n RadioGroup: {\n classNames: {\n root: 'bui-RadioGroup',\n content: 'bui-RadioGroupContent',\n radio: 'bui-Radio',\n },\n },\n ScrollArea: {\n classNames: {\n root: 'bui-ScrollAreaRoot',\n viewport: 'bui-ScrollAreaViewport',\n scrollbar: 'bui-ScrollAreaScrollbar',\n thumb: 'bui-ScrollAreaThumb',\n },\n },\n SearchField: {\n classNames: {\n root: 'bui-SearchField',\n clear: 'bui-InputClear',\n },\n dataAttributes: {\n startCollapsed: [true, false] as const,\n },\n },\n Select: {\n classNames: {\n root: 'bui-Select',\n trigger: 'bui-SelectTrigger',\n value: 'bui-SelectValue',\n icon: 'bui-SelectIcon',\n list: 'bui-SelectList',\n item: 'bui-SelectItem',\n itemIndicator: 'bui-SelectItemIndicator',\n itemLabel: 'bui-SelectItemLabel',\n },\n dataAttributes: {\n size: ['small', 'medium'] as const,\n },\n },\n Skeleton: {\n classNames: {\n root: 'bui-Skeleton',\n },\n },\n Switch: {\n classNames: {\n root: 'bui-Switch',\n indicator: 'bui-SwitchIndicator',\n },\n },\n Table: {\n classNames: {\n table: 'bui-Table',\n header: 'bui-TableHeader',\n body: 'bui-TableBody',\n row: 'bui-TableRow',\n head: 'bui-TableHead',\n headSortButton: 'bui-TableHeadSortButton',\n caption: 'bui-TableCaption',\n cell: 'bui-TableCell',\n cellContentWrapper: 'bui-TableCellContentWrapper',\n cellContent: 'bui-TableCellContent',\n cellIcon: 'bui-TableCellIcon',\n cellProfileAvatar: 'bui-TableCellProfileAvatar',\n cellProfileAvatarImage: 'bui-TableCellProfileAvatarImage',\n cellProfileAvatarFallback: 'bui-TableCellProfileAvatarFallback',\n cellProfileName: 'bui-TableCellProfileName',\n cellProfileLink: 'bui-TableCellProfileLink',\n },\n },\n Tabs: {\n classNames: {\n tabs: 'bui-Tabs',\n tabList: 'bui-TabList',\n tabListWrapper: 'bui-TabListWrapper',\n tab: 'bui-Tab',\n tabActive: 'bui-TabActive',\n tabHovered: 'bui-TabHovered',\n panel: 'bui-TabPanel',\n },\n },\n Text: {\n classNames: {\n root: 'bui-Text',\n },\n dataAttributes: {\n variant: ['subtitle', 'body', 'caption', 'label'] as const,\n weight: ['regular', 'bold'] as const,\n color: ['primary', 'secondary', 'danger', 'warning', 'success'] as const,\n truncate: [true, false] as const,\n },\n },\n TextField: {\n classNames: {\n root: 'bui-TextField',\n inputWrapper: 'bui-InputWrapper',\n input: 'bui-Input',\n inputIcon: 'bui-InputIcon',\n },\n dataAttributes: {\n invalid: [true, false] as const,\n disabled: [true, false] as const,\n },\n },\n Tooltip: {\n classNames: {\n tooltip: 'bui-Tooltip',\n arrow: 'bui-TooltipArrow',\n },\n },\n} as const satisfies Record<string, ComponentDefinition>;\n"],"names":[],"mappings":"AAsBO,MAAM,oBAAA,GAAuB;AAAA,EAClC,MAAA,EAAQ;AAAA,IACN,UAAA,EAAY;AAAA,MACV,IAAA,EAAM,gBAAA;AAAA,MACN,KAAA,EAAO,iBAAA;AAAA,MACP,QAAA,EAAU;AAAA,KACZ;AAAA,IACA,cAAA,EAAgB;AAAA,MACd,IAAA,EAAM,CAAC,OAAA,EAAS,QAAA,EAAU,OAAO;AAAA;AACnC,GACF;AAAA,EACA,GAAA,EAAK;AAAA,IACH,UAAA,EAAY;AAAA,MACV,IAAA,EAAM;AAAA;AACR,GACF;AAAA,EACA,MAAA,EAAQ;AAAA,IACN,UAAA,EAAY;AAAA,MACV,IAAA,EAAM;AAAA,KACR;AAAA,IACA,cAAA,EAAgB;AAAA,MACd,IAAA,EAAM,CAAC,OAAA,EAAS,QAAA,EAAU,OAAO,CAAA;AAAA,MACjC,OAAA,EAAS,CAAC,SAAA,EAAW,WAAA,EAAa,UAAU;AAAA;AAC9C,GACF;AAAA,EACA,UAAA,EAAY;AAAA,IACV,UAAA,EAAY;AAAA,MACV,IAAA,EAAM;AAAA;AACR,GACF;AAAA,EACA,UAAA,EAAY;AAAA,IACV,UAAA,EAAY;AAAA,MACV,IAAA,EAAM;A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UAAA,EAAY,MAAA,EAAQ,WAAW,OAAO,CAAA;AAAA,MAChD,MAAA,EAAQ,CAAC,SAAA,EAAW,MAAM,CAAA;AAAA,MAC1B,OAAO,CAAC,SAAA,EAAW,WAAA,EAAa,QAAA,EAAU,WAAW,SAAS,CAAA;AAAA,MAC9D,QAAA,EAAU,CAAC,IAAA,EAAM,KAAK;AAAA;AACxB,GACF;AAAA,EACA,SAAA,EAAW;AAAA,IACT,UAAA,EAAY;AAAA,MACV,IAAA,EAAM,eAAA;AAAA,MACN,YAAA,EAAc,kBAAA;AAAA,MACd,KAAA,EAAO,WAAA;AAAA,MACP,SAAA,EAAW;AAAA,KACb;AAAA,IACA,cAAA,EAAgB;AAAA,MACd,OAAA,EAAS,CAAC,IAAA,EAAM,KAAK,CAAA;AAAA,MACrB,QAAA,EAAU,CAAC,IAAA,EAAM,KAAK;AAAA;AACxB,GACF;AAAA,EACA,OAAA,EAAS;AAAA,IACP,UAAA,EAAY;AAAA,MACV,OAAA,EAAS,aAAA;AAAA,MACT,KAAA,EAAO;AAAA;AACT;AAEJ;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extractProps.esm.js","sources":["../../src/utils/extractProps.ts"],"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\ntype BasePropDef = {\n type: string;\n values?: readonly unknown[];\n default?: unknown;\n required?: boolean;\n className?: string;\n responsive?: true;\n customProperties?: string[];\n};\n\nexport function extractProps(\n props: {\n className?: string;\n style?: React.CSSProperties;\n children?: React.ReactNode;\n as?: keyof JSX.IntrinsicElements;\n [key: string]: any;\n },\n propDefs: { [name in string]: BasePropDef },\n) {\n let className: string[] = (props.className || '').split(' ');\n let style: React.CSSProperties = { ...props.style };\n\n for (const key in propDefs) {\n const propDef = propDefs[key];\n\n // Check if the prop is present or has a default value\n if (!Object.hasOwn(props, key) && !propDef.hasOwnProperty('default')) {\n continue; // Skip processing if neither is present\n }\n\n const value = Object.hasOwn(props, key)\n ? (props[key] as unknown)\n : propDefs[key].default;\n const propDefsValues = propDef.values;\n const propDefsCustomProperties = propDef.customProperties;\n const propDefsClassName = propDef.className;\n const isResponsive = propDef.responsive;\n\n const handleValue = (val: unknown, prefix: string = '') => {\n // Skip adding class name if the key is \"as\"\n if (key === 'as') return;\n\n if (propDefsValues?.includes(val)) {\n className.push(`${prefix}${propDefsClassName}-${val}`);\n } else {\n if (propDefsCustomProperties) {\n for (const customProperty of propDefsCustomProperties) {\n const customPropertyKey =\n isResponsive && prefix\n ? `${customProperty}-${prefix.slice(0, -1)}`\n : customProperty;\n style[customPropertyKey as keyof typeof style] = val as any;\n }\n }\n className.push(`${prefix}${propDefsClassName}`);\n }\n };\n\n if (isResponsive && typeof value === 'object' && value !== null) {\n const breakpointValues = value as { [key: string]: unknown };\n // Handle responsive object values\n for (const breakpoint in breakpointValues) {\n const prefix = breakpoint === 'initial' ? '' : `${breakpoint}:`;\n handleValue(breakpointValues[breakpoint], prefix);\n }\n } else {\n handleValue(value);\n }\n }\n\n // Ensure keys from props that are defined in propDefs are removed\n const cleanedProps = Object.keys(props).reduce((acc, key) => {\n if (!propDefs.hasOwnProperty(key)) {\n acc[key] = props[key];\n }\n return acc;\n }, {} as { [key: string]: any });\n\n const newClassNames = className\n .filter(name => name && name.trim() !== '')\n .join(' ');\n\n return { ...cleanedProps, className: newClassNames, style };\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"extractProps.esm.js","sources":["../../src/utils/extractProps.ts"],"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\ntype BasePropDef = {\n type: string;\n values?: readonly unknown[];\n default?: unknown;\n required?: boolean;\n className?: string;\n responsive?: true;\n customProperties?: string[];\n};\n\nexport function extractProps(\n props: {\n className?: string;\n style?: React.CSSProperties;\n children?: React.ReactNode;\n as?: keyof JSX.IntrinsicElements;\n [key: string]: any;\n },\n propDefs: { [name in string]: BasePropDef },\n) {\n let className: string[] = (props.className || '').split(' ');\n let style: React.CSSProperties = { ...props.style };\n\n for (const key in propDefs) {\n const propDef = propDefs[key];\n\n // Check if the prop is present or has a default value\n if (!Object.hasOwn(props, key) && !propDef.hasOwnProperty('default')) {\n continue; // Skip processing if neither is present\n }\n\n const value = Object.hasOwn(props, key)\n ? (props[key] as unknown)\n : propDefs[key].default;\n const propDefsValues = propDef.values;\n const propDefsCustomProperties = propDef.customProperties;\n const propDefsClassName = propDef.className;\n const isResponsive = propDef.responsive;\n\n const handleValue = (val: unknown, prefix: string = '') => {\n // Skip adding class name if the key is \"as\"\n if (key === 'as') return;\n\n if (propDefsValues?.includes(val)) {\n className.push(`${prefix}${propDefsClassName}-${val}`);\n } else {\n if (propDefsCustomProperties) {\n for (const customProperty of propDefsCustomProperties) {\n const customPropertyKey =\n isResponsive && prefix\n ? `${customProperty}-${prefix.slice(0, -1)}`\n : customProperty;\n style[customPropertyKey as keyof typeof style] = val as any;\n }\n }\n className.push(`${prefix}${propDefsClassName}`);\n }\n };\n\n if (isResponsive && typeof value === 'object' && value !== null) {\n const breakpointValues = value as { [key: string]: unknown };\n // Handle responsive object values\n for (const breakpoint in breakpointValues) {\n const prefix = breakpoint === 'initial' ? '' : `${breakpoint}:`;\n handleValue(breakpointValues[breakpoint], prefix);\n }\n } else {\n handleValue(value);\n }\n }\n\n // Ensure keys from props that are defined in propDefs are removed\n const cleanedProps = Object.keys(props).reduce((acc, key) => {\n if (!propDefs.hasOwnProperty(key)) {\n acc[key] = props[key];\n }\n return acc;\n }, {} as { [key: string]: any });\n\n const newClassNames = className\n .filter(name => name && name.trim() !== '')\n .join(' ');\n\n return { ...cleanedProps, className: newClassNames, style };\n}\n"],"names":[],"mappings":"AA0BO,SAAS,YAAA,CACd,OAOA,QAAA,EACA;AACA,EAAA,IAAI,SAAA,GAAA,CAAuB,KAAA,CAAM,SAAA,IAAa,EAAA,EAAI,MAAM,GAAG,CAAA;AAC3D,EAAA,IAAI,KAAA,GAA6B,EAAE,GAAG,KAAA,CAAM,KAAA,EAAM;AAElD,EAAA,KAAA,MAAW,OAAO,QAAA,EAAU;AAC1B,IAAA,MAAM,OAAA,GAAU,SAAS,GAAG,CAAA;AAG5B,IAAA,IAAI,CAAC,MAAA,CAAO,MAAA,CAAO,KAAA,EAAO,GAAG,KAAK,CAAC,OAAA,CAAQ,cAAA,CAAe,SAAS,CAAA,EAAG;AACpE,MAAA;AAAA,IACF;AAEA,IAAA,MAAM,KAAA,GAAQ,MAAA,CAAO,MAAA,CAAO,KAAA,EAAO,GAAG,CAAA,GACjC,KAAA,CAAM,GAAG,CAAA,GACV,QAAA,CAAS,GAAG,CAAA,CAAE,OAAA;AAClB,IAAA,MAAM,iBAAiB,OAAA,CAAQ,MAAA;AAC/B,IAAA,MAAM,2BAA2B,OAAA,CAAQ,gBAAA;AACzC,IAAA,MAAM,oBAAoB,OAAA,CAAQ,SAAA;AAClC,IAAA,MAAM,eAAe,OAAA,CAAQ,UAAA;AAE7B,IAAA,MAAM,WAAA,GAAc,CAAC,GAAA,EAAc,MAAA,GAAiB,EAAA,KAAO;AAEzD,MAAA,IAAI,QAAQ,IAAA,EAAM;AAElB,MAAA,IAAI,cAAA,EAAgB,QAAA,CA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AG,CAAA;AAAA,IACtB;AACA,IAAA,OAAO,GAAA;AAAA,EACT,CAAA,EAAG,EAA4B,CAAA;AAE/B,EAAA,MAAM,aAAA,GAAgB,SAAA,CACnB,MAAA,CAAO,CAAA,IAAA,KAAQ,IAAA,IAAQ,IAAA,CAAK,IAAA,EAAK,KAAM,EAAE,CAAA,CACzC,IAAA,CAAK,GAAG,CAAA;AAEX,EAAA,OAAO,EAAE,GAAG,YAAA,EAAc,SAAA,EAAW,eAAe,KAAA,EAAM;AAC5D;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isExternalLink.esm.js","sources":["../../src/utils/isExternalLink.ts"],"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\n/**\n * Determines if a link is external.\n * @param href - The href of the link.\n * @returns True if the link is external, false otherwise.\n * @internal\n */\nexport function isExternalLink(href?: string): boolean {\n if (!href) return false;\n\n // Check if it's an absolute URL with protocol\n if (href.startsWith('http://') || href.startsWith('https://')) {\n return true;\n }\n\n // Check if it's a protocol-relative URL\n if (href.startsWith('//')) {\n return true;\n }\n\n // Check if it's a mailto: or tel: link\n if (href.startsWith('mailto:') || href.startsWith('tel:')) {\n return true;\n }\n\n return false;\n}\n"],"names":[],"mappings":"AAsBO,SAAS,eAAe,
|
|
1
|
+
{"version":3,"file":"isExternalLink.esm.js","sources":["../../src/utils/isExternalLink.ts"],"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\n/**\n * Determines if a link is external.\n * @param href - The href of the link.\n * @returns True if the link is external, false otherwise.\n * @internal\n */\nexport function isExternalLink(href?: string): boolean {\n if (!href) return false;\n\n // Check if it's an absolute URL with protocol\n if (href.startsWith('http://') || href.startsWith('https://')) {\n return true;\n }\n\n // Check if it's a protocol-relative URL\n if (href.startsWith('//')) {\n return true;\n }\n\n // Check if it's a mailto: or tel: link\n if (href.startsWith('mailto:') || href.startsWith('tel:')) {\n return true;\n }\n\n return false;\n}\n"],"names":[],"mappings":"AAsBO,SAAS,eAAe,IAAA,EAAwB;AACrD,EAAA,IAAI,CAAC,MAAM,OAAO,KAAA;AAGlB,EAAA,IAAI,KAAK,UAAA,CAAW,SAAS,KAAK,IAAA,CAAK,UAAA,CAAW,UAAU,CAAA,EAAG;AAC7D,IAAA,OAAO,IAAA;AAAA,EACT;AAGA,EAAA,IAAI,IAAA,CAAK,UAAA,CAAW,IAAI,CAAA,EAAG;AACzB,IAAA,OAAO,IAAA;AAAA,EACT;AAGA,EAAA,IAAI,KAAK,UAAA,CAAW,SAAS,KAAK,IAAA,CAAK,UAAA,CAAW,MAAM,CAAA,EAAG;AACzD,IAAA,OAAO,IAAA;AAAA,EACT;AAEA,EAAA,OAAO,KAAA;AACT;;;;"}
|