ozdenui 0.1.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 (149) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +14 -0
  3. data/NOTICE +5 -0
  4. data/README.md +242 -0
  5. data/exe/ozdenui +17 -0
  6. data/lib/ozdenui/AGENTS.md +210 -0
  7. data/lib/ozdenui/COMPONENTS.md +3017 -0
  8. data/lib/ozdenui/app.rb +749 -0
  9. data/lib/ozdenui/command.rb +107 -0
  10. data/lib/ozdenui/components.rb +368 -0
  11. data/lib/ozdenui/dialogs.rb +212 -0
  12. data/lib/ozdenui/files.rb +124 -0
  13. data/lib/ozdenui/icon.png +0 -0
  14. data/lib/ozdenui/kit.json +1 -0
  15. data/lib/ozdenui/kit.rb +115 -0
  16. data/lib/ozdenui/look.rb +229 -0
  17. data/lib/ozdenui/objects.rb +652 -0
  18. data/lib/ozdenui/server.rb +270 -0
  19. data/lib/ozdenui/values.rb +273 -0
  20. data/lib/ozdenui/version.rb +15 -0
  21. data/lib/ozdenui/web/basic/LICENSE +14 -0
  22. data/lib/ozdenui/web/basic/basic.min.css +1 -0
  23. data/lib/ozdenui/web/basic/basic.min.js +78 -0
  24. data/lib/ozdenui/web/basic/font/open-sans/LICENSE.txt +206 -0
  25. data/lib/ozdenui/web/basic/font/open-sans/OpenSans-Bold.ttf +0 -0
  26. data/lib/ozdenui/web/basic/font/open-sans/OpenSans-Regular.ttf +0 -0
  27. data/lib/ozdenui/web/basic/scroll-bar.min.js +3 -0
  28. data/lib/ozdenui/web/bridge.js +584 -0
  29. data/lib/ozdenui/web/comp/accordion.js +659 -0
  30. data/lib/ozdenui/web/comp/action-button/add.png +0 -0
  31. data/lib/ozdenui/web/comp/action-button.js +521 -0
  32. data/lib/ozdenui/web/comp/action-tab-bar.js +383 -0
  33. data/lib/ozdenui/web/comp/app-bar.js +237 -0
  34. data/lib/ozdenui/web/comp/badge.js +292 -0
  35. data/lib/ozdenui/web/comp/bottom-bar.js +555 -0
  36. data/lib/ozdenui/web/comp/breadcrumbs.js +524 -0
  37. data/lib/ozdenui/web/comp/canvas.js +652 -0
  38. data/lib/ozdenui/web/comp/chat-view.js +827 -0
  39. data/lib/ozdenui/web/comp/check-box.js +490 -0
  40. data/lib/ozdenui/web/comp/code-editor.js +965 -0
  41. data/lib/ozdenui/web/comp/color-picker.js +636 -0
  42. data/lib/ozdenui/web/comp/context-menu.js +951 -0
  43. data/lib/ozdenui/web/comp/currency-field.js +209 -0
  44. data/lib/ozdenui/web/comp/data-table/arrow.svg +2 -0
  45. data/lib/ozdenui/web/comp/data-table.js +937 -0
  46. data/lib/ozdenui/web/comp/date-picker.js +1055 -0
  47. data/lib/ozdenui/web/comp/dialog.js +992 -0
  48. data/lib/ozdenui/web/comp/email-field.js +65 -0
  49. data/lib/ozdenui/web/comp/file-picker.js +920 -0
  50. data/lib/ozdenui/web/comp/filters.js +807 -0
  51. data/lib/ozdenui/web/comp/form.js +602 -0
  52. data/lib/ozdenui/web/comp/full-screen-select/arrow.svg +2 -0
  53. data/lib/ozdenui/web/comp/full-screen-select/cancel.svg +2 -0
  54. data/lib/ozdenui/web/comp/full-screen-select.js +614 -0
  55. data/lib/ozdenui/web/comp/gauge.js +439 -0
  56. data/lib/ozdenui/web/comp/graph-box.js +3911 -0
  57. data/lib/ozdenui/web/comp/grid-group.js +185 -0
  58. data/lib/ozdenui/web/comp/hold-to-confirm-button/trash-red.png +0 -0
  59. data/lib/ozdenui/web/comp/hold-to-confirm-button/trash.png +0 -0
  60. data/lib/ozdenui/web/comp/hold-to-confirm-button.js +289 -0
  61. data/lib/ozdenui/web/comp/image-view.js +598 -0
  62. data/lib/ozdenui/web/comp/item-list.js +1740 -0
  63. data/lib/ozdenui/web/comp/json-editor.js +3221 -0
  64. data/lib/ozdenui/web/comp/json-view.js +597 -0
  65. data/lib/ozdenui/web/comp/label-editor.js +1140 -0
  66. data/lib/ozdenui/web/comp/left-menu/data-table.png +0 -0
  67. data/lib/ozdenui/web/comp/left-menu/home.png +0 -0
  68. data/lib/ozdenui/web/comp/left-menu/reports.png +0 -0
  69. data/lib/ozdenui/web/comp/left-menu/setting.png +0 -0
  70. data/lib/ozdenui/web/comp/left-menu.js +548 -0
  71. data/lib/ozdenui/web/comp/line-progress-bar.js +343 -0
  72. data/lib/ozdenui/web/comp/loading-screen.js +413 -0
  73. data/lib/ozdenui/web/comp/log-view.js +530 -0
  74. data/lib/ozdenui/web/comp/login-page.js +685 -0
  75. data/lib/ozdenui/web/comp/markdown-view.js +1045 -0
  76. data/lib/ozdenui/web/comp/menu-bar.js +624 -0
  77. data/lib/ozdenui/web/comp/mini-graph-box.js +492 -0
  78. data/lib/ozdenui/web/comp/minimal-accent.js +208 -0
  79. data/lib/ozdenui/web/comp/notice.js +229 -0
  80. data/lib/ozdenui/web/comp/number-field.js +128 -0
  81. data/lib/ozdenui/web/comp/numeric-keyboard.js +298 -0
  82. data/lib/ozdenui/web/comp/page-control.js +762 -0
  83. data/lib/ozdenui/web/comp/page-header.js +191 -0
  84. data/lib/ozdenui/web/comp/password-field/hide-btn.png +0 -0
  85. data/lib/ozdenui/web/comp/password-field/hide-btn2.png +0 -0
  86. data/lib/ozdenui/web/comp/password-field/show-btn.png +0 -0
  87. data/lib/ozdenui/web/comp/password-field/show-btn2.png +0 -0
  88. data/lib/ozdenui/web/comp/password-field.js +192 -0
  89. data/lib/ozdenui/web/comp/period-bar.js +436 -0
  90. data/lib/ozdenui/web/comp/phone-field.js +322 -0
  91. data/lib/ozdenui/web/comp/progress-bar.js +992 -0
  92. data/lib/ozdenui/web/comp/property-panel.js +3639 -0
  93. data/lib/ozdenui/web/comp/radio-button.js +527 -0
  94. data/lib/ozdenui/web/comp/range-slider.js +569 -0
  95. data/lib/ozdenui/web/comp/rich-text-editor.js +1064 -0
  96. data/lib/ozdenui/web/comp/scroll-area.js +308 -0
  97. data/lib/ozdenui/web/comp/scrolling-text.js +297 -0
  98. data/lib/ozdenui/web/comp/search-input/clear-round.svg +1 -0
  99. data/lib/ozdenui/web/comp/search-input/clear.svg +1 -0
  100. data/lib/ozdenui/web/comp/search-input/filter.png +0 -0
  101. data/lib/ozdenui/web/comp/search-input/filter.svg +1 -0
  102. data/lib/ozdenui/web/comp/search-input/search.svg +1 -0
  103. data/lib/ozdenui/web/comp/search-input.js +725 -0
  104. data/lib/ozdenui/web/comp/search-results.js +596 -0
  105. data/lib/ozdenui/web/comp/select-box.js +1862 -0
  106. data/lib/ozdenui/web/comp/settings-row.js +299 -0
  107. data/lib/ozdenui/web/comp/side-panel.js +616 -0
  108. data/lib/ozdenui/web/comp/slider-field.js +952 -0
  109. data/lib/ozdenui/web/comp/slider.js +838 -0
  110. data/lib/ozdenui/web/comp/smart-button/alert-black.png +0 -0
  111. data/lib/ozdenui/web/comp/smart-button/clock.png +0 -0
  112. data/lib/ozdenui/web/comp/smart-button.js +981 -0
  113. data/lib/ozdenui/web/comp/smart-table/clock.png +0 -0
  114. data/lib/ozdenui/web/comp/smart-table/down.png +0 -0
  115. data/lib/ozdenui/web/comp/smart-table/scroll.png +0 -0
  116. data/lib/ozdenui/web/comp/smart-table/sort.png +0 -0
  117. data/lib/ozdenui/web/comp/smart-table/up.png +0 -0
  118. data/lib/ozdenui/web/comp/smart-table.js +1883 -0
  119. data/lib/ozdenui/web/comp/sortable-list.js +1181 -0
  120. data/lib/ozdenui/web/comp/spark-line-box.js +738 -0
  121. data/lib/ozdenui/web/comp/splitter.js +411 -0
  122. data/lib/ozdenui/web/comp/status-bar.js +408 -0
  123. data/lib/ozdenui/web/comp/step-bar.js +345 -0
  124. data/lib/ozdenui/web/comp/stepper.js +753 -0
  125. data/lib/ozdenui/web/comp/tabs.js +1366 -0
  126. data/lib/ozdenui/web/comp/tag-input.js +1107 -0
  127. data/lib/ozdenui/web/comp/tap-effect.js +170 -0
  128. data/lib/ozdenui/web/comp/text-area-field.js +233 -0
  129. data/lib/ozdenui/web/comp/text-field.js +1006 -0
  130. data/lib/ozdenui/web/comp/time-line.js +398 -0
  131. data/lib/ozdenui/web/comp/time-picker.js +1032 -0
  132. data/lib/ozdenui/web/comp/tiny-select/arrow.svg +1 -0
  133. data/lib/ozdenui/web/comp/tiny-select.js +322 -0
  134. data/lib/ozdenui/web/comp/tiny-table.js +283 -0
  135. data/lib/ozdenui/web/comp/toast.js +891 -0
  136. data/lib/ozdenui/web/comp/toggle.js +757 -0
  137. data/lib/ozdenui/web/comp/tool-bar.js +760 -0
  138. data/lib/ozdenui/web/comp/tooltip.js +534 -0
  139. data/lib/ozdenui/web/comp/tree-view.js +1179 -0
  140. data/lib/ozdenui/web/comp/ui-effects.js +1097 -0
  141. data/lib/ozdenui/web/comp/ui-standards.js +403 -0
  142. data/lib/ozdenui/web/comp/url-field.js +190 -0
  143. data/lib/ozdenui/web/comp/web-view.js +588 -0
  144. data/lib/ozdenui/web/components.js +123 -0
  145. data/lib/ozdenui/web/index.html +39 -0
  146. data/lib/ozdenui/window.rb +188 -0
  147. data/lib/ozdenui/window_cocoa.rb +221 -0
  148. data/lib/ozdenui.rb +32 -0
  149. metadata +200 -0
@@ -0,0 +1,398 @@
1
+ /* Bismillah */
2
+
3
+ /*
4
+
5
+ Time Line - v26.09
6
+
7
+ UI COMPONENT TEMPLATE
8
+ - A simple vertical time line: a dot for every item and a line between the dots.
9
+ - An item has a time, a text and a description. All of them are optional.
10
+ - The component grows with its items (height is always "auto"). Put it in a scrolling
11
+ Box or in a VGroup for a long list.
12
+ - Every color, size and space is in the style object. Nothing else is needed: no image
13
+ files, no other component.
14
+ - What happened, and when: a history that grows (addItem). For the steps of a job and the step of now: StepBar.
15
+ - Style packages: "light" (default), "dark", "minimal", "minimalDark". Select with styleName (TimeLine.styles), or
16
+ later with setTheme(). minimal and minimalDark also give the sizes (dotSize, lineWidth, itemGap) the page does not give.
17
+
18
+ ITEM: { time, text, description, color, key, data } (style.title and style.description are the look of the two texts)
19
+ - A string is also accepted: "Order created" -> { text: "Order created" }
20
+ - color: The color of the dot of that item. (Empty: style.dot.color)
21
+ - key and data are not shown. They come back in onClick.
22
+
23
+ USAGE:
24
+ const timeLine = TimeLine({
25
+ width: 320,
26
+ items: [
27
+ { time: "09:30", text: "Order created", description: "Order #1024 was created." },
28
+ { time: "11:00", text: "Packed", color: "#E0A038" },
29
+ ],
30
+ clickableItems: 1,
31
+ onClick: function (self, item, index) { println(item.text); },
32
+ });
33
+ timeLine.addItem({ time: "14:20", text: "Sent" });
34
+ timeLine.setItems([]);
35
+ TimeLine({ styleName: "dark", items: ["Order created", "Packed"] }); // On a dark page
36
+ timeLine.setTheme("minimal");
37
+
38
+ Started Date: September 2026
39
+ Webpage: https://bug7a.github.io/js-components/
40
+
41
+ Copyright 2020-2026 Bugra Ozden <bugra.ozden@gmail.com> (https://bug7a.github.io/)
42
+ Licensed under the Apache License, Version 2.0
43
+ SPDX-License-Identifier: Apache-2.0
44
+
45
+ */
46
+
47
+ "use strict";
48
+
49
+ // Default values:
50
+ const TimeLineDefaults = {
51
+ key: "0",
52
+ width: 320, // A number or "100%". (The height always grows with the items.)
53
+ items: [], // [{ time, text, description, color, key, data }] or ["Order created"]
54
+ itemGap: 20, // Space between two items. (The line is drawn in it.)
55
+ dotSize: 12,
56
+ lineWidth: 2,
57
+ showLine: 1, // 0: Only the dots.
58
+ clickableItems: 0, // 1: An item can be clicked. (onClick)
59
+ enabled: 1,
60
+ onClick: function (self, item, index) { },
61
+ styleName: "light", // "light", "dark", "minimal", "minimalDark" or a name added to TimeLine.styles
62
+ style: { // Light style package (default)
63
+ row: {
64
+ gap: 12, // Space between the dots and the texts
65
+ },
66
+ dot: {
67
+ color: "#3871E0",
68
+ border: 0,
69
+ borderColor: White(1),
70
+ topSpace: 4, // WHY: The dot looks better in the middle of the first text line.
71
+ },
72
+ line: {
73
+ color: Black(0.12),
74
+ },
75
+ time: {
76
+ fontSize: 12,
77
+ textColor: Black(0.54), // WHY: 4.5:1 on white, as WCAG asks of a text
78
+ },
79
+ title: {
80
+ fontSize: 15,
81
+ textColor: Black(0.85),
82
+ bold: 1,
83
+ },
84
+ description: {
85
+ fontSize: 14,
86
+ textColor: Black(0.55),
87
+ lineHeight: "1.45",
88
+ },
89
+ hover: {
90
+ opacity: 0.6, // Mouse over an item. (clickableItems: 1)
91
+ },
92
+ disabled: {
93
+ opacity: 0.4,
94
+ },
95
+ }
96
+ };
97
+
98
+ const TimeLine = function (params = {}) {
99
+
100
+ // Merge style package: params.style > TimeLine.styles[styleName] > TimeLineDefaults.style (light)
101
+ const pageParams = Object.assign({}, params); // WHY: setTheme() puts what the page gave over another package.
102
+ basic.applyStylePackage(params, TimeLine.styles, TimeLineDefaults);
103
+
104
+ // Merge params:
105
+ mergeIntoIfMissing(params, TimeLineDefaults);
106
+
107
+ // Edit params, if needed:
108
+ params.color = "transparent";
109
+ params.height = "auto"; // WHY: The component is as tall as its items.
110
+
111
+ // BOX: Component container
112
+ let box = startObject(params);
113
+
114
+ // *** PRIVATE VARIABLES:
115
+ let _s = box.style;
116
+ const TEXT_GAP = 2; // Space between the time, the text and the description
117
+ const HOVER_MOTION = "opacity 0.15s";
118
+ let rows = []; // Created item rows
119
+
120
+ // *** PUBLIC VARIABLES:
121
+ // [var] Items: [{ time, text, description, color, key, data }]
122
+ box.items = [];
123
+
124
+ // *** PRIVATE FUNCTIONS:
125
+
126
+ // The params of a package (its style, and the sizes of a package of params), with what the page gave over them.
127
+ const paramsOfPackage = function (styleName) {
128
+ const fresh = Object.assign({}, pageParams, { styleName: styleName });
129
+ basic.applyStylePackage(fresh, TimeLine.styles, TimeLineDefaults);
130
+ mergeIntoIfMissing(fresh, TimeLineDefaults);
131
+ return fresh;
132
+ };
133
+
134
+ const normalizeItem = function (item) {
135
+ if (typeof item == "string" || typeof item == "number") {
136
+ return { time: "", text: String(item), description: "" }; // WHY: an undefined time made an empty label; its gap moved the text.
137
+ }
138
+ return Object.assign({ time: "", text: "", description: "" }, item);
139
+ };
140
+
141
+ // A row: the rail (dot + line) and the texts next to it.
142
+ const createRow = function (item, index) {
143
+
144
+ const isLast = (index == box.items.length - 1);
145
+
146
+ // GROUP: Item row
147
+ const row = HGroup({
148
+ width: "100%",
149
+ height: "auto",
150
+ align: "left top",
151
+ gap: _s.row.gap,
152
+ });
153
+
154
+ // GROUP: Rail (dot + line)
155
+ // WHY: alignSelf "stretch" makes it as tall as the row. So the line can grow
156
+ // until the dot of the next item, through the space under the texts.
157
+ row.rail = VGroup({
158
+ width: box.dotSize,
159
+ height: "auto",
160
+ align: "center top",
161
+ gap: 0,
162
+ shrink: 0,
163
+ css: { alignSelf: "stretch" },
164
+ });
165
+
166
+ // BOX: Dot
167
+ row.dot = Box({
168
+ width: box.dotSize,
169
+ height: box.dotSize,
170
+ round: 100,
171
+ color: item.color || _s.dot.color,
172
+ border: _s.dot.border,
173
+ borderColor: _s.dot.borderColor,
174
+ shrink: 0,
175
+ css: { marginTop: _s.dot.topSpace + "px" },
176
+ });
177
+
178
+ // BOX: Line to the next dot. (grow: 1 = the rest of the row)
179
+ if (box.showLine == 1 && !isLast) {
180
+ row.line = Box({
181
+ width: box.lineWidth,
182
+ height: 0,
183
+ color: _s.line.color,
184
+ grow: 1,
185
+ });
186
+ }
187
+
188
+ endGroup();
189
+
190
+ // GROUP: Texts
191
+ // WHY: The space between the items is the bottom margin of the texts, not the gap of
192
+ // the list. A gap would cut the line.
193
+ row.content = VGroup({
194
+ width: "auto",
195
+ height: "auto",
196
+ align: "left top",
197
+ gap: TEXT_GAP,
198
+ grow: 1,
199
+ css: { minWidth: "0", marginBottom: (isLast) ? "0px" : box.itemGap + "px" },
200
+ });
201
+
202
+ // LABEL: Time
203
+ if (item.time !== "") {
204
+ row.lblTime = Label({
205
+ width: "100%",
206
+ plainText: item.time, // WHY: plainText, not text. An item text is not HTML.
207
+ fontSize: _s.time.fontSize,
208
+ textColor: _s.time.textColor,
209
+ });
210
+ }
211
+
212
+ // LABEL: Title
213
+ if (item.text !== "") {
214
+ row.lblTitle = Label({
215
+ width: "100%",
216
+ plainText: item.text,
217
+ fontSize: _s.title.fontSize,
218
+ textColor: _s.title.textColor,
219
+ bold: _s.title.bold,
220
+ });
221
+ }
222
+
223
+ // LABEL: Description
224
+ if (item.description !== "") {
225
+ row.lblText = Label({ // WHY: not row.text. Box.text writes innerHTML.
226
+ width: "100%",
227
+ plainText: item.description,
228
+ fontSize: _s.description.fontSize,
229
+ textColor: _s.description.textColor,
230
+ lineHeight: _s.description.lineHeight,
231
+ });
232
+ }
233
+
234
+ endGroup();
235
+
236
+ endGroup();
237
+
238
+ if (box.clickableItems == 1) makeRowClickable(row, item, index);
239
+
240
+ return row;
241
+
242
+ };
243
+
244
+ const makeRowClickable = function (row, item, index) {
245
+
246
+ row.clickable = 1;
247
+ row.cursor = "pointer";
248
+ row.setMotion(HOVER_MOTION);
249
+
250
+ row.on("click", function (self, event) {
251
+ if (box.enabled != 1) return;
252
+ box.onClick(box, item, index, event);
253
+ });
254
+ row.on("mouseover", function () {
255
+ if (box.enabled != 1) return;
256
+ row.opacity = _s.hover.opacity;
257
+ });
258
+ row.on("mouseout", function () {
259
+ row.opacity = 1;
260
+ });
261
+
262
+ };
263
+
264
+ const removeRows = function () {
265
+ rows.forEach(function (row) { row.remove(); });
266
+ rows = [];
267
+ };
268
+
269
+ const drawAll = function () {
270
+
271
+ removeRows();
272
+
273
+ createIn(box.content, function () {
274
+
275
+ box.items.forEach(function (item, index) {
276
+ // WHY: endGroup() (in createRow) sets the container to the last started group, not to
277
+ // box.content. While the page is still being created, that is another box.
278
+ setDefaultContainerBox(box.content);
279
+ rows.push(createRow(item, index));
280
+ });
281
+
282
+ });
283
+
284
+ box.opacity = (box.enabled == 1) ? 1 : _s.disabled.opacity;
285
+
286
+ };
287
+
288
+ // *** PUBLIC FUNCTIONS:
289
+
290
+ box.setItems = function (items) {
291
+ box.items = (items || []).map(normalizeItem);
292
+ drawAll();
293
+ };
294
+ // USAGE: timeLine.setItems([{ time: "09:30", text: "Order created" }, "Packed"])
295
+
296
+ box.getItems = function () {
297
+ return box.items.slice();
298
+ };
299
+
300
+ // Add a new item to the end of the line.
301
+ box.addItem = function (item) {
302
+ box.items.push(normalizeItem(item));
303
+ drawAll();
304
+ };
305
+ // USAGE: timeLine.addItem({ time: "14:20", text: "Sent" })
306
+
307
+ box.clear = function () {
308
+ box.setItems([]);
309
+ };
310
+
311
+ box.setEnabled = function (enabled) {
312
+ box.enabled = basic.isOn(enabled) ? 1 : 0;
313
+ drawAll(); // WHY: The cursor and the click of every row change.
314
+ };
315
+ // USAGE: get: timeLine.enabled, set: timeLine.setEnabled(0)
316
+
317
+ box.refresh = function () {
318
+ drawAll();
319
+ };
320
+
321
+ // Another style package while it is on the page. What the page gave (its style, a dotSize) stays over it.
322
+ box.setTheme = function (styleName) {
323
+ const fresh = paramsOfPackage(styleName);
324
+ box.styleName = styleName;
325
+ box.style = fresh.style;
326
+ _s = fresh.style;
327
+ box.dotSize = fresh.dotSize;
328
+ box.lineWidth = fresh.lineWidth;
329
+ box.itemGap = fresh.itemGap;
330
+ drawAll();
331
+ };
332
+ // USAGE: timeLine.setTheme("dark")
333
+
334
+ // *** OBJECT VIEW:
335
+
336
+ box.role = "list";
337
+
338
+ // GROUP: The item rows (created by drawAll)
339
+ box.content = VGroup({
340
+ width: "100%",
341
+ height: "auto",
342
+ align: "left top",
343
+ gap: 0, // WHY: The space between the items is the bottom margin of the texts. (See createRow)
344
+ position: "relative", // WHY: Component height is "auto". A relative group makes the container wrap it.
345
+ });
346
+
347
+ endGroup();
348
+
349
+ // *** OBJECT INIT CODE:
350
+
351
+ box.enabled = basic.isOn(box.enabled) ? 1 : 0;
352
+ box.setItems(params.items); // WHY: Copy the array. The default [] must not be shared between components.
353
+
354
+ return endObject(box);
355
+
356
+ };
357
+
358
+ // *** STYLE PACKAGES:
359
+ // USAGE: TimeLine({ styleName: "dark" })
360
+ // USAGE: TimeLine({ styleName: "dark", style: { dot: { color: "tomato" } } }) // Change only some keys.
361
+ // NOTE: A new package needs only the keys that differ from the default (light) style.
362
+ TimeLine.styles = {
363
+
364
+ // Blue dots on a light page.
365
+ light: TimeLineDefaults.style,
366
+
367
+ // For a dark page: a lighter blue, light texts. borderColor: the ring of a dot with a border, in the color of the page.
368
+ dark: {
369
+ dot: { color: "#6C98EF", borderColor: "#1A1A19" },
370
+ line: { color: White(0.16) },
371
+ time: { textColor: White(0.5) },
372
+ title: { textColor: White(0.88) },
373
+ description: { textColor: White(0.6) },
374
+ },
375
+
376
+ };
377
+
378
+ // The minimal theme (_designs/minimal-theme.htm): small ink dots on a 1 px line, a 13 px title of the normal weight and
379
+ // 12 px texts. A package of params: it gives the sizes too, when the page does not give them. minimalDark: on a dark window.
380
+ TimeLine.createMinimalStyle = function (palette) {
381
+ return {
382
+ dotSize: 7, // WHY odd: the 1 px line in the middle of the dot stays on a whole pixel.
383
+ lineWidth: 1,
384
+ itemGap: 16,
385
+ style: {
386
+ row: { gap: 10 },
387
+ dot: { color: palette.ink, borderColor: palette.ground, topSpace: 5 },
388
+ line: { color: palette.line },
389
+ time: { fontSize: 11, textColor: palette.softText },
390
+ title: { fontSize: 13, textColor: palette.text, bold: 0 },
391
+ description: { fontSize: 12, textColor: palette.softText },
392
+ },
393
+ };
394
+ };
395
+ TimeLine.MINIMAL_COLORS = { ground: "#FFFFFF", text: Black(0.85), softText: Black(0.55), line: Black(0.2), ink: "#1F1F1F" };
396
+ TimeLine.styles.minimal = TimeLine.createMinimalStyle(TimeLine.MINIMAL_COLORS);
397
+ TimeLine.MINIMAL_DARK_COLORS = { ground: "#1A1A19", text: White(0.88), softText: White(0.55), line: White(0.18), ink: "#EDEDEB" };
398
+ TimeLine.styles.minimalDark = TimeLine.createMinimalStyle(TimeLine.MINIMAL_DARK_COLORS);