@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
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Check, Copy } from "lucide-react";
|
|
3
|
+
import { Sandbox } from "./sandbox.js";
|
|
4
|
+
const meta = {
|
|
5
|
+
title: "Component/Sandbox",
|
|
6
|
+
component: Sandbox,
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: "centered"
|
|
9
|
+
},
|
|
10
|
+
tags: [
|
|
11
|
+
"autodocs"
|
|
12
|
+
],
|
|
13
|
+
argTypes: {
|
|
14
|
+
url: {
|
|
15
|
+
control: "text",
|
|
16
|
+
description: "Display url"
|
|
17
|
+
},
|
|
18
|
+
showCopy: {
|
|
19
|
+
control: "boolean",
|
|
20
|
+
description: "Show the copy button"
|
|
21
|
+
},
|
|
22
|
+
showEye: {
|
|
23
|
+
control: "boolean",
|
|
24
|
+
description: "Show the eye button"
|
|
25
|
+
},
|
|
26
|
+
copyIcon: {
|
|
27
|
+
control: false,
|
|
28
|
+
description: "Show the copy icon"
|
|
29
|
+
},
|
|
30
|
+
tooltipText: {
|
|
31
|
+
control: "text",
|
|
32
|
+
description: "Copy button tooltip text"
|
|
33
|
+
},
|
|
34
|
+
showToast: {
|
|
35
|
+
control: "boolean",
|
|
36
|
+
description: "Show toast on copy"
|
|
37
|
+
},
|
|
38
|
+
onCopy: {
|
|
39
|
+
action: "copied",
|
|
40
|
+
description: "Successful copy callback"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
export default meta;
|
|
45
|
+
export const Default = {
|
|
46
|
+
args: {
|
|
47
|
+
url: "http://localhost:8080/fhir",
|
|
48
|
+
showCopy: true,
|
|
49
|
+
showEye: true,
|
|
50
|
+
copyIcon: /*#__PURE__*/ _jsx(Copy, {}),
|
|
51
|
+
tooltipText: "Copy URL",
|
|
52
|
+
showToast: true
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
export const LongUrl = {
|
|
56
|
+
args: {
|
|
57
|
+
url: "https://very-long-domain-name-that-should-be-truncated.example.com/api/v1/very-long-endpoint-name",
|
|
58
|
+
showCopy: true,
|
|
59
|
+
showEye: true,
|
|
60
|
+
copyIcon: /*#__PURE__*/ _jsx(Copy, {}),
|
|
61
|
+
tooltipText: "Copy URL",
|
|
62
|
+
showToast: true
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
export const WithoutCopy = {
|
|
66
|
+
args: {
|
|
67
|
+
url: "http://localhost:8080/fhir",
|
|
68
|
+
showCopy: false,
|
|
69
|
+
showEye: true
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
export const CustomIcon = {
|
|
73
|
+
args: {
|
|
74
|
+
url: "http://localhost:8080/fhir",
|
|
75
|
+
showCopy: true,
|
|
76
|
+
showEye: true,
|
|
77
|
+
copyIcon: /*#__PURE__*/ _jsx(Check, {}),
|
|
78
|
+
tooltipText: "Copy URL",
|
|
79
|
+
showToast: true
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
export const CustomTooltip = {
|
|
83
|
+
args: {
|
|
84
|
+
url: "http://localhost:8080/fhir",
|
|
85
|
+
showCopy: true,
|
|
86
|
+
showEye: true,
|
|
87
|
+
copyIcon: /*#__PURE__*/ _jsx(Copy, {}),
|
|
88
|
+
tooltipText: "Copy link",
|
|
89
|
+
showToast: true
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
export const WithoutToast = {
|
|
93
|
+
args: {
|
|
94
|
+
url: "http://localhost:8080/fhir",
|
|
95
|
+
showCopy: true,
|
|
96
|
+
showEye: true,
|
|
97
|
+
copyIcon: /*#__PURE__*/ _jsx(Copy, {}),
|
|
98
|
+
tooltipText: "Copy URL",
|
|
99
|
+
showToast: false
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
export const WithCallback = {
|
|
103
|
+
args: {
|
|
104
|
+
url: "http://localhost:8080/fhir",
|
|
105
|
+
showCopy: true,
|
|
106
|
+
showEye: true,
|
|
107
|
+
copyIcon: /*#__PURE__*/ _jsx(Copy, {}),
|
|
108
|
+
tooltipText: "Copy URL",
|
|
109
|
+
showToast: true,
|
|
110
|
+
onCopy: (text)=>{
|
|
111
|
+
console.log("Copied:", text);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
export const WithoutEye = {
|
|
116
|
+
args: {
|
|
117
|
+
url: "http://localhost:8080/fhir",
|
|
118
|
+
showCopy: true,
|
|
119
|
+
showEye: false,
|
|
120
|
+
copyIcon: /*#__PURE__*/ _jsx(Copy, {}),
|
|
121
|
+
tooltipText: "Copy URL",
|
|
122
|
+
showToast: true
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
//# sourceMappingURL=sandbox.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/sandbox.stories.tsx"],"sourcesContent":["import { Check, Copy } from \"lucide-react\";\nimport { Sandbox } from \"./sandbox\";\n\nconst meta = {\n\ttitle: \"Component/Sandbox\",\n\tcomponent: Sandbox,\n\tparameters: {\n\t\tlayout: \"centered\",\n\t},\n\ttags: [\"autodocs\"],\n\targTypes: {\n\t\turl: {\n\t\t\tcontrol: \"text\",\n\t\t\tdescription: \"Display url\",\n\t\t},\n\t\tshowCopy: {\n\t\t\tcontrol: \"boolean\",\n\t\t\tdescription: \"Show the copy button\",\n\t\t},\n\t\tshowEye: {\n\t\t\tcontrol: \"boolean\",\n\t\t\tdescription: \"Show the eye button\",\n\t\t},\n\t\tcopyIcon: {\n\t\t\tcontrol: false,\n\t\t\tdescription: \"Show the copy icon\",\n\t\t},\n\t\ttooltipText: {\n\t\t\tcontrol: \"text\",\n\t\t\tdescription: \"Copy button tooltip text\",\n\t\t},\n\t\tshowToast: {\n\t\t\tcontrol: \"boolean\",\n\t\t\tdescription: \"Show toast on copy\",\n\t\t},\n\t\tonCopy: {\n\t\t\taction: \"copied\",\n\t\t\tdescription: \"Successful copy callback\",\n\t\t},\n\t},\n};\n\nexport default meta;\n\nexport const Default = {\n\targs: {\n\t\turl: \"http://localhost:8080/fhir\",\n\t\tshowCopy: true,\n\t\tshowEye: true,\n\t\tcopyIcon: <Copy />,\n\t\ttooltipText: \"Copy URL\",\n\t\tshowToast: true,\n\t},\n};\n\nexport const LongUrl = {\n\targs: {\n\t\turl: \"https://very-long-domain-name-that-should-be-truncated.example.com/api/v1/very-long-endpoint-name\",\n\t\tshowCopy: true,\n\t\tshowEye: true,\n\t\tcopyIcon: <Copy />,\n\t\ttooltipText: \"Copy URL\",\n\t\tshowToast: true,\n\t},\n};\n\nexport const WithoutCopy = {\n\targs: {\n\t\turl: \"http://localhost:8080/fhir\",\n\t\tshowCopy: false,\n\t\tshowEye: true,\n\t},\n};\n\nexport const CustomIcon = {\n\targs: {\n\t\turl: \"http://localhost:8080/fhir\",\n\t\tshowCopy: true,\n\t\tshowEye: true,\n\t\tcopyIcon: <Check />,\n\t\ttooltipText: \"Copy URL\",\n\t\tshowToast: true,\n\t},\n};\n\nexport const CustomTooltip = {\n\targs: {\n\t\turl: \"http://localhost:8080/fhir\",\n\t\tshowCopy: true,\n\t\tshowEye: true,\n\t\tcopyIcon: <Copy />,\n\t\ttooltipText: \"Copy link\",\n\t\tshowToast: true,\n\t},\n};\n\nexport const WithoutToast = {\n\targs: {\n\t\turl: \"http://localhost:8080/fhir\",\n\t\tshowCopy: true,\n\t\tshowEye: true,\n\t\tcopyIcon: <Copy />,\n\t\ttooltipText: \"Copy URL\",\n\t\tshowToast: false,\n\t},\n};\n\nexport const WithCallback = {\n\targs: {\n\t\turl: \"http://localhost:8080/fhir\",\n\t\tshowCopy: true,\n\t\tshowEye: true,\n\t\tcopyIcon: <Copy />,\n\t\ttooltipText: \"Copy URL\",\n\t\tshowToast: true,\n\t\tonCopy: (text: string) => {\n\t\t\tconsole.log(\"Copied:\", text);\n\t\t},\n\t},\n};\n\nexport const WithoutEye = {\n\targs: {\n\t\turl: \"http://localhost:8080/fhir\",\n\t\tshowCopy: true,\n\t\tshowEye: false,\n\t\tcopyIcon: <Copy />,\n\t\ttooltipText: \"Copy URL\",\n\t\tshowToast: true,\n\t},\n};\n"],"names":["Check","Copy","Sandbox","meta","title","component","parameters","layout","tags","argTypes","url","control","description","showCopy","showEye","copyIcon","tooltipText","showToast","onCopy","action","Default","args","LongUrl","WithoutCopy","CustomIcon","CustomTooltip","WithoutToast","WithCallback","text","console","log","WithoutEye"],"mappings":";AAAA,SAASA,KAAK,EAAEC,IAAI,QAAQ,eAAe;AAC3C,SAASC,OAAO,QAAQ,eAAY;AAEpC,MAAMC,OAAO;IACZC,OAAO;IACPC,WAAWH;IACXI,YAAY;QACXC,QAAQ;IACT;IACAC,MAAM;QAAC;KAAW;IAClBC,UAAU;QACTC,KAAK;YACJC,SAAS;YACTC,aAAa;QACd;QACAC,UAAU;YACTF,SAAS;YACTC,aAAa;QACd;QACAE,SAAS;YACRH,SAAS;YACTC,aAAa;QACd;QACAG,UAAU;YACTJ,SAAS;YACTC,aAAa;QACd;QACAI,aAAa;YACZL,SAAS;YACTC,aAAa;QACd;QACAK,WAAW;YACVN,SAAS;YACTC,aAAa;QACd;QACAM,QAAQ;YACPC,QAAQ;YACRP,aAAa;QACd;IACD;AACD;AAEA,eAAeT,KAAK;AAEpB,OAAO,MAAMiB,UAAU;IACtBC,MAAM;QACLX,KAAK;QACLG,UAAU;QACVC,SAAS;QACTC,wBAAU,KAACd;QACXe,aAAa;QACbC,WAAW;IACZ;AACD,EAAE;AAEF,OAAO,MAAMK,UAAU;IACtBD,MAAM;QACLX,KAAK;QACLG,UAAU;QACVC,SAAS;QACTC,wBAAU,KAACd;QACXe,aAAa;QACbC,WAAW;IACZ;AACD,EAAE;AAEF,OAAO,MAAMM,cAAc;IAC1BF,MAAM;QACLX,KAAK;QACLG,UAAU;QACVC,SAAS;IACV;AACD,EAAE;AAEF,OAAO,MAAMU,aAAa;IACzBH,MAAM;QACLX,KAAK;QACLG,UAAU;QACVC,SAAS;QACTC,wBAAU,KAACf;QACXgB,aAAa;QACbC,WAAW;IACZ;AACD,EAAE;AAEF,OAAO,MAAMQ,gBAAgB;IAC5BJ,MAAM;QACLX,KAAK;QACLG,UAAU;QACVC,SAAS;QACTC,wBAAU,KAACd;QACXe,aAAa;QACbC,WAAW;IACZ;AACD,EAAE;AAEF,OAAO,MAAMS,eAAe;IAC3BL,MAAM;QACLX,KAAK;QACLG,UAAU;QACVC,SAAS;QACTC,wBAAU,KAACd;QACXe,aAAa;QACbC,WAAW;IACZ;AACD,EAAE;AAEF,OAAO,MAAMU,eAAe;IAC3BN,MAAM;QACLX,KAAK;QACLG,UAAU;QACVC,SAAS;QACTC,wBAAU,KAACd;QACXe,aAAa;QACbC,WAAW;QACXC,QAAQ,CAACU;YACRC,QAAQC,GAAG,CAAC,WAAWF;QACxB;IACD;AACD,EAAE;AAEF,OAAO,MAAMG,aAAa;IACzBV,MAAM;QACLX,KAAK;QACLG,UAAU;QACVC,SAAS;QACTC,wBAAU,KAACd;QACXe,aAAa;QACbC,WAAW;IACZ;AACD,EAAE"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
interface SegmentControlProps<T extends string> {
|
|
3
|
+
value: T;
|
|
4
|
+
onValueChange: (value: T) => void;
|
|
5
|
+
items: {
|
|
6
|
+
value: T;
|
|
7
|
+
label: ReactNode;
|
|
8
|
+
}[];
|
|
9
|
+
}
|
|
10
|
+
declare function SegmentControl<T extends string>({ value, onValueChange, items, }: SegmentControlProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export { SegmentControl };
|
|
12
|
+
export type { SegmentControlProps };
|
|
13
|
+
//# sourceMappingURL=segment-control.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"segment-control.d.ts","sourceRoot":"","sources":["../../../src/components/segment-control.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAqCvC,UAAU,mBAAmB,CAAC,CAAC,SAAS,MAAM;IAC7C,KAAK,EAAE,CAAC,CAAC;IACT,aAAa,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;IAClC,KAAK,EAAE;QAAE,KAAK,EAAE,CAAC,CAAC;QAAC,KAAK,EAAE,SAAS,CAAA;KAAE,EAAE,CAAC;CACxC;AAED,iBAAS,cAAc,CAAC,CAAC,SAAS,MAAM,EAAE,EACzC,KAAK,EACL,aAAa,EACb,KAAK,GACL,EAAE,mBAAmB,CAAC,CAAC,CAAC,2CAgCxB;AAED,OAAO,EAAE,cAAc,EAAE,CAAC;AAC1B,YAAY,EAAE,mBAAmB,EAAE,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../shadcn/lib/utils.js";
|
|
3
|
+
// Container: h-24px, p-2px, rounded-full, bg-secondary_inverse
|
|
4
|
+
const containerClass = cn("inline-flex", "h-6", "p-0.5", "bg-bg-secondary_inverse", "rounded-full", "border", "border-transparent", "outline-none", "transition-all", "focus-visible:border-border-link", "focus-visible:ring-4", "focus-visible:ring-ring-blue");
|
|
5
|
+
// Item: px-8px py-2px, rounded-full (16px), typo-body
|
|
6
|
+
const itemBaseClass = cn("flex", "items-center", "justify-center", "px-2", "py-0.5", "typo-body", "leading-4", "cursor-pointer", "rounded-full", "select-none", "transition-colors");
|
|
7
|
+
const itemInactiveClass = "text-text-quternary_on-brand";
|
|
8
|
+
const itemActiveClass = "bg-bg-primary text-text-primary";
|
|
9
|
+
function SegmentControl({ value, onValueChange, items }) {
|
|
10
|
+
const isToggle = items.length === 2;
|
|
11
|
+
return /*#__PURE__*/ _jsx("div", {
|
|
12
|
+
className: containerClass,
|
|
13
|
+
children: items.map((item)=>{
|
|
14
|
+
const isActive = item.value === value;
|
|
15
|
+
return /*#__PURE__*/ _jsx("button", {
|
|
16
|
+
type: "button",
|
|
17
|
+
className: cn(itemBaseClass, isActive ? itemActiveClass : itemInactiveClass),
|
|
18
|
+
onClick: ()=>{
|
|
19
|
+
if (isToggle) {
|
|
20
|
+
const other = items.find((i)=>i.value !== item.value);
|
|
21
|
+
onValueChange(isActive ? other?.value ?? item.value : item.value);
|
|
22
|
+
} else if (!isActive) {
|
|
23
|
+
onValueChange(item.value);
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
children: item.label
|
|
27
|
+
}, item.value);
|
|
28
|
+
})
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
export { SegmentControl };
|
|
32
|
+
|
|
33
|
+
//# sourceMappingURL=segment-control.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/segment-control.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport { cn } from \"#shadcn/lib/utils.js\";\n\n// Container: h-24px, p-2px, rounded-full, bg-secondary_inverse\nconst containerClass = cn(\n\t\"inline-flex\",\n\t\"h-6\",\n\t\"p-0.5\",\n\t\"bg-bg-secondary_inverse\",\n\t\"rounded-full\",\n\t\"border\",\n\t\"border-transparent\",\n\t\"outline-none\",\n\t\"transition-all\",\n\t\"focus-visible:border-border-link\",\n\t\"focus-visible:ring-4\",\n\t\"focus-visible:ring-ring-blue\",\n);\n\n// Item: px-8px py-2px, rounded-full (16px), typo-body\nconst itemBaseClass = cn(\n\t\"flex\",\n\t\"items-center\",\n\t\"justify-center\",\n\t\"px-2\",\n\t\"py-0.5\",\n\t\"typo-body\",\n\t\"leading-4\",\n\t\"cursor-pointer\",\n\t\"rounded-full\",\n\t\"select-none\",\n\t\"transition-colors\",\n);\n\nconst itemInactiveClass = \"text-text-quternary_on-brand\";\nconst itemActiveClass = \"bg-bg-primary text-text-primary\";\n\ninterface SegmentControlProps<T extends string> {\n\tvalue: T;\n\tonValueChange: (value: T) => void;\n\titems: { value: T; label: ReactNode }[];\n}\n\nfunction SegmentControl<T extends string>({\n\tvalue,\n\tonValueChange,\n\titems,\n}: SegmentControlProps<T>) {\n\tconst isToggle = items.length === 2;\n\n\treturn (\n\t\t<div className={containerClass}>\n\t\t\t{items.map((item) => {\n\t\t\t\tconst isActive = item.value === value;\n\t\t\t\treturn (\n\t\t\t\t\t<button\n\t\t\t\t\t\tkey={item.value}\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\titemBaseClass,\n\t\t\t\t\t\t\tisActive ? itemActiveClass : itemInactiveClass,\n\t\t\t\t\t\t)}\n\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\tif (isToggle) {\n\t\t\t\t\t\t\t\tconst other = items.find((i) => i.value !== item.value);\n\t\t\t\t\t\t\t\tonValueChange(\n\t\t\t\t\t\t\t\t\tisActive ? (other?.value ?? item.value) : item.value,\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} else if (!isActive) {\n\t\t\t\t\t\t\t\tonValueChange(item.value);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t{item.label}\n\t\t\t\t\t</button>\n\t\t\t\t);\n\t\t\t})}\n\t\t</div>\n\t);\n}\n\nexport { SegmentControl };\nexport type { SegmentControlProps };\n"],"names":["cn","containerClass","itemBaseClass","itemInactiveClass","itemActiveClass","SegmentControl","value","onValueChange","items","isToggle","length","div","className","map","item","isActive","button","type","onClick","other","find","i","label"],"mappings":";AACA,SAASA,EAAE,QAAQ,yBAAuB;AAE1C,+DAA+D;AAC/D,MAAMC,iBAAiBD,GACtB,eACA,OACA,SACA,2BACA,gBACA,UACA,sBACA,gBACA,kBACA,oCACA,wBACA;AAGD,sDAAsD;AACtD,MAAME,gBAAgBF,GACrB,QACA,gBACA,kBACA,QACA,UACA,aACA,aACA,kBACA,gBACA,eACA;AAGD,MAAMG,oBAAoB;AAC1B,MAAMC,kBAAkB;AAQxB,SAASC,eAAiC,EACzCC,KAAK,EACLC,aAAa,EACbC,KAAK,EACmB;IACxB,MAAMC,WAAWD,MAAME,MAAM,KAAK;IAElC,qBACC,KAACC;QAAIC,WAAWX;kBACdO,MAAMK,GAAG,CAAC,CAACC;YACX,MAAMC,WAAWD,KAAKR,KAAK,KAAKA;YAChC,qBACC,KAACU;gBAEAC,MAAK;gBACLL,WAAWZ,GACVE,eACAa,WAAWX,kBAAkBD;gBAE9Be,SAAS;oBACR,IAAIT,UAAU;wBACb,MAAMU,QAAQX,MAAMY,IAAI,CAAC,CAACC,IAAMA,EAAEf,KAAK,KAAKQ,KAAKR,KAAK;wBACtDC,cACCQ,WAAYI,OAAOb,SAASQ,KAAKR,KAAK,GAAIQ,KAAKR,KAAK;oBAEtD,OAAO,IAAI,CAACS,UAAU;wBACrBR,cAAcO,KAAKR,KAAK;oBACzB;gBACD;0BAECQ,KAAKQ,KAAK;eAjBNR,KAAKR,KAAK;QAoBlB;;AAGH;AAEA,SAASD,cAAc,GAAG"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { SegmentControl } from "./segment-control.js";
|
|
4
|
+
const meta = {
|
|
5
|
+
title: "Component/SegmentControl",
|
|
6
|
+
component: SegmentControl,
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: "centered"
|
|
9
|
+
},
|
|
10
|
+
tags: [
|
|
11
|
+
"autodocs"
|
|
12
|
+
]
|
|
13
|
+
};
|
|
14
|
+
export default meta;
|
|
15
|
+
export const Default = {
|
|
16
|
+
args: {
|
|
17
|
+
value: "yaml",
|
|
18
|
+
onValueChange: ()=>{},
|
|
19
|
+
items: [
|
|
20
|
+
{
|
|
21
|
+
value: "yaml",
|
|
22
|
+
label: "YAML"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
value: "json",
|
|
26
|
+
label: "JSON"
|
|
27
|
+
}
|
|
28
|
+
]
|
|
29
|
+
},
|
|
30
|
+
render: (args)=>{
|
|
31
|
+
const [value, setValue] = useState(args.value);
|
|
32
|
+
return /*#__PURE__*/ _jsx(SegmentControl, {
|
|
33
|
+
value: value,
|
|
34
|
+
onValueChange: setValue,
|
|
35
|
+
items: args.items
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
export const MoreThanTwo = {
|
|
40
|
+
args: {
|
|
41
|
+
value: "yaml",
|
|
42
|
+
onValueChange: ()=>{},
|
|
43
|
+
items: [
|
|
44
|
+
{
|
|
45
|
+
value: "yaml",
|
|
46
|
+
label: "YAML"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
value: "json",
|
|
50
|
+
label: "JSON"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
value: "toml",
|
|
54
|
+
label: "TOML"
|
|
55
|
+
}
|
|
56
|
+
]
|
|
57
|
+
},
|
|
58
|
+
render: (args)=>{
|
|
59
|
+
const [value, setValue] = useState(args.value);
|
|
60
|
+
return /*#__PURE__*/ _jsx(SegmentControl, {
|
|
61
|
+
value: value,
|
|
62
|
+
onValueChange: setValue,
|
|
63
|
+
items: args.items
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
//# sourceMappingURL=segment-control.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/segment-control.stories.tsx"],"sourcesContent":["import type { Meta, StoryObj } from \"@storybook/react-vite\";\nimport { useState } from \"react\";\n\nimport { SegmentControl } from \"./segment-control\";\n\nconst meta = {\n\ttitle: \"Component/SegmentControl\",\n\tcomponent: SegmentControl,\n\tparameters: {\n\t\tlayout: \"centered\",\n\t},\n\ttags: [\"autodocs\"],\n} satisfies Meta<typeof SegmentControl>;\n\nexport default meta;\ntype Story = StoryObj<typeof meta>;\n\nexport const Default: Story = {\n\targs: {\n\t\tvalue: \"yaml\",\n\t\tonValueChange: () => {},\n\t\titems: [\n\t\t\t{ value: \"yaml\", label: \"YAML\" },\n\t\t\t{ value: \"json\", label: \"JSON\" },\n\t\t],\n\t},\n\trender: (args) => {\n\t\tconst [value, setValue] = useState(args.value);\n\n\t\treturn (\n\t\t\t<SegmentControl\n\t\t\t\tvalue={value}\n\t\t\t\tonValueChange={setValue}\n\t\t\t\titems={args.items}\n\t\t\t/>\n\t\t);\n\t},\n};\n\nexport const MoreThanTwo: Story = {\n\targs: {\n\t\tvalue: \"yaml\",\n\t\tonValueChange: () => {},\n\t\titems: [\n\t\t\t{ value: \"yaml\", label: \"YAML\" },\n\t\t\t{ value: \"json\", label: \"JSON\" },\n\t\t\t{ value: \"toml\", label: \"TOML\" },\n\t\t],\n\t},\n\trender: (args) => {\n\t\tconst [value, setValue] = useState(args.value);\n\n\t\treturn (\n\t\t\t<SegmentControl\n\t\t\t\tvalue={value}\n\t\t\t\tonValueChange={setValue}\n\t\t\t\titems={args.items}\n\t\t\t/>\n\t\t);\n\t},\n};\n"],"names":["useState","SegmentControl","meta","title","component","parameters","layout","tags","Default","args","value","onValueChange","items","label","render","setValue","MoreThanTwo"],"mappings":";AACA,SAASA,QAAQ,QAAQ,QAAQ;AAEjC,SAASC,cAAc,QAAQ,uBAAoB;AAEnD,MAAMC,OAAO;IACZC,OAAO;IACPC,WAAWH;IACXI,YAAY;QACXC,QAAQ;IACT;IACAC,MAAM;QAAC;KAAW;AACnB;AAEA,eAAeL,KAAK;AAGpB,OAAO,MAAMM,UAAiB;IAC7BC,MAAM;QACLC,OAAO;QACPC,eAAe,KAAO;QACtBC,OAAO;YACN;gBAAEF,OAAO;gBAAQG,OAAO;YAAO;YAC/B;gBAAEH,OAAO;gBAAQG,OAAO;YAAO;SAC/B;IACF;IACAC,QAAQ,CAACL;QACR,MAAM,CAACC,OAAOK,SAAS,GAAGf,SAASS,KAAKC,KAAK;QAE7C,qBACC,KAACT;YACAS,OAAOA;YACPC,eAAeI;YACfH,OAAOH,KAAKG,KAAK;;IAGpB;AACD,EAAE;AAEF,OAAO,MAAMI,cAAqB;IACjCP,MAAM;QACLC,OAAO;QACPC,eAAe,KAAO;QACtBC,OAAO;YACN;gBAAEF,OAAO;gBAAQG,OAAO;YAAO;YAC/B;gBAAEH,OAAO;gBAAQG,OAAO;YAAO;YAC/B;gBAAEH,OAAO;gBAAQG,OAAO;YAAO;SAC/B;IACF;IACAC,QAAQ,CAACL;QACR,MAAM,CAACC,OAAOK,SAAS,GAAGf,SAASS,KAAKC,KAAK;QAE7C,qBACC,KAACT;YACAS,OAAOA;YACPC,eAAeI;YACfH,OAAOH,KAAKG,KAAK;;IAGpB;AACD,EAAE"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type VariantProps } from "class-variance-authority";
|
|
2
|
+
import type React from "react";
|
|
3
|
+
declare const splitButtonVariants: (props?: ({
|
|
4
|
+
size?: "small" | "regular" | null | undefined;
|
|
5
|
+
disabled?: boolean | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
+
export interface SplitButtonProps extends Omit<React.ComponentProps<"div">, "children">, VariantProps<typeof splitButtonVariants> {
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
}
|
|
10
|
+
declare function SplitButton({ children, size, disabled, className, ...props }: SplitButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export { SplitButton };
|
|
12
|
+
//# sourceMappingURL=split-button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"split-button.d.ts","sourceRoot":"","sources":["../../../src/components/split-button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAU/B,QAAA,MAAM,mBAAmB;;;8EAqCvB,CAAC;AAEH,MAAM,WAAW,gBAChB,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC,EACpD,YAAY,CAAC,OAAO,mBAAmB,CAAC;IACzC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC1B;AAED,iBAAS,WAAW,CAAC,EACpB,QAAQ,EACR,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,GAAG,KAAK,EACR,EAAE,gBAAgB,2CASlB;AAED,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
3
|
+
import { cn } from "../shadcn/lib/utils.js";
|
|
4
|
+
const splitButtonBaseStyles = cn("flex", "*:data-[slot=button]:rounded-r-none", "*:data-[slot=dropdown-menu-trigger]:rounded-l-none", "*:data-[slot=dropdown-menu-trigger]:border-l-0");
|
|
5
|
+
const splitButtonVariants = cva(splitButtonBaseStyles, {
|
|
6
|
+
variants: {
|
|
7
|
+
size: {
|
|
8
|
+
regular: cn("*:data-[slot=button]:h-9", "*:data-[slot=button]:px-4", "*:data-[slot=button]:typo-label", "*:data-[slot=dropdown-menu-trigger]:h-9", "*:data-[slot=dropdown-menu-trigger]:px-1", "*:data-[slot=dropdown-menu-trigger]:py-2"),
|
|
9
|
+
small: cn("*:data-[slot=button]:h-6", "*:data-[slot=button]:px-2", "*:data-[slot=button]:gap-1", "*:data-[slot=button]:typo-button-label-xs", "*:data-[slot=dropdown-menu-trigger]:h-6", "*:data-[slot=dropdown-menu-trigger]:px-1", "*:data-[slot=dropdown-menu-trigger]:py-1")
|
|
10
|
+
},
|
|
11
|
+
disabled: {
|
|
12
|
+
true: cn("*:data-[slot=button]:disabled:bg-bg-primary", "*:data-[slot=button]:disabled:text-text-disabled", "*:data-[slot=button]:disabled:border-border-disabled", "*:data-[slot=dropdown-menu-trigger]:disabled:bg-bg-primary", "*:data-[slot=dropdown-menu-trigger]:disabled:text-text-disabled", "*:data-[slot=dropdown-menu-trigger]:disabled:border-border-disabled"),
|
|
13
|
+
false: ""
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
defaultVariants: {
|
|
17
|
+
size: "regular",
|
|
18
|
+
disabled: false
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
function SplitButton({ children, size, disabled, className, ...props }) {
|
|
22
|
+
return /*#__PURE__*/ _jsx("div", {
|
|
23
|
+
className: cn(splitButtonVariants({
|
|
24
|
+
size,
|
|
25
|
+
disabled
|
|
26
|
+
}), className),
|
|
27
|
+
...props,
|
|
28
|
+
children: children
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
export { SplitButton };
|
|
32
|
+
|
|
33
|
+
//# sourceMappingURL=split-button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/split-button.tsx"],"sourcesContent":["import { cva, type VariantProps } from \"class-variance-authority\";\nimport type React from \"react\";\nimport { cn } from \"#shadcn/lib/utils\";\n\nconst splitButtonBaseStyles = cn(\n\t\"flex\",\n\t\"*:data-[slot=button]:rounded-r-none\",\n\t\"*:data-[slot=dropdown-menu-trigger]:rounded-l-none\",\n\t\"*:data-[slot=dropdown-menu-trigger]:border-l-0\",\n);\n\nconst splitButtonVariants = cva(splitButtonBaseStyles, {\n\tvariants: {\n\t\tsize: {\n\t\t\tregular: cn(\n\t\t\t\t\"*:data-[slot=button]:h-9\",\n\t\t\t\t\"*:data-[slot=button]:px-4\",\n\t\t\t\t\"*:data-[slot=button]:typo-label\",\n\t\t\t\t\"*:data-[slot=dropdown-menu-trigger]:h-9\",\n\t\t\t\t\"*:data-[slot=dropdown-menu-trigger]:px-1\",\n\t\t\t\t\"*:data-[slot=dropdown-menu-trigger]:py-2\",\n\t\t\t),\n\t\t\tsmall: cn(\n\t\t\t\t\"*:data-[slot=button]:h-6\",\n\t\t\t\t\"*:data-[slot=button]:px-2\",\n\t\t\t\t\"*:data-[slot=button]:gap-1\",\n\t\t\t\t\"*:data-[slot=button]:typo-button-label-xs\",\n\t\t\t\t\"*:data-[slot=dropdown-menu-trigger]:h-6\",\n\t\t\t\t\"*:data-[slot=dropdown-menu-trigger]:px-1\",\n\t\t\t\t\"*:data-[slot=dropdown-menu-trigger]:py-1\",\n\t\t\t),\n\t\t},\n\t\tdisabled: {\n\t\t\ttrue: cn(\n\t\t\t\t\"*:data-[slot=button]:disabled:bg-bg-primary\",\n\t\t\t\t\"*:data-[slot=button]:disabled:text-text-disabled\",\n\t\t\t\t\"*:data-[slot=button]:disabled:border-border-disabled\",\n\t\t\t\t\"*:data-[slot=dropdown-menu-trigger]:disabled:bg-bg-primary\",\n\t\t\t\t\"*:data-[slot=dropdown-menu-trigger]:disabled:text-text-disabled\",\n\t\t\t\t\"*:data-[slot=dropdown-menu-trigger]:disabled:border-border-disabled\",\n\t\t\t),\n\t\t\tfalse: \"\",\n\t\t},\n\t},\n\tdefaultVariants: {\n\t\tsize: \"regular\",\n\t\tdisabled: false,\n\t},\n});\n\nexport interface SplitButtonProps\n\textends Omit<React.ComponentProps<\"div\">, \"children\">,\n\t\tVariantProps<typeof splitButtonVariants> {\n\tchildren: React.ReactNode;\n}\n\nfunction SplitButton({\n\tchildren,\n\tsize,\n\tdisabled,\n\tclassName,\n\t...props\n}: SplitButtonProps) {\n\treturn (\n\t\t<div\n\t\t\tclassName={cn(splitButtonVariants({ size, disabled }), className)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{children}\n\t\t</div>\n\t);\n}\n\nexport { SplitButton };\n"],"names":["cva","cn","splitButtonBaseStyles","splitButtonVariants","variants","size","regular","small","disabled","true","false","defaultVariants","SplitButton","children","className","props","div"],"mappings":";AAAA,SAASA,GAAG,QAA2B,2BAA2B;AAElE,SAASC,EAAE,QAAQ,yBAAoB;AAEvC,MAAMC,wBAAwBD,GAC7B,QACA,uCACA,sDACA;AAGD,MAAME,sBAAsBH,IAAIE,uBAAuB;IACtDE,UAAU;QACTC,MAAM;YACLC,SAASL,GACR,4BACA,6BACA,mCACA,2CACA,4CACA;YAEDM,OAAON,GACN,4BACA,6BACA,8BACA,6CACA,2CACA,4CACA;QAEF;QACAO,UAAU;YACTC,MAAMR,GACL,+CACA,oDACA,wDACA,8DACA,mEACA;YAEDS,OAAO;QACR;IACD;IACAC,iBAAiB;QAChBN,MAAM;QACNG,UAAU;IACX;AACD;AAQA,SAASI,YAAY,EACpBC,QAAQ,EACRR,IAAI,EACJG,QAAQ,EACRM,SAAS,EACT,GAAGC,OACe;IAClB,qBACC,KAACC;QACAF,WAAWb,GAAGE,oBAAoB;YAAEE;YAAMG;QAAS,IAAIM;QACtD,GAAGC,KAAK;kBAERF;;AAGJ;AAEA,SAASD,WAAW,GAAG"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ChevronDown, Plus, Save } from "lucide-react";
|
|
3
|
+
import { Button } from "../shadcn/components/ui/button.js";
|
|
4
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger } from "../shadcn/components/ui/dropdown-menu.js";
|
|
5
|
+
import { SplitButton } from "./split-button.js";
|
|
6
|
+
const meta = {
|
|
7
|
+
title: "Component/SplitButton",
|
|
8
|
+
component: SplitButton,
|
|
9
|
+
parameters: {
|
|
10
|
+
layout: "centered"
|
|
11
|
+
},
|
|
12
|
+
tags: [
|
|
13
|
+
"autodocs"
|
|
14
|
+
],
|
|
15
|
+
argTypes: {
|
|
16
|
+
size: {
|
|
17
|
+
control: "select",
|
|
18
|
+
options: [
|
|
19
|
+
"regular",
|
|
20
|
+
"small"
|
|
21
|
+
],
|
|
22
|
+
description: "Size of the split button"
|
|
23
|
+
},
|
|
24
|
+
disabled: {
|
|
25
|
+
control: "boolean",
|
|
26
|
+
description: "Disabled state of the split button"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
export default meta;
|
|
31
|
+
export const Default = {
|
|
32
|
+
args: {
|
|
33
|
+
size: "regular",
|
|
34
|
+
disabled: false
|
|
35
|
+
},
|
|
36
|
+
render: (args)=>/*#__PURE__*/ _jsxs(SplitButton, {
|
|
37
|
+
...args,
|
|
38
|
+
children: [
|
|
39
|
+
/*#__PURE__*/ _jsxs(Button, {
|
|
40
|
+
variant: "secondary",
|
|
41
|
+
disabled: args.disabled ?? false,
|
|
42
|
+
children: [
|
|
43
|
+
/*#__PURE__*/ _jsx(Save, {}),
|
|
44
|
+
"Save"
|
|
45
|
+
]
|
|
46
|
+
}),
|
|
47
|
+
/*#__PURE__*/ _jsxs(DropdownMenu, {
|
|
48
|
+
children: [
|
|
49
|
+
/*#__PURE__*/ _jsx(DropdownMenuTrigger, {
|
|
50
|
+
asChild: true,
|
|
51
|
+
children: /*#__PURE__*/ _jsx(Button, {
|
|
52
|
+
variant: "secondary",
|
|
53
|
+
disabled: args.disabled ?? false,
|
|
54
|
+
children: /*#__PURE__*/ _jsx(ChevronDown, {})
|
|
55
|
+
})
|
|
56
|
+
}),
|
|
57
|
+
/*#__PURE__*/ _jsxs(DropdownMenuContent, {
|
|
58
|
+
children: [
|
|
59
|
+
/*#__PURE__*/ _jsx(DropdownMenuLabel, {
|
|
60
|
+
children: "Save to collection:"
|
|
61
|
+
}),
|
|
62
|
+
/*#__PURE__*/ _jsx(DropdownMenuSeparator, {}),
|
|
63
|
+
/*#__PURE__*/ _jsx(DropdownMenuItem, {
|
|
64
|
+
disabled: true,
|
|
65
|
+
children: "No collections"
|
|
66
|
+
}),
|
|
67
|
+
/*#__PURE__*/ _jsx(DropdownMenuSeparator, {}),
|
|
68
|
+
/*#__PURE__*/ _jsxs(DropdownMenuItem, {
|
|
69
|
+
children: [
|
|
70
|
+
/*#__PURE__*/ _jsx(Plus, {
|
|
71
|
+
className: "text-fg-link"
|
|
72
|
+
}),
|
|
73
|
+
"New collection"
|
|
74
|
+
]
|
|
75
|
+
})
|
|
76
|
+
]
|
|
77
|
+
})
|
|
78
|
+
]
|
|
79
|
+
})
|
|
80
|
+
]
|
|
81
|
+
})
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
//# sourceMappingURL=split-button.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/split-button.stories.tsx"],"sourcesContent":["import type { StoryObj } from \"@storybook/react-vite\";\nimport { ChevronDown, Plus, Save } from \"lucide-react\";\nimport { Button } from \"#shadcn/components/ui/button.js\";\nimport {\n\tDropdownMenu,\n\tDropdownMenuContent,\n\tDropdownMenuItem,\n\tDropdownMenuLabel,\n\tDropdownMenuSeparator,\n\tDropdownMenuTrigger,\n} from \"#shadcn/components/ui/dropdown-menu.js\";\nimport { SplitButton } from \"./split-button\";\n\nconst meta = {\n\ttitle: \"Component/SplitButton\",\n\tcomponent: SplitButton,\n\tparameters: {\n\t\tlayout: \"centered\",\n\t},\n\ttags: [\"autodocs\"],\n\targTypes: {\n\t\tsize: {\n\t\t\tcontrol: \"select\",\n\t\t\toptions: [\"regular\", \"small\"],\n\t\t\tdescription: \"Size of the split button\",\n\t\t},\n\t\tdisabled: {\n\t\t\tcontrol: \"boolean\",\n\t\t\tdescription: \"Disabled state of the split button\",\n\t\t},\n\t},\n};\n\nexport default meta;\n\ntype Story = StoryObj<typeof SplitButton>;\n\nexport const Default: Story = {\n\targs: {\n\t\tsize: \"regular\",\n\t\tdisabled: false,\n\t},\n\trender: (args) => (\n\t\t<SplitButton {...args}>\n\t\t\t<Button variant=\"secondary\" disabled={args.disabled ?? false}>\n\t\t\t\t<Save />\n\t\t\t\tSave\n\t\t\t</Button>\n\t\t\t<DropdownMenu>\n\t\t\t\t<DropdownMenuTrigger asChild>\n\t\t\t\t\t<Button variant=\"secondary\" disabled={args.disabled ?? false}>\n\t\t\t\t\t\t<ChevronDown />\n\t\t\t\t\t</Button>\n\t\t\t\t</DropdownMenuTrigger>\n\t\t\t\t<DropdownMenuContent>\n\t\t\t\t\t<DropdownMenuLabel>Save to collection:</DropdownMenuLabel>\n\t\t\t\t\t<DropdownMenuSeparator />\n\t\t\t\t\t<DropdownMenuItem disabled>No collections</DropdownMenuItem>\n\t\t\t\t\t<DropdownMenuSeparator />\n\t\t\t\t\t<DropdownMenuItem>\n\t\t\t\t\t\t<Plus className=\"text-fg-link\" />\n\t\t\t\t\t\tNew collection\n\t\t\t\t\t</DropdownMenuItem>\n\t\t\t\t</DropdownMenuContent>\n\t\t\t</DropdownMenu>\n\t\t</SplitButton>\n\t),\n};\n"],"names":["ChevronDown","Plus","Save","Button","DropdownMenu","DropdownMenuContent","DropdownMenuItem","DropdownMenuLabel","DropdownMenuSeparator","DropdownMenuTrigger","SplitButton","meta","title","component","parameters","layout","tags","argTypes","size","control","options","description","disabled","Default","args","render","variant","asChild","className"],"mappings":";AACA,SAASA,WAAW,EAAEC,IAAI,EAAEC,IAAI,QAAQ,eAAe;AACvD,SAASC,MAAM,QAAQ,oCAAkC;AACzD,SACCC,YAAY,EACZC,mBAAmB,EACnBC,gBAAgB,EAChBC,iBAAiB,EACjBC,qBAAqB,EACrBC,mBAAmB,QACb,2CAAyC;AAChD,SAASC,WAAW,QAAQ,oBAAiB;AAE7C,MAAMC,OAAO;IACZC,OAAO;IACPC,WAAWH;IACXI,YAAY;QACXC,QAAQ;IACT;IACAC,MAAM;QAAC;KAAW;IAClBC,UAAU;QACTC,MAAM;YACLC,SAAS;YACTC,SAAS;gBAAC;gBAAW;aAAQ;YAC7BC,aAAa;QACd;QACAC,UAAU;YACTH,SAAS;YACTE,aAAa;QACd;IACD;AACD;AAEA,eAAeV,KAAK;AAIpB,OAAO,MAAMY,UAAiB;IAC7BC,MAAM;QACLN,MAAM;QACNI,UAAU;IACX;IACAG,QAAQ,CAACD,qBACR,MAACd;YAAa,GAAGc,IAAI;;8BACpB,MAACrB;oBAAOuB,SAAQ;oBAAYJ,UAAUE,KAAKF,QAAQ,IAAI;;sCACtD,KAACpB;wBAAO;;;8BAGT,MAACE;;sCACA,KAACK;4BAAoBkB,OAAO;sCAC3B,cAAA,KAACxB;gCAAOuB,SAAQ;gCAAYJ,UAAUE,KAAKF,QAAQ,IAAI;0CACtD,cAAA,KAACtB;;;sCAGH,MAACK;;8CACA,KAACE;8CAAkB;;8CACnB,KAACC;8CACD,KAACF;oCAAiBgB,QAAQ;8CAAC;;8CAC3B,KAACd;8CACD,MAACF;;sDACA,KAACL;4CAAK2B,WAAU;;wCAAiB;;;;;;;;;AAOvC,EAAE"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type VariantProps } from "class-variance-authority";
|
|
2
|
+
import type React from "react";
|
|
3
|
+
declare const tagVariants: (props?: ({
|
|
4
|
+
shape?: "round" | "square" | null | undefined;
|
|
5
|
+
size?: "big" | "small" | null | undefined;
|
|
6
|
+
type?: "filled" | "outlined" | null | undefined;
|
|
7
|
+
vibrance?: "vivid" | "subtle" | null | undefined;
|
|
8
|
+
color?: "blue" | "gray" | "green" | "red" | "yellow" | "contrast" | null | undefined;
|
|
9
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
10
|
+
export type TagProps = {
|
|
11
|
+
icon?: React.ReactNode;
|
|
12
|
+
showIcon?: boolean;
|
|
13
|
+
} & Omit<React.ComponentProps<"div">, "color"> & VariantProps<typeof tagVariants>;
|
|
14
|
+
export declare function Tag({ children, shape, size, type, vibrance, color, icon, showIcon, className, ...props }: TagProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=tag.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tag.d.ts","sourceRoot":"","sources":["../../../src/components/tag.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AA6B/B,QAAA,MAAM,WAAW;;;;;;8EAqKf,CAAC;AAEH,MAAM,MAAM,QAAQ,GAAG;IACtB,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACnB,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,GAC7C,YAAY,CAAC,OAAO,WAAW,CAAC,CAAC;AAElC,wBAAgB,GAAG,CAAC,EACnB,QAAQ,EACR,KAAK,EACL,IAAY,EACZ,IAAe,EACf,QAAkB,EAClB,KAAK,EACL,IAAI,EACJ,QAAe,EACf,SAAS,EACT,GAAG,KAAK,EACR,EAAE,QAAQ,2CAqBV"}
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
3
|
+
import { cn } from "../shadcn/lib/utils.js";
|
|
4
|
+
const baseChipStyles = cn("inline-flex", "items-center", "justify-center", "whitespace-nowrap", "shrink-0", "[&>svg]:pointer-events-none", "[&>svg]:shrink-0", "transition-colors", "duration-200");
|
|
5
|
+
const iconBaseClasses = cn("flex", "items-center", "justify-center", "shrink-0", "[&>svg]:pointer-events-none", "[&>svg]:shrink-0");
|
|
6
|
+
const iconSizeClasses = {
|
|
7
|
+
big: cn("[&>svg]:size-4"),
|
|
8
|
+
small: cn("[&>svg]:w-3", "[&>svg]:h-3")
|
|
9
|
+
};
|
|
10
|
+
const tagVariants = cva(baseChipStyles, {
|
|
11
|
+
variants: {
|
|
12
|
+
shape: {
|
|
13
|
+
round: "rounded-full",
|
|
14
|
+
square: "rounded"
|
|
15
|
+
},
|
|
16
|
+
size: {
|
|
17
|
+
big: cn("gap-1", "typo-body"),
|
|
18
|
+
small: cn("gap-1", "typo-body-xs")
|
|
19
|
+
},
|
|
20
|
+
type: {
|
|
21
|
+
filled: "",
|
|
22
|
+
outlined: "border bg-transparent"
|
|
23
|
+
},
|
|
24
|
+
vibrance: {
|
|
25
|
+
vivid: "",
|
|
26
|
+
subtle: ""
|
|
27
|
+
},
|
|
28
|
+
color: {
|
|
29
|
+
green: "",
|
|
30
|
+
gray: "",
|
|
31
|
+
red: "",
|
|
32
|
+
blue: "",
|
|
33
|
+
yellow: "",
|
|
34
|
+
contrast: ""
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
compoundVariants: [
|
|
38
|
+
// ============ SIZE + TYPE (padding compensation for border) ============
|
|
39
|
+
{
|
|
40
|
+
size: "big",
|
|
41
|
+
type: "filled",
|
|
42
|
+
class: "px-3 py-1"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
size: "big",
|
|
46
|
+
type: "outlined",
|
|
47
|
+
class: "px-[11px] py-[3px]"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
size: "small",
|
|
51
|
+
type: "filled",
|
|
52
|
+
class: "px-2 h-[22px]"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
size: "small",
|
|
56
|
+
type: "outlined",
|
|
57
|
+
class: "px-[7px] h-[22px]"
|
|
58
|
+
},
|
|
59
|
+
// ============ FILLED VIVID ============
|
|
60
|
+
{
|
|
61
|
+
type: "filled",
|
|
62
|
+
color: "red",
|
|
63
|
+
vibrance: "vivid",
|
|
64
|
+
class: "bg-bg-error-primary_inverse text-fg-primary_on-brand"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
type: "filled",
|
|
68
|
+
color: "yellow",
|
|
69
|
+
vibrance: "vivid",
|
|
70
|
+
class: "bg-bg-warning-primary_inverse text-fg-warning-primary"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
type: "filled",
|
|
74
|
+
color: "green",
|
|
75
|
+
vibrance: "vivid",
|
|
76
|
+
class: "bg-fg-success-primary text-fg-primary_on-brand"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
type: "filled",
|
|
80
|
+
color: "blue",
|
|
81
|
+
vibrance: "vivid",
|
|
82
|
+
class: "bg-bg-link text-fg-primary_on-brand"
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
type: "filled",
|
|
86
|
+
color: "gray",
|
|
87
|
+
vibrance: "vivid",
|
|
88
|
+
class: "bg-fg-tertiary text-fg-primary_on-brand"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
type: "filled",
|
|
92
|
+
color: "contrast",
|
|
93
|
+
vibrance: "vivid",
|
|
94
|
+
class: "bg-bg-primary_inverse text-fg-primary_on-brand"
|
|
95
|
+
},
|
|
96
|
+
// ============ FILLED SUBTLE ============
|
|
97
|
+
{
|
|
98
|
+
type: "filled",
|
|
99
|
+
color: "red",
|
|
100
|
+
vibrance: "subtle",
|
|
101
|
+
class: "bg-bg-error-tertiary text-fg-error-primary"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
type: "filled",
|
|
105
|
+
color: "yellow",
|
|
106
|
+
vibrance: "subtle",
|
|
107
|
+
class: "bg-bg-warning-secondary text-fg-warning-primary"
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
type: "filled",
|
|
111
|
+
color: "green",
|
|
112
|
+
vibrance: "subtle",
|
|
113
|
+
class: "bg-bg-success-secondary text-fg-success-primary"
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
type: "filled",
|
|
117
|
+
color: "blue",
|
|
118
|
+
vibrance: "subtle",
|
|
119
|
+
class: "bg-bg-info-primary text-fg-info-primary"
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
type: "filled",
|
|
123
|
+
color: "gray",
|
|
124
|
+
vibrance: "subtle",
|
|
125
|
+
class: "bg-bg-tertiary text-text-secondary"
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
type: "filled",
|
|
129
|
+
color: "contrast",
|
|
130
|
+
vibrance: "subtle",
|
|
131
|
+
class: "bg-bg-tertiary text-fg-primary"
|
|
132
|
+
},
|
|
133
|
+
// ============ OUTLINED (only vivid) ============
|
|
134
|
+
{
|
|
135
|
+
type: "outlined",
|
|
136
|
+
color: "red",
|
|
137
|
+
class: "border-border-error text-text-error-primary"
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
type: "outlined",
|
|
141
|
+
color: "yellow",
|
|
142
|
+
class: "border-fg-warning-primary text-text-warning-primary"
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
type: "outlined",
|
|
146
|
+
color: "green",
|
|
147
|
+
class: "border-border-success text-text-success-primary"
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
type: "outlined",
|
|
151
|
+
color: "blue",
|
|
152
|
+
class: "border-border-link text-text-link"
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
type: "outlined",
|
|
156
|
+
color: "gray",
|
|
157
|
+
class: "border-border-primary_hover text-fg-secondary"
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
type: "outlined",
|
|
161
|
+
color: "contrast",
|
|
162
|
+
class: "border-border-primary_hover text-fg-primary"
|
|
163
|
+
}
|
|
164
|
+
],
|
|
165
|
+
defaultVariants: {
|
|
166
|
+
shape: "round",
|
|
167
|
+
size: "big",
|
|
168
|
+
type: "filled",
|
|
169
|
+
vibrance: "vivid",
|
|
170
|
+
color: "green"
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
export function Tag({ children, shape, size = "big", type = "filled", vibrance = "vivid", color, icon, showIcon = true, className, ...props }) {
|
|
174
|
+
const shouldShowIcon = showIcon && icon;
|
|
175
|
+
const currentSize = size ?? "big";
|
|
176
|
+
return /*#__PURE__*/ _jsxs("div", {
|
|
177
|
+
"data-slot": "tag",
|
|
178
|
+
className: cn(tagVariants({
|
|
179
|
+
shape,
|
|
180
|
+
size,
|
|
181
|
+
type,
|
|
182
|
+
vibrance,
|
|
183
|
+
color
|
|
184
|
+
}), className),
|
|
185
|
+
...props,
|
|
186
|
+
children: [
|
|
187
|
+
shouldShowIcon && /*#__PURE__*/ _jsx("div", {
|
|
188
|
+
className: cn(iconBaseClasses, iconSizeClasses[currentSize]),
|
|
189
|
+
children: icon
|
|
190
|
+
}),
|
|
191
|
+
/*#__PURE__*/ _jsx("span", {
|
|
192
|
+
children: children
|
|
193
|
+
})
|
|
194
|
+
]
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
//# sourceMappingURL=tag.js.map
|