@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
|
Calculator,
|
|
@@ -18,52 +19,196 @@ import {
|
|
|
18
19
|
CommandShortcut,
|
|
19
20
|
} from "#shadcn/components/ui/command";
|
|
20
21
|
|
|
22
|
+
interface CommandWrapperProps {
|
|
23
|
+
leftIcons?: boolean;
|
|
24
|
+
rightIcons?: boolean;
|
|
25
|
+
groups?: boolean;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function CommandWrapper({
|
|
29
|
+
leftIcons = true,
|
|
30
|
+
rightIcons = true,
|
|
31
|
+
groups = true,
|
|
32
|
+
}: CommandWrapperProps) {
|
|
33
|
+
const items1 = [
|
|
34
|
+
{ icon: Calendar, label: "Calendar", shortcut: "⌘C" },
|
|
35
|
+
{ icon: Smile, label: "Search Emoji", shortcut: "⌘E" },
|
|
36
|
+
{ icon: Calculator, label: "Calculator", shortcut: "⌘K" },
|
|
37
|
+
];
|
|
38
|
+
|
|
39
|
+
const items2 = [
|
|
40
|
+
{ icon: User, label: "Profile", shortcut: "⌘P" },
|
|
41
|
+
{ icon: CreditCard, label: "Billing", shortcut: "⌘B" },
|
|
42
|
+
{ icon: Settings, label: "Settings", shortcut: "⌘S" },
|
|
43
|
+
];
|
|
44
|
+
|
|
45
|
+
const renderItem = (item: (typeof items1)[0]) => (
|
|
46
|
+
<CommandItem key={item.label}>
|
|
47
|
+
{leftIcons && <item.icon />}
|
|
48
|
+
<span>{item.label}</span>
|
|
49
|
+
{rightIcons && <CommandShortcut>{item.shortcut}</CommandShortcut>}
|
|
50
|
+
</CommandItem>
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
return (
|
|
54
|
+
<Command className="w-[450px] rounded-lg border">
|
|
55
|
+
<CommandInput placeholder="Type a command or search..." />
|
|
56
|
+
<CommandList>
|
|
57
|
+
<CommandEmpty>No results found.</CommandEmpty>
|
|
58
|
+
{groups ? (
|
|
59
|
+
<>
|
|
60
|
+
<CommandGroup heading="Suggestions">
|
|
61
|
+
{items1.map(renderItem)}
|
|
62
|
+
</CommandGroup>
|
|
63
|
+
<CommandSeparator />
|
|
64
|
+
<CommandGroup heading="Settings">
|
|
65
|
+
{items2.map(renderItem)}
|
|
66
|
+
</CommandGroup>
|
|
67
|
+
</>
|
|
68
|
+
) : (
|
|
69
|
+
[...items1, ...items2].map(renderItem)
|
|
70
|
+
)}
|
|
71
|
+
</CommandList>
|
|
72
|
+
</Command>
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
|
|
21
76
|
const meta = {
|
|
22
77
|
title: "Component/Command",
|
|
23
|
-
|
|
78
|
+
component: CommandWrapper,
|
|
79
|
+
parameters: {
|
|
80
|
+
layout: "centered",
|
|
81
|
+
docs: {
|
|
82
|
+
page: () => (
|
|
83
|
+
<>
|
|
84
|
+
<Title />
|
|
85
|
+
<p className="sbdocs-p">
|
|
86
|
+
Command is a composable command menu component. It is also used
|
|
87
|
+
internally by the <strong>Combobox</strong> component for the
|
|
88
|
+
dropdown content.
|
|
89
|
+
</p>
|
|
90
|
+
<Primary />
|
|
91
|
+
<Controls />
|
|
92
|
+
</>
|
|
93
|
+
),
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
argTypes: {
|
|
97
|
+
leftIcons: {
|
|
98
|
+
control: "boolean",
|
|
99
|
+
},
|
|
100
|
+
rightIcons: {
|
|
101
|
+
control: "boolean",
|
|
102
|
+
},
|
|
103
|
+
groups: {
|
|
104
|
+
control: "boolean",
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
args: {
|
|
108
|
+
leftIcons: true,
|
|
109
|
+
rightIcons: true,
|
|
110
|
+
groups: true,
|
|
111
|
+
},
|
|
112
|
+
} satisfies Meta<typeof CommandWrapper>;
|
|
24
113
|
export default meta;
|
|
25
114
|
|
|
26
115
|
type Story = StoryObj<typeof meta>;
|
|
27
116
|
|
|
117
|
+
export const Default = {
|
|
118
|
+
tags: ["!dev"],
|
|
119
|
+
render: ({ leftIcons = true, rightIcons = true, groups = true }) => (
|
|
120
|
+
<CommandWrapper
|
|
121
|
+
leftIcons={leftIcons}
|
|
122
|
+
rightIcons={rightIcons}
|
|
123
|
+
groups={groups}
|
|
124
|
+
/>
|
|
125
|
+
),
|
|
126
|
+
} satisfies Story;
|
|
127
|
+
|
|
28
128
|
export const Demo = {
|
|
129
|
+
tags: ["!autodocs"],
|
|
29
130
|
render: () => (
|
|
30
|
-
<
|
|
31
|
-
|
|
32
|
-
<
|
|
33
|
-
<
|
|
34
|
-
<
|
|
35
|
-
<
|
|
36
|
-
|
|
37
|
-
<
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
<
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
131
|
+
<div className="space-y-8">
|
|
132
|
+
{/* Full */}
|
|
133
|
+
<div>
|
|
134
|
+
<h3 className="typo-label mb-4">With icons and groups</h3>
|
|
135
|
+
<Command className="w-[450px] rounded-lg border">
|
|
136
|
+
<CommandInput placeholder="Type a command or search..." />
|
|
137
|
+
<CommandList>
|
|
138
|
+
<CommandEmpty>No results found.</CommandEmpty>
|
|
139
|
+
<CommandGroup heading="Suggestions">
|
|
140
|
+
<CommandItem>
|
|
141
|
+
<Calendar />
|
|
142
|
+
<span>Calendar</span>
|
|
143
|
+
<CommandShortcut>⌘C</CommandShortcut>
|
|
144
|
+
</CommandItem>
|
|
145
|
+
<CommandItem>
|
|
146
|
+
<Smile />
|
|
147
|
+
<span>Search Emoji</span>
|
|
148
|
+
<CommandShortcut>⌘E</CommandShortcut>
|
|
149
|
+
</CommandItem>
|
|
150
|
+
</CommandGroup>
|
|
151
|
+
<CommandSeparator />
|
|
152
|
+
<CommandGroup heading="Settings">
|
|
153
|
+
<CommandItem>
|
|
154
|
+
<User />
|
|
155
|
+
<span>Profile</span>
|
|
156
|
+
<CommandShortcut>⌘P</CommandShortcut>
|
|
157
|
+
</CommandItem>
|
|
158
|
+
<CommandItem>
|
|
159
|
+
<Settings />
|
|
160
|
+
<span>Settings</span>
|
|
161
|
+
<CommandShortcut>⌘S</CommandShortcut>
|
|
162
|
+
</CommandItem>
|
|
163
|
+
</CommandGroup>
|
|
164
|
+
</CommandList>
|
|
165
|
+
</Command>
|
|
166
|
+
</div>
|
|
167
|
+
|
|
168
|
+
{/* Without groups */}
|
|
169
|
+
<div>
|
|
170
|
+
<h3 className="typo-label mb-4">Without groups</h3>
|
|
171
|
+
<Command className="w-[450px] rounded-lg border">
|
|
172
|
+
<CommandInput placeholder="Type a command or search..." />
|
|
173
|
+
<CommandList>
|
|
174
|
+
<CommandEmpty>No results found.</CommandEmpty>
|
|
175
|
+
<CommandItem>
|
|
176
|
+
<Calendar />
|
|
177
|
+
<span>Calendar</span>
|
|
178
|
+
</CommandItem>
|
|
179
|
+
<CommandItem>
|
|
180
|
+
<User />
|
|
181
|
+
<span>Profile</span>
|
|
182
|
+
</CommandItem>
|
|
183
|
+
<CommandItem>
|
|
184
|
+
<Settings />
|
|
185
|
+
<span>Settings</span>
|
|
186
|
+
</CommandItem>
|
|
187
|
+
</CommandList>
|
|
188
|
+
</Command>
|
|
189
|
+
</div>
|
|
190
|
+
|
|
191
|
+
{/* Without icons */}
|
|
192
|
+
<div>
|
|
193
|
+
<h3 className="typo-label mb-4">Without icons</h3>
|
|
194
|
+
<Command className="w-[450px] rounded-lg border">
|
|
195
|
+
<CommandInput placeholder="Type a command or search..." />
|
|
196
|
+
<CommandList>
|
|
197
|
+
<CommandEmpty>No results found.</CommandEmpty>
|
|
198
|
+
<CommandGroup heading="Actions">
|
|
199
|
+
<CommandItem>
|
|
200
|
+
<span>Calendar</span>
|
|
201
|
+
</CommandItem>
|
|
202
|
+
<CommandItem>
|
|
203
|
+
<span>Profile</span>
|
|
204
|
+
</CommandItem>
|
|
205
|
+
<CommandItem>
|
|
206
|
+
<span>Settings</span>
|
|
207
|
+
</CommandItem>
|
|
208
|
+
</CommandGroup>
|
|
209
|
+
</CommandList>
|
|
210
|
+
</Command>
|
|
211
|
+
</div>
|
|
212
|
+
</div>
|
|
68
213
|
),
|
|
69
214
|
} satisfies Story;
|
|
@@ -10,6 +10,208 @@ import {
|
|
|
10
10
|
} from "#shadcn/components/ui/dialog";
|
|
11
11
|
import { cn } from "#shadcn/lib/utils";
|
|
12
12
|
|
|
13
|
+
// Command Root
|
|
14
|
+
const commandStyles = cn(
|
|
15
|
+
// Layout
|
|
16
|
+
"flex",
|
|
17
|
+
"h-full",
|
|
18
|
+
"w-full",
|
|
19
|
+
"flex-col",
|
|
20
|
+
"overflow-hidden",
|
|
21
|
+
"rounded-md",
|
|
22
|
+
// Colors
|
|
23
|
+
"bg-bg-primary",
|
|
24
|
+
"text-text-primary",
|
|
25
|
+
// Group heading styles
|
|
26
|
+
"[&_*[cmdk-group-heading]]:flex",
|
|
27
|
+
"[&_*[cmdk-group-heading]]:items-center",
|
|
28
|
+
"[&_*[cmdk-group-heading]]:h-7",
|
|
29
|
+
"[&_*[cmdk-group-heading]]:px-3",
|
|
30
|
+
"[&_*[cmdk-group-heading]]:py-0",
|
|
31
|
+
"[&_*[cmdk-group-heading]]:typo-label-tiny",
|
|
32
|
+
"[&_*[cmdk-group-heading]]:text-[color:var(--color-text-secondary)]",
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
// Command Dialog
|
|
36
|
+
const commandDialogContentStyles = cn(
|
|
37
|
+
// Layout
|
|
38
|
+
"overflow-hidden",
|
|
39
|
+
"p-0",
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
const commandDialogCommandStyles = cn(
|
|
43
|
+
// Group headings
|
|
44
|
+
"[&_[cmdk-group-heading]]:flex",
|
|
45
|
+
"[&_[cmdk-group-heading]]:items-center",
|
|
46
|
+
"[&_[cmdk-group-heading]]:h-7",
|
|
47
|
+
"[&_[cmdk-group-heading]]:px-3",
|
|
48
|
+
"[&_[cmdk-group-heading]]:py-0",
|
|
49
|
+
"[&_[cmdk-group-heading]]:typo-label-tiny",
|
|
50
|
+
"[&_[cmdk-group-heading]]:text-text-secondary",
|
|
51
|
+
// Groups
|
|
52
|
+
"[&_[cmdk-group]]:p-2",
|
|
53
|
+
"[&_[cmdk-group]]:gap-1",
|
|
54
|
+
"[&_[cmdk-group]]:flex",
|
|
55
|
+
"[&_[cmdk-group]]:flex-col",
|
|
56
|
+
"[&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0",
|
|
57
|
+
// Input wrapper
|
|
58
|
+
"[&_[cmdk-input-wrapper]]:h-12",
|
|
59
|
+
"**:data-[slot=command-input-wrapper]:h-12",
|
|
60
|
+
// Input wrapper SVG
|
|
61
|
+
"[&_[cmdk-input-wrapper]_svg]:h-5",
|
|
62
|
+
"[&_[cmdk-input-wrapper]_svg]:w-5",
|
|
63
|
+
// Input
|
|
64
|
+
"[&_[cmdk-input]]:h-12",
|
|
65
|
+
// Items
|
|
66
|
+
"[&_[cmdk-item]]:px-2",
|
|
67
|
+
"[&_[cmdk-item]]:py-3",
|
|
68
|
+
// Item SVG
|
|
69
|
+
"[&_[cmdk-item]_svg]:h-5",
|
|
70
|
+
"[&_[cmdk-item]_svg]:w-5",
|
|
71
|
+
);
|
|
72
|
+
|
|
73
|
+
// Command Input Wrapper
|
|
74
|
+
const commandInputWrapperStyles = cn(
|
|
75
|
+
// Layout
|
|
76
|
+
"flex",
|
|
77
|
+
"h-9",
|
|
78
|
+
"items-center",
|
|
79
|
+
"gap-2",
|
|
80
|
+
"px-3",
|
|
81
|
+
// Border
|
|
82
|
+
"border-b",
|
|
83
|
+
"border-border-separator",
|
|
84
|
+
// Animation
|
|
85
|
+
"transition-colors",
|
|
86
|
+
"duration-300",
|
|
87
|
+
);
|
|
88
|
+
|
|
89
|
+
// Command Input Icon
|
|
90
|
+
const commandInputIconStyles = cn(
|
|
91
|
+
// Size
|
|
92
|
+
"size-4",
|
|
93
|
+
"shrink-0",
|
|
94
|
+
// Colors
|
|
95
|
+
"text-text-tertiary",
|
|
96
|
+
);
|
|
97
|
+
|
|
98
|
+
// Command Input
|
|
99
|
+
const commandInputStyles = cn(
|
|
100
|
+
// Layout
|
|
101
|
+
"flex",
|
|
102
|
+
"h-10",
|
|
103
|
+
"w-full",
|
|
104
|
+
"rounded-md",
|
|
105
|
+
"py-3",
|
|
106
|
+
// Background
|
|
107
|
+
"bg-transparent",
|
|
108
|
+
// Typography
|
|
109
|
+
"typo-body",
|
|
110
|
+
// Colors
|
|
111
|
+
"text-text-primary",
|
|
112
|
+
"placeholder:text-text-quternary",
|
|
113
|
+
"file:text-text-primary",
|
|
114
|
+
// States
|
|
115
|
+
"outline-hidden",
|
|
116
|
+
"disabled:cursor-not-allowed",
|
|
117
|
+
"disabled:opacity-50",
|
|
118
|
+
);
|
|
119
|
+
|
|
120
|
+
// Command List
|
|
121
|
+
const commandListStyles = cn(
|
|
122
|
+
// Layout
|
|
123
|
+
"max-h-[300px]",
|
|
124
|
+
"scroll-py-1",
|
|
125
|
+
// Overflow
|
|
126
|
+
"overflow-x-hidden",
|
|
127
|
+
"overflow-y-auto",
|
|
128
|
+
"p-2",
|
|
129
|
+
);
|
|
130
|
+
|
|
131
|
+
// Command Empty
|
|
132
|
+
const commandEmptyStyles = cn(
|
|
133
|
+
// Layout
|
|
134
|
+
"py-6",
|
|
135
|
+
"text-center",
|
|
136
|
+
// Typography
|
|
137
|
+
"typo-body",
|
|
138
|
+
// Colors
|
|
139
|
+
"text-text-tertiary",
|
|
140
|
+
);
|
|
141
|
+
|
|
142
|
+
// Command Group
|
|
143
|
+
const commandGroupStyles = cn(
|
|
144
|
+
// Layout
|
|
145
|
+
"overflow-hidden",
|
|
146
|
+
"p-2",
|
|
147
|
+
"gap-1",
|
|
148
|
+
"flex",
|
|
149
|
+
"flex-col",
|
|
150
|
+
"group",
|
|
151
|
+
// Colors
|
|
152
|
+
"text-text-tertiary",
|
|
153
|
+
// Group heading styles
|
|
154
|
+
"[&_*[cmdk-group-heading]]:flex",
|
|
155
|
+
"[&_*[cmdk-group-heading]]:items-center",
|
|
156
|
+
"[&_*[cmdk-group-heading]]:h-7",
|
|
157
|
+
"[&_*[cmdk-group-heading]]:px-3",
|
|
158
|
+
"[&_*[cmdk-group-heading]]:py-0",
|
|
159
|
+
"[&_*[cmdk-group-heading]]:typo-label-tiny",
|
|
160
|
+
"[&_*[cmdk-group-heading]]:text-[var(--color-text-secondary)]",
|
|
161
|
+
);
|
|
162
|
+
|
|
163
|
+
// Command Separator
|
|
164
|
+
const commandSeparatorStyles = cn(
|
|
165
|
+
// Layout
|
|
166
|
+
"-mx-1",
|
|
167
|
+
"h-px",
|
|
168
|
+
// Colors
|
|
169
|
+
"bg-border-separator",
|
|
170
|
+
);
|
|
171
|
+
|
|
172
|
+
// Command Item
|
|
173
|
+
const commandItemStyles = cn(
|
|
174
|
+
// Layout
|
|
175
|
+
"relative",
|
|
176
|
+
"flex",
|
|
177
|
+
"cursor-pointer",
|
|
178
|
+
"items-center",
|
|
179
|
+
"gap-2",
|
|
180
|
+
"rounded",
|
|
181
|
+
"px-2",
|
|
182
|
+
"py-1.5",
|
|
183
|
+
"select-none",
|
|
184
|
+
// Typography
|
|
185
|
+
"typo-body",
|
|
186
|
+
// Colors
|
|
187
|
+
"text-text-primary",
|
|
188
|
+
// States
|
|
189
|
+
"outline-hidden",
|
|
190
|
+
"data-[state=checked]:bg-bg-tertiary",
|
|
191
|
+
"data-[state=checked]:hover:bg-bg-secondary",
|
|
192
|
+
"hover:bg-bg-secondary",
|
|
193
|
+
"hover:text-text-primary",
|
|
194
|
+
"data-[state=checked]:text-text-primary",
|
|
195
|
+
"data-[disabled=true]:pointer-events-none",
|
|
196
|
+
"data-[disabled=true]:opacity-50",
|
|
197
|
+
// SVG styles
|
|
198
|
+
"[&_svg:not([class*='text-'])]:text-text-quaternary",
|
|
199
|
+
"[&_svg]:pointer-events-none",
|
|
200
|
+
"[&_svg]:shrink-0",
|
|
201
|
+
"[&_svg:not([class*='size-'])]:size-4",
|
|
202
|
+
);
|
|
203
|
+
|
|
204
|
+
// Command Shortcut
|
|
205
|
+
const commandShortcutStyles = cn(
|
|
206
|
+
// Layout
|
|
207
|
+
"ml-auto",
|
|
208
|
+
// Typography
|
|
209
|
+
"typo-body",
|
|
210
|
+
"tracking-widest",
|
|
211
|
+
// Colors
|
|
212
|
+
"text-text-quaternary",
|
|
213
|
+
);
|
|
214
|
+
|
|
13
215
|
function Command({
|
|
14
216
|
className,
|
|
15
217
|
...props
|
|
@@ -17,10 +219,7 @@ function Command({
|
|
|
17
219
|
return (
|
|
18
220
|
<CommandPrimitive
|
|
19
221
|
data-slot="command"
|
|
20
|
-
className={cn(
|
|
21
|
-
"bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",
|
|
22
|
-
className,
|
|
23
|
-
)}
|
|
222
|
+
className={cn(commandStyles, className)}
|
|
24
223
|
{...props}
|
|
25
224
|
/>
|
|
26
225
|
);
|
|
@@ -46,12 +245,10 @@ function CommandDialog({
|
|
|
46
245
|
<DialogDescription>{description}</DialogDescription>
|
|
47
246
|
</DialogHeader>
|
|
48
247
|
<DialogContent
|
|
49
|
-
className={cn(
|
|
248
|
+
className={cn(commandDialogContentStyles, className)}
|
|
50
249
|
showCloseButton={showCloseButton}
|
|
51
250
|
>
|
|
52
|
-
<Command className=
|
|
53
|
-
{children}
|
|
54
|
-
</Command>
|
|
251
|
+
<Command className={commandDialogCommandStyles}>{children}</Command>
|
|
55
252
|
</DialogContent>
|
|
56
253
|
</Dialog>
|
|
57
254
|
);
|
|
@@ -59,20 +256,20 @@ function CommandDialog({
|
|
|
59
256
|
|
|
60
257
|
function CommandInput({
|
|
61
258
|
className,
|
|
259
|
+
wrapperClassName,
|
|
62
260
|
...props
|
|
63
|
-
}: React.ComponentProps<typeof CommandPrimitive.Input>
|
|
261
|
+
}: React.ComponentProps<typeof CommandPrimitive.Input> & {
|
|
262
|
+
wrapperClassName?: string;
|
|
263
|
+
}) {
|
|
64
264
|
return (
|
|
65
265
|
<div
|
|
66
266
|
data-slot="command-input-wrapper"
|
|
67
|
-
className=
|
|
267
|
+
className={cn(commandInputWrapperStyles, wrapperClassName)}
|
|
68
268
|
>
|
|
69
|
-
<SearchIcon className=
|
|
269
|
+
<SearchIcon className={commandInputIconStyles} />
|
|
70
270
|
<CommandPrimitive.Input
|
|
71
271
|
data-slot="command-input"
|
|
72
|
-
className={cn(
|
|
73
|
-
"placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",
|
|
74
|
-
className,
|
|
75
|
-
)}
|
|
272
|
+
className={cn(commandInputStyles, className)}
|
|
76
273
|
{...props}
|
|
77
274
|
/>
|
|
78
275
|
</div>
|
|
@@ -86,10 +283,7 @@ function CommandList({
|
|
|
86
283
|
return (
|
|
87
284
|
<CommandPrimitive.List
|
|
88
285
|
data-slot="command-list"
|
|
89
|
-
className={cn(
|
|
90
|
-
"max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",
|
|
91
|
-
className,
|
|
92
|
-
)}
|
|
286
|
+
className={cn(commandListStyles, className)}
|
|
93
287
|
{...props}
|
|
94
288
|
/>
|
|
95
289
|
);
|
|
@@ -101,7 +295,7 @@ function CommandEmpty({
|
|
|
101
295
|
return (
|
|
102
296
|
<CommandPrimitive.Empty
|
|
103
297
|
data-slot="command-empty"
|
|
104
|
-
className=
|
|
298
|
+
className={commandEmptyStyles}
|
|
105
299
|
{...props}
|
|
106
300
|
/>
|
|
107
301
|
);
|
|
@@ -114,10 +308,7 @@ function CommandGroup({
|
|
|
114
308
|
return (
|
|
115
309
|
<CommandPrimitive.Group
|
|
116
310
|
data-slot="command-group"
|
|
117
|
-
className={cn(
|
|
118
|
-
"text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",
|
|
119
|
-
className,
|
|
120
|
-
)}
|
|
311
|
+
className={cn(commandGroupStyles, className)}
|
|
121
312
|
{...props}
|
|
122
313
|
/>
|
|
123
314
|
);
|
|
@@ -130,7 +321,7 @@ function CommandSeparator({
|
|
|
130
321
|
return (
|
|
131
322
|
<CommandPrimitive.Separator
|
|
132
323
|
data-slot="command-separator"
|
|
133
|
-
className={cn(
|
|
324
|
+
className={cn(commandSeparatorStyles, className)}
|
|
134
325
|
{...props}
|
|
135
326
|
/>
|
|
136
327
|
);
|
|
@@ -143,14 +334,7 @@ function CommandItem({
|
|
|
143
334
|
return (
|
|
144
335
|
<CommandPrimitive.Item
|
|
145
336
|
data-slot="command-item"
|
|
146
|
-
className={cn(
|
|
147
|
-
"data-[selected=true]:bg-(--color-surface-1) text-(--color-elements-assistive)",
|
|
148
|
-
"data-[selected=true]:text-(--color-elements-readable) [&_svg:not([class*='text-'])]:text-muted-foreground",
|
|
149
|
-
"relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none",
|
|
150
|
-
"data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none",
|
|
151
|
-
"[&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
152
|
-
className,
|
|
153
|
-
)}
|
|
337
|
+
className={cn(commandItemStyles, className)}
|
|
154
338
|
{...props}
|
|
155
339
|
/>
|
|
156
340
|
);
|
|
@@ -163,10 +347,7 @@ function CommandShortcut({
|
|
|
163
347
|
return (
|
|
164
348
|
<span
|
|
165
349
|
data-slot="command-shortcut"
|
|
166
|
-
className={cn(
|
|
167
|
-
"text-muted-foreground ml-auto text-xs tracking-widest",
|
|
168
|
-
className,
|
|
169
|
-
)}
|
|
350
|
+
className={cn(commandShortcutStyles, className)}
|
|
170
351
|
{...props}
|
|
171
352
|
/>
|
|
172
353
|
);
|