### Quick Start Installation and Setup Source: https://gitlab.com/govbr-ds/bibliotecas/wbc/govbr-ds-wbc/-/blob/next/README.md Follow these commands to clone the repository, install dependencies, and start the development servers for web components and the documentation site. ```bash # 1) Clonar repositório\ngit clone https://gitlab.com/govbr-ds/bibliotecas/wbc/govbr-ds-wbc.git\ncd govbr-ds-wbc\n\n# 2) Instalar dependências\npnpm install\n\n# 3) Subir dev server dos web components\npnpm start\n\n# 4) Em outro terminal, subir site de docs\npnpm exec nx start site ``` -------------------------------- ### Setup Development Environment Source: https://gitlab.com/govbr-ds/bibliotecas/wbc/govbr-ds-wbc/-/blob/next/CONTRIBUTING.md Clone the repository, install dependencies, and start the development servers for web components and the documentation site. ```bash git clone https://gitlab.com/govbr-ds/bibliotecas/wbc/govbr-ds-wbc.git cd govbr-ds-wbc pnpm install pnpm exec nx run webcomponents:start pnpm exec nx run site:start ``` -------------------------------- ### Install Dependencies and Start Project (Inside Container) Source: https://gitlab.com/govbr-ds/bibliotecas/wbc/govbr-ds-wbc/-/blob/next/README.md Installs dependencies using pnpm with a frozen lockfile and starts the project. These commands are run inside the development container. ```bash pnpm install --frozen-lockfile pnpm start ``` -------------------------------- ### Enter Development Container Source: https://gitlab.com/govbr-ds/bibliotecas/wbc/govbr-ds-wbc/-/blob/next/README.md Enters the development container. Once inside, you can install dependencies and start the project. ```bash {docker/podman} compose -f compose.dev.yml exec dev bash ``` -------------------------------- ### Link Component - Default Example Source: https://gitlab.com/govbr-ds/bibliotecas/wbc/govbr-ds-wbc/-/blob/next/apps/site/docs/components/link.mdx Demonstrates the default usage of the Link component. No specific setup is required beyond importing the component. ```html Link ``` -------------------------------- ### Configure Multi-File Examples Source: https://gitlab.com/govbr-ds/bibliotecas/wbc/govbr-ds-wbc/-/blob/next/apps/site/src/components/Playground/README.md The `files` option allows specifying multiple files for a single framework target, including their content. This is useful for demonstrating complex component setups. You can mix multi-file and single-file examples. ```tsx import angular_example_component_html from './angular/example_component_html.md'; import angular_example_component_ts from './angular/example_component_ts.md'; import react_main_tsx from './react/main_tsx.md'; import react_main_css from './react/main_css.md'; import vue from './vue.md'; import javascript from './javascript.md'; ; ``` -------------------------------- ### Basic Card Example Source: https://gitlab.com/govbr-ds/bibliotecas/wbc/govbr-ds-wbc/-/blob/next/apps/site/docs/components/card/index.mdx Demonstrates the default and basic usage of the Card component. No specific setup is required beyond including the component. ```html

Card Title

This is the card body content. It can contain text, images, or other elements.

``` -------------------------------- ### Start Local Development Server Source: https://gitlab.com/govbr-ds/bibliotecas/wbc/govbr-ds-wbc/-/blob/next/apps/site/README.md Command to start the development server with hot-reloading for `@govbr-ds/webcomponents` and the site. ```bash nx start site ``` -------------------------------- ### Install @govbr-ds/webcomponents-react Source: https://gitlab.com/govbr-ds/bibliotecas/wbc/govbr-ds-wbc/-/blob/next/packages/react/README.md Install the React wrapper using npm, pnpm, or yarn. Ensure your project has compatible versions of React, react-dom, and @govbr-ds/webcomponents installed as peer dependencies. ```bash npm install @govbr-ds/webcomponents-react # ou pnpm add @govbr-ds/webcomponents-react # ou yarn add @govbr-ds/webcomponents-react ``` -------------------------------- ### Install @govbr-ds/webcomponents-angular Source: https://gitlab.com/govbr-ds/bibliotecas/wbc/govbr-ds-wbc/-/blob/next/packages/angular/README.md Install the Angular wrapper and its dependencies using npm, pnpm, or yarn. ```bash npm install @govbr-ds/webcomponents-angular # ou pnpm add @govbr-ds/webcomponents-angular # ou yarn add @govbr-ds/webcomponents-angular ``` -------------------------------- ### Install and Run Danger Bot Locally Source: https://gitlab.com/govbr-ds/bibliotecas/wbc/govbr-ds-wbc/-/blob/next/README.md Install Danger gems, verify Dangerfile syntax, set GitLab API token and host, and run Danger against a specific merge request. Ensure Ruby 3.x and Bundler are installed. ```bash gem install bundler danger ``` ```bash ruby -c Dangerfile ``` ```bash export DANGER_GITLAB_API_TOKEN="" export DANGER_GITLAB_HOST="gitlab.com" ``` ```bash danger pr --help ``` ```bash danger pr https://gitlab.com/govbr-ds/bibliotecas/wbc/govbr-ds-wbc/-/merge_requests/123 ``` -------------------------------- ### Component File Structure Example Source: https://gitlab.com/govbr-ds/bibliotecas/wbc/govbr-ds-wbc/-/blob/next/docs/PROJECT_STANDARDS.md Standard directory structure for a new component. Use `pnpm plop` to create components and examples. Shared types go in `global.types.ts`; shared utilities in `src/shared/`. ```text components// ├── .tsx ├── .scss ├── .types.ts ├── _tests/ │ └── .e2e.tsx ├── sections/ └── readme.md ``` -------------------------------- ### Basic Pagination Example Source: https://gitlab.com/govbr-ds/bibliotecas/wbc/govbr-ds-wbc/-/blob/next/apps/site/docs/components/pagination/index.mdx Demonstrates the default usage of the Pagination component. ```html
``` -------------------------------- ### Table Component Default Example Source: https://gitlab.com/govbr-ds/bibliotecas/wbc/govbr-ds-wbc/-/blob/next/apps/site/docs/components/table/index.mdx Displays the default configuration of the Table component. This example shows how to render a basic table. ```html
Header 1 Header 2 Header 3
Data 1.1 Data 1.2 Data 1.3
Data 2.1 Data 2.2 Data 2.3
Data 3.1 Data 3.2 Data 3.3
``` -------------------------------- ### Basic Notification Example Source: https://gitlab.com/govbr-ds/bibliotecas/wbc/govbr-ds-wbc/-/blob/next/apps/site/docs/components/notification/index.mdx Demonstrates the default usage of the Notification component. This is a foundational example for displaying simple notifications. ```html
``` -------------------------------- ### Install Web Components Package Source: https://gitlab.com/govbr-ds/bibliotecas/wbc/govbr-ds-wbc/-/blob/next/packages/webcomponents/README.md Install the core web components package for your project using npm, yarn, or pnpm. ```bash npm install @govbr-ds/webcomponents # ou yarn add @govbr-ds/webcomponents # ou pnpm add @govbr-ds/webcomponents ``` -------------------------------- ### Basic Collapse Example Source: https://gitlab.com/govbr-ds/bibliotecas/wbc/govbr-ds-wbc/-/blob/next/apps/site/docs/components/collapse/index.mdx Demonstrates the default usage of the Collapse component. ```html
Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident.
``` -------------------------------- ### Basic Tab Example Source: https://gitlab.com/govbr-ds/bibliotecas/wbc/govbr-ds-wbc/-/blob/next/apps/site/docs/components/tab/index.mdx Demonstrates the default usage of the Tab component. ```html
``` -------------------------------- ### Default Datetime Picker Example Source: https://gitlab.com/govbr-ds/bibliotecas/wbc/govbr-ds-wbc/-/blob/next/apps/site/docs/components/datetime-picker/index.mdx Demonstrates the default configuration and usage of the Datetime Picker component. This example is useful for understanding the basic appearance and functionality. ```html ``` -------------------------------- ### Pagination Density Example Source: https://gitlab.com/govbr-ds/bibliotecas/wbc/govbr-ds-wbc/-/blob/next/apps/site/docs/components/pagination/index.mdx Illustrates different density options for the Pagination component. ```html
``` -------------------------------- ### Divider Basic Example Source: https://gitlab.com/govbr-ds/bibliotecas/wbc/govbr-ds-wbc/-/blob/next/apps/site/docs/components/divider/index.mdx Demonstrates the default usage of the Divider component. ```html
``` -------------------------------- ### Contextual Pagination Example Source: https://gitlab.com/govbr-ds/bibliotecas/wbc/govbr-ds-wbc/-/blob/next/apps/site/docs/components/pagination/index.mdx Shows how the Pagination component can be used in a contextualized manner. ```html
``` -------------------------------- ### Basic Header Example Source: https://gitlab.com/govbr-ds/bibliotecas/wbc/govbr-ds-wbc/-/blob/next/apps/site/docs/components/header/index.mdx Demonstrates the default and basic usage of the Header component. ```html
``` -------------------------------- ### Basic Message Example Source: https://gitlab.com/govbr-ds/bibliotecas/wbc/govbr-ds-wbc/-/blob/next/apps/site/docs/components/message/index.mdx Demonstrates the default usage of the Message component. ```html
Título da mensagem

Este é o corpo da mensagem.

``` -------------------------------- ### Cookiebar Default Example Source: https://gitlab.com/govbr-ds/bibliotecas/wbc/govbr-ds-wbc/-/blob/next/apps/site/docs/components/cookiebar/index.mdx This example demonstrates the default opt-out pattern for the Cookiebar, where users can configure their cookie preferences individually. It is the recommended approach for managing user consent. ```html ``` -------------------------------- ### Start Development Environment Source: https://gitlab.com/govbr-ds/bibliotecas/wbc/govbr-ds-wbc/-/blob/next/README.md Starts the development environment using Docker Compose in detached mode. This command uses the compose.dev.yml file to define the services. ```bash {docker/podman} compose -f compose.dev.yml up -d ``` -------------------------------- ### Wizard Horizontal Example Source: https://gitlab.com/govbr-ds/bibliotecas/wbc/govbr-ds-wbc/-/blob/next/apps/site/docs/components/wizard/index.mdx Demonstrates the usage of the Wizard component in a horizontal layout. This example is intended for direct use in an HTML file. ```html
``` -------------------------------- ### Install @govbr-ds/webcomponents-vue Source: https://gitlab.com/govbr-ds/bibliotecas/wbc/govbr-ds-wbc/-/blob/next/packages/vue/README.md Install the Vue wrapper for GovBR-DS Web Components using npm, pnpm, or yarn. Ensure your project meets the specified peer dependency versions for Vue and @govbr-ds/webcomponents. ```bash npm install @govbr-ds/webcomponents-vue # ou pnpm add @govbr-ds/webcomponents-vue # ou yarn add @govbr-ds/webcomponents-vue ``` -------------------------------- ### Basic Slider Example Source: https://gitlab.com/govbr-ds/bibliotecas/wbc/govbr-ds-wbc/-/blob/next/apps/site/docs/components/slider/index.mdx Demonstrates the default and most basic implementation of the Slider component. ```html ``` -------------------------------- ### Button State Examples Source: https://gitlab.com/govbr-ds/bibliotecas/wbc/govbr-ds-wbc/-/blob/next/apps/site/docs/components/button/index.mdx Presents examples of different states for the Button component, such as active, disabled, or hover. Ensure users understand the button's current status. ```html
``` -------------------------------- ### Basic Select Example Source: https://gitlab.com/govbr-ds/bibliotecas/wbc/govbr-ds-wbc/-/blob/next/apps/site/docs/components/select/index.mdx Demonstrates the default usage of the Select component for single item selection. ```html ``` -------------------------------- ### Tab Density Example Source: https://gitlab.com/govbr-ds/bibliotecas/wbc/govbr-ds-wbc/-/blob/next/apps/site/docs/components/tab/index.mdx Illustrates different density options for the Tab component. ```html
``` -------------------------------- ### Tab Alignment Example Source: https://gitlab.com/govbr-ds/bibliotecas/wbc/govbr-ds-wbc/-/blob/next/apps/site/docs/components/tab/index.mdx Shows how to control the alignment of the Tab component. ```html
``` -------------------------------- ### Install and Run Triage Bot Locally Source: https://gitlab.com/govbr-ds/bibliotecas/wbc/govbr-ds-wbc/-/blob/next/README.md Install the gitlab-triage gem, verify YAML syntax for configuration files, set GitLab API tokens, and perform a dry-run or actual execution of the triage process for a group. Ruby 3.x is required. ```bash gem install gitlab-triage ``` ```bash ruby -c .triage-custom.rb ``` ```bash ruby -e "require 'yaml'; YAML.load_file('.triage-policies.yml'); puts 'YAML syntax OK'" ``` ```bash export GITLAB_TOKEN="" export TRIAGE_GITLAB_API_TOKEN="" ``` ```bash gitlab-triage --dry-run -r ./.triage-custom.rb --token "$GITLAB_TOKEN" --source groups --source-id govbr-ds/bibliotecas/wbc ``` ```bash gitlab-triage -r ./.triage-custom.rb --token "$GITLAB_TOKEN" --source groups --source-id govbr-ds/bibliotecas/wbc ``` -------------------------------- ### Checkbox Basic Example Source: https://gitlab.com/govbr-ds/bibliotecas/wbc/govbr-ds-wbc/-/blob/next/apps/site/docs/components/checkbox/index.mdx Demonstrates the default usage of the Checkbox component. ```html
``` -------------------------------- ### Divider Thickness Example Source: https://gitlab.com/govbr-ds/bibliotecas/wbc/govbr-ds-wbc/-/blob/next/apps/site/docs/components/divider/index.mdx Illustrates how to control the thickness of the Divider component. ```html
``` -------------------------------- ### Dropdown Methods Example Source: https://gitlab.com/govbr-ds/bibliotecas/wbc/govbr-ds-wbc/-/blob/next/packages/webcomponents/src/components/dropdown/readme.md Illustrates how to programmatically control the dropdown using its 'hide', 'open', and 'setFocus' methods. ```javascript const dropdown = document.querySelector('br-dropdown'); // To open the dropdown await dropdown.open(); // To hide the dropdown await dropdown.hide(); // To set focus on the dropdown's internal element await dropdown.setFocus(); ``` -------------------------------- ### Dropdown Events Example Source: https://gitlab.com/govbr-ds/bibliotecas/wbc/govbr-ds-wbc/-/blob/next/packages/webcomponents/src/components/dropdown/readme.md Shows how to listen for the 'brDidOpen' and 'brDropdownChange' events emitted by the dropdown component. ```javascript const dropdown = document.querySelector('br-dropdown'); dropdown.addEventListener('brDidOpen', () => { console.log('Dropdown opened!'); }); dropdown.addEventListener('brDropdownChange', (event) => { console.log('Dropdown state changed:', event.detail.isOpen); }); ``` -------------------------------- ### Multiple Select Example Source: https://gitlab.com/govbr-ds/bibliotecas/wbc/govbr-ds-wbc/-/blob/next/apps/site/docs/components/select/index.mdx Illustrates how to configure the Select component to allow multiple item selections. ```html ``` -------------------------------- ### NgModule Usage Example Source: https://gitlab.com/govbr-ds/bibliotecas/wbc/govbr-ds-wbc/-/blob/next/packages/angular/README.md Import the WebcomponentsAngularModule using forRoot() in your application's module. Ensure core dependencies are installed. ```typescript import { WebcomponentsAngularModule } from '@govbr-ds/webcomponents-angular' @NgModule({ imports: [WebcomponentsAngularModule.forRoot()], }) export class AppModule {} ``` -------------------------------- ### Serve Production Build Source: https://gitlab.com/govbr-ds/bibliotecas/wbc/govbr-ds-wbc/-/blob/next/apps/site/README.md Command to preview the production build of the site locally. ```bash nx serve site ``` -------------------------------- ### Basic Checkgroup Usage Source: https://gitlab.com/govbr-ds/bibliotecas/wbc/govbr-ds-wbc/-/blob/next/apps/site/docs/components/checkgroup/index.mdx Demonstrates the default and basic usage of the Checkgroup component. This example is useful for understanding the initial setup and appearance. ```html ``` -------------------------------- ### Vue Component Usage with v-model Source: https://gitlab.com/govbr-ds/bibliotecas/wbc/govbr-ds-wbc/-/blob/next/packages/vue/README.md Example of using a GovBR DS input component with v-model for two-way data binding in a Vue 3 setup script. ```vue ``` -------------------------------- ### Standalone Component Usage Example Source: https://gitlab.com/govbr-ds/bibliotecas/wbc/govbr-ds-wbc/-/blob/next/packages/angular/README.md Import individual components directly from the standalone subpath. This is suitable for applications using standalone components. Ensure core dependencies are installed. ```typescript import { BrButton } from '@govbr-ds/webcomponents-angular/standalone' @Component({ standalone: true, imports: [BrButton], }) export class AppComponent {} ``` -------------------------------- ### Compound Skip Link Example Source: https://gitlab.com/govbr-ds/bibliotecas/wbc/govbr-ds-wbc/-/blob/next/apps/site/docs/components/skip-link/index.mdx Shows a more complex skip link setup, potentially involving multiple skip links or more intricate HTML structure. Use this when you need to offer more granular skipping options. ```html
``` -------------------------------- ### Switch Component Examples Source: https://gitlab.com/govbr-ds/bibliotecas/wbc/govbr-ds-wbc/-/blob/next/apps/site/docs/components/switch/index.mdx Demonstrates different visual configurations of the Switch component, including density, icon usage, and state management. ```html
``` ```html
``` ```html
``` -------------------------------- ### Wizard Vertical Example Source: https://gitlab.com/govbr-ds/bibliotecas/wbc/govbr-ds-wbc/-/blob/next/apps/site/docs/components/wizard/index.mdx Demonstrates the usage of the Wizard component in a vertical layout. This example is intended for direct use in an HTML file. ```html
``` -------------------------------- ### Basic Modal Example Source: https://gitlab.com/govbr-ds/bibliotecas/wbc/govbr-ds-wbc/-/blob/next/apps/site/docs/components/modal/index.mdx Demonstrates the default usage of the Modal component. This snippet shows how to render a basic modal window. ```html ``` -------------------------------- ### Install Peer Dependencies Source: https://gitlab.com/govbr-ds/bibliotecas/wbc/govbr-ds-wbc/-/blob/next/packages/webcomponents/README.md Install required peer dependencies for components like br-datetime-picker and br-tooltip to function correctly. This ensures compatibility with floating UI, date utilities, and icon libraries. ```bash npm install @floating-ui/dom date-fns iconify-icon # ou pnpm add @floating-ui/dom date-fns iconify-icon ``` -------------------------------- ### Menu Push Example Source: https://gitlab.com/govbr-ds/bibliotecas/wbc/govbr-ds-wbc/-/blob/next/apps/site/docs/components/menu/index.mdx Demonstrates the 'Push' variation of the Menu component. This is typically used for navigation that slides in from the side. ```html ``` -------------------------------- ### play Source: https://gitlab.com/govbr-ds/bibliotecas/wbc/govbr-ds-wbc/-/blob/next/packages/webcomponents/src/components/carousel/readme.md Programmatically starts or resumes the carousel's autoplay. ```APIDOC ## play ### Description Starts or resumes the autoplay programmatically. ### Method `play()` ``` -------------------------------- ### Build Web Components and React Wrapper Source: https://gitlab.com/govbr-ds/bibliotecas/wbc/govbr-ds-wbc/-/blob/next/packages/react/README.md Commands to generate Web Components and then compile the React wrapper. Ensure Web Components are built before the React wrapper. ```bash nx build webcomponents nx build react ``` -------------------------------- ### Selectable Item Example Source: https://gitlab.com/govbr-ds/bibliotecas/wbc/govbr-ds-wbc/-/blob/next/apps/site/docs/components/item/index.mdx Shows how to implement a selectable Item component. This is useful for list items that users can choose or unchoose. ```html

Item Selecionável

``` -------------------------------- ### Image Avatar Example Source: https://gitlab.com/govbr-ds/bibliotecas/wbc/govbr-ds-wbc/-/blob/next/apps/site/docs/components/avatar/index.mdx Demonstrates displaying a user's profile image as an avatar. Ensure the image source is correctly provided. ```html
Avatar do usuário
``` -------------------------------- ### Basic List Example Source: https://gitlab.com/govbr-ds/bibliotecas/wbc/govbr-ds-wbc/-/blob/next/apps/site/docs/components/list/index.mdx Demonstrates the default usage of the List component. This snippet shows a standard vertical list layout. ```html ``` -------------------------------- ### Sign In Emphasis Example Source: https://gitlab.com/govbr-ds/bibliotecas/wbc/govbr-ds-wbc/-/blob/next/apps/site/docs/components/sign-in/index.mdx Demonstrates the emphasis variant of the Sign In component. Use this to highlight the primary sign-in action. ```html
``` -------------------------------- ### Divider Color Example Source: https://gitlab.com/govbr-ds/bibliotecas/wbc/govbr-ds-wbc/-/blob/next/apps/site/docs/components/divider/index.mdx Demonstrates how to set the color of the Divider component. ```html
``` -------------------------------- ### Button Density Examples Source: https://gitlab.com/govbr-ds/bibliotecas/wbc/govbr-ds-wbc/-/blob/next/apps/site/docs/components/button/index.mdx Demonstrates different density options for the Button component. Use this to visualize how density affects the button's appearance. ```html
``` -------------------------------- ### Checkbox Indeterminate Example Source: https://gitlab.com/govbr-ds/bibliotecas/wbc/govbr-ds-wbc/-/blob/next/apps/site/docs/components/checkbox/index.mdx Shows how to render a Checkbox in an indeterminate state. ```html
``` -------------------------------- ### Dropdown Slots Example Source: https://gitlab.com/govbr-ds/bibliotecas/wbc/govbr-ds-wbc/-/blob/next/packages/webcomponents/src/components/dropdown/readme.md Demonstrates how to use the 'trigger' and 'target' slots to define the content that opens the dropdown and the content displayed within it. ```html Open Menu
  • Item 1
  • Item 2
``` -------------------------------- ### Basic Footer Example Source: https://gitlab.com/govbr-ds/bibliotecas/wbc/govbr-ds-wbc/-/blob/next/apps/site/docs/components/footer/index.mdx Renders the default footer component. Use this to quickly integrate the basic footer structure. ```html Link 1 Link 2 Link 3 Link 4 Link 5 Link 6 ``` -------------------------------- ### Sign In Shape Example Source: https://gitlab.com/govbr-ds/bibliotecas/wbc/govbr-ds-wbc/-/blob/next/apps/site/docs/components/sign-in/index.mdx Illustrates different shape options for the Sign In component. Choose the shape that best fits your application's design. ```html
``` -------------------------------- ### Vertical Slider Example Source: https://gitlab.com/govbr-ds/bibliotecas/wbc/govbr-ds-wbc/-/blob/next/apps/site/docs/components/slider/index.mdx Illustrates the Slider component implemented in a vertical orientation. ```html ```