@splenddev/kreativ-ui 0.3.20 → 0.3.22
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/Select.types-CIRmqiVe.d.cts +264 -0
- package/dist/Select.types-CIRmqiVe.d.ts +264 -0
- package/dist/{chunk-P63AGDBG.js → chunk-CQUJK47V.js} +5265 -2561
- package/dist/chunk-CQUJK47V.js.map +1 -0
- package/dist/{chunk-C4PCJAAL.js → chunk-D4IXLW5S.js} +34 -3
- package/dist/chunk-D4IXLW5S.js.map +1 -0
- package/dist/{chunk-X7373GJO.js → chunk-HQEFPDPP.js} +421 -46
- package/dist/chunk-HQEFPDPP.js.map +1 -0
- package/dist/{chunk-JCJNV2P2.cjs → chunk-Q73HEANM.cjs} +5292 -2579
- package/dist/chunk-Q73HEANM.cjs.map +1 -0
- package/dist/{chunk-C2JEK4T5.cjs → chunk-TR5LTN5O.cjs} +423 -45
- package/dist/chunk-TR5LTN5O.cjs.map +1 -0
- package/dist/{chunk-5GGCRNXA.cjs → chunk-Z6CDH3CY.cjs} +34 -2
- package/dist/chunk-Z6CDH3CY.cjs.map +1 -0
- package/dist/components.cjs +139 -90
- package/dist/components.d.cts +626 -266
- package/dist/components.d.ts +626 -266
- package/dist/components.js +3 -2
- package/dist/core.cjs +17 -17
- package/dist/core.js +1 -1
- package/dist/index.cjs +12 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +73 -2
- package/dist/index.d.ts +73 -2
- package/dist/index.js +9 -8
- package/dist/index.js.map +1 -1
- package/dist/styles/index.css +1 -1
- package/dist/types.d.cts +4 -28
- package/dist/types.d.ts +4 -28
- package/dist/utils.cjs +39 -35
- package/dist/utils.d.cts +42 -2
- package/dist/utils.d.ts +42 -2
- package/dist/utils.js +1 -1
- package/package.json +4 -3
- package/dist/chunk-5GGCRNXA.cjs.map +0 -1
- package/dist/chunk-C2JEK4T5.cjs.map +0 -1
- package/dist/chunk-C4PCJAAL.js.map +0 -1
- package/dist/chunk-JCJNV2P2.cjs.map +0 -1
- package/dist/chunk-P63AGDBG.js.map +0 -1
- package/dist/chunk-X7373GJO.js.map +0 -1
package/dist/utils.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkZ6CDH3CY_cjs = require('./chunk-Z6CDH3CY.cjs');
|
|
4
4
|
var chunkPOSRGA6G_cjs = require('./chunk-POSRGA6G.cjs');
|
|
5
5
|
require('./chunk-MAUKS2DZ.cjs');
|
|
6
6
|
|
|
@@ -8,139 +8,143 @@ require('./chunk-MAUKS2DZ.cjs');
|
|
|
8
8
|
|
|
9
9
|
Object.defineProperty(exports, "composeRefs", {
|
|
10
10
|
enumerable: true,
|
|
11
|
-
get: function () { return
|
|
11
|
+
get: function () { return chunkZ6CDH3CY_cjs.composeRefs; }
|
|
12
12
|
});
|
|
13
13
|
Object.defineProperty(exports, "createComponent", {
|
|
14
14
|
enumerable: true,
|
|
15
|
-
get: function () { return
|
|
15
|
+
get: function () { return chunkZ6CDH3CY_cjs.createComponent; }
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "createFromProps", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: function () { return
|
|
19
|
+
get: function () { return chunkZ6CDH3CY_cjs.createFromProps; }
|
|
20
20
|
});
|
|
21
21
|
Object.defineProperty(exports, "cssToClass", {
|
|
22
22
|
enumerable: true,
|
|
23
|
-
get: function () { return
|
|
23
|
+
get: function () { return chunkZ6CDH3CY_cjs.cssToClass; }
|
|
24
24
|
});
|
|
25
25
|
Object.defineProperty(exports, "deepMerge", {
|
|
26
26
|
enumerable: true,
|
|
27
|
-
get: function () { return
|
|
27
|
+
get: function () { return chunkZ6CDH3CY_cjs.deepMerge; }
|
|
28
28
|
});
|
|
29
29
|
Object.defineProperty(exports, "hasKuiMeta", {
|
|
30
30
|
enumerable: true,
|
|
31
|
-
get: function () { return
|
|
31
|
+
get: function () { return chunkZ6CDH3CY_cjs.hasKuiMeta; }
|
|
32
32
|
});
|
|
33
33
|
Object.defineProperty(exports, "hashStyle", {
|
|
34
34
|
enumerable: true,
|
|
35
|
-
get: function () { return
|
|
35
|
+
get: function () { return chunkZ6CDH3CY_cjs.hashStyle; }
|
|
36
36
|
});
|
|
37
37
|
Object.defineProperty(exports, "hexToRgbString", {
|
|
38
38
|
enumerable: true,
|
|
39
|
-
get: function () { return
|
|
39
|
+
get: function () { return chunkZ6CDH3CY_cjs.hexToRgbString; }
|
|
40
40
|
});
|
|
41
41
|
Object.defineProperty(exports, "injectStyle", {
|
|
42
42
|
enumerable: true,
|
|
43
|
-
get: function () { return
|
|
43
|
+
get: function () { return chunkZ6CDH3CY_cjs.injectStyle; }
|
|
44
44
|
});
|
|
45
45
|
Object.defineProperty(exports, "isMotionGated", {
|
|
46
46
|
enumerable: true,
|
|
47
|
-
get: function () { return
|
|
47
|
+
get: function () { return chunkZ6CDH3CY_cjs.isMotionGated; }
|
|
48
48
|
});
|
|
49
49
|
Object.defineProperty(exports, "isResponsiveValue", {
|
|
50
50
|
enumerable: true,
|
|
51
|
-
get: function () { return
|
|
51
|
+
get: function () { return chunkZ6CDH3CY_cjs.isResponsiveValue; }
|
|
52
52
|
});
|
|
53
53
|
Object.defineProperty(exports, "kebabCase", {
|
|
54
54
|
enumerable: true,
|
|
55
|
-
get: function () { return
|
|
55
|
+
get: function () { return chunkZ6CDH3CY_cjs.kebabCase; }
|
|
56
56
|
});
|
|
57
57
|
Object.defineProperty(exports, "mergeResponsiveValue", {
|
|
58
58
|
enumerable: true,
|
|
59
|
-
get: function () { return
|
|
59
|
+
get: function () { return chunkZ6CDH3CY_cjs.mergeResponsiveValue; }
|
|
60
60
|
});
|
|
61
61
|
Object.defineProperty(exports, "registerStyle", {
|
|
62
62
|
enumerable: true,
|
|
63
|
-
get: function () { return
|
|
63
|
+
get: function () { return chunkZ6CDH3CY_cjs.registerStyle; }
|
|
64
64
|
});
|
|
65
65
|
Object.defineProperty(exports, "requireProvider", {
|
|
66
66
|
enumerable: true,
|
|
67
|
-
get: function () { return
|
|
67
|
+
get: function () { return chunkZ6CDH3CY_cjs.requireProvider; }
|
|
68
68
|
});
|
|
69
69
|
Object.defineProperty(exports, "resolveColor", {
|
|
70
70
|
enumerable: true,
|
|
71
|
-
get: function () { return
|
|
71
|
+
get: function () { return chunkZ6CDH3CY_cjs.resolveColor; }
|
|
72
|
+
});
|
|
73
|
+
Object.defineProperty(exports, "resolveColorToken", {
|
|
74
|
+
enumerable: true,
|
|
75
|
+
get: function () { return chunkZ6CDH3CY_cjs.resolveColorToken; }
|
|
72
76
|
});
|
|
73
77
|
Object.defineProperty(exports, "resolveFontSize", {
|
|
74
78
|
enumerable: true,
|
|
75
|
-
get: function () { return
|
|
79
|
+
get: function () { return chunkZ6CDH3CY_cjs.resolveFontSize; }
|
|
76
80
|
});
|
|
77
81
|
Object.defineProperty(exports, "resolveRadius", {
|
|
78
82
|
enumerable: true,
|
|
79
|
-
get: function () { return
|
|
83
|
+
get: function () { return chunkZ6CDH3CY_cjs.resolveRadius; }
|
|
80
84
|
});
|
|
81
85
|
Object.defineProperty(exports, "resolveResponsiveValue", {
|
|
82
86
|
enumerable: true,
|
|
83
|
-
get: function () { return
|
|
87
|
+
get: function () { return chunkZ6CDH3CY_cjs.resolveResponsiveValue; }
|
|
84
88
|
});
|
|
85
89
|
Object.defineProperty(exports, "resolveSemanticTokenReferences", {
|
|
86
90
|
enumerable: true,
|
|
87
|
-
get: function () { return
|
|
91
|
+
get: function () { return chunkZ6CDH3CY_cjs.resolveSemanticTokenReferences; }
|
|
88
92
|
});
|
|
89
93
|
Object.defineProperty(exports, "resolveSpace", {
|
|
90
94
|
enumerable: true,
|
|
91
|
-
get: function () { return
|
|
95
|
+
get: function () { return chunkZ6CDH3CY_cjs.resolveSpace; }
|
|
92
96
|
});
|
|
93
97
|
Object.defineProperty(exports, "resolveStyle", {
|
|
94
98
|
enumerable: true,
|
|
95
|
-
get: function () { return
|
|
99
|
+
get: function () { return chunkZ6CDH3CY_cjs.resolveStyle; }
|
|
96
100
|
});
|
|
97
101
|
Object.defineProperty(exports, "resolveToken", {
|
|
98
102
|
enumerable: true,
|
|
99
|
-
get: function () { return
|
|
103
|
+
get: function () { return chunkZ6CDH3CY_cjs.resolveToken; }
|
|
100
104
|
});
|
|
101
105
|
Object.defineProperty(exports, "resolveTokenReference", {
|
|
102
106
|
enumerable: true,
|
|
103
|
-
get: function () { return
|
|
107
|
+
get: function () { return chunkZ6CDH3CY_cjs.resolveTokenReference; }
|
|
104
108
|
});
|
|
105
109
|
Object.defineProperty(exports, "resolveTokens", {
|
|
106
110
|
enumerable: true,
|
|
107
|
-
get: function () { return
|
|
111
|
+
get: function () { return chunkZ6CDH3CY_cjs.resolveTokens; }
|
|
108
112
|
});
|
|
109
113
|
Object.defineProperty(exports, "resolveTypography", {
|
|
110
114
|
enumerable: true,
|
|
111
|
-
get: function () { return
|
|
115
|
+
get: function () { return chunkZ6CDH3CY_cjs.resolveTypography; }
|
|
112
116
|
});
|
|
113
117
|
Object.defineProperty(exports, "rgbToHex", {
|
|
114
118
|
enumerable: true,
|
|
115
|
-
get: function () { return
|
|
119
|
+
get: function () { return chunkZ6CDH3CY_cjs.rgbToHex; }
|
|
116
120
|
});
|
|
117
121
|
Object.defineProperty(exports, "serializeStyle", {
|
|
118
122
|
enumerable: true,
|
|
119
|
-
get: function () { return
|
|
123
|
+
get: function () { return chunkZ6CDH3CY_cjs.serializeStyle; }
|
|
120
124
|
});
|
|
121
125
|
Object.defineProperty(exports, "styleRegistry", {
|
|
122
126
|
enumerable: true,
|
|
123
|
-
get: function () { return
|
|
127
|
+
get: function () { return chunkZ6CDH3CY_cjs.styleRegistry; }
|
|
124
128
|
});
|
|
125
129
|
Object.defineProperty(exports, "toKebabCase", {
|
|
126
130
|
enumerable: true,
|
|
127
|
-
get: function () { return
|
|
131
|
+
get: function () { return chunkZ6CDH3CY_cjs.toKebabCase; }
|
|
128
132
|
});
|
|
129
133
|
Object.defineProperty(exports, "toResponsiveClasses", {
|
|
130
134
|
enumerable: true,
|
|
131
|
-
get: function () { return
|
|
135
|
+
get: function () { return chunkZ6CDH3CY_cjs.toResponsiveClasses; }
|
|
132
136
|
});
|
|
133
137
|
Object.defineProperty(exports, "tokensToCssVars", {
|
|
134
138
|
enumerable: true,
|
|
135
|
-
get: function () { return
|
|
139
|
+
get: function () { return chunkZ6CDH3CY_cjs.tokensToCssVars; }
|
|
136
140
|
});
|
|
137
141
|
Object.defineProperty(exports, "useValidateChildren", {
|
|
138
142
|
enumerable: true,
|
|
139
|
-
get: function () { return
|
|
143
|
+
get: function () { return chunkZ6CDH3CY_cjs.useValidateChildren; }
|
|
140
144
|
});
|
|
141
145
|
Object.defineProperty(exports, "warnOnFlatCompoundConflict", {
|
|
142
146
|
enumerable: true,
|
|
143
|
-
get: function () { return
|
|
147
|
+
get: function () { return chunkZ6CDH3CY_cjs.warnOnFlatCompoundConflict; }
|
|
144
148
|
});
|
|
145
149
|
Object.defineProperty(exports, "cn", {
|
|
146
150
|
enumerable: true,
|
package/dist/utils.d.cts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
export { c as cn } from './cn-Cbsgs0XP.cjs';
|
|
2
2
|
import { BaseColor, ColorProps, Size } from '@splenddev/kreativ-core/types';
|
|
3
|
-
import { SpaceValue } from './types.cjs';
|
|
3
|
+
import { S as SpaceValue } from './Select.types-CIRmqiVe.cjs';
|
|
4
4
|
export { composeRefs, createComponent, createFromProps, cssToClass, deepMerge, hasKuiMeta, hashStyle, injectStyle, isMotionGated, isResponsiveValue, kebabCase, mergeResponsiveValue, registerStyle, requireProvider, resolveFontSize, resolveResponsiveValue, resolveSemanticTokenReferences, resolveStyle, resolveToken, resolveTokenReference, resolveTokens, resolveTypography, serializeStyle, styleRegistry, toKebabCase, toResponsiveClasses, tokensToCssVars, useValidateChildren, warnOnFlatCompoundConflict } from '@splenddev/kreativ-core/utils';
|
|
5
5
|
import 'clsx';
|
|
6
6
|
import '@splenddev/kreativ-core';
|
|
7
|
+
import 'react';
|
|
8
|
+
import '@floating-ui/react';
|
|
7
9
|
|
|
8
10
|
/**
|
|
9
11
|
* Converts an RGB colour string to a 6‑digit uppercase hex string.
|
|
@@ -35,4 +37,42 @@ declare function resolveRadius(value: Size | number | string): string;
|
|
|
35
37
|
|
|
36
38
|
declare function resolveSpace(value: SpaceValue | undefined): string | undefined;
|
|
37
39
|
|
|
38
|
-
|
|
40
|
+
/**
|
|
41
|
+
* Turns a color prop value into something you can put straight into a CSS `color`,
|
|
42
|
+
* `background` or `border-color`.
|
|
43
|
+
*
|
|
44
|
+
* Accepted forms:
|
|
45
|
+
*
|
|
46
|
+
* | Input | Result |
|
|
47
|
+
* | -------------------------- | ---------------------------------------- |
|
|
48
|
+
* | `"{colors.blue.500}"` | `var(--kui-colors-blue-500)` |
|
|
49
|
+
* | `"brand"` | `var(--kui-colors-brand, brand)` |
|
|
50
|
+
* | `"blue.500"` | `var(--kui-colors-blue-500)` |
|
|
51
|
+
* | `"colors.blue.500"` | `var(--kui-colors-blue-500)` |
|
|
52
|
+
* | `"#ff0066"`, `"rgb(…)"`, `"var(--x)"` | unchanged |
|
|
53
|
+
* | `"transparent"`, `"currentColor"` | unchanged |
|
|
54
|
+
* | `undefined`, `""` | `undefined` |
|
|
55
|
+
*
|
|
56
|
+
* Semantic tokens (`brand`, `surface`, `destructive`, …) resolve to CSS variables, so they
|
|
57
|
+
* follow light/dark mode automatically — no theme lookup or re-render needed.
|
|
58
|
+
*
|
|
59
|
+
* A single bare word also carries itself as the `var()` fallback, so plain CSS color names
|
|
60
|
+
* that are not tokens (`"tomato"`) still render. Dotted paths have no fallback, since a path
|
|
61
|
+
* is never a valid CSS color.
|
|
62
|
+
*
|
|
63
|
+
* This is a pure string transform: it does not check that the token exists in the active theme.
|
|
64
|
+
* A reference to a missing token yields a `var()` that resolves to nothing.
|
|
65
|
+
*
|
|
66
|
+
* @param value A token reference, token path, semantic token name, or any CSS color.
|
|
67
|
+
* @returns A CSS color value, or `undefined` when `value` is empty.
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* ```ts
|
|
71
|
+
* resolveColorToken("brand"); // "var(--kui-colors-brand, brand)"
|
|
72
|
+
* resolveColorToken("{colors.red.500}"); // "var(--kui-colors-red-500)"
|
|
73
|
+
* resolveColorToken("#0af"); // "#0af"
|
|
74
|
+
* ```
|
|
75
|
+
*/
|
|
76
|
+
declare function resolveColorToken(value: string | null | undefined): string | undefined;
|
|
77
|
+
|
|
78
|
+
export { hexToRgbString, resolveColor, resolveColorToken, resolveRadius, resolveSpace, rgbToHex };
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
export { c as cn } from './cn-Cbsgs0XP.js';
|
|
2
2
|
import { BaseColor, ColorProps, Size } from '@splenddev/kreativ-core/types';
|
|
3
|
-
import { SpaceValue } from './types.js';
|
|
3
|
+
import { S as SpaceValue } from './Select.types-CIRmqiVe.js';
|
|
4
4
|
export { composeRefs, createComponent, createFromProps, cssToClass, deepMerge, hasKuiMeta, hashStyle, injectStyle, isMotionGated, isResponsiveValue, kebabCase, mergeResponsiveValue, registerStyle, requireProvider, resolveFontSize, resolveResponsiveValue, resolveSemanticTokenReferences, resolveStyle, resolveToken, resolveTokenReference, resolveTokens, resolveTypography, serializeStyle, styleRegistry, toKebabCase, toResponsiveClasses, tokensToCssVars, useValidateChildren, warnOnFlatCompoundConflict } from '@splenddev/kreativ-core/utils';
|
|
5
5
|
import 'clsx';
|
|
6
6
|
import '@splenddev/kreativ-core';
|
|
7
|
+
import 'react';
|
|
8
|
+
import '@floating-ui/react';
|
|
7
9
|
|
|
8
10
|
/**
|
|
9
11
|
* Converts an RGB colour string to a 6‑digit uppercase hex string.
|
|
@@ -35,4 +37,42 @@ declare function resolveRadius(value: Size | number | string): string;
|
|
|
35
37
|
|
|
36
38
|
declare function resolveSpace(value: SpaceValue | undefined): string | undefined;
|
|
37
39
|
|
|
38
|
-
|
|
40
|
+
/**
|
|
41
|
+
* Turns a color prop value into something you can put straight into a CSS `color`,
|
|
42
|
+
* `background` or `border-color`.
|
|
43
|
+
*
|
|
44
|
+
* Accepted forms:
|
|
45
|
+
*
|
|
46
|
+
* | Input | Result |
|
|
47
|
+
* | -------------------------- | ---------------------------------------- |
|
|
48
|
+
* | `"{colors.blue.500}"` | `var(--kui-colors-blue-500)` |
|
|
49
|
+
* | `"brand"` | `var(--kui-colors-brand, brand)` |
|
|
50
|
+
* | `"blue.500"` | `var(--kui-colors-blue-500)` |
|
|
51
|
+
* | `"colors.blue.500"` | `var(--kui-colors-blue-500)` |
|
|
52
|
+
* | `"#ff0066"`, `"rgb(…)"`, `"var(--x)"` | unchanged |
|
|
53
|
+
* | `"transparent"`, `"currentColor"` | unchanged |
|
|
54
|
+
* | `undefined`, `""` | `undefined` |
|
|
55
|
+
*
|
|
56
|
+
* Semantic tokens (`brand`, `surface`, `destructive`, …) resolve to CSS variables, so they
|
|
57
|
+
* follow light/dark mode automatically — no theme lookup or re-render needed.
|
|
58
|
+
*
|
|
59
|
+
* A single bare word also carries itself as the `var()` fallback, so plain CSS color names
|
|
60
|
+
* that are not tokens (`"tomato"`) still render. Dotted paths have no fallback, since a path
|
|
61
|
+
* is never a valid CSS color.
|
|
62
|
+
*
|
|
63
|
+
* This is a pure string transform: it does not check that the token exists in the active theme.
|
|
64
|
+
* A reference to a missing token yields a `var()` that resolves to nothing.
|
|
65
|
+
*
|
|
66
|
+
* @param value A token reference, token path, semantic token name, or any CSS color.
|
|
67
|
+
* @returns A CSS color value, or `undefined` when `value` is empty.
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* ```ts
|
|
71
|
+
* resolveColorToken("brand"); // "var(--kui-colors-brand, brand)"
|
|
72
|
+
* resolveColorToken("{colors.red.500}"); // "var(--kui-colors-red-500)"
|
|
73
|
+
* resolveColorToken("#0af"); // "#0af"
|
|
74
|
+
* ```
|
|
75
|
+
*/
|
|
76
|
+
declare function resolveColorToken(value: string | null | undefined): string | undefined;
|
|
77
|
+
|
|
78
|
+
export { hexToRgbString, resolveColor, resolveColorToken, resolveRadius, resolveSpace, rgbToHex };
|
package/dist/utils.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { composeRefs, createComponent, createFromProps, cssToClass, deepMerge, hasKuiMeta, hashStyle, hexToRgbString, injectStyle, isMotionGated, isResponsiveValue, kebabCase, mergeResponsiveValue, registerStyle, requireProvider, resolveColor, resolveFontSize, resolveRadius, resolveResponsiveValue, resolveSemanticTokenReferences, resolveSpace, resolveStyle, resolveToken, resolveTokenReference, resolveTokens, resolveTypography, rgbToHex, serializeStyle, styleRegistry, toKebabCase, toResponsiveClasses, tokensToCssVars, useValidateChildren, warnOnFlatCompoundConflict } from './chunk-
|
|
1
|
+
export { composeRefs, createComponent, createFromProps, cssToClass, deepMerge, hasKuiMeta, hashStyle, hexToRgbString, injectStyle, isMotionGated, isResponsiveValue, kebabCase, mergeResponsiveValue, registerStyle, requireProvider, resolveColor, resolveColorToken, resolveFontSize, resolveRadius, resolveResponsiveValue, resolveSemanticTokenReferences, resolveSpace, resolveStyle, resolveToken, resolveTokenReference, resolveTokens, resolveTypography, rgbToHex, serializeStyle, styleRegistry, toKebabCase, toResponsiveClasses, tokensToCssVars, useValidateChildren, warnOnFlatCompoundConflict } from './chunk-D4IXLW5S.js';
|
|
2
2
|
export { cn } from './chunk-6MO73J54.js';
|
|
3
3
|
import './chunk-CXR2HHQQ.js';
|
|
4
4
|
//# sourceMappingURL=utils.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@splenddev/kreativ-ui",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.22",
|
|
4
4
|
"description": "A modern, themeable React UI component library with runtime theming, Tailwind CSS v4, and accessible components.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": {
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"dist"
|
|
87
87
|
],
|
|
88
88
|
"scripts": {
|
|
89
|
-
"dev": "vite",
|
|
89
|
+
"dev": "vite --port 5174",
|
|
90
90
|
"test": "vitest",
|
|
91
91
|
"build": "tsup && npm run build:css",
|
|
92
92
|
"build:css": "npx @tailwindcss/cli -i ./src/styles/index.css -o ./dist/styles/index.css --minify",
|
|
@@ -98,13 +98,14 @@
|
|
|
98
98
|
},
|
|
99
99
|
"dependencies": {
|
|
100
100
|
"@floating-ui/react": "^0.27.20",
|
|
101
|
-
"@splenddev/kreativ-core": "^0.1.
|
|
101
|
+
"@splenddev/kreativ-core": "^0.1.30",
|
|
102
102
|
"@testing-library/react": "^16.3.3",
|
|
103
103
|
"class-variance-authority": "^0.7.1",
|
|
104
104
|
"clsx": "^2.1.1",
|
|
105
105
|
"framer-motion": "^12.42.2",
|
|
106
106
|
"lucide-react": "^1.25.0",
|
|
107
107
|
"react-remove-scroll": "^2.7.2",
|
|
108
|
+
"shiki": "^4.6.0",
|
|
108
109
|
"tailwind-merge": "^3.6.0",
|
|
109
110
|
"vitest": "^5.1.0"
|
|
110
111
|
},
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/utils/color.ts","../src/utils/resolveColor.ts","../src/utils/resolveRadius.ts","../src/utils/resolveSpace.ts"],"names":["__name"],"mappings":";;;;;;AAAA,IAAM,MAAA,GAAS,qCAAA;AAcR,SAAS,SAAS,KAAA,EAAuB;AAC9C,EAAA,MAAM,OAAA,GAAU,MAAM,IAAA,EAAK;AAE3B,EAAA,IAAI,MAAA,CAAO,IAAA,CAAK,OAAO,CAAA,EAAG;AACxB,IAAA,IACE,OAAA,CAAQ,MAAA,KAAW,CAAA,IAClB,OAAA,CAAQ,MAAA,KAAW,KAAK,CAAC,OAAA,CAAQ,UAAA,CAAW,GAAG,CAAA,EAChD;AACA,MAAA,MAAM,KAAA,GAAQ,OAAA,CAAQ,O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AAA,IAAI,SAAS,IAAA,CAAK,CAAC,CAAA,EAAG,OAAO,qBAAqB,CAAC,CAAA,CAAA,CAAA;AACnD,EAAA,OAAO,CAAA;AACT;AAVgBA,wBAAA,CAAA,YAAA,EAAA,cAAA,CAAA","file":"chunk-5GGCRNXA.cjs","sourcesContent":["const HEX_RE = /^#?([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/;\r\n\r\n/**\r\n * Converts an RGB colour string to a 6‑digit uppercase hex string.\r\n * Supports the following input formats:\r\n * - Hex: `\"#fff\"`, `\"#FFFFFF\"`\r\n * - CSS rgb/rgba: `\"rgb(255, 0, 0)\"`, `\"rgba(255, 0, 0, 0.5)\"`\r\n * - Space‑separated numbers: `\"255 0 0\"`\r\n * - Comma‑separated numbers: `\"255,0,0\"`\r\n *\r\n * @param value - The colour string to convert.\r\n * @returns A 6‑digit uppercase hex string (e.g. `\"#FF0000\"`).\r\n * If the input cannot be parsed, returns `\"#000000\"`.\r\n */\r\nexport function rgbToHex(value: string): string {\r\n const trimmed = value.trim();\r\n\r\n if (HEX_RE.test(trimmed)) {\r\n if (\r\n trimmed.length === 4 ||\r\n (trimmed.length === 3 && !trimmed.startsWith(\"#\"))\r\n ) {\r\n const clean = trimmed.replace(\"#\", \"\");\r\n const expanded = clean\r\n .split(\"\")\r\n .map((ch) => ch + ch)\r\n .join(\"\");\r\n return `#${expanded.toUpperCase()}`;\r\n }\r\n return trimmed.startsWith(\"#\")\r\n ? trimmed.toUpperCase()\r\n : `#${trimmed.toUpperCase()}`;\r\n }\r\n\r\n const stripped = trimmed\r\n .replace(/^rgba?\\(/i, \"\")\r\n .replace(/\\)$/, \"\")\r\n .trim();\r\n\r\n const parts = stripped.split(/[\\s,]+/).filter(Boolean);\r\n\r\n const numbers = parts\r\n .slice(0, 3)\r\n .map((p) => {\r\n const cleaned = p.replace(/%$/, \"\");\r\n return Number(cleaned);\r\n })\r\n .filter((n) => Number.isFinite(n) && n >= 0 && n <= 255);\r\n\r\n if (numbers.length !== 3) {\r\n return \"#000000\";\r\n }\r\n\r\n const hex = numbers\r\n .map((n) => Math.round(n).toString(16).padStart(2, \"0\"))\r\n .join(\"\")\r\n .toUpperCase();\r\n\r\n return `#${hex}`;\r\n}\r\n\r\nexport function hexToRgbString(hex: string): string | null {\r\n if (!HEX_RE.test(hex)) return null;\r\n\r\n const full =\r\n hex.length === 4 ? \"#\" + [...hex.slice(1)].map((c) => c + c).join(\"\") : hex;\r\n\r\n const r = parseInt(full.slice(1, 3), 16);\r\n const g = parseInt(full.slice(3, 5), 16);\r\n const b = parseInt(full.slice(5, 7), 16);\r\n\r\n return `${r} ${g} ${b}`;\r\n}\r\n","import type { BaseColor, ColorProps } from \"@splenddev/kreativ-core/types\";\r\n\r\nconst RAW_COLOR = /^(#|rgb|hsl|hwb|lab|lch|oklab|oklch|color\\(|var\\()/i;\r\n\r\nfunction isRawColor(value: string) {\r\n return (\r\n RAW_COLOR.test(value) || value === \"transparent\" || value === \"currentColor\"\r\n );\r\n}\r\n\r\n/**\r\n * Token → `var(--kui-color-<token>)`.\r\n * A hex, `rgb()`, `hsl()`, `var()`, `transparent`, or `currentColor` is returned as-is.\r\n */\r\nexport function resolveColor(\r\n value: BaseColor | ColorProps<BaseColor> | string,\r\n): string {\r\n if (typeof value === \"string\") {\r\n return isRawColor(value) ? value : `var(--color-kui-${value})`;\r\n }\r\n\r\n const token = \"color\" in value ? value.color : value;\r\n return typeof token === \"string\" && isRawColor(token)\r\n ? token\r\n : `var(--color-kui-${String(token)})`;\r\n}\r\n","import type { Size } from \"@splenddev/kreativ-core/types\";\r\n\r\nconst RAW_LENGTH = /px|rem|em|%|vw|vh|ch|var\\(/i;\r\n\r\n/**\r\n * Size token → `var(--kui-radii-<token>)`.\r\n * `none` is `0`. `full` is a pill. A number is pixels.\r\n * A raw length (`\"8px\"`, `\"0.5rem\"`, `\"50%\"`) is returned as-is.\r\n */\r\nexport function resolveRadius(value: Size | number | string): string {\r\n if (typeof value === \"number\") return `${value}px`;\r\n if (value === \"none\" || value === \"0\") return \"0\";\r\n if (value === \"full\") return \"9999px\";\r\n if (RAW_LENGTH.test(value)) return value;\r\n return `var(--kui-radii-${value})`;\r\n}\r\n","import { SpaceValue } from \"@/types\";\r\n\r\nconst LENGTH_RE =\r\n /^[+-]?[\\d.]+(px|rem|em|%|vw|vh|vmin|vmax|ch|ex|dvh|svh|lvh)$/i;\r\nconst FN_RE = /^[a-z-]+\\(/i;\r\nconst TOKEN_RE = /^[a-z0-9]+(?:-[a-z0-9]+)*$/i;\r\n\r\nexport function resolveSpace(\r\n value: SpaceValue | undefined,\r\n): string | undefined {\r\n if (value == null) return undefined;\r\n if (typeof value === \"number\") return `${value}px`;\r\n\r\n const s = String(value).trim();\r\n if (LENGTH_RE.test(s) || FN_RE.test(s)) return s;\r\n if (TOKEN_RE.test(s)) return `var(--kui-spacing-${s})`;\r\n return s;\r\n}\r\n"]}
|