@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
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Controls, Primary, Title } from "@storybook/addon-docs/blocks";
|
|
1
2
|
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
3
|
import {
|
|
3
4
|
AlertDialog,
|
|
@@ -12,32 +13,225 @@ import {
|
|
|
12
13
|
} from "#shadcn/components/ui/alert-dialog";
|
|
13
14
|
import { Button } from "#shadcn/components/ui/button";
|
|
14
15
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
interface AlertDialogWrapperProps {
|
|
17
|
+
variant?: "default" | "danger";
|
|
18
|
+
buttons?: 1 | 2;
|
|
19
|
+
scrollableContent?: boolean;
|
|
20
|
+
}
|
|
19
21
|
|
|
20
|
-
|
|
22
|
+
function AlertDialogWrapper({
|
|
23
|
+
variant = "default",
|
|
24
|
+
buttons = 1,
|
|
25
|
+
scrollableContent = false,
|
|
26
|
+
}: AlertDialogWrapperProps) {
|
|
27
|
+
const actionProps = variant === "danger" ? { danger: true } : {};
|
|
21
28
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
29
|
+
const longContent = (
|
|
30
|
+
<>
|
|
31
|
+
{Array.from({ length: 20 }, (_, i) => (
|
|
32
|
+
// biome-ignore lint/suspicious/noArrayIndexKey: static content
|
|
33
|
+
<p key={i}>
|
|
34
|
+
{i + 1}. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed
|
|
35
|
+
do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim
|
|
36
|
+
ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut
|
|
37
|
+
aliquip ex ea commodo consequat. Duis aute irure dolor in
|
|
38
|
+
reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
|
|
39
|
+
pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
|
|
40
|
+
culpa qui officia deserunt mollit anim id est laborum.
|
|
41
|
+
</p>
|
|
42
|
+
))}
|
|
43
|
+
</>
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
return (
|
|
47
|
+
<AlertDialog defaultOpen>
|
|
25
48
|
<AlertDialogTrigger asChild>
|
|
26
49
|
<Button variant="secondary">Show Dialog</Button>
|
|
27
50
|
</AlertDialogTrigger>
|
|
28
|
-
<AlertDialogContent
|
|
51
|
+
<AlertDialogContent
|
|
52
|
+
className={
|
|
53
|
+
scrollableContent ? "h-[calc(100vh-44px)] flex flex-col" : undefined
|
|
54
|
+
}
|
|
55
|
+
>
|
|
29
56
|
<AlertDialogHeader>
|
|
30
|
-
<AlertDialogTitle>
|
|
31
|
-
<AlertDialogDescription>
|
|
32
|
-
This action cannot be undone. This will permanently delete your
|
|
33
|
-
account and remove your data from our servers.
|
|
34
|
-
</AlertDialogDescription>
|
|
57
|
+
<AlertDialogTitle>Dialog Title</AlertDialogTitle>
|
|
35
58
|
</AlertDialogHeader>
|
|
59
|
+
<AlertDialogDescription
|
|
60
|
+
className={scrollableContent ? "flex-1 overflow-y-auto" : undefined}
|
|
61
|
+
>
|
|
62
|
+
{scrollableContent ? (
|
|
63
|
+
<div className="space-y-4">{longContent}</div>
|
|
64
|
+
) : (
|
|
65
|
+
"This is a dialog description. It provides context about the action."
|
|
66
|
+
)}
|
|
67
|
+
</AlertDialogDescription>
|
|
36
68
|
<AlertDialogFooter>
|
|
37
69
|
<AlertDialogCancel>Cancel</AlertDialogCancel>
|
|
38
|
-
<
|
|
70
|
+
<div className="flex gap-3">
|
|
71
|
+
{buttons === 2 && (
|
|
72
|
+
<AlertDialogAction variant="secondary" {...actionProps}>
|
|
73
|
+
Secondary
|
|
74
|
+
</AlertDialogAction>
|
|
75
|
+
)}
|
|
76
|
+
<AlertDialogAction {...actionProps}>
|
|
77
|
+
{variant === "danger" ? "Delete" : "Confirm"}
|
|
78
|
+
</AlertDialogAction>
|
|
79
|
+
</div>
|
|
39
80
|
</AlertDialogFooter>
|
|
40
81
|
</AlertDialogContent>
|
|
41
82
|
</AlertDialog>
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
const meta = {
|
|
87
|
+
title: "Component/Alert dialog",
|
|
88
|
+
component: AlertDialogWrapper,
|
|
89
|
+
parameters: {
|
|
90
|
+
docs: {
|
|
91
|
+
page: () => (
|
|
92
|
+
<>
|
|
93
|
+
<Title />
|
|
94
|
+
<Primary />
|
|
95
|
+
<Controls />
|
|
96
|
+
</>
|
|
97
|
+
),
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
argTypes: {
|
|
101
|
+
variant: {
|
|
102
|
+
control: "select",
|
|
103
|
+
options: ["default", "danger"],
|
|
104
|
+
},
|
|
105
|
+
buttons: {
|
|
106
|
+
control: "select",
|
|
107
|
+
options: [1, 2],
|
|
108
|
+
},
|
|
109
|
+
scrollableContent: {
|
|
110
|
+
control: "boolean",
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
args: {
|
|
114
|
+
variant: "default",
|
|
115
|
+
buttons: 1,
|
|
116
|
+
scrollableContent: false,
|
|
117
|
+
},
|
|
118
|
+
} satisfies Meta<typeof AlertDialogWrapper>;
|
|
119
|
+
export default meta;
|
|
120
|
+
|
|
121
|
+
type Story = StoryObj<typeof meta>;
|
|
122
|
+
|
|
123
|
+
export const Default = {
|
|
124
|
+
tags: ["!dev"],
|
|
125
|
+
render: ({ variant = "default", buttons = 1, scrollableContent = false }) => (
|
|
126
|
+
<AlertDialogWrapper
|
|
127
|
+
variant={variant}
|
|
128
|
+
buttons={buttons}
|
|
129
|
+
scrollableContent={scrollableContent}
|
|
130
|
+
/>
|
|
131
|
+
),
|
|
132
|
+
} satisfies Story;
|
|
133
|
+
|
|
134
|
+
export const Demo = {
|
|
135
|
+
tags: ["!autodocs"],
|
|
136
|
+
render: () => (
|
|
137
|
+
<div className="flex flex-wrap gap-4">
|
|
138
|
+
<AlertDialog>
|
|
139
|
+
<AlertDialogTrigger asChild>
|
|
140
|
+
<Button variant="secondary">Default</Button>
|
|
141
|
+
</AlertDialogTrigger>
|
|
142
|
+
<AlertDialogContent>
|
|
143
|
+
<AlertDialogHeader>
|
|
144
|
+
<AlertDialogTitle>Confirm Action</AlertDialogTitle>
|
|
145
|
+
</AlertDialogHeader>
|
|
146
|
+
<AlertDialogDescription>
|
|
147
|
+
Are you sure you want to continue?
|
|
148
|
+
</AlertDialogDescription>
|
|
149
|
+
<AlertDialogFooter>
|
|
150
|
+
<AlertDialogCancel>Cancel</AlertDialogCancel>
|
|
151
|
+
<div className="flex gap-3">
|
|
152
|
+
<AlertDialogAction>Confirm</AlertDialogAction>
|
|
153
|
+
</div>
|
|
154
|
+
</AlertDialogFooter>
|
|
155
|
+
</AlertDialogContent>
|
|
156
|
+
</AlertDialog>
|
|
157
|
+
|
|
158
|
+
<AlertDialog>
|
|
159
|
+
<AlertDialogTrigger asChild>
|
|
160
|
+
<Button variant="secondary">Default (2 buttons)</Button>
|
|
161
|
+
</AlertDialogTrigger>
|
|
162
|
+
<AlertDialogContent>
|
|
163
|
+
<AlertDialogHeader>
|
|
164
|
+
<AlertDialogTitle>Unsaved Changes</AlertDialogTitle>
|
|
165
|
+
</AlertDialogHeader>
|
|
166
|
+
<AlertDialogDescription>
|
|
167
|
+
You have unsaved changes. Do you want to save before leaving?
|
|
168
|
+
</AlertDialogDescription>
|
|
169
|
+
<AlertDialogFooter>
|
|
170
|
+
<AlertDialogCancel>Cancel</AlertDialogCancel>
|
|
171
|
+
<div className="flex gap-3">
|
|
172
|
+
<AlertDialogAction variant="secondary">
|
|
173
|
+
Don't Save
|
|
174
|
+
</AlertDialogAction>
|
|
175
|
+
<AlertDialogAction>Save</AlertDialogAction>
|
|
176
|
+
</div>
|
|
177
|
+
</AlertDialogFooter>
|
|
178
|
+
</AlertDialogContent>
|
|
179
|
+
</AlertDialog>
|
|
180
|
+
|
|
181
|
+
<AlertDialog>
|
|
182
|
+
<AlertDialogTrigger asChild>
|
|
183
|
+
<Button variant="secondary">Danger</Button>
|
|
184
|
+
</AlertDialogTrigger>
|
|
185
|
+
<AlertDialogContent>
|
|
186
|
+
<AlertDialogHeader>
|
|
187
|
+
<AlertDialogTitle>Delete Account</AlertDialogTitle>
|
|
188
|
+
</AlertDialogHeader>
|
|
189
|
+
<AlertDialogDescription>
|
|
190
|
+
This action cannot be undone. All your data will be permanently
|
|
191
|
+
deleted.
|
|
192
|
+
</AlertDialogDescription>
|
|
193
|
+
<AlertDialogFooter>
|
|
194
|
+
<AlertDialogCancel>Cancel</AlertDialogCancel>
|
|
195
|
+
<div className="flex gap-3">
|
|
196
|
+
<AlertDialogAction danger>Delete</AlertDialogAction>
|
|
197
|
+
</div>
|
|
198
|
+
</AlertDialogFooter>
|
|
199
|
+
</AlertDialogContent>
|
|
200
|
+
</AlertDialog>
|
|
201
|
+
|
|
202
|
+
<AlertDialog>
|
|
203
|
+
<AlertDialogTrigger asChild>
|
|
204
|
+
<Button variant="secondary">Scrollable Content</Button>
|
|
205
|
+
</AlertDialogTrigger>
|
|
206
|
+
<AlertDialogContent className="h-[calc(100vh-44px)] flex flex-col">
|
|
207
|
+
<AlertDialogHeader>
|
|
208
|
+
<AlertDialogTitle>Terms and Conditions</AlertDialogTitle>
|
|
209
|
+
</AlertDialogHeader>
|
|
210
|
+
<AlertDialogDescription className="flex-1 overflow-y-auto">
|
|
211
|
+
<div className="space-y-4">
|
|
212
|
+
{Array.from({ length: 20 }, (_, i) => (
|
|
213
|
+
// biome-ignore lint/suspicious/noArrayIndexKey: static content
|
|
214
|
+
<p key={i}>
|
|
215
|
+
{i + 1}. Lorem ipsum dolor sit amet, consectetur adipiscing
|
|
216
|
+
elit. Sed do eiusmod tempor incididunt ut labore et dolore
|
|
217
|
+
magna aliqua. Ut enim ad minim veniam, quis nostrud
|
|
218
|
+
exercitation ullamco laboris nisi ut aliquip ex ea commodo
|
|
219
|
+
consequat. Duis aute irure dolor in reprehenderit in voluptate
|
|
220
|
+
velit esse cillum dolore eu fugiat nulla pariatur. Excepteur
|
|
221
|
+
sint occaecat cupidatat non proident, sunt in culpa qui
|
|
222
|
+
officia deserunt mollit anim id est laborum.
|
|
223
|
+
</p>
|
|
224
|
+
))}
|
|
225
|
+
</div>
|
|
226
|
+
</AlertDialogDescription>
|
|
227
|
+
<AlertDialogFooter>
|
|
228
|
+
<AlertDialogCancel>Cancel</AlertDialogCancel>
|
|
229
|
+
<div className="flex gap-3">
|
|
230
|
+
<AlertDialogAction>Accept</AlertDialogAction>
|
|
231
|
+
</div>
|
|
232
|
+
</AlertDialogFooter>
|
|
233
|
+
</AlertDialogContent>
|
|
234
|
+
</AlertDialog>
|
|
235
|
+
</div>
|
|
42
236
|
),
|
|
43
237
|
} satisfies Story;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
|
|
2
|
-
import type
|
|
3
|
-
import {
|
|
2
|
+
import type { VariantProps } from "class-variance-authority";
|
|
3
|
+
import { XIcon } from "lucide-react";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
import type { buttonVariants } from "#shadcn/components/ui/button";
|
|
6
|
+
import { Button } from "#shadcn/components/ui/button";
|
|
4
7
|
import { cn } from "#shadcn/lib/utils";
|
|
5
8
|
|
|
6
9
|
function AlertDialog({
|
|
@@ -25,6 +28,22 @@ function AlertDialogPortal({
|
|
|
25
28
|
);
|
|
26
29
|
}
|
|
27
30
|
|
|
31
|
+
// AlertDialog overlay styles
|
|
32
|
+
const alertDialogOverlayStyles = cn(
|
|
33
|
+
// Layout
|
|
34
|
+
"fixed",
|
|
35
|
+
"inset-0",
|
|
36
|
+
"z-50",
|
|
37
|
+
// Background
|
|
38
|
+
"bg-black/50",
|
|
39
|
+
// Animations - open
|
|
40
|
+
"data-[state=open]:animate-in",
|
|
41
|
+
"data-[state=open]:fade-in-0",
|
|
42
|
+
// Animations - closed
|
|
43
|
+
"data-[state=closed]:animate-out",
|
|
44
|
+
"data-[state=closed]:fade-out-0",
|
|
45
|
+
);
|
|
46
|
+
|
|
28
47
|
function AlertDialogOverlay({
|
|
29
48
|
className,
|
|
30
49
|
...props
|
|
@@ -32,30 +51,139 @@ function AlertDialogOverlay({
|
|
|
32
51
|
return (
|
|
33
52
|
<AlertDialogPrimitive.Overlay
|
|
34
53
|
data-slot="alert-dialog-overlay"
|
|
35
|
-
className={cn(
|
|
36
|
-
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
|
|
37
|
-
className,
|
|
38
|
-
)}
|
|
54
|
+
className={cn(alertDialogOverlayStyles, className)}
|
|
39
55
|
{...props}
|
|
40
56
|
/>
|
|
41
57
|
);
|
|
42
58
|
}
|
|
43
59
|
|
|
60
|
+
// AlertDialog content styles
|
|
61
|
+
const alertDialogContentStyles = cn(
|
|
62
|
+
// Layout
|
|
63
|
+
"fixed",
|
|
64
|
+
"top-[50%]",
|
|
65
|
+
"left-[50%]",
|
|
66
|
+
"z-50",
|
|
67
|
+
"flex",
|
|
68
|
+
"flex-col",
|
|
69
|
+
"w-full",
|
|
70
|
+
"max-w-[calc(100%-2rem)]",
|
|
71
|
+
"translate-x-[-50%]",
|
|
72
|
+
"translate-y-[-50%]",
|
|
73
|
+
// Shape
|
|
74
|
+
"rounded-lg",
|
|
75
|
+
// Borders
|
|
76
|
+
"border",
|
|
77
|
+
"border-border-primary",
|
|
78
|
+
// Background & Colors
|
|
79
|
+
"bg-bg-primary",
|
|
80
|
+
// Shadow
|
|
81
|
+
"dropdown-menu-shadow",
|
|
82
|
+
// Animation duration
|
|
83
|
+
"duration-200",
|
|
84
|
+
// Responsive
|
|
85
|
+
"sm:max-w-lg",
|
|
86
|
+
// Animations - open
|
|
87
|
+
"data-[state=open]:animate-in",
|
|
88
|
+
"data-[state=open]:fade-in-0",
|
|
89
|
+
"data-[state=open]:zoom-in-95",
|
|
90
|
+
// Animations - closed
|
|
91
|
+
"data-[state=closed]:animate-out",
|
|
92
|
+
"data-[state=closed]:fade-out-0",
|
|
93
|
+
"data-[state=closed]:zoom-out-95",
|
|
94
|
+
);
|
|
95
|
+
|
|
96
|
+
// AlertDialog close button styles
|
|
97
|
+
const alertDialogCloseButtonStyles = cn(
|
|
98
|
+
// Layout
|
|
99
|
+
"absolute",
|
|
100
|
+
"top-4",
|
|
101
|
+
"right-4",
|
|
102
|
+
// Shape
|
|
103
|
+
"rounded-xs",
|
|
104
|
+
// Opacity
|
|
105
|
+
"opacity-70",
|
|
106
|
+
"hover:opacity-100",
|
|
107
|
+
// Transitions
|
|
108
|
+
"transition-opacity",
|
|
109
|
+
// Cursor
|
|
110
|
+
"cursor-pointer",
|
|
111
|
+
// Focus
|
|
112
|
+
"focus:ring-2",
|
|
113
|
+
"focus:ring-utility-blue/70",
|
|
114
|
+
"focus:ring-offset-2",
|
|
115
|
+
"focus:outline-hidden",
|
|
116
|
+
// Disabled
|
|
117
|
+
"disabled:pointer-events-none",
|
|
118
|
+
// SVG styles
|
|
119
|
+
"[&_svg]:pointer-events-none",
|
|
120
|
+
"[&_svg]:shrink-0",
|
|
121
|
+
"[&_svg:not([class*='size-'])]:size-4",
|
|
122
|
+
// States
|
|
123
|
+
"data-[state=open]:bg-bg-secondary",
|
|
124
|
+
"data-[state=open]:text-text-secondary",
|
|
125
|
+
);
|
|
126
|
+
|
|
44
127
|
function AlertDialogContent({
|
|
45
128
|
className,
|
|
129
|
+
children,
|
|
130
|
+
showCloseButton = true,
|
|
131
|
+
onOpenAutoFocus,
|
|
46
132
|
...props
|
|
47
|
-
}: React.ComponentProps<typeof AlertDialogPrimitive.Content>
|
|
133
|
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Content> & {
|
|
134
|
+
showCloseButton?: boolean;
|
|
135
|
+
}) {
|
|
136
|
+
const contentRef = React.useRef<HTMLDivElement>(null);
|
|
137
|
+
|
|
138
|
+
const handleOpenAutoFocus = React.useCallback(
|
|
139
|
+
(event: Event) => {
|
|
140
|
+
// Prevent default focus behavior
|
|
141
|
+
event.preventDefault();
|
|
142
|
+
|
|
143
|
+
// Find first focusable element (usually a button in footer)
|
|
144
|
+
if (contentRef.current) {
|
|
145
|
+
const firstFocusable = contentRef.current.querySelector<HTMLElement>(
|
|
146
|
+
'button:not([tabindex="-1"]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])',
|
|
147
|
+
);
|
|
148
|
+
|
|
149
|
+
// Focus on first focusable element, or fallback to content itself
|
|
150
|
+
if (firstFocusable) {
|
|
151
|
+
firstFocusable.focus();
|
|
152
|
+
} else {
|
|
153
|
+
contentRef.current.focus();
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
// Call user-provided handler if exists
|
|
158
|
+
if (onOpenAutoFocus) {
|
|
159
|
+
onOpenAutoFocus(event);
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
[onOpenAutoFocus],
|
|
163
|
+
);
|
|
164
|
+
|
|
48
165
|
return (
|
|
49
166
|
<AlertDialogPortal>
|
|
50
167
|
<AlertDialogOverlay />
|
|
51
168
|
<AlertDialogPrimitive.Content
|
|
169
|
+
ref={contentRef}
|
|
52
170
|
data-slot="alert-dialog-content"
|
|
53
|
-
className={cn(
|
|
54
|
-
|
|
55
|
-
className,
|
|
56
|
-
)}
|
|
171
|
+
className={cn(alertDialogContentStyles, className)}
|
|
172
|
+
onOpenAutoFocus={handleOpenAutoFocus}
|
|
57
173
|
{...props}
|
|
58
|
-
|
|
174
|
+
>
|
|
175
|
+
{children}
|
|
176
|
+
{showCloseButton && (
|
|
177
|
+
<AlertDialogPrimitive.Cancel
|
|
178
|
+
data-slot="alert-dialog-close"
|
|
179
|
+
className={alertDialogCloseButtonStyles}
|
|
180
|
+
tabIndex={-1}
|
|
181
|
+
>
|
|
182
|
+
<XIcon />
|
|
183
|
+
<span className="sr-only">Close</span>
|
|
184
|
+
</AlertDialogPrimitive.Cancel>
|
|
185
|
+
)}
|
|
186
|
+
</AlertDialogPrimitive.Content>
|
|
59
187
|
</AlertDialogPortal>
|
|
60
188
|
);
|
|
61
189
|
}
|
|
@@ -67,7 +195,19 @@ function AlertDialogHeader({
|
|
|
67
195
|
return (
|
|
68
196
|
<div
|
|
69
197
|
data-slot="alert-dialog-header"
|
|
70
|
-
className={cn(
|
|
198
|
+
className={cn(
|
|
199
|
+
// Layout
|
|
200
|
+
"flex",
|
|
201
|
+
"items-center",
|
|
202
|
+
"justify-between",
|
|
203
|
+
"h-[60px]",
|
|
204
|
+
// Spacing
|
|
205
|
+
"px-6",
|
|
206
|
+
// Borders
|
|
207
|
+
"border-b",
|
|
208
|
+
"border-border-separator",
|
|
209
|
+
className,
|
|
210
|
+
)}
|
|
71
211
|
{...props}
|
|
72
212
|
/>
|
|
73
213
|
);
|
|
@@ -81,7 +221,17 @@ function AlertDialogFooter({
|
|
|
81
221
|
<div
|
|
82
222
|
data-slot="alert-dialog-footer"
|
|
83
223
|
className={cn(
|
|
84
|
-
|
|
224
|
+
// Layout
|
|
225
|
+
"flex",
|
|
226
|
+
"items-center",
|
|
227
|
+
"justify-between",
|
|
228
|
+
"h-[60px]",
|
|
229
|
+
// Spacing
|
|
230
|
+
"px-4",
|
|
231
|
+
"py-3",
|
|
232
|
+
// Borders
|
|
233
|
+
"border-t",
|
|
234
|
+
"border-border-separator",
|
|
85
235
|
className,
|
|
86
236
|
)}
|
|
87
237
|
{...props}
|
|
@@ -96,7 +246,7 @@ function AlertDialogTitle({
|
|
|
96
246
|
return (
|
|
97
247
|
<AlertDialogPrimitive.Title
|
|
98
248
|
data-slot="alert-dialog-title"
|
|
99
|
-
className={cn("
|
|
249
|
+
className={cn("typo-page-header", className)}
|
|
100
250
|
{...props}
|
|
101
251
|
/>
|
|
102
252
|
);
|
|
@@ -109,7 +259,16 @@ function AlertDialogDescription({
|
|
|
109
259
|
return (
|
|
110
260
|
<AlertDialogPrimitive.Description
|
|
111
261
|
data-slot="alert-dialog-description"
|
|
112
|
-
className={cn(
|
|
262
|
+
className={cn(
|
|
263
|
+
// Typography
|
|
264
|
+
"body14",
|
|
265
|
+
"text-text-secondary_hover",
|
|
266
|
+
// Spacing
|
|
267
|
+
"px-6",
|
|
268
|
+
"pt-3",
|
|
269
|
+
"pb-4",
|
|
270
|
+
className,
|
|
271
|
+
)}
|
|
113
272
|
{...props}
|
|
114
273
|
/>
|
|
115
274
|
);
|
|
@@ -117,25 +276,76 @@ function AlertDialogDescription({
|
|
|
117
276
|
|
|
118
277
|
function AlertDialogAction({
|
|
119
278
|
className,
|
|
279
|
+
variant,
|
|
280
|
+
danger,
|
|
281
|
+
asChild = false,
|
|
282
|
+
children,
|
|
120
283
|
...props
|
|
121
|
-
}: React.ComponentProps<typeof AlertDialogPrimitive.Action>
|
|
284
|
+
}: Omit<React.ComponentProps<typeof AlertDialogPrimitive.Action>, "asChild"> &
|
|
285
|
+
VariantProps<typeof buttonVariants> & {
|
|
286
|
+
asChild?: boolean;
|
|
287
|
+
}) {
|
|
288
|
+
if (asChild) {
|
|
289
|
+
return (
|
|
290
|
+
<AlertDialogPrimitive.Action asChild className={className} {...props}>
|
|
291
|
+
{children}
|
|
292
|
+
</AlertDialogPrimitive.Action>
|
|
293
|
+
);
|
|
294
|
+
}
|
|
295
|
+
// Extract asChild from props to avoid type conflicts
|
|
296
|
+
const { asChild: _asChild, ...restProps } = props as typeof props & {
|
|
297
|
+
asChild?: boolean | null | undefined;
|
|
298
|
+
};
|
|
299
|
+
type ButtonProps = Omit<
|
|
300
|
+
React.ComponentProps<typeof Button>,
|
|
301
|
+
"asChild" | "variant" | "danger" | "className"
|
|
302
|
+
>;
|
|
303
|
+
const buttonProps: React.ComponentProps<typeof Button> = {
|
|
304
|
+
variant,
|
|
305
|
+
className,
|
|
306
|
+
...(danger !== undefined && danger !== null ? { danger } : {}),
|
|
307
|
+
...(restProps as ButtonProps),
|
|
308
|
+
};
|
|
122
309
|
return (
|
|
123
|
-
<AlertDialogPrimitive.Action
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
/>
|
|
310
|
+
<AlertDialogPrimitive.Action asChild>
|
|
311
|
+
<Button {...buttonProps}>{children}</Button>
|
|
312
|
+
</AlertDialogPrimitive.Action>
|
|
127
313
|
);
|
|
128
314
|
}
|
|
129
315
|
|
|
130
316
|
function AlertDialogCancel({
|
|
131
317
|
className,
|
|
318
|
+
asChild = false,
|
|
319
|
+
children,
|
|
132
320
|
...props
|
|
133
|
-
}: React.ComponentProps<typeof AlertDialogPrimitive.Cancel>
|
|
321
|
+
}: Omit<React.ComponentProps<typeof AlertDialogPrimitive.Cancel>, "asChild"> & {
|
|
322
|
+
asChild?: boolean;
|
|
323
|
+
}) {
|
|
324
|
+
if (asChild) {
|
|
325
|
+
return (
|
|
326
|
+
<AlertDialogPrimitive.Cancel asChild className={className} {...props}>
|
|
327
|
+
{children}
|
|
328
|
+
</AlertDialogPrimitive.Cancel>
|
|
329
|
+
);
|
|
330
|
+
}
|
|
331
|
+
// Extract asChild from props to avoid type conflicts
|
|
332
|
+
const { asChild: _asChild, ...restProps } = props as typeof props & {
|
|
333
|
+
asChild?: boolean | null | undefined;
|
|
334
|
+
};
|
|
335
|
+
type ButtonProps = Omit<
|
|
336
|
+
React.ComponentProps<typeof Button>,
|
|
337
|
+
"asChild" | "variant" | "className"
|
|
338
|
+
>;
|
|
134
339
|
return (
|
|
135
|
-
<AlertDialogPrimitive.Cancel
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
340
|
+
<AlertDialogPrimitive.Cancel asChild>
|
|
341
|
+
<Button
|
|
342
|
+
variant="secondary"
|
|
343
|
+
className={className}
|
|
344
|
+
{...(restProps as ButtonProps)}
|
|
345
|
+
>
|
|
346
|
+
{children}
|
|
347
|
+
</Button>
|
|
348
|
+
</AlertDialogPrimitive.Cancel>
|
|
139
349
|
);
|
|
140
350
|
}
|
|
141
351
|
|