praxis-kit 4.1.0 → 4.1.2
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/{chunk-LA6WGQA6.js → chunk-R2RKHZNX.js} +5 -1
- package/dist/lit/index.js +5 -1
- package/dist/preact/index.js +5 -1
- package/dist/react/index.js +1 -1
- package/dist/react/legacy.js +1 -1
- package/dist/solid/index.js +5 -1
- package/dist/svelte/index.js +5 -1
- package/dist/tailwind/index.d.ts +41 -24
- package/dist/tailwind/index.js +4 -1
- package/dist/vite-plugin/index.d.ts +11 -1
- package/dist/vite-plugin/index.js +26 -1
- package/dist/vue/index.js +5 -1
- package/dist/web/index.js +5 -1
- package/package.json +4 -4
|
@@ -2017,7 +2017,11 @@ var HTML_ARIA_RULES = [landmarkRoleRule, landmarkNameAdvisory];
|
|
|
2017
2017
|
import { warnDiagnostics } from "./_shared/diagnostics.js";
|
|
2018
2018
|
function isOpenContent(...blockedTags) {
|
|
2019
2019
|
const set2 = new Set(blockedTags);
|
|
2020
|
-
return (child) =>
|
|
2020
|
+
return (child) => {
|
|
2021
|
+
if (!isObject(child) || !("type" in child)) return false;
|
|
2022
|
+
const tag = getTag(child);
|
|
2023
|
+
return tag === void 0 || !set2.has(tag);
|
|
2024
|
+
};
|
|
2021
2025
|
}
|
|
2022
2026
|
var METADATA_TAGS = ["script", "template"];
|
|
2023
2027
|
var metadataMatch = isTag(...METADATA_TAGS);
|
package/dist/lit/index.js
CHANGED
|
@@ -1847,7 +1847,11 @@ var HTML_ARIA_RULES = [landmarkRoleRule, landmarkNameAdvisory];
|
|
|
1847
1847
|
import { warnDiagnostics } from "../_shared/diagnostics.js";
|
|
1848
1848
|
function isOpenContent(...blockedTags) {
|
|
1849
1849
|
const set2 = new Set(blockedTags);
|
|
1850
|
-
return (child) =>
|
|
1850
|
+
return (child) => {
|
|
1851
|
+
if (!isObject(child) || !("type" in child)) return false;
|
|
1852
|
+
const tag = getTag(child);
|
|
1853
|
+
return tag === void 0 || !set2.has(tag);
|
|
1854
|
+
};
|
|
1851
1855
|
}
|
|
1852
1856
|
var METADATA_TAGS = ["script", "template"];
|
|
1853
1857
|
var metadataMatch = isTag(...METADATA_TAGS);
|
package/dist/preact/index.js
CHANGED
|
@@ -2032,7 +2032,11 @@ var HTML_ARIA_RULES = [landmarkRoleRule, landmarkNameAdvisory];
|
|
|
2032
2032
|
import { warnDiagnostics } from "../_shared/diagnostics.js";
|
|
2033
2033
|
function isOpenContent(...blockedTags) {
|
|
2034
2034
|
const set2 = new Set(blockedTags);
|
|
2035
|
-
return (child) =>
|
|
2035
|
+
return (child) => {
|
|
2036
|
+
if (!isObject(child) || !("type" in child)) return false;
|
|
2037
|
+
const tag = getTag(child);
|
|
2038
|
+
return tag === void 0 || !set2.has(tag);
|
|
2039
|
+
};
|
|
2036
2040
|
}
|
|
2037
2041
|
var METADATA_TAGS = ["script", "template"];
|
|
2038
2042
|
var metadataMatch = isTag(...METADATA_TAGS);
|
package/dist/react/index.js
CHANGED
package/dist/react/legacy.js
CHANGED
package/dist/solid/index.js
CHANGED
|
@@ -1989,7 +1989,11 @@ var HTML_ARIA_RULES = [landmarkRoleRule, landmarkNameAdvisory];
|
|
|
1989
1989
|
import { warnDiagnostics } from "../_shared/diagnostics.js";
|
|
1990
1990
|
function isOpenContent(...blockedTags) {
|
|
1991
1991
|
const set2 = new Set(blockedTags);
|
|
1992
|
-
return (child) =>
|
|
1992
|
+
return (child) => {
|
|
1993
|
+
if (!isObject(child) || !("type" in child)) return false;
|
|
1994
|
+
const tag = getTag(child);
|
|
1995
|
+
return tag === void 0 || !set2.has(tag);
|
|
1996
|
+
};
|
|
1993
1997
|
}
|
|
1994
1998
|
var METADATA_TAGS = ["script", "template"];
|
|
1995
1999
|
var metadataMatch = isTag(...METADATA_TAGS);
|
package/dist/svelte/index.js
CHANGED
|
@@ -1893,7 +1893,11 @@ var HTML_ARIA_RULES = [landmarkRoleRule, landmarkNameAdvisory];
|
|
|
1893
1893
|
import { warnDiagnostics } from "../_shared/diagnostics.js";
|
|
1894
1894
|
function isOpenContent(...blockedTags) {
|
|
1895
1895
|
const set2 = new Set(blockedTags);
|
|
1896
|
-
return (child) =>
|
|
1896
|
+
return (child) => {
|
|
1897
|
+
if (!isObject(child) || !("type" in child)) return false;
|
|
1898
|
+
const tag = getTag(child);
|
|
1899
|
+
return tag === void 0 || !set2.has(tag);
|
|
1900
|
+
};
|
|
1897
1901
|
}
|
|
1898
1902
|
var METADATA_TAGS = ["script", "template"];
|
|
1899
1903
|
var metadataMatch = isTag(...METADATA_TAGS);
|
package/dist/tailwind/index.d.ts
CHANGED
|
@@ -94,6 +94,38 @@ type ClassPlugin<TProps extends AnyRecord = EmptyRecord> = Readonly<{
|
|
|
94
94
|
readonly _pluginProps?: TProps;
|
|
95
95
|
}>;
|
|
96
96
|
|
|
97
|
+
/**
|
|
98
|
+
* Canonical list of reserved layout prop names.
|
|
99
|
+
*
|
|
100
|
+
* This array is the single source of truth for every supported CSS `display`
|
|
101
|
+
* value exposed as a boolean prop. The `LayoutKey` type is derived directly
|
|
102
|
+
* from this list.
|
|
103
|
+
*
|
|
104
|
+
* To add a new display mode:
|
|
105
|
+
* 1. Add the display value here.
|
|
106
|
+
* 2. Register its layout family in `LAYOUT_FAMILY_MAP`.
|
|
107
|
+
*
|
|
108
|
+
* Prop names intentionally match the corresponding Tailwind/CSS display
|
|
109
|
+
* utilities, so no additional prop-to-class mapping is required.
|
|
110
|
+
*/
|
|
111
|
+
declare const layoutKeys: readonly ["flex", "inline-flex", "grid", "inline-grid", "block", "inline-block", "inline", "hidden", "contents", "flow-root", "list-item", "table", "inline-table", "table-caption", "table-cell", "table-column", "table-column-group", "table-footer-group", "table-header-group", "table-row-group", "table-row"];
|
|
112
|
+
|
|
113
|
+
type TupleValues<T extends readonly unknown[]> = T[number];
|
|
114
|
+
type ValueOf<T> = T[keyof T];
|
|
115
|
+
type LayoutKey<T extends readonly string[]> = TupleValues<T>;
|
|
116
|
+
type LayoutFamily<M extends StringMap<string>> = ValueOf<M>;
|
|
117
|
+
type LayoutMode<T extends readonly string[]> = LayoutKey<T> | 'none';
|
|
118
|
+
type ExclusiveTrueProp<K extends PropertyKey> = {
|
|
119
|
+
[P in K]: Simplify<Record<P, true> & Partial<Record<Exclude<K, P>, never>>>;
|
|
120
|
+
}[K];
|
|
121
|
+
/**
|
|
122
|
+
* Mutually exclusive display shorthand props.
|
|
123
|
+
*
|
|
124
|
+
* At most one key may be `true`. Passing multiple is a compile-time error; the
|
|
125
|
+
* runtime also warns and lets the first key in declaration order take precedence.
|
|
126
|
+
*/
|
|
127
|
+
type LayoutProps<T extends readonly string[]> = ExclusiveTrueProp<LayoutKey<T>> | Partial<Record<LayoutKey<T>, never>>;
|
|
128
|
+
|
|
97
129
|
declare const LAYOUT_FAMILY_MAP: {
|
|
98
130
|
readonly flex: "flex";
|
|
99
131
|
readonly 'inline-flex': "flex";
|
|
@@ -107,6 +139,7 @@ declare const LAYOUT_FAMILY_MAP: {
|
|
|
107
139
|
readonly 'flow-root': "none";
|
|
108
140
|
readonly 'list-item': "none";
|
|
109
141
|
readonly table: "none";
|
|
142
|
+
readonly 'inline-table': "none";
|
|
110
143
|
readonly 'table-caption': "none";
|
|
111
144
|
readonly 'table-cell': "none";
|
|
112
145
|
readonly 'table-column': "none";
|
|
@@ -117,32 +150,16 @@ declare const LAYOUT_FAMILY_MAP: {
|
|
|
117
150
|
readonly 'table-row': "none";
|
|
118
151
|
};
|
|
119
152
|
|
|
120
|
-
declare const layoutKeys: readonly ["flex", "inline-flex", "grid", "inline-grid", "block", "inline-block", "inline", "hidden", "contents", "flow-root", "list-item", "table", "table-caption", "table-cell", "table-column", "table-column-group", "table-footer-group", "table-header-group", "table-row-group", "table-row"];
|
|
121
|
-
|
|
122
|
-
type LayoutKey = (typeof layoutKeys)[number];
|
|
123
|
-
type LayoutFamily = (typeof LAYOUT_FAMILY_MAP)[LayoutKey];
|
|
124
|
-
type LayoutMode = LayoutKey | 'none';
|
|
125
|
-
type ExclusiveTrueProp<K extends PropertyKey> = {
|
|
126
|
-
[P in K]: Simplify<Record<P, true> & Partial<Record<Exclude<K, P>, never>>>;
|
|
127
|
-
}[K];
|
|
128
|
-
/**
|
|
129
|
-
* Mutually exclusive display shorthand props.
|
|
130
|
-
*
|
|
131
|
-
* At most one key may be `true`. Passing multiple is a compile-time error; the
|
|
132
|
-
* runtime also warns and lets the first key in declaration order take precedence.
|
|
133
|
-
*/
|
|
134
|
-
type LayoutProps = ExclusiveTrueProp<LayoutKey> | Partial<Record<LayoutKey, never>>;
|
|
135
|
-
|
|
136
153
|
type ClassToken = string;
|
|
137
154
|
type Token<TKind extends string, TData extends object = EmptyRecord> = {
|
|
138
155
|
kind: TKind;
|
|
139
156
|
raw: string;
|
|
140
157
|
} & TData;
|
|
141
158
|
type LayoutToken = Token<'layout', {
|
|
142
|
-
value: LayoutKey
|
|
159
|
+
value: LayoutKey<typeof layoutKeys>;
|
|
143
160
|
}>;
|
|
144
161
|
type ConditionalToken = Token<'conditional', {
|
|
145
|
-
requires: Exclude<LayoutFamily
|
|
162
|
+
requires: Exclude<LayoutFamily<typeof LAYOUT_FAMILY_MAP>, 'none'>;
|
|
146
163
|
}>;
|
|
147
164
|
type GapToken = Token<'gap'>;
|
|
148
165
|
type UtilityToken = Token<'utility', {
|
|
@@ -188,7 +205,7 @@ type CompoundVariant = {
|
|
|
188
205
|
* flex-family modes strip `grid-*`; grid-family modes strip `flex-*`; all other
|
|
189
206
|
* display values (and no prop) strip both `flex-*` and `grid-*`.
|
|
190
207
|
*/
|
|
191
|
-
declare function createTailwindPipeline<V extends VariantMap = VariantMap>(options: ClassPipelineOptions<V>, diagnostics: Diagnostics): ClassPlugin<LayoutProps
|
|
208
|
+
declare function createTailwindPipeline<V extends VariantMap = VariantMap>(options: ClassPipelineOptions<V>, diagnostics: Diagnostics): ClassPlugin<LayoutProps<typeof layoutKeys>>;
|
|
192
209
|
|
|
193
210
|
declare class ClassBuilder {
|
|
194
211
|
#private;
|
|
@@ -200,7 +217,7 @@ declare class ClassClassifier {
|
|
|
200
217
|
classify(token: ClassToken): ClassifiedToken;
|
|
201
218
|
}
|
|
202
219
|
|
|
203
|
-
type DependencyRules = Record<Exclude<LayoutFamily
|
|
220
|
+
type DependencyRules = Record<Exclude<LayoutFamily<typeof LAYOUT_FAMILY_MAP>, 'none'>, readonly RegExp[]>;
|
|
204
221
|
declare const defaultDependencyRules: DependencyRules;
|
|
205
222
|
|
|
206
223
|
/**
|
|
@@ -216,9 +233,9 @@ declare const defaultDependencyRules: DependencyRules;
|
|
|
216
233
|
*/
|
|
217
234
|
declare class LayoutState {
|
|
218
235
|
#private;
|
|
219
|
-
constructor(mode: LayoutMode);
|
|
220
|
-
get mode(): LayoutMode
|
|
221
|
-
get family(): LayoutFamily
|
|
236
|
+
constructor(mode: LayoutMode<typeof layoutKeys>);
|
|
237
|
+
get mode(): LayoutMode<typeof layoutKeys>;
|
|
238
|
+
get family(): LayoutFamily<typeof LAYOUT_FAMILY_MAP>;
|
|
222
239
|
}
|
|
223
240
|
|
|
224
241
|
declare class DependencyEvaluator {
|
|
@@ -227,4 +244,4 @@ declare class DependencyEvaluator {
|
|
|
227
244
|
evaluate(token: ClassifiedToken, state: LayoutState): boolean;
|
|
228
245
|
}
|
|
229
246
|
|
|
230
|
-
export { ClassBuilder, ClassClassifier, type ClassToken, type ClassifiedToken, type CompoundVariant, type ConditionalToken, DependencyEvaluator, type DependencyRules, type GapToken, type LayoutFamily, type LayoutKey, type LayoutMode, type LayoutProps, LayoutState, type LayoutToken, type UtilityToken, type VariantSelection, createTailwindPipeline, defaultDependencyRules };
|
|
247
|
+
export { ClassBuilder, ClassClassifier, type ClassToken, type ClassifiedToken, type CompoundVariant, type ConditionalToken, DependencyEvaluator, type DependencyRules, type GapToken, type LayoutFamily, type LayoutKey, type LayoutMode, type LayoutProps, LayoutState, type LayoutToken, type UtilityToken, type VariantSelection, createTailwindPipeline, defaultDependencyRules, layoutKeys };
|
package/dist/tailwind/index.js
CHANGED
|
@@ -400,6 +400,7 @@ var layoutKeys = [
|
|
|
400
400
|
"flow-root",
|
|
401
401
|
"list-item",
|
|
402
402
|
"table",
|
|
403
|
+
"inline-table",
|
|
403
404
|
"table-caption",
|
|
404
405
|
"table-cell",
|
|
405
406
|
"table-column",
|
|
@@ -425,6 +426,7 @@ var LAYOUT_FAMILY_MAP = {
|
|
|
425
426
|
"flow-root": "none",
|
|
426
427
|
"list-item": "none",
|
|
427
428
|
table: "none",
|
|
429
|
+
"inline-table": "none",
|
|
428
430
|
"table-caption": "none",
|
|
429
431
|
"table-cell": "none",
|
|
430
432
|
"table-column": "none",
|
|
@@ -672,5 +674,6 @@ export {
|
|
|
672
674
|
DependencyEvaluator,
|
|
673
675
|
LayoutState,
|
|
674
676
|
createTailwindPipeline,
|
|
675
|
-
defaultDependencyRules
|
|
677
|
+
defaultDependencyRules,
|
|
678
|
+
layoutKeys
|
|
676
679
|
};
|
|
@@ -287,7 +287,17 @@ type DesignTokenManifest = {
|
|
|
287
287
|
* destructured patterns fall through (same scope as `collectConstraints`).
|
|
288
288
|
*/
|
|
289
289
|
declare function collectFileTokens(source: ts.SourceFile, calleeNames: ReadonlySet<string>): Map<string, ComponentTokens>;
|
|
290
|
-
/**
|
|
290
|
+
/**
|
|
291
|
+
* Builds a DesignTokenManifest from the accumulated per-component token maps,
|
|
292
|
+
* including a flat sorted `allClasses` union.
|
|
293
|
+
*
|
|
294
|
+
* `allClasses` always includes every `layoutKeys` display value (`flex`,
|
|
295
|
+
* `inline-flex`, `grid`, `hidden`, etc.) even when no scanned component uses
|
|
296
|
+
* them literally. Those classes are only ever assembled at runtime by
|
|
297
|
+
* `createTailwindPipeline` from boolean props, so they never appear as a
|
|
298
|
+
* string literal for Tailwind's content scanner (or this manifest) to find
|
|
299
|
+
* on its own — without this, Tailwind silently drops their generated CSS.
|
|
300
|
+
*/
|
|
291
301
|
declare function buildManifest(allTokens: Map<string, ComponentTokens>): DesignTokenManifest;
|
|
292
302
|
type DesignTokensOptions = {
|
|
293
303
|
/**
|
|
@@ -1389,6 +1389,31 @@ function analyze(code, filename, options) {
|
|
|
1389
1389
|
return diagnoseUsages(source, constraints, severity);
|
|
1390
1390
|
}
|
|
1391
1391
|
|
|
1392
|
+
// ../../lib/tailwind/src/layout-keys.ts
|
|
1393
|
+
var layoutKeys = [
|
|
1394
|
+
"flex",
|
|
1395
|
+
"inline-flex",
|
|
1396
|
+
"grid",
|
|
1397
|
+
"inline-grid",
|
|
1398
|
+
"block",
|
|
1399
|
+
"inline-block",
|
|
1400
|
+
"inline",
|
|
1401
|
+
"hidden",
|
|
1402
|
+
"contents",
|
|
1403
|
+
"flow-root",
|
|
1404
|
+
"list-item",
|
|
1405
|
+
"table",
|
|
1406
|
+
"inline-table",
|
|
1407
|
+
"table-caption",
|
|
1408
|
+
"table-cell",
|
|
1409
|
+
"table-column",
|
|
1410
|
+
"table-column-group",
|
|
1411
|
+
"table-footer-group",
|
|
1412
|
+
"table-header-group",
|
|
1413
|
+
"table-row-group",
|
|
1414
|
+
"table-row"
|
|
1415
|
+
];
|
|
1416
|
+
|
|
1392
1417
|
// ../../plugins/vite/src/design-tokens.ts
|
|
1393
1418
|
import { writeFileSync } from "fs";
|
|
1394
1419
|
import { resolve } from "path";
|
|
@@ -1471,7 +1496,7 @@ function mergeTokens(existing, incoming) {
|
|
|
1471
1496
|
}
|
|
1472
1497
|
function buildManifest(allTokens) {
|
|
1473
1498
|
const components = {};
|
|
1474
|
-
const seen =
|
|
1499
|
+
const seen = new Set(layoutKeys);
|
|
1475
1500
|
iterate.forEach(allTokens, ([name, tokens]) => {
|
|
1476
1501
|
components[name] = tokens;
|
|
1477
1502
|
iterate.forEach(
|
package/dist/vue/index.js
CHANGED
|
@@ -2000,7 +2000,11 @@ var HTML_ARIA_RULES = [landmarkRoleRule, landmarkNameAdvisory];
|
|
|
2000
2000
|
import { warnDiagnostics } from "../_shared/diagnostics.js";
|
|
2001
2001
|
function isOpenContent(...blockedTags) {
|
|
2002
2002
|
const set2 = new Set(blockedTags);
|
|
2003
|
-
return (child) =>
|
|
2003
|
+
return (child) => {
|
|
2004
|
+
if (!isObject(child) || !("type" in child)) return false;
|
|
2005
|
+
const tag = getTag(child);
|
|
2006
|
+
return tag === void 0 || !set2.has(tag);
|
|
2007
|
+
};
|
|
2004
2008
|
}
|
|
2005
2009
|
var METADATA_TAGS = ["script", "template"];
|
|
2006
2010
|
var metadataMatch = isTag(...METADATA_TAGS);
|
package/dist/web/index.js
CHANGED
|
@@ -1847,7 +1847,11 @@ var HTML_ARIA_RULES = [landmarkRoleRule, landmarkNameAdvisory];
|
|
|
1847
1847
|
import { warnDiagnostics } from "../_shared/diagnostics.js";
|
|
1848
1848
|
function isOpenContent(...blockedTags) {
|
|
1849
1849
|
const set2 = new Set(blockedTags);
|
|
1850
|
-
return (child) =>
|
|
1850
|
+
return (child) => {
|
|
1851
|
+
if (!isObject(child) || !("type" in child)) return false;
|
|
1852
|
+
const tag = getTag(child);
|
|
1853
|
+
return tag === void 0 || !set2.has(tag);
|
|
1854
|
+
};
|
|
1851
1855
|
}
|
|
1852
1856
|
var METADATA_TAGS = ["script", "template"];
|
|
1853
1857
|
var metadataMatch = isTag(...METADATA_TAGS);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "praxis-kit",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./react": {
|
|
@@ -129,10 +129,10 @@
|
|
|
129
129
|
"typescript": "^6.0.3",
|
|
130
130
|
"vite": "^8.1.3",
|
|
131
131
|
"vue": "^3.5.38",
|
|
132
|
-
"@praxis-kit/core": "0.0.0",
|
|
133
132
|
"@praxis-kit/adapter-utils": "0.0.0",
|
|
134
|
-
"@praxis-kit/
|
|
135
|
-
"@praxis-kit/diagnostics": "0.0.0"
|
|
133
|
+
"@praxis-kit/core": "0.0.0",
|
|
134
|
+
"@praxis-kit/diagnostics": "0.0.0",
|
|
135
|
+
"@praxis-kit/primitive": "0.0.0"
|
|
136
136
|
},
|
|
137
137
|
"publishConfig": {
|
|
138
138
|
"access": "public"
|