@astronox/core 0.2.1 → 0.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 (88) hide show
  1. package/package.json +7 -1
  2. package/src/admin/cache.ts +217 -0
  3. package/src/admin/contracts.ts +28 -0
  4. package/src/admin/index.ts +3 -0
  5. package/src/admin/module.ts +28 -0
  6. package/src/auth/contracts.ts +53 -0
  7. package/src/auth/firebase/client.ts +83 -0
  8. package/src/auth/firebase/contracts.ts +8 -0
  9. package/src/auth/firebase/index.ts +1 -0
  10. package/src/auth/index.ts +2 -0
  11. package/src/auth/module.ts +99 -0
  12. package/src/client/formSubmission.ts +177 -0
  13. package/src/client/index.ts +4 -0
  14. package/src/client/preferences.ts +400 -0
  15. package/src/components/actions/Button/Button.astro +42 -6
  16. package/src/components/actions/Button/Button.css +19 -0
  17. package/src/components/actions/IdentityProviderAction/IdentityProviderAction.astro +35 -0
  18. package/src/components/actions/ScrollToTop/ScrollToTop.css +11 -0
  19. package/src/components/content/CardBody/CardBody.astro +3 -0
  20. package/src/components/content/CardBody/CardBody.css +16 -2
  21. package/src/components/content/CardFooter/CardFooter.astro +9 -0
  22. package/src/components/content/CardFooter/CardFooter.css +45 -3
  23. package/src/components/content/CardLink/CardLink.astro +12 -3
  24. package/src/components/content/CardLink/CardLink.css +32 -0
  25. package/src/components/content/MarkdownContent/MarkdownContent.css +14 -4
  26. package/src/components/content/MarkdownContent/MarkdownInline.astro +1 -1
  27. package/src/components/content/MarkdownContent/contracts.ts +1 -1
  28. package/src/components/content/MarkdownContent/markdownContentRenderer.ts +552 -0
  29. package/src/components/data-display/TextPair/TextPair.css +8 -2
  30. package/src/components/feedback/PreferenceBootstrap/PreferenceBootstrap.astro +403 -0
  31. package/src/components/forms/Checkbox/Checkbox.astro +6 -0
  32. package/src/components/forms/ChoiceGroup/ChoiceGroup.astro +57 -0
  33. package/src/components/forms/ChoiceGroup/ChoiceGroup.css +108 -0
  34. package/src/components/forms/ChoiceGroup/contracts.ts +9 -0
  35. package/src/components/forms/DateTimeInput/DateTimeInput.astro +14 -0
  36. package/src/components/forms/PreparedFormBootstrap/PreparedFormBootstrap.astro +203 -0
  37. package/src/components/forms/PreparedFormBootstrap/contracts.ts +15 -0
  38. package/src/components/forms/TextInput/TextInput.astro +7 -1
  39. package/src/components/forms/Textarea/Textarea.astro +35 -0
  40. package/src/components/forms/Textarea/Textarea.css +62 -0
  41. package/src/components/icons/BackIcon.astro +26 -0
  42. package/src/components/icons/DeleteIcon.astro +22 -0
  43. package/src/components/icons/StatusIndicatorIcon.astro +16 -0
  44. package/src/components/index.ts +18 -0
  45. package/src/components/media/CanvasFrame/CanvasFrame.astro +1 -17
  46. package/src/components/media/EmbedFrame/EmbedFrame.astro +1 -19
  47. package/src/components/media/EmbedFrame/EmbedFrame.css +0 -2
  48. package/src/components/navigation/Breadcrumbs/Breadcrumbs.astro +5 -1
  49. package/src/components/navigation/Breadcrumbs/Breadcrumbs.css +12 -17
  50. package/src/components/navigation/Footer/Footer.astro +102 -0
  51. package/src/components/navigation/Footer/Footer.css +155 -0
  52. package/src/components/navigation/Footer/contracts.ts +17 -0
  53. package/src/components/navigation/SubNavigation/SubNavigation.css +0 -5
  54. package/src/composition/Grid/Grid.css +16 -0
  55. package/src/composition/SurfaceGroup/SurfaceGroup.css +21 -7
  56. package/src/composition/SurfaceGroup/stickySurfaceGroupController.ts +3 -0
  57. package/src/data/firestore/client/contracts.ts +78 -0
  58. package/src/data/firestore/client/firebase.ts +56 -0
  59. package/src/data/firestore/client/index.ts +3 -0
  60. package/src/data/firestore/client/repository.ts +111 -0
  61. package/src/display/contracts.ts +44 -1
  62. package/src/display/index.ts +1 -0
  63. package/src/display/tableProgressive.ts +62 -0
  64. package/src/layouts/BaseLayout.astro +8 -1
  65. package/src/patterns/Combobox/Combobox.astro +23 -0
  66. package/src/patterns/Combobox/comboboxController.ts +69 -0
  67. package/src/patterns/Fullscreen/FullscreenControl.astro +4 -14
  68. package/src/patterns/Fullscreen/FullscreenControl.css +0 -26
  69. package/src/patterns/Modal/Modal.astro +1 -1
  70. package/src/patterns/Modal/Modal.css +38 -1
  71. package/src/patterns/Table/Table.astro +122 -7
  72. package/src/patterns/Table/TableBody.astro +8 -0
  73. package/src/patterns/Table/TableBody.css +3 -3
  74. package/src/patterns/Table/TableCell.css +11 -1
  75. package/src/patterns/Table/TableCellValue.astro +31 -0
  76. package/src/patterns/Table/TableFooter.astro +3 -1
  77. package/src/patterns/Table/TableHeader.astro +1 -0
  78. package/src/patterns/Table/TablePagination.astro +63 -47
  79. package/src/patterns/Table/TableSkeleton.astro +18 -22
  80. package/src/patterns/Table/TableSkeleton.css +30 -5
  81. package/src/patterns/Table/tableClientController.ts +253 -0
  82. package/src/patterns/Table/tableFilterController.ts +23 -31
  83. package/src/patterns/Table/tableProgressiveController.ts +615 -227
  84. package/src/patterns/Table/tableSortController.ts +25 -7
  85. package/src/styles/base.css +24 -7
  86. package/src/styles/interaction.css +16 -0
  87. package/src/styles/style.css +3 -0
  88. package/src/styles/tokens.css +5 -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
  );
@@ -70,7 +70,20 @@ body {
70
70
  }
71
71
 
72
72
  a {
73
- color: inherit;
73
+ color: var(--nox-content-link-color);
74
+ font-weight: var(--nox-content-link-font-weight);
75
+ text-decoration: none;
76
+ text-decoration-thickness: 0.0625rem;
77
+ text-underline-offset: 0.2em;
78
+ }
79
+
80
+ a[data-tone] {
81
+ color: var(--nox-tone-color);
82
+ }
83
+
84
+ strong a,
85
+ a strong {
86
+ font-weight: var(--nox-content-link-emphasis-font-weight);
74
87
  }
75
88
 
76
89
  a:focus-visible,
@@ -83,6 +96,12 @@ button {
83
96
  font: inherit;
84
97
  }
85
98
 
99
+ @media (hover: hover) and (pointer: fine) {
100
+ a:where([href]:hover) {
101
+ text-decoration-line: underline;
102
+ }
103
+ }
104
+
86
105
  img,
87
106
  svg,
88
107
  video {
@@ -104,7 +123,6 @@ p {
104
123
  overflow-y: auto;
105
124
  background: var(--nox-page-background);
106
125
  overscroll-behavior-y: contain;
107
- scrollbar-gutter: stable both-edges;
108
126
  }
109
127
 
110
128
  .site-main {
@@ -113,18 +131,19 @@ p {
113
131
  display: grid;
114
132
  width: var(--nox-page-width);
115
133
  margin: 0 auto;
116
- padding-block: var(--site-main-content-gap) var(--nox-space-7);
117
- gap: var(--nox-layout-gap);
134
+ padding-block: var(--site-main-content-gap);
135
+ align-content: start;
118
136
  }
119
137
 
120
138
  .site-main__content {
121
139
  display: grid;
122
140
  min-width: 0;
141
+ align-content: start;
123
142
  gap: var(--site-main-content-gap);
124
143
  }
125
144
 
126
145
  .site-main:has(> .site-main__content > .breadcrumbs) {
127
- padding-block-start: 0;
146
+ padding-block: 0 var(--site-main-content-gap);
128
147
  }
129
148
 
130
149
  .site-main__content:has(> .breadcrumbs) {
@@ -134,8 +153,6 @@ p {
134
153
  @media (width < 48rem) {
135
154
  .site-main {
136
155
  --site-main-content-gap: var(--nox-space-4);
137
-
138
- padding-block-end: var(--nox-space-6);
139
156
  }
140
157
  }
141
158
 
@@ -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);
@@ -58,6 +60,7 @@
58
60
  @import '../components/navigation/Breadcrumbs/Breadcrumbs.css'
59
61
  layer(components);
60
62
  @import '../components/navigation/Header.css' layer(components);
63
+ @import '../components/navigation/Footer/Footer.css' layer(components);
61
64
  @import '../components/navigation/NavigationBrand.css' layer(components);
62
65
  @import '../components/navigation/NavigationControl.css' layer(components);
63
66
  @import '../components/navigation/NavigationMenuList.css' layer(components);
@@ -9,6 +9,11 @@
9
9
  --nox-source-tone-warning: #d97706;
10
10
  --nox-source-tone-danger: #dc2626;
11
11
 
12
+ /* Shared textual-link recipe. */
13
+ --nox-content-link-color: var(--nox-source-tone-info);
14
+ --nox-content-link-font-weight: var(--nox-font-weight-regular);
15
+ --nox-content-link-emphasis-font-weight: var(--nox-font-weight-medium);
16
+
12
17
  /* Public map seeds. Component states derive their full treatment from these. */
13
18
  --nox-source-map-available: #00b86b;
14
19
  --nox-source-map-unavailable: #f43f5e;