@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,149 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
+
import { Activity, BarChart3, Settings, Users } from "lucide-react";
|
|
3
|
+
import { Tile } from "./tile";
|
|
4
|
+
|
|
5
|
+
const meta: Meta<typeof Tile> = {
|
|
6
|
+
title: "Component/Tile",
|
|
7
|
+
component: Tile,
|
|
8
|
+
parameters: {
|
|
9
|
+
layout: "centered",
|
|
10
|
+
},
|
|
11
|
+
tags: ["autodocs"],
|
|
12
|
+
argTypes: {
|
|
13
|
+
size: {
|
|
14
|
+
control: { type: "select" },
|
|
15
|
+
options: ["auto", "free"],
|
|
16
|
+
},
|
|
17
|
+
showIcon: {
|
|
18
|
+
control: { type: "boolean" },
|
|
19
|
+
},
|
|
20
|
+
icon: {
|
|
21
|
+
control: { type: "select" },
|
|
22
|
+
options: ["Activity", "Users", "Settings", "BarChart"],
|
|
23
|
+
mapping: {
|
|
24
|
+
Activity: <Activity />,
|
|
25
|
+
Users: <Users />,
|
|
26
|
+
Settings: <Settings />,
|
|
27
|
+
BarChart: <BarChart3 />,
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
width: {
|
|
31
|
+
control: { type: "text" },
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export default meta;
|
|
37
|
+
type Story = StoryObj<typeof meta>;
|
|
38
|
+
|
|
39
|
+
const ActivityIcon = () => <Activity />;
|
|
40
|
+
const UsersIcon = () => <Users />;
|
|
41
|
+
const SettingsIcon = () => <Settings />;
|
|
42
|
+
const BarChartIcon = () => <BarChart3 />;
|
|
43
|
+
|
|
44
|
+
export const Default: Story = {
|
|
45
|
+
args: {
|
|
46
|
+
label: "Active Apps",
|
|
47
|
+
value: "0",
|
|
48
|
+
icon: <ActivityIcon />,
|
|
49
|
+
showIcon: true,
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export const WithIcon: Story = {
|
|
54
|
+
args: {
|
|
55
|
+
label: "Active Apps",
|
|
56
|
+
value: "0",
|
|
57
|
+
icon: <ActivityIcon />,
|
|
58
|
+
showIcon: true,
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export const AutoSize: Story = {
|
|
63
|
+
args: {
|
|
64
|
+
label: "Users",
|
|
65
|
+
value: "1,234",
|
|
66
|
+
icon: <UsersIcon />,
|
|
67
|
+
showIcon: true,
|
|
68
|
+
size: "auto",
|
|
69
|
+
},
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export const FreeSize: Story = {
|
|
73
|
+
args: {
|
|
74
|
+
label: "Total Revenue",
|
|
75
|
+
value: "$12,345",
|
|
76
|
+
icon: <BarChartIcon />,
|
|
77
|
+
showIcon: true,
|
|
78
|
+
size: "free",
|
|
79
|
+
},
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
export const CustomWidth: Story = {
|
|
83
|
+
args: {
|
|
84
|
+
label: "Settings",
|
|
85
|
+
value: "Configured",
|
|
86
|
+
icon: <SettingsIcon />,
|
|
87
|
+
showIcon: true,
|
|
88
|
+
width: "200px",
|
|
89
|
+
},
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
export const WithoutIcon: Story = {
|
|
93
|
+
args: {
|
|
94
|
+
label: "Simple Tile",
|
|
95
|
+
value: "No Icon",
|
|
96
|
+
showIcon: false,
|
|
97
|
+
},
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
export const OnlyLabel: Story = {
|
|
101
|
+
args: {
|
|
102
|
+
label: "Status",
|
|
103
|
+
showIcon: false,
|
|
104
|
+
},
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
export const OnlyValue: Story = {
|
|
108
|
+
args: {
|
|
109
|
+
value: "42",
|
|
110
|
+
showIcon: false,
|
|
111
|
+
},
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
export const Grid: Story = {
|
|
115
|
+
render: () => (
|
|
116
|
+
<div className="grid grid-cols-3 gap-4 w-full max-w-4xl">
|
|
117
|
+
<Tile
|
|
118
|
+
label="Active Apps"
|
|
119
|
+
value="0"
|
|
120
|
+
icon={<ActivityIcon />}
|
|
121
|
+
showIcon={true}
|
|
122
|
+
size="free"
|
|
123
|
+
/>
|
|
124
|
+
<Tile
|
|
125
|
+
label="Users"
|
|
126
|
+
value="1,234"
|
|
127
|
+
icon={<UsersIcon />}
|
|
128
|
+
showIcon={true}
|
|
129
|
+
size="free"
|
|
130
|
+
/>
|
|
131
|
+
<Tile
|
|
132
|
+
label="Revenue"
|
|
133
|
+
value="$12,345"
|
|
134
|
+
icon={<BarChartIcon />}
|
|
135
|
+
showIcon={true}
|
|
136
|
+
size="free"
|
|
137
|
+
/>
|
|
138
|
+
<Tile
|
|
139
|
+
label="Settings"
|
|
140
|
+
value="Configured"
|
|
141
|
+
icon={<SettingsIcon />}
|
|
142
|
+
showIcon={true}
|
|
143
|
+
size="free"
|
|
144
|
+
/>
|
|
145
|
+
<Tile label="Simple" value="No Icon" showIcon={false} size="free" />
|
|
146
|
+
<Tile label="Status" value="Online" showIcon={false} size="free" />
|
|
147
|
+
</div>
|
|
148
|
+
),
|
|
149
|
+
};
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { cva, type VariantProps } from "class-variance-authority";
|
|
2
|
+
import type React from "react";
|
|
3
|
+
import { cn } from "../shadcn/lib/utils";
|
|
4
|
+
|
|
5
|
+
const baseTileStyles = cn(
|
|
6
|
+
"flex",
|
|
7
|
+
"flex-col",
|
|
8
|
+
"items-start",
|
|
9
|
+
"gap-2",
|
|
10
|
+
"p-6",
|
|
11
|
+
"bg-bg-primary",
|
|
12
|
+
"rounded-lg",
|
|
13
|
+
"border",
|
|
14
|
+
"border-border-default",
|
|
15
|
+
"transition-colors",
|
|
16
|
+
"duration-200",
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
const tileSizeVariants = cva("", {
|
|
20
|
+
variants: {
|
|
21
|
+
size: {
|
|
22
|
+
auto: "w-auto",
|
|
23
|
+
free: "w-full",
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
defaultVariants: {
|
|
27
|
+
size: "auto",
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
const contentStyles = cn("flex", "flex-col", "items-start", "w-full");
|
|
32
|
+
|
|
33
|
+
const labelStyles = cn("typo-body", "text-text-secondary");
|
|
34
|
+
|
|
35
|
+
const valueStyles = cn("typo-page-header", "text-text-primary");
|
|
36
|
+
|
|
37
|
+
const iconStyles = cn(
|
|
38
|
+
"flex",
|
|
39
|
+
"items-center",
|
|
40
|
+
"justify-center",
|
|
41
|
+
"size-12",
|
|
42
|
+
"shrink-0",
|
|
43
|
+
"rounded-full",
|
|
44
|
+
"bg-bg-tertiary",
|
|
45
|
+
"text-fg-secondary",
|
|
46
|
+
"[&>svg]:size-6",
|
|
47
|
+
"[&>svg]:pointer-events-none",
|
|
48
|
+
"[&>svg]:shrink-0",
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
const iconContainerStyles = cn("flex", "items-center", "gap-3", "w-full");
|
|
52
|
+
|
|
53
|
+
export type TileProps = {
|
|
54
|
+
label?: string;
|
|
55
|
+
value?: string | number;
|
|
56
|
+
icon?: React.ReactNode;
|
|
57
|
+
showIcon?: boolean;
|
|
58
|
+
width?: string | number;
|
|
59
|
+
} & Omit<React.ComponentProps<"div">, "size"> &
|
|
60
|
+
VariantProps<typeof tileSizeVariants>;
|
|
61
|
+
|
|
62
|
+
export function Tile({
|
|
63
|
+
children,
|
|
64
|
+
label,
|
|
65
|
+
value,
|
|
66
|
+
icon,
|
|
67
|
+
showIcon = false,
|
|
68
|
+
size = "auto",
|
|
69
|
+
width,
|
|
70
|
+
className,
|
|
71
|
+
style,
|
|
72
|
+
...props
|
|
73
|
+
}: TileProps) {
|
|
74
|
+
const shouldShowIcon = showIcon && icon;
|
|
75
|
+
const tileStyle = width ? { ...style, width } : style;
|
|
76
|
+
|
|
77
|
+
return (
|
|
78
|
+
<div
|
|
79
|
+
data-slot="tile"
|
|
80
|
+
className={cn(baseTileStyles, tileSizeVariants({ size }), className)}
|
|
81
|
+
style={tileStyle}
|
|
82
|
+
{...props}
|
|
83
|
+
>
|
|
84
|
+
<div className={contentStyles}>
|
|
85
|
+
{shouldShowIcon ? (
|
|
86
|
+
<div className={iconContainerStyles}>
|
|
87
|
+
<div className={iconStyles}>{icon}</div>
|
|
88
|
+
<div className="flex flex-col items-start w-full">
|
|
89
|
+
{label && <div className={labelStyles}>{label}</div>}
|
|
90
|
+
{value !== undefined && (
|
|
91
|
+
<div className={valueStyles}>{value}</div>
|
|
92
|
+
)}
|
|
93
|
+
</div>
|
|
94
|
+
</div>
|
|
95
|
+
) : (
|
|
96
|
+
<>
|
|
97
|
+
{label && <div className={labelStyles}>{label}</div>}
|
|
98
|
+
{value !== undefined && <div className={valueStyles}>{value}</div>}
|
|
99
|
+
</>
|
|
100
|
+
)}
|
|
101
|
+
{children}
|
|
102
|
+
</div>
|
|
103
|
+
</div>
|
|
104
|
+
);
|
|
105
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { Toolbar } from "./toolbar";
|
|
4
|
+
|
|
5
|
+
const meta = {
|
|
6
|
+
title: "Component/Toolbar",
|
|
7
|
+
component: Toolbar,
|
|
8
|
+
parameters: {
|
|
9
|
+
layout: "centered",
|
|
10
|
+
},
|
|
11
|
+
tags: ["autodocs"],
|
|
12
|
+
} satisfies Meta<typeof Toolbar>;
|
|
13
|
+
|
|
14
|
+
export default meta;
|
|
15
|
+
type Story = StoryObj<typeof meta>;
|
|
16
|
+
|
|
17
|
+
export const Default: Story = {
|
|
18
|
+
args: {
|
|
19
|
+
segmentControlValue: "json",
|
|
20
|
+
onSegmentControlChange: () => {},
|
|
21
|
+
segmentControlItems: [
|
|
22
|
+
{ value: "json", label: "JSON" },
|
|
23
|
+
{ value: "yaml", label: "YAML" },
|
|
24
|
+
],
|
|
25
|
+
showCopy: true,
|
|
26
|
+
showAlignLeft: true,
|
|
27
|
+
showDownload: true,
|
|
28
|
+
},
|
|
29
|
+
render: (args) => {
|
|
30
|
+
const [value, setValue] = useState(args.segmentControlValue || "json");
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<Toolbar
|
|
34
|
+
{...args}
|
|
35
|
+
segmentControlValue={value}
|
|
36
|
+
onSegmentControlChange={setValue}
|
|
37
|
+
/>
|
|
38
|
+
);
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export const WithCustomActions: Story = {
|
|
43
|
+
args: {
|
|
44
|
+
segmentControlValue: "json",
|
|
45
|
+
segmentControlItems: [
|
|
46
|
+
{ value: "json", label: "JSON" },
|
|
47
|
+
{ value: "yaml", label: "YAML" },
|
|
48
|
+
],
|
|
49
|
+
showCopy: true,
|
|
50
|
+
showAlignLeft: false,
|
|
51
|
+
showDownload: true,
|
|
52
|
+
},
|
|
53
|
+
render: (args) => {
|
|
54
|
+
const [value, setValue] = useState(args.segmentControlValue || "json");
|
|
55
|
+
|
|
56
|
+
return (
|
|
57
|
+
<Toolbar
|
|
58
|
+
{...args}
|
|
59
|
+
segmentControlValue={value}
|
|
60
|
+
onSegmentControlChange={setValue}
|
|
61
|
+
/>
|
|
62
|
+
);
|
|
63
|
+
},
|
|
64
|
+
};
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { AlignLeft, Copy, Download } from "lucide-react";
|
|
2
|
+
import type React from "react";
|
|
3
|
+
import { cn } from "#shadcn/lib/utils";
|
|
4
|
+
import { IconButton } from "./icon-button";
|
|
5
|
+
import { SegmentControl } from "./segment-control";
|
|
6
|
+
|
|
7
|
+
// Styles
|
|
8
|
+
const toolbarContainerStyles = cn(
|
|
9
|
+
// Layout
|
|
10
|
+
"inline-flex",
|
|
11
|
+
"items-center",
|
|
12
|
+
"gap-2",
|
|
13
|
+
// Spacing
|
|
14
|
+
"pl-[9px]",
|
|
15
|
+
"pr-2",
|
|
16
|
+
"py-2",
|
|
17
|
+
// Background
|
|
18
|
+
"bg-bg-primary",
|
|
19
|
+
// Border
|
|
20
|
+
"border",
|
|
21
|
+
"border-border-secondary",
|
|
22
|
+
// Shape
|
|
23
|
+
"rounded-full",
|
|
24
|
+
// Shadow
|
|
25
|
+
"toolbar-shadow",
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
const iconsContainerStyles = cn(
|
|
29
|
+
// Layout
|
|
30
|
+
"flex",
|
|
31
|
+
"items-center",
|
|
32
|
+
"gap-0",
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
export interface ToolbarProps
|
|
36
|
+
extends Omit<React.ComponentProps<"div">, "children"> {
|
|
37
|
+
segmentControlValue?: string;
|
|
38
|
+
onSegmentControlChange?: (value: string) => void;
|
|
39
|
+
segmentControlItems?: { value: string; label: React.ReactNode }[];
|
|
40
|
+
onCopyClick?: () => void;
|
|
41
|
+
onAlignLeftClick?: () => void;
|
|
42
|
+
onDownloadClick?: () => void;
|
|
43
|
+
showCopy?: boolean;
|
|
44
|
+
showAlignLeft?: boolean;
|
|
45
|
+
showDownload?: boolean;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function Toolbar({
|
|
49
|
+
segmentControlValue = "json",
|
|
50
|
+
onSegmentControlChange,
|
|
51
|
+
segmentControlItems = [
|
|
52
|
+
{ value: "json", label: "JSON" },
|
|
53
|
+
{ value: "yaml", label: "YAML" },
|
|
54
|
+
],
|
|
55
|
+
onCopyClick,
|
|
56
|
+
onAlignLeftClick,
|
|
57
|
+
onDownloadClick,
|
|
58
|
+
showCopy = true,
|
|
59
|
+
showAlignLeft = true,
|
|
60
|
+
showDownload = true,
|
|
61
|
+
className,
|
|
62
|
+
...props
|
|
63
|
+
}: ToolbarProps) {
|
|
64
|
+
return (
|
|
65
|
+
<div
|
|
66
|
+
data-slot="toolbar"
|
|
67
|
+
className={cn(toolbarContainerStyles, className)}
|
|
68
|
+
{...props}
|
|
69
|
+
>
|
|
70
|
+
<SegmentControl
|
|
71
|
+
value={segmentControlValue}
|
|
72
|
+
onValueChange={onSegmentControlChange || (() => {})}
|
|
73
|
+
items={segmentControlItems}
|
|
74
|
+
/>
|
|
75
|
+
<div className={iconsContainerStyles}>
|
|
76
|
+
{showCopy && (
|
|
77
|
+
<IconButton icon={<Copy />} aria-label="Copy" onClick={onCopyClick} />
|
|
78
|
+
)}
|
|
79
|
+
{showAlignLeft && (
|
|
80
|
+
<IconButton
|
|
81
|
+
icon={<AlignLeft />}
|
|
82
|
+
aria-label="Align left"
|
|
83
|
+
onClick={onAlignLeftClick}
|
|
84
|
+
/>
|
|
85
|
+
)}
|
|
86
|
+
{showDownload && (
|
|
87
|
+
<IconButton
|
|
88
|
+
icon={<Download />}
|
|
89
|
+
aria-label="Download"
|
|
90
|
+
onClick={onDownloadClick}
|
|
91
|
+
/>
|
|
92
|
+
)}
|
|
93
|
+
</div>
|
|
94
|
+
</div>
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export { Toolbar };
|
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
import type { ItemInstance } from "@headless-tree/core";
|
|
2
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
3
|
+
import { Ellipsis, Pin, Plus } from "lucide-react";
|
|
4
|
+
import React from "react";
|
|
5
|
+
import { action } from "storybook/actions";
|
|
6
|
+
import { Button } from "#shadcn/components/ui/button.js";
|
|
7
|
+
import { PinIcon } from "../icons";
|
|
8
|
+
import type { TreeViewItem } from "./tree-view";
|
|
9
|
+
import { TreeView } from "./tree-view";
|
|
10
|
+
|
|
11
|
+
const meta: Meta<typeof TreeView> = {
|
|
12
|
+
title: "Component/Tree view",
|
|
13
|
+
component: TreeView,
|
|
14
|
+
parameters: {
|
|
15
|
+
layout: "fullscreen",
|
|
16
|
+
},
|
|
17
|
+
tags: ["autodocs"],
|
|
18
|
+
};
|
|
19
|
+
type ItemMeta = {
|
|
20
|
+
pinned?: boolean;
|
|
21
|
+
method?: "GET" | "POST" | "PUT" | "DELETE" | "PATCH";
|
|
22
|
+
path?: string;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export default meta;
|
|
26
|
+
type Story = StoryObj<typeof TreeView<ItemMeta>>;
|
|
27
|
+
|
|
28
|
+
const items: Record<string, TreeViewItem<ItemMeta>> = {
|
|
29
|
+
root: {
|
|
30
|
+
name: "Root",
|
|
31
|
+
children: ["collection1", "collection2", "collection3"],
|
|
32
|
+
},
|
|
33
|
+
collection1: {
|
|
34
|
+
name: "Collection 1",
|
|
35
|
+
children: ["request1", "request2", "request3"],
|
|
36
|
+
meta: {
|
|
37
|
+
pinned: true,
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
collection2: {
|
|
41
|
+
name: "Collection 2",
|
|
42
|
+
children: ["request4", "request5", "request6"],
|
|
43
|
+
},
|
|
44
|
+
collection3: {
|
|
45
|
+
name: "New Collection",
|
|
46
|
+
children: [
|
|
47
|
+
"request7",
|
|
48
|
+
"request8",
|
|
49
|
+
"request9",
|
|
50
|
+
"request10",
|
|
51
|
+
"request11",
|
|
52
|
+
"collection4",
|
|
53
|
+
],
|
|
54
|
+
},
|
|
55
|
+
collection4: {
|
|
56
|
+
name: "New Collection",
|
|
57
|
+
children: ["request12", "request13", "request14"],
|
|
58
|
+
},
|
|
59
|
+
request1: {
|
|
60
|
+
meta: {
|
|
61
|
+
method: "GET",
|
|
62
|
+
path: "/request1",
|
|
63
|
+
},
|
|
64
|
+
name: "Request 1",
|
|
65
|
+
},
|
|
66
|
+
request2: {
|
|
67
|
+
meta: {
|
|
68
|
+
method: "POST",
|
|
69
|
+
path: "/request2",
|
|
70
|
+
},
|
|
71
|
+
name: "Request 2",
|
|
72
|
+
},
|
|
73
|
+
request3: {
|
|
74
|
+
meta: {
|
|
75
|
+
method: "PUT",
|
|
76
|
+
path: "/request3",
|
|
77
|
+
},
|
|
78
|
+
name: "Request 3",
|
|
79
|
+
},
|
|
80
|
+
request4: {
|
|
81
|
+
meta: {
|
|
82
|
+
method: "DELETE",
|
|
83
|
+
path: "/request4",
|
|
84
|
+
},
|
|
85
|
+
name: "Request 4",
|
|
86
|
+
},
|
|
87
|
+
request5: {
|
|
88
|
+
meta: {
|
|
89
|
+
method: "PATCH",
|
|
90
|
+
path: "/request5",
|
|
91
|
+
},
|
|
92
|
+
name: "Request 5",
|
|
93
|
+
},
|
|
94
|
+
request6: {
|
|
95
|
+
meta: {
|
|
96
|
+
method: "GET",
|
|
97
|
+
path: "/request6",
|
|
98
|
+
},
|
|
99
|
+
name: "Request 6",
|
|
100
|
+
},
|
|
101
|
+
request7: {
|
|
102
|
+
meta: {
|
|
103
|
+
method: "PATCH",
|
|
104
|
+
path: "/fhir/Patient/123",
|
|
105
|
+
},
|
|
106
|
+
name: "Request 7",
|
|
107
|
+
},
|
|
108
|
+
request8: {
|
|
109
|
+
meta: {
|
|
110
|
+
method: "DELETE",
|
|
111
|
+
path: "/fhir/Patient/123",
|
|
112
|
+
},
|
|
113
|
+
name: "Request 8",
|
|
114
|
+
},
|
|
115
|
+
request9: {
|
|
116
|
+
meta: {
|
|
117
|
+
method: "PUT",
|
|
118
|
+
path: "/fhir/Patient/123",
|
|
119
|
+
},
|
|
120
|
+
name: "Request 9",
|
|
121
|
+
},
|
|
122
|
+
request10: {
|
|
123
|
+
meta: {
|
|
124
|
+
method: "POST",
|
|
125
|
+
path: "/fhir/Patient/123",
|
|
126
|
+
},
|
|
127
|
+
name: "Request 10",
|
|
128
|
+
},
|
|
129
|
+
request11: {
|
|
130
|
+
meta: {
|
|
131
|
+
method: "GET",
|
|
132
|
+
path: "/fhir/Patient/123",
|
|
133
|
+
},
|
|
134
|
+
name: "Request 11",
|
|
135
|
+
},
|
|
136
|
+
request12: {
|
|
137
|
+
meta: {
|
|
138
|
+
method: "PUT",
|
|
139
|
+
path: "/fhir/Patient/123",
|
|
140
|
+
},
|
|
141
|
+
name: "Request 12",
|
|
142
|
+
},
|
|
143
|
+
request13: {
|
|
144
|
+
meta: {
|
|
145
|
+
method: "PUT",
|
|
146
|
+
path: "/fhir/Patient/123",
|
|
147
|
+
},
|
|
148
|
+
name: "Request 13",
|
|
149
|
+
},
|
|
150
|
+
request14: {
|
|
151
|
+
meta: {
|
|
152
|
+
method: "PUT",
|
|
153
|
+
path: "/fhir/Patient/123",
|
|
154
|
+
},
|
|
155
|
+
name: "Request 14",
|
|
156
|
+
},
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
export const Default: Story = {
|
|
160
|
+
args: {
|
|
161
|
+
items: items,
|
|
162
|
+
rootItemId: "root",
|
|
163
|
+
focusedItem: "request9",
|
|
164
|
+
defaultExpandedItems: ["collection3"],
|
|
165
|
+
onFocusedItemChange: (a) => action("onSelectItem")(a),
|
|
166
|
+
},
|
|
167
|
+
render: (args) => <TreeView {...args} />,
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
function customItemView(item: ItemInstance<TreeViewItem<ItemMeta>>) {
|
|
171
|
+
const isRootLevel = item.getItemMeta().level === 0;
|
|
172
|
+
const hasChildren = item.getItemData()?.children !== undefined;
|
|
173
|
+
const requestMethhod = item.getItemData()?.meta?.method;
|
|
174
|
+
const requestPath = item.getItemData()?.meta?.path;
|
|
175
|
+
const itemName = item.getItemData()?.name;
|
|
176
|
+
|
|
177
|
+
const requestMethodView = () => {
|
|
178
|
+
switch (requestMethhod) {
|
|
179
|
+
case "GET":
|
|
180
|
+
return (
|
|
181
|
+
<div className="opacity-50 group-hover/tree-item-label:opacity-100 in-data-[selected=true]:opacity-100 font-medium min-w-13 w-13 text-utility-green text-left">
|
|
182
|
+
GET
|
|
183
|
+
</div>
|
|
184
|
+
);
|
|
185
|
+
case "POST":
|
|
186
|
+
return (
|
|
187
|
+
<div className="opacity-50 group-hover/tree-item-label:opacity-100 in-data-[selected=true]:opacity-100 font-medium min-w-13 w-13 text-utility-yellow text-left">
|
|
188
|
+
POST
|
|
189
|
+
</div>
|
|
190
|
+
);
|
|
191
|
+
case "PUT":
|
|
192
|
+
return (
|
|
193
|
+
<div className="opacity-50 group-hover/tree-item-label:opacity-100 in-data-[selected=true]:opacity-100 font-medium min-w-13 w-13 text-utility-blue text-left">
|
|
194
|
+
PUT
|
|
195
|
+
</div>
|
|
196
|
+
);
|
|
197
|
+
case "PATCH":
|
|
198
|
+
return (
|
|
199
|
+
<div className="opacity-50 group-hover/tree-item-label:opacity-100 in-data-[selected=true]:opacity-100 font-medium min-w-13 w-13 text-utility-violet text-left">
|
|
200
|
+
PATCH
|
|
201
|
+
</div>
|
|
202
|
+
);
|
|
203
|
+
case "DELETE":
|
|
204
|
+
return (
|
|
205
|
+
<div className="opacity-50 group-hover/tree-item-label:opacity-100 in-data-[selected=true]:opacity-100 font-medium min-w-13 w-13 text-utility-red text-left">
|
|
206
|
+
DELETE
|
|
207
|
+
</div>
|
|
208
|
+
);
|
|
209
|
+
default:
|
|
210
|
+
return (
|
|
211
|
+
<div className="opacity-50 group-hover/tree-item-label:opacity-100 in-data-[selected=true]:opacity-100 font-medium min-w-13 w-13 text-utility-gray text-left">
|
|
212
|
+
Unknown
|
|
213
|
+
</div>
|
|
214
|
+
);
|
|
215
|
+
}
|
|
216
|
+
};
|
|
217
|
+
|
|
218
|
+
return (
|
|
219
|
+
<div className="w-full flex justify-between gap-2">
|
|
220
|
+
<div className="flex items-center gap-2 truncate">
|
|
221
|
+
{hasChildren ? (
|
|
222
|
+
itemName
|
|
223
|
+
) : (
|
|
224
|
+
<React.Fragment>
|
|
225
|
+
{requestMethodView()}
|
|
226
|
+
{requestPath}
|
|
227
|
+
</React.Fragment>
|
|
228
|
+
)}
|
|
229
|
+
</div>
|
|
230
|
+
<div className="gap-2 hidden group-hover/tree-item-label:flex items-center">
|
|
231
|
+
{isRootLevel && (
|
|
232
|
+
<Button variant="link" size="small" className="p-0 h-4" asChild>
|
|
233
|
+
<span>
|
|
234
|
+
{item.getItemData()?.meta?.pinned ? <PinIcon /> : <Pin />}
|
|
235
|
+
</span>
|
|
236
|
+
</Button>
|
|
237
|
+
)}
|
|
238
|
+
{hasChildren && (
|
|
239
|
+
<Button variant="link" size="small" className="p-0 h-4" asChild>
|
|
240
|
+
<span>
|
|
241
|
+
<Plus />
|
|
242
|
+
</span>
|
|
243
|
+
</Button>
|
|
244
|
+
)}
|
|
245
|
+
<Button variant="link" size="small" className="p-0 h-4" asChild>
|
|
246
|
+
<span>
|
|
247
|
+
<Ellipsis />
|
|
248
|
+
</span>
|
|
249
|
+
</Button>
|
|
250
|
+
</div>
|
|
251
|
+
</div>
|
|
252
|
+
);
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
export const CustomItemView: Story = {
|
|
256
|
+
args: {
|
|
257
|
+
items: items,
|
|
258
|
+
rootItemId: "root",
|
|
259
|
+
focusedItem: "request11",
|
|
260
|
+
defaultExpandedItems: ["collection3", "collection4"],
|
|
261
|
+
onFocusedItemChange: (a) => action("onSelectItem")(a ? items[a]?.name : a),
|
|
262
|
+
customItemView: customItemView,
|
|
263
|
+
},
|
|
264
|
+
render: (args) => <TreeView {...args} />,
|
|
265
|
+
};
|