@povio/ui 5.0.0-rc.5 → 5.0.0-rc.7
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/dist/{ComponentGallery-BWiPGUL8.js → ComponentGallery-Dp0kZVZM.js} +96 -248
- package/dist/{Table-piX1SWvN.js → Table-BN2_J_Ne.js} +1 -54
- package/dist/config/ui-configurator.js +2010 -134
- package/dist/index.js +3 -3
- package/dist/rhf.js +3 -3
- package/dist/styles/configurator.css +915 -14
- package/dist/{table.cva-DlMT-zLD.js → table.cva-D5oQ-QvA.js} +54 -1
- package/dist/tanstack/table.js +2 -2
- package/dist/tanstack.js +3 -3
- package/dist/token-classes-Bfcx0get.js +163 -0
- package/dist/{useTableColumnConfig-BTGZiluz.js → useTableColumnConfig-Di0_w80v.js} +1 -1
- package/package.json +1 -1
- package/src/configurator/README.md +7 -1
|
@@ -1,4 +1,57 @@
|
|
|
1
|
+
import { t as createLucideIcon } from "./createLucideIcon-LcezOE4z.js";
|
|
1
2
|
import { t as UIOverrides } from "./uiOverrides.context-BTCH9y5a.js";
|
|
3
|
+
//#region ../../node_modules/.bun/lucide-react@1.43.0+83d5fd7b249dbeef/node_modules/lucide-react/dist/esm/icons/grip-vertical.mjs
|
|
4
|
+
/**
|
|
5
|
+
* @license lucide-react v1.43.0 - ISC
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the ISC license.
|
|
8
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/
|
|
10
|
+
const __iconData = {
|
|
11
|
+
name: "grip-vertical",
|
|
12
|
+
size: 24,
|
|
13
|
+
node: [
|
|
14
|
+
["circle", {
|
|
15
|
+
cx: "9",
|
|
16
|
+
cy: "12",
|
|
17
|
+
r: "1",
|
|
18
|
+
key: "1vctgf"
|
|
19
|
+
}],
|
|
20
|
+
["circle", {
|
|
21
|
+
cx: "9",
|
|
22
|
+
cy: "5",
|
|
23
|
+
r: "1",
|
|
24
|
+
key: "hp0tcf"
|
|
25
|
+
}],
|
|
26
|
+
["circle", {
|
|
27
|
+
cx: "9",
|
|
28
|
+
cy: "19",
|
|
29
|
+
r: "1",
|
|
30
|
+
key: "fkjjf6"
|
|
31
|
+
}],
|
|
32
|
+
["circle", {
|
|
33
|
+
cx: "15",
|
|
34
|
+
cy: "12",
|
|
35
|
+
r: "1",
|
|
36
|
+
key: "1tmaij"
|
|
37
|
+
}],
|
|
38
|
+
["circle", {
|
|
39
|
+
cx: "15",
|
|
40
|
+
cy: "5",
|
|
41
|
+
r: "1",
|
|
42
|
+
key: "19l28e"
|
|
43
|
+
}],
|
|
44
|
+
["circle", {
|
|
45
|
+
cx: "15",
|
|
46
|
+
cy: "19",
|
|
47
|
+
r: "1",
|
|
48
|
+
key: "f4zoj3"
|
|
49
|
+
}]
|
|
50
|
+
]
|
|
51
|
+
};
|
|
52
|
+
__iconData.node;
|
|
53
|
+
const GripVertical = createLucideIcon(__iconData);
|
|
54
|
+
//#endregion
|
|
2
55
|
//#region src/components/table/table.cva.ts
|
|
3
56
|
const tableRowDefinition = UIOverrides.defineConfig({
|
|
4
57
|
base: [
|
|
@@ -45,4 +98,4 @@ const tableDataDefinition = UIOverrides.defineConfig({
|
|
|
45
98
|
const tableHeaderTextDefinition = UIOverrides.defineConfig({ base: ["overflow-hidden text-ellipsis px-table-cell-content-side-m py-table-cell-content-height-m text-surface-default-card-foreground"] });
|
|
46
99
|
const tableCellTextDefinition = UIOverrides.defineConfig({ base: ["block overflow-hidden text-ellipsis text-surface-default-foreground"] });
|
|
47
100
|
//#endregion
|
|
48
|
-
export { tableHeaderTextDefinition as a, tableHeadRowDefinition as i, tableDataDefinition as n, tableRowDefinition as o, tableHeadDataDefinition as r, theadDefinition as s, tableCellTextDefinition as t };
|
|
101
|
+
export { tableHeaderTextDefinition as a, GripVertical as c, tableHeadRowDefinition as i, tableDataDefinition as n, tableRowDefinition as o, tableHeadDataDefinition as r, theadDefinition as s, tableCellTextDefinition as t };
|
package/dist/tanstack/table.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { i as CellText, n as useTableNav, r as HeaderText, t as Table } from "../Table-
|
|
2
|
-
import { a as PaginatedTable, i as dynamicColumns, n as useSorting, o as InfiniteTable, r as usePagination, s as ColumnConfigModal, t as useTableColumnConfig } from "../useTableColumnConfig-
|
|
1
|
+
import { i as CellText, n as useTableNav, r as HeaderText, t as Table } from "../Table-BN2_J_Ne.js";
|
|
2
|
+
import { a as PaginatedTable, i as dynamicColumns, n as useSorting, o as InfiniteTable, r as usePagination, s as ColumnConfigModal, t as useTableColumnConfig } from "../useTableColumnConfig-Di0_w80v.js";
|
|
3
3
|
export { CellText, ColumnConfigModal, HeaderText, InfiniteTable, PaginatedTable, Table, dynamicColumns, usePagination, useSorting, useTableColumnConfig, useTableNav };
|
package/dist/tanstack.js
CHANGED
|
@@ -4,7 +4,7 @@ import { n as MenuPopover, r as MenuItem } from "./DropdownMenuDesktop-Cl9gZVq0.
|
|
|
4
4
|
import { a as isEqual, i as useDeepCompareMemo, n as useDeepCompareEffect, o as ObjectUtils, r as useDeepCompareLayoutEffect, t as UIConfig } from "./uiConfig.context-BS3r_kTS.js";
|
|
5
5
|
import { t as FileUpload } from "./FileUpload--7ub3EZO.js";
|
|
6
6
|
import { t as PasswordInput } from "./PasswordInput-DYwUZ4-k.js";
|
|
7
|
-
import { i as
|
|
7
|
+
import { a as tableHeaderTextDefinition, i as tableHeadRowDefinition, n as tableDataDefinition, o as tableRowDefinition, r as tableHeadDataDefinition, t as tableCellTextDefinition } from "./table.cva-D5oQ-QvA.js";
|
|
8
8
|
import { a as checkboxDefinition, i as checkboxContentWrapperDefinition, o as checkboxGroupLabelDefinition, r as checkboxContentRowDefinition, s as checkboxIconDefinition } from "./CheckboxCheckmark-CpC3wlMs.js";
|
|
9
9
|
import { n as selectListBoxItemDefinition, r as selectInputTagsContentWrapperDefinition, t as selectPopoverDefinition } from "./selectDesktop.cva-CHAMxhfO.js";
|
|
10
10
|
import { t as X } from "./x-B6vfz8Ps.js";
|
|
@@ -89,9 +89,9 @@ import { a as toastDefinition, n as statusIconDefinition$1, r as statusSeparator
|
|
|
89
89
|
import { t as Toast } from "./Toast-DtG3pA61.js";
|
|
90
90
|
import { n as ToastProvider, t as ToastContainer } from "./ToastContainer-qgpzMFD4.js";
|
|
91
91
|
import { useToast } from "./components/use-toast.js";
|
|
92
|
-
import {
|
|
92
|
+
import { i as CellText, n as useTableNav, r as HeaderText, t as Table } from "./Table-BN2_J_Ne.js";
|
|
93
93
|
import { t as useTranslationMemo } from "./useTranslationMemo-CrZbeyBv.js";
|
|
94
|
-
import { a as PaginatedTable, i as dynamicColumns, n as useSorting, o as InfiniteTable, r as usePagination, s as ColumnConfigModal, t as useTableColumnConfig } from "./useTableColumnConfig-
|
|
94
|
+
import { a as PaginatedTable, i as dynamicColumns, n as useSorting, o as InfiniteTable, r as usePagination, s as ColumnConfigModal, t as useTableColumnConfig } from "./useTableColumnConfig-Di0_w80v.js";
|
|
95
95
|
import { t as linkDefinition } from "./link.cva-DMTHZiJG.js";
|
|
96
96
|
import { Link } from "./components/link.js";
|
|
97
97
|
import { Badge } from "./components/badge.js";
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
//#region src/configurator/inspector/token-classes.ts
|
|
2
|
+
/** Tailwind breakpoints from the Atlas base theme, in rem. */
|
|
3
|
+
const breakpoints = {
|
|
4
|
+
sm: 23.75,
|
|
5
|
+
md: 37.5,
|
|
6
|
+
lg: 80,
|
|
7
|
+
xl: 105
|
|
8
|
+
};
|
|
9
|
+
/** Utility prefix → the slots it sets, its specificity, and the theme namespace its value lives in. */
|
|
10
|
+
const utilities = [
|
|
11
|
+
[
|
|
12
|
+
"p",
|
|
13
|
+
[
|
|
14
|
+
"padding.top",
|
|
15
|
+
"padding.right",
|
|
16
|
+
"padding.bottom",
|
|
17
|
+
"padding.left"
|
|
18
|
+
],
|
|
19
|
+
0,
|
|
20
|
+
"spacing"
|
|
21
|
+
],
|
|
22
|
+
[
|
|
23
|
+
"px",
|
|
24
|
+
["padding.left", "padding.right"],
|
|
25
|
+
1,
|
|
26
|
+
"spacing"
|
|
27
|
+
],
|
|
28
|
+
[
|
|
29
|
+
"py",
|
|
30
|
+
["padding.top", "padding.bottom"],
|
|
31
|
+
1,
|
|
32
|
+
"spacing"
|
|
33
|
+
],
|
|
34
|
+
[
|
|
35
|
+
"pt",
|
|
36
|
+
["padding.top"],
|
|
37
|
+
2,
|
|
38
|
+
"spacing"
|
|
39
|
+
],
|
|
40
|
+
[
|
|
41
|
+
"pr",
|
|
42
|
+
["padding.right"],
|
|
43
|
+
2,
|
|
44
|
+
"spacing"
|
|
45
|
+
],
|
|
46
|
+
[
|
|
47
|
+
"pe",
|
|
48
|
+
["padding.right"],
|
|
49
|
+
2,
|
|
50
|
+
"spacing"
|
|
51
|
+
],
|
|
52
|
+
[
|
|
53
|
+
"pb",
|
|
54
|
+
["padding.bottom"],
|
|
55
|
+
2,
|
|
56
|
+
"spacing"
|
|
57
|
+
],
|
|
58
|
+
[
|
|
59
|
+
"pl",
|
|
60
|
+
["padding.left"],
|
|
61
|
+
2,
|
|
62
|
+
"spacing"
|
|
63
|
+
],
|
|
64
|
+
[
|
|
65
|
+
"ps",
|
|
66
|
+
["padding.left"],
|
|
67
|
+
2,
|
|
68
|
+
"spacing"
|
|
69
|
+
],
|
|
70
|
+
[
|
|
71
|
+
"gap",
|
|
72
|
+
["gap.row", "gap.column"],
|
|
73
|
+
0,
|
|
74
|
+
"spacing"
|
|
75
|
+
],
|
|
76
|
+
[
|
|
77
|
+
"gap-x",
|
|
78
|
+
["gap.column"],
|
|
79
|
+
1,
|
|
80
|
+
"spacing"
|
|
81
|
+
],
|
|
82
|
+
[
|
|
83
|
+
"gap-y",
|
|
84
|
+
["gap.row"],
|
|
85
|
+
1,
|
|
86
|
+
"spacing"
|
|
87
|
+
],
|
|
88
|
+
[
|
|
89
|
+
"rounded",
|
|
90
|
+
["radius"],
|
|
91
|
+
0,
|
|
92
|
+
"radius"
|
|
93
|
+
]
|
|
94
|
+
];
|
|
95
|
+
/** Splits `md:hover:px-4` into its variants and utility, ignoring colons inside `[...]` / `(...)`. */
|
|
96
|
+
function splitVariants(className) {
|
|
97
|
+
const parts = [];
|
|
98
|
+
let depth = 0;
|
|
99
|
+
let current = "";
|
|
100
|
+
for (const char of className) {
|
|
101
|
+
if (char === "[" || char === "(") depth++;
|
|
102
|
+
if (char === "]" || char === ")") depth--;
|
|
103
|
+
if (char === ":" && depth === 0) {
|
|
104
|
+
parts.push(current);
|
|
105
|
+
current = "";
|
|
106
|
+
} else current += char;
|
|
107
|
+
}
|
|
108
|
+
return {
|
|
109
|
+
variants: parts,
|
|
110
|
+
utility: current
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
/** Breakpoint weight when every variant is an active breakpoint; `undefined` for state variants or inactive breakpoints. */
|
|
114
|
+
function variantWeight(variants, viewportWidth, rootFontSize) {
|
|
115
|
+
let weight = 0;
|
|
116
|
+
for (const variant of variants) {
|
|
117
|
+
const max = variant.startsWith("max-");
|
|
118
|
+
const size = breakpoints[max ? variant.slice(4) : variant];
|
|
119
|
+
if (size === void 0) return void 0;
|
|
120
|
+
if (!(max ? viewportWidth < size * rootFontSize : viewportWidth >= size * rootFontSize)) return void 0;
|
|
121
|
+
weight = Math.max(weight, size);
|
|
122
|
+
}
|
|
123
|
+
return weight;
|
|
124
|
+
}
|
|
125
|
+
function tokenFor(value, namespace, isKnown) {
|
|
126
|
+
const referenced = value.match(/^\[.*?var\((--[\w-]+)/)?.[1] ?? value.match(/^\((--[\w-]+)\)$/)?.[1];
|
|
127
|
+
if (referenced) return isKnown(referenced) ? referenced : void 0;
|
|
128
|
+
const name = `--${namespace}-${value}`;
|
|
129
|
+
return isKnown(name) ? name : void 0;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Resolves which theme tokens drive an element's padding, gap and radius from its rendered Tailwind classes.
|
|
133
|
+
* Only tokens accepted by `isKnown` are returned, so every result can be opened in the editor.
|
|
134
|
+
*/
|
|
135
|
+
function inspectTokens(className, isKnown, viewportWidth = Infinity, rootFontSize = 16) {
|
|
136
|
+
const winners = /* @__PURE__ */ new Map();
|
|
137
|
+
for (const raw of className.split(/\s+/).filter(Boolean)) {
|
|
138
|
+
const { variants, utility } = splitVariants(raw);
|
|
139
|
+
const weight = variantWeight(variants, viewportWidth, rootFontSize);
|
|
140
|
+
if (weight === void 0) continue;
|
|
141
|
+
const clean = utility.replace(/^!|!$/g, "");
|
|
142
|
+
for (const [prefix, slots, specificity, namespace] of utilities) {
|
|
143
|
+
if (!clean.startsWith(`${prefix}-`)) continue;
|
|
144
|
+
const token = tokenFor(clean.slice(prefix.length + 1), namespace, isKnown);
|
|
145
|
+
if (!token) continue;
|
|
146
|
+
const rank = weight * 10 + specificity;
|
|
147
|
+
for (const slot of slots) if ((winners.get(slot)?.rank ?? -1) <= rank) winners.set(slot, {
|
|
148
|
+
token,
|
|
149
|
+
rank
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
const result = {
|
|
154
|
+
padding: {},
|
|
155
|
+
gap: {}
|
|
156
|
+
};
|
|
157
|
+
for (const [slot, { token }] of winners) if (slot === "radius") result.radius = token;
|
|
158
|
+
else if (slot.startsWith("gap.")) result.gap[slot.slice(4)] = token;
|
|
159
|
+
else result.padding[slot.slice(8)] = token;
|
|
160
|
+
return result;
|
|
161
|
+
}
|
|
162
|
+
//#endregion
|
|
163
|
+
export { splitVariants as n, inspectTokens as t };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { t as Table } from "./Table-piX1SWvN.js";
|
|
2
1
|
import { t as Checkbox } from "./Checkbox-CV1ILXXO.js";
|
|
3
2
|
import { t as Typography } from "./Typography-LU4z2pR1.js";
|
|
4
3
|
import { t as Spinner } from "./Spinner-BeVTUzzx.js";
|
|
@@ -10,6 +9,7 @@ import { t as StringUtils } from "./string.utils-BPgv6QwA.js";
|
|
|
10
9
|
import { t as ZodUtils } from "./zod.utils-DrrPDT9v.js";
|
|
11
10
|
import { t as Dialog } from "./Dialog-9manOgMA.js";
|
|
12
11
|
import { Pagination } from "./components/pagination.js";
|
|
12
|
+
import { t as Table } from "./Table-BN2_J_Ne.js";
|
|
13
13
|
import { t as useTranslationMemo } from "./useTranslationMemo-CrZbeyBv.js";
|
|
14
14
|
import { t as UIRouter } from "./router.context-B4FvsTim.js";
|
|
15
15
|
import { t as RoutingUtils } from "./routing.utils-UTQonIhB.js";
|
package/package.json
CHANGED
|
@@ -62,10 +62,16 @@ The plugin uses Vite's development middleware and HTML hooks and is enabled only
|
|
|
62
62
|
|
|
63
63
|
`parseThemeCss` reads the flat declaration blocks used by Atlas themes (`:root`, `.dark`, and `@theme` / `@theme static`). It excludes `@theme inline` declarations because their compiled literal values cannot be changed at runtime. It is not a general CSS parser. Supply `{ light, dark, theme }` maps directly for other theme structures. Use CSS variables in utilities you want to tune at runtime. Breakpoints, generated class names, and literal values compiled from `@theme inline` require rebuilding CSS; adjust their underlying variables instead. Edits are application-wide within the current document; mount only one configuration provider per document.
|
|
64
64
|
|
|
65
|
-
|
|
65
|
+
Live Preview includes a docked inspector with independent scrolling. In **Inspect** mode, hover any element to see its computed styles and box model, click to pin it, and click the selected element again to unpin. **Interact** mode lets preview controls respond normally and lets gallery cards open their focused demos. The neutral box model shows per-side spacing and borders, corner radii, content dimensions, and row/column measurements inside the gutters of one gap sketch. Default and empty properties are omitted; recognized utility tokens link to the editor only when they match the computed value. Pinning retains selection while local component state and theme changes refresh the displayed values. Hover or focus a number in the box model to highlight its padding, margin, border, radius, content dimension or gap directly on the preview. Dialog, popover, tooltip and dropdown gallery demos use the components' class definitions to avoid taking focus away from the configurator.
|
|
66
66
|
|
|
67
67
|
The **Advanced → Variants & overrides** sub-tab exposes the library's CVA slots by component. It resolves declarative app overrides before showing base classes, variant classes, default values, and compound-rule classes. Edits store a serializable snapshot of the effective slot using `overrideCva`; untouched slots and function mappers retain the inherited app configuration. Function-based CVA overrides are read-only. Reset slot restores the inherited definition. Apply, Cancel, Reset all, and host persistence cover CVA edits as well as tokens.
|
|
68
68
|
|
|
69
69
|
CVA edits change class names, not the Tailwind compiler. Existing compiled classes preview immediately; newly introduced classes require inclusion in your app's Tailwind sources and a rebuild. The UIOverrides export provides a `withUIOverrides(existing)` helper that preserves other components and sibling slots. Mount the configurator below app override providers; providers nested further inside an app intentionally take precedence.
|
|
70
70
|
|
|
71
71
|
The gallery is the default preview for token sections. Switch to **Token preview** to follow the active section and search results; typography metadata uses its parent text specimen. In Variants & overrides, selecting a component or slot changes the focused preview, and focusing a variant or compound-rule field selects that combination. Preview-only controls do not change saved configuration. Common controls use live library components; structural slots use contained specimens built from the same CVA definitions.
|
|
72
|
+
|
|
73
|
+
The configurator window can be moved using the six-dot grip beside the preview switcher. Drag any border or corner to resize it; the layout follows the window width. Both handles support arrow keys (Shift for larger steps). The window remembers its size and position while the provider remains mounted, including across closing, reopening and docking. Restored bounds are clamped to the current viewport.
|
|
74
|
+
|
|
75
|
+
The pop-out control opens a separate browser window with `window.open`. It shares the provider state with the host application, so edits remain live in both windows. Docking or closing the pop-out returns the editor to the page and preserves the draft; Apply and Cancel close the pop-out. A blocked popup leaves the in-page editor open with retry guidance. The popup remembers its own size and screen position for the next pop-out; placement remains subject to browser window rules. The popup uses its browser window for resizing and switches to the compact Live preview tab below 800px.
|
|
76
|
+
|
|
77
|
+
Minimize turns the configurator into a movable **Povio UI** floating launcher without discarding its draft. Click the launcher to restore the previous window mode, size and position; drag it or use the arrow keys to move it. A minimized pop-out reopens as a separate browser window. After Apply or Cancel, the launcher remains available to start a new editing session. Geometry is remembered for the mounted session, not across page reloads.
|