@styleframe/theme 2.5.0 → 3.0.0
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/CHANGELOG.md +18 -0
- package/dist/theme.d.ts +183 -0
- package/dist/theme.js +2385 -2095
- package/dist/theme.umd.cjs +4 -4
- package/package.json +7 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @styleframe/theme
|
|
2
2
|
|
|
3
|
+
## 3.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [#117](https://github.com/styleframe-dev/styleframe/pull/117) [`ffe6764`](https://github.com/styleframe-dev/styleframe/commit/ffe6764a2e6c84d5b3cfdf431bf11f17a3f3f118) Thanks [@alexgrozav](https://github.com/alexgrozav)! - Introduce global Styleframe single-instance architecture. Extension files (`*.styleframe.ts`) now share the same instance created in `styleframe.config.ts` instead of creating independent instances. This is a breaking change that affects how styles are imported and composed across files.
|
|
8
|
+
|
|
9
|
+
### Minor Changes
|
|
10
|
+
|
|
11
|
+
- [#81](https://github.com/styleframe-dev/styleframe/pull/81) [`266f961`](https://github.com/styleframe-dev/styleframe/commit/266f96143e9ffb47e0e6326d0e5e7cc9d974ab83) Thanks [@alexgrozav](https://github.com/alexgrozav)! - Add Badge recipe with createUseRecipe factory
|
|
12
|
+
- Add `useBadgeRecipe` and `useBadgeRecipeBase` recipe composables with color, variant, and size variants
|
|
13
|
+
- Add `createUseRecipe` factory utility for building reusable, customizable recipe presets
|
|
14
|
+
- Add `3xs` and `2xs` font-size values
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- Updated dependencies [[`266f961`](https://github.com/styleframe-dev/styleframe/commit/266f96143e9ffb47e0e6326d0e5e7cc9d974ab83), [`ffe6764`](https://github.com/styleframe-dev/styleframe/commit/ffe6764a2e6c84d5b3cfdf431bf11f17a3f3f118)]:
|
|
19
|
+
- @styleframe/core@3.0.0
|
|
20
|
+
|
|
3
21
|
## 2.5.0
|
|
4
22
|
|
|
5
23
|
### Minor Changes
|
package/dist/theme.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CamelCase } from 'scule';
|
|
2
2
|
import { ModifierFactory } from '@styleframe/core';
|
|
3
|
+
import { Recipe } from '@styleframe/core';
|
|
3
4
|
import { Reference } from '@styleframe/core';
|
|
4
5
|
import { Styleframe } from '@styleframe/core';
|
|
5
6
|
import { TokenValue } from '@styleframe/core';
|
|
@@ -7,6 +8,7 @@ import { UtilityAutogenerateFn } from '@styleframe/core';
|
|
|
7
8
|
import { UtilityCallbackFn } from '@styleframe/core';
|
|
8
9
|
import { UtilityCreatorFn } from '@styleframe/core';
|
|
9
10
|
import { Variable } from '@styleframe/core';
|
|
11
|
+
import { VariantDeclarationsBlock } from '@styleframe/core';
|
|
10
12
|
|
|
11
13
|
/**
|
|
12
14
|
* Default align-content utility values matching Tailwind CSS.
|
|
@@ -430,8 +432,12 @@ export declare interface CreateMultiplierAutogenerateOptions {
|
|
|
430
432
|
fallback?: string;
|
|
431
433
|
/** Optional key replacer function for non-multiplier values */
|
|
432
434
|
replacer?: (key: string) => string;
|
|
435
|
+
/** Optional namespace for token references (e.g., "spacing" makes "@sm" resolve to ref("spacing.sm")) */
|
|
436
|
+
namespace?: string | string[];
|
|
433
437
|
}
|
|
434
438
|
|
|
439
|
+
export declare function createUseRecipe<Name extends string, Variants extends Record<string, Record<string, VariantDeclarationsBlock>>, Config extends RecipeConfig<Variants>>(name: Name, defaults: Config): (s: Styleframe, options?: DeepPartial<Config>) => Recipe<Name, Variants>;
|
|
440
|
+
|
|
435
441
|
/**
|
|
436
442
|
* Creates a composable function for spacing-based CSS utilities with multiplier support.
|
|
437
443
|
*
|
|
@@ -475,6 +481,11 @@ export declare interface CreateUseSpacingUtilityOptions<Defaults extends Record<
|
|
|
475
481
|
* Only used when baseVariable is a string. Defaults to "1rem".
|
|
476
482
|
*/
|
|
477
483
|
fallback?: string;
|
|
484
|
+
/**
|
|
485
|
+
* Optional namespace for token references in autogenerate.
|
|
486
|
+
* When set, "@sm" in array syntax resolves to ref("namespace.sm").
|
|
487
|
+
*/
|
|
488
|
+
namespace?: string;
|
|
478
489
|
}
|
|
479
490
|
|
|
480
491
|
/**
|
|
@@ -512,6 +523,11 @@ export declare interface CreateUseUtilityOptions<Defaults extends Record<string,
|
|
|
512
523
|
defaults?: Defaults;
|
|
513
524
|
/** Whether to merge user values with defaults (true) or replace them (false) */
|
|
514
525
|
mergeDefaults?: boolean;
|
|
526
|
+
/**
|
|
527
|
+
* Optional namespace for token references in autogenerate.
|
|
528
|
+
* When set, "@sm" in array syntax resolves to ref("namespace.sm").
|
|
529
|
+
*/
|
|
530
|
+
namespace?: string | string[];
|
|
515
531
|
}
|
|
516
532
|
|
|
517
533
|
/**
|
|
@@ -602,6 +618,10 @@ export declare const cursorValues: {
|
|
|
602
618
|
"zoom-out": string;
|
|
603
619
|
};
|
|
604
620
|
|
|
621
|
+
export declare type DeepPartial<T> = {
|
|
622
|
+
[P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
|
|
623
|
+
};
|
|
624
|
+
|
|
605
625
|
declare type DefaultBorderRadius = typeof borderRadiusValues;
|
|
606
626
|
|
|
607
627
|
declare type DefaultBorderStyle = typeof borderStyleValues;
|
|
@@ -861,6 +881,8 @@ export declare const fontFamilyValues: {
|
|
|
861
881
|
|
|
862
882
|
export declare const fontSizeValues: {
|
|
863
883
|
default: string;
|
|
884
|
+
"3xs": string;
|
|
885
|
+
"2xs": string;
|
|
864
886
|
xs: string;
|
|
865
887
|
sm: string;
|
|
866
888
|
md: string;
|
|
@@ -1231,6 +1253,20 @@ export declare const positionValues: {
|
|
|
1231
1253
|
sticky: string;
|
|
1232
1254
|
};
|
|
1233
1255
|
|
|
1256
|
+
export declare type RecipeConfig<Variants extends Record<string, Record<string, VariantDeclarationsBlock>> = Record<string, Record<string, VariantDeclarationsBlock>>> = {
|
|
1257
|
+
base?: VariantDeclarationsBlock;
|
|
1258
|
+
variants?: Variants;
|
|
1259
|
+
defaultVariants?: {
|
|
1260
|
+
[K in keyof Variants]?: keyof Variants[K] & string;
|
|
1261
|
+
};
|
|
1262
|
+
compoundVariants?: Array<{
|
|
1263
|
+
match: {
|
|
1264
|
+
[K in keyof Variants]?: keyof Variants[K] & string;
|
|
1265
|
+
};
|
|
1266
|
+
css: VariantDeclarationsBlock;
|
|
1267
|
+
}>;
|
|
1268
|
+
};
|
|
1269
|
+
|
|
1234
1270
|
/**
|
|
1235
1271
|
* Default resize utility values matching Tailwind CSS.
|
|
1236
1272
|
*/
|
|
@@ -1724,6 +1760,151 @@ export declare const useBackgroundSizeUtility: <T extends Record<string, TokenVa
|
|
|
1724
1760
|
*/
|
|
1725
1761
|
export declare const useBackgroundUtility: <T extends Record<string, TokenValue> = Record<string, TokenValue>>(s: Styleframe, values?: T | undefined, modifiers?: ModifierFactory[]) => UtilityCreatorFn;
|
|
1726
1762
|
|
|
1763
|
+
/**
|
|
1764
|
+
* Full badge recipe with color, variant, and size variants.
|
|
1765
|
+
* Includes all Nuxt UI-inspired styling options.
|
|
1766
|
+
*/
|
|
1767
|
+
export declare const useBadgeRecipe: (s: Styleframe, options?: DeepPartial< {
|
|
1768
|
+
base: {
|
|
1769
|
+
display: string;
|
|
1770
|
+
alignItems: string;
|
|
1771
|
+
fontWeight: string;
|
|
1772
|
+
borderWidth: string;
|
|
1773
|
+
borderStyle: string;
|
|
1774
|
+
borderColor: string;
|
|
1775
|
+
};
|
|
1776
|
+
variants: {
|
|
1777
|
+
color: {
|
|
1778
|
+
primary: {};
|
|
1779
|
+
secondary: {};
|
|
1780
|
+
success: {};
|
|
1781
|
+
info: {};
|
|
1782
|
+
warning: {};
|
|
1783
|
+
danger: {};
|
|
1784
|
+
};
|
|
1785
|
+
variant: {
|
|
1786
|
+
solid: {};
|
|
1787
|
+
outline: {};
|
|
1788
|
+
soft: {};
|
|
1789
|
+
subtle: {};
|
|
1790
|
+
};
|
|
1791
|
+
size: {
|
|
1792
|
+
xs: {
|
|
1793
|
+
fontSize: string;
|
|
1794
|
+
lineHeight: string;
|
|
1795
|
+
paddingTop: string;
|
|
1796
|
+
paddingBottom: string;
|
|
1797
|
+
paddingLeft: string;
|
|
1798
|
+
paddingRight: string;
|
|
1799
|
+
gap: string;
|
|
1800
|
+
borderRadius: string;
|
|
1801
|
+
};
|
|
1802
|
+
sm: {
|
|
1803
|
+
fontSize: string;
|
|
1804
|
+
lineHeight: string;
|
|
1805
|
+
paddingTop: string;
|
|
1806
|
+
paddingBottom: string;
|
|
1807
|
+
paddingLeft: string;
|
|
1808
|
+
paddingRight: string;
|
|
1809
|
+
gap: string;
|
|
1810
|
+
borderRadius: string;
|
|
1811
|
+
};
|
|
1812
|
+
md: {
|
|
1813
|
+
fontSize: string;
|
|
1814
|
+
paddingTop: string;
|
|
1815
|
+
paddingBottom: string;
|
|
1816
|
+
paddingLeft: string;
|
|
1817
|
+
paddingRight: string;
|
|
1818
|
+
gap: string;
|
|
1819
|
+
borderRadius: string;
|
|
1820
|
+
};
|
|
1821
|
+
lg: {
|
|
1822
|
+
fontSize: string;
|
|
1823
|
+
paddingTop: string;
|
|
1824
|
+
paddingBottom: string;
|
|
1825
|
+
paddingLeft: string;
|
|
1826
|
+
paddingRight: string;
|
|
1827
|
+
gap: string;
|
|
1828
|
+
borderRadius: string;
|
|
1829
|
+
};
|
|
1830
|
+
xl: {
|
|
1831
|
+
fontSize: string;
|
|
1832
|
+
paddingTop: string;
|
|
1833
|
+
paddingBottom: string;
|
|
1834
|
+
paddingLeft: string;
|
|
1835
|
+
paddingRight: string;
|
|
1836
|
+
gap: string;
|
|
1837
|
+
borderRadius: string;
|
|
1838
|
+
};
|
|
1839
|
+
};
|
|
1840
|
+
};
|
|
1841
|
+
compoundVariants: ({
|
|
1842
|
+
match: {
|
|
1843
|
+
color: "primary" | "secondary" | "success" | "warning" | "danger" | "info";
|
|
1844
|
+
variant: "solid";
|
|
1845
|
+
};
|
|
1846
|
+
css: {
|
|
1847
|
+
background: string;
|
|
1848
|
+
color: string;
|
|
1849
|
+
borderColor?: undefined;
|
|
1850
|
+
};
|
|
1851
|
+
} | {
|
|
1852
|
+
match: {
|
|
1853
|
+
color: "primary" | "secondary" | "success" | "warning" | "danger" | "info";
|
|
1854
|
+
variant: "outline";
|
|
1855
|
+
};
|
|
1856
|
+
css: {
|
|
1857
|
+
color: string;
|
|
1858
|
+
borderColor: string;
|
|
1859
|
+
background?: undefined;
|
|
1860
|
+
};
|
|
1861
|
+
} | {
|
|
1862
|
+
match: {
|
|
1863
|
+
color: "primary" | "secondary" | "success" | "warning" | "danger" | "info";
|
|
1864
|
+
variant: "soft";
|
|
1865
|
+
};
|
|
1866
|
+
css: {
|
|
1867
|
+
background: string;
|
|
1868
|
+
color: string;
|
|
1869
|
+
borderColor?: undefined;
|
|
1870
|
+
};
|
|
1871
|
+
} | {
|
|
1872
|
+
match: {
|
|
1873
|
+
color: "primary" | "secondary" | "success" | "warning" | "danger" | "info";
|
|
1874
|
+
variant: "subtle";
|
|
1875
|
+
};
|
|
1876
|
+
css: {
|
|
1877
|
+
background: string;
|
|
1878
|
+
color: string;
|
|
1879
|
+
borderColor: string;
|
|
1880
|
+
};
|
|
1881
|
+
})[];
|
|
1882
|
+
defaultVariants: {
|
|
1883
|
+
color: "primary";
|
|
1884
|
+
variant: "solid";
|
|
1885
|
+
size: "sm";
|
|
1886
|
+
};
|
|
1887
|
+
}> | undefined) => Recipe<"badge", Record<string, Record<string, VariantDeclarationsBlock>>>;
|
|
1888
|
+
|
|
1889
|
+
/**
|
|
1890
|
+
* Base badge styling - core appearance without variants.
|
|
1891
|
+
* Use this when you want to define your own custom variants.
|
|
1892
|
+
*/
|
|
1893
|
+
export declare const useBadgeRecipeBase: (s: Styleframe, options?: DeepPartial< {
|
|
1894
|
+
base: {
|
|
1895
|
+
display: string;
|
|
1896
|
+
alignItems: string;
|
|
1897
|
+
fontWeight: string;
|
|
1898
|
+
fontSize: string;
|
|
1899
|
+
lineHeight: string;
|
|
1900
|
+
paddingTop: string;
|
|
1901
|
+
paddingBottom: string;
|
|
1902
|
+
paddingLeft: string;
|
|
1903
|
+
paddingRight: string;
|
|
1904
|
+
borderRadius: string;
|
|
1905
|
+
};
|
|
1906
|
+
}> | undefined) => Recipe<"badge", Record<string, Record<string, VariantDeclarationsBlock>>>;
|
|
1907
|
+
|
|
1727
1908
|
/**
|
|
1728
1909
|
* Create blur utility classes.
|
|
1729
1910
|
*
|
|
@@ -2864,6 +3045,8 @@ export declare const useFontFamilyUtility: <T extends Record<string, TokenValue>
|
|
|
2864
3045
|
*/
|
|
2865
3046
|
export declare const useFontSize: <T extends Record<string, TokenValue> = {
|
|
2866
3047
|
default: string;
|
|
3048
|
+
"3xs": string;
|
|
3049
|
+
"2xs": string;
|
|
2867
3050
|
xs: string;
|
|
2868
3051
|
sm: string;
|
|
2869
3052
|
md: string;
|