@tokenami/config 0.0.32 → 0.0.34
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/index.d.mts +43 -40
- package/dist/index.d.ts +43 -40
- package/dist/index.js +6 -5
- package/dist/index.mjs +6 -5
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
declare const layers: readonly [["all", "-webkit-line-clamp", "accent-color", "align-tracks", "animation", "appearance", "aspect-ratio", "backdrop-filter", "backface-visibility", "background", "border", "border-collapse", "border-spacing", "border-radius", "box-decoration-break", "box-shadow", "box-sizing", "break-after", "break-before", "break-inside", "caption-side", "clear", "clip-path", "color", "color-scheme", "column-fill", "column-span", "column-rule", "columns", "contain", "contain-intrinsic-size", "container", "content", "content-visibility", "counter-increment", "counter-reset", "counter-set", "cursor", "direction", "display", "empty-cells", "filter", "flex", "flex-flow", "float", "font", "font-feature-settings", "font-kerning", "font-language-override", "font-optical-sizing", "font-palette", "font-size-adjust", "font-synthesis", "font-variation-settings", "forced-color-adjust", "gap", "grid", "grid-area", "grid-column", "grid-row", "grid-template", "hanging-punctuation", "height", "hyphenate-character", "hyphenate-limit-chars", "hyphens", "image-orientation", "image-rendering", "image-resolution", "initial-letter", "input-security", "inset", "isolation", "justify-tracks", "letter-spacing", "line-break", "line-clamp", "line-height-step", "list-style", "margin", "mask", "mask-border", "math-depth", "math-shift", "math-style", "max-height", "max-width", "min-height", "min-width", "mix-blend-mode", "object-fit", "object-position", "offset", "opacity", "order", "orphans", "outline", "overflow", "overscroll-behavior", "padding", "page", "paint-order", "perspective", "perspective-origin", "place-content", "place-items", "place-self", "pointer-events", "position", "print-color-adjust", "quotes", "resize", "rotate", "ruby-position", "scale", "scroll-behavior", "scroll-margin", "scroll-padding", "scroll-snap-align", "scroll-snap-stop", "scroll-snap-type", "scroll-timeline", "scrollbar-color", "scrollbar-gutter", "scrollbar-width", "shape-image-threshold", "shape-margin", "shape-outside", "tab-size", "table-layout", "text-align", "text-align-last", "text-combine-upright", "text-decoration", "text-decoration-skip-ink", "text-emphasis", "text-emphasis-position", "text-indent", "text-justify", "text-orientation", "text-overflow", "text-rendering", "text-shadow", "text-size-adjust", "text-transform", "text-underline-offset", "text-underline-position", "touch-action", "transform", "transform-box", "transform-origin", "transform-style", "transition", "translate", "unicode-bidi", "user-select", "vertical-align", "view-transition-name", "visibility", "white-space", "widows", "width", "will-change", "word-break", "word-spacing", "word-wrap", "writing-mode", "z-index", "zoom"], ["animation-composition", "animation-delay", "animation-direction", "animation-duration", "animation-fill-mode", "animation-iteration-count", "animation-name", "animation-play-state", "animation-timeline", "animation-timing-function", "background-attachment", "background-blend-mode", "background-clip", "background-color", "background-image", "background-origin", "background-position", "background-position-x", "background-position-y", "background-repeat", "background-size", "border-top", "border-right", "border-bottom", "border-left", "border-top-left-radius", "border-top-right-radius", "border-bottom-left-radius", "border-bottom-right-radius", "caret-color", "caret-shape", "column-rule-color", "column-rule-style", "column-rule-width", "column-count", "column-width", "contain-intrinsic-width", "contain-intrinsic-height", "container-name", "container-type", "flex-grow", "flex-shrink", "flex-basis", "flex-direction", "flex-wrap", "font-style", "font-variant", "font-weight", "font-stretch", "font-size", "font-family", "row-gap", "column-gap", "grid-auto-columns", "grid-auto-flow", "grid-auto-rows", "grid-template-areas", "grid-template-columns", "grid-template-rows", "grid-row-start", "grid-column-start", "grid-row-end", "grid-column-end", "top", "right", "bottom", "left", "line-height", "list-style-image", "list-style-position", "list-style-type", "margin-top", "margin-right", "margin-bottom", "margin-left", "mask-border-mode", "mask-border-outset", "mask-border-repeat", "mask-border-slice", "mask-border-source", "mask-border-width", "mask-clip", "mask-composite", "mask-image", "mask-mode", "mask-origin", "mask-position", "mask-repeat", "mask-size", "mask-type", "offset-anchor", "offset-distance", "offset-path", "offset-position", "offset-rotate", "outline-color", "outline-offset", "outline-style", "outline-width", "overflow-anchor", "overflow-clip-margin", "overflow-wrap", "overflow-x", "overflow-y", "overscroll-behavior-x", "overscroll-behavior-y", "padding-top", "padding-right", "padding-bottom", "padding-left", "align-content", "justify-content", "align-items", "justify-items", "align-self", "justify-self", "scroll-margin-top", "scroll-margin-right", "scroll-margin-bottom", "scroll-margin-left", "scroll-padding-top", "scroll-padding-right", "scroll-padding-bottom", "scroll-padding-left", "scroll-timeline-axis", "scroll-timeline-name", "text-decoration-color", "text-decoration-line", "text-decoration-style", "text-decoration-thickness", "text-emphasis-color", "text-emphasis-style", "transition-delay", "transition-duration", "transition-property", "transition-timing-function"], ["border-style", "border-color", "border-width", "border-image", "font-variant-alternates", "font-variant-caps", "font-variant-east-asian", "font-variant-emoji", "font-variant-ligatures", "font-variant-numeric", "font-variant-position"], ["border-top-color", "border-top-style", "border-top-width", "border-right-color", "border-right-style", "border-right-width", "border-bottom-color", "border-bottom-style", "border-bottom-width", "border-left-color", "border-left-style", "border-left-width", "border-image-outset", "border-image-repeat", "border-image-slice", "border-image-source", "border-image-width"], ["block-size", "border-block", "border-inline", "contain-intrinsic-block-size", "contain-intrinsic-inline-size", "inline-size", "inset-block", "inset-inline", "margin-block", "margin-inline", "max-block-size", "min-block-size", "max-inline-size", "min-inline-size", "overflow-block", "overflow-inline", "overscroll-behavior-block", "overscroll-behavior-inline", "padding-block", "padding-inline", "scroll-margin-block", "scroll-margin-inline", "scroll-padding-block", "scroll-padding-inline"], ["border-block-width", "border-block-style", "border-block-color", "border-block-start", "border-block-end", "border-inline-color", "border-inline-style", "border-inline-width", "border-inline-start", "border-inline-end", "inset-block-end", "inset-block-start", "inset-inline-end", "inset-inline-start", "margin-block-end", "margin-block-start", "margin-inline-end", "margin-inline-start", "padding-block-end", "padding-block-start", "padding-inline-end", "padding-inline-start", "scroll-margin-block-end", "scroll-margin-block-start", "scroll-margin-inline-end", "scroll-margin-inline-start", "scroll-padding-block-end", "scroll-padding-block-start", "scroll-padding-inline-end", "scroll-padding-inline-start"], ["border-start-end-radius", "border-start-start-radius", "border-end-end-radius", "border-end-start-radius", "border-block-start-color", "border-block-start-style", "border-block-start-width", "border-block-end-color", "border-block-end-style", "border-block-end-width", "border-inline-start-color", "border-inline-start-style", "border-inline-start-width", "border-inline-end-color", "border-inline-end-style", "border-inline-end-width"]];
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
type Flatten<T> = {
|
|
3
|
+
[K in keyof T]: T[K] extends Array<infer E> ? E : T[K];
|
|
4
|
+
};
|
|
5
|
+
type CSSProperty = Flatten<typeof layers>[number];
|
|
6
|
+
declare const properties: CSSProperty;
|
|
4
7
|
|
|
5
8
|
type DeepReadonly<T> = T extends any[] ? T : {
|
|
6
9
|
readonly [P in keyof T]: DeepReadonly<T[P]>;
|
|
@@ -185,44 +188,8 @@ declare const defaultConfig: {
|
|
|
185
188
|
};
|
|
186
189
|
};
|
|
187
190
|
type DefaultConfig = typeof defaultConfig;
|
|
188
|
-
|
|
189
|
-
type GridProperty = '--_grid';
|
|
190
|
-
declare const GridProperty: {
|
|
191
|
-
safeParse: (input: unknown) => Validated<"--_grid">;
|
|
192
|
-
};
|
|
193
|
-
declare function gridProperty(): GridProperty;
|
|
194
|
-
type GridValue = number;
|
|
195
|
-
declare const GridValue: {
|
|
196
|
-
safeParse: (input: unknown) => Validated<number>;
|
|
197
|
-
};
|
|
198
|
-
type TokenProperty<P extends string = string> = `--${P}`;
|
|
199
|
-
declare const TokenProperty: {
|
|
200
|
-
safeParse: (input: unknown) => Validated<`--${string}`>;
|
|
201
|
-
};
|
|
202
|
-
declare function tokenProperty(name: string): TokenProperty;
|
|
203
|
-
type VariantProperty<P extends string = string, V extends string = string> = `--${V}_${P}`;
|
|
204
|
-
declare const VariantProperty: {
|
|
205
|
-
safeParse: (input: unknown) => Validated<`--${string}_${string}`>;
|
|
206
|
-
};
|
|
207
|
-
declare function variantProperty(variant: string, name: string): TokenProperty;
|
|
208
|
-
type TokenValue<TK extends string = string, V extends string = string> = `var(--${TK}_${V})`;
|
|
209
|
-
declare const TokenValue: {
|
|
210
|
-
safeParse: (input: unknown) => Validated<`var(--${string}_${string})`>;
|
|
211
|
-
};
|
|
212
|
-
declare function tokenValue<TK extends string, N extends string>(themeKey: TK, name: N): TokenValue<TK, N>;
|
|
213
|
-
type ArbitraryValue = `var(---,${string})`;
|
|
214
|
-
declare const ArbitraryValue: {
|
|
215
|
-
safeParse: (input: unknown) => Validated<`var(---,${string})`>;
|
|
216
|
-
};
|
|
217
|
-
declare function arbitraryValue(value: string): ArbitraryValue;
|
|
218
|
-
type Validated<T> = {
|
|
219
|
-
success: true;
|
|
220
|
-
output: T;
|
|
221
|
-
} | {
|
|
222
|
-
success: false;
|
|
223
|
-
};
|
|
224
191
|
type Exact<T, V extends T> = Exclude<keyof V, keyof T> extends never ? V : T;
|
|
225
|
-
declare function createConfig<T extends Config>(obj: Exact<Config, T>):
|
|
192
|
+
declare function createConfig<T extends Config>(obj: Exact<Config, T>): {
|
|
226
193
|
include: never[];
|
|
227
194
|
grid: string;
|
|
228
195
|
responsive: {};
|
|
@@ -373,7 +340,43 @@ declare function createConfig<T extends Config>(obj: Exact<Config, T>): Omit<{
|
|
|
373
340
|
width: ("grid" | "size")[];
|
|
374
341
|
'z-index': "z"[];
|
|
375
342
|
};
|
|
376
|
-
}
|
|
343
|
+
} & DeepReadonly<T>;
|
|
344
|
+
|
|
345
|
+
type GridProperty = '--_grid';
|
|
346
|
+
declare const GridProperty: {
|
|
347
|
+
safeParse: (input: unknown) => Validated<"--_grid">;
|
|
348
|
+
};
|
|
349
|
+
declare function gridProperty(): GridProperty;
|
|
350
|
+
type GridValue = number;
|
|
351
|
+
declare const GridValue: {
|
|
352
|
+
safeParse: (input: unknown) => Validated<number>;
|
|
353
|
+
};
|
|
354
|
+
type TokenProperty<P extends string = string> = `--${P}`;
|
|
355
|
+
declare const TokenProperty: {
|
|
356
|
+
safeParse: (input: unknown) => Validated<`--${string}`>;
|
|
357
|
+
};
|
|
358
|
+
declare function tokenProperty(name: string): TokenProperty;
|
|
359
|
+
type VariantProperty<P extends string = string, V extends string = string> = `--${V}_${P}`;
|
|
360
|
+
declare const VariantProperty: {
|
|
361
|
+
safeParse: (input: unknown) => Validated<`--${string}_${string}`>;
|
|
362
|
+
};
|
|
363
|
+
declare function variantProperty(variant: string, name: string): TokenProperty;
|
|
364
|
+
type TokenValue<TK extends string = string, V extends string = string> = `var(--${TK}_${V})`;
|
|
365
|
+
declare const TokenValue: {
|
|
366
|
+
safeParse: (input: unknown) => Validated<`var(--${string}_${string})`>;
|
|
367
|
+
};
|
|
368
|
+
declare function tokenValue<TK extends string, N extends string>(themeKey: TK, name: N): TokenValue<TK, N>;
|
|
369
|
+
type ArbitraryValue = `var(---,${string})`;
|
|
370
|
+
declare const ArbitraryValue: {
|
|
371
|
+
safeParse: (input: unknown) => Validated<`var(---,${string})`>;
|
|
372
|
+
};
|
|
373
|
+
declare function arbitraryValue(value: string): ArbitraryValue;
|
|
374
|
+
type Validated<T> = {
|
|
375
|
+
success: true;
|
|
376
|
+
output: T;
|
|
377
|
+
} | {
|
|
378
|
+
success: false;
|
|
379
|
+
};
|
|
377
380
|
declare function getTokenPropertyName(tokenProperty: TokenProperty): string;
|
|
378
381
|
declare function getTokenPropertySplit(tokenProperty: TokenProperty): {
|
|
379
382
|
alias: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
declare const layers: readonly [["all", "-webkit-line-clamp", "accent-color", "align-tracks", "animation", "appearance", "aspect-ratio", "backdrop-filter", "backface-visibility", "background", "border", "border-collapse", "border-spacing", "border-radius", "box-decoration-break", "box-shadow", "box-sizing", "break-after", "break-before", "break-inside", "caption-side", "clear", "clip-path", "color", "color-scheme", "column-fill", "column-span", "column-rule", "columns", "contain", "contain-intrinsic-size", "container", "content", "content-visibility", "counter-increment", "counter-reset", "counter-set", "cursor", "direction", "display", "empty-cells", "filter", "flex", "flex-flow", "float", "font", "font-feature-settings", "font-kerning", "font-language-override", "font-optical-sizing", "font-palette", "font-size-adjust", "font-synthesis", "font-variation-settings", "forced-color-adjust", "gap", "grid", "grid-area", "grid-column", "grid-row", "grid-template", "hanging-punctuation", "height", "hyphenate-character", "hyphenate-limit-chars", "hyphens", "image-orientation", "image-rendering", "image-resolution", "initial-letter", "input-security", "inset", "isolation", "justify-tracks", "letter-spacing", "line-break", "line-clamp", "line-height-step", "list-style", "margin", "mask", "mask-border", "math-depth", "math-shift", "math-style", "max-height", "max-width", "min-height", "min-width", "mix-blend-mode", "object-fit", "object-position", "offset", "opacity", "order", "orphans", "outline", "overflow", "overscroll-behavior", "padding", "page", "paint-order", "perspective", "perspective-origin", "place-content", "place-items", "place-self", "pointer-events", "position", "print-color-adjust", "quotes", "resize", "rotate", "ruby-position", "scale", "scroll-behavior", "scroll-margin", "scroll-padding", "scroll-snap-align", "scroll-snap-stop", "scroll-snap-type", "scroll-timeline", "scrollbar-color", "scrollbar-gutter", "scrollbar-width", "shape-image-threshold", "shape-margin", "shape-outside", "tab-size", "table-layout", "text-align", "text-align-last", "text-combine-upright", "text-decoration", "text-decoration-skip-ink", "text-emphasis", "text-emphasis-position", "text-indent", "text-justify", "text-orientation", "text-overflow", "text-rendering", "text-shadow", "text-size-adjust", "text-transform", "text-underline-offset", "text-underline-position", "touch-action", "transform", "transform-box", "transform-origin", "transform-style", "transition", "translate", "unicode-bidi", "user-select", "vertical-align", "view-transition-name", "visibility", "white-space", "widows", "width", "will-change", "word-break", "word-spacing", "word-wrap", "writing-mode", "z-index", "zoom"], ["animation-composition", "animation-delay", "animation-direction", "animation-duration", "animation-fill-mode", "animation-iteration-count", "animation-name", "animation-play-state", "animation-timeline", "animation-timing-function", "background-attachment", "background-blend-mode", "background-clip", "background-color", "background-image", "background-origin", "background-position", "background-position-x", "background-position-y", "background-repeat", "background-size", "border-top", "border-right", "border-bottom", "border-left", "border-top-left-radius", "border-top-right-radius", "border-bottom-left-radius", "border-bottom-right-radius", "caret-color", "caret-shape", "column-rule-color", "column-rule-style", "column-rule-width", "column-count", "column-width", "contain-intrinsic-width", "contain-intrinsic-height", "container-name", "container-type", "flex-grow", "flex-shrink", "flex-basis", "flex-direction", "flex-wrap", "font-style", "font-variant", "font-weight", "font-stretch", "font-size", "font-family", "row-gap", "column-gap", "grid-auto-columns", "grid-auto-flow", "grid-auto-rows", "grid-template-areas", "grid-template-columns", "grid-template-rows", "grid-row-start", "grid-column-start", "grid-row-end", "grid-column-end", "top", "right", "bottom", "left", "line-height", "list-style-image", "list-style-position", "list-style-type", "margin-top", "margin-right", "margin-bottom", "margin-left", "mask-border-mode", "mask-border-outset", "mask-border-repeat", "mask-border-slice", "mask-border-source", "mask-border-width", "mask-clip", "mask-composite", "mask-image", "mask-mode", "mask-origin", "mask-position", "mask-repeat", "mask-size", "mask-type", "offset-anchor", "offset-distance", "offset-path", "offset-position", "offset-rotate", "outline-color", "outline-offset", "outline-style", "outline-width", "overflow-anchor", "overflow-clip-margin", "overflow-wrap", "overflow-x", "overflow-y", "overscroll-behavior-x", "overscroll-behavior-y", "padding-top", "padding-right", "padding-bottom", "padding-left", "align-content", "justify-content", "align-items", "justify-items", "align-self", "justify-self", "scroll-margin-top", "scroll-margin-right", "scroll-margin-bottom", "scroll-margin-left", "scroll-padding-top", "scroll-padding-right", "scroll-padding-bottom", "scroll-padding-left", "scroll-timeline-axis", "scroll-timeline-name", "text-decoration-color", "text-decoration-line", "text-decoration-style", "text-decoration-thickness", "text-emphasis-color", "text-emphasis-style", "transition-delay", "transition-duration", "transition-property", "transition-timing-function"], ["border-style", "border-color", "border-width", "border-image", "font-variant-alternates", "font-variant-caps", "font-variant-east-asian", "font-variant-emoji", "font-variant-ligatures", "font-variant-numeric", "font-variant-position"], ["border-top-color", "border-top-style", "border-top-width", "border-right-color", "border-right-style", "border-right-width", "border-bottom-color", "border-bottom-style", "border-bottom-width", "border-left-color", "border-left-style", "border-left-width", "border-image-outset", "border-image-repeat", "border-image-slice", "border-image-source", "border-image-width"], ["block-size", "border-block", "border-inline", "contain-intrinsic-block-size", "contain-intrinsic-inline-size", "inline-size", "inset-block", "inset-inline", "margin-block", "margin-inline", "max-block-size", "min-block-size", "max-inline-size", "min-inline-size", "overflow-block", "overflow-inline", "overscroll-behavior-block", "overscroll-behavior-inline", "padding-block", "padding-inline", "scroll-margin-block", "scroll-margin-inline", "scroll-padding-block", "scroll-padding-inline"], ["border-block-width", "border-block-style", "border-block-color", "border-block-start", "border-block-end", "border-inline-color", "border-inline-style", "border-inline-width", "border-inline-start", "border-inline-end", "inset-block-end", "inset-block-start", "inset-inline-end", "inset-inline-start", "margin-block-end", "margin-block-start", "margin-inline-end", "margin-inline-start", "padding-block-end", "padding-block-start", "padding-inline-end", "padding-inline-start", "scroll-margin-block-end", "scroll-margin-block-start", "scroll-margin-inline-end", "scroll-margin-inline-start", "scroll-padding-block-end", "scroll-padding-block-start", "scroll-padding-inline-end", "scroll-padding-inline-start"], ["border-start-end-radius", "border-start-start-radius", "border-end-end-radius", "border-end-start-radius", "border-block-start-color", "border-block-start-style", "border-block-start-width", "border-block-end-color", "border-block-end-style", "border-block-end-width", "border-inline-start-color", "border-inline-start-style", "border-inline-start-width", "border-inline-end-color", "border-inline-end-style", "border-inline-end-width"]];
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
type Flatten<T> = {
|
|
3
|
+
[K in keyof T]: T[K] extends Array<infer E> ? E : T[K];
|
|
4
|
+
};
|
|
5
|
+
type CSSProperty = Flatten<typeof layers>[number];
|
|
6
|
+
declare const properties: CSSProperty;
|
|
4
7
|
|
|
5
8
|
type DeepReadonly<T> = T extends any[] ? T : {
|
|
6
9
|
readonly [P in keyof T]: DeepReadonly<T[P]>;
|
|
@@ -185,44 +188,8 @@ declare const defaultConfig: {
|
|
|
185
188
|
};
|
|
186
189
|
};
|
|
187
190
|
type DefaultConfig = typeof defaultConfig;
|
|
188
|
-
|
|
189
|
-
type GridProperty = '--_grid';
|
|
190
|
-
declare const GridProperty: {
|
|
191
|
-
safeParse: (input: unknown) => Validated<"--_grid">;
|
|
192
|
-
};
|
|
193
|
-
declare function gridProperty(): GridProperty;
|
|
194
|
-
type GridValue = number;
|
|
195
|
-
declare const GridValue: {
|
|
196
|
-
safeParse: (input: unknown) => Validated<number>;
|
|
197
|
-
};
|
|
198
|
-
type TokenProperty<P extends string = string> = `--${P}`;
|
|
199
|
-
declare const TokenProperty: {
|
|
200
|
-
safeParse: (input: unknown) => Validated<`--${string}`>;
|
|
201
|
-
};
|
|
202
|
-
declare function tokenProperty(name: string): TokenProperty;
|
|
203
|
-
type VariantProperty<P extends string = string, V extends string = string> = `--${V}_${P}`;
|
|
204
|
-
declare const VariantProperty: {
|
|
205
|
-
safeParse: (input: unknown) => Validated<`--${string}_${string}`>;
|
|
206
|
-
};
|
|
207
|
-
declare function variantProperty(variant: string, name: string): TokenProperty;
|
|
208
|
-
type TokenValue<TK extends string = string, V extends string = string> = `var(--${TK}_${V})`;
|
|
209
|
-
declare const TokenValue: {
|
|
210
|
-
safeParse: (input: unknown) => Validated<`var(--${string}_${string})`>;
|
|
211
|
-
};
|
|
212
|
-
declare function tokenValue<TK extends string, N extends string>(themeKey: TK, name: N): TokenValue<TK, N>;
|
|
213
|
-
type ArbitraryValue = `var(---,${string})`;
|
|
214
|
-
declare const ArbitraryValue: {
|
|
215
|
-
safeParse: (input: unknown) => Validated<`var(---,${string})`>;
|
|
216
|
-
};
|
|
217
|
-
declare function arbitraryValue(value: string): ArbitraryValue;
|
|
218
|
-
type Validated<T> = {
|
|
219
|
-
success: true;
|
|
220
|
-
output: T;
|
|
221
|
-
} | {
|
|
222
|
-
success: false;
|
|
223
|
-
};
|
|
224
191
|
type Exact<T, V extends T> = Exclude<keyof V, keyof T> extends never ? V : T;
|
|
225
|
-
declare function createConfig<T extends Config>(obj: Exact<Config, T>):
|
|
192
|
+
declare function createConfig<T extends Config>(obj: Exact<Config, T>): {
|
|
226
193
|
include: never[];
|
|
227
194
|
grid: string;
|
|
228
195
|
responsive: {};
|
|
@@ -373,7 +340,43 @@ declare function createConfig<T extends Config>(obj: Exact<Config, T>): Omit<{
|
|
|
373
340
|
width: ("grid" | "size")[];
|
|
374
341
|
'z-index': "z"[];
|
|
375
342
|
};
|
|
376
|
-
}
|
|
343
|
+
} & DeepReadonly<T>;
|
|
344
|
+
|
|
345
|
+
type GridProperty = '--_grid';
|
|
346
|
+
declare const GridProperty: {
|
|
347
|
+
safeParse: (input: unknown) => Validated<"--_grid">;
|
|
348
|
+
};
|
|
349
|
+
declare function gridProperty(): GridProperty;
|
|
350
|
+
type GridValue = number;
|
|
351
|
+
declare const GridValue: {
|
|
352
|
+
safeParse: (input: unknown) => Validated<number>;
|
|
353
|
+
};
|
|
354
|
+
type TokenProperty<P extends string = string> = `--${P}`;
|
|
355
|
+
declare const TokenProperty: {
|
|
356
|
+
safeParse: (input: unknown) => Validated<`--${string}`>;
|
|
357
|
+
};
|
|
358
|
+
declare function tokenProperty(name: string): TokenProperty;
|
|
359
|
+
type VariantProperty<P extends string = string, V extends string = string> = `--${V}_${P}`;
|
|
360
|
+
declare const VariantProperty: {
|
|
361
|
+
safeParse: (input: unknown) => Validated<`--${string}_${string}`>;
|
|
362
|
+
};
|
|
363
|
+
declare function variantProperty(variant: string, name: string): TokenProperty;
|
|
364
|
+
type TokenValue<TK extends string = string, V extends string = string> = `var(--${TK}_${V})`;
|
|
365
|
+
declare const TokenValue: {
|
|
366
|
+
safeParse: (input: unknown) => Validated<`var(--${string}_${string})`>;
|
|
367
|
+
};
|
|
368
|
+
declare function tokenValue<TK extends string, N extends string>(themeKey: TK, name: N): TokenValue<TK, N>;
|
|
369
|
+
type ArbitraryValue = `var(---,${string})`;
|
|
370
|
+
declare const ArbitraryValue: {
|
|
371
|
+
safeParse: (input: unknown) => Validated<`var(---,${string})`>;
|
|
372
|
+
};
|
|
373
|
+
declare function arbitraryValue(value: string): ArbitraryValue;
|
|
374
|
+
type Validated<T> = {
|
|
375
|
+
success: true;
|
|
376
|
+
output: T;
|
|
377
|
+
} | {
|
|
378
|
+
success: false;
|
|
379
|
+
};
|
|
377
380
|
declare function getTokenPropertyName(tokenProperty: TokenProperty): string;
|
|
378
381
|
declare function getTokenPropertySplit(tokenProperty: TokenProperty): {
|
|
379
382
|
alias: string;
|
package/dist/index.js
CHANGED
|
@@ -44,7 +44,7 @@ __export(src_exports, {
|
|
|
44
44
|
});
|
|
45
45
|
module.exports = __toCommonJS(src_exports);
|
|
46
46
|
|
|
47
|
-
// src/config.
|
|
47
|
+
// src/config.ts
|
|
48
48
|
var defaultConfig = {
|
|
49
49
|
include: [],
|
|
50
50
|
grid: "0.25rem",
|
|
@@ -197,8 +197,12 @@ var defaultConfig = {
|
|
|
197
197
|
"z-index": ["z"]
|
|
198
198
|
}
|
|
199
199
|
};
|
|
200
|
+
function createConfig(obj) {
|
|
201
|
+
const readonlyConfig = obj;
|
|
202
|
+
return { ...defaultConfig, ...readonlyConfig };
|
|
203
|
+
}
|
|
200
204
|
|
|
201
|
-
// src/
|
|
205
|
+
// src/common.ts
|
|
202
206
|
var gridPropertyRegex = /--_grid/;
|
|
203
207
|
var GridProperty = {
|
|
204
208
|
safeParse: (input) => validate(gridPropertyRegex, input)
|
|
@@ -250,9 +254,6 @@ function validate(regex, input) {
|
|
|
250
254
|
return { success: false };
|
|
251
255
|
}
|
|
252
256
|
}
|
|
253
|
-
function createConfig(obj) {
|
|
254
|
-
return obj;
|
|
255
|
-
}
|
|
256
257
|
function getTokenPropertyName(tokenProperty2) {
|
|
257
258
|
return tokenProperty2.replace(tokenPropertyRegex, "$1");
|
|
258
259
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// src/config.
|
|
1
|
+
// src/config.ts
|
|
2
2
|
var defaultConfig = {
|
|
3
3
|
include: [],
|
|
4
4
|
grid: "0.25rem",
|
|
@@ -151,8 +151,12 @@ var defaultConfig = {
|
|
|
151
151
|
"z-index": ["z"]
|
|
152
152
|
}
|
|
153
153
|
};
|
|
154
|
+
function createConfig(obj) {
|
|
155
|
+
const readonlyConfig = obj;
|
|
156
|
+
return { ...defaultConfig, ...readonlyConfig };
|
|
157
|
+
}
|
|
154
158
|
|
|
155
|
-
// src/
|
|
159
|
+
// src/common.ts
|
|
156
160
|
var gridPropertyRegex = /--_grid/;
|
|
157
161
|
var GridProperty = {
|
|
158
162
|
safeParse: (input) => validate(gridPropertyRegex, input)
|
|
@@ -204,9 +208,6 @@ function validate(regex, input) {
|
|
|
204
208
|
return { success: false };
|
|
205
209
|
}
|
|
206
210
|
}
|
|
207
|
-
function createConfig(obj) {
|
|
208
|
-
return obj;
|
|
209
|
-
}
|
|
210
211
|
function getTokenPropertyName(tokenProperty2) {
|
|
211
212
|
return tokenProperty2.replace(tokenPropertyRegex, "$1");
|
|
212
213
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tokenami/config",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.34",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"csstype": "^3.1.2",
|
|
15
15
|
"tsup": "^7.0.0",
|
|
16
16
|
"typescript": "^5.1.3",
|
|
17
|
-
"@tokenami/dev": "0.0.
|
|
17
|
+
"@tokenami/dev": "0.0.34"
|
|
18
18
|
},
|
|
19
19
|
"scripts": {
|
|
20
20
|
"build": "tsup src/index.ts --format=esm,cjs --dts",
|