@lobehub/ui 6.0.0-beta.4 → 6.0.0-beta.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (286) hide show
  1. package/es/ActionIcon/style.mjs +1 -1
  2. package/es/ActionIcon/style.mjs.map +1 -1
  3. package/es/Anchor/Anchor.mjs +2 -2
  4. package/es/Anchor/Anchor.mjs.map +1 -1
  5. package/es/Carousel/Carousel.mjs +1 -1
  6. package/es/Carousel/Carousel.mjs.map +1 -1
  7. package/es/CodeDiff/CodeDiff.mjs.map +1 -1
  8. package/es/CodeDiff/PatchDiff.mjs.map +1 -1
  9. package/es/CodeDiff/theme.mjs.map +1 -1
  10. package/es/CodeDiff/type.d.mts +2 -2
  11. package/es/CodeEditor/CodeEditor.mjs +1 -1
  12. package/es/CodeEditor/CodeEditor.mjs.map +1 -1
  13. package/es/ColorPicker/ColorPicker.mjs +1 -1
  14. package/es/ColorPicker/ColorPicker.mjs.map +1 -1
  15. package/es/ColorSwatches/ColorSwatches.mjs +18 -23
  16. package/es/ColorSwatches/ColorSwatches.mjs.map +1 -1
  17. package/es/ColorSwatches/CustomPicker.mjs +101 -0
  18. package/es/ColorSwatches/CustomPicker.mjs.map +1 -0
  19. package/es/ColorSwatches/index.d.mts +2 -2
  20. package/es/ColorSwatches/marker.stylex.mjs +9 -0
  21. package/es/ColorSwatches/marker.stylex.mjs.map +1 -0
  22. package/es/ColorSwatches/style.mjs +36 -0
  23. package/es/ColorSwatches/style.mjs.map +1 -1
  24. package/es/ColorSwatches/type.d.mts +9 -0
  25. package/es/ConfigProvider/cdnAssets.mjs +6 -0
  26. package/es/ConfigProvider/cdnAssets.mjs.map +1 -0
  27. package/es/ConfigProvider/index.mjs +2 -1
  28. package/es/ConfigProvider/index.mjs.map +1 -1
  29. package/es/ContextMenu/store.d.mts +0 -1
  30. package/es/ContextMenu/store.mjs.map +1 -1
  31. package/es/DatePicker/DatePicker.mjs +1 -1
  32. package/es/DatePicker/DatePicker.mjs.map +1 -1
  33. package/es/DatePicker/DateRangePicker.mjs +1 -1
  34. package/es/DatePicker/DateRangePicker.mjs.map +1 -1
  35. package/es/DraggablePanel/atoms.mjs +1 -1
  36. package/es/DraggablePanel/atoms.mjs.map +1 -1
  37. package/es/DraggableSideNav/DraggableSideNav.mjs +2 -2
  38. package/es/DraggableSideNav/DraggableSideNav.mjs.map +1 -1
  39. package/es/Drawer/atoms.mjs +1 -1
  40. package/es/Drawer/atoms.mjs.map +1 -1
  41. package/es/DropdownMenu/atoms.mjs +1 -1
  42. package/es/DropdownMenu/atoms.mjs.map +1 -1
  43. package/es/EditableText/ControlInput.mjs +42 -29
  44. package/es/EditableText/ControlInput.mjs.map +1 -1
  45. package/es/EditableText/EditableText.mjs +1 -1
  46. package/es/EditableText/EditableText.mjs.map +1 -1
  47. package/es/EmojiPicker/EmojiPicker.mjs +3 -9
  48. package/es/EmojiPicker/EmojiPicker.mjs.map +1 -1
  49. package/es/EmojiPicker/useEmojiMartI18n.mjs +37 -0
  50. package/es/EmojiPicker/useEmojiMartI18n.mjs.map +1 -0
  51. package/es/FormKit/engine/tanstack.mjs +1 -1
  52. package/es/FormKit/engine/tanstack.mjs.map +1 -1
  53. package/es/Grid/style.mjs +1 -1
  54. package/es/Grid/style.mjs.map +1 -1
  55. package/es/HotkeyInput/HotkeyInput.mjs +1 -1
  56. package/es/HotkeyInput/HotkeyInput.mjs.map +1 -1
  57. package/es/Image/type.d.mts +1 -0
  58. package/es/Image/viewer/ImageViewer.mjs +2 -1
  59. package/es/Image/viewer/ImageViewer.mjs.map +1 -1
  60. package/es/Image/viewer/Toolbar.mjs +19 -6
  61. package/es/Image/viewer/Toolbar.mjs.map +1 -1
  62. package/es/Image/viewer/ViewerChrome.mjs.map +1 -1
  63. package/es/ImageSelect/ImageSelect.mjs +1 -1
  64. package/es/ImageSelect/ImageSelect.mjs.map +1 -1
  65. package/es/Input/Input.mjs +7 -5
  66. package/es/Input/Input.mjs.map +1 -1
  67. package/es/Input/TextArea.mjs +1 -1
  68. package/es/Input/TextArea.mjs.map +1 -1
  69. package/es/Input/style.mjs +3 -3
  70. package/es/Input/style.mjs.map +1 -1
  71. package/es/Modal/atoms.mjs +3 -3
  72. package/es/Modal/atoms.mjs.map +1 -1
  73. package/es/Pagination/Pagination.mjs +1 -1
  74. package/es/Pagination/Pagination.mjs.map +1 -1
  75. package/es/Popover/PopoverInGroup.mjs +1 -1
  76. package/es/Popover/PopoverInGroup.mjs.map +1 -1
  77. package/es/Popover/atoms.mjs +1 -1
  78. package/es/Popover/atoms.mjs.map +1 -1
  79. package/es/Rate/Rate.mjs +1 -1
  80. package/es/Rate/Rate.mjs.map +1 -1
  81. package/es/ScrollShadow/ScrollShadow.mjs +1 -1
  82. package/es/ScrollShadow/ScrollShadow.mjs.map +1 -1
  83. package/es/SearchBar/SearchBar.mjs +31 -25
  84. package/es/SearchBar/SearchBar.mjs.map +1 -1
  85. package/es/Segmented/Segmented.mjs +1 -1
  86. package/es/Segmented/Segmented.mjs.map +1 -1
  87. package/es/Select/atoms.mjs +1 -1
  88. package/es/Select/atoms.mjs.map +1 -1
  89. package/es/Switch/atoms.mjs +1 -1
  90. package/es/Switch/atoms.mjs.map +1 -1
  91. package/es/Tabs/Tabs.mjs +35 -21
  92. package/es/Tabs/Tabs.mjs.map +1 -1
  93. package/es/ToggleGroup/ToggleGroup.mjs +1 -1
  94. package/es/ToggleGroup/ToggleGroup.mjs.map +1 -1
  95. package/es/Tooltip/TooltipInGroup.mjs +1 -1
  96. package/es/Tooltip/TooltipInGroup.mjs.map +1 -1
  97. package/es/Tooltip/TooltipStandalone.mjs +1 -1
  98. package/es/Tooltip/TooltipStandalone.mjs.map +1 -1
  99. package/es/Tree/Tree.mjs +1 -1
  100. package/es/Tree/Tree.mjs.map +1 -1
  101. package/es/awesome/Giscus/style.mjs +9 -9
  102. package/es/awesome/Giscus/style.mjs.map +1 -1
  103. package/es/awesome/Grainient/Grainient.d.mts +11 -0
  104. package/es/awesome/Grainient/Grainient.mjs +314 -0
  105. package/es/awesome/Grainient/Grainient.mjs.map +1 -0
  106. package/es/awesome/Grainient/index.d.mts +3 -0
  107. package/es/awesome/Grainient/style.mjs +23 -0
  108. package/es/awesome/Grainient/style.mjs.map +1 -0
  109. package/es/awesome/Grainient/type.d.mts +121 -0
  110. package/es/awesome/GridBackground/GridBackground.mjs +1 -1
  111. package/es/awesome/GridBackground/GridBackground.mjs.map +1 -1
  112. package/es/awesome/GridBackground/GridShowcase.mjs +4 -4
  113. package/es/awesome/GridBackground/GridShowcase.mjs.map +1 -1
  114. package/es/awesome/Spline/ParentSize.mjs +1 -1
  115. package/es/awesome/Spline/ParentSize.mjs.map +1 -1
  116. package/es/awesome/index.d.mts +4 -1
  117. package/es/awesome/index.mjs +2 -1
  118. package/es/chat/BackBottom/BackBottom.mjs +1 -1
  119. package/es/chat/BackBottom/BackBottom.mjs.map +1 -1
  120. package/es/chat/BackBottom/type.d.mts +2 -2
  121. package/es/chat/EditableMessage/EditableMessage.mjs +1 -1
  122. package/es/chat/EditableMessage/EditableMessage.mjs.map +1 -1
  123. package/es/chat/EditableMessageList/EditableMessageList.mjs +1 -1
  124. package/es/chat/EditableMessageList/EditableMessageList.mjs.map +1 -1
  125. package/es/chat/EditableMessageList/messageReducer.mjs +30 -23
  126. package/es/chat/EditableMessageList/messageReducer.mjs.map +1 -1
  127. package/es/chat/MessageModal/MessageModal.mjs +1 -1
  128. package/es/chat/MessageModal/MessageModal.mjs.map +1 -1
  129. package/es/chat/TokenTag/TokenTag.mjs +2 -3
  130. package/es/chat/TokenTag/TokenTag.mjs.map +1 -1
  131. package/es/dashboard/AuthLayout/Aside.d.mts +10 -0
  132. package/es/dashboard/AuthLayout/Aside.mjs +31 -0
  133. package/es/dashboard/AuthLayout/Aside.mjs.map +1 -0
  134. package/es/dashboard/AuthLayout/AuthLayout.d.mts +3 -1
  135. package/es/dashboard/AuthLayout/AuthLayout.mjs +93 -37
  136. package/es/dashboard/AuthLayout/AuthLayout.mjs.map +1 -1
  137. package/es/dashboard/AuthLayout/index.d.mts +3 -2
  138. package/es/dashboard/AuthLayout/style.mjs +98 -1
  139. package/es/dashboard/AuthLayout/style.mjs.map +1 -1
  140. package/es/dashboard/AuthLayout/type.d.mts +38 -2
  141. package/es/dashboard/AuthTools/AuthLocaleSwitch.d.mts +10 -0
  142. package/es/dashboard/AuthTools/AuthLocaleSwitch.mjs +33 -0
  143. package/es/dashboard/AuthTools/AuthLocaleSwitch.mjs.map +1 -0
  144. package/es/dashboard/AuthTools/AuthThemeSwitch.d.mts +10 -0
  145. package/es/dashboard/AuthTools/AuthThemeSwitch.mjs +59 -0
  146. package/es/dashboard/AuthTools/AuthThemeSwitch.mjs.map +1 -0
  147. package/es/dashboard/AuthTools/index.d.mts +4 -0
  148. package/es/dashboard/AuthTools/style.mjs +27 -0
  149. package/es/dashboard/AuthTools/style.mjs.map +1 -0
  150. package/es/dashboard/AuthTools/type.d.mts +29 -0
  151. package/es/dashboard/ChartGrid/ChartGrid.d.mts +10 -0
  152. package/es/dashboard/ChartGrid/ChartGrid.mjs +19 -0
  153. package/es/dashboard/ChartGrid/ChartGrid.mjs.map +1 -0
  154. package/es/dashboard/ChartGrid/index.d.mts +3 -0
  155. package/es/dashboard/ChartGrid/style.mjs +18 -0
  156. package/es/dashboard/ChartGrid/style.mjs.map +1 -0
  157. package/es/dashboard/ChartGrid/type.d.mts +8 -0
  158. package/es/dashboard/ConsoleNav/Skeleton.d.mts +15 -0
  159. package/es/dashboard/ConsoleNav/Skeleton.mjs +82 -0
  160. package/es/dashboard/ConsoleNav/Skeleton.mjs.map +1 -0
  161. package/es/dashboard/ConsoleNav/index.d.mts +3 -2
  162. package/es/dashboard/ConsoleNav/style.mjs +18 -0
  163. package/es/dashboard/ConsoleNav/style.mjs.map +1 -1
  164. package/es/dashboard/ConsoleNav/type.d.mts +13 -0
  165. package/es/dashboard/ConsoleShell/ConsoleShell.d.mts +1 -1
  166. package/es/dashboard/ConsoleShell/ConsoleShell.mjs +26 -6
  167. package/es/dashboard/ConsoleShell/ConsoleShell.mjs.map +1 -1
  168. package/es/dashboard/ConsoleShell/style.mjs +10 -0
  169. package/es/dashboard/ConsoleShell/style.mjs.map +1 -1
  170. package/es/dashboard/ConsoleShell/type.d.mts +11 -0
  171. package/es/dashboard/FilterSidebar/FilterSidebar.mjs +18 -17
  172. package/es/dashboard/FilterSidebar/FilterSidebar.mjs.map +1 -1
  173. package/es/dashboard/FilterStrip/FilterStrip.d.mts +11 -0
  174. package/es/dashboard/FilterStrip/FilterStrip.mjs +55 -0
  175. package/es/dashboard/FilterStrip/FilterStrip.mjs.map +1 -0
  176. package/es/dashboard/FilterStrip/index.d.mts +3 -0
  177. package/es/dashboard/FilterStrip/style.mjs +78 -0
  178. package/es/dashboard/FilterStrip/style.mjs.map +1 -0
  179. package/es/dashboard/FilterStrip/type.d.mts +25 -0
  180. package/es/dashboard/LabelWithKey/LabelWithKey.d.mts +10 -0
  181. package/es/dashboard/LabelWithKey/LabelWithKey.mjs +18 -0
  182. package/es/dashboard/LabelWithKey/LabelWithKey.mjs.map +1 -0
  183. package/es/dashboard/LabelWithKey/index.d.mts +3 -0
  184. package/es/dashboard/LabelWithKey/type.d.mts +11 -0
  185. package/es/dashboard/MetricStrip/MetricCell.mjs +81 -0
  186. package/es/dashboard/MetricStrip/MetricCell.mjs.map +1 -0
  187. package/es/dashboard/MetricStrip/MetricStrip.d.mts +13 -0
  188. package/es/dashboard/MetricStrip/MetricStrip.mjs +47 -0
  189. package/es/dashboard/MetricStrip/MetricStrip.mjs.map +1 -0
  190. package/es/dashboard/MetricStrip/index.d.mts +3 -0
  191. package/es/dashboard/MetricStrip/style.mjs +156 -0
  192. package/es/dashboard/MetricStrip/style.mjs.map +1 -0
  193. package/es/dashboard/MetricStrip/type.d.mts +36 -0
  194. package/es/dashboard/PageSkeleton/PageSkeleton.mjs +20 -18
  195. package/es/dashboard/PageSkeleton/PageSkeleton.mjs.map +1 -1
  196. package/es/dashboard/PageSkeleton/style.mjs +1 -1
  197. package/es/dashboard/PageSkeleton/style.mjs.map +1 -1
  198. package/es/dashboard/PageToolbar/PageToolbar.d.mts +10 -0
  199. package/es/dashboard/PageToolbar/PageToolbar.mjs +22 -0
  200. package/es/dashboard/PageToolbar/PageToolbar.mjs.map +1 -0
  201. package/es/dashboard/PageToolbar/index.d.mts +3 -0
  202. package/es/dashboard/PageToolbar/style.mjs +36 -0
  203. package/es/dashboard/PageToolbar/style.mjs.map +1 -0
  204. package/es/dashboard/PageToolbar/type.d.mts +11 -0
  205. package/es/dashboard/PanelSurface/PanelSurface.d.mts +10 -0
  206. package/es/dashboard/PanelSurface/PanelSurface.mjs +40 -0
  207. package/es/dashboard/PanelSurface/PanelSurface.mjs.map +1 -0
  208. package/es/dashboard/PanelSurface/index.d.mts +3 -0
  209. package/es/dashboard/PanelSurface/style.mjs +25 -0
  210. package/es/dashboard/PanelSurface/style.mjs.map +1 -0
  211. package/es/dashboard/PanelSurface/type.d.mts +17 -0
  212. package/es/dashboard/Section/Section.d.mts +10 -0
  213. package/es/dashboard/Section/Section.mjs +81 -0
  214. package/es/dashboard/Section/Section.mjs.map +1 -0
  215. package/es/dashboard/Section/index.d.mts +3 -0
  216. package/es/dashboard/Section/style.mjs +31 -0
  217. package/es/dashboard/Section/style.mjs.map +1 -0
  218. package/es/dashboard/Section/type.d.mts +23 -0
  219. package/es/dashboard/StatCard/StatCard.d.mts +2 -1
  220. package/es/dashboard/StatCard/StatCard.mjs +28 -91
  221. package/es/dashboard/StatCard/StatCard.mjs.map +1 -1
  222. package/es/dashboard/StatCard/type.d.mts +16 -5
  223. package/es/dashboard/Surface/Surface.d.mts +4 -3
  224. package/es/dashboard/Surface/Surface.mjs +91 -8
  225. package/es/dashboard/Surface/Surface.mjs.map +1 -1
  226. package/es/dashboard/Surface/index.d.mts +3 -2
  227. package/es/dashboard/Surface/link.d.mts +16 -0
  228. package/es/dashboard/Surface/link.mjs +40 -0
  229. package/es/dashboard/Surface/link.mjs.map +1 -0
  230. package/es/dashboard/Surface/marker.stylex.mjs +9 -0
  231. package/es/dashboard/Surface/marker.stylex.mjs.map +1 -0
  232. package/es/dashboard/Surface/style.d.mts +2 -0
  233. package/es/dashboard/Surface/style.mjs +155 -14
  234. package/es/dashboard/Surface/style.mjs.map +1 -1
  235. package/es/dashboard/Surface/type.d.mts +29 -1
  236. package/es/dashboard/TableIconActions/TableIconActions.d.mts +17 -0
  237. package/es/dashboard/TableIconActions/TableIconActions.mjs +39 -0
  238. package/es/dashboard/TableIconActions/TableIconActions.mjs.map +1 -0
  239. package/es/dashboard/TableIconActions/index.d.mts +3 -0
  240. package/es/dashboard/TableIconActions/type.d.mts +17 -0
  241. package/es/dashboard/TitleWithTips/TitleWithTips.d.mts +10 -0
  242. package/es/dashboard/TitleWithTips/TitleWithTips.mjs +28 -0
  243. package/es/dashboard/TitleWithTips/TitleWithTips.mjs.map +1 -0
  244. package/es/dashboard/TitleWithTips/index.d.mts +3 -0
  245. package/es/dashboard/TitleWithTips/type.d.mts +10 -0
  246. package/es/dashboard/index.d.mts +38 -4
  247. package/es/dashboard/index.mjs +17 -3
  248. package/es/hooks/useControlledState.mjs +20 -0
  249. package/es/hooks/useControlledState.mjs.map +1 -0
  250. package/es/hooks/useHighlight.mjs +2 -2
  251. package/es/hooks/useHighlight.mjs.map +1 -1
  252. package/es/hooks/useHover.mjs +22 -0
  253. package/es/hooks/useHover.mjs.map +1 -0
  254. package/es/hooks/useScroll.d.mts +8 -0
  255. package/es/hooks/useScroll.mjs +33 -0
  256. package/es/hooks/useScroll.mjs.map +1 -0
  257. package/es/hooks/useSize.mjs +26 -0
  258. package/es/hooks/useSize.mjs.map +1 -0
  259. package/es/internal/virtual/VirtualScrollArea.mjs +1 -1
  260. package/es/internal/virtual/VirtualScrollArea.mjs.map +1 -1
  261. package/es/mobile/ChatInputArea/ChatInputArea.mjs +1 -1
  262. package/es/mobile/ChatInputArea/ChatInputArea.mjs.map +1 -1
  263. package/es/mobile/TabBar/TabBar.mjs +1 -1
  264. package/es/mobile/TabBar/TabBar.mjs.map +1 -1
  265. package/es/node_modules/.pnpm/@eslint_core@1.2.1/node_modules/@eslint/core/dist/esm/types.d.mts +2 -46
  266. package/es/node_modules/.pnpm/@eslint_plugin-kit@0.7.3/node_modules/@eslint/plugin-kit/dist/cjs/index.d.mts +1 -1
  267. package/es/node_modules/.pnpm/@types_estree@1.0.9/node_modules/@types/estree/index.d.mts +1 -4
  268. package/es/node_modules/.pnpm/eslint@10.12.0_jiti@2.6.1_supports-color@10.2.2/node_modules/eslint/lib/types/index.d.mts +1 -1
  269. package/es/style.css +339 -32
  270. package/es/styles/theme/token/neutral.mjs +5 -5
  271. package/es/styles/theme/token/neutral.mjs.map +1 -1
  272. package/es/utils/colorMath.mjs +52 -0
  273. package/es/utils/colorMath.mjs.map +1 -0
  274. package/es/utils/formatNumber.mjs +7 -0
  275. package/es/utils/formatNumber.mjs.map +1 -0
  276. package/es/utils/genCdnUrl.mjs +6 -3
  277. package/es/utils/genCdnUrl.mjs.map +1 -1
  278. package/es/utils/hashString.mjs +19 -0
  279. package/es/utils/hashString.mjs.map +1 -0
  280. package/es/utils/mergeRefs.mjs +20 -0
  281. package/es/utils/mergeRefs.mjs.map +1 -0
  282. package/es/utils/placement.d.mts +5 -5
  283. package/es/utils/placement.mjs.map +1 -1
  284. package/package.json +16 -42
  285. package/es/dashboard/StatCard/style.mjs +0 -105
  286. package/es/dashboard/StatCard/style.mjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"FilterSidebar.mjs","names":["styles","surfaceStyles"],"sources":["../../../src/dashboard/FilterSidebar/FilterSidebar.tsx"],"sourcesContent":["'use client';\n\nimport './style.css';\n\nimport * as stylex from '@stylexjs/stylex';\nimport { Filter } from 'lucide-react';\nimport { useState } from 'react';\n\nimport Button from '@/Button';\nimport { DraggablePanel } from '@/DraggablePanel';\nimport { Drawer } from '@/Drawer';\nimport { styleProps } from '@/styles/stylex/props';\n\nimport { useIsCompact, useLocalStorage } from '../hooks';\nimport { styles as surfaceStyles } from '../Surface/style';\nimport { FilterSplitProvider } from './context';\nimport { styles } from './style';\nimport type { FilterOptionProps, FilterRowProps, FilterSidebarProps } from './type';\nimport { clampSidebarWidth, sidebarWidth } from './width';\n\nconst contentClassName = 'lobe-filter-sidebar-content';\n\nfunction usePageSidebar(wide: boolean | undefined, storageKey: string | undefined) {\n const fallback = wide ? sidebarWidth.wide : sidebarWidth.narrow;\n const [prefs, setPrefs] = useLocalStorage<{ expand?: boolean; width?: number }>(storageKey, {\n expand: true,\n width: fallback,\n });\n return {\n expand: prefs.expand !== false,\n onExpandChange: (expand: boolean) => setPrefs((current) => ({ ...current, expand })),\n onSizeChange: (size: { width?: number | string }) => {\n const next = typeof size.width === 'number' ? size.width : fallback;\n setPrefs((current) => ({ ...current, width: clampSidebarWidth(next, fallback) }));\n },\n width: clampSidebarWidth(Number(prefs.width), fallback),\n };\n}\n\nfunction FilterSidebar({\n body,\n children,\n flush,\n head,\n header,\n label,\n storageKey,\n summary,\n wide,\n}: FilterSidebarProps) {\n const isCompact = useIsCompact();\n const [drawerOpen, setDrawerOpen] = useState(false);\n const sidebar = usePageSidebar(wide, storageKey);\n const close = () => setDrawerOpen(false);\n\n if (isCompact) {\n return (\n <FilterSplitProvider active={!flush}>\n <div {...stylex.props(styles.layout)}>\n {header}\n <Button block icon={Filter} onClick={() => setDrawerOpen(true)}>\n {summary}\n </Button>\n <Drawer open={drawerOpen} placement=\"left\" title={label} width={300} onClose={close}>\n <div {...stylex.props(styles.drawerPanel)}>\n {head?.(close)}\n {body(close)}\n </div>\n </Drawer>\n <div {...styleProps(styles.content, contentClassName)}>{children}</div>\n </div>\n </FilterSplitProvider>\n );\n }\n\n return (\n <FilterSplitProvider active={!flush}>\n <div\n {...stylex.props(\n styles.layout,\n flush ? styles.layoutFlush : [surfaceStyles.card, styles.layoutSplit],\n )}\n data-flush={flush ? true : undefined}\n data-page-layout={flush ? 'flush' : undefined}\n data-split-card={flush ? undefined : true}\n >\n <DraggablePanel\n expandable\n showHandleWhenCollapsed\n aria-label={label}\n className={stylex.props(styles.sidebar, flush && styles.sidebarFlush).className}\n collapseThreshold={sidebarWidth.collapse}\n data-flush={flush ? true : undefined}\n defaultSize={{ width: wide ? sidebarWidth.wide : sidebarWidth.narrow }}\n expand={sidebar.expand}\n maxWidth={sidebarWidth.max}\n minWidth={sidebarWidth.min}\n mode=\"fixed\"\n placement=\"left\"\n showBorder={false}\n size={{ width: sidebar.width }}\n classNames={{\n content: stylex.props(styles.panel, !flush && styles.panelSplit).className,\n }}\n onExpandChange={sidebar.onExpandChange}\n onSizeChange={(_delta, size) => sidebar.onSizeChange(size)}\n >\n {head ? <div {...stylex.props(styles.head)}>{head(close)}</div> : null}\n <div\n data-flush={flush ? true : undefined}\n {...stylex.props(styles.body, flush && styles.bodyFlush)}\n >\n {body(close)}\n </div>\n </DraggablePanel>\n <div\n data-flush={flush ? true : undefined}\n {...styleProps(\n [styles.content, flush ? styles.contentFlush : styles.contentSplit],\n contentClassName,\n )}\n >\n {header}\n {children}\n </div>\n </div>\n </FilterSplitProvider>\n );\n}\n\nFilterSidebar.displayName = 'FilterSidebar';\n\nfunction FilterRow({ count, name }: FilterRowProps) {\n return (\n <span {...stylex.props(styles.row)}>\n <span {...stylex.props(styles.name)}>{name}</span>\n {count !== undefined ? <span {...stylex.props(styles.count)}>{count}</span> : null}\n </span>\n );\n}\n\nFilterRow.displayName = 'FilterRow';\n\nfunction FilterOption({ count, icon, label, name, onClick, selected, title }: FilterOptionProps) {\n return (\n <button\n aria-label={label}\n aria-pressed={selected}\n title={title}\n type=\"button\"\n onClick={onClick}\n {...stylex.props(styles.option)}\n >\n {icon}\n <span {...stylex.props(styles.name)}>{name}</span>\n {count !== undefined ? <span {...stylex.props(styles.count)}>{count}</span> : null}\n </button>\n );\n}\n\nFilterOption.displayName = 'FilterOption';\n\nexport { FilterOption, FilterRow };\nexport default FilterSidebar;\n"],"mappings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A,CACG,QACA,QACE;GACF,CAAA,CAAA;;CACc,CAAA;AACzB;AACA,cAAc,cAAc;AAC5B,SAAS,UAAU,EACjB,OACA,QACiB;CACjB,OAAO,qBAAC,QAAD;EAAM,GAAI,OAAO,MAAMA,SAAO,GAAG;EAAjC,UAAA,CACH,oBAAC,QAAD;GAAM,GAAI,OAAO,MAAMA,SAAO,IAAI;GAAI,UAAA;EAAW,CAAA,GAChD,UAAU,KAAA,IAAY,oBAAC,QAAD;GAAM,GAAI,OAAO,MAAMA,SAAO,KAAK;GAAI,UAAA;EAAY,CAAA,IAAI,IAC1E;;AACV;AACA,UAAU,cAAc;AACxB,SAAS,aAAa,EACpB,OACA,MACA,OACA,MACA,SACA,UACA,SACoB;CACpB,OAAO,qBAAC,UAAD;EAAQ,cAAY;EAAO,gBAAc;EAAiB;EAAO,MAAK;EAAkB;EAAS,GAAI,OAAO,MAAMA,SAAO,MAAM;EAA/H,UAAA;GACF;GACD,oBAAC,QAAD;IAAM,GAAI,OAAO,MAAMA,SAAO,IAAI;IAAI,UAAA;GAAW,CAAA;GAChD,UAAU,KAAA,IAAY,oBAAC,QAAD;IAAM,GAAI,OAAO,MAAMA,SAAO,KAAK;IAAI,UAAA;GAAY,CAAA,IAAI;EACxE;;AACZ;AACA,aAAa,cAAc"}
1
+ {"version":3,"file":"FilterSidebar.mjs","names":[],"sources":["../../../src/dashboard/FilterSidebar/FilterSidebar.tsx"],"sourcesContent":["'use client';\n\nimport './style.css';\n\nimport * as stylex from '@stylexjs/stylex';\nimport { Filter } from 'lucide-react';\nimport { useState } from 'react';\n\nimport Button from '@/Button';\nimport { DraggablePanel } from '@/DraggablePanel';\nimport { Drawer } from '@/Drawer';\nimport { styleProps } from '@/styles/stylex/props';\n\nimport { useIsCompact, useLocalStorage } from '../hooks';\nimport { useSurfaceCardStyles } from '../Surface/link';\nimport { FilterSplitProvider } from './context';\nimport { styles } from './style';\nimport type { FilterOptionProps, FilterRowProps, FilterSidebarProps } from './type';\nimport { clampSidebarWidth, sidebarWidth } from './width';\n\nconst contentClassName = 'lobe-filter-sidebar-content';\n\nfunction usePageSidebar(wide: boolean | undefined, storageKey: string | undefined) {\n const fallback = wide ? sidebarWidth.wide : sidebarWidth.narrow;\n const [prefs, setPrefs] = useLocalStorage<{ expand?: boolean; width?: number }>(storageKey, {\n expand: true,\n width: fallback,\n });\n return {\n expand: prefs.expand !== false,\n onExpandChange: (expand: boolean) => setPrefs((current) => ({ ...current, expand })),\n onSizeChange: (size: { width?: number | string }) => {\n const next = typeof size.width === 'number' ? size.width : fallback;\n setPrefs((current) => ({ ...current, width: clampSidebarWidth(next, fallback) }));\n },\n width: clampSidebarWidth(Number(prefs.width), fallback),\n };\n}\n\nfunction FilterSidebar({\n body,\n children,\n flush,\n head,\n header,\n label,\n storageKey,\n summary,\n wide,\n}: FilterSidebarProps) {\n const cardStyles = useSurfaceCardStyles();\n const isCompact = useIsCompact();\n const [drawerOpen, setDrawerOpen] = useState(false);\n const sidebar = usePageSidebar(wide, storageKey);\n const close = () => setDrawerOpen(false);\n\n if (isCompact) {\n return (\n <FilterSplitProvider active={!flush}>\n <div {...stylex.props(styles.layout)}>\n {header}\n <Button block icon={Filter} onClick={() => setDrawerOpen(true)}>\n {summary}\n </Button>\n <Drawer open={drawerOpen} placement=\"left\" title={label} width={300} onClose={close}>\n <div {...stylex.props(styles.drawerPanel)}>\n {head?.(close)}\n {body(close)}\n </div>\n </Drawer>\n <div {...styleProps(styles.content, contentClassName)}>{children}</div>\n </div>\n </FilterSplitProvider>\n );\n }\n\n return (\n <FilterSplitProvider active={!flush}>\n <div\n {...stylex.props(\n styles.layout,\n flush ? styles.layoutFlush : [cardStyles, styles.layoutSplit],\n )}\n data-flush={flush ? true : undefined}\n data-page-layout={flush ? 'flush' : undefined}\n data-split-card={flush ? undefined : true}\n >\n <DraggablePanel\n expandable\n showHandleWhenCollapsed\n aria-label={label}\n className={stylex.props(styles.sidebar, flush && styles.sidebarFlush).className}\n collapseThreshold={sidebarWidth.collapse}\n data-flush={flush ? true : undefined}\n defaultSize={{ width: wide ? sidebarWidth.wide : sidebarWidth.narrow }}\n expand={sidebar.expand}\n maxWidth={sidebarWidth.max}\n minWidth={sidebarWidth.min}\n mode=\"fixed\"\n placement=\"left\"\n showBorder={false}\n size={{ width: sidebar.width }}\n classNames={{\n content: stylex.props(styles.panel, !flush && styles.panelSplit).className,\n }}\n onExpandChange={sidebar.onExpandChange}\n onSizeChange={(_delta, size) => sidebar.onSizeChange(size)}\n >\n {head ? <div {...stylex.props(styles.head)}>{head(close)}</div> : null}\n <div\n data-flush={flush ? true : undefined}\n {...stylex.props(styles.body, flush && styles.bodyFlush)}\n >\n {body(close)}\n </div>\n </DraggablePanel>\n <div\n data-flush={flush ? true : undefined}\n {...styleProps(\n [styles.content, flush ? styles.contentFlush : styles.contentSplit],\n contentClassName,\n )}\n >\n {header}\n {children}\n </div>\n </div>\n </FilterSplitProvider>\n );\n}\n\nFilterSidebar.displayName = 'FilterSidebar';\n\nfunction FilterRow({ count, name }: FilterRowProps) {\n return (\n <span {...stylex.props(styles.row)}>\n <span {...stylex.props(styles.name)}>{name}</span>\n {count !== undefined ? <span {...stylex.props(styles.count)}>{count}</span> : null}\n </span>\n );\n}\n\nFilterRow.displayName = 'FilterRow';\n\nfunction FilterOption({ count, icon, label, name, onClick, selected, title }: FilterOptionProps) {\n return (\n <button\n aria-label={label}\n aria-pressed={selected}\n title={title}\n type=\"button\"\n onClick={onClick}\n {...stylex.props(styles.option)}\n >\n {icon}\n <span {...stylex.props(styles.name)}>{name}</span>\n {count !== undefined ? <span {...stylex.props(styles.count)}>{count}</span> : null}\n </button>\n );\n}\n\nFilterOption.displayName = 'FilterOption';\n\nexport { FilterOption, FilterRow };\nexport default FilterSidebar;\n"],"mappings":";;;;;;;;;;;;;;;AAgBA,MAAM,mBAAmB;AACzB,SAAS,eAAe,MAA2B,YAAgC;CACjF,MAAM,WAAW,OAAO,aAAa,OAAO,aAAa;CACzD,MAAM,CAAC,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AAD;EAAM,GAAI,OAAO,MAAM,OAAO,GAAG;EAAjC,UAAA,CACH,oBAAC,QAAD;GAAM,GAAI,OAAO,MAAM,OAAO,IAAI;GAAI,UAAA;EAAW,CAAA,GAChD,UAAU,KAAA,IAAY,oBAAC,QAAD;GAAM,GAAI,OAAO,MAAM,OAAO,KAAK;GAAI,UAAA;EAAY,CAAA,IAAI,IAC1E;;AACV;AACA,UAAU,cAAc;AACxB,SAAS,aAAa,EACpB,OACA,MACA,OACA,MACA,SACA,UACA,SACoB;CACpB,OAAO,qBAAC,UAAD;EAAQ,cAAY;EAAO,gBAAc;EAAiB;EAAO,MAAK;EAAkB;EAAS,GAAI,OAAO,MAAM,OAAO,MAAM;EAA/H,UAAA;GACF;GACD,oBAAC,QAAD;IAAM,GAAI,OAAO,MAAM,OAAO,IAAI;IAAI,UAAA;GAAW,CAAA;GAChD,UAAU,KAAA,IAAY,oBAAC,QAAD;IAAM,GAAI,OAAO,MAAM,OAAO,KAAK;IAAI,UAAA;GAAY,CAAA,IAAI;EACxE;;AACZ;AACA,aAAa,cAAc"}
@@ -0,0 +1,11 @@
1
+ import { FilterStripProps } from "./type.mjs";
2
+ //#region src/dashboard/FilterStrip/FilterStrip.d.ts
3
+ export declare const formatInteger: (count: number) => string;
4
+ /** One surface of selectable counts. Peer filters share a seam instead of a row of equal cards. */
5
+ declare const FilterStrip: {
6
+ ({ emptyText, formatCount, items, label, onChange, value }: FilterStripProps): import("react").JSX.Element;
7
+ displayName: string;
8
+ };
9
+ //#endregion
10
+ export { FilterStrip as default };
11
+ //# sourceMappingURL=FilterStrip.d.mts.map
@@ -0,0 +1,55 @@
1
+ "use client";
2
+ import Skeleton from "../../Skeleton/index.mjs";
3
+ import { styles } from "../Surface/style.mjs";
4
+ import Surface from "../Surface/Surface.mjs";
5
+ import { styles as styles$1 } from "./style.mjs";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ import * as stylex from "@stylexjs/stylex";
8
+ //#region src/dashboard/FilterStrip/FilterStrip.tsx
9
+ const countStyles = {
10
+ danger: styles$1.countDanger,
11
+ warning: styles$1.countWarning
12
+ };
13
+ const integerFormat = new Intl.NumberFormat("en-US", { maximumFractionDigits: 0 });
14
+ const formatInteger = (count) => integerFormat.format(count);
15
+ /** One surface of selectable counts. Peer filters share a seam instead of a row of equal cards. */
16
+ const FilterStrip = ({ emptyText = "--", formatCount = formatInteger, items, label, onChange, value }) => /* @__PURE__ */ jsx(Surface, {
17
+ className: stylex.props(styles.clip).className,
18
+ children: /* @__PURE__ */ jsx("div", {
19
+ "aria-label": label,
20
+ role: "radiogroup",
21
+ ...stylex.props(styles$1.frame),
22
+ children: /* @__PURE__ */ jsx("div", {
23
+ ...stylex.props(styles$1.grid),
24
+ children: items.map((item) => {
25
+ const active = item.key === value;
26
+ const missing = item.count === void 0 || item.count === null;
27
+ const emphasize = item.tone && typeof item.count === "number" && item.count > 0;
28
+ return /* @__PURE__ */ jsxs("button", {
29
+ "aria-checked": active,
30
+ role: "radio",
31
+ title: item.hint,
32
+ type: "button",
33
+ onClick: () => onChange(item.key),
34
+ ...stylex.props(styles$1.cell, active && styles$1.cellActive),
35
+ children: [/* @__PURE__ */ jsx("span", {
36
+ ...stylex.props(styles$1.label, active && styles$1.labelActive),
37
+ children: item.label
38
+ }), /* @__PURE__ */ jsx("span", {
39
+ ...stylex.props(styles$1.count, emphasize && countStyles[item.tone]),
40
+ children: item.loading ? /* @__PURE__ */ jsx(Skeleton, {
41
+ height: 22,
42
+ radius: 6,
43
+ width: 48
44
+ }) : missing ? emptyText : formatCount(item.count)
45
+ })]
46
+ }, item.key);
47
+ })
48
+ })
49
+ })
50
+ });
51
+ FilterStrip.displayName = "FilterStrip";
52
+ //#endregion
53
+ export { FilterStrip as default, formatInteger };
54
+
55
+ //# sourceMappingURL=FilterStrip.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FilterStrip.mjs","names":["styles","surfaceStyles"],"sources":["../../../src/dashboard/FilterStrip/FilterStrip.tsx"],"sourcesContent":["'use client';\n\nimport * as stylex from '@stylexjs/stylex';\n\nimport Skeleton from '@/Skeleton';\n\nimport { styles as surfaceStyles } from '../Surface/style';\nimport Surface from '../Surface/Surface';\nimport { styles } from './style';\nimport type { FilterStripProps } from './type';\n\nconst countStyles = {\n danger: styles.countDanger,\n warning: styles.countWarning,\n} as const;\n\nconst integerFormat = new Intl.NumberFormat('en-US', { maximumFractionDigits: 0 });\n\nexport const formatInteger = (count: number) => integerFormat.format(count);\n\n/** One surface of selectable counts. Peer filters share a seam instead of a row of equal cards. */\nconst FilterStrip = ({\n emptyText = '--',\n formatCount = formatInteger,\n items,\n label,\n onChange,\n value,\n}: FilterStripProps) => (\n <Surface className={stylex.props(surfaceStyles.clip).className}>\n <div aria-label={label} role=\"radiogroup\" {...stylex.props(styles.frame)}>\n <div {...stylex.props(styles.grid)}>\n {items.map((item) => {\n const active = item.key === value;\n const missing = item.count === undefined || item.count === null;\n const emphasize = item.tone && typeof item.count === 'number' && item.count > 0;\n\n return (\n <button\n aria-checked={active}\n key={item.key}\n role=\"radio\"\n title={item.hint}\n type=\"button\"\n onClick={() => onChange(item.key)}\n {...stylex.props(styles.cell, active && styles.cellActive)}\n >\n <span {...stylex.props(styles.label, active && styles.labelActive)}>\n {item.label}\n </span>\n <span {...stylex.props(styles.count, emphasize && countStyles[item.tone!])}>\n {item.loading ? (\n <Skeleton height={22} radius={6} width={48} />\n ) : missing ? (\n emptyText\n ) : (\n formatCount(item.count!)\n )}\n </span>\n </button>\n );\n })}\n </div>\n </div>\n </Surface>\n);\n\nFilterStrip.displayName = 'FilterStrip';\n\nexport default FilterStrip;\n"],"mappings":";;;;;;;;AAQA,MAAM,cAAc;CAClB,QAAQA,SAAO;CACf,SAASA,SAAO;AAClB;AACA,MAAM,gBAAgB,IAAI,KAAK,aAAa,SAAS,EACnD,uBAAuB,EACzB,CAAC;AACD,MAAa,iBAAiB,UAAkB,cAAc,OAAO,KAAK;;AAG1E,MAAM,eAAe,EACnB,YAAY,MACZ,cAAc,eACd,OACA,OACA,UACA,YACsB,oBAAC,SAAD;CAAS,WAAW,OAAO,MAAMC,OAAc,IAAI,CAAC,CAAC;CACzE,UAAA,oBAAC,OAAD;EAAK,cAAY;EAAO,MAAK;EAAa,GAAI,OAAO,MAAMD,SAAO,KAAK;EACrE,UAAA,oBAAC,OAAD;GAAK,GAAI,OAAO,MAAMA,SAAO,IAAI;GAC9B,UAAA,MAAM,KAAI,SAAQ;IACnB,MAAM,SAAS,KAAK,QAAQ;IAC5B,MAAM,UAAU,KAAK,UAAU,KAAA,KAAa,KAAK,UAAU;IAC3D,MAAM,YAAY,KAAK,QAAQ,OAAO,KAAK,UAAU,YAAY,KAAK,QAAQ;IAC9E,OAAO,qBAAC,UAAD;KAAQ,gBAAc;KAAuB,MAAK;KAAQ,OAAO,KAAK;KAAM,MAAK;KAAS,eAAe,SAAS,KAAK,GAAG;KAAG,GAAI,OAAO,MAAMA,SAAO,MAAM,UAAUA,SAAO,UAAU;KAAtL,UAAA,CACD,oBAAC,QAAD;MAAM,GAAI,OAAO,MAAMA,SAAO,OAAO,UAAUA,SAAO,WAAW;MAC9D,UAAA,KAAK;KACF,CAAA,GACN,oBAAC,QAAD;MAAM,GAAI,OAAO,MAAMA,SAAO,OAAO,aAAa,YAAY,KAAK,KAAM;MACtE,UAAA,KAAK,UAAU,oBAAC,UAAD;OAAU,QAAQ;OAAI,QAAQ;OAAG,OAAO;MAAK,CAAA,IAAI,UAAU,YAAY,YAAY,KAAK,KAAM;KAC1G,CAAA,CACA;IAP8B,GAAA,KAAK,GAOnC;GACd,CAAC;EACI,CAAA;CACF,CAAA;AACE,CAAA;AACX,YAAY,cAAc"}
@@ -0,0 +1,3 @@
1
+ import { FilterStripItem, FilterStripProps } from "./type.mjs";
2
+ import FilterStrip, { formatInteger } from "./FilterStrip.mjs";
3
+ export { type FilterStripItem, type FilterStripProps, FilterStrip as default, formatInteger };
@@ -0,0 +1,78 @@
1
+ //#region src/dashboard/FilterStrip/style.ts
2
+ const styles = {
3
+ cell: {
4
+ kVVagm: "lbln7xf2",
5
+ kogj98: "lb1ghz6dp",
6
+ kMzoRj: "lbc342km",
7
+ kOIVth: "lb17d4w8g",
8
+ kg3NbH: "lb1hr3lfm",
9
+ kGNEyG: "lb1cy8zhl",
10
+ kWkggS: "lbjbqb8w lbql1cz1",
11
+ kGVxlE: "lb11szn1f",
12
+ kMwMTN: "lb1heor9g",
13
+ kkrTdU: "lb1ypdohk",
14
+ k1xSpc: "lb78zum5",
15
+ kXwgrk: "lbdt5ytf",
16
+ k7Eaqz: "lbeuugli",
17
+ kGO01o: "lb1l90r2v",
18
+ kLKAdn: "lbyinxu5",
19
+ kVAEAm: "lb1n2onr6",
20
+ k9WMMc: "lb1yc453h",
21
+ kcktkL: "lbb7ltuz",
22
+ ks3ayO: "lbyhc2n1",
23
+ k4zj60: "lbar2jh8",
24
+ k5JduY: "lb1s928wv",
25
+ k8Iv0R: "lbexwc5z",
26
+ kwXMNM: "lb1j6awrg",
27
+ $$css: true
28
+ },
29
+ cellActive: {
30
+ kWkggS: "lbaljia1",
31
+ ks3ayO: "lb1qvhnq6",
32
+ $$css: true
33
+ },
34
+ count: {
35
+ kMwMTN: "lb66ogz0",
36
+ kGuDYH: "lb1x0ry8x",
37
+ kcqcaj: "lbss6m8b",
38
+ k63SB2: "lb1s688f",
39
+ kLWn49: "lb1uo3zyz",
40
+ $$css: true
41
+ },
42
+ countDanger: {
43
+ kMwMTN: "lb12ap7uz",
44
+ $$css: true
45
+ },
46
+ countWarning: {
47
+ kMwMTN: "lbgyvj36",
48
+ $$css: true
49
+ },
50
+ frame: {
51
+ "--filter-seam": "lb1osd58z",
52
+ kaIpWk: "lb1pjcqnp",
53
+ kVQacm: "lbb3r6kr",
54
+ $$css: true
55
+ },
56
+ grid: {
57
+ k1xSpc: "lbrvj5dj",
58
+ kumcoG: "lbwqfyl0",
59
+ kzqmXN: "lbjl7whj",
60
+ k1K539: "lb1jyxor1",
61
+ $$css: true
62
+ },
63
+ label: {
64
+ kMwMTN: "lbc77et8",
65
+ kGuDYH: "lb4z9k3i",
66
+ k63SB2: "lbk50ysn",
67
+ kLWn49: "lb37zpob",
68
+ $$css: true
69
+ },
70
+ labelActive: {
71
+ kMwMTN: "lb66ogz0",
72
+ $$css: true
73
+ }
74
+ };
75
+ //#endregion
76
+ export { styles };
77
+
78
+ //# sourceMappingURL=style.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"style.mjs","names":[],"sources":["../../../src/dashboard/FilterStrip/style.ts"],"sourcesContent":["import * as stylex from '@stylexjs/stylex';\n\nimport { cssVar } from '@/styles/stylex/cssVar.stylex';\n\nexport const styles = stylex.create({\n cell: {\n 'font': 'inherit',\n 'margin': 0,\n 'borderWidth': 0,\n 'gap': 6,\n 'paddingInline': 16,\n 'alignItems': 'flex-start',\n 'backgroundColor': { 'default': 'transparent', ':hover': cssVar.colorFillQuaternary },\n 'boxShadow': 'inset -1px 0 0 var(--filter-seam), inset 0 -1px 0 var(--filter-seam)',\n 'color': 'inherit',\n 'cursor': 'pointer',\n 'display': 'flex',\n 'flexDirection': 'column',\n 'minInlineSize': 0,\n 'paddingBlockEnd': 16,\n 'paddingBlockStart': 14,\n 'position': 'relative',\n 'textAlign': 'start',\n '::after': {\n insetInline: 0,\n backgroundColor: 'transparent',\n blockSize: 3,\n content: '\"\"',\n insetBlockEnd: 1,\n position: 'absolute',\n },\n },\n cellActive: {\n 'backgroundColor': cssVar.colorFillTertiary,\n '::after': {\n backgroundColor: cssVar.colorText,\n },\n },\n count: {\n color: cssVar.colorText,\n fontSize: cssVar.fontSizeHeading4,\n fontVariantNumeric: 'tabular-nums',\n fontWeight: 600,\n lineHeight: 1.15,\n },\n countDanger: {\n color: cssVar.colorError,\n },\n countWarning: {\n color: cssVar.colorWarning,\n },\n frame: {\n '--filter-seam': cssVar.colorFillSecondary,\n 'borderRadius': 'inherit',\n 'overflow': 'hidden',\n },\n grid: {\n display: 'grid',\n gridTemplateColumns: 'repeat(auto-fit, minmax(148px, 1fr))',\n inlineSize: 'calc(100% + 1px)',\n marginBlockEnd: -1,\n },\n label: {\n color: cssVar.colorTextSecondary,\n fontSize: 13,\n fontWeight: 500,\n lineHeight: 1.4,\n },\n labelActive: {\n color: cssVar.colorText,\n },\n});\n"],"mappings":";AAGA,MAAa,SAAS;CACpB,MAAM;EACJ,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,YAAY;EACV,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,OAAO;EACL,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,aAAa;EACX,QAAQ;EACR,OAAO;CACT;CACA,cAAc;EACZ,QAAQ;EACR,OAAO;CACT;CACA,OAAO;EACL,iBAAiB;EACjB,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,MAAM;EACJ,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,OAAO;EACL,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,aAAa;EACX,QAAQ;EACR,OAAO;CACT;AACF"}
@@ -0,0 +1,25 @@
1
+ import { ReactNode } from "react";
2
+ //#region src/dashboard/FilterStrip/type.d.ts
3
+ export interface FilterStripItem {
4
+ count?: number;
5
+ /** Shown as the control's title. Definitions stay off the number so the row can be scanned. */
6
+ hint?: string;
7
+ key: string;
8
+ label: ReactNode;
9
+ loading?: boolean;
10
+ /** Colors the count only when it is greater than zero; a zero is not an incident. */
11
+ tone?: 'danger' | 'warning';
12
+ }
13
+ export interface FilterStripProps {
14
+ /** Shown when an item has no count. Defaults to `--`. */
15
+ emptyText?: ReactNode;
16
+ /** Formats a count. Defaults to a grouped integer, e.g. `12,345`. */
17
+ formatCount?: (count: number) => ReactNode;
18
+ items: FilterStripItem[];
19
+ /** Accessible name for the radio group. */
20
+ label: string;
21
+ onChange: (key: string) => void;
22
+ value: string;
23
+ }
24
+ //#endregion
25
+ //# sourceMappingURL=type.d.mts.map
@@ -0,0 +1,10 @@
1
+ import { LabelWithKeyProps } from "./type.mjs";
2
+ //#region src/dashboard/LabelWithKey/LabelWithKey.d.ts
3
+ /** A human label followed by its machine key as a tag. */
4
+ declare const LabelWithKey: {
5
+ ({ tag, title, ...rest }: LabelWithKeyProps): import("react").JSX.Element;
6
+ displayName: string;
7
+ };
8
+ //#endregion
9
+ export { LabelWithKey as default };
10
+ //# sourceMappingURL=LabelWithKey.d.mts.map
@@ -0,0 +1,18 @@
1
+ "use client";
2
+ import FlexBasic_default from "../../Flex/FlexBasic.mjs";
3
+ import Tag from "../../Tag/Tag.mjs";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ //#region src/dashboard/LabelWithKey/LabelWithKey.tsx
6
+ /** A human label followed by its machine key as a tag. */
7
+ const LabelWithKey = ({ tag, title, ...rest }) => /* @__PURE__ */ jsxs(FlexBasic_default, {
8
+ horizontal: true,
9
+ align: "center",
10
+ gap: 8,
11
+ ...rest,
12
+ children: [title, /* @__PURE__ */ jsx(Tag, { children: tag })]
13
+ });
14
+ LabelWithKey.displayName = "LabelWithKey";
15
+ //#endregion
16
+ export { LabelWithKey as default };
17
+
18
+ //# sourceMappingURL=LabelWithKey.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LabelWithKey.mjs","names":["Flexbox"],"sources":["../../../src/dashboard/LabelWithKey/LabelWithKey.tsx"],"sourcesContent":["'use client';\n\nimport { Flexbox } from '@/Flex';\nimport Tag from '@/Tag';\n\nimport type { LabelWithKeyProps } from './type';\n\n/** A human label followed by its machine key as a tag. */\nconst LabelWithKey = ({ tag, title, ...rest }: LabelWithKeyProps) => (\n <Flexbox horizontal align={'center'} gap={8} {...rest}>\n {title}\n <Tag>{tag}</Tag>\n </Flexbox>\n);\n\nLabelWithKey.displayName = 'LabelWithKey';\n\nexport default LabelWithKey;\n"],"mappings":";;;;;;AAQA,MAAM,gBAAgB,EAAE,KAAK,OAAO,GAAG,WACrC,qBAACA,mBAAD;CAAS,YAAA;CAAW,OAAO;CAAU,KAAK;CAAG,GAAI;CAAjD,UAAA,CACG,OACD,oBAAC,KAAD,EAAA,UAAM,IAAS,CAAA,CACR;;AAGX,aAAa,cAAc"}
@@ -0,0 +1,3 @@
1
+ import { LabelWithKeyProps } from "./type.mjs";
2
+ import LabelWithKey from "./LabelWithKey.mjs";
3
+ export { type LabelWithKeyProps, LabelWithKey as default };
@@ -0,0 +1,11 @@
1
+ import { FlexboxProps } from "../../Flex/type.mjs";
2
+ import "../../Flex/index.mjs";
3
+ import { ReactNode } from "react";
4
+ //#region src/dashboard/LabelWithKey/type.d.ts
5
+ export interface LabelWithKeyProps extends Omit<FlexboxProps, 'title'> {
6
+ /** The machine key shown as a tag after the label, e.g. a config or permission id. */
7
+ tag: ReactNode;
8
+ title: ReactNode;
9
+ }
10
+ //#endregion
11
+ //# sourceMappingURL=type.d.mts.map
@@ -0,0 +1,81 @@
1
+ "use client";
2
+ import Icon from "../../Icon/Icon.mjs";
3
+ import Skeleton from "../../Skeleton/index.mjs";
4
+ import { useSurfaceLink } from "../Surface/link.mjs";
5
+ import { styles } from "./style.mjs";
6
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
7
+ import * as stylex from "@stylexjs/stylex";
8
+ //#region src/dashboard/MetricStrip/MetricCell.tsx
9
+ const deltaStyles = {
10
+ down: styles.deltaDown,
11
+ flat: styles.deltaFlat,
12
+ up: styles.deltaUp
13
+ };
14
+ const MetricBody = ({ item, loading }) => /* @__PURE__ */ jsxs(Fragment, { children: [
15
+ /* @__PURE__ */ jsxs("div", {
16
+ ...stylex.props(styles.head),
17
+ children: [/* @__PURE__ */ jsxs("div", {
18
+ ...stylex.props(styles.headCopy),
19
+ children: [/* @__PURE__ */ jsx("div", {
20
+ ...stylex.props(styles.label),
21
+ children: item.label
22
+ }), item.action]
23
+ }), item.mark ? /* @__PURE__ */ jsx("span", {
24
+ "aria-hidden": true,
25
+ ...stylex.props(styles.mark),
26
+ children: /* @__PURE__ */ jsx(Icon, {
27
+ icon: item.mark,
28
+ size: 14
29
+ })
30
+ }) : null]
31
+ }),
32
+ loading ? /* @__PURE__ */ jsx(Skeleton, {
33
+ height: 28,
34
+ radius: 6,
35
+ width: 88
36
+ }) : /* @__PURE__ */ jsx("div", {
37
+ ...stylex.props(styles.value, item.valueTone === "danger" && styles.valueDanger, item.valueTone === "warning" && styles.valueWarning),
38
+ children: item.value
39
+ }),
40
+ !loading && (item.delta || item.hint) ? /* @__PURE__ */ jsxs("div", {
41
+ ...stylex.props(styles.foot),
42
+ children: [item.delta ? /* @__PURE__ */ jsx("span", {
43
+ ...stylex.props(styles.delta, deltaStyles[item.direction ?? "flat"]),
44
+ children: item.delta
45
+ }) : null, item.hint ? /* @__PURE__ */ jsx("span", {
46
+ ...stylex.props(styles.hint),
47
+ children: item.hint
48
+ }) : null]
49
+ }) : null
50
+ ] });
51
+ /** One metric: label row, figure, delta and hint. Shared by MetricStrip and StatCard. */
52
+ const MetricCell = ({ item, loading, renderLink, seam = false }) => {
53
+ const link = useSurfaceLink(renderLink);
54
+ const body = /* @__PURE__ */ jsx(MetricBody, {
55
+ item,
56
+ loading: item.loading ?? loading
57
+ });
58
+ const cell = [styles.cell, seam && styles.cellSeam];
59
+ if (item.href) return /* @__PURE__ */ jsx("div", {
60
+ ...stylex.props(styles.slot),
61
+ children: link({
62
+ children: body,
63
+ className: stylex.props(cell, styles.link).className,
64
+ href: item.href
65
+ })
66
+ });
67
+ if (item.onClick) return /* @__PURE__ */ jsx("button", {
68
+ type: "button",
69
+ onClick: item.onClick,
70
+ ...stylex.props(cell, styles.press),
71
+ children: body
72
+ });
73
+ return /* @__PURE__ */ jsx("div", {
74
+ ...stylex.props(cell),
75
+ children: body
76
+ });
77
+ };
78
+ //#endregion
79
+ export { MetricCell as default };
80
+
81
+ //# sourceMappingURL=MetricCell.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MetricCell.mjs","names":[],"sources":["../../../src/dashboard/MetricStrip/MetricCell.tsx"],"sourcesContent":["'use client';\n\nimport * as stylex from '@stylexjs/stylex';\n\nimport Icon from '@/Icon';\nimport Skeleton from '@/Skeleton';\n\nimport { useSurfaceLink } from '../Surface/link';\nimport type { SurfaceRenderLink } from '../Surface/type';\nimport { styles } from './style';\nimport type { MetricItem } from './type';\n\nconst deltaStyles = {\n down: styles.deltaDown,\n flat: styles.deltaFlat,\n up: styles.deltaUp,\n} as const;\n\nconst MetricBody = ({ item, loading }: { item: MetricItem; loading?: boolean }) => (\n <>\n <div {...stylex.props(styles.head)}>\n <div {...stylex.props(styles.headCopy)}>\n <div {...stylex.props(styles.label)}>{item.label}</div>\n {item.action}\n </div>\n {item.mark ? (\n <span aria-hidden {...stylex.props(styles.mark)}>\n <Icon icon={item.mark} size={14} />\n </span>\n ) : null}\n </div>\n {loading ? (\n <Skeleton height={28} radius={6} width={88} />\n ) : (\n <div\n {...stylex.props(\n styles.value,\n item.valueTone === 'danger' && styles.valueDanger,\n item.valueTone === 'warning' && styles.valueWarning,\n )}\n >\n {item.value}\n </div>\n )}\n {!loading && (item.delta || item.hint) ? (\n <div {...stylex.props(styles.foot)}>\n {item.delta ? (\n <span {...stylex.props(styles.delta, deltaStyles[item.direction ?? 'flat'])}>\n {item.delta}\n </span>\n ) : null}\n {item.hint ? <span {...stylex.props(styles.hint)}>{item.hint}</span> : null}\n </div>\n ) : null}\n </>\n);\n\nexport interface MetricCellProps {\n item: MetricItem;\n loading?: boolean;\n renderLink?: SurfaceRenderLink;\n /** Draw the joined-strip divider on the trailing and bottom edges. */\n seam?: boolean;\n}\n\n/** One metric: label row, figure, delta and hint. Shared by MetricStrip and StatCard. */\nconst MetricCell = ({ item, loading, renderLink, seam = false }: MetricCellProps) => {\n const link = useSurfaceLink(renderLink);\n const body = <MetricBody item={item} loading={item.loading ?? loading} />;\n const cell = [styles.cell, seam && styles.cellSeam];\n\n if (item.href) {\n return (\n <div {...stylex.props(styles.slot)}>\n {link({\n children: body,\n className: stylex.props(cell, styles.link).className,\n href: item.href,\n })}\n </div>\n );\n }\n if (item.onClick) {\n return (\n <button type=\"button\" onClick={item.onClick} {...stylex.props(cell, styles.press)}>\n {body}\n </button>\n );\n }\n return <div {...stylex.props(cell)}>{body}</div>;\n};\n\nexport default MetricCell;\n"],"mappings":";;;;;;;;AASA,MAAM,cAAc;CAClB,MAAM,OAAO;CACb,MAAM,OAAO;CACb,IAAI,OAAO;AACb;AACA,MAAM,cAAc,EAClB,MACA,cAII,qBAAA,UAAA,EAAA,UAAA;CACF,qBAAC,OAAD;EAAK,GAAI,OAAO,MAAM,OAAO,IAAI;EAAjC,UAAA,CACE,qBAAC,OAAD;GAAK,GAAI,OAAO,MAAM,OAAO,QAAQ;GAArC,UAAA,CACE,oBAAC,OAAD;IAAK,GAAI,OAAO,MAAM,OAAO,KAAK;IAAI,UAAA,KAAK;GAAW,CAAA,GACrD,KAAK,MACH;EACJ,CAAA,GAAA,KAAK,OAAO,oBAAC,QAAD;GAAM,eAAA;GAAY,GAAI,OAAO,MAAM,OAAO,IAAI;GACvD,UAAA,oBAAC,MAAD;IAAM,MAAM,KAAK;IAAM,MAAM;GAAK,CAAA;EAC9B,CAAA,IAAI,IACT;;CACJ,UAAU,oBAAC,UAAD;EAAU,QAAQ;EAAI,QAAQ;EAAG,OAAO;CAAK,CAAA,IAAI,oBAAC,OAAD;EAAK,GAAI,OAAO,MAAM,OAAO,OAAO,KAAK,cAAc,YAAY,OAAO,aAAa,KAAK,cAAc,aAAa,OAAO,YAAY;EACjM,UAAA,KAAK;CACH,CAAA;CACN,CAAC,YAAY,KAAK,SAAS,KAAK,QAAQ,qBAAC,OAAD;EAAK,GAAI,OAAO,MAAM,OAAO,IAAI;EAAjC,UAAA,CACpC,KAAK,QAAQ,oBAAC,QAAD;GAAM,GAAI,OAAO,MAAM,OAAO,OAAO,YAAY,KAAK,aAAa,OAAO;GACnF,UAAA,KAAK;EACF,CAAA,IAAI,MACX,KAAK,OAAO,oBAAC,QAAD;GAAM,GAAI,OAAO,MAAM,OAAO,IAAI;GAAI,UAAA,KAAK;EAAW,CAAA,IAAI,IACpE;CAAI,CAAA,IAAA;AACX,EAAA,CAAA;;AAUJ,MAAM,cAAc,EAClB,MACA,SACA,YACA,OAAO,YACc;CACrB,MAAM,OAAO,eAAe,UAAU;CACtC,MAAM,OAAO,oBAAC,YAAD;EAAkB;EAAM,SAAS,KAAK,WAAW;CAAU,CAAA;CACxE,MAAM,OAAO,CAAC,OAAO,MAAM,QAAQ,OAAO,QAAQ;CAClD,IAAI,KAAK,MACP,OAAO,oBAAC,OAAD;EAAK,GAAI,OAAO,MAAM,OAAO,IAAI;EACnC,UAAA,KAAK;GACN,UAAU;GACV,WAAW,OAAO,MAAM,MAAM,OAAO,IAAI,CAAC,CAAC;GAC3C,MAAM,KAAK;EACb,CAAC;CACI,CAAA;CAET,IAAI,KAAK,SACP,OAAO,oBAAC,UAAD;EAAQ,MAAK;EAAS,SAAS,KAAK;EAAS,GAAI,OAAO,MAAM,MAAM,OAAO,KAAK;EAClF,UAAA;CACK,CAAA;CAEZ,OAAO,oBAAC,OAAD;EAAK,GAAI,OAAO,MAAM,IAAI;EAAI,UAAA;CAAU,CAAA;AACjD"}
@@ -0,0 +1,13 @@
1
+ import { MetricStripProps } from "./type.mjs";
2
+ //#region src/dashboard/MetricStrip/MetricStrip.d.ts
3
+ /**
4
+ * Peer metrics. `joined` shares one card divided into cells; `split` gives each item its own card,
5
+ * identical to StatCard.
6
+ */
7
+ declare const MetricStrip: {
8
+ ({ items, loading, renderLink, variant }: MetricStripProps): import("react").JSX.Element;
9
+ displayName: string;
10
+ };
11
+ //#endregion
12
+ export { MetricStrip as default };
13
+ //# sourceMappingURL=MetricStrip.d.mts.map
@@ -0,0 +1,47 @@
1
+ "use client";
2
+ import { styles } from "../Surface/style.mjs";
3
+ import { useSurfaceCardStyles } from "../Surface/link.mjs";
4
+ import Surface from "../Surface/Surface.mjs";
5
+ import { styles as styles$1 } from "./style.mjs";
6
+ import MetricCell from "./MetricCell.mjs";
7
+ import { jsx } from "react/jsx-runtime";
8
+ import * as stylex from "@stylexjs/stylex";
9
+ //#region src/dashboard/MetricStrip/MetricStrip.tsx
10
+ /**
11
+ * Peer metrics. `joined` shares one card divided into cells; `split` gives each item its own card,
12
+ * identical to StatCard.
13
+ */
14
+ const MetricStrip = ({ items, loading, renderLink, variant = "joined" }) => {
15
+ const cardStyles = useSurfaceCardStyles();
16
+ if (variant === "split") return /* @__PURE__ */ jsx("div", {
17
+ ...stylex.props(styles$1.split),
18
+ children: items.map((item, index) => /* @__PURE__ */ jsx("div", {
19
+ ...stylex.props(styles$1.card, cardStyles, styles.clip),
20
+ children: /* @__PURE__ */ jsx(MetricCell, {
21
+ item,
22
+ loading,
23
+ renderLink
24
+ })
25
+ }, index))
26
+ });
27
+ return /* @__PURE__ */ jsx(Surface, {
28
+ className: stylex.props(styles.clip).className,
29
+ children: /* @__PURE__ */ jsx("div", {
30
+ ...stylex.props(styles$1.frame),
31
+ children: /* @__PURE__ */ jsx("div", {
32
+ ...stylex.props(styles$1.grid),
33
+ children: items.map((item, index) => /* @__PURE__ */ jsx(MetricCell, {
34
+ seam: true,
35
+ item,
36
+ loading,
37
+ renderLink
38
+ }, index))
39
+ })
40
+ })
41
+ });
42
+ };
43
+ MetricStrip.displayName = "MetricStrip";
44
+ //#endregion
45
+ export { MetricStrip as default };
46
+
47
+ //# sourceMappingURL=MetricStrip.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MetricStrip.mjs","names":["styles","surfaceStyles"],"sources":["../../../src/dashboard/MetricStrip/MetricStrip.tsx"],"sourcesContent":["'use client';\n\nimport * as stylex from '@stylexjs/stylex';\n\nimport { useSurfaceCardStyles } from '../Surface/link';\nimport { styles as surfaceStyles } from '../Surface/style';\nimport Surface from '../Surface/Surface';\nimport MetricCell from './MetricCell';\nimport { styles } from './style';\nimport type { MetricStripProps } from './type';\n\n/**\n * Peer metrics. `joined` shares one card divided into cells; `split` gives each item its own card,\n * identical to StatCard.\n */\nconst MetricStrip = ({ items, loading, renderLink, variant = 'joined' }: MetricStripProps) => {\n const cardStyles = useSurfaceCardStyles();\n\n if (variant === 'split') {\n return (\n <div {...stylex.props(styles.split)}>\n {items.map((item, index) => (\n <div key={index} {...stylex.props(styles.card, cardStyles, surfaceStyles.clip)}>\n <MetricCell item={item} loading={loading} renderLink={renderLink} />\n </div>\n ))}\n </div>\n );\n }\n\n return (\n <Surface className={stylex.props(surfaceStyles.clip).className}>\n <div {...stylex.props(styles.frame)}>\n <div {...stylex.props(styles.grid)}>\n {items.map((item, index) => (\n <MetricCell seam item={item} key={index} loading={loading} renderLink={renderLink} />\n ))}\n </div>\n </div>\n </Surface>\n );\n};\n\nMetricStrip.displayName = 'MetricStrip';\n\nexport default MetricStrip;\n"],"mappings":";;;;;;;;;;;;;AAcA,MAAM,eAAe,EACnB,OACA,SACA,YACA,UAAU,eACY;CACtB,MAAM,aAAa,qBAAqB;CACxC,IAAI,YAAY,SACd,OAAO,oBAAC,OAAD;EAAK,GAAI,OAAO,MAAMA,SAAO,KAAK;EACpC,UAAA,MAAM,KAAK,MAAM,UAAU,oBAAC,OAAD;GAAiB,GAAI,OAAO,MAAMA,SAAO,MAAM,YAAYC,OAAc,IAAI;GACrG,UAAA,oBAAC,YAAD;IAAkB;IAAe;IAAqB;GAAa,CAAA;EAChE,GAF+B,KAE/B,CAAC;CACL,CAAA;CAET,OAAO,oBAAC,SAAD;EAAS,WAAW,OAAO,MAAMA,OAAc,IAAI,CAAC,CAAC;EACxD,UAAA,oBAAC,OAAD;GAAK,GAAI,OAAO,MAAMD,SAAO,KAAK;GAChC,UAAA,oBAAC,OAAD;IAAK,GAAI,OAAO,MAAMA,SAAO,IAAI;IAC9B,UAAA,MAAM,KAAK,MAAM,UAAU,oBAAC,YAAD;KAAY,MAAA;KAAW;KAA2B;KAAqB;IAAa,GAAlD,KAAkD,CAAC;GAC9G,CAAA;EACF,CAAA;CACE,CAAA;AACb;AACA,YAAY,cAAc"}
@@ -0,0 +1,3 @@
1
+ import { MetricItem, MetricStripProps } from "./type.mjs";
2
+ import MetricStrip from "./MetricStrip.mjs";
3
+ export { type MetricItem, type MetricStripProps, MetricStrip as default };
@@ -0,0 +1,156 @@
1
+ //#region src/dashboard/MetricStrip/style.ts
2
+ const styles = {
3
+ card: {
4
+ k1xSpc: "lbrvj5dj",
5
+ k7Eaqz: "lbeuugli",
6
+ $$css: true
7
+ },
8
+ cell: {
9
+ kOIVth: "lb17d4w8g",
10
+ k8WAf4: "lb1xn8qrt",
11
+ kg3NbH: "lb17qtykl",
12
+ kWkggS: "lbjbqb8w",
13
+ k1xSpc: "lb78zum5",
14
+ kXwgrk: "lbdt5ytf",
15
+ k7Eaqz: "lbeuugli",
16
+ $$css: true
17
+ },
18
+ cellSeam: {
19
+ kGVxlE: "lb4uk749",
20
+ $$css: true
21
+ },
22
+ delta: {
23
+ kGuDYH: "lb4z9k3i",
24
+ kcqcaj: "lbss6m8b",
25
+ kLWn49: "lb37zpob",
26
+ $$css: true
27
+ },
28
+ deltaDown: {
29
+ kMwMTN: "lb12ap7uz",
30
+ $$css: true
31
+ },
32
+ deltaFlat: {
33
+ kMwMTN: "lbc77et8",
34
+ $$css: true
35
+ },
36
+ deltaUp: {
37
+ kMwMTN: "lbs9y9h1",
38
+ $$css: true
39
+ },
40
+ foot: {
41
+ kOIVth: "lb167g77z",
42
+ kGNEyG: "lb1pha0wt",
43
+ k1xSpc: "lb78zum5",
44
+ kwnvtZ: "lb1a02dak",
45
+ $$css: true
46
+ },
47
+ frame: {
48
+ "--metric-seam": "lbgo1hwp",
49
+ kaIpWk: "lb1pjcqnp",
50
+ kVQacm: "lbb3r6kr",
51
+ kWkggS: "lbjbqb8w",
52
+ $$css: true
53
+ },
54
+ grid: {
55
+ kWkggS: "lbjbqb8w",
56
+ k1xSpc: "lbrvj5dj",
57
+ kumcoG: "lb1rfa8br",
58
+ kzqmXN: "lbjl7whj",
59
+ k1K539: "lb1jyxor1",
60
+ $$css: true
61
+ },
62
+ head: {
63
+ kOIVth: "lb167g77z",
64
+ kGNEyG: "lb6s0dn4",
65
+ kZKoxP: "lb10w6t97",
66
+ kB7OPa: "lb9f619",
67
+ k1xSpc: "lb78zum5",
68
+ kjj79g: "lb1qughib",
69
+ k7Eaqz: "lbeuugli",
70
+ $$css: true
71
+ },
72
+ headCopy: {
73
+ kOIVth: "lb17d4w8g",
74
+ kGNEyG: "lb6s0dn4",
75
+ k1xSpc: "lb78zum5",
76
+ k7Eaqz: "lbeuugli",
77
+ $$css: true
78
+ },
79
+ hint: {
80
+ kMwMTN: "lbc77et8",
81
+ kGuDYH: "lb4z9k3i",
82
+ kLWn49: "lb37zpob",
83
+ $$css: true
84
+ },
85
+ label: {
86
+ kMwMTN: "lbc77et8",
87
+ kGuDYH: "lb4z9k3i",
88
+ k63SB2: "lbk50ysn",
89
+ kLWn49: "lb37zpob",
90
+ $$css: true
91
+ },
92
+ link: {
93
+ kybGjl: "lb1hl2dhg",
94
+ kWkggS: "lbjbqb8w lbql1cz1",
95
+ kMwMTN: "lb1heor9g",
96
+ $$css: true
97
+ },
98
+ mark: {
99
+ kVAM5u: "lb6d5vuu",
100
+ kaIpWk: "lb1vihcfj",
101
+ ksu8eU: "lb1y0btm7",
102
+ kMzoRj: "lbmkeg23",
103
+ kUk6DE: "lb1okw0bk",
104
+ kGNEyG: "lb6s0dn4",
105
+ kWkggS: "lbaljia1",
106
+ kZKoxP: "lbxk0z11",
107
+ kMwMTN: "lb53gy9q",
108
+ k1xSpc: "lb3nfvp2",
109
+ kzqmXN: "lbvy4d1p",
110
+ kjj79g: "lbl56j7k",
111
+ $$css: true
112
+ },
113
+ press: {
114
+ kVVagm: "lbln7xf2",
115
+ ksu8eU: "lbng3xce",
116
+ kWkggS: "lbjbqb8w lbql1cz1",
117
+ kMwMTN: "lb1heor9g",
118
+ kkrTdU: "lb1ypdohk",
119
+ k9WMMc: "lb1yc453h",
120
+ $$css: true
121
+ },
122
+ slot: {
123
+ k1xSpc: "lbrvj5dj",
124
+ k7Eaqz: "lbeuugli",
125
+ $$css: true
126
+ },
127
+ split: {
128
+ kOIVth: "lb1v2ro7d",
129
+ k1xSpc: "lbrvj5dj",
130
+ kumcoG: "lb1rfa8br",
131
+ $$css: true
132
+ },
133
+ value: {
134
+ kVQacm: "lbb3r6kr",
135
+ kMwMTN: "lb66ogz0",
136
+ kGuDYH: "lb4zirph",
137
+ kcqcaj: "lbss6m8b",
138
+ k63SB2: "lb1s688f",
139
+ kLWn49: "lb1uo3zyz",
140
+ kg5iWk: "lblyipyv",
141
+ khDVqt: "lbuxw1ft",
142
+ $$css: true
143
+ },
144
+ valueDanger: {
145
+ kMwMTN: "lb12ap7uz",
146
+ $$css: true
147
+ },
148
+ valueWarning: {
149
+ kMwMTN: "lbgyvj36",
150
+ $$css: true
151
+ }
152
+ };
153
+ //#endregion
154
+ export { styles };
155
+
156
+ //# sourceMappingURL=style.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"style.mjs","names":[],"sources":["../../../src/dashboard/MetricStrip/style.ts"],"sourcesContent":["import * as stylex from '@stylexjs/stylex';\n\nimport { cssVar } from '@/styles/stylex/cssVar.stylex';\n\nexport const styles = stylex.create({\n /** Split strip and StatCard: one card per item. */\n card: {\n display: 'grid',\n minInlineSize: 0,\n },\n cell: {\n gap: 6,\n paddingBlock: 16,\n paddingInline: 20,\n backgroundColor: 'transparent',\n display: 'flex',\n flexDirection: 'column',\n minInlineSize: 0,\n },\n /** Joined strip only: the divider on the cell's trailing and bottom edges. */\n cellSeam: {\n boxShadow: 'inset -1px 0 0 var(--metric-seam), inset 0 -1px 0 var(--metric-seam)',\n },\n delta: {\n fontSize: 13,\n fontVariantNumeric: 'tabular-nums',\n lineHeight: 1.4,\n },\n deltaDown: {\n color: cssVar.colorError,\n },\n deltaFlat: {\n color: cssVar.colorTextSecondary,\n },\n deltaUp: {\n color: cssVar.colorSuccess,\n },\n foot: {\n gap: 8,\n alignItems: 'baseline',\n display: 'flex',\n flexWrap: 'wrap',\n },\n /**\n * Clips the seam that would otherwise sit on the card's trailing and bottom\n * edges. A short last row used to show the seam color across the empty\n * track, which reads louder than the cells.\n */\n frame: {\n '--metric-seam': cssVar.colorFillSecondary,\n 'borderRadius': 'inherit',\n 'overflow': 'hidden',\n 'backgroundColor': 'transparent',\n },\n grid: {\n backgroundColor: 'transparent',\n display: 'grid',\n gridTemplateColumns: 'repeat(auto-fit, minmax(180px, 1fr))',\n inlineSize: 'calc(100% + 1px)',\n marginBlockEnd: -1,\n },\n /* One fixed 32px row (a small Segmented or ActionIcon fits): an action or mark in the head must\n not push the value down, so cells with and without header controls line up across a split\n strip or a row of StatCards. */\n head: {\n gap: 8,\n alignItems: 'center',\n blockSize: 32,\n boxSizing: 'border-box',\n display: 'flex',\n justifyContent: 'space-between',\n minInlineSize: 0,\n },\n headCopy: {\n gap: 6,\n alignItems: 'center',\n display: 'flex',\n minInlineSize: 0,\n },\n hint: {\n color: cssVar.colorTextSecondary,\n fontSize: 13,\n lineHeight: 1.4,\n },\n label: {\n color: cssVar.colorTextSecondary,\n fontSize: 13,\n fontWeight: 500,\n lineHeight: 1.4,\n },\n link: {\n textDecoration: 'none',\n backgroundColor: { 'default': 'transparent', ':hover': cssVar.colorFillQuaternary },\n color: 'inherit',\n },\n mark: {\n borderColor: cssVar.colorFillSecondary,\n borderRadius: cssVar.borderRadiusSM,\n borderStyle: 'solid',\n borderWidth: 1,\n flex: 'none',\n alignItems: 'center',\n backgroundColor: cssVar.colorFillTertiary,\n blockSize: 24,\n color: cssVar.colorTextTertiary,\n display: 'inline-flex',\n inlineSize: 24,\n justifyContent: 'center',\n },\n press: {\n font: 'inherit',\n borderStyle: 'none',\n backgroundColor: { 'default': 'transparent', ':hover': cssVar.colorFillQuaternary },\n color: 'inherit',\n cursor: 'pointer',\n textAlign: 'start',\n },\n /** Grid cell around a rendered link, so the link fills it. */\n slot: {\n display: 'grid',\n minInlineSize: 0,\n },\n split: {\n gap: 12,\n display: 'grid',\n gridTemplateColumns: 'repeat(auto-fit, minmax(180px, 1fr))',\n },\n value: {\n overflow: 'hidden',\n color: cssVar.colorText,\n fontSize: cssVar.fontSizeHeading3,\n fontVariantNumeric: 'tabular-nums',\n fontWeight: 600,\n lineHeight: 1.15,\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n },\n valueDanger: {\n color: cssVar.colorError,\n },\n valueWarning: {\n color: cssVar.colorWarning,\n },\n});\n"],"mappings":";AAGA,MAAa,SAAS;CACpB,MAAM;EACJ,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,MAAM;EACJ,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,UAAU;EACR,QAAQ;EACR,OAAO;CACT;CACA,OAAO;EACL,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,WAAW;EACT,QAAQ;EACR,OAAO;CACT;CACA,WAAW;EACT,QAAQ;EACR,OAAO;CACT;CACA,SAAS;EACP,QAAQ;EACR,OAAO;CACT;CACA,MAAM;EACJ,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,OAAO;EACL,iBAAiB;EACjB,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,MAAM;EACJ,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO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