@cahyo-dimas/freeday 1.54.0 → 2.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 (147) hide show
  1. package/CHANGELOG.md +713 -545
  2. package/COMPONENTS.md +417 -139
  3. package/README.id.md +46 -45
  4. package/README.md +46 -43
  5. package/USAGE.md +34 -34
  6. package/adapters/blazor/FdyAppShell.razor +2 -2
  7. package/adapters/blazor/FdyAppShell.razor.cs +6 -6
  8. package/adapters/blazor/FdyCfl.razor.cs +1 -1
  9. package/adapters/blazor/FdyChart.razor +1 -1
  10. package/adapters/blazor/FdyChart.razor.cs +3 -3
  11. package/adapters/blazor/FdyChartSeries.cs +1 -1
  12. package/adapters/blazor/FdyCombo.razor.cs +2 -2
  13. package/adapters/blazor/FdyModal.razor +1 -1
  14. package/adapters/blazor/FdyTable.razor.cs +7 -7
  15. package/adapters/blazor/FdyTableFilter.razor +1 -1
  16. package/adapters/blazor/FdyTableFooter.razor +1 -1
  17. package/adapters/blazor/FdyTableFooter.razor.cs +4 -4
  18. package/adapters/blazor/Freeday.Blazor.csproj +1 -1
  19. package/adapters/blazor/FreedayComponentBase.cs +1 -1
  20. package/adapters/blazor/TableModel.cs +3 -3
  21. package/adapters/blazor/TableTypes.cs +3 -3
  22. package/adapters/blazor/freeday-blazor.js +5 -5
  23. package/adapters/core/app-shell.d.ts +1 -1
  24. package/adapters/core/app-shell.js +6 -6
  25. package/adapters/core/cfl-value.d.ts +11 -0
  26. package/adapters/core/cfl-value.js +31 -0
  27. package/adapters/core/table-model.d.ts +2 -2
  28. package/adapters/core/table-model.js +8 -8
  29. package/adapters/react/components/FdyAppShell.tsx +5 -5
  30. package/adapters/react/components/FdyAutocomplete.tsx +1 -1
  31. package/adapters/react/components/FdyCascade.tsx +1 -1
  32. package/adapters/react/components/FdyCfl.tsx +11 -11
  33. package/adapters/react/components/FdyDateRange.tsx +2 -2
  34. package/adapters/react/components/FdyDatepicker.tsx +5 -5
  35. package/adapters/react/components/FdyDrawer.tsx +1 -1
  36. package/adapters/react/components/FdyModal.tsx +2 -2
  37. package/adapters/react/components/FdyTable.tsx +7 -7
  38. package/adapters/react/components/FdyTableFilter.tsx +1 -1
  39. package/adapters/react/components/FdyTableFooter.tsx +5 -5
  40. package/adapters/react/index.d.ts +4 -1
  41. package/adapters/react/index.js +1 -0
  42. package/adapters/react/useFreeday.js +3 -3
  43. package/adapters/vue/components/FdyAppShell.vue +5 -5
  44. package/adapters/vue/components/FdyAutocomplete.vue +1 -1
  45. package/adapters/vue/components/FdyCascade.vue +1 -1
  46. package/adapters/vue/components/FdyCfl.vue +8 -8
  47. package/adapters/vue/components/FdyChart.vue +2 -2
  48. package/adapters/vue/components/FdyCombo.vue +1 -1
  49. package/adapters/vue/components/FdyDateRange.vue +2 -2
  50. package/adapters/vue/components/FdyDatepicker.vue +5 -5
  51. package/adapters/vue/components/FdyDrawer.vue +3 -3
  52. package/adapters/vue/components/FdyModal.vue +3 -3
  53. package/adapters/vue/components/FdyTable.vue +7 -7
  54. package/adapters/vue/components/FdyTableFilter.vue +1 -1
  55. package/adapters/vue/components/FdyTableFooter.vue +5 -5
  56. package/adapters/vue/index.d.ts +5 -2
  57. package/adapters/vue/index.js +1 -0
  58. package/adapters/vue/useFreeday.js +3 -3
  59. package/dist/asset.d.ts +3 -3
  60. package/dist/freeday-app-shell.js +9 -9
  61. package/dist/freeday-autocomplete.js +2 -2
  62. package/dist/freeday-breakpoint.js +1 -1
  63. package/dist/freeday-carousel.js +8 -7
  64. package/dist/freeday-cascade.js +10 -9
  65. package/dist/freeday-cfl.js +12 -11
  66. package/dist/freeday-chart.js +11 -11
  67. package/dist/freeday-chip.js +3 -3
  68. package/dist/freeday-datepicker.js +11 -7
  69. package/dist/freeday-datetime.js +5 -5
  70. package/dist/freeday-drawer.js +1 -1
  71. package/dist/freeday-form.js +17 -16
  72. package/dist/freeday-mask.js +9 -8
  73. package/dist/freeday-menu.js +1 -1
  74. package/dist/freeday-number.js +3 -3
  75. package/dist/freeday-popover.js +3 -3
  76. package/dist/freeday-rating.js +2 -2
  77. package/dist/freeday-select.js +5 -5
  78. package/dist/freeday-slider.js +2 -2
  79. package/dist/freeday-stepper.js +10 -9
  80. package/dist/freeday-table.js +18 -17
  81. package/dist/freeday-tabs.js +1 -1
  82. package/dist/freeday-timepicker.js +2 -2
  83. package/dist/freeday-toast.js +11 -10
  84. package/dist/freeday-tree.js +3 -3
  85. package/dist/freeday-upload.js +28 -27
  86. package/dist/freeday.bundle.css +176 -176
  87. package/dist/freeday.css +170 -170
  88. package/dist/freeday.d.ts +2 -2
  89. package/dist/freeday.js +189 -176
  90. package/dist/freeday.tokens.css +5 -5
  91. package/docs/agent-onboarding.md +49 -46
  92. package/docs/getting-started.md +49 -40
  93. package/docs/integrations.md +18 -18
  94. package/docs/reference-screen.html +14 -14
  95. package/package.json +4 -3
  96. package/src/base.css +6 -6
  97. package/src/components/accordion.css +4 -4
  98. package/src/components/alert.css +1 -1
  99. package/src/components/app-shell.css +10 -10
  100. package/src/components/appbar.css +3 -3
  101. package/src/components/autocomplete.css +1 -1
  102. package/src/components/avatar.css +3 -3
  103. package/src/components/badge.css +5 -5
  104. package/src/components/breadcrumb.css +1 -1
  105. package/src/components/breakpoints.css +4 -4
  106. package/src/components/button.css +13 -13
  107. package/src/components/card.css +8 -8
  108. package/src/components/carousel.css +2 -2
  109. package/src/components/cascade.css +2 -2
  110. package/src/components/cfl.css +4 -4
  111. package/src/components/chart.css +3 -3
  112. package/src/components/chip.css +2 -2
  113. package/src/components/combo.css +3 -3
  114. package/src/components/composition.css +7 -7
  115. package/src/components/datepicker.css +6 -6
  116. package/src/components/datetimepicker.css +1 -1
  117. package/src/components/description-list.css +1 -1
  118. package/src/components/divider.css +1 -1
  119. package/src/components/drawer.css +1 -1
  120. package/src/components/file-upload.css +5 -5
  121. package/src/components/filterbar.css +7 -7
  122. package/src/components/form-grid.css +2 -2
  123. package/src/components/input-group.css +6 -6
  124. package/src/components/input.css +6 -6
  125. package/src/components/kbd.css +1 -1
  126. package/src/components/list.css +6 -6
  127. package/src/components/menu.css +3 -3
  128. package/src/components/modal.css +1 -1
  129. package/src/components/pagination.css +1 -1
  130. package/src/components/progress.css +1 -1
  131. package/src/components/rating.css +2 -2
  132. package/src/components/selection.css +4 -4
  133. package/src/components/skeleton.css +1 -1
  134. package/src/components/slider.css +1 -1
  135. package/src/components/spinner.css +1 -1
  136. package/src/components/states.css +1 -1
  137. package/src/components/stepper.css +2 -2
  138. package/src/components/table.css +15 -15
  139. package/src/components/tabs.css +3 -3
  140. package/src/components/timeline.css +1 -1
  141. package/src/components/timepicker.css +1 -1
  142. package/src/components/toast.css +3 -3
  143. package/src/components/tooltip.css +1 -1
  144. package/src/components/tree.css +2 -2
  145. package/tokens/breakpoints.d.ts +2 -2
  146. package/tokens/breakpoints.mjs +3 -3
  147. package/tokens/tokens.json +1 -1
@@ -1,13 +1,13 @@
1
- /* Freeday — file-upload enhancer (optional, zero-dependency).
1
+ /* Freeday, file-upload enhancer (optional, zero-dependency).
2
2
  * A drop target that also opens the file dialog on click / Enter / Space, validates each file
3
3
  * (accept + max size), and renders a per-file row with explicit state. Actual upload is the
4
- * consumer's job — this is a controlled reference: wire the emitted event's row API to your
4
+ * consumer's job, this is a controlled reference: wire the emitted event's row API to your
5
5
  * upload call, or set data-fdy-upload-simulate for a demo progress animation.
6
6
  *
7
7
  * Markup contract:
8
8
  * <div class="fdy-dropzone" data-fdy-dropzone role="button" tabindex="0"
9
9
  * data-max-size="10485760" data-filelist="#dz-list" [data-fdy-upload-simulate]
10
- * aria-label="Unggah berkas — seret ke sini atau tekan Enter">
10
+ * aria-label="Unggah berkas, seret ke sini atau tekan Enter">
11
11
  * <span class="fdy-dropzone__icon">…svg…</span>
12
12
  * <span class="fdy-dropzone__title">…</span>
13
13
  * <span class="fdy-dropzone__hint">…</span>
@@ -15,15 +15,15 @@
15
15
  * </div>
16
16
  * <div class="fdy-filelist" id="dz-list"></div>
17
17
  *
18
- * Emits bubbling CustomEvents — BOTH on the dropzone element, which is the one target a consumer
18
+ * Emits bubbling CustomEvents. BOTH on the dropzone element, which is the one target a consumer
19
19
  * needs to listen on:
20
20
  * "fdy-upload-add" {file, rejected, reason, row}
21
21
  * "fdy-upload-remove" {file}
22
22
  * `row` is the state machine over the rendered .fdy-file:
23
- * .ready() (rest — where a dropped file starts) / .uploading() / .setProgress(pct) /
23
+ * .ready() (rest, where a dropped file starts) / .uploading() / .setProgress(pct) /
24
24
  * .waiting(label) (sent, awaiting the server) / .done() / .fail(msg) / .el
25
25
  * Note the file list is a SIBLING of the dropzone above, so nothing dispatched on a row would ever
26
- * bubble through the zone — which is why removal fires on the zone and not on the row.
26
+ * bubble through the zone, which is why removal fires on the zone and not on the row.
27
27
  */
28
28
  (function () {
29
29
  'use strict';
@@ -51,21 +51,22 @@
51
51
  }
52
52
 
53
53
 
54
- /* User-facing strings. Indonesian by default — documented and deliberate for the raw enhancer
55
- * path — and every one overridable per element, so a host that speaks another language (the
56
- * Blazor adapters, an English app on the raw path) supplies its own without forking this file.
57
- * Keeping them in ONE table is also what lets a guard prove none is hard-coded further down. */
54
+ /* User-facing strings. English by default since 2.0.0, documented and deliberate for the raw
55
+ * enhancer path, and every one overridable per element with `data-fdy-text-<key>`, so a host
56
+ * that speaks another language (an Indonesian app on the raw path) supplies its own without
57
+ * forking this file. Keeping them in ONE table is also what lets a guard prove none is
58
+ * hard-coded further down. */
58
59
  var TEXT = {
59
- remove: 'Hapus {name}',
60
- progress: 'Progres unggah {name}',
61
- uploading: 'Mengunggah…',
62
- waiting: 'Menunggu server…',
63
- done: 'Terunggah',
64
- badType: 'Tipe berkas tidak didukung.',
65
- tooBig: 'Ukuran melebihi batas ({max}).'
60
+ remove: 'Remove {name}',
61
+ progress: 'Upload progress for {name}',
62
+ uploading: 'Uploading…',
63
+ waiting: 'Waiting for the server…',
64
+ done: 'Uploaded',
65
+ badType: 'Unsupported file type.',
66
+ tooBig: 'Over the {max} limit.'
66
67
  };
67
68
  /* HTML lowercases attribute names, so a camelCase key like `filterText` can only ever be written
68
- as `data-fdy-text-filtertext` — while the kebab form anybody would reach for,
69
+ as `data-fdy-text-filtertext`, while the kebab form anybody would reach for,
69
70
  `data-fdy-text-filter-text`, becomes a DIFFERENT attribute the enhancer never reads, and the
70
71
  override fails silently. So the key is kebab-cased for the lookup; the run-together spelling
71
72
  still resolves, for markup written against 1.39.0. */
@@ -103,12 +104,12 @@
103
104
  remove.setAttribute('aria-label', textOf(zone, 'remove', { name: file.name }));
104
105
  remove.innerHTML = '&times;';
105
106
  remove.addEventListener('click', function () {
106
- /* Dispatched on the ZONE, not on the row — the same target as fdy-upload-add, so one listener
107
+ /* Dispatched on the ZONE, not on the row, the same target as fdy-upload-add, so one listener
107
108
  on the dropzone gets both. The row lives in the file list, which the kit's own markup
108
109
  contract puts as a SIBLING of the dropzone, so a row event never bubbles through the zone:
109
110
  a consumer following the docs saw `add` arrive and `remove` never fire, with no error.
110
- Firing on both would look safer, but it makes the pair asymmetric — one `add` and, for
111
- anyone delegating on a common ancestor, two `remove`s — which is its own silent bug. It
111
+ Firing on both would look safer, but it makes the pair asymmetric, one `add` and, for
112
+ anyone delegating on a common ancestor, two `remove`s, which is its own silent bug. It
112
113
  also fixes the listless case: a row that was never attached bubbles to nothing at all. */
113
114
  zone.dispatchEvent(new CustomEvent('fdy-upload-remove', { bubbles: true, detail: { file: file } }));
114
115
  el.remove();
@@ -140,14 +141,14 @@
140
141
  }
141
142
  /* Back to a measured bar. While the indeterminate modifier is on it owns the bar's width, so an
142
143
  explicit one has to be restored when it comes off: .fdy-progress__bar is a plain block div, and
143
- with no width at all it fills the track — a full bar, which is the opposite of what 0% means. */
144
+ with no width at all it fills the track, a full bar, which is the opposite of what 0% means. */
144
145
  function determinate() {
145
146
  progressEl.classList.remove('fdy-progress--indeterminate');
146
147
  if (!bar.style.width) bar.style.width = '0%';
147
148
  }
148
149
  return {
149
150
  el: el,
150
- /* The state a row starts in: chosen, not yet sent. The size alone — it makes no claim about
151
+ /* The state a row starts in: chosen, not yet sent. The size alone, it makes no claim about
151
152
  a transfer, and no progress bar is shown, because nothing is in flight. Without this the
152
153
  state machine had no start state: done() claims success, fail() claims an error, and
153
154
  uploading() is a lie until the consumer actually sends the file. */
@@ -171,12 +172,12 @@
171
172
  bar.style.width = v + '%';
172
173
  progressEl.setAttribute('aria-valuenow', String(Math.round(v)));
173
174
  },
174
- /* The bytes are gone and the server has not answered yet — extraction, scanning, transcoding.
175
+ /* The bytes are gone and the server has not answered yet, extraction, scanning, transcoding.
175
176
  "Mengunggah…" turns false the moment the last byte leaves, and a determinate bar parked at
176
177
  100% is the most convincing "hung" signal a UI can produce, so this state reports no
177
178
  percentage: the bar goes indeterminate and the label belongs to the consumer, because only
178
179
  they know what the server is doing ("Membaca PDF…", "Memindai…"). done()/fail()/ready() need
179
- no counterpart here — they drop the progress element outright, modifier and all. */
180
+ no counterpart here, they drop the progress element outright, modifier and all. */
180
181
  waiting: function (label) {
181
182
  el.classList.remove('fdy-file--error', 'fdy-file--success');
182
183
  icon.innerHTML = FILE_ICON;
@@ -184,7 +185,7 @@
184
185
  ensureProgress();
185
186
  progressEl.classList.add('fdy-progress--indeterminate');
186
187
  /* The modifier styles .fdy-progress__bar, so it must sit on the CONTAINER, and the inline
187
- width setProgress wrote has to go — an inline style beats any rule the modifier brings.
188
+ width setProgress wrote has to go, an inline style beats any rule the modifier brings.
188
189
  aria-valuenow goes with it: a progressbar with no value is precisely what ARIA calls
189
190
  indeterminate, which is the contract COMPONENTS.md already states for this component. */
190
191
  bar.style.width = '';
@@ -255,7 +256,7 @@
255
256
  if (input) input.addEventListener('change', function () { handleFiles(input.files); input.value = ''; });
256
257
 
257
258
  /* The list is optional: rendering a row and announcing the file are separate jobs. A consumer
258
- that wants its own markup simply provides no list — it still gets `fdy-upload-add`, and
259
+ that wants its own markup simply provides no list, it still gets `fdy-upload-add`, and
259
260
  `detail.row` still works (its element is just never attached). Gating the EVENT on the list
260
261
  meant "bring your own row" silently cost you the notification that a file had arrived. */
261
262
  function handleFiles(fileList) {