@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,37 +1,122 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Slot } from "@radix-ui/react-slot";
|
|
3
|
-
import { MoreHorizontal } from "lucide-react";
|
|
3
|
+
import { ChevronDownIcon, MoreHorizontal } from "lucide-react";
|
|
4
|
+
import { createContext, useContext } from "react";
|
|
5
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuTrigger } from "./dropdown-menu.js";
|
|
4
6
|
import { cn } from "../../lib/utils.js";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
import { IconButton } from "../../../components/icon-button.js";
|
|
8
|
+
// Styles
|
|
9
|
+
const breadcrumbListStyles = cn(// Typography
|
|
10
|
+
"typo-body", "text-text-tertiary", // Layout
|
|
11
|
+
"flex", "flex-wrap", "items-center", "break-words", // Spacing
|
|
12
|
+
"gap-2");
|
|
13
|
+
const breadcrumbItemStyles = cn(// Layout
|
|
14
|
+
"inline-flex", "items-center");
|
|
15
|
+
const breadcrumbLinkBaseStyles = cn(// Typography
|
|
16
|
+
"typo-body", // Layout
|
|
17
|
+
"px-2", "py-1", // Colors
|
|
18
|
+
"bg-bg-tertiary", "text-text-tertiary", "hover:text-text-secondary", // Shape
|
|
19
|
+
"rounded-md", // Interaction
|
|
20
|
+
"transition-colors", "focus-visible:outline-none", "focus-visible:ring-2", "focus-visible:ring-utility-blue/70");
|
|
21
|
+
const breadcrumbLinkWithDropdownStyles = cn(// Shape
|
|
22
|
+
"rounded-l-md", "rounded-r-none");
|
|
23
|
+
const breadcrumbSeparatorStyles = cn(// Size
|
|
24
|
+
"h-4", "w-px", "shrink-0", // Colors
|
|
25
|
+
"bg-border-separator");
|
|
26
|
+
const breadcrumbTriggerContainerStyles = cn(// Layout
|
|
27
|
+
"flex", "items-center", "gap-2", "h-7", "pl-0", "pr-2", "py-1", // Colors
|
|
28
|
+
"bg-bg-tertiary", // Shape
|
|
29
|
+
"rounded-r-md", "rounded-l-none");
|
|
30
|
+
const breadcrumbIconButtonStyles = cn(// Size
|
|
31
|
+
"size-auto", "p-0", // Colors
|
|
32
|
+
"bg-transparent", "hover:bg-transparent", "text-text-tertiary", "hover:text-text-secondary");
|
|
33
|
+
const breadcrumbPageBaseStyles = cn(// Typography
|
|
34
|
+
"typo-page-header", // Layout
|
|
35
|
+
"px-0", "py-0.5", // Colors
|
|
36
|
+
"text-text-primary");
|
|
37
|
+
const breadcrumbPageWhiteStyles = cn(// Colors
|
|
38
|
+
"text-white");
|
|
39
|
+
const breadcrumbSeparatorBaseStyles = cn(// Typography
|
|
40
|
+
"text-xs", "text-text-tertiary", // SVG
|
|
41
|
+
"[&>svg]:size-3.5");
|
|
42
|
+
const breadcrumbEllipsisStyles = cn(// Layout
|
|
43
|
+
"flex", "size-9", "items-center", "justify-center");
|
|
44
|
+
const BreadcrumbContext = /*#__PURE__*/ createContext({});
|
|
45
|
+
function Breadcrumb({ isWhite, ...props }) {
|
|
46
|
+
return /*#__PURE__*/ _jsx(BreadcrumbContext.Provider, {
|
|
47
|
+
value: isWhite !== undefined ? {
|
|
48
|
+
isWhite
|
|
49
|
+
} : {},
|
|
50
|
+
children: /*#__PURE__*/ _jsx("nav", {
|
|
51
|
+
"aria-label": "breadcrumb",
|
|
52
|
+
"data-slot": "breadcrumb",
|
|
53
|
+
...props
|
|
54
|
+
})
|
|
10
55
|
});
|
|
11
56
|
}
|
|
12
57
|
function BreadcrumbList({ className, ...props }) {
|
|
13
58
|
return /*#__PURE__*/ _jsx("ol", {
|
|
14
59
|
"data-slot": "breadcrumb-list",
|
|
15
|
-
className: cn(
|
|
60
|
+
className: cn(breadcrumbListStyles, className),
|
|
16
61
|
...props
|
|
17
62
|
});
|
|
18
63
|
}
|
|
19
64
|
function BreadcrumbItem({ className, ...props }) {
|
|
20
65
|
return /*#__PURE__*/ _jsx("li", {
|
|
21
66
|
"data-slot": "breadcrumb-item",
|
|
22
|
-
className: cn(
|
|
67
|
+
className: cn(breadcrumbItemStyles, className),
|
|
23
68
|
...props
|
|
24
69
|
});
|
|
25
70
|
}
|
|
26
|
-
function BreadcrumbLink({ asChild, className, ...props }) {
|
|
71
|
+
function BreadcrumbLink({ asChild, className, dropdownContent, ...props }) {
|
|
27
72
|
const Comp = asChild ? Slot : "a";
|
|
73
|
+
const linkStyles = cn(breadcrumbLinkBaseStyles, dropdownContent && breadcrumbLinkWithDropdownStyles, className);
|
|
74
|
+
if (dropdownContent) {
|
|
75
|
+
return /*#__PURE__*/ _jsxs("div", {
|
|
76
|
+
className: "inline-flex items-center",
|
|
77
|
+
children: [
|
|
78
|
+
/*#__PURE__*/ _jsx(Comp, {
|
|
79
|
+
"data-slot": "breadcrumb-link",
|
|
80
|
+
className: linkStyles,
|
|
81
|
+
...props
|
|
82
|
+
}),
|
|
83
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
84
|
+
className: breadcrumbTriggerContainerStyles,
|
|
85
|
+
children: [
|
|
86
|
+
/*#__PURE__*/ _jsx("div", {
|
|
87
|
+
className: breadcrumbSeparatorStyles
|
|
88
|
+
}),
|
|
89
|
+
/*#__PURE__*/ _jsxs(DropdownMenu, {
|
|
90
|
+
children: [
|
|
91
|
+
/*#__PURE__*/ _jsx(DropdownMenuTrigger, {
|
|
92
|
+
asChild: true,
|
|
93
|
+
children: /*#__PURE__*/ _jsx(IconButton, {
|
|
94
|
+
icon: /*#__PURE__*/ _jsx(ChevronDownIcon, {
|
|
95
|
+
className: "size-4"
|
|
96
|
+
}),
|
|
97
|
+
"aria-label": "Toggle menu",
|
|
98
|
+
className: breadcrumbIconButtonStyles
|
|
99
|
+
})
|
|
100
|
+
}),
|
|
101
|
+
/*#__PURE__*/ _jsx(DropdownMenuContent, {
|
|
102
|
+
align: "start",
|
|
103
|
+
children: dropdownContent
|
|
104
|
+
})
|
|
105
|
+
]
|
|
106
|
+
})
|
|
107
|
+
]
|
|
108
|
+
})
|
|
109
|
+
]
|
|
110
|
+
});
|
|
111
|
+
}
|
|
28
112
|
return /*#__PURE__*/ _jsx(Comp, {
|
|
29
113
|
"data-slot": "breadcrumb-link",
|
|
30
|
-
className:
|
|
114
|
+
className: linkStyles,
|
|
31
115
|
...props
|
|
32
116
|
});
|
|
33
117
|
}
|
|
34
118
|
function BreadcrumbPage({ className, ...props }) {
|
|
119
|
+
const { isWhite } = useContext(BreadcrumbContext);
|
|
35
120
|
return(// biome-ignore lint/a11y/useFocusableInteractive: FIXME: unchanged shadcn
|
|
36
121
|
// biome-ignore lint/a11y/useSemanticElements: FIXME: unchanged shadcn
|
|
37
122
|
/*#__PURE__*/ _jsx("span", {
|
|
@@ -39,7 +124,7 @@ function BreadcrumbPage({ className, ...props }) {
|
|
|
39
124
|
role: "link",
|
|
40
125
|
"aria-disabled": "true",
|
|
41
126
|
"aria-current": "page",
|
|
42
|
-
className: cn(
|
|
127
|
+
className: cn(breadcrumbPageBaseStyles, isWhite && breadcrumbPageWhiteStyles, className),
|
|
43
128
|
...props
|
|
44
129
|
}));
|
|
45
130
|
}
|
|
@@ -48,7 +133,7 @@ function BreadcrumbSeparator({ children, className, ...props }) {
|
|
|
48
133
|
"data-slot": "breadcrumb-separator",
|
|
49
134
|
role: "presentation",
|
|
50
135
|
"aria-hidden": "true",
|
|
51
|
-
className: cn(
|
|
136
|
+
className: cn(breadcrumbSeparatorBaseStyles, className),
|
|
52
137
|
...props,
|
|
53
138
|
children: children ?? "/"
|
|
54
139
|
});
|
|
@@ -58,7 +143,7 @@ function BreadcrumbEllipsis({ className, ...props }) {
|
|
|
58
143
|
"data-slot": "breadcrumb-ellipsis",
|
|
59
144
|
role: "presentation",
|
|
60
145
|
"aria-hidden": "true",
|
|
61
|
-
className: cn(
|
|
146
|
+
className: cn(breadcrumbEllipsisStyles, className),
|
|
62
147
|
...props,
|
|
63
148
|
children: [
|
|
64
149
|
/*#__PURE__*/ _jsx(MoreHorizontal, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/shadcn/components/ui/breadcrumb.tsx"],"sourcesContent":["import { Slot } from \"@radix-ui/react-slot\";\nimport { MoreHorizontal } from \"lucide-react\";\nimport type * as React from \"react\";\n\nimport { cn } from \"#shadcn/lib/utils\";\n\nfunction Breadcrumb({
|
|
1
|
+
{"version":3,"sources":["../../../../../src/shadcn/components/ui/breadcrumb.tsx"],"sourcesContent":["import { Slot } from \"@radix-ui/react-slot\";\nimport { ChevronDownIcon, MoreHorizontal } from \"lucide-react\";\nimport type * as React from \"react\";\nimport { createContext, useContext } from \"react\";\nimport {\n\tDropdownMenu,\n\tDropdownMenuContent,\n\tDropdownMenuTrigger,\n} from \"#shadcn/components/ui/dropdown-menu\";\nimport { cn } from \"#shadcn/lib/utils\";\nimport { IconButton } from \"../../../components/icon-button\";\n\n// Styles\nconst breadcrumbListStyles = cn(\n\t// Typography\n\t\"typo-body\",\n\t\"text-text-tertiary\",\n\t// Layout\n\t\"flex\",\n\t\"flex-wrap\",\n\t\"items-center\",\n\t\"break-words\",\n\t// Spacing\n\t\"gap-2\",\n);\n\nconst breadcrumbItemStyles = cn(\n\t// Layout\n\t\"inline-flex\",\n\t\"items-center\",\n);\n\nconst breadcrumbLinkBaseStyles = cn(\n\t// Typography\n\t\"typo-body\",\n\t// Layout\n\t\"px-2\",\n\t\"py-1\",\n\t// Colors\n\t\"bg-bg-tertiary\",\n\t\"text-text-tertiary\",\n\t\"hover:text-text-secondary\",\n\t// Shape\n\t\"rounded-md\",\n\t// Interaction\n\t\"transition-colors\",\n\t\"focus-visible:outline-none\",\n\t\"focus-visible:ring-2\",\n\t\"focus-visible:ring-utility-blue/70\",\n);\n\nconst breadcrumbLinkWithDropdownStyles = cn(\n\t// Shape\n\t\"rounded-l-md\",\n\t\"rounded-r-none\",\n);\n\nconst breadcrumbSeparatorStyles = cn(\n\t// Size\n\t\"h-4\",\n\t\"w-px\",\n\t\"shrink-0\",\n\t// Colors\n\t\"bg-border-separator\",\n);\n\nconst breadcrumbTriggerContainerStyles = cn(\n\t// Layout\n\t\"flex\",\n\t\"items-center\",\n\t\"gap-2\",\n\t\"h-7\",\n\t\"pl-0\",\n\t\"pr-2\",\n\t\"py-1\",\n\t// Colors\n\t\"bg-bg-tertiary\",\n\t// Shape\n\t\"rounded-r-md\",\n\t\"rounded-l-none\",\n);\n\nconst breadcrumbIconButtonStyles = cn(\n\t// Size\n\t\"size-auto\",\n\t\"p-0\",\n\t// Colors\n\t\"bg-transparent\",\n\t\"hover:bg-transparent\",\n\t\"text-text-tertiary\",\n\t\"hover:text-text-secondary\",\n);\n\nconst breadcrumbPageBaseStyles = cn(\n\t// Typography\n\t\"typo-page-header\",\n\t// Layout\n\t\"px-0\",\n\t\"py-0.5\",\n\t// Colors\n\t\"text-text-primary\",\n);\n\nconst breadcrumbPageWhiteStyles = cn(\n\t// Colors\n\t\"text-white\",\n);\n\nconst breadcrumbSeparatorBaseStyles = cn(\n\t// Typography\n\t\"text-xs\",\n\t\"text-text-tertiary\",\n\t// SVG\n\t\"[&>svg]:size-3.5\",\n);\n\nconst breadcrumbEllipsisStyles = cn(\n\t// Layout\n\t\"flex\",\n\t\"size-9\",\n\t\"items-center\",\n\t\"justify-center\",\n);\n\nconst BreadcrumbContext = createContext<{ isWhite?: boolean }>({});\n\nfunction Breadcrumb({\n\tisWhite,\n\t...props\n}: React.ComponentProps<\"nav\"> & { isWhite?: boolean }) {\n\treturn (\n\t\t<BreadcrumbContext.Provider\n\t\t\tvalue={isWhite !== undefined ? { isWhite } : {}}\n\t\t>\n\t\t\t<nav aria-label=\"breadcrumb\" data-slot=\"breadcrumb\" {...props} />\n\t\t</BreadcrumbContext.Provider>\n\t);\n}\n\nfunction BreadcrumbList({ className, ...props }: React.ComponentProps<\"ol\">) {\n\treturn (\n\t\t<ol\n\t\t\tdata-slot=\"breadcrumb-list\"\n\t\t\tclassName={cn(breadcrumbListStyles, className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction BreadcrumbItem({ className, ...props }: React.ComponentProps<\"li\">) {\n\treturn (\n\t\t<li\n\t\t\tdata-slot=\"breadcrumb-item\"\n\t\t\tclassName={cn(breadcrumbItemStyles, className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction BreadcrumbLink({\n\tasChild,\n\tclassName,\n\tdropdownContent,\n\t...props\n}: React.ComponentProps<\"a\"> & {\n\tasChild?: boolean;\n\tdropdownContent?: React.ReactNode;\n}) {\n\tconst Comp = asChild ? Slot : \"a\";\n\n\tconst linkStyles = cn(\n\t\tbreadcrumbLinkBaseStyles,\n\t\tdropdownContent && breadcrumbLinkWithDropdownStyles,\n\t\tclassName,\n\t);\n\n\tif (dropdownContent) {\n\t\treturn (\n\t\t\t<div className=\"inline-flex items-center\">\n\t\t\t\t<Comp data-slot=\"breadcrumb-link\" className={linkStyles} {...props} />\n\t\t\t\t<div className={breadcrumbTriggerContainerStyles}>\n\t\t\t\t\t<div className={breadcrumbSeparatorStyles} />\n\t\t\t\t\t<DropdownMenu>\n\t\t\t\t\t\t<DropdownMenuTrigger asChild>\n\t\t\t\t\t\t\t<IconButton\n\t\t\t\t\t\t\t\ticon={<ChevronDownIcon className=\"size-4\" />}\n\t\t\t\t\t\t\t\taria-label=\"Toggle menu\"\n\t\t\t\t\t\t\t\tclassName={breadcrumbIconButtonStyles}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</DropdownMenuTrigger>\n\t\t\t\t\t\t<DropdownMenuContent align=\"start\">\n\t\t\t\t\t\t\t{dropdownContent}\n\t\t\t\t\t\t</DropdownMenuContent>\n\t\t\t\t\t</DropdownMenu>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t);\n\t}\n\n\treturn <Comp data-slot=\"breadcrumb-link\" className={linkStyles} {...props} />;\n}\n\nfunction BreadcrumbPage({ className, ...props }: React.ComponentProps<\"span\">) {\n\tconst { isWhite } = useContext(BreadcrumbContext);\n\n\treturn (\n\t\t// biome-ignore lint/a11y/useFocusableInteractive: FIXME: unchanged shadcn\n\t\t// biome-ignore lint/a11y/useSemanticElements: FIXME: unchanged shadcn\n\t\t<span\n\t\t\tdata-slot=\"breadcrumb-page\"\n\t\t\trole=\"link\"\n\t\t\taria-disabled=\"true\"\n\t\t\taria-current=\"page\"\n\t\t\tclassName={cn(\n\t\t\t\tbreadcrumbPageBaseStyles,\n\t\t\t\tisWhite && breadcrumbPageWhiteStyles,\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction BreadcrumbSeparator({\n\tchildren,\n\tclassName,\n\t...props\n}: React.ComponentProps<\"li\">) {\n\treturn (\n\t\t<li\n\t\t\tdata-slot=\"breadcrumb-separator\"\n\t\t\trole=\"presentation\"\n\t\t\taria-hidden=\"true\"\n\t\t\tclassName={cn(breadcrumbSeparatorBaseStyles, className)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{children ?? \"/\"}\n\t\t</li>\n\t);\n}\n\nfunction BreadcrumbEllipsis({\n\tclassName,\n\t...props\n}: React.ComponentProps<\"span\">) {\n\treturn (\n\t\t<span\n\t\t\tdata-slot=\"breadcrumb-ellipsis\"\n\t\t\trole=\"presentation\"\n\t\t\taria-hidden=\"true\"\n\t\t\tclassName={cn(breadcrumbEllipsisStyles, className)}\n\t\t\t{...props}\n\t\t>\n\t\t\t<MoreHorizontal className=\"size-4\" />\n\t\t\t<span className=\"sr-only\">More</span>\n\t\t</span>\n\t);\n}\n\nexport {\n\tBreadcrumb,\n\tBreadcrumbList,\n\tBreadcrumbItem,\n\tBreadcrumbLink,\n\tBreadcrumbPage,\n\tBreadcrumbSeparator,\n\tBreadcrumbEllipsis,\n};\n"],"names":["Slot","ChevronDownIcon","MoreHorizontal","createContext","useContext","DropdownMenu","DropdownMenuContent","DropdownMenuTrigger","cn","IconButton","breadcrumbListStyles","breadcrumbItemStyles","breadcrumbLinkBaseStyles","breadcrumbLinkWithDropdownStyles","breadcrumbSeparatorStyles","breadcrumbTriggerContainerStyles","breadcrumbIconButtonStyles","breadcrumbPageBaseStyles","breadcrumbPageWhiteStyles","breadcrumbSeparatorBaseStyles","breadcrumbEllipsisStyles","BreadcrumbContext","Breadcrumb","isWhite","props","Provider","value","undefined","nav","aria-label","data-slot","BreadcrumbList","className","ol","BreadcrumbItem","li","BreadcrumbLink","asChild","dropdownContent","Comp","linkStyles","div","icon","align","BreadcrumbPage","span","role","aria-disabled","aria-current","BreadcrumbSeparator","children","aria-hidden","BreadcrumbEllipsis"],"mappings":"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"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
1
2
|
// biome-ignore-all lint/a11y/useValidAnchor: Useless in stories
|
|
2
|
-
import {
|
|
3
|
-
import { Breadcrumb,
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
render: ()=>/*#__PURE__*/ _jsx(Breadcrumb, {
|
|
3
|
+
import { Controls, Primary, Title } from "@storybook/addon-docs/blocks";
|
|
4
|
+
import { Breadcrumb, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator } from "./breadcrumb.js";
|
|
5
|
+
import { DropdownMenuItem } from "./dropdown-menu.js";
|
|
6
|
+
function BreadcrumbWrapper({ isWhite = false, hasDropdown = false }) {
|
|
7
|
+
return /*#__PURE__*/ _jsx("div", {
|
|
8
|
+
className: isWhite ? "bg-black p-8 rounded-lg" : "",
|
|
9
|
+
children: /*#__PURE__*/ _jsx(Breadcrumb, {
|
|
10
|
+
isWhite: isWhite,
|
|
11
11
|
children: /*#__PURE__*/ _jsxs(BreadcrumbList, {
|
|
12
12
|
children: [
|
|
13
13
|
/*#__PURE__*/ _jsx(BreadcrumbItem, {
|
|
@@ -20,57 +20,217 @@ export const Demo = {
|
|
|
20
20
|
})
|
|
21
21
|
}),
|
|
22
22
|
/*#__PURE__*/ _jsx(BreadcrumbSeparator, {}),
|
|
23
|
-
/*#__PURE__*/ _jsx(BreadcrumbItem, {
|
|
24
|
-
children: /*#__PURE__*/ _jsxs(DropdownMenu, {
|
|
25
|
-
children: [
|
|
26
|
-
/*#__PURE__*/ _jsxs(DropdownMenuTrigger, {
|
|
27
|
-
className: "flex items-center gap-1",
|
|
28
|
-
children: [
|
|
29
|
-
/*#__PURE__*/ _jsx(BreadcrumbEllipsis, {
|
|
30
|
-
className: "size-4"
|
|
31
|
-
}),
|
|
32
|
-
/*#__PURE__*/ _jsx("span", {
|
|
33
|
-
className: "sr-only",
|
|
34
|
-
children: "Toggle menu"
|
|
35
|
-
})
|
|
36
|
-
]
|
|
37
|
-
}),
|
|
38
|
-
/*#__PURE__*/ _jsxs(DropdownMenuContent, {
|
|
39
|
-
align: "start",
|
|
40
|
-
children: [
|
|
41
|
-
/*#__PURE__*/ _jsx(DropdownMenuItem, {
|
|
42
|
-
children: "Documentation"
|
|
43
|
-
}),
|
|
44
|
-
/*#__PURE__*/ _jsx(DropdownMenuItem, {
|
|
45
|
-
children: "Themes"
|
|
46
|
-
}),
|
|
47
|
-
/*#__PURE__*/ _jsx(DropdownMenuItem, {
|
|
48
|
-
children: "GitHub"
|
|
49
|
-
})
|
|
50
|
-
]
|
|
51
|
-
})
|
|
52
|
-
]
|
|
53
|
-
})
|
|
54
|
-
}),
|
|
55
|
-
/*#__PURE__*/ _jsx(BreadcrumbSeparator, {}),
|
|
56
23
|
/*#__PURE__*/ _jsx(BreadcrumbItem, {
|
|
57
24
|
children: /*#__PURE__*/ _jsx(BreadcrumbLink, {
|
|
58
25
|
asChild: true,
|
|
26
|
+
dropdownContent: hasDropdown ? /*#__PURE__*/ _jsxs(_Fragment, {
|
|
27
|
+
children: [
|
|
28
|
+
/*#__PURE__*/ _jsx(DropdownMenuItem, {
|
|
29
|
+
children: "Level 1"
|
|
30
|
+
}),
|
|
31
|
+
/*#__PURE__*/ _jsx(DropdownMenuItem, {
|
|
32
|
+
children: "Level 2"
|
|
33
|
+
}),
|
|
34
|
+
/*#__PURE__*/ _jsx(DropdownMenuItem, {
|
|
35
|
+
children: "Level 3"
|
|
36
|
+
})
|
|
37
|
+
]
|
|
38
|
+
}) : undefined,
|
|
59
39
|
children: /*#__PURE__*/ _jsx("a", {
|
|
60
|
-
href: "/docs
|
|
61
|
-
children: "
|
|
40
|
+
href: "/docs",
|
|
41
|
+
children: "Documentation"
|
|
62
42
|
})
|
|
63
43
|
})
|
|
64
44
|
}),
|
|
65
45
|
/*#__PURE__*/ _jsx(BreadcrumbSeparator, {}),
|
|
66
46
|
/*#__PURE__*/ _jsx(BreadcrumbItem, {
|
|
67
47
|
children: /*#__PURE__*/ _jsx(BreadcrumbPage, {
|
|
68
|
-
children: "
|
|
48
|
+
children: "Components"
|
|
69
49
|
})
|
|
70
50
|
})
|
|
71
51
|
]
|
|
72
52
|
})
|
|
73
53
|
})
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
const meta = {
|
|
57
|
+
title: "Component/Breadcrumb",
|
|
58
|
+
component: BreadcrumbWrapper,
|
|
59
|
+
parameters: {
|
|
60
|
+
docs: {
|
|
61
|
+
page: ()=>/*#__PURE__*/ _jsxs(_Fragment, {
|
|
62
|
+
children: [
|
|
63
|
+
/*#__PURE__*/ _jsx(Title, {}),
|
|
64
|
+
/*#__PURE__*/ _jsx(Primary, {}),
|
|
65
|
+
/*#__PURE__*/ _jsx(Controls, {})
|
|
66
|
+
]
|
|
67
|
+
})
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
argTypes: {
|
|
71
|
+
isWhite: {
|
|
72
|
+
control: "boolean"
|
|
73
|
+
},
|
|
74
|
+
hasDropdown: {
|
|
75
|
+
control: "boolean"
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
args: {
|
|
79
|
+
isWhite: false,
|
|
80
|
+
hasDropdown: false
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
export default meta;
|
|
84
|
+
export const Default = {
|
|
85
|
+
tags: [
|
|
86
|
+
"!dev"
|
|
87
|
+
],
|
|
88
|
+
render: ({ isWhite = false, hasDropdown = false })=>/*#__PURE__*/ _jsx(BreadcrumbWrapper, {
|
|
89
|
+
isWhite: isWhite,
|
|
90
|
+
hasDropdown: hasDropdown
|
|
91
|
+
})
|
|
92
|
+
};
|
|
93
|
+
export const Demo = {
|
|
94
|
+
tags: [
|
|
95
|
+
"!autodocs"
|
|
96
|
+
],
|
|
97
|
+
render: ()=>/*#__PURE__*/ _jsxs("div", {
|
|
98
|
+
className: "space-y-8",
|
|
99
|
+
children: [
|
|
100
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
101
|
+
children: [
|
|
102
|
+
/*#__PURE__*/ _jsx("p", {
|
|
103
|
+
className: "text-sm text-text-secondary mb-2",
|
|
104
|
+
children: "Default"
|
|
105
|
+
}),
|
|
106
|
+
/*#__PURE__*/ _jsx(Breadcrumb, {
|
|
107
|
+
children: /*#__PURE__*/ _jsxs(BreadcrumbList, {
|
|
108
|
+
children: [
|
|
109
|
+
/*#__PURE__*/ _jsx(BreadcrumbItem, {
|
|
110
|
+
children: /*#__PURE__*/ _jsx(BreadcrumbLink, {
|
|
111
|
+
asChild: true,
|
|
112
|
+
children: /*#__PURE__*/ _jsx("a", {
|
|
113
|
+
href: "/",
|
|
114
|
+
children: "Home"
|
|
115
|
+
})
|
|
116
|
+
})
|
|
117
|
+
}),
|
|
118
|
+
/*#__PURE__*/ _jsx(BreadcrumbSeparator, {}),
|
|
119
|
+
/*#__PURE__*/ _jsx(BreadcrumbItem, {
|
|
120
|
+
children: /*#__PURE__*/ _jsx(BreadcrumbLink, {
|
|
121
|
+
asChild: true,
|
|
122
|
+
children: /*#__PURE__*/ _jsx("a", {
|
|
123
|
+
href: "/docs",
|
|
124
|
+
children: "Documentation"
|
|
125
|
+
})
|
|
126
|
+
})
|
|
127
|
+
}),
|
|
128
|
+
/*#__PURE__*/ _jsx(BreadcrumbSeparator, {}),
|
|
129
|
+
/*#__PURE__*/ _jsx(BreadcrumbItem, {
|
|
130
|
+
children: /*#__PURE__*/ _jsx(BreadcrumbPage, {
|
|
131
|
+
children: "Components"
|
|
132
|
+
})
|
|
133
|
+
})
|
|
134
|
+
]
|
|
135
|
+
})
|
|
136
|
+
})
|
|
137
|
+
]
|
|
138
|
+
}),
|
|
139
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
140
|
+
children: [
|
|
141
|
+
/*#__PURE__*/ _jsx("p", {
|
|
142
|
+
className: "text-sm text-text-secondary mb-2",
|
|
143
|
+
children: "With Dropdown"
|
|
144
|
+
}),
|
|
145
|
+
/*#__PURE__*/ _jsx(Breadcrumb, {
|
|
146
|
+
children: /*#__PURE__*/ _jsxs(BreadcrumbList, {
|
|
147
|
+
children: [
|
|
148
|
+
/*#__PURE__*/ _jsx(BreadcrumbItem, {
|
|
149
|
+
children: /*#__PURE__*/ _jsx(BreadcrumbLink, {
|
|
150
|
+
asChild: true,
|
|
151
|
+
children: /*#__PURE__*/ _jsx("a", {
|
|
152
|
+
href: "/",
|
|
153
|
+
children: "Home"
|
|
154
|
+
})
|
|
155
|
+
})
|
|
156
|
+
}),
|
|
157
|
+
/*#__PURE__*/ _jsx(BreadcrumbSeparator, {}),
|
|
158
|
+
/*#__PURE__*/ _jsx(BreadcrumbItem, {
|
|
159
|
+
children: /*#__PURE__*/ _jsx(BreadcrumbLink, {
|
|
160
|
+
asChild: true,
|
|
161
|
+
dropdownContent: /*#__PURE__*/ _jsxs(_Fragment, {
|
|
162
|
+
children: [
|
|
163
|
+
/*#__PURE__*/ _jsx(DropdownMenuItem, {
|
|
164
|
+
children: "Level 1"
|
|
165
|
+
}),
|
|
166
|
+
/*#__PURE__*/ _jsx(DropdownMenuItem, {
|
|
167
|
+
children: "Level 2"
|
|
168
|
+
}),
|
|
169
|
+
/*#__PURE__*/ _jsx(DropdownMenuItem, {
|
|
170
|
+
children: "Level 3"
|
|
171
|
+
})
|
|
172
|
+
]
|
|
173
|
+
}),
|
|
174
|
+
children: /*#__PURE__*/ _jsx("a", {
|
|
175
|
+
href: "/docs",
|
|
176
|
+
children: "Documentation"
|
|
177
|
+
})
|
|
178
|
+
})
|
|
179
|
+
}),
|
|
180
|
+
/*#__PURE__*/ _jsx(BreadcrumbSeparator, {}),
|
|
181
|
+
/*#__PURE__*/ _jsx(BreadcrumbItem, {
|
|
182
|
+
children: /*#__PURE__*/ _jsx(BreadcrumbPage, {
|
|
183
|
+
children: "Components"
|
|
184
|
+
})
|
|
185
|
+
})
|
|
186
|
+
]
|
|
187
|
+
})
|
|
188
|
+
})
|
|
189
|
+
]
|
|
190
|
+
}),
|
|
191
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
192
|
+
className: "bg-black p-8 rounded-lg",
|
|
193
|
+
children: [
|
|
194
|
+
/*#__PURE__*/ _jsx("p", {
|
|
195
|
+
className: "text-sm text-white/70 mb-2",
|
|
196
|
+
children: "White (for dark backgrounds)"
|
|
197
|
+
}),
|
|
198
|
+
/*#__PURE__*/ _jsx(Breadcrumb, {
|
|
199
|
+
isWhite: true,
|
|
200
|
+
children: /*#__PURE__*/ _jsxs(BreadcrumbList, {
|
|
201
|
+
children: [
|
|
202
|
+
/*#__PURE__*/ _jsx(BreadcrumbItem, {
|
|
203
|
+
children: /*#__PURE__*/ _jsx(BreadcrumbLink, {
|
|
204
|
+
asChild: true,
|
|
205
|
+
children: /*#__PURE__*/ _jsx("a", {
|
|
206
|
+
href: "/",
|
|
207
|
+
children: "Home"
|
|
208
|
+
})
|
|
209
|
+
})
|
|
210
|
+
}),
|
|
211
|
+
/*#__PURE__*/ _jsx(BreadcrumbSeparator, {}),
|
|
212
|
+
/*#__PURE__*/ _jsx(BreadcrumbItem, {
|
|
213
|
+
children: /*#__PURE__*/ _jsx(BreadcrumbLink, {
|
|
214
|
+
asChild: true,
|
|
215
|
+
children: /*#__PURE__*/ _jsx("a", {
|
|
216
|
+
href: "/docs",
|
|
217
|
+
children: "Documentation"
|
|
218
|
+
})
|
|
219
|
+
})
|
|
220
|
+
}),
|
|
221
|
+
/*#__PURE__*/ _jsx(BreadcrumbSeparator, {}),
|
|
222
|
+
/*#__PURE__*/ _jsx(BreadcrumbItem, {
|
|
223
|
+
children: /*#__PURE__*/ _jsx(BreadcrumbPage, {
|
|
224
|
+
children: "Components"
|
|
225
|
+
})
|
|
226
|
+
})
|
|
227
|
+
]
|
|
228
|
+
})
|
|
229
|
+
})
|
|
230
|
+
]
|
|
231
|
+
})
|
|
232
|
+
]
|
|
233
|
+
})
|
|
74
234
|
};
|
|
75
235
|
|
|
76
236
|
//# sourceMappingURL=breadcrumb.stories.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/shadcn/components/ui/breadcrumb.stories.tsx"],"sourcesContent":["// biome-ignore-all lint/a11y/useValidAnchor: Useless in stories\nimport type { Meta, StoryObj } from \"@storybook/react-vite\";\nimport {\n\tBreadcrumb,\n\
|
|
1
|
+
{"version":3,"sources":["../../../../../src/shadcn/components/ui/breadcrumb.stories.tsx"],"sourcesContent":["// biome-ignore-all lint/a11y/useValidAnchor: Useless in stories\nimport { Controls, Primary, Title } from \"@storybook/addon-docs/blocks\";\nimport type { Meta, StoryObj } from \"@storybook/react-vite\";\nimport {\n\tBreadcrumb,\n\tBreadcrumbItem,\n\tBreadcrumbLink,\n\tBreadcrumbList,\n\tBreadcrumbPage,\n\tBreadcrumbSeparator,\n} from \"#shadcn/components/ui/breadcrumb\";\nimport { DropdownMenuItem } from \"#shadcn/components/ui/dropdown-menu\";\n\ninterface BreadcrumbWrapperProps {\n\tisWhite?: boolean;\n\thasDropdown?: boolean;\n}\n\nfunction BreadcrumbWrapper({\n\tisWhite = false,\n\thasDropdown = false,\n}: BreadcrumbWrapperProps) {\n\treturn (\n\t\t<div className={isWhite ? \"bg-black p-8 rounded-lg\" : \"\"}>\n\t\t\t<Breadcrumb isWhite={isWhite}>\n\t\t\t\t<BreadcrumbList>\n\t\t\t\t\t<BreadcrumbItem>\n\t\t\t\t\t\t<BreadcrumbLink asChild>\n\t\t\t\t\t\t\t<a href=\"/\">Home</a>\n\t\t\t\t\t\t</BreadcrumbLink>\n\t\t\t\t\t</BreadcrumbItem>\n\t\t\t\t\t<BreadcrumbSeparator />\n\t\t\t\t\t<BreadcrumbItem>\n\t\t\t\t\t\t<BreadcrumbLink\n\t\t\t\t\t\t\tasChild\n\t\t\t\t\t\t\tdropdownContent={\n\t\t\t\t\t\t\t\thasDropdown ? (\n\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t<DropdownMenuItem>Level 1</DropdownMenuItem>\n\t\t\t\t\t\t\t\t\t\t<DropdownMenuItem>Level 2</DropdownMenuItem>\n\t\t\t\t\t\t\t\t\t\t<DropdownMenuItem>Level 3</DropdownMenuItem>\n\t\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t\t) : undefined\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<a href=\"/docs\">Documentation</a>\n\t\t\t\t\t\t</BreadcrumbLink>\n\t\t\t\t\t</BreadcrumbItem>\n\t\t\t\t\t<BreadcrumbSeparator />\n\t\t\t\t\t<BreadcrumbItem>\n\t\t\t\t\t\t<BreadcrumbPage>Components</BreadcrumbPage>\n\t\t\t\t\t</BreadcrumbItem>\n\t\t\t\t</BreadcrumbList>\n\t\t\t</Breadcrumb>\n\t\t</div>\n\t);\n}\n\nconst meta = {\n\ttitle: \"Component/Breadcrumb\",\n\tcomponent: BreadcrumbWrapper,\n\tparameters: {\n\t\tdocs: {\n\t\t\tpage: () => (\n\t\t\t\t<>\n\t\t\t\t\t<Title />\n\t\t\t\t\t<Primary />\n\t\t\t\t\t<Controls />\n\t\t\t\t</>\n\t\t\t),\n\t\t},\n\t},\n\targTypes: {\n\t\tisWhite: {\n\t\t\tcontrol: \"boolean\",\n\t\t},\n\t\thasDropdown: {\n\t\t\tcontrol: \"boolean\",\n\t\t},\n\t},\n\targs: {\n\t\tisWhite: false,\n\t\thasDropdown: false,\n\t},\n} satisfies Meta<typeof BreadcrumbWrapper>;\nexport default meta;\n\ntype Story = StoryObj<typeof meta>;\n\nexport const Default = {\n\ttags: [\"!dev\"],\n\trender: ({ isWhite = false, hasDropdown = false }) => (\n\t\t<BreadcrumbWrapper isWhite={isWhite} hasDropdown={hasDropdown} />\n\t),\n} satisfies Story;\n\nexport const Demo = {\n\ttags: [\"!autodocs\"],\n\trender: () => (\n\t\t<div className=\"space-y-8\">\n\t\t\t<div>\n\t\t\t\t<p className=\"text-sm text-text-secondary mb-2\">Default</p>\n\t\t\t\t<Breadcrumb>\n\t\t\t\t\t<BreadcrumbList>\n\t\t\t\t\t\t<BreadcrumbItem>\n\t\t\t\t\t\t\t<BreadcrumbLink asChild>\n\t\t\t\t\t\t\t\t<a href=\"/\">Home</a>\n\t\t\t\t\t\t\t</BreadcrumbLink>\n\t\t\t\t\t\t</BreadcrumbItem>\n\t\t\t\t\t\t<BreadcrumbSeparator />\n\t\t\t\t\t\t<BreadcrumbItem>\n\t\t\t\t\t\t\t<BreadcrumbLink asChild>\n\t\t\t\t\t\t\t\t<a href=\"/docs\">Documentation</a>\n\t\t\t\t\t\t\t</BreadcrumbLink>\n\t\t\t\t\t\t</BreadcrumbItem>\n\t\t\t\t\t\t<BreadcrumbSeparator />\n\t\t\t\t\t\t<BreadcrumbItem>\n\t\t\t\t\t\t\t<BreadcrumbPage>Components</BreadcrumbPage>\n\t\t\t\t\t\t</BreadcrumbItem>\n\t\t\t\t\t</BreadcrumbList>\n\t\t\t\t</Breadcrumb>\n\t\t\t</div>\n\n\t\t\t<div>\n\t\t\t\t<p className=\"text-sm text-text-secondary mb-2\">With Dropdown</p>\n\t\t\t\t<Breadcrumb>\n\t\t\t\t\t<BreadcrumbList>\n\t\t\t\t\t\t<BreadcrumbItem>\n\t\t\t\t\t\t\t<BreadcrumbLink asChild>\n\t\t\t\t\t\t\t\t<a href=\"/\">Home</a>\n\t\t\t\t\t\t\t</BreadcrumbLink>\n\t\t\t\t\t\t</BreadcrumbItem>\n\t\t\t\t\t\t<BreadcrumbSeparator />\n\t\t\t\t\t\t<BreadcrumbItem>\n\t\t\t\t\t\t\t<BreadcrumbLink\n\t\t\t\t\t\t\t\tasChild\n\t\t\t\t\t\t\t\tdropdownContent={\n\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t<DropdownMenuItem>Level 1</DropdownMenuItem>\n\t\t\t\t\t\t\t\t\t\t<DropdownMenuItem>Level 2</DropdownMenuItem>\n\t\t\t\t\t\t\t\t\t\t<DropdownMenuItem>Level 3</DropdownMenuItem>\n\t\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<a href=\"/docs\">Documentation</a>\n\t\t\t\t\t\t\t</BreadcrumbLink>\n\t\t\t\t\t\t</BreadcrumbItem>\n\t\t\t\t\t\t<BreadcrumbSeparator />\n\t\t\t\t\t\t<BreadcrumbItem>\n\t\t\t\t\t\t\t<BreadcrumbPage>Components</BreadcrumbPage>\n\t\t\t\t\t\t</BreadcrumbItem>\n\t\t\t\t\t</BreadcrumbList>\n\t\t\t\t</Breadcrumb>\n\t\t\t</div>\n\n\t\t\t<div className=\"bg-black p-8 rounded-lg\">\n\t\t\t\t<p className=\"text-sm text-white/70 mb-2\">\n\t\t\t\t\tWhite (for dark backgrounds)\n\t\t\t\t</p>\n\t\t\t\t<Breadcrumb isWhite>\n\t\t\t\t\t<BreadcrumbList>\n\t\t\t\t\t\t<BreadcrumbItem>\n\t\t\t\t\t\t\t<BreadcrumbLink asChild>\n\t\t\t\t\t\t\t\t<a href=\"/\">Home</a>\n\t\t\t\t\t\t\t</BreadcrumbLink>\n\t\t\t\t\t\t</BreadcrumbItem>\n\t\t\t\t\t\t<BreadcrumbSeparator />\n\t\t\t\t\t\t<BreadcrumbItem>\n\t\t\t\t\t\t\t<BreadcrumbLink asChild>\n\t\t\t\t\t\t\t\t<a href=\"/docs\">Documentation</a>\n\t\t\t\t\t\t\t</BreadcrumbLink>\n\t\t\t\t\t\t</BreadcrumbItem>\n\t\t\t\t\t\t<BreadcrumbSeparator />\n\t\t\t\t\t\t<BreadcrumbItem>\n\t\t\t\t\t\t\t<BreadcrumbPage>Components</BreadcrumbPage>\n\t\t\t\t\t\t</BreadcrumbItem>\n\t\t\t\t\t</BreadcrumbList>\n\t\t\t\t</Breadcrumb>\n\t\t\t</div>\n\t\t</div>\n\t),\n} satisfies Story;\n"],"names":["Controls","Primary","Title","Breadcrumb","BreadcrumbItem","BreadcrumbLink","BreadcrumbList","BreadcrumbPage","BreadcrumbSeparator","DropdownMenuItem","BreadcrumbWrapper","isWhite","hasDropdown","div","className","asChild","a","href","dropdownContent","undefined","meta","title","component","parameters","docs","page","argTypes","control","args","Default","tags","render","Demo","p"],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../../../src/shadcn/components/ui/button.tsx"],"names":[],"mappings":"AACA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../../../src/shadcn/components/ui/button.tsx"],"names":[],"mappings":"AACA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AA8BpC,QAAA,MAAM,cAAc;;;;8EAkIlB,CAAC;AAEH,iBAAS,MAAM,CAAC,EACf,SAAS,EACT,OAAO,EACP,IAAI,EACJ,MAAc,EACd,OAAe,EACf,GAAG,KAAK,EACR,EAAE,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,GAChC,YAAY,CAAC,OAAO,cAAc,CAAC,GAAG;IACrC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;CACjB,2CAUD;AAED,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -2,17 +2,25 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { Slot } from "@radix-ui/react-slot";
|
|
3
3
|
import { cva } from "class-variance-authority";
|
|
4
4
|
import { cn } from "../../lib/utils.js";
|
|
5
|
-
const
|
|
5
|
+
const baseButtonStyles = cn(// Layout
|
|
6
|
+
"inline-flex", "items-center", "justify-center", "gap-2", "whitespace-nowrap", "shrink-0", // Shape
|
|
7
|
+
"rounded-lg", // Interaction
|
|
8
|
+
"transition-all", "outline-none", "cursor-pointer", // Disabled states
|
|
9
|
+
"disabled:cursor-not-allowed", // Icon styles
|
|
10
|
+
"[&_svg]:pointer-events-none", "[&_svg:not([class*='size-'])]:size-4", "[&_svg]:shrink-0", // Focus states
|
|
11
|
+
// Invalid states
|
|
12
|
+
"aria-invalid:ring-2", "aria-invalid:ring-utility-red/70");
|
|
13
|
+
const buttonVariants = cva(baseButtonStyles, {
|
|
6
14
|
variants: {
|
|
7
15
|
variant: {
|
|
8
|
-
primary: "bg-bg-link text-text-primary_on-brand
|
|
9
|
-
secondary: "border border-border-primary bg-bg-primary text-text-
|
|
10
|
-
link: "text-text-secondary hover:text-text-primary
|
|
11
|
-
ghost: "text-text-secondary hover:text-text-primary
|
|
16
|
+
primary: cn("bg-bg-link", "text-text-primary_on-brand", "hover:bg-bg-link_hover", "active:bg-bg-link"),
|
|
17
|
+
secondary: cn("border", "border-border-primary", "bg-bg-primary", "text-text-secondary", "hover:text-text-primary", "hover:bg-bg-secondary", "active:bg-bg-primary", "active:text-text-tertiary"),
|
|
18
|
+
link: cn("text-text-secondary", "hover:text-text-primary", "rounded"),
|
|
19
|
+
ghost: cn("text-text-secondary", "hover:text-text-primary", "hover:bg-bg-secondary", "active:bg-bg-tertiary")
|
|
12
20
|
},
|
|
13
21
|
size: {
|
|
14
|
-
regular: "h-9 px-4 typo-
|
|
15
|
-
small: "h-6 px-2 typo-button-label-xs
|
|
22
|
+
regular: cn("h-9", "px-4", "typo-body"),
|
|
23
|
+
small: cn("h-6", "px-2", "gap-1", "typo-button-label-xs")
|
|
16
24
|
},
|
|
17
25
|
danger: {
|
|
18
26
|
true: "",
|
|
@@ -20,25 +28,71 @@ const buttonVariants = cva(cn("inline-flex items-center justify-center gap-2 whi
|
|
|
20
28
|
}
|
|
21
29
|
},
|
|
22
30
|
compoundVariants: [
|
|
31
|
+
// Primary disabled
|
|
32
|
+
{
|
|
33
|
+
variant: "primary",
|
|
34
|
+
class: cn("disabled:bg-bg-disabled", "disabled:text-white")
|
|
35
|
+
},
|
|
36
|
+
// Secondary disabled
|
|
37
|
+
{
|
|
38
|
+
variant: "secondary",
|
|
39
|
+
class: cn("disabled:bg-bg-primary", "disabled:text-text-disabled", "disabled:border-border-disabled")
|
|
40
|
+
},
|
|
41
|
+
// Link disabled
|
|
42
|
+
{
|
|
43
|
+
variant: "link",
|
|
44
|
+
class: cn("disabled:text-text-disabled")
|
|
45
|
+
},
|
|
46
|
+
// Ghost disabled
|
|
47
|
+
{
|
|
48
|
+
variant: "ghost",
|
|
49
|
+
class: cn("disabled:text-text-disabled")
|
|
50
|
+
},
|
|
51
|
+
// Primary danger
|
|
23
52
|
{
|
|
24
53
|
variant: "primary",
|
|
25
54
|
danger: true,
|
|
26
|
-
class: "bg-bg-error-primary_inverse text-text-primary_on-brand hover:bg-bg-error-primary_inverse_hover active:bg-bg-error-primary_inverse
|
|
55
|
+
class: cn("bg-bg-error-primary_inverse", "text-text-primary_on-brand", "hover:bg-bg-error-primary_inverse_hover", "active:bg-bg-error-primary_inverse")
|
|
27
56
|
},
|
|
57
|
+
// Secondary danger
|
|
28
58
|
{
|
|
29
59
|
variant: "secondary",
|
|
30
60
|
danger: true,
|
|
31
|
-
class: "border-border-error text-text-error-primary hover:text-text-error-
|
|
61
|
+
class: cn("border-border-error", "text-text-error-primary", "hover:text-text-error-primary", "hover:bg-bg-error-secondary", "active:bg-bg-primary", "active:text-text-error-primary")
|
|
32
62
|
},
|
|
63
|
+
// Link danger
|
|
33
64
|
{
|
|
34
65
|
variant: "link",
|
|
35
66
|
danger: true,
|
|
36
|
-
class: "text-text-error-secondary hover:text-text-error-primary"
|
|
67
|
+
class: cn("text-text-error-secondary", "hover:text-text-error-primary")
|
|
37
68
|
},
|
|
69
|
+
// Ghost danger
|
|
38
70
|
{
|
|
39
71
|
variant: "ghost",
|
|
40
72
|
danger: true,
|
|
41
|
-
class: "text-text-error-secondary hover:text-text-error-primary hover:bg-bg-error-secondary active:bg-bg-error-tertiary"
|
|
73
|
+
class: cn("text-text-error-secondary", "hover:text-text-error-primary", "hover:bg-bg-error-secondary", "active:bg-bg-error-tertiary")
|
|
74
|
+
},
|
|
75
|
+
// Focus ring for regular size
|
|
76
|
+
{
|
|
77
|
+
size: "regular",
|
|
78
|
+
danger: false,
|
|
79
|
+
class: cn("focus-visible:ring-4", "focus-visible:ring-ring-blue")
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
size: "regular",
|
|
83
|
+
danger: true,
|
|
84
|
+
class: cn("focus-visible:ring-4", "focus-visible:ring-ring-red")
|
|
85
|
+
},
|
|
86
|
+
// Focus ring for small size
|
|
87
|
+
{
|
|
88
|
+
size: "small",
|
|
89
|
+
danger: false,
|
|
90
|
+
class: cn("focus-visible:ring-3", "focus-visible:ring-ring-blue")
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
size: "small",
|
|
94
|
+
danger: true,
|
|
95
|
+
class: cn("focus-visible:ring-3", "focus-visible:ring-ring-red")
|
|
42
96
|
}
|
|
43
97
|
],
|
|
44
98
|
defaultVariants: {
|