@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,13 +1,105 @@
|
|
|
1
|
+
import { Controls, Primary, Title } from "@storybook/addon-docs/blocks";
|
|
1
2
|
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
3
|
+
import { Label } from "#shadcn/components/ui/label";
|
|
2
4
|
import { Textarea } from "#shadcn/components/ui/textarea";
|
|
3
5
|
|
|
6
|
+
interface TextareaWithLabelProps {
|
|
7
|
+
label?: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
invalid?: boolean;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
placeholder?: string;
|
|
12
|
+
focused?: boolean;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function TextareaWithLabel({
|
|
16
|
+
label = "Description",
|
|
17
|
+
description = "This is a hint text to help user.",
|
|
18
|
+
invalid = false,
|
|
19
|
+
disabled = false,
|
|
20
|
+
placeholder = "Enter a description...",
|
|
21
|
+
focused = false,
|
|
22
|
+
}: TextareaWithLabelProps) {
|
|
23
|
+
const descriptionColor = invalid
|
|
24
|
+
? "text-text-error-primary"
|
|
25
|
+
: disabled
|
|
26
|
+
? "text-text-disabled"
|
|
27
|
+
: "text-text-secondary";
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<div className="flex w-full">
|
|
31
|
+
<div className="space-y-2 w-full">
|
|
32
|
+
<Label>{label}</Label>
|
|
33
|
+
<Textarea
|
|
34
|
+
placeholder={placeholder}
|
|
35
|
+
invalid={invalid}
|
|
36
|
+
disabled={disabled}
|
|
37
|
+
autoFocus={focused}
|
|
38
|
+
/>
|
|
39
|
+
<p className={`typo-body-xs ${descriptionColor}`}>{description}</p>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
|
|
4
45
|
const meta = {
|
|
5
46
|
title: "Component/Textarea",
|
|
6
|
-
|
|
47
|
+
component: Textarea,
|
|
48
|
+
parameters: {
|
|
49
|
+
docs: {
|
|
50
|
+
page: () => (
|
|
51
|
+
<>
|
|
52
|
+
<Title />
|
|
53
|
+
<Primary />
|
|
54
|
+
<Controls />
|
|
55
|
+
</>
|
|
56
|
+
),
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
argTypes: {
|
|
60
|
+
placeholder: {
|
|
61
|
+
control: "text",
|
|
62
|
+
},
|
|
63
|
+
invalid: {
|
|
64
|
+
control: "boolean",
|
|
65
|
+
},
|
|
66
|
+
disabled: {
|
|
67
|
+
control: "boolean",
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
args: {
|
|
71
|
+
placeholder: "Enter a description...",
|
|
72
|
+
invalid: false,
|
|
73
|
+
disabled: false,
|
|
74
|
+
},
|
|
75
|
+
} satisfies Meta<typeof Textarea>;
|
|
7
76
|
export default meta;
|
|
8
77
|
|
|
9
78
|
type Story = StoryObj<typeof meta>;
|
|
10
79
|
|
|
80
|
+
export const Default = {
|
|
81
|
+
tags: ["!dev"],
|
|
82
|
+
render: (args) => <Textarea {...args} />,
|
|
83
|
+
} satisfies Story;
|
|
84
|
+
|
|
11
85
|
export const Demo = {
|
|
12
|
-
|
|
86
|
+
tags: ["!autodocs"],
|
|
87
|
+
render: () => (
|
|
88
|
+
<div className="p-6 space-y-6">
|
|
89
|
+
{/* Default */}
|
|
90
|
+
<TextareaWithLabel />
|
|
91
|
+
|
|
92
|
+
{/* Focused */}
|
|
93
|
+
<TextareaWithLabel focused />
|
|
94
|
+
|
|
95
|
+
{/* Disabled */}
|
|
96
|
+
<TextareaWithLabel disabled />
|
|
97
|
+
|
|
98
|
+
{/* Error */}
|
|
99
|
+
<TextareaWithLabel invalid />
|
|
100
|
+
|
|
101
|
+
{/* Error + Focused */}
|
|
102
|
+
<TextareaWithLabel invalid focused />
|
|
103
|
+
</div>
|
|
104
|
+
),
|
|
13
105
|
} satisfies Story;
|
|
@@ -1,15 +1,80 @@
|
|
|
1
|
+
import { cva, type VariantProps } from "class-variance-authority";
|
|
1
2
|
import type * as React from "react";
|
|
2
3
|
|
|
3
4
|
import { cn } from "#shadcn/lib/utils";
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
const textareaVariants = cva(
|
|
7
|
+
cn(
|
|
8
|
+
// Layout
|
|
9
|
+
"flex",
|
|
10
|
+
"w-full",
|
|
11
|
+
"min-h-16",
|
|
12
|
+
"field-sizing-content",
|
|
13
|
+
// Shape
|
|
14
|
+
"rounded-md",
|
|
15
|
+
// Borders
|
|
16
|
+
"border",
|
|
17
|
+
"border-border-primary",
|
|
18
|
+
// Background & Colors
|
|
19
|
+
"bg-transparent",
|
|
20
|
+
"text-base",
|
|
21
|
+
// Spacing
|
|
22
|
+
"px-3",
|
|
23
|
+
"py-2",
|
|
24
|
+
// Typography
|
|
25
|
+
"md:text-sm",
|
|
26
|
+
// Placeholder
|
|
27
|
+
"placeholder:text-text-tertiary",
|
|
28
|
+
// Transitions
|
|
29
|
+
"transition-all",
|
|
30
|
+
"duration-300",
|
|
31
|
+
"outline-none",
|
|
32
|
+
// Hover
|
|
33
|
+
"hover:border-border-primary_hover",
|
|
34
|
+
// Focus
|
|
35
|
+
"focus-visible:border-border-link",
|
|
36
|
+
// Disabled
|
|
37
|
+
"disabled:cursor-not-allowed",
|
|
38
|
+
"disabled:bg-bg-secondary",
|
|
39
|
+
"disabled:border-border-primary",
|
|
40
|
+
"disabled:text-text-disabled",
|
|
41
|
+
"disabled:placeholder:text-text-disabled",
|
|
42
|
+
),
|
|
43
|
+
{
|
|
44
|
+
variants: {
|
|
45
|
+
invalid: {
|
|
46
|
+
true: cn(
|
|
47
|
+
// Invalid border colors
|
|
48
|
+
"border-border-error",
|
|
49
|
+
"hover:border-border-error_inverse",
|
|
50
|
+
// Invalid focus states
|
|
51
|
+
"focus-visible:ring-4",
|
|
52
|
+
"focus-visible:ring-ring-red",
|
|
53
|
+
"focus-visible:border-border-error",
|
|
54
|
+
// Transitions
|
|
55
|
+
"transition-all",
|
|
56
|
+
"duration-300",
|
|
57
|
+
),
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
defaultVariants: {
|
|
61
|
+
invalid: false,
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
interface TextareaProps
|
|
67
|
+
extends React.ComponentProps<"textarea">,
|
|
68
|
+
VariantProps<typeof textareaVariants> {
|
|
69
|
+
invalid?: boolean;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function Textarea({ className, invalid, ...props }: TextareaProps) {
|
|
6
73
|
return (
|
|
7
74
|
<textarea
|
|
8
75
|
data-slot="textarea"
|
|
9
|
-
className={cn(
|
|
10
|
-
|
|
11
|
-
className,
|
|
12
|
-
)}
|
|
76
|
+
className={cn(textareaVariants({ invalid }), className)}
|
|
77
|
+
aria-invalid={invalid}
|
|
13
78
|
{...props}
|
|
14
79
|
/>
|
|
15
80
|
);
|
|
@@ -1,20 +1,49 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group";
|
|
2
3
|
import type { VariantProps } from "class-variance-authority";
|
|
3
4
|
import * as React from "react";
|
|
4
5
|
import { toggleVariants } from "#shadcn/components/ui/toggle";
|
|
5
6
|
import { cn } from "#shadcn/lib/utils";
|
|
6
7
|
|
|
8
|
+
// Toggle group styles
|
|
9
|
+
const toggleGroupStyles = cn(
|
|
10
|
+
"group/toggle-group",
|
|
11
|
+
"flex",
|
|
12
|
+
"w-fit",
|
|
13
|
+
"items-center",
|
|
14
|
+
"rounded-md",
|
|
15
|
+
"bg-bg-primary",
|
|
16
|
+
"border",
|
|
17
|
+
"border-border-primary",
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
// Toggle group item styles
|
|
21
|
+
const toggleGroupItemStyles = cn(
|
|
22
|
+
"min-w-0",
|
|
23
|
+
"flex-1",
|
|
24
|
+
"shrink-0",
|
|
25
|
+
"rounded-none",
|
|
26
|
+
"shadow-none",
|
|
27
|
+
"first:rounded-l-md",
|
|
28
|
+
"last:rounded-r-md",
|
|
29
|
+
"focus:z-10",
|
|
30
|
+
"focus-visible:z-10",
|
|
31
|
+
// Убираем все границы у элементов внутри группы
|
|
32
|
+
"data-[variant=outline]:border-0",
|
|
33
|
+
// Добавляем правую границу как разделитель (кроме последнего элемента)
|
|
34
|
+
"data-[variant=outline]:[&:not(:last-child)]:border-r",
|
|
35
|
+
"data-[variant=outline]:[&:not(:last-child)]:border-r-border-primary",
|
|
36
|
+
);
|
|
37
|
+
|
|
7
38
|
const ToggleGroupContext = React.createContext<
|
|
8
39
|
VariantProps<typeof toggleVariants>
|
|
9
40
|
>({
|
|
10
|
-
|
|
11
|
-
variant: "default",
|
|
41
|
+
variant: "filled",
|
|
12
42
|
});
|
|
13
43
|
|
|
14
44
|
function ToggleGroup({
|
|
15
45
|
className,
|
|
16
46
|
variant,
|
|
17
|
-
size,
|
|
18
47
|
children,
|
|
19
48
|
...props
|
|
20
49
|
}: React.ComponentProps<typeof ToggleGroupPrimitive.Root> &
|
|
@@ -23,14 +52,10 @@ function ToggleGroup({
|
|
|
23
52
|
<ToggleGroupPrimitive.Root
|
|
24
53
|
data-slot="toggle-group"
|
|
25
54
|
data-variant={variant}
|
|
26
|
-
|
|
27
|
-
className={cn(
|
|
28
|
-
"group/toggle-group flex w-fit items-center rounded-md data-[variant=outline]:shadow-xs",
|
|
29
|
-
className,
|
|
30
|
-
)}
|
|
55
|
+
className={cn(toggleGroupStyles, className)}
|
|
31
56
|
{...props}
|
|
32
57
|
>
|
|
33
|
-
<ToggleGroupContext.Provider value={{ variant
|
|
58
|
+
<ToggleGroupContext.Provider value={{ variant }}>
|
|
34
59
|
{children}
|
|
35
60
|
</ToggleGroupContext.Provider>
|
|
36
61
|
</ToggleGroupPrimitive.Root>
|
|
@@ -41,7 +66,6 @@ function ToggleGroupItem({
|
|
|
41
66
|
className,
|
|
42
67
|
children,
|
|
43
68
|
variant,
|
|
44
|
-
size,
|
|
45
69
|
...props
|
|
46
70
|
}: React.ComponentProps<typeof ToggleGroupPrimitive.Item> &
|
|
47
71
|
VariantProps<typeof toggleVariants>) {
|
|
@@ -51,13 +75,11 @@ function ToggleGroupItem({
|
|
|
51
75
|
<ToggleGroupPrimitive.Item
|
|
52
76
|
data-slot="toggle-group-item"
|
|
53
77
|
data-variant={context.variant || variant}
|
|
54
|
-
data-size={context.size || size}
|
|
55
78
|
className={cn(
|
|
56
79
|
toggleVariants({
|
|
57
80
|
variant: context.variant || variant,
|
|
58
|
-
size: context.size || size,
|
|
59
81
|
}),
|
|
60
|
-
|
|
82
|
+
toggleGroupItemStyles,
|
|
61
83
|
className,
|
|
62
84
|
)}
|
|
63
85
|
{...props}
|
|
@@ -1,18 +1,105 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
-
import {
|
|
2
|
+
import { PanelRight } from "lucide-react";
|
|
3
|
+
import { Badge } from "#shadcn/components/ui/badge";
|
|
3
4
|
import { Toggle } from "#shadcn/components/ui/toggle";
|
|
4
5
|
|
|
5
6
|
const meta = {
|
|
6
7
|
title: "Component/Toggle",
|
|
7
|
-
|
|
8
|
+
component: Toggle,
|
|
9
|
+
parameters: {
|
|
10
|
+
controls: {
|
|
11
|
+
exclude: ["size", "asChild"],
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
argTypes: {
|
|
15
|
+
variant: {
|
|
16
|
+
control: "select",
|
|
17
|
+
options: ["filled", "outline"],
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
args: {
|
|
21
|
+
variant: "filled",
|
|
22
|
+
children: (
|
|
23
|
+
<>
|
|
24
|
+
<PanelRight /> Instance preview
|
|
25
|
+
</>
|
|
26
|
+
),
|
|
27
|
+
"aria-label": "Toggle panel",
|
|
28
|
+
},
|
|
29
|
+
} satisfies Meta<typeof Toggle>;
|
|
8
30
|
export default meta;
|
|
9
31
|
|
|
10
32
|
type Story = StoryObj<typeof meta>;
|
|
11
33
|
|
|
34
|
+
export const WithText = {
|
|
35
|
+
args: {
|
|
36
|
+
children: (
|
|
37
|
+
<>
|
|
38
|
+
<PanelRight /> Instance preview
|
|
39
|
+
</>
|
|
40
|
+
),
|
|
41
|
+
"aria-label": "Toggle panel",
|
|
42
|
+
variant: "filled",
|
|
43
|
+
},
|
|
44
|
+
} satisfies Story;
|
|
45
|
+
|
|
46
|
+
export const IconOnly = {
|
|
47
|
+
args: {
|
|
48
|
+
children: <PanelRight />,
|
|
49
|
+
"aria-label": "Toggle panel",
|
|
50
|
+
},
|
|
51
|
+
} satisfies Story;
|
|
52
|
+
|
|
12
53
|
export const Demo = {
|
|
13
54
|
render: () => (
|
|
14
|
-
<
|
|
15
|
-
<
|
|
16
|
-
|
|
55
|
+
<div className="p-6 min-h-screen flex justify-center items-center">
|
|
56
|
+
<div className="rounded-lg p-6 shadow-sm w-200">
|
|
57
|
+
<div className="flex items-center mb-4 justify-between">
|
|
58
|
+
<div className="w-30 text-center">Variant</div>
|
|
59
|
+
<div className="w-40 text-center text-sm text-text-secondary">
|
|
60
|
+
Default
|
|
61
|
+
</div>
|
|
62
|
+
<div className="w-40 text-center text-sm text-text-secondary">
|
|
63
|
+
Disabled
|
|
64
|
+
</div>
|
|
65
|
+
</div>
|
|
66
|
+
|
|
67
|
+
{(["filled", "outline"] as const).map((variant) => (
|
|
68
|
+
<div className="border-t border-border-separator py-4" key={variant}>
|
|
69
|
+
<div className="flex gap-4 items-center py-2 justify-between">
|
|
70
|
+
<div className="w-30 text-sm text-text-secondary">
|
|
71
|
+
<Badge variant="outline" className="text-xs">
|
|
72
|
+
{variant}
|
|
73
|
+
</Badge>
|
|
74
|
+
</div>
|
|
75
|
+
<div className="w-40 flex gap-3 justify-center items-center">
|
|
76
|
+
<Toggle variant={variant} aria-label="Toggle with text">
|
|
77
|
+
<PanelRight /> Instance preview
|
|
78
|
+
</Toggle>
|
|
79
|
+
<Toggle variant={variant} aria-label="Toggle icon only">
|
|
80
|
+
<PanelRight />
|
|
81
|
+
</Toggle>
|
|
82
|
+
</div>
|
|
83
|
+
<div className="w-40 flex gap-3 justify-center items-center">
|
|
84
|
+
<Toggle
|
|
85
|
+
variant={variant}
|
|
86
|
+
disabled
|
|
87
|
+
aria-label="Toggle with text"
|
|
88
|
+
>
|
|
89
|
+
<PanelRight /> Instance preview
|
|
90
|
+
</Toggle>
|
|
91
|
+
<Toggle
|
|
92
|
+
variant={variant}
|
|
93
|
+
disabled
|
|
94
|
+
aria-label="Toggle icon only"
|
|
95
|
+
>
|
|
96
|
+
<PanelRight />
|
|
97
|
+
</Toggle>
|
|
98
|
+
</div>
|
|
99
|
+
</div>
|
|
100
|
+
</div>
|
|
101
|
+
))}
|
|
102
|
+
</div>
|
|
103
|
+
</div>
|
|
17
104
|
),
|
|
18
105
|
} satisfies Story;
|
|
@@ -1,44 +1,117 @@
|
|
|
1
1
|
import * as TogglePrimitive from "@radix-ui/react-toggle";
|
|
2
2
|
import { cva, type VariantProps } from "class-variance-authority";
|
|
3
|
-
import
|
|
3
|
+
import * 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
|
-
|
|
24
|
-
|
|
7
|
+
// Base toggle styles
|
|
8
|
+
const baseToggleStyles = cn(
|
|
9
|
+
// Layout
|
|
10
|
+
"inline-flex",
|
|
11
|
+
"items-center",
|
|
12
|
+
"justify-center",
|
|
13
|
+
"gap-2",
|
|
14
|
+
"whitespace-nowrap",
|
|
15
|
+
// Shape
|
|
16
|
+
"rounded",
|
|
17
|
+
"h-6",
|
|
18
|
+
"px-2",
|
|
19
|
+
"border",
|
|
20
|
+
"border-transparent",
|
|
21
|
+
// Typography
|
|
22
|
+
"typo-body",
|
|
23
|
+
// Colors
|
|
24
|
+
"bg-bg-primary",
|
|
25
|
+
"text-text-secondary",
|
|
26
|
+
// Interaction
|
|
27
|
+
"outline-none",
|
|
28
|
+
"transition-colors",
|
|
29
|
+
"cursor-pointer",
|
|
30
|
+
// Hover
|
|
31
|
+
"hover:bg-bg-secondary",
|
|
32
|
+
// SVG icons
|
|
33
|
+
"[&_svg]:pointer-events-none",
|
|
34
|
+
"[&_svg:not([class*='size-'])]:size-4",
|
|
35
|
+
"[&_svg]:shrink-0",
|
|
36
|
+
"[&_svg]:text-text-secondary",
|
|
37
|
+
"data-[state=on]:[&_svg]:text-text-primary",
|
|
38
|
+
// Disabled
|
|
39
|
+
"disabled:pointer-events-none",
|
|
40
|
+
"disabled:opacity-50",
|
|
41
|
+
// Focus
|
|
42
|
+
"focus-visible:ring-2",
|
|
43
|
+
"focus-visible:ring-utility-blue/70",
|
|
44
|
+
// Invalid
|
|
45
|
+
"aria-invalid:ring-2",
|
|
46
|
+
"aria-invalid:ring-utility-red/70",
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
const toggleVariants = cva(baseToggleStyles, {
|
|
50
|
+
variants: {
|
|
51
|
+
variant: {
|
|
52
|
+
filled: cn("data-[state=on]:bg-bg-tertiary"),
|
|
53
|
+
outline: cn(
|
|
54
|
+
"data-[state=on]:border-border-separator",
|
|
55
|
+
"data-[state=on]:bg-bg-secondary",
|
|
56
|
+
),
|
|
25
57
|
},
|
|
26
58
|
},
|
|
27
|
-
|
|
59
|
+
defaultVariants: {
|
|
60
|
+
variant: "filled",
|
|
61
|
+
},
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
// Рекурсивно проверяем наличие текста в children
|
|
65
|
+
function hasTextContent(children: React.ReactNode): boolean {
|
|
66
|
+
const childArray = React.Children.toArray(children);
|
|
67
|
+
|
|
68
|
+
for (const child of childArray) {
|
|
69
|
+
// Проверяем строки и числа
|
|
70
|
+
if (typeof child === "string" || typeof child === "number") {
|
|
71
|
+
// Игнорируем пустые строки и пробелы
|
|
72
|
+
if (String(child).trim()) {
|
|
73
|
+
return true;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// Проверяем React элементы (включая фрагменты)
|
|
78
|
+
if (
|
|
79
|
+
React.isValidElement(child) &&
|
|
80
|
+
child.props &&
|
|
81
|
+
typeof child.props === "object" &&
|
|
82
|
+
"children" in child.props
|
|
83
|
+
) {
|
|
84
|
+
if (hasTextContent(child.props.children as React.ReactNode)) {
|
|
85
|
+
return true;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
return false;
|
|
91
|
+
}
|
|
28
92
|
|
|
29
93
|
function Toggle({
|
|
30
94
|
className,
|
|
31
95
|
variant,
|
|
32
|
-
|
|
96
|
+
children,
|
|
33
97
|
...props
|
|
34
98
|
}: React.ComponentProps<typeof TogglePrimitive.Root> &
|
|
35
99
|
VariantProps<typeof toggleVariants>) {
|
|
100
|
+
// Автоматически определяем, есть ли текст помимо иконки
|
|
101
|
+
const hasText = hasTextContent(children);
|
|
102
|
+
|
|
36
103
|
return (
|
|
37
104
|
<TogglePrimitive.Root
|
|
38
105
|
data-slot="toggle"
|
|
39
|
-
className={cn(
|
|
106
|
+
className={cn(
|
|
107
|
+
toggleVariants({ variant }),
|
|
108
|
+
!hasText && "w-6 p-1",
|
|
109
|
+
className,
|
|
110
|
+
)}
|
|
40
111
|
{...props}
|
|
41
|
-
|
|
112
|
+
>
|
|
113
|
+
{children}
|
|
114
|
+
</TogglePrimitive.Root>
|
|
42
115
|
);
|
|
43
116
|
}
|
|
44
117
|
|
|
@@ -1,8 +1,41 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
2
3
|
import type * as React from "react";
|
|
3
4
|
|
|
4
5
|
import { cn } from "#shadcn/lib/utils";
|
|
5
6
|
|
|
7
|
+
// Tooltip content styles
|
|
8
|
+
const tooltipContentStyles = cn(
|
|
9
|
+
// Layout
|
|
10
|
+
"z-50",
|
|
11
|
+
"w-fit",
|
|
12
|
+
"origin-(--radix-tooltip-content-transform-origin)",
|
|
13
|
+
// Shape
|
|
14
|
+
"rounded-md",
|
|
15
|
+
// Background & Colors
|
|
16
|
+
"bg-bg-overlay",
|
|
17
|
+
"text-text-primary_on-brand",
|
|
18
|
+
// Spacing
|
|
19
|
+
"px-3",
|
|
20
|
+
"py-1.5",
|
|
21
|
+
// Typography
|
|
22
|
+
"text-xs",
|
|
23
|
+
"text-balance",
|
|
24
|
+
// Animations - open
|
|
25
|
+
"animate-in",
|
|
26
|
+
"fade-in-0",
|
|
27
|
+
"zoom-in-95",
|
|
28
|
+
// Animations - closed
|
|
29
|
+
"data-[state=closed]:animate-out",
|
|
30
|
+
"data-[state=closed]:fade-out-0",
|
|
31
|
+
"data-[state=closed]:zoom-out-95",
|
|
32
|
+
// Slide animations
|
|
33
|
+
"data-[side=bottom]:slide-in-from-top-2",
|
|
34
|
+
"data-[side=left]:slide-in-from-right-2",
|
|
35
|
+
"data-[side=right]:slide-in-from-left-2",
|
|
36
|
+
"data-[side=top]:slide-in-from-bottom-2",
|
|
37
|
+
);
|
|
38
|
+
|
|
6
39
|
function TooltipProvider({
|
|
7
40
|
delayDuration = 0,
|
|
8
41
|
...props
|
|
@@ -43,14 +76,7 @@ function TooltipContent({
|
|
|
43
76
|
<TooltipPrimitive.Content
|
|
44
77
|
data-slot="tooltip-content"
|
|
45
78
|
sideOffset={sideOffset}
|
|
46
|
-
className={cn(
|
|
47
|
-
"bg-(--color-elements-assistive) text-(--color-elements-readable-inv) animate-in fade-in-0 zoom-in-95",
|
|
48
|
-
"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
|
|
49
|
-
"data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2",
|
|
50
|
-
"data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md",
|
|
51
|
-
"px-3 py-1.5 text-xs text-balance",
|
|
52
|
-
className,
|
|
53
|
-
)}
|
|
79
|
+
className={cn(tooltipContentStyles, className)}
|
|
54
80
|
{...props}
|
|
55
81
|
>
|
|
56
82
|
{children}
|