nexus-shared 3.1.0 → 4.0.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 (234) hide show
  1. package/CHANGELOG.md +2268 -446
  2. package/LICENSE +21 -21
  3. package/README.md +1705 -1084
  4. package/dist/Client.Index.d.ts +17 -0
  5. package/dist/Client.Index.js +17 -0
  6. package/dist/Components/Documents/DocumentFrame.d.ts +50 -0
  7. package/dist/Components/Documents/DocumentFrame.js +83 -0
  8. package/dist/Components/Documents/Menu.d.ts +4 -0
  9. package/dist/Components/Documents/Menu.js +40 -24
  10. package/dist/Components/Documents/PrintDocument.d.ts +95 -0
  11. package/dist/Components/Documents/PrintDocument.js +62 -0
  12. package/dist/Components/Documents/Tabs.d.ts +59 -0
  13. package/dist/Components/Documents/Tabs.js +70 -0
  14. package/dist/Components/Forms/ApiForm.js +19 -2
  15. package/dist/Components/Forms/Crud.d.ts +2 -2
  16. package/dist/Components/Forms/Crud.js +871 -377
  17. package/dist/Components/Forms/CrudActions.d.ts +136 -0
  18. package/dist/Components/Forms/CrudActions.js +184 -0
  19. package/dist/Components/Forms/CrudHistory.d.ts +66 -0
  20. package/dist/Components/Forms/CrudHistory.js +140 -0
  21. package/dist/Components/Forms/CrudNarrowPicker.d.ts +31 -0
  22. package/dist/Components/Forms/CrudNarrowPicker.js +180 -0
  23. package/dist/Components/Forms/CrudParts.d.ts +30 -2
  24. package/dist/Components/Forms/CrudParts.js +56 -5
  25. package/dist/Components/Forms/CrudRowForms.d.ts +26 -0
  26. package/dist/Components/Forms/CrudRowForms.js +114 -0
  27. package/dist/Components/Forms/CrudScopes.d.ts +28 -0
  28. package/dist/Components/Forms/CrudScopes.js +76 -0
  29. package/dist/Components/Forms/CrudTree.d.ts +90 -0
  30. package/dist/Components/Forms/CrudTree.js +363 -0
  31. package/dist/Components/Forms/CrudWorkspace.d.ts +63 -0
  32. package/dist/Components/Forms/CrudWorkspace.js +169 -0
  33. package/dist/Components/Forms/ExcelImport.js +3 -3
  34. package/dist/Components/Forms/Form.d.ts +4 -4
  35. package/dist/Components/Forms/Form.js +125 -16
  36. package/dist/Components/Forms/FormLeaveGuard.d.ts +44 -0
  37. package/dist/Components/Forms/FormLeaveGuard.js +65 -0
  38. package/dist/Components/Forms/RecordFlows.d.ts +50 -0
  39. package/dist/Components/Forms/RecordFlows.js +282 -0
  40. package/dist/Components/Forms/SubmitForm.d.ts +37 -2
  41. package/dist/Components/Forms/SubmitForm.js +195 -10
  42. package/dist/Components/Inputs/CheckBox.js +1 -1
  43. package/dist/Components/Inputs/ChoiceField.d.ts +21 -1
  44. package/dist/Components/Inputs/ChoiceField.js +28 -2
  45. package/dist/Components/Inputs/CodeBox.d.ts +69 -0
  46. package/dist/Components/Inputs/CodeBox.js +316 -0
  47. package/dist/Components/Inputs/DatePicker.js +4 -1
  48. package/dist/Components/Inputs/DateRangePicker.js +4 -1
  49. package/dist/Components/Inputs/DateTimePicker.js +4 -1
  50. package/dist/Components/Inputs/Dropdown.d.ts +13 -0
  51. package/dist/Components/Inputs/Dropdown.js +8 -5
  52. package/dist/Components/Inputs/DropdownParts.d.ts +3 -1
  53. package/dist/Components/Inputs/DropdownParts.js +16 -4
  54. package/dist/Components/Inputs/Field.d.ts +7 -1
  55. package/dist/Components/Inputs/Field.js +2 -2
  56. package/dist/Components/Inputs/GroupForm.d.ts +6 -6
  57. package/dist/Components/Inputs/GroupForm.js +10 -11
  58. package/dist/Components/Inputs/InputRenderer.d.ts +9 -6
  59. package/dist/Components/Inputs/InputRenderer.js +39 -31
  60. package/dist/Components/Inputs/NumberBox.js +4 -2
  61. package/dist/Components/Inputs/PictureInput.d.ts +41 -0
  62. package/dist/Components/Inputs/PictureInput.js +70 -0
  63. package/dist/Components/Inputs/RadioGroup.d.ts +16 -3
  64. package/dist/Components/Inputs/RadioGroup.js +8 -3
  65. package/dist/Components/Inputs/RowsInput.d.ts +1 -1
  66. package/dist/Components/Inputs/RowsInput.js +18 -3
  67. package/dist/Components/Inputs/TabularForm.d.ts +5 -5
  68. package/dist/Components/Inputs/TabularForm.js +29 -29
  69. package/dist/Components/Inputs/TextArea.d.ts +6 -0
  70. package/dist/Components/Inputs/TextArea.js +14 -2
  71. package/dist/Components/Inputs/TextBox.js +4 -1
  72. package/dist/Components/Inputs/TextBoxTypes.d.ts +6 -0
  73. package/dist/Components/Inputs/TextBoxTypes.js +17 -0
  74. package/dist/Components/Inputs/TimePicker.js +4 -1
  75. package/dist/Components/Inputs/TreeView.d.ts +107 -6
  76. package/dist/Components/Inputs/TreeView.js +513 -30
  77. package/dist/Components/Layouts/MessageBox.d.ts +15 -2
  78. package/dist/Components/Layouts/MessageBox.js +56 -7
  79. package/dist/Components/Layouts/Popup.d.ts +13 -6
  80. package/dist/Components/Layouts/Popup.js +37 -9
  81. package/dist/Components/Layouts/PopupDock.d.ts +3 -1
  82. package/dist/Components/Layouts/PopupDock.js +2 -1
  83. package/dist/Components/Layouts/PopupHost.js +5 -4
  84. package/dist/Components/Layouts/ThemePicker.d.ts +3 -2
  85. package/dist/Components/Layouts/ThemePicker.js +16 -4
  86. package/dist/Components/Viewers/DataTable.js +205 -61
  87. package/dist/Components/Viewers/DataTableFilters.d.ts +1 -1
  88. package/dist/Components/Viewers/DataTableFilters.js +17 -2
  89. package/dist/Components/Viewers/DataTableParts.d.ts +46 -12
  90. package/dist/Components/Viewers/DataTableParts.js +62 -21
  91. package/dist/Components/Viewers/OwnerFiles.d.ts +175 -0
  92. package/dist/Components/Viewers/OwnerFiles.js +589 -0
  93. package/dist/Components/Viewers/QrCodeImage.d.ts +22 -0
  94. package/dist/Components/Viewers/QrCodeImage.js +15 -0
  95. package/dist/Components/Viewers/RecordCards.d.ts +16 -0
  96. package/dist/Components/Viewers/RecordCards.js +509 -0
  97. package/dist/Helpers/ApiModules.d.ts +3 -34
  98. package/dist/Helpers/ApiModules.js +3 -3
  99. package/dist/Helpers/ApiRoutes.d.ts +68 -26
  100. package/dist/Helpers/ApiRoutes.js +31 -27
  101. package/dist/Helpers/ArrayHelpers.d.ts +0 -0
  102. package/dist/Helpers/ArrayHelpers.js +2 -0
  103. package/dist/Helpers/BusyHooks.d.ts +6 -0
  104. package/dist/Helpers/BusyHooks.js +39 -0
  105. package/dist/Helpers/CodeHelpers.d.ts +97 -0
  106. package/dist/Helpers/CodeHelpers.js +332 -0
  107. package/dist/Helpers/CrudBackend.d.ts +114 -6
  108. package/dist/Helpers/CrudBackend.js +214 -11
  109. package/dist/Helpers/CrudColumns.d.ts +98 -0
  110. package/dist/Helpers/CrudColumns.js +160 -0
  111. package/dist/Helpers/CrudDetailsTabs.d.ts +58 -0
  112. package/dist/Helpers/CrudDetailsTabs.js +126 -0
  113. package/dist/Helpers/CrudHelpers.d.ts +130 -6
  114. package/dist/Helpers/CrudHelpers.js +304 -12
  115. package/dist/Helpers/CrudNarrowPick.d.ts +83 -0
  116. package/dist/Helpers/CrudNarrowPick.js +157 -0
  117. package/dist/Helpers/CrudRowForms.d.ts +15 -0
  118. package/dist/Helpers/CrudRowForms.js +43 -0
  119. package/dist/Helpers/CrudScopes.d.ts +32 -0
  120. package/dist/Helpers/CrudScopes.js +79 -0
  121. package/dist/Helpers/DropdownHelpers.d.ts +3 -1
  122. package/dist/Helpers/DropdownHelpers.js +6 -2
  123. package/dist/Helpers/ExcelHelpers.d.ts +1 -1
  124. package/dist/Helpers/ExcelHelpers.js +12 -11
  125. package/dist/Helpers/FileAdapter.d.ts +78 -0
  126. package/dist/Helpers/FileAdapter.js +102 -0
  127. package/dist/Helpers/FilePrimaries.d.ts +48 -0
  128. package/dist/Helpers/FilePrimaries.js +138 -0
  129. package/dist/Helpers/FormConfirm.d.ts +32 -0
  130. package/dist/Helpers/FormConfirm.js +40 -0
  131. package/dist/Helpers/FormStore.d.ts +90 -5
  132. package/dist/Helpers/FormStore.js +318 -22
  133. package/dist/Helpers/InputConditions.d.ts +50 -0
  134. package/dist/Helpers/InputConditions.js +168 -0
  135. package/dist/Helpers/InputMemory.d.ts +106 -0
  136. package/dist/Helpers/InputMemory.js +385 -0
  137. package/dist/Helpers/InputNarrowing.d.ts +18 -0
  138. package/dist/Helpers/InputNarrowing.js +67 -0
  139. package/dist/Helpers/InputParamsHelpers.d.ts +44 -1
  140. package/dist/Helpers/InputParamsHelpers.js +162 -71
  141. package/dist/Helpers/MessageBuilder.js +2 -0
  142. package/dist/Helpers/NexusDriveAdapter.d.ts +55 -0
  143. package/dist/Helpers/NexusDriveAdapter.js +207 -0
  144. package/dist/Helpers/NexusHelpers.d.ts +0 -0
  145. package/dist/Helpers/NexusHelpers.js +1 -0
  146. package/dist/Helpers/NumberHelpers.d.ts +95 -0
  147. package/dist/Helpers/NumberHelpers.js +126 -0
  148. package/dist/Helpers/Permissions.js +2 -1
  149. package/dist/Helpers/QrCode.d.ts +26 -0
  150. package/dist/Helpers/QrCode.js +463 -0
  151. package/dist/Helpers/RecordCards.d.ts +205 -0
  152. package/dist/Helpers/RecordCards.js +378 -0
  153. package/dist/Helpers/RequestCache.d.ts +47 -0
  154. package/dist/Helpers/RequestCache.js +132 -0
  155. package/dist/Helpers/RowsStore.d.ts +37 -2
  156. package/dist/Helpers/RowsStore.js +128 -10
  157. package/dist/Helpers/ServerPreview.d.ts +69 -0
  158. package/dist/Helpers/ServerPreview.js +99 -0
  159. package/dist/Helpers/TableColumns.js +4 -3
  160. package/dist/Helpers/TableExport.d.ts +7 -1
  161. package/dist/Helpers/TableExport.js +21 -15
  162. package/dist/Helpers/TableFilters.d.ts +1 -1
  163. package/dist/Helpers/TableFilters.js +24 -23
  164. package/dist/Helpers/TableHelpers.d.ts +24 -3
  165. package/dist/Helpers/TableHelpers.js +58 -12
  166. package/dist/Helpers/TableJoins.d.ts +83 -0
  167. package/dist/Helpers/TableJoins.js +284 -0
  168. package/dist/Helpers/TableStore.d.ts +26 -1
  169. package/dist/Helpers/TableStore.js +73 -7
  170. package/dist/Helpers/TreeStore.d.ts +306 -11
  171. package/dist/Helpers/TreeStore.js +1048 -90
  172. package/dist/Helpers/UserPreferences.d.ts +8 -0
  173. package/dist/Helpers/UserPreferences.js +17 -0
  174. package/dist/Interfaces/CrudInterfaces.d.ts +512 -14
  175. package/dist/Interfaces/FileInterfaces.d.ts +162 -0
  176. package/dist/Interfaces/FileInterfaces.js +4 -0
  177. package/dist/Interfaces/FormInterfaces.d.ts +393 -29
  178. package/dist/Interfaces/FormInterfaces.js +79 -1
  179. package/dist/Interfaces/InputInterfaces.d.ts +39 -3
  180. package/dist/Interfaces/MessageInterfaces.d.ts +1 -1
  181. package/dist/Interfaces/PreferenceInterfaces.d.ts +8 -0
  182. package/dist/Interfaces/PreferenceInterfaces.js +2 -5
  183. package/dist/Interfaces/RecordInterfaces.d.ts +367 -0
  184. package/dist/Interfaces/RecordInterfaces.js +1 -0
  185. package/dist/Interfaces/TableInterfaces.d.ts +160 -5
  186. package/dist/Services/ApiProxy.d.ts +36 -1
  187. package/dist/Services/ApiProxy.js +182 -52
  188. package/dist/Services/ApiProxyRules.d.ts +203 -0
  189. package/dist/Services/ApiProxyRules.js +426 -0
  190. package/dist/Services/ExcelApi.js +5 -0
  191. package/dist/Services/FileApi.d.ts +13 -0
  192. package/dist/Services/FileApi.js +29 -0
  193. package/dist/Services/ImageEditorLoader.d.ts +14 -0
  194. package/dist/Services/ImageEditorLoader.js +51 -0
  195. package/dist/Services/JoinSources.d.ts +80 -0
  196. package/dist/Services/JoinSources.js +150 -0
  197. package/dist/Services/ModuleImport.d.ts +7 -0
  198. package/dist/Services/ModuleImport.js +22 -0
  199. package/dist/Services/ServerApi.d.ts +13 -2
  200. package/dist/Services/ServerApi.js +8 -3
  201. package/dist/Shared.Index.d.ts +20 -0
  202. package/dist/Shared.Index.js +20 -0
  203. package/package.json +92 -85
  204. package/src/Styles/Nexus.Avatar.css +80 -79
  205. package/src/Styles/Nexus.Base.css +117 -117
  206. package/src/Styles/Nexus.Button.css +186 -180
  207. package/src/Styles/Nexus.Calendar.css +273 -273
  208. package/src/Styles/Nexus.Chat.css +1443 -1443
  209. package/src/Styles/Nexus.Choice.css +359 -343
  210. package/src/Styles/Nexus.Crud.css +542 -168
  211. package/src/Styles/Nexus.DateTime.css +81 -81
  212. package/src/Styles/Nexus.Dropdown.css +733 -725
  213. package/src/Styles/Nexus.Editor.css +295 -295
  214. package/src/Styles/Nexus.Excel.css +389 -389
  215. package/src/Styles/Nexus.Files.css +410 -0
  216. package/src/Styles/Nexus.Form.css +282 -279
  217. package/src/Styles/Nexus.Index.css +41 -37
  218. package/src/Styles/Nexus.Input.css +238 -4
  219. package/src/Styles/Nexus.Markdown.css +237 -237
  220. package/src/Styles/Nexus.Menu.css +246 -237
  221. package/src/Styles/Nexus.Popup.css +800 -724
  222. package/src/Styles/Nexus.Print.css +288 -0
  223. package/src/Styles/Nexus.QrCode.css +12 -0
  224. package/src/Styles/Nexus.Record.css +430 -0
  225. package/src/Styles/Nexus.Rows.css +637 -637
  226. package/src/Styles/Nexus.Slider.css +276 -276
  227. package/src/Styles/Nexus.Tab.Buttons.css +497 -432
  228. package/src/Styles/Nexus.Table.css +98 -35
  229. package/src/Styles/Nexus.Theme.Picker.css +59 -3
  230. package/src/Styles/Nexus.Themes.css +200 -194
  231. package/src/Styles/Nexus.Time.css +144 -144
  232. package/src/Styles/Nexus.Toast.css +263 -263
  233. package/src/Styles/Nexus.Tokens.css +94 -89
  234. package/src/Styles/Nexus.Tree.css +530 -431
@@ -1,273 +1,273 @@
1
- @layer nexus.components {
2
- /*
3
- * Calendar: a month grid of day buttons under a header of month and year menus. Cells touch along a row, so a
4
- * range reads as one band; the chosen days are solid primary, today has a primary edge, and holidays are red.
5
- * Nepali text carries lang="ne", which switches to a font with Devanagari glyphs (Nexus.Base.css).
6
- */
7
- .nx-cal {
8
- --nx-cal-cell: 36px;
9
- --nx-cal-font: var(--nx-text-sm);
10
-
11
- display: inline-grid;
12
- gap: var(--nx-space-2);
13
- padding: var(--nx-space-2);
14
- color: var(--nx-text);
15
- font-size: var(--nx-cal-font);
16
- line-height: 1.3;
17
- user-select: none;
18
- }
19
-
20
- .nx-cal--sm {
21
- --nx-cal-cell: 32px;
22
- }
23
-
24
- .nx-cal--lg {
25
- --nx-cal-cell: 42px;
26
- --nx-cal-font: var(--nx-text-md);
27
- }
28
-
29
- .nx-cal[data-disabled] {
30
- opacity: 0.6;
31
- }
32
-
33
- /* One or more months side by side; each has its own header, and only the outer ones carry an arrow. */
34
- .nx-cal__months {
35
- display: flex;
36
- align-items: flex-start;
37
- gap: var(--nx-space-4);
38
- }
39
-
40
- .nx-cal__month {
41
- display: grid;
42
- gap: var(--nx-space-2);
43
- }
44
-
45
- /* Header: previous, month and year menus, next */
46
- .nx-cal__head {
47
- display: flex;
48
- align-items: center;
49
- gap: 2px;
50
- }
51
-
52
- .nx-cal__nav {
53
- display: grid;
54
- place-items: center;
55
- flex-shrink: 0;
56
- width: 28px;
57
- height: 28px;
58
- padding: 0;
59
- border: 0;
60
- border-radius: var(--nx-radius-sm);
61
- background: none;
62
- color: var(--nx-text-muted);
63
- cursor: pointer;
64
- transition:
65
- background-color var(--nx-duration),
66
- color var(--nx-duration);
67
- }
68
-
69
- .nx-cal__nav .nx-icon {
70
- width: 18px;
71
- height: 18px;
72
- vertical-align: 0;
73
- }
74
-
75
- .nx-cal__nav:hover:not(:disabled) {
76
- background: var(--nx-surface-hover);
77
- color: var(--nx-text);
78
- }
79
-
80
- .nx-cal__nav:focus-visible {
81
- outline: 2px solid var(--nx-primary);
82
- outline-offset: -2px;
83
- }
84
-
85
- .nx-cal__nav:disabled {
86
- opacity: 0.35;
87
- cursor: default;
88
- }
89
-
90
- /* Keeps the menus centered in a month that has no arrow on that side. */
91
- .nx-cal__nav--space {
92
- visibility: hidden;
93
- }
94
-
95
- .nx-cal__menus {
96
- display: flex;
97
- flex: 1 1 auto;
98
- justify-content: center;
99
- gap: 2px;
100
- min-width: 0;
101
- }
102
-
103
- /* A menu drawn as a title: no frame until hovered, its own small chevron. */
104
- .nx-cal__select {
105
- appearance: none;
106
- max-width: 100%;
107
- height: 28px;
108
- padding: 0 18px 0 8px;
109
- border: 0;
110
- border-radius: var(--nx-radius-sm);
111
- background:
112
- url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6l6-6'/%3E%3C/svg%3E")
113
- no-repeat right 4px center / 12px;
114
- color: var(--nx-text);
115
- font-size: var(--nx-cal-font);
116
- font-weight: 600;
117
- cursor: pointer;
118
- transition: background-color var(--nx-duration);
119
- }
120
-
121
- .nx-cal__select:hover:not(:disabled) {
122
- background-color: var(--nx-surface-hover);
123
- }
124
-
125
- .nx-cal__select:focus-visible {
126
- outline: 2px solid var(--nx-primary);
127
- outline-offset: -2px;
128
- }
129
-
130
- .nx-cal__select:disabled {
131
- cursor: default;
132
- }
133
-
134
- /* The menu's list takes the theme's colors in browsers that style it. */
135
- .nx-cal__select option {
136
- background: var(--nx-surface);
137
- color: var(--nx-text);
138
- font-weight: 400;
139
- }
140
-
141
- /* Grid */
142
- .nx-cal__grid {
143
- display: grid;
144
- gap: 2px 0;
145
- }
146
-
147
- .nx-cal__row {
148
- display: grid;
149
- grid-template-columns: repeat(7, var(--nx-cal-cell));
150
- }
151
-
152
- .nx-cal__weekday {
153
- display: grid;
154
- place-items: center;
155
- height: 26px;
156
- color: var(--nx-text-muted);
157
- font-size: var(--nx-text-xs);
158
- font-weight: 600;
159
- }
160
-
161
- .nx-cal__day {
162
- position: relative;
163
- display: grid;
164
- place-items: center;
165
- width: var(--nx-cal-cell);
166
- height: var(--nx-cal-cell);
167
- padding: 0;
168
- border: 1px solid transparent;
169
- border-radius: var(--nx-radius);
170
- background: none;
171
- color: var(--nx-text);
172
- font: inherit;
173
- font-variant-numeric: tabular-nums;
174
- cursor: pointer;
175
- transition:
176
- background-color var(--nx-duration),
177
- color var(--nx-duration);
178
- }
179
-
180
- .nx-cal__day--empty {
181
- cursor: default;
182
- }
183
-
184
- .nx-cal__day:hover:not([aria-disabled], [aria-selected="true"]) {
185
- background: var(--nx-surface-hover);
186
- }
187
-
188
- /* A ring that stays visible on a solid primary day. */
189
- .nx-cal__day:focus-visible {
190
- outline: none;
191
- box-shadow:
192
- 0 0 0 2px var(--nx-surface),
193
- 0 0 0 4px var(--nx-primary);
194
- z-index: 1;
195
- }
196
-
197
- .nx-cal__day[data-outside] {
198
- color: var(--nx-text-subtle);
199
- }
200
-
201
- .nx-cal__weekday[data-weekend],
202
- .nx-cal__day[data-weekend]:not([data-outside]) {
203
- color: var(--nx-danger);
204
- }
205
-
206
- .nx-cal__day[data-today] {
207
- border-color: var(--nx-primary);
208
- font-weight: 600;
209
- }
210
-
211
- /* Between the two ends of a range: a soft band across the row. */
212
- .nx-cal__day[data-in-range] {
213
- border-radius: 0;
214
- background: var(--nx-primary-soft);
215
- }
216
-
217
- .nx-cal__day[data-range-start] {
218
- border-top-right-radius: 0;
219
- border-bottom-right-radius: 0;
220
- }
221
-
222
- .nx-cal__day[data-range-end] {
223
- border-top-left-radius: 0;
224
- border-bottom-left-radius: 0;
225
- }
226
-
227
- .nx-cal__day[aria-selected="true"] {
228
- border-color: var(--nx-primary-solid);
229
- background: var(--nx-primary-solid);
230
- color: var(--nx-primary-text);
231
- font-weight: 600;
232
- }
233
-
234
- .nx-cal__day[aria-disabled="true"] {
235
- color: var(--nx-text-subtle);
236
- opacity: 0.45;
237
- cursor: default;
238
- }
239
-
240
- .nx-cal__day[aria-disabled="true"][aria-selected="true"] {
241
- opacity: 0.7;
242
- }
243
-
244
- /* Footer */
245
- .nx-cal__foot {
246
- display: flex;
247
- justify-content: space-between;
248
- gap: var(--nx-space-2);
249
- padding-top: var(--nx-space-1);
250
- border-top: 1px solid var(--nx-border);
251
- }
252
-
253
- /* Date picker: the box's text lines digits up, and its calendar opens in a popover placed by the component. */
254
- .nx-field__control--date {
255
- font-variant-numeric: tabular-nums;
256
- }
257
-
258
- .nx-date-popover {
259
- position: fixed;
260
- inset: auto;
261
- padding: 0;
262
- }
263
-
264
- .nx-field__action--calendar[aria-expanded="true"] {
265
- color: var(--nx-field-accent);
266
- }
267
-
268
- [data-nx-motion="reduce"] .nx-cal__day,
269
- [data-nx-motion="reduce"] .nx-cal__nav,
270
- [data-nx-motion="reduce"] .nx-cal__select {
271
- transition: none;
272
- }
273
- }
1
+ @layer nexus.components {
2
+ /*
3
+ * Calendar: a month grid of day buttons under a header of month and year menus. Cells touch along a row, so a
4
+ * range reads as one band; the chosen days are solid primary, today has a primary edge, and holidays are red.
5
+ * Nepali text carries lang="ne", which switches to a font with Devanagari glyphs (Nexus.Base.css).
6
+ */
7
+ .nx-cal {
8
+ --nx-cal-cell: 36px;
9
+ --nx-cal-font: var(--nx-text-sm);
10
+
11
+ display: inline-grid;
12
+ gap: var(--nx-space-2);
13
+ padding: var(--nx-space-2);
14
+ color: var(--nx-text);
15
+ font-size: var(--nx-cal-font);
16
+ line-height: 1.3;
17
+ user-select: none;
18
+ }
19
+
20
+ .nx-cal--sm {
21
+ --nx-cal-cell: 32px;
22
+ }
23
+
24
+ .nx-cal--lg {
25
+ --nx-cal-cell: 42px;
26
+ --nx-cal-font: var(--nx-text-md);
27
+ }
28
+
29
+ .nx-cal[data-disabled] {
30
+ opacity: 0.6;
31
+ }
32
+
33
+ /* One or more months side by side; each has its own header, and only the outer ones carry an arrow. */
34
+ .nx-cal__months {
35
+ display: flex;
36
+ align-items: flex-start;
37
+ gap: var(--nx-space-4);
38
+ }
39
+
40
+ .nx-cal__month {
41
+ display: grid;
42
+ gap: var(--nx-space-2);
43
+ }
44
+
45
+ /* Header: previous, month and year menus, next */
46
+ .nx-cal__head {
47
+ display: flex;
48
+ align-items: center;
49
+ gap: 2px;
50
+ }
51
+
52
+ .nx-cal__nav {
53
+ display: grid;
54
+ place-items: center;
55
+ flex-shrink: 0;
56
+ width: 28px;
57
+ height: 28px;
58
+ padding: 0;
59
+ border: 0;
60
+ border-radius: var(--nx-radius-sm);
61
+ background: none;
62
+ color: var(--nx-text-muted);
63
+ cursor: pointer;
64
+ transition:
65
+ background-color var(--nx-duration),
66
+ color var(--nx-duration);
67
+ }
68
+
69
+ .nx-cal__nav .nx-icon {
70
+ width: 18px;
71
+ height: 18px;
72
+ vertical-align: 0;
73
+ }
74
+
75
+ .nx-cal__nav:hover:not(:disabled) {
76
+ background: var(--nx-surface-hover);
77
+ color: var(--nx-text);
78
+ }
79
+
80
+ .nx-cal__nav:focus-visible {
81
+ outline: 2px solid var(--nx-primary);
82
+ outline-offset: -2px;
83
+ }
84
+
85
+ .nx-cal__nav:disabled {
86
+ opacity: 0.35;
87
+ cursor: default;
88
+ }
89
+
90
+ /* Keeps the menus centered in a month that has no arrow on that side. */
91
+ .nx-cal__nav--space {
92
+ visibility: hidden;
93
+ }
94
+
95
+ .nx-cal__menus {
96
+ display: flex;
97
+ flex: 1 1 auto;
98
+ justify-content: center;
99
+ gap: 2px;
100
+ min-width: 0;
101
+ }
102
+
103
+ /* A menu drawn as a title: no frame until hovered, its own small chevron. */
104
+ .nx-cal__select {
105
+ appearance: none;
106
+ max-width: 100%;
107
+ height: 28px;
108
+ padding: 0 18px 0 8px;
109
+ border: 0;
110
+ border-radius: var(--nx-radius-sm);
111
+ background:
112
+ url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6l6-6'/%3E%3C/svg%3E")
113
+ no-repeat right 4px center / 12px;
114
+ color: var(--nx-text);
115
+ font-size: var(--nx-cal-font);
116
+ font-weight: 600;
117
+ cursor: pointer;
118
+ transition: background-color var(--nx-duration);
119
+ }
120
+
121
+ .nx-cal__select:hover:not(:disabled) {
122
+ background-color: var(--nx-surface-hover);
123
+ }
124
+
125
+ .nx-cal__select:focus-visible {
126
+ outline: 2px solid var(--nx-primary);
127
+ outline-offset: -2px;
128
+ }
129
+
130
+ .nx-cal__select:disabled {
131
+ cursor: default;
132
+ }
133
+
134
+ /* The menu's list takes the theme's colors in browsers that style it. */
135
+ .nx-cal__select option {
136
+ background: var(--nx-surface);
137
+ color: var(--nx-text);
138
+ font-weight: 400;
139
+ }
140
+
141
+ /* Grid */
142
+ .nx-cal__grid {
143
+ display: grid;
144
+ gap: 2px 0;
145
+ }
146
+
147
+ .nx-cal__row {
148
+ display: grid;
149
+ grid-template-columns: repeat(7, var(--nx-cal-cell));
150
+ }
151
+
152
+ .nx-cal__weekday {
153
+ display: grid;
154
+ place-items: center;
155
+ height: 26px;
156
+ color: var(--nx-text-muted);
157
+ font-size: var(--nx-text-xs);
158
+ font-weight: 600;
159
+ }
160
+
161
+ .nx-cal__day {
162
+ position: relative;
163
+ display: grid;
164
+ place-items: center;
165
+ width: var(--nx-cal-cell);
166
+ height: var(--nx-cal-cell);
167
+ padding: 0;
168
+ border: 1px solid transparent;
169
+ border-radius: var(--nx-radius);
170
+ background: none;
171
+ color: var(--nx-text);
172
+ font: inherit;
173
+ font-variant-numeric: tabular-nums;
174
+ cursor: pointer;
175
+ transition:
176
+ background-color var(--nx-duration),
177
+ color var(--nx-duration);
178
+ }
179
+
180
+ .nx-cal__day--empty {
181
+ cursor: default;
182
+ }
183
+
184
+ .nx-cal__day:hover:not([aria-disabled], [aria-selected="true"]) {
185
+ background: var(--nx-surface-hover);
186
+ }
187
+
188
+ /* A ring that stays visible on a solid primary day. */
189
+ .nx-cal__day:focus-visible {
190
+ outline: none;
191
+ box-shadow:
192
+ 0 0 0 2px var(--nx-surface),
193
+ 0 0 0 4px var(--nx-primary);
194
+ z-index: 1;
195
+ }
196
+
197
+ .nx-cal__day[data-outside] {
198
+ color: var(--nx-text-subtle);
199
+ }
200
+
201
+ .nx-cal__weekday[data-weekend],
202
+ .nx-cal__day[data-weekend]:not([data-outside]) {
203
+ color: var(--nx-danger);
204
+ }
205
+
206
+ .nx-cal__day[data-today] {
207
+ border-color: var(--nx-primary);
208
+ font-weight: 600;
209
+ }
210
+
211
+ /* Between the two ends of a range: a soft band across the row. */
212
+ .nx-cal__day[data-in-range] {
213
+ border-radius: 0;
214
+ background: var(--nx-primary-soft);
215
+ }
216
+
217
+ .nx-cal__day[data-range-start] {
218
+ border-top-right-radius: 0;
219
+ border-bottom-right-radius: 0;
220
+ }
221
+
222
+ .nx-cal__day[data-range-end] {
223
+ border-top-left-radius: 0;
224
+ border-bottom-left-radius: 0;
225
+ }
226
+
227
+ .nx-cal__day[aria-selected="true"] {
228
+ border-color: var(--nx-primary-solid);
229
+ background: var(--nx-primary-solid);
230
+ color: var(--nx-primary-text);
231
+ font-weight: 600;
232
+ }
233
+
234
+ .nx-cal__day[aria-disabled="true"] {
235
+ color: var(--nx-text-subtle);
236
+ opacity: 0.45;
237
+ cursor: default;
238
+ }
239
+
240
+ .nx-cal__day[aria-disabled="true"][aria-selected="true"] {
241
+ opacity: 0.7;
242
+ }
243
+
244
+ /* Footer */
245
+ .nx-cal__foot {
246
+ display: flex;
247
+ justify-content: space-between;
248
+ gap: var(--nx-space-2);
249
+ padding-top: var(--nx-space-1);
250
+ border-top: 1px solid var(--nx-border);
251
+ }
252
+
253
+ /* Date picker: the box's text lines digits up, and its calendar opens in a popover placed by the component. */
254
+ .nx-field__control--date {
255
+ font-variant-numeric: tabular-nums;
256
+ }
257
+
258
+ .nx-date-popover {
259
+ position: fixed;
260
+ inset: auto;
261
+ padding: 0;
262
+ }
263
+
264
+ .nx-field__action--calendar[aria-expanded="true"] {
265
+ color: var(--nx-field-accent);
266
+ }
267
+
268
+ [data-nx-motion="reduce"] .nx-cal__day,
269
+ [data-nx-motion="reduce"] .nx-cal__nav,
270
+ [data-nx-motion="reduce"] .nx-cal__select {
271
+ transition: none;
272
+ }
273
+ }