@likec4/styles 1.49.0 → 1.50.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/jsx/is-valid-prop.mjs +1 -1
- package/dist/types/csstype.d.mts +6405 -5133
- package/dist/types/style-props.d.mts +2748 -2163
- package/dist/types/system-types.d.mts +14 -132
- package/package.json +9 -9
- package/preset/_chunks/libs/remeda.mjs +29 -23
- package/preset/preset.mjs +16 -0
|
@@ -22,140 +22,9 @@ export type Assign<T, U> = {
|
|
|
22
22
|
* Native css properties
|
|
23
23
|
* -----------------------------------------------------------------------------*/
|
|
24
24
|
|
|
25
|
-
type
|
|
26
|
-
|
|
27
|
-
type StringToMultiple<T extends string> = T | `${T}, ${T}`
|
|
28
|
-
|
|
29
|
-
export type PositionAreaAxis =
|
|
30
|
-
| 'left'
|
|
31
|
-
| 'center'
|
|
32
|
-
| 'right'
|
|
33
|
-
| 'x-start'
|
|
34
|
-
| 'x-end'
|
|
35
|
-
| 'span-x-start'
|
|
36
|
-
| 'span-x-end'
|
|
37
|
-
| 'x-self-start'
|
|
38
|
-
| 'x-self-end'
|
|
39
|
-
| 'span-x-self-start'
|
|
40
|
-
| 'span-x-self-end'
|
|
41
|
-
| 'span-all'
|
|
42
|
-
| 'top'
|
|
43
|
-
| 'bottom'
|
|
44
|
-
| 'span-top'
|
|
45
|
-
| 'span-bottom'
|
|
46
|
-
| 'y-start'
|
|
47
|
-
| 'y-end'
|
|
48
|
-
| 'span-y-start'
|
|
49
|
-
| 'span-y-end'
|
|
50
|
-
| 'y-self-start'
|
|
51
|
-
| 'y-self-end'
|
|
52
|
-
| 'span-y-self-start'
|
|
53
|
-
| 'span-y-self-end'
|
|
54
|
-
| 'block-start'
|
|
55
|
-
| 'block-end'
|
|
56
|
-
| 'span-block-start'
|
|
57
|
-
| 'span-block-end'
|
|
58
|
-
| 'inline-start'
|
|
59
|
-
| 'inline-end'
|
|
60
|
-
| 'span-inline-start'
|
|
61
|
-
| 'span-inline-end'
|
|
62
|
-
| 'self-block-start'
|
|
63
|
-
| 'self-block-end'
|
|
64
|
-
| 'span-self-block-start'
|
|
65
|
-
| 'span-self-block-end'
|
|
66
|
-
| 'self-inline-start'
|
|
67
|
-
| 'self-inline-end'
|
|
68
|
-
| 'span-self-inline-start'
|
|
69
|
-
| 'span-self-inline-end'
|
|
70
|
-
| 'start'
|
|
71
|
-
| 'end'
|
|
72
|
-
| 'span-start'
|
|
73
|
-
| 'span-end'
|
|
74
|
-
| 'self-start'
|
|
75
|
-
| 'self-end'
|
|
76
|
-
| 'span-self-start'
|
|
77
|
-
| 'span-self-end'
|
|
78
|
-
|
|
79
|
-
type PositionTry =
|
|
80
|
-
| 'normal'
|
|
81
|
-
| 'flip-block'
|
|
82
|
-
| 'flip-inline'
|
|
83
|
-
| 'top'
|
|
84
|
-
| 'bottom'
|
|
85
|
-
| 'left'
|
|
86
|
-
| 'right'
|
|
87
|
-
| 'block-start'
|
|
88
|
-
| 'block-end'
|
|
89
|
-
| 'inline-start'
|
|
90
|
-
| 'inline-end'
|
|
91
|
-
| DashedIdent
|
|
25
|
+
type CornerShapeValue = 'round' | 'square' | 'bevel' | 'scoop' | 'notch' | 'squircle' | `superellipse(${number})`
|
|
92
26
|
|
|
93
27
|
export interface ModernCssProperties {
|
|
94
|
-
/**
|
|
95
|
-
* Defines a name for the anchor element that can be referenced by positioned elements.
|
|
96
|
-
*/
|
|
97
|
-
anchorName?: Globals | 'none' | DashedIdent | StringToMultiple<DashedIdent>
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
* Defines the scope of anchor names within the element.
|
|
101
|
-
*/
|
|
102
|
-
anchorScope?: Globals | 'none' | 'all' | DashedIdent | StringToMultiple<DashedIdent>
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* Controls how form elements size themselves.
|
|
106
|
-
*/
|
|
107
|
-
fieldSizing?: Globals | 'fixed' | 'content'
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
* Controls whether interpolation of size values should allow keywords.
|
|
111
|
-
*/
|
|
112
|
-
interpolateSize?: Globals | 'allow-keywords' | 'numeric-only'
|
|
113
|
-
|
|
114
|
-
/**
|
|
115
|
-
* Specifies the anchor element that this positioned element should be positioned relative to.
|
|
116
|
-
*/
|
|
117
|
-
positionAnchor?: Globals | 'auto' | DashedIdent
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* Specifies the area within the anchor element where this positioned element should be placed.
|
|
121
|
-
*/
|
|
122
|
-
positionArea?: Globals | 'auto' | PositionAreaAxis | `${PositionAreaAxis} ${PositionAreaAxis}` | String
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* Specifies the position try options for the element.
|
|
126
|
-
*/
|
|
127
|
-
positionTry?: Globals | StringToMultiple<PositionTry> | String
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
* Specifies fallback position try options when the primary position fails.
|
|
131
|
-
*/
|
|
132
|
-
positionTryFallback?: Globals | 'none' | StringToMultiple<PositionTry> | String
|
|
133
|
-
|
|
134
|
-
/**
|
|
135
|
-
* Specifies the order in which position try options should be attempted.
|
|
136
|
-
*/
|
|
137
|
-
positionTryOrder?: Globals | 'normal' | 'most-width' | 'most-height' | 'most-block-size' | 'most-inline-size'
|
|
138
|
-
|
|
139
|
-
/**
|
|
140
|
-
* Controls when the positioned element should be visible.
|
|
141
|
-
*/
|
|
142
|
-
positionVisibility?: Globals | 'always' | 'anchors-visible' | 'no-overflow'
|
|
143
|
-
|
|
144
|
-
/**
|
|
145
|
-
* Controls whether text should wrap or not.
|
|
146
|
-
*/
|
|
147
|
-
textWrapMode?: Globals | 'wrap' | 'nowrap'
|
|
148
|
-
|
|
149
|
-
/**
|
|
150
|
-
* Controls trimming of spacing in text.
|
|
151
|
-
*/
|
|
152
|
-
textSpacingTrim?: Globals | 'normal' | 'space-all' | 'space-first' | 'trim-start'
|
|
153
|
-
|
|
154
|
-
/**
|
|
155
|
-
* Controls the style of text wrapping.
|
|
156
|
-
*/
|
|
157
|
-
textWrapStyle?: Globals | 'auto' | 'balance' | 'pretty' | 'stable'
|
|
158
|
-
|
|
159
28
|
/**
|
|
160
29
|
* Controls whether the entire element should be draggable instead of its contents.
|
|
161
30
|
*/
|
|
@@ -180,6 +49,19 @@ export interface ModernCssProperties {
|
|
|
180
49
|
* Controls the display of text content for security purposes (e.g., password fields).
|
|
181
50
|
*/
|
|
182
51
|
WebkitTextSecurity?: Globals | 'none' | 'circle' | 'disc' | 'square'
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Specifies the shape of a box's corners within the area defined by the border-radius property.
|
|
55
|
+
* @experimental
|
|
56
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/corner-shape
|
|
57
|
+
*/
|
|
58
|
+
cornerShape?:
|
|
59
|
+
| Globals
|
|
60
|
+
| CornerShapeValue
|
|
61
|
+
| `${CornerShapeValue} ${CornerShapeValue}`
|
|
62
|
+
| `${CornerShapeValue} ${CornerShapeValue} ${CornerShapeValue}`
|
|
63
|
+
| `${CornerShapeValue} ${CornerShapeValue} ${CornerShapeValue} ${CornerShapeValue}`
|
|
64
|
+
| String
|
|
183
65
|
}
|
|
184
66
|
|
|
185
67
|
export type CssProperty = keyof PropertiesFallback
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@likec4/styles",
|
|
3
3
|
"description": "Shared PandaCSS preset and generated styles, used in LikeC4",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"version": "1.
|
|
5
|
+
"version": "1.50.0",
|
|
6
6
|
"bugs": "https://github.com/likec4/likec4/issues",
|
|
7
7
|
"homepage": "https://likec4.dev",
|
|
8
8
|
"author": "Denis Davydkov <denis@davydkov.com>",
|
|
@@ -77,10 +77,10 @@
|
|
|
77
77
|
}
|
|
78
78
|
},
|
|
79
79
|
"dependencies": {
|
|
80
|
-
"@pandacss/types": "^1.8.
|
|
80
|
+
"@pandacss/types": "^1.8.2"
|
|
81
81
|
},
|
|
82
82
|
"peerDependencies": {
|
|
83
|
-
"@pandacss/dev": "^1.8.
|
|
83
|
+
"@pandacss/dev": "^1.8.2",
|
|
84
84
|
"react": "^18.x || ^19.x"
|
|
85
85
|
},
|
|
86
86
|
"peerDependenciesMeta": {
|
|
@@ -92,21 +92,21 @@
|
|
|
92
92
|
}
|
|
93
93
|
},
|
|
94
94
|
"devDependencies": {
|
|
95
|
-
"@types/node": "~22.19.
|
|
95
|
+
"@types/node": "~22.19.11",
|
|
96
96
|
"@pandabox/panda-plugins": "^0.0.8",
|
|
97
97
|
"@pandabox/utils": "^0.0.5",
|
|
98
98
|
"@pandabox/unplugin": "^0.2.2",
|
|
99
|
-
"@pandacss/dev": "^1.8.
|
|
99
|
+
"@pandacss/dev": "^1.8.2",
|
|
100
100
|
"@types/picomatch": "^4.0.2",
|
|
101
|
-
"@types/react": "19.2.
|
|
101
|
+
"@types/react": "19.2.14",
|
|
102
102
|
"postcss": "8.5.6",
|
|
103
103
|
"remeda": "^2.33.5",
|
|
104
104
|
"nano-spawn": "^2.0.0",
|
|
105
|
-
"obuild": "^0.4.
|
|
105
|
+
"obuild": "^0.4.31",
|
|
106
106
|
"typescript": "5.9.3",
|
|
107
|
-
"@likec4/style-preset": "1.
|
|
107
|
+
"@likec4/style-preset": "1.50.0",
|
|
108
108
|
"@likec4/devops": "1.42.0",
|
|
109
|
-
"@likec4/tsconfig": "1.
|
|
109
|
+
"@likec4/tsconfig": "1.50.0"
|
|
110
110
|
},
|
|
111
111
|
"scripts": {
|
|
112
112
|
"typecheck": "tsc --noEmit",
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
function e$
|
|
1
|
+
function e$4(e, t, n) {
|
|
2
2
|
let r = (n) => e(n, ...t);
|
|
3
3
|
return n === void 0 ? r : Object.assign(r, {
|
|
4
4
|
lazy: n,
|
|
5
5
|
lazyArgs: t
|
|
6
6
|
});
|
|
7
7
|
}
|
|
8
|
-
function t$
|
|
8
|
+
function t$10(t, n, r) {
|
|
9
9
|
let i = t.length - n.length;
|
|
10
10
|
if (i === 0) return t(...n);
|
|
11
|
-
if (i === 1) return e$
|
|
11
|
+
if (i === 1) return e$4(t, n, r);
|
|
12
12
|
throw Error(`Wrong number of arguments`);
|
|
13
13
|
}
|
|
14
|
-
function t$
|
|
15
|
-
return t$
|
|
14
|
+
function t$9(...t) {
|
|
15
|
+
return t$10(n$6, t);
|
|
16
16
|
}
|
|
17
|
-
const n$6 = (e) => `${e[0]?.toUpperCase() ?? ``}${e.slice(1)}`, t$
|
|
17
|
+
const n$6 = (e) => `${e[0]?.toUpperCase() ?? ``}${e.slice(1)}`, t$8 = {
|
|
18
18
|
done: !1,
|
|
19
19
|
hasNext: !1
|
|
20
20
|
};
|
|
21
|
-
function t$
|
|
21
|
+
function t$7(e, ...t) {
|
|
22
22
|
let a = e, o = t.map((e) => `lazy` in e ? r(e) : void 0), s = 0;
|
|
23
23
|
for (; s < t.length;) {
|
|
24
24
|
if (o[s] === void 0 || !i(a)) {
|
|
@@ -40,7 +40,7 @@ function t$6(e, ...t) {
|
|
|
40
40
|
}
|
|
41
41
|
function n$4(t, r, i) {
|
|
42
42
|
if (i.length === 0) return r.push(t), !1;
|
|
43
|
-
let a = t, o = t$
|
|
43
|
+
let a = t, o = t$8, s = !1;
|
|
44
44
|
for (let [e, t] of i.entries()) {
|
|
45
45
|
let { index: c, items: l } = t;
|
|
46
46
|
if (l.push(a), o = t(a, c, l), t.index += 1, o.hasNext) {
|
|
@@ -66,18 +66,18 @@ function r(e) {
|
|
|
66
66
|
function i(e) {
|
|
67
67
|
return typeof e == `string` || typeof e == `object` && !!e && Symbol.iterator in e;
|
|
68
68
|
}
|
|
69
|
-
function t$
|
|
70
|
-
return t$
|
|
69
|
+
function t$6(...t) {
|
|
70
|
+
return t$10(n$3, t);
|
|
71
71
|
}
|
|
72
72
|
const n$3 = (e, t) => e.length >= t;
|
|
73
|
-
function e$
|
|
73
|
+
function e$2(e) {
|
|
74
74
|
return typeof e == `string`;
|
|
75
75
|
}
|
|
76
|
-
function t$
|
|
77
|
-
return t$
|
|
76
|
+
function t$5(...t) {
|
|
77
|
+
return t$10(Object.keys, t);
|
|
78
78
|
}
|
|
79
|
-
function t$
|
|
80
|
-
return t$
|
|
79
|
+
function t$4(...t) {
|
|
80
|
+
return t$10(n$2, t);
|
|
81
81
|
}
|
|
82
82
|
function n$2(e, t) {
|
|
83
83
|
let n = {};
|
|
@@ -87,8 +87,8 @@ function n$2(e, t) {
|
|
|
87
87
|
}
|
|
88
88
|
return n;
|
|
89
89
|
}
|
|
90
|
-
function t$
|
|
91
|
-
return t$
|
|
90
|
+
function t$3(...t) {
|
|
91
|
+
return t$10(n$1, t);
|
|
92
92
|
}
|
|
93
93
|
function n$1(e, t) {
|
|
94
94
|
let n = {};
|
|
@@ -98,18 +98,18 @@ function n$1(e, t) {
|
|
|
98
98
|
}
|
|
99
99
|
return n;
|
|
100
100
|
}
|
|
101
|
-
function t$
|
|
102
|
-
return t$
|
|
101
|
+
function t$2(...t) {
|
|
102
|
+
return t$10(n, t);
|
|
103
103
|
}
|
|
104
104
|
function n(e, t) {
|
|
105
105
|
let n = {};
|
|
106
106
|
for (let [r, i] of Object.entries(e)) n[r] = t(i, r, e);
|
|
107
107
|
return n;
|
|
108
108
|
}
|
|
109
|
-
function e(e, ...n) {
|
|
110
|
-
return typeof e == `string` || typeof e == `number` || typeof e == `symbol` ? (r) => t(r, e, ...n) : t(e, ...n);
|
|
109
|
+
function e$1(e, ...n) {
|
|
110
|
+
return typeof e == `string` || typeof e == `number` || typeof e == `symbol` ? (r) => t$1(r, e, ...n) : t$1(e, ...n);
|
|
111
111
|
}
|
|
112
|
-
function t(e, ...t) {
|
|
112
|
+
function t$1(e, ...t) {
|
|
113
113
|
let n = e;
|
|
114
114
|
for (let e of t) {
|
|
115
115
|
if (n == null) return;
|
|
@@ -117,4 +117,10 @@ function t(e, ...t) {
|
|
|
117
117
|
}
|
|
118
118
|
return n;
|
|
119
119
|
}
|
|
120
|
-
|
|
120
|
+
new Set([
|
|
121
|
+
`-`,
|
|
122
|
+
`_`,
|
|
123
|
+
...` .
|
|
124
|
+
.\v.\f.\r. .
.\xA0. . . . . . . . . . . . .\u2028.\u2029. . . .`.split(`.`)
|
|
125
|
+
]);
|
|
126
|
+
export { t$5 as a, t$7 as c, t$4 as i, t$9 as l, t$2 as n, e$2 as o, t$3 as r, t$6 as s, e$1 as t };
|
package/preset/preset.mjs
CHANGED
|
@@ -55,6 +55,16 @@ function readName(key) {
|
|
|
55
55
|
let name = e(vars, ...path);
|
|
56
56
|
return e$1(name) ? name : void 0;
|
|
57
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* Returns a CSS variable declaration string.
|
|
60
|
+
*
|
|
61
|
+
* If `defaultTo` is not provided, returns a string like `var(--likec4-palette-fill)`.
|
|
62
|
+
* If `defaultTo` is a Vars or string, returns a string like `var(--likec4-palette-fill, var(--default-to))`.
|
|
63
|
+
*
|
|
64
|
+
* @param key - The name of the CSS variable to generate.
|
|
65
|
+
* @param defaultTo - An optional string, Vars, or object to use as the default value.
|
|
66
|
+
* @returns A CSS variable declaration string.
|
|
67
|
+
*/
|
|
58
68
|
function __v(key, defaultTo) {
|
|
59
69
|
let name = readName(key);
|
|
60
70
|
if (!name) throw new Error(`Unknown var: ${key}`);
|
|
@@ -1300,6 +1310,12 @@ const mantine = {
|
|
|
1300
1310
|
darkSelector: "[data-mantine-color-scheme=\"dark\"] &",
|
|
1301
1311
|
lightSelector: "[data-mantine-color-scheme=\"light\"] &"
|
|
1302
1312
|
};
|
|
1313
|
+
/**
|
|
1314
|
+
* Changes the alpha channel of a color
|
|
1315
|
+
* @param color color value or CSS variable
|
|
1316
|
+
* @param percentage Alpha channel value
|
|
1317
|
+
* @returns
|
|
1318
|
+
*/
|
|
1303
1319
|
function alpha(color, percentage = 50) {
|
|
1304
1320
|
let alpha = percentage;
|
|
1305
1321
|
if (typeof percentage === "number") {
|