@siyahi/ui 0.1.9-next.3 → 0.1.9-next.31

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 (254) hide show
  1. package/DESIGN.md +251 -0
  2. package/README.md +94 -177
  3. package/THIRD_PARTY_NOTICES.md +11 -11
  4. package/agents/examples/accordion.tsx +39 -0
  5. package/agents/examples/alert.tsx +24 -0
  6. package/agents/examples/app-sidebar.tsx +40 -0
  7. package/agents/examples/avatar.tsx +24 -0
  8. package/agents/examples/badge.tsx +26 -0
  9. package/agents/examples/bar-list-labels.tsx +22 -0
  10. package/agents/examples/bar-list-sides.tsx +40 -0
  11. package/agents/examples/bar-list.tsx +24 -0
  12. package/agents/examples/breadcrumb.tsx +28 -0
  13. package/agents/examples/button-states.tsx +23 -0
  14. package/agents/examples/button.tsx +21 -0
  15. package/agents/examples/calendar.tsx +11 -0
  16. package/agents/examples/callout.tsx +33 -0
  17. package/agents/examples/card.tsx +36 -0
  18. package/agents/examples/change-bar.tsx +104 -0
  19. package/agents/examples/change-grid-money.tsx +36 -0
  20. package/agents/examples/change-grid.tsx +43 -0
  21. package/agents/examples/chart-area-log.tsx +45 -0
  22. package/agents/examples/chart-area.tsx +39 -0
  23. package/agents/examples/chart-bar-flows.tsx +32 -0
  24. package/agents/examples/chart-bar-hourly.tsx +28 -0
  25. package/agents/examples/chart-bar-losses.tsx +29 -0
  26. package/agents/examples/chart-bar-teams.tsx +72 -0
  27. package/agents/examples/chart-bar-years.tsx +42 -0
  28. package/agents/examples/chart-bar.tsx +56 -0
  29. package/agents/examples/chart-category-ticks.tsx +50 -0
  30. package/agents/examples/chart-line-events.tsx +47 -0
  31. package/agents/examples/chart-line-forecast.tsx +36 -0
  32. package/agents/examples/chart-line-log.tsx +39 -0
  33. package/agents/examples/chart-line-quiet.tsx +114 -0
  34. package/agents/examples/chart-line-timeline.tsx +41 -0
  35. package/agents/examples/chart-line.tsx +57 -0
  36. package/agents/examples/chart-panels.tsx +94 -0
  37. package/agents/examples/code-block.tsx +40 -0
  38. package/agents/examples/collapsible.tsx +18 -0
  39. package/agents/examples/command.tsx +29 -0
  40. package/agents/examples/context-menu.tsx +17 -0
  41. package/agents/examples/copy-button.tsx +8 -0
  42. package/agents/examples/data-bar.tsx +114 -0
  43. package/agents/examples/data-table-compact.tsx +93 -0
  44. package/agents/examples/data-table-filters.tsx +103 -0
  45. package/agents/examples/data-table.tsx +96 -0
  46. package/agents/examples/delta.tsx +18 -0
  47. package/agents/examples/dialog.tsx +28 -0
  48. package/agents/examples/distribution-bar-budget.tsx +30 -0
  49. package/agents/examples/distribution-bar-tug.tsx +74 -0
  50. package/agents/examples/drawdown-chart.tsx +35 -0
  51. package/agents/examples/dropdown-menu.tsx +31 -0
  52. package/agents/examples/field.tsx +108 -0
  53. package/agents/examples/formatters.tsx +42 -0
  54. package/agents/examples/heatmap-calendar-signed.tsx +67 -0
  55. package/agents/examples/heatmap-calendar.tsx +62 -0
  56. package/agents/examples/heatmap-status.tsx +61 -0
  57. package/agents/examples/heatmap-weekday.tsx +72 -0
  58. package/agents/examples/histogram-chart.tsx +28 -0
  59. package/agents/examples/input-states.tsx +23 -0
  60. package/agents/examples/input.tsx +17 -0
  61. package/agents/examples/local-time.tsx +14 -0
  62. package/agents/examples/metric-strip.tsx +46 -0
  63. package/agents/examples/overview-dashboard.tsx +180 -0
  64. package/agents/examples/page-hero.tsx +38 -0
  65. package/agents/examples/page-section.tsx +52 -0
  66. package/agents/examples/popover.tsx +23 -0
  67. package/agents/examples/price-chart.tsx +32 -0
  68. package/agents/examples/progress-tone.tsx +29 -0
  69. package/agents/examples/progress.tsx +10 -0
  70. package/agents/examples/range-position-table.tsx +113 -0
  71. package/agents/examples/range-position.tsx +55 -0
  72. package/agents/examples/scatter-chart-quadrants.tsx +63 -0
  73. package/agents/examples/scatter-chart-scales.tsx +46 -0
  74. package/agents/examples/scatter-chart.tsx +78 -0
  75. package/agents/examples/scroll-area.tsx +22 -0
  76. package/agents/examples/section-cards-select.tsx +28 -0
  77. package/agents/examples/section-cards-trend.tsx +32 -0
  78. package/agents/examples/section-cards.tsx +48 -0
  79. package/agents/examples/select.tsx +27 -0
  80. package/agents/examples/separator.tsx +13 -0
  81. package/agents/examples/sheet.tsx +15 -0
  82. package/agents/examples/skeleton.tsx +11 -0
  83. package/agents/examples/slider.tsx +5 -0
  84. package/agents/examples/slope-chart-market.tsx +33 -0
  85. package/agents/examples/slope-chart.tsx +26 -0
  86. package/agents/examples/stale-blocks.tsx +56 -0
  87. package/agents/examples/surfaces.tsx +116 -0
  88. package/agents/examples/table.tsx +60 -0
  89. package/agents/examples/tabs.tsx +16 -0
  90. package/agents/examples/target-rows.tsx +74 -0
  91. package/agents/examples/toggle-group.tsx +12 -0
  92. package/agents/examples/toggle.tsx +11 -0
  93. package/agents/examples/tooltip.tsx +13 -0
  94. package/agents/examples/treemap.tsx +93 -0
  95. package/agents/examples/waterfall-chart-stores.tsx +27 -0
  96. package/agents/examples/waterfall-chart.tsx +37 -0
  97. package/agents/manifest.json +1391 -0
  98. package/agents/report-rules.json +7 -0
  99. package/dist/components/registry/charts/area-chart-card.d.ts +7 -3
  100. package/dist/components/registry/charts/area-chart-card.js +56 -10
  101. package/dist/components/registry/charts/bar-chart-card.d.ts +1 -1
  102. package/dist/components/registry/charts/bar-chart-card.js +20 -22
  103. package/dist/components/registry/charts/line-chart-card.d.ts +3 -3
  104. package/dist/components/registry/charts/line-chart-card.js +44 -9
  105. package/dist/components/registry/dashboard-01/section-cards.d.ts +6 -0
  106. package/dist/components/registry/dashboard-01/section-cards.js +51 -35
  107. package/dist/components/registry/dashboardcn/bar-list.js +17 -10
  108. package/dist/components/registry/dashboardcn/distribution-bar.js +6 -4
  109. package/dist/components/registry/dashboardcn/kpi-row-card.d.ts +29 -0
  110. package/dist/components/registry/dashboardcn/kpi-row-card.js +81 -0
  111. package/dist/components/registry/dashboardcn/sparkline.d.ts +22 -0
  112. package/dist/components/registry/dashboardcn/sparkline.js +117 -0
  113. package/dist/components/registry/heatmap/calendar-heatmap.d.ts +11 -3
  114. package/dist/components/registry/heatmap/calendar-heatmap.js +164 -45
  115. package/dist/components/registry/heatmap/status-heatmap.d.ts +5 -3
  116. package/dist/components/registry/heatmap/status-heatmap.js +115 -54
  117. package/dist/components/registry/heatmap/weekday-heatmap.d.ts +9 -3
  118. package/dist/components/registry/heatmap/weekday-heatmap.js +83 -53
  119. package/dist/components/registry/niko-table/core/data-table-context.d.ts +18 -1
  120. package/dist/components/registry/niko-table/core/data-table-context.js +7 -1
  121. package/dist/components/registry/niko-table/core/data-table-grouped-row.js +3 -1
  122. package/dist/components/registry/niko-table/core/data-table-root.js +39 -4
  123. package/dist/components/registry/niko-table/core/data-table-structure.js +17 -12
  124. package/dist/components/registry/niko-table/core/data-table.d.ts +2 -2
  125. package/dist/components/registry/niko-table/core/data-table.js +5 -1
  126. package/dist/components/registry/niko-table/filters/table-faceted-filter.js +5 -5
  127. package/dist/components/registry/niko-table/filters/table-search-filter.js +1 -1
  128. package/dist/components/registry/niko-table/lib/flex-columns.d.ts +1 -1
  129. package/dist/components/registry/niko-table/lib/flex-columns.js +3 -3
  130. package/dist/components/registry/niko-table/lib/styles.d.ts +1 -1
  131. package/dist/components/registry/niko-table/lib/styles.js +3 -3
  132. package/dist/components/registry/niko-table/types/index.d.ts +9 -0
  133. package/dist/components/registry/niko-table/ui/table.js +2 -2
  134. package/dist/components/registry/sidebar-07/app-sidebar.d.ts +1 -1
  135. package/dist/components/registry/sidebar-07/app-sidebar.js +3 -1
  136. package/dist/components/registry/sidebar-07/nav-main.d.ts +2 -1
  137. package/dist/components/registry/sidebar-07/nav-main.js +16 -3
  138. package/dist/components/siyahi/callout.d.ts +17 -0
  139. package/dist/components/siyahi/callout.js +34 -0
  140. package/dist/components/siyahi/change-bar.d.ts +21 -0
  141. package/dist/components/siyahi/change-bar.js +35 -0
  142. package/dist/components/siyahi/change-grid.d.ts +31 -0
  143. package/dist/components/siyahi/change-grid.js +74 -0
  144. package/dist/components/siyahi/data-bar.d.ts +19 -0
  145. package/dist/components/siyahi/data-bar.js +29 -0
  146. package/dist/components/siyahi/data-table-compact-columns-toggle.d.ts +4 -0
  147. package/dist/components/siyahi/data-table-compact-columns-toggle.js +19 -0
  148. package/dist/components/siyahi/data-table-footnote.d.ts +12 -0
  149. package/dist/components/siyahi/data-table-footnote.js +35 -0
  150. package/dist/components/siyahi/default-sidebar-open.d.ts +8 -0
  151. package/dist/components/siyahi/default-sidebar-open.js +13 -0
  152. package/dist/components/siyahi/delta.d.ts +5 -1
  153. package/dist/components/siyahi/delta.js +14 -9
  154. package/dist/components/siyahi/drawdown-chart.d.ts +34 -0
  155. package/dist/components/siyahi/drawdown-chart.js +102 -0
  156. package/dist/components/siyahi/histogram-chart.d.ts +57 -0
  157. package/dist/components/siyahi/histogram-chart.js +134 -0
  158. package/dist/components/siyahi/page-hero.d.ts +23 -0
  159. package/dist/components/siyahi/page-hero.js +43 -0
  160. package/dist/components/siyahi/page-section.d.ts +4 -1
  161. package/dist/components/siyahi/page-section.js +6 -3
  162. package/dist/components/siyahi/page-toc.d.ts +20 -0
  163. package/dist/components/siyahi/page-toc.js +76 -0
  164. package/dist/components/siyahi/panel-grid.d.ts +24 -0
  165. package/dist/components/siyahi/panel-grid.js +37 -0
  166. package/dist/components/siyahi/quote.d.ts +12 -0
  167. package/dist/components/siyahi/quote.js +23 -0
  168. package/dist/components/siyahi/range-position.d.ts +24 -0
  169. package/dist/components/siyahi/range-position.js +105 -0
  170. package/dist/components/siyahi/scale-toggle.d.ts +32 -0
  171. package/dist/components/siyahi/scale-toggle.js +61 -0
  172. package/dist/components/siyahi/scatter-chart.d.ts +69 -0
  173. package/dist/components/siyahi/scatter-chart.js +395 -0
  174. package/dist/components/siyahi/siyahi-provider.d.ts +15 -2
  175. package/dist/components/siyahi/siyahi-provider.js +17 -4
  176. package/dist/components/siyahi/slope-chart.d.ts +35 -0
  177. package/dist/components/siyahi/slope-chart.js +159 -0
  178. package/dist/components/siyahi/stale-note.d.ts +9 -0
  179. package/dist/components/siyahi/stale-note.js +12 -0
  180. package/dist/components/siyahi/status-alert.d.ts +15 -0
  181. package/dist/components/siyahi/status-alert.js +29 -0
  182. package/dist/components/siyahi/status-badge.d.ts +15 -0
  183. package/dist/components/siyahi/status-badge.js +24 -0
  184. package/dist/components/siyahi/target-rows.d.ts +34 -0
  185. package/dist/components/siyahi/target-rows.js +97 -0
  186. package/dist/components/siyahi/tone-progress.d.ts +1 -1
  187. package/dist/components/siyahi/tone-progress.js +1 -1
  188. package/dist/components/siyahi/treemap.d.ts +8 -5
  189. package/dist/components/siyahi/treemap.js +80 -34
  190. package/dist/components/siyahi/waterfall-chart.d.ts +51 -0
  191. package/dist/components/siyahi/waterfall-chart.js +147 -0
  192. package/dist/components/ui/accordion.js +5 -5
  193. package/dist/components/ui/alert.js +2 -2
  194. package/dist/components/ui/badge.js +1 -1
  195. package/dist/components/ui/breadcrumb.js +2 -2
  196. package/dist/components/ui/button.js +10 -10
  197. package/dist/components/ui/calendar.js +1 -1
  198. package/dist/components/ui/card.js +4 -4
  199. package/dist/components/ui/chart.js +1 -1
  200. package/dist/components/ui/code-block.js +13 -12
  201. package/dist/components/ui/command.js +7 -6
  202. package/dist/components/ui/context-menu.js +7 -7
  203. package/dist/components/ui/dialog.js +5 -5
  204. package/dist/components/ui/dropdown-menu.js +8 -8
  205. package/dist/components/ui/field.d.ts +26 -0
  206. package/dist/components/ui/field.js +109 -0
  207. package/dist/components/ui/input-group.js +11 -11
  208. package/dist/components/ui/input.js +1 -1
  209. package/dist/components/ui/label.d.ts +5 -0
  210. package/dist/components/ui/label.js +13 -0
  211. package/dist/components/ui/popover.js +3 -3
  212. package/dist/components/ui/progress.js +1 -1
  213. package/dist/components/ui/select.js +6 -6
  214. package/dist/components/ui/sheet.js +5 -5
  215. package/dist/components/ui/sidebar.js +17 -18
  216. package/dist/components/ui/skeleton.js +1 -1
  217. package/dist/components/ui/slider.js +2 -2
  218. package/dist/components/ui/table.js +2 -2
  219. package/dist/components/ui/tabs.js +2 -2
  220. package/dist/components/ui/textarea.js +1 -1
  221. package/dist/components/ui/toggle-group.js +2 -2
  222. package/dist/components/ui/toggle.js +4 -4
  223. package/dist/components/ui/tooltip.js +2 -2
  224. package/dist/index.d.ts +35 -8
  225. package/dist/index.js +30 -4
  226. package/dist/lib/chart-frame.d.ts +51 -7
  227. package/dist/lib/chart-frame.js +390 -133
  228. package/dist/lib/chart-marks.d.ts +83 -0
  229. package/dist/lib/chart-marks.js +216 -0
  230. package/dist/lib/chart-series.d.ts +42 -10
  231. package/dist/lib/compact-columns.d.ts +19 -0
  232. package/dist/lib/compact-columns.js +55 -0
  233. package/dist/lib/fit-text.d.ts +6 -0
  234. package/dist/lib/fit-text.js +11 -0
  235. package/dist/lib/format.d.ts +8 -3
  236. package/dist/lib/format.js +55 -17
  237. package/dist/lib/heat.d.ts +7 -0
  238. package/dist/lib/heat.js +14 -0
  239. package/dist/lib/heatmap-navigation.d.ts +8 -0
  240. package/dist/lib/heatmap-navigation.js +49 -0
  241. package/dist/lib/scatter.d.ts +88 -0
  242. package/dist/lib/scatter.js +179 -0
  243. package/dist/lib/ticks.d.ts +27 -0
  244. package/dist/lib/ticks.js +67 -0
  245. package/dist/lib/tone.d.ts +36 -0
  246. package/dist/lib/tone.js +35 -0
  247. package/dist/lib/treemap.d.ts +0 -5
  248. package/dist/lib/treemap.js +1 -11
  249. package/dist/lib/use-element-width.d.ts +5 -0
  250. package/dist/lib/use-element-width.js +15 -0
  251. package/package.json +5 -1
  252. package/registry.lock.json +16 -0
  253. package/report.css +63 -47
  254. package/styles/siyahi.css +708 -55
@@ -2,8 +2,8 @@
2
2
  import { Badge } from "../../../ui/badge.js";
3
3
  import { Button } from "../../../ui/button.js";
4
4
  import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator } from "../../../ui/command.js";
5
- import { Popover, PopoverContent, PopoverTrigger } from "../../../ui/popover.js";
6
5
  import { Separator } from "../../../ui/separator.js";
6
+ import { Popover, PopoverContent, PopoverTrigger } from "../../../ui/popover.js";
7
7
  import { cn } from "../../../../lib/utils.js";
8
8
  import { FILTER_OPERATORS, FILTER_VARIANTS, JOIN_OPERATORS } from "../lib/constants.js";
9
9
  import { Check, PlusCircle, XCircle } from "lucide-react";
@@ -149,7 +149,7 @@ function TableFacetedFilter({ column, title, options = [], multiple, onValueChan
149
149
  ] })
150
150
  ]
151
151
  }) }), /* @__PURE__ */ jsx(PopoverContent, {
152
- className: "w-52 p-0",
152
+ className: "w-max min-w-52 max-w-(--available-width) p-0",
153
153
  align: "start",
154
154
  children: /* @__PURE__ */ jsx(TableFacetedFilterContent, {
155
155
  title,
@@ -177,16 +177,16 @@ function TableFacetedFilterContent({ title, options, selectedValues, onItemSelec
177
177
  onSelect: () => onItemSelect(option, isSelected),
178
178
  children: [
179
179
  /* @__PURE__ */ jsx("div", {
180
- className: cn("mr-2 flex size-4 items-center justify-center rounded-sm border border-primary", isSelected ? "bg-primary text-primary-foreground" : "opacity-50 [&_svg]:invisible"),
180
+ className: cn("mr-2 flex size-4 shrink-0 items-center justify-center rounded-sm border border-primary", isSelected ? "bg-primary text-primary-foreground" : "opacity-50 [&_svg]:invisible"),
181
181
  children: /* @__PURE__ */ jsx(Check, { className: "size-4" })
182
182
  }),
183
183
  option.icon && /* @__PURE__ */ jsx(option.icon, { className: "mr-2 size-4" }),
184
184
  /* @__PURE__ */ jsx("span", {
185
- className: "truncate",
185
+ className: "min-w-0 flex-1 whitespace-normal wrap-anywhere",
186
186
  children: option.label
187
187
  }),
188
188
  option.count !== void 0 && /* @__PURE__ */ jsx("span", {
189
- className: "ml-auto font-mono text-xs",
189
+ className: "ml-auto shrink-0 font-mono text-xs",
190
190
  children: option.count
191
191
  })
192
192
  ]
@@ -62,7 +62,7 @@ function TableSearchFilter({ table, className, placeholder = "Search...", label
62
62
  ]);
63
63
  const hasValue = currentValue.length > 0;
64
64
  return /* @__PURE__ */ jsxs("div", {
65
- className: cn("relative flex flex-1 items-center", className),
65
+ className: cn("relative flex min-w-0 max-w-full flex-1 items-center", className),
66
66
  role: "search",
67
67
  children: [
68
68
  /* @__PURE__ */ jsx(Search, {
@@ -26,7 +26,7 @@ import { ColumnSizingState, RowData } from "@tanstack/react-table";
26
26
  * Returns the set of column ids to render widthless (empty when fill is off or
27
27
  * no eligible column exists — the table then sizes to its columns as before).
28
28
  */
29
- export declare function resolveFlexColumnIds<TData extends RowData>(table: DataTableInstance<TData>): ReadonlySet<string>;
29
+ export declare function resolveFlexColumnIds<TData extends RowData>(table: DataTableInstance<TData>, pinningEnabled?: boolean): ReadonlySet<string>;
30
30
  /**
31
31
  * The width to render for a single column. Centralizes the flex + header-fit
32
32
  * rules so the header, body cells, and the min-width lock all agree.
@@ -24,19 +24,19 @@
24
24
  * Returns the set of column ids to render widthless (empty when fill is off or
25
25
  * no eligible column exists — the table then sizes to its columns as before).
26
26
  */
27
- function resolveFlexColumnIds(table) {
27
+ function resolveFlexColumnIds(table, pinningEnabled = true) {
28
28
  const ids = /* @__PURE__ */ new Set();
29
29
  if (!table.options.enableColumnResizing) return ids;
30
30
  if (table.options.meta?.disableFlexFill) return ids;
31
31
  const leafColumns = table.getVisibleLeafColumns();
32
32
  const columnSizing = table.state.columnSizing;
33
33
  let hasExplicit = false;
34
- for (const column of leafColumns) if (column.columnDef.meta?.flex === true && !column.getIsPinned() && columnSizing[column.id] == null) {
34
+ for (const column of leafColumns) if (column.columnDef.meta?.flex === true && !(pinningEnabled && column.getIsPinned()) && columnSizing[column.id] == null) {
35
35
  ids.add(column.id);
36
36
  hasExplicit = true;
37
37
  }
38
38
  if (hasExplicit) return ids;
39
- const auto = leafColumns.find((column) => column.getCanResize() && !column.getIsPinned() && column.columnDef.meta?.flex !== false && columnSizing[column.id] == null);
39
+ const auto = leafColumns.find((column) => column.getCanResize() && !(pinningEnabled && column.getIsPinned()) && column.columnDef.meta?.flex !== false && columnSizing[column.id] == null);
40
40
  if (auto) ids.add(auto.id);
41
41
  return ids;
42
42
  }
@@ -2,5 +2,5 @@ import { DataTableFeatures } from "./data-table-features.js";
2
2
  import React from "react";
3
3
  import { Column, RowData } from "@tanstack/react-table";
4
4
  //#region src/components/registry/niko-table/lib/styles.d.ts
5
- export declare const getCommonPinningStyles: <TData extends RowData>(column: Column<DataTableFeatures, TData>, isHeader?: boolean) => React.CSSProperties;
5
+ export declare const getCommonPinningStyles: <TData extends RowData>(column: Column<DataTableFeatures, TData>, isHeader?: boolean, pinningEnabled?: boolean) => React.CSSProperties;
6
6
  //#endregion
@@ -1,8 +1,8 @@
1
1
  import "@tanstack/react-table";
2
2
  //#region src/components/registry/niko-table/lib/styles.ts
3
- const getCommonPinningStyles = (column, isHeader = false) => {
3
+ const getCommonPinningStyles = (column, isHeader = false, pinningEnabled = true) => {
4
4
  const isPinned = column.getIsPinned();
5
- if (!isPinned) return {};
5
+ if (!isPinned || !pinningEnabled) return {};
6
6
  const isLeft = isPinned === "start";
7
7
  const columnSize = column.getSize();
8
8
  return {
@@ -17,7 +17,7 @@ const getCommonPinningStyles = (column, isHeader = false) => {
17
17
  flexShrink: 0,
18
18
  zIndex: isHeader ? 20 : 10,
19
19
  backgroundColor: "var(--card)",
20
- ...isLeft ? { boxShadow: "inset -2px 0 0 0 color-mix(in oklab, var(--foreground) 40%, transparent), 4px 0 8px -2px color-mix(in oklab, var(--foreground) 14%, transparent)" } : { boxShadow: "inset 2px 0 0 0 color-mix(in oklab, var(--foreground) 40%, transparent), -4px 0 8px -2px color-mix(in oklab, var(--foreground) 14%, transparent)" }
20
+ boxShadow: isLeft ? "inset -1px 0 0 0 var(--border)" : "inset 1px 0 0 0 var(--border)"
21
21
  };
22
22
  };
23
23
  //#endregion
@@ -23,6 +23,15 @@ declare module "@tanstack/react-table" {
23
23
  * `TableMeta.disableFlexFill`.
24
24
  */
25
25
  flex?: boolean;
26
+ /**
27
+ * Never hide this column to fit. Once any column sets it, a table whose
28
+ * columns do not fit its width hides the others, rightmost first, until
29
+ * they do, and `<DataTableCompactColumnsToggle />` shows them all again.
30
+ * Mark the few a reader needs to answer the table's question: the name and
31
+ * its result. Read `useDataTable().compactColumns?.hidden` in a cell to
32
+ * fold a hidden figure under a kept one.
33
+ */
34
+ compact?: boolean;
26
35
  variant?: FilterVariant;
27
36
  options?: Option[];
28
37
  range?: [number, number];
@@ -52,14 +52,14 @@ function TableRow({ className, ...props }) {
52
52
  function TableHead({ className, ...props }) {
53
53
  return /* @__PURE__ */ jsx("th", {
54
54
  "data-slot": "table-head",
55
- className: cn("h-12 px-3 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0 *:[[role=checkbox]]:translate-y-[2px]", className),
55
+ className: cn("h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0 *:[[role=checkbox]]:translate-y-[2px]", className),
56
56
  ...props
57
57
  });
58
58
  }
59
59
  function TableCell({ className, ...props }) {
60
60
  return /* @__PURE__ */ jsx("td", {
61
61
  "data-slot": "table-cell",
62
- className: cn("p-3 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 *:[[role=checkbox]]:translate-y-[2px]", className),
62
+ className: cn("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 *:[[role=checkbox]]:translate-y-[2px]", className),
63
63
  ...props
64
64
  });
65
65
  }
@@ -14,5 +14,5 @@ export interface AppSidebarProps extends React$1.ComponentProps<typeof Sidebar>
14
14
  projects?: React$1.ComponentProps<typeof NavProjects>["projects"];
15
15
  user?: React$1.ComponentProps<typeof NavUser>["user"];
16
16
  }
17
- export declare function AppSidebar({ navMain, navLabel, header, teams, projects, user, collapsible, ...props }: AppSidebarProps): React$1.JSX.Element;
17
+ export declare function AppSidebar({ navMain, navLabel, header, teams, projects, user, collapsible, className, ...props }: AppSidebarProps): React$1.JSX.Element;
18
18
  //#endregion
@@ -1,5 +1,6 @@
1
1
  "use client";
2
2
  import { Sidebar, SidebarContent, SidebarFooter, SidebarHeader, SidebarRail } from "../../ui/sidebar.js";
3
+ import { cn } from "../../../lib/utils.js";
3
4
  import { NavMain } from "./nav-main.js";
4
5
  import { NavProjects } from "./nav-projects.js";
5
6
  import { NavUser } from "./nav-user.js";
@@ -7,9 +8,10 @@ import { TeamSwitcher } from "./team-switcher.js";
7
8
  import { jsx, jsxs } from "react/jsx-runtime";
8
9
  import "react";
9
10
  //#region src/components/registry/sidebar-07/app-sidebar.tsx
10
- function AppSidebar({ navMain, navLabel, header, teams, projects, user, collapsible = "icon", ...props }) {
11
+ function AppSidebar({ navMain, navLabel, header, teams, projects, user, collapsible = "icon", className, ...props }) {
11
12
  return /* @__PURE__ */ jsxs(Sidebar, {
12
13
  collapsible,
14
+ className: cn(collapsible !== "none" && "h-auto", className),
13
15
  ...props,
14
16
  children: [
15
17
  (header || teams) && /* @__PURE__ */ jsx(SidebarHeader, { children: header ?? (teams && /* @__PURE__ */ jsx(TeamSwitcher, { teams })) }),
@@ -4,12 +4,13 @@ export declare function NavMain({ items, label }: {
4
4
  items: {
5
5
  title: string;
6
6
  url: string;
7
- icon?: React.ReactNode;
7
+ icon: React.ReactNode;
8
8
  isActive?: boolean;
9
9
  linkProps?: Omit<React.ComponentProps<"a">, "href">;
10
10
  items?: {
11
11
  title: string;
12
12
  url: string;
13
+ isActive?: boolean;
13
14
  }[];
14
15
  }[];
15
16
  }): import("react").JSX.Element;
@@ -2,9 +2,11 @@ import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "../../ui/co
2
2
  import { SidebarGroup, SidebarGroupLabel, SidebarMenu, SidebarMenuButton, SidebarMenuItem, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, useSidebar } from "../../ui/sidebar.js";
3
3
  import { ChevronRightIcon } from "lucide-react";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
5
+ import { useState } from "react";
5
6
  //#region src/components/registry/sidebar-07/nav-main.tsx
6
7
  function NavMain({ items, label = "Navigation" }) {
7
8
  const { isMobile, setOpenMobile } = useSidebar();
9
+ const [expanded, setExpanded] = useState({});
8
10
  const closeDrawer = () => {
9
11
  if (isMobile) setOpenMobile(false);
10
12
  };
@@ -19,18 +21,29 @@ function NavMain({ items, label = "Navigation" }) {
19
21
  onClick: closeDrawer,
20
22
  children: [item.icon, /* @__PURE__ */ jsx("span", { children: item.title })]
21
23
  }) }, item.title) : /* @__PURE__ */ jsxs(Collapsible, {
22
- defaultOpen: item.isActive,
24
+ open: expanded[item.title] ?? !!item.isActive,
25
+ onOpenChange: (open) => setExpanded((previous) => ({
26
+ ...previous,
27
+ [item.title]: open
28
+ })),
23
29
  className: "group/collapsible",
24
30
  render: /* @__PURE__ */ jsx(SidebarMenuItem, {}),
25
31
  children: [/* @__PURE__ */ jsxs(CollapsibleTrigger, {
26
- render: /* @__PURE__ */ jsx(SidebarMenuButton, { tooltip: item.title }),
32
+ render: /* @__PURE__ */ jsx(SidebarMenuButton, {
33
+ tooltip: item.title,
34
+ isActive: item.isActive && !item.items?.some((subItem) => subItem.isActive)
35
+ }),
27
36
  children: [
28
37
  item.icon,
29
38
  /* @__PURE__ */ jsx("span", { children: item.title }),
30
39
  /* @__PURE__ */ jsx(ChevronRightIcon, { className: "ml-auto transition-transform duration-200 group-data-open/collapsible:rotate-90" })
31
40
  ]
32
41
  }), /* @__PURE__ */ jsx(CollapsibleContent, { children: /* @__PURE__ */ jsx(SidebarMenuSub, { children: item.items?.map((subItem) => /* @__PURE__ */ jsx(SidebarMenuSubItem, { children: /* @__PURE__ */ jsx(SidebarMenuSubButton, {
33
- render: /* @__PURE__ */ jsx("a", { href: subItem.url }),
42
+ isActive: subItem.isActive,
43
+ render: /* @__PURE__ */ jsx("a", {
44
+ href: subItem.url,
45
+ "aria-current": subItem.isActive ? "page" : void 0
46
+ }),
34
47
  onClick: closeDrawer,
35
48
  children: /* @__PURE__ */ jsx("span", { children: subItem.title })
36
49
  }) }, subItem.title)) }) })]
@@ -0,0 +1,17 @@
1
+ import { Tone } from "../../lib/tone.js";
2
+ import { ComponentProps, ReactNode } from "react";
3
+ //#region src/components/siyahi/callout.d.ts
4
+ export interface CalloutProps extends Omit<ComponentProps<"aside">, "title"> {
5
+ /** neutral for an aside, accent for a key point, warning for a caution, positive or negative for a gain or a loss. */
6
+ tone?: Tone;
7
+ /** A lucide icon, drawn in the tone's colour. */
8
+ icon?: ReactNode;
9
+ title?: ReactNode;
10
+ }
11
+ /**
12
+ * A point set apart from the prose: a takeaway, a caveat, a definition. The whole box takes the tone, a faint wash
13
+ * inside a border of the same colour; never a single coloured edge. For a notice that interrupts, use StatusAlert
14
+ * instead.
15
+ */
16
+ export declare function Callout({ tone, icon, title, className, children, ...props }: CalloutProps): import("react").JSX.Element;
17
+ //#endregion
@@ -0,0 +1,34 @@
1
+ import { TONES } from "../../lib/tone.js";
2
+ import { cn } from "cn";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
4
+ //#region src/components/siyahi/callout.tsx
5
+ /**
6
+ * A point set apart from the prose: a takeaway, a caveat, a definition. The whole box takes the tone, a faint wash
7
+ * inside a border of the same colour; never a single coloured edge. For a notice that interrupts, use StatusAlert
8
+ * instead.
9
+ */
10
+ function Callout({ tone = "neutral", icon, title, className, children, ...props }) {
11
+ return /* @__PURE__ */ jsxs("aside", {
12
+ "data-slot": "callout",
13
+ "data-tone": tone,
14
+ className: cn("flex gap-3 rounded-lg border px-4 py-3 text-sm", TONES[tone].box, className),
15
+ ...props,
16
+ children: [icon && /* @__PURE__ */ jsx("span", {
17
+ "data-slot": "callout-icon",
18
+ "aria-hidden": true,
19
+ className: cn("mt-0.5 shrink-0 [&>svg]:size-4", TONES[tone].ink),
20
+ children: icon
21
+ }), /* @__PURE__ */ jsxs("div", {
22
+ className: "flex min-w-0 flex-col gap-1",
23
+ children: [title && /* @__PURE__ */ jsx("p", {
24
+ className: "font-medium",
25
+ children: title
26
+ }), /* @__PURE__ */ jsx("div", {
27
+ className: "text-pretty text-muted-foreground [&_strong]:text-foreground",
28
+ children
29
+ })]
30
+ })]
31
+ });
32
+ }
33
+ //#endregion
34
+ export { Callout };
@@ -0,0 +1,21 @@
1
+ import { DeltaProps } from "./delta.js";
2
+ //#region src/components/siyahi/change-bar.d.ts
3
+ export interface ChangeBarProps {
4
+ /** The signed change, as Delta takes it. */
5
+ value: number;
6
+ /** The column's largest change by size: Math.max(...rows.map((row) => Math.abs(row.change))). */
7
+ max: number;
8
+ /**
9
+ * Draws the bar from a centre line, losses leftward and gains rightward. Pass it when the column holds both signs:
10
+ * rows.some((row) => row.change < 0) && rows.some((row) => row.change > 0).
11
+ */
12
+ diverging?: boolean;
13
+ format?: DeltaProps["format"];
14
+ className?: string;
15
+ }
16
+ /**
17
+ * A table cell's change as a Delta over a 3px bar whose length is the change's size against the column's largest, so
18
+ * the rows rank by eye. The bar is neutral because it shows size; the Delta above it carries the gain or loss colour.
19
+ */
20
+ export declare function ChangeBar({ value, max, diverging, format, className }: ChangeBarProps): import("react").JSX.Element;
21
+ //#endregion
@@ -0,0 +1,35 @@
1
+ import { Delta } from "./delta.js";
2
+ import { cn } from "cn";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
4
+ //#region src/components/siyahi/change-bar.tsx
5
+ /**
6
+ * A table cell's change as a Delta over a 3px bar whose length is the change's size against the column's largest, so
7
+ * the rows rank by eye. The bar is neutral because it shows size; the Delta above it carries the gain or loss colour.
8
+ */
9
+ function ChangeBar({ value, max, diverging = false, format, className }) {
10
+ const share = max > 0 ? Math.min(1, Math.abs(value) / max) : 0;
11
+ const half = diverging ? 50 : 100;
12
+ const side = diverging && value < 0 ? "right" : "left";
13
+ return /* @__PURE__ */ jsxs("div", {
14
+ "data-slot": "change-bar",
15
+ className: cn("flex w-full flex-col items-end gap-1.5", className),
16
+ children: [/* @__PURE__ */ jsx(Delta, {
17
+ value,
18
+ format,
19
+ className: "font-medium"
20
+ }), /* @__PURE__ */ jsxs("div", {
21
+ "aria-hidden": "true",
22
+ className: "relative h-0.75 w-full bg-muted",
23
+ children: [/* @__PURE__ */ jsx("div", {
24
+ "data-slot": "change-bar-fill",
25
+ className: "absolute inset-y-0 bg-foreground",
26
+ style: {
27
+ [side]: diverging ? "50%" : 0,
28
+ width: `${share * half}%`
29
+ }
30
+ }), diverging && /* @__PURE__ */ jsx("div", { className: "absolute -inset-y-1 left-1/2 w-px -translate-x-1/2 bg-muted-foreground" })]
31
+ })]
32
+ });
33
+ }
34
+ //#endregion
35
+ export { ChangeBar };
@@ -0,0 +1,31 @@
1
+ //#region src/components/siyahi/change-grid.d.ts
2
+ export interface ChangeGridRow {
3
+ label: string;
4
+ /** One figure per column, in column order; null where there is none, such as a month still to come. NaN counts as none. */
5
+ values: readonly (number | null)[];
6
+ /** The row's total as the page works it out: monthly returns compound rather than add. Leave it out for no total. */
7
+ total?: number | null;
8
+ /** Unique key when labels repeat. Defaults to `label`. */
9
+ key?: string;
10
+ }
11
+ export interface ChangeGridProps {
12
+ /** The column heads, such as the months of a financial year. */
13
+ columns: readonly string[];
14
+ rows: readonly ChangeGridRow[];
15
+ /** "pct" takes fractions, 0.025 for 2.5%; "money" takes amounts, written short in one unit. */
16
+ format?: "pct" | "money";
17
+ /** The change that takes the deepest tint, as a size. Defaults to the grid's largest, totals aside. */
18
+ range?: number;
19
+ /** Heads the total column, which draws when any row has a total. */
20
+ totalLabel?: string;
21
+ /** Names the table for a screen reader, such as "Monthly sales growth by year". */
22
+ label: string;
23
+ className?: string;
24
+ }
25
+ /**
26
+ * Signed changes laid out rows by columns, such as each month of each year, every cell tinted by its sign and size
27
+ * as a Treemap tile is and written with its sign, with an optional total per row. The figure is always written, so
28
+ * the tint only helps the eye find the large months.
29
+ */
30
+ export declare function ChangeGrid({ columns, rows, format, range, totalLabel, label, className }: ChangeGridProps): import("react").JSX.Element;
31
+ //#endregion
@@ -0,0 +1,74 @@
1
+ import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "../ui/table.js";
2
+ import { useFormat } from "../../lib/format.js";
3
+ import { heat } from "../../lib/heat.js";
4
+ import { cn } from "cn";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ //#region src/components/siyahi/change-grid.tsx
7
+ const MINUS = "−";
8
+ /** A figure the grid can draw: anything that is not a finite number, NaN included, is no figure at all. */
9
+ const known = (value) => value != null && Number.isFinite(value) ? value : null;
10
+ /**
11
+ * Signed changes laid out rows by columns, such as each month of each year, every cell tinted by its sign and size
12
+ * as a Treemap tile is and written with its sign, with an optional total per row. The figure is always written, so
13
+ * the tint only helps the eye find the large months.
14
+ */
15
+ function ChangeGrid({ columns, rows, format = "pct", range, totalLabel = "Total", label, className }) {
16
+ const f = useFormat();
17
+ const sizes = rows.flatMap(({ values }) => values.flatMap((value) => known(value) ?? []).map(Math.abs));
18
+ const deepest = known(range) ?? Math.max(0, ...sizes);
19
+ const write = (value) => {
20
+ if (value === null) return "—";
21
+ const size = format === "money" ? f.moneyCompact(Math.abs(value), deepest) : f.pct(Math.abs(value));
22
+ return `${value > 0 ? "+" : value < 0 ? MINUS : ""}${size}`;
23
+ };
24
+ const totals = rows.some((row) => row.total !== void 0);
25
+ return /* @__PURE__ */ jsxs(Table, {
26
+ "aria-label": label,
27
+ "data-slot": "change-grid",
28
+ className: cn("border-separate border-spacing-0.5", className),
29
+ children: [/* @__PURE__ */ jsx(TableHeader, { children: /* @__PURE__ */ jsxs(TableRow, {
30
+ className: "hover:bg-transparent",
31
+ children: [
32
+ /* @__PURE__ */ jsx(TableHead, {
33
+ className: "sticky left-0 bg-card",
34
+ children: /* @__PURE__ */ jsx("span", {
35
+ className: "sr-only",
36
+ children: "Row"
37
+ })
38
+ }),
39
+ columns.map((column) => /* @__PURE__ */ jsx(TableHead, {
40
+ className: "text-right",
41
+ children: column
42
+ }, column)),
43
+ totals && /* @__PURE__ */ jsx(TableHead, {
44
+ className: "text-right",
45
+ children: totalLabel
46
+ })
47
+ ]
48
+ }) }), /* @__PURE__ */ jsx(TableBody, { children: rows.map((row) => /* @__PURE__ */ jsxs(TableRow, {
49
+ className: "border-0 hover:bg-transparent",
50
+ children: [
51
+ /* @__PURE__ */ jsx(TableHead, {
52
+ scope: "row",
53
+ className: "sticky left-0 bg-card font-medium",
54
+ children: row.label
55
+ }),
56
+ columns.map((column, index) => {
57
+ const value = known(row.values[index]);
58
+ return /* @__PURE__ */ jsx(TableCell, {
59
+ "data-slot": "change-grid-cell",
60
+ className: cn("rounded-sm text-right font-mono tabular-nums", value === null && "text-muted-foreground"),
61
+ style: { backgroundColor: heat(value, deepest) },
62
+ children: write(value)
63
+ }, column);
64
+ }),
65
+ totals && /* @__PURE__ */ jsx(TableCell, {
66
+ className: "text-right font-mono font-medium tabular-nums",
67
+ children: write(known(row.total))
68
+ })
69
+ ]
70
+ }, row.key ?? row.label)) })]
71
+ });
72
+ }
73
+ //#endregion
74
+ export { ChangeGrid };
@@ -0,0 +1,19 @@
1
+ import { ReactNode } from "react";
2
+ //#region src/components/siyahi/data-bar.d.ts
3
+ export interface DataBarProps {
4
+ value: number;
5
+ /** The value a full bar stands for, usually the column's largest: Math.max(...rows.map((row) => row.value)). */
6
+ max: number;
7
+ /** "sign" draws a gain in --positive and a loss in --negative; by default every bar is --chart-1. */
8
+ tone?: "chart" | "sign";
9
+ /** The figure, as the page formats it. */
10
+ children: ReactNode;
11
+ className?: string;
12
+ }
13
+ /**
14
+ * A table cell's figure behind a short bar whose length is the figure's share of max, so a column reads as a chart.
15
+ * The bar has a fixed width, so every row draws to the same scale, and sits on the figure's line, so the row
16
+ * keeps its height.
17
+ */
18
+ export declare function DataBar({ value, max, tone, children, className }: DataBarProps): import("react").JSX.Element;
19
+ //#endregion
@@ -0,0 +1,29 @@
1
+ import { cn } from "cn";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ //#region src/components/siyahi/data-bar.tsx
4
+ /**
5
+ * A table cell's figure behind a short bar whose length is the figure's share of max, so a column reads as a chart.
6
+ * The bar has a fixed width, so every row draws to the same scale, and sits on the figure's line, so the row
7
+ * keeps its height.
8
+ */
9
+ function DataBar({ value, max, tone = "chart", children, className }) {
10
+ const share = max > 0 ? Math.min(1, Math.abs(value) / max) : 0;
11
+ const fill = tone === "chart" ? "bg-chart-1" : value < 0 ? "bg-negative" : "bg-positive";
12
+ return /* @__PURE__ */ jsxs("div", {
13
+ "data-slot": "data-bar",
14
+ className: cn("flex items-center gap-2", className),
15
+ children: [/* @__PURE__ */ jsx("div", {
16
+ "aria-hidden": "true",
17
+ className: "h-1.5 w-16 shrink-0 overflow-hidden bg-muted",
18
+ children: /* @__PURE__ */ jsx("div", {
19
+ className: cn("h-full", fill),
20
+ style: { width: `${share * 100}%` }
21
+ })
22
+ }), /* @__PURE__ */ jsx("span", {
23
+ className: "tabular-nums",
24
+ children
25
+ })]
26
+ });
27
+ }
28
+ //#endregion
29
+ export { DataBar };
@@ -0,0 +1,4 @@
1
+ //#region src/components/siyahi/data-table-compact-columns-toggle.d.ts
2
+ /** Renders only while some columns are hidden to fit, or the reader has shown them all. */
3
+ export declare function DataTableCompactColumnsToggle(): import("react").JSX.Element | null;
4
+ //#endregion
@@ -0,0 +1,19 @@
1
+ import { Button } from "../ui/button.js";
2
+ import { useDataTable } from "../registry/niko-table/core/data-table-context.js";
3
+ import { jsx } from "react/jsx-runtime";
4
+ //#region src/components/siyahi/data-table-compact-columns-toggle.tsx
5
+ /** Renders only while some columns are hidden to fit, or the reader has shown them all. */
6
+ function DataTableCompactColumnsToggle() {
7
+ const { compactColumns } = useDataTable();
8
+ if (!compactColumns) return null;
9
+ const { collapsed, setCollapsed } = compactColumns;
10
+ return /* @__PURE__ */ jsx(Button, {
11
+ variant: "outline",
12
+ size: "sm",
13
+ "aria-pressed": !collapsed,
14
+ onClick: () => setCollapsed(!collapsed),
15
+ children: collapsed ? `All columns (+${compactColumns.hidden.size})` : "Key columns"
16
+ });
17
+ }
18
+ //#endregion
19
+ export { DataTableCompactColumnsToggle };
@@ -0,0 +1,12 @@
1
+ import { ReactNode } from "react";
2
+ //#region src/components/siyahi/data-table-footnote.d.ts
3
+ export interface DataTableFootnoteProps {
4
+ /** One sentence on how to read the table, such as what each bar measures. */
5
+ children: ReactNode;
6
+ }
7
+ /**
8
+ * A full-width last row, inside `DataTable` after its body, that explains the table's encoding. On a table wider than
9
+ * its card the note stays put at the card's width while the columns scroll under it.
10
+ */
11
+ export declare function DataTableFootnote({ children }: DataTableFootnoteProps): import("react").JSX.Element;
12
+ //#endregion
@@ -0,0 +1,35 @@
1
+ import { useDataTable } from "../registry/niko-table/core/data-table-context.js";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import { useEffect, useState } from "react";
4
+ //#region src/components/siyahi/data-table-footnote.tsx
5
+ /**
6
+ * A full-width last row, inside `DataTable` after its body, that explains the table's encoding. On a table wider than
7
+ * its card the note stays put at the card's width while the columns scroll under it.
8
+ */
9
+ function DataTableFootnote({ children }) {
10
+ const { table, scrollContainer } = useDataTable();
11
+ const [viewport, setViewport] = useState();
12
+ useEffect(() => {
13
+ if (!scrollContainer) return;
14
+ const observer = new ResizeObserver(() => setViewport(scrollContainer.clientWidth));
15
+ observer.observe(scrollContainer);
16
+ return () => observer.disconnect();
17
+ }, [scrollContainer]);
18
+ return /* @__PURE__ */ jsx("tfoot", {
19
+ "data-slot": "data-table-footnote",
20
+ children: /* @__PURE__ */ jsx("tr", {
21
+ className: "border-t",
22
+ children: /* @__PURE__ */ jsx("td", {
23
+ colSpan: table.getVisibleLeafColumns().length,
24
+ className: "p-0",
25
+ children: /* @__PURE__ */ jsx("p", {
26
+ className: "sticky left-0 px-2 py-3 text-sm whitespace-normal text-muted-foreground",
27
+ style: { maxWidth: viewport },
28
+ children
29
+ })
30
+ })
31
+ })
32
+ });
33
+ }
34
+ //#endregion
35
+ export { DataTableFootnote };
@@ -0,0 +1,8 @@
1
+ //#region src/components/siyahi/default-sidebar-open.d.ts
2
+ /**
3
+ * SidebarProvider's `defaultOpen` for an app shell: the reader's last choice, which the provider keeps in the
4
+ * `sidebar_state` cookie, else open — except on a short landscape screen, a phone held sideways, where an open
5
+ * sidebar leaves no room for the page. There it starts as the icon rail.
6
+ */
7
+ export declare function defaultSidebarOpen(): boolean;
8
+ //#endregion
@@ -0,0 +1,13 @@
1
+ //#region src/components/siyahi/default-sidebar-open.ts
2
+ /**
3
+ * SidebarProvider's `defaultOpen` for an app shell: the reader's last choice, which the provider keeps in the
4
+ * `sidebar_state` cookie, else open — except on a short landscape screen, a phone held sideways, where an open
5
+ * sidebar leaves no room for the page. There it starts as the icon rail.
6
+ */
7
+ function defaultSidebarOpen() {
8
+ const saved = document.cookie.split("; ").find((entry) => entry.startsWith("sidebar_state="))?.slice(14);
9
+ if (saved !== void 0) return saved === "true";
10
+ return !matchMedia("(orientation: landscape) and (max-height: 30rem)").matches;
11
+ }
12
+ //#endregion
13
+ export { defaultSidebarOpen };
@@ -5,6 +5,10 @@ export interface DeltaProps {
5
5
  format?: "pct" | "money";
6
6
  className?: string;
7
7
  }
8
- /** A signed figure: ▲ in --positive, ▼ in --negative, so colour is never the only cue. */
8
+ /**
9
+ * A signed change: the figure in the surrounding text colour with its sign, and a trend icon in --positive or
10
+ * --negative. The sign and the icon's shape carry the direction, so colour is never the only cue, and a column of
11
+ * changes reads as figures rather than a wall of red and green.
12
+ */
9
13
  export declare function Delta({ value, format, className }: DeltaProps): import("react").JSX.Element;
10
14
  //#endregion