@astronox/core 0.2.1 → 0.2.2

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 (64) hide show
  1. package/package.json +7 -1
  2. package/src/admin/contracts.ts +28 -0
  3. package/src/admin/index.ts +2 -0
  4. package/src/admin/module.ts +28 -0
  5. package/src/auth/contracts.ts +53 -0
  6. package/src/auth/firebase/client.ts +53 -0
  7. package/src/auth/firebase/contracts.ts +8 -0
  8. package/src/auth/firebase/index.ts +1 -0
  9. package/src/auth/index.ts +2 -0
  10. package/src/auth/module.ts +99 -0
  11. package/src/client/index.ts +3 -0
  12. package/src/client/preferences.ts +400 -0
  13. package/src/components/actions/Button/Button.astro +42 -6
  14. package/src/components/actions/Button/Button.css +19 -0
  15. package/src/components/actions/IdentityProviderAction/IdentityProviderAction.astro +35 -0
  16. package/src/components/content/CardBody/CardBody.astro +3 -0
  17. package/src/components/content/CardBody/CardBody.css +10 -0
  18. package/src/components/content/MarkdownContent/markdownContentRenderer.ts +549 -0
  19. package/src/components/feedback/PreferenceBootstrap/PreferenceBootstrap.astro +403 -0
  20. package/src/components/forms/Checkbox/Checkbox.astro +6 -0
  21. package/src/components/forms/ChoiceGroup/ChoiceGroup.astro +57 -0
  22. package/src/components/forms/ChoiceGroup/ChoiceGroup.css +108 -0
  23. package/src/components/forms/ChoiceGroup/contracts.ts +9 -0
  24. package/src/components/forms/DateTimeInput/DateTimeInput.astro +14 -0
  25. package/src/components/forms/TextInput/TextInput.astro +7 -1
  26. package/src/components/forms/Textarea/Textarea.astro +32 -0
  27. package/src/components/forms/Textarea/Textarea.css +54 -0
  28. package/src/components/icons/BackIcon.astro +26 -0
  29. package/src/components/icons/DeleteIcon.astro +22 -0
  30. package/src/components/icons/StatusIndicatorIcon.astro +16 -0
  31. package/src/components/index.ts +10 -0
  32. package/src/components/media/CanvasFrame/CanvasFrame.astro +1 -17
  33. package/src/components/media/EmbedFrame/EmbedFrame.astro +1 -19
  34. package/src/components/media/EmbedFrame/EmbedFrame.css +0 -2
  35. package/src/components/navigation/SubNavigation/SubNavigation.css +0 -5
  36. package/src/composition/SurfaceGroup/SurfaceGroup.css +21 -7
  37. package/src/composition/SurfaceGroup/stickySurfaceGroupController.ts +3 -0
  38. package/src/data/firestore/client/contracts.ts +55 -0
  39. package/src/data/firestore/client/firebase.ts +12 -0
  40. package/src/data/firestore/client/index.ts +3 -0
  41. package/src/data/firestore/client/repository.ts +111 -0
  42. package/src/display/contracts.ts +40 -0
  43. package/src/display/index.ts +1 -0
  44. package/src/display/tableProgressive.ts +62 -0
  45. package/src/patterns/Combobox/Combobox.astro +23 -0
  46. package/src/patterns/Fullscreen/FullscreenControl.astro +4 -14
  47. package/src/patterns/Fullscreen/FullscreenControl.css +0 -26
  48. package/src/patterns/Modal/Modal.astro +1 -1
  49. package/src/patterns/Modal/Modal.css +38 -1
  50. package/src/patterns/Table/Table.astro +122 -7
  51. package/src/patterns/Table/TableBody.astro +8 -0
  52. package/src/patterns/Table/TableCell.css +6 -0
  53. package/src/patterns/Table/TableCellValue.astro +31 -0
  54. package/src/patterns/Table/TableFooter.astro +3 -1
  55. package/src/patterns/Table/TableHeader.astro +1 -0
  56. package/src/patterns/Table/TablePagination.astro +63 -47
  57. package/src/patterns/Table/TableSkeleton.astro +18 -22
  58. package/src/patterns/Table/TableSkeleton.css +30 -5
  59. package/src/patterns/Table/tableClientController.ts +253 -0
  60. package/src/patterns/Table/tableFilterController.ts +23 -31
  61. package/src/patterns/Table/tableProgressiveController.ts +615 -227
  62. package/src/patterns/Table/tableSortController.ts +25 -7
  63. package/src/styles/interaction.css +16 -0
  64. package/src/styles/style.css +2 -0
@@ -1,3 +1,10 @@
1
+ import {
2
+ hasTableProgressive,
3
+ refreshTableProgressive,
4
+ setTableProgressiveSort,
5
+ updateTableProgressiveEntry,
6
+ } from './tableProgressiveController';
7
+
1
8
  type SortDirection = 'ascending' | 'descending';
2
9
  type SortType = 'number' | 'text';
3
10
  type SortValue = string | number | null;
@@ -134,30 +141,35 @@ export function initTableSort(root: HTMLElement): () => void {
134
141
  const id = button.dataset.tableSortColumn;
135
142
  const type = button.dataset.tableSortType;
136
143
  if (!id || (type !== 'number' && type !== 'text')) return;
144
+ const firstDirection =
145
+ button.dataset.tableSortFirstDirection === 'ascending'
146
+ ? 'ascending'
147
+ : 'descending';
148
+ const secondDirection =
149
+ firstDirection === 'ascending' ? 'descending' : 'ascending';
137
150
 
138
151
  if (state?.id !== id) {
139
152
  state = {
140
153
  id,
141
154
  type,
142
- direction: 'descending',
155
+ direction: firstDirection,
143
156
  tieBreaker: button.dataset.tableSortTieBreaker,
144
157
  };
145
- root.dispatchEvent(new CustomEvent('table:load-all', { bubbles: true }));
146
- } else if (state.direction === 'descending') {
147
- state = { ...state, direction: 'ascending' };
158
+ } else if (state.direction === firstDirection) {
159
+ state = { ...state, direction: secondDirection };
148
160
  } else {
149
161
  state = null;
150
162
  }
151
163
 
152
164
  updateButtons();
153
- scheduleSort();
165
+ if (!setTableProgressiveSort(root, state)) scheduleSort();
154
166
  };
155
167
 
156
168
  const handleRowsAppended = (event: Event): void => {
157
169
  const detail = (event as CustomEvent<{ rows?: readonly HTMLElement[] }>)
158
170
  .detail;
159
171
  registerRows(detail?.rows ?? []);
160
- scheduleSort();
172
+ if (!hasTableProgressive(root)) scheduleSort();
161
173
  };
162
174
 
163
175
  const handleSortValuesChanged = (): void => {
@@ -169,7 +181,7 @@ export function initTableSort(root: HTMLElement): () => void {
169
181
 
170
182
  state = null;
171
183
  updateButtons();
172
- scheduleSort();
184
+ if (!setTableProgressiveSort(root, null)) scheduleSort();
173
185
  };
174
186
 
175
187
  registerRows(getRows());
@@ -208,9 +220,15 @@ export function setTableSortValues(
208
220
  };
209
221
  sortValuesCache.set(row, nextValues);
210
222
  row.dataset.tableSortValues = JSON.stringify(nextValues);
223
+ const root = row.closest<HTMLElement>('[data-table-scroll-root]');
224
+ const key = row.dataset.tableRowKey;
225
+ if (root && key) {
226
+ updateTableProgressiveEntry(root, key, { sortValues: nextValues });
227
+ }
211
228
  }
212
229
 
213
230
  export function refreshTableSort(root: HTMLElement): void {
231
+ if (refreshTableProgressive(root)) return;
214
232
  root.dispatchEvent(
215
233
  new CustomEvent('table:sort-values-changed', { bubbles: true }),
216
234
  );
@@ -29,6 +29,22 @@
29
29
  transform-origin: center;
30
30
  }
31
31
 
32
+ @media (hover: none) and (pointer: coarse) {
33
+ :where(
34
+ a[href],
35
+ button,
36
+ summary,
37
+ [role='button'],
38
+ [role='link'],
39
+ [tabindex]:not(input, select, textarea)
40
+ ):focus-visible {
41
+ --nox-focus-ring: transparent;
42
+ --nox-tone-focus-ring: transparent;
43
+
44
+ outline: none;
45
+ }
46
+ }
47
+
32
48
  @media (hover: hover) and (pointer: fine) {
33
49
  [data-interaction-accent]:hover {
34
50
  background: var(--nox-interaction-accent-hover-background);
@@ -42,10 +42,12 @@
42
42
  @import '../components/data-display/TextPair/TextPair.css'
43
43
  layer(components);
44
44
  @import '../components/forms/Checkbox/Checkbox.css' layer(components);
45
+ @import '../components/forms/ChoiceGroup/ChoiceGroup.css' layer(components);
45
46
  @import '../components/forms/FieldLabel/FieldLabel.css' layer(components);
46
47
  @import '../components/forms/FieldError/FieldError.css' layer(components);
47
48
  @import '../components/forms/FieldGroup/FieldGroup.css' layer(components);
48
49
  @import '../components/forms/TextInput/TextInput.css' layer(components);
50
+ @import '../components/forms/Textarea/Textarea.css' layer(components);
49
51
  @import '../components/feedback/Tooltip/Tooltip.css' layer(components);
50
52
  @import '../components/feedback/Spinner/Spinner.css' layer(components);
51
53
  @import '../components/icons/CurrencyIcon.css' layer(components);