nexus-shared 3.1.0 → 3.2.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.
- package/CHANGELOG.md +704 -446
- package/LICENSE +21 -21
- package/README.md +44 -5
- package/dist/Client.Index.d.ts +3 -0
- package/dist/Client.Index.js +3 -0
- package/dist/Components/Forms/Crud.js +322 -161
- package/dist/Components/Forms/CrudHistory.d.ts +66 -0
- package/dist/Components/Forms/CrudHistory.js +140 -0
- package/dist/Components/Forms/CrudParts.js +2 -1
- package/dist/Components/Forms/Form.js +4 -1
- package/dist/Components/Inputs/CodeBox.d.ts +69 -0
- package/dist/Components/Inputs/CodeBox.js +316 -0
- package/dist/Components/Inputs/DatePicker.js +4 -1
- package/dist/Components/Inputs/DateRangePicker.js +4 -1
- package/dist/Components/Inputs/DateTimePicker.js +4 -1
- package/dist/Components/Inputs/Dropdown.js +4 -1
- package/dist/Components/Inputs/InputRenderer.js +3 -0
- package/dist/Components/Inputs/NumberBox.js +4 -2
- package/dist/Components/Inputs/TextArea.js +4 -1
- package/dist/Components/Inputs/TextBox.js +4 -1
- package/dist/Components/Inputs/TimePicker.js +4 -1
- package/dist/Components/Inputs/TreeView.d.ts +55 -5
- package/dist/Components/Inputs/TreeView.js +372 -23
- package/dist/Components/Layouts/ThemePicker.d.ts +3 -2
- package/dist/Components/Layouts/ThemePicker.js +16 -4
- package/dist/Components/Viewers/DataTable.js +63 -21
- package/dist/Components/Viewers/DataTableParts.d.ts +26 -8
- package/dist/Components/Viewers/DataTableParts.js +39 -10
- package/dist/Helpers/ApiModules.d.ts +3 -34
- package/dist/Helpers/ApiModules.js +3 -3
- package/dist/Helpers/ApiRoutes.d.ts +68 -26
- package/dist/Helpers/ApiRoutes.js +31 -27
- package/dist/Helpers/ArrayHelpers.d.ts +0 -0
- package/dist/Helpers/ArrayHelpers.js +2 -0
- package/dist/Helpers/CodeHelpers.d.ts +97 -0
- package/dist/Helpers/CodeHelpers.js +332 -0
- package/dist/Helpers/CrudBackend.d.ts +94 -4
- package/dist/Helpers/CrudBackend.js +168 -9
- package/dist/Helpers/CrudColumns.d.ts +51 -0
- package/dist/Helpers/CrudColumns.js +69 -0
- package/dist/Helpers/CrudHelpers.d.ts +50 -5
- package/dist/Helpers/CrudHelpers.js +109 -12
- package/dist/Helpers/InputParamsHelpers.js +8 -0
- package/dist/Helpers/MessageBuilder.js +2 -0
- package/dist/Helpers/NexusHelpers.d.ts +0 -0
- package/dist/Helpers/NexusHelpers.js +1 -0
- package/dist/Helpers/RequestCache.d.ts +35 -0
- package/dist/Helpers/RequestCache.js +113 -0
- package/dist/Helpers/TableExport.js +12 -12
- package/dist/Helpers/TableHelpers.d.ts +1 -1
- package/dist/Helpers/TableHelpers.js +7 -2
- package/dist/Helpers/TableJoins.d.ts +70 -0
- package/dist/Helpers/TableJoins.js +250 -0
- package/dist/Helpers/TableStore.d.ts +5 -0
- package/dist/Helpers/TableStore.js +9 -0
- package/dist/Helpers/TreeStore.d.ts +225 -11
- package/dist/Helpers/TreeStore.js +683 -90
- package/dist/Helpers/UserPreferences.d.ts +8 -0
- package/dist/Helpers/UserPreferences.js +17 -0
- package/dist/Interfaces/CrudInterfaces.d.ts +47 -9
- package/dist/Interfaces/FormInterfaces.d.ts +4 -1
- package/dist/Interfaces/InputInterfaces.d.ts +24 -0
- package/dist/Interfaces/MessageInterfaces.d.ts +1 -1
- package/dist/Interfaces/PreferenceInterfaces.d.ts +8 -0
- package/dist/Interfaces/PreferenceInterfaces.js +2 -5
- package/dist/Interfaces/TableInterfaces.d.ts +86 -4
- package/dist/Services/ApiProxy.d.ts +36 -1
- package/dist/Services/ApiProxy.js +182 -52
- package/dist/Services/ApiProxyRules.d.ts +203 -0
- package/dist/Services/ApiProxyRules.js +426 -0
- package/dist/Services/JoinSources.d.ts +48 -0
- package/dist/Services/JoinSources.js +74 -0
- package/dist/Services/ServerApi.d.ts +13 -2
- package/dist/Services/ServerApi.js +8 -3
- package/dist/Shared.Index.d.ts +4 -0
- package/dist/Shared.Index.js +4 -0
- package/package.json +87 -85
- package/src/Styles/Nexus.Avatar.css +79 -79
- package/src/Styles/Nexus.Base.css +117 -117
- package/src/Styles/Nexus.Button.css +180 -180
- package/src/Styles/Nexus.Calendar.css +273 -273
- package/src/Styles/Nexus.Chat.css +1443 -1443
- package/src/Styles/Nexus.Choice.css +343 -343
- package/src/Styles/Nexus.Crud.css +168 -168
- package/src/Styles/Nexus.DateTime.css +81 -81
- package/src/Styles/Nexus.Dropdown.css +725 -725
- package/src/Styles/Nexus.Editor.css +295 -295
- package/src/Styles/Nexus.Excel.css +389 -389
- package/src/Styles/Nexus.Form.css +279 -279
- package/src/Styles/Nexus.Index.css +37 -37
- package/src/Styles/Nexus.Input.css +196 -4
- package/src/Styles/Nexus.Markdown.css +237 -237
- package/src/Styles/Nexus.Menu.css +237 -237
- package/src/Styles/Nexus.Popup.css +724 -724
- package/src/Styles/Nexus.Rows.css +637 -637
- package/src/Styles/Nexus.Slider.css +276 -276
- package/src/Styles/Nexus.Tab.Buttons.css +432 -432
- package/src/Styles/Nexus.Table.css +31 -30
- package/src/Styles/Nexus.Theme.Picker.css +59 -3
- package/src/Styles/Nexus.Themes.css +194 -194
- package/src/Styles/Nexus.Time.css +144 -144
- package/src/Styles/Nexus.Toast.css +263 -263
- package/src/Styles/Nexus.Tokens.css +89 -89
- package/src/Styles/Nexus.Tree.css +500 -431
package/package.json
CHANGED
|
@@ -1,85 +1,87 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "nexus-shared",
|
|
3
|
-
"version": "3.
|
|
4
|
-
"description": "The Nexus component library for React and Next.js: params-driven inputs and forms, a data table with a CRUD on top, popups and toasts, an API layer with permissions, Markdown and rich text editors, and 7 themes in light and dark.",
|
|
5
|
-
"keywords": [
|
|
6
|
-
"react",
|
|
7
|
-
"nextjs",
|
|
8
|
-
"components",
|
|
9
|
-
"ui",
|
|
10
|
-
"forms",
|
|
11
|
-
"datatable",
|
|
12
|
-
"crud",
|
|
13
|
-
"inputs",
|
|
14
|
-
"design-system",
|
|
15
|
-
"typescript",
|
|
16
|
-
"nepali-calendar",
|
|
17
|
-
"nexus"
|
|
18
|
-
],
|
|
19
|
-
"license": "MIT",
|
|
20
|
-
"author": "Bijay Adhikari",
|
|
21
|
-
"type": "module",
|
|
22
|
-
"sideEffects": [
|
|
23
|
-
"*.css"
|
|
24
|
-
],
|
|
25
|
-
"exports": {
|
|
26
|
-
".": {
|
|
27
|
-
"types": "./dist/Shared.Index.d.ts",
|
|
28
|
-
"default": "./dist/Shared.Index.js"
|
|
29
|
-
},
|
|
30
|
-
"./client": {
|
|
31
|
-
"types": "./dist/Client.Index.d.ts",
|
|
32
|
-
"default": "./dist/Client.Index.js"
|
|
33
|
-
},
|
|
34
|
-
"./server": {
|
|
35
|
-
"types": "./dist/Server.Index.d.ts",
|
|
36
|
-
"default": "./dist/Server.Index.js"
|
|
37
|
-
},
|
|
38
|
-
"./styles.css": "./src/Styles/Nexus.Index.css",
|
|
39
|
-
"./package.json": "./package.json"
|
|
40
|
-
},
|
|
41
|
-
"files": [
|
|
42
|
-
"dist",
|
|
43
|
-
"src/Styles",
|
|
44
|
-
"CHANGELOG.md"
|
|
45
|
-
],
|
|
46
|
-
"scripts": {
|
|
47
|
-
"build": "tsc -p tsconfig.build.json",
|
|
48
|
-
"typecheck": "tsc -p tsconfig.json",
|
|
49
|
-
"test": "node scripts/test-all.mjs",
|
|
50
|
-
"check:themes": "node scripts/check-themes.mjs",
|
|
51
|
-
"test:api": "node scripts/test-api.mts",
|
|
52
|
-
"test:
|
|
53
|
-
"test:
|
|
54
|
-
"test:
|
|
55
|
-
"test:
|
|
56
|
-
"test:
|
|
57
|
-
"test:
|
|
58
|
-
"test:
|
|
59
|
-
"test:
|
|
60
|
-
"test:
|
|
61
|
-
"test:
|
|
62
|
-
"test:
|
|
63
|
-
"test:
|
|
64
|
-
"test:
|
|
65
|
-
"test:
|
|
66
|
-
"test:
|
|
67
|
-
"test:
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "nexus-shared",
|
|
3
|
+
"version": "3.2.0",
|
|
4
|
+
"description": "The Nexus component library for React and Next.js: params-driven inputs and forms, a data table with a CRUD on top, popups and toasts, an API layer with permissions, Markdown and rich text editors, and 7 themes in light and dark.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"react",
|
|
7
|
+
"nextjs",
|
|
8
|
+
"components",
|
|
9
|
+
"ui",
|
|
10
|
+
"forms",
|
|
11
|
+
"datatable",
|
|
12
|
+
"crud",
|
|
13
|
+
"inputs",
|
|
14
|
+
"design-system",
|
|
15
|
+
"typescript",
|
|
16
|
+
"nepali-calendar",
|
|
17
|
+
"nexus"
|
|
18
|
+
],
|
|
19
|
+
"license": "MIT",
|
|
20
|
+
"author": "Bijay Adhikari",
|
|
21
|
+
"type": "module",
|
|
22
|
+
"sideEffects": [
|
|
23
|
+
"*.css"
|
|
24
|
+
],
|
|
25
|
+
"exports": {
|
|
26
|
+
".": {
|
|
27
|
+
"types": "./dist/Shared.Index.d.ts",
|
|
28
|
+
"default": "./dist/Shared.Index.js"
|
|
29
|
+
},
|
|
30
|
+
"./client": {
|
|
31
|
+
"types": "./dist/Client.Index.d.ts",
|
|
32
|
+
"default": "./dist/Client.Index.js"
|
|
33
|
+
},
|
|
34
|
+
"./server": {
|
|
35
|
+
"types": "./dist/Server.Index.d.ts",
|
|
36
|
+
"default": "./dist/Server.Index.js"
|
|
37
|
+
},
|
|
38
|
+
"./styles.css": "./src/Styles/Nexus.Index.css",
|
|
39
|
+
"./package.json": "./package.json"
|
|
40
|
+
},
|
|
41
|
+
"files": [
|
|
42
|
+
"dist",
|
|
43
|
+
"src/Styles",
|
|
44
|
+
"CHANGELOG.md"
|
|
45
|
+
],
|
|
46
|
+
"scripts": {
|
|
47
|
+
"build": "tsc -p tsconfig.build.json",
|
|
48
|
+
"typecheck": "tsc -p tsconfig.json",
|
|
49
|
+
"test": "node scripts/test-all.mjs",
|
|
50
|
+
"check:themes": "node scripts/check-themes.mjs",
|
|
51
|
+
"test:api": "node scripts/test-api.mts",
|
|
52
|
+
"test:proxy": "node scripts/test-api-proxy.mts",
|
|
53
|
+
"test:chat": "node scripts/test-chat.mts",
|
|
54
|
+
"test:codes": "node scripts/test-code-helpers.mts",
|
|
55
|
+
"test:dates": "node scripts/test-date-helpers.mts",
|
|
56
|
+
"test:datetimes": "node scripts/test-datetime-helpers.mts",
|
|
57
|
+
"test:drag": "node scripts/test-drag-helpers.mts",
|
|
58
|
+
"test:excel": "node scripts/test-excel.mts",
|
|
59
|
+
"test:dropdown": "node scripts/test-dropdown-helpers.mts",
|
|
60
|
+
"test:forms": "node scripts/test-form-store.mts",
|
|
61
|
+
"test:markdown": "node scripts/test-markdown.mts",
|
|
62
|
+
"test:numbers": "node scripts/test-number-helpers.mts",
|
|
63
|
+
"test:popups": "node scripts/test-popup-rules.mts",
|
|
64
|
+
"test:richtext": "node scripts/test-richtext.mts",
|
|
65
|
+
"test:rows": "node scripts/test-rows-store.mts",
|
|
66
|
+
"test:table": "node scripts/test-table.mts",
|
|
67
|
+
"test:times": "node scripts/test-time-helpers.mts",
|
|
68
|
+
"test:tree": "node scripts/test-tree-store.mts",
|
|
69
|
+
"test:types": "tsc -p scripts/type-checks/tsconfig.json"
|
|
70
|
+
},
|
|
71
|
+
"dependencies": {
|
|
72
|
+
"nexus-icons": "^1.2.0"
|
|
73
|
+
},
|
|
74
|
+
"peerDependencies": {
|
|
75
|
+
"react": ">=19",
|
|
76
|
+
"react-dom": ">=19"
|
|
77
|
+
},
|
|
78
|
+
"devDependencies": {
|
|
79
|
+
"@types/react": "19.3.0"
|
|
80
|
+
},
|
|
81
|
+
"engines": {
|
|
82
|
+
"node": ">=20.9"
|
|
83
|
+
},
|
|
84
|
+
"publishConfig": {
|
|
85
|
+
"access": "public"
|
|
86
|
+
}
|
|
87
|
+
}
|
|
@@ -1,79 +1,79 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* A person's avatar, wherever one is drawn: the chat, a dropdown's avatar column, the admin bar.
|
|
3
|
-
*/
|
|
4
|
-
@layer nexus.components {
|
|
5
|
-
.nx-avatar {
|
|
6
|
-
position: relative;
|
|
7
|
-
display: inline-grid;
|
|
8
|
-
flex-shrink: 0;
|
|
9
|
-
place-items: center;
|
|
10
|
-
width: var(--nx-avatar-size, 28px);
|
|
11
|
-
height: var(--nx-avatar-size, 28px);
|
|
12
|
-
padding: 0;
|
|
13
|
-
overflow: hidden;
|
|
14
|
-
border: 0;
|
|
15
|
-
border-radius: 50%;
|
|
16
|
-
background: color-mix(in oklab, var(--nx-text) 10%, var(--nx-surface));
|
|
17
|
-
color: var(--nx-text);
|
|
18
|
-
font: inherit;
|
|
19
|
-
font-size: max(8px, calc(var(--nx-avatar-size, 28px) * 0.4));
|
|
20
|
-
font-weight: 600;
|
|
21
|
-
line-height: 1;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.nx-avatar--sm {
|
|
25
|
-
--nx-avatar-size: 22px;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.nx-avatar--lg {
|
|
29
|
-
--nx-avatar-size: 44px;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.nx-avatar[data-tone="primary"] {
|
|
33
|
-
background: var(--nx-primary-soft);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.nx-avatar[data-tone="info"] {
|
|
37
|
-
background: var(--nx-info-soft);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.nx-avatar[data-tone="success"] {
|
|
41
|
-
background: var(--nx-success-soft);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.nx-avatar[data-tone="warning"] {
|
|
45
|
-
background: var(--nx-warning-soft);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.nx-avatar img {
|
|
49
|
-
position: absolute;
|
|
50
|
-
inset: 0;
|
|
51
|
-
width: 100%;
|
|
52
|
-
height: 100%;
|
|
53
|
-
object-fit: cover;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
/* A picture that can be changed: hovering or focusing it lays a camera over it. Opacity alone, no animation. */
|
|
57
|
-
button.nx-avatar {
|
|
58
|
-
cursor: pointer;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
button.nx-avatar:focus-visible {
|
|
62
|
-
outline: none;
|
|
63
|
-
box-shadow: var(--nx-focus-ring);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.nx-avatar__veil {
|
|
67
|
-
position: absolute;
|
|
68
|
-
inset: 0;
|
|
69
|
-
display: grid;
|
|
70
|
-
place-items: center;
|
|
71
|
-
background: rgb(16 24 40 / 0.55);
|
|
72
|
-
color: #fff;
|
|
73
|
-
opacity: 0;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
button.nx-avatar:is(:hover, :focus-visible) .nx-avatar__veil {
|
|
77
|
-
opacity: 1;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
1
|
+
/*
|
|
2
|
+
* A person's avatar, wherever one is drawn: the chat, a dropdown's avatar column, the admin bar.
|
|
3
|
+
*/
|
|
4
|
+
@layer nexus.components {
|
|
5
|
+
.nx-avatar {
|
|
6
|
+
position: relative;
|
|
7
|
+
display: inline-grid;
|
|
8
|
+
flex-shrink: 0;
|
|
9
|
+
place-items: center;
|
|
10
|
+
width: var(--nx-avatar-size, 28px);
|
|
11
|
+
height: var(--nx-avatar-size, 28px);
|
|
12
|
+
padding: 0;
|
|
13
|
+
overflow: hidden;
|
|
14
|
+
border: 0;
|
|
15
|
+
border-radius: 50%;
|
|
16
|
+
background: color-mix(in oklab, var(--nx-text) 10%, var(--nx-surface));
|
|
17
|
+
color: var(--nx-text);
|
|
18
|
+
font: inherit;
|
|
19
|
+
font-size: max(8px, calc(var(--nx-avatar-size, 28px) * 0.4));
|
|
20
|
+
font-weight: 600;
|
|
21
|
+
line-height: 1;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.nx-avatar--sm {
|
|
25
|
+
--nx-avatar-size: 22px;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.nx-avatar--lg {
|
|
29
|
+
--nx-avatar-size: 44px;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.nx-avatar[data-tone="primary"] {
|
|
33
|
+
background: var(--nx-primary-soft);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.nx-avatar[data-tone="info"] {
|
|
37
|
+
background: var(--nx-info-soft);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.nx-avatar[data-tone="success"] {
|
|
41
|
+
background: var(--nx-success-soft);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.nx-avatar[data-tone="warning"] {
|
|
45
|
+
background: var(--nx-warning-soft);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.nx-avatar img {
|
|
49
|
+
position: absolute;
|
|
50
|
+
inset: 0;
|
|
51
|
+
width: 100%;
|
|
52
|
+
height: 100%;
|
|
53
|
+
object-fit: cover;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/* A picture that can be changed: hovering or focusing it lays a camera over it. Opacity alone, no animation. */
|
|
57
|
+
button.nx-avatar {
|
|
58
|
+
cursor: pointer;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
button.nx-avatar:focus-visible {
|
|
62
|
+
outline: none;
|
|
63
|
+
box-shadow: var(--nx-focus-ring);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.nx-avatar__veil {
|
|
67
|
+
position: absolute;
|
|
68
|
+
inset: 0;
|
|
69
|
+
display: grid;
|
|
70
|
+
place-items: center;
|
|
71
|
+
background: rgb(16 24 40 / 0.55);
|
|
72
|
+
color: #fff;
|
|
73
|
+
opacity: 0;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
button.nx-avatar:is(:hover, :focus-visible) .nx-avatar__veil {
|
|
77
|
+
opacity: 1;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -1,117 +1,117 @@
|
|
|
1
|
-
/* Page defaults and small shared utilities. */
|
|
2
|
-
@layer nexus.base {
|
|
3
|
-
*,
|
|
4
|
-
*::before,
|
|
5
|
-
*::after {
|
|
6
|
-
box-sizing: border-box;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
body {
|
|
10
|
-
margin: 0;
|
|
11
|
-
background: var(--nx-bg);
|
|
12
|
-
color: var(--nx-text);
|
|
13
|
-
font: var(--nx-text-md) / var(--nx-leading) var(--nx-font);
|
|
14
|
-
-webkit-font-smoothing: antialiased;
|
|
15
|
-
text-rendering: optimizeLegibility;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
button,
|
|
19
|
-
input,
|
|
20
|
-
select,
|
|
21
|
-
textarea {
|
|
22
|
-
font: inherit;
|
|
23
|
-
color: inherit;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/* Nepali text takes a font that has Devanagari glyphs, digits included. */
|
|
27
|
-
:lang(ne) {
|
|
28
|
-
font-family: var(--nx-font-devanagari);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
:focus-visible {
|
|
32
|
-
outline: 2px solid var(--nx-primary);
|
|
33
|
-
outline-offset: 2px;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/*
|
|
37
|
-
* One scroll bar for every scroller, the design lab's: thin and quiet, a thumb of the text colour at 22% on no
|
|
38
|
-
* track. On Windows, Chrome and Edge draw it 10px wide with small arrows and darken the thumb under the pointer
|
|
39
|
-
* themselves, and Firefox's thin bar is 8px; Safari, which has no `scrollbar-color` yet, draws its own thin bar.
|
|
40
|
-
* `scrollbar-width` is not inherited, so it is set on every element, and a gutter kept with `scrollbar-gutter` is as
|
|
41
|
-
* wide as the bar it waits for. There is no `::-webkit-scrollbar` here because Chrome, Edge and Safari ignore it on an
|
|
42
|
-
* element that sets `scrollbar-width`. A component that needs another look sets the two properties on its own
|
|
43
|
-
* scroller. With forced colours the browser puts the system's colours back.
|
|
44
|
-
*/
|
|
45
|
-
* {
|
|
46
|
-
scrollbar-width: thin;
|
|
47
|
-
scrollbar-color: color-mix(in oklab, var(--nx-text) 22%, transparent) transparent;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/* Hidden on screen but still read by screen readers and reachable with the keyboard. */
|
|
51
|
-
.nx-visually-hidden {
|
|
52
|
-
position: absolute;
|
|
53
|
-
width: 1px;
|
|
54
|
-
height: 1px;
|
|
55
|
-
margin: -1px;
|
|
56
|
-
padding: 0;
|
|
57
|
-
overflow: hidden;
|
|
58
|
-
clip-path: inset(50%);
|
|
59
|
-
white-space: nowrap;
|
|
60
|
-
border: 0;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
/* Icons sit on the text baseline and never shrink inside flex rows. */
|
|
64
|
-
.nx-icon {
|
|
65
|
-
flex-shrink: 0;
|
|
66
|
-
vertical-align: -0.125em;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
.nx-spin {
|
|
70
|
-
animation: nx-spin 0.8s linear infinite;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
@keyframes nx-spin {
|
|
74
|
-
to {
|
|
75
|
-
transform: rotate(360deg);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
/* A spinner says something is still happening, so with animations off it turns slowly rather than stopping. */
|
|
80
|
-
[data-nx-motion="reduce"] .nx-spin {
|
|
81
|
-
animation-duration: 2.4s;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
/*
|
|
85
|
-
* The scale grid, a development tool from the theme panel: a ruled sheet over the whole window, so an edge one pixel
|
|
86
|
-
* out is seen rather than argued about. `px` rules every 4px with a solid line every 48px; `cm` rules millimetres
|
|
87
|
-
* with the centimetre solid. Lines start on the window's edge, so every reading counts from there. It takes no
|
|
88
|
-
* clicks and moves nothing; popups and menus sit in the top layer, above it. ThemeScript sets it in a development
|
|
89
|
-
* build only. The lines mix the text colour, so they read on all seven themes in both modes.
|
|
90
|
-
*/
|
|
91
|
-
[data-nx-grid] body::after {
|
|
92
|
-
--nx-grid-minor: color-mix(in oklab, var(--nx-text) 14%, transparent);
|
|
93
|
-
--nx-grid-major: color-mix(in oklab, var(--nx-text) 34%, transparent);
|
|
94
|
-
|
|
95
|
-
position: fixed;
|
|
96
|
-
inset: 0;
|
|
97
|
-
z-index: 2147483000;
|
|
98
|
-
pointer-events: none;
|
|
99
|
-
content: "";
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
[data-nx-grid="px"] body::after {
|
|
103
|
-
background-image:
|
|
104
|
-
repeating-linear-gradient(to right, var(--nx-grid-major) 0 1px, transparent 1px 48px),
|
|
105
|
-
repeating-linear-gradient(to bottom, var(--nx-grid-major) 0 1px, transparent 1px 48px),
|
|
106
|
-
repeating-linear-gradient(to right, var(--nx-grid-minor) 0 1px, transparent 1px 4px),
|
|
107
|
-
repeating-linear-gradient(to bottom, var(--nx-grid-minor) 0 1px, transparent 1px 4px);
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
[data-nx-grid="cm"] body::after {
|
|
111
|
-
background-image:
|
|
112
|
-
repeating-linear-gradient(to right, var(--nx-grid-major) 0 1px, transparent 1px 1cm),
|
|
113
|
-
repeating-linear-gradient(to bottom, var(--nx-grid-major) 0 1px, transparent 1px 1cm),
|
|
114
|
-
repeating-linear-gradient(to right, var(--nx-grid-minor) 0 1px, transparent 1px 1mm),
|
|
115
|
-
repeating-linear-gradient(to bottom, var(--nx-grid-minor) 0 1px, transparent 1px 1mm);
|
|
116
|
-
}
|
|
117
|
-
}
|
|
1
|
+
/* Page defaults and small shared utilities. */
|
|
2
|
+
@layer nexus.base {
|
|
3
|
+
*,
|
|
4
|
+
*::before,
|
|
5
|
+
*::after {
|
|
6
|
+
box-sizing: border-box;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
body {
|
|
10
|
+
margin: 0;
|
|
11
|
+
background: var(--nx-bg);
|
|
12
|
+
color: var(--nx-text);
|
|
13
|
+
font: var(--nx-text-md) / var(--nx-leading) var(--nx-font);
|
|
14
|
+
-webkit-font-smoothing: antialiased;
|
|
15
|
+
text-rendering: optimizeLegibility;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
button,
|
|
19
|
+
input,
|
|
20
|
+
select,
|
|
21
|
+
textarea {
|
|
22
|
+
font: inherit;
|
|
23
|
+
color: inherit;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/* Nepali text takes a font that has Devanagari glyphs, digits included. */
|
|
27
|
+
:lang(ne) {
|
|
28
|
+
font-family: var(--nx-font-devanagari);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
:focus-visible {
|
|
32
|
+
outline: 2px solid var(--nx-primary);
|
|
33
|
+
outline-offset: 2px;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/*
|
|
37
|
+
* One scroll bar for every scroller, the design lab's: thin and quiet, a thumb of the text colour at 22% on no
|
|
38
|
+
* track. On Windows, Chrome and Edge draw it 10px wide with small arrows and darken the thumb under the pointer
|
|
39
|
+
* themselves, and Firefox's thin bar is 8px; Safari, which has no `scrollbar-color` yet, draws its own thin bar.
|
|
40
|
+
* `scrollbar-width` is not inherited, so it is set on every element, and a gutter kept with `scrollbar-gutter` is as
|
|
41
|
+
* wide as the bar it waits for. There is no `::-webkit-scrollbar` here because Chrome, Edge and Safari ignore it on an
|
|
42
|
+
* element that sets `scrollbar-width`. A component that needs another look sets the two properties on its own
|
|
43
|
+
* scroller. With forced colours the browser puts the system's colours back.
|
|
44
|
+
*/
|
|
45
|
+
* {
|
|
46
|
+
scrollbar-width: thin;
|
|
47
|
+
scrollbar-color: color-mix(in oklab, var(--nx-text) 22%, transparent) transparent;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/* Hidden on screen but still read by screen readers and reachable with the keyboard. */
|
|
51
|
+
.nx-visually-hidden {
|
|
52
|
+
position: absolute;
|
|
53
|
+
width: 1px;
|
|
54
|
+
height: 1px;
|
|
55
|
+
margin: -1px;
|
|
56
|
+
padding: 0;
|
|
57
|
+
overflow: hidden;
|
|
58
|
+
clip-path: inset(50%);
|
|
59
|
+
white-space: nowrap;
|
|
60
|
+
border: 0;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/* Icons sit on the text baseline and never shrink inside flex rows. */
|
|
64
|
+
.nx-icon {
|
|
65
|
+
flex-shrink: 0;
|
|
66
|
+
vertical-align: -0.125em;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.nx-spin {
|
|
70
|
+
animation: nx-spin 0.8s linear infinite;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
@keyframes nx-spin {
|
|
74
|
+
to {
|
|
75
|
+
transform: rotate(360deg);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/* A spinner says something is still happening, so with animations off it turns slowly rather than stopping. */
|
|
80
|
+
[data-nx-motion="reduce"] .nx-spin {
|
|
81
|
+
animation-duration: 2.4s;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/*
|
|
85
|
+
* The scale grid, a development tool from the theme panel: a ruled sheet over the whole window, so an edge one pixel
|
|
86
|
+
* out is seen rather than argued about. `px` rules every 4px with a solid line every 48px; `cm` rules millimetres
|
|
87
|
+
* with the centimetre solid. Lines start on the window's edge, so every reading counts from there. It takes no
|
|
88
|
+
* clicks and moves nothing; popups and menus sit in the top layer, above it. ThemeScript sets it in a development
|
|
89
|
+
* build only. The lines mix the text colour, so they read on all seven themes in both modes.
|
|
90
|
+
*/
|
|
91
|
+
[data-nx-grid] body::after {
|
|
92
|
+
--nx-grid-minor: color-mix(in oklab, var(--nx-text) 14%, transparent);
|
|
93
|
+
--nx-grid-major: color-mix(in oklab, var(--nx-text) 34%, transparent);
|
|
94
|
+
|
|
95
|
+
position: fixed;
|
|
96
|
+
inset: 0;
|
|
97
|
+
z-index: 2147483000;
|
|
98
|
+
pointer-events: none;
|
|
99
|
+
content: "";
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
[data-nx-grid="px"] body::after {
|
|
103
|
+
background-image:
|
|
104
|
+
repeating-linear-gradient(to right, var(--nx-grid-major) 0 1px, transparent 1px 48px),
|
|
105
|
+
repeating-linear-gradient(to bottom, var(--nx-grid-major) 0 1px, transparent 1px 48px),
|
|
106
|
+
repeating-linear-gradient(to right, var(--nx-grid-minor) 0 1px, transparent 1px 4px),
|
|
107
|
+
repeating-linear-gradient(to bottom, var(--nx-grid-minor) 0 1px, transparent 1px 4px);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
[data-nx-grid="cm"] body::after {
|
|
111
|
+
background-image:
|
|
112
|
+
repeating-linear-gradient(to right, var(--nx-grid-major) 0 1px, transparent 1px 1cm),
|
|
113
|
+
repeating-linear-gradient(to bottom, var(--nx-grid-major) 0 1px, transparent 1px 1cm),
|
|
114
|
+
repeating-linear-gradient(to right, var(--nx-grid-minor) 0 1px, transparent 1px 1mm),
|
|
115
|
+
repeating-linear-gradient(to bottom, var(--nx-grid-minor) 0 1px, transparent 1px 1mm);
|
|
116
|
+
}
|
|
117
|
+
}
|