@health-samurai/react-components 0.0.0-alpha.2 → 0.0.0-alpha.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +102 -1
- package/dist/bundle.css +2340 -744
- 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 +1849 -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 +1472 -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 +895 -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 +31 -14
- 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 +2321 -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 +1626 -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 +1105 -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 +253 -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 +31 -14
- 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,66 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { flexRender, getCoreRowModel, useReactTable } from "@tanstack/react-table";
|
|
4
|
+
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "../shadcn/components/ui/table.js";
|
|
5
|
+
export function DataTable({ columns, data, stickyHeader = false }) {
|
|
6
|
+
"use no memo";
|
|
7
|
+
const table = useReactTable({
|
|
8
|
+
data,
|
|
9
|
+
columns,
|
|
10
|
+
getCoreRowModel: getCoreRowModel(),
|
|
11
|
+
columnResizeMode: "onChange",
|
|
12
|
+
enableColumnResizing: true
|
|
13
|
+
});
|
|
14
|
+
return /*#__PURE__*/ _jsx("div", {
|
|
15
|
+
className: "overflow-hidden w-full h-full",
|
|
16
|
+
children: /*#__PURE__*/ _jsxs(Table, {
|
|
17
|
+
className: "relative border-spacing-0 border-separate w-full",
|
|
18
|
+
children: [
|
|
19
|
+
/*#__PURE__*/ _jsx(TableHeader, {
|
|
20
|
+
children: table.getHeaderGroups().map((headerGroup)=>/*#__PURE__*/ _jsx(TableRow, {
|
|
21
|
+
children: headerGroup.headers.map((header)=>{
|
|
22
|
+
return /*#__PURE__*/ _jsxs(TableHead, {
|
|
23
|
+
className: `relative group border ${stickyHeader ? "sticky top-0 z-10 bg-bg-secondary text-elements-assistive" : ""}`,
|
|
24
|
+
style: {
|
|
25
|
+
width: header.column.getIndex() === headerGroup.headers.length - 1 ? "100%" : header.getSize()
|
|
26
|
+
},
|
|
27
|
+
children: [
|
|
28
|
+
header.isPlaceholder ? null : flexRender(header.column.columnDef.header, header.getContext()),
|
|
29
|
+
header.column.getCanResize() && /*#__PURE__*/ _jsx("div", {
|
|
30
|
+
onMouseDown: header.getResizeHandler(),
|
|
31
|
+
onTouchStart: header.getResizeHandler(),
|
|
32
|
+
className: `hidden group-hover:block absolute top-0 right-0 h-full w-1 bg-border-secondary cursor-col-resize hover:bg-border-secondary`,
|
|
33
|
+
style: {
|
|
34
|
+
userSelect: "none",
|
|
35
|
+
touchAction: "none"
|
|
36
|
+
}
|
|
37
|
+
})
|
|
38
|
+
]
|
|
39
|
+
}, header.id);
|
|
40
|
+
})
|
|
41
|
+
}, headerGroup.id))
|
|
42
|
+
}),
|
|
43
|
+
/*#__PURE__*/ _jsx(TableBody, {
|
|
44
|
+
children: table.getRowModel().rows?.length ? table.getRowModel().rows.map((row)=>/*#__PURE__*/ _jsx(TableRow, {
|
|
45
|
+
"data-state": row.getIsSelected() && "selected",
|
|
46
|
+
children: row.getVisibleCells().map((cell)=>/*#__PURE__*/ _jsx(TableCell, {
|
|
47
|
+
className: "border",
|
|
48
|
+
style: {
|
|
49
|
+
width: cell.column.getIndex() === row.getVisibleCells().length - 1 ? "100%" : cell.column.getSize()
|
|
50
|
+
},
|
|
51
|
+
children: flexRender(cell.column.columnDef.cell, cell.getContext())
|
|
52
|
+
}, cell.id))
|
|
53
|
+
}, row.id)) : /*#__PURE__*/ _jsx(TableRow, {
|
|
54
|
+
children: /*#__PURE__*/ _jsx(TableCell, {
|
|
55
|
+
colSpan: columns.length,
|
|
56
|
+
className: "h-24 text-center",
|
|
57
|
+
children: "No results."
|
|
58
|
+
})
|
|
59
|
+
})
|
|
60
|
+
})
|
|
61
|
+
]
|
|
62
|
+
})
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
//# sourceMappingURL=data-table.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/data-table.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n\ttype AccessorKeyColumnDef,\n\ttype ColumnDef,\n\tflexRender,\n\tgetCoreRowModel,\n\tuseReactTable,\n} from \"@tanstack/react-table\";\n\nimport {\n\tTable,\n\tTableBody,\n\tTableCell,\n\tTableHead,\n\tTableHeader,\n\tTableRow,\n} from \"../shadcn/components/ui/table\";\n\nexport interface DataTableProps<TData> {\n\t// It is not possible to allow arbitrary and nested data structures\n\t// and have more type safety. Note that the useReactTable type definition\n\t// is exactly the same.\n\t// There is an open issue: https://github.com/TanStack/table/issues/4382\n\t// biome-ignore lint/suspicious/noExplicitAny: cannot be stricter while being a useful library\n\tcolumns: ColumnDef<TData, any>[];\n\tdata: TData[];\n\tstickyHeader?: boolean;\n}\n\nexport function DataTable<TData>({\n\tcolumns,\n\tdata,\n\tstickyHeader = false,\n}: DataTableProps<TData>) {\n\t\"use no memo\";\n\tconst table = useReactTable({\n\t\tdata,\n\t\tcolumns,\n\t\tgetCoreRowModel: getCoreRowModel(),\n\t\tcolumnResizeMode: \"onChange\",\n\t\tenableColumnResizing: true,\n\t});\n\n\treturn (\n\t\t<div className=\"overflow-hidden w-full h-full\">\n\t\t\t<Table className=\"relative border-spacing-0 border-separate w-full\">\n\t\t\t\t<TableHeader>\n\t\t\t\t\t{table.getHeaderGroups().map((headerGroup) => (\n\t\t\t\t\t\t<TableRow key={headerGroup.id}>\n\t\t\t\t\t\t\t{headerGroup.headers.map((header) => {\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t<TableHead\n\t\t\t\t\t\t\t\t\t\tkey={header.id}\n\t\t\t\t\t\t\t\t\t\tclassName={`relative group border ${stickyHeader ? \"sticky top-0 z-10 bg-bg-secondary text-elements-assistive\" : \"\"}`}\n\t\t\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\t\t\twidth:\n\t\t\t\t\t\t\t\t\t\t\t\theader.column.getIndex() ===\n\t\t\t\t\t\t\t\t\t\t\t\theaderGroup.headers.length - 1\n\t\t\t\t\t\t\t\t\t\t\t\t\t? \"100%\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t: header.getSize(),\n\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{header.isPlaceholder\n\t\t\t\t\t\t\t\t\t\t\t? null\n\t\t\t\t\t\t\t\t\t\t\t: flexRender(\n\t\t\t\t\t\t\t\t\t\t\t\t\theader.column.columnDef.header,\n\t\t\t\t\t\t\t\t\t\t\t\t\theader.getContext(),\n\t\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t{header.column.getCanResize() && (\n\t\t\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\t\t\t{...{\n\t\t\t\t\t\t\t\t\t\t\t\t\tonMouseDown: header.getResizeHandler(),\n\t\t\t\t\t\t\t\t\t\t\t\t\tonTouchStart: header.getResizeHandler(),\n\t\t\t\t\t\t\t\t\t\t\t\t\tclassName: `hidden group-hover:block absolute top-0 right-0 h-full w-1 bg-border-secondary cursor-col-resize hover:bg-border-secondary`,\n\t\t\t\t\t\t\t\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tuserSelect: \"none\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttouchAction: \"none\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t</TableHead>\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t</TableRow>\n\t\t\t\t\t))}\n\t\t\t\t</TableHeader>\n\t\t\t\t<TableBody>\n\t\t\t\t\t{table.getRowModel().rows?.length ? (\n\t\t\t\t\t\ttable.getRowModel().rows.map((row) => (\n\t\t\t\t\t\t\t<TableRow\n\t\t\t\t\t\t\t\tkey={row.id}\n\t\t\t\t\t\t\t\tdata-state={row.getIsSelected() && \"selected\"}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{row.getVisibleCells().map((cell) => (\n\t\t\t\t\t\t\t\t\t<TableCell\n\t\t\t\t\t\t\t\t\t\tclassName=\"border\"\n\t\t\t\t\t\t\t\t\t\tkey={cell.id}\n\t\t\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\t\t\twidth:\n\t\t\t\t\t\t\t\t\t\t\t\tcell.column.getIndex() ===\n\t\t\t\t\t\t\t\t\t\t\t\trow.getVisibleCells().length - 1\n\t\t\t\t\t\t\t\t\t\t\t\t\t? \"100%\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t: cell.column.getSize(),\n\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{flexRender(cell.column.columnDef.cell, cell.getContext())}\n\t\t\t\t\t\t\t\t\t</TableCell>\n\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t</TableRow>\n\t\t\t\t\t\t))\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<TableRow>\n\t\t\t\t\t\t\t<TableCell colSpan={columns.length} className=\"h-24 text-center\">\n\t\t\t\t\t\t\t\tNo results.\n\t\t\t\t\t\t\t</TableCell>\n\t\t\t\t\t\t</TableRow>\n\t\t\t\t\t)}\n\t\t\t\t</TableBody>\n\t\t\t</Table>\n\t\t</div>\n\t);\n}\n\nexport type { ColumnDef, AccessorKeyColumnDef };\n"],"names":["flexRender","getCoreRowModel","useReactTable","Table","TableBody","TableCell","TableHead","TableHeader","TableRow","DataTable","columns","data","stickyHeader","table","columnResizeMode","enableColumnResizing","div","className","getHeaderGroups","map","headerGroup","headers","header","style","width","column","getIndex","length","getSize","isPlaceholder","columnDef","getContext","getCanResize","onMouseDown","getResizeHandler","onTouchStart","userSelect","touchAction","id","getRowModel","rows","row","data-state","getIsSelected","getVisibleCells","cell","colSpan"],"mappings":"AAAA;;AAEA,SAGCA,UAAU,EACVC,eAAe,EACfC,aAAa,QACP,wBAAwB;AAE/B,SACCC,KAAK,EACLC,SAAS,EACTC,SAAS,EACTC,SAAS,EACTC,WAAW,EACXC,QAAQ,QACF,mCAAgC;AAavC,OAAO,SAASC,UAAiB,EAChCC,OAAO,EACPC,IAAI,EACJC,eAAe,KAAK,EACG;IACvB;IACA,MAAMC,QAAQX,cAAc;QAC3BS;QACAD;QACAT,iBAAiBA;QACjBa,kBAAkB;QAClBC,sBAAsB;IACvB;IAEA,qBACC,KAACC;QAAIC,WAAU;kBACd,cAAA,MAACd;YAAMc,WAAU;;8BAChB,KAACV;8BACCM,MAAMK,eAAe,GAAGC,GAAG,CAAC,CAACC,4BAC7B,KAACZ;sCACCY,YAAYC,OAAO,CAACF,GAAG,CAAC,CAACG;gCACzB,qBACC,MAAChB;oCAEAW,WAAW,CAAC,sBAAsB,EAAEL,eAAe,8DAA8D,IAAI;oCACrHW,OAAO;wCACNC,OACCF,OAAOG,MAAM,CAACC,QAAQ,OACtBN,YAAYC,OAAO,CAACM,MAAM,GAAG,IAC1B,SACAL,OAAOM,OAAO;oCACnB;;wCAECN,OAAOO,aAAa,GAClB,OACA7B,WACAsB,OAAOG,MAAM,CAACK,SAAS,CAACR,MAAM,EAC9BA,OAAOS,UAAU;wCAEnBT,OAAOG,MAAM,CAACO,YAAY,oBAC1B,KAAChB;4CAECiB,aAAaX,OAAOY,gBAAgB;4CACpCC,cAAcb,OAAOY,gBAAgB;4CACrCjB,WAAW,CAAC,0HAA0H,CAAC;4CACvIM,OAAO;gDACNa,YAAY;gDACZC,aAAa;4CACd;;;mCAzBEf,OAAOgB,EAAE;4BA+BjB;2BAnCclB,YAAYkB,EAAE;;8BAuC/B,KAAClC;8BACCS,MAAM0B,WAAW,GAAGC,IAAI,EAAEb,SAC1Bd,MAAM0B,WAAW,GAAGC,IAAI,CAACrB,GAAG,CAAC,CAACsB,oBAC7B,KAACjC;4BAEAkC,cAAYD,IAAIE,aAAa,MAAM;sCAElCF,IAAIG,eAAe,GAAGzB,GAAG,CAAC,CAAC0B,qBAC3B,KAACxC;oCACAY,WAAU;oCAEVM,OAAO;wCACNC,OACCqB,KAAKpB,MAAM,CAACC,QAAQ,OACpBe,IAAIG,eAAe,GAAGjB,MAAM,GAAG,IAC5B,SACAkB,KAAKpB,MAAM,CAACG,OAAO;oCACxB;8CAEC5B,WAAW6C,KAAKpB,MAAM,CAACK,SAAS,CAACe,IAAI,EAAEA,KAAKd,UAAU;mCATlDc,KAAKP,EAAE;2BANTG,IAAIH,EAAE,mBAqBb,KAAC9B;kCACA,cAAA,KAACH;4BAAUyC,SAASpC,QAAQiB,MAAM;4BAAEV,WAAU;sCAAmB;;;;;;;AASxE"}
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { DataTable } from "./data-table.js";
|
|
3
|
+
const meta = {
|
|
4
|
+
title: "Component/Data table",
|
|
5
|
+
component: DataTable,
|
|
6
|
+
tags: [
|
|
7
|
+
"autodocs"
|
|
8
|
+
]
|
|
9
|
+
};
|
|
10
|
+
export default meta;
|
|
11
|
+
function DataTableWrapper({ columns, data }) {
|
|
12
|
+
return /*#__PURE__*/ _jsx(DataTable, {
|
|
13
|
+
columns: columns,
|
|
14
|
+
data: data
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
export const Default = {
|
|
18
|
+
args: {
|
|
19
|
+
columns: [
|
|
20
|
+
{
|
|
21
|
+
header: "Name",
|
|
22
|
+
accessorKey: "name"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
header: "Age",
|
|
26
|
+
accessorKey: "age"
|
|
27
|
+
}
|
|
28
|
+
],
|
|
29
|
+
data: [
|
|
30
|
+
{
|
|
31
|
+
name: "John Doe",
|
|
32
|
+
age: 30
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: "Jane Smith",
|
|
36
|
+
age: 25
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: "Bob Johnson",
|
|
40
|
+
age: 42
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: "Alice Williams",
|
|
44
|
+
age: 35
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
name: "Charlie Brown",
|
|
48
|
+
age: 28
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
name: "Diana Prince",
|
|
52
|
+
age: 31
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
name: "Edward Norton",
|
|
56
|
+
age: 45
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: "Fiona Green",
|
|
60
|
+
age: 27
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
name: "George Miller",
|
|
64
|
+
age: 38
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
name: "Hannah Davis",
|
|
68
|
+
age: 33
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
name: "Ian Moore",
|
|
72
|
+
age: 29
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
name: "Julia Taylor",
|
|
76
|
+
age: 41
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
name: "Kevin Anderson",
|
|
80
|
+
age: 36
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
name: "Laura Thomas",
|
|
84
|
+
age: 32
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
name: "Michael Jackson",
|
|
88
|
+
age: 44
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
name: "Nancy Wilson",
|
|
92
|
+
age: 26
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
name: "Oscar Martinez",
|
|
96
|
+
age: 39
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
name: "Patricia Lee",
|
|
100
|
+
age: 34
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
name: "Quinn Harris",
|
|
104
|
+
age: 37
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
name: "Rachel Clark",
|
|
108
|
+
age: 40
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
name: "Samuel Wright",
|
|
112
|
+
age: 43
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
name: "Tina Turner",
|
|
116
|
+
age: 48
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
name: "Ulysses Grant",
|
|
120
|
+
age: 52
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
name: "Victoria Baker",
|
|
124
|
+
age: 29
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
name: "William Scott",
|
|
128
|
+
age: 35
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
name: "Xavier Adams",
|
|
132
|
+
age: 31
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
name: "Yolanda King",
|
|
136
|
+
age: 38
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
name: "Zachary Nelson",
|
|
140
|
+
age: 27
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
name: "Amy Carter",
|
|
144
|
+
age: 33
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
name: "Benjamin Hall",
|
|
148
|
+
age: 46
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
name: "Catherine Allen",
|
|
152
|
+
age: 24
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
name: "David Young",
|
|
156
|
+
age: 41
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
name: "Emily Walker",
|
|
160
|
+
age: 36
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
name: "Frank Robinson",
|
|
164
|
+
age: 39
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
name: "Grace White",
|
|
168
|
+
age: 28
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
name: "Henry Lewis",
|
|
172
|
+
age: 47
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
name: "Isabella Hill",
|
|
176
|
+
age: 32
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
name: "Jack Martin",
|
|
180
|
+
age: 34
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
name: "Katherine Garcia",
|
|
184
|
+
age: 30
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
name: "Louis Rodriguez",
|
|
188
|
+
age: 45
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
name: "Margaret Martinez",
|
|
192
|
+
age: 37
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
name: "Nathan Hernandez",
|
|
196
|
+
age: 26
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
name: "Olivia Lopez",
|
|
200
|
+
age: 29
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
name: "Peter Gonzalez",
|
|
204
|
+
age: 43
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
name: "Quincy Wilson",
|
|
208
|
+
age: 38
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
name: "Rebecca Anderson",
|
|
212
|
+
age: 31
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
name: "Steven Thomas",
|
|
216
|
+
age: 44
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
name: "Teresa Taylor",
|
|
220
|
+
age: 35
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
name: "Ursula Moore",
|
|
224
|
+
age: 40
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
name: "Victor Jackson",
|
|
228
|
+
age: 42
|
|
229
|
+
}
|
|
230
|
+
]
|
|
231
|
+
},
|
|
232
|
+
parameters: {
|
|
233
|
+
layout: "fullscreen"
|
|
234
|
+
},
|
|
235
|
+
render: (args)=>/*#__PURE__*/ _jsx(DataTableWrapper, {
|
|
236
|
+
...args
|
|
237
|
+
})
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
//# sourceMappingURL=data-table.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/data-table.stories.tsx"],"sourcesContent":["import type { Meta, StoryObj } from \"@storybook/react-vite\";\nimport { DataTable, type DataTableProps } from \"./data-table\";\n\ntype Data = {\n\tname: string;\n\tage: number;\n};\n\nconst meta: Meta<typeof DataTable<Data>> = {\n\ttitle: \"Component/Data table\",\n\tcomponent: DataTable<Data>,\n\ttags: [\"autodocs\"],\n};\n\nexport default meta;\ntype Story = StoryObj<typeof meta>;\n\nfunction DataTableWrapper({ columns, data }: DataTableProps<Data>) {\n\treturn <DataTable columns={columns} data={data} />;\n}\n\nexport const Default: Story = {\n\targs: {\n\t\tcolumns: [\n\t\t\t{\n\t\t\t\theader: \"Name\",\n\t\t\t\taccessorKey: \"name\",\n\t\t\t},\n\t\t\t{\n\t\t\t\theader: \"Age\",\n\t\t\t\taccessorKey: \"age\",\n\t\t\t},\n\t\t],\n\t\tdata: [\n\t\t\t{ name: \"John Doe\", age: 30 },\n\t\t\t{ name: \"Jane Smith\", age: 25 },\n\t\t\t{ name: \"Bob Johnson\", age: 42 },\n\t\t\t{ name: \"Alice Williams\", age: 35 },\n\t\t\t{ name: \"Charlie Brown\", age: 28 },\n\t\t\t{ name: \"Diana Prince\", age: 31 },\n\t\t\t{ name: \"Edward Norton\", age: 45 },\n\t\t\t{ name: \"Fiona Green\", age: 27 },\n\t\t\t{ name: \"George Miller\", age: 38 },\n\t\t\t{ name: \"Hannah Davis\", age: 33 },\n\t\t\t{ name: \"Ian Moore\", age: 29 },\n\t\t\t{ name: \"Julia Taylor\", age: 41 },\n\t\t\t{ name: \"Kevin Anderson\", age: 36 },\n\t\t\t{ name: \"Laura Thomas\", age: 32 },\n\t\t\t{ name: \"Michael Jackson\", age: 44 },\n\t\t\t{ name: \"Nancy Wilson\", age: 26 },\n\t\t\t{ name: \"Oscar Martinez\", age: 39 },\n\t\t\t{ name: \"Patricia Lee\", age: 34 },\n\t\t\t{ name: \"Quinn Harris\", age: 37 },\n\t\t\t{ name: \"Rachel Clark\", age: 40 },\n\t\t\t{ name: \"Samuel Wright\", age: 43 },\n\t\t\t{ name: \"Tina Turner\", age: 48 },\n\t\t\t{ name: \"Ulysses Grant\", age: 52 },\n\t\t\t{ name: \"Victoria Baker\", age: 29 },\n\t\t\t{ name: \"William Scott\", age: 35 },\n\t\t\t{ name: \"Xavier Adams\", age: 31 },\n\t\t\t{ name: \"Yolanda King\", age: 38 },\n\t\t\t{ name: \"Zachary Nelson\", age: 27 },\n\t\t\t{ name: \"Amy Carter\", age: 33 },\n\t\t\t{ name: \"Benjamin Hall\", age: 46 },\n\t\t\t{ name: \"Catherine Allen\", age: 24 },\n\t\t\t{ name: \"David Young\", age: 41 },\n\t\t\t{ name: \"Emily Walker\", age: 36 },\n\t\t\t{ name: \"Frank Robinson\", age: 39 },\n\t\t\t{ name: \"Grace White\", age: 28 },\n\t\t\t{ name: \"Henry Lewis\", age: 47 },\n\t\t\t{ name: \"Isabella Hill\", age: 32 },\n\t\t\t{ name: \"Jack Martin\", age: 34 },\n\t\t\t{ name: \"Katherine Garcia\", age: 30 },\n\t\t\t{ name: \"Louis Rodriguez\", age: 45 },\n\t\t\t{ name: \"Margaret Martinez\", age: 37 },\n\t\t\t{ name: \"Nathan Hernandez\", age: 26 },\n\t\t\t{ name: \"Olivia Lopez\", age: 29 },\n\t\t\t{ name: \"Peter Gonzalez\", age: 43 },\n\t\t\t{ name: \"Quincy Wilson\", age: 38 },\n\t\t\t{ name: \"Rebecca Anderson\", age: 31 },\n\t\t\t{ name: \"Steven Thomas\", age: 44 },\n\t\t\t{ name: \"Teresa Taylor\", age: 35 },\n\t\t\t{ name: \"Ursula Moore\", age: 40 },\n\t\t\t{ name: \"Victor Jackson\", age: 42 },\n\t\t],\n\t},\n\tparameters: {\n\t\tlayout: \"fullscreen\",\n\t},\n\trender: (args) => <DataTableWrapper {...args} />,\n};\n"],"names":["DataTable","meta","title","component","tags","DataTableWrapper","columns","data","Default","args","header","accessorKey","name","age","parameters","layout","render"],"mappings":";AACA,SAASA,SAAS,QAA6B,kBAAe;AAO9D,MAAMC,OAAqC;IAC1CC,OAAO;IACPC,WAAWH;IACXI,MAAM;QAAC;KAAW;AACnB;AAEA,eAAeH,KAAK;AAGpB,SAASI,iBAAiB,EAAEC,OAAO,EAAEC,IAAI,EAAwB;IAChE,qBAAO,KAACP;QAAUM,SAASA;QAASC,MAAMA;;AAC3C;AAEA,OAAO,MAAMC,UAAiB;IAC7BC,MAAM;QACLH,SAAS;YACR;gBACCI,QAAQ;gBACRC,aAAa;YACd;YACA;gBACCD,QAAQ;gBACRC,aAAa;YACd;SACA;QACDJ,MAAM;YACL;gBAAEK,MAAM;gBAAYC,KAAK;YAAG;YAC5B;gBAAED,MAAM;gBAAcC,KAAK;YAAG;YAC9B;gBAAED,MAAM;gBAAeC,KAAK;YAAG;YAC/B;gBAAED,MAAM;gBAAkBC,KAAK;YAAG;YAClC;gBAAED,MAAM;gBAAiBC,KAAK;YAAG;YACjC;gBAAED,MAAM;gBAAgBC,KAAK;YAAG;YAChC;gBAAED,MAAM;gBAAiBC,KAAK;YAAG;YACjC;gBAAED,MAAM;gBAAeC,KAAK;YAAG;YAC/B;gBAAED,MAAM;gBAAiBC,KAAK;YAAG;YACjC;gBAAED,MAAM;gBAAgBC,KAAK;YAAG;YAChC;gBAAED,MAAM;gBAAaC,KAAK;YAAG;YAC7B;gBAAED,MAAM;gBAAgBC,KAAK;YAAG;YAChC;gBAAED,MAAM;gBAAkBC,KAAK;YAAG;YAClC;gBAAED,MAAM;gBAAgBC,KAAK;YAAG;YAChC;gBAAED,MAAM;gBAAmBC,KAAK;YAAG;YACnC;gBAAED,MAAM;gBAAgBC,KAAK;YAAG;YAChC;gBAAED,MAAM;gBAAkBC,KAAK;YAAG;YAClC;gBAAED,MAAM;gBAAgBC,KAAK;YAAG;YAChC;gBAAED,MAAM;gBAAgBC,KAAK;YAAG;YAChC;gBAAED,MAAM;gBAAgBC,KAAK;YAAG;YAChC;gBAAED,MAAM;gBAAiBC,KAAK;YAAG;YACjC;gBAAED,MAAM;gBAAeC,KAAK;YAAG;YAC/B;gBAAED,MAAM;gBAAiBC,KAAK;YAAG;YACjC;gBAAED,MAAM;gBAAkBC,KAAK;YAAG;YAClC;gBAAED,MAAM;gBAAiBC,KAAK;YAAG;YACjC;gBAAED,MAAM;gBAAgBC,KAAK;YAAG;YAChC;gBAAED,MAAM;gBAAgBC,KAAK;YAAG;YAChC;gBAAED,MAAM;gBAAkBC,KAAK;YAAG;YAClC;gBAAED,MAAM;gBAAcC,KAAK;YAAG;YAC9B;gBAAED,MAAM;gBAAiBC,KAAK;YAAG;YACjC;gBAAED,MAAM;gBAAmBC,KAAK;YAAG;YACnC;gBAAED,MAAM;gBAAeC,KAAK;YAAG;YAC/B;gBAAED,MAAM;gBAAgBC,KAAK;YAAG;YAChC;gBAAED,MAAM;gBAAkBC,KAAK;YAAG;YAClC;gBAAED,MAAM;gBAAeC,KAAK;YAAG;YAC/B;gBAAED,MAAM;gBAAeC,KAAK;YAAG;YAC/B;gBAAED,MAAM;gBAAiBC,KAAK;YAAG;YACjC;gBAAED,MAAM;gBAAeC,KAAK;YAAG;YAC/B;gBAAED,MAAM;gBAAoBC,KAAK;YAAG;YACpC;gBAAED,MAAM;gBAAmBC,KAAK;YAAG;YACnC;gBAAED,MAAM;gBAAqBC,KAAK;YAAG;YACrC;gBAAED,MAAM;gBAAoBC,KAAK;YAAG;YACpC;gBAAED,MAAM;gBAAgBC,KAAK;YAAG;YAChC;gBAAED,MAAM;gBAAkBC,KAAK;YAAG;YAClC;gBAAED,MAAM;gBAAiBC,KAAK;YAAG;YACjC;gBAAED,MAAM;gBAAoBC,KAAK;YAAG;YACpC;gBAAED,MAAM;gBAAiBC,KAAK;YAAG;YACjC;gBAAED,MAAM;gBAAiBC,KAAK;YAAG;YACjC;gBAAED,MAAM;gBAAgBC,KAAK;YAAG;YAChC;gBAAED,MAAM;gBAAkBC,KAAK;YAAG;SAClC;IACF;IACAC,YAAY;QACXC,QAAQ;IACT;IACAC,QAAQ,CAACP,qBAAS,KAACJ;YAAkB,GAAGI,IAAI;;AAC7C,EAAE"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
interface DatePickerInputProps {
|
|
2
|
+
value: string;
|
|
3
|
+
onChange: (value: string) => void;
|
|
4
|
+
placeholder?: string;
|
|
5
|
+
className?: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
}
|
|
8
|
+
declare function DatePickerInput({ value, onChange, placeholder, className, disabled, }: DatePickerInputProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export { DatePickerInput, type DatePickerInputProps };
|
|
10
|
+
//# sourceMappingURL=date-picker-input.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date-picker-input.d.ts","sourceRoot":"","sources":["../../../src/components/date-picker-input.tsx"],"names":[],"mappings":"AAiCA,UAAU,oBAAoB;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,iBAAS,eAAe,CAAC,EACxB,KAAK,EACL,QAAQ,EACR,WAA0B,EAC1B,SAAS,EACT,QAAQ,GACR,EAAE,oBAAoB,2CAsDtB;AAED,OAAO,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,CAAC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { CalendarIcon } from "lucide-react";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { Button } from "../shadcn/components/ui/button.js";
|
|
5
|
+
import { Calendar } from "../shadcn/components/ui/calendar.js";
|
|
6
|
+
import { Input } from "../shadcn/components/ui/input.js";
|
|
7
|
+
import { Popover, PopoverContent, PopoverTrigger } from "../shadcn/components/ui/popover.js";
|
|
8
|
+
import { cn } from "../shadcn/lib/utils.js";
|
|
9
|
+
function formatDate(date) {
|
|
10
|
+
if (!date) return "";
|
|
11
|
+
const d = date.getDate().toString().padStart(2, "0");
|
|
12
|
+
const m = (date.getMonth() + 1).toString().padStart(2, "0");
|
|
13
|
+
const y = date.getFullYear();
|
|
14
|
+
return `${d}.${m}.${y}`;
|
|
15
|
+
}
|
|
16
|
+
function parseDate(value) {
|
|
17
|
+
if (!value) return undefined;
|
|
18
|
+
const parts = value.split(".");
|
|
19
|
+
if (parts.length === 3) {
|
|
20
|
+
const [d, m, y] = parts;
|
|
21
|
+
const date = new Date(`${y}-${m}-${d}`);
|
|
22
|
+
if (!Number.isNaN(date.getTime())) return date;
|
|
23
|
+
}
|
|
24
|
+
const date = new Date(value);
|
|
25
|
+
if (!Number.isNaN(date.getTime())) return date;
|
|
26
|
+
return undefined;
|
|
27
|
+
}
|
|
28
|
+
function DatePickerInput({ value, onChange, placeholder = "dd.mm.yyyy", className, disabled }) {
|
|
29
|
+
const [open, setOpen] = React.useState(false);
|
|
30
|
+
const selectedDate = parseDate(value);
|
|
31
|
+
const [month, setMonth] = React.useState(selectedDate ?? new Date());
|
|
32
|
+
return /*#__PURE__*/ _jsx("div", {
|
|
33
|
+
className: cn("relative", className),
|
|
34
|
+
children: /*#__PURE__*/ _jsx(Input, {
|
|
35
|
+
type: "text",
|
|
36
|
+
placeholder: placeholder,
|
|
37
|
+
value: value,
|
|
38
|
+
disabled: disabled,
|
|
39
|
+
onChange: (e)=>onChange(e.target.value),
|
|
40
|
+
onKeyDown: (e)=>{
|
|
41
|
+
if (e.key === "ArrowDown") {
|
|
42
|
+
e.preventDefault();
|
|
43
|
+
setOpen(true);
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
rightSlot: /*#__PURE__*/ _jsxs(Popover, {
|
|
47
|
+
open: open,
|
|
48
|
+
onOpenChange: setOpen,
|
|
49
|
+
children: [
|
|
50
|
+
/*#__PURE__*/ _jsx(PopoverTrigger, {
|
|
51
|
+
asChild: true,
|
|
52
|
+
children: /*#__PURE__*/ _jsx(Button, {
|
|
53
|
+
variant: "ghost",
|
|
54
|
+
size: "small",
|
|
55
|
+
className: "p-0 size-5",
|
|
56
|
+
"aria-label": "Select date",
|
|
57
|
+
disabled: disabled,
|
|
58
|
+
onClick: (e)=>{
|
|
59
|
+
e.preventDefault();
|
|
60
|
+
setOpen((o)=>!o);
|
|
61
|
+
},
|
|
62
|
+
children: /*#__PURE__*/ _jsx(CalendarIcon, {
|
|
63
|
+
className: "size-3.5"
|
|
64
|
+
})
|
|
65
|
+
})
|
|
66
|
+
}),
|
|
67
|
+
/*#__PURE__*/ _jsx(PopoverContent, {
|
|
68
|
+
className: "w-auto p-0",
|
|
69
|
+
align: "end",
|
|
70
|
+
sideOffset: 10,
|
|
71
|
+
children: /*#__PURE__*/ _jsx(Calendar, {
|
|
72
|
+
mode: "single",
|
|
73
|
+
selected: selectedDate,
|
|
74
|
+
month: month,
|
|
75
|
+
onMonthChange: (m)=>setMonth(m),
|
|
76
|
+
onSelect: (date)=>{
|
|
77
|
+
onChange(formatDate(date));
|
|
78
|
+
if (date) setMonth(date);
|
|
79
|
+
setOpen(false);
|
|
80
|
+
}
|
|
81
|
+
})
|
|
82
|
+
})
|
|
83
|
+
]
|
|
84
|
+
})
|
|
85
|
+
})
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
export { DatePickerInput };
|
|
89
|
+
|
|
90
|
+
//# sourceMappingURL=date-picker-input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/date-picker-input.tsx"],"sourcesContent":["import { CalendarIcon } from \"lucide-react\";\nimport * as React from \"react\";\nimport { Button } from \"#shadcn/components/ui/button\";\nimport { Calendar } from \"#shadcn/components/ui/calendar\";\nimport { Input } from \"#shadcn/components/ui/input\";\nimport {\n\tPopover,\n\tPopoverContent,\n\tPopoverTrigger,\n} from \"#shadcn/components/ui/popover\";\nimport { cn } from \"#shadcn/lib/utils\";\n\nfunction formatDate(date: Date | undefined): string {\n\tif (!date) return \"\";\n\tconst d = date.getDate().toString().padStart(2, \"0\");\n\tconst m = (date.getMonth() + 1).toString().padStart(2, \"0\");\n\tconst y = date.getFullYear();\n\treturn `${d}.${m}.${y}`;\n}\n\nfunction parseDate(value: string): Date | undefined {\n\tif (!value) return undefined;\n\tconst parts = value.split(\".\");\n\tif (parts.length === 3) {\n\t\tconst [d, m, y] = parts;\n\t\tconst date = new Date(`${y}-${m}-${d}`);\n\t\tif (!Number.isNaN(date.getTime())) return date;\n\t}\n\tconst date = new Date(value);\n\tif (!Number.isNaN(date.getTime())) return date;\n\treturn undefined;\n}\n\ninterface DatePickerInputProps {\n\tvalue: string;\n\tonChange: (value: string) => void;\n\tplaceholder?: string;\n\tclassName?: string;\n\tdisabled?: boolean;\n}\n\nfunction DatePickerInput({\n\tvalue,\n\tonChange,\n\tplaceholder = \"dd.mm.yyyy\",\n\tclassName,\n\tdisabled,\n}: DatePickerInputProps) {\n\tconst [open, setOpen] = React.useState(false);\n\tconst selectedDate = parseDate(value);\n\tconst [month, setMonth] = React.useState<Date>(selectedDate ?? new Date());\n\n\treturn (\n\t\t<div className={cn(\"relative\", className)}>\n\t\t\t<Input\n\t\t\t\ttype=\"text\"\n\t\t\t\tplaceholder={placeholder}\n\t\t\t\tvalue={value}\n\t\t\t\tdisabled={disabled}\n\t\t\t\tonChange={(e) => onChange(e.target.value)}\n\t\t\t\tonKeyDown={(e) => {\n\t\t\t\t\tif (e.key === \"ArrowDown\") {\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\tsetOpen(true);\n\t\t\t\t\t}\n\t\t\t\t}}\n\t\t\t\trightSlot={\n\t\t\t\t\t<Popover open={open} onOpenChange={setOpen}>\n\t\t\t\t\t\t<PopoverTrigger asChild>\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tvariant=\"ghost\"\n\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\tclassName=\"p-0 size-5\"\n\t\t\t\t\t\t\t\taria-label=\"Select date\"\n\t\t\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\t\t\tonClick={(e) => {\n\t\t\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\t\t\tsetOpen((o) => !o);\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<CalendarIcon className=\"size-3.5\" />\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t</PopoverTrigger>\n\t\t\t\t\t\t<PopoverContent className=\"w-auto p-0\" align=\"end\" sideOffset={10}>\n\t\t\t\t\t\t\t<Calendar\n\t\t\t\t\t\t\t\tmode=\"single\"\n\t\t\t\t\t\t\t\tselected={selectedDate}\n\t\t\t\t\t\t\t\tmonth={month}\n\t\t\t\t\t\t\t\tonMonthChange={(m) => setMonth(m)}\n\t\t\t\t\t\t\t\tonSelect={(date) => {\n\t\t\t\t\t\t\t\t\tonChange(formatDate(date));\n\t\t\t\t\t\t\t\t\tif (date) setMonth(date);\n\t\t\t\t\t\t\t\t\tsetOpen(false);\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</PopoverContent>\n\t\t\t\t\t</Popover>\n\t\t\t\t}\n\t\t\t/>\n\t\t</div>\n\t);\n}\n\nexport { DatePickerInput, type DatePickerInputProps };\n"],"names":["CalendarIcon","React","Button","Calendar","Input","Popover","PopoverContent","PopoverTrigger","cn","formatDate","date","d","getDate","toString","padStart","m","getMonth","y","getFullYear","parseDate","value","undefined","parts","split","length","Date","Number","isNaN","getTime","DatePickerInput","onChange","placeholder","className","disabled","open","setOpen","useState","selectedDate","month","setMonth","div","type","e","target","onKeyDown","key","preventDefault","rightSlot","onOpenChange","asChild","variant","size","aria-label","onClick","o","align","sideOffset","mode","selected","onMonthChange","onSelect"],"mappings":";AAAA,SAASA,YAAY,QAAQ,eAAe;AAC5C,YAAYC,WAAW,QAAQ;AAC/B,SAASC,MAAM,QAAQ,oCAA+B;AACtD,SAASC,QAAQ,QAAQ,sCAAiC;AAC1D,SAASC,KAAK,QAAQ,mCAA8B;AACpD,SACCC,OAAO,EACPC,cAAc,EACdC,cAAc,QACR,qCAAgC;AACvC,SAASC,EAAE,QAAQ,yBAAoB;AAEvC,SAASC,WAAWC,IAAsB;IACzC,IAAI,CAACA,MAAM,OAAO;IAClB,MAAMC,IAAID,KAAKE,OAAO,GAAGC,QAAQ,GAAGC,QAAQ,CAAC,GAAG;IAChD,MAAMC,IAAI,AAACL,CAAAA,KAAKM,QAAQ,KAAK,CAAA,EAAGH,QAAQ,GAAGC,QAAQ,CAAC,GAAG;IACvD,MAAMG,IAAIP,KAAKQ,WAAW;IAC1B,OAAO,GAAGP,EAAE,CAAC,EAAEI,EAAE,CAAC,EAAEE,GAAG;AACxB;AAEA,SAASE,UAAUC,KAAa;IAC/B,IAAI,CAACA,OAAO,OAAOC;IACnB,MAAMC,QAAQF,MAAMG,KAAK,CAAC;IAC1B,IAAID,MAAME,MAAM,KAAK,GAAG;QACvB,MAAM,CAACb,GAAGI,GAAGE,EAAE,GAAGK;QAClB,MAAMZ,OAAO,IAAIe,KAAK,GAAGR,EAAE,CAAC,EAAEF,EAAE,CAAC,EAAEJ,GAAG;QACtC,IAAI,CAACe,OAAOC,KAAK,CAACjB,KAAKkB,OAAO,KAAK,OAAOlB;IAC3C;IACA,MAAMA,OAAO,IAAIe,KAAKL;IACtB,IAAI,CAACM,OAAOC,KAAK,CAACjB,KAAKkB,OAAO,KAAK,OAAOlB;IAC1C,OAAOW;AACR;AAUA,SAASQ,gBAAgB,EACxBT,KAAK,EACLU,QAAQ,EACRC,cAAc,YAAY,EAC1BC,SAAS,EACTC,QAAQ,EACc;IACtB,MAAM,CAACC,MAAMC,QAAQ,GAAGlC,MAAMmC,QAAQ,CAAC;IACvC,MAAMC,eAAelB,UAAUC;IAC/B,MAAM,CAACkB,OAAOC,SAAS,GAAGtC,MAAMmC,QAAQ,CAAOC,gBAAgB,IAAIZ;IAEnE,qBACC,KAACe;QAAIR,WAAWxB,GAAG,YAAYwB;kBAC9B,cAAA,KAAC5B;YACAqC,MAAK;YACLV,aAAaA;YACbX,OAAOA;YACPa,UAAUA;YACVH,UAAU,CAACY,IAAMZ,SAASY,EAAEC,MAAM,CAACvB,KAAK;YACxCwB,WAAW,CAACF;gBACX,IAAIA,EAAEG,GAAG,KAAK,aAAa;oBAC1BH,EAAEI,cAAc;oBAChBX,QAAQ;gBACT;YACD;YACAY,yBACC,MAAC1C;gBAAQ6B,MAAMA;gBAAMc,cAAcb;;kCAClC,KAAC5B;wBAAe0C,OAAO;kCACtB,cAAA,KAAC/C;4BACAgD,SAAQ;4BACRC,MAAK;4BACLnB,WAAU;4BACVoB,cAAW;4BACXnB,UAAUA;4BACVoB,SAAS,CAACX;gCACTA,EAAEI,cAAc;gCAChBX,QAAQ,CAACmB,IAAM,CAACA;4BACjB;sCAEA,cAAA,KAACtD;gCAAagC,WAAU;;;;kCAG1B,KAAC1B;wBAAe0B,WAAU;wBAAauB,OAAM;wBAAMC,YAAY;kCAC9D,cAAA,KAACrD;4BACAsD,MAAK;4BACLC,UAAUrB;4BACVC,OAAOA;4BACPqB,eAAe,CAAC5C,IAAMwB,SAASxB;4BAC/B6C,UAAU,CAAClD;gCACVoB,SAASrB,WAAWC;gCACpB,IAAIA,MAAM6B,SAAS7B;gCACnByB,QAAQ;4BACT;;;;;;;AAQR;AAEA,SAASN,eAAe,GAA8B"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { DatePickerInput } from "./date-picker-input.js";
|
|
4
|
+
function DatePickerInputWrapper(props) {
|
|
5
|
+
const [value, setValue] = useState("");
|
|
6
|
+
return /*#__PURE__*/ _jsx("div", {
|
|
7
|
+
className: "w-48",
|
|
8
|
+
children: /*#__PURE__*/ _jsx(DatePickerInput, {
|
|
9
|
+
value: value,
|
|
10
|
+
onChange: setValue,
|
|
11
|
+
...props
|
|
12
|
+
})
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
function DatePickerInputPrefilledWrapper() {
|
|
16
|
+
const [value, setValue] = useState("15.06.2025");
|
|
17
|
+
return /*#__PURE__*/ _jsx("div", {
|
|
18
|
+
className: "w-48",
|
|
19
|
+
children: /*#__PURE__*/ _jsx(DatePickerInput, {
|
|
20
|
+
value: value,
|
|
21
|
+
onChange: setValue
|
|
22
|
+
})
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
function DatePickerRangeWrapper() {
|
|
26
|
+
const [from, setFrom] = useState("");
|
|
27
|
+
const [to, setTo] = useState("");
|
|
28
|
+
return /*#__PURE__*/ _jsxs("div", {
|
|
29
|
+
className: "flex items-center gap-2",
|
|
30
|
+
children: [
|
|
31
|
+
/*#__PURE__*/ _jsx(DatePickerInput, {
|
|
32
|
+
value: from,
|
|
33
|
+
onChange: setFrom,
|
|
34
|
+
className: "w-40",
|
|
35
|
+
placeholder: "From"
|
|
36
|
+
}),
|
|
37
|
+
/*#__PURE__*/ _jsx("span", {
|
|
38
|
+
className: "text-text-secondary",
|
|
39
|
+
children: "—"
|
|
40
|
+
}),
|
|
41
|
+
/*#__PURE__*/ _jsx(DatePickerInput, {
|
|
42
|
+
value: to,
|
|
43
|
+
onChange: setTo,
|
|
44
|
+
className: "w-40",
|
|
45
|
+
placeholder: "To"
|
|
46
|
+
})
|
|
47
|
+
]
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
const meta = {
|
|
51
|
+
title: "Component/DatePickerInput",
|
|
52
|
+
component: DatePickerInputWrapper,
|
|
53
|
+
parameters: {
|
|
54
|
+
layout: "centered"
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
export default meta;
|
|
58
|
+
export const Default = {};
|
|
59
|
+
export const WithPlaceholder = {
|
|
60
|
+
args: {
|
|
61
|
+
placeholder: "Select a date..."
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
export const Disabled = {
|
|
65
|
+
args: {
|
|
66
|
+
disabled: true
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
export const Prefilled = {
|
|
70
|
+
render: ()=>/*#__PURE__*/ _jsx(DatePickerInputPrefilledWrapper, {})
|
|
71
|
+
};
|
|
72
|
+
export const DateRange = {
|
|
73
|
+
render: ()=>/*#__PURE__*/ _jsx(DatePickerRangeWrapper, {})
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
//# sourceMappingURL=date-picker-input.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/date-picker-input.stories.tsx"],"sourcesContent":["import type { Meta, StoryObj } from \"@storybook/react-vite\";\nimport { useState } from \"react\";\nimport { DatePickerInput } from \"./date-picker-input\";\n\nfunction DatePickerInputWrapper(props: {\n\tplaceholder?: string;\n\tdisabled?: boolean;\n}) {\n\tconst [value, setValue] = useState(\"\");\n\treturn (\n\t\t<div className=\"w-48\">\n\t\t\t<DatePickerInput value={value} onChange={setValue} {...props} />\n\t\t</div>\n\t);\n}\n\nfunction DatePickerInputPrefilledWrapper() {\n\tconst [value, setValue] = useState(\"15.06.2025\");\n\treturn (\n\t\t<div className=\"w-48\">\n\t\t\t<DatePickerInput value={value} onChange={setValue} />\n\t\t</div>\n\t);\n}\n\nfunction DatePickerRangeWrapper() {\n\tconst [from, setFrom] = useState(\"\");\n\tconst [to, setTo] = useState(\"\");\n\treturn (\n\t\t<div className=\"flex items-center gap-2\">\n\t\t\t<DatePickerInput\n\t\t\t\tvalue={from}\n\t\t\t\tonChange={setFrom}\n\t\t\t\tclassName=\"w-40\"\n\t\t\t\tplaceholder=\"From\"\n\t\t\t/>\n\t\t\t<span className=\"text-text-secondary\">—</span>\n\t\t\t<DatePickerInput\n\t\t\t\tvalue={to}\n\t\t\t\tonChange={setTo}\n\t\t\t\tclassName=\"w-40\"\n\t\t\t\tplaceholder=\"To\"\n\t\t\t/>\n\t\t</div>\n\t);\n}\n\nconst meta = {\n\ttitle: \"Component/DatePickerInput\",\n\tcomponent: DatePickerInputWrapper,\n\tparameters: {\n\t\tlayout: \"centered\",\n\t},\n} satisfies Meta<typeof DatePickerInputWrapper>;\n\nexport default meta;\ntype Story = StoryObj<typeof meta>;\n\nexport const Default: Story = {};\n\nexport const WithPlaceholder: Story = {\n\targs: {\n\t\tplaceholder: \"Select a date...\",\n\t},\n};\n\nexport const Disabled: Story = {\n\targs: {\n\t\tdisabled: true,\n\t},\n};\n\nexport const Prefilled: StoryObj = {\n\trender: () => <DatePickerInputPrefilledWrapper />,\n};\n\nexport const DateRange: StoryObj = {\n\trender: () => <DatePickerRangeWrapper />,\n};\n"],"names":["useState","DatePickerInput","DatePickerInputWrapper","props","value","setValue","div","className","onChange","DatePickerInputPrefilledWrapper","DatePickerRangeWrapper","from","setFrom","to","setTo","placeholder","span","meta","title","component","parameters","layout","Default","WithPlaceholder","args","Disabled","disabled","Prefilled","render","DateRange"],"mappings":";AACA,SAASA,QAAQ,QAAQ,QAAQ;AACjC,SAASC,eAAe,QAAQ,yBAAsB;AAEtD,SAASC,uBAAuBC,KAG/B;IACA,MAAM,CAACC,OAAOC,SAAS,GAAGL,SAAS;IACnC,qBACC,KAACM;QAAIC,WAAU;kBACd,cAAA,KAACN;YAAgBG,OAAOA;YAAOI,UAAUH;YAAW,GAAGF,KAAK;;;AAG/D;AAEA,SAASM;IACR,MAAM,CAACL,OAAOC,SAAS,GAAGL,SAAS;IACnC,qBACC,KAACM;QAAIC,WAAU;kBACd,cAAA,KAACN;YAAgBG,OAAOA;YAAOI,UAAUH;;;AAG5C;AAEA,SAASK;IACR,MAAM,CAACC,MAAMC,QAAQ,GAAGZ,SAAS;IACjC,MAAM,CAACa,IAAIC,MAAM,GAAGd,SAAS;IAC7B,qBACC,MAACM;QAAIC,WAAU;;0BACd,KAACN;gBACAG,OAAOO;gBACPH,UAAUI;gBACVL,WAAU;gBACVQ,aAAY;;0BAEb,KAACC;gBAAKT,WAAU;0BAAsB;;0BACtC,KAACN;gBACAG,OAAOS;gBACPL,UAAUM;gBACVP,WAAU;gBACVQ,aAAY;;;;AAIhB;AAEA,MAAME,OAAO;IACZC,OAAO;IACPC,WAAWjB;IACXkB,YAAY;QACXC,QAAQ;IACT;AACD;AAEA,eAAeJ,KAAK;AAGpB,OAAO,MAAMK,UAAiB,CAAC,EAAE;AAEjC,OAAO,MAAMC,kBAAyB;IACrCC,MAAM;QACLT,aAAa;IACd;AACD,EAAE;AAEF,OAAO,MAAMU,WAAkB;IAC9BD,MAAM;QACLE,UAAU;IACX;AACD,EAAE;AAEF,OAAO,MAAMC,YAAsB;IAClCC,QAAQ,kBAAM,KAACnB;AAChB,EAAE;AAEF,OAAO,MAAMoB,YAAsB;IAClCD,QAAQ,kBAAM,KAAClB;AAChB,EAAE"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type TreeViewItem } from "./tree-view";
|
|
2
|
+
type PackageSpec = {
|
|
3
|
+
name: string;
|
|
4
|
+
version: string;
|
|
5
|
+
};
|
|
6
|
+
type Coordinate = {
|
|
7
|
+
id?: string;
|
|
8
|
+
packageSpec?: PackageSpec;
|
|
9
|
+
"package-spec"?: PackageSpec;
|
|
10
|
+
label?: string;
|
|
11
|
+
};
|
|
12
|
+
type FhirStructure = {
|
|
13
|
+
type?: string;
|
|
14
|
+
min?: string | number;
|
|
15
|
+
max?: string | number;
|
|
16
|
+
lastNode?: boolean;
|
|
17
|
+
isSummary?: boolean;
|
|
18
|
+
isModifier?: boolean;
|
|
19
|
+
mustSupport?: boolean;
|
|
20
|
+
datatype?: string;
|
|
21
|
+
short?: string;
|
|
22
|
+
desc?: string;
|
|
23
|
+
extensionUrl?: string;
|
|
24
|
+
extensionCoordinate?: Coordinate;
|
|
25
|
+
binding?: {
|
|
26
|
+
valueSet: string;
|
|
27
|
+
};
|
|
28
|
+
vsCoordinate?: Coordinate;
|
|
29
|
+
};
|
|
30
|
+
declare function FhirStructureView({ tree, }: {
|
|
31
|
+
tree: Record<string, TreeViewItem<FhirStructure>>;
|
|
32
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
export { FhirStructureView, type FhirStructure };
|
|
34
|
+
//# sourceMappingURL=fhir-structure-view.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fhir-structure-view.d.ts","sourceRoot":"","sources":["../../../src/components/fhir-structure-view.tsx"],"names":[],"mappings":"AASA,OAAO,EAAY,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAE1D,KAAK,WAAW,GAAG;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,KAAK,UAAU,GAAG;IACjB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,cAAc,CAAC,EAAE,WAAW,CAAC;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,KAAK,aAAa,GAAG;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACtB,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,mBAAmB,CAAC,EAAE,UAAU,CAAC;IACjC,OAAO,CAAC,EAAE;QACT,QAAQ,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,YAAY,CAAC,EAAE,UAAU,CAAC;CAC1B,CAAC;AA8JF,iBAAS,iBAAiB,CAAC,EAC1B,IAAI,GACJ,EAAE;IACF,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,aAAa,CAAC,CAAC,CAAC;CAClD,2CA4BA;AAED,OAAO,EAAE,iBAAiB,EAAE,KAAK,aAAa,EAAE,CAAC"}
|