@techfides/ui-library-design 0.3.1 → 0.7.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.
Files changed (189) hide show
  1. package/dist/anatomies.d.ts +1586 -0
  2. package/dist/anatomies.js +107 -0
  3. package/dist/anatomies.js.map +1 -0
  4. package/dist/anatomy.d.ts +13 -0
  5. package/dist/anatomy.js +6 -0
  6. package/dist/anatomy.js.map +1 -0
  7. package/dist/control.d.ts +1 -2
  8. package/dist/control.js +1 -2
  9. package/dist/control.js.map +1 -1
  10. package/dist/index.d.ts +55 -58
  11. package/dist/index.js +59 -62
  12. package/dist/recipes/accordion.d.ts +28 -1
  13. package/dist/recipes/accordion.js +29 -1
  14. package/dist/recipes/accordion.js.map +1 -1
  15. package/dist/recipes/alert.d.ts +45 -1
  16. package/dist/recipes/alert.js +45 -1
  17. package/dist/recipes/alert.js.map +1 -1
  18. package/dist/recipes/band.d.ts +11 -1
  19. package/dist/recipes/band.js +7 -1
  20. package/dist/recipes/band.js.map +1 -1
  21. package/dist/recipes/bars.d.ts +60 -1
  22. package/dist/recipes/bars.js +59 -1
  23. package/dist/recipes/bars.js.map +1 -1
  24. package/dist/recipes/brandMark.d.ts +8 -1
  25. package/dist/recipes/brandMark.js +7 -1
  26. package/dist/recipes/brandMark.js.map +1 -1
  27. package/dist/recipes/button.d.ts +41 -4
  28. package/dist/recipes/button.js +31 -2
  29. package/dist/recipes/button.js.map +1 -1
  30. package/dist/recipes/cardHeader.d.ts +18 -1
  31. package/dist/recipes/cardHeader.js +19 -1
  32. package/dist/recipes/cardHeader.js.map +1 -1
  33. package/dist/recipes/checkbox.d.ts +16 -1
  34. package/dist/recipes/checkbox.js +16 -3
  35. package/dist/recipes/checkbox.js.map +1 -1
  36. package/dist/recipes/chip.d.ts +41 -2
  37. package/dist/recipes/chip.js +34 -1
  38. package/dist/recipes/chip.js.map +1 -1
  39. package/dist/recipes/codeEditor.d.ts +8 -1
  40. package/dist/recipes/codeEditor.js +7 -1
  41. package/dist/recipes/codeEditor.js.map +1 -1
  42. package/dist/recipes/datePicker.d.ts +62 -1
  43. package/dist/recipes/datePicker.js +56 -3
  44. package/dist/recipes/datePicker.js.map +1 -1
  45. package/dist/recipes/dialog.d.ts +49 -1
  46. package/dist/recipes/dialog.js +40 -1
  47. package/dist/recipes/dialog.js.map +1 -1
  48. package/dist/recipes/feature.d.ts +30 -1
  49. package/dist/recipes/feature.js +30 -2
  50. package/dist/recipes/feature.js.map +1 -1
  51. package/dist/recipes/field.js +1 -1
  52. package/dist/recipes/findings.d.ts +33 -1
  53. package/dist/recipes/findings.js +34 -1
  54. package/dist/recipes/findings.js.map +1 -1
  55. package/dist/recipes/heading.d.ts +12 -2
  56. package/dist/recipes/heading.js +7 -1
  57. package/dist/recipes/heading.js.map +1 -1
  58. package/dist/recipes/heartbeat.d.ts +52 -2
  59. package/dist/recipes/heartbeat.js +51 -4
  60. package/dist/recipes/heartbeat.js.map +1 -1
  61. package/dist/recipes/ink.d.ts +11 -0
  62. package/dist/recipes/ink.js +13 -0
  63. package/dist/recipes/ink.js.map +1 -0
  64. package/dist/recipes/input.d.ts +55 -1
  65. package/dist/recipes/input.js +52 -2
  66. package/dist/recipes/input.js.map +1 -1
  67. package/dist/recipes/listItem.d.ts +18 -1
  68. package/dist/recipes/listItem.js +20 -1
  69. package/dist/recipes/listItem.js.map +1 -1
  70. package/dist/recipes/listbox.d.ts +22 -2
  71. package/dist/recipes/listbox.js +19 -1
  72. package/dist/recipes/listbox.js.map +1 -1
  73. package/dist/recipes/marquee.d.ts +26 -2
  74. package/dist/recipes/marquee.js +24 -1
  75. package/dist/recipes/marquee.js.map +1 -1
  76. package/dist/recipes/menu.d.ts +33 -1
  77. package/dist/recipes/menu.js +29 -1
  78. package/dist/recipes/menu.js.map +1 -1
  79. package/dist/recipes/metaRow.d.ts +11 -2
  80. package/dist/recipes/metaRow.js +7 -1
  81. package/dist/recipes/metaRow.js.map +1 -1
  82. package/dist/recipes/meter.d.ts +36 -2
  83. package/dist/recipes/meter.js +34 -1
  84. package/dist/recipes/meter.js.map +1 -1
  85. package/dist/recipes/motion.d.ts +9 -1
  86. package/dist/recipes/nebula.js +1 -1
  87. package/dist/recipes/numberRange.d.ts +44 -1
  88. package/dist/recipes/numberRange.js +36 -1
  89. package/dist/recipes/numberRange.js.map +1 -1
  90. package/dist/recipes/paper.d.ts +55 -2
  91. package/dist/recipes/paper.js +47 -4
  92. package/dist/recipes/paper.js.map +1 -1
  93. package/dist/recipes/progressBar.d.ts +8 -1
  94. package/dist/recipes/progressBar.js +7 -1
  95. package/dist/recipes/progressBar.js.map +1 -1
  96. package/dist/recipes/queue.d.ts +33 -1
  97. package/dist/recipes/queue.js +35 -1
  98. package/dist/recipes/queue.js.map +1 -1
  99. package/dist/recipes/radioGroup.d.ts +18 -1
  100. package/dist/recipes/radioGroup.js +21 -3
  101. package/dist/recipes/radioGroup.js.map +1 -1
  102. package/dist/recipes/scopeSwitcher.d.ts +38 -1
  103. package/dist/recipes/scopeSwitcher.js +40 -1
  104. package/dist/recipes/scopeSwitcher.js.map +1 -1
  105. package/dist/recipes/scrollArea.d.ts +12 -3
  106. package/dist/recipes/scrollArea.js +7 -1
  107. package/dist/recipes/scrollArea.js.map +1 -1
  108. package/dist/recipes/searchPalette.d.ts +48 -1
  109. package/dist/recipes/searchPalette.js +49 -1
  110. package/dist/recipes/searchPalette.js.map +1 -1
  111. package/dist/recipes/sectionHeader.d.ts +20 -2
  112. package/dist/recipes/sectionHeader.js +20 -3
  113. package/dist/recipes/sectionHeader.js.map +1 -1
  114. package/dist/recipes/segmentedControl.d.ts +8 -1
  115. package/dist/recipes/segmentedControl.js +7 -1
  116. package/dist/recipes/segmentedControl.js.map +1 -1
  117. package/dist/recipes/select.d.ts +57 -1
  118. package/dist/recipes/select.js +51 -1
  119. package/dist/recipes/select.js.map +1 -1
  120. package/dist/recipes/separator.d.ts +13 -2
  121. package/dist/recipes/separator.js +8 -2
  122. package/dist/recipes/separator.js.map +1 -1
  123. package/dist/recipes/sidebar.d.ts +128 -2
  124. package/dist/recipes/sidebar.js +125 -2
  125. package/dist/recipes/sidebar.js.map +1 -1
  126. package/dist/recipes/sky.d.ts +31 -1
  127. package/dist/recipes/sky.js +30 -1
  128. package/dist/recipes/sky.js.map +1 -1
  129. package/dist/recipes/slider.d.ts +15 -1
  130. package/dist/recipes/slider.js +14 -1
  131. package/dist/recipes/slider.js.map +1 -1
  132. package/dist/recipes/stat.d.ts +72 -3
  133. package/dist/recipes/stat.js +73 -3
  134. package/dist/recipes/stat.js.map +1 -1
  135. package/dist/recipes/switch.d.ts +10 -1
  136. package/dist/recipes/switch.js +9 -3
  137. package/dist/recipes/switch.js.map +1 -1
  138. package/dist/recipes/table.d.ts +63 -3
  139. package/dist/recipes/table.js +56 -2
  140. package/dist/recipes/table.js.map +1 -1
  141. package/dist/recipes/tail.d.ts +40 -5
  142. package/dist/recipes/tail.js +37 -5
  143. package/dist/recipes/tail.js.map +1 -1
  144. package/dist/recipes/text.d.ts +16 -3
  145. package/dist/recipes/text.js +8 -3
  146. package/dist/recipes/text.js.map +1 -1
  147. package/dist/recipes/textarea.d.ts +46 -1
  148. package/dist/recipes/textarea.js +41 -1
  149. package/dist/recipes/textarea.js.map +1 -1
  150. package/dist/recipes/tile.d.ts +23 -1
  151. package/dist/recipes/tile.js +19 -1
  152. package/dist/recipes/tile.js.map +1 -1
  153. package/dist/recipes/tooltip.d.ts +8 -1
  154. package/dist/recipes/tooltip.js +7 -1
  155. package/dist/recipes/tooltip.js.map +1 -1
  156. package/dist/recipes/topBar.d.ts +43 -1
  157. package/dist/recipes/topBar.js +44 -1
  158. package/dist/recipes/topBar.js.map +1 -1
  159. package/dist/recipes/trail.d.ts +55 -5
  160. package/dist/recipes/trail.js +47 -5
  161. package/dist/recipes/trail.js.map +1 -1
  162. package/dist/recipes/userMenu.d.ts +23 -1
  163. package/dist/recipes/userMenu.js +24 -1
  164. package/dist/recipes/userMenu.js.map +1 -1
  165. package/package.json +1 -2
  166. package/dist/charts/animation.js +0 -14
  167. package/dist/charts/animation.js.map +0 -1
  168. package/dist/charts/bars.d.ts +0 -22
  169. package/dist/charts/bars.js +0 -61
  170. package/dist/charts/bars.js.map +0 -1
  171. package/dist/charts/groupedBars.d.ts +0 -20
  172. package/dist/charts/groupedBars.js +0 -82
  173. package/dist/charts/groupedBars.js.map +0 -1
  174. package/dist/charts/paint.js +0 -19
  175. package/dist/charts/paint.js.map +0 -1
  176. package/dist/charts/spark.d.ts +0 -17
  177. package/dist/charts/spark.js +0 -159
  178. package/dist/charts/spark.js.map +0 -1
  179. package/dist/charts/tooltip.js +0 -41
  180. package/dist/charts/tooltip.js.map +0 -1
  181. package/dist/czech.d.ts +0 -6
  182. package/dist/czech.js +0 -100
  183. package/dist/czech.js.map +0 -1
  184. package/dist/tally.d.ts +0 -17
  185. package/dist/tally.js +0 -75
  186. package/dist/tally.js.map +0 -1
  187. package/dist/words.d.ts +0 -116
  188. package/dist/words.js +0 -96
  189. package/dist/words.js.map +0 -1
@@ -1,7 +1,6 @@
1
1
  //#region src/recipes/trail.d.ts
2
2
  declare const trailStates: readonly ["done", "failed", "current", "pending"];
3
3
  type TrailState = (typeof trailStates)[number];
4
- declare const defaultTrailState = "pending";
5
4
  declare const trailFlows: readonly ["row", "column"];
6
5
  type TrailFlow = (typeof trailFlows)[number];
7
6
  declare const defaultTrailFlow = "row";
@@ -11,17 +10,68 @@ declare const trailRecipe: (props?: ({
11
10
  declare const trailStepRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
12
11
  declare const trailCaptionRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
13
12
  declare const trailBadgeRecipe: (props?: ({
14
- state?: "current" | "done" | "failed" | "pending" | null | undefined;
13
+ state?: "pending" | "done" | "failed" | "current" | null | undefined;
15
14
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
16
15
  declare const trailSpinRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
17
16
  declare const trailConnectorRecipe: (props?: ({
18
17
  flow?: "row" | "column" | null | undefined;
19
- state?: "current" | "done" | "failed" | "pending" | null | undefined;
18
+ state?: "pending" | "done" | "failed" | "current" | null | undefined;
20
19
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
21
20
  declare const trailLabelRecipe: (props?: ({
22
- state?: "current" | "done" | "failed" | "pending" | null | undefined;
21
+ state?: "pending" | "done" | "failed" | "current" | null | undefined;
23
22
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
24
23
  declare const trailHintRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
24
+ declare const trailAnatomy: {
25
+ readonly badge: {
26
+ readonly part: "badge";
27
+ readonly recipe: (props?: ({
28
+ state?: "pending" | "done" | "failed" | "current" | null | undefined;
29
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
30
+ readonly required: true;
31
+ };
32
+ readonly caption: {
33
+ readonly part: "caption";
34
+ readonly recipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
35
+ readonly required: true;
36
+ };
37
+ readonly connector: {
38
+ readonly part: "connector";
39
+ readonly recipe: (props?: ({
40
+ flow?: "row" | "column" | null | undefined;
41
+ state?: "pending" | "done" | "failed" | "current" | null | undefined;
42
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
43
+ readonly required: false;
44
+ };
45
+ readonly hint: {
46
+ readonly part: "hint";
47
+ readonly recipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
48
+ readonly required: false;
49
+ };
50
+ readonly label: {
51
+ readonly part: "label";
52
+ readonly recipe: (props?: ({
53
+ state?: "pending" | "done" | "failed" | "current" | null | undefined;
54
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
55
+ readonly required: true;
56
+ };
57
+ readonly meta: {
58
+ readonly part: "meta";
59
+ readonly recipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
60
+ readonly required: false;
61
+ };
62
+ readonly root: {
63
+ readonly part: "trail";
64
+ readonly recipe: (props?: ({
65
+ flow?: "row" | "column" | null | undefined;
66
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
67
+ readonly required: true;
68
+ };
69
+ readonly step: {
70
+ readonly part: "step";
71
+ readonly recipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
72
+ readonly required: false;
73
+ };
74
+ };
25
75
  //#endregion
26
- export { type TrailFlow, type TrailState, defaultTrailFlow, defaultTrailState, trailBadgeRecipe, trailCaptionRecipe, trailConnectorRecipe, trailFlows, trailHintRecipe, trailLabelRecipe, trailRecipe, trailSpinRecipe, trailStates, trailStepRecipe };
76
+ export { type TrailFlow, type TrailState, defaultTrailFlow, trailAnatomy, trailBadgeRecipe, trailCaptionRecipe, trailConnectorRecipe, trailFlows, trailHintRecipe, trailLabelRecipe, trailRecipe, trailSpinRecipe, trailStates, trailStepRecipe };
27
77
  //# sourceMappingURL=trail.d.ts.map
@@ -1,3 +1,4 @@
1
+ import { anatomy } from "../anatomy.js";
1
2
  import { cva } from "class-variance-authority";
2
3
  //#region src/recipes/trail.ts
3
4
  const trailStates = [
@@ -6,7 +7,6 @@ const trailStates = [
6
7
  "current",
7
8
  "pending"
8
9
  ];
9
- const defaultTrailState = "pending";
10
10
  const trailFlows = ["row", "column"];
11
11
  const defaultTrailFlow = "row";
12
12
  const trailRecipe = cva("rounded-tf-block bg-tf-sunken p-6 font-tf-body", {
@@ -23,7 +23,7 @@ const trailBadgeRecipe = cva([
23
23
  "tf-icons",
24
24
  "[&_svg]:size-tf-icon-2xs [&_svg]:shrink-0"
25
25
  ], {
26
- defaultVariants: { state: defaultTrailState },
26
+ defaultVariants: { state: "pending" },
27
27
  variants: { state: {
28
28
  current: "bg-tf-blend text-tf-on-accent blend-tf-accent",
29
29
  done: "bg-tf-blend text-tf-on-semantic blend-tf-success",
@@ -35,7 +35,7 @@ const trailSpinRecipe = cva("[&_svg]:animate-spin motion-reduce:[&_svg]:animate-
35
35
  const trailConnectorRecipe = cva("", {
36
36
  defaultVariants: {
37
37
  flow: "row",
38
- state: defaultTrailState
38
+ state: "pending"
39
39
  },
40
40
  variants: {
41
41
  flow: {
@@ -51,7 +51,7 @@ const trailConnectorRecipe = cva("", {
51
51
  }
52
52
  });
53
53
  const trailLabelRecipe = cva("text-tf-caption font-medium", {
54
- defaultVariants: { state: defaultTrailState },
54
+ defaultVariants: { state: "pending" },
55
55
  variants: { state: {
56
56
  current: "text-tf-accent-hi",
57
57
  done: "text-tf-fg",
@@ -60,7 +60,49 @@ const trailLabelRecipe = cva("text-tf-caption font-medium", {
60
60
  } }
61
61
  });
62
62
  const trailHintRecipe = cva("text-tf-caption-sm text-tf-muted");
63
+ const trailAnatomy = anatomy({
64
+ badge: {
65
+ part: "badge",
66
+ recipe: trailBadgeRecipe,
67
+ required: true
68
+ },
69
+ caption: {
70
+ part: "caption",
71
+ recipe: trailCaptionRecipe,
72
+ required: true
73
+ },
74
+ connector: {
75
+ part: "connector",
76
+ recipe: trailConnectorRecipe,
77
+ required: false
78
+ },
79
+ hint: {
80
+ part: "hint",
81
+ recipe: trailHintRecipe,
82
+ required: false
83
+ },
84
+ label: {
85
+ part: "label",
86
+ recipe: trailLabelRecipe,
87
+ required: true
88
+ },
89
+ meta: {
90
+ part: "meta",
91
+ recipe: trailHintRecipe,
92
+ required: false
93
+ },
94
+ root: {
95
+ part: "trail",
96
+ recipe: trailRecipe,
97
+ required: true
98
+ },
99
+ step: {
100
+ part: "step",
101
+ recipe: trailStepRecipe,
102
+ required: false
103
+ }
104
+ });
63
105
  //#endregion
64
- export { defaultTrailFlow, defaultTrailState, trailBadgeRecipe, trailCaptionRecipe, trailConnectorRecipe, trailFlows, trailHintRecipe, trailLabelRecipe, trailRecipe, trailSpinRecipe, trailStates, trailStepRecipe };
106
+ export { defaultTrailFlow, trailAnatomy, trailBadgeRecipe, trailCaptionRecipe, trailConnectorRecipe, trailFlows, trailHintRecipe, trailLabelRecipe, trailRecipe, trailSpinRecipe, trailStates, trailStepRecipe };
65
107
 
66
108
  //# sourceMappingURL=trail.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"trail.js","names":[],"sources":["../../src/recipes/trail.ts"],"sourcesContent":["import { cva } from 'class-variance-authority'\n\nconst trailStates = ['done', 'failed', 'current', 'pending'] as const\n\ntype TrailState = (typeof trailStates)[number]\n\nconst defaultTrailState = 'pending' satisfies TrailState\n\nconst trailFlows = ['row', 'column'] as const\n\ntype TrailFlow = (typeof trailFlows)[number]\n\nconst defaultTrailFlow = 'row' satisfies TrailFlow\n\nconst trailRecipe = cva('rounded-tf-block bg-tf-sunken p-6 font-tf-body', {\n defaultVariants: { flow: defaultTrailFlow },\n variants: {\n flow: {\n column: 'grid grid-cols-1 gap-3',\n row: 'grid gap-y-2',\n } satisfies Record<TrailFlow, string>,\n },\n})\n\nconst trailStepRecipe = cva('relative flex flex-row items-start gap-2')\n\nconst trailCaptionRecipe = cva(\n '[grid-column:span_2] flex min-w-0 flex-1 flex-col gap-0 pr-3 last:[grid-column:span_1] last:pr-0',\n)\n\nconst trailBadgeRecipe = cva(\n [\n 'relative isolate flex size-6.5 flex-none items-center justify-center rounded-tf-pill',\n 'tf-icons',\n '[&_svg]:size-tf-icon-2xs [&_svg]:shrink-0',\n ],\n {\n defaultVariants: { state: defaultTrailState },\n variants: {\n state: {\n current: 'bg-tf-blend text-tf-on-accent blend-tf-accent',\n done: 'bg-tf-blend text-tf-on-semantic blend-tf-success',\n failed: 'bg-tf-blend text-tf-on-semantic blend-tf-danger',\n pending: 'bg-tf-panel text-tf-muted opacity-55',\n } satisfies Record<TrailState, string>,\n },\n },\n)\n\nconst trailSpinRecipe = cva('[&_svg]:animate-spin motion-reduce:[&_svg]:animate-none')\n\nconst trailConnectorRecipe = cva('', {\n defaultVariants: { flow: defaultTrailFlow, state: defaultTrailState },\n variants: {\n flow: {\n column: 'absolute top-6.5 -bottom-3 left-[calc(1.625rem/2-1px)] w-0.5',\n row: 'mx-1 mt-[calc(1.625rem/2)] h-0.5 min-w-6',\n } satisfies Record<TrailFlow, string>,\n state: {\n current: 'bg-tf-line',\n done: 'bg-tf-success-hi',\n failed: 'bg-tf-danger-hi',\n pending: 'bg-tf-line',\n } satisfies Record<TrailState, string>,\n },\n})\n\nconst trailLabelRecipe = cva('text-tf-caption font-medium', {\n defaultVariants: { state: defaultTrailState },\n variants: {\n state: {\n current: 'text-tf-accent-hi',\n done: 'text-tf-fg',\n failed: 'text-tf-danger-hi',\n pending: 'text-tf-muted',\n } satisfies Record<TrailState, string>,\n },\n})\n\nconst trailHintRecipe = cva('text-tf-caption-sm text-tf-muted')\n\nexport {\n type TrailFlow,\n type TrailState,\n defaultTrailFlow,\n defaultTrailState,\n trailBadgeRecipe,\n trailCaptionRecipe,\n trailConnectorRecipe,\n trailFlows,\n trailHintRecipe,\n trailLabelRecipe,\n trailRecipe,\n trailSpinRecipe,\n trailStates,\n trailStepRecipe,\n}\n"],"mappings":";;AAEA,MAAM,cAAc;CAAC;CAAQ;CAAU;CAAW;AAAS;AAI3D,MAAM,oBAAoB;AAE1B,MAAM,aAAa,CAAC,OAAO,QAAQ;AAInC,MAAM,mBAAmB;AAEzB,MAAM,cAAc,IAAI,kDAAkD;CACxE,iBAAiB,EAAE,MAAA,MAAuB;CAC1C,UAAU,EACR,MAAM;EACJ,QAAQ;EACR,KAAK;CACP,EACF;AACF,CAAC;AAED,MAAM,kBAAkB,IAAI,0CAA0C;AAEtE,MAAM,qBAAqB,IACzB,kGACF;AAEA,MAAM,mBAAmB,IACvB;CACE;CACA;CACA;AACF,GACA;CACE,iBAAiB,EAAE,OAAO,kBAAkB;CAC5C,UAAU,EACR,OAAO;EACL,SAAS;EACT,MAAM;EACN,QAAQ;EACR,SAAS;CACX,EACF;AACF,CACF;AAEA,MAAM,kBAAkB,IAAI,yDAAyD;AAErF,MAAM,uBAAuB,IAAI,IAAI;CACnC,iBAAiB;EAAE,MAAA;EAAwB,OAAO;CAAkB;CACpE,UAAU;EACR,MAAM;GACJ,QAAQ;GACR,KAAK;EACP;EACA,OAAO;GACL,SAAS;GACT,MAAM;GACN,QAAQ;GACR,SAAS;EACX;CACF;AACF,CAAC;AAED,MAAM,mBAAmB,IAAI,+BAA+B;CAC1D,iBAAiB,EAAE,OAAO,kBAAkB;CAC5C,UAAU,EACR,OAAO;EACL,SAAS;EACT,MAAM;EACN,QAAQ;EACR,SAAS;CACX,EACF;AACF,CAAC;AAED,MAAM,kBAAkB,IAAI,kCAAkC"}
1
+ {"version":3,"file":"trail.js","names":[],"sources":["../../src/recipes/trail.ts"],"sourcesContent":["import { cva } from 'class-variance-authority'\n\nimport { anatomy } from '#anatomy'\n\nconst trailStates = ['done', 'failed', 'current', 'pending'] as const\n\ntype TrailState = (typeof trailStates)[number]\n\nconst trailFlows = ['row', 'column'] as const\n\ntype TrailFlow = (typeof trailFlows)[number]\n\nconst defaultTrailFlow = 'row' satisfies TrailFlow\n\nconst trailRecipe = cva('rounded-tf-block bg-tf-sunken p-6 font-tf-body', {\n defaultVariants: { flow: defaultTrailFlow },\n variants: {\n flow: {\n column: 'grid grid-cols-1 gap-3',\n row: 'grid gap-y-2',\n } satisfies Record<TrailFlow, string>,\n },\n})\n\nconst trailStepRecipe = cva('relative flex flex-row items-start gap-2')\n\nconst trailCaptionRecipe = cva(\n '[grid-column:span_2] flex min-w-0 flex-1 flex-col gap-0 pr-3 last:[grid-column:span_1] last:pr-0',\n)\n\nconst trailBadgeRecipe = cva(\n [\n 'relative isolate flex size-6.5 flex-none items-center justify-center rounded-tf-pill',\n 'tf-icons',\n '[&_svg]:size-tf-icon-2xs [&_svg]:shrink-0',\n ],\n {\n defaultVariants: { state: 'pending' },\n variants: {\n state: {\n current: 'bg-tf-blend text-tf-on-accent blend-tf-accent',\n done: 'bg-tf-blend text-tf-on-semantic blend-tf-success',\n failed: 'bg-tf-blend text-tf-on-semantic blend-tf-danger',\n pending: 'bg-tf-panel text-tf-muted opacity-55',\n } satisfies Record<TrailState, string>,\n },\n },\n)\n\nconst trailSpinRecipe = cva('[&_svg]:animate-spin motion-reduce:[&_svg]:animate-none')\n\nconst trailConnectorRecipe = cva('', {\n defaultVariants: { flow: defaultTrailFlow, state: 'pending' },\n variants: {\n flow: {\n column: 'absolute top-6.5 -bottom-3 left-[calc(1.625rem/2-1px)] w-0.5',\n row: 'mx-1 mt-[calc(1.625rem/2)] h-0.5 min-w-6',\n } satisfies Record<TrailFlow, string>,\n state: {\n current: 'bg-tf-line',\n done: 'bg-tf-success-hi',\n failed: 'bg-tf-danger-hi',\n pending: 'bg-tf-line',\n } satisfies Record<TrailState, string>,\n },\n})\n\nconst trailLabelRecipe = cva('text-tf-caption font-medium', {\n defaultVariants: { state: 'pending' },\n variants: {\n state: {\n current: 'text-tf-accent-hi',\n done: 'text-tf-fg',\n failed: 'text-tf-danger-hi',\n pending: 'text-tf-muted',\n } satisfies Record<TrailState, string>,\n },\n})\n\nconst trailHintRecipe = cva('text-tf-caption-sm text-tf-muted')\n\nconst trailAnatomy = anatomy({\n badge: { part: 'badge', recipe: trailBadgeRecipe, required: true },\n caption: { part: 'caption', recipe: trailCaptionRecipe, required: true },\n connector: { part: 'connector', recipe: trailConnectorRecipe, required: false },\n hint: { part: 'hint', recipe: trailHintRecipe, required: false },\n label: { part: 'label', recipe: trailLabelRecipe, required: true },\n meta: { part: 'meta', recipe: trailHintRecipe, required: false },\n root: { part: 'trail', recipe: trailRecipe, required: true },\n step: { part: 'step', recipe: trailStepRecipe, required: false },\n})\n\nexport {\n type TrailFlow,\n type TrailState,\n defaultTrailFlow,\n trailAnatomy,\n trailBadgeRecipe,\n trailCaptionRecipe,\n trailConnectorRecipe,\n trailFlows,\n trailHintRecipe,\n trailLabelRecipe,\n trailRecipe,\n trailSpinRecipe,\n trailStates,\n trailStepRecipe,\n}\n"],"mappings":";;;AAIA,MAAM,cAAc;CAAC;CAAQ;CAAU;CAAW;AAAS;AAI3D,MAAM,aAAa,CAAC,OAAO,QAAQ;AAInC,MAAM,mBAAmB;AAEzB,MAAM,cAAc,IAAI,kDAAkD;CACxE,iBAAiB,EAAE,MAAA,MAAuB;CAC1C,UAAU,EACR,MAAM;EACJ,QAAQ;EACR,KAAK;CACP,EACF;AACF,CAAC;AAED,MAAM,kBAAkB,IAAI,0CAA0C;AAEtE,MAAM,qBAAqB,IACzB,kGACF;AAEA,MAAM,mBAAmB,IACvB;CACE;CACA;CACA;AACF,GACA;CACE,iBAAiB,EAAE,OAAO,UAAU;CACpC,UAAU,EACR,OAAO;EACL,SAAS;EACT,MAAM;EACN,QAAQ;EACR,SAAS;CACX,EACF;AACF,CACF;AAEA,MAAM,kBAAkB,IAAI,yDAAyD;AAErF,MAAM,uBAAuB,IAAI,IAAI;CACnC,iBAAiB;EAAE,MAAA;EAAwB,OAAO;CAAU;CAC5D,UAAU;EACR,MAAM;GACJ,QAAQ;GACR,KAAK;EACP;EACA,OAAO;GACL,SAAS;GACT,MAAM;GACN,QAAQ;GACR,SAAS;EACX;CACF;AACF,CAAC;AAED,MAAM,mBAAmB,IAAI,+BAA+B;CAC1D,iBAAiB,EAAE,OAAO,UAAU;CACpC,UAAU,EACR,OAAO;EACL,SAAS;EACT,MAAM;EACN,QAAQ;EACR,SAAS;CACX,EACF;AACF,CAAC;AAED,MAAM,kBAAkB,IAAI,kCAAkC;AAE9D,MAAM,eAAe,QAAQ;CAC3B,OAAO;EAAE,MAAM;EAAS,QAAQ;EAAkB,UAAU;CAAK;CACjE,SAAS;EAAE,MAAM;EAAW,QAAQ;EAAoB,UAAU;CAAK;CACvE,WAAW;EAAE,MAAM;EAAa,QAAQ;EAAsB,UAAU;CAAM;CAC9E,MAAM;EAAE,MAAM;EAAQ,QAAQ;EAAiB,UAAU;CAAM;CAC/D,OAAO;EAAE,MAAM;EAAS,QAAQ;EAAkB,UAAU;CAAK;CACjE,MAAM;EAAE,MAAM;EAAQ,QAAQ;EAAiB,UAAU;CAAM;CAC/D,MAAM;EAAE,MAAM;EAAS,QAAQ;EAAa,UAAU;CAAK;CAC3D,MAAM;EAAE,MAAM;EAAQ,QAAQ;EAAiB,UAAU;CAAM;AACjE,CAAC"}
@@ -6,6 +6,28 @@ declare const userIdentityRecipe: (props?: import("class-variance-authority/type
6
6
  declare const userNameRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
7
7
  declare const userRoleRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
8
8
  declare const userChevronRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
9
+ declare const userMenuAnatomy: {
10
+ readonly identity: {
11
+ readonly part: "identity";
12
+ readonly recipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
13
+ readonly required: true;
14
+ };
15
+ readonly name: {
16
+ readonly part: "name";
17
+ readonly recipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
18
+ readonly required: true;
19
+ };
20
+ readonly root: {
21
+ readonly part: "account";
22
+ readonly recipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
23
+ readonly required: true;
24
+ };
25
+ readonly subtitle: {
26
+ readonly part: "subtitle";
27
+ readonly recipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
28
+ readonly required: false;
29
+ };
30
+ };
9
31
  //#endregion
10
- export { userAvatarRecipe, userChevronRecipe, userIdentityRecipe, userNameRecipe, userPortraitRecipe, userRoleRecipe, userTriggerRecipe };
32
+ export { userAvatarRecipe, userChevronRecipe, userIdentityRecipe, userMenuAnatomy, userNameRecipe, userPortraitRecipe, userRoleRecipe, userTriggerRecipe };
11
33
  //# sourceMappingURL=userMenu.d.ts.map
@@ -1,3 +1,4 @@
1
+ import { anatomy } from "../anatomy.js";
1
2
  import { controlInert, controlPress } from "../parts/control.js";
2
3
  import { railCollapse, railMorph } from "./motion.js";
3
4
  import { cva } from "class-variance-authority";
@@ -32,7 +33,29 @@ const userChevronRecipe = cva([
32
33
  "[--tf-travel:opacity_var(--tf-timing-glide)]",
33
34
  railMorph
34
35
  ]);
36
+ const userMenuAnatomy = anatomy({
37
+ identity: {
38
+ part: "identity",
39
+ recipe: userIdentityRecipe,
40
+ required: true
41
+ },
42
+ name: {
43
+ part: "name",
44
+ recipe: userNameRecipe,
45
+ required: true
46
+ },
47
+ root: {
48
+ part: "account",
49
+ recipe: userTriggerRecipe,
50
+ required: true
51
+ },
52
+ subtitle: {
53
+ part: "subtitle",
54
+ recipe: userRoleRecipe,
55
+ required: false
56
+ }
57
+ });
35
58
  //#endregion
36
- export { userAvatarRecipe, userChevronRecipe, userIdentityRecipe, userNameRecipe, userPortraitRecipe, userRoleRecipe, userTriggerRecipe };
59
+ export { userAvatarRecipe, userChevronRecipe, userIdentityRecipe, userMenuAnatomy, userNameRecipe, userPortraitRecipe, userRoleRecipe, userTriggerRecipe };
37
60
 
38
61
  //# sourceMappingURL=userMenu.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"userMenu.js","names":[],"sources":["../../src/recipes/userMenu.ts"],"sourcesContent":["import { cva } from 'class-variance-authority'\n\nimport { controlInert, controlPress } from '#parts/control'\n\nimport { railCollapse, railMorph } from './motion'\n\nconst userTriggerRecipe = cva([\n 'flex w-full items-center justify-center gap-3 rounded-tf-control p-3 text-left',\n 'text-tf-fg data-rail:gap-0 data-rail:py-2',\n 'data-rail:px-2',\n 'interactive:hovered:bg-tf-panel',\n 'hovered:**:data-[scope=avatar]:tf-edge-lit',\n 'focused:**:data-[scope=avatar]:tf-edge-lit',\n 'outline-hidden',\n 'focused:outline-2 focused:outline-offset-2 focused:outline-tf-accent-hi focused:outline-solid',\n `cursor-pointer ${railMorph}`,\n '[&_svg]:size-tf-icon-sm [&_svg]:shrink-0',\n ...controlPress,\n ...controlInert,\n])\n\nconst userAvatarRecipe = cva([\n 'relative isolate flex size-tf-control-sm flex-none items-center justify-center',\n 'rounded-tf-pill bg-tf-panel-hi text-tf-caption font-medium text-tf-fg',\n 'tf-edge-sweep tf-swept blend-tf-accent',\n 'tf-transition motion-reduce:transition-none',\n])\n\nconst userPortraitRecipe = cva('size-full rounded-tf-pill object-cover')\n\nconst userIdentityRecipe = cva(`flex flex-col gap-0 ${railCollapse}`)\n\nconst userNameRecipe = cva('truncate text-tf-body-sm font-medium')\n\nconst userRoleRecipe = cva('truncate text-tf-caption-sm text-tf-muted')\n\nconst userChevronRecipe = cva([\n 'flex-none text-tf-muted',\n 'in-data-rail:size-0! in-data-rail:opacity-0',\n '[--tf-travel:opacity_var(--tf-timing-glide)]',\n railMorph,\n])\n\nexport {\n userAvatarRecipe,\n userPortraitRecipe,\n userChevronRecipe,\n userIdentityRecipe,\n userNameRecipe,\n userRoleRecipe,\n userTriggerRecipe,\n}\n"],"mappings":";;;;AAMA,MAAM,oBAAoB,IAAI;CAC5B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA,kBAAkB;CAClB;CACA,GAAG;CACH,GAAG;AACL,CAAC;AAED,MAAM,mBAAmB,IAAI;CAC3B;CACA;CACA;CACA;AACF,CAAC;AAED,MAAM,qBAAqB,IAAI,wCAAwC;AAEvE,MAAM,qBAAqB,IAAI,uBAAuB,cAAc;AAEpE,MAAM,iBAAiB,IAAI,sCAAsC;AAEjE,MAAM,iBAAiB,IAAI,2CAA2C;AAEtE,MAAM,oBAAoB,IAAI;CAC5B;CACA;CACA;CACA;AACF,CAAC"}
1
+ {"version":3,"file":"userMenu.js","names":[],"sources":["../../src/recipes/userMenu.ts"],"sourcesContent":["import { cva } from 'class-variance-authority'\n\nimport { anatomy } from '#anatomy'\nimport { controlInert, controlPress } from '#parts/control'\n\nimport { railCollapse, railMorph } from './motion'\n\nconst userTriggerRecipe = cva([\n 'flex w-full items-center justify-center gap-3 rounded-tf-control p-3 text-left',\n 'text-tf-fg data-rail:gap-0 data-rail:py-2',\n 'data-rail:px-2',\n 'interactive:hovered:bg-tf-panel',\n 'hovered:**:data-[scope=avatar]:tf-edge-lit',\n 'focused:**:data-[scope=avatar]:tf-edge-lit',\n 'outline-hidden',\n 'focused:outline-2 focused:outline-offset-2 focused:outline-tf-accent-hi focused:outline-solid',\n `cursor-pointer ${railMorph}`,\n '[&_svg]:size-tf-icon-sm [&_svg]:shrink-0',\n ...controlPress,\n ...controlInert,\n])\n\nconst userAvatarRecipe = cva([\n 'relative isolate flex size-tf-control-sm flex-none items-center justify-center',\n 'rounded-tf-pill bg-tf-panel-hi text-tf-caption font-medium text-tf-fg',\n 'tf-edge-sweep tf-swept blend-tf-accent',\n 'tf-transition motion-reduce:transition-none',\n])\n\nconst userPortraitRecipe = cva('size-full rounded-tf-pill object-cover')\n\nconst userIdentityRecipe = cva(`flex flex-col gap-0 ${railCollapse}`)\n\nconst userNameRecipe = cva('truncate text-tf-body-sm font-medium')\n\nconst userRoleRecipe = cva('truncate text-tf-caption-sm text-tf-muted')\n\nconst userChevronRecipe = cva([\n 'flex-none text-tf-muted',\n 'in-data-rail:size-0! in-data-rail:opacity-0',\n '[--tf-travel:opacity_var(--tf-timing-glide)]',\n railMorph,\n])\n\nconst userMenuAnatomy = anatomy({\n identity: { part: 'identity', recipe: userIdentityRecipe, required: true },\n name: { part: 'name', recipe: userNameRecipe, required: true },\n root: { part: 'account', recipe: userTriggerRecipe, required: true },\n subtitle: { part: 'subtitle', recipe: userRoleRecipe, required: false },\n})\n\nexport {\n userAvatarRecipe,\n userMenuAnatomy,\n userPortraitRecipe,\n userChevronRecipe,\n userIdentityRecipe,\n userNameRecipe,\n userRoleRecipe,\n userTriggerRecipe,\n}\n"],"mappings":";;;;;AAOA,MAAM,oBAAoB,IAAI;CAC5B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA,kBAAkB;CAClB;CACA,GAAG;CACH,GAAG;AACL,CAAC;AAED,MAAM,mBAAmB,IAAI;CAC3B;CACA;CACA;CACA;AACF,CAAC;AAED,MAAM,qBAAqB,IAAI,wCAAwC;AAEvE,MAAM,qBAAqB,IAAI,uBAAuB,cAAc;AAEpE,MAAM,iBAAiB,IAAI,sCAAsC;AAEjE,MAAM,iBAAiB,IAAI,2CAA2C;AAEtE,MAAM,oBAAoB,IAAI;CAC5B;CACA;CACA;CACA;AACF,CAAC;AAED,MAAM,kBAAkB,QAAQ;CAC9B,UAAU;EAAE,MAAM;EAAY,QAAQ;EAAoB,UAAU;CAAK;CACzE,MAAM;EAAE,MAAM;EAAQ,QAAQ;EAAgB,UAAU;CAAK;CAC7D,MAAM;EAAE,MAAM;EAAW,QAAQ;EAAmB,UAAU;CAAK;CACnE,UAAU;EAAE,MAAM;EAAY,QAAQ;EAAgB,UAAU;CAAM;AACxE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@techfides/ui-library-design",
3
- "version": "0.3.1",
3
+ "version": "0.7.0",
4
4
  "description": "Framework-agnostic design core for the TechFides UI library: Tailwind design tokens and component variant recipes",
5
5
  "keywords": [
6
6
  "cva",
@@ -42,7 +42,6 @@
42
42
  "@fontsource/poppins": "^5.3.0",
43
43
  "class-variance-authority": "^0.7.1",
44
44
  "clsx": "^2.1.1",
45
- "echarts": "^6.1.0",
46
45
  "tailwind-merge": "^3.6.0"
47
46
  },
48
47
  "devDependencies": {
@@ -1,14 +0,0 @@
1
- //#region src/charts/animation.ts
2
- const CHART_EASING = "cubicOut";
3
- const chartAnimation = (durationMs) => ({
4
- animation: true,
5
- animationDuration: durationMs,
6
- animationDurationUpdate: durationMs,
7
- animationEasing: CHART_EASING,
8
- animationEasingUpdate: CHART_EASING
9
- });
10
- const chartStagger = (stepMs) => (index) => index * stepMs;
11
- //#endregion
12
- export { CHART_EASING, chartAnimation, chartStagger };
13
-
14
- //# sourceMappingURL=animation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"animation.js","names":[],"sources":["../../src/charts/animation.ts"],"sourcesContent":["import type { EChartsOption } from 'echarts'\n\nconst CHART_EASING = 'cubicOut'\n\ntype ChartAnimation = Pick<\n EChartsOption,\n | 'animation'\n | 'animationDuration'\n | 'animationDurationUpdate'\n | 'animationEasing'\n | 'animationEasingUpdate'\n>\n\nconst chartAnimation = (durationMs: number): ChartAnimation => ({\n animation: true,\n animationDuration: durationMs,\n animationDurationUpdate: durationMs,\n animationEasing: CHART_EASING,\n animationEasingUpdate: CHART_EASING,\n})\n\nconst chartStagger =\n (stepMs: number) =>\n (index: number): number =>\n index * stepMs\n\nexport { CHART_EASING, chartAnimation, chartStagger }\n"],"mappings":";AAEA,MAAM,eAAe;AAWrB,MAAM,kBAAkB,gBAAwC;CAC9D,WAAW;CACX,mBAAmB;CACnB,yBAAyB;CACzB,iBAAiB;CACjB,uBAAuB;AACzB;AAEA,MAAM,gBACH,YACA,UACC,QAAQ"}
@@ -1,22 +0,0 @@
1
- import { EChartsOption } from "echarts";
2
- //#region src/charts/bars.d.ts
3
- interface BarsAccent {
4
- hi: string;
5
- surface: string;
6
- }
7
- interface BarsPoint {
8
- label: string;
9
- value: number | null;
10
- }
11
- interface BarsOptionInput {
12
- accent: BarsAccent;
13
- durationMs: number;
14
- labelColor: string;
15
- radius: number;
16
- stateDurationMs: number;
17
- values: readonly BarsPoint[];
18
- }
19
- declare const barsOption: (input: BarsOptionInput) => EChartsOption;
20
- //#endregion
21
- export { type BarsAccent, type BarsOptionInput, type BarsPoint, barsOption };
22
- //# sourceMappingURL=bars.d.ts.map
@@ -1,61 +0,0 @@
1
- import { CHART_EASING, chartAnimation, chartStagger } from "./animation.js";
2
- import { verticalGradient } from "./paint.js";
3
- import { chartTooltip, formatCallbackValue } from "./tooltip.js";
4
- //#region src/charts/bars.ts
5
- const GRID = {
6
- bottom: 22,
7
- left: 4,
8
- right: 4,
9
- top: 8
10
- };
11
- const BAR_CATEGORY_GAP = "35%";
12
- const LABEL_FONT_SIZE = 11;
13
- const STAGGER_MS = 40;
14
- const EMPTY_LENGTH = 0;
15
- const FIRST_INDEX = 0;
16
- const barPointFormatter = (params) => {
17
- const point = params[FIRST_INDEX];
18
- if (!point) return "";
19
- return `${point.name}: ${formatCallbackValue(point.value)}`;
20
- };
21
- const barsOption = (input) => {
22
- if (input.values.length === EMPTY_LENGTH) return { series: [] };
23
- return {
24
- ...chartAnimation(input.durationMs),
25
- grid: GRID,
26
- series: [{
27
- animationDelay: chartStagger(STAGGER_MS),
28
- barCategoryGap: BAR_CATEGORY_GAP,
29
- data: input.values.map((point) => point.value),
30
- emphasis: { disabled: true },
31
- itemStyle: {
32
- borderRadius: input.radius,
33
- color: verticalGradient(input.accent.hi, input.accent.surface)
34
- },
35
- stateAnimation: {
36
- duration: input.stateDurationMs,
37
- easing: CHART_EASING
38
- },
39
- type: "bar"
40
- }],
41
- tooltip: chartTooltip(barPointFormatter),
42
- xAxis: {
43
- axisLabel: {
44
- color: input.labelColor,
45
- fontSize: LABEL_FONT_SIZE
46
- },
47
- axisLine: { show: false },
48
- axisTick: { show: false },
49
- data: input.values.map((point) => point.label),
50
- type: "category"
51
- },
52
- yAxis: {
53
- show: false,
54
- type: "value"
55
- }
56
- };
57
- };
58
- //#endregion
59
- export { barsOption };
60
-
61
- //# sourceMappingURL=bars.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"bars.js","names":[],"sources":["../../src/charts/bars.ts"],"sourcesContent":["import type { DefaultLabelFormatterCallbackParams, EChartsOption } from 'echarts'\n\nimport { CHART_EASING, chartAnimation, chartStagger } from './animation'\nimport { verticalGradient } from './paint'\nimport { chartTooltip, formatCallbackValue } from './tooltip'\n\ninterface BarsAccent {\n hi: string\n\n surface: string\n}\n\ninterface BarsPoint {\n label: string\n\n value: number | null\n}\n\ninterface BarsOptionInput {\n accent: BarsAccent\n\n durationMs: number\n\n labelColor: string\n\n radius: number\n\n stateDurationMs: number\n\n values: readonly BarsPoint[]\n}\n\nconst GRID = { bottom: 22, left: 4, right: 4, top: 8 }\n\nconst BAR_CATEGORY_GAP = '35%'\n\nconst LABEL_FONT_SIZE = 11\n\nconst STAGGER_MS = 40\n\nconst EMPTY_LENGTH = 0\n\nconst FIRST_INDEX = 0\n\nconst barPointFormatter = (params: readonly DefaultLabelFormatterCallbackParams[]): string => {\n const point = params[FIRST_INDEX]\n\n if (!point) {\n return ''\n }\n return `${point.name}: ${formatCallbackValue(point.value)}`\n}\n\nconst barsOption = (input: BarsOptionInput): EChartsOption => {\n if (input.values.length === EMPTY_LENGTH) {\n return { series: [] }\n }\n return {\n ...chartAnimation(input.durationMs),\n grid: GRID,\n series: [\n {\n animationDelay: chartStagger(STAGGER_MS),\n barCategoryGap: BAR_CATEGORY_GAP,\n data: input.values.map((point) => point.value),\n emphasis: { disabled: true },\n itemStyle: {\n borderRadius: input.radius,\n color: verticalGradient(input.accent.hi, input.accent.surface),\n },\n stateAnimation: { duration: input.stateDurationMs, easing: CHART_EASING },\n type: 'bar',\n },\n ],\n tooltip: chartTooltip(barPointFormatter),\n xAxis: {\n axisLabel: { color: input.labelColor, fontSize: LABEL_FONT_SIZE },\n axisLine: { show: false },\n axisTick: { show: false },\n data: input.values.map((point) => point.label),\n type: 'category',\n },\n yAxis: { show: false, type: 'value' },\n }\n}\n\nexport { type BarsAccent, type BarsOptionInput, type BarsPoint, barsOption }\n"],"mappings":";;;;AAgCA,MAAM,OAAO;CAAE,QAAQ;CAAI,MAAM;CAAG,OAAO;CAAG,KAAK;AAAE;AAErD,MAAM,mBAAmB;AAEzB,MAAM,kBAAkB;AAExB,MAAM,aAAa;AAEnB,MAAM,eAAe;AAErB,MAAM,cAAc;AAEpB,MAAM,qBAAqB,WAAmE;CAC5F,MAAM,QAAQ,OAAO;CAErB,IAAI,CAAC,OACH,OAAO;CAET,OAAO,GAAG,MAAM,KAAK,IAAI,oBAAoB,MAAM,KAAK;AAC1D;AAEA,MAAM,cAAc,UAA0C;CAC5D,IAAI,MAAM,OAAO,WAAW,cAC1B,OAAO,EAAE,QAAQ,CAAC,EAAE;CAEtB,OAAO;EACL,GAAG,eAAe,MAAM,UAAU;EAClC,MAAM;EACN,QAAQ,CACN;GACE,gBAAgB,aAAa,UAAU;GACvC,gBAAgB;GAChB,MAAM,MAAM,OAAO,KAAK,UAAU,MAAM,KAAK;GAC7C,UAAU,EAAE,UAAU,KAAK;GAC3B,WAAW;IACT,cAAc,MAAM;IACpB,OAAO,iBAAiB,MAAM,OAAO,IAAI,MAAM,OAAO,OAAO;GAC/D;GACA,gBAAgB;IAAE,UAAU,MAAM;IAAiB,QAAQ;GAAa;GACxE,MAAM;EACR,CACF;EACA,SAAS,aAAa,iBAAiB;EACvC,OAAO;GACL,WAAW;IAAE,OAAO,MAAM;IAAY,UAAU;GAAgB;GAChE,UAAU,EAAE,MAAM,MAAM;GACxB,UAAU,EAAE,MAAM,MAAM;GACxB,MAAM,MAAM,OAAO,KAAK,UAAU,MAAM,KAAK;GAC7C,MAAM;EACR;EACA,OAAO;GAAE,MAAM;GAAO,MAAM;EAAQ;CACtC;AACF"}
@@ -1,20 +0,0 @@
1
- import { EChartsOption } from "echarts";
2
- //#region src/charts/groupedBars.d.ts
3
- interface GroupedBarsSeries {
4
- color: string;
5
- name: string;
6
- values: readonly (number | null)[];
7
- }
8
- interface GroupedBarsOptionInput {
9
- categories: readonly string[];
10
- durationMs: number;
11
- labelColor: string;
12
- radius: number;
13
- series: readonly GroupedBarsSeries[];
14
- stateDurationMs: number;
15
- valueFormat?: (value: number) => string;
16
- }
17
- declare const groupedBarsOption: (input: GroupedBarsOptionInput) => EChartsOption;
18
- //#endregion
19
- export { type GroupedBarsOptionInput, type GroupedBarsSeries, groupedBarsOption };
20
- //# sourceMappingURL=groupedBars.d.ts.map
@@ -1,82 +0,0 @@
1
- import { CHART_EASING, chartAnimation } from "./animation.js";
2
- import { chartTooltip, formatCallbackValue } from "./tooltip.js";
3
- //#region src/charts/groupedBars.ts
4
- const GRID = {
5
- bottom: 22,
6
- left: 4,
7
- right: 4,
8
- top: 8
9
- };
10
- const BAR_CATEGORY_GAP = "35%";
11
- const LABEL_FONT_SIZE = 11;
12
- const EMPTY_LENGTH = 0;
13
- const FIRST_INDEX = 0;
14
- const DOT_CLASS = "inline-block size-2 flex-none rounded-tf-pill";
15
- const ROW_CLASS = "flex items-center justify-between gap-3";
16
- const NAME_CLASS = "flex items-center gap-1.5";
17
- const VALUE_CLASS = "font-semibold tabular-nums";
18
- const formatValue = (value, valueFormat) => {
19
- if (typeof value === "number") return valueFormat(value);
20
- return formatCallbackValue(value);
21
- };
22
- const NO_COLOR = "";
23
- const colorOf = (point) => {
24
- if (typeof point.color === "string") return point.color;
25
- return NO_COLOR;
26
- };
27
- const groupedBarRow = (point, valueFormat) => {
28
- const color = colorOf(point);
29
- const name = formatCallbackValue(point.seriesName);
30
- return `<div class="${ROW_CLASS}"><span class="${NAME_CLASS}"><span aria-hidden="true" class="${DOT_CLASS}" style="background:${color}"></span>${name}</span><span class="${VALUE_CLASS}">${formatValue(point.value, valueFormat)}</span></div>`;
31
- };
32
- const groupedBarsFormatter = (valueFormat) => (params) => {
33
- const first = params[FIRST_INDEX];
34
- if (!first) return "";
35
- return `<div class="flex flex-col gap-1"><span class="font-semibold">${formatCallbackValue(first.name)}</span>${params.map((point) => groupedBarRow(point, valueFormat)).join("")}</div>`;
36
- };
37
- const IDENTITY_FORMAT = String;
38
- const AXIS_SHADOW_COLOR = "rgb(255 255 255 / 9%)";
39
- const groupedBarsOption = (input) => {
40
- if (input.categories.length === EMPTY_LENGTH) return { series: [] };
41
- const valueFormat = input.valueFormat ?? IDENTITY_FORMAT;
42
- return {
43
- ...chartAnimation(input.durationMs),
44
- grid: GRID,
45
- series: input.series.map((series) => ({
46
- barCategoryGap: BAR_CATEGORY_GAP,
47
- data: [...series.values],
48
- itemStyle: {
49
- borderRadius: input.radius,
50
- color: series.color
51
- },
52
- name: series.name,
53
- stateAnimation: {
54
- duration: input.stateDurationMs,
55
- easing: CHART_EASING
56
- },
57
- type: "bar"
58
- })),
59
- tooltip: chartTooltip(groupedBarsFormatter(valueFormat), "axis", {
60
- shadowStyle: { color: AXIS_SHADOW_COLOR },
61
- type: "shadow"
62
- }),
63
- xAxis: {
64
- axisLabel: {
65
- color: input.labelColor,
66
- fontSize: LABEL_FONT_SIZE
67
- },
68
- axisLine: { show: false },
69
- axisTick: { show: false },
70
- data: [...input.categories],
71
- type: "category"
72
- },
73
- yAxis: {
74
- show: false,
75
- type: "value"
76
- }
77
- };
78
- };
79
- //#endregion
80
- export { groupedBarsOption };
81
-
82
- //# sourceMappingURL=groupedBars.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"groupedBars.js","names":[],"sources":["../../src/charts/groupedBars.ts"],"sourcesContent":["import type { DefaultLabelFormatterCallbackParams, EChartsOption } from 'echarts'\n\nimport { CHART_EASING, chartAnimation } from './animation'\nimport { chartTooltip, formatCallbackValue } from './tooltip'\n\ninterface GroupedBarsSeries {\n color: string\n\n name: string\n\n values: readonly (number | null)[]\n}\n\ninterface GroupedBarsOptionInput {\n categories: readonly string[]\n\n durationMs: number\n\n labelColor: string\n\n radius: number\n\n series: readonly GroupedBarsSeries[]\n\n stateDurationMs: number\n\n valueFormat?: (value: number) => string\n}\n\nconst GRID = { bottom: 22, left: 4, right: 4, top: 8 }\n\nconst BAR_CATEGORY_GAP = '35%'\n\nconst LABEL_FONT_SIZE = 11\n\nconst EMPTY_LENGTH = 0\n\nconst FIRST_INDEX = 0\n\nconst DOT_CLASS = 'inline-block size-2 flex-none rounded-tf-pill'\n\nconst ROW_CLASS = 'flex items-center justify-between gap-3'\n\nconst NAME_CLASS = 'flex items-center gap-1.5'\n\nconst VALUE_CLASS = 'font-semibold tabular-nums'\n\nconst formatValue = (value: unknown, valueFormat: (value: number) => string): string => {\n if (typeof value === 'number') {\n return valueFormat(value)\n }\n return formatCallbackValue(value)\n}\n\nconst NO_COLOR = ''\n\nconst colorOf = (point: DefaultLabelFormatterCallbackParams): string => {\n if (typeof point.color === 'string') {\n return point.color\n }\n return NO_COLOR\n}\n\nconst groupedBarRow = (\n point: DefaultLabelFormatterCallbackParams,\n valueFormat: (value: number) => string,\n): string => {\n const color = colorOf(point)\n const name = formatCallbackValue(point.seriesName)\n\n return (\n `<div class=\"${ROW_CLASS}\">` +\n `<span class=\"${NAME_CLASS}\"><span aria-hidden=\"true\" class=\"${DOT_CLASS}\" style=\"background:${color}\"></span>${name}</span>` +\n `<span class=\"${VALUE_CLASS}\">${formatValue(point.value, valueFormat)}</span>` +\n `</div>`\n )\n}\n\nconst groupedBarsFormatter =\n (valueFormat: (value: number) => string) =>\n (params: readonly DefaultLabelFormatterCallbackParams[]): string => {\n const first = params[FIRST_INDEX]\n\n if (!first) {\n return ''\n }\n const heading = formatCallbackValue(first.name)\n const rows = params.map((point) => groupedBarRow(point, valueFormat)).join('')\n\n return `<div class=\"flex flex-col gap-1\"><span class=\"font-semibold\">${heading}</span>${rows}</div>`\n }\n\nconst IDENTITY_FORMAT = String\n\nconst AXIS_SHADOW_COLOR = 'rgb(255 255 255 / 9%)'\n\nconst groupedBarsOption = (input: GroupedBarsOptionInput): EChartsOption => {\n if (input.categories.length === EMPTY_LENGTH) {\n return { series: [] }\n }\n const valueFormat = input.valueFormat ?? IDENTITY_FORMAT\n\n return {\n ...chartAnimation(input.durationMs),\n grid: GRID,\n series: input.series.map((series) => ({\n barCategoryGap: BAR_CATEGORY_GAP,\n data: [...series.values],\n itemStyle: { borderRadius: input.radius, color: series.color },\n name: series.name,\n stateAnimation: { duration: input.stateDurationMs, easing: CHART_EASING },\n type: 'bar' as const,\n })),\n tooltip: chartTooltip(groupedBarsFormatter(valueFormat), 'axis', {\n shadowStyle: { color: AXIS_SHADOW_COLOR },\n type: 'shadow',\n }),\n xAxis: {\n axisLabel: { color: input.labelColor, fontSize: LABEL_FONT_SIZE },\n axisLine: { show: false },\n axisTick: { show: false },\n data: [...input.categories],\n type: 'category',\n },\n yAxis: { show: false, type: 'value' },\n }\n}\n\nexport { type GroupedBarsOptionInput, type GroupedBarsSeries, groupedBarsOption }\n"],"mappings":";;;AA6BA,MAAM,OAAO;CAAE,QAAQ;CAAI,MAAM;CAAG,OAAO;CAAG,KAAK;AAAE;AAErD,MAAM,mBAAmB;AAEzB,MAAM,kBAAkB;AAExB,MAAM,eAAe;AAErB,MAAM,cAAc;AAEpB,MAAM,YAAY;AAElB,MAAM,YAAY;AAElB,MAAM,aAAa;AAEnB,MAAM,cAAc;AAEpB,MAAM,eAAe,OAAgB,gBAAmD;CACtF,IAAI,OAAO,UAAU,UACnB,OAAO,YAAY,KAAK;CAE1B,OAAO,oBAAoB,KAAK;AAClC;AAEA,MAAM,WAAW;AAEjB,MAAM,WAAW,UAAuD;CACtE,IAAI,OAAO,MAAM,UAAU,UACzB,OAAO,MAAM;CAEf,OAAO;AACT;AAEA,MAAM,iBACJ,OACA,gBACW;CACX,MAAM,QAAQ,QAAQ,KAAK;CAC3B,MAAM,OAAO,oBAAoB,MAAM,UAAU;CAEjD,OACE,eAAe,UAAU,iBACT,WAAW,oCAAoC,UAAU,sBAAsB,MAAM,WAAW,KAAK,sBACrG,YAAY,IAAI,YAAY,MAAM,OAAO,WAAW,EAAE;AAG1E;AAEA,MAAM,wBACH,iBACA,WAAmE;CAClE,MAAM,QAAQ,OAAO;CAErB,IAAI,CAAC,OACH,OAAO;CAKT,OAAO,gEAHS,oBAAoB,MAAM,IAGmC,EAAE,SAFlE,OAAO,KAAK,UAAU,cAAc,OAAO,WAAW,CAAC,CAAC,CAAC,KAAK,EAEgB,EAAE;AAC/F;AAEF,MAAM,kBAAkB;AAExB,MAAM,oBAAoB;AAE1B,MAAM,qBAAqB,UAAiD;CAC1E,IAAI,MAAM,WAAW,WAAW,cAC9B,OAAO,EAAE,QAAQ,CAAC,EAAE;CAEtB,MAAM,cAAc,MAAM,eAAe;CAEzC,OAAO;EACL,GAAG,eAAe,MAAM,UAAU;EAClC,MAAM;EACN,QAAQ,MAAM,OAAO,KAAK,YAAY;GACpC,gBAAgB;GAChB,MAAM,CAAC,GAAG,OAAO,MAAM;GACvB,WAAW;IAAE,cAAc,MAAM;IAAQ,OAAO,OAAO;GAAM;GAC7D,MAAM,OAAO;GACb,gBAAgB;IAAE,UAAU,MAAM;IAAiB,QAAQ;GAAa;GACxE,MAAM;EACR,EAAE;EACF,SAAS,aAAa,qBAAqB,WAAW,GAAG,QAAQ;GAC/D,aAAa,EAAE,OAAO,kBAAkB;GACxC,MAAM;EACR,CAAC;EACD,OAAO;GACL,WAAW;IAAE,OAAO,MAAM;IAAY,UAAU;GAAgB;GAChE,UAAU,EAAE,MAAM,MAAM;GACxB,UAAU,EAAE,MAAM,MAAM;GACxB,MAAM,CAAC,GAAG,MAAM,UAAU;GAC1B,MAAM;EACR;EACA,OAAO;GAAE,MAAM;GAAO,MAAM;EAAQ;CACtC;AACF"}
@@ -1,19 +0,0 @@
1
- import { graphic } from "echarts/core";
2
- //#region src/charts/paint.ts
3
- const TOP = 0;
4
- const BOTTOM = 1;
5
- const LEFT = 0;
6
- const START = 0;
7
- const END = 1;
8
- const verticalGradient = (from, to) => new graphic.LinearGradient(LEFT, TOP, LEFT, BOTTOM, [{
9
- color: from,
10
- offset: START
11
- }, {
12
- color: to,
13
- offset: END
14
- }]);
15
- const TRANSPARENT = "rgba(0, 0, 0, 0)";
16
- //#endregion
17
- export { TRANSPARENT, verticalGradient };
18
-
19
- //# sourceMappingURL=paint.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"paint.js","names":[],"sources":["../../src/charts/paint.ts"],"sourcesContent":["import { graphic } from 'echarts/core'\n\nconst TOP = 0\n\nconst BOTTOM = 1\n\nconst LEFT = 0\n\nconst START = 0\n\nconst END = 1\n\nconst verticalGradient = (from: string, to: string): graphic.LinearGradient =>\n new graphic.LinearGradient(LEFT, TOP, LEFT, BOTTOM, [\n { color: from, offset: START },\n { color: to, offset: END },\n ])\n\nconst TRANSPARENT = 'rgba(0, 0, 0, 0)'\n\nexport { TRANSPARENT, verticalGradient }\n"],"mappings":";;AAEA,MAAM,MAAM;AAEZ,MAAM,SAAS;AAEf,MAAM,OAAO;AAEb,MAAM,QAAQ;AAEd,MAAM,MAAM;AAEZ,MAAM,oBAAoB,MAAc,OACtC,IAAI,QAAQ,eAAe,MAAM,KAAK,MAAM,QAAQ,CAClD;CAAE,OAAO;CAAM,QAAQ;AAAM,GAC7B;CAAE,OAAO;CAAI,QAAQ;AAAI,CAC3B,CAAC;AAEH,MAAM,cAAc"}
@@ -1,17 +0,0 @@
1
- import { BarsAccent } from "./bars.js";
2
- import { EChartsOption } from "echarts";
3
- //#region src/charts/spark.d.ts
4
- type SparkShape = 'line' | 'bars';
5
- type SparkAccent = BarsAccent;
6
- interface SparkOptionInput {
7
- accent: SparkAccent;
8
- durationMs: number;
9
- stateDurationMs: number;
10
- radius: number;
11
- shape: SparkShape;
12
- values: readonly number[];
13
- }
14
- declare const sparkOption: (input: SparkOptionInput) => EChartsOption;
15
- //#endregion
16
- export { type SparkAccent, type SparkOptionInput, type SparkShape, sparkOption };
17
- //# sourceMappingURL=spark.d.ts.map