@mrts/soltw 0.3.13 → 0.3.23

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.
Files changed (50) hide show
  1. package/dist/index.d.ts +125 -10
  2. package/dist/index.js +3730 -10
  3. package/dist/index.jsx +3648 -10
  4. package/package.json +2 -2
  5. package/dist/Block.d.ts +0 -13
  6. package/dist/Block.js +0 -33
  7. package/dist/Block.jsx +0 -24
  8. package/dist/items/IdLabel.d.ts +0 -15
  9. package/dist/items/IdLabel.js +0 -19
  10. package/dist/items/IdLabel.jsx +0 -19
  11. package/dist/items/Item.d.ts +0 -25
  12. package/dist/items/Item.js +0 -75
  13. package/dist/items/Item.jsx +0 -60
  14. package/dist/items/ItemGroup.d.ts +0 -24
  15. package/dist/items/ItemGroup.js +0 -86
  16. package/dist/items/ItemGroup.jsx +0 -63
  17. package/dist/node_modules/solid-js/dist/solid.js +0 -677
  18. package/dist/node_modules/solid-js/dist/solid.jsx +0 -654
  19. package/dist/node_modules/solid-js/web/dist/web.js +0 -694
  20. package/dist/node_modules/solid-js/web/dist/web.jsx +0 -678
  21. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +0 -1893
  22. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.jsx +0 -1893
  23. package/dist/packages/common/dist/index.js +0 -4
  24. package/dist/packages/common/dist/index.jsx +0 -4
  25. package/dist/packages/common/dist/messages/index.js +0 -1
  26. package/dist/packages/common/dist/messages/index.jsx +0 -1
  27. package/dist/packages/common/dist/messages/logMessages.js +0 -14
  28. package/dist/packages/common/dist/messages/logMessages.jsx +0 -14
  29. package/dist/packages/common/dist/strings/index.js +0 -1
  30. package/dist/packages/common/dist/strings/index.jsx +0 -1
  31. package/dist/packages/common/dist/strings/tokenize.js +0 -47
  32. package/dist/packages/common/dist/strings/tokenize.jsx +0 -47
  33. package/dist/soltw.d.ts +0 -7
  34. package/dist/soltw.js +0 -10
  35. package/dist/soltw.jsx +0 -7
  36. package/dist/stylers/SVTStyler.d.ts +0 -32
  37. package/dist/stylers/SVTStyler.js +0 -65
  38. package/dist/stylers/SVTStyler.jsx +0 -65
  39. package/dist/stylers/Stylers.d.ts +0 -12
  40. package/dist/stylers/Stylers.js +0 -23
  41. package/dist/stylers/Stylers.jsx +0 -23
  42. package/dist/stylers/base.styler.d.ts +0 -6
  43. package/dist/stylers/base.styler.js +0 -71
  44. package/dist/stylers/base.styler.jsx +0 -71
  45. package/dist/stylers/index.js +0 -4
  46. package/dist/stylers/index.jsx +0 -4
  47. package/dist/stylers/normalizers.d.ts +0 -6
  48. package/dist/stylers/normalizers.js +0 -32
  49. package/dist/stylers/normalizers.jsx +0 -32
  50. package/dist/stylers/types.d.ts +0 -14
package/dist/index.d.ts CHANGED
@@ -1,11 +1,126 @@
1
- import { IdLabel, IdLabelArg, IdLabelDef, buildIdLabel } from "./items/IdLabel.js";
2
- import { ISVTStyler, TagListArgument, TagRule, TagRuleMode } from "./stylers/types.js";
3
- import { Stylers } from "./stylers/Stylers.js";
4
- import { exclusiveTagsNormalize, mainTagNormalize, twMergeNormalize } from "./stylers/normalizers.js";
5
- import { SVTRule, SVTRuleDef, SVTStyler, tagRuleMatches } from "./stylers/SVTStyler.js";
6
- import { baseStyler } from "./stylers/base.styler.js";
7
- import { Item, TItemClass, TItemClassArg, TItemProps } from "./items/Item.js";
8
- import { Block } from "./Block.js";
9
- import { ItemGroup } from "./items/ItemGroup.js";
10
- import { SolTw } from "./soltw.js";
1
+ import { Component, ParentProps } from "solid-js";
2
+ import { TokenizeArg } from "@mrts/common";
3
+
4
+ //#region src/items/IdLabel.d.ts
5
+ interface IdLabel {
6
+ id: string;
7
+ label: string;
8
+ [x: string | symbol]: unknown;
9
+ }
10
+ type IdLabelDef = {
11
+ id: string;
12
+ label?: string;
13
+ [x: string | symbol]: unknown;
14
+ };
15
+ type IdLabelArg = IdLabelDef | [string, string] | string;
16
+ declare function buildIdLabel(arg: IdLabelArg): IdLabel;
17
+ //#endregion
18
+ //#region src/stylers/types.d.ts
19
+ type TagListArgument = TokenizeArg;
20
+ interface ISVTStyler {
21
+ classes(stags: TagListArgument, vtags: TagListArgument): string[] | undefined;
22
+ }
23
+ type TagRuleMode = "or" | "and" | "any";
24
+ type TagRule = {
25
+ mode: TagRuleMode;
26
+ tags: string[];
27
+ };
28
+ //#endregion
29
+ //#region src/stylers/Stylers.d.ts
30
+ declare class Stylers {
31
+ private static _base;
32
+ private static _stylersMap;
33
+ static get base(): ISVTStyler | undefined;
34
+ static setBase(base: ISVTStyler | undefined): ISVTStyler | undefined;
35
+ static get(name: string): ISVTStyler | undefined;
36
+ }
37
+ //#endregion
38
+ //#region src/stylers/normalizers.d.ts
39
+ declare function twMergeNormalize(raw: string[]): string[];
40
+ declare function mainTagNormalize(rawTags: string[], defaultTag?: string): string[];
41
+ declare function exclusiveTagsNormalize(rawTags: string[], tagSet: Set<String> | ((tag: string) => boolean), defaultTag?: string): string[];
42
+ //#endregion
43
+ //#region src/stylers/SVTStyler.d.ts
44
+ type SVTRule = {
45
+ stagRule: TagRule;
46
+ vtagRule: TagRule;
47
+ classes: string[];
48
+ };
49
+ type SVTRuleDef = {
50
+ stagMode?: TagRuleMode;
51
+ vtagMode?: TagRuleMode;
52
+ stags?: TagListArgument;
53
+ vtags?: TagListArgument;
54
+ classes?: TagListArgument;
55
+ };
56
+ type SVTStylerOptions = {
57
+ normalizer?: (rawClasses: string[]) => string[];
58
+ stagsNormaliser?: (rawTags: string[]) => string[];
59
+ vtagsNormaliser?: (rawTags: string[]) => string[];
60
+ };
61
+ declare class SVTStyler implements ISVTStyler {
62
+ readonly _rules: SVTRule[];
63
+ readonly options: SVTStylerOptions;
64
+ constructor(rules: SVTRuleDef[], options?: SVTStylerOptions);
65
+ with(rules: SVTRuleDef[], options?: SVTStylerOptions): SVTStyler;
66
+ classes(stags: TagListArgument, vtags: TagListArgument): string[];
67
+ static normalizeRule(rule: SVTRuleDef): SVTRule;
68
+ ruleMatches(rule: SVTRule, stags: string[], vtags: string[]): boolean;
69
+ }
70
+ declare function tagRuleMatches(rule: TagRule, candidateTags: string[]): boolean;
71
+ //#endregion
72
+ //#region src/stylers/base.styler.d.ts
73
+ declare const baseStyler: SVTStyler;
74
+ //#endregion
75
+ //#region src/items/Item.d.ts
76
+ type TItemClass = {
77
+ item?: string;
78
+ selected?: string;
79
+ disabled?: string;
80
+ disabler?: string;
81
+ };
82
+ type TItemClassArg = TItemClass | string;
83
+ type TItemProps = {
84
+ idLabel: IdLabelArg;
85
+ callback?: (item: IdLabel) => void;
86
+ selected?: boolean;
87
+ disabled?: boolean;
88
+ clickableWhendisabled?: boolean;
89
+ styler?: ISVTStyler;
90
+ vtags?: TagListArgument;
91
+ class?: TItemClassArg;
92
+ };
93
+ declare const Item: Component<TItemProps>;
94
+ //#endregion
95
+ //#region src/Block.d.ts
96
+ type TProps$2 = ParentProps & {
97
+ vtags?: TagListArgument;
98
+ styler?: ISVTStyler;
99
+ class?: string;
100
+ element?: string;
101
+ };
102
+ declare const Block: Component<TProps$2>;
103
+ //#endregion
104
+ //#region src/items/ItemGroup.d.ts
105
+ type TProps$1 = {
106
+ items: IdLabelArg[];
107
+ callback?: (item: IdLabel) => void;
108
+ class?: string | {
109
+ group?: string;
110
+ item?: TItemClassArg;
111
+ };
112
+ selection?: string | {
113
+ [id: string]: boolean;
114
+ };
115
+ vtags?: TagListArgument | {
116
+ group?: TagListArgument;
117
+ item?: TagListArgument;
118
+ };
119
+ };
120
+ declare const ItemGroup: Component<TProps$1>;
121
+ //#endregion
122
+ //#region src/soltw.d.ts
123
+ type TProps = {};
124
+ declare const SolTw: Component<TProps>;
125
+ //#endregion
11
126
  export { Block, ISVTStyler, IdLabel, IdLabelArg, IdLabelDef, Item, ItemGroup, SVTRule, SVTRuleDef, SVTStyler, SolTw, Stylers, TItemClass, TItemClassArg, TItemProps, TagListArgument, TagRule, TagRuleMode, baseStyler, buildIdLabel, exclusiveTagsNormalize, mainTagNormalize, tagRuleMatches, twMergeNormalize };