@marigold/system 11.1.0 → 11.2.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/dist/index.d.mts +20 -1
- package/dist/index.d.ts +20 -1
- package/dist/index.js +7 -1
- package/dist/index.mjs +5 -1
- package/package.json +7 -6
package/dist/index.d.mts
CHANGED
|
@@ -76,6 +76,25 @@ declare const createVar: (o: {
|
|
|
76
76
|
* Based on: https://github.com/developit/dlv
|
|
77
77
|
*/
|
|
78
78
|
declare const get: (obj: object, path: string, fallback?: any) => any;
|
|
79
|
+
/**
|
|
80
|
+
* Checks if a given string is a valid CSS custom property name (without the leading `--`).
|
|
81
|
+
*
|
|
82
|
+
* This simplified check ensures:
|
|
83
|
+
* - The name does not start with a digit.
|
|
84
|
+
* - It contains only word characters (letters, digits, underscore) or hyphens.
|
|
85
|
+
* - It must include at least one hyphen to be considered a custom property name.
|
|
86
|
+
*/
|
|
87
|
+
declare const isValidCssCustomPropertyName: (val: string) => boolean;
|
|
88
|
+
/**
|
|
89
|
+
* Ensures that the given value is formatted as a CSS variable reference.
|
|
90
|
+
*
|
|
91
|
+
* If the provided value (`val`) is a valid CSS custom property name (without the leading `--`),
|
|
92
|
+
* the function returns a string in the form of `var(--<prefix-if-provided><val>, <val>)`. When a
|
|
93
|
+
* `prefix` is provided, it is prepended to the custom property name with a hyphen.
|
|
94
|
+
*
|
|
95
|
+
* If the value is not a valid custom property name, the function returns the original value.
|
|
96
|
+
*/
|
|
97
|
+
declare const ensureCssVar: (val: string, prefix?: string) => string;
|
|
79
98
|
|
|
80
99
|
interface NestedStringObject {
|
|
81
100
|
[key: string]: NestedStringObject | string;
|
|
@@ -943,4 +962,4 @@ type HeightProp = {
|
|
|
943
962
|
height?: keyof typeof height;
|
|
944
963
|
};
|
|
945
964
|
|
|
946
|
-
export { type AlignmentProp, type AspectProp, type ComponentClassNames, type ComponentNames, type ComponentState, type ComponentStyleFunction, type Config, type ConfigSchema, type ConfigVariants, type ConfigVariantsMulti, type CursorProp, DateFormat, type FontSizeProp, type FontStyleProp, type FontWeightProp, type GapSpaceProp, type HeightProp, type NestedStringObject, NumericFormat, type ObjectFitProp, type ObjectPositionProp, type PaddingBottomProp, type PaddingLeftProp, type PaddingRightProp, type PaddingSpaceProp, type PaddingSpacePropX, type PaddingSpacePropY, type PaddingTopProp, type PlaceItemsProp, type Props, SVG, type SVGProps, type StateAttrKeyProps, type StateAttrProps, type StylesProps, type TextAlignProp, type Theme, type ThemeComponent, ThemeProvider, type ThemeProviderProps, type UseClassNamesProps, type UseStateProps, type WidthProp, alignment, aspect, cn, createVar, cursorStyle, cva, defaultTheme, extendTheme, fontWeight, gapSpace, get, height, objectFit, objectPosition, paddingBottom, paddingLeft, paddingRight, paddingSpace, paddingSpaceX, paddingSpaceY, paddingTop, placeItems, textAlign, textSize, textStyle, useClassNames, useResponsiveValue, useSmallScreen, useStateProps, useTheme, width };
|
|
965
|
+
export { type AlignmentProp, type AspectProp, type ComponentClassNames, type ComponentNames, type ComponentState, type ComponentStyleFunction, type Config, type ConfigSchema, type ConfigVariants, type ConfigVariantsMulti, type CursorProp, DateFormat, type FontSizeProp, type FontStyleProp, type FontWeightProp, type GapSpaceProp, type HeightProp, type NestedStringObject, NumericFormat, type ObjectFitProp, type ObjectPositionProp, type PaddingBottomProp, type PaddingLeftProp, type PaddingRightProp, type PaddingSpaceProp, type PaddingSpacePropX, type PaddingSpacePropY, type PaddingTopProp, type PlaceItemsProp, type Props, SVG, type SVGProps, type StateAttrKeyProps, type StateAttrProps, type StylesProps, type TextAlignProp, type Theme, type ThemeComponent, ThemeProvider, type ThemeProviderProps, type UseClassNamesProps, type UseStateProps, type WidthProp, alignment, aspect, cn, createVar, cursorStyle, cva, defaultTheme, ensureCssVar, extendTheme, fontWeight, gapSpace, get, height, isValidCssCustomPropertyName, objectFit, objectPosition, paddingBottom, paddingLeft, paddingRight, paddingSpace, paddingSpaceX, paddingSpaceY, paddingTop, placeItems, textAlign, textSize, textStyle, useClassNames, useResponsiveValue, useSmallScreen, useStateProps, useTheme, width };
|
package/dist/index.d.ts
CHANGED
|
@@ -76,6 +76,25 @@ declare const createVar: (o: {
|
|
|
76
76
|
* Based on: https://github.com/developit/dlv
|
|
77
77
|
*/
|
|
78
78
|
declare const get: (obj: object, path: string, fallback?: any) => any;
|
|
79
|
+
/**
|
|
80
|
+
* Checks if a given string is a valid CSS custom property name (without the leading `--`).
|
|
81
|
+
*
|
|
82
|
+
* This simplified check ensures:
|
|
83
|
+
* - The name does not start with a digit.
|
|
84
|
+
* - It contains only word characters (letters, digits, underscore) or hyphens.
|
|
85
|
+
* - It must include at least one hyphen to be considered a custom property name.
|
|
86
|
+
*/
|
|
87
|
+
declare const isValidCssCustomPropertyName: (val: string) => boolean;
|
|
88
|
+
/**
|
|
89
|
+
* Ensures that the given value is formatted as a CSS variable reference.
|
|
90
|
+
*
|
|
91
|
+
* If the provided value (`val`) is a valid CSS custom property name (without the leading `--`),
|
|
92
|
+
* the function returns a string in the form of `var(--<prefix-if-provided><val>, <val>)`. When a
|
|
93
|
+
* `prefix` is provided, it is prepended to the custom property name with a hyphen.
|
|
94
|
+
*
|
|
95
|
+
* If the value is not a valid custom property name, the function returns the original value.
|
|
96
|
+
*/
|
|
97
|
+
declare const ensureCssVar: (val: string, prefix?: string) => string;
|
|
79
98
|
|
|
80
99
|
interface NestedStringObject {
|
|
81
100
|
[key: string]: NestedStringObject | string;
|
|
@@ -943,4 +962,4 @@ type HeightProp = {
|
|
|
943
962
|
height?: keyof typeof height;
|
|
944
963
|
};
|
|
945
964
|
|
|
946
|
-
export { type AlignmentProp, type AspectProp, type ComponentClassNames, type ComponentNames, type ComponentState, type ComponentStyleFunction, type Config, type ConfigSchema, type ConfigVariants, type ConfigVariantsMulti, type CursorProp, DateFormat, type FontSizeProp, type FontStyleProp, type FontWeightProp, type GapSpaceProp, type HeightProp, type NestedStringObject, NumericFormat, type ObjectFitProp, type ObjectPositionProp, type PaddingBottomProp, type PaddingLeftProp, type PaddingRightProp, type PaddingSpaceProp, type PaddingSpacePropX, type PaddingSpacePropY, type PaddingTopProp, type PlaceItemsProp, type Props, SVG, type SVGProps, type StateAttrKeyProps, type StateAttrProps, type StylesProps, type TextAlignProp, type Theme, type ThemeComponent, ThemeProvider, type ThemeProviderProps, type UseClassNamesProps, type UseStateProps, type WidthProp, alignment, aspect, cn, createVar, cursorStyle, cva, defaultTheme, extendTheme, fontWeight, gapSpace, get, height, objectFit, objectPosition, paddingBottom, paddingLeft, paddingRight, paddingSpace, paddingSpaceX, paddingSpaceY, paddingTop, placeItems, textAlign, textSize, textStyle, useClassNames, useResponsiveValue, useSmallScreen, useStateProps, useTheme, width };
|
|
965
|
+
export { type AlignmentProp, type AspectProp, type ComponentClassNames, type ComponentNames, type ComponentState, type ComponentStyleFunction, type Config, type ConfigSchema, type ConfigVariants, type ConfigVariantsMulti, type CursorProp, DateFormat, type FontSizeProp, type FontStyleProp, type FontWeightProp, type GapSpaceProp, type HeightProp, type NestedStringObject, NumericFormat, type ObjectFitProp, type ObjectPositionProp, type PaddingBottomProp, type PaddingLeftProp, type PaddingRightProp, type PaddingSpaceProp, type PaddingSpacePropX, type PaddingSpacePropY, type PaddingTopProp, type PlaceItemsProp, type Props, SVG, type SVGProps, type StateAttrKeyProps, type StateAttrProps, type StylesProps, type TextAlignProp, type Theme, type ThemeComponent, ThemeProvider, type ThemeProviderProps, type UseClassNamesProps, type UseStateProps, type WidthProp, alignment, aspect, cn, createVar, cursorStyle, cva, defaultTheme, ensureCssVar, extendTheme, fontWeight, gapSpace, get, height, isValidCssCustomPropertyName, objectFit, objectPosition, paddingBottom, paddingLeft, paddingRight, paddingSpace, paddingSpaceX, paddingSpaceY, paddingTop, placeItems, textAlign, textSize, textStyle, useClassNames, useResponsiveValue, useSmallScreen, useStateProps, useTheme, width };
|
package/dist/index.js
CHANGED
|
@@ -41,11 +41,13 @@ __export(index_exports, {
|
|
|
41
41
|
cursorStyle: () => cursorStyle,
|
|
42
42
|
cva: () => cva,
|
|
43
43
|
defaultTheme: () => defaultTheme,
|
|
44
|
+
ensureCssVar: () => ensureCssVar,
|
|
44
45
|
extendTheme: () => extendTheme,
|
|
45
46
|
fontWeight: () => fontWeight,
|
|
46
47
|
gapSpace: () => gapSpace,
|
|
47
48
|
get: () => get,
|
|
48
49
|
height: () => height,
|
|
50
|
+
isValidCssCustomPropertyName: () => isValidCssCustomPropertyName,
|
|
49
51
|
objectFit: () => objectFit,
|
|
50
52
|
objectPosition: () => objectPosition,
|
|
51
53
|
paddingBottom: () => paddingBottom,
|
|
@@ -94,6 +96,8 @@ var get = (obj, path, fallback) => {
|
|
|
94
96
|
}
|
|
95
97
|
return result === void 0 ? fallback : result;
|
|
96
98
|
};
|
|
99
|
+
var isValidCssCustomPropertyName = (val) => /^[A-Za-z0-9_-]+$/.test(val);
|
|
100
|
+
var ensureCssVar = (val, prefix) => isValidCssCustomPropertyName(val) ? `var(--${prefix ? `${prefix}-` : ""}${val}, ${val})` : val;
|
|
97
101
|
|
|
98
102
|
// src/components/SVG/SVG.tsx
|
|
99
103
|
var SVG = (0, import_react.forwardRef)(
|
|
@@ -106,7 +110,7 @@ var SVG = (0, import_react.forwardRef)(
|
|
|
106
110
|
width: `${props.width || size}px`,
|
|
107
111
|
height: `${props.height || size}px`,
|
|
108
112
|
className: cn("flex-none fill-current", className),
|
|
109
|
-
style: { color: color &&
|
|
113
|
+
style: { color: color && ensureCssVar(color, "color") }
|
|
110
114
|
},
|
|
111
115
|
children
|
|
112
116
|
);
|
|
@@ -903,11 +907,13 @@ var cursorStyle = {
|
|
|
903
907
|
cursorStyle,
|
|
904
908
|
cva,
|
|
905
909
|
defaultTheme,
|
|
910
|
+
ensureCssVar,
|
|
906
911
|
extendTheme,
|
|
907
912
|
fontWeight,
|
|
908
913
|
gapSpace,
|
|
909
914
|
get,
|
|
910
915
|
height,
|
|
916
|
+
isValidCssCustomPropertyName,
|
|
911
917
|
objectFit,
|
|
912
918
|
objectPosition,
|
|
913
919
|
paddingBottom,
|
package/dist/index.mjs
CHANGED
|
@@ -24,6 +24,8 @@ var get = (obj, path, fallback) => {
|
|
|
24
24
|
}
|
|
25
25
|
return result === void 0 ? fallback : result;
|
|
26
26
|
};
|
|
27
|
+
var isValidCssCustomPropertyName = (val) => /^[A-Za-z0-9_-]+$/.test(val);
|
|
28
|
+
var ensureCssVar = (val, prefix) => isValidCssCustomPropertyName(val) ? `var(--${prefix ? `${prefix}-` : ""}${val}, ${val})` : val;
|
|
27
29
|
|
|
28
30
|
// src/components/SVG/SVG.tsx
|
|
29
31
|
var SVG = forwardRef(
|
|
@@ -36,7 +38,7 @@ var SVG = forwardRef(
|
|
|
36
38
|
width: `${props.width || size}px`,
|
|
37
39
|
height: `${props.height || size}px`,
|
|
38
40
|
className: cn("flex-none fill-current", className),
|
|
39
|
-
style: { color: color &&
|
|
41
|
+
style: { color: color && ensureCssVar(color, "color") }
|
|
40
42
|
},
|
|
41
43
|
children
|
|
42
44
|
);
|
|
@@ -832,11 +834,13 @@ export {
|
|
|
832
834
|
cursorStyle,
|
|
833
835
|
cva,
|
|
834
836
|
defaultTheme,
|
|
837
|
+
ensureCssVar,
|
|
835
838
|
extendTheme,
|
|
836
839
|
fontWeight,
|
|
837
840
|
gapSpace,
|
|
838
841
|
get,
|
|
839
842
|
height,
|
|
843
|
+
isValidCssCustomPropertyName,
|
|
840
844
|
objectFit,
|
|
841
845
|
objectPosition,
|
|
842
846
|
paddingBottom,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@marigold/system",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.2.0",
|
|
4
4
|
"description": "Marigold System Library",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
@@ -29,18 +29,19 @@
|
|
|
29
29
|
"deepmerge": "4.3.1",
|
|
30
30
|
"react-fast-compare": "3.2.2",
|
|
31
31
|
"tailwind-merge": "2.6.0",
|
|
32
|
-
"@marigold/types": "1.
|
|
32
|
+
"@marigold/types": "1.3.0"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
|
-
"react": "
|
|
36
|
-
"react-dom": "
|
|
35
|
+
"react": ">=17.0.0",
|
|
36
|
+
"react-dom": ">=17.0.0"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@babel/core": "7.26.
|
|
39
|
+
"@babel/core": "7.26.9",
|
|
40
40
|
"postcss": "8.5.2",
|
|
41
41
|
"react": "19.0.0",
|
|
42
|
+
"@types/react": "19.0.8",
|
|
42
43
|
"tailwindcss": "4.0.6",
|
|
43
|
-
"tsup": "8.3.
|
|
44
|
+
"tsup": "8.3.6",
|
|
44
45
|
"@marigold/tsconfig": "0.4.0"
|
|
45
46
|
},
|
|
46
47
|
"scripts": {
|