@health-samurai/react-components 0.0.0-alpha.2 → 0.0.0-alpha.21
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/LICENSE +21 -0
- package/README.md +102 -1
- package/dist/bundle.css +2349 -754
- package/dist/src/components/button-dropdown.d.ts +10 -0
- package/dist/src/components/button-dropdown.d.ts.map +1 -0
- package/dist/src/components/button-dropdown.js +70 -0
- package/dist/src/components/button-dropdown.js.map +1 -0
- package/dist/src/components/button-dropdown.stories.js +48 -0
- package/dist/src/components/button-dropdown.stories.js.map +1 -0
- package/dist/src/components/code-editor/fhir-autocomplete.d.ts +70 -0
- package/dist/src/components/code-editor/fhir-autocomplete.d.ts.map +1 -0
- package/dist/src/components/code-editor/fhir-autocomplete.js +1850 -0
- package/dist/src/components/code-editor/fhir-autocomplete.js.map +1 -0
- package/dist/src/components/code-editor/fhir-autocomplete.test.js +1099 -0
- package/dist/src/components/code-editor/fhir-autocomplete.test.js.map +1 -0
- package/dist/src/components/code-editor/http/grammar/http.d.ts +3 -0
- package/dist/src/components/code-editor/http/grammar/http.d.ts.map +1 -0
- package/dist/src/components/code-editor/http/grammar/http.grammar +74 -0
- package/dist/src/components/code-editor/http/grammar/http.js +38 -0
- package/dist/src/components/code-editor/http/grammar/http.js.map +1 -0
- package/dist/src/components/code-editor/http/grammar/http.terms.d.ts +2 -0
- package/dist/src/components/code-editor/http/grammar/http.terms.d.ts.map +1 -0
- package/dist/src/components/code-editor/http/grammar/http.terms.js +4 -0
- package/dist/src/components/code-editor/http/grammar/http.terms.js.map +1 -0
- package/dist/src/components/code-editor/http/grammar/http.test.js +80 -0
- package/dist/src/components/code-editor/http/grammar/http.test.js.map +1 -0
- package/dist/src/components/code-editor/http/index.d.ts +12 -0
- package/dist/src/components/code-editor/http/index.d.ts.map +1 -0
- package/dist/src/components/code-editor/http/index.js +486 -0
- package/dist/src/components/code-editor/http/index.js.map +1 -0
- package/dist/src/components/code-editor/index.d.ts +39 -1
- package/dist/src/components/code-editor/index.d.ts.map +1 -1
- package/dist/src/components/code-editor/index.js +1792 -45
- package/dist/src/components/code-editor/index.js.map +1 -1
- package/dist/src/components/code-editor/json-ast.d.ts +46 -0
- package/dist/src/components/code-editor/json-ast.d.ts.map +1 -0
- package/dist/src/components/code-editor/json-ast.js +465 -0
- package/dist/src/components/code-editor/json-ast.js.map +1 -0
- package/dist/src/components/code-editor/json-ast.test.js +206 -0
- package/dist/src/components/code-editor/json-ast.test.js.map +1 -0
- package/dist/src/components/code-editor/sql-completion.d.ts +22 -0
- package/dist/src/components/code-editor/sql-completion.d.ts.map +1 -0
- package/dist/src/components/code-editor/sql-completion.js +897 -0
- package/dist/src/components/code-editor/sql-completion.js.map +1 -0
- package/dist/src/components/code-editor.stories.js +280 -3
- package/dist/src/components/code-editor.stories.js.map +1 -1
- package/dist/src/components/copy-icon.d.ts +5 -1
- package/dist/src/components/copy-icon.d.ts.map +1 -1
- package/dist/src/components/copy-icon.js +41 -3
- package/dist/src/components/copy-icon.js.map +1 -1
- package/dist/src/components/data-table.d.ts +9 -0
- package/dist/src/components/data-table.d.ts.map +1 -0
- package/dist/src/components/data-table.js +66 -0
- package/dist/src/components/data-table.js.map +1 -0
- package/dist/src/components/data-table.stories.js +240 -0
- package/dist/src/components/data-table.stories.js.map +1 -0
- package/dist/src/components/date-picker-input.d.ts +10 -0
- package/dist/src/components/date-picker-input.d.ts.map +1 -0
- package/dist/src/components/date-picker-input.js +90 -0
- package/dist/src/components/date-picker-input.js.map +1 -0
- package/dist/src/components/date-picker-input.stories.js +76 -0
- package/dist/src/components/date-picker-input.stories.js.map +1 -0
- package/dist/src/components/fhir-structure-view.d.ts +34 -0
- package/dist/src/components/fhir-structure-view.d.ts.map +1 -0
- package/dist/src/components/fhir-structure-view.js +230 -0
- package/dist/src/components/fhir-structure-view.js.map +1 -0
- package/dist/src/components/fhir-structure-view.stories.js +447 -0
- package/dist/src/components/fhir-structure-view.stories.js.map +1 -0
- package/dist/src/components/icon-button.d.ts +12 -0
- package/dist/src/components/icon-button.d.ts.map +1 -0
- package/dist/src/components/icon-button.js +41 -0
- package/dist/src/components/icon-button.js.map +1 -0
- package/dist/src/components/icon-button.stories.js +157 -0
- package/dist/src/components/icon-button.stories.js.map +1 -0
- package/dist/src/components/operation-outcome-view.d.ts +27 -0
- package/dist/src/components/operation-outcome-view.d.ts.map +1 -0
- package/dist/src/components/operation-outcome-view.js +198 -0
- package/dist/src/components/operation-outcome-view.js.map +1 -0
- package/dist/src/components/operation-outcome-view.stories.js +207 -0
- package/dist/src/components/operation-outcome-view.stories.js.map +1 -0
- package/dist/src/components/request-line-editor.d.ts +13 -35
- package/dist/src/components/request-line-editor.d.ts.map +1 -1
- package/dist/src/components/request-line-editor.js +73 -49
- package/dist/src/components/request-line-editor.js.map +1 -1
- package/dist/src/components/request-line-editor.stories.js +17 -53
- package/dist/src/components/request-line-editor.stories.js.map +1 -1
- package/dist/src/components/sandbox.d.ts +13 -0
- package/dist/src/components/sandbox.d.ts.map +1 -0
- package/dist/src/components/sandbox.js +107 -0
- package/dist/src/components/sandbox.js.map +1 -0
- package/dist/src/components/sandbox.stories.js +126 -0
- package/dist/src/components/sandbox.stories.js.map +1 -0
- package/dist/src/components/segment-control.d.ts +13 -0
- package/dist/src/components/segment-control.d.ts.map +1 -0
- package/dist/src/components/segment-control.js +33 -0
- package/dist/src/components/segment-control.js.map +1 -0
- package/dist/src/components/segment-control.stories.js +68 -0
- package/dist/src/components/segment-control.stories.js.map +1 -0
- package/dist/src/components/split-button.d.ts +12 -0
- package/dist/src/components/split-button.d.ts.map +1 -0
- package/dist/src/components/split-button.js +33 -0
- package/dist/src/components/split-button.js.map +1 -0
- package/dist/src/components/split-button.stories.js +84 -0
- package/dist/src/components/split-button.stories.js.map +1 -0
- package/dist/src/components/tag.d.ts +16 -0
- package/dist/src/components/tag.d.ts.map +1 -0
- package/dist/src/components/tag.js +198 -0
- package/dist/src/components/tag.js.map +1 -0
- package/dist/src/components/tag.stories.js +459 -0
- package/dist/src/components/tag.stories.js.map +1 -0
- package/dist/src/components/tile.d.ts +15 -0
- package/dist/src/components/tile.d.ts.map +1 -0
- package/dist/src/components/tile.js +76 -0
- package/dist/src/components/tile.js.map +1 -0
- package/dist/src/components/tile.stories.js +167 -0
- package/dist/src/components/tile.stories.js.map +1 -0
- package/dist/src/components/toolbar.d.ts +18 -0
- package/dist/src/components/toolbar.d.ts.map +1 -0
- package/dist/src/components/toolbar.js +61 -0
- package/dist/src/components/toolbar.js.map +1 -0
- package/dist/src/components/toolbar.stories.js +69 -0
- package/dist/src/components/toolbar.stories.js.map +1 -0
- package/dist/src/components/tree-view.d.ts +47 -0
- package/dist/src/components/tree-view.d.ts.map +1 -0
- package/dist/src/components/tree-view.js +122 -0
- package/dist/src/components/tree-view.js.map +1 -0
- package/dist/src/components/tree-view.stories.js +283 -0
- package/dist/src/components/tree-view.stories.js.map +1 -0
- package/dist/src/icons.d.ts +11 -0
- package/dist/src/icons.d.ts.map +1 -0
- package/dist/src/icons.js +328 -0
- package/dist/src/icons.js.map +1 -0
- package/dist/src/index.css +358 -74
- package/dist/src/index.d.ts +17 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +17 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/shadcn/components/ui/accordion.d.ts +2 -2
- package/dist/src/shadcn/components/ui/accordion.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/accordion.js +35 -9
- package/dist/src/shadcn/components/ui/accordion.js.map +1 -1
- package/dist/src/shadcn/components/ui/alert-dialog.d.ts +12 -4
- package/dist/src/shadcn/components/ui/alert-dialog.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/alert-dialog.js +128 -18
- package/dist/src/shadcn/components/ui/alert-dialog.js.map +1 -1
- package/dist/src/shadcn/components/ui/alert-dialog.stories.js +269 -19
- package/dist/src/shadcn/components/ui/alert-dialog.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/alert.d.ts +29 -6
- package/dist/src/shadcn/components/ui/alert.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/alert.js +50 -19
- package/dist/src/shadcn/components/ui/alert.js.map +1 -1
- package/dist/src/shadcn/components/ui/alert.stories.js +140 -36
- package/dist/src/shadcn/components/ui/alert.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/aspect-ratio.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/aspect-ratio.js +1 -0
- package/dist/src/shadcn/components/ui/aspect-ratio.js.map +1 -1
- package/dist/src/shadcn/components/ui/avatar.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/avatar.js +4 -3
- package/dist/src/shadcn/components/ui/avatar.js.map +1 -1
- package/dist/src/shadcn/components/ui/avatar.stories.js +68 -2
- package/dist/src/shadcn/components/ui/avatar.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/badge.d.ts +1 -1
- package/dist/src/shadcn/components/ui/badge.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/badge.js +16 -5
- package/dist/src/shadcn/components/ui/badge.js.map +1 -1
- package/dist/src/shadcn/components/ui/breadcrumb.d.ts +5 -2
- package/dist/src/shadcn/components/ui/breadcrumb.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/breadcrumb.js +98 -13
- package/dist/src/shadcn/components/ui/breadcrumb.js.map +1 -1
- package/dist/src/shadcn/components/ui/breadcrumb.stories.js +205 -45
- package/dist/src/shadcn/components/ui/breadcrumb.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/button.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/button.js +65 -11
- package/dist/src/shadcn/components/ui/button.js.map +1 -1
- package/dist/src/shadcn/components/ui/button.stories.js +99 -17
- package/dist/src/shadcn/components/ui/button.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/calendar.d.ts +1 -1
- package/dist/src/shadcn/components/ui/calendar.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/calendar.js +1 -0
- package/dist/src/shadcn/components/ui/calendar.js.map +1 -1
- package/dist/src/shadcn/components/ui/card.d.ts +5 -1
- package/dist/src/shadcn/components/ui/card.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/card.js +28 -7
- package/dist/src/shadcn/components/ui/card.js.map +1 -1
- package/dist/src/shadcn/components/ui/card.stories.js +23 -2
- package/dist/src/shadcn/components/ui/card.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/carousel.d.ts +1 -1
- package/dist/src/shadcn/components/ui/carousel.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/carousel.js +1 -0
- package/dist/src/shadcn/components/ui/carousel.js.map +1 -1
- package/dist/src/shadcn/components/ui/chart.d.ts +5 -5
- package/dist/src/shadcn/components/ui/chart.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/chart.js +4 -3
- package/dist/src/shadcn/components/ui/chart.js.map +1 -1
- package/dist/src/shadcn/components/ui/checkbox.d.ts +5 -1
- package/dist/src/shadcn/components/ui/checkbox.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/checkbox.js +46 -6
- package/dist/src/shadcn/components/ui/checkbox.js.map +1 -1
- package/dist/src/shadcn/components/ui/checkbox.stories.js +156 -46
- package/dist/src/shadcn/components/ui/checkbox.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/combobox.d.ts +29 -0
- package/dist/src/shadcn/components/ui/combobox.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/combobox.js +226 -0
- package/dist/src/shadcn/components/ui/combobox.js.map +1 -0
- package/dist/src/shadcn/components/ui/combobox.stories.js +167 -0
- package/dist/src/shadcn/components/ui/combobox.stories.js.map +1 -0
- package/dist/src/shadcn/components/ui/command.d.ts +4 -2
- package/dist/src/shadcn/components/ui/command.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/command.js +75 -13
- package/dist/src/shadcn/components/ui/command.js.map +1 -1
- package/dist/src/shadcn/components/ui/command.stories.js +277 -57
- package/dist/src/shadcn/components/ui/command.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/context-menu.d.ts +7 -3
- package/dist/src/shadcn/components/ui/context-menu.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/context-menu.js +120 -13
- package/dist/src/shadcn/components/ui/context-menu.js.map +1 -1
- package/dist/src/shadcn/components/ui/dialog.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/dialog.js +35 -7
- package/dist/src/shadcn/components/ui/dialog.js.map +1 -1
- package/dist/src/shadcn/components/ui/drawer.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/drawer.js +27 -5
- package/dist/src/shadcn/components/ui/drawer.js.map +1 -1
- package/dist/src/shadcn/components/ui/dropdown-menu.d.ts +7 -3
- package/dist/src/shadcn/components/ui/dropdown-menu.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/dropdown-menu.js +122 -14
- package/dist/src/shadcn/components/ui/dropdown-menu.js.map +1 -1
- package/dist/src/shadcn/components/ui/dropdown-menu.stories.js +22 -5
- package/dist/src/shadcn/components/ui/dropdown-menu.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/form.d.ts +2 -2
- package/dist/src/shadcn/components/ui/form.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/form.js +17 -8
- package/dist/src/shadcn/components/ui/form.js.map +1 -1
- package/dist/src/shadcn/components/ui/hover-card.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/hover-card.js +2 -1
- package/dist/src/shadcn/components/ui/hover-card.js.map +1 -1
- package/dist/src/shadcn/components/ui/input-otp.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/input-otp.js +1 -0
- package/dist/src/shadcn/components/ui/input-otp.js.map +1 -1
- package/dist/src/shadcn/components/ui/input.d.ts +3 -1
- package/dist/src/shadcn/components/ui/input.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/input.js +126 -17
- package/dist/src/shadcn/components/ui/input.js.map +1 -1
- package/dist/src/shadcn/components/ui/input.stories.js +218 -29
- package/dist/src/shadcn/components/ui/input.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/label.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/label.js +9 -1
- package/dist/src/shadcn/components/ui/label.js.map +1 -1
- package/dist/src/shadcn/components/ui/menubar.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/menubar.js +35 -13
- package/dist/src/shadcn/components/ui/menubar.js.map +1 -1
- package/dist/src/shadcn/components/ui/pagination.d.ts +9 -2
- package/dist/src/shadcn/components/ui/pagination.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/pagination.js +41 -24
- package/dist/src/shadcn/components/ui/pagination.js.map +1 -1
- package/dist/src/shadcn/components/ui/pagination.stories.js +44 -37
- package/dist/src/shadcn/components/ui/pagination.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/popover.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/popover.js +13 -1
- package/dist/src/shadcn/components/ui/popover.js.map +1 -1
- package/dist/src/shadcn/components/ui/progress.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/progress.js +6 -2
- package/dist/src/shadcn/components/ui/progress.js.map +1 -1
- package/dist/src/shadcn/components/ui/radio-button-group.d.ts +21 -0
- package/dist/src/shadcn/components/ui/radio-button-group.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/radio-button-group.js +148 -0
- package/dist/src/shadcn/components/ui/radio-button-group.js.map +1 -0
- package/dist/src/shadcn/components/ui/radio-button-group.stories.js +283 -0
- package/dist/src/shadcn/components/ui/radio-button-group.stories.js.map +1 -0
- package/dist/src/shadcn/components/ui/radio-group.d.ts +5 -1
- package/dist/src/shadcn/components/ui/radio-group.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/radio-group.js +40 -7
- package/dist/src/shadcn/components/ui/radio-group.js.map +1 -1
- package/dist/src/shadcn/components/ui/radio-group.stories.js +107 -32
- package/dist/src/shadcn/components/ui/radio-group.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/resizable.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/resizable.js +2 -1
- package/dist/src/shadcn/components/ui/resizable.js.map +1 -1
- package/dist/src/shadcn/components/ui/resizable.stories.js +2 -2
- package/dist/src/shadcn/components/ui/resizable.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/scroll-area.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/scroll-area.js +10 -3
- package/dist/src/shadcn/components/ui/scroll-area.js.map +1 -1
- package/dist/src/shadcn/components/ui/select.d.ts +1 -2
- package/dist/src/shadcn/components/ui/select.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/select.js +49 -19
- package/dist/src/shadcn/components/ui/select.js.map +1 -1
- package/dist/src/shadcn/components/ui/select.stories.js +193 -70
- package/dist/src/shadcn/components/ui/select.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/separator.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/separator.js +8 -1
- package/dist/src/shadcn/components/ui/separator.js.map +1 -1
- package/dist/src/shadcn/components/ui/sheet.js +1 -1
- package/dist/src/shadcn/components/ui/sheet.js.map +1 -1
- package/dist/src/shadcn/components/ui/sidebar.d.ts +4 -4
- package/dist/src/shadcn/components/ui/sidebar.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/sidebar.js +21 -6
- package/dist/src/shadcn/components/ui/sidebar.js.map +1 -1
- package/dist/src/shadcn/components/ui/skeleton.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/skeleton.js +3 -1
- package/dist/src/shadcn/components/ui/skeleton.js.map +1 -1
- package/dist/src/shadcn/components/ui/slider.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/slider.js +35 -4
- package/dist/src/shadcn/components/ui/slider.js.map +1 -1
- package/dist/src/shadcn/components/ui/sonner.d.ts +24 -2
- package/dist/src/shadcn/components/ui/sonner.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/sonner.js +127 -9
- package/dist/src/shadcn/components/ui/sonner.js.map +1 -1
- package/dist/src/shadcn/components/ui/sonner.stories.js +251 -12
- package/dist/src/shadcn/components/ui/sonner.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/switch.d.ts +7 -1
- package/dist/src/shadcn/components/ui/switch.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/switch.js +55 -3
- package/dist/src/shadcn/components/ui/switch.js.map +1 -1
- package/dist/src/shadcn/components/ui/switch.stories.js +84 -9
- package/dist/src/shadcn/components/ui/switch.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/table.d.ts +23 -6
- package/dist/src/shadcn/components/ui/table.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/table.js +65 -20
- package/dist/src/shadcn/components/ui/table.js.map +1 -1
- package/dist/src/shadcn/components/ui/table.stories.js +217 -97
- package/dist/src/shadcn/components/ui/table.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/tabs.d.ts +30 -5
- package/dist/src/shadcn/components/ui/tabs.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/tabs.js +470 -23
- package/dist/src/shadcn/components/ui/tabs.js.map +1 -1
- package/dist/src/shadcn/components/ui/tabs.stories.js +405 -181
- package/dist/src/shadcn/components/ui/tabs.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/textarea.d.ts +8 -1
- package/dist/src/shadcn/components/ui/textarea.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/textarea.js +30 -2
- package/dist/src/shadcn/components/ui/textarea.js.map +1 -1
- package/dist/src/shadcn/components/ui/textarea.stories.js +85 -4
- package/dist/src/shadcn/components/ui/textarea.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/toggle-group.d.ts +3 -3
- package/dist/src/shadcn/components/ui/toggle-group.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/toggle-group.js +14 -12
- package/dist/src/shadcn/components/ui/toggle-group.js.map +1 -1
- package/dist/src/shadcn/components/ui/toggle.d.ts +3 -4
- package/dist/src/shadcn/components/ui/toggle.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/toggle.js +44 -16
- package/dist/src/shadcn/components/ui/toggle.js.map +1 -1
- package/dist/src/shadcn/components/ui/toggle.stories.js +130 -7
- package/dist/src/shadcn/components/ui/toggle.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/tooltip.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/tooltip.js +12 -1
- package/dist/src/shadcn/components/ui/tooltip.js.map +1 -1
- package/dist/src/shadcn/components/ui/tree.d.ts +29 -0
- package/dist/src/shadcn/components/ui/tree.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/tree.js +135 -0
- package/dist/src/shadcn/components/ui/tree.js.map +1 -0
- package/dist/src/shadcn/shadcn.css +4 -4
- package/dist/src/tokens.css +50 -20
- package/dist/src/typography.css +78 -15
- package/package.json +84 -64
- package/src/components/button-dropdown.stories.tsx +41 -0
- package/src/components/button-dropdown.tsx +97 -0
- package/src/components/code-editor/fhir-autocomplete.test.ts +993 -0
- package/src/components/code-editor/fhir-autocomplete.ts +2322 -0
- package/src/components/code-editor/http/grammar/http.grammar +74 -0
- package/src/components/code-editor/http/grammar/http.terms.ts +9 -0
- package/src/components/code-editor/http/grammar/http.test.ts +110 -0
- package/src/components/code-editor/http/grammar/http.ts +21 -0
- package/src/components/code-editor/http/index.ts +424 -0
- package/src/components/code-editor/index.tsx +1944 -42
- package/src/components/code-editor/json-ast.test.ts +230 -0
- package/src/components/code-editor/json-ast.ts +590 -0
- package/src/components/code-editor/sql-completion.ts +1112 -0
- package/src/components/code-editor.stories.tsx +325 -2
- package/src/components/copy-icon.tsx +57 -3
- package/src/components/data-table.stories.tsx +91 -0
- package/src/components/data-table.tsx +126 -0
- package/src/components/date-picker-input.stories.tsx +79 -0
- package/src/components/date-picker-input.tsx +104 -0
- package/src/components/fhir-structure-view.stories.tsx +439 -0
- package/src/components/fhir-structure-view.tsx +233 -0
- package/src/components/icon-button.stories.tsx +86 -0
- package/src/components/icon-button.tsx +57 -0
- package/src/components/operation-outcome-view.stories.tsx +163 -0
- package/src/components/operation-outcome-view.tsx +254 -0
- package/src/components/request-line-editor.stories.tsx +17 -27
- package/src/components/request-line-editor.tsx +103 -61
- package/src/components/sandbox.stories.tsx +131 -0
- package/src/components/sandbox.tsx +191 -0
- package/src/components/segment-control.stories.tsx +61 -0
- package/src/components/segment-control.tsx +83 -0
- package/src/components/split-button.stories.tsx +68 -0
- package/src/components/split-button.tsx +74 -0
- package/src/components/tag.stories.tsx +371 -0
- package/src/components/tag.tsx +236 -0
- package/src/components/tile.stories.tsx +149 -0
- package/src/components/tile.tsx +105 -0
- package/src/components/toolbar.stories.tsx +64 -0
- package/src/components/toolbar.tsx +98 -0
- package/src/components/tree-view.stories.tsx +265 -0
- package/src/components/tree-view.tsx +246 -0
- package/src/icons.tsx +331 -0
- package/src/index.css +358 -74
- package/src/index.tsx +17 -3
- package/src/shadcn/components/ui/accordion.tsx +91 -10
- package/src/shadcn/components/ui/alert-dialog.stories.tsx +209 -15
- package/src/shadcn/components/ui/alert-dialog.tsx +236 -26
- package/src/shadcn/components/ui/alert.stories.tsx +120 -21
- package/src/shadcn/components/ui/alert.tsx +125 -28
- package/src/shadcn/components/ui/aspect-ratio.tsx +1 -0
- package/src/shadcn/components/ui/avatar.stories.tsx +74 -1
- package/src/shadcn/components/ui/avatar.tsx +22 -6
- package/src/shadcn/components/ui/badge.tsx +67 -18
- package/src/shadcn/components/ui/breadcrumb.stories.tsx +161 -41
- package/src/shadcn/components/ui/breadcrumb.tsx +172 -23
- package/src/shadcn/components/ui/button.stories.tsx +106 -18
- package/src/shadcn/components/ui/button.tsx +151 -55
- package/src/shadcn/components/ui/calendar.tsx +1 -0
- package/src/shadcn/components/ui/card.stories.tsx +17 -3
- package/src/shadcn/components/ui/card.tsx +89 -14
- package/src/shadcn/components/ui/carousel.tsx +1 -0
- package/src/shadcn/components/ui/chart.tsx +9 -5
- package/src/shadcn/components/ui/checkbox.stories.tsx +78 -30
- package/src/shadcn/components/ui/checkbox.tsx +91 -8
- package/src/shadcn/components/ui/combobox.stories.tsx +148 -0
- package/src/shadcn/components/ui/combobox.tsx +324 -0
- package/src/shadcn/components/ui/command.stories.tsx +184 -39
- package/src/shadcn/components/ui/command.tsx +218 -37
- package/src/shadcn/components/ui/context-menu.tsx +333 -40
- package/src/shadcn/components/ui/dialog.tsx +101 -13
- package/src/shadcn/components/ui/drawer.tsx +94 -18
- package/src/shadcn/components/ui/dropdown-menu.stories.tsx +18 -2
- package/src/shadcn/components/ui/dropdown-menu.tsx +334 -68
- package/src/shadcn/components/ui/form.tsx +22 -11
- package/src/shadcn/components/ui/hover-card.tsx +2 -1
- package/src/shadcn/components/ui/input-otp.tsx +1 -0
- package/src/shadcn/components/ui/input.stories.tsx +235 -27
- package/src/shadcn/components/ui/input.tsx +400 -29
- package/src/shadcn/components/ui/label.tsx +22 -4
- package/src/shadcn/components/ui/menubar.tsx +188 -43
- package/src/shadcn/components/ui/pagination.stories.tsx +8 -2
- package/src/shadcn/components/ui/pagination.tsx +65 -8
- package/src/shadcn/components/ui/popover.tsx +36 -4
- package/src/shadcn/components/ui/progress.tsx +21 -5
- package/src/shadcn/components/ui/radio-button-group.stories.tsx +247 -0
- package/src/shadcn/components/ui/radio-button-group.tsx +188 -0
- package/src/shadcn/components/ui/radio-group.stories.tsx +70 -14
- package/src/shadcn/components/ui/radio-group.tsx +85 -9
- package/src/shadcn/components/ui/resizable.stories.tsx +2 -2
- package/src/shadcn/components/ui/resizable.tsx +2 -1
- package/src/shadcn/components/ui/scroll-area.tsx +34 -5
- package/src/shadcn/components/ui/select.stories.tsx +108 -32
- package/src/shadcn/components/ui/select.tsx +182 -36
- package/src/shadcn/components/ui/separator.tsx +16 -5
- package/src/shadcn/components/ui/sheet.tsx +1 -1
- package/src/shadcn/components/ui/sidebar.tsx +69 -26
- package/src/shadcn/components/ui/skeleton.tsx +4 -1
- package/src/shadcn/components/ui/slider.tsx +83 -11
- package/src/shadcn/components/ui/sonner.stories.tsx +238 -17
- package/src/shadcn/components/ui/sonner.tsx +254 -11
- package/src/shadcn/components/ui/switch.stories.tsx +52 -5
- package/src/shadcn/components/ui/switch.tsx +92 -7
- package/src/shadcn/components/ui/table.stories.tsx +252 -72
- package/src/shadcn/components/ui/table.tsx +204 -26
- package/src/shadcn/components/ui/tabs.stories.tsx +235 -123
- package/src/shadcn/components/ui/tabs.tsx +694 -36
- package/src/shadcn/components/ui/textarea.stories.tsx +94 -2
- package/src/shadcn/components/ui/textarea.tsx +70 -5
- package/src/shadcn/components/ui/toggle-group.tsx +35 -13
- package/src/shadcn/components/ui/toggle.stories.tsx +92 -5
- package/src/shadcn/components/ui/toggle.tsx +96 -23
- package/src/shadcn/components/ui/tooltip.tsx +34 -8
- package/src/shadcn/components/ui/tree.tsx +257 -0
- package/src/shadcn/shadcn.css +4 -4
- package/src/tokens.css +50 -20
- package/src/typography.css +78 -15
- package/dist/src/components/code-editor.stories.d.ts +0 -7
- package/dist/src/components/code-editor.stories.d.ts.map +0 -1
- package/dist/src/components/request-line-editor.stories.d.ts +0 -11
- package/dist/src/components/request-line-editor.stories.d.ts.map +0 -1
- package/dist/src/index.stories.d.ts +0 -14
- package/dist/src/index.stories.d.ts.map +0 -1
- package/dist/src/index.stories.js +0 -19
- package/dist/src/index.stories.js.map +0 -1
- package/dist/src/shadcn/components/ui/accordion.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/accordion.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/alert-dialog.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/alert-dialog.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/alert.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/alert.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/aspect-ratio.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/aspect-ratio.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/avatar.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/avatar.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/badge.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/badge.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/breadcrumb.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/breadcrumb.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/button.stories.d.ts +0 -23
- package/dist/src/shadcn/components/ui/button.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/calendar.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/calendar.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/card.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/card.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/carousel.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/carousel.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/chart.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/chart.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/checkbox.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/checkbox.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/collapsible.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/collapsible.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/command.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/command.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/context-menu.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/context-menu.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/dialog.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/dialog.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/drawer.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/drawer.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/dropdown-menu.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/dropdown-menu.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/form.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/form.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/hover-card.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/hover-card.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/input-otp.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/input-otp.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/input.stories.d.ts +0 -18
- package/dist/src/shadcn/components/ui/input.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/label.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/label.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/menubar.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/menubar.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/navigation-menu.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/navigation-menu.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/pagination.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/pagination.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/popover.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/popover.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/progress.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/progress.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/radio-group.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/radio-group.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/resizable.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/resizable.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/scroll-area.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/scroll-area.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/select.stories.d.ts +0 -11
- package/dist/src/shadcn/components/ui/select.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/separator.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/separator.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/sheet.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/sheet.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/sidebar.stories.d.ts +0 -11
- package/dist/src/shadcn/components/ui/sidebar.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/skeleton.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/skeleton.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/slider.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/slider.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/sonner.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/sonner.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/switch.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/switch.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/table.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/table.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/tabs.stories.d.ts +0 -32
- package/dist/src/shadcn/components/ui/tabs.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/textarea.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/textarea.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/toggle-group.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/toggle-group.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/toggle.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/toggle.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/tooltip.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/tooltip.stories.d.ts.map +0 -1
- package/src/index.stories.tsx +0 -21
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
import type { ItemInstance } from "@headless-tree/core";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import {
|
|
4
|
+
Tooltip,
|
|
5
|
+
TooltipContent,
|
|
6
|
+
TooltipTrigger,
|
|
7
|
+
} from "#shadcn/components/ui/tooltip";
|
|
8
|
+
import { cn } from "#shadcn/lib/utils.js";
|
|
9
|
+
import * as CustomIcon from "../icons";
|
|
10
|
+
import { TreeView, type TreeViewItem } from "./tree-view";
|
|
11
|
+
|
|
12
|
+
type PackageSpec = {
|
|
13
|
+
name: string;
|
|
14
|
+
version: string;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
type Coordinate = {
|
|
18
|
+
id?: string;
|
|
19
|
+
packageSpec?: PackageSpec;
|
|
20
|
+
"package-spec"?: PackageSpec;
|
|
21
|
+
label?: string;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
type FhirStructure = {
|
|
25
|
+
type?: string;
|
|
26
|
+
min?: string | number;
|
|
27
|
+
max?: string | number;
|
|
28
|
+
lastNode?: boolean;
|
|
29
|
+
isSummary?: boolean;
|
|
30
|
+
isModifier?: boolean;
|
|
31
|
+
mustSupport?: boolean;
|
|
32
|
+
datatype?: string;
|
|
33
|
+
short?: string;
|
|
34
|
+
desc?: string;
|
|
35
|
+
extensionUrl?: string;
|
|
36
|
+
extensionCoordinate?: Coordinate;
|
|
37
|
+
binding?: {
|
|
38
|
+
valueSet: string;
|
|
39
|
+
};
|
|
40
|
+
vsCoordinate?: Coordinate;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
function FiledIcon(item: ItemInstance<TreeViewItem<FhirStructure>>) {
|
|
44
|
+
const filedType = item.getItemData()?.meta?.type;
|
|
45
|
+
|
|
46
|
+
switch (filedType) {
|
|
47
|
+
case "Resource":
|
|
48
|
+
return <CustomIcon.ResourceIcon />;
|
|
49
|
+
case "BackboneElement":
|
|
50
|
+
return <CustomIcon.BackboneElementIcon />;
|
|
51
|
+
case "Extension":
|
|
52
|
+
return <CustomIcon.ExtensionIcon />;
|
|
53
|
+
case "Reference":
|
|
54
|
+
return <CustomIcon.ReferenceIcon />;
|
|
55
|
+
case "union":
|
|
56
|
+
return <CustomIcon.UnionIcon />;
|
|
57
|
+
case "instant":
|
|
58
|
+
case "time":
|
|
59
|
+
case "date":
|
|
60
|
+
case "dateTime":
|
|
61
|
+
case "decimal":
|
|
62
|
+
case "boolean":
|
|
63
|
+
case "integer":
|
|
64
|
+
case "string":
|
|
65
|
+
case "uri":
|
|
66
|
+
case "base64Binary":
|
|
67
|
+
case "code":
|
|
68
|
+
case "id":
|
|
69
|
+
case "oid":
|
|
70
|
+
case "unsignedInt":
|
|
71
|
+
case "positiveInt":
|
|
72
|
+
case "markdown":
|
|
73
|
+
case "url":
|
|
74
|
+
case "canonical":
|
|
75
|
+
case "uuid":
|
|
76
|
+
case "integer64":
|
|
77
|
+
return <CustomIcon.TypCodeIcon />;
|
|
78
|
+
default:
|
|
79
|
+
return <CustomIcon.ComplexTypeIcon />;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const customItemFieldNameClass = cn(
|
|
84
|
+
"flex",
|
|
85
|
+
"items-center",
|
|
86
|
+
"truncate",
|
|
87
|
+
"gap-2",
|
|
88
|
+
"min-w-[calc(260px-var(--tree-padding))]",
|
|
89
|
+
"w-[calc(260px-var(--tree-padding))]",
|
|
90
|
+
"in-data-[folder=true]:w-[calc(260px-var(--tree-padding))]",
|
|
91
|
+
"in-data-[folder=true]:min-w-[calc(260px-var(--tree-padding))]",
|
|
92
|
+
);
|
|
93
|
+
|
|
94
|
+
function customItemView(item: ItemInstance<TreeViewItem<FhirStructure>>) {
|
|
95
|
+
const fieldName = item.getItemData()?.name;
|
|
96
|
+
const cardinalityMin = item.getItemData()?.meta?.min;
|
|
97
|
+
const cardinalityMax = item.getItemData()?.meta?.max;
|
|
98
|
+
const isSummary = item.getItemData()?.meta?.isSummary;
|
|
99
|
+
const isModifier = item.getItemData()?.meta?.isModifier;
|
|
100
|
+
const mustSupport = item.getItemData()?.meta?.mustSupport;
|
|
101
|
+
const datatype = item.getItemData()?.meta?.type;
|
|
102
|
+
const short = item.getItemData()?.meta?.short;
|
|
103
|
+
const desc = item.getItemData()?.meta?.desc;
|
|
104
|
+
const extensionUrl = item.getItemData()?.meta?.extensionUrl;
|
|
105
|
+
const extensionCoordinate = item.getItemData()?.meta?.extensionCoordinate;
|
|
106
|
+
const binding = item.getItemData()?.meta?.binding;
|
|
107
|
+
const vsCoordinate = item.getItemData()?.meta?.vsCoordinate;
|
|
108
|
+
return (
|
|
109
|
+
<div className="flex items-start gap-2 text-xs">
|
|
110
|
+
<div className={customItemFieldNameClass}>
|
|
111
|
+
{FiledIcon(item)}
|
|
112
|
+
{fieldName}
|
|
113
|
+
</div>
|
|
114
|
+
|
|
115
|
+
<div className="flex items-center gap-1 min-w-[60px] w-[60px]">
|
|
116
|
+
{mustSupport && (
|
|
117
|
+
<Tooltip>
|
|
118
|
+
<TooltipTrigger asChild>
|
|
119
|
+
<span className="px-[2px] max-h-[20px] text-white bg-red-600 rounded cursor-help">
|
|
120
|
+
S
|
|
121
|
+
</span>
|
|
122
|
+
</TooltipTrigger>
|
|
123
|
+
<TooltipContent>
|
|
124
|
+
<p>Must be supported</p>
|
|
125
|
+
</TooltipContent>
|
|
126
|
+
</Tooltip>
|
|
127
|
+
)}
|
|
128
|
+
{isSummary && (
|
|
129
|
+
<Tooltip>
|
|
130
|
+
<TooltipTrigger asChild>
|
|
131
|
+
<span className="px-[2px] max-h-[20px] cursor-help">Σ</span>
|
|
132
|
+
</TooltipTrigger>
|
|
133
|
+
<TooltipContent>
|
|
134
|
+
<p>Part of the summary set</p>
|
|
135
|
+
</TooltipContent>
|
|
136
|
+
</Tooltip>
|
|
137
|
+
)}
|
|
138
|
+
{isModifier && (
|
|
139
|
+
<Tooltip>
|
|
140
|
+
<TooltipTrigger asChild>
|
|
141
|
+
<span className="px-[2px] max-h-[20px] cursor-help">!?</span>
|
|
142
|
+
</TooltipTrigger>
|
|
143
|
+
<TooltipContent>
|
|
144
|
+
<p>Modifying element</p>
|
|
145
|
+
</TooltipContent>
|
|
146
|
+
</Tooltip>
|
|
147
|
+
)}
|
|
148
|
+
</div>
|
|
149
|
+
<div className="flex items-center gap-1 min-w-[50px] w-[50px] typo-code">
|
|
150
|
+
{cardinalityMin && cardinalityMax
|
|
151
|
+
? `${cardinalityMin}..${cardinalityMax}`
|
|
152
|
+
: ""}
|
|
153
|
+
</div>
|
|
154
|
+
<div className="flex gap-1 w-[200px] min-w-[200px]">
|
|
155
|
+
{datatype !== "union" && datatype}
|
|
156
|
+
</div>
|
|
157
|
+
<div className="text-left overflow-hidden">
|
|
158
|
+
{short && <div className="line-clamp-2">{short}</div>}
|
|
159
|
+
{!short && desc && <div className="line-clamp-2">{desc}</div>}
|
|
160
|
+
{extensionUrl && (
|
|
161
|
+
<div className="flex items-center gap-1">
|
|
162
|
+
<span>URL:</span>
|
|
163
|
+
{extensionCoordinate?.id ? (
|
|
164
|
+
<a
|
|
165
|
+
href={`#/ig/${extensionCoordinate?.["package-spec"]?.name || extensionCoordinate?.packageSpec?.name}#${extensionCoordinate?.["package-spec"]?.version || extensionCoordinate?.packageSpec?.version}/sd/${extensionCoordinate?.id}`}
|
|
166
|
+
className="font-medium hover:underline"
|
|
167
|
+
>
|
|
168
|
+
{extensionCoordinate?.label || extensionUrl}
|
|
169
|
+
</a>
|
|
170
|
+
) : (
|
|
171
|
+
<span className="font-medium">
|
|
172
|
+
{extensionCoordinate?.label || extensionUrl}
|
|
173
|
+
</span>
|
|
174
|
+
)}
|
|
175
|
+
</div>
|
|
176
|
+
)}
|
|
177
|
+
{binding && (
|
|
178
|
+
<div className="flex items-center gap-1">
|
|
179
|
+
<span>Binding:</span>
|
|
180
|
+
{vsCoordinate?.id ? (
|
|
181
|
+
<a
|
|
182
|
+
href={`#/ig/${vsCoordinate?.["package-spec"]?.name || vsCoordinate?.packageSpec?.name}#${vsCoordinate?.["package-spec"]?.version || vsCoordinate?.packageSpec?.version}/vs/${vsCoordinate?.id}`}
|
|
183
|
+
className="font-medium hover:underline"
|
|
184
|
+
>
|
|
185
|
+
{vsCoordinate?.label || binding?.valueSet || "Binding"}
|
|
186
|
+
</a>
|
|
187
|
+
) : (
|
|
188
|
+
<span className="font-medium">
|
|
189
|
+
{vsCoordinate?.label || binding?.valueSet || "Binding"}
|
|
190
|
+
</span>
|
|
191
|
+
)}
|
|
192
|
+
</div>
|
|
193
|
+
)}
|
|
194
|
+
</div>
|
|
195
|
+
</div>
|
|
196
|
+
);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
function FhirStructureView({
|
|
200
|
+
tree,
|
|
201
|
+
}: {
|
|
202
|
+
tree: Record<string, TreeViewItem<FhirStructure>>;
|
|
203
|
+
}) {
|
|
204
|
+
const expandedItemIds = React.useMemo(() => {
|
|
205
|
+
return Object.keys(tree ?? {});
|
|
206
|
+
}, [tree]);
|
|
207
|
+
|
|
208
|
+
return (
|
|
209
|
+
<div className="min-h-0 min-w-0">
|
|
210
|
+
<div className="flex items-center gap-2 font-semibold text-xs text-text-secondary border-b py-2 pl-[34px] bg-bg-primary sticky top-0 z-20">
|
|
211
|
+
<div className="min-w-[260px] w-[260px]">Name</div>
|
|
212
|
+
<div className="min-w-[60px] w-[60px]">Flags</div>
|
|
213
|
+
<div className="min-w-[50px] w-[50px]">Card.</div>
|
|
214
|
+
<div className="min-w-[200px] w-[200px]">Type</div>
|
|
215
|
+
<div className="flex-1">Description</div>
|
|
216
|
+
</div>
|
|
217
|
+
<TreeView
|
|
218
|
+
focusedItem={null}
|
|
219
|
+
onFocusedItemChange={() => {}}
|
|
220
|
+
hideChevron={false}
|
|
221
|
+
horizontalLines={true}
|
|
222
|
+
disableHover={true}
|
|
223
|
+
zebra={true}
|
|
224
|
+
rootItemId="root"
|
|
225
|
+
items={tree}
|
|
226
|
+
customItemView={customItemView}
|
|
227
|
+
defaultExpandedItems={expandedItemIds}
|
|
228
|
+
/>
|
|
229
|
+
</div>
|
|
230
|
+
);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
export { FhirStructureView, type FhirStructure };
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { Controls, Primary, Title } from "@storybook/addon-docs/blocks";
|
|
2
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
3
|
+
import {
|
|
4
|
+
AlignLeft,
|
|
5
|
+
Copy,
|
|
6
|
+
Download,
|
|
7
|
+
Edit,
|
|
8
|
+
Settings,
|
|
9
|
+
Trash2,
|
|
10
|
+
} from "lucide-react";
|
|
11
|
+
import { IconButton } from "./icon-button";
|
|
12
|
+
|
|
13
|
+
const meta = {
|
|
14
|
+
title: "Component/IconButton",
|
|
15
|
+
component: IconButton,
|
|
16
|
+
parameters: {
|
|
17
|
+
docs: {
|
|
18
|
+
page: () => (
|
|
19
|
+
<>
|
|
20
|
+
<Title />
|
|
21
|
+
<Primary />
|
|
22
|
+
<Controls />
|
|
23
|
+
</>
|
|
24
|
+
),
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
argTypes: {
|
|
28
|
+
variant: {
|
|
29
|
+
control: "select",
|
|
30
|
+
options: ["ghost", "link"],
|
|
31
|
+
},
|
|
32
|
+
disabled: {
|
|
33
|
+
control: "boolean",
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
args: {
|
|
37
|
+
icon: <Copy />,
|
|
38
|
+
"aria-label": "Copy",
|
|
39
|
+
variant: "ghost",
|
|
40
|
+
disabled: false,
|
|
41
|
+
},
|
|
42
|
+
} satisfies Meta<typeof IconButton>;
|
|
43
|
+
|
|
44
|
+
export default meta;
|
|
45
|
+
type Story = StoryObj<typeof meta>;
|
|
46
|
+
|
|
47
|
+
export const Default: Story = {
|
|
48
|
+
tags: ["!dev"],
|
|
49
|
+
render: (args) => <IconButton {...args} />,
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export const Demo: Story = {
|
|
53
|
+
tags: ["!autodocs"],
|
|
54
|
+
render: () => (
|
|
55
|
+
<div className="flex flex-col gap-4">
|
|
56
|
+
<div className="flex items-center gap-4">
|
|
57
|
+
<span className="w-16 typo-body text-text-secondary">Ghost:</span>
|
|
58
|
+
<IconButton icon={<Copy />} aria-label="Copy" variant="ghost" />
|
|
59
|
+
<IconButton icon={<Edit />} aria-label="Edit" variant="ghost" />
|
|
60
|
+
<IconButton icon={<Trash2 />} aria-label="Delete" variant="ghost" />
|
|
61
|
+
<IconButton icon={<Download />} aria-label="Download" variant="ghost" />
|
|
62
|
+
<IconButton icon={<Settings />} aria-label="Settings" variant="ghost" />
|
|
63
|
+
<IconButton icon={<AlignLeft />} aria-label="Align" variant="ghost" />
|
|
64
|
+
</div>
|
|
65
|
+
<div className="flex items-center gap-4">
|
|
66
|
+
<span className="w-16 typo-body text-text-secondary">Link:</span>
|
|
67
|
+
<IconButton icon={<Copy />} aria-label="Copy" variant="link" />
|
|
68
|
+
<IconButton icon={<Edit />} aria-label="Edit" variant="link" />
|
|
69
|
+
<IconButton icon={<Trash2 />} aria-label="Delete" variant="link" />
|
|
70
|
+
<IconButton icon={<Download />} aria-label="Download" variant="link" />
|
|
71
|
+
<IconButton icon={<Settings />} aria-label="Settings" variant="link" />
|
|
72
|
+
<IconButton icon={<AlignLeft />} aria-label="Align" variant="link" />
|
|
73
|
+
</div>
|
|
74
|
+
<div className="flex items-center gap-4">
|
|
75
|
+
<span className="w-16 typo-body text-text-secondary">Disabled:</span>
|
|
76
|
+
<IconButton
|
|
77
|
+
icon={<Copy />}
|
|
78
|
+
aria-label="Copy"
|
|
79
|
+
variant="ghost"
|
|
80
|
+
disabled
|
|
81
|
+
/>
|
|
82
|
+
<IconButton icon={<Copy />} aria-label="Copy" variant="link" disabled />
|
|
83
|
+
</div>
|
|
84
|
+
</div>
|
|
85
|
+
),
|
|
86
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { cva, type VariantProps } from "class-variance-authority";
|
|
2
|
+
import type React from "react";
|
|
3
|
+
import { buttonVariants } from "#shadcn/components/ui/button";
|
|
4
|
+
import { cn } from "#shadcn/lib/utils";
|
|
5
|
+
|
|
6
|
+
// Styles
|
|
7
|
+
const iconButtonBaseStyles = cn(
|
|
8
|
+
// Size
|
|
9
|
+
"size-6",
|
|
10
|
+
// Spacing
|
|
11
|
+
"p-0",
|
|
12
|
+
// SVG
|
|
13
|
+
"[&>svg]:size-4",
|
|
14
|
+
"[&>svg]:pointer-events-none",
|
|
15
|
+
"[&>svg]:shrink-0",
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
const iconButtonVariants = cva(iconButtonBaseStyles, {
|
|
19
|
+
variants: {
|
|
20
|
+
variant: {
|
|
21
|
+
ghost: buttonVariants({ variant: "ghost", size: "small" }),
|
|
22
|
+
link: buttonVariants({ variant: "link", size: "small" }),
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
defaultVariants: {
|
|
26
|
+
variant: "ghost",
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
// Interface
|
|
31
|
+
export interface IconButtonProps
|
|
32
|
+
extends Omit<React.ComponentProps<"button">, "children">,
|
|
33
|
+
VariantProps<typeof iconButtonVariants> {
|
|
34
|
+
icon: React.ReactNode;
|
|
35
|
+
"aria-label": string;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Component
|
|
39
|
+
function IconButton({
|
|
40
|
+
icon,
|
|
41
|
+
className,
|
|
42
|
+
variant = "ghost",
|
|
43
|
+
...props
|
|
44
|
+
}: IconButtonProps) {
|
|
45
|
+
return (
|
|
46
|
+
<button
|
|
47
|
+
type="button"
|
|
48
|
+
data-slot="icon-button"
|
|
49
|
+
className={cn(iconButtonVariants({ variant }), className)}
|
|
50
|
+
{...props}
|
|
51
|
+
>
|
|
52
|
+
{icon}
|
|
53
|
+
</button>
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export { IconButton, iconButtonVariants };
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
+
import { OperationOutcomeView } from "./operation-outcome-view";
|
|
3
|
+
|
|
4
|
+
const meta = {
|
|
5
|
+
title: "Component/OperationOutcomeView",
|
|
6
|
+
component: OperationOutcomeView,
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: "padded",
|
|
9
|
+
},
|
|
10
|
+
} satisfies Meta<typeof OperationOutcomeView>;
|
|
11
|
+
|
|
12
|
+
export default meta;
|
|
13
|
+
type Story = StoryObj<typeof meta>;
|
|
14
|
+
|
|
15
|
+
export const Default: Story = {
|
|
16
|
+
args: {
|
|
17
|
+
resource: {
|
|
18
|
+
resourceType: "OperationOutcome",
|
|
19
|
+
issue: [
|
|
20
|
+
{
|
|
21
|
+
code: "invalid",
|
|
22
|
+
severity: "error",
|
|
23
|
+
diagnostics: "Unknown key:",
|
|
24
|
+
expression: ['"communication"'],
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
code: "invalid",
|
|
28
|
+
severity: "error",
|
|
29
|
+
diagnostics: "Unknown key:",
|
|
30
|
+
expression: ['"address"'],
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
code: "invalid",
|
|
34
|
+
severity: "error",
|
|
35
|
+
diagnostics: "Unknown key:",
|
|
36
|
+
expression: ['"temp1"'],
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
code: "invalid",
|
|
40
|
+
severity: "error",
|
|
41
|
+
diagnostics: "Unknown key:",
|
|
42
|
+
expression: ['"temp2"'],
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export const Demo: Story = {
|
|
50
|
+
tags: ["!autodocs"],
|
|
51
|
+
args: Default.args,
|
|
52
|
+
render: () => (
|
|
53
|
+
<div className="flex flex-col gap-6">
|
|
54
|
+
<div>
|
|
55
|
+
<h3 className="typo-h4 mb-2">Errors only</h3>
|
|
56
|
+
<OperationOutcomeView
|
|
57
|
+
resource={{
|
|
58
|
+
resourceType: "OperationOutcome",
|
|
59
|
+
issue: [
|
|
60
|
+
{
|
|
61
|
+
code: "invalid",
|
|
62
|
+
severity: "error",
|
|
63
|
+
diagnostics: "Unknown key:",
|
|
64
|
+
expression: ['"communication"'],
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
code: "invalid",
|
|
68
|
+
severity: "error",
|
|
69
|
+
diagnostics: "Unknown key:",
|
|
70
|
+
expression: ['"address"'],
|
|
71
|
+
},
|
|
72
|
+
],
|
|
73
|
+
}}
|
|
74
|
+
/>
|
|
75
|
+
</div>
|
|
76
|
+
|
|
77
|
+
<div>
|
|
78
|
+
<h3 className="typo-h4 mb-2">Warnings only</h3>
|
|
79
|
+
<OperationOutcomeView
|
|
80
|
+
resource={{
|
|
81
|
+
resourceType: "OperationOutcome",
|
|
82
|
+
issue: [
|
|
83
|
+
{
|
|
84
|
+
code: "business-rule",
|
|
85
|
+
severity: "warning",
|
|
86
|
+
diagnostics: "Resource has no narrative text",
|
|
87
|
+
expression: ["Patient.text"],
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
code: "informational",
|
|
91
|
+
severity: "warning",
|
|
92
|
+
diagnostics: "Best practice violation",
|
|
93
|
+
expression: ["Patient.contact"],
|
|
94
|
+
},
|
|
95
|
+
],
|
|
96
|
+
}}
|
|
97
|
+
/>
|
|
98
|
+
</div>
|
|
99
|
+
|
|
100
|
+
<div>
|
|
101
|
+
<h3 className="typo-h4 mb-2">Mixed severities</h3>
|
|
102
|
+
<OperationOutcomeView
|
|
103
|
+
resource={{
|
|
104
|
+
resourceType: "OperationOutcome",
|
|
105
|
+
issue: [
|
|
106
|
+
{
|
|
107
|
+
code: "structure",
|
|
108
|
+
severity: "fatal",
|
|
109
|
+
diagnostics: "Invalid JSON",
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
code: "invalid",
|
|
113
|
+
severity: "error",
|
|
114
|
+
diagnostics: "Unknown key:",
|
|
115
|
+
expression: ['"temp1"'],
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
code: "invalid",
|
|
119
|
+
severity: "error",
|
|
120
|
+
diagnostics: "Unknown key:",
|
|
121
|
+
expression: ['"temp2"'],
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
code: "business-rule",
|
|
125
|
+
severity: "warning",
|
|
126
|
+
diagnostics: "Missing preferred field",
|
|
127
|
+
expression: ["Patient.name.given"],
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
code: "informational",
|
|
131
|
+
severity: "information",
|
|
132
|
+
diagnostics: "Validation completed with issues",
|
|
133
|
+
},
|
|
134
|
+
],
|
|
135
|
+
}}
|
|
136
|
+
/>
|
|
137
|
+
</div>
|
|
138
|
+
|
|
139
|
+
<div>
|
|
140
|
+
<h3 className="typo-h4 mb-2">With multiple expressions</h3>
|
|
141
|
+
<OperationOutcomeView
|
|
142
|
+
resource={{
|
|
143
|
+
resourceType: "OperationOutcome",
|
|
144
|
+
issue: [
|
|
145
|
+
{
|
|
146
|
+
code: "required",
|
|
147
|
+
severity: "error",
|
|
148
|
+
diagnostics: "Missing required element",
|
|
149
|
+
expression: ["Patient.identifier", "Patient.name"],
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
code: "value",
|
|
153
|
+
severity: "error",
|
|
154
|
+
diagnostics: "Invalid date format",
|
|
155
|
+
expression: ["Patient.birthDate"],
|
|
156
|
+
},
|
|
157
|
+
],
|
|
158
|
+
}}
|
|
159
|
+
/>
|
|
160
|
+
</div>
|
|
161
|
+
</div>
|
|
162
|
+
),
|
|
163
|
+
};
|