@orfium/ictinus 5.43.5 → 5.43.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +17 -17
- package/CHANGELOG.md +6 -0
- package/dist/package.json.d.ts +1 -1
- package/dist/package.json.js +1 -1
- package/dist/sprinkles/properties.css.js +1 -1
- package/dist/sprinkles/properties.css.ts.vanilla.css +1 -1
- package/dist/src/actions/ActionsContent.d.ts +65 -64
- package/dist/src/actions/ActionsRoot.d.ts +65 -64
- package/dist/src/data-table/DataTable.d.ts +65 -64
- package/dist/src/data-table/DataTableBody.d.ts +67 -64
- package/dist/src/data-table/DataTableCounter.d.ts +2 -1
- package/dist/src/data-table/DataTableHeader.d.ts +65 -64
- package/dist/src/data-table/DataTableRow.d.ts +135 -133
- package/dist/src/data-table/DataTableRowContext.d.ts +28 -5
- package/dist/src/skeleton/Skeleton.css.d.ts +5 -0
- package/dist/src/skeleton/Skeleton.d.ts +427 -0
- package/dist/src/skeleton/index.d.ts +1 -0
- package/dist/src/sprinkles/properties.css.d.ts +280 -0
- package/dist/src/sprinkles/sprinkles.d.ts +597 -56
- package/dist/src/vanilla/Box/Box.d.ts +65 -64
- package/dist/src/vanilla/Box/extractBoxProps.d.ts +2 -2
- package/dist/src/vanilla/Table/Table.d.ts +65 -64
- package/dist/src/vanilla/Table/TableBody.d.ts +65 -64
- package/dist/src/vanilla/Table/TableCell.d.ts +65 -64
- package/dist/src/vanilla/Table/TableFooter.d.ts +65 -64
- package/dist/src/vanilla/Table/TableHeader.d.ts +65 -64
- package/dist/src/vanilla/Table/TableHeaderCell.d.ts +65 -64
- package/dist/src/vanilla/Table/TableRow.d.ts +65 -64
- package/dist/src/vanilla/Text/Text.d.ts +65 -64
- package/dist/src/vanilla/index.d.ts +2 -0
- package/dist/vanilla/Dropdown/Dropdown-css.js +2 -2
- package/dist/vanilla/Menu/Menu-css.js +3 -3
- package/dist/vanilla/Popover/Popover-css.js +2 -2
- package/dist/vanilla/Table/Table-css.js +3 -3
- package/dist/vanilla/Table/TableCell-css.js +3 -3
- package/dist/vanilla/Table/TableHeaderCell-css.js +3 -3
- package/dist/vanilla/Table/TableRow-css.js +2 -2
- package/dist/vanilla/Tooltip/Tooltip-css.js +2 -2
- package/dist/vanilla/assets/src/skeleton/Skeleton.css.ts.vanilla-CNzX69JK.css +6 -0
- package/dist/vanilla/assets/src/sprinkles/{properties.css.ts.vanilla-C8hqLKur.css → properties.css.ts.vanilla-CRlOneec.css} +3613 -3233
- package/dist/vanilla/index.d.ts +1296 -852
- package/dist/vanilla/index.js +2 -0
- package/dist/vanilla/package.json.js +1 -1
- package/dist/vanilla/src/actions/ActionsContent-css.js +2 -2
- package/dist/vanilla/src/data-table/DataTableBody-css.js +3 -3
- package/dist/vanilla/src/data-table/DataTableBody.js +26 -4
- package/dist/vanilla/src/data-table/DataTableCounter.js +5 -3
- package/dist/vanilla/src/data-table/DataTableHeaderCell-css.js +3 -3
- package/dist/vanilla/src/data-table/DataTableRowContext.js +29 -2
- package/dist/vanilla/src/skeleton/Skeleton-css.js +9 -0
- package/dist/vanilla/src/skeleton/Skeleton.js +26 -0
- package/dist/vanilla/src/sprinkles/properties-css.js +4 -4
- package/package.json +1 -1
- package/src/components/Controls/CheckBox/__snapshots__/CheckBox.test.tsx.snap +1 -1
- package/src/components/DatePicker/OverlayComponent/__snapshots__/OverlayComponent.test.tsx.snap +4 -4
- package/src/components/DatePicker/OverlayComponent/components/MonthWrapper/__snapshots__/MonthWrapper.test.tsx.snap +2 -2
- package/src/components/TopAppBar/__snapshots__/TopAppBar.test.tsx.snap +2 -2
- package/src/data-table/DataTableBody.tsx +46 -15
- package/src/data-table/DataTableCounter.tsx +13 -4
- package/src/data-table/DataTableRow.tsx +4 -5
- package/src/data-table/DataTableRowContext.tsx +33 -4
- package/src/skeleton/Skeleton.css.ts +19 -0
- package/src/skeleton/Skeleton.tsx +34 -0
- package/src/skeleton/index.ts +1 -0
- package/src/sprinkles/properties.css.ts +87 -6
- package/src/vanilla/index.ts +2 -0
package/dist/vanilla/index.js
CHANGED
|
@@ -150,6 +150,8 @@ export { WarningIcon } from './src/icons/WarningIcon.js';
|
|
|
150
150
|
export { WorkIcon } from './src/icons/WorkIcon.js';
|
|
151
151
|
export { WriterIcon } from './src/icons/WriterIcon.js';
|
|
152
152
|
export { YouTubeIcon } from './src/icons/YouTubeIcon.js';
|
|
153
|
+
export { Skeleton } from './src/skeleton/Skeleton.js';
|
|
154
|
+
export { cn } from './src/utils/cn.js';
|
|
153
155
|
export { Box } from './Box/Box.js';
|
|
154
156
|
export { extractBoxProps } from './Box/extractBoxProps.js';
|
|
155
157
|
export { Dialog, DialogBody, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger } from './Dialog/Dialog.js';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import './../../assets/src/layers/layers.css.ts.vanilla-CBkaYCBT.css';
|
|
2
2
|
import './../../assets/src/vanilla-extract/global.css.ts.vanilla-BHTgxO8_.css';
|
|
3
|
-
import './../../assets/src/sprinkles/properties.css.ts.vanilla-
|
|
3
|
+
import './../../assets/src/sprinkles/properties.css.ts.vanilla-CRlOneec.css';
|
|
4
4
|
import './../../assets/src/actions/ActionsRoot.css.ts.vanilla-B5JvX1-v.css';
|
|
5
5
|
import './../../assets/src/actions/ActionsContent.css.ts.vanilla-BVxWvGVF.css';
|
|
6
6
|
import { createRuntimeFn } from '@vanilla-extract/recipes/createRuntimeFn';
|
|
7
7
|
|
|
8
|
-
var content = createRuntimeFn({defaultClassName:'
|
|
8
|
+
var content = createRuntimeFn({defaultClassName:'_146hxcf6 _146hxcf2i _146hxcf1m gfg8xi0',variantClassNames:{visible:{always:'gfg8xi1','if-needed':'gfg8xi2'}},defaultVariants:{},compoundVariants:[]});
|
|
9
9
|
|
|
10
10
|
export { content };
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import './../../assets/src/layers/layers.css.ts.vanilla-CBkaYCBT.css';
|
|
2
2
|
import './../../assets/src/vanilla-extract/global.css.ts.vanilla-BHTgxO8_.css';
|
|
3
|
-
import './../../assets/src/sprinkles/properties.css.ts.vanilla-
|
|
3
|
+
import './../../assets/src/sprinkles/properties.css.ts.vanilla-CRlOneec.css';
|
|
4
4
|
import './../../assets/src/vanilla/Table/TableRow.css.ts.vanilla-B1NNK8v8.css';
|
|
5
5
|
import './../../assets/src/data-table/DataTableBody.css.ts.vanilla-B8JRxzQ8.css';
|
|
6
6
|
import { createRuntimeFn } from '@vanilla-extract/recipes/createRuntimeFn';
|
|
7
7
|
|
|
8
|
-
var cell = createRuntimeFn({defaultClassName:'
|
|
8
|
+
var cell = createRuntimeFn({defaultClassName:'_146hxcf1py _146hxcf2 _146hxcf2i nl338i8',variantClassNames:{pinned:{left:'nl338i9',right:'nl338ia'},resizable:{false:'nl338ib',true:'nl338ic'}},defaultVariants:{},compoundVariants:[]});
|
|
9
9
|
var cellOffsetVar = 'var(--nl338i1)';
|
|
10
10
|
var cellSizeVar = 'var(--nl338i0)';
|
|
11
11
|
var leftTotalSizeVar = 'var(--nl338i2)';
|
|
12
12
|
var rightTotalSizeVar = 'var(--nl338i3)';
|
|
13
|
-
var root = createRuntimeFn({defaultClassName:'
|
|
13
|
+
var root = createRuntimeFn({defaultClassName:'_146hxcf1n5 _146hxcf1n8 _146hxcf1ls _146hxcfjq _146hxcf2i _146hxcfnu nl338i6',variantClassNames:{},defaultVariants:{},compoundVariants:[]});
|
|
14
14
|
var totalSizeVar = 'var(--nl338i4)';
|
|
15
15
|
|
|
16
16
|
export { cell, cellOffsetVar, cellSizeVar, leftTotalSizeVar, rightTotalSizeVar, root, totalSizeVar };
|
|
@@ -2,7 +2,7 @@ import { jsx, jsxs } from '@emotion/react/jsx-runtime';
|
|
|
2
2
|
import { flexRender } from '@tanstack/react-table';
|
|
3
3
|
import { useVirtualizer } from '@tanstack/react-virtual';
|
|
4
4
|
import { assignInlineVars } from '@vanilla-extract/dynamic';
|
|
5
|
-
import { forwardRef, useRef, useEffect } from 'react';
|
|
5
|
+
import { forwardRef, useMemo, useRef, useEffect } from 'react';
|
|
6
6
|
import { useDOMRef } from '../components/utils/useDOMRef.js';
|
|
7
7
|
import { cn } from '../utils/cn.js';
|
|
8
8
|
import { Box } from '../../Box/Box.js';
|
|
@@ -17,8 +17,12 @@ import { TableRow } from '../../Table/TableRow.js';
|
|
|
17
17
|
import { useDataTableContext } from './DataTableContext.js';
|
|
18
18
|
import { DataTableHeaderCell } from './DataTableHeaderCell.js';
|
|
19
19
|
import { DataTableRow } from './DataTableRow.js';
|
|
20
|
+
import { fakeRow } from './DataTableRowContext.js';
|
|
20
21
|
import { cell, cellSizeVar, cellOffsetVar, root, totalSizeVar, rightTotalSizeVar, leftTotalSizeVar } from './DataTableBody-css.js';
|
|
21
22
|
|
|
23
|
+
function isTableRow(row) {
|
|
24
|
+
return "original" in row;
|
|
25
|
+
}
|
|
22
26
|
const COL_VIRTUALIZATION_THRESHOLD = 25;
|
|
23
27
|
const ROW_VIRTUALIZATION_THRESHOLD = 25;
|
|
24
28
|
const DataTableBody = forwardRef(
|
|
@@ -27,12 +31,27 @@ const DataTableBody = forwardRef(
|
|
|
27
31
|
estimatedRowHeight = 44,
|
|
28
32
|
bordered = false,
|
|
29
33
|
size = "sm",
|
|
34
|
+
loading,
|
|
30
35
|
style,
|
|
31
36
|
...props
|
|
32
37
|
}, ref) => {
|
|
33
38
|
const domRef = useDOMRef(ref);
|
|
34
39
|
const { table } = useDataTableContext();
|
|
35
|
-
const rows = table.getRowModel()
|
|
40
|
+
const { rows: rawRows } = table.getRowModel();
|
|
41
|
+
const rows = useMemo(() => {
|
|
42
|
+
let index = 0;
|
|
43
|
+
return rawRows.reduce(
|
|
44
|
+
(result, row) => {
|
|
45
|
+
result.push(row);
|
|
46
|
+
index++;
|
|
47
|
+
if (loading && typeof loading === "object" && loading[row.id] === "sub-rows") {
|
|
48
|
+
result.push(fakeRow(table, index++), fakeRow(table, index++));
|
|
49
|
+
}
|
|
50
|
+
return result;
|
|
51
|
+
},
|
|
52
|
+
[]
|
|
53
|
+
);
|
|
54
|
+
}, [loading, rawRows, table]);
|
|
36
55
|
const previousRowsRef = useRef(rows);
|
|
37
56
|
useEffect(() => {
|
|
38
57
|
previousRowsRef.current = rows;
|
|
@@ -128,14 +147,17 @@ const DataTableBody = forwardRef(
|
|
|
128
147
|
{
|
|
129
148
|
display: "grid",
|
|
130
149
|
style: rowVirtualizer.options.enabled ? { height: `${rowVirtualizer.getTotalSize()}px` } : void 0,
|
|
131
|
-
children: (
|
|
150
|
+
children: (loading === true ? Array.from({ length: 10 }, (__, rowIndex) => ({
|
|
151
|
+
row: fakeRow(table, rowIndex),
|
|
152
|
+
virtualRow: void 0
|
|
153
|
+
})) : rowVirtualizer.options.enabled ? virtualRows.length === 0 && rows.length > 0 ? previousRowsRef.current.map((row) => ({
|
|
132
154
|
row,
|
|
133
155
|
virtualRow: void 0
|
|
134
156
|
})) : virtualRows.map((virtualRow) => ({
|
|
135
157
|
row: rows[virtualRow.index],
|
|
136
158
|
virtualRow
|
|
137
159
|
})) : rows.map((row) => ({ row, virtualRow: void 0 }))).map(({ row, virtualRow }, index) => {
|
|
138
|
-
const cellProps = table.options.meta?.getCellProps?.(row);
|
|
160
|
+
const cellProps = isTableRow(row) ? table.options.meta?.getCellProps?.(row) : void 0;
|
|
139
161
|
return /* @__PURE__ */ jsxs(
|
|
140
162
|
DataTableRow,
|
|
141
163
|
{
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { jsxs,
|
|
1
|
+
import { jsx, jsxs, Fragment } from '@emotion/react/jsx-runtime';
|
|
2
|
+
import { Skeleton } from '../skeleton/Skeleton.js';
|
|
2
3
|
import { Box } from '../../Box/Box.js';
|
|
3
4
|
import '../sprinkles/sprinkles.js';
|
|
4
5
|
import { Text } from '../../Text/Text.js';
|
|
@@ -6,6 +7,7 @@ import { useDataTableContext } from './DataTableContext.js';
|
|
|
6
7
|
|
|
7
8
|
function DataTableCounter({
|
|
8
9
|
count: countProp,
|
|
10
|
+
loading = false,
|
|
9
11
|
singular = "item",
|
|
10
12
|
plural = "items",
|
|
11
13
|
...props
|
|
@@ -16,10 +18,10 @@ function DataTableCounter({
|
|
|
16
18
|
const hasSelection = selectedCount > 0;
|
|
17
19
|
const count = hasSelection ? selectedCount : totalCount;
|
|
18
20
|
const label = count === 1 ? singular : plural;
|
|
19
|
-
return /* @__PURE__ */
|
|
21
|
+
return /* @__PURE__ */ jsx(Box, { display: "flex", alignItems: "center", gap: "sm", ...props, children: loading ? /* @__PURE__ */ jsx(Skeleton, { w: "20" }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
20
22
|
/* @__PURE__ */ jsx(Text, { typography: "label02", color: "active", children: count.toLocaleString() }),
|
|
21
23
|
/* @__PURE__ */ jsx(Text, { typography: "label02", children: hasSelection ? `${label} selected` : label })
|
|
22
|
-
] });
|
|
24
|
+
] }) });
|
|
23
25
|
}
|
|
24
26
|
|
|
25
27
|
export { DataTableCounter };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import './../../assets/src/layers/layers.css.ts.vanilla-CBkaYCBT.css';
|
|
2
2
|
import './../../assets/src/vanilla-extract/global.css.ts.vanilla-BHTgxO8_.css';
|
|
3
|
-
import './../../assets/src/sprinkles/properties.css.ts.vanilla-
|
|
3
|
+
import './../../assets/src/sprinkles/properties.css.ts.vanilla-CRlOneec.css';
|
|
4
4
|
import './../../assets/src/vanilla/Table/TableHeader.css.ts.vanilla-2yw_MsU1.css';
|
|
5
5
|
import './../../assets/src/vanilla/Table/TableRow.css.ts.vanilla-B1NNK8v8.css';
|
|
6
6
|
import './../../assets/src/vanilla/Table/TableHeaderCell.css.ts.vanilla-CZtubUTB.css';
|
|
7
7
|
import './../../assets/src/data-table/DataTableHeaderCell.css.ts.vanilla-B2HJ86a7.css';
|
|
8
8
|
import { createRuntimeFn } from '@vanilla-extract/recipes/createRuntimeFn';
|
|
9
9
|
|
|
10
|
-
var handle = createRuntimeFn({defaultClassName:'
|
|
11
|
-
createRuntimeFn({defaultClassName:'
|
|
10
|
+
var handle = createRuntimeFn({defaultClassName:'_146hxcf9q _146hxcf1zi _16lgdksa',variantClassNames:{resizing:{false:'_16lgdksc',true:'_146hxcf1zu'}},defaultVariants:{},compoundVariants:[]});
|
|
11
|
+
createRuntimeFn({defaultClassName:'_146hxcf8i _146hxcfze _146hxcf11y _16lgdks4',variantClassNames:{active:{false:'_16lgdks5',true:'_16lgdks6'}},defaultVariants:{},compoundVariants:[]});
|
|
12
12
|
var label = createRuntimeFn({defaultClassName:'_16lgdks0',variantClassNames:{sortDir:{false:'_16lgdks2',true:'_16lgdks3'}},defaultVariants:{},compoundVariants:[]});
|
|
13
13
|
|
|
14
14
|
export { handle, label };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { createContext, useContext } from 'react';
|
|
1
|
+
import { createContext, createElement, useContext } from 'react';
|
|
2
|
+
import { Skeleton } from '../skeleton/Skeleton.js';
|
|
2
3
|
|
|
3
4
|
const DataTableRowContext = createContext({
|
|
4
5
|
actions: [],
|
|
@@ -18,5 +19,31 @@ function useDataTableRowContext() {
|
|
|
18
19
|
}
|
|
19
20
|
return context;
|
|
20
21
|
}
|
|
22
|
+
const fakeCellsFactory = (columns, rowIndex) => () => columns.map((column, columnIndex) => ({
|
|
23
|
+
column: {
|
|
24
|
+
...column,
|
|
25
|
+
columnDef: {
|
|
26
|
+
...column.columnDef,
|
|
27
|
+
cell: () => createElement(Skeleton, {
|
|
28
|
+
w: ["1/2", "full", "3/4"][(rowIndex + columnIndex) % 3]
|
|
29
|
+
})
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
getContext: () => ({}),
|
|
33
|
+
id: column.id
|
|
34
|
+
}));
|
|
35
|
+
const fakeRow = (table, rowIndex) => ({
|
|
36
|
+
getCanMultiSelect: () => false,
|
|
37
|
+
getCanSelect: () => false,
|
|
38
|
+
getCenterVisibleCells: fakeCellsFactory(table.getCenterVisibleLeafColumns(), rowIndex),
|
|
39
|
+
getIsSelected: () => false,
|
|
40
|
+
getLeftVisibleCells: fakeCellsFactory(table.getLeftVisibleLeafColumns(), rowIndex),
|
|
41
|
+
getRightVisibleCells: fakeCellsFactory(table.getRightVisibleLeafColumns(), rowIndex),
|
|
42
|
+
getToggleSelectedHandler: () => (__event) => {
|
|
43
|
+
},
|
|
44
|
+
id: "loading" + rowIndex,
|
|
45
|
+
toggleSelected: (__value) => {
|
|
46
|
+
}
|
|
47
|
+
});
|
|
21
48
|
|
|
22
|
-
export { DataTableRowProvider, useDataTableRowContext };
|
|
49
|
+
export { DataTableRowProvider, fakeRow, useDataTableRowContext };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import './../../assets/src/layers/layers.css.ts.vanilla-CBkaYCBT.css';
|
|
2
|
+
import './../../assets/src/vanilla-extract/global.css.ts.vanilla-BHTgxO8_.css';
|
|
3
|
+
import './../../assets/src/sprinkles/properties.css.ts.vanilla-CRlOneec.css';
|
|
4
|
+
import './../../assets/src/skeleton/Skeleton.css.ts.vanilla-CNzX69JK.css';
|
|
5
|
+
import { createRuntimeFn } from '@vanilla-extract/recipes/createRuntimeFn';
|
|
6
|
+
|
|
7
|
+
var skeleton = createRuntimeFn({defaultClassName:'_146hxcf1q2 _146hxcf1p9 _146hxcf26m _146hxcf2e _1dxg85w0',variantClassNames:{},defaultVariants:{},compoundVariants:[]});
|
|
8
|
+
|
|
9
|
+
export { skeleton };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx } from '@emotion/react/jsx-runtime';
|
|
2
|
+
import { createSlot } from '@radix-ui/react-slot';
|
|
3
|
+
import { forwardRef } from 'react';
|
|
4
|
+
import { cn } from '../utils/cn.js';
|
|
5
|
+
import { Box } from '../../Box/Box.js';
|
|
6
|
+
import '../sprinkles/sprinkles.js';
|
|
7
|
+
import { skeleton } from './Skeleton-css.js';
|
|
8
|
+
|
|
9
|
+
const Slot = createSlot("@orfium/ictinus/Skeleton");
|
|
10
|
+
const Skeleton = forwardRef(
|
|
11
|
+
({ asChild = true, children, circle, className, rounded = "2", ...props }, ref) => {
|
|
12
|
+
return /* @__PURE__ */ jsx(
|
|
13
|
+
Box,
|
|
14
|
+
{
|
|
15
|
+
asChild,
|
|
16
|
+
rounded: circle || rounded === "7" ? "7" : rounded,
|
|
17
|
+
className: cn(skeleton({}), className),
|
|
18
|
+
...props,
|
|
19
|
+
children: /* @__PURE__ */ jsx(Slot, { ref, children: children ?? /* @__PURE__ */ jsx("span", {}) })
|
|
20
|
+
}
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
);
|
|
24
|
+
Skeleton.displayName = "Skeleton";
|
|
25
|
+
|
|
26
|
+
export { Skeleton };
|