Skip to content

Releases

@sakaniui/react 0.21.0

Choose a tag to compare

@samzydd samzydd released this 22 Nov 14:34

Changed

  • The calendar views are redrawn: calmer, tighter, one card each. MonthCalendar, WeekCalendar and DayPanel are now a real card (surface, a 1px border-default edge, radius-xl) with their header inside it, padded, instead of a header floating above a bordered frame. Nothing to change in your code: the props are the same. What you will see:
    • Month: quieter grid lines, days outside the month on the canvas colour instead of a grey fill, today as a warm tint with a dark date pill, and a selected day shown by a thin ring instead of a blue wash. Chips and bars are 20px; a day's chips drop below an all-day bar only on the days that bar covers (they used to drop for the whole week).
    • Week: 52px hours (was 48), a lighter all-day strip, the today column on the canvas colour, timed events as a tint with a 3px edge in their colour, compact times ("10 to 11:30 AM"), and the current-time line in the brand colour.
    • Day panel: free time is a quiet dashed line with its length ("30m free") instead of a dashed box per gap; with onBlockFocus the line offers "Block focus time" when you hover or focus it. The "New event" button is a ghost Button.
    • Header buttons are the library's own Button (outline) and IconButton (ghost), so they follow your button theming.
    • Blocks: WeekCalendarBlock and MonthCalendarBlock use a 24px padding, a border-default edge and a tighter inner card; the event card and the "N more" list use the same spacing and radii.
  • CalendarEvent blocks show the time as a range with the period said once ("2 to 3 PM"). The WeekCalendar hourHeight default is 52.

@sakaniui/react 0.20.0

Choose a tag to compare

@samzydd samzydd released this 21 Nov 08:24

Added

  • Calendar views: MonthCalendar, WeekCalendar, DayPanel and CalendarEvent. Calendar is a date picker; these show events. MonthCalendar is a month grid with chips, bars that run across days (all-day and multi-day events), "N more" and a lit day. WeekCalendar is a time grid (7 days or a 5-day work week): events as tall as they are long, overlapping ones side by side, an all-day lane, and a line for now. Both take plain events ({ id, title, start, end, allDay?, color?, location?, meta? }), report changes through callbacks (onEventClick, onEventMove, onSlotClick, onMoreClick) and own no data. Drag an event to another day (month) or day and time (week, snapping to snapMinutes, default 15); Alt + arrows moves a focused event, so it works without a mouse. DayPanel is one day beside either view: how many events, hours booked and free, a strip of the working day, all-day events, the schedule in order, and each free gap of 30 minutes or more as a "Block focus time" button. Event colours come from the chart tokens. Two blocks show them on their own, Week Calendar and Month Calendar (Blocks / Application / Calendar): a header with the month, a line about what is in view, previous / Today / next and New event (and a Week / Work week switch on the week), the grid in a rounded frame below it, and a card that opens on an event with when, where, which calendar, Delete and Done. On the month, "N more" opens that day's events as a short list. Nothing existing changes.

@sakaniui/react 0.19.1

Choose a tag to compare

@samzydd samzydd released this 18 Nov 05:25

Fixed

  • RegionMap's hover card stays under the pointer inside a scaled container. The card was placed from the pointer's screen position, so in a preview shrunk with transform: scale() (an expanded docs preview, a scale-to-fit frame) it landed off by the scale factor. It now divides by the scale. Nothing changes when the map is not scaled.

@sakaniui/react 0.19.0

Choose a tag to compare

@samzydd samzydd released this 17 Nov 14:59

Added

  • RegionMap, RegionMapLegend and RegionMapBlock. A choropleth for "how does this vary by place": regions shaded by a value, a hover card with the rank, and click-to-zoom into one region (the view eases to it; Escape or a second click goes back out; reduced motion jumps). Plain SVG, no map library, no new dependency. The shapes are data (regions + viewBox), so it is not tied to one country: outlines ship per country, each importable on its own so an app only carries the ones it uses: @sakaniui/react/regions/us (the 50 states and DC), /uk (the 12 statistical regions), /es (the 17 autonomous communities and Ceuta and Melilla, with the Canary Islands as an inset), /de (the 16 Länder), /ca (13 provinces and territories) and /au (6 states and 2 territories), 6 to 45 KB each, from Natural Earth and US Census boundaries (public domain), and any SVG paths work. scale takes breaks (4 breaks make 5 bins) and diverging for growth-style data (orange below zero, blue above). Keyboard: one tab stop, arrows move between regions, Enter or Space selects. RegionMapBlock is the full "Revenue by state" card (Blocks / Application / Region Map): a metric switch, a find-a-state search, the headline figure, the map and legend, and a ranked list (highest or lowest, or all) that becomes, once a region is zoomed, its first two metrics as compact cards (name and rank on top, the figure, then a green, red or grey pill: "+16.6 pts", "39% below", "On average"), the rest of the metrics as one line of help text under them ("Penetration 10.3%, 25th of 51, in line with the average") and the regions next to it in the ranking. The map, legend and list are linked: pointing at a region outlines it everywhere and marks its band on the legend; pointing at a legend band (or clicking it to hold it) fades every region outside it. RegionMap gains onHoverChange, hovered and dimExcept; RegionMapLegend gains activeBin, lockedBin, markBin, onBinHover, onBinClick and noData. The list plays a load animation: each bar grows from the left while its figure counts up from zero, row by row (on first load, when the metric changes, and when you come back from a zoom). animate={false} turns it off, and reduced motion skips it. The map colours are seven new tokens, --color-map-bin-0 to --color-map-bin-4 (the chart blue stepping from 25% to 100% over --color-bg-muted) and --color-map-neg-0, --color-map-neg-1 (the chart orange, for values below zero), declared in light and dark and mirrored in Figma as Semantic map/*. Nothing existing changes.

Fixed

  • Combobox shows a pointer cursor, not a text cursor. The field is a button that opens a list, but a stray cursor: text made it look like a box you could type into. It now shows the pointer, and the value is no longer selectable text. No prop or layout changes.

@sakaniui/react 0.18.3

Choose a tag to compare

@samzydd samzydd released this 16 Nov 09:50

Fixed

  • get_tokens (MCP) shows the dark value. The manifest kept only the first (light) definition of each token, so an agent asking for --color-fg-muted saw neutral-500 and had no way to know that dark mode swaps it with --color-fg-subtle. The manifest now carries the .dark overrides (tokens.dark), and get_tokens lists { light, dark } for every token that differs in dark, each resolved to its colour (for example var(--color-neutral-500) (#78716A)). 56 tokens show both values; the rest are one string as before. The existing tokens.groups of the manifest is unchanged, and the build verifies that every dark token is a listed token. AGENTS.md says not to assume a token keeps its light value in dark.

@sakaniui/react 0.18.2

Choose a tag to compare

@samzydd samzydd released this 16 Nov 09:02

Fixed

  • Map Globe follows a theme class on any ancestor. The globe read its colours again only when the class on <html> changed, so inside a wrapper that flips dark (a docs preview, a themed card, a <div className="dark">) it kept its light-mode colours: near-black dots on a dark surface, which read as an empty map. It now watches every ancestor's class too. useThemeTick takes an optional ref for the same reason (the charts still watch <html> only).
  • Live Map: no hydration warning on the clock. The clock's seconds differ between the server's render and the browser's first render, which React reported as a hydration error and answered by rebuilding the block. The clock text is now allowed to differ.

@sakaniui/react 0.18.1

Choose a tag to compare

@samzydd samzydd released this 16 Nov 08:26

Fixed

  • Table: a selected row stays selected when you drag it. The selection is a list of row positions, and a reorder left it where it was, so the tick stayed on the old slot and the row you moved lost it. A drag now moves the selection with the rows, in both the uncontrolled and the controlled (selectedRows) table; onSelectionChange fires with the new positions just before onReorder. Nothing to change in your code.

@sakaniui/react 0.18.0

Choose a tag to compare

@samzydd samzydd released this 15 Nov 11:54

Map Globe: markers that carry data, a globe that follows

All additions are optional; a globe that uses none of them draws and behaves as before.

  • MapGlobeMarker.size ("sm" | "md" | "lg", default "sm"): the dot, its ring and its halo scale 1x, 1.6x and 2.3x, so a marker can show a value (Figma Map Globe Marker, Size).
  • MapGlobeMarker.rank: a numbered chip beside the marker that matches the rank in a list next to the globe (Rank=Number).
  • MapGlobeMarker.status="watch": a dashed amber ring (--color-warning-solid), so a warning is never carried by colour alone (Status=Watch).
  • center is reactive. When it changes after mount the globe turns to face the new place, the short way round, over about 0.9s, then pauses its spin for a moment; dragging cancels it. Under reduced motion it jumps.
  • zoom (default 1, 0.7 to 2.2): scales the sphere, easing between values.
  • renderMarkerCard(index, marker): your own card, kept on the hovered marker (or the selected one) as the globe turns, above it or below when there is no room, and hidden while the marker is on the far side. It never takes the pointer. Replaces the small text label.
  • Arrow keys move between the markers' keyboard buttons.
  • New type export MapGlobeMarkerSize.
  • cardPlacement ("above" | "side", default "above"): renderMarkerCard can sit beside the marker, on the side with room, instead of above it.
  • MapControlButton takes pressed (a toggle that is on: a bg/muted fill and aria-pressed) and title. Figma's Map Control Button set has a matching Pressed state.
  • markerScale: how big the markers are drawn (dots, rings, halos and rank chips together). It follows the globe's size by default; pass 1 to keep the design size on a small globe, so the rank numbers stay readable on a phone.
  • A marker pinned with hovered now shows its renderMarkerCard too. Markers stay solid until the very edge of the disc instead of fading a little early, and the rank chip is Geist Regular 10px as in Figma.

New component: Flag

A country flag from the Figma "Flags" set: <Flag country="JP" />, by ISO 3166-1 alpha-2 code, a 16 x 16 box (Figma uses 16 beside text and 32 beside a heading; pass size). Decorative unless you pass label: put the country's name in text beside it. The flags the library uses are imported (GB, SG, JP, IN, AU); a country whose artwork is not imported yet draws a neutral placeholder of the same shape, so a row of flags never shifts. Each further flag is added by dropping its exported SVG markup into src/components/Flag/flags.ts.

New block: Live Map (LiveMapBlock)

A live payments map from the Figma "Live Map" set (Device x State). A dotted globe whose dots are sized by the metric and ranked, a ranked list of cities that turns into a city's detail when you pick one, region filters, a Revenue / Payments / Approval rate switch, a hover card (with the city's Flag), a legend, zoom buttons, and a playback row (Replay today, Pause, the volume by hour, a UTC clock). A rotate button in the map controls stops and restarts the globe's slow spin. Under 720px of its own width it is the phone layout, with the list as a bottom sheet. States: default, loading (skeletons), empty (no payments yet today). It is a composition example: the data is plain props (cities, regions, hourly, totals, insight) with the Figma block's figures as the default, and it is built from Map Globe, Flag, Segmented control, Filter chip, Tabs, Badge, Button, Icon button and Location dot. Each city's country is its two-letter code, which shows as its flag in the list, the hover card, the city detail and the phone rows.

import { LiveMapBlock } from '@sakaniui/react/blocks';
<LiveMapBlock cities={cities} onViewCity={(city) => router.push(`/payments?city=${city.id}`)} />

Fixed

  • Button is the same height with an icon as without one. A 16px (or 18px) icon was taller than the label's 14px line, so every sm button with an icon was 34px tall (Figma: 32) and md 38px (Figma: 36). The icon now overflows its box evenly and the button keeps its size.
  • FilterChip is 26px tall, as in Figma (4px + an 18px line + 4px, with the 1px stroke inside). It was 28px, and 2 to 4px wider.
  • The active SidebarItem has no hover state. It is where you are, not something to point at, so the pointer no longer changes it. The "Active - Indicator" item keeps shadow/xs under the pointer (it used to strengthen to shadow/sm), the "Active - Default" item keeps its bg/subtle tint (it used to lighten toward bg/canvas, expanded only), and the Sidebar's gliding hover highlight skips the active item (data-hover-item="off", also on the active SidebarSubItem). Every other item still reacts as before. The Figma Sidebar Item set no longer has the three "Active Hover" variants either. Nothing to change in your code; blocks that use SidebarItem (the CRM dashboard, the chat and AI chat blocks) follow automatically.

@sakaniui/react 0.17.3

Choose a tag to compare

@samzydd samzydd released this 14 Nov 08:37
  • Marketing and commerce blocks keep their Figma padding at every width above a phone. In 0.16.0 their side padding followed the viewport (clamp(16px, 4vw, 48px)), so a block shown at its full Figma width in a window under about 1200px had less padding than the design (40px at 1000px). The padding is now Figma's (48px; 64px above and below the centred hero) at any width, and tightens to 16px only on a phone-sized viewport (640px and under). Applies to HeroBlock, FeatureGridBlock, LogoCloudBlock, CtaBannerBlock, PricingTableBlock, TestimonialBlock, FaqBlock, BlogListingBlock, CareersBlock, TeamSectionBlock, ProductDetailBlock, ProductGridBlock, CheckoutFlowBlock and DataTableBlock.
  • Button size sm is 32px tall, as in Figma (14px text and a 6px icon gap). It was 27px with 13px text. Every small button grows 5px.
  • Button size md's icon gap is 8px, as in Figma (it was 6px).

@sakaniui/react 0.17.2

Choose a tag to compare

@samzydd samzydd released this 14 Nov 08:04

Marketing blocks now match Figma to the pixel. Each of these was measured against its Figma frame (padding, gaps, sizes, type) and corrected:

  • Button size lg is 44px tall, as in Figma (a 10px pad, a 24px line, 10px). It was 42px. Every large button grows 2px.
  • Badge is 20px tall (12/16 text with 2px above and below). It was 16px.
  • HeroBlock: the image no longer overflows its frame by 2px (the 1px border sat outside the 100% width: it is 1184 x 560 now, and 560 x 400 in the split layout), the page is 1280 x 976 as in Figma, and the second button is the Outline variant, not Secondary.
  • CtaBannerBlock and InlineCtaBlock: the stroke sits inside the frame, as Figma strokes do, so the banner is 264px and the inline CTA 76px (it was 78); the inline CTA's icon is 40 x 40 (it was 42 x 42).
  • LogoCloudBlock: the label has no letter-spacing (153px wide in Figma).
  • Checked and already matching: FeatureGridBlock (every column count) and SectionFooterBlock.