@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,5 +1,11 @@
|
|
|
1
|
+
import { Controls, Primary, Title } from "@storybook/addon-docs/blocks";
|
|
1
2
|
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
AlertCircleIcon,
|
|
5
|
+
CheckIcon,
|
|
6
|
+
CircleXIcon,
|
|
7
|
+
InfoIcon,
|
|
8
|
+
} from "lucide-react";
|
|
3
9
|
import {
|
|
4
10
|
Alert,
|
|
5
11
|
AlertDescription,
|
|
@@ -8,37 +14,130 @@ import {
|
|
|
8
14
|
|
|
9
15
|
const meta = {
|
|
10
16
|
title: "Component/Alert",
|
|
11
|
-
|
|
17
|
+
component: Alert,
|
|
18
|
+
parameters: {
|
|
19
|
+
docs: {
|
|
20
|
+
page: () => (
|
|
21
|
+
<>
|
|
22
|
+
<Title />
|
|
23
|
+
<Primary />
|
|
24
|
+
<Controls />
|
|
25
|
+
</>
|
|
26
|
+
),
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
argTypes: {
|
|
30
|
+
variant: {
|
|
31
|
+
control: "select",
|
|
32
|
+
options: ["critical", "warning", "info", "neutral", "success"],
|
|
33
|
+
},
|
|
34
|
+
vivid: {
|
|
35
|
+
control: "boolean",
|
|
36
|
+
},
|
|
37
|
+
icon: {
|
|
38
|
+
control: "boolean",
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
args: {
|
|
42
|
+
variant: "info",
|
|
43
|
+
vivid: false,
|
|
44
|
+
icon: true,
|
|
45
|
+
},
|
|
46
|
+
} satisfies Meta<typeof Alert>;
|
|
12
47
|
export default meta;
|
|
13
48
|
|
|
14
49
|
type Story = StoryObj<typeof meta>;
|
|
15
50
|
|
|
51
|
+
export const Default = {
|
|
52
|
+
tags: ["!dev"],
|
|
53
|
+
render: ({ variant, vivid, icon = true }) => (
|
|
54
|
+
<Alert variant={variant} vivid={vivid} icon={icon}>
|
|
55
|
+
<InfoIcon />
|
|
56
|
+
<AlertTitle>Alert Title</AlertTitle>
|
|
57
|
+
<AlertDescription>
|
|
58
|
+
This is an alert description with some helpful information.
|
|
59
|
+
</AlertDescription>
|
|
60
|
+
</Alert>
|
|
61
|
+
),
|
|
62
|
+
} satisfies Story;
|
|
63
|
+
|
|
16
64
|
export const Demo = {
|
|
65
|
+
tags: ["!autodocs"],
|
|
17
66
|
render: () => (
|
|
18
|
-
<div className="grid w-full max-w-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
<
|
|
67
|
+
<div className="grid grid-cols-2 w-full max-w-4xl items-start gap-4">
|
|
68
|
+
{/* Default variants */}
|
|
69
|
+
<Alert variant="critical">
|
|
70
|
+
<CircleXIcon />
|
|
22
71
|
<AlertDescription>
|
|
23
|
-
|
|
72
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
|
|
73
|
+
eiusmod tempor incididunt ut labore et dolore magna aliqua. Learn more
|
|
24
74
|
</AlertDescription>
|
|
25
75
|
</Alert>
|
|
26
|
-
<Alert>
|
|
27
|
-
<
|
|
28
|
-
<
|
|
29
|
-
|
|
30
|
-
|
|
76
|
+
<Alert variant="critical" vivid>
|
|
77
|
+
<CircleXIcon />
|
|
78
|
+
<AlertDescription>
|
|
79
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
|
|
80
|
+
eiusmod tempor incididunt ut labore et dolore magna aliqua. Learn more
|
|
81
|
+
</AlertDescription>
|
|
31
82
|
</Alert>
|
|
32
|
-
|
|
83
|
+
|
|
84
|
+
<Alert variant="warning">
|
|
33
85
|
<AlertCircleIcon />
|
|
34
|
-
<
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
86
|
+
<AlertDescription>
|
|
87
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
|
|
88
|
+
eiusmod tempor incididunt ut labore et dolore magna aliqua. Learn more
|
|
89
|
+
</AlertDescription>
|
|
90
|
+
</Alert>
|
|
91
|
+
<Alert variant="warning" vivid>
|
|
92
|
+
<AlertCircleIcon />
|
|
93
|
+
<AlertDescription>
|
|
94
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
|
|
95
|
+
eiusmod tempor incididunt ut labore et dolore magna aliqua. Learn more
|
|
96
|
+
</AlertDescription>
|
|
97
|
+
</Alert>
|
|
98
|
+
|
|
99
|
+
<Alert variant="info">
|
|
100
|
+
<InfoIcon />
|
|
101
|
+
<AlertDescription>
|
|
102
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
|
|
103
|
+
eiusmod tempor incididunt ut labore et dolore magna aliqua. Learn more
|
|
104
|
+
</AlertDescription>
|
|
105
|
+
</Alert>
|
|
106
|
+
<Alert variant="info" vivid>
|
|
107
|
+
<InfoIcon />
|
|
108
|
+
<AlertDescription>
|
|
109
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
|
|
110
|
+
eiusmod tempor incididunt ut labore et dolore magna aliqua. Learn more
|
|
111
|
+
</AlertDescription>
|
|
112
|
+
</Alert>
|
|
113
|
+
|
|
114
|
+
<Alert variant="neutral">
|
|
115
|
+
<InfoIcon />
|
|
116
|
+
<AlertDescription>
|
|
117
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
|
|
118
|
+
eiusmod tempor incididunt ut labore et dolore magna aliqua. Learn more
|
|
119
|
+
</AlertDescription>
|
|
120
|
+
</Alert>
|
|
121
|
+
<Alert variant="neutral" vivid>
|
|
122
|
+
<InfoIcon />
|
|
123
|
+
<AlertDescription>
|
|
124
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
|
|
125
|
+
eiusmod tempor incididunt ut labore et dolore magna aliqua. Learn more
|
|
126
|
+
</AlertDescription>
|
|
127
|
+
</Alert>
|
|
128
|
+
|
|
129
|
+
<Alert variant="success">
|
|
130
|
+
<CheckIcon />
|
|
131
|
+
<AlertDescription>
|
|
132
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
|
|
133
|
+
eiusmod tempor incididunt ut labore et dolore magna aliqua. Learn more
|
|
134
|
+
</AlertDescription>
|
|
135
|
+
</Alert>
|
|
136
|
+
<Alert variant="success" vivid>
|
|
137
|
+
<CheckIcon />
|
|
138
|
+
<AlertDescription>
|
|
139
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
|
|
140
|
+
eiusmod tempor incididunt ut labore et dolore magna aliqua. Learn more
|
|
42
141
|
</AlertDescription>
|
|
43
142
|
</Alert>
|
|
44
143
|
</div>
|
|
@@ -1,36 +1,139 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type * as React from "react";
|
|
1
|
+
import * as React from "react";
|
|
3
2
|
|
|
4
3
|
import { cn } from "#shadcn/lib/utils";
|
|
5
4
|
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
5
|
+
const baseAlertStyles = cn(
|
|
6
|
+
// Layout
|
|
7
|
+
"relative",
|
|
8
|
+
"w-full",
|
|
9
|
+
"flex",
|
|
10
|
+
"items-start",
|
|
11
|
+
"gap-[var(--spacing-x1,8px)]",
|
|
12
|
+
// Shape
|
|
13
|
+
"rounded-[var(--corner-corner-m,6px)]",
|
|
14
|
+
// Spacing
|
|
15
|
+
"p-[var(--spacing-x2,16px)]",
|
|
16
|
+
// Typography
|
|
17
|
+
"typo-body",
|
|
18
|
+
// SVG styles
|
|
19
|
+
"[&>svg]:size-5",
|
|
20
|
+
"[&>svg]:shrink-0",
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
const alertContentStyles = cn(
|
|
24
|
+
// Layout
|
|
25
|
+
"flex",
|
|
26
|
+
"flex-col",
|
|
27
|
+
"gap-[var(--spacing-x1,8px)]",
|
|
28
|
+
"flex-1",
|
|
29
|
+
"min-w-0",
|
|
20
30
|
);
|
|
21
31
|
|
|
32
|
+
const variantStyles = {
|
|
33
|
+
critical: {
|
|
34
|
+
default: cn(
|
|
35
|
+
"bg-bg-error-primary",
|
|
36
|
+
"text-text-error-primary",
|
|
37
|
+
"[&>svg]:text-fg-error-primary",
|
|
38
|
+
),
|
|
39
|
+
vivid: cn(
|
|
40
|
+
"bg-bg-error-primary_inverse",
|
|
41
|
+
"text-text-primary_on-brand",
|
|
42
|
+
"[&>svg]:text-fg-primary_on-brand",
|
|
43
|
+
),
|
|
44
|
+
},
|
|
45
|
+
warning: {
|
|
46
|
+
default: cn(
|
|
47
|
+
"bg-bg-warning-primary",
|
|
48
|
+
"text-text-warning-primary",
|
|
49
|
+
"[&>svg]:text-fg-warning-primary",
|
|
50
|
+
),
|
|
51
|
+
vivid: cn(
|
|
52
|
+
"bg-bg-warning-primary_inverse",
|
|
53
|
+
"text-text-warning-primary",
|
|
54
|
+
"[&>svg]:text-fg-warning-primary",
|
|
55
|
+
),
|
|
56
|
+
},
|
|
57
|
+
info: {
|
|
58
|
+
default: cn(
|
|
59
|
+
"bg-bg-info-primary",
|
|
60
|
+
"text-text-info-primary",
|
|
61
|
+
"[&>svg]:text-fg-info-primary",
|
|
62
|
+
),
|
|
63
|
+
vivid: cn(
|
|
64
|
+
"bg-bg-info-primary_inverse",
|
|
65
|
+
"text-text-primary_on-brand",
|
|
66
|
+
"[&>svg]:text-fg-primary_on-brand",
|
|
67
|
+
),
|
|
68
|
+
},
|
|
69
|
+
neutral: {
|
|
70
|
+
default: cn(
|
|
71
|
+
"bg-bg-neutral-primary",
|
|
72
|
+
"text-text-primary",
|
|
73
|
+
"[&>svg]:text-fg-neutral-primary",
|
|
74
|
+
),
|
|
75
|
+
vivid: cn(
|
|
76
|
+
"bg-bg-neutral-primary_inverse",
|
|
77
|
+
"text-text-primary_on-brand",
|
|
78
|
+
"[&>svg]:text-fg-primary_on-brand",
|
|
79
|
+
),
|
|
80
|
+
},
|
|
81
|
+
success: {
|
|
82
|
+
default: cn(
|
|
83
|
+
"bg-bg-success-secondary",
|
|
84
|
+
"text-text-primary",
|
|
85
|
+
"[&>svg]:text-fg-success-primary",
|
|
86
|
+
),
|
|
87
|
+
vivid: cn(
|
|
88
|
+
"bg-bg-success-primary_inverse",
|
|
89
|
+
"text-text-primary_on-brand",
|
|
90
|
+
"[&>svg]:text-fg-primary_on-brand",
|
|
91
|
+
),
|
|
92
|
+
},
|
|
93
|
+
} as const;
|
|
94
|
+
|
|
95
|
+
type AlertVariant = keyof typeof variantStyles;
|
|
96
|
+
|
|
22
97
|
function Alert({
|
|
23
98
|
className,
|
|
24
|
-
variant,
|
|
99
|
+
variant = "info",
|
|
100
|
+
vivid = false,
|
|
101
|
+
icon = true,
|
|
102
|
+
children,
|
|
25
103
|
...props
|
|
26
|
-
}: React.ComponentProps<"div"> &
|
|
104
|
+
}: React.ComponentProps<"div"> & {
|
|
105
|
+
variant?: AlertVariant | undefined;
|
|
106
|
+
vivid?: boolean | undefined;
|
|
107
|
+
icon?: boolean | undefined;
|
|
108
|
+
}) {
|
|
109
|
+
const childrenArray = React.Children.toArray(children);
|
|
110
|
+
|
|
111
|
+
// Find first child that is not AlertTitle or AlertDescription (assumed to be icon)
|
|
112
|
+
const iconIndex = childrenArray.findIndex(
|
|
113
|
+
(child) =>
|
|
114
|
+
React.isValidElement(child) &&
|
|
115
|
+
child.type !== AlertTitle &&
|
|
116
|
+
child.type !== AlertDescription,
|
|
117
|
+
);
|
|
118
|
+
|
|
119
|
+
const hasIcon = icon && iconIndex !== -1;
|
|
120
|
+
const iconElement = hasIcon ? childrenArray[iconIndex] : null;
|
|
121
|
+
const content = hasIcon
|
|
122
|
+
? childrenArray.filter((_, index) => index !== iconIndex)
|
|
123
|
+
: childrenArray;
|
|
124
|
+
|
|
125
|
+
const variantStyle = variantStyles[variant][vivid ? "vivid" : "default"];
|
|
126
|
+
|
|
27
127
|
return (
|
|
28
128
|
<div
|
|
29
129
|
data-slot="alert"
|
|
30
130
|
role="alert"
|
|
31
|
-
className={cn(
|
|
131
|
+
className={cn(baseAlertStyles, variantStyle, className)}
|
|
32
132
|
{...props}
|
|
33
|
-
|
|
133
|
+
>
|
|
134
|
+
{iconElement}
|
|
135
|
+
<div className={alertContentStyles}>{content}</div>
|
|
136
|
+
</div>
|
|
34
137
|
);
|
|
35
138
|
}
|
|
36
139
|
|
|
@@ -38,10 +141,7 @@ function AlertTitle({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
38
141
|
return (
|
|
39
142
|
<div
|
|
40
143
|
data-slot="alert-title"
|
|
41
|
-
className={cn(
|
|
42
|
-
"col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",
|
|
43
|
-
className,
|
|
44
|
-
)}
|
|
144
|
+
className={cn("typo-body", "font-medium", className)}
|
|
45
145
|
{...props}
|
|
46
146
|
/>
|
|
47
147
|
);
|
|
@@ -54,10 +154,7 @@ function AlertDescription({
|
|
|
54
154
|
return (
|
|
55
155
|
<div
|
|
56
156
|
data-slot="alert-description"
|
|
57
|
-
className={cn(
|
|
58
|
-
"text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",
|
|
59
|
-
className,
|
|
60
|
-
)}
|
|
157
|
+
className={cn("typo-body", className)}
|
|
61
158
|
{...props}
|
|
62
159
|
/>
|
|
63
160
|
);
|
|
@@ -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
|
Avatar,
|
|
@@ -5,20 +6,85 @@ import {
|
|
|
5
6
|
AvatarImage,
|
|
6
7
|
} from "#shadcn/components/ui/avatar";
|
|
7
8
|
|
|
9
|
+
interface AvatarWrapperProps {
|
|
10
|
+
shape?: "circle" | "square";
|
|
11
|
+
hasImage?: boolean;
|
|
12
|
+
fallback?: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function AvatarWrapper({
|
|
16
|
+
shape = "circle",
|
|
17
|
+
hasImage = true,
|
|
18
|
+
fallback = "CN",
|
|
19
|
+
}: AvatarWrapperProps) {
|
|
20
|
+
return (
|
|
21
|
+
<Avatar
|
|
22
|
+
key={`${hasImage}`}
|
|
23
|
+
className={shape === "square" ? "rounded-lg" : undefined}
|
|
24
|
+
>
|
|
25
|
+
{hasImage && (
|
|
26
|
+
<AvatarImage src="https://github.com/shadcn.png" alt="@shadcn" />
|
|
27
|
+
)}
|
|
28
|
+
<AvatarFallback>{fallback}</AvatarFallback>
|
|
29
|
+
</Avatar>
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
8
33
|
const meta = {
|
|
9
34
|
title: "Component/Avatar",
|
|
10
|
-
|
|
35
|
+
component: AvatarWrapper,
|
|
36
|
+
parameters: {
|
|
37
|
+
layout: "centered",
|
|
38
|
+
docs: {
|
|
39
|
+
page: () => (
|
|
40
|
+
<>
|
|
41
|
+
<Title />
|
|
42
|
+
<Primary />
|
|
43
|
+
<Controls />
|
|
44
|
+
</>
|
|
45
|
+
),
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
argTypes: {
|
|
49
|
+
shape: {
|
|
50
|
+
control: "select",
|
|
51
|
+
options: ["circle", "square"],
|
|
52
|
+
},
|
|
53
|
+
hasImage: {
|
|
54
|
+
control: "boolean",
|
|
55
|
+
},
|
|
56
|
+
fallback: {
|
|
57
|
+
control: "text",
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
args: {
|
|
61
|
+
shape: "circle",
|
|
62
|
+
hasImage: true,
|
|
63
|
+
fallback: "CN",
|
|
64
|
+
},
|
|
65
|
+
} satisfies Meta<typeof AvatarWrapper>;
|
|
11
66
|
export default meta;
|
|
12
67
|
|
|
13
68
|
type Story = StoryObj<typeof meta>;
|
|
14
69
|
|
|
70
|
+
export const Default = {
|
|
71
|
+
tags: ["!dev"],
|
|
72
|
+
render: ({ shape = "circle", hasImage = true, fallback = "CN" }) => (
|
|
73
|
+
<AvatarWrapper shape={shape} hasImage={hasImage} fallback={fallback} />
|
|
74
|
+
),
|
|
75
|
+
} satisfies Story;
|
|
76
|
+
|
|
15
77
|
export const Demo = {
|
|
78
|
+
tags: ["!autodocs"],
|
|
16
79
|
render: () => (
|
|
17
80
|
<div className="flex flex-row flex-wrap items-center gap-12">
|
|
81
|
+
{/* With image - circle */}
|
|
18
82
|
<Avatar>
|
|
19
83
|
<AvatarImage src="https://github.com/shadcn.png" alt="@shadcn" />
|
|
20
84
|
<AvatarFallback>CN</AvatarFallback>
|
|
21
85
|
</Avatar>
|
|
86
|
+
|
|
87
|
+
{/* With image - square */}
|
|
22
88
|
<Avatar className="rounded-lg">
|
|
23
89
|
<AvatarImage
|
|
24
90
|
src="https://github.com/evilrabbit.png"
|
|
@@ -26,6 +92,13 @@ export const Demo = {
|
|
|
26
92
|
/>
|
|
27
93
|
<AvatarFallback>ER</AvatarFallback>
|
|
28
94
|
</Avatar>
|
|
95
|
+
|
|
96
|
+
{/* Fallback only */}
|
|
97
|
+
<Avatar>
|
|
98
|
+
<AvatarFallback>KB</AvatarFallback>
|
|
99
|
+
</Avatar>
|
|
100
|
+
|
|
101
|
+
{/* Stacked avatars */}
|
|
29
102
|
<div className="*:data-[slot=avatar]:ring-background flex -space-x-2 *:data-[slot=avatar]:ring-2 *:data-[slot=avatar]:grayscale">
|
|
30
103
|
<Avatar>
|
|
31
104
|
<AvatarImage src="https://github.com/shadcn.png" alt="@shadcn" />
|
|
@@ -3,6 +3,15 @@ import type * as React from "react";
|
|
|
3
3
|
|
|
4
4
|
import { cn } from "#shadcn/lib/utils";
|
|
5
5
|
|
|
6
|
+
const avatarStyles = cn(
|
|
7
|
+
"relative",
|
|
8
|
+
"flex",
|
|
9
|
+
"size-8",
|
|
10
|
+
"shrink-0",
|
|
11
|
+
"overflow-hidden",
|
|
12
|
+
"rounded-full",
|
|
13
|
+
);
|
|
14
|
+
|
|
6
15
|
function Avatar({
|
|
7
16
|
className,
|
|
8
17
|
...props
|
|
@@ -10,10 +19,7 @@ function Avatar({
|
|
|
10
19
|
return (
|
|
11
20
|
<AvatarPrimitive.Root
|
|
12
21
|
data-slot="avatar"
|
|
13
|
-
className={cn(
|
|
14
|
-
"relative flex size-8 shrink-0 overflow-hidden rounded-full",
|
|
15
|
-
className,
|
|
16
|
-
)}
|
|
22
|
+
className={cn(avatarStyles, className)}
|
|
17
23
|
{...props}
|
|
18
24
|
/>
|
|
19
25
|
);
|
|
@@ -26,7 +32,7 @@ function AvatarImage({
|
|
|
26
32
|
return (
|
|
27
33
|
<AvatarPrimitive.Image
|
|
28
34
|
data-slot="avatar-image"
|
|
29
|
-
className={cn("aspect-square size-full", className)}
|
|
35
|
+
className={cn("aspect-square", "size-full", className)}
|
|
30
36
|
{...props}
|
|
31
37
|
/>
|
|
32
38
|
);
|
|
@@ -40,7 +46,17 @@ function AvatarFallback({
|
|
|
40
46
|
<AvatarPrimitive.Fallback
|
|
41
47
|
data-slot="avatar-fallback"
|
|
42
48
|
className={cn(
|
|
43
|
-
"bg-
|
|
49
|
+
"bg-bg-tertiary",
|
|
50
|
+
"text-text-secondary",
|
|
51
|
+
"flex",
|
|
52
|
+
"size-full",
|
|
53
|
+
"items-center",
|
|
54
|
+
"justify-center",
|
|
55
|
+
"rounded-full",
|
|
56
|
+
"transition-colors",
|
|
57
|
+
"cursor-pointer",
|
|
58
|
+
"hover:bg-bg-dark_tertiary",
|
|
59
|
+
"hover:text-text-primary_on-brand",
|
|
44
60
|
className,
|
|
45
61
|
)}
|
|
46
62
|
{...props}
|
|
@@ -4,26 +4,75 @@ import type * as React from "react";
|
|
|
4
4
|
|
|
5
5
|
import { cn } from "#shadcn/lib/utils";
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
7
|
+
// Base badge styles
|
|
8
|
+
const baseBadgeStyles = cn(
|
|
9
|
+
// Layout
|
|
10
|
+
"inline-flex",
|
|
11
|
+
"items-center",
|
|
12
|
+
"justify-center",
|
|
13
|
+
"w-fit",
|
|
14
|
+
"whitespace-nowrap",
|
|
15
|
+
"shrink-0",
|
|
16
|
+
"gap-1",
|
|
17
|
+
"overflow-hidden",
|
|
18
|
+
// Shape
|
|
19
|
+
"rounded-md",
|
|
20
|
+
// Borders
|
|
21
|
+
"border",
|
|
22
|
+
// Spacing
|
|
23
|
+
"px-2",
|
|
24
|
+
"py-0.5",
|
|
25
|
+
// Typography
|
|
26
|
+
"text-xs",
|
|
27
|
+
"font-medium",
|
|
28
|
+
// SVG
|
|
29
|
+
"[&>svg]:size-3",
|
|
30
|
+
"[&>svg]:pointer-events-none",
|
|
31
|
+
// Transitions
|
|
32
|
+
"transition-[color,box-shadow]",
|
|
33
|
+
// Focus
|
|
34
|
+
"focus-visible:ring-2",
|
|
35
|
+
"focus-visible:ring-utility-blue/70",
|
|
36
|
+
// Invalid
|
|
37
|
+
"aria-invalid:ring-2",
|
|
38
|
+
"aria-invalid:ring-utility-red/70",
|
|
39
|
+
"aria-invalid:border-border-error",
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
const badgeVariants = cva(baseBadgeStyles, {
|
|
43
|
+
variants: {
|
|
44
|
+
variant: {
|
|
45
|
+
default: cn(
|
|
46
|
+
"border-transparent",
|
|
47
|
+
"bg-bg-link",
|
|
48
|
+
"text-text-primary_on-brand",
|
|
49
|
+
"[a&]:hover:bg-bg-link_hover",
|
|
50
|
+
),
|
|
51
|
+
secondary: cn(
|
|
52
|
+
"border-transparent",
|
|
53
|
+
"bg-bg-secondary",
|
|
54
|
+
"text-text-secondary",
|
|
55
|
+
"[a&]:hover:bg-bg-tertiary",
|
|
56
|
+
),
|
|
57
|
+
destructive: cn(
|
|
58
|
+
"border-transparent",
|
|
59
|
+
"bg-bg-error-primary_inverse",
|
|
60
|
+
"text-text-primary_on-brand",
|
|
61
|
+
"[a&]:hover:bg-bg-error-primary_inverse_hover",
|
|
62
|
+
"focus-visible:ring-utility-red/70",
|
|
63
|
+
),
|
|
64
|
+
outline: cn(
|
|
65
|
+
"text-text-primary",
|
|
66
|
+
"border-border-primary",
|
|
67
|
+
"[a&]:hover:bg-bg-secondary",
|
|
68
|
+
"[a&]:hover:text-text-primary",
|
|
69
|
+
),
|
|
24
70
|
},
|
|
25
71
|
},
|
|
26
|
-
|
|
72
|
+
defaultVariants: {
|
|
73
|
+
variant: "default",
|
|
74
|
+
},
|
|
75
|
+
});
|
|
27
76
|
|
|
28
77
|
function Badge({
|
|
29
78
|
className,
|