Repository: charmbracelet/bubbles Branch: main Commit: d2b804ead271 Files: 98 Total size: 390.4 KB Directory structure: gitextract_bq3bte_v/ ├── .github/ │ ├── CODEOWNERS │ ├── ISSUE_TEMPLATE/ │ │ ├── bug_report.md │ │ ├── config.yml │ │ └── feature_request.md │ ├── dependabot.yml │ └── workflows/ │ ├── build.yml │ ├── coverage.yml │ ├── dependabot-sync.yml │ ├── lint-sync.yml │ ├── lint.yml │ └── release.yml ├── .gitignore ├── .golangci.yml ├── .goreleaser.yml ├── LICENSE ├── README.md ├── Taskfile.yaml ├── UPGRADE_GUIDE_V2.md ├── bubbles.go ├── cursor/ │ ├── cursor.go │ └── cursor_test.go ├── filepicker/ │ ├── filepicker.go │ ├── hidden_unix.go │ └── hidden_windows.go ├── go.mod ├── go.sum ├── help/ │ ├── help.go │ ├── help_test.go │ └── testdata/ │ └── TestFullHelp/ │ ├── full_help_20_width.golden │ ├── full_help_30_width.golden │ └── full_help_40_width.golden ├── internal/ │ ├── memoization/ │ │ ├── memoization.go │ │ └── memoization_test.go │ └── runeutil/ │ ├── runeutil.go │ └── runeutil_test.go ├── key/ │ ├── key.go │ └── key_test.go ├── list/ │ ├── README.md │ ├── defaultitem.go │ ├── keys.go │ ├── list.go │ ├── list_test.go │ └── style.go ├── paginator/ │ ├── paginator.go │ └── paginator_test.go ├── progress/ │ ├── progress.go │ ├── progress_test.go │ └── testdata/ │ └── TestBlend/ │ ├── 10w-red-to-green-50perc-full-block.golden │ ├── 10w-red-to-green-50perc.golden │ ├── 10w-red-to-green-scaled-50perc.golden │ ├── 30w-colorfunc-rgb-100perc.golden │ ├── 30w-red-to-green-100perc.golden │ └── 30w-red-to-green-scaled-100perc.golden ├── spinner/ │ ├── spinner.go │ └── spinner_test.go ├── stopwatch/ │ └── stopwatch.go ├── table/ │ ├── table.go │ ├── table_test.go │ └── testdata/ │ ├── TestModel_View/ │ │ ├── Bordered_cells.golden │ │ ├── Bordered_headers.golden │ │ ├── Empty.golden │ │ ├── Extra_padding.golden │ │ ├── Height_greater_than_rows.golden │ │ ├── Height_less_than_rows.golden │ │ ├── Modified_viewport_height.golden │ │ ├── Multiple_rows_and_columns.golden │ │ ├── No_padding.golden │ │ ├── Single_row_and_column.golden │ │ ├── Width_greater_than_columns.golden │ │ └── Width_less_than_columns.golden │ ├── TestModel_View_CenteredInABox.golden │ └── TestTableAlignment/ │ ├── No_border.golden │ └── With_border.golden ├── textarea/ │ ├── textarea.go │ └── textarea_test.go ├── textinput/ │ ├── styles.go │ ├── textinput.go │ └── textinput_test.go ├── timer/ │ └── timer.go └── viewport/ ├── highlight.go ├── keymap.go ├── testdata/ │ └── TestSizing/ │ ├── view-40x1-softwrap-at-bottom.golden │ ├── view-40x1-softwrap-scrolled-plus-1.golden │ ├── view-40x1-softwrap-scrolled-plus-2.golden │ ├── view-40x1-softwrap.golden │ ├── view-40x1.golden │ ├── view-40x100percent.golden │ ├── view-50x15-content-lines.golden │ ├── view-50x15-softwrap-at-bottom.golden │ ├── view-50x15-softwrap-at-top.golden │ ├── view-50x15-softwrap-gutter-at-bottom.golden │ ├── view-50x15-softwrap-gutter-at-top.golden │ ├── view-50x15-softwrap-gutter-scrolled-plus-1.golden │ ├── view-50x15-softwrap-gutter-scrolled-plus-2.golden │ ├── view-50x15-softwrap-scrolled-plus-1.golden │ └── view-50x15-softwrap-scrolled-plus-2.golden ├── viewport.go └── viewport_test.go ================================================ FILE CONTENTS ================================================ ================================================ FILE: .github/CODEOWNERS ================================================ * @meowgorithm @bashbunni cursor/ @aymanbagabas filepicker/ @bashbunni help/ @meowgorithm key/ @meowgorithm list/ @meowgorithm paginator/ @meowgorithm progress/ @meowgorithm spinner/ @meowgorithm stopwatch/ @caarlos0 table/ @aymanbagabas textarea/ @aymanbagabas textinput/ @meowgorithm viewport/ @meowgorithm ================================================ FILE: .github/ISSUE_TEMPLATE/bug_report.md ================================================ --- name: Bug report about: Create a report to help us improve title: '' labels: '' assignees: '' --- **Describe the bug** A clear and concise description of what the bug is. **Setup** Please complete the following information along with version numbers, if applicable. - OS [e.g. Ubuntu, macOS] - Shell [e.g. zsh, fish] - Terminal Emulator [e.g. kitty, iterm] - Terminal Multiplexer [e.g. tmux] - Locale [e.g. en_US.UTF-8, zh_CN.UTF-8, etc.] **To Reproduce** Steps to reproduce the behavior: 1. Go to '...' 2. Click on '....' 3. Scroll down to '....' 4. See error **Source Code** Please include source code if needed to reproduce the behavior. **Expected behavior** A clear and concise description of what you expected to happen. **Screenshots** Add screenshots to help explain your problem. **Additional context** Add any other context about the problem here. ================================================ FILE: .github/ISSUE_TEMPLATE/config.yml ================================================ blank_issues_enabled: true contact_links: - name: Discord url: https://charm.sh/discord about: Chat on our Discord. ================================================ FILE: .github/ISSUE_TEMPLATE/feature_request.md ================================================ --- name: Feature request about: Suggest an idea for this project title: '' labels: enhancement assignees: '' --- **Is your feature request related to a problem? Please describe.** A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] **Describe the solution you'd like** A clear and concise description of what you want to happen. **Describe alternatives you've considered** A clear and concise description of any alternative solutions or features you've considered. **Additional context** Add any other context or screenshots about the feature request here. ================================================ FILE: .github/dependabot.yml ================================================ version: 2 updates: - package-ecosystem: "gomod" directory: "/" schedule: interval: "weekly" day: "monday" time: "05:00" timezone: "America/New_York" labels: - "dependencies" commit-message: prefix: "chore" include: "scope" groups: all: patterns: - "*" - package-ecosystem: "github-actions" directory: "/" schedule: interval: "weekly" day: "monday" time: "05:00" timezone: "America/New_York" labels: - "dependencies" commit-message: prefix: "chore" include: "scope" groups: all: patterns: - "*" - package-ecosystem: "docker" directory: "/" schedule: interval: "weekly" day: "monday" time: "05:00" timezone: "America/New_York" labels: - "dependencies" commit-message: prefix: "chore" include: "scope" groups: all: patterns: - "*" ================================================ FILE: .github/workflows/build.yml ================================================ name: build on: [push, pull_request] jobs: test: strategy: matrix: go-version: [stable, oldstable] os: [ubuntu-latest, macos-latest, windows-latest] runs-on: ${{ matrix.os }} steps: - name: Install Go uses: actions/setup-go@v6 with: go-version: ${{ matrix.go-version }} - name: Checkout code uses: actions/checkout@v6 - name: Download Go modules run: go mod download - name: Build run: go build -v ./... - name: Test run: go test ./... dependabot: needs: [test] runs-on: ubuntu-latest permissions: pull-requests: write contents: write if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'}} steps: - id: metadata uses: dependabot/fetch-metadata@v2 with: github-token: "${{ secrets.GITHUB_TOKEN }}" - run: | gh pr review --approve "$PR_URL" gh pr merge --squash --auto "$PR_URL" env: PR_URL: ${{github.event.pull_request.html_url}} GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} ================================================ FILE: .github/workflows/coverage.yml ================================================ name: coverage on: [push, pull_request] jobs: coverage: strategy: matrix: go-version: [^1.22] os: [ubuntu-latest] runs-on: ${{ matrix.os }} env: GO111MODULE: "on" steps: - name: Install Go uses: actions/setup-go@v6 with: go-version: ${{ matrix.go-version }} - name: Checkout code uses: actions/checkout@v6 - name: Coverage env: COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | go test -race -covermode atomic -coverprofile=profile.cov ./... go install github.com/mattn/goveralls@latest goveralls -coverprofile=profile.cov -service=github ================================================ FILE: .github/workflows/dependabot-sync.yml ================================================ name: dependabot-sync on: schedule: - cron: "0 0 * * 0" # every Sunday at midnight workflow_dispatch: # allows manual triggering permissions: contents: write pull-requests: write jobs: dependabot-sync: uses: charmbracelet/meta/.github/workflows/dependabot-sync.yml@main with: repo_name: ${{ github.event.repository.name }} secrets: gh_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} ================================================ FILE: .github/workflows/lint-sync.yml ================================================ name: lint-sync on: schedule: # every Sunday at midnight - cron: "0 0 * * 0" workflow_dispatch: # allows manual triggering permissions: contents: write pull-requests: write jobs: lint: uses: charmbracelet/meta/.github/workflows/lint-sync.yml@main ================================================ FILE: .github/workflows/lint.yml ================================================ name: lint on: push: pull_request: jobs: lint: uses: charmbracelet/meta/.github/workflows/lint.yml@main with: golangci_path: .golangci.yml golangci_version: v2.9 timeout: 10m ================================================ FILE: .github/workflows/release.yml ================================================ name: goreleaser on: push: tags: - v*.*.* concurrency: group: goreleaser cancel-in-progress: true jobs: goreleaser: uses: charmbracelet/meta/.github/workflows/goreleaser.yml@main secrets: docker_username: ${{ secrets.DOCKERHUB_USERNAME }} docker_token: ${{ secrets.DOCKERHUB_TOKEN }} gh_pat: ${{ secrets.PERSONAL_ACCESS_TOKEN }} goreleaser_key: ${{ secrets.GORELEASER_KEY }} twitter_consumer_key: ${{ secrets.TWITTER_CONSUMER_KEY }} twitter_consumer_secret: ${{ secrets.TWITTER_CONSUMER_SECRET }} twitter_access_token: ${{ secrets.TWITTER_ACCESS_TOKEN }} twitter_access_token_secret: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }} mastodon_client_id: ${{ secrets.MASTODON_CLIENT_ID }} mastodon_client_secret: ${{ secrets.MASTODON_CLIENT_SECRET }} mastodon_access_token: ${{ secrets.MASTODON_ACCESS_TOKEN }} discord_webhook_id: ${{ secrets.DISCORD_WEBHOOK_ID }} discord_webhook_token: ${{ secrets.DISCORD_WEBHOOK_TOKEN }} # yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json ================================================ FILE: .gitignore ================================================ .DS_Store dist/ ================================================ FILE: .golangci.yml ================================================ version: "2" run: tests: false linters: enable: - bodyclose - exhaustive - goconst - godot - godox - gomoddirectives - goprintffuncname - gosec - misspell - nakedret - nestif - nilerr - noctx - nolintlint - prealloc - revive - rowserrcheck - sqlclosecheck - tparallel - unconvert - unparam - whitespace - wrapcheck exclusions: generated: lax presets: - common-false-positives rules: - linters: - revive text: "var-naming" issues: max-issues-per-linter: 0 max-same-issues: 0 formatters: enable: - gofumpt - goimports exclusions: generated: lax ================================================ FILE: .goreleaser.yml ================================================ # yaml-language-server: $schema=https://goreleaser.com/static/schema-pro.json version: 2 includes: - from_url: url: charmbracelet/meta/main/goreleaser-lib.yaml ================================================ FILE: LICENSE ================================================ MIT License Copyright (c) 2020-2026 Charmbracelet, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: README.md ================================================ # Bubbles [![Latest Release](https://img.shields.io/github/release/charmbracelet/bubbles.svg)](https://github.com/charmbracelet/bubbles/releases) [![GoDoc](https://godoc.org/github.com/golang/gddo?status.svg)](https://pkg.go.dev/github.com/charmbracelet/bubbles) [![Build Status](https://github.com/charmbracelet/bubbles/workflows/build/badge.svg)](https://github.com/charmbracelet/bubbles/actions) [![Go ReportCard](https://goreportcard.com/badge/charmbracelet/bubbles)](https://goreportcard.com/report/charmbracelet/bubbles) Primatives for [Bubble Tea](https://github.com/charmbracelet/bubbletea) applications. These components are used in production in [Crush][crush], and [many other applications][otherstuff]. > [!TIP] > > Upgrading from v1? Check out the [upgrade guide](./UPGRADE_GUIDE_V2.md), or > point your LLM at it and let it go to town. [crush]: https://github.com/charmbracelet/crush [otherstuff]: https://github.com/charmbracelet/bubbletea/#bubble-tea-in-the-wild ## Spinner Spinner Example A spinner, useful for indicating that some kind an operation is happening. There are a couple default ones, but you can also pass your own ”frames.” - [Example code, basic spinner](https://github.com/charmbracelet/bubbletea/blob/main/examples/spinner/main.go) - [Example code, various spinners](https://github.com/charmbracelet/bubbletea/blob/main/examples/spinners/main.go) ## Text Input Text Input Example A text input field, akin to an `` in HTML. Supports unicode, pasting, in-place scrolling when the value exceeds the width of the element and the common, and many customization options. - [Example code, one field](https://github.com/charmbracelet/bubbletea/blob/main/examples/textinput/main.go) - [Example code, many fields](https://github.com/charmbracelet/bubbletea/blob/main/examples/textinputs/main.go) ## Text Area Text Area Example A text area field, akin to an `