nexus-shared 1.1.20 → 2.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 (332) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +903 -0
  3. package/dist/Client.Index.d.ts +44 -0
  4. package/dist/Client.Index.js +49 -0
  5. package/dist/Components/Documents/Button.d.ts +29 -0
  6. package/dist/Components/Documents/Button.js +11 -0
  7. package/dist/Components/Documents/Menu.d.ts +102 -0
  8. package/dist/Components/Documents/Menu.js +238 -0
  9. package/dist/Components/Documents/SplitButton.d.ts +64 -0
  10. package/dist/Components/Documents/SplitButton.js +127 -0
  11. package/dist/Components/Documents/TabButtons.d.ts +62 -0
  12. package/dist/Components/Documents/TabButtons.js +19 -0
  13. package/dist/Components/Forms/ApiForm.d.ts +21 -0
  14. package/dist/Components/Forms/ApiForm.js +99 -0
  15. package/dist/Components/Forms/Crud.d.ts +17 -0
  16. package/dist/Components/Forms/Crud.js +556 -0
  17. package/dist/Components/Forms/CrudParts.d.ts +15 -0
  18. package/dist/Components/Forms/CrudParts.js +36 -0
  19. package/dist/Components/Forms/Form.d.ts +52 -0
  20. package/dist/Components/Forms/Form.js +319 -0
  21. package/dist/Components/Forms/SubmitForm.d.ts +65 -0
  22. package/dist/Components/Forms/SubmitForm.js +198 -0
  23. package/dist/Components/Inputs/Calendar.d.ts +69 -0
  24. package/dist/Components/Inputs/Calendar.js +258 -0
  25. package/dist/Components/Inputs/CheckBox.d.ts +53 -0
  26. package/dist/Components/Inputs/CheckBox.js +87 -0
  27. package/dist/Components/Inputs/CheckBoxGroup.d.ts +20 -0
  28. package/dist/Components/Inputs/CheckBoxGroup.js +80 -0
  29. package/dist/Components/Inputs/ChoiceField.d.ts +122 -0
  30. package/dist/Components/Inputs/ChoiceField.js +169 -0
  31. package/dist/Components/Inputs/DatePicker.d.ts +54 -0
  32. package/dist/Components/Inputs/DatePicker.js +246 -0
  33. package/dist/Components/Inputs/DateRangePicker.d.ts +62 -0
  34. package/dist/Components/Inputs/DateRangePicker.js +283 -0
  35. package/dist/Components/Inputs/DateTimePicker.d.ts +75 -0
  36. package/dist/Components/Inputs/DateTimePicker.js +399 -0
  37. package/dist/Components/Inputs/Dropdown.d.ts +117 -0
  38. package/dist/Components/Inputs/Dropdown.js +839 -0
  39. package/dist/Components/Inputs/DropdownParts.d.ts +84 -0
  40. package/dist/Components/Inputs/DropdownParts.js +102 -0
  41. package/dist/Components/Inputs/EditorShell.d.ts +45 -0
  42. package/dist/Components/Inputs/EditorShell.js +214 -0
  43. package/dist/Components/Inputs/Field.d.ts +53 -0
  44. package/dist/Components/Inputs/Field.js +16 -0
  45. package/dist/Components/Inputs/GroupForm.d.ts +20 -0
  46. package/dist/Components/Inputs/GroupForm.js +170 -0
  47. package/dist/Components/Inputs/InputField.d.ts +59 -0
  48. package/dist/Components/Inputs/InputField.js +169 -0
  49. package/dist/Components/Inputs/InputRenderer.d.ts +35 -0
  50. package/dist/Components/Inputs/InputRenderer.js +99 -0
  51. package/dist/Components/Inputs/MarkdownEditor.d.ts +67 -0
  52. package/dist/Components/Inputs/MarkdownEditor.js +289 -0
  53. package/dist/Components/Inputs/NumberBox.d.ts +53 -0
  54. package/dist/Components/Inputs/NumberBox.js +228 -0
  55. package/dist/Components/Inputs/RadioGroup.d.ts +20 -0
  56. package/dist/Components/Inputs/RadioGroup.js +43 -0
  57. package/dist/Components/Inputs/ReadOnlyNotice.d.ts +36 -0
  58. package/dist/Components/Inputs/ReadOnlyNotice.js +116 -0
  59. package/dist/Components/Inputs/RichTextEditor.d.ts +103 -0
  60. package/dist/Components/Inputs/RichTextEditor.js +1170 -0
  61. package/dist/Components/Inputs/RichTextParts.d.ts +63 -0
  62. package/dist/Components/Inputs/RichTextParts.js +157 -0
  63. package/dist/Components/Inputs/RowsInput.d.ts +104 -0
  64. package/dist/Components/Inputs/RowsInput.js +259 -0
  65. package/dist/Components/Inputs/Slider.d.ts +87 -0
  66. package/dist/Components/Inputs/Slider.js +216 -0
  67. package/dist/Components/Inputs/TabularForm.d.ts +23 -0
  68. package/dist/Components/Inputs/TabularForm.js +283 -0
  69. package/dist/Components/Inputs/TextArea.d.ts +43 -0
  70. package/dist/Components/Inputs/TextArea.js +31 -0
  71. package/dist/Components/Inputs/TextBox.d.ts +52 -0
  72. package/dist/Components/Inputs/TextBox.js +58 -0
  73. package/dist/Components/Inputs/TextField.d.ts +31 -0
  74. package/dist/Components/Inputs/TextField.js +35 -0
  75. package/dist/Components/Inputs/TimePanel.d.ts +34 -0
  76. package/dist/Components/Inputs/TimePanel.js +288 -0
  77. package/dist/Components/Inputs/TimePicker.d.ts +54 -0
  78. package/dist/Components/Inputs/TimePicker.js +239 -0
  79. package/dist/Components/Inputs/TreeView.d.ts +160 -0
  80. package/dist/Components/Inputs/TreeView.js +947 -0
  81. package/dist/Components/Layouts/MessageBox.d.ts +71 -0
  82. package/dist/Components/Layouts/MessageBox.js +104 -0
  83. package/dist/Components/Layouts/Popup.d.ts +92 -0
  84. package/dist/Components/Layouts/Popup.js +376 -0
  85. package/dist/Components/Layouts/PopupContext.d.ts +2 -0
  86. package/dist/Components/Layouts/PopupContext.js +4 -0
  87. package/dist/Components/Layouts/PopupDock.d.ts +22 -0
  88. package/dist/Components/Layouts/PopupDock.js +121 -0
  89. package/dist/Components/Layouts/PopupHost.d.ts +56 -0
  90. package/dist/Components/Layouts/PopupHost.js +163 -0
  91. package/dist/Components/Layouts/PopupRules.d.ts +30 -0
  92. package/dist/Components/Layouts/PopupRules.js +63 -0
  93. package/dist/Components/Layouts/ThemePicker.d.ts +13 -0
  94. package/dist/Components/Layouts/ThemePicker.js +22 -0
  95. package/dist/Components/Layouts/ThemeScript.d.ts +14 -0
  96. package/dist/Components/Layouts/ThemeScript.js +13 -0
  97. package/dist/Components/Layouts/ThemeSwitcher.d.ts +13 -0
  98. package/dist/Components/Layouts/ThemeSwitcher.js +29 -0
  99. package/dist/Components/Layouts/Toaster.d.ts +76 -0
  100. package/dist/Components/Layouts/Toaster.js +172 -0
  101. package/dist/Components/Viewers/DataTable.d.ts +25 -0
  102. package/dist/Components/Viewers/DataTable.js +542 -0
  103. package/dist/Components/Viewers/DataTableParts.d.ts +134 -0
  104. package/dist/Components/Viewers/DataTableParts.js +145 -0
  105. package/dist/Components/Viewers/MarkdownView.d.ts +26 -0
  106. package/dist/Components/Viewers/MarkdownView.js +79 -0
  107. package/dist/Components/Viewers/RichTextView.d.ts +18 -0
  108. package/dist/Components/Viewers/RichTextView.js +17 -0
  109. package/dist/Helpers/AnimationHelpers.d.ts +6 -0
  110. package/dist/Helpers/AnimationHelpers.js +35 -0
  111. package/dist/Helpers/ApiClient.d.ts +74 -0
  112. package/dist/Helpers/ApiClient.js +197 -0
  113. package/dist/Helpers/ApiFormHelpers.d.ts +26 -0
  114. package/dist/Helpers/ApiFormHelpers.js +56 -0
  115. package/dist/Helpers/ApiModules.d.ts +135 -0
  116. package/dist/Helpers/ApiModules.js +194 -0
  117. package/dist/Helpers/ApiResponses.d.ts +41 -0
  118. package/dist/Helpers/ApiResponses.js +159 -0
  119. package/dist/Helpers/ApiRoutes.d.ts +150 -0
  120. package/dist/Helpers/ApiRoutes.js +191 -0
  121. package/dist/Helpers/ApiToasts.d.ts +21 -0
  122. package/dist/Helpers/ApiToasts.js +22 -0
  123. package/dist/Helpers/ClassHelpers.d.ts +3 -0
  124. package/dist/Helpers/ClassHelpers.js +4 -0
  125. package/dist/Helpers/CrudBackend.d.ts +56 -0
  126. package/dist/Helpers/CrudBackend.js +119 -0
  127. package/dist/Helpers/CrudHelpers.d.ts +76 -0
  128. package/dist/Helpers/CrudHelpers.js +202 -0
  129. package/dist/Helpers/DateHelpers.d.ts +88 -0
  130. package/dist/Helpers/DateHelpers.js +363 -0
  131. package/dist/Helpers/DatePreferences.d.ts +14 -0
  132. package/dist/Helpers/DatePreferences.js +94 -0
  133. package/dist/Helpers/DateTimeHelpers.d.ts +87 -0
  134. package/dist/Helpers/DateTimeHelpers.js +286 -0
  135. package/dist/Helpers/DragHelpers.d.ts +129 -0
  136. package/dist/Helpers/DragHelpers.js +281 -0
  137. package/dist/Helpers/DropdownHelpers.d.ts +56 -0
  138. package/dist/Helpers/DropdownHelpers.js +180 -0
  139. package/dist/Helpers/FormDrafts.d.ts +18 -0
  140. package/dist/Helpers/FormDrafts.js +76 -0
  141. package/dist/Helpers/FormStore.d.ts +231 -0
  142. package/dist/Helpers/FormStore.js +734 -0
  143. package/dist/Helpers/InputParamsHelpers.d.ts +79 -0
  144. package/dist/Helpers/InputParamsHelpers.js +388 -0
  145. package/dist/Helpers/MarkdownEditing.d.ts +27 -0
  146. package/dist/Helpers/MarkdownEditing.js +250 -0
  147. package/dist/Helpers/MarkdownHelpers.d.ts +82 -0
  148. package/dist/Helpers/MarkdownHelpers.js +775 -0
  149. package/dist/Helpers/MessageBuilder.d.ts +74 -0
  150. package/dist/Helpers/MessageBuilder.js +254 -0
  151. package/dist/Helpers/NepaliCalendar.d.ts +25 -0
  152. package/dist/Helpers/NepaliCalendar.js +107 -0
  153. package/dist/Helpers/NumberHelpers.d.ts +71 -0
  154. package/dist/Helpers/NumberHelpers.js +202 -0
  155. package/dist/Helpers/Permissions.d.ts +62 -0
  156. package/dist/Helpers/Permissions.js +133 -0
  157. package/dist/Helpers/PopoverHelpers.d.ts +43 -0
  158. package/dist/Helpers/PopoverHelpers.js +91 -0
  159. package/dist/Helpers/RichTextHelpers.d.ts +77 -0
  160. package/dist/Helpers/RichTextHelpers.js +1072 -0
  161. package/dist/Helpers/RowsStore.d.ts +160 -0
  162. package/dist/Helpers/RowsStore.js +584 -0
  163. package/dist/Helpers/TableColumns.d.ts +40 -0
  164. package/dist/Helpers/TableColumns.js +254 -0
  165. package/dist/Helpers/TableExport.d.ts +30 -0
  166. package/dist/Helpers/TableExport.js +97 -0
  167. package/dist/Helpers/TableHelpers.d.ts +102 -0
  168. package/dist/Helpers/TableHelpers.js +281 -0
  169. package/dist/Helpers/TableStore.d.ts +142 -0
  170. package/dist/Helpers/TableStore.js +530 -0
  171. package/dist/Helpers/ThemeHelpers.d.ts +15 -0
  172. package/dist/Helpers/ThemeHelpers.js +16 -0
  173. package/dist/Helpers/TimeHelpers.d.ts +73 -0
  174. package/dist/Helpers/TimeHelpers.js +253 -0
  175. package/dist/Helpers/TreeStore.d.ts +188 -0
  176. package/dist/Helpers/TreeStore.js +577 -0
  177. package/dist/Helpers/ValidationHelpers.d.ts +124 -0
  178. package/dist/Helpers/ValidationHelpers.js +301 -0
  179. package/dist/Interfaces/ApiInterfaces.d.ts +149 -0
  180. package/dist/Interfaces/ApiInterfaces.js +24 -0
  181. package/dist/Interfaces/CrudInterfaces.d.ts +171 -0
  182. package/{src/sso-client.tsx → dist/Interfaces/CrudInterfaces.js} +1 -1
  183. package/dist/Interfaces/DateInterfaces.d.ts +154 -0
  184. package/dist/Interfaces/DateInterfaces.js +29 -0
  185. package/dist/Interfaces/FormInterfaces.d.ts +352 -0
  186. package/dist/Interfaces/FormInterfaces.js +1 -0
  187. package/dist/Interfaces/InputInterfaces.d.ts +141 -0
  188. package/dist/Interfaces/InputInterfaces.js +1 -0
  189. package/dist/Interfaces/MessageInterfaces.d.ts +111 -0
  190. package/dist/Interfaces/MessageInterfaces.js +5 -0
  191. package/dist/Interfaces/TableInterfaces.d.ts +291 -0
  192. package/dist/Interfaces/TableInterfaces.js +1 -0
  193. package/dist/Interfaces/ThemeInterfaces.d.ts +17 -0
  194. package/dist/Interfaces/ThemeInterfaces.js +17 -0
  195. package/dist/Interfaces/TypeInterfaces.d.ts +4 -0
  196. package/dist/Interfaces/TypeInterfaces.js +1 -0
  197. package/dist/Server.Index.d.ts +2 -0
  198. package/dist/Server.Index.js +5 -0
  199. package/dist/Services/ApiProxy.d.ts +32 -0
  200. package/dist/Services/ApiProxy.js +111 -0
  201. package/dist/Services/BrowserApi.d.ts +78 -0
  202. package/dist/Services/BrowserApi.js +111 -0
  203. package/dist/Services/ServerApi.d.ts +49 -0
  204. package/dist/Services/ServerApi.js +75 -0
  205. package/dist/Services/ThemeService.d.ts +17 -0
  206. package/dist/Services/ThemeService.js +83 -0
  207. package/dist/Shared.Index.d.ts +43 -0
  208. package/dist/Shared.Index.js +47 -0
  209. package/package.json +82 -33
  210. package/src/Styles/Nexus.Base.css +70 -0
  211. package/src/Styles/Nexus.Button.css +151 -0
  212. package/src/Styles/Nexus.Calendar.css +275 -0
  213. package/src/Styles/Nexus.Choice.css +345 -0
  214. package/src/Styles/Nexus.Crud.css +84 -0
  215. package/src/Styles/Nexus.DateTime.css +81 -0
  216. package/src/Styles/Nexus.Dropdown.css +774 -0
  217. package/src/Styles/Nexus.Editor.css +297 -0
  218. package/src/Styles/Nexus.Form.css +298 -0
  219. package/src/Styles/Nexus.Index.css +34 -0
  220. package/src/Styles/Nexus.Input.css +637 -0
  221. package/src/Styles/Nexus.Markdown.css +265 -0
  222. package/src/Styles/Nexus.Menu.css +249 -0
  223. package/src/Styles/Nexus.Popup.css +731 -0
  224. package/src/Styles/Nexus.RichText.css +463 -0
  225. package/src/Styles/Nexus.Rows.css +566 -0
  226. package/src/Styles/Nexus.Slider.css +278 -0
  227. package/src/Styles/Nexus.Tab.Buttons.css +364 -0
  228. package/src/Styles/Nexus.Table.css +1014 -0
  229. package/src/Styles/Nexus.Theme.Picker.css +159 -0
  230. package/src/Styles/Nexus.Themes.css +194 -0
  231. package/src/Styles/Nexus.Time.css +147 -0
  232. package/src/Styles/Nexus.Toast.css +265 -0
  233. package/src/Styles/Nexus.Tokens.css +72 -0
  234. package/src/Styles/Nexus.Tree.css +435 -0
  235. package/src/api-services/authentication-service.tsx +0 -23
  236. package/src/api-services/preference-service.tsx +0 -5
  237. package/src/api-services/system-service.tsx +0 -34
  238. package/src/client.ts +0 -31
  239. package/src/components/documents/button.tsx +0 -142
  240. package/src/components/documents/icon-box.tsx +0 -93
  241. package/src/components/documents/page-title.tsx +0 -7
  242. package/src/components/documents/tab-button.tsx +0 -172
  243. package/src/components/documents/tag.tsx +0 -30
  244. package/src/components/index.js +0 -0
  245. package/src/components/inputs/checkbox-input.tsx +0 -66
  246. package/src/components/inputs/input-box.tsx +0 -48
  247. package/src/components/inputs/input-element.tsx +0 -65
  248. package/src/components/inputs/input-form.tsx +0 -164
  249. package/src/components/inputs/input.tsx +0 -181
  250. package/src/components/inputs/number-input.tsx +0 -108
  251. package/src/components/inputs/radiobox-input.tsx +0 -53
  252. package/src/components/inputs/textarea-input.tsx +0 -47
  253. package/src/components/inputs/textbox-input.tsx +0 -45
  254. package/src/components/layouts/global-dialogbox.tsx +0 -431
  255. package/src/components/layouts/global-layout.tsx +0 -59
  256. package/src/components/layouts/layout-helpers.tsx +0 -20
  257. package/src/components/layouts/panels/user-panel.tsx +0 -112
  258. package/src/components/layouts/utility-menu.tsx +0 -49
  259. package/src/components/panels/theme-panel.tsx +0 -46
  260. package/src/helpers/bitwise-helpers.tsx +0 -11
  261. package/src/helpers/browser-helpers.tsx +0 -156
  262. package/src/helpers/datasource-helpers.tsx +0 -99
  263. package/src/helpers/element-helpers.tsx +0 -57
  264. package/src/helpers/input-helpers.tsx +0 -74
  265. package/src/helpers/string-helpers.tsx +0 -28
  266. package/src/helpers/utility-helpers.tsx +0 -45
  267. package/src/helpers/validation-helpers.tsx +0 -302
  268. package/src/index.ts +0 -26
  269. package/src/interface.ts +0 -19
  270. package/src/interfaces/auth-token-interfaces.tsx +0 -6
  271. package/src/interfaces/browser-interfaces.tsx +0 -36
  272. package/src/interfaces/button-interfaces.tsx +0 -63
  273. package/src/interfaces/datasource-interfaces.tsx +0 -22
  274. package/src/interfaces/datatable-interfaces.tsx +0 -25
  275. package/src/interfaces/dialogbox-interfaces.tsx +0 -5
  276. package/src/interfaces/exception-interfaces.tsx +0 -99
  277. package/src/interfaces/http-interfaces.tsx +0 -129
  278. package/src/interfaces/icon-interfaces.tsx +0 -129
  279. package/src/interfaces/input-interfaces.tsx +0 -410
  280. package/src/interfaces/layout-interfaces.tsx +0 -191
  281. package/src/interfaces/menu-interfaces.tsx +0 -49
  282. package/src/interfaces/message-interfaces.tsx +0 -32
  283. package/src/interfaces/permission-interfaces.tsx +0 -9
  284. package/src/interfaces/storage-interfaces.tsx +0 -5
  285. package/src/interfaces/system-interfaces.tsx +0 -22
  286. package/src/interfaces/theme-interfaces.tsx +0 -123
  287. package/src/interfaces/type-interfaces.tsx +0 -28
  288. package/src/interfaces/user-interfaces.tsx +0 -47
  289. package/src/nexus-client.tsx +0 -21
  290. package/src/nexus.environments.tsx +0 -66
  291. package/src/proxy-api/proxy-backend.tsx +0 -60
  292. package/src/proxy-api/proxy-constants.tsx +0 -28
  293. package/src/proxy-api/proxy-helpers.tsx +0 -91
  294. package/src/proxy-api-client.tsx +0 -1
  295. package/src/proxy-api-server.tsx +0 -2
  296. package/src/services/http-client-services.tsx +0 -75
  297. package/src/services/http-services.tsx +0 -158
  298. package/src/services/loader-service.tsx +0 -185
  299. package/src/services/localstorage-service.tsx +0 -119
  300. package/src/services/message-services.tsx +0 -383
  301. package/src/services/theme-service.tsx +0 -161
  302. package/src/services/user-services.tsx +0 -10
  303. package/src/sso-config/auth-token-validation.ts +0 -16
  304. package/src/sso-config/callback-route.tsx +0 -35
  305. package/src/sso-config/cookie-encryption.ts +0 -51
  306. package/src/sso-config/cookie-helpers.tsx +0 -102
  307. package/src/sso-config/forgot-password-route.tsx +0 -36
  308. package/src/sso-config/oauth-callback-state.ts +0 -61
  309. package/src/sso-config/pkce-helpers.ts +0 -9
  310. package/src/sso-config/provider-complete-route.tsx +0 -18
  311. package/src/sso-config/redirect-context-actions.tsx +0 -45
  312. package/src/sso-config/redirect-context-helpers.tsx +0 -159
  313. package/src/sso-config/redirect-context-persist.tsx +0 -18
  314. package/src/sso-config/redirect-context-route.tsx +0 -45
  315. package/src/sso-config/refresh-route.tsx +0 -23
  316. package/src/sso-config/sign-in-route.tsx +0 -74
  317. package/src/sso-config/sign-out-route.tsx +0 -57
  318. package/src/sso-config/sign-up-route.tsx +0 -57
  319. package/src/sso-config/sso-backend-flow.ts +0 -38
  320. package/src/sso-config/sso-complete-route.tsx +0 -50
  321. package/src/sso-config/sso-config.ts +0 -59
  322. package/src/sso-config/sso-interfaces.tsx +0 -99
  323. package/src/sso-config/sso-response-helpers.tsx +0 -20
  324. package/src/sso-server.tsx +0 -21
  325. package/src/styles/nexus.animation.css +0 -269
  326. package/src/styles/nexus.core.css +0 -119
  327. package/src/styles/nexus.dialog.css +0 -144
  328. package/src/styles/nexus.icon.css +0 -51
  329. package/src/styles/nexus.input.css +0 -207
  330. package/src/styles/nexus.loader.css +0 -11
  331. package/src/styles/nexus.logic.css +0 -47
  332. package/src/styles/nexus.utility.css +0 -347
@@ -0,0 +1,637 @@
1
+ @layer nexus.components {
2
+ /*
3
+ * Field: the frame of every input. Label, a box holding icons, the control, and buttons, then a hint or error line.
4
+ * Sizes, designs, and states only change the --nx-field-* variables below; the rules after them read those.
5
+ */
6
+ .nx-field {
7
+ --nx-field-base: var(--nx-control-md);
8
+ --nx-field-extra: 0px;
9
+ --nx-field-height: calc(var(--nx-field-base) + var(--nx-field-extra));
10
+ --nx-field-pad-x: 10px;
11
+ --nx-field-pad-y: 7px;
12
+ --nx-field-font: var(--nx-text-md);
13
+ --nx-field-label-font: var(--nx-text-sm);
14
+ --nx-field-icon: 16px;
15
+ --nx-field-bg: var(--nx-surface);
16
+ --nx-field-border: var(--nx-border-strong);
17
+ --nx-field-border-hover: color-mix(in oklab, var(--nx-border-strong), var(--nx-text) 22%);
18
+ --nx-field-accent: var(--nx-primary);
19
+ --nx-field-ring: var(--nx-focus-ring);
20
+ --nx-field-label-color: var(--nx-text-muted);
21
+ --nx-field-scrollbar: color-mix(in oklab, var(--nx-text-subtle) 75%, transparent);
22
+ --nx-field-scrollbar-hover: var(--nx-text-muted);
23
+
24
+ display: flex;
25
+ flex-direction: column;
26
+ min-width: 0;
27
+ }
28
+
29
+ .nx-field--sm {
30
+ --nx-field-base: var(--nx-control-sm);
31
+ --nx-field-pad-x: var(--nx-space-2);
32
+ --nx-field-pad-y: 4px;
33
+ --nx-field-font: var(--nx-text-sm);
34
+ --nx-field-label-font: var(--nx-text-xs);
35
+ --nx-field-icon: 14px;
36
+ }
37
+
38
+ .nx-field--lg {
39
+ --nx-field-base: var(--nx-control-lg);
40
+ --nx-field-pad-x: var(--nx-space-3);
41
+ --nx-field-pad-y: 9px;
42
+ --nx-field-font: var(--nx-text-lg);
43
+ --nx-field-label-font: var(--nx-text-md);
44
+ --nx-field-icon: 18px;
45
+ }
46
+
47
+ /* States */
48
+ .nx-field:focus-within {
49
+ --nx-field-label-color: var(--nx-field-accent);
50
+ }
51
+
52
+ .nx-field[data-invalid] {
53
+ --nx-field-border: var(--nx-danger);
54
+ --nx-field-border-hover: var(--nx-danger);
55
+ --nx-field-accent: var(--nx-danger);
56
+ --nx-field-ring: 0 0 0 3px color-mix(in oklab, var(--nx-danger) 30%, transparent);
57
+ --nx-field-label-color: var(--nx-danger);
58
+ }
59
+
60
+ /* Read-only and disabled boxes sit lower than the panel: lighter gray in light mode, the page color in dark mode. */
61
+ .nx-field:is([data-readonly], [data-disabled]) {
62
+ --nx-field-bg: light-dark(var(--nx-surface-2), var(--nx-bg));
63
+ --nx-field-border-hover: var(--nx-field-border);
64
+ }
65
+
66
+ .nx-field:is([data-readonly], [data-disabled]) .nx-field__box {
67
+ box-shadow: none;
68
+ }
69
+
70
+ .nx-field[data-disabled] {
71
+ opacity: 0.6;
72
+ }
73
+
74
+ .nx-field[data-disabled] :is(.nx-field__label, .nx-field__box, .nx-field__control) {
75
+ cursor: not-allowed;
76
+ }
77
+
78
+ /* Label above the box */
79
+ .nx-field__label {
80
+ color: var(--nx-text);
81
+ font-size: var(--nx-field-label-font);
82
+ font-weight: 500;
83
+ line-height: 1.3;
84
+ }
85
+
86
+ .nx-field--standard > .nx-field__label {
87
+ align-self: flex-start;
88
+ margin-bottom: 6px;
89
+ }
90
+
91
+ .nx-field__required {
92
+ margin-left: 3px;
93
+ color: var(--nx-danger);
94
+ }
95
+
96
+ /* Box */
97
+ .nx-field__box {
98
+ position: relative;
99
+ display: flex;
100
+ align-items: center;
101
+ min-height: var(--nx-field-height);
102
+ border: 1px solid var(--nx-field-border);
103
+ border-radius: var(--nx-radius);
104
+ background: var(--nx-field-bg);
105
+ box-shadow: var(--nx-shadow-sm);
106
+ font-size: var(--nx-field-font);
107
+ transition:
108
+ border-color var(--nx-duration),
109
+ box-shadow var(--nx-duration);
110
+ }
111
+
112
+ .nx-field__box:hover {
113
+ border-color: var(--nx-field-border-hover);
114
+ }
115
+
116
+ .nx-field__box:focus-within {
117
+ border-color: var(--nx-field-accent);
118
+ box-shadow: var(--nx-field-ring);
119
+ }
120
+
121
+ .nx-field__control {
122
+ flex: 1 1 auto;
123
+ align-self: stretch;
124
+ width: 100%;
125
+ min-width: 0;
126
+ margin: 0;
127
+ padding: 0 var(--nx-field-pad-x);
128
+ border: 0;
129
+ border-radius: inherit;
130
+ outline: none;
131
+ background: transparent;
132
+ color: var(--nx-text);
133
+ font-size: var(--nx-field-font);
134
+ line-height: 1.4;
135
+ text-overflow: ellipsis;
136
+ }
137
+
138
+ /* Numbers line up digit under digit. */
139
+ .nx-field__control--number {
140
+ font-variant-numeric: tabular-nums;
141
+ }
142
+
143
+ .nx-field__control::placeholder {
144
+ color: var(--nx-text-subtle);
145
+ opacity: 1;
146
+ }
147
+
148
+ /* Browser extras that the field replaces with its own buttons. */
149
+ .nx-field__control::-webkit-search-cancel-button,
150
+ .nx-field__control::-webkit-search-decoration {
151
+ appearance: none;
152
+ }
153
+
154
+ .nx-field__control::-ms-reveal,
155
+ .nx-field__control::-ms-clear {
156
+ display: none;
157
+ }
158
+
159
+ /* Autofilled values keep the field's own colors. */
160
+ .nx-field__control:is(:autofill, :-webkit-autofill) {
161
+ -webkit-text-fill-color: var(--nx-text);
162
+ caret-color: var(--nx-text);
163
+ box-shadow: 0 0 0 100px var(--nx-field-bg) inset;
164
+ }
165
+
166
+ /* Icons */
167
+ .nx-field__icon {
168
+ display: flex;
169
+ align-items: center;
170
+ flex-shrink: 0;
171
+ padding-left: var(--nx-field-pad-x);
172
+ color: var(--nx-text-subtle);
173
+ pointer-events: none;
174
+ transition: color var(--nx-duration);
175
+ }
176
+
177
+ .nx-field__icon .nx-icon,
178
+ .nx-field__action .nx-icon,
179
+ .nx-field__lock .nx-icon {
180
+ width: var(--nx-field-icon);
181
+ height: var(--nx-field-icon);
182
+ vertical-align: 0;
183
+ }
184
+
185
+ .nx-field__icon--end {
186
+ padding-right: var(--nx-field-pad-x);
187
+ padding-left: 0;
188
+ }
189
+
190
+ .nx-field__box:focus-within .nx-field__icon,
191
+ .nx-field[data-invalid] .nx-field__icon {
192
+ color: var(--nx-field-accent);
193
+ }
194
+
195
+ .nx-field__icon:not(.nx-field__icon--end) + .nx-field__control {
196
+ padding-left: var(--nx-space-2);
197
+ }
198
+
199
+ .nx-field__control:has(~ .nx-field__actions, ~ .nx-field__icon--end) {
200
+ padding-right: var(--nx-space-1);
201
+ }
202
+
203
+ /* Text before and after the value: a currency, a unit, a domain. Muted, so the value reads first. */
204
+ .nx-field__affix {
205
+ display: flex;
206
+ align-items: center;
207
+ align-self: stretch;
208
+ flex-shrink: 0;
209
+ padding-left: var(--nx-field-pad-x);
210
+ color: var(--nx-text-muted);
211
+ line-height: 1.4;
212
+ white-space: nowrap;
213
+ user-select: none;
214
+ }
215
+
216
+ .nx-field__affix--end {
217
+ padding-right: var(--nx-field-pad-x);
218
+ padding-left: 0;
219
+ }
220
+
221
+ .nx-field__icon:not(.nx-field__icon--end) + .nx-field__affix {
222
+ padding-left: var(--nx-space-2);
223
+ }
224
+
225
+ .nx-field__affix:not(.nx-field__affix--end) + .nx-field__control {
226
+ padding-left: 6px;
227
+ }
228
+
229
+ .nx-field__control:has(~ .nx-field__affix--end) {
230
+ padding-right: 6px;
231
+ }
232
+
233
+ .nx-field__affix--end:has(~ .nx-field__actions, ~ .nx-field__icon--end) {
234
+ padding-right: var(--nx-space-1);
235
+ }
236
+
237
+ /* Buttons inside the box: clear, show password, − and + */
238
+ .nx-field__actions {
239
+ display: flex;
240
+ align-items: center;
241
+ flex-shrink: 0;
242
+ gap: 2px;
243
+ padding-right: 4px;
244
+ }
245
+
246
+ .nx-field__actions--start {
247
+ padding-right: 0;
248
+ padding-left: 4px;
249
+ }
250
+
251
+ .nx-field__actions + .nx-field__icon--end {
252
+ padding-left: var(--nx-space-1);
253
+ }
254
+
255
+ .nx-field__action {
256
+ display: grid;
257
+ place-items: center;
258
+ width: calc(var(--nx-field-base) - 10px);
259
+ height: calc(var(--nx-field-base) - 10px);
260
+ padding: 0;
261
+ border: 0;
262
+ border-radius: var(--nx-radius-sm);
263
+ background: none;
264
+ color: var(--nx-text-subtle);
265
+ cursor: pointer;
266
+ transition:
267
+ background-color var(--nx-duration),
268
+ color var(--nx-duration);
269
+ }
270
+
271
+ .nx-field__action:hover:not(:disabled, [aria-disabled="true"]) {
272
+ background: var(--nx-surface-hover);
273
+ color: var(--nx-text);
274
+ }
275
+
276
+ .nx-field__action:focus-visible {
277
+ outline: 2px solid var(--nx-primary);
278
+ outline-offset: -2px;
279
+ }
280
+
281
+ .nx-field__action[aria-pressed="true"] {
282
+ color: var(--nx-field-accent);
283
+ }
284
+
285
+ .nx-field__action:disabled {
286
+ cursor: not-allowed;
287
+ }
288
+
289
+ /* − and +: stronger than the clear button, since they are the main way to change the value by pointer. */
290
+ .nx-field__action--step {
291
+ color: var(--nx-text-muted);
292
+ touch-action: manipulation;
293
+ user-select: none;
294
+ -webkit-touch-callout: none;
295
+ }
296
+
297
+ /* At a limit: dimmed, and the press does nothing. Not `disabled`, which would lose the pointer while it is held. */
298
+ .nx-field__action[aria-disabled="true"] {
299
+ opacity: 0.4;
300
+ cursor: default;
301
+ }
302
+
303
+ /* Split stepper: − before and + after a centered value, as in a guest or quantity picker. */
304
+ .nx-field--split .nx-field__control {
305
+ padding-inline: var(--nx-space-1);
306
+ text-align: center;
307
+ }
308
+
309
+ /*
310
+ * Read-only lock: at the end of the box, where a button that no longer works would be (a date picker's calendar, a
311
+ * number box's − and +), so a click that does nothing does not look like a bug. Muted rather than subtle, since it
312
+ * is the only sign of the state: at least 3:1 on the box in every theme. On an attempt to change the field it turns
313
+ * to the text color and nudges.
314
+ */
315
+ .nx-field__lock {
316
+ display: grid;
317
+ place-items: center;
318
+ width: calc(var(--nx-field-base) - 10px);
319
+ height: calc(var(--nx-field-base) - 10px);
320
+ color: var(--nx-text-muted);
321
+ cursor: default;
322
+ }
323
+
324
+ /* After the label of a field without a box: a checkbox, a switch, a choice group, a slider. Sized to the label text. */
325
+ .nx-field__lock--label {
326
+ display: inline-block;
327
+ width: auto;
328
+ height: auto;
329
+ margin-left: 0.35em;
330
+ }
331
+
332
+ .nx-field__lock--label .nx-icon {
333
+ width: 1em;
334
+ height: 1em;
335
+ }
336
+
337
+ .nx-field__lock[data-nudge] {
338
+ color: var(--nx-text);
339
+ animation: nx-field-nudge 320ms ease-in-out;
340
+ }
341
+
342
+ @keyframes nx-field-nudge {
343
+ 20%,
344
+ 60% {
345
+ transform: translateX(-2px);
346
+ }
347
+
348
+ 40%,
349
+ 80% {
350
+ transform: translateX(2px);
351
+ }
352
+ }
353
+
354
+ /* The note under a read-only box, in the top layer and placed by the component. Inverted, like a tooltip. */
355
+ .nx-field-notice {
356
+ position: fixed;
357
+ inset: auto;
358
+ display: flex;
359
+ align-items: center;
360
+ gap: 6px;
361
+ max-width: min(320px, calc(100vw - 16px));
362
+ margin: 0;
363
+ padding: 6px 10px 6px 8px;
364
+ overflow: visible;
365
+ border: 0;
366
+ border-radius: var(--nx-radius);
367
+ background: var(--nx-text);
368
+ color: var(--nx-surface);
369
+ box-shadow: var(--nx-shadow);
370
+ font-size: var(--nx-text-xs);
371
+ font-weight: 500;
372
+ line-height: 1.35;
373
+ pointer-events: none;
374
+ }
375
+
376
+ .nx-field-notice:popover-open {
377
+ animation: nx-field-notice-in 120ms ease-out;
378
+ }
379
+
380
+ @keyframes nx-field-notice-in {
381
+ from {
382
+ opacity: 0;
383
+ transform: translateY(-4px);
384
+ }
385
+ }
386
+
387
+ .nx-field-notice .nx-icon {
388
+ flex-shrink: 0;
389
+ width: 14px;
390
+ height: 14px;
391
+ vertical-align: 0;
392
+ }
393
+
394
+ /* Nothing to clear in an empty field. The control always has a placeholder, so :placeholder-shown means empty. */
395
+ .nx-field__box:has(.nx-field__control:placeholder-shown) .nx-field__action--clear {
396
+ display: none;
397
+ }
398
+
399
+ /* Hint, error, and count under the box */
400
+ .nx-field__footer {
401
+ display: flex;
402
+ align-items: flex-start;
403
+ gap: var(--nx-space-3);
404
+ margin-top: 5px;
405
+ font-size: var(--nx-text-xs);
406
+ line-height: 1.35;
407
+ }
408
+
409
+ .nx-field__message {
410
+ display: flex;
411
+ gap: 5px;
412
+ min-width: 0;
413
+ margin: 0;
414
+ color: var(--nx-text-muted);
415
+ }
416
+
417
+ .nx-field__message .nx-icon {
418
+ flex-shrink: 0;
419
+ width: 1.35em;
420
+ height: 1.35em;
421
+ vertical-align: 0;
422
+ }
423
+
424
+ .nx-field__message--error {
425
+ color: var(--nx-danger);
426
+ font-weight: 500;
427
+ }
428
+
429
+ .nx-field__aside {
430
+ margin-left: auto;
431
+ color: var(--nx-text-muted);
432
+ font-variant-numeric: tabular-nums;
433
+ white-space: nowrap;
434
+ }
435
+
436
+ /* Outlined and inbox: the label rests inside the box like a placeholder and rises on focus or once there is a value. */
437
+ :is(.nx-field--outlined, .nx-field--inbox) .nx-field__label {
438
+ position: absolute;
439
+ z-index: 1;
440
+ top: 50%;
441
+ left: var(--nx-field-pad-x);
442
+ max-width: calc(100% - 2 * var(--nx-field-pad-x));
443
+ overflow: hidden;
444
+ color: var(--nx-field-label-color);
445
+ font-size: var(--nx-field-font);
446
+ font-weight: 400;
447
+ line-height: 1.2;
448
+ text-overflow: ellipsis;
449
+ white-space: nowrap;
450
+ transform: translateY(-50%);
451
+ pointer-events: none;
452
+ transition:
453
+ top var(--nx-duration),
454
+ left var(--nx-duration),
455
+ font-size var(--nx-duration),
456
+ color var(--nx-duration),
457
+ transform var(--nx-duration);
458
+ }
459
+
460
+ /* After a start icon, the resting label lines up with the text. */
461
+ .nx-field__icon:not(.nx-field__icon--end) ~ .nx-field__label {
462
+ left: calc(var(--nx-field-pad-x) + var(--nx-field-icon) + var(--nx-space-2));
463
+ }
464
+
465
+ /* On a multi-line box, the resting label sits on the first line. */
466
+ .nx-field--multiline .nx-field__label {
467
+ top: calc(var(--nx-field-pad-y) + var(--nx-field-font) * 0.7);
468
+ }
469
+
470
+ /* Outlined: the raised label sits on the top border. Its backing covers only the lower half, so it blends with any panel. */
471
+ .nx-field--outlined:is([data-raised], :focus-within, :has(.nx-field__control:not(:placeholder-shown))) .nx-field__label {
472
+ top: 0;
473
+ left: calc(var(--nx-field-pad-x) - 4px);
474
+ padding: 0 4px;
475
+ background: linear-gradient(to bottom, transparent calc(50% - 1px), var(--nx-field-bg) calc(50% - 1px));
476
+ font-size: var(--nx-text-xs);
477
+ font-weight: 500;
478
+ }
479
+
480
+ /* Inbox: a taller box with the raised label inside its top edge. */
481
+ .nx-field--inbox {
482
+ --nx-field-extra: 12px;
483
+ --nx-field-inbox-pad: 17px;
484
+ }
485
+
486
+ .nx-field--inbox.nx-field--sm {
487
+ --nx-field-inbox-pad: 15px;
488
+ }
489
+
490
+ .nx-field--inbox.nx-field--lg {
491
+ --nx-field-inbox-pad: 19px;
492
+ }
493
+
494
+ .nx-field--inbox .nx-field__control {
495
+ padding-top: var(--nx-field-inbox-pad);
496
+ }
497
+
498
+ /*
499
+ * Beside the value: while the label rests in the middle, icons, text, and buttons line up with it. Once the label
500
+ * rises, the value sits low in the box, and they move down to its line. Buttons move halfway, so their hover
501
+ * background keeps clear of the border.
502
+ */
503
+ .nx-field--inbox :is(.nx-field__icon, .nx-field__affix, .nx-field__actions) {
504
+ align-self: stretch;
505
+ transition: padding-top var(--nx-duration);
506
+ }
507
+
508
+ .nx-field--inbox:is([data-raised], :focus-within, :has(.nx-field__control:not(:placeholder-shown))) :is(.nx-field__icon, .nx-field__affix) {
509
+ padding-top: var(--nx-field-inbox-pad);
510
+ }
511
+
512
+ .nx-field--inbox:is([data-raised], :focus-within, :has(.nx-field__control:not(:placeholder-shown))) .nx-field__actions {
513
+ padding-top: calc(var(--nx-field-inbox-pad) / 2);
514
+ }
515
+
516
+ .nx-field--inbox:is([data-raised], :focus-within, :has(.nx-field__control:not(:placeholder-shown))) .nx-field__label {
517
+ top: 5px;
518
+ font-size: var(--nx-text-xs);
519
+ font-weight: 500;
520
+ transform: none;
521
+ }
522
+
523
+ /*
524
+ * Split stepper: the label sits centered over the centered value, between − and +.
525
+ * It must come after the raised-label rule above: both have the same specificity, so the later one wins.
526
+ */
527
+ .nx-field--inbox.nx-field--split[data-raised] .nx-field__label {
528
+ left: 50%;
529
+ max-width: calc(100% - 2 * var(--nx-field-base));
530
+ transform: translateX(-50%);
531
+ }
532
+
533
+ /* Multi-line */
534
+ .nx-field--multiline .nx-field__box {
535
+ align-items: stretch;
536
+ }
537
+
538
+ .nx-field--multiline .nx-field__control {
539
+ padding: var(--nx-field-pad-y) var(--nx-field-pad-x);
540
+ font-family: inherit;
541
+ resize: vertical;
542
+ }
543
+
544
+ /* Buttons and the read-only lock sit at the top end, centered on the first line (line height 1.4). */
545
+ .nx-field--multiline .nx-field__actions {
546
+ align-items: flex-start;
547
+ padding-top: calc(var(--nx-field-pad-y) + 0.7em - (var(--nx-field-base) - 10px) / 2);
548
+ }
549
+
550
+ /*
551
+ * Thin scrollbar: 8px instead of the default 15px, a rounded thumb in theme colors, no arrow buttons.
552
+ * Chromium ignores ::-webkit-scrollbar once scrollbar-width is set, so the standard properties go only to
553
+ * browsers without it (Firefox, where "thin" is also 8px).
554
+ */
555
+ .nx-field--multiline .nx-field__control::-webkit-scrollbar {
556
+ width: 8px;
557
+ height: 8px;
558
+ }
559
+
560
+ .nx-field--multiline .nx-field__control::-webkit-scrollbar-track,
561
+ .nx-field--multiline .nx-field__control::-webkit-scrollbar-corner {
562
+ background: transparent;
563
+ }
564
+
565
+ .nx-field--multiline .nx-field__control::-webkit-scrollbar-thumb {
566
+ border: 2px solid transparent;
567
+ border-radius: var(--nx-radius-full);
568
+ background: var(--nx-field-scrollbar) padding-box;
569
+ }
570
+
571
+ .nx-field--multiline .nx-field__control::-webkit-scrollbar-thumb:hover {
572
+ background-color: var(--nx-field-scrollbar-hover);
573
+ }
574
+
575
+ /* A styled scrollbar drops the browser's resize grip, which turns light in dark mode: draw two grip lines instead. */
576
+ .nx-field--multiline .nx-field__control::-webkit-resizer {
577
+ background: linear-gradient(
578
+ 135deg,
579
+ transparent 0 48%,
580
+ var(--nx-field-scrollbar) 48% 56%,
581
+ transparent 56% 70%,
582
+ var(--nx-field-scrollbar) 70% 78%,
583
+ transparent 78%
584
+ );
585
+ }
586
+
587
+ @supports not selector(::-webkit-scrollbar) {
588
+ .nx-field--multiline .nx-field__control {
589
+ scrollbar-width: thin;
590
+ scrollbar-color: var(--nx-field-scrollbar) transparent;
591
+ }
592
+ }
593
+
594
+ .nx-field--multiline.nx-field--inbox .nx-field__control {
595
+ padding-top: calc(var(--nx-field-pad-y) + var(--nx-field-inbox-pad) - 4px);
596
+ }
597
+
598
+ .nx-field--multiline .nx-field__icon {
599
+ align-items: flex-start;
600
+ padding-top: calc(var(--nx-field-pad-y) + (1.4em - var(--nx-field-icon)) / 2);
601
+ }
602
+
603
+ .nx-field--multiline.nx-field--inbox:is([data-raised], :focus-within, :has(.nx-field__control:not(:placeholder-shown))) .nx-field__icon {
604
+ padding-top: calc(var(--nx-field-pad-y) + var(--nx-field-inbox-pad) - 4px + (1.4em - var(--nx-field-icon)) / 2);
605
+ }
606
+
607
+ .nx-field--multiline.nx-field--inbox:is([data-raised], :focus-within, :has(.nx-field__control:not(:placeholder-shown))) .nx-field__actions {
608
+ padding-top: calc(var(--nx-field-pad-y) + var(--nx-field-inbox-pad) - 4px + 0.7em - (var(--nx-field-base) - 10px) / 2);
609
+ }
610
+
611
+ /* Grows with its text between --nx-field-rows and --nx-field-max-rows lines. */
612
+ .nx-field__control--auto {
613
+ field-sizing: content;
614
+ min-height: calc(var(--nx-field-rows, 3) * 1lh + 2 * var(--nx-field-pad-y));
615
+ max-height: calc(var(--nx-field-max-rows, 12) * 1lh + 2 * var(--nx-field-pad-y));
616
+ resize: none;
617
+ }
618
+
619
+ @supports not (field-sizing: content) {
620
+ .nx-field__control--auto {
621
+ max-height: none;
622
+ resize: vertical;
623
+ }
624
+ }
625
+
626
+ @media (prefers-reduced-motion: reduce) {
627
+ .nx-field__label,
628
+ .nx-field--inbox :is(.nx-field__icon, .nx-field__affix, .nx-field__actions) {
629
+ transition: none;
630
+ }
631
+
632
+ .nx-field__lock[data-nudge],
633
+ .nx-field-notice:popover-open {
634
+ animation: none;
635
+ }
636
+ }
637
+ }