@medplum/react 0.9.17 → 0.9.20

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.
@@ -1,8 +1,8 @@
1
1
  .medplum-input {
2
2
  border: 0.1px solid var(--medplum-gray-300);
3
- border-radius: 3px;
3
+ border-radius: 2px;
4
4
  background: var(--medplum-surface);
5
- box-shadow: 0 1px 1px 0 var(--medplum-shadow);
5
+ box-shadow: 0 0.5px 0.5px 0 var(--medplum-shadow);
6
6
  color: var(--medplum-gray-800);
7
7
  font-size: var(--medplum-font-normal);
8
8
  height: 34px;
@@ -12,6 +12,10 @@
12
12
  width: 100%;
13
13
  }
14
14
 
15
+ .medplum-input::placeholder {
16
+ color: var(--medplum-gray-600);
17
+ }
18
+
15
19
  .medplum-input:focus {
16
20
  background: var(--medplum-surface);
17
21
  color: var(--medplum-gray-900);
@@ -31,26 +35,6 @@
31
35
  color: red;
32
36
  }
33
37
 
34
- input[type='checkbox'],
35
- input[type='radio'] {
36
- border: 0.1px solid var(--medplum-gray-300);
37
- border-radius: 0;
38
- background: var(--medplum-surface);
39
- margin: 4px;
40
- }
41
-
42
- input[type='checkbox']:focus,
43
- input[type='radio']:focus {
44
- background: var(--medplum-surface);
45
- color: var(--medplum-gray-900);
46
- border: 0.1px solid var(--medplum-blue-300);
47
- }
48
-
49
- input[type='checkbox']:disabled,
50
- input[type='radio']:disabled {
51
- background: var(--medplum-gray-100);
52
- }
53
-
54
38
  .medplum-input-row {
55
39
  display: flex;
56
40
  width: 100%;
@@ -62,7 +46,7 @@ input[type='radio']:disabled {
62
46
  select.medplum-select {
63
47
  background: var(--medplum-surface);
64
48
  padding: 4px 8px;
65
- margin: 1px;
49
+ margin: 1px 1px 1px 0;
66
50
  line-height: 28px;
67
51
  border-radius: 3px;
68
52
  }
@@ -70,7 +54,7 @@ select.medplum-select {
70
54
  select.medplum-select:not([size]) {
71
55
  border: 0.1px solid var(--medplum-gray-300);
72
56
  border-radius: 3px;
73
- box-shadow: 0 1px 1px 0 var(--medplum-shadow);
57
+ box-shadow: 0 0.5px 0.5px 0 var(--medplum-shadow);
74
58
  color: var(--medplum-gray-800);
75
59
  font-size: var(--medplum-font-normal);
76
60
  height: 34px;
@@ -98,10 +82,10 @@ select.medplum-select:disabled {
98
82
  font-size: var(--medplum-font-normal);
99
83
  line-height: 24px;
100
84
  color: var(--medplum-gray-800);
101
- margin: 1px 2px;
85
+ margin: 1px 2px 1px 0;
102
86
  padding: 4px 12px;
103
87
  cursor: pointer;
104
- box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
88
+ box-shadow: 0 0.5px 0.5px 0 var(--medplum-shadow);
105
89
  }
106
90
 
107
91
  .medplum-button:hover {
@@ -192,7 +176,7 @@ select.medplum-select:disabled {
192
176
  border: 0.1px solid var(--medplum-gray-300);
193
177
  border-radius: 3px;
194
178
  background: var(--medplum-surface);
195
- box-shadow: 0 1px 1px 0 var(--medplum-shadow);
179
+ box-shadow: 0 0.5px 0.5px 0 var(--medplum-shadow);
196
180
  outline: 2px var(--medplum-surface);
197
181
  position: relative;
198
182
  cursor: text;
@@ -230,10 +214,10 @@ select.medplum-select:disabled {
230
214
 
231
215
  .medplum-autocomplete-container li.medplum-autocomplete-item.choice {
232
216
  margin: 1px 0 1px 4px;
233
- padding: 0 6px;
234
- border: 0.1px solid var(--medplum-orange-200);
217
+ padding: 2px 6px 0 6px;
218
+ border: 0.1px solid var(--medplum-gray-400);
235
219
  border-radius: 4px;
236
- background-color: var(--medplum-gray-50);
220
+ background-color: var(--medplum-gray-200);
237
221
  cursor: move;
238
222
  line-height: 22px;
239
223
  }
@@ -245,7 +229,7 @@ select.medplum-select:disabled {
245
229
  .medplum-autocomplete-container li.medplum-autocomplete-item input {
246
230
  color: var(--medplum-gray-800);
247
231
  display: inline-block;
248
- width: 80px;
232
+ width: 100%;
249
233
  height: 28px;
250
234
  line-height: 26px;
251
235
  padding: 0 0 0 4px;
@@ -376,31 +360,42 @@ select.medplum-select:disabled {
376
360
  text-decoration: none;
377
361
  }
378
362
 
379
- fieldset {
380
- border: 0;
381
- margin: 6px 0 16px 0;
382
- padding: 2px 0 8px 0;
363
+ .medplum-checkbox-form-section {
364
+ display: flex;
365
+ justify-content: space-between;
383
366
  }
384
367
 
385
- fieldset.bordered {
386
- border: 0.1px solid var(--medplum-gray-300);
387
- border-radius: 6px;
388
- margin: 6px 0 16px 0;
389
- padding: 2px 8px 8px 8px;
368
+ .medplum-checkbox-form-section-checkbox-container {
369
+ width: 30px;
390
370
  }
391
371
 
392
- fieldset label,
393
- fieldset legend {
394
- display: block;
395
- margin: 2px 0 4px 0;
396
- font-size: var(--medplum-font-small);
372
+ .medplum-checkbox-form-section-details-container {
373
+ flex: 1;
374
+ width: 100%;
397
375
  }
398
376
 
399
- fieldset small {
377
+ .medplum-checkbox-form-section-details-container > label {
378
+ font-weight: 500;
379
+ }
380
+
381
+ fieldset.medplum-form-section {
382
+ border: 0;
383
+ margin: 6px 0 12px 0;
384
+ padding: 2px 0 8px 0;
385
+ }
386
+
387
+ fieldset.medplum-form-section > label,
388
+ fieldset.medplum-form-section > legend {
400
389
  display: block;
401
- margin: 2px 0 4px 0;
402
- padding: 2px 0 4px 0;
403
- font-size: var(--medplum-font-small);
390
+ margin: 1px 0 3px 0;
391
+ line-height: 1.75;
392
+ font-weight: 500;
393
+ }
394
+
395
+ fieldset.medplum-form-section > p {
396
+ margin: 1px 0 4px 0;
397
+ padding: 1px 0 4px 0;
398
+ line-height: 1.75;
404
399
  }
405
400
 
406
401
  dl.medplum-description-list {
@@ -426,17 +421,41 @@ dl.medplum-description-list.compact dd {
426
421
  border: 0;
427
422
  }
428
423
 
424
+ input[type='checkbox'],
425
+ input[type='radio'] {
426
+ background: var(--medplum-surface);
427
+ padding: 10px;
428
+ margin: 4px;
429
+ transform: scale(1.25);
430
+ }
431
+
432
+ input[type='checkbox']:focus,
433
+ input[type='radio']:focus {
434
+ color: var(--medplum-gray-900);
435
+ border: 0.1px solid var(--medplum-blue-300);
436
+ }
437
+
438
+ input[type='checkbox']:disabled,
439
+ input[type='radio']:disabled {
440
+ background: var(--medplum-gray-100);
441
+ }
442
+
429
443
  .medplum-textarea {
430
444
  background: var(--medplum-surface);
431
445
  border: 0.1px solid var(--medplum-gray-300);
432
446
  border-radius: 3px;
433
- box-shadow: 0 1px 1px 0 var(--medplum-shadow);
447
+ box-shadow: 0 0.5px 0.5px 0 var(--medplum-shadow);
434
448
  color: var(--medplum-foreground);
435
449
  line-height: 18px;
436
- padding: 2px 4px;
450
+ padding: 8px 12px;
437
451
  margin: 0;
438
452
  }
439
453
 
454
+ .medplum-textarea.monospace {
455
+ font-family: var(--medplum-monospace-font-family);
456
+ padding: 2px 4px;
457
+ }
458
+
440
459
  .medplum-textarea:focus {
441
460
  background: var(--medplum-surface);
442
461
  color: var(--medplum-gray-900);
@@ -773,10 +792,8 @@ table.medplum-diff-table td {
773
792
  }
774
793
 
775
794
  .medplum-document textarea {
776
- line-height: 18px;
777
795
  margin: 0;
778
- min-height: 300px;
779
- padding: 2px 4px;
796
+ min-height: 100px;
780
797
  width: 100%;
781
798
  }
782
799
 
@@ -1015,7 +1032,6 @@ table.medplum-diff-table td {
1015
1032
  .medplum-search-icon-cell input[type='checkbox'] {
1016
1033
  margin: 0;
1017
1034
  padding: 0;
1018
- border: 0.1px solid var(--medplum-gray-600);
1019
1035
  outline: 0;
1020
1036
  }
1021
1037
 
@@ -1120,7 +1136,7 @@ header a:focus {
1120
1136
 
1121
1137
  .medplum-nav-search-container > ul > li.choice {
1122
1138
  margin: 1px 0 1px 4px;
1123
- padding: 0 6px;
1139
+ padding: 2px 6px 0 6px;
1124
1140
  border: 0.1px solid var(--medplum-orange-200);
1125
1141
  border-radius: 4px;
1126
1142
  background-color: var(--medplum-gray-50);
@@ -1135,7 +1151,7 @@ header a:focus {
1135
1151
 
1136
1152
  .medplum-nav-search-container > ul > li > input {
1137
1153
  display: inline-block;
1138
- width: 80px;
1154
+ width: 100%;
1139
1155
  line-height: 26px;
1140
1156
  padding: 0 0 0 6px;
1141
1157
  margin: 2px 0 0 2px;
@@ -1327,7 +1343,7 @@ div.medplum-nav-menu-container {
1327
1343
  }
1328
1344
 
1329
1345
  .medplum-questionnaire-builder .section > .top-actions {
1330
- top: 0;
1346
+ top: 1px;
1331
1347
  padding: 4px;
1332
1348
  color: var(--medplum-gray-500);
1333
1349
  }
@@ -1339,7 +1355,7 @@ div.medplum-nav-menu-container {
1339
1355
  .medplum-questionnaire-builder .section > .top-actions,
1340
1356
  .medplum-questionnaire-builder .section > .bottom-actions {
1341
1357
  position: absolute;
1342
- right: 0;
1358
+ right: 4px;
1343
1359
  }
1344
1360
 
1345
1361
  .medplum-questionnaire-builder .section > .top-actions a,
@@ -1,8 +1,7 @@
1
1
  /// <reference types="react" />
2
- import { ElementDefinition, OperationOutcome } from '@medplum/fhirtypes';
2
+ import { OperationOutcome } from '@medplum/fhirtypes';
3
3
  export interface BackboneElementInputProps {
4
- property: ElementDefinition;
5
- name: string;
4
+ typeName: string;
6
5
  defaultValue?: any;
7
6
  outcome?: OperationOutcome;
8
7
  onChange?: (value: any) => void;
@@ -0,0 +1,12 @@
1
+ import { RefObject } from 'react';
2
+ import './Checkbox.css';
3
+ export interface CheckboxProps {
4
+ name?: string;
5
+ defaultValue?: boolean | number;
6
+ required?: boolean;
7
+ inputRef?: RefObject<HTMLInputElement>;
8
+ testid?: string;
9
+ disabled?: boolean;
10
+ onChange?: (newValue: boolean) => void;
11
+ }
12
+ export declare function Checkbox(props: CheckboxProps): JSX.Element;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import './CheckboxFormSection.css';
3
+ export interface CheckboxFormSectionProps {
4
+ htmlFor?: string;
5
+ title?: string;
6
+ description?: string;
7
+ children?: React.ReactNode;
8
+ }
9
+ export declare function CheckboxFormSection(props: CheckboxFormSectionProps): JSX.Element;
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ import { ContactDetail } from '@medplum/fhirtypes';
3
+ export interface ContactDetailDisplayProps {
4
+ value?: ContactDetail;
5
+ }
6
+ export declare function ContactDetailDisplay(props: ContactDetailDisplayProps): JSX.Element | null;
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ import { ContactDetail } from '@medplum/fhirtypes';
3
+ export interface ContactDetailInputProps {
4
+ name: string;
5
+ defaultValue?: ContactDetail;
6
+ onChange?: (value: ContactDetail) => void;
7
+ }
8
+ export declare function ContactDetailInput(props: ContactDetailInputProps): JSX.Element;
@@ -3,6 +3,6 @@ import { ContactPoint } from '@medplum/fhirtypes';
3
3
  export interface ContactPointInputProps {
4
4
  name: string;
5
5
  defaultValue?: ContactPoint;
6
- onChange?: (value: ContactPoint) => void;
6
+ onChange?: (value: ContactPoint | undefined) => void;
7
7
  }
8
8
  export declare function ContactPointInput(props: ContactPointInputProps): JSX.Element;
@@ -1,8 +1,8 @@
1
1
  /// <reference types="react" />
2
- import { LoginAuthenticationResponse } from '@medplum/core';
2
+ import { GoogleCredentialResponse } from '@medplum/core';
3
3
  export interface GoogleButtonProps {
4
- googleClientId?: string;
5
- handleAuthResponse: (response: LoginAuthenticationResponse) => void;
4
+ readonly googleClientId?: string;
5
+ readonly handleGoogleCredential: (response: GoogleCredentialResponse) => void;
6
6
  }
7
7
  export declare function GoogleButton(props: GoogleButtonProps): JSX.Element | null;
8
8
  export declare function getGoogleClientId(clientId: string | undefined): string | undefined;
@@ -1,11 +1,12 @@
1
1
  import { OperationOutcome } from '@medplum/fhirtypes';
2
- import { RefObject } from 'react';
2
+ import React, { RefObject } from 'react';
3
3
  import './Input.css';
4
4
  export interface InputProps {
5
5
  name?: string;
6
6
  type?: string;
7
7
  size?: number;
8
8
  step?: number | 'any';
9
+ style?: React.CSSProperties;
9
10
  defaultValue?: string | number;
10
11
  required?: boolean;
11
12
  autoCapitalize?: string;
@@ -2,6 +2,7 @@ import { Reference, Resource } from '@medplum/fhirtypes';
2
2
  import React from 'react';
3
3
  export interface MedplumLinkProps {
4
4
  to?: Resource | Reference | string;
5
+ suffix?: string;
5
6
  label?: string;
6
7
  id?: string;
7
8
  testid?: string;
@@ -1,7 +1,9 @@
1
1
  /// <reference types="react" />
2
- import { Reference, RequestGroup } from '@medplum/fhirtypes';
2
+ import { Reference, RequestGroup, Task } from '@medplum/fhirtypes';
3
3
  import './RequestGroupDisplay.css';
4
4
  export interface RequestGroupDisplayProps {
5
5
  value?: RequestGroup | Reference<RequestGroup>;
6
+ onStart: (task: Task, input: Reference) => void;
7
+ onEdit: (task: Task, input: Reference, output: Reference) => void;
6
8
  }
7
9
  export declare function RequestGroupDisplay(props: RequestGroupDisplayProps): JSX.Element | null;
@@ -19,6 +19,8 @@ export interface SearchControlProps {
19
19
  search: SearchRequest;
20
20
  userConfig?: UserConfiguration;
21
21
  checkboxesEnabled?: boolean;
22
+ hideToolbar?: boolean;
23
+ hideFilters?: boolean;
22
24
  onLoad?: (e: SearchLoadEvent) => void;
23
25
  onChange?: (e: SearchChangeEvent) => void;
24
26
  onClick?: (e: SearchClickEvent) => void;
@@ -2,13 +2,16 @@ import React from 'react';
2
2
  import './SignInForm.css';
3
3
  import './util.css';
4
4
  export interface SignInFormProps {
5
- scopes?: string;
6
- remember?: boolean;
7
- projectId?: string;
8
- googleClientId?: string;
9
- onSuccess?: () => void;
10
- onForgotPassword?: () => void;
11
- onRegister?: () => void;
12
- children?: React.ReactNode;
5
+ readonly remember?: boolean;
6
+ readonly projectId?: string;
7
+ readonly googleClientId?: string;
8
+ readonly clientId?: string;
9
+ readonly scope?: string;
10
+ readonly nonce?: string;
11
+ readonly onSuccess?: () => void;
12
+ readonly onForgotPassword?: () => void;
13
+ readonly onRegister?: () => void;
14
+ readonly onCode?: (code: string) => void;
15
+ readonly children?: React.ReactNode;
13
16
  }
14
17
  export declare function SignInForm(props: SignInFormProps): JSX.Element;
@@ -11,6 +11,7 @@ export interface TextAreaProps {
11
11
  outcome?: OperationOutcome;
12
12
  placeholder?: string;
13
13
  testid?: string;
14
+ monospace?: boolean;
14
15
  style?: React.CSSProperties;
15
16
  onChange?: (newValue: string) => void;
16
17
  }
@@ -7,9 +7,13 @@ export * from './Autocomplete';
7
7
  export * from './Avatar';
8
8
  export * from './BackboneElementInput';
9
9
  export * from './Button';
10
+ export * from './Checkbox';
11
+ export * from './CheckboxFormSection';
10
12
  export * from './CodeableConceptDisplay';
11
13
  export * from './CodeableConceptInput';
12
14
  export * from './CodeInput';
15
+ export * from './ContactDetailDisplay';
16
+ export * from './ContactDetailInput';
13
17
  export * from './ContactPointDisplay';
14
18
  export * from './ContactPointInput';
15
19
  export * from './DateTimeDisplay';
@@ -8,3 +8,6 @@ export declare const AllButtons: () => JSX.Element;
8
8
  export declare const ExtraFields: () => JSX.Element;
9
9
  export declare const ServiceRequests: () => JSX.Element;
10
10
  export declare const Observations: () => JSX.Element;
11
+ export declare const HideToolbar: () => JSX.Element;
12
+ export declare const HideFilters: () => JSX.Element;
13
+ export declare const HideToolbarAndFilters: () => JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@medplum/react",
3
- "version": "0.9.17",
3
+ "version": "0.9.20",
4
4
  "description": "Medplum React Component Library",
5
5
  "author": "Medplum <hello@medplum.com>",
6
6
  "license": "Apache-2.0",
@@ -19,9 +19,9 @@
19
19
  "storybook": "build-storybook"
20
20
  },
21
21
  "devDependencies": {
22
- "@medplum/core": "0.9.17",
23
- "@medplum/fhirtypes": "0.9.17",
24
- "@medplum/mock": "0.9.17",
22
+ "@medplum/core": "0.9.20",
23
+ "@medplum/fhirtypes": "0.9.20",
24
+ "@medplum/mock": "0.9.20",
25
25
  "@storybook/addon-actions": "6.5.9",
26
26
  "@storybook/addon-essentials": "6.5.9",
27
27
  "@storybook/addon-links": "6.5.9",
@@ -48,7 +48,7 @@
48
48
  "typescript": "4.7.4"
49
49
  },
50
50
  "peerDependencies": {
51
- "@medplum/core": "0.9.17",
51
+ "@medplum/core": "0.9.20",
52
52
  "react": "^17.0.2 || ^18.0.0",
53
53
  "react-dom": "^17.0.2 || ^18.0.0",
54
54
  "react-router-dom": "^6.2.2"