cx 26.2.1 → 26.2.3

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 (324) hide show
  1. package/build/charts/Chart.d.ts.map +1 -1
  2. package/build/charts/Chart.js +5 -4
  3. package/build/charts/ColumnBarBase.d.ts +3 -3
  4. package/build/charts/ColumnBarBase.d.ts.map +1 -1
  5. package/build/charts/ColumnBarBase.js +1 -1
  6. package/build/charts/Legend.d.ts.map +1 -1
  7. package/build/charts/Legend.js +11 -4
  8. package/build/charts/Marker.d.ts +3 -3
  9. package/build/charts/Marker.d.ts.map +1 -1
  10. package/build/charts/MarkerLine.d.ts +7 -7
  11. package/build/charts/MarkerLine.d.ts.map +1 -1
  12. package/build/charts/MarkerLine.js +14 -10
  13. package/build/charts/PieChart.d.ts +4 -4
  14. package/build/charts/PieChart.d.ts.map +1 -1
  15. package/build/charts/PieChart.js +36 -14
  16. package/build/charts/PieLabel.d.ts.map +1 -1
  17. package/build/charts/PieLabel.js +2 -1
  18. package/build/charts/RangeMarker.d.ts +3 -3
  19. package/build/charts/RangeMarker.d.ts.map +1 -1
  20. package/build/charts/RangeMarker.js +1 -1
  21. package/build/charts/axis/TimeAxis.d.ts +3 -3
  22. package/build/charts/axis/TimeAxis.d.ts.map +1 -1
  23. package/build/charts/axis/TimeAxis.js +70 -21
  24. package/build/charts/helpers/ValueAtFinder.d.ts +1 -1
  25. package/build/charts/helpers/ValueAtFinder.d.ts.map +1 -1
  26. package/build/charts/helpers/ValueAtFinder.js +5 -2
  27. package/build/data/StructuredSelector.js +3 -4
  28. package/build/data/createAccessorModelProxy.d.ts +6 -11
  29. package/build/data/createAccessorModelProxy.d.ts.map +1 -1
  30. package/build/data/createAccessorModelProxy.js +1 -3
  31. package/build/svg/Ellipse.d.ts +5 -4
  32. package/build/svg/Ellipse.d.ts.map +1 -1
  33. package/build/svg/Ellipse.js +9 -6
  34. package/build/svg/Line.d.ts +1 -0
  35. package/build/svg/Line.d.ts.map +1 -1
  36. package/build/svg/Line.js +4 -1
  37. package/build/svg/Text.d.ts +12 -6
  38. package/build/svg/Text.d.ts.map +1 -1
  39. package/build/svg/Text.js +12 -4
  40. package/build/ui/Controller.d.ts +2 -0
  41. package/build/ui/Controller.d.ts.map +1 -1
  42. package/build/ui/Controller.js +3 -0
  43. package/build/ui/HoverSync.d.ts.map +1 -1
  44. package/build/ui/HoverSync.js +7 -2
  45. package/build/ui/Prop.d.ts +1 -1
  46. package/build/ui/Prop.d.ts.map +1 -1
  47. package/build/ui/Text.d.ts +3 -3
  48. package/build/ui/Text.d.ts.map +1 -1
  49. package/build/ui/Text.js +5 -5
  50. package/build/ui/adapter/GroupAdapter.d.ts.map +1 -1
  51. package/build/ui/adapter/GroupAdapter.js +20 -10
  52. package/build/ui/app/History.js +1 -1
  53. package/build/widgets/List.d.ts.map +1 -1
  54. package/build/widgets/List.js +6 -7
  55. package/build/widgets/drag-drop/DropZone.d.ts +3 -3
  56. package/build/widgets/drag-drop/DropZone.d.ts.map +1 -1
  57. package/build/widgets/form/Calendar.d.ts.map +1 -1
  58. package/build/widgets/form/Calendar.js +30 -11
  59. package/build/widgets/form/ColorField.d.ts.map +1 -1
  60. package/build/widgets/form/ColorField.js +16 -7
  61. package/build/widgets/form/DateTimeField.d.ts.map +1 -1
  62. package/build/widgets/form/DateTimeField.js +23 -10
  63. package/build/widgets/form/Field.d.ts +2 -0
  64. package/build/widgets/form/Field.d.ts.map +1 -1
  65. package/build/widgets/form/Field.js +11 -5
  66. package/build/widgets/form/LookupField.d.ts +1 -1
  67. package/build/widgets/form/LookupField.d.ts.map +1 -1
  68. package/build/widgets/form/LookupField.js +6 -6
  69. package/build/widgets/form/MonthField.d.ts.map +1 -1
  70. package/build/widgets/form/MonthField.js +15 -7
  71. package/build/widgets/form/MonthPicker.d.ts +1 -2
  72. package/build/widgets/form/MonthPicker.d.ts.map +1 -1
  73. package/build/widgets/form/MonthPicker.js +84 -41
  74. package/build/widgets/form/NumberField.d.ts +2 -0
  75. package/build/widgets/form/NumberField.d.ts.map +1 -1
  76. package/build/widgets/form/NumberField.js +45 -15
  77. package/build/widgets/form/TextField.d.ts +1 -9
  78. package/build/widgets/form/TextField.d.ts.map +1 -1
  79. package/build/widgets/form/TextField.js +1 -1
  80. package/build/widgets/grid/Grid.d.ts +2 -2
  81. package/build/widgets/grid/Grid.d.ts.map +1 -1
  82. package/build/widgets/grid/Grid.js +9 -4
  83. package/build/widgets/grid/Pagination.d.ts.map +1 -1
  84. package/build/widgets/grid/Pagination.js +4 -4
  85. package/build/widgets/grid/TreeNode.d.ts.map +1 -1
  86. package/build/widgets/grid/TreeNode.js +10 -2
  87. package/build/widgets/icons/folder.d.ts.map +1 -1
  88. package/build/widgets/icons/folder.js +1 -0
  89. package/build/widgets/icons/forward.d.ts.map +1 -1
  90. package/build/widgets/icons/forward.js +4 -3
  91. package/build/widgets/icons/loading.d.ts.map +1 -1
  92. package/build/widgets/icons/loading.js +6 -5
  93. package/build/widgets/icons/square.d.ts.map +1 -1
  94. package/build/widgets/icons/square.js +3 -3
  95. package/build/widgets/index.d.ts +3 -1
  96. package/build/widgets/index.d.ts.map +1 -1
  97. package/build/widgets/index.js +3 -1
  98. package/build/widgets/overlay/ContextMenu.d.ts.map +1 -1
  99. package/build/widgets/overlay/ContextMenu.js +2 -0
  100. package/build/widgets/overlay/Dropdown.d.ts +2 -1
  101. package/build/widgets/overlay/Dropdown.d.ts.map +1 -1
  102. package/build/widgets/overlay/Dropdown.js +75 -20
  103. package/build/widgets/overlay/MsgBox.d.ts +1 -0
  104. package/build/widgets/overlay/MsgBox.d.ts.map +1 -1
  105. package/build/widgets/overlay/MsgBox.js +2 -2
  106. package/build/widgets/overlay/Overlay.d.ts +32 -2
  107. package/build/widgets/overlay/Overlay.d.ts.map +1 -1
  108. package/build/widgets/overlay/Overlay.js +47 -16
  109. package/build/widgets/overlay/Toast.d.ts +1 -1
  110. package/build/widgets/overlay/Toast.d.ts.map +1 -1
  111. package/build/widgets/overlay/Toast.js +4 -1
  112. package/build/widgets/overlay/Tooltip.d.ts +6 -0
  113. package/build/widgets/overlay/Tooltip.d.ts.map +1 -1
  114. package/build/widgets/overlay/Tooltip.js +24 -9
  115. package/build/widgets/overlay/Window.d.ts.map +1 -1
  116. package/build/widgets/overlay/Window.js +24 -9
  117. package/dist/charts.css +325 -272
  118. package/dist/charts.js +11 -5
  119. package/dist/data.js +2 -2
  120. package/dist/manifest.js +892 -880
  121. package/dist/svg.css +14 -8
  122. package/dist/svg.js +9 -1
  123. package/dist/ui.js +29 -16
  124. package/dist/widgets.css +997 -294
  125. package/dist/widgets.js +317 -121
  126. package/package.json +1 -1
  127. package/src/charts/Bar.scss +13 -10
  128. package/src/charts/BarGraph.scss +31 -29
  129. package/src/charts/BubbleGraph.scss +11 -8
  130. package/src/charts/Chart.ts +5 -3
  131. package/src/charts/Column.scss +13 -10
  132. package/src/charts/ColumnBarBase.tsx +255 -230
  133. package/src/charts/ColumnGraph.scss +13 -11
  134. package/src/charts/Gridlines.scss +10 -8
  135. package/src/charts/Legend.scss +57 -50
  136. package/src/charts/Legend.tsx +257 -213
  137. package/src/charts/LegendEntry.scss +35 -29
  138. package/src/charts/LineGraph.scss +28 -25
  139. package/src/charts/Marker.scss +12 -10
  140. package/src/charts/Marker.tsx +3 -2
  141. package/src/charts/MarkerLine.scss +11 -8
  142. package/src/charts/MarkerLine.tsx +196 -177
  143. package/src/charts/PieChart.scss +12 -9
  144. package/src/charts/PieChart.tsx +717 -591
  145. package/src/charts/PieLabel.tsx +99 -81
  146. package/src/charts/Range.scss +11 -8
  147. package/src/charts/RangeMarker.tsx +204 -187
  148. package/src/charts/ScatterGraph.scss +12 -9
  149. package/src/charts/axis/Axis.scss +6 -5
  150. package/src/charts/axis/CategoryAxis.scss +10 -8
  151. package/src/charts/axis/NumericAxis.scss +9 -6
  152. package/src/charts/axis/TimeAxis.scss +9 -6
  153. package/src/charts/axis/TimeAxis.tsx +753 -637
  154. package/src/charts/axis/index.scss +4 -5
  155. package/src/charts/axis/variables.scss +4 -2
  156. package/src/charts/helpers/ValueAtFinder.ts +19 -5
  157. package/src/charts/index.scss +16 -19
  158. package/src/charts/maps.scss +0 -0
  159. package/src/charts/palette.scss +11 -31
  160. package/src/charts/palette.variables.scss +23 -0
  161. package/src/charts/variables.scss +35 -3
  162. package/src/data/StructuredSelector.ts +2 -2
  163. package/src/data/createAccessorModelProxy.ts +66 -74
  164. package/src/index.scss +5 -6
  165. package/src/maps.scss +5 -0
  166. package/src/svg/Ellipse.tsx +62 -55
  167. package/src/svg/Line.tsx +57 -42
  168. package/src/svg/Svg.scss +6 -6
  169. package/src/svg/Text.scss +19 -0
  170. package/src/svg/Text.tsx +172 -116
  171. package/src/svg/index.scss +3 -2
  172. package/src/svg/maps.scss +0 -0
  173. package/src/svg/variables.scss +0 -0
  174. package/src/ui/Container.spec.ts +59 -0
  175. package/src/ui/Controller.spec.tsx +30 -0
  176. package/src/ui/Controller.ts +5 -0
  177. package/src/ui/HoverSync.tsx +179 -147
  178. package/src/ui/Prop.ts +1 -1
  179. package/src/ui/Text.ts +12 -9
  180. package/src/ui/adapter/GroupAdapter.spec.ts +42 -0
  181. package/src/ui/adapter/GroupAdapter.ts +25 -14
  182. package/src/ui/app/History.ts +1 -1
  183. package/src/ui/index.scss +1 -1
  184. package/src/ui/layout/LabelsLeftLayout.scss +5 -7
  185. package/src/ui/layout/LabelsTopLayout.scss +4 -6
  186. package/src/ui/layout/index.scss +2 -3
  187. package/src/ui/maps.scss +0 -0
  188. package/src/ui/variables.scss +1 -2
  189. package/src/util/index.scss +4 -2
  190. package/src/util/maps.scss +1 -0
  191. package/src/util/scss/besm.scss +15 -0
  192. package/src/util/scss/calc.scss +103 -11
  193. package/src/util/scss/defaults.scss +24 -0
  194. package/src/util/scss/elements.scss +78 -0
  195. package/src/util/scss/global.scss +15 -0
  196. package/src/util/scss/include.scss +17 -9
  197. package/src/util/scss/index.scss +1 -9
  198. package/src/util/scss/maps.scss +2 -0
  199. package/src/util/scss/pad-size.scss +9 -0
  200. package/src/util/scss/padding.scss +6 -0
  201. package/src/util/scss/screen-size.scss +5 -0
  202. package/src/util/scss/variables.scss +6 -0
  203. package/src/util/variables.scss +1 -0
  204. package/src/variables.scss +5 -217
  205. package/src/widgets/Button.maps.scss +103 -0
  206. package/src/widgets/Button.scss +33 -9
  207. package/src/widgets/Button.variables.scss +8 -104
  208. package/src/widgets/CxCredit.scss +2 -0
  209. package/src/widgets/FlexBox.scss +16 -11
  210. package/src/widgets/Heading.scss +6 -0
  211. package/src/widgets/HighlightedSearchText.scss +8 -1
  212. package/src/widgets/Icon.scss +6 -0
  213. package/src/widgets/List.scss +7 -0
  214. package/src/widgets/List.tsx +6 -7
  215. package/src/widgets/ProgressBar.scss +9 -0
  216. package/src/widgets/Resizer.scss +9 -7
  217. package/src/widgets/Section.scss +53 -56
  218. package/src/widgets/animations.scss +4 -2
  219. package/src/widgets/box.scss +47 -0
  220. package/src/widgets/drag-drop/DragClone.scss +12 -4
  221. package/src/widgets/drag-drop/DragHandle.scss +12 -6
  222. package/src/widgets/drag-drop/DragSource.scss +12 -6
  223. package/src/widgets/drag-drop/DropZone.scss +9 -0
  224. package/src/widgets/drag-drop/DropZone.tsx +3 -3
  225. package/src/widgets/drag-drop/index.scss +4 -4
  226. package/src/widgets/drag-drop/maps.scss +7 -0
  227. package/src/widgets/drag-drop/variables.scss +8 -5
  228. package/src/widgets/form/Calendar.maps.scss +54 -0
  229. package/src/widgets/form/Calendar.scss +49 -11
  230. package/src/widgets/form/Calendar.tsx +755 -653
  231. package/src/widgets/form/Calendar.variables.scss +3 -46
  232. package/src/widgets/form/Checkbox.maps.scss +34 -0
  233. package/src/widgets/form/Checkbox.scss +14 -3
  234. package/src/widgets/form/Checkbox.variables.scss +4 -36
  235. package/src/widgets/form/ColorField.scss +21 -2
  236. package/src/widgets/form/ColorField.tsx +485 -431
  237. package/src/widgets/form/ColorPicker.maps.scss +21 -0
  238. package/src/widgets/form/ColorPicker.scss +26 -9
  239. package/src/widgets/form/ColorPicker.variables.scss +3 -16
  240. package/src/widgets/form/DateTimeField.scss +54 -21
  241. package/src/widgets/form/DateTimeField.tsx +697 -615
  242. package/src/widgets/form/DateTimePicker.scss +14 -4
  243. package/src/widgets/form/Field.maps.scss +122 -0
  244. package/src/widgets/form/Field.scss +54 -18
  245. package/src/widgets/form/Field.tsx +611 -504
  246. package/src/widgets/form/Field.variables.scss +46 -0
  247. package/src/widgets/form/HelpText.scss +8 -5
  248. package/src/widgets/form/Label.scss +10 -3
  249. package/src/widgets/form/LookupField.maps.scss +26 -0
  250. package/src/widgets/form/LookupField.scss +54 -24
  251. package/src/widgets/form/LookupField.tsx +25 -21
  252. package/src/widgets/form/MonthField.scss +48 -26
  253. package/src/widgets/form/MonthField.tsx +645 -567
  254. package/src/widgets/form/MonthPicker.maps.scss +50 -0
  255. package/src/widgets/form/MonthPicker.scss +44 -35
  256. package/src/widgets/form/MonthPicker.tsx +954 -724
  257. package/src/widgets/form/MonthPicker.variables.scss +24 -0
  258. package/src/widgets/form/NumberField.scss +19 -2
  259. package/src/widgets/form/NumberField.tsx +576 -466
  260. package/src/widgets/form/Radio.maps.scss +36 -0
  261. package/src/widgets/form/Radio.scss +12 -2
  262. package/src/widgets/form/Radio.variables.scss +3 -42
  263. package/src/widgets/form/Select.scss +25 -9
  264. package/src/widgets/form/Slider.scss +23 -14
  265. package/src/widgets/form/Switch.scss +18 -8
  266. package/src/widgets/form/TextArea.scss +14 -1
  267. package/src/widgets/form/TextField.scss +24 -3
  268. package/src/widgets/form/TextField.tsx +9 -21
  269. package/src/widgets/form/UploadButton.scss +14 -6
  270. package/src/widgets/form/ValidationError.scss +10 -6
  271. package/src/widgets/form/Wheel.scss +14 -4
  272. package/src/widgets/form/index.scss +22 -24
  273. package/src/widgets/form/maps.scss +81 -0
  274. package/src/widgets/form/variables.scss +111 -355
  275. package/src/widgets/grid/Grid.scss +19 -2
  276. package/src/widgets/grid/Grid.spec.ts +42 -0
  277. package/src/widgets/grid/Grid.tsx +15 -7
  278. package/src/widgets/grid/Pagination.scss +11 -2
  279. package/src/widgets/grid/Pagination.tsx +110 -102
  280. package/src/widgets/grid/TreeNode.scss +25 -8
  281. package/src/widgets/grid/TreeNode.tsx +127 -116
  282. package/src/widgets/grid/index.scss +3 -4
  283. package/src/widgets/grid/maps.scss +110 -0
  284. package/src/widgets/grid/variables.scss +48 -137
  285. package/src/widgets/icons/folder.tsx +1 -2
  286. package/src/widgets/icons/forward.tsx +23 -20
  287. package/src/widgets/icons/loading.tsx +22 -19
  288. package/src/widgets/icons/square.tsx +20 -17
  289. package/src/widgets/index.scss +16 -16
  290. package/src/widgets/index.ts +63 -58
  291. package/src/widgets/lists.scss +42 -0
  292. package/src/widgets/maps.scss +139 -0
  293. package/src/widgets/nav/Link.scss +14 -1
  294. package/src/widgets/nav/Menu.scss +13 -7
  295. package/src/widgets/nav/Menu.variables.scss +1 -12
  296. package/src/widgets/nav/MenuItem.scss +21 -6
  297. package/src/widgets/nav/Scroller.scss +11 -2
  298. package/src/widgets/nav/Tab.maps.scss +78 -0
  299. package/src/widgets/nav/Tab.scss +12 -6
  300. package/src/widgets/nav/Tab.variables.scss +7 -76
  301. package/src/widgets/nav/cover.scss +6 -4
  302. package/src/widgets/nav/index.scss +6 -6
  303. package/src/widgets/nav/maps.scss +32 -0
  304. package/src/widgets/nav/variables.scss +4 -11
  305. package/src/widgets/overlay/ContextMenu.ts +3 -0
  306. package/src/widgets/overlay/Dropdown.scss +47 -16
  307. package/src/widgets/overlay/Dropdown.tsx +851 -676
  308. package/src/widgets/overlay/MsgBox.tsx +125 -111
  309. package/src/widgets/overlay/Overlay.scss +60 -40
  310. package/src/widgets/overlay/Overlay.tsx +948 -800
  311. package/src/widgets/overlay/Toast.scss +42 -34
  312. package/src/widgets/overlay/Toast.ts +11 -1
  313. package/src/widgets/overlay/Tooltip.scss +27 -96
  314. package/src/widgets/overlay/Tooltip.tsx +376 -309
  315. package/src/widgets/overlay/Window.maps.scss +51 -0
  316. package/src/widgets/overlay/Window.scss +17 -17
  317. package/src/widgets/overlay/Window.tsx +291 -236
  318. package/src/widgets/overlay/Window.variables.scss +2 -43
  319. package/src/widgets/overlay/index.d.ts +11 -11
  320. package/src/widgets/overlay/index.scss +6 -15
  321. package/src/widgets/overlay/maps.scss +44 -0
  322. package/src/widgets/overlay/variables.scss +11 -42
  323. package/src/widgets/variables.scss +33 -117
  324. package/src/global.scss +0 -14
@@ -1,45 +1,137 @@
1
+ @use "sass:color";
1
2
  @use "sass:list";
2
3
  @use "sass:map";
3
4
  @use "sass:math";
5
+ @use "sass:meta";
6
+ @use "sass:string";
7
+
8
+ // Check if a value is or contains a CSS variable (var(--...)) or calc expression
9
+ @function cx-is-css-var($value) {
10
+ @if meta.type-of($value) == "string" {
11
+ @return string.index($value, "var(") != null or
12
+ string.index($value, "calc(") != null or
13
+ string.index($value, "color-mix(") != null;
14
+ }
15
+ // Also check for calc type returned by calc()
16
+ @if meta.type-of($value) == "calculation" {
17
+ @return true;
18
+ }
19
+ @return false;
20
+ }
21
+
22
+ // Lighten a color, supporting CSS variables
23
+ // For CSS variables, outputs color-mix(in srgb, color, white amount)
24
+ // For Sass colors, uses color.adjust (same as old lighten) at compile time
25
+ @function cx-lighten($color, $amount) {
26
+ @if cx-is-css-var($color) or cx-is-css-var($amount) {
27
+ @return #{"color-mix(in srgb, " + $color + ", white " + $amount + ")"};
28
+ }
29
+ @return color.adjust($color, $lightness: $amount);
30
+ }
31
+
32
+ // Darken a color, supporting CSS variables
33
+ // For CSS variables, outputs color-mix(in srgb, color, black amount)
34
+ // For Sass colors, uses color.adjust (same as old darken) at compile time
35
+ @function cx-darken($color, $amount) {
36
+ @if cx-is-css-var($color) or cx-is-css-var($amount) {
37
+ @return #{"color-mix(in srgb, " + $color + ", black " + $amount + ")"};
38
+ }
39
+ @return color.adjust($color, $lightness: -$amount);
40
+ }
41
+
42
+ // Multiply a value by a factor, supporting CSS variables
43
+ // For CSS variables, outputs calc(var(...) * factor)
44
+ // For numeric values, performs the multiplication at compile time
45
+ @function cx-multiply($value, $factor) {
46
+ @if cx-is-css-var($value) or cx-is-css-var(($factor)) {
47
+ @return calc(#{$value} * #{$factor});
48
+ }
49
+ @return $value * $factor;
50
+ }
51
+
52
+ @function cx-divide($value, $factor) {
53
+ @if cx-is-css-var($value) or cx-is-css-var(($factor)) {
54
+ @return calc(#{$value} / #{$factor});
55
+ }
56
+ @return math.div($value, $factor);
57
+ }
58
+
59
+ // Round a value, supporting CSS variables
60
+ // For CSS variables, outputs CSS round() function
61
+ // For numeric values, performs the rounding at compile time
62
+ @function cx-round($value) {
63
+ @if cx-is-css-var($value) {
64
+ @return round(#{$value});
65
+ }
66
+ @return math.round($value);
67
+ }
4
68
 
5
69
  @function cx-calc($lengths...) {
6
70
  $units: ();
71
+ $css-vars: ();
7
72
 
8
73
  @each $l in $lengths {
9
- $unit: math.unit($l);
10
- @if (map.has-key($units, $unit)) {
11
- $nl: map.get($units, $unit) + $l;
12
- $units: map.merge($units, ($unit: $nl))
74
+ // Handle CSS variables separately
75
+ @if cx-is-css-var($l) {
76
+ $css-vars: list.append($css-vars, $l);
13
77
  } @else {
14
- $units: map.merge($units, ($unit: $l))
78
+ $unit: math.unit($l);
79
+ @if (map.has-key($units, $unit)) {
80
+ $nl: map.get($units, $unit) + $l;
81
+ $units: map.merge(
82
+ $units,
83
+ (
84
+ $unit: $nl,
85
+ )
86
+ );
87
+ } @else {
88
+ $units: map.merge(
89
+ $units,
90
+ (
91
+ $unit: $l,
92
+ )
93
+ );
94
+ }
15
95
  }
16
96
  }
17
97
 
18
98
  $keys: map.keys($units);
19
- @if (list.length($keys) == 1) {
99
+ $has-css-vars: list.length($css-vars) > 0;
100
+
101
+ // If only one unit type and no CSS vars, return directly
102
+ @if (list.length($keys) == 1 and not $has-css-vars) {
20
103
  @return map.get($units, list.nth($keys, 1));
21
104
  }
22
105
 
23
- $calc: '';
106
+ $calc: "";
24
107
  $count: 0;
25
108
 
26
109
  @each $u, $v in $units {
27
110
  @if ($v != 0) {
28
111
  $count: $count + 1;
29
112
  @if ($count > 1) {
30
- $calc: $calc + ' + ';
113
+ $calc: $calc + " + ";
31
114
  }
32
115
  $calc: $calc + $v;
33
116
  }
34
117
  }
35
118
 
119
+ // Add CSS variables to the calc expression
120
+ @each $var in $css-vars {
121
+ $count: $count + 1;
122
+ @if ($count > 1) {
123
+ $calc: $calc + " + ";
124
+ }
125
+ $calc: $calc + $var;
126
+ }
127
+
36
128
  @if ($count == 0) {
37
129
  @return 0;
38
130
  }
39
131
 
40
- @if ($count == 1) {
132
+ @if ($count == 1 and not $has-css-vars) {
41
133
  @return #{$calc};
42
134
  }
43
135
 
44
- @return #{'calc(' + $calc + ')'};
45
- }
136
+ @return #{"calc(" + $calc + ")"};
137
+ }
@@ -0,0 +1,24 @@
1
+ // Text
2
+ $cx-default-font-family: (
3
+ -apple-system,
4
+ BlinkMacSystemFont,
5
+ "Segoe UI",
6
+ "Roboto",
7
+ "Helvetica Neue",
8
+ Arial,
9
+ sans-serif
10
+ ) !default;
11
+ $cx-default-font-size: 14px !default;
12
+ $cx-default-color: #373a3c !default;
13
+
14
+ // Border
15
+ $cx-default-border-color: #bfbfbf !default;
16
+ $cx-default-border-radius: 0 !default;
17
+ $cx-default-border-width: 1px !default;
18
+
19
+ // Container
20
+ $cx-default-container-padding: 5px !default;
21
+
22
+ // Cover
23
+ $cx-default-cover-border-color: $cx-default-border-color !default;
24
+ $cx-default-cover-background-color: white !default;
@@ -0,0 +1,78 @@
1
+ @use "./variables.scss" as *;
2
+
3
+ $cx-element-style-map: (
4
+ html: (
5
+ font-family: $cx-default-font-family,
6
+ font-size: $cx-default-font-size,
7
+ height: 100%,
8
+ background-color: #eee,
9
+ ),
10
+ body: (
11
+ margin: 0,
12
+ padding: 0,
13
+ height: 100%,
14
+ color: $cx-default-color,
15
+ ),
16
+ h1: (
17
+ font-size: 2rem,
18
+ line-height: 1.1,
19
+ margin: 0 0 0.75rem 0,
20
+ font-weight: 500,
21
+ ),
22
+ h2: (
23
+ font-size: 1.75rem,
24
+ line-height: 1.1,
25
+ margin: 0 0 0.5rem 0,
26
+ font-weight: 500,
27
+ ),
28
+ h3: (
29
+ font-size: 1.5rem,
30
+ line-height: 1.1,
31
+ margin: 0 0 0.5rem 0,
32
+ font-weight: 500,
33
+ ),
34
+ h4: (
35
+ font-size: 1.3rem,
36
+ line-height: 1.1,
37
+ margin: 0 0 0.5rem 0,
38
+ font-weight: 500,
39
+ ),
40
+ h5: (
41
+ font-size: 1.15rem,
42
+ line-height: 1.1,
43
+ margin: 0 0 0.5rem 0,
44
+ font-weight: 500,
45
+ ),
46
+ h6: (
47
+ font-size: 1rem,
48
+ line-height: 1.1,
49
+ margin: 0 0 0.5rem 0,
50
+ font-weight: 500,
51
+ ),
52
+ p: (
53
+ margin: 0 0 1rem 0,
54
+ ),
55
+ a: (
56
+ text-decoration: none,
57
+ color: #0275d8,
58
+ ),
59
+ "a:hover": (
60
+ text-decoration: underline,
61
+ ),
62
+ ul: (
63
+ margin: 0 0 1rem 0,
64
+ ),
65
+ ol: (
66
+ margin: 0 0 1rem 0,
67
+ ),
68
+ th: (
69
+ font-weight: 500,
70
+ ),
71
+ text: (
72
+ fill: currentColor,
73
+ stroke: none,
74
+ ),
75
+ table: (
76
+ font-size: inherit,
77
+ ),
78
+ ) !default;
@@ -0,0 +1,15 @@
1
+ @use "./variables.scss" as *;
2
+ @use "./elements.scss" as *;
3
+ @use "./add-rules.scss" as *;
4
+
5
+ @mixin cx-global-rules() {
6
+ @each $tag, $styles in $cx-element-style-map {
7
+ #{$tag} {
8
+ @include cx-add-rules($styles);
9
+ }
10
+ }
11
+ }
12
+
13
+ @if ($cx-include-global-rules and cx-call-once("cx/globals")) {
14
+ @include cx-global-rules();
15
+ }
@@ -1,6 +1,7 @@
1
+ @forward "colors";
2
+ @use "call-once" as *;
3
+ @use "colors" as *;
1
4
  @use "sass:map";
2
- @import "call-once";
3
- @import "colors";
4
5
 
5
6
  $cx-include-all: true !default;
6
7
 
@@ -11,11 +12,13 @@ $cx-dependencies: () !default;
11
12
 
12
13
  @function cx-should-include($name, $once: true) {
13
14
  @return (
14
- (map.get($cx-excluded, $name) != true) and
15
- ($cx-include-all or
16
- ($cx-used != null and map.get($cx-used, $name) == true))
17
- )
18
- and ($once != true or cx-call-once($name));
15
+ (map.get($cx-excluded, $name) != true) and
16
+ (
17
+ $cx-include-all or
18
+ ($cx-used != null and map.get($cx-used, $name) == true)
19
+ )
20
+ )
21
+ and ($once != true or cx-call-once($name));
19
22
  }
20
23
 
21
24
  @function cx-included($name) {
@@ -26,7 +29,12 @@ $cx-dependencies: () !default;
26
29
  @if (map.get($cx-excluded, $name)) {
27
30
  @return 0;
28
31
  }
29
- $cx-used: map.merge($cx-used, ($name: true)) !global;
32
+ $cx-used: map.merge(
33
+ $cx-used,
34
+ (
35
+ $name: true,
36
+ )
37
+ ) !global;
30
38
  $dummy: 1;
31
39
  $deps: map.get($cx-dependencies, $name);
32
40
  @if ($deps == null) {
@@ -43,6 +51,6 @@ $cx-dependencies: () !default;
43
51
  $cx-used: () !default !global;
44
52
 
45
53
  @each $name in $names {
46
- $dummy: cx-widget($name)
54
+ $dummy: cx-widget($name);
47
55
  }
48
56
  }
@@ -1,9 +1 @@
1
- @import "add-rules";
2
- @import "calc";
3
- @import "call-once";
4
- @import "clockwise";
5
- @import "colors";
6
- @import "deep-merge";
7
- @import "deep-get";
8
- @import "include";
9
- @import "divide";
1
+ @use "./global.scss" as *;
@@ -0,0 +1,2 @@
1
+ @forward "./elements.scss";
2
+ @forward "./pad-size.scss";
@@ -0,0 +1,9 @@
1
+ @use "./padding.scss" as *;
2
+
3
+ $cx-pad-size: (
4
+ xsmall: $cx-default-padding-extra-small,
5
+ small: $cx-default-padding-small,
6
+ medium: $cx-default-padding-medium,
7
+ large: $cx-default-padding-large,
8
+ xlarge: $cx-default-padding-extra-large,
9
+ ) !default;
@@ -0,0 +1,6 @@
1
+ // Padding
2
+ $cx-default-padding-extra-small: 3px !default;
3
+ $cx-default-padding-small: 5px !default;
4
+ $cx-default-padding-medium: 10px !default;
5
+ $cx-default-padding-large: 15px !default;
6
+ $cx-default-padding-extra-large: 20px !default;
@@ -0,0 +1,5 @@
1
+ // SCREEN SIZE
2
+ $screen-size-small: 400px !default;
3
+ $screen-size-medium: 800px !default;
4
+ $screen-size-large: 1300px !default;
5
+ $screen-size-extra-large: 1800px !default;
@@ -0,0 +1,6 @@
1
+ $cx-include-global-rules: false !default;
2
+
3
+ @forward "./besm.scss";
4
+ @forward "./defaults.scss";
5
+ @forward "./screen-size.scss";
6
+ @forward "./padding.scss";
@@ -0,0 +1 @@
1
+ @forward "./scss/variables.scss";
@@ -1,217 +1,5 @@
1
- // FUNCTIONS
2
- @import "util/scss/index";
3
-
4
- // SCREEN SIZE
5
- $cx-screen-size-small: 400px !default;
6
- $cx-screen-size-medium: 800px !default;
7
- $cx-screen-size-large: 1300px !default;
8
- $cx-screen-size-extra-large: 1800px !default;
9
-
10
- //
11
- // BESM
12
- //
13
- // B - block - top level HTML element
14
- // E - element - part of the component (block)
15
- // S - state - indicator of the component state which affects the appearance
16
- // M - mod - user supplied instruction which overrides default appearance
17
- //
18
-
19
- $cx-besm: (
20
- block: "cxb-",
21
- element: "cxe-",
22
- state: "cxs-",
23
- mod: "cxm-"
24
- ) !default;
25
-
26
- //
27
- // Boxes
28
- // -----
29
- //
30
- // Boxes are inline-block elements which are likely to appear in the same row, such as buttons and form elements.
31
- // These elements should have the same height in order to avoid problems when put together in a toolbar
32
- // or a complex form.
33
- //
34
- // To ensure the height consistency, all box models should use the same line-height, top/bottom padding and border-width;
35
- //
36
- // For elements which do not have a natural border, such as checkboxes, radios and buttons,
37
- // border-color should be set to transparent.
38
- //
39
- // box height = line-height + padding-top + padding-bottom + border-width-top + border-width-bottom
40
- //
41
- // Some browsers do not respect the line-height being set and therefore explicit height value is
42
- // calculated and set on all box elements.
43
- //
44
- // Hint: Use em units to make the box height grow with the font-size, but note that the elements
45
- // will not be aligned in case of pixel boundaries and icons may appear blurry in some desktop browsers.
46
- //
47
-
48
- $cx-default-box-font-size: 13px !default;
49
- $cx-default-box-font-family: inherit !default;
50
- $cx-default-box-line-height: 16px !default;
51
- $cx-default-box-padding: 5px !default; //should not be a list
52
- $cx-default-box-border-width: 1px !default;
53
-
54
- // Borders
55
- // -------
56
-
57
- $cx-default-border-color: #bfbfbf !default;
58
- $cx-default-border-radius: 0 !default;
59
- $cx-default-border-width: 1px !default;
60
-
61
- // Padding
62
- // -------
63
-
64
- $cx-default-container-padding: 5px !default;
65
-
66
- // Empty Texts
67
- // ------------
68
- //
69
- // Displayed instead of whitespace
70
-
71
- $cx-default-empty-text-color: rgba(128, 128, 128, 0.7) !default;
72
-
73
- $cx-empty-text: (
74
- color: $cx-default-empty-text-color
75
- ) !default;
76
-
77
- //Icons
78
- $cx-default-icon-size: 16px !default;
79
-
80
- //Selection
81
- $cx-selection-background-color: rgba(135, 206, 250, 0.6);
82
-
83
- //List
84
- $cx-default-list-item-padding: 5px 10px !default;
85
-
86
- //Lists
87
- $cx-list: (
88
- default: (
89
- -webkit-overflow-scrolling: touch
90
- ),
91
- hover: (),
92
- focus: (
93
- outline: none
94
- )
95
- );
96
-
97
- $cx-list-item: (
98
- default: (),
99
- hover: (
100
- background-color: rgba(128, 128, 128, 0.1),
101
- outline: none,
102
- cursor: pointer
103
- ),
104
- cursor: (
105
- background-color: rgba(123, 190, 255, 0.15),
106
- outline: none
107
- ),
108
- selected: (
109
- background-color: rgba(123, 190, 255, 0.4)
110
- ),
111
- selected-hover: (
112
- background-color: rgba(123, 190, 255, 0.2)
113
- ),
114
- selected-cursor: (
115
- background-color: rgba(123, 190, 255, 0.3),
116
- outline: none
117
- ),
118
- disabled: (
119
- cursor: default,
120
- opacity: 0.5,
121
- pointer-events: none
122
- ),
123
- active: (
124
- //causes flickering
125
- //background: rgba(123,190,255, 0.7)
126
- )
127
- ) !default;
128
-
129
- $cx-default-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto",
130
- "Helvetica Neue", Arial, sans-serif !default;
131
-
132
- $cx-default-font-size: 14px !default;
133
- $cx-default-color: #373a3c !default;
134
-
135
- $cx-element-style-map: (
136
- html: (
137
- font-family: $cx-default-font-family,
138
- font-size: $cx-default-font-size,
139
- height: 100%,
140
- background-color: #eee
141
- ),
142
- body: (
143
- margin: 0,
144
- padding: 0,
145
- height: 100%,
146
- color: $cx-default-color
147
- ),
148
- h1: (
149
- font-size: 2rem,
150
- line-height: 1.1,
151
- margin: 0 0 0.75rem 0,
152
- font-weight: 500
153
- ),
154
- h2: (
155
- font-size: 1.75rem,
156
- line-height: 1.1,
157
- margin: 0 0 0.5rem 0,
158
- font-weight: 500
159
- ),
160
- h3: (
161
- font-size: 1.5rem,
162
- line-height: 1.1,
163
- margin: 0 0 0.5rem 0,
164
- font-weight: 500
165
- ),
166
- h4: (
167
- font-size: 1.3rem,
168
- line-height: 1.1,
169
- margin: 0 0 0.5rem 0,
170
- font-weight: 500
171
- ),
172
- h5: (
173
- font-size: 1.15rem,
174
- line-height: 1.1,
175
- margin: 0 0 0.5rem 0,
176
- font-weight: 500
177
- ),
178
- h6: (
179
- font-size: 1rem,
180
- line-height: 1.1,
181
- margin: 0 0 0.5rem 0,
182
- font-weight: 500
183
- ),
184
- p: (
185
- margin: 0 0 1rem 0
186
- ),
187
- a: (
188
- text-decoration: none,
189
- color: #0275d8
190
- ),
191
- "a:hover": (
192
- text-decoration: underline
193
- ),
194
- ul: (
195
- margin: 0 0 1rem 0
196
- ),
197
- ol: (
198
- margin: 0 0 1rem 0
199
- ),
200
- th: (
201
- font-weight: 500
202
- ),
203
- text: (
204
- fill: currentColor,
205
- stroke: none
206
- ),
207
- table: (
208
- font-size: inherit
209
- )
210
- ) !default;
211
-
212
- $cx-default-cover-border-color: $cx-default-border-color !default;
213
- $cx-default-cover-background-color: white !default;
214
-
215
- @import "charts/variables";
216
- @import "ui/variables";
217
- @import "widgets/variables";
1
+ @forward "./util/variables.scss";
2
+ @forward "./ui/variables.scss";
3
+ @forward "./widgets/variables.scss";
4
+ @forward "./svg/variables.scss";
5
+ @forward "./charts/variables.scss";
@@ -0,0 +1,103 @@
1
+ @use "sass:map";
2
+ @use "./lists" as *;
3
+ @use "./variables" as *;
4
+
5
+ $cx-button-state-style-map: (
6
+ default: (
7
+ background-color: $cx-default-button-background-color,
8
+ box-shadow: $cx-default-button-box-shadow,
9
+ border-color: $cx-default-button-border-color,
10
+ border-width: $cx-default-button-border-width,
11
+ border-radius: $cx-default-button-border-radius,
12
+ border-style: solid,
13
+ user-select: none,
14
+ color: $cx-default-button-color,
15
+ font-family: $cx-default-button-font-family,
16
+ font-size: $cx-default-button-font-size,
17
+ font-weight: $cx-default-button-font-weight,
18
+ line-height: $cx-default-button-line-height,
19
+ padding: $cx-default-button-padding,
20
+ cursor: pointer,
21
+ -webkit-appearance: none,
22
+ -moz-appearance: none,
23
+ appearance: none,
24
+ white-space: nowrap,
25
+ text-decoration: none,
26
+ ),
27
+ hover: (
28
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3),
29
+ text-decoration: none,
30
+ ),
31
+ focus: (
32
+ outline: none,
33
+ box-shadow: 0 0 1px 1px rgba(77, 144, 254, 0.8),
34
+ ),
35
+ hover-focus: (),
36
+ disabled: (
37
+ color: gray,
38
+ box-shadow: none,
39
+ pointer-events: none,
40
+ ),
41
+ active: (
42
+ top: 1px,
43
+ box-shadow: none,
44
+ ),
45
+ ) !default;
46
+
47
+ $cx-button-mods: (
48
+ primary: (
49
+ default: (
50
+ background-color: #1f99f8,
51
+ border-color: #1e88e5,
52
+ color: white,
53
+ ),
54
+ disabled: (
55
+ background-color: rgba(31, 153, 248, 0.5),
56
+ border-color: rgba(30, 136, 229, 0.1),
57
+ color: rgba(255, 255, 255, 0.6),
58
+ ),
59
+ hover: (
60
+ background-color: #1f99f8,
61
+ ),
62
+ ),
63
+ danger: (
64
+ default: (
65
+ background-color: #d32f2f,
66
+ border-color: #c62828,
67
+ color: white,
68
+ ),
69
+ disabled: (
70
+ background-color: rgba(211, 47, 47, 0.6),
71
+ border-color: rgba(198, 40, 40, 0.1),
72
+ color: rgba(255, 255, 255, 0.5),
73
+ ),
74
+ hover: (
75
+ background-color: #d32f2f,
76
+ ),
77
+ ),
78
+ hollow: (
79
+ default: (
80
+ background-color: transparent,
81
+ border-color: transparent,
82
+ color: inherit,
83
+ box-shadow: none,
84
+ ),
85
+ hover: map.merge(
86
+ map.get($cx-list-item, hover),
87
+ (
88
+ box-shadow: none,
89
+ border-color: transparent,
90
+ )
91
+ ),
92
+ focus: map.merge(
93
+ map.get($cx-list-item, selected-cursor),
94
+ (
95
+ box-shadow: none,
96
+ border-color: transparent,
97
+ )
98
+ ),
99
+ disabled: (
100
+ color: rgba(128, 128, 128, 0.5),
101
+ ),
102
+ ),
103
+ ) !default;