@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
|
@@ -4,67 +4,163 @@ import type * as React from "react";
|
|
|
4
4
|
|
|
5
5
|
import { cn } from "#shadcn/lib/utils";
|
|
6
6
|
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
7
|
+
const baseButtonStyles = cn(
|
|
8
|
+
// Layout
|
|
9
|
+
"inline-flex",
|
|
10
|
+
"items-center",
|
|
11
|
+
"justify-center",
|
|
12
|
+
"gap-2",
|
|
13
|
+
"whitespace-nowrap",
|
|
14
|
+
"shrink-0",
|
|
15
|
+
// Shape
|
|
16
|
+
"rounded-lg",
|
|
17
|
+
// Interaction
|
|
18
|
+
"transition-all",
|
|
19
|
+
"outline-none",
|
|
20
|
+
"cursor-pointer",
|
|
21
|
+
// Disabled states
|
|
22
|
+
"disabled:cursor-not-allowed",
|
|
23
|
+
// Icon styles
|
|
24
|
+
"[&_svg]:pointer-events-none",
|
|
25
|
+
"[&_svg:not([class*='size-'])]:size-4",
|
|
26
|
+
"[&_svg]:shrink-0",
|
|
27
|
+
// Focus states
|
|
28
|
+
// Invalid states
|
|
29
|
+
"aria-invalid:ring-2",
|
|
30
|
+
"aria-invalid:ring-utility-red/70",
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
const buttonVariants = cva(baseButtonStyles, {
|
|
34
|
+
variants: {
|
|
35
|
+
variant: {
|
|
36
|
+
primary: cn(
|
|
37
|
+
"bg-bg-link",
|
|
38
|
+
"text-text-primary_on-brand",
|
|
39
|
+
"hover:bg-bg-link_hover",
|
|
40
|
+
"active:bg-bg-link",
|
|
41
|
+
),
|
|
42
|
+
secondary: cn(
|
|
43
|
+
"border",
|
|
44
|
+
"border-border-primary",
|
|
45
|
+
"bg-bg-primary",
|
|
46
|
+
"text-text-secondary",
|
|
47
|
+
"hover:text-text-primary",
|
|
48
|
+
"hover:bg-bg-secondary",
|
|
49
|
+
"active:bg-bg-primary",
|
|
50
|
+
"active:text-text-tertiary",
|
|
51
|
+
),
|
|
52
|
+
link: cn("text-text-secondary", "hover:text-text-primary", "rounded"),
|
|
53
|
+
ghost: cn(
|
|
54
|
+
"text-text-secondary",
|
|
55
|
+
"hover:text-text-primary",
|
|
56
|
+
"hover:bg-bg-secondary",
|
|
57
|
+
"active:bg-bg-tertiary",
|
|
58
|
+
),
|
|
59
|
+
},
|
|
60
|
+
size: {
|
|
61
|
+
regular: cn("h-9", "px-4", "typo-body"),
|
|
62
|
+
small: cn("h-6", "px-2", "gap-1", "typo-button-label-xs"),
|
|
63
|
+
},
|
|
64
|
+
danger: {
|
|
65
|
+
true: "",
|
|
66
|
+
false: "",
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
compoundVariants: [
|
|
70
|
+
// Primary disabled
|
|
71
|
+
{
|
|
72
|
+
variant: "primary",
|
|
73
|
+
class: cn("disabled:bg-bg-disabled", "disabled:text-white"),
|
|
74
|
+
},
|
|
75
|
+
// Secondary disabled
|
|
76
|
+
{
|
|
77
|
+
variant: "secondary",
|
|
78
|
+
class: cn(
|
|
79
|
+
"disabled:bg-bg-primary",
|
|
80
|
+
"disabled:text-text-disabled",
|
|
81
|
+
"disabled:border-border-disabled",
|
|
82
|
+
),
|
|
83
|
+
},
|
|
84
|
+
// Link disabled
|
|
85
|
+
{
|
|
86
|
+
variant: "link",
|
|
87
|
+
class: cn("disabled:text-text-disabled"),
|
|
88
|
+
},
|
|
89
|
+
// Ghost disabled
|
|
90
|
+
{
|
|
91
|
+
variant: "ghost",
|
|
92
|
+
class: cn("disabled:text-text-disabled"),
|
|
35
93
|
},
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
variant: "primary",
|
|
39
|
-
danger: true,
|
|
40
|
-
class:
|
|
41
|
-
"bg-bg-error-primary_inverse text-text-primary_on-brand hover:bg-bg-error-primary_inverse_hover active:bg-bg-error-primary_inverse disabled:bg-bg-disabled",
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
variant: "secondary",
|
|
45
|
-
danger: true,
|
|
46
|
-
class:
|
|
47
|
-
"border-border-error text-text-error-primary hover:text-text-error-primary_hover hover:bg-bg-error-secondary active:bg-bg-primary active:text-text-error-primary_on-brand",
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
variant: "link",
|
|
51
|
-
danger: true,
|
|
52
|
-
class: "text-text-error-secondary hover:text-text-error-primary",
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
variant: "ghost",
|
|
56
|
-
danger: true,
|
|
57
|
-
class:
|
|
58
|
-
"text-text-error-secondary hover:text-text-error-primary hover:bg-bg-error-secondary active:bg-bg-error-tertiary",
|
|
59
|
-
},
|
|
60
|
-
],
|
|
61
|
-
defaultVariants: {
|
|
94
|
+
// Primary danger
|
|
95
|
+
{
|
|
62
96
|
variant: "primary",
|
|
97
|
+
danger: true,
|
|
98
|
+
class: cn(
|
|
99
|
+
"bg-bg-error-primary_inverse",
|
|
100
|
+
"text-text-primary_on-brand",
|
|
101
|
+
"hover:bg-bg-error-primary_inverse_hover",
|
|
102
|
+
"active:bg-bg-error-primary_inverse",
|
|
103
|
+
),
|
|
104
|
+
},
|
|
105
|
+
// Secondary danger
|
|
106
|
+
{
|
|
107
|
+
variant: "secondary",
|
|
108
|
+
danger: true,
|
|
109
|
+
class: cn(
|
|
110
|
+
"border-border-error",
|
|
111
|
+
"text-text-error-primary",
|
|
112
|
+
"hover:text-text-error-primary",
|
|
113
|
+
"hover:bg-bg-error-secondary",
|
|
114
|
+
"active:bg-bg-primary",
|
|
115
|
+
"active:text-text-error-primary",
|
|
116
|
+
),
|
|
117
|
+
},
|
|
118
|
+
// Link danger
|
|
119
|
+
{
|
|
120
|
+
variant: "link",
|
|
121
|
+
danger: true,
|
|
122
|
+
class: cn("text-text-error-secondary", "hover:text-text-error-primary"),
|
|
123
|
+
},
|
|
124
|
+
// Ghost danger
|
|
125
|
+
{
|
|
126
|
+
variant: "ghost",
|
|
127
|
+
danger: true,
|
|
128
|
+
class: cn(
|
|
129
|
+
"text-text-error-secondary",
|
|
130
|
+
"hover:text-text-error-primary",
|
|
131
|
+
"hover:bg-bg-error-secondary",
|
|
132
|
+
"active:bg-bg-error-tertiary",
|
|
133
|
+
),
|
|
134
|
+
},
|
|
135
|
+
// Focus ring for regular size
|
|
136
|
+
{
|
|
137
|
+
size: "regular",
|
|
138
|
+
danger: false,
|
|
139
|
+
class: cn("focus-visible:ring-4", "focus-visible:ring-ring-blue"),
|
|
140
|
+
},
|
|
141
|
+
{
|
|
63
142
|
size: "regular",
|
|
143
|
+
danger: true,
|
|
144
|
+
class: cn("focus-visible:ring-4", "focus-visible:ring-ring-red"),
|
|
145
|
+
},
|
|
146
|
+
// Focus ring for small size
|
|
147
|
+
{
|
|
148
|
+
size: "small",
|
|
64
149
|
danger: false,
|
|
150
|
+
class: cn("focus-visible:ring-3", "focus-visible:ring-ring-blue"),
|
|
65
151
|
},
|
|
152
|
+
{
|
|
153
|
+
size: "small",
|
|
154
|
+
danger: true,
|
|
155
|
+
class: cn("focus-visible:ring-3", "focus-visible:ring-ring-red"),
|
|
156
|
+
},
|
|
157
|
+
],
|
|
158
|
+
defaultVariants: {
|
|
159
|
+
variant: "primary",
|
|
160
|
+
size: "regular",
|
|
161
|
+
danger: false,
|
|
66
162
|
},
|
|
67
|
-
);
|
|
163
|
+
});
|
|
68
164
|
|
|
69
165
|
function Button({
|
|
70
166
|
className,
|
|
@@ -15,14 +15,28 @@ import { Label } from "#shadcn/components/ui/label";
|
|
|
15
15
|
|
|
16
16
|
const meta = {
|
|
17
17
|
title: "Component/Card",
|
|
18
|
-
|
|
18
|
+
component: Card,
|
|
19
|
+
parameters: {
|
|
20
|
+
layout: "centered",
|
|
21
|
+
},
|
|
22
|
+
argTypes: {
|
|
23
|
+
variant: {
|
|
24
|
+
control: { type: "select" },
|
|
25
|
+
options: ["default", "round", "round-white"],
|
|
26
|
+
description: "Card variant",
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
} satisfies Meta<typeof Card>;
|
|
19
30
|
export default meta;
|
|
20
31
|
|
|
21
32
|
type Story = StoryObj<typeof meta>;
|
|
22
33
|
|
|
23
34
|
export const Demo = {
|
|
24
|
-
|
|
25
|
-
|
|
35
|
+
args: {
|
|
36
|
+
variant: "default",
|
|
37
|
+
},
|
|
38
|
+
render: ({ variant }) => (
|
|
39
|
+
<Card variant={variant || "default"} className="w-full max-w-sm">
|
|
26
40
|
<CardHeader>
|
|
27
41
|
<CardTitle>Login to your account</CardTitle>
|
|
28
42
|
<CardDescription>
|
|
@@ -2,16 +2,73 @@ import type * as React from "react";
|
|
|
2
2
|
|
|
3
3
|
import { cn } from "#shadcn/lib/utils";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// Base card styles
|
|
6
|
+
const baseCardStyles = cn(
|
|
7
|
+
// Layout
|
|
8
|
+
"flex",
|
|
9
|
+
"flex-col",
|
|
10
|
+
"gap-6",
|
|
11
|
+
// Borders
|
|
12
|
+
"border",
|
|
13
|
+
"border-border-primary",
|
|
14
|
+
// Background & Colors
|
|
15
|
+
"bg-bg-primary",
|
|
16
|
+
"text-text-primary",
|
|
17
|
+
// Shadow
|
|
18
|
+
"shadow-sm",
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
// Default card styles
|
|
22
|
+
const defaultCardStyles = cn(
|
|
23
|
+
baseCardStyles,
|
|
24
|
+
// Shape
|
|
25
|
+
"rounded-xl",
|
|
26
|
+
// Spacing
|
|
27
|
+
"py-6",
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
// Round card styles
|
|
31
|
+
const roundCardStyles = cn(
|
|
32
|
+
baseCardStyles,
|
|
33
|
+
// Shape
|
|
34
|
+
"rounded-3xl",
|
|
35
|
+
// Spacing
|
|
36
|
+
"px-8",
|
|
37
|
+
"py-6",
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
// Round white card styles (no border, no shadow)
|
|
41
|
+
const roundWhiteCardStyles = cn(
|
|
42
|
+
// Layout
|
|
43
|
+
"flex",
|
|
44
|
+
"flex-col",
|
|
45
|
+
"gap-6",
|
|
46
|
+
// Background & Colors
|
|
47
|
+
"bg-bg-primary",
|
|
48
|
+
"text-text-primary",
|
|
49
|
+
// Shape
|
|
50
|
+
"rounded-3xl",
|
|
51
|
+
// Spacing
|
|
52
|
+
"px-8",
|
|
53
|
+
"py-6",
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
type CardVariant = "default" | "round" | "round-white";
|
|
57
|
+
|
|
58
|
+
interface CardProps extends React.ComponentProps<"div"> {
|
|
59
|
+
variant?: CardVariant;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function Card({ className, variant = "default", ...props }: CardProps) {
|
|
63
|
+
const variantStyles =
|
|
64
|
+
variant === "round"
|
|
65
|
+
? roundCardStyles
|
|
66
|
+
: variant === "round-white"
|
|
67
|
+
? roundWhiteCardStyles
|
|
68
|
+
: defaultCardStyles;
|
|
69
|
+
|
|
6
70
|
return (
|
|
7
|
-
<div
|
|
8
|
-
data-slot="card"
|
|
9
|
-
className={cn(
|
|
10
|
-
"bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",
|
|
11
|
-
className,
|
|
12
|
-
)}
|
|
13
|
-
{...props}
|
|
14
|
-
/>
|
|
71
|
+
<div data-slot="card" className={cn(variantStyles, className)} {...props} />
|
|
15
72
|
);
|
|
16
73
|
}
|
|
17
74
|
|
|
@@ -20,7 +77,15 @@ function CardHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
20
77
|
<div
|
|
21
78
|
data-slot="card-header"
|
|
22
79
|
className={cn(
|
|
23
|
-
"@container/card-header
|
|
80
|
+
"@container/card-header",
|
|
81
|
+
"grid",
|
|
82
|
+
"auto-rows-min",
|
|
83
|
+
"grid-rows-[auto_auto]",
|
|
84
|
+
"items-start",
|
|
85
|
+
"gap-1.5",
|
|
86
|
+
"px-6",
|
|
87
|
+
"has-data-[slot=card-action]:grid-cols-[1fr_auto]",
|
|
88
|
+
"[.border-b]:pb-6",
|
|
24
89
|
className,
|
|
25
90
|
)}
|
|
26
91
|
{...props}
|
|
@@ -32,7 +97,7 @@ function CardTitle({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
32
97
|
return (
|
|
33
98
|
<div
|
|
34
99
|
data-slot="card-title"
|
|
35
|
-
className={cn("leading-none font-semibold", className)}
|
|
100
|
+
className={cn("leading-none", "font-semibold", className)}
|
|
36
101
|
{...props}
|
|
37
102
|
/>
|
|
38
103
|
);
|
|
@@ -42,7 +107,7 @@ function CardDescription({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
42
107
|
return (
|
|
43
108
|
<div
|
|
44
109
|
data-slot="card-description"
|
|
45
|
-
className={cn("text-
|
|
110
|
+
className={cn("text-text-secondary", "text-sm", className)}
|
|
46
111
|
{...props}
|
|
47
112
|
/>
|
|
48
113
|
);
|
|
@@ -53,7 +118,11 @@ function CardAction({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
53
118
|
<div
|
|
54
119
|
data-slot="card-action"
|
|
55
120
|
className={cn(
|
|
56
|
-
"col-start-2
|
|
121
|
+
"col-start-2",
|
|
122
|
+
"row-span-2",
|
|
123
|
+
"row-start-1",
|
|
124
|
+
"self-start",
|
|
125
|
+
"justify-self-end",
|
|
57
126
|
className,
|
|
58
127
|
)}
|
|
59
128
|
{...props}
|
|
@@ -75,7 +144,13 @@ function CardFooter({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
75
144
|
return (
|
|
76
145
|
<div
|
|
77
146
|
data-slot="card-footer"
|
|
78
|
-
className={cn(
|
|
147
|
+
className={cn(
|
|
148
|
+
"flex",
|
|
149
|
+
"items-center",
|
|
150
|
+
"px-6",
|
|
151
|
+
"[.border-t]:pt-6",
|
|
152
|
+
className,
|
|
153
|
+
)}
|
|
79
154
|
{...props}
|
|
80
155
|
/>
|
|
81
156
|
);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import * as React from "react";
|
|
2
3
|
import * as RechartsPrimitive from "recharts";
|
|
3
4
|
|
|
@@ -67,7 +68,7 @@ function ChartContainer({
|
|
|
67
68
|
);
|
|
68
69
|
}
|
|
69
70
|
|
|
70
|
-
|
|
71
|
+
function ChartStyle({ id, config }: { id: string; config: ChartConfig }) {
|
|
71
72
|
const colorConfig = Object.entries(config).filter(
|
|
72
73
|
([, config]) => config.theme || config.color,
|
|
73
74
|
);
|
|
@@ -99,7 +100,7 @@ ${colorConfig
|
|
|
99
100
|
}}
|
|
100
101
|
/>
|
|
101
102
|
);
|
|
102
|
-
}
|
|
103
|
+
}
|
|
103
104
|
|
|
104
105
|
const ChartTooltip = RechartsPrimitive.Tooltip;
|
|
105
106
|
|
|
@@ -117,7 +118,7 @@ function ChartTooltipContent({
|
|
|
117
118
|
color,
|
|
118
119
|
nameKey,
|
|
119
120
|
labelKey,
|
|
120
|
-
}:
|
|
121
|
+
}: RechartsPrimitive.TooltipContentProps &
|
|
121
122
|
React.ComponentProps<"div"> & {
|
|
122
123
|
hideLabel?: boolean;
|
|
123
124
|
hideIndicator?: boolean;
|
|
@@ -185,7 +186,7 @@ function ChartTooltipContent({
|
|
|
185
186
|
|
|
186
187
|
return (
|
|
187
188
|
<div
|
|
188
|
-
key={item.dataKey}
|
|
189
|
+
key={String(item.dataKey ?? index)}
|
|
189
190
|
className={cn(
|
|
190
191
|
"[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5",
|
|
191
192
|
indicator === "dot" && "items-center",
|
|
@@ -256,7 +257,10 @@ function ChartLegendContent({
|
|
|
256
257
|
verticalAlign = "bottom",
|
|
257
258
|
nameKey,
|
|
258
259
|
}: React.ComponentProps<"div"> &
|
|
259
|
-
Pick<
|
|
260
|
+
Pick<
|
|
261
|
+
RechartsPrimitive.DefaultLegendContentProps,
|
|
262
|
+
"payload" | "verticalAlign"
|
|
263
|
+
> & {
|
|
260
264
|
hideIcon?: boolean;
|
|
261
265
|
nameKey?: string;
|
|
262
266
|
}) {
|
|
@@ -11,39 +11,87 @@ type Story = StoryObj<typeof meta>;
|
|
|
11
11
|
|
|
12
12
|
export const Demo = {
|
|
13
13
|
render: () => (
|
|
14
|
-
<div className="flex
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
<
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
<div className="
|
|
22
|
-
<
|
|
23
|
-
<
|
|
24
|
-
|
|
25
|
-
|
|
14
|
+
<div className="flex gap-12">
|
|
15
|
+
{/* Regular size */}
|
|
16
|
+
<div className="flex flex-col gap-6">
|
|
17
|
+
<div className="flex items-center gap-3">
|
|
18
|
+
<Checkbox id="terms" size="regular" />
|
|
19
|
+
<Label htmlFor="terms">Unchecked</Label>
|
|
20
|
+
</div>
|
|
21
|
+
<div className="flex items-center gap-3">
|
|
22
|
+
<Checkbox id="terms-2" size="regular" defaultChecked />
|
|
23
|
+
<Label htmlFor="terms-2">Checked</Label>
|
|
24
|
+
</div>
|
|
25
|
+
<div className="flex items-center gap-3">
|
|
26
|
+
<Checkbox id="indeterminate" size="regular" checked="indeterminate" />
|
|
27
|
+
<Label htmlFor="indeterminate">Indeterminate</Label>
|
|
28
|
+
</div>
|
|
29
|
+
<div className="flex items-center gap-3">
|
|
30
|
+
<Checkbox id="disabled" size="regular" disabled />
|
|
31
|
+
<Label htmlFor="disabled">Disabled unchecked</Label>
|
|
32
|
+
</div>
|
|
33
|
+
<div className="flex items-center gap-3">
|
|
34
|
+
<Checkbox
|
|
35
|
+
id="disabled-checked"
|
|
36
|
+
size="regular"
|
|
37
|
+
disabled
|
|
38
|
+
defaultChecked
|
|
39
|
+
/>
|
|
40
|
+
<Label htmlFor="disabled-checked">Disabled checked</Label>
|
|
41
|
+
</div>
|
|
42
|
+
<div className="flex items-center gap-3">
|
|
43
|
+
<Checkbox
|
|
44
|
+
id="disabled-indeterminate"
|
|
45
|
+
size="regular"
|
|
46
|
+
disabled
|
|
47
|
+
checked="indeterminate"
|
|
48
|
+
/>
|
|
49
|
+
<Label htmlFor="disabled-indeterminate">Disabled indeterminate</Label>
|
|
26
50
|
</div>
|
|
27
51
|
</div>
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
<
|
|
52
|
+
{/* Small size */}
|
|
53
|
+
<div className="flex flex-col gap-6">
|
|
54
|
+
<div className="flex items-center gap-3">
|
|
55
|
+
<Checkbox id="terms-small" size="small" />
|
|
56
|
+
<Label htmlFor="terms-small">Unchecked</Label>
|
|
57
|
+
</div>
|
|
58
|
+
<div className="flex items-center gap-3">
|
|
59
|
+
<Checkbox id="terms-2-small" size="small" defaultChecked />
|
|
60
|
+
<Label htmlFor="terms-2-small">Checked</Label>
|
|
61
|
+
</div>
|
|
62
|
+
<div className="flex items-center gap-3">
|
|
63
|
+
<Checkbox
|
|
64
|
+
id="indeterminate-small"
|
|
65
|
+
size="small"
|
|
66
|
+
checked="indeterminate"
|
|
67
|
+
/>
|
|
68
|
+
<Label htmlFor="indeterminate-small">Indeterminate</Label>
|
|
69
|
+
</div>
|
|
70
|
+
<div className="flex items-center gap-3">
|
|
71
|
+
<Checkbox id="disabled-small" size="small" disabled />
|
|
72
|
+
<Label htmlFor="disabled-small">Disabled unchecked</Label>
|
|
73
|
+
</div>
|
|
74
|
+
<div className="flex items-center gap-3">
|
|
75
|
+
<Checkbox
|
|
76
|
+
id="disabled-checked-small"
|
|
77
|
+
size="small"
|
|
78
|
+
disabled
|
|
79
|
+
defaultChecked
|
|
80
|
+
/>
|
|
81
|
+
<Label htmlFor="disabled-checked-small">Disabled checked</Label>
|
|
82
|
+
</div>
|
|
83
|
+
<div className="flex items-center gap-3">
|
|
84
|
+
<Checkbox
|
|
85
|
+
id="disabled-indeterminate-small"
|
|
86
|
+
size="small"
|
|
87
|
+
disabled
|
|
88
|
+
checked="indeterminate"
|
|
89
|
+
/>
|
|
90
|
+
<Label htmlFor="disabled-indeterminate-small">
|
|
91
|
+
Disabled indeterminate
|
|
92
|
+
</Label>
|
|
93
|
+
</div>
|
|
31
94
|
</div>
|
|
32
|
-
<Label className="hover:bg-accent/50 flex items-start gap-3 rounded-lg border p-3 has-[[aria-checked=true]]:border-blue-600 has-[[aria-checked=true]]:bg-blue-50 dark:has-[[aria-checked=true]]:border-blue-900 dark:has-[[aria-checked=true]]:bg-blue-950">
|
|
33
|
-
<Checkbox
|
|
34
|
-
id="toggle-2"
|
|
35
|
-
defaultChecked
|
|
36
|
-
className="data-[state=checked]:border-blue-600 data-[state=checked]:bg-blue-600 data-[state=checked]:text-white dark:data-[state=checked]:border-blue-700 dark:data-[state=checked]:bg-blue-700"
|
|
37
|
-
/>
|
|
38
|
-
<div className="grid gap-1.5 font-normal">
|
|
39
|
-
<p className="text-sm leading-none font-medium">
|
|
40
|
-
Enable notifications
|
|
41
|
-
</p>
|
|
42
|
-
<p className="text-muted-foreground text-sm">
|
|
43
|
-
You can enable or disable notifications at any time.
|
|
44
|
-
</p>
|
|
45
|
-
</div>
|
|
46
|
-
</Label>
|
|
47
95
|
</div>
|
|
48
96
|
),
|
|
49
97
|
} satisfies Story;
|