angulux-styled 1.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/LICENSE +22 -0
- package/README.md +26 -0
- package/dist/index.d.mts +327 -0
- package/dist/index.mjs +2 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +54 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 angulux contributors
|
|
4
|
+
Copyright (c) 2016-2026 PrimeTek
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in
|
|
14
|
+
all copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
22
|
+
THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# angulux-styled
|
|
2
|
+
|
|
3
|
+
Design-token and CSS-variable engine used by angulux.
|
|
4
|
+
|
|
5
|
+
Part of [angulux](https://github.com/anguless-com/angulux). Published so the library has
|
|
6
|
+
no runtime dependency on packages whose upstream has moved to a commercial license.
|
|
7
|
+
|
|
8
|
+
## Provenance
|
|
9
|
+
|
|
10
|
+
Forked from `@primeuix/styled`, MIT, at the final public commit of
|
|
11
|
+
[primefaces/primeuix](https://github.com/primefaces/primeuix) (`b9467bc`, repository
|
|
12
|
+
archived 2026-06-28\), which published as `@primeuix/styled 0.7.4`.
|
|
13
|
+
|
|
14
|
+
This package is versioned **independently of angulux**. angulux locks its major to Angular's,
|
|
15
|
+
but nothing here depends on Angular — there are no Angular imports and no Angular peer
|
|
16
|
+
dependency — so tying these versions to an Angular release would claim a relationship that
|
|
17
|
+
does not exist. The lineage lives in this file and in `PROVENANCE.md`, not in the version
|
|
18
|
+
number.
|
|
19
|
+
|
|
20
|
+
The public API is verified to cover that release completely; see `PROVENANCE.md` in the
|
|
21
|
+
repository root for the checksummed record and the command to verify it yourself.
|
|
22
|
+
|
|
23
|
+
## License
|
|
24
|
+
|
|
25
|
+
MIT. See `LICENSE` and the repository's `NOTICE`. angulux is not affiliated with,
|
|
26
|
+
endorsed by, or sponsored by PrimeTek.
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
import * as angulux_utils from 'angulux-utils';
|
|
2
|
+
|
|
3
|
+
declare function definePreset<T extends Record<string, unknown>>(...presets: T[]): T;
|
|
4
|
+
|
|
5
|
+
declare function updatePreset<T extends Record<string, unknown>>(...presets: T[]): T;
|
|
6
|
+
|
|
7
|
+
declare function updatePrimaryPalette<T = unknown, P = unknown>(palette?: T): P;
|
|
8
|
+
|
|
9
|
+
declare function updateSurfacePalette<T = unknown, P = unknown>(palette?: T): P;
|
|
10
|
+
|
|
11
|
+
declare function usePreset<T extends Record<string, unknown>>(...presets: T[]): T;
|
|
12
|
+
|
|
13
|
+
declare function useTheme<T = unknown>(theme: T): T;
|
|
14
|
+
|
|
15
|
+
declare const _default$5: {
|
|
16
|
+
defaults: {
|
|
17
|
+
variable: {
|
|
18
|
+
prefix: string;
|
|
19
|
+
selector: string;
|
|
20
|
+
excludedKeyRegex: RegExp;
|
|
21
|
+
};
|
|
22
|
+
options: {
|
|
23
|
+
prefix: string;
|
|
24
|
+
darkModeSelector: string;
|
|
25
|
+
cssLayer: boolean;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
_theme: undefined;
|
|
29
|
+
_layerNames: Set<unknown>;
|
|
30
|
+
_loadedStyleNames: Set<unknown>;
|
|
31
|
+
_loadingStyles: Set<unknown>;
|
|
32
|
+
_tokens: {};
|
|
33
|
+
update(newValues?: any): void;
|
|
34
|
+
readonly theme: any;
|
|
35
|
+
readonly preset: any;
|
|
36
|
+
readonly options: any;
|
|
37
|
+
readonly tokens: {};
|
|
38
|
+
getTheme(): any;
|
|
39
|
+
setTheme(newValue: any): void;
|
|
40
|
+
getPreset(): any;
|
|
41
|
+
setPreset(newValue: any): void;
|
|
42
|
+
getOptions(): any;
|
|
43
|
+
setOptions(newValue: any): void;
|
|
44
|
+
getLayerNames(): unknown[];
|
|
45
|
+
setLayerNames(layerName: any): void;
|
|
46
|
+
getLoadedStyleNames(): Set<unknown>;
|
|
47
|
+
isStyleNameLoaded(name: string): boolean;
|
|
48
|
+
setLoadedStyleName(name: string): void;
|
|
49
|
+
deleteLoadedStyleName(name: string): void;
|
|
50
|
+
clearLoadedStyleNames(): void;
|
|
51
|
+
getTokenValue(tokenPath: string): any;
|
|
52
|
+
getCommon(name: string | undefined, params: any): {
|
|
53
|
+
primitive: {
|
|
54
|
+
css: string | undefined;
|
|
55
|
+
tokens: any;
|
|
56
|
+
};
|
|
57
|
+
semantic: {
|
|
58
|
+
css: string | undefined;
|
|
59
|
+
tokens: any[] | undefined;
|
|
60
|
+
};
|
|
61
|
+
global: {
|
|
62
|
+
css: string | undefined;
|
|
63
|
+
tokens: any[] | undefined;
|
|
64
|
+
};
|
|
65
|
+
style: string | undefined;
|
|
66
|
+
};
|
|
67
|
+
getComponent(name: string | undefined, params: any): {
|
|
68
|
+
css: string | undefined;
|
|
69
|
+
tokens: any[] | undefined;
|
|
70
|
+
style: string | undefined;
|
|
71
|
+
};
|
|
72
|
+
getDirective(name: string | undefined, params: any): {
|
|
73
|
+
css: string | undefined;
|
|
74
|
+
tokens: any[] | undefined;
|
|
75
|
+
style: string | undefined;
|
|
76
|
+
};
|
|
77
|
+
getCustomPreset(name: string | undefined, preset: any, selector: string, params: any): {
|
|
78
|
+
css: string | undefined;
|
|
79
|
+
tokens: any[] | undefined;
|
|
80
|
+
style: string | undefined;
|
|
81
|
+
};
|
|
82
|
+
getLayerOrderCSS(name?: string): string;
|
|
83
|
+
transformCSS(name: string | undefined, css: string, type?: string, mode?: string): string;
|
|
84
|
+
getCommonStyleSheet(name: string | undefined, params: any, props?: {}): any;
|
|
85
|
+
getStyleSheet(name: string, params: any, props?: {}): string;
|
|
86
|
+
onStyleMounted(name: string): void;
|
|
87
|
+
onStyleUpdated(name: string): void;
|
|
88
|
+
onStyleLoaded(event: any, { name }: {
|
|
89
|
+
name: any;
|
|
90
|
+
}): void;
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
declare const _default$4: (color1: string, color2: string, weight: number) => string;
|
|
94
|
+
|
|
95
|
+
declare const _default$3: (color: string) => string | ColorScale;
|
|
96
|
+
|
|
97
|
+
declare const _default$2: (color: string, percent: number) => string;
|
|
98
|
+
|
|
99
|
+
declare const _default$1: (color: string, percent: number) => string;
|
|
100
|
+
|
|
101
|
+
declare function css(strings: TemplateStringsArray | StyleType, ...exprs: unknown[]): string | undefined;
|
|
102
|
+
|
|
103
|
+
declare const $dt: (tokenPath: string) => {
|
|
104
|
+
name: string;
|
|
105
|
+
variable: string;
|
|
106
|
+
value: unknown;
|
|
107
|
+
};
|
|
108
|
+
declare const dt: (...args: Parameters<typeof dtwt> extends [unknown, ...infer Rest] ? Rest : never) => any;
|
|
109
|
+
declare const dtwt: (theme: any | undefined, tokenPath: string, fallback?: string, type?: string) => any;
|
|
110
|
+
|
|
111
|
+
declare const $t: (theme?: any) => {
|
|
112
|
+
preset(value: any): /*elided*/ any;
|
|
113
|
+
options(value: any): /*elided*/ any;
|
|
114
|
+
primaryPalette(primary: any): /*elided*/ any;
|
|
115
|
+
surfacePalette(surface: any): /*elided*/ any;
|
|
116
|
+
define({ useDefaultPreset, useDefaultOptions }?: {
|
|
117
|
+
useDefaultPreset?: boolean | undefined;
|
|
118
|
+
useDefaultOptions?: boolean | undefined;
|
|
119
|
+
}): {
|
|
120
|
+
preset: any;
|
|
121
|
+
options: any;
|
|
122
|
+
};
|
|
123
|
+
update({ mergePresets, mergeOptions }?: {
|
|
124
|
+
mergePresets?: boolean | undefined;
|
|
125
|
+
mergeOptions?: boolean | undefined;
|
|
126
|
+
}): {
|
|
127
|
+
preset: any;
|
|
128
|
+
options: any;
|
|
129
|
+
};
|
|
130
|
+
use(options: any): {
|
|
131
|
+
preset: any;
|
|
132
|
+
options: any;
|
|
133
|
+
};
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
interface toVariableOptions {
|
|
137
|
+
prefix?: string;
|
|
138
|
+
selector?: string;
|
|
139
|
+
excludedKeyRegex?: RegExp;
|
|
140
|
+
}
|
|
141
|
+
interface toVariableOutput {
|
|
142
|
+
value: string[];
|
|
143
|
+
tokens: string[];
|
|
144
|
+
declarations: string;
|
|
145
|
+
css: string;
|
|
146
|
+
}
|
|
147
|
+
declare function export_default(theme: any, options?: toVariableOptions): toVariableOutput;
|
|
148
|
+
|
|
149
|
+
declare const ThemeService: angulux_utils.EventBusOptions;
|
|
150
|
+
|
|
151
|
+
interface StyleSheetProps {
|
|
152
|
+
attrs?: Record<string, unknown>;
|
|
153
|
+
}
|
|
154
|
+
interface StyleMeta<E = HTMLStyleElement> {
|
|
155
|
+
name?: string;
|
|
156
|
+
css?: string;
|
|
157
|
+
attrs?: Record<string, unknown>;
|
|
158
|
+
markup?: string;
|
|
159
|
+
element?: E;
|
|
160
|
+
}
|
|
161
|
+
declare class StyleSheet<E = HTMLStyleElement> {
|
|
162
|
+
_styles: Map<string, StyleMeta<E>>;
|
|
163
|
+
_attrs: Record<string, unknown>;
|
|
164
|
+
constructor({ attrs }?: StyleSheetProps);
|
|
165
|
+
get(key: string): StyleMeta<E> | undefined;
|
|
166
|
+
has(key: string): boolean;
|
|
167
|
+
delete(key: string): void;
|
|
168
|
+
clear(): void;
|
|
169
|
+
add(key: string, css?: string): void;
|
|
170
|
+
update(): void;
|
|
171
|
+
getStyles(): Map<string, StyleMeta<E>>;
|
|
172
|
+
getAllCSS(): (string | undefined)[];
|
|
173
|
+
getAllMarkup(): (string | undefined)[];
|
|
174
|
+
getAllElements(): (E | undefined)[];
|
|
175
|
+
/**
|
|
176
|
+
* Used to create a style element.
|
|
177
|
+
*
|
|
178
|
+
* @param {StyleMeta} meta
|
|
179
|
+
* @returns {HTMLStyleElement | undefined}
|
|
180
|
+
*/
|
|
181
|
+
createStyleElement(meta?: StyleMeta): E | undefined;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
declare const EXPR_REGEX: RegExp;
|
|
185
|
+
declare const CALC_REGEX: RegExp;
|
|
186
|
+
declare const VAR_REGEX: RegExp;
|
|
187
|
+
declare function toTokenKey(str: string): string;
|
|
188
|
+
declare function merge(value1: any, value2: any): void;
|
|
189
|
+
declare function toValue(value: any): any;
|
|
190
|
+
declare function toUnit(value: string, variable?: string): string;
|
|
191
|
+
declare function toNormalizePrefix(prefix: string): string;
|
|
192
|
+
declare function toNormalizeVariable(prefix?: string, variable?: string): string;
|
|
193
|
+
declare function getVariableName(prefix?: string, variable?: string): string;
|
|
194
|
+
declare function hasOddBraces(str?: string): boolean;
|
|
195
|
+
declare function getVariableValue(value: any, variable?: string, prefix?: string, excludedKeyRegexes?: RegExp[], fallback?: string): string | undefined;
|
|
196
|
+
declare function getComputedValue(obj: {} | undefined, value: any): any;
|
|
197
|
+
declare function setProperty(properties: string[], key: string, value?: string): void;
|
|
198
|
+
declare function getRule(selector: string, properties: string): string;
|
|
199
|
+
declare function evaluateDtExpressions(input: string, fn: (...args: any[]) => string): string;
|
|
200
|
+
|
|
201
|
+
declare const _default: {
|
|
202
|
+
regex: {
|
|
203
|
+
rules: {
|
|
204
|
+
class: {
|
|
205
|
+
pattern: RegExp;
|
|
206
|
+
resolve(value: string): {
|
|
207
|
+
type: string;
|
|
208
|
+
selector: string;
|
|
209
|
+
matched: boolean;
|
|
210
|
+
};
|
|
211
|
+
};
|
|
212
|
+
attr: {
|
|
213
|
+
pattern: RegExp;
|
|
214
|
+
resolve(value: string): {
|
|
215
|
+
type: string;
|
|
216
|
+
selector: string;
|
|
217
|
+
matched: boolean;
|
|
218
|
+
};
|
|
219
|
+
};
|
|
220
|
+
media: {
|
|
221
|
+
pattern: RegExp;
|
|
222
|
+
resolve(value: string): {
|
|
223
|
+
type: string;
|
|
224
|
+
selector: string;
|
|
225
|
+
matched: boolean;
|
|
226
|
+
};
|
|
227
|
+
};
|
|
228
|
+
system: {
|
|
229
|
+
pattern: RegExp;
|
|
230
|
+
resolve(value: string): {
|
|
231
|
+
type: string;
|
|
232
|
+
selector: string;
|
|
233
|
+
matched: boolean;
|
|
234
|
+
};
|
|
235
|
+
};
|
|
236
|
+
custom: {
|
|
237
|
+
resolve(value: string): {
|
|
238
|
+
type: string;
|
|
239
|
+
selector: string;
|
|
240
|
+
matched: boolean;
|
|
241
|
+
};
|
|
242
|
+
};
|
|
243
|
+
};
|
|
244
|
+
resolve(value: any): any[];
|
|
245
|
+
};
|
|
246
|
+
_toVariables(theme: any, options: any): toVariableOutput;
|
|
247
|
+
getCommon({ name, theme, params, set, defaults }: any): {
|
|
248
|
+
primitive: {
|
|
249
|
+
css: string | undefined;
|
|
250
|
+
tokens: any;
|
|
251
|
+
};
|
|
252
|
+
semantic: {
|
|
253
|
+
css: string | undefined;
|
|
254
|
+
tokens: any[] | undefined;
|
|
255
|
+
};
|
|
256
|
+
global: {
|
|
257
|
+
css: string | undefined;
|
|
258
|
+
tokens: any[] | undefined;
|
|
259
|
+
};
|
|
260
|
+
style: string | undefined;
|
|
261
|
+
};
|
|
262
|
+
getPreset({ name, preset, options, params, set, defaults, selector }: any): {
|
|
263
|
+
css: string | undefined;
|
|
264
|
+
tokens: any[] | undefined;
|
|
265
|
+
style: string | undefined;
|
|
266
|
+
};
|
|
267
|
+
getPresetC({ name, theme, params, set, defaults }: any): {
|
|
268
|
+
css: string | undefined;
|
|
269
|
+
tokens: any[] | undefined;
|
|
270
|
+
style: string | undefined;
|
|
271
|
+
};
|
|
272
|
+
getPresetD({ name, theme, params, set, defaults }: any): {
|
|
273
|
+
css: string | undefined;
|
|
274
|
+
tokens: any[] | undefined;
|
|
275
|
+
style: string | undefined;
|
|
276
|
+
};
|
|
277
|
+
applyDarkColorScheme(options: any): boolean;
|
|
278
|
+
getColorSchemeOption(options: any, defaults: any): any[];
|
|
279
|
+
getLayerOrder(name: string, options: any | undefined, params: any, defaults: any): string;
|
|
280
|
+
getCommonStyleSheet({ name, theme, params, props, set, defaults }: any): any;
|
|
281
|
+
getStyleSheet({ name, theme, params, props, set, defaults }: any): string;
|
|
282
|
+
createTokens(obj: any | undefined, defaults: any, parentKey?: string, parentPath?: string, tokens?: any): any;
|
|
283
|
+
getTokenValue(tokens: any, path: string, defaults: any): any;
|
|
284
|
+
getSelectorRule(selector1: any, selector2: any, type: string, css: string): string;
|
|
285
|
+
transformCSS(name: string, css: string, mode?: string, type?: string, options?: any, set?: any, defaults?: any, selector?: string): string;
|
|
286
|
+
};
|
|
287
|
+
|
|
288
|
+
interface ThemeOptions {
|
|
289
|
+
/**
|
|
290
|
+
* The prefix for the theme
|
|
291
|
+
* @default 'p'
|
|
292
|
+
*/
|
|
293
|
+
prefix?: string;
|
|
294
|
+
/**
|
|
295
|
+
* Dark mode selector
|
|
296
|
+
* @default 'system'
|
|
297
|
+
*/
|
|
298
|
+
darkModeSelector?: string;
|
|
299
|
+
/**
|
|
300
|
+
* Whether to use the css layer
|
|
301
|
+
* @default false
|
|
302
|
+
*/
|
|
303
|
+
cssLayer?: boolean | {
|
|
304
|
+
name?: string;
|
|
305
|
+
order?: string;
|
|
306
|
+
};
|
|
307
|
+
}
|
|
308
|
+
interface StyleOptions {
|
|
309
|
+
dt: (key: string, fallback?: string | number | Pick<StyleOptions, 'dt'>) => string | number | undefined;
|
|
310
|
+
}
|
|
311
|
+
declare type StyleType<T = StyleOptions> = string | ((options?: T) => string);
|
|
312
|
+
type ColorScale = {
|
|
313
|
+
0?: string;
|
|
314
|
+
50?: string;
|
|
315
|
+
100?: string;
|
|
316
|
+
200?: string;
|
|
317
|
+
300?: string;
|
|
318
|
+
400?: string;
|
|
319
|
+
500?: string;
|
|
320
|
+
600?: string;
|
|
321
|
+
700?: string;
|
|
322
|
+
800?: string;
|
|
323
|
+
900?: string;
|
|
324
|
+
950?: string;
|
|
325
|
+
};
|
|
326
|
+
|
|
327
|
+
export { $dt, $t, CALC_REGEX, type ColorScale, EXPR_REGEX, type StyleMeta, type StyleOptions, StyleSheet, type StyleSheetProps, type StyleType, _default$5 as Theme, type ThemeOptions, ThemeService, _default as ThemeUtils, VAR_REGEX, css, definePreset, dt, dtwt, evaluateDtExpressions, getComputedValue, getRule, getVariableName, getVariableValue, hasOddBraces, merge, _default$4 as mix, _default$3 as palette, setProperty, _default$2 as shade, _default$1 as tint, toNormalizePrefix, toNormalizeVariable, toTokenKey, toUnit, toValue, export_default as toVariables, updatePreset, updatePrimaryPalette, updateSurfacePalette, usePreset, useTheme };
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{deepMerge as Me}from"angulux-utils/object";function ne(...e){return Me(...e)}import{deepMerge as rt}from"angulux-utils/object";import{EventBus as ze}from"angulux-utils/eventbus";var Ke=ze(),$=Ke;import{getKeyValue as Xe,isArray as Ge,isNotEmpty as Ue,isNumber as H,isObject as ie,isString as N,matchRegex as G,toKebabCase as Be}from"angulux-utils/object";var b=/{([^}]*)}/g,W=/(\d+\s+[\+\-\*\/]\s+\d+)/g,q=/var\([^)]+\)/g;function Z(e){return N(e)?e.replace(/[A-Z]/g,(t,r)=>r===0?t:"."+t.toLowerCase()).toLowerCase():e}function dt(e,t){Ge(e)?e.push(...t||[]):ie(e)&&Object.assign(e,t)}function oe(e){return ie(e)&&e.hasOwnProperty("$value")&&e.hasOwnProperty("$type")?e.$value:e}function pt(e,t=""){return["opacity","z-index","line-height","font-weight","flex","flex-grow","flex-shrink","order"].some(s=>t.endsWith(s))?e:`${e}`.trim().split(" ").map(a=>H(a)?`${a}px`:a).join(" ")}function Ie(e){return e.replaceAll(/ /g,"").replace(/[^\w]/g,"-")}function U(e="",t=""){return Ie(`${N(e,!1)&&N(t,!1)?`${e}-`:e}${t}`)}function F(e="",t=""){return`--${U(e,t)}`}function He(e=""){let t=(e.match(/{/g)||[]).length,r=(e.match(/}/g)||[]).length;return(t+r)%2!==0}function B(e,t="",r="",s=[],i){if(N(e)){let a=e.trim();if(He(a))return;if(G(a,b)){let n=a.replaceAll(b,o=>{let c=o.replace(/{|}/g,"").split(".").filter(m=>!s.some(d=>G(m,d)));return`var(${F(r,Be(c.join("-")))}${Ue(i)?`, ${i}`:""})`});return G(n.replace(q,"0"),W)?`calc(${n})`:n}return a}else if(H(e))return e}function ht(e={},t){if(N(t)){let r=t.trim();return G(r,b)?r.replaceAll(b,s=>Xe(e,s.replace(/{|}/g,""))):r}else if(H(t))return t}function ae(e,t,r){N(t,!1)&&e.push(`${t}:${r};`)}function R(e,t){return e?`${e}{${t}}`:""}function J(e,t){if(e.indexOf("dt(")===-1)return e;function r(n,o){let l=[],c=0,m="",d=null,u=0;for(;c<=n.length;){let p=n[c];if((p==='"'||p==="'"||p==="`")&&n[c-1]!=="\\"&&(d=d===p?null:p),!d&&(p==="("&&u++,p===")"&&u--,(p===","||c===n.length)&&u===0)){let h=m.trim();h.startsWith("dt(")?l.push(J(h,o)):l.push(s(h)),m="",c++;continue}p!==void 0&&(m+=p),c++}return l}function s(n){let o=n[0];if((o==='"'||o==="'"||o==="`")&&n[n.length-1]===o)return n.slice(1,-1);let l=Number(n);return isNaN(l)?n:l}let i=[],a=[];for(let n=0;n<e.length;n++)if(e[n]==="d"&&e.slice(n,n+3)==="dt(")a.push(n),n+=2;else if(e[n]===")"&&a.length>0){let o=a.pop();a.length===0&&i.push([o,n])}if(!i.length)return e;for(let n=i.length-1;n>=0;n--){let[o,l]=i[n],c=e.slice(o+3,l),m=r(c,t),d=t(...m);e=e.slice(0,o)+d+e.slice(l+1)}return e}import{isEmpty as tt,isNotEmpty as y,isObject as re,matchRegex as pe,minifyCSS as he,resolve as I}from"angulux-utils/object";function le(e){return e.length===4?`#${e[1]}${e[1]}${e[2]}${e[2]}${e[3]}${e[3]}`:e}function ce(e){let t=parseInt(e.substring(1),16),r=t>>16&255,s=t>>8&255,i=t&255;return{r,g:s,b:i}}function We(e,t,r){return`#${e.toString(16).padStart(2,"0")}${t.toString(16).padStart(2,"0")}${r.toString(16).padStart(2,"0")}`}var O=(e,t,r)=>{e=le(e),t=le(t);let a=(r/100*2-1+1)/2,n=1-a,o=ce(e),l=ce(t),c=Math.round(o.r*a+l.r*n),m=Math.round(o.g*a+l.g*n),d=Math.round(o.b*a+l.b*n);return We(c,m,d)};import{matchRegex as qe}from"angulux-utils";var Q=(e,t)=>O("#000000",e,t);var Y=(e,t)=>O("#ffffff",e,t);var me=[50,100,200,300,400,500,600,700,800,900,950],Ze=e=>{if(qe(e,b)){let t=e.replace(/{|}/g,"");return me.reduce((r,s)=>(r[s]=`{${t}.${s}}`,r),{})}return typeof e=="string"?me.reduce((t,r,s)=>(t[r]=s<=5?Y(e,(5-s)*19):Q(e,(s-5)*15),t),{}):e};import{resolve as ue}from"angulux-utils";import{isEmpty as Fe,matchRegex as Je}from"angulux-utils/object";var Lt=e=>{let t=g.getTheme(),r=ee(t,e,void 0,"variable"),s=r?.match(/--[\w-]+/g)?.[0],i=ee(t,e,void 0,"value");return{name:s,variable:r,value:i}},T=(...e)=>ee(g.getTheme(),...e),ee=(e={},t,r,s)=>{if(t){let{variable:i,options:a}=g.defaults||{},{prefix:n,transform:o}=e?.options||a||{},l=Je(t,b)?t:`{${t}}`;return s==="value"||Fe(s)&&o==="strict"?g.getTokenValue(t):B(l,void 0,n,[i.excludedKeyRegex],r)}return""};function zt(e,...t){if(e instanceof Array){let r=e.reduce((s,i,a)=>s+i+(ue(t[a],{dt:T})??""),"");return J(r,T)}return ue(e,{dt:T})}import{mergeKeys as de}from"angulux-utils/object";var C=(e={})=>{let{preset:t,options:r}=e;return{preset(s){return t=t?de(t,s):s,this},options(s){return r=r?{...r,...s}:s,this},primaryPalette(s){let{semantic:i}=t||{};return t={...t,semantic:{...i,primary:s}},this},surfacePalette(s){let{semantic:i}=t||{},a=s&&Object.hasOwn(s,"light")?s.light:s,n=s&&Object.hasOwn(s,"dark")?s.dark:s,o={colorScheme:{light:{...i?.colorScheme?.light,...!!a&&{surface:a}},dark:{...i?.colorScheme?.dark,...!!n&&{surface:n}}}};return t={...t,semantic:{...i,...o}},this},define({useDefaultPreset:s=!1,useDefaultOptions:i=!1}={}){return{preset:s?g.getPreset():t,options:i?g.getOptions():r}},update({mergePresets:s=!0,mergeOptions:i=!0}={}){let a={preset:s?de(g.getPreset(),t):t,options:i?{...g.getOptions(),...r}:r};return g.setTheme(a),a},use(s){let i=this.define(s);return g.setTheme(i),i}}};import{isObject as Qe,matchRegex as Ye,toKebabCase as et}from"angulux-utils/object";function te(e,t={}){let r=g.defaults.variable,{prefix:s=r.prefix,selector:i=r.selector,excludedKeyRegex:a=r.excludedKeyRegex}=t,n=[],o=[],l=[{node:e,path:s}];for(;l.length;){let{node:m,path:d}=l.pop();for(let u in m){let p=m[u],h=oe(p),f=Ye(u,a)?U(d):U(d,et(u));if(Qe(h))l.push({node:h,path:f});else{let S=F(f),k=B(h,f,s,[a]);ae(o,S,k);let v=f;s&&v.startsWith(s+"-")&&(v=v.slice(s.length+1)),n.push(v.replace(/-/g,"."))}}}let c=o.join("");return{value:o,tokens:n,declarations:c,css:R(i,c)}}var _={regex:{rules:{class:{pattern:/^\.([a-zA-Z][\w-]*)$/,resolve(e){return{type:"class",selector:e,matched:this.pattern.test(e.trim())}}},attr:{pattern:/^\[(.*)\]$/,resolve(e){return{type:"attr",selector:`:root${e},:host${e}`,matched:this.pattern.test(e.trim())}}},media:{pattern:/^@media (.*)$/,resolve(e){return{type:"media",selector:e,matched:this.pattern.test(e.trim())}}},system:{pattern:/^system$/,resolve(e){return{type:"system",selector:"@media (prefers-color-scheme: dark)",matched:this.pattern.test(e.trim())}}},custom:{resolve(e){return{type:"custom",selector:e,matched:!0}}}},resolve(e){let t=Object.keys(this.rules).filter(r=>r!=="custom").map(r=>this.rules[r]);return[e].flat().map(r=>t.map(s=>s.resolve(r)).find(s=>s.matched)??this.rules.custom.resolve(r))}},_toVariables(e,t){return te(e,{prefix:t?.prefix})},getCommon({name:e="",theme:t={},params:r,set:s,defaults:i}){let{preset:a,options:n}=t,o,l,c,m,d,u,p;if(y(a)&&n.transform!=="strict"){let{primitive:h,semantic:x,extend:f}=a,{colorScheme:S,...k}=x||{},{colorScheme:v,...V}=f||{},{dark:P,...E}=S||{},{dark:w,...L}=v||{},A=y(h)?this._toVariables({primitive:h},n):{},D=y(k)?this._toVariables({semantic:k},n):{},j=y(E)?this._toVariables({light:E},n):{},M=y(P)?this._toVariables({dark:P},n):{},z=y(V)?this._toVariables({semantic:V},n):{},K=y(L)?this._toVariables({light:L},n):{},X=y(w)?this._toVariables({dark:w},n):{},[xe,be]=[A.declarations??"",A.tokens],[ke,$e]=[D.declarations??"",D.tokens||[]],[ve,Re]=[j.declarations??"",j.tokens||[]],[Te,Ne]=[M.declarations??"",M.tokens||[]],[Ce,Pe]=[z.declarations??"",z.tokens||[]],[Ee,we]=[K.declarations??"",K.tokens||[]],[Oe,Ve]=[X.declarations??"",X.tokens||[]];o=this.transformCSS(e,xe,"light","variable",n,s,i),l=be;let Le=this.transformCSS(e,`${ke}${ve}`,"light","variable",n,s,i),Ae=this.transformCSS(e,`${Te}`,"dark","variable",n,s,i);c=`${Le}${Ae}`,m=[...new Set([...$e,...Re,...Ne])];let De=this.transformCSS(e,`${Ce}${Ee}color-scheme:light`,"light","variable",n,s,i),je=this.transformCSS(e,`${Oe}color-scheme:dark`,"dark","variable",n,s,i);d=`${De}${je}`,u=[...new Set([...Pe,...we,...Ve])],p=I(a.css,{dt:T})}return{primitive:{css:o,tokens:l},semantic:{css:c,tokens:m},global:{css:d,tokens:u},style:p}},getPreset({name:e="",preset:t={},options:r,params:s,set:i,defaults:a,selector:n}){let o,l,c;if(y(t)&&r.transform!=="strict"){let m=e.replace("-directive",""),{colorScheme:d,extend:u,css:p,...h}=t,{colorScheme:x,...f}=u||{},{dark:S,...k}=d||{},{dark:v,...V}=x||{},P=y(h)?this._toVariables({[m]:{...h,...f}},r):{},E=y(k)?this._toVariables({[m]:{...k,...V}},r):{},w=y(S)?this._toVariables({[m]:{...S,...v}},r):{},[L,A]=[P.declarations??"",P.tokens||[]],[D,j]=[E.declarations??"",E.tokens||[]],[M,z]=[w.declarations??"",w.tokens||[]],K=this.transformCSS(m,`${L}${D}`,"light","variable",r,i,a,n),X=this.transformCSS(m,M,"dark","variable",r,i,a,n);o=`${K}${X}`,l=[...new Set([...A,...j,...z])],c=I(p,{dt:T})}return{css:o,tokens:l,style:c}},getPresetC({name:e="",theme:t={},params:r,set:s,defaults:i}){let{preset:a,options:n}=t,o=a?.components?.[e];return this.getPreset({name:e,preset:o,options:n,params:r,set:s,defaults:i})},getPresetD({name:e="",theme:t={},params:r,set:s,defaults:i}){let a=e.replace("-directive",""),{preset:n,options:o}=t,l=n?.components?.[a]||n?.directives?.[a];return this.getPreset({name:a,preset:l,options:o,params:r,set:s,defaults:i})},applyDarkColorScheme(e){return!(e.darkModeSelector==="none"||e.darkModeSelector===!1)},getColorSchemeOption(e,t){return this.applyDarkColorScheme(e)?this.regex.resolve(e.darkModeSelector===!0?t.options.darkModeSelector:e.darkModeSelector??t.options.darkModeSelector):[]},getLayerOrder(e,t={},r,s){let{cssLayer:i}=t;return i?`@layer ${I(i.order||i.name||"primeui",r)}`:""},getCommonStyleSheet({name:e="",theme:t={},params:r,props:s={},set:i,defaults:a}){let n=this.getCommon({name:e,theme:t,params:r,set:i,defaults:a}),o=Object.entries(s).reduce((l,[c,m])=>l.push(`${c}="${m}"`)&&l,[]).join(" ");return Object.entries(n||{}).reduce((l,[c,m])=>{if(re(m)&&Object.hasOwn(m,"css")){let d=he(m.css),u=`${c}-variables`;l.push(`<style type="text/css" data-primevue-style-id="${u}" ${o}>${d}</style>`)}return l},[]).join("")},getStyleSheet({name:e="",theme:t={},params:r,props:s={},set:i,defaults:a}){let n={name:e,theme:t,params:r,set:i,defaults:a},o=(e.includes("-directive")?this.getPresetD(n):this.getPresetC(n))?.css,l=Object.entries(s).reduce((c,[m,d])=>c.push(`${m}="${d}"`)&&c,[]).join(" ");return o?`<style type="text/css" data-primevue-style-id="${e}-variables" ${l}>${he(o)}</style>`:""},createTokens(e={},t,r="",s="",i={}){let a=function(o,l={},c=[]){if(c.includes(this.path))return console.warn(`Circular reference detected at ${this.path}`),{colorScheme:o,path:this.path,paths:l,value:void 0};c.push(this.path),l.name=this.path,l.binding||={};let m=this.value;if(typeof this.value=="string"&&b.test(this.value)){let u=this.value.trim().replace(b,p=>{let h=p.slice(1,-1),x=this.tokens[h];if(!x)return console.warn(`Token not found for path: ${h}`),"__UNRESOLVED__";let f=x.computed(o,l,c);return Array.isArray(f)&&f.length===2?`light-dark(${f[0].value},${f[1].value})`:f?.value??"__UNRESOLVED__"});m=W.test(u.replace(q,"0"))?`calc(${u})`:u}return tt(l.binding)&&delete l.binding,c.pop(),{colorScheme:o,path:this.path,paths:l,value:m.includes("__UNRESOLVED__")?void 0:m}},n=(o,l,c)=>{Object.entries(o).forEach(([m,d])=>{let u=pe(m,t.variable.excludedKeyRegex)?l:l?`${l}.${Z(m)}`:Z(m),p=c?`${c}.${m}`:m;re(d)?n(d,u,p):(i[u]||(i[u]={paths:[],computed:(h,x={},f=[])=>{if(i[u].paths.length===1)return i[u].paths[0].computed(i[u].paths[0].scheme,x.binding,f);if(h&&h!=="none")for(let S=0;S<i[u].paths.length;S++){let k=i[u].paths[S];if(k.scheme===h)return k.computed(h,x.binding,f)}return i[u].paths.map(S=>S.computed(S.scheme,x[S.scheme],f))}}),i[u].paths.push({path:p,value:d,scheme:p.includes("colorScheme.light")?"light":p.includes("colorScheme.dark")?"dark":"none",computed:a,tokens:i}))})};return n(e,r,s),i},getTokenValue(e,t,r){let i=(o=>o.split(".").filter(c=>!pe(c.toLowerCase(),r.variable.excludedKeyRegex)).join("."))(t),a=t.includes("colorScheme.light")?"light":t.includes("colorScheme.dark")?"dark":void 0,n=[e[i]?.computed(a)].flat().filter(o=>o);return n.length===1?n[0].value:n.reduce((o={},l)=>{let{colorScheme:c,...m}=l;return o[c]=m,o},void 0)},getSelectorRule(e,t,r,s){return r==="class"||r==="attr"?R(y(t)?`${e}${t},${e} ${t}`:e,s):R(e,R(t??":root,:host",s))},transformCSS(e,t,r,s,i={},a,n,o){if(y(t)){let{cssLayer:l}=i;if(s!=="style"){let c=this.getColorSchemeOption(i,n);t=r==="dark"?c.reduce((m,{type:d,selector:u})=>(y(u)&&(m+=u.includes("[CSS]")?u.replace("[CSS]",t):this.getSelectorRule(u,o,d,t)),m),""):R(o??":root,:host",t)}if(l){let c={name:"primeui",order:"primeui"};re(l)&&(c.name=I(l.name,{name:e,type:s})),y(c.name)&&(t=R(`@layer ${c.name}`,t),a?.layerNames(c.name))}return t}return""}};var g={defaults:{variable:{prefix:"p",selector:":root,:host",excludedKeyRegex:/^(primitive|semantic|components|directives|variables|colorscheme|light|dark|common|root|states|extend|css)$/gi},options:{prefix:"p",darkModeSelector:"system",cssLayer:!1}},_theme:void 0,_layerNames:new Set,_loadedStyleNames:new Set,_loadingStyles:new Set,_tokens:{},update(e={}){let{theme:t}=e;t&&(this._theme={...t,options:{...this.defaults.options,...t.options}},this._tokens=_.createTokens(this.preset,this.defaults),this.clearLoadedStyleNames())},get theme(){return this._theme},get preset(){return this.theme?.preset||{}},get options(){return this.theme?.options||{}},get tokens(){return this._tokens},getTheme(){return this.theme},setTheme(e){this.update({theme:e}),$.emit("theme:change",e)},getPreset(){return this.preset},setPreset(e){this._theme={...this.theme,preset:e},this._tokens=_.createTokens(e,this.defaults),this.clearLoadedStyleNames(),$.emit("preset:change",e),$.emit("theme:change",this.theme)},getOptions(){return this.options},setOptions(e){this._theme={...this.theme,options:e},this.clearLoadedStyleNames(),$.emit("options:change",e),$.emit("theme:change",this.theme)},getLayerNames(){return[...this._layerNames]},setLayerNames(e){this._layerNames.add(e)},getLoadedStyleNames(){return this._loadedStyleNames},isStyleNameLoaded(e){return this._loadedStyleNames.has(e)},setLoadedStyleName(e){this._loadedStyleNames.add(e)},deleteLoadedStyleName(e){this._loadedStyleNames.delete(e)},clearLoadedStyleNames(){this._loadedStyleNames.clear()},getTokenValue(e){return _.getTokenValue(this.tokens,e,this.defaults)},getCommon(e="",t){return _.getCommon({name:e,theme:this.theme,params:t,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}})},getComponent(e="",t){let r={name:e,theme:this.theme,params:t,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}};return _.getPresetC(r)},getDirective(e="",t){let r={name:e,theme:this.theme,params:t,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}};return _.getPresetD(r)},getCustomPreset(e="",t,r,s){let i={name:e,preset:t,options:this.options,selector:r,params:s,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}};return _.getPreset(i)},getLayerOrderCSS(e=""){return _.getLayerOrder(e,this.options,{names:this.getLayerNames()},this.defaults)},transformCSS(e="",t,r="style",s){return _.transformCSS(e,t,s,r,this.options,{layerNames:this.setLayerNames.bind(this)},this.defaults)},getCommonStyleSheet(e="",t,r={}){return _.getCommonStyleSheet({name:e,theme:this.theme,params:t,props:r,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}})},getStyleSheet(e,t,r={}){return _.getStyleSheet({name:e,theme:this.theme,params:t,props:r,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}})},onStyleMounted(e){this._loadingStyles.add(e)},onStyleUpdated(e){this._loadingStyles.add(e)},onStyleLoaded(e,{name:t}){this._loadingStyles.size&&(this._loadingStyles.delete(t),$.emit(`theme:${t}:load`,e),!this._loadingStyles.size&&$.emit("theme:load"))}};function ge(...e){let t=rt(g.getPreset(),...e);return g.setPreset(t),t}function fe(e){return C().primaryPalette(e).update().preset}function ye(e){return C().surfacePalette(e).update().preset}import{deepMerge as st}from"angulux-utils/object";function Se(...e){let t=st(...e);return g.setPreset(t),t}function _e(e){return C(e).update({mergePresets:!1})}import{createStyleMarkup as nt,isNotEmpty as it}from"angulux-utils";var se=class{_styles;_attrs;constructor({attrs:t}={}){this._styles=new Map,this._attrs=t||{}}get(t){return this._styles.get(t)}has(t){return this._styles.has(t)}delete(t){this._styles.delete(t)}clear(){this._styles.clear()}add(t,r){if(it(r)){let s={name:t,css:r,attrs:this._attrs,markup:nt(r,this._attrs)};this._styles.set(t,{...s,element:this.createStyleElement(s)})}}update(){}getStyles(){return this._styles}getAllCSS(){return[...this._styles.values()].map(t=>t.css).filter(String)}getAllMarkup(){return[...this._styles.values()].map(t=>t.markup).filter(String)}getAllElements(){return[...this._styles.values()].map(t=>t.element)}createStyleElement(t={}){}},ot=se;export{Lt as $dt,C as $t,W as CALC_REGEX,b as EXPR_REGEX,ot as StyleSheet,g as Theme,$ as ThemeService,_ as ThemeUtils,q as VAR_REGEX,zt as css,ne as definePreset,T as dt,ee as dtwt,J as evaluateDtExpressions,ht as getComputedValue,R as getRule,F as getVariableName,B as getVariableValue,He as hasOddBraces,dt as merge,O as mix,Ze as palette,ae as setProperty,Q as shade,Y as tint,Ie as toNormalizePrefix,U as toNormalizeVariable,Z as toTokenKey,pt as toUnit,oe as toValue,te as toVariables,ge as updatePreset,fe as updatePrimaryPalette,ye as updateSurfacePalette,Se as usePreset,_e as useTheme};
|
|
2
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/actions/definePreset.ts","../src/actions/updatePreset.ts","../src/service/index.ts","../src/utils/sharedUtils.ts","../src/utils/themeUtils.ts","../src/helpers/color/mix.ts","../src/helpers/color/palette.ts","../src/helpers/color/shade.ts","../src/helpers/color/tint.ts","../src/helpers/css.ts","../src/helpers/dt.ts","../src/helpers/t.ts","../src/helpers/toVariables.ts","../src/config/index.ts","../src/actions/updatePrimaryPalette.ts","../src/actions/updateSurfacePalette.ts","../src/actions/usePreset.ts","../src/actions/useTheme.ts","../src/stylesheet/index.ts"],"sourcesContent":["import { deepMerge } from 'angulux-utils/object';\n\nexport default function definePreset<T extends Record<string, unknown>>(...presets: T[]): T {\n return deepMerge(...presets) as T;\n}\n","import { deepMerge } from 'angulux-utils/object';\nimport Theme from '../config/index';\n\nexport default function updatePreset<T extends Record<string, unknown>>(...presets: T[]): T {\n const newPreset = deepMerge(Theme.getPreset(), ...presets);\n\n Theme.setPreset(newPreset);\n\n return newPreset as T;\n}\n","import { EventBus } from 'angulux-utils/eventbus';\n\nconst ThemeService = EventBus();\n\nexport default ThemeService;\n","import { getKeyValue, isArray, isNotEmpty, isNumber, isObject, isString, matchRegex, toKebabCase } from 'angulux-utils/object';\n\nexport const EXPR_REGEX = /{([^}]*)}/g; // Exp: '{a}', '{a.b}', '{a.b.c}' etc.\nexport const CALC_REGEX = /(\\d+\\s+[\\+\\-\\*\\/]\\s+\\d+)/g;\nexport const VAR_REGEX = /var\\([^)]+\\)/g;\n\nexport function toTokenKey(str: string): string {\n return isString(str) ? str.replace(/[A-Z]/g, (c: string, i: number) => (i === 0 ? c : '.' + c.toLowerCase())).toLowerCase() : str;\n}\n\nexport function merge(value1: any, value2: any): void {\n if (isArray(value1)) {\n value1.push(...(value2 || []));\n } else if (isObject(value1)) {\n Object.assign(value1, value2);\n }\n}\n\nexport function toValue(value: any): any {\n // Check for Figma ($value-$type)\n return isObject(value) && value.hasOwnProperty('$value') && value.hasOwnProperty('$type') ? (value as any).$value : value;\n}\n\nexport function toUnit(value: string, variable: string = ''): string {\n const excludedProperties = ['opacity', 'z-index', 'line-height', 'font-weight', 'flex', 'flex-grow', 'flex-shrink', 'order'];\n\n if (!excludedProperties.some((property) => variable.endsWith(property))) {\n const val = `${value}`.trim();\n const valArr = val.split(' ');\n\n return valArr.map((v) => (isNumber(v) ? `${v}px` : v)).join(' ');\n }\n\n return value;\n}\n\nexport function toNormalizePrefix(prefix: string): string {\n return prefix.replaceAll(/ /g, '').replace(/[^\\w]/g, '-');\n}\n\nexport function toNormalizeVariable(prefix: string = '', variable: string = ''): string {\n return toNormalizePrefix(`${isString(prefix, false) && isString(variable, false) ? `${prefix}-` : prefix}${variable}`);\n}\n\nexport function getVariableName(prefix: string = '', variable: string = ''): string {\n return `--${toNormalizeVariable(prefix, variable)}`;\n}\n\nexport function hasOddBraces(str: string = ''): boolean {\n const openBraces = (str.match(/{/g) || []).length;\n const closeBraces = (str.match(/}/g) || []).length;\n\n return (openBraces + closeBraces) % 2 !== 0;\n}\n\nexport function getVariableValue(value: any, variable: string = '', prefix: string = '', excludedKeyRegexes: RegExp[] = [], fallback?: string): string | undefined {\n if (isString(value)) {\n const val = value.trim();\n\n if (hasOddBraces(val)) {\n return undefined;\n } else if (matchRegex(val, EXPR_REGEX)) {\n const _val = val.replaceAll(EXPR_REGEX, (v: string) => {\n const path = v.replace(/{|}/g, '');\n const keys = path.split('.').filter((_v: string) => !excludedKeyRegexes.some((_r) => matchRegex(_v, _r)));\n\n return `var(${getVariableName(prefix, toKebabCase(keys.join('-')))}${isNotEmpty(fallback) ? `, ${fallback}` : ''})`;\n });\n\n return matchRegex(_val.replace(VAR_REGEX, '0'), CALC_REGEX) ? `calc(${_val})` : _val;\n }\n\n return val; //toUnit(val, variable);\n } else if (isNumber(value)) {\n return value; //toUnit(value, variable);\n }\n\n return undefined;\n}\n\nexport function getComputedValue(obj = {}, value: any): any {\n if (isString(value)) {\n const val = value.trim();\n\n return matchRegex(val, EXPR_REGEX) ? val.replaceAll(EXPR_REGEX, (v: string) => getKeyValue(obj, v.replace(/{|}/g, '')) as string) : val;\n } else if (isNumber(value)) {\n return value;\n }\n\n return undefined;\n}\n\nexport function setProperty(properties: string[], key: string, value?: string) {\n if (isString(key, false)) {\n properties.push(`${key}:${value};`);\n }\n}\n\nexport function getRule(selector: string, properties: string): string {\n if (selector) {\n return `${selector}{${properties}}`;\n }\n\n return '';\n}\n\nexport function evaluateDtExpressions(input: string, fn: (...args: any[]) => string): string {\n if (input.indexOf('dt(') === -1) return input;\n\n function fastParseArgs(str: string, fn: (...args: (string | number)[]) => string): (string | number)[] {\n const args: (string | number)[] = [];\n let i = 0;\n let current = '';\n let quote: string | null = null;\n let depth = 0;\n\n while (i <= str.length) {\n const c = str[i];\n\n if ((c === '\"' || c === \"'\" || c === '`') && str[i - 1] !== '\\\\') {\n quote = quote === c ? null : c;\n }\n\n if (!quote) {\n if (c === '(') depth++;\n if (c === ')') depth--;\n\n if ((c === ',' || i === str.length) && depth === 0) {\n const arg = current.trim();\n\n if (arg.startsWith('dt(')) {\n args.push(evaluateDtExpressions(arg, fn));\n } else {\n args.push(parseArg(arg));\n }\n\n current = '';\n i++;\n continue;\n }\n }\n\n if (c !== undefined) current += c;\n i++;\n }\n\n return args;\n }\n\n function parseArg(arg: string): string | number {\n const q = arg[0];\n\n if ((q === '\"' || q === \"'\" || q === '`') && arg[arg.length - 1] === q) {\n return arg.slice(1, -1);\n }\n\n const num = Number(arg);\n\n return isNaN(num) ? arg : num;\n }\n\n const indices: [number, number][] = [];\n const stack: number[] = [];\n\n for (let i = 0; i < input.length; i++) {\n if (input[i] === 'd' && input.slice(i, i + 3) === 'dt(') {\n stack.push(i);\n i += 2;\n } else if (input[i] === ')' && stack.length > 0) {\n const start = stack.pop()!;\n\n if (stack.length === 0) {\n indices.push([start, i]);\n }\n }\n }\n\n if (!indices.length) return input;\n\n for (let i = indices.length - 1; i >= 0; i--) {\n const [start, end] = indices[i];\n const inner = input.slice(start + 3, end);\n const args = fastParseArgs(inner, fn);\n const resolved = fn(...args);\n\n input = input.slice(0, start) + resolved + input.slice(end + 1);\n }\n\n return input;\n}\n","import { isEmpty, isNotEmpty, isObject, matchRegex, minifyCSS, resolve } from 'angulux-utils/object';\nimport { dt, toVariables } from '../helpers/index';\nimport { CALC_REGEX, EXPR_REGEX, getRule, toTokenKey, VAR_REGEX } from './sharedUtils';\n\nexport default {\n regex: {\n rules: {\n class: {\n pattern: /^\\.([a-zA-Z][\\w-]*)$/,\n resolve(value: string) {\n return { type: 'class', selector: value, matched: this.pattern.test(value.trim()) };\n }\n },\n attr: {\n pattern: /^\\[(.*)\\]$/,\n resolve(value: string) {\n return { type: 'attr', selector: `:root${value},:host${value}`, matched: this.pattern.test(value.trim()) };\n }\n },\n media: {\n pattern: /^@media (.*)$/,\n resolve(value: string) {\n return { type: 'media', selector: value, matched: this.pattern.test(value.trim()) };\n }\n },\n system: {\n pattern: /^system$/,\n resolve(value: string) {\n return { type: 'system', selector: '@media (prefers-color-scheme: dark)', matched: this.pattern.test(value.trim()) };\n }\n },\n custom: {\n resolve(value: string) {\n return { type: 'custom', selector: value, matched: true };\n }\n }\n },\n resolve(value: any) {\n const rules = Object.keys(this.rules)\n .filter((k) => k !== 'custom')\n .map((r) => (this.rules as any)[r]);\n\n return [value].flat().map((v) => rules.map((r) => r.resolve(v)).find((rr) => rr.matched) ?? this.rules.custom.resolve(v));\n }\n },\n _toVariables(theme: any, options: any) {\n return toVariables(theme, { prefix: options?.prefix });\n },\n getCommon({ name = '', theme = {}, params, set, defaults }: any) {\n const { preset, options } = theme;\n let primitive_css, primitive_tokens, semantic_css, semantic_tokens, global_css, global_tokens, style;\n\n // @todo - check if options is not empty\n if (isNotEmpty(preset) && options.transform !== 'strict') {\n const { primitive, semantic, extend } = preset;\n const { colorScheme, ...sRest } = semantic || {};\n const { colorScheme: eColorScheme, ...eRest } = extend || {};\n const { dark, ...csRest } = colorScheme || {};\n const { dark: eDark, ...ecsRest } = eColorScheme || {};\n const prim_var: any = isNotEmpty(primitive) ? this._toVariables({ primitive }, options) : {};\n const sRest_var: any = isNotEmpty(sRest) ? this._toVariables({ semantic: sRest }, options) : {};\n const csRest_var: any = isNotEmpty(csRest) ? this._toVariables({ light: csRest }, options) : {};\n const csDark_var: any = isNotEmpty(dark) ? this._toVariables({ dark }, options) : {};\n const eRest_var: any = isNotEmpty(eRest) ? this._toVariables({ semantic: eRest }, options) : {};\n const ecsRest_var: any = isNotEmpty(ecsRest) ? this._toVariables({ light: ecsRest }, options) : {};\n const ecsDark_var: any = isNotEmpty(eDark) ? this._toVariables({ dark: eDark }, options) : {};\n\n const [prim_css, prim_tokens] = [prim_var.declarations ?? '', prim_var.tokens];\n const [sRest_css, sRest_tokens] = [sRest_var.declarations ?? '', sRest_var.tokens || []];\n const [csRest_css, csRest_tokens] = [csRest_var.declarations ?? '', csRest_var.tokens || []];\n const [csDark_css, csDark_tokens] = [csDark_var.declarations ?? '', csDark_var.tokens || []];\n const [eRest_css, eRest_tokens] = [eRest_var.declarations ?? '', eRest_var.tokens || []];\n const [ecsRest_css, ecsRest_tokens] = [ecsRest_var.declarations ?? '', ecsRest_var.tokens || []];\n const [ecsDark_css, ecsDark_tokens] = [ecsDark_var.declarations ?? '', ecsDark_var.tokens || []];\n\n primitive_css = this.transformCSS(name, prim_css, 'light', 'variable', options, set, defaults);\n primitive_tokens = prim_tokens;\n\n const semantic_light_css = this.transformCSS(name, `${sRest_css}${csRest_css}`, 'light', 'variable', options, set, defaults);\n const semantic_dark_css = this.transformCSS(name, `${csDark_css}`, 'dark', 'variable', options, set, defaults);\n\n semantic_css = `${semantic_light_css}${semantic_dark_css}`;\n semantic_tokens = [...new Set([...sRest_tokens, ...csRest_tokens, ...csDark_tokens])];\n\n const global_light_css = this.transformCSS(name, `${eRest_css}${ecsRest_css}color-scheme:light`, 'light', 'variable', options, set, defaults);\n const global_dark_css = this.transformCSS(name, `${ecsDark_css}color-scheme:dark`, 'dark', 'variable', options, set, defaults);\n\n global_css = `${global_light_css}${global_dark_css}`;\n global_tokens = [...new Set([...eRest_tokens, ...ecsRest_tokens, ...ecsDark_tokens])];\n\n style = resolve(preset.css, { dt }) as string;\n }\n\n return {\n primitive: {\n css: primitive_css,\n tokens: primitive_tokens\n },\n semantic: {\n css: semantic_css,\n tokens: semantic_tokens\n },\n global: {\n css: global_css,\n tokens: global_tokens\n },\n style\n };\n },\n getPreset({ name = '', preset = {}, options, params, set, defaults, selector }: any) {\n let p_css, p_tokens, p_style;\n\n if (isNotEmpty(preset) && options.transform !== 'strict') {\n const _name = name.replace('-directive', '');\n const { colorScheme, extend, css, ...vRest } = preset;\n const { colorScheme: eColorScheme, ...evRest } = extend || {};\n const { dark, ...csRest } = colorScheme || {};\n const { dark: ecsDark, ...ecsRest } = eColorScheme || {};\n const vRest_var: any = isNotEmpty(vRest) ? this._toVariables({ [_name]: { ...vRest, ...evRest } }, options) : {};\n const csRest_var: any = isNotEmpty(csRest) ? this._toVariables({ [_name]: { ...csRest, ...ecsRest } }, options) : {};\n const csDark_var: any = isNotEmpty(dark) ? this._toVariables({ [_name]: { ...dark, ...ecsDark } }, options) : {};\n\n const [vRest_css, vRest_tokens] = [vRest_var.declarations ?? '', vRest_var.tokens || []];\n const [csRest_css, csRest_tokens] = [csRest_var.declarations ?? '', csRest_var.tokens || []];\n const [csDark_css, csDark_tokens] = [csDark_var.declarations ?? '', csDark_var.tokens || []];\n\n const light_variable_css = this.transformCSS(_name, `${vRest_css}${csRest_css}`, 'light', 'variable', options, set, defaults, selector);\n const dark_variable_css = this.transformCSS(_name, csDark_css, 'dark', 'variable', options, set, defaults, selector);\n\n p_css = `${light_variable_css}${dark_variable_css}`;\n p_tokens = [...new Set([...vRest_tokens, ...csRest_tokens, ...csDark_tokens])];\n\n p_style = resolve(css, { dt }) as string;\n }\n\n return {\n css: p_css,\n tokens: p_tokens,\n style: p_style\n };\n },\n getPresetC({ name = '', theme = {}, params, set, defaults }: any) {\n const { preset, options } = theme;\n const cPreset = preset?.components?.[name];\n\n return this.getPreset({ name, preset: cPreset, options, params, set, defaults });\n },\n // @deprecated - use getPresetC instead\n getPresetD({ name = '', theme = {}, params, set, defaults }: any) {\n const dName = name.replace('-directive', '');\n const { preset, options } = theme;\n const dPreset = preset?.components?.[dName] || preset?.directives?.[dName];\n\n return this.getPreset({ name: dName, preset: dPreset, options, params, set, defaults });\n },\n applyDarkColorScheme(options: any) {\n return !(options.darkModeSelector === 'none' || options.darkModeSelector === false);\n },\n getColorSchemeOption(options: any, defaults: any) {\n return this.applyDarkColorScheme(options) ? this.regex.resolve(options.darkModeSelector === true ? defaults.options.darkModeSelector : (options.darkModeSelector ?? defaults.options.darkModeSelector)) : [];\n },\n getLayerOrder(name: string, options: any = {}, params: any, defaults: any) {\n const { cssLayer } = options;\n\n if (cssLayer) {\n const order = resolve(cssLayer.order || cssLayer.name || 'primeui', params);\n\n return `@layer ${order}`;\n }\n\n return '';\n },\n getCommonStyleSheet({ name = '', theme = {}, params, props = {}, set, defaults }: any) {\n const common = this.getCommon({ name, theme, params, set, defaults });\n const _props = Object.entries(props)\n .reduce((acc: any, [k, v]) => acc.push(`${k}=\"${v}\"`) && acc, [])\n .join(' ');\n\n return Object.entries(common || {})\n .reduce((acc: any, [key, value]) => {\n if (isObject(value) && Object.hasOwn(value, 'css')) {\n const _css = minifyCSS((value as any).css);\n const id = `${key}-variables`;\n\n acc.push(`<style type=\"text/css\" data-primevue-style-id=\"${id}\" ${_props}>${_css}</style>`); // @todo data-primevue -> data-primeui check in primevue usestyle\n }\n\n return acc;\n }, [])\n .join('');\n },\n getStyleSheet({ name = '', theme = {}, params, props = {}, set, defaults }: any) {\n const options = { name, theme, params, set, defaults };\n const preset_css = (name.includes('-directive') ? this.getPresetD(options) : this.getPresetC(options))?.css;\n const _props = Object.entries(props)\n .reduce((acc: any, [k, v]) => acc.push(`${k}=\"${v}\"`) && acc, [])\n .join(' ');\n\n return preset_css ? `<style type=\"text/css\" data-primevue-style-id=\"${name}-variables\" ${_props}>${minifyCSS(preset_css)}</style>` : ''; // @todo check\n },\n createTokens(obj: any = {}, defaults: any, parentKey: string = '', parentPath: string = '', tokens: any = {}) {\n const computedFn = function (this: any, colorScheme: string, tokenPathMap: any = {}, stack: string[] = []) {\n if (stack.includes(this.path)) {\n console.warn(`Circular reference detected at ${this.path}`);\n\n return {\n colorScheme,\n path: this.path,\n paths: tokenPathMap,\n value: undefined\n };\n }\n\n stack.push(this.path);\n tokenPathMap['name'] = this.path;\n tokenPathMap['binding'] ||= {};\n\n let computedValue: any = this.value;\n\n if (typeof this.value === 'string' && EXPR_REGEX.test(this.value)) {\n const val = this.value.trim();\n const _val = val.replace(EXPR_REGEX, (v: any) => {\n const refPath = v.slice(1, -1);\n const refToken = this.tokens[refPath];\n\n if (!refToken) {\n console.warn(`Token not found for path: ${refPath}`);\n\n return `__UNRESOLVED__`;\n }\n\n const computed = refToken.computed(colorScheme, tokenPathMap, stack);\n\n if (Array.isArray(computed) && computed.length === 2) {\n return `light-dark(${computed[0].value},${computed[1].value})`;\n } else {\n return computed?.value ?? `__UNRESOLVED__`;\n }\n });\n\n computedValue = CALC_REGEX.test(_val.replace(VAR_REGEX, '0')) ? `calc(${_val})` : _val;\n }\n\n if (isEmpty(tokenPathMap['binding'])) {\n delete tokenPathMap['binding'];\n }\n\n stack.pop();\n\n return {\n colorScheme,\n path: this.path,\n paths: tokenPathMap,\n value: computedValue.includes('__UNRESOLVED__') ? undefined : computedValue\n };\n };\n\n const traverse = (obj: any, parentKey: string, parentPath: string) => {\n Object.entries(obj).forEach(([key, value]) => {\n const currentKey = matchRegex(key, defaults.variable.excludedKeyRegex) ? parentKey : parentKey ? `${parentKey}.${toTokenKey(key)}` : toTokenKey(key);\n\n const currentPath = parentPath ? `${parentPath}.${key}` : key;\n\n if (isObject(value)) {\n traverse(value, currentKey, currentPath);\n } else {\n if (!tokens[currentKey]) {\n tokens[currentKey] = {\n paths: [],\n computed: (colorScheme: string, tokenPathMap: any = {}, stack: string[] = []) => {\n if (tokens[currentKey].paths.length === 1) {\n return tokens[currentKey].paths[0].computed(tokens[currentKey].paths[0].scheme, tokenPathMap['binding'], stack);\n } else if (colorScheme && colorScheme !== 'none') {\n for (let i = 0; i < tokens[currentKey].paths.length; i++) {\n const p = tokens[currentKey].paths[i];\n\n if (p.scheme === colorScheme) {\n return p.computed(colorScheme, tokenPathMap['binding'], stack);\n }\n }\n }\n\n return tokens[currentKey].paths.map((p: any) => p.computed(p.scheme, tokenPathMap[p.scheme], stack));\n }\n };\n }\n\n tokens[currentKey].paths.push({\n path: currentPath,\n value,\n scheme: currentPath.includes('colorScheme.light') ? 'light' : currentPath.includes('colorScheme.dark') ? 'dark' : 'none',\n computed: computedFn,\n tokens\n });\n }\n });\n };\n\n traverse(obj, parentKey, parentPath);\n\n return tokens;\n },\n getTokenValue(tokens: any, path: string, defaults: any) {\n const normalizePath = (str: string) => {\n const strArr = str.split('.');\n\n return strArr.filter((s) => !matchRegex(s.toLowerCase(), defaults.variable.excludedKeyRegex)).join('.');\n };\n\n const token = normalizePath(path);\n const colorScheme = path.includes('colorScheme.light') ? 'light' : path.includes('colorScheme.dark') ? 'dark' : undefined;\n const computedValues = [tokens[token as any]?.computed(colorScheme)].flat().filter((computed) => computed);\n\n return computedValues.length === 1\n ? computedValues[0].value\n : computedValues.reduce((acc = {}, computed) => {\n const { colorScheme: cs, ...rest } = computed;\n\n acc[cs] = rest;\n\n return acc;\n }, undefined);\n },\n getSelectorRule(selector1: any, selector2: any, type: string, css: string) {\n return type === 'class' || type === 'attr' ? getRule(isNotEmpty(selector2) ? `${selector1}${selector2},${selector1} ${selector2}` : selector1, css) : getRule(selector1, getRule(selector2 ?? ':root,:host', css));\n },\n transformCSS(name: string, css: string, mode?: string, type?: string, options: any = {}, set?: any, defaults?: any, selector?: string) {\n if (isNotEmpty(css)) {\n const { cssLayer } = options;\n\n if (type !== 'style') {\n const colorSchemeOption = this.getColorSchemeOption(options, defaults);\n\n css =\n mode === 'dark'\n ? colorSchemeOption.reduce((acc, { type, selector: _selector }) => {\n if (isNotEmpty(_selector)) {\n acc += _selector.includes('[CSS]') ? _selector.replace('[CSS]', css) : this.getSelectorRule(_selector, selector, type, css);\n }\n\n return acc;\n }, '')\n : getRule(selector ?? ':root,:host', css);\n }\n\n if (cssLayer) {\n const layerOptions = {\n name: 'primeui',\n order: 'primeui'\n };\n\n isObject(cssLayer) && (layerOptions.name = resolve((cssLayer as any).name, { name, type }));\n\n if (isNotEmpty(layerOptions.name)) {\n css = getRule(`@layer ${layerOptions.name}`, css);\n set?.layerNames(layerOptions.name);\n }\n }\n\n return css;\n }\n\n return '';\n }\n};\n","function normalizeColor(color: string): string {\n if (color.length === 4) {\n return `#${color[1]}${color[1]}${color[2]}${color[2]}${color[3]}${color[3]}`;\n }\n\n return color;\n}\n\nfunction hexToRgb(hex: string) {\n const bigint = parseInt(hex.substring(1), 16);\n const r = (bigint >> 16) & 255;\n const g = (bigint >> 8) & 255;\n const b = bigint & 255;\n\n return { r, g, b };\n}\n\nfunction rgbToHex(r: number, g: number, b: number) {\n return `#${r.toString(16).padStart(2, '0')}${g.toString(16).padStart(2, '0')}${b.toString(16).padStart(2, '0')}`;\n}\n\nexport default (color1: string, color2: string, weight: number): string => {\n color1 = normalizeColor(color1);\n color2 = normalizeColor(color2);\n\n const p = weight / 100;\n const w = p * 2 - 1;\n const w1 = (w + 1) / 2.0;\n const w2 = 1 - w1;\n\n const rgb1 = hexToRgb(color1);\n const rgb2 = hexToRgb(color2);\n\n const r = Math.round(rgb1.r * w1 + rgb2.r * w2);\n const g = Math.round(rgb1.g * w1 + rgb2.g * w2);\n const b = Math.round(rgb1.b * w1 + rgb2.b * w2);\n\n return rgbToHex(r, g, b);\n};\n","import { matchRegex } from 'angulux-utils';\nimport type { ColorScale } from '../..';\nimport { EXPR_REGEX } from '../../utils/index';\nimport shade from './shade';\nimport tint from './tint';\n\nconst scales: number[] = [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950];\n\nexport default (color: string): string | ColorScale => {\n if (matchRegex(color, EXPR_REGEX)) {\n const token = color.replace(/{|}/g, '');\n\n return scales.reduce<ColorScale>((acc, scale) => {\n acc[scale as keyof ColorScale] = `{${token}.${scale}}`;\n\n return acc;\n }, {});\n }\n\n return typeof color === 'string'\n ? scales.reduce<ColorScale>((acc, scale, i) => {\n acc[scale as keyof ColorScale] = i <= 5 ? tint(color, (5 - i) * 19) : shade(color, (i - 5) * 15);\n\n return acc;\n }, {})\n : color;\n};\n","import mix from './mix';\n\nexport default (color: string, percent: number) => mix('#000000', color, percent);\n","import mix from './mix';\n\nexport default (color: string, percent: number) => mix('#ffffff', color, percent);\n","import { resolve } from 'angulux-utils';\nimport { evaluateDtExpressions, type StyleType } from '..';\nimport { dt } from './dt';\n\nexport function css(strings: TemplateStringsArray | StyleType, ...exprs: unknown[]): string | undefined {\n if (strings instanceof Array) {\n const raw = strings.reduce((acc, str, i) => acc + str + (resolve(exprs[i], { dt }) ?? ''), '');\n\n return evaluateDtExpressions(raw, dt);\n }\n\n return resolve(strings as unknown, { dt }) as string | undefined;\n}\n","import { isEmpty, matchRegex } from 'angulux-utils/object';\nimport Theme from '../config/index';\nimport { EXPR_REGEX, getVariableValue } from '../utils/index';\n\nexport const $dt = (tokenPath: string): { name: string; variable: string; value: unknown } => {\n const theme = Theme.getTheme();\n\n const variable = dtwt(theme, tokenPath, undefined, 'variable');\n const name = variable?.match(/--[\\w-]+/g)?.[0];\n const value = dtwt(theme, tokenPath, undefined, 'value');\n\n return {\n name,\n variable,\n value\n };\n};\n\nexport const dt = (...args: Parameters<typeof dtwt> extends [unknown, ...infer Rest] ? Rest : never) => {\n return dtwt(Theme.getTheme(), ...args);\n};\n\nexport const dtwt = (theme: any = {}, tokenPath: string, fallback?: string, type?: string) => {\n if (tokenPath) {\n const { variable: VARIABLE, options: OPTIONS } = Theme.defaults || {};\n const { prefix, transform } = theme?.options || OPTIONS || {};\n const token = matchRegex(tokenPath, EXPR_REGEX) ? tokenPath : `{${tokenPath}}`;\n const isStrictTransform = type === 'value' || (isEmpty(type) && transform === 'strict'); // @todo - TRANSFORM: strict | lenient(default)\n\n return isStrictTransform ? Theme.getTokenValue(tokenPath) : getVariableValue(token, undefined, prefix, [VARIABLE.excludedKeyRegex], fallback);\n }\n\n return '';\n};\n","import { mergeKeys } from 'angulux-utils/object';\nimport Theme from '../config/index';\n\nexport const $t = (theme: any = {}) => {\n let { preset: _preset, options: _options } = theme;\n\n return {\n preset(value: any) {\n _preset = _preset ? mergeKeys(_preset, value) : value;\n\n return this;\n },\n options(value: any) {\n _options = _options ? { ..._options, ...value } : value;\n\n return this;\n },\n // features\n primaryPalette(primary: any) {\n const { semantic } = _preset || {};\n\n _preset = { ..._preset, semantic: { ...semantic, primary } };\n\n return this;\n },\n surfacePalette(surface: any) {\n const { semantic } = _preset || {};\n const lightSurface = surface && Object.hasOwn(surface, 'light') ? surface.light : surface;\n const darkSurface = surface && Object.hasOwn(surface, 'dark') ? surface.dark : surface;\n const newColorScheme = {\n colorScheme: {\n light: { ...semantic?.colorScheme?.light, ...(!!lightSurface && { surface: lightSurface }) },\n dark: { ...semantic?.colorScheme?.dark, ...(!!darkSurface && { surface: darkSurface }) }\n }\n };\n\n _preset = { ..._preset, semantic: { ...semantic, ...newColorScheme } };\n\n return this;\n },\n // actions\n define({ useDefaultPreset = false, useDefaultOptions = false } = {}) {\n return {\n preset: useDefaultPreset ? Theme.getPreset() : _preset,\n options: useDefaultOptions ? Theme.getOptions() : _options\n };\n },\n update({ mergePresets = true, mergeOptions = true } = {}) {\n const newTheme = {\n preset: mergePresets ? mergeKeys(Theme.getPreset(), _preset) : _preset,\n options: mergeOptions ? { ...Theme.getOptions(), ..._options } : _options\n };\n\n Theme.setTheme(newTheme);\n\n return newTheme;\n },\n use(options: any) {\n const newTheme = this.define(options);\n\n Theme.setTheme(newTheme);\n\n return newTheme;\n }\n };\n};\n","import { isObject, matchRegex, toKebabCase } from 'angulux-utils/object';\nimport Theme from '../config/index';\nimport { getRule, getVariableName, getVariableValue, setProperty, toNormalizeVariable, toValue } from '../utils/index';\n\nexport interface toVariableOptions {\n prefix?: string;\n selector?: string;\n excludedKeyRegex?: RegExp;\n}\n\nexport interface toVariableOutput {\n value: string[];\n tokens: string[];\n declarations: string;\n css: string;\n}\n\nexport default function (theme: any, options: toVariableOptions = {}): toVariableOutput {\n const VARIABLE = Theme.defaults.variable;\n const { prefix = VARIABLE.prefix, selector = VARIABLE.selector, excludedKeyRegex = VARIABLE.excludedKeyRegex } = options;\n\n const tokens: string[] = [];\n const variables: string[] = [];\n\n const stack = [{ node: theme, path: prefix }];\n\n while (stack.length) {\n const { node, path } = stack.pop()!;\n\n for (const key in node) {\n const raw = node[key];\n const val = toValue(raw);\n\n const skipNormalize = matchRegex(key, excludedKeyRegex);\n const variablePath = skipNormalize ? toNormalizeVariable(path) : toNormalizeVariable(path, toKebabCase(key));\n\n if (isObject(val)) {\n stack.push({ node: val, path: variablePath });\n } else {\n const varName = getVariableName(variablePath);\n const varValue = getVariableValue(val, variablePath, prefix, [excludedKeyRegex]);\n\n setProperty(variables, varName, varValue);\n\n let token = variablePath;\n\n if (prefix && token.startsWith(prefix + '-')) {\n token = token.slice(prefix.length + 1);\n }\n\n tokens.push(token.replace(/-/g, '.'));\n }\n }\n }\n\n const declarations = variables.join('');\n\n return {\n value: variables,\n tokens,\n declarations,\n css: getRule(selector, declarations)\n };\n}\n","import ThemeService from '../service/index';\nimport { ThemeUtils } from '../utils/index';\n\nexport default {\n defaults: {\n variable: {\n prefix: 'p',\n selector: ':root,:host',\n excludedKeyRegex: /^(primitive|semantic|components|directives|variables|colorscheme|light|dark|common|root|states|extend|css)$/gi\n },\n options: {\n prefix: 'p',\n darkModeSelector: 'system',\n cssLayer: false\n }\n },\n _theme: undefined,\n _layerNames: new Set(),\n _loadedStyleNames: new Set(),\n _loadingStyles: new Set(),\n _tokens: {},\n update(newValues: any = {}) {\n const { theme } = newValues;\n\n if (theme) {\n this._theme = {\n ...theme,\n options: {\n ...this.defaults.options,\n ...theme.options\n }\n };\n this._tokens = ThemeUtils.createTokens(this.preset, this.defaults);\n this.clearLoadedStyleNames();\n }\n },\n get theme(): any {\n return this._theme;\n },\n get preset() {\n return this.theme?.preset || {};\n },\n get options() {\n return this.theme?.options || {};\n },\n get tokens() {\n return this._tokens;\n },\n getTheme() {\n return this.theme;\n },\n setTheme(newValue: any) {\n this.update({ theme: newValue });\n ThemeService.emit('theme:change', newValue);\n },\n getPreset() {\n return this.preset;\n },\n setPreset(newValue: any) {\n this._theme = { ...this.theme, preset: newValue };\n this._tokens = ThemeUtils.createTokens(newValue, this.defaults);\n\n this.clearLoadedStyleNames();\n ThemeService.emit('preset:change', newValue);\n ThemeService.emit('theme:change', this.theme);\n },\n getOptions() {\n return this.options;\n },\n setOptions(newValue: any) {\n this._theme = { ...this.theme, options: newValue };\n\n this.clearLoadedStyleNames();\n ThemeService.emit('options:change', newValue);\n ThemeService.emit('theme:change', this.theme);\n },\n getLayerNames() {\n return [...this._layerNames];\n },\n setLayerNames(layerName: any) {\n this._layerNames.add(layerName);\n },\n getLoadedStyleNames() {\n return this._loadedStyleNames;\n },\n isStyleNameLoaded(name: string) {\n return this._loadedStyleNames.has(name);\n },\n setLoadedStyleName(name: string) {\n this._loadedStyleNames.add(name);\n },\n deleteLoadedStyleName(name: string) {\n this._loadedStyleNames.delete(name);\n },\n clearLoadedStyleNames() {\n this._loadedStyleNames.clear();\n },\n getTokenValue(tokenPath: string) {\n return ThemeUtils.getTokenValue(this.tokens, tokenPath, this.defaults);\n },\n getCommon(name = '', params: any) {\n return ThemeUtils.getCommon({ name, theme: this.theme, params, defaults: this.defaults, set: { layerNames: this.setLayerNames.bind(this) } });\n },\n getComponent(name = '', params: any) {\n const options = { name, theme: this.theme, params, defaults: this.defaults, set: { layerNames: this.setLayerNames.bind(this) } };\n\n return ThemeUtils.getPresetC(options);\n },\n // @deprecated - use getComponent instead\n getDirective(name = '', params: any) {\n const options = { name, theme: this.theme, params, defaults: this.defaults, set: { layerNames: this.setLayerNames.bind(this) } };\n\n return ThemeUtils.getPresetD(options);\n },\n getCustomPreset(name = '', preset: any, selector: string, params: any) {\n const options = { name, preset, options: this.options, selector, params, defaults: this.defaults, set: { layerNames: this.setLayerNames.bind(this) } };\n\n return ThemeUtils.getPreset(options);\n },\n getLayerOrderCSS(name = '') {\n return ThemeUtils.getLayerOrder(name, this.options, { names: this.getLayerNames() }, this.defaults);\n },\n transformCSS(name = '', css: string, type: string = 'style', mode?: string) {\n return ThemeUtils.transformCSS(name, css, mode, type, this.options, { layerNames: this.setLayerNames.bind(this) }, this.defaults);\n },\n getCommonStyleSheet(name = '', params: any, props = {}) {\n return ThemeUtils.getCommonStyleSheet({ name, theme: this.theme, params, props, defaults: this.defaults, set: { layerNames: this.setLayerNames.bind(this) } });\n },\n getStyleSheet(name: string, params: any, props = {}) {\n return ThemeUtils.getStyleSheet({ name, theme: this.theme, params, props, defaults: this.defaults, set: { layerNames: this.setLayerNames.bind(this) } });\n },\n onStyleMounted(name: string) {\n this._loadingStyles.add(name);\n },\n onStyleUpdated(name: string) {\n this._loadingStyles.add(name);\n },\n onStyleLoaded(event: any, { name }: { name: any }) {\n if (this._loadingStyles.size) {\n this._loadingStyles.delete(name);\n\n ThemeService.emit(`theme:${name}:load`, event); // Exp: ThemeService.emit('theme:panel-style:load', event)\n !this._loadingStyles.size && ThemeService.emit('theme:load');\n }\n }\n};\n","import { $t } from '../helpers/index';\n\nexport default function updatePrimaryPalette<T = unknown, P = unknown>(palette?: T): P {\n return $t().primaryPalette(palette).update().preset as P;\n}\n","import { $t } from '../helpers/index';\n\nexport default function updateSurfacePalette<T = unknown, P = unknown>(palette?: T): P {\n return $t().surfacePalette(palette).update().preset as P;\n}\n","import { deepMerge } from 'angulux-utils/object';\nimport Theme from '../config/index';\n\nexport default function usePreset<T extends Record<string, unknown>>(...presets: T[]): T {\n const newPreset = deepMerge(...presets);\n\n Theme.setPreset(newPreset);\n\n return newPreset as T;\n}\n","import { $t } from '../helpers/index';\n\nexport default function useTheme<T = unknown>(theme: T): T {\n return $t(theme).update({ mergePresets: false }) as T;\n}\n","import { createStyleMarkup, isNotEmpty } from 'angulux-utils';\n\nexport interface StyleSheetProps {\n attrs?: Record<string, unknown>;\n}\n\nexport interface StyleMeta<E = HTMLStyleElement> {\n name?: string;\n css?: string;\n attrs?: Record<string, unknown>;\n markup?: string;\n element?: E;\n}\n\nclass StyleSheet<E = HTMLStyleElement> {\n _styles: Map<string, StyleMeta<E>>;\n _attrs: Record<string, unknown>;\n constructor({ attrs }: StyleSheetProps = {}) {\n this._styles = new Map();\n this._attrs = attrs || {};\n }\n get(key: string) {\n return this._styles.get(key);\n }\n has(key: string) {\n return this._styles.has(key);\n }\n delete(key: string) {\n this._styles.delete(key);\n }\n clear() {\n this._styles.clear();\n }\n add(key: string, css?: string) {\n if (isNotEmpty(css)) {\n const meta = {\n name: key,\n css,\n attrs: this._attrs,\n markup: createStyleMarkup(css, this._attrs)\n } satisfies StyleMeta<E>;\n\n this._styles.set(key, {\n ...meta,\n element: this.createStyleElement(meta)\n });\n }\n }\n update() {\n // @todo\n }\n getStyles() {\n return this._styles;\n }\n getAllCSS() {\n return [...this._styles.values()].map((style) => style.css).filter(String);\n }\n getAllMarkup() {\n return [...this._styles.values()].map((style) => style.markup).filter(String);\n }\n getAllElements() {\n return [...this._styles.values()].map((style) => style.element);\n }\n /**\n * Used to create a style element.\n *\n * @param {StyleMeta} meta\n * @returns {HTMLStyleElement | undefined}\n */\n // eslint-disable-next-line\n createStyleElement(meta: StyleMeta = {}): E | undefined {\n return undefined;\n }\n}\n\nexport default StyleSheet;\n"],"mappings":"AAAA,OAAS,aAAAA,OAAiB,uBAEX,SAARC,MAAoEC,E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G,KAAK,QAAQ,OAAO,CAAC,EAAE,IAAKA,GAAUA,EAAM,OAAO,CAClE,CAQA,mBAAmBD,EAAkB,CAAC,EAAkB,CAExD,CACJ,EAEOE,GAAQN","names":["deepMerge","definePreset","presets","deepMerge","EventBus","ThemeService","service_default","getKeyValue","isArray","isNotEmpty","isNumber","isObject","isString","matchRegex","toKebabCase","EXPR_REGEX","CALC_REGEX","VAR_REGEX","toTokenKey","str","c","i","merge","value1","value2","toValue","value","toUnit","variable","property","v","toNormalizePrefix","prefix","toNormalizeVariable","getVariableName","hasOddBraces","openBraces","closeBraces","getVariableValue","excludedKeyRegexes","fallback","val","_val","keys","_v","_r","getComputedValue","obj","setProperty","properties","key","getRule","selector","evaluateDtExpressions","input","fn","fastParseArgs","args","current","quote","depth","arg","parseArg","q","num","indices","stack","start","end","inner","resolved","isEmpty","isNotEmpty","isObject","matchRegex","minifyCSS","resolve","normalizeColor","color","hexToRgb","hex","bigint","g","b","rgbToHex","r","mix_default","color1","color2","weight","w1","w2","rgb1","rgb2","matchRegex","shade_default","color","percent","mix_default","tint_default","color","percent","mix_default","scales","palette_default","color","matchRegex","EXPR_REGEX","token","acc","scale","i","tint_default","shade_default","resolve","isEmpty","matchRegex","$dt","tokenPath","theme","config_default","variable","dtwt","name","value","dt","args","fallback","type","VARIABLE","OPTIONS","prefix","transform","token","matchRegex","EXPR_REGEX","isEmpty","getVariableValue","css","strings","exprs","raw","acc","str","i","resolve","dt","evaluateDtExpressions","mergeKeys","$t","theme","_preset","_options","value","mergeKeys","primary","semantic","surface","lightSurface","darkSurface","newColorScheme","useDefaultPreset","useDefaultOptions","config_default","mergePresets","mergeOptions","newTheme","options","isObject","matchRegex","toKebabCase","toVariables_default","theme","options","VARIABLE","config_default","prefix","selector","excludedKeyRegex","tokens","variables","stack","node","path","key","raw","val","toValue","variablePath","matchRegex","toNormalizeVariable","toKebabCase","isObject","varName","getVariableName","varValue","getVariableValue","setProperty","token","declarations","getRule","themeUtils_default","value","rules","k","v","r","rr","theme","options","toVariables_default","name","params","set","defaults","preset","primitive_css","primitive_tokens","semantic_css","semantic_tokens","global_css","global_tokens","style","isNotEmpty","primitive","semantic","extend","colorScheme","sRest","eColorScheme","eRest","dark","csRest","eDark","ecsRest","prim_var","sRest_var","csRest_var","csDark_var","eRest_var","ecsRest_var","ecsDark_var","prim_css","prim_tokens","sRest_css","sRest_tokens","csRest_css","csRest_tokens","csDark_css","csDark_tokens","eRest_css","eRest_tokens","ecsRest_css","ecsRest_tokens","ecsDark_css","ecsDark_tokens","semantic_light_css","semantic_dark_css","global_light_css","global_dark_css","resolve","dt","selector","p_css","p_tokens","p_style","_name","css","vRest","evRest","ecsDark","vRest_var","vRest_css","vRest_tokens","light_variable_css","dark_variable_css","cPreset","dName","dPreset","cssLayer","props","common","_props","acc","key","isObject","_css","minifyCSS","id","preset_css","obj","parentKey","parentPath","tokens","computedFn","tokenPathMap","stack","computedValue","EXPR_REGEX","_val","refPath","refToken","computed","CALC_REGEX","VAR_REGEX","isEmpty","traverse","currentKey","matchRegex","toTokenKey","currentPath","i","p","path","token","str","s","computedValues","cs","rest","selector1","selector2","type","getRule","mode","colorSchemeOption","_selector","layerOptions","config_default","newValues","theme","themeUtils_default","newValue","service_default","layerName","name","tokenPath","params","options","preset","selector","css","type","mode","props","event","updatePreset","presets","newPreset","deepMerge","config_default","updatePrimaryPalette","palette","$t","updateSurfacePalette","palette","$t","deepMerge","usePreset","presets","newPreset","deepMerge","config_default","useTheme","theme","$t","createStyleMarkup","isNotEmpty","StyleSheet","attrs","key","css","meta","style","stylesheet_default"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "angulux-styled",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"author": "PrimeTek Informatics",
|
|
5
|
+
"description": "Design-token and CSS-variable engine used by angulux.",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"styled",
|
|
8
|
+
"css",
|
|
9
|
+
"style utilities",
|
|
10
|
+
"primeng",
|
|
11
|
+
"primereact",
|
|
12
|
+
"primevue",
|
|
13
|
+
"primeuix"
|
|
14
|
+
],
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "git+https://github.com/anguless-com/angulux.git",
|
|
19
|
+
"directory": "packages/angulux-styled"
|
|
20
|
+
},
|
|
21
|
+
"bugs": {
|
|
22
|
+
"url": "https://github.com/anguless-com/angulux/issues"
|
|
23
|
+
},
|
|
24
|
+
"main": "./dist/index.mjs",
|
|
25
|
+
"module": "./dist/index.mjs",
|
|
26
|
+
"types": "./dist/index.d.mts",
|
|
27
|
+
"exports": {
|
|
28
|
+
".": {
|
|
29
|
+
"types": "./dist/index.d.mts",
|
|
30
|
+
"import": "./dist/index.mjs",
|
|
31
|
+
"default": "./dist/index.mjs"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"publishConfig": {
|
|
35
|
+
"access": "public"
|
|
36
|
+
},
|
|
37
|
+
"sideEffects": false,
|
|
38
|
+
"files": [
|
|
39
|
+
"dist",
|
|
40
|
+
"README.md",
|
|
41
|
+
"LICENSE"
|
|
42
|
+
],
|
|
43
|
+
"dependencies": {
|
|
44
|
+
"angulux-utils": "^1.0.0"
|
|
45
|
+
},
|
|
46
|
+
"engines": {
|
|
47
|
+
"node": ">=12.11.0"
|
|
48
|
+
},
|
|
49
|
+
"private": false,
|
|
50
|
+
"scripts": {
|
|
51
|
+
"build": "cross-env NODE_ENV=production tsup",
|
|
52
|
+
"build:dev": "tsup --watch"
|
|
53
|
+
}
|
|
54
|
+
}
|