@tensor_1/tokens 2.43.1 → 2.44.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tensor_1/tokens",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.44.1",
|
|
4
4
|
"description": "UIx v2 design tokens — the --uix-* contract for house products (Tensor, POSx, SHOPx). One DTCG source -> CSS variables, Tailwind theme, and typed TS constants.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": [
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/* DashboardCanvas (TENSOR HAR-1823): a free dashboard layout. Twelve equal columns, rows of one
|
|
2
|
+
fixed height, and every item at its own place and size in grid units, set by the component as
|
|
3
|
+
custom properties on the item:
|
|
4
|
+
--uix-dashboard-canvas-col / -row-start first column / row, 1-based
|
|
5
|
+
--uix-dashboard-canvas-w / -h width in columns / height in rows
|
|
6
|
+
--uix-dashboard-canvas-order its position in reading order (row, then column)
|
|
7
|
+
|
|
8
|
+
Below 36rem of the canvas's own width (a container query, so a canvas beside an open sidebar
|
|
9
|
+
collapses sooner) it is one column in reading order, each item as tall as its rows, and the
|
|
10
|
+
edit handles step aside: the product's item menu is the way to arrange it there.
|
|
11
|
+
|
|
12
|
+
Edit mode (--editing) gives each item a move handle (top right) and a resize handle (bottom
|
|
13
|
+
right corner) and outlines the cells. While a handle is dragged, a dashed preview shows where
|
|
14
|
+
the item will land. */
|
|
15
|
+
@layer uix.components {
|
|
16
|
+
.uix-dashboard-canvas {
|
|
17
|
+
--uix-dashboard-canvas-row: 5rem;
|
|
18
|
+
--dashboard-canvas-gap: var(--uix-space-4);
|
|
19
|
+
container: uix-dashboard-canvas / inline-size;
|
|
20
|
+
position: relative;
|
|
21
|
+
display: grid;
|
|
22
|
+
grid-template-columns: repeat(12, minmax(0, 1fr));
|
|
23
|
+
grid-auto-rows: var(--uix-dashboard-canvas-row);
|
|
24
|
+
/* 11 column gaps sit between the 12 tracks; capping each at 1/12 of the width keeps a very
|
|
25
|
+
narrow canvas from being pushed wider than its box by the gaps alone. */
|
|
26
|
+
column-gap: min(var(--dashboard-canvas-gap), calc(100% / 12));
|
|
27
|
+
row-gap: var(--dashboard-canvas-gap);
|
|
28
|
+
min-width: 0;
|
|
29
|
+
}
|
|
30
|
+
.uix-dashboard-canvas--gap-sm { --dashboard-canvas-gap: var(--uix-space-3); }
|
|
31
|
+
.uix-dashboard-canvas--gap-lg { --dashboard-canvas-gap: var(--uix-space-6); }
|
|
32
|
+
|
|
33
|
+
.uix-dashboard-canvas__item,
|
|
34
|
+
.uix-dashboard-canvas__preview {
|
|
35
|
+
grid-column: var(--uix-dashboard-canvas-col, 1) / span var(--uix-dashboard-canvas-w, 12);
|
|
36
|
+
grid-row: var(--uix-dashboard-canvas-row-start, auto) / span var(--uix-dashboard-canvas-h, 1);
|
|
37
|
+
min-width: 0;
|
|
38
|
+
min-height: 0;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/* The item is the container its content sizes against; its last child takes the spare height. */
|
|
42
|
+
.uix-dashboard-canvas__item {
|
|
43
|
+
container: uix-dashboard-canvas-item / inline-size;
|
|
44
|
+
position: relative;
|
|
45
|
+
display: flex;
|
|
46
|
+
flex-direction: column;
|
|
47
|
+
}
|
|
48
|
+
.uix-dashboard-canvas__item > :not(.uix-dashboard-canvas__handle) { min-height: 0; }
|
|
49
|
+
.uix-dashboard-canvas__item > :not(.uix-dashboard-canvas__handle):last-of-type { flex-grow: 1; }
|
|
50
|
+
|
|
51
|
+
/* ── Edit mode ─────────────────────────────────────────────────────────────── */
|
|
52
|
+
.uix-dashboard-canvas--editing .uix-dashboard-canvas__item {
|
|
53
|
+
outline: 1px dashed var(--uix-border-strong);
|
|
54
|
+
outline-offset: 2px;
|
|
55
|
+
border-radius: var(--uix-radius-md);
|
|
56
|
+
}
|
|
57
|
+
.uix-dashboard-canvas__item--dragging { opacity: 0.5; }
|
|
58
|
+
|
|
59
|
+
.uix-dashboard-canvas__handle {
|
|
60
|
+
position: absolute;
|
|
61
|
+
z-index: var(--uix-z-raised);
|
|
62
|
+
display: inline-grid;
|
|
63
|
+
place-items: center;
|
|
64
|
+
inline-size: var(--uix-space-6);
|
|
65
|
+
block-size: var(--uix-space-6);
|
|
66
|
+
padding: 0;
|
|
67
|
+
border: 1px solid var(--uix-border);
|
|
68
|
+
border-radius: var(--uix-radius-sm);
|
|
69
|
+
background: var(--uix-surface);
|
|
70
|
+
color: var(--uix-text-muted);
|
|
71
|
+
touch-action: none;
|
|
72
|
+
}
|
|
73
|
+
.uix-dashboard-canvas__handle:hover { background: var(--uix-bg-hover); color: var(--uix-text); }
|
|
74
|
+
.uix-dashboard-canvas__handle:focus-visible { outline: 2px solid var(--uix-ring); outline-offset: 2px; }
|
|
75
|
+
.uix-dashboard-canvas__handle > svg { inline-size: var(--uix-space-4); block-size: var(--uix-space-4); }
|
|
76
|
+
.uix-dashboard-canvas__move { inset-block-start: var(--uix-space-1); inset-inline-end: var(--uix-space-1); cursor: grab; }
|
|
77
|
+
.uix-dashboard-canvas--dragging .uix-dashboard-canvas__move { cursor: grabbing; }
|
|
78
|
+
.uix-dashboard-canvas__resize { inset-block-end: var(--uix-space-1); inset-inline-end: var(--uix-space-1); cursor: nwse-resize; }
|
|
79
|
+
|
|
80
|
+
.uix-dashboard-canvas__preview {
|
|
81
|
+
border: 2px dashed var(--uix-accent);
|
|
82
|
+
border-radius: var(--uix-radius-md);
|
|
83
|
+
background: var(--uix-brand-muted);
|
|
84
|
+
pointer-events: none;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/* ── Narrow: one column in reading order ───────────────────────────────────── */
|
|
88
|
+
/* A container query styles the container's descendants, never the container itself, so the
|
|
89
|
+
canvas keeps its fixed rows here: each item spans as many of them as it has on the wide
|
|
90
|
+
canvas, which makes it exactly as tall as there, gaps included, and the next item starts
|
|
91
|
+
below it. */
|
|
92
|
+
@container uix-dashboard-canvas (max-width: 35.99rem) {
|
|
93
|
+
.uix-dashboard-canvas__item {
|
|
94
|
+
grid-column: 1 / -1;
|
|
95
|
+
grid-row: auto / span var(--uix-dashboard-canvas-h, 1);
|
|
96
|
+
order: var(--uix-dashboard-canvas-order, 0);
|
|
97
|
+
}
|
|
98
|
+
.uix-dashboard-canvas__handle,
|
|
99
|
+
.uix-dashboard-canvas__preview { display: none; }
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
103
|
+
.uix-dashboard-canvas__item { transition: opacity var(--uix-dur-fast) var(--uix-ease-out); }
|
|
104
|
+
}
|
|
105
|
+
}
|