npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@wecareu/date-picker

v0.2.3

Published

Seletor de data com suporte a data única, range e múltiplas datas para o design system WeCareU

Readme

@wecareu/date-picker

Seletor de data com calendário visual cross-platform para o design system WeCareU. Funciona de forma idêntica em iOS, Android e Web sem distinção de plataforma. Suporta seleção de data única, intervalo de datas (range) e múltiplas datas.

Instalação

yarn add @wecareu/date-picker

Peer dependencies

yarn add @wecareu/icons @wecareu/theme @wecareu/tokens

Uso básico

import { DatePicker } from '@wecareu/date-picker'

// Data única
<DatePicker
  mode="single"
  value={date}
  onChangeValue={setDate}
  label="Data de nascimento"
/>

// Intervalo de datas
<DatePicker
  mode="range"
  value={range}
  onChangeValue={setRange}
  label="Período"
/>

// Múltiplas datas
<DatePicker
  mode="multiple"
  value={dates}
  onChangeValue={setDates}
  label="Dias disponíveis"
/>

Modos de operação

| Mode | Tipo do value | Tipo do onChangeValue | |------|---------------|-----------------------| | single | string \| undefined | (value: string \| undefined) => void | | range | { start: string; end: string } \| undefined | (value: { start: string; end: string } \| undefined) => void | | multiple | string[] | (value: string[]) => void |

Todos os valores são em formato ISO 8601 (YYYY-MM-DD ou YYYY-MM-DDTHH:mm:ss quando withTime=true).

Props

Comuns a todos os modos

| Prop | Tipo | Padrão | Descrição | |------|------|--------|-----------| | mode | 'single' \| 'range' \| 'multiple' | 'single' | Modo de seleção | | variant | 'field' \| 'bare' | 'field' | field: estilo InputText com borda. bare: sem decoração | | withTime | boolean | false | Habilita seleção de hora e minuto | | label | string | — | Label acima do campo (variant='field') | | placeholder | string | 'Selecionar data' | Texto exibido quando vazio | | disabled | boolean | false | Bloqueia interação | | readonly | boolean | false | Somente leitura | | minDate | string | — | Data mínima permitida (ISO 8601) | | maxDate | string | — | Data máxima permitida (ISO 8601) | | disabledDates | string[] | [] | Datas individuais bloqueadas (ISO 8601) | | style | StyleProp<ViewStyle> | — | Estilo do container | | testID | string | — | Identificador para testes |

Variantes visuais

variant='field' (padrão)

Visualmente idêntico ao InputText: borda, border radius, padding e label flutuante. Exibe ícone de calendário quando vazio e ícone de limpar (×) quando há valor selecionado.

variant='bare'

Sem borda, sem background, sem padding. Apenas o texto da data com ícone inline. Indicado para uso dentro de cards, cabeçalhos ou contextos com layout próprio.

Exibição do valor (pt-BR)

| Situação | Exibição | |----------|---------| | Data única | 31/12/2025 | | Data + hora | 31/12/2025 14:30 | | Range | 01/12/2025 → 31/12/2025 | | 1 data (multiple) | 01/12/2025 | | N datas (multiple) | 3 datas selecionadas |

Exemplos

// Data única com limite máximo
<DatePicker
  mode="single"
  value={birthDate}
  onChangeValue={setBirthDate}
  label="Data de nascimento"
  maxDate="2025-12-31"
/>

// Range com data mínima
<DatePicker
  mode="range"
  value={period}
  onChangeValue={setPeriod}
  label="Período da viagem"
  minDate="2025-01-01"
/>

// Múltiplas com feriados bloqueados
<DatePicker
  mode="multiple"
  value={availableDates}
  onChangeValue={setAvailableDates}
  label="Dias disponíveis"
  disabledDates={['2025-12-25', '2026-01-01']}
/>

// Com hora
<DatePicker
  mode="single"
  value={appointment}
  onChangeValue={setAppointment}
  label="Data e hora da consulta"
  withTime
/>

// Sem decoração (bare), dentro de um card
<DatePicker
  mode="single"
  variant="bare"
  value={filterDate}
  onChangeValue={setFilterDate}
/>

// Desabilitado
<DatePicker
  mode="single"
  value="2025-12-31"
  onChangeValue={() => {}}
  disabled
  label="Data de vencimento"
/>

Comportamento do calendário

O calendário é um componente visual customizado, implementado apenas com primitivos React Native (Modal, Pressable, View, Text). Não depende de bibliotecas nativas externas, garantindo comportamento idêntico em iOS, Android e Web.

  • Navegação: botões ‹ e › navegam entre meses
  • Seleção single: toque em um dia seleciona e fecha o modal imediatamente
  • Seleção range: 1° toque define o início, 2° toque define o fim com banda visual de destaque
  • Seleção multiple: toque em um dia o adiciona ou remove da lista; botão "Confirmar" fecha o modal
  • Datas bloqueadas: exibidas com opacidade reduzida e não clicáveis
  • Seleção de hora (withTime=true): após selecionar a(s) data(s), exibe seletores de hora e minuto com botões ▲ / ▼

Formato dos valores

Todos os valores retornados estão em ISO 8601:

// single sem withTime
onChangeValue("2025-12-31")

// single com withTime
onChangeValue("2025-12-31T14:30:00")

// range
onChangeValue({ start: "2025-12-01", end: "2025-12-31" })

// multiple
onChangeValue(["2025-12-01", "2025-12-15", "2025-12-20"])

// limpar (single/range)
onChangeValue(undefined)

// limpar (multiple)
onChangeValue([])