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.
- package/CHANGELOG.md +2268 -446
- package/LICENSE +21 -21
- package/README.md +1705 -1084
- package/dist/Client.Index.d.ts +17 -0
- package/dist/Client.Index.js +17 -0
- package/dist/Components/Documents/DocumentFrame.d.ts +50 -0
- package/dist/Components/Documents/DocumentFrame.js +83 -0
- package/dist/Components/Documents/Menu.d.ts +4 -0
- package/dist/Components/Documents/Menu.js +40 -24
- package/dist/Components/Documents/PrintDocument.d.ts +95 -0
- package/dist/Components/Documents/PrintDocument.js +62 -0
- package/dist/Components/Documents/Tabs.d.ts +59 -0
- package/dist/Components/Documents/Tabs.js +70 -0
- package/dist/Components/Forms/ApiForm.js +19 -2
- package/dist/Components/Forms/Crud.d.ts +2 -2
- package/dist/Components/Forms/Crud.js +871 -377
- package/dist/Components/Forms/CrudActions.d.ts +136 -0
- package/dist/Components/Forms/CrudActions.js +184 -0
- package/dist/Components/Forms/CrudHistory.d.ts +66 -0
- package/dist/Components/Forms/CrudHistory.js +140 -0
- package/dist/Components/Forms/CrudNarrowPicker.d.ts +31 -0
- package/dist/Components/Forms/CrudNarrowPicker.js +180 -0
- package/dist/Components/Forms/CrudParts.d.ts +30 -2
- package/dist/Components/Forms/CrudParts.js +56 -5
- package/dist/Components/Forms/CrudRowForms.d.ts +26 -0
- package/dist/Components/Forms/CrudRowForms.js +114 -0
- package/dist/Components/Forms/CrudScopes.d.ts +28 -0
- package/dist/Components/Forms/CrudScopes.js +76 -0
- package/dist/Components/Forms/CrudTree.d.ts +90 -0
- package/dist/Components/Forms/CrudTree.js +363 -0
- package/dist/Components/Forms/CrudWorkspace.d.ts +63 -0
- package/dist/Components/Forms/CrudWorkspace.js +169 -0
- package/dist/Components/Forms/ExcelImport.js +3 -3
- package/dist/Components/Forms/Form.d.ts +4 -4
- package/dist/Components/Forms/Form.js +125 -16
- package/dist/Components/Forms/FormLeaveGuard.d.ts +44 -0
- package/dist/Components/Forms/FormLeaveGuard.js +65 -0
- package/dist/Components/Forms/RecordFlows.d.ts +50 -0
- package/dist/Components/Forms/RecordFlows.js +282 -0
- package/dist/Components/Forms/SubmitForm.d.ts +37 -2
- package/dist/Components/Forms/SubmitForm.js +195 -10
- package/dist/Components/Inputs/CheckBox.js +1 -1
- package/dist/Components/Inputs/ChoiceField.d.ts +21 -1
- package/dist/Components/Inputs/ChoiceField.js +28 -2
- 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.d.ts +13 -0
- package/dist/Components/Inputs/Dropdown.js +8 -5
- package/dist/Components/Inputs/DropdownParts.d.ts +3 -1
- package/dist/Components/Inputs/DropdownParts.js +16 -4
- package/dist/Components/Inputs/Field.d.ts +7 -1
- package/dist/Components/Inputs/Field.js +2 -2
- package/dist/Components/Inputs/GroupForm.d.ts +6 -6
- package/dist/Components/Inputs/GroupForm.js +10 -11
- package/dist/Components/Inputs/InputRenderer.d.ts +9 -6
- package/dist/Components/Inputs/InputRenderer.js +39 -31
- package/dist/Components/Inputs/NumberBox.js +4 -2
- package/dist/Components/Inputs/PictureInput.d.ts +41 -0
- package/dist/Components/Inputs/PictureInput.js +70 -0
- package/dist/Components/Inputs/RadioGroup.d.ts +16 -3
- package/dist/Components/Inputs/RadioGroup.js +8 -3
- package/dist/Components/Inputs/RowsInput.d.ts +1 -1
- package/dist/Components/Inputs/RowsInput.js +18 -3
- package/dist/Components/Inputs/TabularForm.d.ts +5 -5
- package/dist/Components/Inputs/TabularForm.js +29 -29
- package/dist/Components/Inputs/TextArea.d.ts +6 -0
- package/dist/Components/Inputs/TextArea.js +14 -2
- package/dist/Components/Inputs/TextBox.js +4 -1
- package/dist/Components/Inputs/TextBoxTypes.d.ts +6 -0
- package/dist/Components/Inputs/TextBoxTypes.js +17 -0
- package/dist/Components/Inputs/TimePicker.js +4 -1
- package/dist/Components/Inputs/TreeView.d.ts +107 -6
- package/dist/Components/Inputs/TreeView.js +513 -30
- package/dist/Components/Layouts/MessageBox.d.ts +15 -2
- package/dist/Components/Layouts/MessageBox.js +56 -7
- package/dist/Components/Layouts/Popup.d.ts +13 -6
- package/dist/Components/Layouts/Popup.js +37 -9
- package/dist/Components/Layouts/PopupDock.d.ts +3 -1
- package/dist/Components/Layouts/PopupDock.js +2 -1
- package/dist/Components/Layouts/PopupHost.js +5 -4
- package/dist/Components/Layouts/ThemePicker.d.ts +3 -2
- package/dist/Components/Layouts/ThemePicker.js +16 -4
- package/dist/Components/Viewers/DataTable.js +205 -61
- package/dist/Components/Viewers/DataTableFilters.d.ts +1 -1
- package/dist/Components/Viewers/DataTableFilters.js +17 -2
- package/dist/Components/Viewers/DataTableParts.d.ts +46 -12
- package/dist/Components/Viewers/DataTableParts.js +62 -21
- package/dist/Components/Viewers/OwnerFiles.d.ts +175 -0
- package/dist/Components/Viewers/OwnerFiles.js +589 -0
- package/dist/Components/Viewers/QrCodeImage.d.ts +22 -0
- package/dist/Components/Viewers/QrCodeImage.js +15 -0
- package/dist/Components/Viewers/RecordCards.d.ts +16 -0
- package/dist/Components/Viewers/RecordCards.js +509 -0
- 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/BusyHooks.d.ts +6 -0
- package/dist/Helpers/BusyHooks.js +39 -0
- package/dist/Helpers/CodeHelpers.d.ts +97 -0
- package/dist/Helpers/CodeHelpers.js +332 -0
- package/dist/Helpers/CrudBackend.d.ts +114 -6
- package/dist/Helpers/CrudBackend.js +214 -11
- package/dist/Helpers/CrudColumns.d.ts +98 -0
- package/dist/Helpers/CrudColumns.js +160 -0
- package/dist/Helpers/CrudDetailsTabs.d.ts +58 -0
- package/dist/Helpers/CrudDetailsTabs.js +126 -0
- package/dist/Helpers/CrudHelpers.d.ts +130 -6
- package/dist/Helpers/CrudHelpers.js +304 -12
- package/dist/Helpers/CrudNarrowPick.d.ts +83 -0
- package/dist/Helpers/CrudNarrowPick.js +157 -0
- package/dist/Helpers/CrudRowForms.d.ts +15 -0
- package/dist/Helpers/CrudRowForms.js +43 -0
- package/dist/Helpers/CrudScopes.d.ts +32 -0
- package/dist/Helpers/CrudScopes.js +79 -0
- package/dist/Helpers/DropdownHelpers.d.ts +3 -1
- package/dist/Helpers/DropdownHelpers.js +6 -2
- package/dist/Helpers/ExcelHelpers.d.ts +1 -1
- package/dist/Helpers/ExcelHelpers.js +12 -11
- package/dist/Helpers/FileAdapter.d.ts +78 -0
- package/dist/Helpers/FileAdapter.js +102 -0
- package/dist/Helpers/FilePrimaries.d.ts +48 -0
- package/dist/Helpers/FilePrimaries.js +138 -0
- package/dist/Helpers/FormConfirm.d.ts +32 -0
- package/dist/Helpers/FormConfirm.js +40 -0
- package/dist/Helpers/FormStore.d.ts +90 -5
- package/dist/Helpers/FormStore.js +318 -22
- package/dist/Helpers/InputConditions.d.ts +50 -0
- package/dist/Helpers/InputConditions.js +168 -0
- package/dist/Helpers/InputMemory.d.ts +106 -0
- package/dist/Helpers/InputMemory.js +385 -0
- package/dist/Helpers/InputNarrowing.d.ts +18 -0
- package/dist/Helpers/InputNarrowing.js +67 -0
- package/dist/Helpers/InputParamsHelpers.d.ts +44 -1
- package/dist/Helpers/InputParamsHelpers.js +162 -71
- package/dist/Helpers/MessageBuilder.js +2 -0
- package/dist/Helpers/NexusDriveAdapter.d.ts +55 -0
- package/dist/Helpers/NexusDriveAdapter.js +207 -0
- package/dist/Helpers/NexusHelpers.d.ts +0 -0
- package/dist/Helpers/NexusHelpers.js +1 -0
- package/dist/Helpers/NumberHelpers.d.ts +95 -0
- package/dist/Helpers/NumberHelpers.js +126 -0
- package/dist/Helpers/Permissions.js +2 -1
- package/dist/Helpers/QrCode.d.ts +26 -0
- package/dist/Helpers/QrCode.js +463 -0
- package/dist/Helpers/RecordCards.d.ts +205 -0
- package/dist/Helpers/RecordCards.js +378 -0
- package/dist/Helpers/RequestCache.d.ts +47 -0
- package/dist/Helpers/RequestCache.js +132 -0
- package/dist/Helpers/RowsStore.d.ts +37 -2
- package/dist/Helpers/RowsStore.js +128 -10
- package/dist/Helpers/ServerPreview.d.ts +69 -0
- package/dist/Helpers/ServerPreview.js +99 -0
- package/dist/Helpers/TableColumns.js +4 -3
- package/dist/Helpers/TableExport.d.ts +7 -1
- package/dist/Helpers/TableExport.js +21 -15
- package/dist/Helpers/TableFilters.d.ts +1 -1
- package/dist/Helpers/TableFilters.js +24 -23
- package/dist/Helpers/TableHelpers.d.ts +24 -3
- package/dist/Helpers/TableHelpers.js +58 -12
- package/dist/Helpers/TableJoins.d.ts +83 -0
- package/dist/Helpers/TableJoins.js +284 -0
- package/dist/Helpers/TableStore.d.ts +26 -1
- package/dist/Helpers/TableStore.js +73 -7
- package/dist/Helpers/TreeStore.d.ts +306 -11
- package/dist/Helpers/TreeStore.js +1048 -90
- package/dist/Helpers/UserPreferences.d.ts +8 -0
- package/dist/Helpers/UserPreferences.js +17 -0
- package/dist/Interfaces/CrudInterfaces.d.ts +512 -14
- package/dist/Interfaces/FileInterfaces.d.ts +162 -0
- package/dist/Interfaces/FileInterfaces.js +4 -0
- package/dist/Interfaces/FormInterfaces.d.ts +393 -29
- package/dist/Interfaces/FormInterfaces.js +79 -1
- package/dist/Interfaces/InputInterfaces.d.ts +39 -3
- 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/RecordInterfaces.d.ts +367 -0
- package/dist/Interfaces/RecordInterfaces.js +1 -0
- package/dist/Interfaces/TableInterfaces.d.ts +160 -5
- 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/ExcelApi.js +5 -0
- package/dist/Services/FileApi.d.ts +13 -0
- package/dist/Services/FileApi.js +29 -0
- package/dist/Services/ImageEditorLoader.d.ts +14 -0
- package/dist/Services/ImageEditorLoader.js +51 -0
- package/dist/Services/JoinSources.d.ts +80 -0
- package/dist/Services/JoinSources.js +150 -0
- package/dist/Services/ModuleImport.d.ts +7 -0
- package/dist/Services/ModuleImport.js +22 -0
- package/dist/Services/ServerApi.d.ts +13 -2
- package/dist/Services/ServerApi.js +8 -3
- package/dist/Shared.Index.d.ts +20 -0
- package/dist/Shared.Index.js +20 -0
- package/package.json +92 -85
- package/src/Styles/Nexus.Avatar.css +80 -79
- package/src/Styles/Nexus.Base.css +117 -117
- package/src/Styles/Nexus.Button.css +186 -180
- package/src/Styles/Nexus.Calendar.css +273 -273
- package/src/Styles/Nexus.Chat.css +1443 -1443
- package/src/Styles/Nexus.Choice.css +359 -343
- package/src/Styles/Nexus.Crud.css +542 -168
- package/src/Styles/Nexus.DateTime.css +81 -81
- package/src/Styles/Nexus.Dropdown.css +733 -725
- package/src/Styles/Nexus.Editor.css +295 -295
- package/src/Styles/Nexus.Excel.css +389 -389
- package/src/Styles/Nexus.Files.css +410 -0
- package/src/Styles/Nexus.Form.css +282 -279
- package/src/Styles/Nexus.Index.css +41 -37
- package/src/Styles/Nexus.Input.css +238 -4
- package/src/Styles/Nexus.Markdown.css +237 -237
- package/src/Styles/Nexus.Menu.css +246 -237
- package/src/Styles/Nexus.Popup.css +800 -724
- package/src/Styles/Nexus.Print.css +288 -0
- package/src/Styles/Nexus.QrCode.css +12 -0
- package/src/Styles/Nexus.Record.css +430 -0
- package/src/Styles/Nexus.Rows.css +637 -637
- package/src/Styles/Nexus.Slider.css +276 -276
- package/src/Styles/Nexus.Tab.Buttons.css +497 -432
- package/src/Styles/Nexus.Table.css +98 -35
- package/src/Styles/Nexus.Theme.Picker.css +59 -3
- package/src/Styles/Nexus.Themes.css +200 -194
- package/src/Styles/Nexus.Time.css +144 -144
- package/src/Styles/Nexus.Toast.css +263 -263
- package/src/Styles/Nexus.Tokens.css +94 -89
- package/src/Styles/Nexus.Tree.css +530 -431
|
@@ -1,343 +1,359 @@
|
|
|
1
|
-
@layer nexus.components {
|
|
2
|
-
/*
|
|
3
|
-
* Checkbox, radio, and switch. Each is the native input drawn with CSS (appearance: none), so an option is one
|
|
4
|
-
* element that forms, keyboards, and screen readers already understand. Marks are masks filled with theme colors.
|
|
5
|
-
*/
|
|
6
|
-
.nx-choice {
|
|
7
|
-
--nx-choice-size: 16px;
|
|
8
|
-
--nx-choice-font: var(--nx-text-md);
|
|
9
|
-
--nx-choice-gap: var(--nx-space-2);
|
|
10
|
-
/* The box edge meets 3:1 contrast on the panel in every theme (text-subtle is checked for it). */
|
|
11
|
-
--nx-choice-border: var(--nx-text-subtle);
|
|
12
|
-
--nx-choice-border-hover: var(--nx-text-muted);
|
|
13
|
-
--nx-choice-bg: var(--nx-surface);
|
|
14
|
-
--nx-choice-accent: var(--nx-primary-solid);
|
|
15
|
-
--nx-choice-mark: var(--nx-primary-text);
|
|
16
|
-
|
|
17
|
-
display: inline-flex;
|
|
18
|
-
align-items: flex-start;
|
|
19
|
-
gap: var(--nx-choice-gap);
|
|
20
|
-
min-width: 0;
|
|
21
|
-
color: var(--nx-text);
|
|
22
|
-
font-size: var(--nx-choice-font);
|
|
23
|
-
line-height: 1.45;
|
|
24
|
-
cursor: pointer;
|
|
25
|
-
-webkit-tap-highlight-color: transparent;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.nx-choice--sm {
|
|
29
|
-
--nx-choice-size: 14px;
|
|
30
|
-
--nx-choice-font: var(--nx-text-sm);
|
|
31
|
-
--nx-choice-gap: 6px;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.nx-choice--lg {
|
|
35
|
-
--nx-choice-size: 20px;
|
|
36
|
-
--nx-choice-font: var(--nx-text-lg);
|
|
37
|
-
--nx-choice-gap: 10px;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/* Label first, control at the end of the row: settings lists. */
|
|
41
|
-
.nx-choice--start {
|
|
42
|
-
flex-direction: row-reverse;
|
|
43
|
-
justify-content: space-between;
|
|
44
|
-
width: 100%;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.nx-choice__control {
|
|
48
|
-
appearance: none;
|
|
49
|
-
display: grid;
|
|
50
|
-
place-content: center;
|
|
51
|
-
flex-shrink: 0;
|
|
52
|
-
width: var(--nx-choice-size);
|
|
53
|
-
height: var(--nx-choice-size);
|
|
54
|
-
/* Centered on the first line of the label. */
|
|
55
|
-
margin: calc((1lh - var(--nx-choice-size)) / 2) 0 0;
|
|
56
|
-
border: 1px solid var(--nx-choice-border);
|
|
57
|
-
border-radius: 4px;
|
|
58
|
-
background: var(--nx-choice-bg);
|
|
59
|
-
color: var(--nx-choice-mark);
|
|
60
|
-
font: inherit;
|
|
61
|
-
cursor: inherit;
|
|
62
|
-
transition:
|
|
63
|
-
background-color var(--nx-duration),
|
|
64
|
-
border-color var(--nx-duration);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
.nx-choice__control::before {
|
|
68
|
-
content: "";
|
|
69
|
-
width: calc(var(--nx-choice-size) - 2px);
|
|
70
|
-
height: calc(var(--nx-choice-size) - 2px);
|
|
71
|
-
background: currentColor;
|
|
72
|
-
transform: scale(0);
|
|
73
|
-
transition: transform var(--nx-duration) ease-out;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
.nx-choice:hover .nx-choice__control:not(:checked, :indeterminate, :disabled) {
|
|
77
|
-
border-color: var(--nx-choice-border-hover);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
.nx-choice__control:focus-visible {
|
|
81
|
-
outline: 2px solid var(--nx-primary);
|
|
82
|
-
outline-offset: 2px;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
/* Checkbox */
|
|
86
|
-
.nx-choice__control--checkbox::before {
|
|
87
|
-
mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5l9.5 -10'/%3E%3C/svg%3E") center / 100% no-repeat;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
.nx-choice__control--checkbox:indeterminate::before {
|
|
91
|
-
mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.2' stroke-linecap='round'%3E%3Cpath d='M6 12h12'/%3E%3C/svg%3E");
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
.nx-choice__control--checkbox:is(:checked, :indeterminate) {
|
|
95
|
-
border-color: var(--nx-choice-accent);
|
|
96
|
-
background: var(--nx-choice-accent);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
.nx-choice__control--checkbox:is(:checked, :indeterminate)::before {
|
|
100
|
-
transform: scale(1);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
/* Radio */
|
|
104
|
-
.nx-choice__control--radio {
|
|
105
|
-
border-radius: 50%;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
.nx-choice__control--radio::before {
|
|
109
|
-
width: calc(var(--nx-choice-size) * 0.375);
|
|
110
|
-
height: calc(var(--nx-choice-size) * 0.375);
|
|
111
|
-
border-radius: 50%;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
.nx-choice__control--radio:checked {
|
|
115
|
-
border-color: var(--nx-choice-accent);
|
|
116
|
-
background: var(--nx-choice-accent);
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
.nx-choice__control--radio:checked::before {
|
|
120
|
-
transform: scale(1);
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
/*
|
|
124
|
-
* Switch: a track and a thumb. Off, the track is the subtle text color, so its edge keeps 3:1 contrast;
|
|
125
|
-
* on, it is the primary color. The thumb looks the same in both states: the panel color when off, and the text
|
|
126
|
-
* color for primary when on, which is white in light themes and near black in dark ones, like the panel.
|
|
127
|
-
*/
|
|
128
|
-
.nx-choice__control--switch {
|
|
129
|
-
--nx-switch-height: calc(var(--nx-choice-size) + 2px);
|
|
130
|
-
--nx-switch-width: calc(var(--nx-switch-height) * 1.8);
|
|
131
|
-
--nx-switch-thumb: calc(var(--nx-switch-height) - 4px);
|
|
132
|
-
|
|
133
|
-
place-content: center start;
|
|
134
|
-
width: var(--nx-switch-width);
|
|
135
|
-
height: var(--nx-switch-height);
|
|
136
|
-
margin-top: calc((1lh - var(--nx-switch-height)) / 2);
|
|
137
|
-
padding: 0 2px;
|
|
138
|
-
border: 0;
|
|
139
|
-
border-radius: var(--nx-radius-full);
|
|
140
|
-
background: var(--nx-choice-border);
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
.nx-choice__control--switch::before {
|
|
144
|
-
width: var(--nx-switch-thumb);
|
|
145
|
-
height: var(--nx-switch-thumb);
|
|
146
|
-
border-radius: 50%;
|
|
147
|
-
background: var(--nx-surface);
|
|
148
|
-
box-shadow: 0 1px 2px rgb(0 0 0 / 0.25);
|
|
149
|
-
transform: none;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
.nx-choice:hover .nx-choice__control--switch:not(:checked, :disabled) {
|
|
153
|
-
background: var(--nx-choice-border-hover);
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
.nx-choice__control--switch:checked {
|
|
157
|
-
background: var(--nx-choice-accent);
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
.nx-choice__control--switch:checked::before {
|
|
161
|
-
background: var(--nx-choice-mark);
|
|
162
|
-
transform: translateX(calc(var(--nx-switch-width) - var(--nx-switch-height)));
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
/* Text beside the control */
|
|
166
|
-
.nx-choice__text {
|
|
167
|
-
display: grid;
|
|
168
|
-
gap: 1px;
|
|
169
|
-
min-width: 0;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
.nx-choice__description {
|
|
173
|
-
color: var(--nx-text-muted);
|
|
174
|
-
font-size: calc(var(--nx-choice-font) - 1px);
|
|
175
|
-
line-height: 1.4;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
.nx-choice__icon {
|
|
179
|
-
display: flex;
|
|
180
|
-
align-items: center;
|
|
181
|
-
height: 1lh;
|
|
182
|
-
color: var(--nx-text-muted);
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
.nx-choice__icon .nx-icon {
|
|
186
|
-
width: calc(var(--nx-choice-size) + 2px);
|
|
187
|
-
height: calc(var(--nx-choice-size) + 2px);
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
/* States */
|
|
191
|
-
.nx-choice:has(> .nx-choice__control:disabled) {
|
|
192
|
-
cursor: not-allowed;
|
|
193
|
-
opacity: 0.55;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
[data-readonly] .nx-choice {
|
|
197
|
-
cursor: default;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
[data-readonly] .nx-choice__control:not(:checked, :indeterminate) {
|
|
201
|
-
--nx-choice-bg: var(--nx-surface-2);
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
[data-readonly] .nx-choice__control:is(:checked, :indeterminate) {
|
|
205
|
-
--nx-choice-accent: color-mix(in oklab, var(--nx-primary-solid) 70%, var(--nx-surface));
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
[data-invalid] .nx-choice__control:not(:checked, :indeterminate) {
|
|
209
|
-
--nx-choice-border: var(--nx-danger);
|
|
210
|
-
--nx-choice-border-hover: var(--nx-danger);
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
/* A single checkbox or switch, with its message line. */
|
|
214
|
-
.nx-choice-field {
|
|
215
|
-
display: flex;
|
|
216
|
-
flex-direction: column;
|
|
217
|
-
align-items: flex-start;
|
|
218
|
-
min-width: 0;
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
.nx-choice-field:has(> .nx-choice--start) {
|
|
222
|
-
align-items: stretch;
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
/* Groups */
|
|
226
|
-
.nx-choices {
|
|
227
|
-
--nx-field-label-font: var(--nx-text-sm);
|
|
228
|
-
--nx-choices-gap-x: var(--nx-space-5);
|
|
229
|
-
--nx-choices-gap-y: var(--nx-space-2);
|
|
230
|
-
|
|
231
|
-
min-width: 0;
|
|
232
|
-
margin: 0;
|
|
233
|
-
padding: 0;
|
|
234
|
-
border: 0;
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
.nx-choices--sm {
|
|
238
|
-
--nx-field-label-font: var(--nx-text-xs);
|
|
239
|
-
--nx-choices-gap-y: 6px;
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
.nx-choices--lg {
|
|
243
|
-
--nx-field-label-font: var(--nx-text-md);
|
|
244
|
-
--nx-choices-gap-y: var(--nx-space-3);
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
.nx-choices__legend {
|
|
248
|
-
margin-bottom: var(--nx-space-2);
|
|
249
|
-
padding: 0;
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
/*
|
|
253
|
-
* Options fill up to --nx-choices-columns columns, and wrap to fewer when a column would be narrower than 160px,
|
|
254
|
-
* so three columns on a desktop become one on a phone without a media query.
|
|
255
|
-
*/
|
|
256
|
-
.nx-choices__options {
|
|
257
|
-
display: grid;
|
|
258
|
-
grid-template-columns: repeat(
|
|
259
|
-
auto-fill,
|
|
260
|
-
minmax(min(100%, max(160px, (100% - (var(--nx-choices-columns, 1) - 1) * var(--nx-choices-gap-x)) / var(--nx-choices-columns, 1))), 1fr)
|
|
261
|
-
);
|
|
262
|
-
align-items: start;
|
|
263
|
-
gap: var(--nx-choices-gap-y) var(--nx-choices-gap-x);
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
.nx-choices--horizontal .nx-choices__options {
|
|
267
|
-
display: flex;
|
|
268
|
-
flex-wrap: wrap;
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
.nx-choices__all {
|
|
272
|
-
display: flex;
|
|
273
|
-
margin-bottom: var(--nx-choices-gap-y);
|
|
274
|
-
padding-bottom: var(--nx-choices-gap-y);
|
|
275
|
-
border-bottom: 1px solid var(--nx-border);
|
|
276
|
-
font-weight: 500;
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
.nx-choices > .nx-field__footer {
|
|
280
|
-
margin-top: var(--nx-space-2);
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
/* Cards: each option is a card; the chosen one takes a primary edge and a light primary tint. */
|
|
284
|
-
.nx-choices--cards {
|
|
285
|
-
--nx-choices-gap-x: var(--nx-space-3);
|
|
286
|
-
--nx-choices-gap-y: var(--nx-space-3);
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
.nx-choices--cards .nx-choices__options {
|
|
290
|
-
align-items: stretch;
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
.nx-choices--cards .nx-choice {
|
|
294
|
-
padding: var(--nx-space-3) var(--nx-space-4) var(--nx-space-3) var(--nx-space-3);
|
|
295
|
-
border: 1px solid var(--nx-border);
|
|
296
|
-
border-radius: var(--nx-radius-lg);
|
|
297
|
-
background: var(--nx-surface);
|
|
298
|
-
box-shadow: var(--nx-shadow-sm);
|
|
299
|
-
transition:
|
|
300
|
-
border-color var(--nx-duration),
|
|
301
|
-
background-color var(--nx-duration),
|
|
302
|
-
box-shadow var(--nx-duration);
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
.nx-choices--cards .nx-choice__label {
|
|
306
|
-
font-weight: 500;
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
.nx-choices--cards .nx-choice:hover:not(:has(> :disabled)) {
|
|
310
|
-
border-color: var(--nx-border-strong);
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
/* The inset ring doubles the edge without moving the content. */
|
|
314
|
-
.nx-choices--cards .nx-choice:has(> .nx-choice__control:checked) {
|
|
315
|
-
border-color: var(--nx-choice-accent);
|
|
316
|
-
background: color-mix(in oklab, var(--nx-choice-accent) 7%, var(--nx-surface));
|
|
317
|
-
box-shadow: inset 0 0 0 1px var(--nx-choice-accent);
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
.nx-choices--cards .nx-choice:has(> .nx-choice__control:checked) .nx-choice__icon {
|
|
321
|
-
color: var(--nx-choice-accent);
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
/* The focus ring goes around the whole card rather than the small control. */
|
|
325
|
-
.nx-choices--cards .nx-choice:has(> .nx-choice__control:focus-visible) {
|
|
326
|
-
outline: 2px solid var(--nx-primary);
|
|
327
|
-
outline-offset: 2px;
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
.nx-choices--cards .nx-choice__control:focus-visible {
|
|
331
|
-
outline: none;
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
.nx-choices--cards[data-invalid] .nx-choice {
|
|
335
|
-
border-color: var(--nx-danger);
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
1
|
+
@layer nexus.components {
|
|
2
|
+
/*
|
|
3
|
+
* Checkbox, radio, and switch. Each is the native input drawn with CSS (appearance: none), so an option is one
|
|
4
|
+
* element that forms, keyboards, and screen readers already understand. Marks are masks filled with theme colors.
|
|
5
|
+
*/
|
|
6
|
+
.nx-choice {
|
|
7
|
+
--nx-choice-size: 16px;
|
|
8
|
+
--nx-choice-font: var(--nx-text-md);
|
|
9
|
+
--nx-choice-gap: var(--nx-space-2);
|
|
10
|
+
/* The box edge meets 3:1 contrast on the panel in every theme (text-subtle is checked for it). */
|
|
11
|
+
--nx-choice-border: var(--nx-text-subtle);
|
|
12
|
+
--nx-choice-border-hover: var(--nx-text-muted);
|
|
13
|
+
--nx-choice-bg: var(--nx-surface);
|
|
14
|
+
--nx-choice-accent: var(--nx-primary-solid);
|
|
15
|
+
--nx-choice-mark: var(--nx-primary-text);
|
|
16
|
+
|
|
17
|
+
display: inline-flex;
|
|
18
|
+
align-items: flex-start;
|
|
19
|
+
gap: var(--nx-choice-gap);
|
|
20
|
+
min-width: 0;
|
|
21
|
+
color: var(--nx-text);
|
|
22
|
+
font-size: var(--nx-choice-font);
|
|
23
|
+
line-height: 1.45;
|
|
24
|
+
cursor: pointer;
|
|
25
|
+
-webkit-tap-highlight-color: transparent;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.nx-choice--sm {
|
|
29
|
+
--nx-choice-size: 14px;
|
|
30
|
+
--nx-choice-font: var(--nx-text-sm);
|
|
31
|
+
--nx-choice-gap: 6px;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.nx-choice--lg {
|
|
35
|
+
--nx-choice-size: 20px;
|
|
36
|
+
--nx-choice-font: var(--nx-text-lg);
|
|
37
|
+
--nx-choice-gap: 10px;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/* Label first, control at the end of the row: settings lists. */
|
|
41
|
+
.nx-choice--start {
|
|
42
|
+
flex-direction: row-reverse;
|
|
43
|
+
justify-content: space-between;
|
|
44
|
+
width: 100%;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.nx-choice__control {
|
|
48
|
+
appearance: none;
|
|
49
|
+
display: grid;
|
|
50
|
+
place-content: center;
|
|
51
|
+
flex-shrink: 0;
|
|
52
|
+
width: var(--nx-choice-size);
|
|
53
|
+
height: var(--nx-choice-size);
|
|
54
|
+
/* Centered on the first line of the label. */
|
|
55
|
+
margin: calc((1lh - var(--nx-choice-size)) / 2) 0 0;
|
|
56
|
+
border: 1px solid var(--nx-choice-border);
|
|
57
|
+
border-radius: 4px;
|
|
58
|
+
background: var(--nx-choice-bg);
|
|
59
|
+
color: var(--nx-choice-mark);
|
|
60
|
+
font: inherit;
|
|
61
|
+
cursor: inherit;
|
|
62
|
+
transition:
|
|
63
|
+
background-color var(--nx-duration),
|
|
64
|
+
border-color var(--nx-duration);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.nx-choice__control::before {
|
|
68
|
+
content: "";
|
|
69
|
+
width: calc(var(--nx-choice-size) - 2px);
|
|
70
|
+
height: calc(var(--nx-choice-size) - 2px);
|
|
71
|
+
background: currentColor;
|
|
72
|
+
transform: scale(0);
|
|
73
|
+
transition: transform var(--nx-duration) ease-out;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.nx-choice:hover .nx-choice__control:not(:checked, :indeterminate, :disabled) {
|
|
77
|
+
border-color: var(--nx-choice-border-hover);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.nx-choice__control:focus-visible {
|
|
81
|
+
outline: 2px solid var(--nx-primary);
|
|
82
|
+
outline-offset: 2px;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/* Checkbox */
|
|
86
|
+
.nx-choice__control--checkbox::before {
|
|
87
|
+
mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5l9.5 -10'/%3E%3C/svg%3E") center / 100% no-repeat;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.nx-choice__control--checkbox:indeterminate::before {
|
|
91
|
+
mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.2' stroke-linecap='round'%3E%3Cpath d='M6 12h12'/%3E%3C/svg%3E");
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.nx-choice__control--checkbox:is(:checked, :indeterminate) {
|
|
95
|
+
border-color: var(--nx-choice-accent);
|
|
96
|
+
background: var(--nx-choice-accent);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.nx-choice__control--checkbox:is(:checked, :indeterminate)::before {
|
|
100
|
+
transform: scale(1);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/* Radio */
|
|
104
|
+
.nx-choice__control--radio {
|
|
105
|
+
border-radius: 50%;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.nx-choice__control--radio::before {
|
|
109
|
+
width: calc(var(--nx-choice-size) * 0.375);
|
|
110
|
+
height: calc(var(--nx-choice-size) * 0.375);
|
|
111
|
+
border-radius: 50%;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.nx-choice__control--radio:checked {
|
|
115
|
+
border-color: var(--nx-choice-accent);
|
|
116
|
+
background: var(--nx-choice-accent);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.nx-choice__control--radio:checked::before {
|
|
120
|
+
transform: scale(1);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/*
|
|
124
|
+
* Switch: a track and a thumb. Off, the track is the subtle text color, so its edge keeps 3:1 contrast;
|
|
125
|
+
* on, it is the primary color. The thumb looks the same in both states: the panel color when off, and the text
|
|
126
|
+
* color for primary when on, which is white in light themes and near black in dark ones, like the panel.
|
|
127
|
+
*/
|
|
128
|
+
.nx-choice__control--switch {
|
|
129
|
+
--nx-switch-height: calc(var(--nx-choice-size) + 2px);
|
|
130
|
+
--nx-switch-width: calc(var(--nx-switch-height) * 1.8);
|
|
131
|
+
--nx-switch-thumb: calc(var(--nx-switch-height) - 4px);
|
|
132
|
+
|
|
133
|
+
place-content: center start;
|
|
134
|
+
width: var(--nx-switch-width);
|
|
135
|
+
height: var(--nx-switch-height);
|
|
136
|
+
margin-top: calc((1lh - var(--nx-switch-height)) / 2);
|
|
137
|
+
padding: 0 2px;
|
|
138
|
+
border: 0;
|
|
139
|
+
border-radius: var(--nx-radius-full);
|
|
140
|
+
background: var(--nx-choice-border);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.nx-choice__control--switch::before {
|
|
144
|
+
width: var(--nx-switch-thumb);
|
|
145
|
+
height: var(--nx-switch-thumb);
|
|
146
|
+
border-radius: 50%;
|
|
147
|
+
background: var(--nx-surface);
|
|
148
|
+
box-shadow: 0 1px 2px rgb(0 0 0 / 0.25);
|
|
149
|
+
transform: none;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.nx-choice:hover .nx-choice__control--switch:not(:checked, :disabled) {
|
|
153
|
+
background: var(--nx-choice-border-hover);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.nx-choice__control--switch:checked {
|
|
157
|
+
background: var(--nx-choice-accent);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.nx-choice__control--switch:checked::before {
|
|
161
|
+
background: var(--nx-choice-mark);
|
|
162
|
+
transform: translateX(calc(var(--nx-switch-width) - var(--nx-switch-height)));
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/* Text beside the control */
|
|
166
|
+
.nx-choice__text {
|
|
167
|
+
display: grid;
|
|
168
|
+
gap: 1px;
|
|
169
|
+
min-width: 0;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.nx-choice__description {
|
|
173
|
+
color: var(--nx-text-muted);
|
|
174
|
+
font-size: calc(var(--nx-choice-font) - 1px);
|
|
175
|
+
line-height: 1.4;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.nx-choice__icon {
|
|
179
|
+
display: flex;
|
|
180
|
+
align-items: center;
|
|
181
|
+
height: 1lh;
|
|
182
|
+
color: var(--nx-text-muted);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.nx-choice__icon .nx-icon {
|
|
186
|
+
width: calc(var(--nx-choice-size) + 2px);
|
|
187
|
+
height: calc(var(--nx-choice-size) + 2px);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/* States */
|
|
191
|
+
.nx-choice:has(> .nx-choice__control:disabled) {
|
|
192
|
+
cursor: not-allowed;
|
|
193
|
+
opacity: 0.55;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
[data-readonly] .nx-choice {
|
|
197
|
+
cursor: default;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
[data-readonly] .nx-choice__control:not(:checked, :indeterminate) {
|
|
201
|
+
--nx-choice-bg: var(--nx-surface-2);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
[data-readonly] .nx-choice__control:is(:checked, :indeterminate) {
|
|
205
|
+
--nx-choice-accent: color-mix(in oklab, var(--nx-primary-solid) 70%, var(--nx-surface));
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
[data-invalid] .nx-choice__control:not(:checked, :indeterminate) {
|
|
209
|
+
--nx-choice-border: var(--nx-danger);
|
|
210
|
+
--nx-choice-border-hover: var(--nx-danger);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/* A single checkbox or switch, with its message line. */
|
|
214
|
+
.nx-choice-field {
|
|
215
|
+
display: flex;
|
|
216
|
+
flex-direction: column;
|
|
217
|
+
align-items: flex-start;
|
|
218
|
+
min-width: 0;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.nx-choice-field:has(> .nx-choice--start) {
|
|
222
|
+
align-items: stretch;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
/* Groups */
|
|
226
|
+
.nx-choices {
|
|
227
|
+
--nx-field-label-font: var(--nx-text-sm);
|
|
228
|
+
--nx-choices-gap-x: var(--nx-space-5);
|
|
229
|
+
--nx-choices-gap-y: var(--nx-space-2);
|
|
230
|
+
|
|
231
|
+
min-width: 0;
|
|
232
|
+
margin: 0;
|
|
233
|
+
padding: 0;
|
|
234
|
+
border: 0;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.nx-choices--sm {
|
|
238
|
+
--nx-field-label-font: var(--nx-text-xs);
|
|
239
|
+
--nx-choices-gap-y: 6px;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
.nx-choices--lg {
|
|
243
|
+
--nx-field-label-font: var(--nx-text-md);
|
|
244
|
+
--nx-choices-gap-y: var(--nx-space-3);
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
.nx-choices__legend {
|
|
248
|
+
margin-bottom: var(--nx-space-2);
|
|
249
|
+
padding: 0;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
/*
|
|
253
|
+
* Options fill up to --nx-choices-columns columns, and wrap to fewer when a column would be narrower than 160px,
|
|
254
|
+
* so three columns on a desktop become one on a phone without a media query.
|
|
255
|
+
*/
|
|
256
|
+
.nx-choices__options {
|
|
257
|
+
display: grid;
|
|
258
|
+
grid-template-columns: repeat(
|
|
259
|
+
auto-fill,
|
|
260
|
+
minmax(min(100%, max(160px, (100% - (var(--nx-choices-columns, 1) - 1) * var(--nx-choices-gap-x)) / var(--nx-choices-columns, 1))), 1fr)
|
|
261
|
+
);
|
|
262
|
+
align-items: start;
|
|
263
|
+
gap: var(--nx-choices-gap-y) var(--nx-choices-gap-x);
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
.nx-choices--horizontal .nx-choices__options {
|
|
267
|
+
display: flex;
|
|
268
|
+
flex-wrap: wrap;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
.nx-choices__all {
|
|
272
|
+
display: flex;
|
|
273
|
+
margin-bottom: var(--nx-choices-gap-y);
|
|
274
|
+
padding-bottom: var(--nx-choices-gap-y);
|
|
275
|
+
border-bottom: 1px solid var(--nx-border);
|
|
276
|
+
font-weight: 500;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
.nx-choices > .nx-field__footer {
|
|
280
|
+
margin-top: var(--nx-space-2);
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
/* Cards: each option is a card; the chosen one takes a primary edge and a light primary tint. */
|
|
284
|
+
.nx-choices--cards {
|
|
285
|
+
--nx-choices-gap-x: var(--nx-space-3);
|
|
286
|
+
--nx-choices-gap-y: var(--nx-space-3);
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
.nx-choices--cards .nx-choices__options {
|
|
290
|
+
align-items: stretch;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
.nx-choices--cards .nx-choice {
|
|
294
|
+
padding: var(--nx-space-3) var(--nx-space-4) var(--nx-space-3) var(--nx-space-3);
|
|
295
|
+
border: 1px solid var(--nx-border);
|
|
296
|
+
border-radius: var(--nx-radius-lg);
|
|
297
|
+
background: var(--nx-surface);
|
|
298
|
+
box-shadow: var(--nx-shadow-sm);
|
|
299
|
+
transition:
|
|
300
|
+
border-color var(--nx-duration),
|
|
301
|
+
background-color var(--nx-duration),
|
|
302
|
+
box-shadow var(--nx-duration);
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
.nx-choices--cards .nx-choice__label {
|
|
306
|
+
font-weight: 500;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
.nx-choices--cards .nx-choice:hover:not(:has(> :disabled)) {
|
|
310
|
+
border-color: var(--nx-border-strong);
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
/* The inset ring doubles the edge without moving the content. */
|
|
314
|
+
.nx-choices--cards .nx-choice:has(> .nx-choice__control:checked) {
|
|
315
|
+
border-color: var(--nx-choice-accent);
|
|
316
|
+
background: color-mix(in oklab, var(--nx-choice-accent) 7%, var(--nx-surface));
|
|
317
|
+
box-shadow: inset 0 0 0 1px var(--nx-choice-accent);
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
.nx-choices--cards .nx-choice:has(> .nx-choice__control:checked) .nx-choice__icon {
|
|
321
|
+
color: var(--nx-choice-accent);
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
/* The focus ring goes around the whole card rather than the small control. */
|
|
325
|
+
.nx-choices--cards .nx-choice:has(> .nx-choice__control:focus-visible) {
|
|
326
|
+
outline: 2px solid var(--nx-primary);
|
|
327
|
+
outline-offset: 2px;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
.nx-choices--cards .nx-choice__control:focus-visible {
|
|
331
|
+
outline: none;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
.nx-choices--cards[data-invalid] .nx-choice {
|
|
335
|
+
border-color: var(--nx-danger);
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
/*
|
|
339
|
+
* Tabs (`RadioGroup design="tabs"`): the options on a `TabButtons` track that wraps (`nx-tabs--wrap`), each chosen
|
|
340
|
+
* option raised; the chosen option's description on a line under the track, the others' in their tooltips. An
|
|
341
|
+
* invalid group edges the track in the danger colour.
|
|
342
|
+
*/
|
|
343
|
+
.nx-choices--tabs[data-invalid] .nx-tabs {
|
|
344
|
+
--nx-tabs-track-border: var(--nx-danger);
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
.nx-choices__note {
|
|
348
|
+
margin: var(--nx-space-2) 0 0;
|
|
349
|
+
color: var(--nx-text-muted);
|
|
350
|
+
font-size: var(--nx-field-label-font);
|
|
351
|
+
line-height: 1.4;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
[data-nx-motion="reduce"] .nx-choice__control,
|
|
355
|
+
[data-nx-motion="reduce"] .nx-choice__control::before,
|
|
356
|
+
[data-nx-motion="reduce"] .nx-choices--cards .nx-choice {
|
|
357
|
+
transition: none;
|
|
358
|
+
}
|
|
359
|
+
}
|