@brightlocal/ui-components 3.3.0 → 3.5.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/AI_USAGE.md +22 -3
- package/README.md +177 -109
- package/component-meta.json +1307 -113
- package/dist/alert-dialog.cjs +1 -1
- package/dist/alert-dialog.d.ts +13 -2
- package/dist/alert-dialog.d.ts.map +1 -1
- package/dist/alert-dialog.js +4 -3
- package/dist/banner.cjs +1 -1
- package/dist/banner.d.ts +47 -11
- package/dist/banner.d.ts.map +1 -1
- package/dist/banner.js +156 -79
- package/dist/blocks/empty-state.cjs +1 -1
- package/dist/blocks/empty-state.d.ts +40 -5
- package/dist/blocks/empty-state.d.ts.map +1 -1
- package/dist/blocks/empty-state.js +59 -52
- package/dist/blocks/input-list.cjs +1 -1
- package/dist/blocks/input-list.d.ts +1 -0
- package/dist/blocks/input-list.d.ts.map +1 -1
- package/dist/blocks/input-list.js +39 -39
- package/dist/blocks/sidebar.cjs +1 -1
- package/dist/blocks/sidebar.d.ts +12 -6
- package/dist/blocks/sidebar.d.ts.map +1 -1
- package/dist/blocks/sidebar.js +64 -63
- package/dist/button.cjs +1 -1
- package/dist/button.d.ts.map +1 -1
- package/dist/button.js +47 -43
- package/dist/card.cjs +1 -1
- package/dist/card.d.ts +12 -0
- package/dist/card.d.ts.map +1 -1
- package/dist/card.js +115 -97
- package/dist/chart.cjs +6 -6
- package/dist/chart.d.ts +6 -10
- package/dist/chart.d.ts.map +1 -1
- package/dist/chart.js +281 -296
- package/dist/combobox.cjs +3 -3
- package/dist/combobox.d.ts.map +1 -1
- package/dist/combobox.js +430 -343
- package/dist/command.cjs +1 -1
- package/dist/command.d.ts +23 -2
- package/dist/command.d.ts.map +1 -1
- package/dist/command.js +212 -207
- package/dist/count-indicator.cjs +1 -0
- package/dist/count-indicator.d.ts +85 -0
- package/dist/count-indicator.d.ts.map +1 -0
- package/dist/count-indicator.js +72 -0
- package/dist/data-table.cjs +1 -1
- package/dist/data-table.d.ts +101 -11
- package/dist/data-table.d.ts.map +1 -1
- package/dist/data-table.js +593 -523
- package/dist/description-list.cjs +1 -0
- package/dist/description-list.d.ts +142 -0
- package/dist/description-list.d.ts.map +1 -0
- package/dist/description-list.js +173 -0
- package/dist/dialog.cjs +1 -1
- package/dist/dialog.d.ts +26 -3
- package/dist/dialog.d.ts.map +1 -1
- package/dist/dialog.js +62 -47
- package/dist/drawer.cjs +1 -1
- package/dist/drawer.d.ts +8 -4
- package/dist/drawer.d.ts.map +1 -1
- package/dist/drawer.js +37 -38
- package/dist/file-upload.cjs +1 -0
- package/dist/file-upload.d.ts +546 -0
- package/dist/file-upload.d.ts.map +1 -0
- package/dist/file-upload.js +1103 -0
- package/dist/global-layout.cjs +1 -1
- package/dist/global-layout.d.ts +7 -2
- package/dist/global-layout.d.ts.map +1 -1
- package/dist/global-layout.js +52 -52
- package/dist/hooks/use-file-dropzone.cjs +1 -0
- package/dist/hooks/use-file-dropzone.d.ts +75 -0
- package/dist/hooks/use-file-dropzone.d.ts.map +1 -0
- package/dist/hooks/use-file-dropzone.js +133 -0
- package/dist/hover-card.cjs +1 -1
- package/dist/hover-card.d.ts +29 -16
- package/dist/hover-card.d.ts.map +1 -1
- package/dist/hover-card.js +153 -36
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +681 -623
- package/dist/input-chip.cjs +1 -1
- package/dist/input-chip.d.ts +30 -1
- package/dist/input-chip.d.ts.map +1 -1
- package/dist/input-chip.js +131 -115
- package/dist/input-group.cjs +1 -1
- package/dist/input-group.d.ts +37 -2
- package/dist/input-group.d.ts.map +1 -1
- package/dist/input-group.js +131 -114
- package/dist/input-password.cjs +1 -1
- package/dist/input-password.js +6 -6
- package/dist/lib/empty-canvas.cjs +1 -1
- package/dist/lib/empty-canvas.d.ts +27 -1
- package/dist/lib/empty-canvas.d.ts.map +1 -1
- package/dist/lib/empty-canvas.js +27 -23
- package/dist/lib/empty-chip.cjs +1 -1
- package/dist/lib/empty-chip.d.ts +19 -2
- package/dist/lib/empty-chip.d.ts.map +1 -1
- package/dist/lib/empty-chip.js +14 -9
- package/dist/lib/field-aria.cjs +1 -1
- package/dist/lib/field-aria.d.ts +4 -4
- package/dist/lib/field-aria.d.ts.map +1 -1
- package/dist/lib/field-aria.js +7 -5
- package/dist/lib/media-viewer-content.cjs +1 -1
- package/dist/lib/media-viewer-content.js +1 -1
- package/dist/lib/motion.cjs +1 -1
- package/dist/lib/motion.js +15 -10
- package/dist/lib/table-internal.cjs +1 -1
- package/dist/lib/table-internal.d.ts +19 -0
- package/dist/lib/table-internal.d.ts.map +1 -1
- package/dist/lib/table-internal.js +22 -7
- package/dist/list.cjs +1 -1
- package/dist/list.d.ts +230 -40
- package/dist/list.d.ts.map +1 -1
- package/dist/list.js +301 -66
- package/dist/logo-mark.cjs +1 -1
- package/dist/logo-mark.d.ts +18 -2
- package/dist/logo-mark.d.ts.map +1 -1
- package/dist/logo-mark.js +159 -79
- package/dist/media-empty.cjs +1 -1
- package/dist/media-empty.d.ts +50 -7
- package/dist/media-empty.d.ts.map +1 -1
- package/dist/media-empty.js +14 -13
- package/dist/media-viewer.cjs +1 -1
- package/dist/media-viewer.js +6 -6
- package/dist/multi-select-filter.cjs +1 -1
- package/dist/multi-select-filter.d.ts.map +1 -1
- package/dist/multi-select-filter.js +92 -101
- package/dist/pagination.cjs +1 -1
- package/dist/pagination.d.ts +11 -0
- package/dist/pagination.d.ts.map +1 -1
- package/dist/pagination.js +17 -17
- package/dist/relative-date.d.ts +6 -0
- package/dist/relative-date.d.ts.map +1 -1
- package/dist/resizable.d.ts +1 -1
- package/dist/result-count.cjs +1 -1
- package/dist/result-count.d.ts +13 -16
- package/dist/result-count.d.ts.map +1 -1
- package/dist/result-count.js +24 -33
- package/dist/route-progress.cjs +1 -1
- package/dist/route-progress.js +24 -23
- package/dist/sheet.cjs +1 -1
- package/dist/sheet.d.ts +22 -3
- package/dist/sheet.d.ts.map +1 -1
- package/dist/sheet.js +152 -125
- package/dist/single-select-filter.cjs +1 -1
- package/dist/single-select-filter.d.ts.map +1 -1
- package/dist/single-select-filter.js +67 -76
- package/dist/table.cjs +1 -1
- package/dist/table.d.ts.map +1 -1
- package/dist/table.js +77 -76
- package/dist/tabs.cjs +1 -1
- package/dist/tabs.d.ts +39 -3
- package/dist/tabs.d.ts.map +1 -1
- package/dist/tabs.js +127 -76
- package/dist/textarea.cjs +1 -1
- package/dist/textarea.d.ts +34 -0
- package/dist/textarea.d.ts.map +1 -1
- package/dist/textarea.js +115 -19
- package/dist/tooltip.cjs +1 -1
- package/dist/tooltip.d.ts.map +1 -1
- package/dist/tooltip.js +137 -131
- package/dist/typography-text.cjs +1 -1
- package/dist/typography-text.d.ts +6 -2
- package/dist/typography-text.d.ts.map +1 -1
- package/dist/typography-text.js +14 -13
- package/package.json +2 -3
- package/src/blocks/empty-state.tsx +108 -48
- package/src/blocks/input-list.tsx +15 -9
- package/src/blocks/sidebar.tsx +39 -16
- package/src/components/alert-dialog.tsx +18 -2
- package/src/components/banner.tsx +247 -68
- package/src/components/button.tsx +27 -10
- package/src/components/card.tsx +89 -7
- package/src/components/chart.tsx +47 -67
- package/src/components/combobox.tsx +221 -12
- package/src/components/command.tsx +83 -37
- package/src/components/count-indicator.tsx +188 -0
- package/src/components/data-table.tsx +506 -159
- package/src/components/description-list.tsx +445 -0
- package/src/components/dialog.tsx +74 -5
- package/src/components/drawer.tsx +52 -32
- package/src/components/file-upload.tsx +2574 -0
- package/src/components/global-layout.tsx +18 -5
- package/src/components/hover-card.tsx +395 -65
- package/src/components/input-chip.tsx +67 -2
- package/src/components/input-group.tsx +89 -6
- package/src/components/list.tsx +720 -72
- package/src/components/logo-mark.tsx +109 -25
- package/src/components/media-empty.tsx +62 -7
- package/src/components/multi-select-filter.tsx +9 -16
- package/src/components/pagination.tsx +15 -2
- package/src/components/relative-date.tsx +6 -0
- package/src/components/result-count.tsx +27 -54
- package/src/components/sheet.tsx +86 -8
- package/src/components/single-select-filter.tsx +9 -16
- package/src/components/table.tsx +16 -1
- package/src/components/tabs.tsx +223 -41
- package/src/components/textarea.tsx +271 -4
- package/src/components/tooltip.tsx +29 -2
- package/src/components/typography-text.tsx +7 -2
- package/src/hooks/use-file-dropzone.ts +325 -0
- package/src/index.ts +4 -0
- package/src/lib/empty-canvas.tsx +47 -20
- package/src/lib/empty-chip.tsx +38 -3
- package/src/lib/field-aria.tsx +11 -6
- package/src/lib/table-internal.ts +38 -0
package/AI_USAGE.md
CHANGED
|
@@ -122,11 +122,11 @@ Always specify the property — never use `transition-all`:
|
|
|
122
122
|
|
|
123
123
|
```tsx
|
|
124
124
|
// CORRECT
|
|
125
|
-
<div className="transition-colors duration-
|
|
126
|
-
<div className="transition-opacity duration-
|
|
125
|
+
<div className="transition-colors duration-fast ease-out" />
|
|
126
|
+
<div className="transition-opacity duration-fast ease-out" />
|
|
127
127
|
|
|
128
128
|
// WRONG
|
|
129
|
-
<div className="transition-all duration-
|
|
129
|
+
<div className="transition-all duration-base" />
|
|
130
130
|
```
|
|
131
131
|
|
|
132
132
|
### Focus States
|
|
@@ -236,6 +236,25 @@ For groups of related fields:
|
|
|
236
236
|
</FieldSet>
|
|
237
237
|
```
|
|
238
238
|
|
|
239
|
+
For a field with a limit, show the count inside the field. It never blocks typing: over the limit the count turns red and the field takes the error border, so show the message with `FieldError` and stop the save in validation (a zod `.max()` does both). Never hand-build a count with `TypographyText` and never use `maxLength` to enforce the limit:
|
|
240
|
+
|
|
241
|
+
```tsx
|
|
242
|
+
{/* Characters in a Textarea: pass a controlled value */}
|
|
243
|
+
<Textarea dataHook="description" limit={750} value={value} onChange={onChange} />
|
|
244
|
+
|
|
245
|
+
{/* Characters in an Input */}
|
|
246
|
+
<InputGroup dataHook="alt-group">
|
|
247
|
+
<InputGroupInput aria-label="Photo description" />
|
|
248
|
+
<InputGroupCount dataHook="alt-count" limit={125} />
|
|
249
|
+
</InputGroup>
|
|
250
|
+
|
|
251
|
+
{/* Items in a chip field */}
|
|
252
|
+
<InputChipInput dataHook="emails-input">
|
|
253
|
+
<InputChipItems dataHookPrefix="emails-chip" />
|
|
254
|
+
<InputChipCount dataHook="emails-count" limit={5} />
|
|
255
|
+
</InputChipInput>
|
|
256
|
+
```
|
|
257
|
+
|
|
239
258
|
### Overlays (Dialogs, Sheets, Drawers)
|
|
240
259
|
|
|
241
260
|
All overlay components follow the same pattern:
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @brightlocal/ui-components
|
|
2
2
|
|
|
3
|
-
BrightLocal Design System UI Components package containing low-level React components and utilities built on top of Radix UI primitives.
|
|
3
|
+
Atlas, the BrightLocal Design System: UI Components package containing low-level React components and utilities built on top of Radix UI primitives.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
@@ -24,109 +24,175 @@ pnpm add @brightlocal/tokens
|
|
|
24
24
|
|
|
25
25
|
## Components
|
|
26
26
|
|
|
27
|
-
This package includes
|
|
27
|
+
This package includes 90 components and 4 blocks built on Radix UI primitives and other React libraries. All components are fully typed with TypeScript and follow BrightLocal's design system patterns.
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
<!-- categories:start (generated by sync-meta from component-meta.json; do not edit) -->
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
- **Card** - Container for content with consistent styling
|
|
33
|
-
- **CentredLayout** - Centers content horizontally
|
|
34
|
-
- **GlobalLayout** - Full-page layout wrapper
|
|
35
|
-
- **Grid** - Layout primitive with a closed `variant` axis; `variant="centered"` holds one message at the page body's optical centre (stack/row/cards reserved, DS-970)
|
|
36
|
-
- **HeightTransition** - Smoothly transitions its height when children's natural height changes
|
|
37
|
-
- **ResizablePanel** - Panels that can be resized by users
|
|
38
|
-
- **ScrollArea** - Custom scrollable areas with styled scrollbars
|
|
39
|
-
- **Separator** - Visual divider between content with configurable spacing
|
|
40
|
-
- **Skeleton** - Loading placeholder components
|
|
41
|
-
- **SplitLayout** - Split-pane layouts
|
|
31
|
+
### Actions
|
|
42
32
|
|
|
43
|
-
|
|
33
|
+
_Triggers an action: buttons, toggles and the menus that list actions._
|
|
44
34
|
|
|
45
|
-
- **
|
|
46
|
-
- **
|
|
47
|
-
- **
|
|
48
|
-
- **
|
|
49
|
-
- **
|
|
50
|
-
- **
|
|
51
|
-
- **
|
|
52
|
-
|
|
53
|
-
###
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
- **
|
|
58
|
-
- **
|
|
59
|
-
- **
|
|
60
|
-
- **
|
|
61
|
-
- **
|
|
62
|
-
- **
|
|
63
|
-
|
|
64
|
-
|
|
35
|
+
- **Button** - Primary interactive button with variants
|
|
36
|
+
- **ButtonGroup** - Joins Buttons and a Select trigger into one attached control with merged borders
|
|
37
|
+
- **ContextMenu** - Right-click context menu
|
|
38
|
+
- **DropdownMenu** - Dropdown menu triggered by a button
|
|
39
|
+
- **Menubar** - Horizontal application menu bar
|
|
40
|
+
- **Toggle** - Toggle button
|
|
41
|
+
- **ToggleGroup** - Group of toggle buttons
|
|
42
|
+
|
|
43
|
+
### Containers
|
|
44
|
+
|
|
45
|
+
_Groups and contains content: cards, collapsible regions, scroll and resize containers._
|
|
46
|
+
|
|
47
|
+
- **Accordion** - Expandable/collapsible content sections
|
|
48
|
+
- **Card** - Content container with consistent styling. Full-width by default — constrain width via className (e.g., className='max-w-sm'). Supports a density prop: 'default' uses generous spacing (gap-8, py-section-md, px-section-md) for standalone cards; 'condensed' uses compact spacing (gap-3, py-3, px-3) for cards nested inside other cards as sub-sections, inline stat panels, or dense dashboard widgets; 'data' uses the report-page scale (DS-989): fixed 24px horizontal padding, a header with 16px vertical padding, 24px section spacing below it (pair with CardTitle size='small'). CardHeader's divider prop closes the header with its own full-width bottom border in every density — the header pads its bottom by the density's spacing, and flush content right after sits on the line. variant='border' uses the card surface (bg-card: white in light mode, neutral-900 in dark) so it lifts off the off-white page; variant='filled' uses the muted fill (bg-muted). For cards carrying a filter row and a data view. CardContent accepts a flush prop for edge-to-edge tables/maps inside a filled or border card (the card keeps its surface and border). CardToolbar puts the filter row (search — Input, InputGroup or DataTableSearch — capped at 360px, then filters, 8px gap; styles direct children only) in the header, for everything that narrows what the card shows; pagination stays in a DataTableToolbar beside the table; CardMetric shows a value + trend badge opposite the title. CardHeader takes align ('left' | 'center' | 'right') for header layout; CardDescription takes its own align with the same values to pin the description's text alignment when it would otherwise inherit it (e.g. centred inside a button trigger) — omitted, it inherits as before. CardHeader's sticky prop pins the header to the top edge of its scroll container (page, Sheet, Dialog or any scroll box) while a tall card scrolls, with no gap above it (DS-1211), painting the card's surface so content never shows through. CardTitle takes an icon (a DS icon, sized to 20px, or a 20px LogoMark) rendered before the text with an 8px gap and centred on the title's first line, so wrapping titles keep it beside their opening words (DS-1268).
|
|
49
|
+
- **Collapsible** - Collapsible content sections
|
|
50
|
+
- **HeightTransition** - Wrapper that smoothly transitions its height (fixed 200ms) when children's natural height changes (content swaps, filtering); reduced motion handled by the DS global kill-switch
|
|
51
|
+
- **Resizable** - Resizable panel layout
|
|
52
|
+
- **ScrollArea** - Custom scrollable area with styled scrollbars
|
|
53
|
+
|
|
54
|
+
### Content
|
|
55
|
+
|
|
56
|
+
_Single values and content: avatars, ratings, dates and counts._
|
|
57
|
+
|
|
58
|
+
- **Avatar** - User avatar images with fallback
|
|
59
|
+
- **Rating** - Review score display: a 0–5 star value (0.5 increments) or Facebook's Recommended / Not recommended verdict
|
|
60
|
+
- **RelativeDate** - When something happened, in words people read at a glance ("1 hour ago"), with the exact date and time in a tooltip — left out when the words already are the exact date (an older calendar date from another year). Handles ISO timestamps, calendar dates, and null/unknown.
|
|
61
|
+
- **ResultCount** - The one count text the DS renders for a collection, as the screen's one role="status" live region (Patterns/Filtering, Where controls live). Plain form (`count` + optional `total`): "4 of 24 locations" — the toolbar count of a filtered list. Range form (`from` + `to` + `total`): "1 to 20 of 45 locations" — what DataTablePagination and PaginationControls render, so a paged collection shows the count once, in the toolbar or the pagination row, never both. At zero the visible text hides (the empty state says it) and the region keeps the screen-reader-only emptyLabel. During a scope-change refetch the count holds its previous value until new data arrives — no dimming, no spinner. The `updating` and `updatingLabel` props are deprecated no-ops since 3.5.0 and will be removed in the next major version. Name the records in the product's words through the label templates.
|
|
62
|
+
|
|
63
|
+
### Data
|
|
64
|
+
|
|
65
|
+
_Data representation: tables, lists, charts, maps and progress bars._
|
|
66
|
+
|
|
67
|
+
- **Chart** - Data visualization wrapper for Recharts. Legends are composable: ChartLegendContent renders Recharts' payload inside a chart (with sortBy, showValue/valueKey, renderItem); ChartLegendList + ChartLegendItem compose a legend beside a chart — vertical with values next to a donut, shared across charts, or a row of toggles/popover triggers via asChild. size sm (12px chart chrome, default) or md (14px key read as content, 10px swatch). Item states: muted = de-emphasised but still drawn (a filter focused elsewhere); hidden = switched off, faded + struck label, never colour alone.
|
|
68
|
+
- **DataTable** - Composable data table built on TanStack Table. Exposes `useDataTable` hook + `DataTable` / `VirtualizedDataTable` renderers + toolbar layout + pagination and search helpers. Compose the table and its companions (DataTableToolbar rows, bulk actions) as ONE slot — a single flex-column wrapper — inside gapped parents like DialogContent or Card, so the parent's gap applies around the table block, not between the toolbars and the table; the toolbars' built-in padding provides the internal spacing. noResultsMessage accepts a ReactNode as well as a string: pass an EmptyState for a collection that is empty, and keep a one-line string for a collection that is merely filtered — the reader typed the query and wants its outcome, not an onboarding block. The cell is a polite live region either way. The component's outer wrapper is its single scroll container for both axes (DS-912): bound the height through className (`max-h-*` for a fixed cap, `min-h-0 flex-1` inside a height-capped parent like a dialog body) and stickyHeader keeps the column headers pinned while the rows scroll — no internal slot targeting needed. With stickyHeader, minWidth, or scrollRegionLabel set (and always on VirtualizedDataTable) the wrapper is a focusable scroll region (role=region + tabIndex, labelled by scrollRegionLabel) so keyboard users can scroll the rows — pass scrollRegionLabel to opt in when the height is capped via className with the header deliberately left unpinned. To keep the row's name in view while a wide table scrolls sideways (minWidth), set `meta: { pinned: "left" }` on ONE column definition (normally the first): its header and body cells become sticky at the left edge with an opaque background that follows the row state (selected, expanded, sub-row) and a divider on the pinned edge, and it works with stickyHeader (DS-1205).
|
|
69
|
+
- **DescriptionList** - Label-and-value pairs describing one record, rendered as a semantic <dl>
|
|
70
|
+
- **List** - Vertical list of rows: static, pressable (button or link), drill-down with a value and chevron, toggle and media rows, with section headings and separators
|
|
71
|
+
- **Map** - Vendor-agnostic map UI primitives: pins, controls, popover, loading/error states. Pattern: Recipe, not a component — the DS ships map UI primitives but not a Google Maps wrapper. Includes useMapStyles(variant) hook for built-in map style presets ('default' and 'muted') with automatic dark mode support, and useMapPopoverClick for click-to-open popover state management. MapLoadingState and MapErrorState include a border-border border. MapEmpty is the empty-canvas state — a muted surface, a bare glyph and one line — and deliberately does NOT draw the map background: a pinless map behind 'no data' recreates the confusion the message exists to clear up. The rule it enforces: a map never renders pinless with no message. When the map has loaded, the consumer owns the container — add 'border border-border rounded-lg' to your map wrapper for consistency.
|
|
72
|
+
- **Progress** - Progress bar indicator with optional label (text, or a node such as a Rating or icon) placed inline or stacked above, numeric value with optional custom formatting, and score-scale color options
|
|
73
|
+
- **Table** - Semantic HTML table with accessibility features. Text alignment is physical (left/right/center). Set layout="fixed" with width on TableHead for stable columns. scrollOwner="parent" keeps the table-container wrapper in the DOM as a plain positioned block but strips its scroll behavior, so a scrolling ancestor owns both axes (how DataTable renders it); default "self" makes the wrapper the horizontal scroll container.
|
|
74
|
+
|
|
75
|
+
### Feedback
|
|
76
|
+
|
|
77
|
+
_Tells the user something happened or needs attention, or highlights a message: alerts, banners, callouts, toasts._
|
|
78
|
+
|
|
79
|
+
- **Alert** - Status alert messages with semantic variants
|
|
80
|
+
- **Banner** - Branded invitation to an optional step on a highlight sky/violet surface — composed from BannerIllustration, BannerContent (BannerEyebrow, BannerTitle, BannerDescription), BannerActions and, at lg, BannerDetails. sm is the compact strip (flow horizontal or vertical); lg is the hero
|
|
81
|
+
- **Callout** - Speech bubble callout for highlighting key statements or quotes
|
|
82
|
+
- **ChartEmpty** - The empty-canvas treatment for a chart's plot area: a muted surface at the height the consumer reserves, a bare 32px glyph, and one quiet line — no title, no CTA, and no circle chip, because a circle on a flat surface reads as a button. Coherence contract: sibling KPIs must show an em-dash and drop their trend badges. Exported from @brightlocal/ui-components/chart-empty and from /chart; the standalone path avoids pulling Recharts in.
|
|
83
|
+
- **Sonner** - Toast notification system. Accepts a `duration` option (ms) to control auto-dismiss timing. Set to `Infinity` to keep the toast visible until the user closes it or you call `sonner.dismiss(id)`.
|
|
84
|
+
|
|
85
|
+
### Form
|
|
86
|
+
|
|
87
|
+
_Collects or describes user input: fields, selects, pickers, toggles that hold a value._
|
|
88
|
+
|
|
89
|
+
- **Calendar** - Date selection calendar (wraps react-day-picker)
|
|
90
|
+
- **Checkbox** - Checkbox input
|
|
91
|
+
- **Chip** - Removable chip/tag element
|
|
92
|
+
- **Combobox** - Searchable select dropdown with filtering
|
|
93
|
+
- **CountIndicator** - A small count against a limit, such as "120 / 750" (characters) or "3 / 5" (items), that turns red once it goes over the limit (exactly at the limit is not highlighted). The shared count for text fields: Textarea shows it with `limit`, InputGroupCount and InputChipCount place it inside an input group or a chip field. It never blocks typing; the consumer shows the error and stops the save. Screen readers hear the value with the field and a polite announcement only when the count goes over.
|
|
94
|
+
- **DatePicker** - Date selection with calendar popup and presets
|
|
95
|
+
- **Description** - Helper/description text
|
|
96
|
+
- **Field** - Form field wrapper with label, description, and error handling
|
|
97
|
+
- **Input** - Text input field
|
|
65
98
|
- **InputChip** - Tag/chip input with managed items
|
|
66
|
-
- **InputGroup** -
|
|
67
|
-
- **
|
|
68
|
-
- **
|
|
69
|
-
- **InputPassword** - Password input with visibility toggle
|
|
70
|
-
- **
|
|
71
|
-
- **
|
|
72
|
-
- **
|
|
73
|
-
- **
|
|
74
|
-
- **
|
|
75
|
-
- **
|
|
76
|
-
- **
|
|
77
|
-
- **
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
- **ContextMenu** - Right-click context menus
|
|
84
|
-
- **Dialog** - Modal dialogs
|
|
85
|
-
- **Drawer** - Side drawer panels
|
|
86
|
-
- **DropdownMenu** - Dropdown menus
|
|
87
|
-
- **HoverCard** - Popover cards on hover
|
|
88
|
-
- **Popover** - Floating popovers
|
|
89
|
-
- **Sheet** - Slide-in panels
|
|
90
|
-
- **Tooltip** - Tooltips on hover
|
|
91
|
-
|
|
92
|
-
### Feedback Components
|
|
93
|
-
|
|
94
|
-
- **Alert** - Alert messages
|
|
99
|
+
- **InputGroup** - Input with addon text or button, and an opt-in built-in clear X
|
|
100
|
+
- **InputList** (block) - Editable list of text items with add/remove, paste support, and validation
|
|
101
|
+
- **InputOTP** - One-time password input
|
|
102
|
+
- **InputPassword** - Password input with visibility toggle and strength meter
|
|
103
|
+
- **Label** - Form label element
|
|
104
|
+
- **MultiSelectFilter** - The Filtering pattern's several-at-once filter: one dimension, several values combining as OR, over a Popover + Command menu that stays open across picks. The trigger hugs its label in a toolbar and wears the Select field look (border, radius, focus ring, chevron) because a filter trigger holds a value, it does not act; stacked in a panel it takes className='w-full'. No error state — a filter does not validate. size='default' (h-9, text-field like Select: 14px desktop / 16px touch) or 'sm' (h-8, text-label, phone card headers). The trigger always reads its picks, like a Select shows its value: allLabel at zero (or the dimension's label, muted, as a placeholder), then the picked labels, collapsing past maxVisibleLabels (default 1) into summaryLabel ('Google +2' via the default '{labels} +{rest}'; '3 selected' via '{count} selected') — and it computes the accessible name itself with every pick spelled out. Glyphs are the consumer's, never a fixed funnel: option.icon shows before each label in the menu and drawer, allIcon marks the All row, and the trigger follows the selection (allIcon at zero, then the first pick's icon) unless icon pins one. No-match shows the compact empty form (muted chip, emptyLabel, emptyDescription) in both presentations. allLabel adds a leading reset row: 'All' means no narrowing, so it is checked when value is empty and picking it clears the selection; a pick that completes the set collapses to [] for the same reason (collapseFullSelection, default true). Picks read on the trigger in pick order. Selected values pin to the top on reopen; a zero-count option is disabled, never hidden; past searchThreshold (10) the menu grows an autofocused search input (searchable forces it) — a case-insensitive substring match on label and value, never on the count; while searching the All row and Clear step aside, and a no-match search shows emptyLabel alone. presentation='menu' (default) is the Popover + Command menu; 'drawer' is the phone form — the same trigger opens a bottom Drawer titled with the dimension, All row, options as Checkboxes in two columns, search past the threshold, Clear while something is picked, a Done button that only closes (ticks apply at once); 'auto' switches at the md breakpoint. Both render from one state. Per-filter commit model: onValueChange on every pick, run an expensive refetch on onOpenChange(false). multiSelectFilterTriggerVariants is the trigger's cva style helper.
|
|
105
|
+
- **RadioGroup** - Radio button group with multiple layout variants
|
|
106
|
+
- **Select** - Dropdown select input
|
|
107
|
+
- **SingleSelectFilter** - The Filtering pattern's single-value dropdown filter: one value from one dimension (time period, interval, source type). Shows a DS Select (native listbox, keyboard navigation, scroll indicators) on desktop and a bottom Drawer with RadioGroup in two columns on mobile. The trigger wears the same field look as MultiSelectFilter (multiSelectFilterTriggerVariants — border, radius, focus ring, chevron) so a SingleSelectFilter sits beside a MultiSelectFilter in a toolbar row without looking different. size='default' (h-9, text-field: 14px desktop / 16px touch like Select) or 'sm' (h-8, text-label, phone card headers). The trigger always reads the selected label, or the dimension's name when nothing is picked — both in foreground text, never muted. Options may carry their own icon (option.icon) shown before the label in the menu and the drawer; the trigger wears the picked option's icon unless the icon prop pins one. Counts render in the menu only, never in the trigger. Clear resets to defaultValue — unlike MultiSelectFilter which clears to []; a single-value filter always has a value, and 'no filter' is an explicit option in the list. Drawer anatomy matches MultiSelectFilter: DrawerTitle = label, sr-only DrawerDescription, RadioGroup in grid-cols-2, Clear when value ≠ defaultValue, Done button that only closes. When options.length > searchThreshold (default 10) the drawer shows a search field above the scrolling radio list — case-insensitive substring match on label and value; override with searchable. The query resets on close. Per-filter commit model: onValueChange fires on every pick. presentation='menu' (default) is the DS Select; 'drawer' is the phone form; 'auto' switches at the md breakpoint.
|
|
108
|
+
- **Slider** - Numeric range slider input
|
|
109
|
+
- **Switch** - Toggle switch input
|
|
110
|
+
- **Textarea** - Multi-line text input
|
|
111
|
+
|
|
112
|
+
### Indicators
|
|
113
|
+
|
|
114
|
+
_Compact status and change markers: badge, status dot, delta._
|
|
115
|
+
|
|
95
116
|
- **Badge** - Status badges and labels
|
|
96
|
-
- **
|
|
97
|
-
- **
|
|
98
|
-
|
|
99
|
-
|
|
117
|
+
- **Delta** - How much a value moved between two points: an arrow and an amount. The arrow follows the sign of value (the change as the product phrases it — rank up 8 is value={8}); the colour comes from greenWhen (score-strong ink when the direction is good, score-poor when bad, muted for zero). variant inline (text-label, 16px arrow) or pill (text-label-sm on a 15% score tint). Screen readers hear a phrase ("Increased by 8") instead of the arrow and number. Exposes data-direction (increase|decrease|none) and data-trend (better|worse|none).
|
|
118
|
+
- **Status** - A dot and a word on an outlined pill: where a tracked thing is in its lifecycle (Connected, Syncing, Paused, Failed). variant sets the mark's visual weight only (success, warning, error, info, neutral) or loading, which swaps the dot for a small Spinner (same name as Button's loading); dotOnly hides the word, which becomes the accessible name and a tooltip on a keyboard-focusable trigger. The root is a polite live region (role="status"), so a change like Syncing → Connected is announced.
|
|
119
|
+
|
|
120
|
+
### Loading
|
|
121
|
+
|
|
122
|
+
_Communicates that work is in progress: spinners, skeletons, route progress._
|
|
123
|
+
|
|
100
124
|
- **Loading** - Brand loading animation that morphs between shapes while rotating
|
|
101
|
-
- **
|
|
102
|
-
- **
|
|
103
|
-
- **
|
|
104
|
-
- **
|
|
105
|
-
|
|
125
|
+
- **RouteProgress** - Slim top-edge bar that reports a full route navigation, from the click until the destination's route-critical content has settled
|
|
126
|
+
- **Skeleton** - Loading placeholder with a travelling shimmer wave. Silent by default: aria-hidden with no screen-reader text, because a loading layout is many skeletons and one announcement per shape reads the whole wait out dozens of times — the region being loaded carries aria-busy and makes the single announcement. Pass loadingLabel to opt a standalone skeleton back in.
|
|
127
|
+
- **Spinner** - The one indeterminate loading indicator — LoaderCircle at the shared speed, three sizes (sm 14, md 16, lg 20)
|
|
128
|
+
- **TextRevealMotion** - Deprecated (DS-907): animated text reveal with rolling shape-morphing ball; removal planned once product usage is gone
|
|
129
|
+
|
|
130
|
+
### Media & brand
|
|
106
131
|
|
|
107
|
-
|
|
132
|
+
_Imagery, video and BrightLocal brand marks: frames, carousels, media viewer, logos and illustration motifs._
|
|
108
133
|
|
|
109
|
-
- **
|
|
110
|
-
- **
|
|
111
|
-
- **
|
|
112
|
-
- **
|
|
113
|
-
- **
|
|
134
|
+
- **AspectRatio** - Maintains consistent aspect ratios for content
|
|
135
|
+
- **BrandIllustrationMotif** - Brand illustration composed over a decorative motif backdrop (lg) or a standalone green motif mark (sm/md); sunrise + lg slowly rotates
|
|
136
|
+
- **Carousel** - Image/content carousel slider
|
|
137
|
+
- **FileUpload** - Drag-and-drop file upload with validation, image previews, upload progress tracking, rejection banners (Alert), and single-image slots. Supports grid and list layouts, per-file upload status (idle/uploading/success/error), focus management after removal, ARIA live region for announcements, a `messages` prop for every generated string, and the PHOTO_UPLOAD_RULES preset. FileUploadSlot accepts `layout` (`"vertical"` centres the image above the label and buttons; `"horizontal"` places the image beside a column of label, description and buttons — default `"vertical"`), `description` (hint text below the label), `emptyMessage` (text alongside the placeholder icon), and `actions` (extra content in the button row, shown when an image is present).
|
|
138
|
+
- **Logo** - BrightLocal brand logo
|
|
139
|
+
- **LogoMark** - Displays a brand logo, any lucide icon (globe, star, map-pin, building-2, phone, mail, etc.), or a letter-initial fallback in a consistent mark. Resolves the name against the DS social-media icon registry first, then lucide, loading each icon as its own chunk via iconImports from @brightlocal/icons/dynamic. Variants: filled (bg-muted surface, default), border (border ring), transparent (bare icon), success (bg-score-strong/15 with text-score-strong-ink) and destructive (bg-score-poor/15 with text-score-poor-ink) — the last two use the Delta pill's tint and ink for outcome glyphs, not brand logos. Four sizes: xs, sm, md, lg. colorScheme toggles original/neutral for social-media icons. shape controls the container's border-radius: square (default, stepped rounded-md/rounded-lg) or circle (rounded-full); ignored on transparent, which has no container to round. Empty-state chips and file-upload dropzone feedback use the circle shape.
|
|
140
|
+
- **MediaEmpty** - The missing-media placeholder for a media slot — location photos, card media, video wells. Same canvas family as ChartEmpty and MapEmpty: it fills the reserved frame (usually AspectRatio) with a muted surface, a bare 32px glyph, and one quiet line — no title, no actions, no chip. variant="image" (default) | "video" picks the glyph and the default line ("No photo available" / "No video available"); icon and message stay as overrides. It owns its own background, so the frame needs no bg-muted override, and overlays on the frame (a status Badge in a corner) keep rendering above it. The glyph is the plain Image/Video icon, never ImageOff/VideoOff — this state is "media goes here", not "the media is broken". size="md" (default) is for a content box; size="sm" is for slots under 48px (table thumbnails, list avatars) and draws a 20px glyph alone, centred, with no line. The props are a discriminated union on size: message exists only at md.
|
|
141
|
+
- **MediaViewer** - One family for an image set, modelled on Telegram's media view. MediaViewer (root, no DOM) owns items, the open index and whether the lightbox is open — uncontrolled by default, controllable via open/onOpenChange and index/onIndexChange. MediaViewerTrigger is a fixed-ratio preview that is a button; it opens the lightbox at its index (one tile or a grid is the same markup), indicator adds dots for the set and lets the preview be browsed in place (swipe, arrow keys) before opening, MediaViewerAddon children lie over a corner (align top-start/top-end/bottom-start/bottom-end: a position Badge, a status), beside the button so they stay out of its name; the root's actions (DropdownMenuItems per item) appear behind a More actions button on each preview (top-right, on hover/focus/open, always on touch) and in the view's bar after Download, MediaEmpty when there is no item; while the view is open, the preview of the open item is hidden in place, as if the image had lifted out of it. MediaViewerContent is a lightbox that fills the window over a backdrop darker than a modal's (text and controls in scoped dark tokens): the image with Previous/Next as full-height clickable strips at its sides (shown on hover or keyboard focus; touch and trackpad swipes drag the image carousel-style and step or spring back; buttons, keys and thumbnails swap at once), no close button (Esc or a click on the image or backdrop closes), and a bottom bar — MediaViewerTitle on the left over the open item's description (its alt, shown for the eye) and date (a RelativeDate from items[].date), a strip of thumbnails in the middle (the open one at full opacity, aria-current, kept in view), the built-in Download / Zoom in / Zoom out on the right, then MediaViewerActions (the consumer's extra actions: share, a menu), the item's More actions and, last, Image details (an InfoTooltip: format, size in pixels and file size); on phones the strip takes its own row. Opening zooms the image out of its preview and closing zooms it back in, slightly faster (fade with reduced motion or no preview on screen); stepping swaps the image with no animation. Photos are fitted, never past their own pixels (a small image shows at its size); a capture far taller than wide (over 2.5:1) keeps the stage width (or its own, if narrower) and scrolls. A title or description cut to one line shows the full text on hover. Arrow keys step, focus returns to the opening trigger, the position is announced in a visually hidden polite live region. An expired item or failed load shows MediaEmpty in the same frame. A long set stays light: three slides on the stage, lazy thumbnails, at most five indicator dots.
|
|
114
142
|
|
|
115
|
-
###
|
|
143
|
+
### Navigation
|
|
116
144
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
- **
|
|
120
|
-
- **
|
|
121
|
-
- **
|
|
122
|
-
- **
|
|
123
|
-
- **
|
|
124
|
-
- **
|
|
125
|
-
- **
|
|
126
|
-
- **
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
145
|
+
_Moves the user between places or commands: tabs, breadcrumbs, pagination, steppers, sidebar._
|
|
146
|
+
|
|
147
|
+
- **Breadcrumb** - Hierarchical navigation trail
|
|
148
|
+
- **Command** - Command palette and search interface
|
|
149
|
+
- **Link** - Styled hyperlink with inline, inherit (body-copy), button-styled (incl. primary brand CTA) and icon-only variants and external link support
|
|
150
|
+
- **NavigationMenu** - Complex navigation menu structure
|
|
151
|
+
- **Pagination** - Page navigation controls
|
|
152
|
+
- **Sidebar** (block) - Complex sidebar navigation with collapsible support
|
|
153
|
+
- **Stepper** - Guides users through a multi-step process, showing progress and the current step
|
|
154
|
+
- **Tabs** - Tabbed interface for switching between views
|
|
155
|
+
|
|
156
|
+
### Overlay
|
|
157
|
+
|
|
158
|
+
_Content layered above the page: dialogs, sheets, popovers and tooltips._
|
|
159
|
+
|
|
160
|
+
- **AlertDialog** - Modal confirmation dialogs
|
|
161
|
+
- **Dialog** - Modal dialog overlay
|
|
162
|
+
- **Drawer** - Slide-out drawer panel
|
|
163
|
+
- **HoverCard** - Card that appears on hover; tap toggles on touch
|
|
164
|
+
- **InfoTooltip** - Muted info icon that opens a tooltip (hover/tap/focus) — the standard pattern for inline hints next to labels. Composes the Tooltip component.
|
|
165
|
+
- **Popover** - Floating popover panel
|
|
166
|
+
- **Sheet** - Side panel overlay
|
|
167
|
+
- **Tooltip** - Toggletip: hover on desktop, tap to toggle on touch (stays open for copying text), dismiss via click-outside or Escape
|
|
168
|
+
|
|
169
|
+
### Page layout
|
|
170
|
+
|
|
171
|
+
_Structures the page itself: shells, headers, grids, split panes and dividers._
|
|
172
|
+
|
|
173
|
+
- **CentredLayout** - Full-page centered content layout
|
|
174
|
+
- **GlobalLayout** - Full-page responsive layout with sidebar
|
|
175
|
+
- **Grid** - The layout primitive (DS-970): one component, one closed variant axis, and the modifiers each variant actually has — a discriminated union, so a prop that does not belong to a variant does not compile. variant="centered" holds one message at the page body's OPTICAL centre (38/62, not 50/50 — the page header biases the reader's eye and the ratio cancels it); every single-message screen (EmptyState size="lg", ProgressState, an error page) uses the same spot, so switching between them never shifts the furniture. The ratio is deliberately not a prop. Reserved variants stack/row/cards (vertical rhythm, inline cluster, responsive collections) arrive with DS-970. Not CentredLayout: that one owns the whole viewport (min-h-screen, background, padding) for pages outside the app shell — Grid owns nothing but the position inside whatever box it is given.
|
|
176
|
+
- **Header** - Top-level page header container; compose the page title from TypographyHeading level={1} variant="page" (text-heading-page) rather than hand-styling it
|
|
177
|
+
- **Separator** - Visual divider between content with configurable spacing
|
|
178
|
+
- **SplitLayout** - Two-column responsive layout with composition pattern
|
|
179
|
+
|
|
180
|
+
### States
|
|
181
|
+
|
|
182
|
+
_Whole-surface states: empty and in-progress._
|
|
183
|
+
|
|
184
|
+
- **EmptyState** (block) - The empty block. Four parts in reading order: a visual, a real heading, one supporting line, and the actions row — children render in source order, so the primary action goes last and lands rightmost. size sets visual prominence and nothing else — the block is pure content and owns no page layout, so position is always the consumer's composition. size="md" (default) is for the box a working page gives it (a card, a panel, a zero-row table): an icon in a 40px LogoMark chip (lg, circle by default; iconShape picks circle / square, iconVariant picks filled / border / transparent for the surface — border or transparent on a bg-muted panel, where the filled chip vanishes) and a 16/24 title. size="lg" is for the moment the whole page has nothing to show: a 130px illustration and a 20/28 title, composed inside Grid variant="centered" for the page body's optical centre — the same spot ProgressState uses. The props are a discriminated union on size: illustration exists only at lg and align only at md, so a 130px drawing inside a card will not compile. Pass the illustration without a size; the block sets it. titleLevel stays the consumer's, for the document outline. size="sm" is the compact form for a popover, menu or drawer list that found nothing: the same chip, the title as one body-sm line (never a heading, so it can sit inside a listbox option), one quiet hint, and the actions 16px under it. CommandEmpty / ComboboxEmpty and the Single/MultiSelectFilter drawers render it; titleLevel, align and illustration do not exist at sm.
|
|
185
|
+
- **ProgressState** (block) - Generation state: an illustration, title and description in a column — the tool's illustration over a determinate bar when the backend reports a percentage, and a built-in cel animation with neither bar nor status line when it does not. Pure content: compose it inside Grid variant="centered" for the page body's optical centre — the same spot an empty page uses
|
|
186
|
+
|
|
187
|
+
### Typography
|
|
188
|
+
|
|
189
|
+
_Text styles and semantic text elements._
|
|
190
|
+
|
|
191
|
+
- **Typography** - Semantic text components for headings, paragraphs, and inline styles. Deprecated (DS-714) - migrate to TypographyHeading/TypographyText
|
|
192
|
+
- **TypographyHeading** - Semantic heading with decoupled axes: level sets the h1-h6 tag (document outline), variant sets the visual style from the semantic type scale, color carries the colour role (DS-714)
|
|
193
|
+
- **TypographyText** - Semantic text styled by the type scale (DS-714): variant chooses family/size/line-height/weight together; color carries the colour role - muted de-emphasises with colour only, destructive marks error text, success is for positive/confirmation text (same family as Alert success tokens)
|
|
194
|
+
|
|
195
|
+
<!-- categories:end -->
|
|
130
196
|
|
|
131
197
|
### Example Usage
|
|
132
198
|
|
|
@@ -149,15 +215,15 @@ For detailed component APIs and props, refer to the TypeScript definitions inclu
|
|
|
149
215
|
|
|
150
216
|
## Hooks
|
|
151
217
|
|
|
152
|
-
###
|
|
218
|
+
### useIsBelowBreakpoint
|
|
153
219
|
|
|
154
|
-
A React hook
|
|
220
|
+
A React hook that returns `true` while the viewport is below a breakpoint.
|
|
155
221
|
|
|
156
222
|
```tsx
|
|
157
|
-
import {
|
|
223
|
+
import { useIsBelowBreakpoint } from "@brightlocal/ui-components/hooks/use-breakpoint";
|
|
158
224
|
|
|
159
225
|
function MyComponent() {
|
|
160
|
-
const isMobile =
|
|
226
|
+
const isMobile = useIsBelowBreakpoint("sm");
|
|
161
227
|
|
|
162
228
|
return <div>{isMobile ? "Mobile View" : "Desktop View"}</div>;
|
|
163
229
|
}
|
|
@@ -165,11 +231,12 @@ function MyComponent() {
|
|
|
165
231
|
|
|
166
232
|
**Features:**
|
|
167
233
|
|
|
168
|
-
-
|
|
169
|
-
-
|
|
170
|
-
- Automatically updates on window resize
|
|
234
|
+
- Takes a breakpoint name, defaulting to `"sm"`
|
|
235
|
+
- Updates on viewport resize
|
|
171
236
|
- Uses `window.matchMedia` for efficient media query listening
|
|
172
237
|
|
|
238
|
+
Other hooks: `use-debounce`, `use-delayed-pending`, `use-filter-search-params`, `use-overlay-pointer-lock`.
|
|
239
|
+
|
|
173
240
|
### usePrefersReducedMotion
|
|
174
241
|
|
|
175
242
|
A React hook that returns `true` when reduced motion should be applied. It
|
|
@@ -299,7 +366,8 @@ This package uses Tailwind CSS utility classes internally. In Tailwind CSS v4, `
|
|
|
299
366
|
|
|
300
367
|
```css
|
|
301
368
|
@import "tailwindcss";
|
|
302
|
-
@import "@brightlocal/
|
|
369
|
+
@import "@brightlocal/tokens/tailwind-preset.css";
|
|
370
|
+
@import "@brightlocal/ui-components/tailwind.css";
|
|
303
371
|
```
|
|
304
372
|
|
|
305
373
|
This tells Tailwind to scan the package's compiled output for utility classes, ensuring all component styles are generated correctly.
|
|
@@ -322,15 +390,15 @@ All components are built to be themeable using CSS custom properties. You can cu
|
|
|
322
390
|
```css
|
|
323
391
|
:root {
|
|
324
392
|
/* Customize colors, spacing, borders, etc. */
|
|
325
|
-
--radius: 0.5rem;
|
|
326
|
-
--primary:
|
|
327
|
-
--foreground:
|
|
393
|
+
--radius-md: 0.5rem;
|
|
394
|
+
--primary: #0a66ff;
|
|
395
|
+
--foreground: #0b1220;
|
|
328
396
|
}
|
|
329
397
|
|
|
330
398
|
.dark {
|
|
331
399
|
/* Dark mode overrides */
|
|
332
|
-
--background:
|
|
333
|
-
--foreground:
|
|
400
|
+
--background: #0b1220;
|
|
401
|
+
--foreground: #f8fafc;
|
|
334
402
|
}
|
|
335
403
|
```
|
|
336
404
|
|
|
@@ -450,7 +518,7 @@ Components are exported per-file (not barrel imports). Use the component name in
|
|
|
450
518
|
import { Button } from "@brightlocal/ui-components/button";
|
|
451
519
|
import { Dialog, DialogContent, DialogTrigger } from "@brightlocal/ui-components/dialog";
|
|
452
520
|
import { DataTable } from "@brightlocal/ui-components/data-table";
|
|
453
|
-
import {
|
|
521
|
+
import { useIsBelowBreakpoint } from "@brightlocal/ui-components/hooks/use-breakpoint";
|
|
454
522
|
import { cn } from "@brightlocal/ui-components/lib/utils";
|
|
455
523
|
```
|
|
456
524
|
|
|
@@ -459,7 +527,7 @@ import { cn } from "@brightlocal/ui-components/lib/utils";
|
|
|
459
527
|
| Path pattern | Example |
|
|
460
528
|
|---|---|
|
|
461
529
|
| `@brightlocal/ui-components/{component}` | `/button`, `/input`, `/dialog`, `/select`, `/data-table`, `/sidebar`, `/input-list` |
|
|
462
|
-
| `@brightlocal/ui-components/hooks/{hook}` | `/hooks/use-
|
|
530
|
+
| `@brightlocal/ui-components/hooks/{hook}` | `/hooks/use-breakpoint` |
|
|
463
531
|
| `@brightlocal/ui-components/lib/{util}` | `/lib/utils` |
|
|
464
532
|
|
|
465
533
|
## Dependencies
|
|
@@ -488,7 +556,7 @@ These files help AI assistants generate code that follows BrightLocal Design Sys
|
|
|
488
556
|
|
|
489
557
|
## Development
|
|
490
558
|
|
|
491
|
-
This package is part of the BrightLocal Design System monorepo. It
|
|
559
|
+
This package is part of the BrightLocal Design System monorepo. It ships built `dist` output plus `src` for consuming applications.
|
|
492
560
|
|
|
493
561
|
### Bundle Size Monitoring
|
|
494
562
|
|