@siyahi/ui 0.1.8-next.3 → 0.1.9-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +29 -17
- package/THIRD_PARTY_NOTICES.md +10 -10
- package/dist/components/registry/dashboard-01/section-cards.d.ts +7 -2
- package/dist/components/registry/dashboard-01/section-cards.js +31 -21
- package/dist/components/registry/niko-table/components/data-table-search-filter.d.ts +35 -0
- package/dist/components/registry/niko-table/components/data-table-search-filter.js +44 -0
- package/dist/components/registry/niko-table/filters/table-search-filter.d.ts +38 -0
- package/dist/components/registry/niko-table/filters/table-search-filter.js +103 -0
- package/dist/components/siyahi/data-list.d.ts +14 -0
- package/dist/components/siyahi/data-list.js +25 -0
- package/dist/components/siyahi/data-table-row-count.d.ts +11 -0
- package/dist/components/siyahi/data-table-row-count.js +18 -0
- package/dist/components/siyahi/data-table-sort-header.d.ts +15 -0
- package/dist/components/siyahi/data-table-sort-header.js +36 -0
- package/dist/components/siyahi/inline-code.d.ts +7 -0
- package/dist/components/siyahi/inline-code.js +11 -0
- package/dist/components/siyahi/page-section.d.ts +21 -0
- package/dist/components/siyahi/page-section.js +39 -0
- package/dist/components/siyahi/tone-progress.d.ts +15 -0
- package/dist/components/siyahi/tone-progress.js +18 -0
- package/dist/components/siyahi/treemap.d.ts +7 -0
- package/dist/components/siyahi/treemap.js +69 -2
- package/dist/components/ui/code-block.d.ts +28 -0
- package/dist/components/ui/code-block.js +122 -0
- package/dist/index.d.ts +14 -5
- package/dist/index.js +12 -3
- package/dist/lib/format.d.ts +3 -0
- package/dist/lib/format.js +6 -1
- package/dist/lib/treemap.d.ts +4 -0
- package/dist/lib/treemap.js +9 -4
- package/package.json +1 -1
- package/registry.lock.json +16 -0
package/README.md
CHANGED
|
@@ -75,8 +75,12 @@ Every merge to `main` also attaches both tarballs to a GitHub release
|
|
|
75
75
|
bar list, the `SectionCards` stat tile and the `sidebar-07` app shell.
|
|
76
76
|
- **Siyahi components**: `Delta` (a signed figure with ▲ ▼), `PriceChart`
|
|
77
77
|
(TradingView Lightweight Charts in theme colours), `Treemap` (holdings heat
|
|
78
|
-
map; hover or tap a tile for its figures)
|
|
79
|
-
|
|
78
|
+
map; hover or tap a tile for its figures) with `TreemapLegend` (its colour
|
|
79
|
+
scale), `LocalTime` (a time in the configured zone with the viewer's own clock
|
|
80
|
+
in a tooltip), `ToneProgress` (Progress in a meaning colour), the page parts
|
|
81
|
+
`PageSection`, `PageSubheading`, `DataList` and `InlineCode`, the data table
|
|
82
|
+
parts `DataTableSortHeader` (sorts on one click) and `DataTableRowCount`
|
|
83
|
+
("12 of 48"), and `SiyahiProvider`.
|
|
80
84
|
- **Cards and badges as installed**: every `Card`, stat tiles included, keeps
|
|
81
85
|
luma's `rounded-4xl`, `shadow-md` and faint ring. A category (a sector, a
|
|
82
86
|
broker, a unit's kind) is an outline `Badge`: categories stay neutral, and
|
|
@@ -84,7 +88,7 @@ Every merge to `main` also attaches both tarballs to a GitHub release
|
|
|
84
88
|
(header under 24rem, so any phone) a header action such as a toggle drops
|
|
85
89
|
under the title and description, left-aligned; a stat tile's badge stays
|
|
86
90
|
top right.
|
|
87
|
-
- **Formatters**: `money`, `moneyCompact`, `pct` and `time`, or `useFormat()`
|
|
91
|
+
- **Formatters**: `count`, `money`, `moneyCompact`, `pct` and `time`, or `useFormat()`
|
|
88
92
|
for the same bound to the provider's locale.
|
|
89
93
|
`useFormat().time(value, { withDate: true })` (or
|
|
90
94
|
`time(value, locale, { withDate: true })`) and `<LocalTime withDate>` write
|
|
@@ -94,20 +98,28 @@ Every merge to `main` also attaches both tarballs to a GitHub release
|
|
|
94
98
|
|
|
95
99
|
## Which component
|
|
96
100
|
|
|
97
|
-
| Need | Component
|
|
98
|
-
| ----------------------------------------------------------------------- |
|
|
99
|
-
| Values over time or another ordered axis (months, hours, price buckets) | `BarChartCard`, `AreaChartCard` or `LineChartCard`
|
|
100
|
-
| Counts or amounts per period, one series or several | `BarChartCard`; `stacked` when the series add up to a total
|
|
101
|
-
| A running level, such as a portfolio's value against money put in | `AreaChartCard`
|
|
102
|
-
| Series compared point by point, such as a return against an index | `LineChartCard`
|
|
103
|
-
| Ranked counts or amounts by category (a name, a bar and a figure) | `BarList`
|
|
104
|
-
| Headline figures with their change | `SectionCards`, with a `Delta` in each badge
|
|
105
|
-
| One instrument's price history | `PriceChart`
|
|
106
|
-
| Holdings sized by weight and coloured by change | `Treemap`
|
|
107
|
-
| Activity by day, by weekday and hour, or a status over time | `CalendarHeatmap`, `WeekdayHeatmap`, `StatusHeatmap`
|
|
108
|
-
| Rows to sort and filter | `DataTable`, inside a `Card`
|
|
109
|
-
| A
|
|
110
|
-
|
|
|
101
|
+
| Need | Component |
|
|
102
|
+
| ----------------------------------------------------------------------- | ------------------------------------------------------------------- |
|
|
103
|
+
| Values over time or another ordered axis (months, hours, price buckets) | `BarChartCard`, `AreaChartCard` or `LineChartCard` |
|
|
104
|
+
| Counts or amounts per period, one series or several | `BarChartCard`; `stacked` when the series add up to a total |
|
|
105
|
+
| A running level, such as a portfolio's value against money put in | `AreaChartCard` |
|
|
106
|
+
| Series compared point by point, such as a return against an index | `LineChartCard` |
|
|
107
|
+
| Ranked counts or amounts by category (a name, a bar and a figure) | `BarList` |
|
|
108
|
+
| Headline figures with their change | `SectionCards`, with a `Delta` in each badge |
|
|
109
|
+
| One instrument's price history | `PriceChart` |
|
|
110
|
+
| Holdings sized by weight and coloured by change | `Treemap` |
|
|
111
|
+
| Activity by day, by weekday and hour, or a status over time | `CalendarHeatmap`, `WeekdayHeatmap`, `StatusHeatmap` |
|
|
112
|
+
| Rows to sort and filter | `DataTable`, inside a `Card` |
|
|
113
|
+
| A column that sorts on one click; a search and an "n of m" count | `DataTableSortHeader`; `DataTableSearchFilter`, `DataTableRowCount` |
|
|
114
|
+
| Stat tiles that pick a scope for the page | `SectionCards` with `selected` and `onSelect` |
|
|
115
|
+
| A share or a part of a whole, coloured as a gain or a loss | `ToneProgress` |
|
|
116
|
+
| The colour scale under a `Treemap` | `TreemapLegend`, with the map's `range` |
|
|
117
|
+
| One part of a long page: rule, eyebrow, heading, lead, action | `PageSection`, with `PageSubheading` inside |
|
|
118
|
+
| Label and value pairs, such as a record's fields | `DataList` and `DataListItem` |
|
|
119
|
+
| A command or file to copy, wrapped or scrolling | `CodeBlock` with `CodeBlockCopyButton` |
|
|
120
|
+
| A command, file or identifier inside prose | `InlineCode` |
|
|
121
|
+
| A signed figure (a gain, a loss, a change) | `Delta` |
|
|
122
|
+
| A time, with the viewer's own clock on hover | `LocalTime` |
|
|
111
123
|
|
|
112
124
|
The three chart cards take the rows, the field the x axis reads and the series,
|
|
113
125
|
and own everything else: the card and its header action (a range or mode
|
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -8,16 +8,16 @@ file as copied; `packages/ui/registry.lock.json` lists them all and
|
|
|
8
8
|
|
|
9
9
|
## Copied into `@siyahi/ui`
|
|
10
10
|
|
|
11
|
-
| What | Where in the package | Origin
|
|
12
|
-
| ------------------------------------------------------------------------------------- | -------------------------------------------------------- |
|
|
13
|
-
| shadcn/ui core components (installed with `shadcn add`, never edited) | `src/components/ui/*`, `src/hooks/use-mobile.ts` | https://github.com/shadcn-ui/ui
|
|
14
|
-
| shadcn `tailwind.css` (variants and utilities the components use) | `styles/shadcn.css` | https://github.com/shadcn-ui/ui/tree/main/packages/shadcn
|
|
15
|
-
| shadcn block `sidebar-07` | `src/components/registry/sidebar-07/*` | https://ui.shadcn.com/r/styles/base-vega/sidebar-07.json
|
|
16
|
-
| shadcn block `dashboard-01`, `SectionCards` only | `src/components/registry/dashboard-01/section-cards.tsx` | https://ui.shadcn.com/r/styles/base-vega/dashboard-01.json
|
|
17
|
-
| Heatmaps: calendar, weekday by hour, status timeline | `src/components/registry/heatmap/*` | https://shadcn-heatmap.pages.dev/r/calendar-heatmap.json, https://shadcn-heatmap.pages.dev/r/weekday-heatmap.json, https://shadcn-heatmap.pages.dev/r/status-heatmap.json (source: https://github.com/rutopio/shadcn-heatmap)
|
|
18
|
-
| niko-table data table on TanStack Table | `src/components/registry/niko-table/*` | https://niko-table.com/r/data-table.json, https://niko-table.com/r/data-table-core.json, https://niko-table.com/r/data-table-ui.json, https://niko-table.com/r/data-table-faceted-filter.json, https://niko-table.com/r/data-table-column-sort.json (source: https://github.com/Semkoo/niko-table-registry) | MIT, Copyright (c) 2025 Semir N.; original work Copyright (c) 2025 WebDevSimplified |
|
|
19
|
-
| shadcn chart blocks `chart-bar-multiple`, `chart-area-stacked`, `chart-line-multiple` | `src/components/registry/charts/*` | https://ui.shadcn.com/r/styles/new-york-v4/chart-bar-multiple.json, https://ui.shadcn.com/r/styles/new-york-v4/chart-area-stacked.json, https://ui.shadcn.com/r/styles/new-york-v4/chart-line-multiple.json
|
|
20
|
-
| dashboardcn ranked list (`BarList`) | `src/components/registry/dashboardcn/bar-list.tsx` | https://dashboardcn.com/r/bar-list.json (source: https://github.com/NoahGdev/dashboardcn)
|
|
11
|
+
| What | Where in the package | Origin | Licence |
|
|
12
|
+
| ------------------------------------------------------------------------------------- | -------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
|
|
13
|
+
| shadcn/ui core components (installed with `shadcn add`, never edited) | `src/components/ui/*`, `src/hooks/use-mobile.ts` | https://github.com/shadcn-ui/ui | MIT, Copyright (c) 2023 shadcn |
|
|
14
|
+
| shadcn `tailwind.css` (variants and utilities the components use) | `styles/shadcn.css` | https://github.com/shadcn-ui/ui/tree/main/packages/shadcn | MIT, Copyright (c) 2023 shadcn |
|
|
15
|
+
| shadcn block `sidebar-07` | `src/components/registry/sidebar-07/*` | https://ui.shadcn.com/r/styles/base-vega/sidebar-07.json | MIT, Copyright (c) 2023 shadcn |
|
|
16
|
+
| shadcn block `dashboard-01`, `SectionCards` only | `src/components/registry/dashboard-01/section-cards.tsx` | https://ui.shadcn.com/r/styles/base-vega/dashboard-01.json | MIT, Copyright (c) 2023 shadcn |
|
|
17
|
+
| Heatmaps: calendar, weekday by hour, status timeline | `src/components/registry/heatmap/*` | https://shadcn-heatmap.pages.dev/r/calendar-heatmap.json, https://shadcn-heatmap.pages.dev/r/weekday-heatmap.json, https://shadcn-heatmap.pages.dev/r/status-heatmap.json (source: https://github.com/rutopio/shadcn-heatmap) | MIT, Copyright (c) 2026 ChingRu |
|
|
18
|
+
| niko-table data table on TanStack Table | `src/components/registry/niko-table/*` | https://niko-table.com/r/data-table.json, https://niko-table.com/r/data-table-core.json, https://niko-table.com/r/data-table-ui.json, https://niko-table.com/r/data-table-faceted-filter.json, https://niko-table.com/r/data-table-column-sort.json, https://niko-table.com/r/data-table-search-filter.json (source: https://github.com/Semkoo/niko-table-registry) | MIT, Copyright (c) 2025 Semir N.; original work Copyright (c) 2025 WebDevSimplified |
|
|
19
|
+
| shadcn chart blocks `chart-bar-multiple`, `chart-area-stacked`, `chart-line-multiple` | `src/components/registry/charts/*` | https://ui.shadcn.com/r/styles/new-york-v4/chart-bar-multiple.json, https://ui.shadcn.com/r/styles/new-york-v4/chart-area-stacked.json, https://ui.shadcn.com/r/styles/new-york-v4/chart-line-multiple.json | MIT, Copyright (c) 2023 shadcn |
|
|
20
|
+
| dashboardcn ranked list (`BarList`) | `src/components/registry/dashboardcn/bar-list.tsx` | https://dashboardcn.com/r/bar-list.json (source: https://github.com/NoahGdev/dashboardcn) | MIT, Copyright (c) 2026 dashboardcn contributors |
|
|
21
21
|
|
|
22
22
|
## Runtime dependencies with attribution terms
|
|
23
23
|
|
|
@@ -11,7 +11,12 @@ export interface SectionCard {
|
|
|
11
11
|
/** Muted second footer line. */
|
|
12
12
|
detail?: React$1.ReactNode;
|
|
13
13
|
}
|
|
14
|
-
export
|
|
14
|
+
export interface SectionCardsProps {
|
|
15
15
|
items: SectionCard[];
|
|
16
|
-
|
|
16
|
+
/** The label of the picked tile. */
|
|
17
|
+
selected?: string;
|
|
18
|
+
/** Makes each tile one button, so keep tile content non-interactive; gets the label of the tile picked. */
|
|
19
|
+
onSelect?: (label: string) => void;
|
|
20
|
+
}
|
|
21
|
+
export declare function SectionCards({ items, selected, onSelect }: SectionCardsProps): React$1.JSX.Element;
|
|
17
22
|
//#endregion
|
|
@@ -12,33 +12,43 @@ const COLUMNS = {
|
|
|
12
12
|
5: "@3xl/main:grid-cols-3 @7xl/main:grid-cols-5",
|
|
13
13
|
6: "@3xl/main:grid-cols-3"
|
|
14
14
|
};
|
|
15
|
-
function SectionCards({ items }) {
|
|
15
|
+
function SectionCards({ items, selected, onSelect }) {
|
|
16
16
|
return /* @__PURE__ */ jsx("div", {
|
|
17
17
|
className: "@container/main",
|
|
18
18
|
children: /* @__PURE__ */ jsx("div", {
|
|
19
19
|
className: cn("grid grid-cols-1 gap-4", COLUMNS[items.length] ?? COLUMNS[4]),
|
|
20
20
|
children: items.map((item) => /* @__PURE__ */ jsxs(Card, {
|
|
21
|
-
className: "@container/card",
|
|
22
|
-
children: [
|
|
23
|
-
/* @__PURE__ */ jsx(
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
className: cn("@container/card", onSelect && "relative", item.label === selected && "ring-2 ring-primary!"),
|
|
22
|
+
children: [
|
|
23
|
+
onSelect && /* @__PURE__ */ jsx("button", {
|
|
24
|
+
type: "button",
|
|
25
|
+
"aria-label": item.label,
|
|
26
|
+
"aria-pressed": item.label === selected,
|
|
27
|
+
onClick: () => onSelect(item.label),
|
|
28
|
+
className: "absolute inset-0 z-10 rounded-4xl outline-none focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset"
|
|
27
29
|
}),
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
30
|
+
/* @__PURE__ */ jsxs(CardHeader, { children: [
|
|
31
|
+
/* @__PURE__ */ jsx(CardDescription, { children: item.label }),
|
|
32
|
+
/* @__PURE__ */ jsx(CardTitle, {
|
|
33
|
+
className: "text-2xl font-semibold tabular-nums @[250px]/card:text-3xl",
|
|
34
|
+
children: item.value
|
|
35
|
+
}),
|
|
36
|
+
item.badge && /* @__PURE__ */ jsx(CardAction, { children: /* @__PURE__ */ jsx(Badge, {
|
|
37
|
+
variant: "outline",
|
|
38
|
+
children: item.badge
|
|
39
|
+
}) })
|
|
40
|
+
] }),
|
|
41
|
+
(item.headline || item.detail) && /* @__PURE__ */ jsxs(CardFooter, {
|
|
42
|
+
className: "flex-col items-start gap-1.5 text-sm",
|
|
43
|
+
children: [item.headline && /* @__PURE__ */ jsx("div", {
|
|
44
|
+
className: "line-clamp-1 flex gap-2 font-medium",
|
|
45
|
+
children: item.headline
|
|
46
|
+
}), item.detail && /* @__PURE__ */ jsx("div", {
|
|
47
|
+
className: "text-muted-foreground",
|
|
48
|
+
children: item.detail
|
|
49
|
+
})]
|
|
50
|
+
})
|
|
51
|
+
]
|
|
42
52
|
}, item.label))
|
|
43
53
|
})
|
|
44
54
|
});
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { TableSearchFilterProps } from "../filters/table-search-filter.js";
|
|
2
|
+
import { RowData } from "@tanstack/react-table";
|
|
3
|
+
//#region src/components/registry/niko-table/components/data-table-search-filter.d.ts
|
|
4
|
+
type DataTableSearchFilterProps<TData extends RowData> = Omit<TableSearchFilterProps<TData>, "table">;
|
|
5
|
+
/**
|
|
6
|
+
* A search filter component for DataTable.
|
|
7
|
+
* Can be used in controlled or uncontrolled mode.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* // Uncontrolled (manages its own state)
|
|
11
|
+
* <DataTableSearchFilter placeholder="Search products..." />
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* // Controlled (you manage the state)
|
|
15
|
+
* const [search, setSearch] = useState("")
|
|
16
|
+
* <DataTableSearchFilter
|
|
17
|
+
* value={search}
|
|
18
|
+
* onChange={setSearch}
|
|
19
|
+
* placeholder="Search..."
|
|
20
|
+
* />
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* // With nuqs for URL state
|
|
24
|
+
* const [search, setSearch] = useQueryState('search')
|
|
25
|
+
* <DataTableSearchFilter
|
|
26
|
+
* value={search ?? ""}
|
|
27
|
+
* onChange={setSearch}
|
|
28
|
+
* />
|
|
29
|
+
*/
|
|
30
|
+
export declare function DataTableSearchFilter<TData extends RowData>(props: DataTableSearchFilterProps<TData>): import("react").JSX.Element;
|
|
31
|
+
export declare namespace DataTableSearchFilter {
|
|
32
|
+
var displayName: string;
|
|
33
|
+
}
|
|
34
|
+
//#endregion
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useDataTable } from "../core/data-table-context.js";
|
|
3
|
+
import { TableSearchFilter } from "../filters/table-search-filter.js";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/registry/niko-table/components/data-table-search-filter.tsx
|
|
6
|
+
/**
|
|
7
|
+
* A search filter component for DataTable.
|
|
8
|
+
* Can be used in controlled or uncontrolled mode.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* // Uncontrolled (manages its own state)
|
|
12
|
+
* <DataTableSearchFilter placeholder="Search products..." />
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* // Controlled (you manage the state)
|
|
16
|
+
* const [search, setSearch] = useState("")
|
|
17
|
+
* <DataTableSearchFilter
|
|
18
|
+
* value={search}
|
|
19
|
+
* onChange={setSearch}
|
|
20
|
+
* placeholder="Search..."
|
|
21
|
+
* />
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* // With nuqs for URL state
|
|
25
|
+
* const [search, setSearch] = useQueryState('search')
|
|
26
|
+
* <DataTableSearchFilter
|
|
27
|
+
* value={search ?? ""}
|
|
28
|
+
* onChange={setSearch}
|
|
29
|
+
* />
|
|
30
|
+
*/
|
|
31
|
+
function DataTableSearchFilter(props) {
|
|
32
|
+
const { table } = useDataTable();
|
|
33
|
+
return /* @__PURE__ */ jsx(TableSearchFilter, {
|
|
34
|
+
table,
|
|
35
|
+
...props
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* @required displayName is required for auto feature detection
|
|
40
|
+
* @see "feature-detection.ts"
|
|
41
|
+
*/
|
|
42
|
+
DataTableSearchFilter.displayName = "DataTableSearchFilter";
|
|
43
|
+
//#endregion
|
|
44
|
+
export { DataTableSearchFilter };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { DataTableInstance } from "../types/index.js";
|
|
2
|
+
import * as React$1 from "react";
|
|
3
|
+
import { RowData } from "@tanstack/react-table";
|
|
4
|
+
//#region src/components/registry/niko-table/filters/table-search-filter.d.ts
|
|
5
|
+
export interface TableSearchFilterProps<TData extends RowData> {
|
|
6
|
+
table: DataTableInstance<TData>;
|
|
7
|
+
className?: string;
|
|
8
|
+
placeholder?: string;
|
|
9
|
+
/** The field's accessible name, such as "Filter holdings". */
|
|
10
|
+
label?: string;
|
|
11
|
+
showClearButton?: boolean;
|
|
12
|
+
onChange?: (value: string) => void;
|
|
13
|
+
value?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Debounce ms before pushing the typed value into table state. The
|
|
16
|
+
* input reflects keystrokes immediately; only the call to
|
|
17
|
+
* `table.setGlobalFilter` (and the supplied `onChange`) is delayed.
|
|
18
|
+
* Useful for client-side filtering of larger fully-loaded datasets
|
|
19
|
+
* (e.g. 1k+ rows) where each keystroke would otherwise re-walk the
|
|
20
|
+
* row model synchronously.
|
|
21
|
+
*
|
|
22
|
+
* Server-driven search (small `data` array, infinite-query-backed)
|
|
23
|
+
* usually wants this OFF because the network request is already
|
|
24
|
+
* the natural rate limiter — keep at the default.
|
|
25
|
+
*
|
|
26
|
+
* Only applies in uncontrolled mode (when neither `value` nor
|
|
27
|
+
* `onChange` is supplied). In controlled mode, debounce in the
|
|
28
|
+
* consumer's `onChange` instead.
|
|
29
|
+
*
|
|
30
|
+
* @default 0
|
|
31
|
+
*/
|
|
32
|
+
debounceMs?: number;
|
|
33
|
+
}
|
|
34
|
+
export declare function TableSearchFilter<TData extends RowData>({ table, className, placeholder, label, showClearButton, onChange, value, debounceMs }: TableSearchFilterProps<TData>): React$1.JSX.Element;
|
|
35
|
+
export declare namespace TableSearchFilter {
|
|
36
|
+
var displayName: string;
|
|
37
|
+
}
|
|
38
|
+
//#endregion
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { Button } from "../../../ui/button.js";
|
|
2
|
+
import { Input } from "../../../ui/input.js";
|
|
3
|
+
import { cn } from "../../../../lib/utils.js";
|
|
4
|
+
import { Search, X } from "lucide-react";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import * as React$1 from "react";
|
|
7
|
+
//#region src/components/registry/niko-table/filters/table-search-filter.tsx
|
|
8
|
+
function TableSearchFilter({ table, className, placeholder = "Search...", label = "Search table", showClearButton = true, onChange, value, debounceMs = 0 }) {
|
|
9
|
+
const isControlled = value !== void 0;
|
|
10
|
+
const tableGlobalFilter = table.state.globalFilter;
|
|
11
|
+
const globalFilterValue = typeof tableGlobalFilter === "string" ? tableGlobalFilter : "";
|
|
12
|
+
const debounceEnabled = !isControlled && debounceMs > 0;
|
|
13
|
+
const [pendingValue, setPendingValue] = React$1.useState(globalFilterValue);
|
|
14
|
+
const debounceTimerRef = React$1.useRef(null);
|
|
15
|
+
React$1.useEffect(() => {
|
|
16
|
+
if (debounceTimerRef.current) {
|
|
17
|
+
clearTimeout(debounceTimerRef.current);
|
|
18
|
+
debounceTimerRef.current = null;
|
|
19
|
+
}
|
|
20
|
+
if (!debounceEnabled) return;
|
|
21
|
+
setPendingValue(globalFilterValue);
|
|
22
|
+
}, [globalFilterValue, debounceEnabled]);
|
|
23
|
+
React$1.useEffect(() => {
|
|
24
|
+
return () => {
|
|
25
|
+
if (debounceTimerRef.current) clearTimeout(debounceTimerRef.current);
|
|
26
|
+
};
|
|
27
|
+
}, []);
|
|
28
|
+
const currentValue = isControlled ? value : debounceEnabled ? pendingValue : globalFilterValue;
|
|
29
|
+
const handleClear = React$1.useCallback(() => {
|
|
30
|
+
const emptyValue = "";
|
|
31
|
+
if (debounceTimerRef.current) {
|
|
32
|
+
clearTimeout(debounceTimerRef.current);
|
|
33
|
+
debounceTimerRef.current = null;
|
|
34
|
+
}
|
|
35
|
+
if (debounceEnabled) setPendingValue(emptyValue);
|
|
36
|
+
table.setGlobalFilter(emptyValue);
|
|
37
|
+
onChange?.(emptyValue);
|
|
38
|
+
}, [
|
|
39
|
+
table,
|
|
40
|
+
onChange,
|
|
41
|
+
debounceEnabled
|
|
42
|
+
]);
|
|
43
|
+
const handleChange = React$1.useCallback((event) => {
|
|
44
|
+
const newValue = event.target.value;
|
|
45
|
+
if (!debounceEnabled) {
|
|
46
|
+
table.setGlobalFilter(newValue);
|
|
47
|
+
onChange?.(newValue);
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
setPendingValue(newValue);
|
|
51
|
+
if (debounceTimerRef.current) clearTimeout(debounceTimerRef.current);
|
|
52
|
+
debounceTimerRef.current = setTimeout(() => {
|
|
53
|
+
debounceTimerRef.current = null;
|
|
54
|
+
table.setGlobalFilter(newValue);
|
|
55
|
+
onChange?.(newValue);
|
|
56
|
+
}, debounceMs);
|
|
57
|
+
}, [
|
|
58
|
+
table,
|
|
59
|
+
onChange,
|
|
60
|
+
debounceEnabled,
|
|
61
|
+
debounceMs
|
|
62
|
+
]);
|
|
63
|
+
const hasValue = currentValue.length > 0;
|
|
64
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
65
|
+
className: cn("relative flex flex-1 items-center", className),
|
|
66
|
+
role: "search",
|
|
67
|
+
children: [
|
|
68
|
+
/* @__PURE__ */ jsx(Search, {
|
|
69
|
+
className: "absolute left-3 h-4 w-4 text-muted-foreground",
|
|
70
|
+
"aria-hidden": "true"
|
|
71
|
+
}),
|
|
72
|
+
/* @__PURE__ */ jsx(Input, {
|
|
73
|
+
placeholder,
|
|
74
|
+
value: currentValue,
|
|
75
|
+
onChange: handleChange,
|
|
76
|
+
className: "pr-9 pl-9",
|
|
77
|
+
"aria-label": label
|
|
78
|
+
}),
|
|
79
|
+
hasValue && showClearButton && /* @__PURE__ */ jsxs(Button, {
|
|
80
|
+
variant: "ghost",
|
|
81
|
+
size: "sm",
|
|
82
|
+
onClick: handleClear,
|
|
83
|
+
className: "absolute right-1 h-7 w-7 p-0 hover:bg-muted",
|
|
84
|
+
type: "button",
|
|
85
|
+
"aria-label": "Clear search",
|
|
86
|
+
children: [/* @__PURE__ */ jsx(X, {
|
|
87
|
+
className: "h-3 w-3",
|
|
88
|
+
"aria-hidden": "true"
|
|
89
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
90
|
+
className: "sr-only",
|
|
91
|
+
children: "Clear search"
|
|
92
|
+
})]
|
|
93
|
+
})
|
|
94
|
+
]
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* @required displayName is required for auto feature detection
|
|
99
|
+
* @see src/components/niko-table/config/feature-detection.ts
|
|
100
|
+
*/
|
|
101
|
+
TableSearchFilter.displayName = "TableSearchFilter";
|
|
102
|
+
//#endregion
|
|
103
|
+
export { TableSearchFilter };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
//#region src/components/siyahi/data-list.d.ts
|
|
3
|
+
/** Label and value pairs, such as a record's fields in a card. */
|
|
4
|
+
export declare function DataList({ className, children }: {
|
|
5
|
+
className?: string;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
}): import("react").JSX.Element;
|
|
8
|
+
export interface DataListItemProps {
|
|
9
|
+
/** A short muted label; may hold a badge beside the words. */
|
|
10
|
+
label: ReactNode;
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
}
|
|
13
|
+
export declare function DataListItem({ label, children }: DataListItemProps): import("react").JSX.Element;
|
|
14
|
+
//#endregion
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { cn } from "cn";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/siyahi/data-list.tsx
|
|
4
|
+
/** Label and value pairs, such as a record's fields in a card. */
|
|
5
|
+
function DataList({ className, children }) {
|
|
6
|
+
return /* @__PURE__ */ jsx("dl", {
|
|
7
|
+
className: cn("flex flex-col gap-4", className),
|
|
8
|
+
children
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
function DataListItem({ label, children }) {
|
|
12
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
13
|
+
"data-slot": "data-list-item",
|
|
14
|
+
className: "flex flex-col gap-1",
|
|
15
|
+
children: [/* @__PURE__ */ jsx("dt", {
|
|
16
|
+
className: "flex items-center gap-2 text-xs font-medium text-muted-foreground",
|
|
17
|
+
children: label
|
|
18
|
+
}), /* @__PURE__ */ jsx("dd", {
|
|
19
|
+
className: "min-w-0",
|
|
20
|
+
children
|
|
21
|
+
})]
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
export { DataList, DataListItem };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { RowData } from "@tanstack/react-table";
|
|
2
|
+
//#region src/components/siyahi/data-table-row-count.d.ts
|
|
3
|
+
export interface DataTableRowCountProps {
|
|
4
|
+
/** What a row is, plural: "positions" prints "48 positions" while nothing is filtered. */
|
|
5
|
+
unit: string;
|
|
6
|
+
/** Rows before any filter. Defaults to the table's data; pass it when the page narrowed the data before the table. */
|
|
7
|
+
total?: number;
|
|
8
|
+
}
|
|
9
|
+
/** How many rows the filters leave: "12 of 48", or "48 positions" when they leave all. For a table toolbar, at its end. */
|
|
10
|
+
export declare function DataTableRowCount<TData extends RowData>({ unit, total }: DataTableRowCountProps): import("react").JSX.Element;
|
|
11
|
+
//#endregion
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { useFormat } from "../../lib/format.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-row-count.tsx
|
|
5
|
+
/** How many rows the filters leave: "12 of 48", or "48 positions" when they leave all. For a table toolbar, at its end. */
|
|
6
|
+
function DataTableRowCount({ unit, total }) {
|
|
7
|
+
const { table } = useDataTable();
|
|
8
|
+
const { count } = useFormat();
|
|
9
|
+
const all = total ?? table.getCoreRowModel().rows.length;
|
|
10
|
+
const shown = table.getFilteredRowModel().rows.length;
|
|
11
|
+
return /* @__PURE__ */ jsx("span", {
|
|
12
|
+
"data-slot": "data-table-row-count",
|
|
13
|
+
className: "ml-auto text-sm text-muted-foreground tabular-nums",
|
|
14
|
+
children: shown === all ? `${count(all)} ${unit}` : `${count(shown)} of ${count(all)}`
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { DataTableRowCount };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { RowData } from "@tanstack/react-table";
|
|
2
|
+
//#region src/components/siyahi/data-table-sort-header.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* A column header that sorts on one click, largest (or Z) first, as shadcn's
|
|
5
|
+
* data table guide draws it: a ghost button with the direction's arrow. The
|
|
6
|
+
* column menu takes two clicks for the same. Use it as a column's `header`:
|
|
7
|
+
* `header: () => <DataTableSortHeader />`; the title defaults to `meta.label`.
|
|
8
|
+
*/
|
|
9
|
+
export declare function DataTableSortHeader<TData extends RowData>({ title }: {
|
|
10
|
+
title?: string;
|
|
11
|
+
}): import("react").JSX.Element;
|
|
12
|
+
export declare namespace DataTableSortHeader {
|
|
13
|
+
var displayName: string;
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Button } from "../ui/button.js";
|
|
2
|
+
import { DataTableColumnHeader, useColumnHeaderContext } from "../registry/niko-table/components/data-table-column-header.js";
|
|
3
|
+
import { useDerivedColumnTitle } from "../registry/niko-table/hooks/use-derived-column-title.js";
|
|
4
|
+
import { registerComponentFeatures } from "../registry/niko-table/config/feature-detection.js";
|
|
5
|
+
import { ArrowDownIcon, ArrowUpDownIcon, ArrowUpIcon } from "lucide-react";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
//#region src/components/siyahi/data-table-sort-header.tsx
|
|
8
|
+
/**
|
|
9
|
+
* A column header that sorts on one click, largest (or Z) first, as shadcn's
|
|
10
|
+
* data table guide draws it: a ghost button with the direction's arrow. The
|
|
11
|
+
* column menu takes two clicks for the same. Use it as a column's `header`:
|
|
12
|
+
* `header: () => <DataTableSortHeader />`; the title defaults to `meta.label`.
|
|
13
|
+
*/
|
|
14
|
+
function DataTableSortHeader({ title }) {
|
|
15
|
+
const { column } = useColumnHeaderContext(true);
|
|
16
|
+
const label = useDerivedColumnTitle(column, column.id, title);
|
|
17
|
+
const sorted = column.getIsSorted();
|
|
18
|
+
return /* @__PURE__ */ jsx(DataTableColumnHeader, { children: /* @__PURE__ */ jsxs(Button, {
|
|
19
|
+
variant: "ghost",
|
|
20
|
+
size: "sm",
|
|
21
|
+
className: "-ml-2",
|
|
22
|
+
onClick: () => column.toggleSorting(sorted !== "desc"),
|
|
23
|
+
children: [
|
|
24
|
+
label,
|
|
25
|
+
/* @__PURE__ */ jsx(sorted === "asc" ? ArrowUpIcon : sorted === "desc" ? ArrowDownIcon : ArrowUpDownIcon, { "aria-hidden": "true" }),
|
|
26
|
+
sorted && /* @__PURE__ */ jsxs("span", {
|
|
27
|
+
className: "sr-only",
|
|
28
|
+
children: [", sorted ", sorted === "asc" ? "ascending" : "descending"]
|
|
29
|
+
})
|
|
30
|
+
]
|
|
31
|
+
}) });
|
|
32
|
+
}
|
|
33
|
+
DataTableSortHeader.displayName = "DataTableSortHeader";
|
|
34
|
+
registerComponentFeatures(DataTableSortHeader.displayName, { enableSorting: true });
|
|
35
|
+
//#endregion
|
|
36
|
+
export { DataTableSortHeader };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
//#region src/components/siyahi/inline-code.d.ts
|
|
3
|
+
/** A command, file name or identifier inside prose, in Geist Mono on a muted chip, at the size of the text around it. */
|
|
4
|
+
export declare function InlineCode({ children }: {
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
}): import("react").JSX.Element;
|
|
7
|
+
//#endregion
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
//#region src/components/siyahi/inline-code.tsx
|
|
3
|
+
/** A command, file name or identifier inside prose, in Geist Mono on a muted chip, at the size of the text around it. */
|
|
4
|
+
function InlineCode({ children }) {
|
|
5
|
+
return /* @__PURE__ */ jsx("code", {
|
|
6
|
+
className: "rounded-sm bg-muted px-1 font-mono",
|
|
7
|
+
children
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
//#endregion
|
|
11
|
+
export { InlineCode };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
//#region src/components/siyahi/page-section.d.ts
|
|
3
|
+
export interface PageSectionProps {
|
|
4
|
+
/** Anchor for a table of contents; the section scrolls in with room above it. */
|
|
5
|
+
id?: string;
|
|
6
|
+
/** Small muted line above the title, such as "Part 2". */
|
|
7
|
+
eyebrow?: ReactNode;
|
|
8
|
+
title: ReactNode;
|
|
9
|
+
/** Muted prose under the title: a sentence, or several paragraphs as elements. */
|
|
10
|
+
lead?: ReactNode;
|
|
11
|
+
/** A control for the whole section, such as a copy or mode toggle; it sits right, beside the heading. */
|
|
12
|
+
action?: ReactNode;
|
|
13
|
+
children?: ReactNode;
|
|
14
|
+
}
|
|
15
|
+
/** One part of a long page: a rule above, then the heading and lead on the canvas, then its content. */
|
|
16
|
+
export declare function PageSection({ id, eyebrow, title, lead, action, children }: PageSectionProps): import("react").JSX.Element;
|
|
17
|
+
/** A heading inside a PageSection, one level under its title. */
|
|
18
|
+
export declare function PageSubheading({ children }: {
|
|
19
|
+
children: ReactNode;
|
|
20
|
+
}): import("react").JSX.Element;
|
|
21
|
+
//#endregion
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
//#region src/components/siyahi/page-section.tsx
|
|
3
|
+
/** One part of a long page: a rule above, then the heading and lead on the canvas, then its content. */
|
|
4
|
+
function PageSection({ id, eyebrow, title, lead, action, children }) {
|
|
5
|
+
return /* @__PURE__ */ jsxs("section", {
|
|
6
|
+
id,
|
|
7
|
+
"data-slot": "page-section",
|
|
8
|
+
className: "flex scroll-mt-6 flex-col gap-6 border-t pt-10",
|
|
9
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
10
|
+
className: "flex flex-wrap items-end justify-between gap-4",
|
|
11
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
12
|
+
className: "flex flex-col gap-2",
|
|
13
|
+
children: [
|
|
14
|
+
eyebrow && /* @__PURE__ */ jsx("p", {
|
|
15
|
+
className: "text-sm text-muted-foreground",
|
|
16
|
+
children: eyebrow
|
|
17
|
+
}),
|
|
18
|
+
/* @__PURE__ */ jsx("h2", {
|
|
19
|
+
className: "text-2xl font-semibold tracking-tight",
|
|
20
|
+
children: title
|
|
21
|
+
}),
|
|
22
|
+
lead && /* @__PURE__ */ jsx("div", {
|
|
23
|
+
className: "flex max-w-prose flex-col gap-2 text-muted-foreground",
|
|
24
|
+
children: lead
|
|
25
|
+
})
|
|
26
|
+
]
|
|
27
|
+
}), action]
|
|
28
|
+
}), children]
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
/** A heading inside a PageSection, one level under its title. */
|
|
32
|
+
function PageSubheading({ children }) {
|
|
33
|
+
return /* @__PURE__ */ jsx("h3", {
|
|
34
|
+
className: "text-lg font-semibold tracking-tight",
|
|
35
|
+
children
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
//#endregion
|
|
39
|
+
export { PageSection, PageSubheading };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Progress } from "../ui/progress.js";
|
|
2
|
+
import { ComponentProps } from "react";
|
|
3
|
+
//#region src/components/siyahi/tone-progress.d.ts
|
|
4
|
+
declare const TONE: {
|
|
5
|
+
readonly positive: "**:data-[slot=progress-indicator]:bg-positive";
|
|
6
|
+
readonly negative: "**:data-[slot=progress-indicator]:bg-negative";
|
|
7
|
+
};
|
|
8
|
+
export interface ToneProgressProps extends ComponentProps<typeof Progress> {
|
|
9
|
+
/** The meaning colour of the bar: a gain's share in --positive, a loss's in --negative. */
|
|
10
|
+
tone: keyof typeof TONE;
|
|
11
|
+
}
|
|
12
|
+
/** shadcn's Progress with its bar in a meaning colour, such as each position's share of the booked P&L. */
|
|
13
|
+
export declare function ToneProgress({ tone, className, ...props }: ToneProgressProps): import("react").JSX.Element;
|
|
14
|
+
//#endregion
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Progress } from "../ui/progress.js";
|
|
2
|
+
import { cn } from "cn";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/siyahi/tone-progress.tsx
|
|
5
|
+
const TONE = {
|
|
6
|
+
positive: "**:data-[slot=progress-indicator]:bg-positive",
|
|
7
|
+
negative: "**:data-[slot=progress-indicator]:bg-negative"
|
|
8
|
+
};
|
|
9
|
+
/** shadcn's Progress with its bar in a meaning colour, such as each position's share of the booked P&L. */
|
|
10
|
+
function ToneProgress({ tone, className, ...props }) {
|
|
11
|
+
return /* @__PURE__ */ jsx(Progress, {
|
|
12
|
+
"data-tone": tone,
|
|
13
|
+
className: cn(TONE[tone], className),
|
|
14
|
+
...props
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { ToneProgress };
|
|
@@ -28,4 +28,11 @@ export interface TreemapProps<T extends TreemapItem> {
|
|
|
28
28
|
}
|
|
29
29
|
/** Holdings heat map: area by weight, colour by signed change, optionally grouped; hand-drawn SVG. */
|
|
30
30
|
export declare function Treemap<T extends TreemapItem>({ items, height, range, onHover, selected, onSelect }: TreemapProps<T>): import("react").JSX.Element;
|
|
31
|
+
export interface TreemapLegendProps {
|
|
32
|
+
/** The Treemap's own range, so each swatch matches its tiles. */
|
|
33
|
+
range?: number;
|
|
34
|
+
className?: string;
|
|
35
|
+
}
|
|
36
|
+
/** The Treemap's colour scale under the map: five steps of loss, no change, five steps of gain, deepest at the ends. */
|
|
37
|
+
export declare function TreemapLegend({ range, className }: TreemapLegendProps): import("react").JSX.Element;
|
|
31
38
|
//#endregion
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { useFormat } from "../../lib/format.js";
|
|
2
|
-
import { heat, layout } from "../../lib/treemap.js";
|
|
2
|
+
import { heat, heatFill, heatRange, layout } from "../../lib/treemap.js";
|
|
3
|
+
import { cn } from "cn";
|
|
3
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
5
|
import { useEffect, useEffectEvent, useLayoutEffect, useRef, useState } from "react";
|
|
5
6
|
//#region src/components/siyahi/treemap.tsx
|
|
@@ -96,5 +97,71 @@ function Treemap({ items, height, range, onHover, selected, onSelect }) {
|
|
|
96
97
|
})
|
|
97
98
|
});
|
|
98
99
|
}
|
|
100
|
+
function Swatch({ label, fill }) {
|
|
101
|
+
return /* @__PURE__ */ jsxs("svg", {
|
|
102
|
+
"data-slot": "treemap-legend-swatch",
|
|
103
|
+
className: "h-3 flex-1",
|
|
104
|
+
children: [/* @__PURE__ */ jsx("title", { children: label }), /* @__PURE__ */ jsx("rect", {
|
|
105
|
+
width: "100%",
|
|
106
|
+
height: "100%",
|
|
107
|
+
rx: 2,
|
|
108
|
+
style: { fill }
|
|
109
|
+
})]
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
/** The Treemap's colour scale under the map: five steps of loss, no change, five steps of gain, deepest at the ends. */
|
|
113
|
+
function TreemapLegend({ range, className }) {
|
|
114
|
+
const { pct } = useFormat();
|
|
115
|
+
const step = heatRange(range) / 5;
|
|
116
|
+
const digits = Number.isInteger(Math.round(step * 1e6) / 1e4) ? 0 : 1;
|
|
117
|
+
const over = pct(step * 4, digits);
|
|
118
|
+
const swatch = (side, n) => {
|
|
119
|
+
const word = side === "positive" ? "up" : "down";
|
|
120
|
+
const label = n === 5 ? `${word} over ${over}` : `${word} ${pct(step * (n - 1), digits)}–${pct(step * n, digits)}`;
|
|
121
|
+
return /* @__PURE__ */ jsx(Swatch, {
|
|
122
|
+
label,
|
|
123
|
+
fill: heatFill(side, n)
|
|
124
|
+
}, `${side}-${n}`);
|
|
125
|
+
};
|
|
126
|
+
const steps = Array.from({ length: 5 }, (_, i) => i + 1);
|
|
127
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
128
|
+
"data-slot": "treemap-legend",
|
|
129
|
+
className: cn("flex w-full max-w-xs flex-col gap-1 text-xs text-muted-foreground", className),
|
|
130
|
+
children: [
|
|
131
|
+
/* @__PURE__ */ jsxs("div", {
|
|
132
|
+
className: "flex gap-0.5",
|
|
133
|
+
"aria-hidden": "true",
|
|
134
|
+
children: [
|
|
135
|
+
steps.toReversed().map((n) => swatch("negative", n)),
|
|
136
|
+
/* @__PURE__ */ jsx(Swatch, {
|
|
137
|
+
label: "no change, or unknown",
|
|
138
|
+
fill: heat(null)
|
|
139
|
+
}),
|
|
140
|
+
steps.map((n) => swatch("positive", n))
|
|
141
|
+
]
|
|
142
|
+
}),
|
|
143
|
+
/* @__PURE__ */ jsxs("div", {
|
|
144
|
+
className: "flex justify-between gap-2 tabular-nums",
|
|
145
|
+
children: [
|
|
146
|
+
/* @__PURE__ */ jsxs("span", { children: ["▼ over ", over] }),
|
|
147
|
+
/* @__PURE__ */ jsxs("span", { children: [pct(step, digits), " a step"] }),
|
|
148
|
+
/* @__PURE__ */ jsxs("span", { children: ["▲ over ", over] })
|
|
149
|
+
]
|
|
150
|
+
}),
|
|
151
|
+
/* @__PURE__ */ jsxs("p", {
|
|
152
|
+
className: "sr-only",
|
|
153
|
+
children: [
|
|
154
|
+
"Tile colours run in ",
|
|
155
|
+
5,
|
|
156
|
+
" steps of ",
|
|
157
|
+
pct(step, digits),
|
|
158
|
+
" each way, deepest over ",
|
|
159
|
+
over,
|
|
160
|
+
"; a muted tile is no change or unknown."
|
|
161
|
+
]
|
|
162
|
+
})
|
|
163
|
+
]
|
|
164
|
+
});
|
|
165
|
+
}
|
|
99
166
|
//#endregion
|
|
100
|
-
export { Treemap };
|
|
167
|
+
export { Treemap, TreemapLegend };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Button } from "./button.js";
|
|
2
|
+
import * as React$1 from "react";
|
|
3
|
+
import { VariantProps } from "class-variance-authority";
|
|
4
|
+
//#region src/components/ui/code-block.d.ts
|
|
5
|
+
declare const codeBlockVariants: (props?: ({
|
|
6
|
+
variant?: "default" | "destructive" | null | undefined;
|
|
7
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
|
+
declare function CodeBlock({ className, variant, size, ...props }: React$1.ComponentProps<"div"> & VariantProps<typeof codeBlockVariants> & {
|
|
9
|
+
size?: "default" | "sm";
|
|
10
|
+
}): React$1.JSX.Element;
|
|
11
|
+
declare function CodeBlockHeader({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
12
|
+
declare function CodeBlockTitle({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
13
|
+
declare function CodeBlockActions({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
14
|
+
declare function CodeBlockCopyButton({ value, variant, size, className, onClick, ...props }: React$1.ComponentProps<typeof Button> & {
|
|
15
|
+
value: string;
|
|
16
|
+
}): React$1.JSX.Element;
|
|
17
|
+
declare function CodeBlockContent({ className, children, style, wrap, lineNumbers, startLine, ...props }: React$1.ComponentProps<"pre"> & {
|
|
18
|
+
wrap?: boolean;
|
|
19
|
+
lineNumbers?: boolean;
|
|
20
|
+
startLine?: number;
|
|
21
|
+
}): React$1.JSX.Element;
|
|
22
|
+
declare const codeBlockLineVariants: (props?: ({
|
|
23
|
+
variant?: "added" | "default" | "highlighted" | "removed" | null | undefined;
|
|
24
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
25
|
+
declare function CodeBlockLine({ className, variant, children, ...props }: React$1.ComponentProps<"span"> & VariantProps<typeof codeBlockLineVariants>): React$1.JSX.Element;
|
|
26
|
+
declare function CodeBlockFooter({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
27
|
+
//#endregion
|
|
28
|
+
export { CodeBlock, CodeBlockActions, CodeBlockContent, CodeBlockCopyButton, CodeBlockFooter, CodeBlockHeader, CodeBlockLine, CodeBlockTitle };
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { Button } from "./button.js";
|
|
2
|
+
import { cn } from "cn";
|
|
3
|
+
import { CheckIcon, CopyIcon } from "lucide-react";
|
|
4
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import * as React$1 from "react";
|
|
6
|
+
import { cva } from "class-variance-authority";
|
|
7
|
+
//#region src/components/ui/code-block.tsx
|
|
8
|
+
const codeBlockVariants = cva("group/code-block relative flex w-full min-w-0 flex-col overflow-hidden rounded-2xl text-sm has-[>[data-slot=code-block-content]:focus-visible]:ring-3 has-[>[data-slot=code-block-content]:focus-visible]:ring-ring/30 data-[size=sm]:rounded-xl data-[size=sm]:text-xs", {
|
|
9
|
+
variants: { variant: {
|
|
10
|
+
default: "bg-muted text-foreground ring-1 ring-foreground/5 dark:ring-foreground/10",
|
|
11
|
+
destructive: "bg-destructive/5 text-destructive ring-1 ring-destructive/15 dark:bg-destructive/10 dark:ring-destructive/20"
|
|
12
|
+
} },
|
|
13
|
+
defaultVariants: { variant: "default" }
|
|
14
|
+
});
|
|
15
|
+
function CodeBlock({ className, variant = "default", size = "default", ...props }) {
|
|
16
|
+
return /* @__PURE__ */ jsx("div", {
|
|
17
|
+
"data-slot": "code-block",
|
|
18
|
+
"data-variant": variant,
|
|
19
|
+
"data-size": size,
|
|
20
|
+
className: cn(codeBlockVariants({ variant }), className),
|
|
21
|
+
...props
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
function CodeBlockHeader({ className, ...props }) {
|
|
25
|
+
return /* @__PURE__ */ jsx("div", {
|
|
26
|
+
"data-slot": "code-block-header",
|
|
27
|
+
className: cn("flex min-w-0 shrink-0 items-center gap-2 px-5 pt-5 text-muted-foreground group-data-[size=sm]/code-block:px-3 group-data-[size=sm]/code-block:pt-3 group-data-[variant=destructive]/code-block:text-destructive *:has-[>[data-slot=code-block-title]]:min-w-0", className),
|
|
28
|
+
...props
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
function CodeBlockTitle({ className, ...props }) {
|
|
32
|
+
return /* @__PURE__ */ jsx("div", {
|
|
33
|
+
"data-slot": "code-block-title",
|
|
34
|
+
className: cn("min-w-0 truncate font-sans text-sm font-medium text-foreground group-data-[size=sm]/code-block:text-xs group-data-[variant=destructive]/code-block:text-destructive [&_svg]:pointer-events-none [&_svg]:inline-block [&_svg]:align-middle [&_svg:not([class*='size-'])]:size-4 group-data-[size=sm]/code-block:[&_svg:not([class*='size-'])]:size-3.5 *:[svg]:me-1.5", className),
|
|
35
|
+
...props
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
function CodeBlockActions({ className, ...props }) {
|
|
39
|
+
return /* @__PURE__ */ jsx("div", {
|
|
40
|
+
"data-slot": "code-block-actions",
|
|
41
|
+
className: cn("-my-1 ms-auto -me-1.5 flex shrink-0 items-center gap-1 *:data-[slot=button]:hover:bg-foreground/5 dark:*:data-[slot=button]:hover:bg-foreground/10 [[data-slot=code-block]>&]:absolute [[data-slot=code-block]>&]:end-4 [[data-slot=code-block]>&]:top-4 [[data-slot=code-block]>&]:z-10 [[data-slot=code-block]>&]:m-0 [[data-slot=code-block]>&]:opacity-0 [[data-slot=code-block]>&]:transition-opacity [[data-slot=code-block]>&]:group-focus-within/code-block:opacity-100 [[data-slot=code-block]>&]:group-hover/code-block:opacity-100 group-data-[size=sm]/code-block:[[data-slot=code-block]>&]:end-2 group-data-[size=sm]/code-block:[[data-slot=code-block]>&]:top-2 [[data-slot=code-block]>&]:pointer-coarse:opacity-100 [[data-slot=code-block]>&]:*:[button]:bg-background [[data-slot=code-block]>&]:*:[button]:ring-1 [[data-slot=code-block]>&]:*:[button]:ring-foreground/10", className),
|
|
42
|
+
...props
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
function CodeBlockCopyButton({ value, variant = "ghost", size = "icon-xs", className, onClick, ...props }) {
|
|
46
|
+
const [copied, setCopied] = React$1.useState(false);
|
|
47
|
+
React$1.useEffect(() => {
|
|
48
|
+
if (!copied) return;
|
|
49
|
+
const timeout = setTimeout(() => setCopied(false), 2e3);
|
|
50
|
+
return () => clearTimeout(timeout);
|
|
51
|
+
}, [copied]);
|
|
52
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Button, {
|
|
53
|
+
"data-slot": "code-block-copy-button",
|
|
54
|
+
"data-copied": copied || void 0,
|
|
55
|
+
variant,
|
|
56
|
+
size,
|
|
57
|
+
"aria-label": copied ? "Copied" : "Copy",
|
|
58
|
+
className: cn("hover:bg-foreground/5 dark:hover:bg-foreground/10", className),
|
|
59
|
+
onClick: (event) => {
|
|
60
|
+
onClick?.(event);
|
|
61
|
+
navigator.clipboard.writeText(value).then(() => setCopied(true)).catch(() => {});
|
|
62
|
+
},
|
|
63
|
+
...props,
|
|
64
|
+
children: copied ? /* @__PURE__ */ jsx(CheckIcon, {}) : /* @__PURE__ */ jsx(CopyIcon, {})
|
|
65
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
66
|
+
"aria-live": "polite",
|
|
67
|
+
className: "sr-only",
|
|
68
|
+
children: copied ? "Copied" : ""
|
|
69
|
+
})] });
|
|
70
|
+
}
|
|
71
|
+
function CodeBlockContent({ className, children, style, wrap = false, lineNumbers = false, startLine = 1, ...props }) {
|
|
72
|
+
return /* @__PURE__ */ jsx("pre", {
|
|
73
|
+
"data-slot": "code-block-content",
|
|
74
|
+
"data-wrap": wrap || void 0,
|
|
75
|
+
"data-numbered": lineNumbers || void 0,
|
|
76
|
+
dir: "ltr",
|
|
77
|
+
tabIndex: 0,
|
|
78
|
+
style: {
|
|
79
|
+
counterReset: `line ${startLine - 1}`,
|
|
80
|
+
...style
|
|
81
|
+
},
|
|
82
|
+
className: cn("min-h-0 min-w-0 scroll-fade-x scrollbar-thin overflow-auto px-5 py-5 text-start font-mono leading-relaxed outline-none group-has-data-[slot=code-block-footer]/code-block:pb-2 group-has-data-[slot=code-block-header]/code-block:pt-2 group-data-[size=sm]/code-block:px-3 group-data-[size=sm]/code-block:py-3 group-data-[size=sm]/code-block:group-has-data-[slot=code-block-header]/code-block:pt-1.5 data-wrap:scroll-fade-y data-wrap:wrap-break-word data-wrap:whitespace-pre-wrap", className),
|
|
83
|
+
...props,
|
|
84
|
+
children: /* @__PURE__ */ jsx("code", {
|
|
85
|
+
"data-slot": "code-block-code",
|
|
86
|
+
className: "grid min-h-lh min-w-max content-start in-data-numbered:grid-cols-[auto_1fr] in-data-wrap:min-w-0",
|
|
87
|
+
children: lineNumbers && typeof children === "string" ? children.replace(/\n$/, "").split("\n").map((line, index) => /* @__PURE__ */ jsx(CodeBlockLine, { children: line }, index)) : children
|
|
88
|
+
})
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
const codeBlockLineVariants = cva("relative -mx-5 block min-h-lh px-5 group-data-[size=sm]/code-block:-mx-3 group-data-[size=sm]/code-block:px-3 before:min-w-6 before:text-end before:text-muted-foreground after:absolute after:start-1 after:top-0 after:text-muted-foreground after:select-none in-data-numbered:col-span-2 in-data-numbered:grid in-data-numbered:grid-cols-subgrid in-data-numbered:gap-x-3 in-data-numbered:[counter-increment:line] in-data-numbered:before:content-[counter(line)] in-data-numbered:before:select-none in-data-numbered:supports-[content:counter(line)_/_'']:before:content-[counter(line)_/_'']", {
|
|
92
|
+
variants: { variant: {
|
|
93
|
+
default: "",
|
|
94
|
+
added: "bg-foreground/5 after:content-['+']",
|
|
95
|
+
removed: "bg-destructive/10 after:text-destructive after:content-['−']",
|
|
96
|
+
highlighted: "bg-foreground/5"
|
|
97
|
+
} },
|
|
98
|
+
defaultVariants: { variant: "default" }
|
|
99
|
+
});
|
|
100
|
+
function CodeBlockLine({ className, variant = "default", children, ...props }) {
|
|
101
|
+
const empty = children === void 0 || children === null || children === "" || Array.isArray(children) && children.length === 0;
|
|
102
|
+
return /* @__PURE__ */ jsx("span", {
|
|
103
|
+
"data-slot": "code-block-line",
|
|
104
|
+
"data-variant": variant,
|
|
105
|
+
className: cn(codeBlockLineVariants({ variant }), className),
|
|
106
|
+
...props,
|
|
107
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
108
|
+
"data-slot": "code-block-line-content",
|
|
109
|
+
className: "min-w-0",
|
|
110
|
+
children: empty ? "\n" : children
|
|
111
|
+
})
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
function CodeBlockFooter({ className, ...props }) {
|
|
115
|
+
return /* @__PURE__ */ jsx("div", {
|
|
116
|
+
"data-slot": "code-block-footer",
|
|
117
|
+
className: cn("flex min-w-0 shrink-0 items-center gap-2 px-5 pb-5 text-muted-foreground group-data-[size=sm]/code-block:px-3 group-data-[size=sm]/code-block:pb-3", className),
|
|
118
|
+
...props
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
//#endregion
|
|
122
|
+
export { CodeBlock, CodeBlockActions, CodeBlockContent, CodeBlockCopyButton, CodeBlockFooter, CodeBlockHeader, CodeBlockLine, CodeBlockTitle };
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { ChartColor, ChartSeries, ChartSeriesItem, SeriesChartProps } from "./li
|
|
|
2
2
|
import { AreaChartCard, AreaChartCardProps } from "./components/registry/charts/area-chart-card.js";
|
|
3
3
|
import { BarChartCard, BarChartCardProps } from "./components/registry/charts/bar-chart-card.js";
|
|
4
4
|
import { LineChartCard } from "./components/registry/charts/line-chart-card.js";
|
|
5
|
-
import { SectionCard, SectionCards } from "./components/registry/dashboard-01/section-cards.js";
|
|
5
|
+
import { SectionCard, SectionCards, SectionCardsProps } from "./components/registry/dashboard-01/section-cards.js";
|
|
6
6
|
import { BarList, BarListItem, BarListProps } from "./components/registry/dashboardcn/bar-list.js";
|
|
7
7
|
import { Activity, CalendarHeatmap, CalendarHeatmapBlock, CalendarHeatmapBlockProps, CalendarHeatmapBody, CalendarHeatmapBodyProps, CalendarHeatmapFooter, CalendarHeatmapFooterProps, CalendarHeatmapLegend, CalendarHeatmapLegendProps, CalendarHeatmapProps, CalendarHeatmapStat, CalendarHeatmapStatProps, ColorConfig, Labels } from "./components/registry/heatmap/calendar-heatmap.js";
|
|
8
8
|
import { StatusActivity, StatusColorConfig, StatusHeatmap, StatusHeatmapBlock, StatusHeatmapBlockProps, StatusHeatmapBody, StatusHeatmapBodyProps, StatusHeatmapFooter, StatusHeatmapFooterProps, StatusHeatmapLabels, StatusHeatmapLegend, StatusHeatmapLegendProps, StatusHeatmapProps, StatusHeatmapStat, StatusHeatmapStatProps, StatusValue } from "./components/registry/heatmap/status-heatmap.js";
|
|
@@ -24,6 +24,8 @@ import { DataTableRowContextMenuSlot, DataTableRowContextMenuSlotProps, resolveR
|
|
|
24
24
|
import { DataTableRowContextMenu, DataTableRowContextMenuProps } from "./components/registry/niko-table/components/data-table-row-context-menu.js";
|
|
25
25
|
import { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger } from "./components/ui/dropdown-menu.js";
|
|
26
26
|
import { DataTableRowMenuScope, RowMenuGroup, RowMenuItem, RowMenuLabel, RowMenuSeparator, RowMenuSub, RowMenuSubContent, RowMenuSubTrigger, useDataTableRow } from "./components/registry/niko-table/components/data-table-row-menu.js";
|
|
27
|
+
import { TableSearchFilter, TableSearchFilterProps } from "./components/registry/niko-table/filters/table-search-filter.js";
|
|
28
|
+
import { DataTableSearchFilter } from "./components/registry/niko-table/components/data-table-search-filter.js";
|
|
27
29
|
import { DataTableToolbarSection, DataTableToolbarSectionProps } from "./components/registry/niko-table/components/data-table-toolbar-section.js";
|
|
28
30
|
import { ActiveCell, ActiveSelection, ColumnResizeInfo, DataTableActions, DataTableContext, DataTableContextState, DataTableProvider, FlashCellRef, FlashCells, FlashRows, FlashRowsOptions, ScrollAlign, ScrollRowIntoView, flashCellKey, useColumnResizeInfo, useDataTable, useDataTableActiveCell, useDataTableActiveCellSetter } from "./components/registry/niko-table/core/data-table-context.js";
|
|
29
31
|
import { DataTableErrorBoundary, DataTableErrorBoundaryProps } from "./components/registry/niko-table/core/data-table-error-boundary.js";
|
|
@@ -42,12 +44,19 @@ import { Separator } from "./components/ui/separator.js";
|
|
|
42
44
|
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "./components/ui/tooltip.js";
|
|
43
45
|
import { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, useSidebar } from "./components/ui/sidebar.js";
|
|
44
46
|
import { AppSidebar, AppSidebarProps } from "./components/registry/sidebar-07/app-sidebar.js";
|
|
47
|
+
import { DataList, DataListItem, DataListItemProps } from "./components/siyahi/data-list.js";
|
|
48
|
+
import { DataTableRowCount, DataTableRowCountProps } from "./components/siyahi/data-table-row-count.js";
|
|
49
|
+
import { DataTableSortHeader } from "./components/siyahi/data-table-sort-header.js";
|
|
45
50
|
import { Delta, DeltaProps } from "./components/siyahi/delta.js";
|
|
51
|
+
import { InlineCode } from "./components/siyahi/inline-code.js";
|
|
46
52
|
import { LocalTime, LocalTimeProps } from "./components/siyahi/local-time.js";
|
|
53
|
+
import { PageSection, PageSectionProps, PageSubheading } from "./components/siyahi/page-section.js";
|
|
47
54
|
import { PriceChart, PriceChartProps } from "./components/siyahi/price-chart.js";
|
|
48
55
|
import { SiyahiLocale, defaultLocale } from "./lib/locale.js";
|
|
49
56
|
import { SiyahiProvider, SiyahiProviderProps, useLocale } from "./components/siyahi/siyahi-provider.js";
|
|
50
|
-
import {
|
|
57
|
+
import { Progress, ProgressIndicator, ProgressLabel, ProgressTrack, ProgressValue } from "./components/ui/progress.js";
|
|
58
|
+
import { ToneProgress, ToneProgressProps } from "./components/siyahi/tone-progress.js";
|
|
59
|
+
import { Treemap, TreemapItem, TreemapLegend, TreemapLegendProps, TreemapProps } from "./components/siyahi/treemap.js";
|
|
51
60
|
import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from "./components/ui/accordion.js";
|
|
52
61
|
import { Alert, AlertAction, AlertDescription, AlertTitle } from "./components/ui/alert.js";
|
|
53
62
|
import { Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage } from "./components/ui/avatar.js";
|
|
@@ -56,13 +65,13 @@ import { Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, Breadcr
|
|
|
56
65
|
import { Calendar, CalendarDayButton } from "./components/ui/calendar.js";
|
|
57
66
|
import { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "./components/ui/card.js";
|
|
58
67
|
import { ChartConfig, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent } from "./components/ui/chart.js";
|
|
68
|
+
import { CodeBlock, CodeBlockActions, CodeBlockContent, CodeBlockCopyButton, CodeBlockFooter, CodeBlockHeader, CodeBlockLine, CodeBlockTitle } from "./components/ui/code-block.js";
|
|
59
69
|
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "./components/ui/collapsible.js";
|
|
60
70
|
import { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger } from "./components/ui/dialog.js";
|
|
61
71
|
import { Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut } from "./components/ui/command.js";
|
|
62
72
|
import { ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger } from "./components/ui/context-menu.js";
|
|
63
73
|
import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea } from "./components/ui/input-group.js";
|
|
64
74
|
import { Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger } from "./components/ui/popover.js";
|
|
65
|
-
import { Progress, ProgressIndicator, ProgressLabel, ProgressTrack, ProgressValue } from "./components/ui/progress.js";
|
|
66
75
|
import { ScrollArea, ScrollBar } from "./components/ui/scroll-area.js";
|
|
67
76
|
import { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue } from "./components/ui/select.js";
|
|
68
77
|
import { Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger } from "./components/ui/sheet.js";
|
|
@@ -73,6 +82,6 @@ import { Tabs, TabsContent, TabsList, TabsTrigger, tabsListVariants } from "./co
|
|
|
73
82
|
import { Textarea } from "./components/ui/textarea.js";
|
|
74
83
|
import { Toggle, toggleVariants } from "./components/ui/toggle.js";
|
|
75
84
|
import { ToggleGroup, ToggleGroupItem } from "./components/ui/toggle-group.js";
|
|
76
|
-
import { Formatters, TimeOptions, money, moneyCompact, pct, time, useFormat } from "./lib/format.js";
|
|
85
|
+
import { Formatters, TimeOptions, count, money, moneyCompact, pct, time, useFormat } from "./lib/format.js";
|
|
77
86
|
import { Area, AreaChart, Bar, BarChart, CartesianGrid, Line, LineChart, ReferenceLine, XAxis, YAxis } from "./lib/recharts.js";
|
|
78
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, ActiveCell, ActiveSelection, Activity, Alert, AlertAction, AlertDescription, AlertTitle, AppSidebar, AppSidebarProps, Area, AreaChart, AreaChartCard, AreaChartCardProps, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge, Bar, BarChart, BarChartCard, BarChartCardProps, BarList, BarListItem, BarListProps, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Calendar, CalendarDayButton, CalendarHeatmap, CalendarHeatmapBlock, CalendarHeatmapBlockProps, CalendarHeatmapBody, CalendarHeatmapBodyProps, CalendarHeatmapFooter, CalendarHeatmapFooterProps, CalendarHeatmapLegend, CalendarHeatmapLegendProps, CalendarHeatmapProps, CalendarHeatmapStat, CalendarHeatmapStatProps, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CartesianGrid, ChartColor, ChartConfig, ChartContainer, ChartLegend, ChartLegendContent, ChartSeries, ChartSeriesItem, ChartStyle, ChartTooltip, ChartTooltipContent, Collapsible, CollapsibleContent, CollapsibleTrigger, ColorConfig, ColumnResizeInfo, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, DataTable, DataTableActions, DataTableBody, DataTableBodyProps, type DataTableCell, type DataTableColumn, DataTableColumnActions, type DataTableColumnDef, DataTableColumnFilter, DataTableColumnHeader, DataTableColumnHeaderProps, DataTableColumnHeaderRoot, DataTableColumnSortMenu, DataTableColumnSortOptions, DataTableColumnTitle, type DataTableColumns, DataTableConfig, DataTableContainerProps, DataTableContext, DataTableContextState, DataTableEmptyActions, DataTableEmptyActionsProps, DataTableEmptyBody, DataTableEmptyBodyProps, DataTableEmptyDescription, DataTableEmptyDescriptionProps, DataTableEmptyFilteredMessage, DataTableEmptyFilteredMessageProps, DataTableEmptyIcon, DataTableEmptyIconProps, DataTableEmptyMessage, DataTableEmptyMessageProps, DataTableEmptyState, DataTableEmptyStateProps, DataTableEmptyTitle, DataTableEmptyTitleProps, DataTableErrorBoundary, DataTableErrorBoundaryProps, DataTableFacetedFilter, DataTableFacetedFilterContent, DataTableGroupRowContextValue, DataTableGroupRowProvider, DataTableGroupedRowCells, DataTableGroupedRows, DataTableGroupedRowsProps, DataTableHeader, type DataTableHeader$1 as DataTableHeaderCell, DataTableHeaderProps, type DataTableInstance, DataTableLoading, DataTableLoadingMore, DataTableLoadingMoreProps, DataTableLoadingProps, DataTableProvider, DataTableRoot, type DataTableRow, DataTableRowContextMenu, DataTableRowContextMenuProps, DataTableRowContextMenuSlot, DataTableRowContextMenuSlotProps, DataTableRowMenuScope, DataTableSkeleton, DataTableSkeletonProps, DataTableToolbarSection, DataTableToolbarSectionProps, Delta, DeltaProps, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, type ExtendedColumnFilter, type ExtendedColumnSort, type FilterOperator, type FilterOperatorValues, type FilterVariant, type FilterVariantValues, FlashCellRef, FlashCells, FlashRows, FlashRowsOptions, Formatters, type GlobalFilter, GroupedBodyRow, GroupedBodyRowProps, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, type JoinOperator, type JoinOperatorValues, Labels, Line, LineChart, LineChartCard, LocalTime, LocalTimeProps, NavMain, NavProjects, NavUser, type Option, Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, PriceChart, PriceChartProps, Progress, ProgressIndicator, ProgressLabel, ProgressTrack, ProgressValue, type QueryKeys, ReferenceLine, RowMenuGroup, RowMenuItem, RowMenuLabel, RowMenuSeparator, RowMenuSub, RowMenuSubContent, RowMenuSubTrigger, ScrollAlign, ScrollArea, ScrollBar, type ScrollEvent, ScrollRowIntoView, SectionCard, SectionCards, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, SeriesChartProps, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, SiyahiLocale, SiyahiProvider, SiyahiProviderProps, Skeleton, Slider, StatusActivity, StatusColorConfig, StatusHeatmap, StatusHeatmapBlock, StatusHeatmapBlockProps, StatusHeatmapBody, StatusHeatmapBodyProps, StatusHeatmapFooter, StatusHeatmapFooterProps, StatusHeatmapLabels, StatusHeatmapLegend, StatusHeatmapLegendProps, StatusHeatmapProps, StatusHeatmapStat, StatusHeatmapStatProps, StatusValue, Table, TableBody, TableCaption, TableCell, TableColumnActions, TableColumnActionsProps, TableColumnSortMenu, TableColumnSortOptions, TableColumnTitle, TableFacetedFilter, TableFacetedFilterContent, TableFacetedFilterProps, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, TeamSwitcher, Textarea, TimeOptions, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, Treemap, TreemapItem, TreemapProps, type ValueOf, type ColorConfig$1 as WeekdayColorConfig, type WeekdayExtraColumnSpec, type WeekdayExtraRowSpec, WeekdayHeatmap, WeekdayHeatmapBlock, type WeekdayHeatmapBlockProps, WeekdayHeatmapBody, type WeekdayHeatmapBodyProps, WeekdayHeatmapFooter, type WeekdayHeatmapFooterProps, type WeekdayHeatmapLabels, WeekdayHeatmapLegend, type WeekdayHeatmapLegendProps, type WeekdayHeatmapProps, WeekdayHeatmapStat, type WeekdayHeatmapStatProps, type WeekdayHour, type WeekdayHourlyActivity, type WeekdayIndex, XAxis, YAxis, badgeVariants, buttonVariants, defaultLocale, flashCellKey, money, moneyCompact, pct, resolveGroupedRowsSlot, resolveRowContextMenuRenderer, tabsListVariants, time, toggleVariants, useColumnHeaderContext, useColumnResizeInfo, useDataTable, useDataTableActiveCell, useDataTableActiveCellSetter, useDataTableGroupRow, useDataTableRow, useFormat, useLocale, useResolvedRowContextMenuRenderer, useSidebar, useTableFacetedFilter };
|
|
87
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, ActiveCell, ActiveSelection, Activity, Alert, AlertAction, AlertDescription, AlertTitle, AppSidebar, AppSidebarProps, Area, AreaChart, AreaChartCard, AreaChartCardProps, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge, Bar, BarChart, BarChartCard, BarChartCardProps, BarList, BarListItem, BarListProps, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Calendar, CalendarDayButton, CalendarHeatmap, CalendarHeatmapBlock, CalendarHeatmapBlockProps, CalendarHeatmapBody, CalendarHeatmapBodyProps, CalendarHeatmapFooter, CalendarHeatmapFooterProps, CalendarHeatmapLegend, CalendarHeatmapLegendProps, CalendarHeatmapProps, CalendarHeatmapStat, CalendarHeatmapStatProps, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CartesianGrid, ChartColor, ChartConfig, ChartContainer, ChartLegend, ChartLegendContent, ChartSeries, ChartSeriesItem, ChartStyle, ChartTooltip, ChartTooltipContent, CodeBlock, CodeBlockActions, CodeBlockContent, CodeBlockCopyButton, CodeBlockFooter, CodeBlockHeader, CodeBlockLine, CodeBlockTitle, Collapsible, CollapsibleContent, CollapsibleTrigger, ColorConfig, ColumnResizeInfo, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, DataList, DataListItem, DataListItemProps, DataTable, DataTableActions, DataTableBody, DataTableBodyProps, type DataTableCell, type DataTableColumn, DataTableColumnActions, type DataTableColumnDef, DataTableColumnFilter, DataTableColumnHeader, DataTableColumnHeaderProps, DataTableColumnHeaderRoot, DataTableColumnSortMenu, DataTableColumnSortOptions, DataTableColumnTitle, type DataTableColumns, DataTableConfig, DataTableContainerProps, DataTableContext, DataTableContextState, DataTableEmptyActions, DataTableEmptyActionsProps, DataTableEmptyBody, DataTableEmptyBodyProps, DataTableEmptyDescription, DataTableEmptyDescriptionProps, DataTableEmptyFilteredMessage, DataTableEmptyFilteredMessageProps, DataTableEmptyIcon, DataTableEmptyIconProps, DataTableEmptyMessage, DataTableEmptyMessageProps, DataTableEmptyState, DataTableEmptyStateProps, DataTableEmptyTitle, DataTableEmptyTitleProps, DataTableErrorBoundary, DataTableErrorBoundaryProps, DataTableFacetedFilter, DataTableFacetedFilterContent, DataTableGroupRowContextValue, DataTableGroupRowProvider, DataTableGroupedRowCells, DataTableGroupedRows, DataTableGroupedRowsProps, DataTableHeader, type DataTableHeader$1 as DataTableHeaderCell, DataTableHeaderProps, type DataTableInstance, DataTableLoading, DataTableLoadingMore, DataTableLoadingMoreProps, DataTableLoadingProps, DataTableProvider, DataTableRoot, type DataTableRow, DataTableRowContextMenu, DataTableRowContextMenuProps, DataTableRowContextMenuSlot, DataTableRowContextMenuSlotProps, DataTableRowCount, DataTableRowCountProps, DataTableRowMenuScope, DataTableSearchFilter, DataTableSkeleton, DataTableSkeletonProps, DataTableSortHeader, DataTableToolbarSection, DataTableToolbarSectionProps, Delta, DeltaProps, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, type ExtendedColumnFilter, type ExtendedColumnSort, type FilterOperator, type FilterOperatorValues, type FilterVariant, type FilterVariantValues, FlashCellRef, FlashCells, FlashRows, FlashRowsOptions, Formatters, type GlobalFilter, GroupedBodyRow, GroupedBodyRowProps, InlineCode, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, type JoinOperator, type JoinOperatorValues, Labels, Line, LineChart, LineChartCard, LocalTime, LocalTimeProps, NavMain, NavProjects, NavUser, type Option, PageSection, PageSectionProps, PageSubheading, Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, PriceChart, PriceChartProps, Progress, ProgressIndicator, ProgressLabel, ProgressTrack, ProgressValue, type QueryKeys, ReferenceLine, RowMenuGroup, RowMenuItem, RowMenuLabel, RowMenuSeparator, RowMenuSub, RowMenuSubContent, RowMenuSubTrigger, ScrollAlign, ScrollArea, ScrollBar, type ScrollEvent, ScrollRowIntoView, SectionCard, SectionCards, SectionCardsProps, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, SeriesChartProps, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, SiyahiLocale, SiyahiProvider, SiyahiProviderProps, Skeleton, Slider, StatusActivity, StatusColorConfig, StatusHeatmap, StatusHeatmapBlock, StatusHeatmapBlockProps, StatusHeatmapBody, StatusHeatmapBodyProps, StatusHeatmapFooter, StatusHeatmapFooterProps, StatusHeatmapLabels, StatusHeatmapLegend, StatusHeatmapLegendProps, StatusHeatmapProps, StatusHeatmapStat, StatusHeatmapStatProps, StatusValue, Table, TableBody, TableCaption, TableCell, TableColumnActions, TableColumnActionsProps, TableColumnSortMenu, TableColumnSortOptions, TableColumnTitle, TableFacetedFilter, TableFacetedFilterContent, TableFacetedFilterProps, TableFooter, TableHead, TableHeader, TableRow, TableSearchFilter, TableSearchFilterProps, Tabs, TabsContent, TabsList, TabsTrigger, TeamSwitcher, Textarea, TimeOptions, Toggle, ToggleGroup, ToggleGroupItem, ToneProgress, ToneProgressProps, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, Treemap, TreemapItem, TreemapLegend, TreemapLegendProps, TreemapProps, type ValueOf, type ColorConfig$1 as WeekdayColorConfig, type WeekdayExtraColumnSpec, type WeekdayExtraRowSpec, WeekdayHeatmap, WeekdayHeatmapBlock, type WeekdayHeatmapBlockProps, WeekdayHeatmapBody, type WeekdayHeatmapBodyProps, WeekdayHeatmapFooter, type WeekdayHeatmapFooterProps, type WeekdayHeatmapLabels, WeekdayHeatmapLegend, type WeekdayHeatmapLegendProps, type WeekdayHeatmapProps, WeekdayHeatmapStat, type WeekdayHeatmapStatProps, type WeekdayHour, type WeekdayHourlyActivity, type WeekdayIndex, XAxis, YAxis, badgeVariants, buttonVariants, count, defaultLocale, flashCellKey, money, moneyCompact, pct, resolveGroupedRowsSlot, resolveRowContextMenuRenderer, tabsListVariants, time, toggleVariants, useColumnHeaderContext, useColumnResizeInfo, useDataTable, useDataTableActiveCell, useDataTableActiveCellSetter, useDataTableGroupRow, useDataTableRow, useFormat, useLocale, useResolvedRowContextMenuRenderer, useSidebar, useTableFacetedFilter };
|
package/dist/index.js
CHANGED
|
@@ -7,6 +7,7 @@ import { Button, buttonVariants } from "./components/ui/button.js";
|
|
|
7
7
|
import { Calendar, CalendarDayButton } from "./components/ui/calendar.js";
|
|
8
8
|
import { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "./components/ui/card.js";
|
|
9
9
|
import { ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent } from "./components/ui/chart.js";
|
|
10
|
+
import { CodeBlock, CodeBlockActions, CodeBlockContent, CodeBlockCopyButton, CodeBlockFooter, CodeBlockHeader, CodeBlockLine, CodeBlockTitle } from "./components/ui/code-block.js";
|
|
10
11
|
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "./components/ui/collapsible.js";
|
|
11
12
|
import { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger } from "./components/ui/dialog.js";
|
|
12
13
|
import { Input } from "./components/ui/input.js";
|
|
@@ -35,7 +36,7 @@ import { AreaChartCard } from "./components/registry/charts/area-chart-card.js";
|
|
|
35
36
|
import { BarChartCard } from "./components/registry/charts/bar-chart-card.js";
|
|
36
37
|
import { LineChartCard } from "./components/registry/charts/line-chart-card.js";
|
|
37
38
|
import { SectionCards } from "./components/registry/dashboard-01/section-cards.js";
|
|
38
|
-
import { money, moneyCompact, pct, time, useFormat } from "./lib/format.js";
|
|
39
|
+
import { count, money, moneyCompact, pct, time, useFormat } from "./lib/format.js";
|
|
39
40
|
import { BarList } from "./components/registry/dashboardcn/bar-list.js";
|
|
40
41
|
import { CalendarHeatmap, CalendarHeatmapBlock, CalendarHeatmapBody, CalendarHeatmapFooter, CalendarHeatmapLegend, CalendarHeatmapStat } from "./components/registry/heatmap/calendar-heatmap.js";
|
|
41
42
|
import { StatusHeatmap, StatusHeatmapBlock, StatusHeatmapBody, StatusHeatmapFooter, StatusHeatmapLegend, StatusHeatmapStat } from "./components/registry/heatmap/status-heatmap.js";
|
|
@@ -56,6 +57,8 @@ import { DataTableGroupRowProvider, DataTableGroupedRows, resolveGroupedRowsSlot
|
|
|
56
57
|
import { DataTableRowContextMenuSlot, resolveRowContextMenuRenderer, useResolvedRowContextMenuRenderer } from "./components/registry/niko-table/components/data-table-row-context-menu-slot.js";
|
|
57
58
|
import { DataTableRowMenuScope, RowMenuGroup, RowMenuItem, RowMenuLabel, RowMenuSeparator, RowMenuSub, RowMenuSubContent, RowMenuSubTrigger, useDataTableRow } from "./components/registry/niko-table/components/data-table-row-menu.js";
|
|
58
59
|
import { DataTableRowContextMenu } from "./components/registry/niko-table/components/data-table-row-context-menu.js";
|
|
60
|
+
import { TableSearchFilter } from "./components/registry/niko-table/filters/table-search-filter.js";
|
|
61
|
+
import { DataTableSearchFilter } from "./components/registry/niko-table/components/data-table-search-filter.js";
|
|
59
62
|
import { DataTableToolbarSection } from "./components/registry/niko-table/components/data-table-toolbar-section.js";
|
|
60
63
|
import { DataTableErrorBoundary } from "./components/registry/niko-table/core/data-table-error-boundary.js";
|
|
61
64
|
import { DataTableGroupedRowCells, GroupedBodyRow } from "./components/registry/niko-table/core/data-table-grouped-row.js";
|
|
@@ -67,9 +70,15 @@ import { NavProjects } from "./components/registry/sidebar-07/nav-projects.js";
|
|
|
67
70
|
import { NavUser } from "./components/registry/sidebar-07/nav-user.js";
|
|
68
71
|
import { TeamSwitcher } from "./components/registry/sidebar-07/team-switcher.js";
|
|
69
72
|
import { AppSidebar } from "./components/registry/sidebar-07/app-sidebar.js";
|
|
73
|
+
import { DataList, DataListItem } from "./components/siyahi/data-list.js";
|
|
74
|
+
import { DataTableRowCount } from "./components/siyahi/data-table-row-count.js";
|
|
75
|
+
import { DataTableSortHeader } from "./components/siyahi/data-table-sort-header.js";
|
|
70
76
|
import { Delta } from "./components/siyahi/delta.js";
|
|
77
|
+
import { InlineCode } from "./components/siyahi/inline-code.js";
|
|
71
78
|
import { LocalTime } from "./components/siyahi/local-time.js";
|
|
79
|
+
import { PageSection, PageSubheading } from "./components/siyahi/page-section.js";
|
|
72
80
|
import { PriceChart } from "./components/siyahi/price-chart.js";
|
|
73
|
-
import {
|
|
81
|
+
import { ToneProgress } from "./components/siyahi/tone-progress.js";
|
|
82
|
+
import { Treemap, TreemapLegend } from "./components/siyahi/treemap.js";
|
|
74
83
|
import { Area, AreaChart, Bar, BarChart, CartesianGrid, Line, LineChart, ReferenceLine, XAxis, YAxis } from "./lib/recharts.js";
|
|
75
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertAction, AlertDescription, AlertTitle, AppSidebar, Area, AreaChart, AreaChartCard, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge, Bar, BarChart, BarChartCard, BarList, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Calendar, CalendarDayButton, CalendarHeatmap, CalendarHeatmapBlock, CalendarHeatmapBody, CalendarHeatmapFooter, CalendarHeatmapLegend, CalendarHeatmapStat, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CartesianGrid, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, Collapsible, CollapsibleContent, CollapsibleTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, DataTable, DataTableActions, DataTableBody, DataTableColumnActions, DataTableColumnFilter, DataTableColumnHeader, DataTableColumnHeaderRoot, DataTableColumnSortMenu, DataTableColumnSortOptions, DataTableColumnTitle, DataTableContext, DataTableEmptyActions, DataTableEmptyBody, DataTableEmptyDescription, DataTableEmptyFilteredMessage, DataTableEmptyIcon, DataTableEmptyMessage, DataTableEmptyState, DataTableEmptyTitle, DataTableErrorBoundary, DataTableFacetedFilter, DataTableFacetedFilterContent, DataTableGroupRowProvider, DataTableGroupedRowCells, DataTableGroupedRows, DataTableHeader, DataTableLoading, DataTableLoadingMore, DataTableProvider, DataTableRoot, DataTableRowContextMenu, DataTableRowContextMenuSlot, DataTableRowMenuScope, DataTableSkeleton, DataTableToolbarSection, Delta, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, GroupedBodyRow, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, Line, LineChart, LineChartCard, LocalTime, NavMain, NavProjects, NavUser, Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, PriceChart, Progress, ProgressIndicator, ProgressLabel, ProgressTrack, ProgressValue, ReferenceLine, RowMenuGroup, RowMenuItem, RowMenuLabel, RowMenuSeparator, RowMenuSub, RowMenuSubContent, RowMenuSubTrigger, ScrollArea, ScrollBar, SectionCards, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, SiyahiProvider, Skeleton, Slider, StatusHeatmap, StatusHeatmapBlock, StatusHeatmapBody, StatusHeatmapFooter, StatusHeatmapLegend, StatusHeatmapStat, Table, TableBody, TableCaption, TableCell, TableColumnActions, TableColumnSortMenu, TableColumnSortOptions, TableColumnTitle, TableFacetedFilter, TableFacetedFilterContent, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, TeamSwitcher, Textarea, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, Treemap, WeekdayHeatmap, WeekdayHeatmapBlock, WeekdayHeatmapBody, WeekdayHeatmapFooter, WeekdayHeatmapLegend, WeekdayHeatmapStat, XAxis, YAxis, badgeVariants, buttonVariants, defaultLocale, flashCellKey, money, moneyCompact, pct, resolveGroupedRowsSlot, resolveRowContextMenuRenderer, tabsListVariants, time, toggleVariants, useColumnHeaderContext, useColumnResizeInfo, useDataTable, useDataTableActiveCell, useDataTableActiveCellSetter, useDataTableGroupRow, useDataTableRow, useFormat, useLocale, useResolvedRowContextMenuRenderer, useSidebar, useTableFacetedFilter };
|
|
84
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertAction, AlertDescription, AlertTitle, AppSidebar, Area, AreaChart, AreaChartCard, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge, Bar, BarChart, BarChartCard, BarList, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Calendar, CalendarDayButton, CalendarHeatmap, CalendarHeatmapBlock, CalendarHeatmapBody, CalendarHeatmapFooter, CalendarHeatmapLegend, CalendarHeatmapStat, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CartesianGrid, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, CodeBlock, CodeBlockActions, CodeBlockContent, CodeBlockCopyButton, CodeBlockFooter, CodeBlockHeader, CodeBlockLine, CodeBlockTitle, Collapsible, CollapsibleContent, CollapsibleTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, DataList, DataListItem, DataTable, DataTableActions, DataTableBody, DataTableColumnActions, DataTableColumnFilter, DataTableColumnHeader, DataTableColumnHeaderRoot, DataTableColumnSortMenu, DataTableColumnSortOptions, DataTableColumnTitle, DataTableContext, DataTableEmptyActions, DataTableEmptyBody, DataTableEmptyDescription, DataTableEmptyFilteredMessage, DataTableEmptyIcon, DataTableEmptyMessage, DataTableEmptyState, DataTableEmptyTitle, DataTableErrorBoundary, DataTableFacetedFilter, DataTableFacetedFilterContent, DataTableGroupRowProvider, DataTableGroupedRowCells, DataTableGroupedRows, DataTableHeader, DataTableLoading, DataTableLoadingMore, DataTableProvider, DataTableRoot, DataTableRowContextMenu, DataTableRowContextMenuSlot, DataTableRowCount, DataTableRowMenuScope, DataTableSearchFilter, DataTableSkeleton, DataTableSortHeader, DataTableToolbarSection, Delta, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, GroupedBodyRow, InlineCode, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, Line, LineChart, LineChartCard, LocalTime, NavMain, NavProjects, NavUser, PageSection, PageSubheading, Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, PriceChart, Progress, ProgressIndicator, ProgressLabel, ProgressTrack, ProgressValue, ReferenceLine, RowMenuGroup, RowMenuItem, RowMenuLabel, RowMenuSeparator, RowMenuSub, RowMenuSubContent, RowMenuSubTrigger, ScrollArea, ScrollBar, SectionCards, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, SiyahiProvider, Skeleton, Slider, StatusHeatmap, StatusHeatmapBlock, StatusHeatmapBody, StatusHeatmapFooter, StatusHeatmapLegend, StatusHeatmapStat, Table, TableBody, TableCaption, TableCell, TableColumnActions, TableColumnSortMenu, TableColumnSortOptions, TableColumnTitle, TableFacetedFilter, TableFacetedFilterContent, TableFooter, TableHead, TableHeader, TableRow, TableSearchFilter, Tabs, TabsContent, TabsList, TabsTrigger, TeamSwitcher, Textarea, Toggle, ToggleGroup, ToggleGroupItem, ToneProgress, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, Treemap, TreemapLegend, WeekdayHeatmap, WeekdayHeatmapBlock, WeekdayHeatmapBody, WeekdayHeatmapFooter, WeekdayHeatmapLegend, WeekdayHeatmapStat, XAxis, YAxis, badgeVariants, buttonVariants, count, defaultLocale, flashCellKey, money, moneyCompact, pct, resolveGroupedRowsSlot, resolveRowContextMenuRenderer, tabsListVariants, time, toggleVariants, useColumnHeaderContext, useColumnResizeInfo, useDataTable, useDataTableActiveCell, useDataTableActiveCellSetter, useDataTableGroupRow, useDataTableRow, useFormat, useLocale, useResolvedRowContextMenuRenderer, useSidebar, useTableFacetedFilter };
|
package/dist/lib/format.d.ts
CHANGED
|
@@ -9,6 +9,8 @@ export declare function money(value: number, locale?: SiyahiLocale, fractionDigi
|
|
|
9
9
|
* `Delta`, which adds the arrow.
|
|
10
10
|
*/
|
|
11
11
|
export declare function moneyCompact(value: number, locale?: SiyahiLocale): string;
|
|
12
|
+
/** A whole count with the locale's grouping: 1,53,110 in en-IN. */
|
|
13
|
+
export declare function count(value: number, locale?: SiyahiLocale): string;
|
|
12
14
|
/** A fraction as a percentage: 0.1234 is 12.3%. */
|
|
13
15
|
export declare function pct(value: number, locale?: SiyahiLocale, fractionDigits?: number): string;
|
|
14
16
|
export interface TimeOptions {
|
|
@@ -18,6 +20,7 @@ export interface TimeOptions {
|
|
|
18
20
|
/** A 24-hour time in the locale's zone, with the zone written: 14:30 IST. */
|
|
19
21
|
export declare function time(value: Date | number | string, locale?: SiyahiLocale, { withDate }?: TimeOptions): string;
|
|
20
22
|
export interface Formatters {
|
|
23
|
+
count: (value: number) => string;
|
|
21
24
|
money: (value: number, fractionDigits?: number) => string;
|
|
22
25
|
moneyCompact: (value: number) => string;
|
|
23
26
|
pct: (value: number, fractionDigits?: number) => string;
|
package/dist/lib/format.js
CHANGED
|
@@ -26,6 +26,10 @@ function moneyCompact(value, locale = defaultLocale) {
|
|
|
26
26
|
maximumFractionDigits: 1
|
|
27
27
|
}).format(value);
|
|
28
28
|
}
|
|
29
|
+
/** A whole count with the locale's grouping: 1,53,110 in en-IN. */
|
|
30
|
+
function count(value, locale = defaultLocale) {
|
|
31
|
+
return new Intl.NumberFormat(locale.numberLocale, { maximumFractionDigits: 0 }).format(value);
|
|
32
|
+
}
|
|
29
33
|
/** A fraction as a percentage: 0.1234 is 12.3%. */
|
|
30
34
|
function pct(value, locale = defaultLocale, fractionDigits = 1) {
|
|
31
35
|
return new Intl.NumberFormat(locale.numberLocale, {
|
|
@@ -54,6 +58,7 @@ function time(value, locale = defaultLocale, { withDate = false } = {}) {
|
|
|
54
58
|
function useFormat() {
|
|
55
59
|
const locale = useLocale();
|
|
56
60
|
return useMemo(() => ({
|
|
61
|
+
count: (value) => count(value, locale),
|
|
57
62
|
money: (value, fractionDigits) => money(value, locale, fractionDigits),
|
|
58
63
|
moneyCompact: (value) => moneyCompact(value, locale),
|
|
59
64
|
pct: (value, fractionDigits) => pct(value, locale, fractionDigits),
|
|
@@ -61,4 +66,4 @@ function useFormat() {
|
|
|
61
66
|
}), [locale]);
|
|
62
67
|
}
|
|
63
68
|
//#endregion
|
|
64
|
-
export { money, moneyCompact, pct, time, useFormat };
|
|
69
|
+
export { count, money, moneyCompact, pct, time, useFormat };
|
package/dist/lib/treemap.d.ts
CHANGED
|
@@ -18,6 +18,10 @@ export declare function layout<T extends {
|
|
|
18
18
|
weight: number;
|
|
19
19
|
group?: string;
|
|
20
20
|
}>(items: T[], width: number, height: number): Layout<T>;
|
|
21
|
+
export declare const HEAT_STEPS = 5;
|
|
22
|
+
/** The range the heat scale uses: one that is not a positive number falls back to ±5%. */
|
|
23
|
+
export declare const heatRange: (range?: number) => number;
|
|
24
|
+
export declare const heatFill: (side: "positive" | "negative", step: number) => string;
|
|
21
25
|
export declare function heat(change: number | null, range?: number): string;
|
|
22
26
|
//#endregion
|
|
23
27
|
export {};
|
package/dist/lib/treemap.js
CHANGED
|
@@ -31,10 +31,15 @@ function layout(items, width, height) {
|
|
|
31
31
|
}])
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
|
-
|
|
34
|
+
const DEFAULT_RANGE = .05;
|
|
35
|
+
const HEAT_STEPS = 5;
|
|
36
|
+
/** The range the heat scale uses: one that is not a positive number falls back to ±5%. */
|
|
37
|
+
const heatRange = (range = DEFAULT_RANGE) => Number.isFinite(range) && range > 0 ? range : DEFAULT_RANGE;
|
|
38
|
+
const heatFill = (side, step) => `color-mix(in oklab, var(--${side}) ${step * 12}%, var(--card))`;
|
|
39
|
+
function heat(change, range) {
|
|
35
40
|
if (!change) return "var(--muted)";
|
|
36
|
-
const
|
|
37
|
-
return
|
|
41
|
+
const step = Math.min(5, Math.ceil(Math.abs(change) / heatRange(range) * 5));
|
|
42
|
+
return heatFill(change > 0 ? "positive" : "negative", step);
|
|
38
43
|
}
|
|
39
44
|
//#endregion
|
|
40
|
-
export { heat, layout };
|
|
45
|
+
export { HEAT_STEPS, heat, heatFill, heatRange, layout };
|
package/package.json
CHANGED
package/registry.lock.json
CHANGED
|
@@ -153,6 +153,14 @@
|
|
|
153
153
|
"copied": "2026-10-20",
|
|
154
154
|
"sha256": "8b0c9768a5f1b90d7b4e2bf467a32ca86a43d5d546653f3a64d7abea277aa68b"
|
|
155
155
|
},
|
|
156
|
+
{
|
|
157
|
+
"file": "src/components/registry/niko-table/components/data-table-search-filter.tsx",
|
|
158
|
+
"registry": "@niko-table/data-table-search-filter",
|
|
159
|
+
"origin": "https://niko-table.com/r/data-table-search-filter.json",
|
|
160
|
+
"licence": "MIT, Copyright (c) 2025 Semir N., original work (c) 2025 WebDevSimplified, https://github.com/Semkoo/niko-table-registry/blob/main/LICENSE",
|
|
161
|
+
"copied": "2026-10-22",
|
|
162
|
+
"sha256": "5aeb91ef34ff0dd87a92f1ad7ebd4500e8733b8ae30ecf836eae78304a10fad0"
|
|
163
|
+
},
|
|
156
164
|
{
|
|
157
165
|
"file": "src/components/registry/niko-table/components/data-table-toolbar-section.tsx",
|
|
158
166
|
"registry": "@niko-table/data-table",
|
|
@@ -257,6 +265,14 @@
|
|
|
257
265
|
"copied": "2026-10-20",
|
|
258
266
|
"sha256": "dba551593726fa342b8c61daf5e5b9c79125df391af8ed31504e7dfedf7a71ba"
|
|
259
267
|
},
|
|
268
|
+
{
|
|
269
|
+
"file": "src/components/registry/niko-table/filters/table-search-filter.tsx",
|
|
270
|
+
"registry": "@niko-table/data-table-search-filter",
|
|
271
|
+
"origin": "https://niko-table.com/r/data-table-search-filter.json",
|
|
272
|
+
"licence": "MIT, Copyright (c) 2025 Semir N., original work (c) 2025 WebDevSimplified, https://github.com/Semkoo/niko-table-registry/blob/main/LICENSE",
|
|
273
|
+
"copied": "2026-10-22",
|
|
274
|
+
"sha256": "c672763c02894a579f6cc7cddbe5fc17149b1eef484f992b9a35441b4e3b1c42"
|
|
275
|
+
},
|
|
260
276
|
{
|
|
261
277
|
"file": "src/components/registry/niko-table/hooks/use-derived-column-title.ts",
|
|
262
278
|
"registry": "@niko-table/data-table",
|