@health-samurai/react-components 0.0.0-alpha.18 → 0.0.0-alpha.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.
Files changed (74) hide show
  1. package/LICENSE +21 -0
  2. package/dist/bundle.css +51 -33
  3. package/dist/src/components/code-editor/fhir-autocomplete.d.ts +70 -0
  4. package/dist/src/components/code-editor/fhir-autocomplete.d.ts.map +1 -0
  5. package/dist/src/components/code-editor/fhir-autocomplete.js +1849 -0
  6. package/dist/src/components/code-editor/fhir-autocomplete.js.map +1 -0
  7. package/dist/src/components/code-editor/fhir-autocomplete.test.js +1099 -0
  8. package/dist/src/components/code-editor/fhir-autocomplete.test.js.map +1 -0
  9. package/dist/src/components/code-editor/http/index.d.ts +9 -1
  10. package/dist/src/components/code-editor/http/index.d.ts.map +1 -1
  11. package/dist/src/components/code-editor/http/index.js +423 -3
  12. package/dist/src/components/code-editor/http/index.js.map +1 -1
  13. package/dist/src/components/code-editor/index.d.ts +13 -4
  14. package/dist/src/components/code-editor/index.d.ts.map +1 -1
  15. package/dist/src/components/code-editor/index.js +505 -96
  16. package/dist/src/components/code-editor/index.js.map +1 -1
  17. package/dist/src/components/code-editor/json-ast.d.ts +46 -0
  18. package/dist/src/components/code-editor/json-ast.d.ts.map +1 -0
  19. package/dist/src/components/code-editor/json-ast.js +465 -0
  20. package/dist/src/components/code-editor/json-ast.js.map +1 -0
  21. package/dist/src/components/code-editor/json-ast.test.js +206 -0
  22. package/dist/src/components/code-editor/json-ast.test.js.map +1 -0
  23. package/dist/src/components/code-editor/sql-completion.d.ts +22 -0
  24. package/dist/src/components/code-editor/sql-completion.d.ts.map +1 -0
  25. package/dist/src/components/code-editor/sql-completion.js +895 -0
  26. package/dist/src/components/code-editor/sql-completion.js.map +1 -0
  27. package/dist/src/components/date-picker-input.d.ts +10 -0
  28. package/dist/src/components/date-picker-input.d.ts.map +1 -0
  29. package/dist/src/components/date-picker-input.js +90 -0
  30. package/dist/src/components/date-picker-input.js.map +1 -0
  31. package/dist/src/components/date-picker-input.stories.js +76 -0
  32. package/dist/src/components/date-picker-input.stories.js.map +1 -0
  33. package/dist/src/index.d.ts +1 -0
  34. package/dist/src/index.d.ts.map +1 -1
  35. package/dist/src/index.js +1 -0
  36. package/dist/src/index.js.map +1 -1
  37. package/dist/src/shadcn/components/ui/alert-dialog.d.ts +1 -1
  38. package/dist/src/shadcn/components/ui/calendar.d.ts +1 -1
  39. package/dist/src/shadcn/components/ui/carousel.d.ts +1 -1
  40. package/dist/src/shadcn/components/ui/chart.d.ts +3 -3
  41. package/dist/src/shadcn/components/ui/chart.d.ts.map +1 -1
  42. package/dist/src/shadcn/components/ui/chart.js +1 -1
  43. package/dist/src/shadcn/components/ui/chart.js.map +1 -1
  44. package/dist/src/shadcn/components/ui/command.d.ts +1 -1
  45. package/dist/src/shadcn/components/ui/pagination.d.ts +1 -1
  46. package/dist/src/shadcn/components/ui/resizable.stories.js +2 -2
  47. package/dist/src/shadcn/components/ui/resizable.stories.js.map +1 -1
  48. package/dist/src/shadcn/components/ui/sidebar.d.ts +4 -4
  49. package/dist/src/shadcn/components/ui/tabs.d.ts +3 -1
  50. package/dist/src/shadcn/components/ui/tabs.d.ts.map +1 -1
  51. package/dist/src/shadcn/components/ui/tabs.js +129 -2
  52. package/dist/src/shadcn/components/ui/tabs.js.map +1 -1
  53. package/dist/src/shadcn/components/ui/tabs.stories.js +1 -1
  54. package/dist/src/shadcn/components/ui/tabs.stories.js.map +1 -1
  55. package/dist/src/shadcn/components/ui/toggle-group.d.ts +1 -1
  56. package/dist/src/typography.css +1 -1
  57. package/package.json +24 -19
  58. package/src/components/code-editor/fhir-autocomplete.test.ts +993 -0
  59. package/src/components/code-editor/fhir-autocomplete.ts +2321 -0
  60. package/src/components/code-editor/http/index.ts +339 -2
  61. package/src/components/code-editor/index.tsx +593 -102
  62. package/src/components/code-editor/json-ast.test.ts +230 -0
  63. package/src/components/code-editor/json-ast.ts +590 -0
  64. package/src/components/code-editor/sql-completion.ts +1105 -0
  65. package/src/components/date-picker-input.stories.tsx +79 -0
  66. package/src/components/date-picker-input.tsx +104 -0
  67. package/src/index.tsx +1 -0
  68. package/src/shadcn/components/ui/chart.tsx +6 -3
  69. package/src/shadcn/components/ui/resizable.stories.tsx +2 -2
  70. package/src/shadcn/components/ui/tabs.stories.tsx +1 -1
  71. package/src/shadcn/components/ui/tabs.tsx +160 -2
  72. package/src/typography.css +1 -1
  73. package/dist/src/components/code-editor/http/grammar/http.test.d.ts +0 -2
  74. package/dist/src/components/code-editor/http/grammar/http.test.d.ts.map +0 -1
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Health Samurai Team
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/dist/bundle.css CHANGED
@@ -36,6 +36,7 @@
36
36
  --color-green-400: #c9e19b;
37
37
  --color-green-500: #78b506;
38
38
  --color-green-600: #558300;
39
+ --color-green-700: #334e02;
39
40
  --color-green-900: #090d04;
40
41
  --color-green-950: #090d04;
41
42
  --color-blue-50: #f9fbfe;
@@ -49,7 +50,9 @@
49
50
  --color-blue-800: #053775;
50
51
  --color-blue-900: #052040;
51
52
  --color-violet-500: oklch(60.6% 0.25 292.717);
53
+ --color-purple-100: oklch(94.6% 0.033 307.174);
52
54
  --color-purple-200: oklch(90.2% 0.063 306.703);
55
+ --color-purple-600: oklch(55.8% 0.288 302.321);
53
56
  --color-pink-200: oklch(89.9% 0.061 343.231);
54
57
  --color-gray-50: oklch(98.5% 0.002 247.839);
55
58
  --color-gray-100: oklch(96.7% 0.003 264.542);
@@ -163,9 +166,15 @@
163
166
  --color-border-link: var(--color-blue-500);
164
167
  --color-bg-primary: var(--hs-bg-primary);
165
168
  --color-bg-secondary: var(--hs-bg-secondary);
169
+ --color-bg-quaternary: var(--hs-bg-quaternary);
166
170
  --color-fg-secondary: var(--hs-fg-secondary);
167
171
  --color-fg-disabled: var(--hs-fg-disabled);
168
172
  --color-fg-link: var(--hs-fg-link);
173
+ --color-utility-green: var(--color-green-500);
174
+ --color-utility-yellow: var(--color-yellow-600);
175
+ --color-utility-blue: var(--color-blue-500);
176
+ --color-utility-violet: var(--color-violet-500);
177
+ --color-utility-red: var(--color-red-500);
169
178
  --font-leading-14: 56px;
170
179
  }
171
180
  }
@@ -1166,6 +1175,9 @@
1166
1175
  .cursor-default {
1167
1176
  cursor: default;
1168
1177
  }
1178
+ .cursor-grabbing {
1179
+ cursor: grabbing;
1180
+ }
1169
1181
  .cursor-help {
1170
1182
  cursor: help;
1171
1183
  }
@@ -2126,6 +2138,9 @@
2126
2138
  .no-underline {
2127
2139
  text-decoration-line: none;
2128
2140
  }
2141
+ .underline {
2142
+ text-decoration-line: underline;
2143
+ }
2129
2144
  .underline-offset-4 {
2130
2145
  text-underline-offset: 4px;
2131
2146
  }
@@ -2199,6 +2214,9 @@
2199
2214
  outline-style: var(--tw-outline-style);
2200
2215
  outline-width: 1px;
2201
2216
  }
2217
+ .filter {
2218
+ filter: var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,);
2219
+ }
2202
2220
  .transition {
2203
2221
  transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to, opacity, box-shadow, transform, translate, scale, rotate, filter, -webkit-backdrop-filter, backdrop-filter, display, content-visibility, overlay, pointer-events;
2204
2222
  transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
@@ -6445,7 +6463,7 @@ body {
6445
6463
  font-size: var(--font-size-xs);
6446
6464
  font-family: var(--font-family-sans);
6447
6465
  font-weight: var(--font-weight-normal);
6448
- line-height: var(--font-leading-3);
6466
+ line-height: var(--font-leading-4);
6449
6467
  }
6450
6468
  .typo-label-xs {
6451
6469
  font-size: var(--font-size-xs);
@@ -6977,86 +6995,86 @@ body ::-webkit-scrollbar-thumb:hover {
6977
6995
  inherits: false;
6978
6996
  initial-value: solid;
6979
6997
  }
6980
- @property --tw-duration {
6998
+ @property --tw-blur {
6981
6999
  syntax: "*";
6982
7000
  inherits: false;
6983
7001
  }
6984
- @property --tw-ease {
7002
+ @property --tw-brightness {
6985
7003
  syntax: "*";
6986
7004
  inherits: false;
6987
7005
  }
6988
- @property --tw-content {
7006
+ @property --tw-contrast {
6989
7007
  syntax: "*";
6990
- initial-value: "";
6991
7008
  inherits: false;
6992
7009
  }
6993
- @property --tw-scale-x {
7010
+ @property --tw-grayscale {
6994
7011
  syntax: "*";
6995
7012
  inherits: false;
6996
- initial-value: 1;
6997
7013
  }
6998
- @property --tw-scale-y {
7014
+ @property --tw-hue-rotate {
6999
7015
  syntax: "*";
7000
7016
  inherits: false;
7001
- initial-value: 1;
7002
7017
  }
7003
- @property --tw-scale-z {
7018
+ @property --tw-invert {
7004
7019
  syntax: "*";
7005
7020
  inherits: false;
7006
- initial-value: 1;
7007
7021
  }
7008
- @property --tw-blur {
7022
+ @property --tw-opacity {
7009
7023
  syntax: "*";
7010
7024
  inherits: false;
7011
7025
  }
7012
- @property --tw-brightness {
7026
+ @property --tw-saturate {
7013
7027
  syntax: "*";
7014
7028
  inherits: false;
7015
7029
  }
7016
- @property --tw-contrast {
7030
+ @property --tw-sepia {
7017
7031
  syntax: "*";
7018
7032
  inherits: false;
7019
7033
  }
7020
- @property --tw-grayscale {
7034
+ @property --tw-drop-shadow {
7021
7035
  syntax: "*";
7022
7036
  inherits: false;
7023
7037
  }
7024
- @property --tw-hue-rotate {
7038
+ @property --tw-drop-shadow-color {
7025
7039
  syntax: "*";
7026
7040
  inherits: false;
7027
7041
  }
7028
- @property --tw-invert {
7029
- syntax: "*";
7042
+ @property --tw-drop-shadow-alpha {
7043
+ syntax: "<percentage>";
7030
7044
  inherits: false;
7045
+ initial-value: 100%;
7031
7046
  }
7032
- @property --tw-opacity {
7047
+ @property --tw-drop-shadow-size {
7033
7048
  syntax: "*";
7034
7049
  inherits: false;
7035
7050
  }
7036
- @property --tw-saturate {
7051
+ @property --tw-duration {
7037
7052
  syntax: "*";
7038
7053
  inherits: false;
7039
7054
  }
7040
- @property --tw-sepia {
7055
+ @property --tw-ease {
7041
7056
  syntax: "*";
7042
7057
  inherits: false;
7043
7058
  }
7044
- @property --tw-drop-shadow {
7059
+ @property --tw-content {
7045
7060
  syntax: "*";
7061
+ initial-value: "";
7046
7062
  inherits: false;
7047
7063
  }
7048
- @property --tw-drop-shadow-color {
7064
+ @property --tw-scale-x {
7049
7065
  syntax: "*";
7050
7066
  inherits: false;
7067
+ initial-value: 1;
7051
7068
  }
7052
- @property --tw-drop-shadow-alpha {
7053
- syntax: "<percentage>";
7069
+ @property --tw-scale-y {
7070
+ syntax: "*";
7054
7071
  inherits: false;
7055
- initial-value: 100%;
7072
+ initial-value: 1;
7056
7073
  }
7057
- @property --tw-drop-shadow-size {
7074
+ @property --tw-scale-z {
7058
7075
  syntax: "*";
7059
7076
  inherits: false;
7077
+ initial-value: 1;
7060
7078
  }
7061
7079
  @property --tw-divide-x-reverse {
7062
7080
  syntax: "*";
@@ -7154,12 +7172,6 @@ body ::-webkit-scrollbar-thumb:hover {
7154
7172
  --tw-ring-offset-color: #fff;
7155
7173
  --tw-ring-offset-shadow: 0 0 #0000;
7156
7174
  --tw-outline-style: solid;
7157
- --tw-duration: initial;
7158
- --tw-ease: initial;
7159
- --tw-content: "";
7160
- --tw-scale-x: 1;
7161
- --tw-scale-y: 1;
7162
- --tw-scale-z: 1;
7163
7175
  --tw-blur: initial;
7164
7176
  --tw-brightness: initial;
7165
7177
  --tw-contrast: initial;
@@ -7173,6 +7185,12 @@ body ::-webkit-scrollbar-thumb:hover {
7173
7185
  --tw-drop-shadow-color: initial;
7174
7186
  --tw-drop-shadow-alpha: 100%;
7175
7187
  --tw-drop-shadow-size: initial;
7188
+ --tw-duration: initial;
7189
+ --tw-ease: initial;
7190
+ --tw-content: "";
7191
+ --tw-scale-x: 1;
7192
+ --tw-scale-y: 1;
7193
+ --tw-scale-z: 1;
7176
7194
  --tw-divide-x-reverse: 0;
7177
7195
  --tw-animation-delay: 0s;
7178
7196
  --tw-animation-direction: normal;
@@ -0,0 +1,70 @@
1
+ import { type CompletionSource } from "@codemirror/autocomplete";
2
+ import { type Extension, RangeSet, StateField } from "@codemirror/state";
3
+ import { Decoration, GutterMarker } from "@codemirror/view";
4
+ interface FhirElementType {
5
+ code: string;
6
+ profile?: string[];
7
+ targetProfile?: string[];
8
+ }
9
+ interface FhirElement {
10
+ path: string;
11
+ short?: string;
12
+ definition?: string;
13
+ min?: number;
14
+ max?: string;
15
+ type?: FhirElementType[];
16
+ binding?: {
17
+ valueSet: string;
18
+ strength: string;
19
+ };
20
+ contentReference?: string;
21
+ sliceName?: string;
22
+ fixedUri?: string;
23
+ fixedString?: string;
24
+ fixedCode?: string;
25
+ }
26
+ interface StructureDefinition {
27
+ type: string;
28
+ url?: string;
29
+ name?: string;
30
+ baseDefinition?: string;
31
+ context?: {
32
+ expression: string;
33
+ type: string;
34
+ }[];
35
+ differential?: {
36
+ element: FhirElement[];
37
+ };
38
+ }
39
+ export interface StructureDefinitionSearchParams {
40
+ type?: string;
41
+ url?: string;
42
+ derivation?: string;
43
+ "derivation:missing"?: string;
44
+ kind?: string;
45
+ _count?: string;
46
+ _elements?: string;
47
+ _ilike?: string;
48
+ }
49
+ export type GetStructureDefinitions = (params: StructureDefinitionSearchParams) => Promise<StructureDefinition[]>;
50
+ export type ExpandValueSet = (url: string, filter: string) => Promise<{
51
+ code: string;
52
+ display?: string;
53
+ system?: string;
54
+ }[]>;
55
+ /** @internal — exported for tests only */
56
+ export declare function buildParameterSnippet(name: string, valueTypes: string[], indent: string): {
57
+ text: string;
58
+ cursorOffset: number;
59
+ };
60
+ /** @internal — exported for tests only */
61
+ export declare function jsonCompletionSource(getSDs: GetStructureDefinitions, resourceTypeHint?: string, expandValueSet?: ExpandValueSet): CompletionSource;
62
+ export declare const fhirDiagnosticsField: StateField<{
63
+ marks: RangeSet<Decoration>;
64
+ lineDecos: RangeSet<Decoration>;
65
+ gutterMarkers: RangeSet<GutterMarker>;
66
+ messages: Map<number, string>;
67
+ }>;
68
+ export declare function buildFhirCompletionExtension(getSDs: GetStructureDefinitions, resourceTypeHint?: string, expandValueSet?: ExpandValueSet): Extension;
69
+ export {};
70
+ //# sourceMappingURL=fhir-autocomplete.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fhir-autocomplete.d.ts","sourceRoot":"","sources":["../../../../src/components/code-editor/fhir-autocomplete.ts"],"names":[],"mappings":"AAAA,OAAO,EAIN,KAAK,gBAAgB,EAGrB,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EACN,KAAK,SAAS,EACd,QAAQ,EAER,UAAU,EACV,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACN,UAAU,EAEV,YAAY,EAIZ,MAAM,kBAAkB,CAAC;AAW1B,UAAU,e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