@astronox/core 0.2.0 → 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.
- package/README.md +9 -30
- package/package.json +7 -1
- package/src/admin/contracts.ts +28 -0
- package/src/admin/index.ts +2 -0
- package/src/admin/module.ts +28 -0
- package/src/auth/contracts.ts +53 -0
- package/src/auth/firebase/client.ts +53 -0
- package/src/auth/firebase/contracts.ts +8 -0
- package/src/auth/firebase/index.ts +1 -0
- package/src/auth/index.ts +2 -0
- package/src/auth/module.ts +99 -0
- package/src/client/index.ts +3 -0
- package/src/client/preferences.ts +400 -0
- package/src/components/actions/Button/Button.astro +42 -6
- package/src/components/actions/Button/Button.css +19 -0
- package/src/components/actions/IdentityProviderAction/IdentityProviderAction.astro +35 -0
- package/src/components/actions/MediaTrigger/MediaTrigger.astro +12 -4
- package/src/components/actions/MediaTrigger/MediaTrigger.css +1 -0
- package/src/components/content/CardBody/CardBody.astro +3 -0
- package/src/components/content/CardBody/CardBody.css +10 -0
- package/src/components/content/MarkdownContent/MarkdownContent.css +0 -1
- package/src/components/content/MarkdownContent/MarkdownNode.astro +1 -0
- package/src/components/content/MarkdownContent/markdownContentRenderer.ts +549 -0
- package/src/components/feedback/PreferenceBootstrap/PreferenceBootstrap.astro +403 -0
- package/src/components/forms/Checkbox/Checkbox.astro +66 -0
- package/src/components/forms/Checkbox/Checkbox.css +126 -0
- package/src/components/forms/ChoiceGroup/ChoiceGroup.astro +57 -0
- package/src/components/forms/ChoiceGroup/ChoiceGroup.css +108 -0
- package/src/components/forms/ChoiceGroup/contracts.ts +9 -0
- package/src/components/forms/DateTimeInput/DateTimeInput.astro +14 -0
- package/src/components/forms/FieldGroup/FieldGroup.astro +34 -0
- package/src/components/forms/FieldGroup/FieldGroup.css +30 -0
- package/src/components/forms/TextInput/TextInput.astro +7 -1
- package/src/components/forms/Textarea/Textarea.astro +32 -0
- package/src/components/forms/Textarea/Textarea.css +54 -0
- package/src/components/icons/BackIcon.astro +26 -0
- package/src/components/icons/CheckIcon.astro +22 -0
- package/src/components/icons/DeleteIcon.astro +22 -0
- package/src/components/icons/StatusIndicatorIcon.astro +16 -0
- package/src/components/index.ts +12 -0
- package/src/components/media/CanvasFrame/CanvasFrame.astro +1 -17
- package/src/components/media/EmbedFrame/EmbedFrame.astro +1 -19
- package/src/components/media/EmbedFrame/EmbedFrame.css +0 -2
- package/src/components/navigation/SubNavigation/SubNavigation.css +0 -5
- package/src/composition/Grid/Grid.astro +9 -0
- package/src/composition/Grid/Grid.css +52 -0
- package/src/composition/GridItem/GridItem.astro +9 -0
- package/src/composition/GridItem/GridItem.css +12 -0
- package/src/composition/SurfaceGroup/SurfaceGroup.css +21 -7
- package/src/composition/SurfaceGroup/stickySurfaceGroupController.ts +3 -0
- package/src/data/firestore/client/contracts.ts +55 -0
- package/src/data/firestore/client/firebase.ts +12 -0
- package/src/data/firestore/client/index.ts +3 -0
- package/src/data/firestore/client/repository.ts +111 -0
- package/src/display/contracts.ts +41 -0
- package/src/display/index.ts +1 -0
- package/src/display/tableProgressive.ts +62 -0
- package/src/patterns/Combobox/Combobox.astro +23 -0
- package/src/patterns/Combobox/comboboxController.ts +72 -0
- package/src/patterns/Fullscreen/FullscreenControl.astro +4 -14
- package/src/patterns/Fullscreen/FullscreenControl.css +0 -26
- package/src/patterns/Modal/Modal.astro +1 -1
- package/src/patterns/Modal/Modal.css +38 -1
- package/src/patterns/Table/Table.astro +122 -7
- package/src/patterns/Table/Table.css +2 -1
- package/src/patterns/Table/TableBody.astro +11 -1
- package/src/patterns/Table/TableBody.css +6 -0
- package/src/patterns/Table/TableCell.css +6 -0
- package/src/patterns/Table/TableCellValue.astro +31 -0
- package/src/patterns/Table/TableFooter.astro +3 -1
- package/src/patterns/Table/TableHeader.astro +1 -0
- package/src/patterns/Table/TablePagination.astro +63 -47
- package/src/patterns/Table/TableSkeleton.astro +18 -22
- package/src/patterns/Table/TableSkeleton.css +30 -5
- package/src/patterns/Table/tableClientController.ts +253 -0
- package/src/patterns/Table/tableFilterController.ts +83 -33
- package/src/patterns/Table/tableLayout.ts +10 -3
- package/src/patterns/Table/tableProgressiveController.ts +615 -227
- package/src/patterns/Table/tableSortController.ts +25 -7
- package/src/styles/interaction.css +16 -0
- package/src/styles/style.css +4 -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:
|
|
155
|
+
direction: firstDirection,
|
|
143
156
|
tieBreaker: button.dataset.tableSortTieBreaker,
|
|
144
157
|
};
|
|
145
|
-
|
|
146
|
-
|
|
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);
|
package/src/styles/style.css
CHANGED
|
@@ -41,9 +41,13 @@
|
|
|
41
41
|
@import '../components/data-display/Tag/Tag.css' layer(components);
|
|
42
42
|
@import '../components/data-display/TextPair/TextPair.css'
|
|
43
43
|
layer(components);
|
|
44
|
+
@import '../components/forms/Checkbox/Checkbox.css' layer(components);
|
|
45
|
+
@import '../components/forms/ChoiceGroup/ChoiceGroup.css' layer(components);
|
|
44
46
|
@import '../components/forms/FieldLabel/FieldLabel.css' layer(components);
|
|
45
47
|
@import '../components/forms/FieldError/FieldError.css' layer(components);
|
|
48
|
+
@import '../components/forms/FieldGroup/FieldGroup.css' layer(components);
|
|
46
49
|
@import '../components/forms/TextInput/TextInput.css' layer(components);
|
|
50
|
+
@import '../components/forms/Textarea/Textarea.css' layer(components);
|
|
47
51
|
@import '../components/feedback/Tooltip/Tooltip.css' layer(components);
|
|
48
52
|
@import '../components/feedback/Spinner/Spinner.css' layer(components);
|
|
49
53
|
@import '../components/icons/CurrencyIcon.css' layer(components);
|