@keboola/design 2.0.0 → 2.1.0
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/README.md +57 -1
- package/dist/icon-names.d.cts +7 -0
- package/dist/icon-names.d.ts +7 -0
- package/dist/icons.cjs +12 -0
- package/dist/icons.d.cts +6 -0
- package/dist/icons.d.ts +6 -0
- package/dist/icons.js +1 -1
- package/dist/index.cjs +367 -135
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +10184 -0
- package/dist/index.d.ts +10184 -0
- package/dist/index.js +392 -173
- package/dist/index.js.map +1 -1
- package/dist/markdown-editor.cjs +69 -49
- package/dist/markdown-editor.cjs.map +1 -1
- package/dist/markdown-editor.d.cts +74 -0
- package/dist/markdown-editor.d.ts +74 -0
- package/dist/markdown-editor.js +69 -49
- package/dist/markdown-editor.js.map +1 -1
- package/dist/mermaid.cjs +50 -23
- package/dist/mermaid.cjs.map +1 -1
- package/dist/mermaid.d.cts +11 -0
- package/dist/mermaid.d.ts +11 -0
- package/dist/mermaid.js +50 -23
- package/dist/mermaid.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +83 -12
- package/src/blocks/AIKit/AnswerSummary.stories.tsx +0 -38
- package/src/blocks/AIKit/AnswerSummary.tsx +0 -63
- package/src/blocks/AIKit/CollapsibleStepHeader.stories.tsx +0 -53
- package/src/blocks/AIKit/CollapsibleStepHeader.tsx +0 -64
- package/src/blocks/AIKit/InlineStepDetail.stories.tsx +0 -25
- package/src/blocks/AIKit/InlineStepDetail.tsx +0 -13
- package/src/blocks/AIKit/InlineStepLabel.stories.tsx +0 -37
- package/src/blocks/AIKit/InlineStepLabel.tsx +0 -36
- package/src/blocks/AIKit/MessageBubble.stories.tsx +0 -145
- package/src/blocks/AIKit/MessageBubble.tsx +0 -68
- package/src/blocks/AIKit/PlanApproval.stories.tsx +0 -121
- package/src/blocks/AIKit/PlanApproval.test.tsx +0 -241
- package/src/blocks/AIKit/PlanApproval.tsx +0 -363
- package/src/blocks/AIKit/PlanRewritingIndicator.test.tsx +0 -17
- package/src/blocks/AIKit/PlanRewritingIndicator.tsx +0 -20
- package/src/blocks/AIKit/PromptInput.stories.tsx +0 -106
- package/src/blocks/AIKit/PromptInput.test.tsx +0 -53
- package/src/blocks/AIKit/PromptInput.tsx +0 -218
- package/src/blocks/AIKit/PromptInputAction.tsx +0 -18
- package/src/blocks/AIKit/PromptInputSubmit.tsx +0 -59
- package/src/blocks/AIKit/Question.stories.tsx +0 -235
- package/src/blocks/AIKit/Question.tsx +0 -350
- package/src/blocks/AIKit/QuestionBlock.stories.tsx +0 -99
- package/src/blocks/AIKit/QuestionBlock.tsx +0 -83
- package/src/blocks/AIKit/SuggestedPrompt.stories.tsx +0 -82
- package/src/blocks/AIKit/SuggestedPrompt.tsx +0 -42
- package/src/blocks/AIKit/ThinkingIndicator.stories.tsx +0 -21
- package/src/blocks/AIKit/ThinkingIndicator.tsx +0 -14
- package/src/blocks/AIKit/index.ts +0 -12
- package/src/blocks/AutoSaveTextarea/AutoSaveTextarea.stories.tsx +0 -78
- package/src/blocks/AutoSaveTextarea/AutoSaveTextarea.tsx +0 -103
- package/src/blocks/AutoSaveTextarea/index.ts +0 -1
- package/src/blocks/ClipboardButton/ClipboardButton.stories.tsx +0 -28
- package/src/blocks/ClipboardButton/ClipboardButton.tsx +0 -43
- package/src/blocks/ClipboardButton/ClipboardInline.tsx +0 -40
- package/src/blocks/ClipboardButton/index.ts +0 -2
- package/src/blocks/ColorInput/ColorInput.stories.tsx +0 -109
- package/src/blocks/ColorInput/ColorInput.test.tsx +0 -163
- package/src/blocks/ColorInput/ColorInput.tsx +0 -171
- package/src/blocks/ColorInput/ColorPicker.tsx +0 -42
- package/src/blocks/ColorInput/index.ts +0 -1
- package/src/blocks/ColorInput/utils.test.ts +0 -189
- package/src/blocks/ColorInput/utils.ts +0 -74
- package/src/blocks/EmptyConfigurationActionCard/EmptyConfigurationActionCard.stories.tsx +0 -30
- package/src/blocks/EmptyConfigurationActionCard/EmptyConfigurationActionCard.tsx +0 -20
- package/src/blocks/EmptyConfigurationActionCard/index.ts +0 -1
- package/src/blocks/EmptyState/EmptyState.stories.tsx +0 -93
- package/src/blocks/EmptyState/EmptyState.tsx +0 -146
- package/src/blocks/EmptyState/index.ts +0 -1
- package/src/blocks/ErrorState/ErrorState.stories.tsx +0 -125
- package/src/blocks/ErrorState/ErrorState.tsx +0 -147
- package/src/blocks/ErrorState/index.ts +0 -1
- package/src/blocks/Form/components/FormBody.tsx +0 -27
- package/src/blocks/Form/components/SubmitButton.tsx +0 -30
- package/src/blocks/Form/connectors/CheckboxField.tsx +0 -34
- package/src/blocks/Form/connectors/FieldShell.tsx +0 -46
- package/src/blocks/Form/connectors/NumberField.tsx +0 -36
- package/src/blocks/Form/connectors/PasswordField.tsx +0 -38
- package/src/blocks/Form/connectors/SelectField.tsx +0 -73
- package/src/blocks/Form/connectors/SwitchField.tsx +0 -34
- package/src/blocks/Form/connectors/TextAreaField.tsx +0 -36
- package/src/blocks/Form/connectors/TextField.tsx +0 -36
- package/src/blocks/Form/contexts.ts +0 -4
- package/src/blocks/Form/formHook.ts +0 -45
- package/src/blocks/Form/index.ts +0 -2
- package/src/blocks/Form/setServerFieldErrors.test.ts +0 -38
- package/src/blocks/Form/setServerFieldErrors.ts +0 -21
- package/src/blocks/MermaidDiagram/MermaidDiagram.stories.tsx +0 -87
- package/src/blocks/MermaidDiagram/MermaidDiagram.tsx +0 -266
- package/src/blocks/MermaidDiagram/index.ts +0 -1
- package/src/blocks/MultiActionButtonGroup/MultiActionButton.stories.tsx +0 -119
- package/src/blocks/MultiActionButtonGroup/MultiActionButton.tsx +0 -41
- package/src/blocks/MultiActionButtonGroup/MultiActionButtonGroup.tsx +0 -16
- package/src/blocks/MultiActionButtonGroup/index.ts +0 -1
- package/src/blocks/MultiCombobox/MultiCombobox.stories.tsx +0 -324
- package/src/blocks/MultiCombobox/MultiCombobox.tsx +0 -257
- package/src/blocks/MultiCombobox/index.ts +0 -1
- package/src/blocks/NumberInput/NumberInput.stories.tsx +0 -112
- package/src/blocks/NumberInput/NumberInput.test.tsx +0 -148
- package/src/blocks/NumberInput/NumberInput.tsx +0 -89
- package/src/blocks/NumberInput/index.ts +0 -1
- package/src/blocks/PageHeader/AGENTS.md +0 -137
- package/src/blocks/PageHeader/PageHeader.stories.tsx +0 -371
- package/src/blocks/PageHeader/PageHeader.tsx +0 -22
- package/src/blocks/PageHeader/PageHeaderDetail.tsx +0 -84
- package/src/blocks/PageHeader/PageHeaderIndex.tsx +0 -75
- package/src/blocks/PageHeader/index.ts +0 -1
- package/src/blocks/PageHeader/styles.ts +0 -6
- package/src/blocks/PageLayout/AGENTS.md +0 -94
- package/src/blocks/PageLayout/PageLayout.stories.tsx +0 -146
- package/src/blocks/PageLayout/PageLayout.tsx +0 -139
- package/src/blocks/PageLayout/index.ts +0 -1
- package/src/blocks/PageToolbar/PageToolbar.stories.tsx +0 -353
- package/src/blocks/PageToolbar/PageToolbar.tsx +0 -160
- package/src/blocks/PageToolbar/PageToolbarToken.tsx +0 -61
- package/src/blocks/PageToolbar/index.ts +0 -1
- package/src/blocks/PasswordInput/PasswordInput.stories.tsx +0 -114
- package/src/blocks/PasswordInput/PasswordInput.test.tsx +0 -219
- package/src/blocks/PasswordInput/PasswordInput.tsx +0 -180
- package/src/blocks/PasswordInput/index.ts +0 -1
- package/src/blocks/SearchInput/SearchInput.stories.tsx +0 -127
- package/src/blocks/SearchInput/SearchInput.test.tsx +0 -162
- package/src/blocks/SearchInput/SearchInput.tsx +0 -172
- package/src/blocks/SearchInput/index.ts +0 -1
- package/src/blocks/SearchInputWithNavigation/SearchInputWithNavigation.stories.tsx +0 -73
- package/src/blocks/SearchInputWithNavigation/SearchInputWithNavigation.tsx +0 -92
- package/src/blocks/SearchInputWithNavigation/index.ts +0 -1
- package/src/blocks/SplitButton/SplitButton.stories.tsx +0 -91
- package/src/blocks/SplitButton/SplitButton.tsx +0 -81
- package/src/blocks/SplitButton/index.ts +0 -1
- package/src/blocks/Tagger/TagItem.tsx +0 -32
- package/src/blocks/Tagger/TagSelectPopover/TagSelectCreateItem.tsx +0 -44
- package/src/blocks/Tagger/TagSelectPopover/TagSelectItem.tsx +0 -31
- package/src/blocks/Tagger/TagSelectPopover/TagSelectList.tsx +0 -67
- package/src/blocks/Tagger/TagSelectPopover/TagSelectPopover.tsx +0 -34
- package/src/blocks/Tagger/TagSelectPopover/TagSelectValue.tsx +0 -47
- package/src/blocks/Tagger/TagSelectPopover/index.ts +0 -1
- package/src/blocks/Tagger/Tagger.stories.tsx +0 -80
- package/src/blocks/Tagger/Tagger.tsx +0 -101
- package/src/blocks/Tagger/index.ts +0 -1
- package/src/blocks/Tagger/types.ts +0 -11
- package/src/blocks/Textarea/Textarea.stories.tsx +0 -47
- package/src/blocks/Textarea/Textarea.tsx +0 -50
- package/src/blocks/Textarea/index.ts +0 -1
- package/src/components/Alert/Alert.stories.tsx +0 -101
- package/src/components/Alert/Alert.tsx +0 -121
- package/src/components/Alert/AlertAction.tsx +0 -31
- package/src/components/Alert/AlertCollapsibleIcon.tsx +0 -25
- package/src/components/Alert/AlertDescription.tsx +0 -36
- package/src/components/Alert/AlertIcon.tsx +0 -40
- package/src/components/Alert/AlertRoot.tsx +0 -64
- package/src/components/Alert/AlertTitle.tsx +0 -25
- package/src/components/Alert/index.ts +0 -1
- package/src/components/Avatar.stories.tsx +0 -22
- package/src/components/Avatar.tsx +0 -88
- package/src/components/Badge/Badge.stories.tsx +0 -122
- package/src/components/Badge/Badge.tsx +0 -71
- package/src/components/Badge/BadgeAddon.tsx +0 -63
- package/src/components/Badge/BadgeButton.tsx +0 -40
- package/src/components/Badge/BadgeLabel.tsx +0 -37
- package/src/components/Badge/BadgeRoot.tsx +0 -21
- package/src/components/Badge/index.ts +0 -1
- package/src/components/Badge/styles.ts +0 -74
- package/src/components/Breadcrumb/Breadcrumb.stories.tsx +0 -135
- package/src/components/Breadcrumb/Breadcrumb.tsx +0 -23
- package/src/components/Breadcrumb/BreadcrumbEllipsis.tsx +0 -43
- package/src/components/Breadcrumb/BreadcrumbItem.tsx +0 -9
- package/src/components/Breadcrumb/BreadcrumbLink.tsx +0 -48
- package/src/components/Breadcrumb/BreadcrumbList.tsx +0 -26
- package/src/components/Breadcrumb/BreadcrumbPage.tsx +0 -22
- package/src/components/Breadcrumb/BreadcrumbSeparator.tsx +0 -28
- package/src/components/Breadcrumb/index.ts +0 -1
- package/src/components/Button/Button.stories.tsx +0 -80
- package/src/components/Button/Button.tsx +0 -110
- package/src/components/Button/ButtonInline.stories.tsx +0 -54
- package/src/components/Button/ButtonInline.tsx +0 -77
- package/src/components/Button/index.ts +0 -3
- package/src/components/Button/styles.ts +0 -290
- package/src/components/ButtonGroup/ButtonGroup.stories.tsx +0 -140
- package/src/components/ButtonGroup/ButtonGroup.tsx +0 -79
- package/src/components/ButtonGroup/index.ts +0 -1
- package/src/components/Calendar/Calendar.stories.tsx +0 -101
- package/src/components/Calendar/Calendar.tsx +0 -44
- package/src/components/Calendar/index.ts +0 -2
- package/src/components/Card/Card.stories.tsx +0 -60
- package/src/components/Card/Card.tsx +0 -42
- package/src/components/Card/CardContent.tsx +0 -5
- package/src/components/Card/CardHeader.tsx +0 -5
- package/src/components/Card/CardTitle.tsx +0 -13
- package/src/components/Card/index.ts +0 -1
- package/src/components/Card/styles.ts +0 -32
- package/src/components/Checkbox/Checkbox.stories.tsx +0 -210
- package/src/components/Checkbox/Checkbox.test.tsx +0 -140
- package/src/components/Checkbox/Checkbox.tsx +0 -83
- package/src/components/Checkbox/index.ts +0 -1
- package/src/components/Checkbox/styles.ts +0 -77
- package/src/components/Clipboard/Clipboard.stories.tsx +0 -44
- package/src/components/Clipboard/Clipboard.tsx +0 -89
- package/src/components/Clipboard/index.ts +0 -1
- package/src/components/CodeEditor/ButtonToolbar.tsx +0 -14
- package/src/components/CodeEditor/CodeEditor.tsx +0 -155
- package/src/components/CodeEditor/SqlEditor.stories.tsx +0 -76
- package/src/components/CodeEditor/SqlEditor.tsx +0 -206
- package/src/components/CodeEditor/ToggleComponentHelp.tsx +0 -7
- package/src/components/CodeEditor/activeQueryHighlight.test.ts +0 -178
- package/src/components/CodeEditor/activeQueryHighlight.ts +0 -245
- package/src/components/CodeEditor/helpers.ts +0 -100
- package/src/components/CodeEditor/highlighting.ts +0 -184
- package/src/components/CodeEditor/index.ts +0 -3
- package/src/components/CodeEditor/search.ts +0 -186
- package/src/components/Collapse.stories.tsx +0 -56
- package/src/components/Collapse.tsx +0 -61
- package/src/components/Collapsible/Collapsible.stories.tsx +0 -55
- package/src/components/Collapsible/Collapsible.tsx +0 -11
- package/src/components/Collapsible/CollapsibleContent.tsx +0 -25
- package/src/components/Collapsible/index.ts +0 -1
- package/src/components/CollapsiblePanel.stories.tsx +0 -25
- package/src/components/CollapsiblePanel.tsx +0 -127
- package/src/components/Combobox/Combobox.stories.tsx +0 -426
- package/src/components/Combobox/Combobox.test.tsx +0 -165
- package/src/components/Combobox/Combobox.tsx +0 -345
- package/src/components/Combobox/ComboboxChips.tsx +0 -68
- package/src/components/Combobox/ComboboxContent.tsx +0 -95
- package/src/components/Combobox/ComboboxEmpty.tsx +0 -30
- package/src/components/Combobox/ComboboxInput.tsx +0 -10
- package/src/components/Combobox/ComboboxInputGroup.tsx +0 -38
- package/src/components/Combobox/ComboboxItem.tsx +0 -70
- package/src/components/Combobox/ComboboxItemIndicator.tsx +0 -78
- package/src/components/Combobox/ComboboxList.tsx +0 -32
- package/src/components/Combobox/ComboboxRoot.tsx +0 -5
- package/src/components/Combobox/ComboboxSeparator.tsx +0 -20
- package/src/components/Combobox/Group/ComboboxCollection.tsx +0 -7
- package/src/components/Combobox/Group/ComboboxGroup.tsx +0 -23
- package/src/components/Combobox/Group/ComboboxGroupLabel.tsx +0 -38
- package/src/components/Combobox/Group/index.ts +0 -3
- package/src/components/Combobox/index.ts +0 -1
- package/src/components/Combobox/types.ts +0 -22
- package/src/components/Combobox/utils.test.ts +0 -95
- package/src/components/Combobox/utils.ts +0 -103
- package/src/components/Command/Command.stories.tsx +0 -367
- package/src/components/Command/Command.tsx +0 -37
- package/src/components/Command/CommandContent.tsx +0 -19
- package/src/components/Command/CommandEmpty.tsx +0 -6
- package/src/components/Command/CommandGroup.tsx +0 -26
- package/src/components/Command/CommandInput.tsx +0 -27
- package/src/components/Command/CommandItem/CheckIndicator.tsx +0 -86
- package/src/components/Command/CommandItem/CommandItem.tsx +0 -94
- package/src/components/Command/CommandItem/index.ts +0 -1
- package/src/components/Command/CommandList.tsx +0 -32
- package/src/components/Command/CommandSeparator.tsx +0 -13
- package/src/components/Command/index.ts +0 -6
- package/src/components/DatePicker/DatePicker.tsx +0 -37
- package/src/components/DatePicker/index.ts +0 -1
- package/src/components/DiffView/DiffView.stories.tsx +0 -80
- package/src/components/DiffView/DiffView.tsx +0 -131
- package/src/components/DiffView/DiffViewMark.tsx +0 -21
- package/src/components/DiffView/DiffViewTd.tsx +0 -84
- package/src/components/DiffView/DiffViewTh.tsx +0 -23
- package/src/components/DiffView/index.ts +0 -11
- package/src/components/DiffView/util.test.ts +0 -231
- package/src/components/DiffView/util.ts +0 -311
- package/src/components/DotsLoader.tsx +0 -22
- package/src/components/DropdownMenu/DropdownMenu.stories.tsx +0 -310
- package/src/components/DropdownMenu/DropdownMenu.tsx +0 -61
- package/src/components/DropdownMenu/DropdownMenuCheckboxItem.tsx +0 -55
- package/src/components/DropdownMenu/DropdownMenuContent.tsx +0 -52
- package/src/components/DropdownMenu/DropdownMenuContext.tsx +0 -13
- package/src/components/DropdownMenu/DropdownMenuItem.tsx +0 -80
- package/src/components/DropdownMenu/DropdownMenuItemDescription.tsx +0 -42
- package/src/components/DropdownMenu/DropdownMenuItemIndicator.tsx +0 -104
- package/src/components/DropdownMenu/DropdownMenuLabel.tsx +0 -21
- package/src/components/DropdownMenu/DropdownMenuRadioGroup/DropdownMenuRadioGroup.tsx +0 -31
- package/src/components/DropdownMenu/DropdownMenuRadioGroup/DropdownMenuRadioItem.tsx +0 -67
- package/src/components/DropdownMenu/DropdownMenuRadioGroup/index.ts +0 -2
- package/src/components/DropdownMenu/DropdownMenuSeparator.tsx +0 -35
- package/src/components/DropdownMenu/DropdownMenuSub/DropdownMenuSub.tsx +0 -3
- package/src/components/DropdownMenu/DropdownMenuSub/DropdownMenuSubContent.tsx +0 -21
- package/src/components/DropdownMenu/DropdownMenuSub/DropdownMenuSubTrigger.tsx +0 -17
- package/src/components/DropdownMenu/DropdownMenuSub/index.ts +0 -3
- package/src/components/DropdownMenu/DropdownMenuTrigger.tsx +0 -19
- package/src/components/DropdownMenu/ItemIcon.tsx +0 -30
- package/src/components/DropdownMenu/index.ts +0 -1
- package/src/components/DropdownMenu/styles.ts +0 -82
- package/src/components/EmptySearchContent.stories.tsx +0 -12
- package/src/components/EmptySearchContent.tsx +0 -13
- package/src/components/FieldBox/FieldBox.stories.tsx +0 -138
- package/src/components/FieldBox/FieldBox.tsx +0 -43
- package/src/components/FieldBox/FieldBoxDescription.tsx +0 -18
- package/src/components/FieldBox/FieldBoxTitle.tsx +0 -20
- package/src/components/FieldBox/index.ts +0 -1
- package/src/components/FieldBox/styles.ts +0 -37
- package/src/components/FormGroup/FormGroup.stories.tsx +0 -120
- package/src/components/FormGroup/FormGroup.tsx +0 -48
- package/src/components/FormGroup/FormGroupColorInput.tsx +0 -15
- package/src/components/FormGroup/FormGroupHelp.tsx +0 -17
- package/src/components/FormGroup/FormGroupNumberInput.tsx +0 -15
- package/src/components/FormGroup/FormGroupTextInput.tsx +0 -15
- package/src/components/FormGroup/FormGroupTextarea.tsx +0 -12
- package/src/components/FormGroup/context.ts +0 -11
- package/src/components/FormGroup/index.ts +0 -2
- package/src/components/FormGroup/types.ts +0 -5
- package/src/components/FullScreenModal/FullScreenModal.tsx +0 -8
- package/src/components/FullScreenModal/FullScreenModalBody.tsx +0 -16
- package/src/components/FullScreenModal/FullScreenModalHeader.tsx +0 -92
- package/src/components/FullScreenModal/FullScreenModalRoot.tsx +0 -79
- package/src/components/FullScreenModal/index.ts +0 -3
- package/src/components/HelpBlock/HelpBlock.stories.tsx +0 -28
- package/src/components/HelpBlock/HelpBlock.tsx +0 -31
- package/src/components/HelpBlock/index.ts +0 -1
- package/src/components/HoverCard/HoverCard.stories.tsx +0 -77
- package/src/components/HoverCard/HoverCard.tsx +0 -13
- package/src/components/HoverCard/HoverCardContent.tsx +0 -68
- package/src/components/HoverCard/index.ts +0 -1
- package/src/components/Icon/Icon.stories.tsx +0 -26
- package/src/components/Icon/Icon.tsx +0 -10
- package/src/components/Icon/Icons.mdx +0 -28
- package/src/components/Icon/constants.ts +0 -1
- package/src/components/Icon/index.ts +0 -27
- package/src/components/Input/DateInput/DateInput.stories.tsx +0 -58
- package/src/components/Input/DateInput/DateInput.tsx +0 -143
- package/src/components/Input/DateInput/helpers.test.ts +0 -102
- package/src/components/Input/DateInput/helpers.ts +0 -59
- package/src/components/Input/DateInput/index.ts +0 -1
- package/src/components/Input/DateRangeInput/DateRangeInput.stories.tsx +0 -66
- package/src/components/Input/DateRangeInput/DateRangeInput.tsx +0 -139
- package/src/components/Input/DateRangeInput/helpers.test.ts +0 -146
- package/src/components/Input/DateRangeInput/helpers.ts +0 -36
- package/src/components/Input/DateRangeInput/index.ts +0 -1
- package/src/components/Input/Input.stories.tsx +0 -93
- package/src/components/Input/Input.test.tsx +0 -112
- package/src/components/Input/Input.tsx +0 -163
- package/src/components/Input/TextInput/TextInput.stories.tsx +0 -68
- package/src/components/Input/TextInput/TextInput.test.tsx +0 -52
- package/src/components/Input/TextInput/TextInput.tsx +0 -73
- package/src/components/Input/TextInput/index.ts +0 -1
- package/src/components/Input/TimeInput/TimeInput.stories.tsx +0 -89
- package/src/components/Input/TimeInput/TimeInput.tsx +0 -106
- package/src/components/Input/TimeInput/index.ts +0 -1
- package/src/components/Input/index.ts +0 -4
- package/src/components/Input/utils.ts +0 -11
- package/src/components/InputGroup/InputGroup.stories.tsx +0 -215
- package/src/components/InputGroup/InputGroup.tsx +0 -228
- package/src/components/InputGroup/InputGroupAddon.tsx +0 -57
- package/src/components/InputGroup/InputGroupButton.tsx +0 -25
- package/src/components/InputGroup/InputGroupInput.tsx +0 -34
- package/src/components/InputGroup/InputGroupText.tsx +0 -21
- package/src/components/InputGroup/InputGroupTextArea.tsx +0 -78
- package/src/components/InputGroup/index.ts +0 -1
- package/src/components/Kbd/Kbd.stories.tsx +0 -82
- package/src/components/Kbd/Kbd.tsx +0 -17
- package/src/components/Kbd/KbdGroup.tsx +0 -35
- package/src/components/Kbd/KbdSeparator.tsx +0 -9
- package/src/components/Kbd/index.ts +0 -3
- package/src/components/Kbd/keyboardKeys.ts +0 -40
- package/src/components/Kbd/styles.ts +0 -39
- package/src/components/Label/Label.stories.tsx +0 -53
- package/src/components/Label/Label.tsx +0 -31
- package/src/components/Label/index.ts +0 -1
- package/src/components/Link.stories.tsx +0 -19
- package/src/components/Link.tsx +0 -37
- package/src/components/MarkdownEditor/MarkdownEditor.stories.tsx +0 -182
- package/src/components/MarkdownEditor/MarkdownEditor.test.ts +0 -171
- package/src/components/MarkdownEditor/MarkdownEditor.tsx +0 -245
- package/src/components/MarkdownEditor/context.ts +0 -10
- package/src/components/MarkdownEditor/index.ts +0 -1
- package/src/components/MarkdownEditor/nodes/ImageNode.tsx +0 -115
- package/src/components/MarkdownEditor/nodes/ImageNodeComponent.tsx +0 -18
- package/src/components/MarkdownEditor/nodes/MermaidNode.tsx +0 -72
- package/src/components/MarkdownEditor/nodes/MermaidNodeComponent.tsx +0 -35
- package/src/components/MarkdownEditor/plugins/ImagePastePlugin.tsx +0 -149
- package/src/components/MarkdownEditor/plugins/KeyboardPlugin.tsx +0 -81
- package/src/components/MarkdownEditor/plugins/MarkdownSyncPlugin.tsx +0 -65
- package/src/components/MarkdownEditor/plugins/ToolbarPlugin.tsx +0 -284
- package/src/components/MarkdownEditor/plugins/toolbar/AlignmentDropdown.tsx +0 -99
- package/src/components/MarkdownEditor/plugins/toolbar/BlockTypeDropdown.tsx +0 -142
- package/src/components/MarkdownEditor/plugins/toolbar/LinkPanel.tsx +0 -160
- package/src/components/MarkdownEditor/plugins/toolbar/ToolbarButton.tsx +0 -36
- package/src/components/MarkdownEditor/plugins/toolbar/ToolbarDivider.tsx +0 -1
- package/src/components/MarkdownEditor/theme.ts +0 -39
- package/src/components/MarkdownEditor/transformers.ts +0 -189
- package/src/components/MarkedText/MarkedText.stories.tsx +0 -46
- package/src/components/MarkedText/MarkedText.tsx +0 -36
- package/src/components/MarkedText/index.ts +0 -1
- package/src/components/MarkedText/utils.test.ts +0 -193
- package/src/components/MarkedText/utils.ts +0 -37
- package/src/components/MergeEditor/AcceptControls/AcceptButton.tsx +0 -25
- package/src/components/MergeEditor/AcceptControls/AcceptControls.tsx +0 -77
- package/src/components/MergeEditor/ConflictStatus/ConflictStatusIndicator.tsx +0 -38
- package/src/components/MergeEditor/MergeEditor.stories.tsx +0 -226
- package/src/components/MergeEditor/MergeEditor.tsx +0 -125
- package/src/components/MergeEditor/MergePane.tsx +0 -113
- package/src/components/MergeEditor/PaneHeader.tsx +0 -11
- package/src/components/MergeEditor/constants.ts +0 -48
- package/src/components/MergeEditor/decorations.ts +0 -126
- package/src/components/MergeEditor/helpers.test.ts +0 -172
- package/src/components/MergeEditor/helpers.ts +0 -118
- package/src/components/MergeEditor/index.ts +0 -5
- package/src/components/MergeEditor/useMergeDiff.ts +0 -573
- package/src/components/MergeEditor/useScrollSync.ts +0 -79
- package/src/components/Modal/Modal.stories.tsx +0 -680
- package/src/components/Modal/Modal.tsx +0 -49
- package/src/components/Modal/ModalBody.tsx +0 -33
- package/src/components/Modal/ModalCloseIcon.tsx +0 -31
- package/src/components/Modal/ModalContent.tsx +0 -95
- package/src/components/Modal/ModalDescription.tsx +0 -20
- package/src/components/Modal/ModalFooter.tsx +0 -20
- package/src/components/Modal/ModalHeader.tsx +0 -61
- package/src/components/Modal/ModalIcon.tsx +0 -109
- package/src/components/Modal/ModalOverlay.tsx +0 -42
- package/src/components/Modal/ModalTitle.tsx +0 -12
- package/src/components/Modal/index.ts +0 -1
- package/src/components/Navbar/Navbar.stories.tsx +0 -191
- package/src/components/Navbar/Navbar.tsx +0 -80
- package/src/components/Navbar/NavbarContent.tsx +0 -20
- package/src/components/Navbar/NavbarFooter.tsx +0 -11
- package/src/components/Navbar/NavbarHeader.tsx +0 -11
- package/src/components/Navbar/NavbarMenu.tsx +0 -30
- package/src/components/Navbar/NavbarMenuAvatar.tsx +0 -67
- package/src/components/Navbar/NavbarMenuButton.tsx +0 -135
- package/src/components/Navbar/NavbarMenuItem.tsx +0 -9
- package/src/components/Navbar/NavbarMenuItemAdornment.tsx +0 -65
- package/src/components/Navbar/index.ts +0 -1
- package/src/components/Pagination/Pagination.stories.tsx +0 -131
- package/src/components/Pagination/Pagination.tsx +0 -34
- package/src/components/Pagination/PaginationButton.tsx +0 -36
- package/src/components/Pagination/PaginationContent.tsx +0 -12
- package/src/components/Pagination/PaginationEllipsis.tsx +0 -26
- package/src/components/Pagination/PaginationItem.tsx +0 -9
- package/src/components/Pagination/PaginationNext.tsx +0 -20
- package/src/components/Pagination/PaginationPrevious.tsx +0 -14
- package/src/components/Pagination/index.ts +0 -1
- package/src/components/PanelWithDetails.stories.tsx +0 -28
- package/src/components/PanelWithDetails.tsx +0 -65
- package/src/components/Popconfirm/Popconfirm.stories.tsx +0 -373
- package/src/components/Popconfirm/Popconfirm.tsx +0 -82
- package/src/components/Popconfirm/PopconfirmBody.tsx +0 -5
- package/src/components/Popconfirm/PopconfirmCancel.tsx +0 -45
- package/src/components/Popconfirm/PopconfirmConfirm.tsx +0 -57
- package/src/components/Popconfirm/PopconfirmContent.tsx +0 -33
- package/src/components/Popconfirm/PopconfirmFooter.tsx +0 -9
- package/src/components/Popconfirm/PopconfirmTrigger.tsx +0 -22
- package/src/components/Popconfirm/context.ts +0 -19
- package/src/components/Popconfirm/index.ts +0 -1
- package/src/components/Popover/Popover.stories.tsx +0 -85
- package/src/components/Popover/Popover.tsx +0 -15
- package/src/components/Popover/PopoverContent.tsx +0 -103
- package/src/components/Popover/index.ts +0 -1
- package/src/components/Progress/Progress.stories.tsx +0 -67
- package/src/components/Progress/Progress.tsx +0 -45
- package/src/components/Progress/index.ts +0 -1
- package/src/components/RadioGroup/Radio.tsx +0 -61
- package/src/components/RadioGroup/RadioGroup.stories.tsx +0 -300
- package/src/components/RadioGroup/RadioGroup.tsx +0 -64
- package/src/components/RadioGroup/RadioGroupItem.tsx +0 -60
- package/src/components/RadioGroup/RadioGroupItemButton.tsx +0 -79
- package/src/components/RadioGroup/RadioGroupSeparator.tsx +0 -12
- package/src/components/RadioGroup/context.ts +0 -13
- package/src/components/RadioGroup/index.ts +0 -1
- package/src/components/Resizable/Resizable.stories.tsx +0 -50
- package/src/components/Resizable/ResizableHandle.tsx +0 -50
- package/src/components/Resizable/ResizablePanel.tsx +0 -12
- package/src/components/Resizable/ResizablePanelGroup.tsx +0 -19
- package/src/components/Resizable/index.ts +0 -3
- package/src/components/ScrollArea/ScrollArea.stories.tsx +0 -43
- package/src/components/ScrollArea/ScrollArea.tsx +0 -50
- package/src/components/ScrollArea/ScrollBar.tsx +0 -32
- package/src/components/ScrollArea/index.ts +0 -2
- package/src/components/Search/ClearButton.tsx +0 -42
- package/src/components/Search/Search.stories.tsx +0 -77
- package/src/components/Search/Search.test.tsx +0 -224
- package/src/components/Search/Search.tsx +0 -139
- package/src/components/Search/SearchForm.tsx +0 -37
- package/src/components/Search/index.ts +0 -2
- package/src/components/Search/styles.ts +0 -88
- package/src/components/Search/utils.ts +0 -11
- package/src/components/Select/Select.stories.tsx +0 -109
- package/src/components/Select/Select.tsx +0 -141
- package/src/components/Select/SelectContent.tsx +0 -110
- package/src/components/Select/SelectGroup.tsx +0 -10
- package/src/components/Select/SelectItem.tsx +0 -72
- package/src/components/Select/SelectLabel.tsx +0 -32
- package/src/components/Select/SelectRoot.tsx +0 -6
- package/src/components/Select/SelectSeparator.tsx +0 -13
- package/src/components/Select/SelectTrigger.tsx +0 -161
- package/src/components/Select/index.ts +0 -1
- package/src/components/Separator/Separator.stories.tsx +0 -60
- package/src/components/Separator/Separator.test.tsx +0 -39
- package/src/components/Separator/Separator.tsx +0 -115
- package/src/components/Separator/index.ts +0 -1
- package/src/components/Sheet/Sheet.stories.tsx +0 -63
- package/src/components/Sheet/Sheet.tsx +0 -21
- package/src/components/Sheet/SheetBody.tsx +0 -12
- package/src/components/Sheet/SheetContent.tsx +0 -131
- package/src/components/Sheet/SheetFooter.tsx +0 -9
- package/src/components/Sheet/SheetHeader.tsx +0 -39
- package/src/components/Sheet/SheetOverlay.tsx +0 -11
- package/src/components/Sheet/SheetTitle.tsx +0 -12
- package/src/components/Sheet/index.ts +0 -1
- package/src/components/Sidebar/Sidebar.stories.tsx +0 -849
- package/src/components/Sidebar/Sidebar.tsx +0 -225
- package/src/components/Sidebar/SidebarContent.tsx +0 -61
- package/src/components/Sidebar/SidebarFillTrigger.tsx +0 -25
- package/src/components/Sidebar/SidebarFooter.tsx +0 -13
- package/src/components/Sidebar/SidebarGroup/SidebarGroup.tsx +0 -23
- package/src/components/Sidebar/SidebarGroup/SidebarGroupAction.tsx +0 -53
- package/src/components/Sidebar/SidebarGroup/SidebarGroupContent.tsx +0 -20
- package/src/components/Sidebar/SidebarGroup/SidebarGroupLabel.tsx +0 -76
- package/src/components/Sidebar/SidebarGroup/index.ts +0 -4
- package/src/components/Sidebar/SidebarHeader.tsx +0 -20
- package/src/components/Sidebar/SidebarInstanceContext.ts +0 -18
- package/src/components/Sidebar/SidebarMenu/SidebarMenu.tsx +0 -28
- package/src/components/Sidebar/SidebarMenu/SidebarMenuAction.tsx +0 -69
- package/src/components/Sidebar/SidebarMenu/SidebarMenuBadge.tsx +0 -56
- package/src/components/Sidebar/SidebarMenu/SidebarMenuButton.tsx +0 -110
- package/src/components/Sidebar/SidebarMenu/SidebarMenuCard.tsx +0 -108
- package/src/components/Sidebar/SidebarMenu/SidebarMenuIcon.tsx +0 -30
- package/src/components/Sidebar/SidebarMenu/SidebarMenuItem.tsx +0 -9
- package/src/components/Sidebar/SidebarMenu/SidebarMenuSub.tsx +0 -139
- package/src/components/Sidebar/SidebarMenu/SidebarMenuSubItem.tsx +0 -106
- package/src/components/Sidebar/SidebarMenu/SidebarSearchInput.tsx +0 -88
- package/src/components/Sidebar/SidebarMenu/index.ts +0 -10
- package/src/components/Sidebar/SidebarProvider/SidebarProvider.tsx +0 -171
- package/src/components/Sidebar/SidebarProvider/context.ts +0 -35
- package/src/components/Sidebar/SidebarProvider/index.ts +0 -2
- package/src/components/Sidebar/SidebarProvider/useHoverTracking.test.ts +0 -199
- package/src/components/Sidebar/SidebarProvider/useHoverTracking.ts +0 -72
- package/src/components/Sidebar/SidebarProvider/useSidebarState.ts +0 -50
- package/src/components/Sidebar/SidebarProvider/useTransitionPresence.test.ts +0 -179
- package/src/components/Sidebar/SidebarProvider/useTransitionPresence.ts +0 -53
- package/src/components/Sidebar/SidebarResizeHandle.tsx +0 -28
- package/src/components/Sidebar/SidebarSeparator.tsx +0 -15
- package/src/components/Sidebar/SidebarTrigger.tsx +0 -40
- package/src/components/Sidebar/index.ts +0 -3
- package/src/components/Sidebar/types.ts +0 -6
- package/src/components/Sidebar/useResizeSidebar.ts +0 -112
- package/src/components/Sidebar/utils.test.ts +0 -178
- package/src/components/Sidebar/utils.ts +0 -70
- package/src/components/Skeleton/Skeleton.stories.tsx +0 -106
- package/src/components/Skeleton/Skeleton.tsx +0 -77
- package/src/components/Skeleton/SkeletonList.stories.tsx +0 -11
- package/src/components/Skeleton/SkeletonList.tsx +0 -65
- package/src/components/Slider/Slider.stories.tsx +0 -99
- package/src/components/Slider/Slider.tsx +0 -85
- package/src/components/Slider/SliderThumb.tsx +0 -57
- package/src/components/Slider/SliderTrack.tsx +0 -49
- package/src/components/Slider/index.ts +0 -1
- package/src/components/Slider/useInteracting.test.ts +0 -159
- package/src/components/Slider/useInteracting.ts +0 -64
- package/src/components/Switch/Switch.stories.tsx +0 -177
- package/src/components/Switch/Switch.tsx +0 -58
- package/src/components/Switch/index.ts +0 -1
- package/src/components/Switch/styles.ts +0 -173
- package/src/components/Table/Table.stories.tsx +0 -328
- package/src/components/Table/Table.tsx +0 -68
- package/src/components/Table/TableBody.tsx +0 -22
- package/src/components/Table/TableCell.tsx +0 -7
- package/src/components/Table/TableFooter.tsx +0 -15
- package/src/components/Table/TableHead.tsx +0 -15
- package/src/components/Table/TableHeader.tsx +0 -20
- package/src/components/Table/TableRow.tsx +0 -11
- package/src/components/Table/index.ts +0 -1
- package/src/components/Tabs.stories.tsx +0 -123
- package/src/components/Tabs.tsx +0 -134
- package/src/components/ThemeProvider/AIGradientSvg.tsx +0 -18
- package/src/components/ThemeProvider/ThemeProvider.tsx +0 -25
- package/src/components/ThemeProvider/index.ts +0 -1
- package/src/components/TimePicker/TimePicker.tsx +0 -95
- package/src/components/TimePicker/TimePickerButton.tsx +0 -39
- package/src/components/TimePicker/index.ts +0 -1
- package/src/components/TimePicker/utils.ts +0 -31
- package/src/components/Timeline/Timeline.stories.tsx +0 -246
- package/src/components/Timeline/Timeline.tsx +0 -35
- package/src/components/Timeline/TimelineConnector.tsx +0 -154
- package/src/components/Timeline/TimelineContent.tsx +0 -18
- package/src/components/Timeline/TimelineItem.tsx +0 -14
- package/src/components/Timeline/index.ts +0 -1
- package/src/components/Timeline/useLastLineHeight.ts +0 -36
- package/src/components/Toast/Toast.stories.tsx +0 -178
- package/src/components/Toast/ToastAction.tsx +0 -40
- package/src/components/Toast/ToastDescription.tsx +0 -28
- package/src/components/Toast/ToastDismiss.tsx +0 -36
- package/src/components/Toast/ToastDuration.tsx +0 -43
- package/src/components/Toast/ToastRoot.tsx +0 -135
- package/src/components/Toast/ToastTitle.tsx +0 -33
- package/src/components/Toast/Toaster.tsx +0 -25
- package/src/components/Toast/index.ts +0 -3
- package/src/components/Toast/toast.tsx +0 -94
- package/src/components/Toast/useNotification.tsx +0 -33
- package/src/components/Toggle/Toggle.stories.tsx +0 -67
- package/src/components/Toggle/Toggle.tsx +0 -202
- package/src/components/Toggle/index.ts +0 -1
- package/src/components/ToggleGroup/ToggleGroup.stories.tsx +0 -60
- package/src/components/ToggleGroup/ToggleGroup.tsx +0 -99
- package/src/components/ToggleGroup/index.ts +0 -1
- package/src/components/Tooltip/Tooltip.stories.tsx +0 -82
- package/src/components/Tooltip/Tooltip.tsx +0 -110
- package/src/components/Tooltip/TooltipContent.tsx +0 -90
- package/src/components/Tooltip/TooltipRoot.tsx +0 -12
- package/src/components/Tooltip/TooltipTrigger.tsx +0 -42
- package/src/components/Tooltip/index.ts +0 -1
- package/src/components/Truncated.stories.tsx +0 -72
- package/src/components/Truncated.tsx +0 -78
- package/src/components/ZoomableSvg/ZoomableSvg.stories.tsx +0 -53
- package/src/components/ZoomableSvg/ZoomableSvg.tsx +0 -200
- package/src/components/ZoomableSvg/index.ts +0 -1
- package/src/constants/keyCodes.ts +0 -5
- package/src/docs/Colors.mdx +0 -19
- package/src/docs/Spacing.mdx +0 -35
- package/src/docs/Typography.mdx +0 -63
- package/src/docs/components/Typeset.tsx +0 -35
- package/src/hooks/useAutosizeInput.stories.tsx +0 -142
- package/src/hooks/useAutosizeInput.test.tsx +0 -77
- package/src/hooks/useAutosizeInput.tsx +0 -107
- package/src/hooks/useElement.ts +0 -16
- package/src/hooks/useScrollbarPosition.ts +0 -68
- package/src/icon-names.ts +0 -20
- package/src/icons/Keboola.tsx +0 -28
- package/src/icons/icons.stories.tsx +0 -174
- package/src/icons/index.ts +0 -186
- package/src/index.ts +0 -89
- package/src/patterns/AlertWithAction.stories.tsx +0 -30
- package/src/patterns/CardWithEmptyState.stories.tsx +0 -66
- package/src/patterns/ConfirmDialog.stories.tsx +0 -72
- package/src/patterns/CreatableMultiCombobox.stories.tsx +0 -33
- package/src/patterns/DataCardWithSkeleton.stories.tsx +0 -48
- package/src/patterns/DisabledButtonTooltip.stories.tsx +0 -30
- package/src/patterns/FilterToolbar.stories.tsx +0 -275
- package/src/patterns/InfoTooltip.stories.tsx +0 -56
- package/src/patterns/ListDetail.stories.tsx +0 -65
- package/src/patterns/ModalForm.stories.tsx +0 -59
- package/src/patterns/PageHeaderTabs.stories.tsx +0 -48
- package/src/utils/classNames.test.ts +0 -16
- package/src/utils/classNames.ts +0 -27
- package/src/utils/copyToClipboard.ts +0 -3
- package/src/utils/createChangeInputEvent.ts +0 -28
- package/src/utils/createPrefixedString.ts +0 -2
- package/src/utils/debounce.test.ts +0 -63
- package/src/utils/debounce.ts +0 -17
- package/src/utils/decorators.tsx +0 -16
- package/src/utils/escapeStringRegexp.ts +0 -4
- package/src/utils/index.ts +0 -11
- package/src/utils/isMac.ts +0 -26
- package/src/utils/legacyIcon.tsx +0 -28
- package/src/utils/mergeRefs.ts +0 -23
- package/src/utils/noop.ts +0 -1
- package/src/utils/useSHA256.ts +0 -21
- package/src/vite-env.d.ts +0 -1
|
@@ -1,849 +0,0 @@
|
|
|
1
|
-
import { useState } from 'react';
|
|
2
|
-
import type { ComponentProps } from 'react';
|
|
3
|
-
import type { Decorator, Meta, StoryObj } from '@storybook/react-vite';
|
|
4
|
-
import type { InputType } from 'storybook/internal/types';
|
|
5
|
-
|
|
6
|
-
import {
|
|
7
|
-
AlertTriangle,
|
|
8
|
-
Ellipsis,
|
|
9
|
-
Expand,
|
|
10
|
-
Gauge,
|
|
11
|
-
Keboola,
|
|
12
|
-
Menu,
|
|
13
|
-
Minus,
|
|
14
|
-
PanelLeft,
|
|
15
|
-
Pencil,
|
|
16
|
-
Plus,
|
|
17
|
-
Sparkles,
|
|
18
|
-
SquareTerminal,
|
|
19
|
-
Trash2,
|
|
20
|
-
} from '@keboola/design/icons';
|
|
21
|
-
|
|
22
|
-
import { cn } from '../../utils';
|
|
23
|
-
import { Button } from '../Button';
|
|
24
|
-
import { ButtonGroup } from '../ButtonGroup';
|
|
25
|
-
import { DropdownMenu } from '../DropdownMenu';
|
|
26
|
-
import { Link } from '../Link';
|
|
27
|
-
import { Modal } from '../Modal';
|
|
28
|
-
|
|
29
|
-
import { Sidebar } from './Sidebar';
|
|
30
|
-
import { SidebarProvider, useSidebar } from './SidebarProvider';
|
|
31
|
-
import type { SidebarCollapsible, SidebarMode, SidebarSide, SidebarVariant } from './types';
|
|
32
|
-
|
|
33
|
-
type SidebarProviderDecorator = Decorator<ComponentProps<typeof SidebarProvider>>;
|
|
34
|
-
|
|
35
|
-
const AppContent = ({
|
|
36
|
-
className,
|
|
37
|
-
side,
|
|
38
|
-
...props
|
|
39
|
-
}: ComponentProps<'main'> & { side?: SidebarSide | 'both' }) => {
|
|
40
|
-
const isBoth = side === 'both';
|
|
41
|
-
const isLeft = side === 'left' || isBoth;
|
|
42
|
-
const isRight = side === 'right' || isBoth;
|
|
43
|
-
|
|
44
|
-
return (
|
|
45
|
-
<main
|
|
46
|
-
{...props}
|
|
47
|
-
className={cn(
|
|
48
|
-
'tw-w-full tw-gap-4 tw-flex tw-flex-col tw-items-center tw-mx-auto tw-p-8 tw-my-2 tw-bg-white tw-rounded-xl tw-shadow-lg',
|
|
49
|
-
className,
|
|
50
|
-
)}
|
|
51
|
-
>
|
|
52
|
-
<h1>Keboola App</h1>
|
|
53
|
-
<div className="tw-flex tw-w-full tw-flex-1 tw-justify-between tw-gap-2">
|
|
54
|
-
{isLeft && (
|
|
55
|
-
<div>
|
|
56
|
-
<h3>Left Controls</h3>
|
|
57
|
-
<ButtonGroup space="compact">
|
|
58
|
-
<Sidebar.Trigger side="left">
|
|
59
|
-
<Button argo variant="primary">
|
|
60
|
-
<PanelLeft className="tw-size-4" />
|
|
61
|
-
Toggle
|
|
62
|
-
</Button>
|
|
63
|
-
</Sidebar.Trigger>
|
|
64
|
-
|
|
65
|
-
<Sidebar.FillTrigger side="left">
|
|
66
|
-
<Button argo variant="secondary">
|
|
67
|
-
<PanelLeft className="tw-size-4" />
|
|
68
|
-
Fill
|
|
69
|
-
</Button>
|
|
70
|
-
</Sidebar.FillTrigger>
|
|
71
|
-
</ButtonGroup>
|
|
72
|
-
</div>
|
|
73
|
-
)}
|
|
74
|
-
|
|
75
|
-
{isRight && (
|
|
76
|
-
<div>
|
|
77
|
-
<h3>Right Controls</h3>
|
|
78
|
-
<ButtonGroup space="compact">
|
|
79
|
-
<Sidebar.FillTrigger side="right">
|
|
80
|
-
<Button argo variant="secondary">
|
|
81
|
-
<PanelLeft className="tw-size-4" />
|
|
82
|
-
Fill
|
|
83
|
-
</Button>
|
|
84
|
-
</Sidebar.FillTrigger>
|
|
85
|
-
|
|
86
|
-
<Sidebar.Trigger side="right">
|
|
87
|
-
<Button argo variant="primary">
|
|
88
|
-
<PanelLeft className="tw-size-4" />
|
|
89
|
-
Toggle
|
|
90
|
-
</Button>
|
|
91
|
-
</Sidebar.Trigger>
|
|
92
|
-
</ButtonGroup>
|
|
93
|
-
</div>
|
|
94
|
-
)}
|
|
95
|
-
</div>
|
|
96
|
-
</main>
|
|
97
|
-
);
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
const leftLayoutDecorator: SidebarProviderDecorator = (StoryFn) => (
|
|
101
|
-
<div className="tw-flex tw-flex-1">
|
|
102
|
-
<StoryFn />
|
|
103
|
-
<AppContent side="left" />
|
|
104
|
-
</div>
|
|
105
|
-
);
|
|
106
|
-
|
|
107
|
-
const rightLayoutDecorator: SidebarProviderDecorator = (StoryFn) => (
|
|
108
|
-
<div className="tw-flex tw-flex-1">
|
|
109
|
-
<AppContent side="right" />
|
|
110
|
-
<StoryFn />
|
|
111
|
-
</div>
|
|
112
|
-
);
|
|
113
|
-
|
|
114
|
-
const collapsibleControl: InputType = {
|
|
115
|
-
control: { type: 'radio' },
|
|
116
|
-
options: ['icon', 'off-canvas'] satisfies SidebarCollapsible[],
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
const variantControl: InputType = {
|
|
120
|
-
control: { type: 'radio' },
|
|
121
|
-
options: ['sided-floating', 'inset', 'floating'] satisfies SidebarVariant[],
|
|
122
|
-
};
|
|
123
|
-
|
|
124
|
-
export default {
|
|
125
|
-
component: SidebarProvider,
|
|
126
|
-
parameters: {
|
|
127
|
-
layout: 'fullscreen',
|
|
128
|
-
},
|
|
129
|
-
args: {
|
|
130
|
-
defaultLeftMode: 'expanded',
|
|
131
|
-
leftVariant: 'sided-floating',
|
|
132
|
-
leftCollapsible: 'icon',
|
|
133
|
-
rightVariant: 'floating',
|
|
134
|
-
rightCollapsible: 'off-canvas',
|
|
135
|
-
},
|
|
136
|
-
argTypes: {
|
|
137
|
-
leftCollapsible: collapsibleControl,
|
|
138
|
-
leftVariant: variantControl,
|
|
139
|
-
rightCollapsible: collapsibleControl,
|
|
140
|
-
rightVariant: variantControl,
|
|
141
|
-
},
|
|
142
|
-
decorators: [
|
|
143
|
-
(StoryFn, context) => (
|
|
144
|
-
<SidebarProvider {...context.args}>
|
|
145
|
-
<div className="tailwindcss-preflight tw-flex tw-h-svh tw-w-svw tw-flex-col tw-bg-neutral-50">
|
|
146
|
-
<StoryFn />
|
|
147
|
-
</div>
|
|
148
|
-
</SidebarProvider>
|
|
149
|
-
),
|
|
150
|
-
],
|
|
151
|
-
} satisfies Meta<typeof SidebarProvider>;
|
|
152
|
-
|
|
153
|
-
const SidebarFillControlMenuButton = ({ side }: { side?: SidebarSide }) => (
|
|
154
|
-
<Sidebar.FillTrigger side={side}>
|
|
155
|
-
<Sidebar.MenuButton
|
|
156
|
-
tooltip="Sidebar Fill Control"
|
|
157
|
-
icon="expand-alt"
|
|
158
|
-
className="!tw-flex-none [&_svg]:tw-text-sidebar-foreground"
|
|
159
|
-
>
|
|
160
|
-
<span className="tw-sr-only">Sidebar Fill Control</span>
|
|
161
|
-
</Sidebar.MenuButton>
|
|
162
|
-
</Sidebar.FillTrigger>
|
|
163
|
-
);
|
|
164
|
-
|
|
165
|
-
const SidebarModeControlMenuButton = ({ side }: { side?: SidebarSide }) => {
|
|
166
|
-
const { mode, setMode } = useSidebar(side);
|
|
167
|
-
|
|
168
|
-
return (
|
|
169
|
-
<DropdownMenu variant="argo">
|
|
170
|
-
<DropdownMenu.Trigger asChild>
|
|
171
|
-
<Sidebar.MenuButton
|
|
172
|
-
tooltip="Sidebar State Control"
|
|
173
|
-
icon={['far', 'sidebar']}
|
|
174
|
-
className="!tw-flex-none [&_svg]:tw-text-sidebar-foreground"
|
|
175
|
-
>
|
|
176
|
-
<span className="tw-sr-only">Sidebar State Control</span>
|
|
177
|
-
</Sidebar.MenuButton>
|
|
178
|
-
</DropdownMenu.Trigger>
|
|
179
|
-
<DropdownMenu.Content>
|
|
180
|
-
<DropdownMenu.RadioGroup value={mode} onValueChange={setMode}>
|
|
181
|
-
<DropdownMenu.RadioItem closeOnSelect value="collapsed">
|
|
182
|
-
Collapsed
|
|
183
|
-
</DropdownMenu.RadioItem>
|
|
184
|
-
<DropdownMenu.RadioItem closeOnSelect value="expanded">
|
|
185
|
-
Expanded
|
|
186
|
-
</DropdownMenu.RadioItem>
|
|
187
|
-
<DropdownMenu.RadioItem closeOnSelect value="expand-on-hover">
|
|
188
|
-
Expand on Hover
|
|
189
|
-
</DropdownMenu.RadioItem>
|
|
190
|
-
</DropdownMenu.RadioGroup>
|
|
191
|
-
</DropdownMenu.Content>
|
|
192
|
-
</DropdownMenu>
|
|
193
|
-
);
|
|
194
|
-
};
|
|
195
|
-
|
|
196
|
-
type Story = StoryObj<typeof SidebarProvider>;
|
|
197
|
-
|
|
198
|
-
export const Default: Story = {
|
|
199
|
-
render: () => (
|
|
200
|
-
<div className="tw-flex tw-flex-1">
|
|
201
|
-
<Sidebar side="left">
|
|
202
|
-
<Sidebar.Header>
|
|
203
|
-
<Sidebar.Menu>
|
|
204
|
-
<Sidebar.MenuItem>
|
|
205
|
-
<Sidebar.MenuIcon className="!tw-size-8 tw-text-secondary-500">
|
|
206
|
-
<Keboola className="tw-size-4" />
|
|
207
|
-
</Sidebar.MenuIcon>
|
|
208
|
-
Sticky Header
|
|
209
|
-
</Sidebar.MenuItem>
|
|
210
|
-
</Sidebar.Menu>
|
|
211
|
-
|
|
212
|
-
<Sidebar.SearchInput placeholder="Search" />
|
|
213
|
-
</Sidebar.Header>
|
|
214
|
-
|
|
215
|
-
<Sidebar.Content>
|
|
216
|
-
<Sidebar.Menu>
|
|
217
|
-
<Sidebar.MenuItem>
|
|
218
|
-
<Sidebar.MenuButton tooltip="Dashboard" asChild>
|
|
219
|
-
<Link href="#">
|
|
220
|
-
<Sidebar.MenuIcon>
|
|
221
|
-
<Gauge className="tw-size-4" />
|
|
222
|
-
</Sidebar.MenuIcon>
|
|
223
|
-
Dashboard
|
|
224
|
-
</Link>
|
|
225
|
-
</Sidebar.MenuButton>
|
|
226
|
-
</Sidebar.MenuItem>
|
|
227
|
-
|
|
228
|
-
<Sidebar.MenuItem>
|
|
229
|
-
<Sidebar.MenuButton tooltip="AI Assistant" asChild>
|
|
230
|
-
<Link href="#">
|
|
231
|
-
<Sidebar.MenuIcon>
|
|
232
|
-
<Sparkles className="tw-size-4" />
|
|
233
|
-
</Sidebar.MenuIcon>
|
|
234
|
-
AI Assistant
|
|
235
|
-
</Link>
|
|
236
|
-
</Sidebar.MenuButton>
|
|
237
|
-
</Sidebar.MenuItem>
|
|
238
|
-
|
|
239
|
-
<Sidebar.MenuItem>
|
|
240
|
-
<Sidebar.MenuButton tooltip="Flows" asChild>
|
|
241
|
-
<Link href="#">
|
|
242
|
-
<Sidebar.MenuIcon>
|
|
243
|
-
<Menu className="tw-size-4" />
|
|
244
|
-
</Sidebar.MenuIcon>
|
|
245
|
-
Flows
|
|
246
|
-
</Link>
|
|
247
|
-
</Sidebar.MenuButton>
|
|
248
|
-
</Sidebar.MenuItem>
|
|
249
|
-
|
|
250
|
-
<Sidebar.MenuItem>
|
|
251
|
-
<Sidebar.MenuButton tooltip="Components" icon={['far', 'layer-group']}>
|
|
252
|
-
Components
|
|
253
|
-
</Sidebar.MenuButton>
|
|
254
|
-
</Sidebar.MenuItem>
|
|
255
|
-
|
|
256
|
-
<Sidebar.MenuItem>
|
|
257
|
-
<Sidebar.MenuButton tooltip="Templates" icon={['far', 'book-open']}>
|
|
258
|
-
Templates
|
|
259
|
-
</Sidebar.MenuButton>
|
|
260
|
-
</Sidebar.MenuItem>
|
|
261
|
-
|
|
262
|
-
<Sidebar.MenuItem>
|
|
263
|
-
<Sidebar.MenuButton tooltip="Data Catalog" icon={['far', 'database']}>
|
|
264
|
-
Data Catalog
|
|
265
|
-
</Sidebar.MenuButton>
|
|
266
|
-
</Sidebar.MenuItem>
|
|
267
|
-
|
|
268
|
-
<Sidebar.MenuItem>
|
|
269
|
-
<Sidebar.MenuButton
|
|
270
|
-
tooltip="Storage"
|
|
271
|
-
icon={['far', 'warehouse']}
|
|
272
|
-
aria-selected={true}
|
|
273
|
-
>
|
|
274
|
-
Storage
|
|
275
|
-
</Sidebar.MenuButton>
|
|
276
|
-
</Sidebar.MenuItem>
|
|
277
|
-
|
|
278
|
-
<Sidebar.MenuItem>
|
|
279
|
-
<Sidebar.MenuButton tooltip="Transformations" icon={['far', 'window-restore']}>
|
|
280
|
-
Transformations
|
|
281
|
-
</Sidebar.MenuButton>
|
|
282
|
-
</Sidebar.MenuItem>
|
|
283
|
-
|
|
284
|
-
<Sidebar.MenuItem>
|
|
285
|
-
<Sidebar.MenuButton tooltip="Workspaces" icon={['far', 'box']}>
|
|
286
|
-
Workspaces
|
|
287
|
-
</Sidebar.MenuButton>
|
|
288
|
-
</Sidebar.MenuItem>
|
|
289
|
-
|
|
290
|
-
<Sidebar.MenuItem>
|
|
291
|
-
<Sidebar.MenuButton tooltip="Jobs" icon={['far', 'key']}>
|
|
292
|
-
Jobs
|
|
293
|
-
</Sidebar.MenuButton>
|
|
294
|
-
</Sidebar.MenuItem>
|
|
295
|
-
</Sidebar.Menu>
|
|
296
|
-
</Sidebar.Content>
|
|
297
|
-
|
|
298
|
-
<Sidebar.Footer>
|
|
299
|
-
<Sidebar.Menu>
|
|
300
|
-
<Sidebar.MenuItem>
|
|
301
|
-
<Sidebar.MenuCard
|
|
302
|
-
icon="clock"
|
|
303
|
-
title="Whats New"
|
|
304
|
-
className="tw-flex tw-flex-col tw-gap-2"
|
|
305
|
-
>
|
|
306
|
-
Our arbitrary content
|
|
307
|
-
<Button>Our Button</Button>
|
|
308
|
-
</Sidebar.MenuCard>
|
|
309
|
-
<Sidebar.MenuBadge>8</Sidebar.MenuBadge>
|
|
310
|
-
</Sidebar.MenuItem>
|
|
311
|
-
|
|
312
|
-
<Sidebar.MenuItem>
|
|
313
|
-
<Sidebar.MenuButton tooltip="Support & Feedback" icon={['far', 'key']}>
|
|
314
|
-
Support & Feedback
|
|
315
|
-
</Sidebar.MenuButton>
|
|
316
|
-
</Sidebar.MenuItem>
|
|
317
|
-
|
|
318
|
-
<Sidebar.Separator />
|
|
319
|
-
<Sidebar.MenuItem>
|
|
320
|
-
<SidebarFillControlMenuButton side="left" />
|
|
321
|
-
</Sidebar.MenuItem>
|
|
322
|
-
|
|
323
|
-
<Sidebar.MenuItem>
|
|
324
|
-
<SidebarModeControlMenuButton side="left" />
|
|
325
|
-
</Sidebar.MenuItem>
|
|
326
|
-
</Sidebar.Menu>
|
|
327
|
-
</Sidebar.Footer>
|
|
328
|
-
</Sidebar>
|
|
329
|
-
|
|
330
|
-
<AppContent side="both" />
|
|
331
|
-
|
|
332
|
-
<Sidebar container side="right">
|
|
333
|
-
<div className="tw-flex tw-flex-col tw-items-center tw-p-4">
|
|
334
|
-
<h1>KAI</h1>
|
|
335
|
-
<Sidebar.FillTrigger side="right">
|
|
336
|
-
<Button block argo variant="secondary">
|
|
337
|
-
<PanelLeft className="tw-size-4" />
|
|
338
|
-
Fill
|
|
339
|
-
</Button>
|
|
340
|
-
</Sidebar.FillTrigger>
|
|
341
|
-
</div>
|
|
342
|
-
</Sidebar>
|
|
343
|
-
</div>
|
|
344
|
-
),
|
|
345
|
-
};
|
|
346
|
-
|
|
347
|
-
export const Resizable: Story = {
|
|
348
|
-
render: () => {
|
|
349
|
-
const [rightWidth, setRightWidth] = useState(384);
|
|
350
|
-
|
|
351
|
-
return (
|
|
352
|
-
<SidebarProvider
|
|
353
|
-
rightVariant="floating"
|
|
354
|
-
rightCollapsible="off-canvas"
|
|
355
|
-
defaultRightMode="expanded"
|
|
356
|
-
rightWidth={rightWidth}
|
|
357
|
-
onRightWidthChange={setRightWidth}
|
|
358
|
-
>
|
|
359
|
-
<div className="tailwindcss-preflight tw-flex tw-h-svh tw-w-svw tw-bg-neutral-50">
|
|
360
|
-
<AppContent side="right" />
|
|
361
|
-
|
|
362
|
-
<Sidebar container side="right" resizable>
|
|
363
|
-
<div className="tw-flex tw-flex-col tw-items-center tw-gap-4 tw-p-4">
|
|
364
|
-
<h2>Resizable Sidebar</h2>
|
|
365
|
-
<p className="tw-text-sm tw-text-neutral-400">
|
|
366
|
-
Width: {rightWidth}px — Drag left edge to resize
|
|
367
|
-
</p>
|
|
368
|
-
<Sidebar.FillTrigger side="right">
|
|
369
|
-
<Button block argo variant="secondary">
|
|
370
|
-
<Expand className="tw-size-4" />
|
|
371
|
-
Fullscreen
|
|
372
|
-
</Button>
|
|
373
|
-
</Sidebar.FillTrigger>
|
|
374
|
-
<Sidebar.Trigger side="right">
|
|
375
|
-
<Button block argo variant="outline">
|
|
376
|
-
<PanelLeft className="tw-size-4" />
|
|
377
|
-
Collapse
|
|
378
|
-
</Button>
|
|
379
|
-
</Sidebar.Trigger>
|
|
380
|
-
</div>
|
|
381
|
-
</Sidebar>
|
|
382
|
-
</div>
|
|
383
|
-
</SidebarProvider>
|
|
384
|
-
);
|
|
385
|
-
},
|
|
386
|
-
decorators: [],
|
|
387
|
-
};
|
|
388
|
-
|
|
389
|
-
export const SidebarInSidebar: Story = {
|
|
390
|
-
args: {
|
|
391
|
-
rightWidth: 384,
|
|
392
|
-
leftVariant: 'none',
|
|
393
|
-
},
|
|
394
|
-
decorators: [rightLayoutDecorator],
|
|
395
|
-
render: () => {
|
|
396
|
-
const { isFill } = useSidebar('right');
|
|
397
|
-
const [innerMode, setInnerMode] = useState<SidebarMode>('collapsed');
|
|
398
|
-
|
|
399
|
-
const handleOnModeChange = (mode: SidebarMode) => {
|
|
400
|
-
setInnerMode(mode);
|
|
401
|
-
};
|
|
402
|
-
|
|
403
|
-
return (
|
|
404
|
-
<Sidebar container side="right">
|
|
405
|
-
<SidebarProvider
|
|
406
|
-
leftVariant="sided-floating"
|
|
407
|
-
leftMode={isFill ? innerMode : 'collapsed'}
|
|
408
|
-
leftCollapsible={isFill ? 'icon' : 'off-canvas'}
|
|
409
|
-
onLeftModeChange={handleOnModeChange}
|
|
410
|
-
>
|
|
411
|
-
<div className="tw-flex tw-flex-1">
|
|
412
|
-
<Sidebar className="tw-absolute">
|
|
413
|
-
<Sidebar.Content>
|
|
414
|
-
<Sidebar.SearchInput placeholder="Search" />
|
|
415
|
-
|
|
416
|
-
<Sidebar.Menu>
|
|
417
|
-
<Sidebar.MenuItem>
|
|
418
|
-
<Sidebar.MenuButton tooltip="Simple" icon={['far', 'rectangle-terminal']}>
|
|
419
|
-
Action
|
|
420
|
-
</Sidebar.MenuButton>
|
|
421
|
-
</Sidebar.MenuItem>
|
|
422
|
-
|
|
423
|
-
<Sidebar.MenuItem>
|
|
424
|
-
<Sidebar.MenuCard icon="clock" title="Card">
|
|
425
|
-
Content
|
|
426
|
-
</Sidebar.MenuCard>
|
|
427
|
-
</Sidebar.MenuItem>
|
|
428
|
-
|
|
429
|
-
<Sidebar.MenuItem>
|
|
430
|
-
<SidebarModeControlMenuButton side="left" />
|
|
431
|
-
</Sidebar.MenuItem>
|
|
432
|
-
</Sidebar.Menu>
|
|
433
|
-
</Sidebar.Content>
|
|
434
|
-
</Sidebar>
|
|
435
|
-
<main className="tw-m-2 tw-flex tw-flex-1 tw-justify-center tw-rounded-xl tw-bg-neutral-50">
|
|
436
|
-
<h1>KAI</h1>
|
|
437
|
-
</main>
|
|
438
|
-
</div>
|
|
439
|
-
</SidebarProvider>
|
|
440
|
-
</Sidebar>
|
|
441
|
-
);
|
|
442
|
-
},
|
|
443
|
-
};
|
|
444
|
-
|
|
445
|
-
export const MenuItems: Story = {
|
|
446
|
-
decorators: [leftLayoutDecorator],
|
|
447
|
-
render: () => (
|
|
448
|
-
<Sidebar>
|
|
449
|
-
<Sidebar.Content>
|
|
450
|
-
<Sidebar.Menu>
|
|
451
|
-
<Sidebar.MenuItem>
|
|
452
|
-
<Sidebar.MenuButton tooltip="Simple" icon={['far', 'rectangle-terminal']}>
|
|
453
|
-
Simple
|
|
454
|
-
</Sidebar.MenuButton>
|
|
455
|
-
</Sidebar.MenuItem>
|
|
456
|
-
|
|
457
|
-
<Sidebar.MenuItem>
|
|
458
|
-
<Sidebar.MenuButton
|
|
459
|
-
tooltip="Active"
|
|
460
|
-
icon={['far', 'rectangle-terminal']}
|
|
461
|
-
aria-selected={true}
|
|
462
|
-
>
|
|
463
|
-
Active
|
|
464
|
-
</Sidebar.MenuButton>
|
|
465
|
-
</Sidebar.MenuItem>
|
|
466
|
-
|
|
467
|
-
<Sidebar.MenuItem>
|
|
468
|
-
<Sidebar.MenuButton tooltip="Disabled" icon={['far', 'rectangle-terminal']} disabled>
|
|
469
|
-
Disabled
|
|
470
|
-
</Sidebar.MenuButton>
|
|
471
|
-
</Sidebar.MenuItem>
|
|
472
|
-
|
|
473
|
-
<Sidebar.MenuItem>
|
|
474
|
-
<Sidebar.MenuButton tooltip="Simple Anchor" asChild>
|
|
475
|
-
<a href="https://www.keboole.com">
|
|
476
|
-
<Sidebar.MenuIcon>
|
|
477
|
-
<SquareTerminal className="tw-size-4" />
|
|
478
|
-
</Sidebar.MenuIcon>
|
|
479
|
-
Simple Anchor
|
|
480
|
-
</a>
|
|
481
|
-
</Sidebar.MenuButton>
|
|
482
|
-
</Sidebar.MenuItem>
|
|
483
|
-
|
|
484
|
-
<Sidebar.MenuItem>
|
|
485
|
-
<Sidebar.MenuButton
|
|
486
|
-
tooltip="Simple Anchor - Active"
|
|
487
|
-
asChild
|
|
488
|
-
icon={['far', 'rectangle-terminal']}
|
|
489
|
-
>
|
|
490
|
-
{/*use react-router based on spec*/}
|
|
491
|
-
{/*https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Attributes/aria-current*/}
|
|
492
|
-
<a aria-current="page" href="https://www.keboola.com">
|
|
493
|
-
Simple Anchor - Active
|
|
494
|
-
</a>
|
|
495
|
-
</Sidebar.MenuButton>
|
|
496
|
-
</Sidebar.MenuItem>
|
|
497
|
-
|
|
498
|
-
<Sidebar.MenuItem>
|
|
499
|
-
<Sidebar.MenuButton
|
|
500
|
-
tooltip="This will be very long text hidden with ellipsis"
|
|
501
|
-
icon={['far', 'rectangle-terminal']}
|
|
502
|
-
>
|
|
503
|
-
<span className="tw-truncate">This will be very long text hidden with ellipsis</span>
|
|
504
|
-
</Sidebar.MenuButton>
|
|
505
|
-
</Sidebar.MenuItem>
|
|
506
|
-
|
|
507
|
-
<Sidebar.MenuItem>
|
|
508
|
-
<Sidebar.MenuCard icon="clock" title="Card Item">
|
|
509
|
-
Content
|
|
510
|
-
</Sidebar.MenuCard>
|
|
511
|
-
</Sidebar.MenuItem>
|
|
512
|
-
|
|
513
|
-
<Sidebar.MenuItem>
|
|
514
|
-
<Sidebar.SubMenu icon={['far', 'layer-group']} label="Sub Menu" defaultOpen>
|
|
515
|
-
<Sidebar.SubItem>Plain Sub Item</Sidebar.SubItem>
|
|
516
|
-
<Sidebar.SubItem aria-selected>Active Sub Item</Sidebar.SubItem>
|
|
517
|
-
<Sidebar.SubItem asChild>
|
|
518
|
-
{/* oxlint-disable-next-line jsx-a11y/anchor-is-valid */}
|
|
519
|
-
<a href="#">Anchor Sub Item</a>
|
|
520
|
-
</Sidebar.SubItem>
|
|
521
|
-
<Sidebar.SubItem disabled>Disabled Sub Item</Sidebar.SubItem>
|
|
522
|
-
</Sidebar.SubMenu>
|
|
523
|
-
</Sidebar.MenuItem>
|
|
524
|
-
</Sidebar.Menu>
|
|
525
|
-
</Sidebar.Content>
|
|
526
|
-
</Sidebar>
|
|
527
|
-
),
|
|
528
|
-
};
|
|
529
|
-
|
|
530
|
-
/**
|
|
531
|
-
* The SidebarMenuAction component is used to render a menu action within a SidebarMenuItem.
|
|
532
|
-
*
|
|
533
|
-
* This button works independently of the SidebarMenuButton i.e you can have the `<SidebarMenuButton />` as a clickable link and the `<SidebarMenuAction />` as a button.
|
|
534
|
-
*/
|
|
535
|
-
export const MenuAction: Story = {
|
|
536
|
-
decorators: [leftLayoutDecorator],
|
|
537
|
-
render: () => (
|
|
538
|
-
<Sidebar>
|
|
539
|
-
<Sidebar.Content>
|
|
540
|
-
<Sidebar.Menu>
|
|
541
|
-
<Sidebar.MenuItem>
|
|
542
|
-
<Sidebar.MenuButton
|
|
543
|
-
tooltip="Dropdown Action With very very long text"
|
|
544
|
-
icon={['far', 'rectangle-terminal']}
|
|
545
|
-
>
|
|
546
|
-
<span className="tw-truncate">Dropdown Action With very very long text</span>
|
|
547
|
-
</Sidebar.MenuButton>
|
|
548
|
-
<DropdownMenu>
|
|
549
|
-
<DropdownMenu.Trigger asChild>
|
|
550
|
-
<Sidebar.MenuAction showOnHover>
|
|
551
|
-
<Ellipsis />
|
|
552
|
-
<span className="tw-sr-only">Actions</span>
|
|
553
|
-
</Sidebar.MenuAction>
|
|
554
|
-
</DropdownMenu.Trigger>
|
|
555
|
-
|
|
556
|
-
<DropdownMenu.Content side="right" align="start">
|
|
557
|
-
<DropdownMenu.Group>
|
|
558
|
-
<DropdownMenu.Item icon={<Pencil className="tw-size-4" />}>
|
|
559
|
-
Edit{' '}
|
|
560
|
-
</DropdownMenu.Item>
|
|
561
|
-
<DropdownMenu.Item icon={<Trash2 className="tw-size-4" />}>
|
|
562
|
-
Delete{' '}
|
|
563
|
-
</DropdownMenu.Item>
|
|
564
|
-
</DropdownMenu.Group>
|
|
565
|
-
</DropdownMenu.Content>
|
|
566
|
-
</DropdownMenu>
|
|
567
|
-
</Sidebar.MenuItem>
|
|
568
|
-
|
|
569
|
-
<Sidebar.MenuItem>
|
|
570
|
-
<Sidebar.MenuButton tooltip="As Non-actionable" icon="code">
|
|
571
|
-
<span className="tw-truncate">As Non-actionable</span>
|
|
572
|
-
</Sidebar.MenuButton>
|
|
573
|
-
|
|
574
|
-
<Sidebar.MenuAction asChild>
|
|
575
|
-
<AlertTriangle className="tw-text-warning-600" />
|
|
576
|
-
</Sidebar.MenuAction>
|
|
577
|
-
</Sidebar.MenuItem>
|
|
578
|
-
<Sidebar.MenuItem>
|
|
579
|
-
<Sidebar.MenuButton tooltip="As Non-actionable with Very long text" icon="code">
|
|
580
|
-
<span className="tw-truncate">As Non-actionable with Very long text</span>
|
|
581
|
-
</Sidebar.MenuButton>
|
|
582
|
-
<Sidebar.MenuAction asChild>
|
|
583
|
-
<AlertTriangle className="tw-text-warning-600" />
|
|
584
|
-
</Sidebar.MenuAction>
|
|
585
|
-
</Sidebar.MenuItem>
|
|
586
|
-
<Sidebar.MenuItem>
|
|
587
|
-
<Sidebar.MenuButton tooltip="As Link" asChild icon={['far', 'code-branch']}>
|
|
588
|
-
{/* oxlint-disable-next-line jsx-a11y/anchor-is-valid */}
|
|
589
|
-
<a href="#">As Link</a>
|
|
590
|
-
</Sidebar.MenuButton>
|
|
591
|
-
<Sidebar.MenuAction asChild>
|
|
592
|
-
<Link href="#">
|
|
593
|
-
<Gauge className="tw-text-warning-600" />
|
|
594
|
-
<span className="tw-sr-only">Dashboard</span>
|
|
595
|
-
</Link>
|
|
596
|
-
</Sidebar.MenuAction>
|
|
597
|
-
</Sidebar.MenuItem>
|
|
598
|
-
</Sidebar.Menu>
|
|
599
|
-
</Sidebar.Content>
|
|
600
|
-
</Sidebar>
|
|
601
|
-
),
|
|
602
|
-
};
|
|
603
|
-
|
|
604
|
-
/**
|
|
605
|
-
* The `Sidebar.MenuBadge` component is used to display notification counts, status indicators,
|
|
606
|
-
* or other small pieces of information on menu buttons.
|
|
607
|
-
*
|
|
608
|
-
* The badge is positioned absolutely in the top-right corner of the menu button and automatically
|
|
609
|
-
* adapts its color based on button state (hover, active). It's hidden when the sidebar is collapsed
|
|
610
|
-
* to icon-only mode.
|
|
611
|
-
*/
|
|
612
|
-
export const MenuBadge: Story = {
|
|
613
|
-
decorators: [leftLayoutDecorator],
|
|
614
|
-
render: () => (
|
|
615
|
-
<Sidebar>
|
|
616
|
-
<Sidebar.Content>
|
|
617
|
-
<Sidebar.Menu>
|
|
618
|
-
<Sidebar.MenuItem>
|
|
619
|
-
<Sidebar.MenuButton tooltip="Messages" icon={['far', 'rectangle-terminal']}>
|
|
620
|
-
Messages
|
|
621
|
-
</Sidebar.MenuButton>
|
|
622
|
-
<Sidebar.MenuBadge>5</Sidebar.MenuBadge>
|
|
623
|
-
</Sidebar.MenuItem>
|
|
624
|
-
|
|
625
|
-
<Sidebar.MenuItem>
|
|
626
|
-
<Sidebar.MenuButton tooltip="Storage" icon={['far', 'warehouse']} aria-selected={true}>
|
|
627
|
-
Storage
|
|
628
|
-
</Sidebar.MenuButton>
|
|
629
|
-
<Sidebar.MenuBadge>3</Sidebar.MenuBadge>
|
|
630
|
-
</Sidebar.MenuItem>
|
|
631
|
-
|
|
632
|
-
<Sidebar.MenuItem>
|
|
633
|
-
<Sidebar.MenuButton
|
|
634
|
-
tooltip="Link"
|
|
635
|
-
icon={['far', 'warehouse']}
|
|
636
|
-
aria-selected={true}
|
|
637
|
-
asChild
|
|
638
|
-
>
|
|
639
|
-
<Link href="#">Link</Link>
|
|
640
|
-
</Sidebar.MenuButton>
|
|
641
|
-
<Sidebar.MenuBadge>3</Sidebar.MenuBadge>
|
|
642
|
-
</Sidebar.MenuItem>
|
|
643
|
-
|
|
644
|
-
<Sidebar.MenuItem>
|
|
645
|
-
<Sidebar.MenuCard icon="clock" title="Card With Badge">
|
|
646
|
-
Content
|
|
647
|
-
</Sidebar.MenuCard>
|
|
648
|
-
<Sidebar.MenuBadge>8</Sidebar.MenuBadge>
|
|
649
|
-
</Sidebar.MenuItem>
|
|
650
|
-
</Sidebar.Menu>
|
|
651
|
-
</Sidebar.Content>
|
|
652
|
-
</Sidebar>
|
|
653
|
-
),
|
|
654
|
-
};
|
|
655
|
-
|
|
656
|
-
/**
|
|
657
|
-
* Use the `Sidebar.Group` component to create a section within the sidebar.
|
|
658
|
-
*
|
|
659
|
-
* A `Sidebar.Group` has a `Sidebar.GroupLabel`, a `Sidebar.GroupContent` and an optional `Sidebar.GroupAction`.
|
|
660
|
-
*/
|
|
661
|
-
export const Group: Story = {
|
|
662
|
-
decorators: [leftLayoutDecorator],
|
|
663
|
-
render: () => (
|
|
664
|
-
<Sidebar>
|
|
665
|
-
<Sidebar.Content>
|
|
666
|
-
<Sidebar.Group>
|
|
667
|
-
<Sidebar.GroupLabel>Group A</Sidebar.GroupLabel>
|
|
668
|
-
<Sidebar.GroupAction>
|
|
669
|
-
<Plus className="tw-size-4" />
|
|
670
|
-
</Sidebar.GroupAction>
|
|
671
|
-
<Sidebar.GroupContent>
|
|
672
|
-
<Sidebar.Menu>
|
|
673
|
-
<Sidebar.MenuItem>
|
|
674
|
-
<Sidebar.MenuButton tooltip="Group A Item" icon="gauge">
|
|
675
|
-
Group A Item
|
|
676
|
-
</Sidebar.MenuButton>
|
|
677
|
-
</Sidebar.MenuItem>
|
|
678
|
-
</Sidebar.Menu>
|
|
679
|
-
</Sidebar.GroupContent>
|
|
680
|
-
</Sidebar.Group>
|
|
681
|
-
|
|
682
|
-
<Sidebar.Group>
|
|
683
|
-
<Sidebar.GroupLabel>Group B</Sidebar.GroupLabel>
|
|
684
|
-
<Sidebar.GroupAction>
|
|
685
|
-
<Minus className="tw-size-4" />
|
|
686
|
-
</Sidebar.GroupAction>
|
|
687
|
-
<Sidebar.GroupContent>
|
|
688
|
-
<Sidebar.Menu>
|
|
689
|
-
<Sidebar.MenuItem>
|
|
690
|
-
<Sidebar.MenuButton tooltip="Group B Item" icon="gauge">
|
|
691
|
-
Group B Item
|
|
692
|
-
</Sidebar.MenuButton>
|
|
693
|
-
</Sidebar.MenuItem>
|
|
694
|
-
</Sidebar.Menu>
|
|
695
|
-
</Sidebar.GroupContent>
|
|
696
|
-
</Sidebar.Group>
|
|
697
|
-
</Sidebar.Content>
|
|
698
|
-
</Sidebar>
|
|
699
|
-
),
|
|
700
|
-
};
|
|
701
|
-
|
|
702
|
-
/**
|
|
703
|
-
* The `SidebarSeparator` component is used to render a separator within a `Sidebar`.
|
|
704
|
-
*/
|
|
705
|
-
export const Separator: Story = {
|
|
706
|
-
decorators: [leftLayoutDecorator],
|
|
707
|
-
render: () => (
|
|
708
|
-
<Sidebar>
|
|
709
|
-
<Sidebar.Content>
|
|
710
|
-
<Sidebar.Menu>
|
|
711
|
-
<Sidebar.MenuItem>
|
|
712
|
-
<Sidebar.MenuButton tooltip="Menu & Menu" icon="folder-open">
|
|
713
|
-
Menu & Menu
|
|
714
|
-
</Sidebar.MenuButton>
|
|
715
|
-
</Sidebar.MenuItem>
|
|
716
|
-
</Sidebar.Menu>
|
|
717
|
-
|
|
718
|
-
<Sidebar.Separator />
|
|
719
|
-
|
|
720
|
-
<Sidebar.Menu>
|
|
721
|
-
<Sidebar.MenuItem>
|
|
722
|
-
<Sidebar.MenuButton tooltip="Menu & Group" icon="folder-open">
|
|
723
|
-
Menu & Group
|
|
724
|
-
</Sidebar.MenuButton>
|
|
725
|
-
</Sidebar.MenuItem>
|
|
726
|
-
</Sidebar.Menu>
|
|
727
|
-
|
|
728
|
-
<Sidebar.Separator />
|
|
729
|
-
|
|
730
|
-
<Sidebar.Group>
|
|
731
|
-
<Sidebar.GroupLabel>Group A</Sidebar.GroupLabel>
|
|
732
|
-
<Sidebar.GroupContent>
|
|
733
|
-
<Sidebar.Menu>
|
|
734
|
-
<Sidebar.MenuItem>
|
|
735
|
-
<Sidebar.MenuButton tooltip="MenuItem * MenuItem" icon="folder-open">
|
|
736
|
-
MenuItem * MenuItem
|
|
737
|
-
</Sidebar.MenuButton>
|
|
738
|
-
</Sidebar.MenuItem>
|
|
739
|
-
|
|
740
|
-
<Sidebar.Separator />
|
|
741
|
-
|
|
742
|
-
<Sidebar.MenuItem>
|
|
743
|
-
<Sidebar.MenuButton tooltip="Item E" icon="folder-open">
|
|
744
|
-
Item E
|
|
745
|
-
</Sidebar.MenuButton>
|
|
746
|
-
</Sidebar.MenuItem>
|
|
747
|
-
</Sidebar.Menu>
|
|
748
|
-
</Sidebar.GroupContent>
|
|
749
|
-
</Sidebar.Group>
|
|
750
|
-
</Sidebar.Content>
|
|
751
|
-
</Sidebar>
|
|
752
|
-
),
|
|
753
|
-
};
|
|
754
|
-
|
|
755
|
-
/*
|
|
756
|
-
* Use the `Sidebar` component inside a `Modal` or `Popover` to create a modal sidebar.
|
|
757
|
-
*/
|
|
758
|
-
export const InsideModal: Story = {
|
|
759
|
-
render: () => (
|
|
760
|
-
<Modal>
|
|
761
|
-
<Modal.Trigger asChild>
|
|
762
|
-
<Button>Open Modal</Button>
|
|
763
|
-
</Modal.Trigger>
|
|
764
|
-
|
|
765
|
-
<Modal.Content className="tw-size-[800px] !tw-flex-row tw-gap-0 tw-overflow-hidden tw-bg-neutral-50 tw-p-0">
|
|
766
|
-
<Modal.Header title="Story for Sidebar inside Modal" className="tw-sr-only" />
|
|
767
|
-
<SidebarProvider leftVariant="floating" leftCollapsible="icon">
|
|
768
|
-
<div className="tw-flex tw-flex-1">
|
|
769
|
-
<Sidebar side="left">
|
|
770
|
-
<Sidebar.Header>
|
|
771
|
-
<Sidebar.Menu>
|
|
772
|
-
<Sidebar.MenuItem>
|
|
773
|
-
<Sidebar.Trigger>
|
|
774
|
-
<Sidebar.MenuButton tooltip="Collapse" icon={['far', 'sidebar']}>
|
|
775
|
-
Collapse
|
|
776
|
-
</Sidebar.MenuButton>
|
|
777
|
-
</Sidebar.Trigger>
|
|
778
|
-
</Sidebar.MenuItem>
|
|
779
|
-
</Sidebar.Menu>
|
|
780
|
-
</Sidebar.Header>
|
|
781
|
-
</Sidebar>
|
|
782
|
-
|
|
783
|
-
<AppContent>Keboola Content</AppContent>
|
|
784
|
-
</div>
|
|
785
|
-
</SidebarProvider>
|
|
786
|
-
</Modal.Content>
|
|
787
|
-
</Modal>
|
|
788
|
-
),
|
|
789
|
-
};
|
|
790
|
-
|
|
791
|
-
export const StaticSiteMenu: Story = {
|
|
792
|
-
render: () => {
|
|
793
|
-
const HEADER_HEIGHT = '40px'; // Adjust based on your header height
|
|
794
|
-
|
|
795
|
-
return (
|
|
796
|
-
<>
|
|
797
|
-
<header
|
|
798
|
-
className="tw-top tw-static tw-flex tw-items-center tw-justify-center tw-border-b tw-border-neutral-150 tw-bg-white"
|
|
799
|
-
style={{
|
|
800
|
-
height: HEADER_HEIGHT,
|
|
801
|
-
}}
|
|
802
|
-
>
|
|
803
|
-
Static Site header
|
|
804
|
-
</header>
|
|
805
|
-
|
|
806
|
-
<div className="tw-flex tw-flex-1">
|
|
807
|
-
<Sidebar
|
|
808
|
-
style={{
|
|
809
|
-
top: HEADER_HEIGHT,
|
|
810
|
-
}}
|
|
811
|
-
>
|
|
812
|
-
<Sidebar.Header>
|
|
813
|
-
<Sidebar.Menu>
|
|
814
|
-
<Sidebar.MenuItem>
|
|
815
|
-
<Sidebar.Trigger>
|
|
816
|
-
<Sidebar.MenuButton tooltip="Hello" icon="bolt">
|
|
817
|
-
Hello
|
|
818
|
-
</Sidebar.MenuButton>
|
|
819
|
-
</Sidebar.Trigger>
|
|
820
|
-
</Sidebar.MenuItem>
|
|
821
|
-
</Sidebar.Menu>
|
|
822
|
-
</Sidebar.Header>
|
|
823
|
-
</Sidebar>
|
|
824
|
-
|
|
825
|
-
<AppContent side="both" />
|
|
826
|
-
|
|
827
|
-
<Sidebar
|
|
828
|
-
side="right"
|
|
829
|
-
style={{
|
|
830
|
-
top: HEADER_HEIGHT,
|
|
831
|
-
}}
|
|
832
|
-
>
|
|
833
|
-
<Sidebar.Header>
|
|
834
|
-
<Sidebar.Menu>
|
|
835
|
-
<Sidebar.MenuItem>
|
|
836
|
-
<Sidebar.Trigger side="right">
|
|
837
|
-
<Sidebar.MenuButton tooltip="Hello" icon="bolt">
|
|
838
|
-
Hello
|
|
839
|
-
</Sidebar.MenuButton>
|
|
840
|
-
</Sidebar.Trigger>
|
|
841
|
-
</Sidebar.MenuItem>
|
|
842
|
-
</Sidebar.Menu>
|
|
843
|
-
</Sidebar.Header>
|
|
844
|
-
</Sidebar>
|
|
845
|
-
</div>
|
|
846
|
-
</>
|
|
847
|
-
);
|
|
848
|
-
},
|
|
849
|
-
};
|