@brightlocal/ui-components 0.1.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/LICENSE +21 -0
- package/README.md +349 -0
- package/dist/accordion.cjs +1 -0
- package/dist/accordion.d.ts +32 -0
- package/dist/accordion.d.ts.map +1 -0
- package/dist/accordion.js +107 -0
- package/dist/alert-dialog.cjs +1 -0
- package/dist/alert-dialog.d.ts +15 -0
- package/dist/alert-dialog.d.ts.map +1 -0
- package/dist/alert-dialog.js +146 -0
- package/dist/alert.cjs +1 -0
- package/dist/alert.d.ts +16 -0
- package/dist/alert.d.ts.map +1 -0
- package/dist/alert.js +174 -0
- package/dist/aspect-ratio.cjs +1 -0
- package/dist/aspect-ratio.d.ts +10 -0
- package/dist/aspect-ratio.d.ts.map +1 -0
- package/dist/aspect-ratio.js +22 -0
- package/dist/avatar.cjs +1 -0
- package/dist/avatar.d.ts +11 -0
- package/dist/avatar.d.ts.map +1 -0
- package/dist/avatar.js +46 -0
- package/dist/badge.cjs +1 -0
- package/dist/badge.d.ts +19 -0
- package/dist/badge.d.ts.map +1 -0
- package/dist/badge.js +50 -0
- package/dist/blocks/data-table.cjs +1 -0
- package/dist/blocks/data-table.d.ts +303 -0
- package/dist/blocks/data-table.d.ts.map +1 -0
- package/dist/blocks/data-table.js +555 -0
- package/dist/blocks/sidebar.cjs +1 -0
- package/dist/blocks/sidebar.d.ts +744 -0
- package/dist/blocks/sidebar.d.ts.map +1 -0
- package/dist/blocks/sidebar.js +839 -0
- package/dist/breadcrumb.cjs +1 -0
- package/dist/breadcrumb.d.ts +12 -0
- package/dist/breadcrumb.d.ts.map +1 -0
- package/dist/breadcrumb.js +102 -0
- package/dist/button.cjs +1 -0
- package/dist/button.d.ts +73 -0
- package/dist/button.d.ts.map +1 -0
- package/dist/button.js +195 -0
- package/dist/calendar.cjs +1 -0
- package/dist/calendar.d.ts +28 -0
- package/dist/calendar.d.ts.map +1 -0
- package/dist/calendar.js +191 -0
- package/dist/card.cjs +1 -0
- package/dist/card.d.ts +28 -0
- package/dist/card.d.ts.map +1 -0
- package/dist/card.js +131 -0
- package/dist/carousel.cjs +1 -0
- package/dist/carousel.d.ts +21 -0
- package/dist/carousel.d.ts.map +1 -0
- package/dist/carousel.js +185 -0
- package/dist/centred-layout.cjs +1 -0
- package/dist/centred-layout.d.ts +49 -0
- package/dist/centred-layout.d.ts.map +1 -0
- package/dist/centred-layout.js +35 -0
- package/dist/chart.cjs +10 -0
- package/dist/chart.d.ts +83 -0
- package/dist/chart.d.ts.map +1 -0
- package/dist/chart.js +254 -0
- package/dist/checkbox.cjs +1 -0
- package/dist/checkbox.d.ts +15 -0
- package/dist/checkbox.d.ts.map +1 -0
- package/dist/checkbox.js +96 -0
- package/dist/collapsible.cjs +1 -0
- package/dist/collapsible.d.ts +18 -0
- package/dist/collapsible.d.ts.map +1 -0
- package/dist/collapsible.js +58 -0
- package/dist/combobox.cjs +1 -0
- package/dist/combobox.d.ts +65 -0
- package/dist/combobox.d.ts.map +1 -0
- package/dist/combobox.js +203 -0
- package/dist/command.cjs +1 -0
- package/dist/command.d.ts +44 -0
- package/dist/command.d.ts.map +1 -0
- package/dist/command.js +166 -0
- package/dist/context-menu.cjs +1 -0
- package/dist/context-menu.d.ts +42 -0
- package/dist/context-menu.d.ts.map +1 -0
- package/dist/context-menu.js +226 -0
- package/dist/date-picker.cjs +1 -0
- package/dist/date-picker.d.ts +54 -0
- package/dist/date-picker.d.ts.map +1 -0
- package/dist/date-picker.js +95 -0
- package/dist/dialog.cjs +1 -0
- package/dist/dialog.d.ts +20 -0
- package/dist/dialog.d.ts.map +1 -0
- package/dist/dialog.js +130 -0
- package/dist/drawer.cjs +1 -0
- package/dist/drawer.d.ts +22 -0
- package/dist/drawer.d.ts.map +1 -0
- package/dist/drawer.js +149 -0
- package/dist/dropdown-menu.cjs +1 -0
- package/dist/dropdown-menu.d.ts +253 -0
- package/dist/dropdown-menu.d.ts.map +1 -0
- package/dist/dropdown-menu.js +325 -0
- package/dist/field.cjs +1 -0
- package/dist/field.d.ts +21 -0
- package/dist/field.d.ts.map +1 -0
- package/dist/field.js +148 -0
- package/dist/global-layout.cjs +1 -0
- package/dist/global-layout.d.ts +60 -0
- package/dist/global-layout.d.ts.map +1 -0
- package/dist/global-layout.js +87 -0
- package/dist/hooks/use-mobile.cjs +1 -0
- package/dist/hooks/use-mobile.d.ts +2 -0
- package/dist/hooks/use-mobile.d.ts.map +1 -0
- package/dist/hooks/use-mobile.js +16 -0
- package/dist/hover-card.cjs +1 -0
- package/dist/hover-card.d.ts +43 -0
- package/dist/hover-card.d.ts.map +1 -0
- package/dist/hover-card.js +71 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +61 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +412 -0
- package/dist/input-base.cjs +1 -0
- package/dist/input-base.d.ts +28 -0
- package/dist/input-base.d.ts.map +1 -0
- package/dist/input-base.js +56 -0
- package/dist/input-group.cjs +1 -0
- package/dist/input-group.d.ts +26 -0
- package/dist/input-group.d.ts.map +1 -0
- package/dist/input-group.js +116 -0
- package/dist/input-otp.cjs +1 -0
- package/dist/input-otp.d.ts +45 -0
- package/dist/input-otp.d.ts.map +1 -0
- package/dist/input-otp.js +186 -0
- package/dist/input-password.cjs +1 -0
- package/dist/input-password.d.ts +38 -0
- package/dist/input-password.d.ts.map +1 -0
- package/dist/input-password.js +101 -0
- package/dist/input.cjs +1 -0
- package/dist/input.d.ts +32 -0
- package/dist/input.d.ts.map +1 -0
- package/dist/input.js +146 -0
- package/dist/label.cjs +1 -0
- package/dist/label.d.ts +12 -0
- package/dist/label.d.ts.map +1 -0
- package/dist/label.js +34 -0
- package/dist/lib/utils.cjs +1 -0
- package/dist/lib/utils.d.ts +3 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +8 -0
- package/dist/link.cjs +1 -0
- package/dist/link.d.ts +29 -0
- package/dist/link.d.ts.map +1 -0
- package/dist/link.figma.d.ts +2 -0
- package/dist/link.figma.d.ts.map +1 -0
- package/dist/link.js +71 -0
- package/dist/logo.cjs +1 -0
- package/dist/logo.d.ts +25 -0
- package/dist/logo.d.ts.map +1 -0
- package/dist/logo.js +71 -0
- package/dist/menubar.cjs +1 -0
- package/dist/menubar.d.ts +106 -0
- package/dist/menubar.d.ts.map +1 -0
- package/dist/menubar.js +270 -0
- package/dist/navigation-menu.cjs +1 -0
- package/dist/navigation-menu.d.ts +108 -0
- package/dist/navigation-menu.d.ts.map +1 -0
- package/dist/navigation-menu.js +175 -0
- package/dist/pagination.cjs +1 -0
- package/dist/pagination.d.ts +81 -0
- package/dist/pagination.d.ts.map +1 -0
- package/dist/pagination.js +216 -0
- package/dist/popover.cjs +1 -0
- package/dist/popover.d.ts +8 -0
- package/dist/popover.d.ts.map +1 -0
- package/dist/popover.js +44 -0
- package/dist/progress.cjs +1 -0
- package/dist/progress.d.ts +29 -0
- package/dist/progress.d.ts.map +1 -0
- package/dist/progress.js +64 -0
- package/dist/radio-group.cjs +1 -0
- package/dist/radio-group.d.ts +33 -0
- package/dist/radio-group.d.ts.map +1 -0
- package/dist/radio-group.js +193 -0
- package/dist/rating.cjs +1 -0
- package/dist/rating.d.ts +22 -0
- package/dist/rating.d.ts.map +1 -0
- package/dist/rating.js +51 -0
- package/dist/resizable.cjs +1 -0
- package/dist/resizable.d.ts +14 -0
- package/dist/resizable.d.ts.map +1 -0
- package/dist/resizable.js +46 -0
- package/dist/scroll-area.cjs +1 -0
- package/dist/scroll-area.d.ts +12 -0
- package/dist/scroll-area.d.ts.map +1 -0
- package/dist/scroll-area.js +67 -0
- package/dist/select.cjs +1 -0
- package/dist/select.d.ts +77 -0
- package/dist/select.d.ts.map +1 -0
- package/dist/select.js +259 -0
- package/dist/separator.cjs +1 -0
- package/dist/separator.d.ts +14 -0
- package/dist/separator.d.ts.map +1 -0
- package/dist/separator.js +43 -0
- package/dist/sheet.cjs +1 -0
- package/dist/sheet.d.ts +38 -0
- package/dist/sheet.d.ts.map +1 -0
- package/dist/sheet.js +190 -0
- package/dist/skeleton.cjs +1 -0
- package/dist/skeleton.d.ts +5 -0
- package/dist/skeleton.d.ts.map +1 -0
- package/dist/skeleton.js +15 -0
- package/dist/slider.cjs +1 -0
- package/dist/slider.d.ts +19 -0
- package/dist/slider.d.ts.map +1 -0
- package/dist/slider.js +69 -0
- package/dist/sonner.cjs +1 -0
- package/dist/sonner.d.ts +188 -0
- package/dist/sonner.d.ts.map +1 -0
- package/dist/sonner.js +150 -0
- package/dist/split-layout.cjs +1 -0
- package/dist/split-layout.d.ts +42 -0
- package/dist/split-layout.d.ts.map +1 -0
- package/dist/split-layout.js +108 -0
- package/dist/switch.cjs +1 -0
- package/dist/switch.d.ts +43 -0
- package/dist/switch.d.ts.map +1 -0
- package/dist/switch.figma.d.ts +2 -0
- package/dist/switch.figma.d.ts.map +1 -0
- package/dist/switch.js +110 -0
- package/dist/table.cjs +1 -0
- package/dist/table.d.ts +95 -0
- package/dist/table.d.ts.map +1 -0
- package/dist/table.js +164 -0
- package/dist/tabs.cjs +1 -0
- package/dist/tabs.d.ts +29 -0
- package/dist/tabs.d.ts.map +1 -0
- package/dist/tabs.js +96 -0
- package/dist/textarea.cjs +1 -0
- package/dist/textarea.d.ts +23 -0
- package/dist/textarea.d.ts.map +1 -0
- package/dist/textarea.js +47 -0
- package/dist/toggle-group.cjs +1 -0
- package/dist/toggle-group.d.ts +25 -0
- package/dist/toggle-group.d.ts.map +1 -0
- package/dist/toggle-group.js +74 -0
- package/dist/toggle.cjs +1 -0
- package/dist/toggle.d.ts +44 -0
- package/dist/toggle.d.ts.map +1 -0
- package/dist/toggle.figma.d.ts +2 -0
- package/dist/toggle.figma.d.ts.map +1 -0
- package/dist/toggle.js +57 -0
- package/dist/tooltip.cjs +1 -0
- package/dist/tooltip.d.ts +66 -0
- package/dist/tooltip.d.ts.map +1 -0
- package/dist/tooltip.js +78 -0
- package/package.json +184 -0
- package/src/blocks/data-table.tsx +1166 -0
- package/src/blocks/sidebar.tsx +1830 -0
- package/src/components/.gitkeep +0 -0
- package/src/components/accordion.tsx +142 -0
- package/src/components/alert-dialog.tsx +157 -0
- package/src/components/alert.tsx +199 -0
- package/src/components/aspect-ratio.tsx +30 -0
- package/src/components/avatar.tsx +56 -0
- package/src/components/badge.tsx +72 -0
- package/src/components/breadcrumb.tsx +109 -0
- package/src/components/button.tsx +296 -0
- package/src/components/calendar.tsx +234 -0
- package/src/components/card.tsx +158 -0
- package/src/components/carousel.tsx +256 -0
- package/src/components/centred-layout.tsx +91 -0
- package/src/components/chart.tsx +456 -0
- package/src/components/checkbox.tsx +132 -0
- package/src/components/collapsible.tsx +68 -0
- package/src/components/combobox.tsx +321 -0
- package/src/components/command.tsx +220 -0
- package/src/components/context-menu.tsx +305 -0
- package/src/components/date-picker.tsx +155 -0
- package/src/components/dialog.tsx +152 -0
- package/src/components/drawer.tsx +168 -0
- package/src/components/dropdown-menu.tsx +575 -0
- package/src/components/field.tsx +155 -0
- package/src/components/global-layout.tsx +153 -0
- package/src/components/hover-card.tsx +121 -0
- package/src/components/input-base.tsx +86 -0
- package/src/components/input-group.tsx +158 -0
- package/src/components/input-otp.tsx +327 -0
- package/src/components/input-password.tsx +191 -0
- package/src/components/input.tsx +220 -0
- package/src/components/label.tsx +42 -0
- package/src/components/link.figma.tsx +71 -0
- package/src/components/link.tsx +105 -0
- package/src/components/logo.tsx +97 -0
- package/src/components/menubar.tsx +379 -0
- package/src/components/navigation-menu.tsx +324 -0
- package/src/components/pagination.tsx +368 -0
- package/src/components/popover.tsx +46 -0
- package/src/components/progress.tsx +100 -0
- package/src/components/radio-group.tsx +281 -0
- package/src/components/rating.tsx +87 -0
- package/src/components/resizable.tsx +66 -0
- package/src/components/scroll-area.tsx +72 -0
- package/src/components/select.tsx +442 -0
- package/src/components/separator.tsx +53 -0
- package/src/components/sheet.tsx +220 -0
- package/src/components/skeleton.tsx +17 -0
- package/src/components/slider.tsx +86 -0
- package/src/components/sonner.tsx +396 -0
- package/src/components/split-layout.tsx +155 -0
- package/src/components/switch.figma.tsx +115 -0
- package/src/components/switch.tsx +173 -0
- package/src/components/table.tsx +277 -0
- package/src/components/tabs.tsx +142 -0
- package/src/components/textarea.tsx +77 -0
- package/src/components/toggle-group.tsx +109 -0
- package/src/components/toggle.figma.tsx +81 -0
- package/src/components/toggle.tsx +103 -0
- package/src/components/tooltip.tsx +156 -0
- package/src/hooks/.gitkeep +0 -0
- package/src/hooks/use-mobile.ts +21 -0
- package/src/index.ts +67 -0
- package/src/lib/utils.ts +6 -0
- package/src/types/external-modules.d.ts +16 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 BrightLocal
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,349 @@
|
|
|
1
|
+
# @brightlocal/ui-components
|
|
2
|
+
|
|
3
|
+
BrightLocal Design System UI Components package containing low-level React components and utilities built on top of Radix UI primitives.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @brightlocal/ui-components
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Peer Dependencies
|
|
12
|
+
|
|
13
|
+
This package requires React 17+ or 18+ or 19+:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install react react-dom
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Components
|
|
20
|
+
|
|
21
|
+
This package includes 56 components built on Radix UI primitives and other React libraries. All components are fully typed with TypeScript and follow BrightLocal's design system patterns.
|
|
22
|
+
|
|
23
|
+
### Layout Components
|
|
24
|
+
|
|
25
|
+
- **AspectRatio** - Maintains consistent aspect ratios for content
|
|
26
|
+
- **Card** - Container for content with consistent styling
|
|
27
|
+
- **CentredLayout** - Centers content horizontally
|
|
28
|
+
- **GlobalLayout** - Full-page layout wrapper
|
|
29
|
+
- **ResizablePanel** - Panels that can be resized by users
|
|
30
|
+
- **ScrollArea** - Custom scrollable areas with styled scrollbars
|
|
31
|
+
- **Separator** - Visual dividers between content
|
|
32
|
+
- **Skeleton** - Loading placeholder components
|
|
33
|
+
- **SplitLayout** - Split-pane layouts
|
|
34
|
+
|
|
35
|
+
### Navigation Components
|
|
36
|
+
|
|
37
|
+
- **Breadcrumb** - Hierarchical navigation trail
|
|
38
|
+
- **Link** - Styled anchor links
|
|
39
|
+
- **NavigationMenu** - Complex navigation menus
|
|
40
|
+
- **Menubar** - Application menu bars
|
|
41
|
+
- **Pagination** - Page navigation controls
|
|
42
|
+
- **Tabs** - Tabbed interface components
|
|
43
|
+
|
|
44
|
+
### Form Components
|
|
45
|
+
|
|
46
|
+
- **Button** - Interactive buttons with variants
|
|
47
|
+
- **Calendar** - Date selection calendar
|
|
48
|
+
- **Checkbox** - Checkbox inputs
|
|
49
|
+
- **Combobox** - Searchable select inputs
|
|
50
|
+
- **DatePicker** - Date picker with calendar
|
|
51
|
+
- **Field** - Form field wrapper with label and error handling
|
|
52
|
+
- **Input** - Text input fields
|
|
53
|
+
- **InputBase** - Base input component
|
|
54
|
+
- **InputGroup** - Grouped input components
|
|
55
|
+
- **InputOTP** - One-time password inputs
|
|
56
|
+
- **Label** - Form labels
|
|
57
|
+
- **InputPassword** - Password input with visibility toggle
|
|
58
|
+
- **RadioGroup** - Radio button groups
|
|
59
|
+
- **Rating** - Star rating input
|
|
60
|
+
- **Select** - Dropdown select inputs
|
|
61
|
+
- **Slider** - Range slider inputs
|
|
62
|
+
- **Switch** - Toggle switches
|
|
63
|
+
- **Textarea** - Multi-line text inputs
|
|
64
|
+
- **Toggle** - Toggle buttons
|
|
65
|
+
- **ToggleGroup** - Groups of toggle buttons
|
|
66
|
+
|
|
67
|
+
### Overlay Components
|
|
68
|
+
|
|
69
|
+
- **AlertDialog** - Modal dialogs for confirmations
|
|
70
|
+
- **ContextMenu** - Right-click context menus
|
|
71
|
+
- **Dialog** - Modal dialogs
|
|
72
|
+
- **Drawer** - Side drawer panels
|
|
73
|
+
- **DropdownMenu** - Dropdown menus
|
|
74
|
+
- **HoverCard** - Popover cards on hover
|
|
75
|
+
- **Popover** - Floating popovers
|
|
76
|
+
- **Sheet** - Slide-in panels
|
|
77
|
+
- **Tooltip** - Tooltips on hover
|
|
78
|
+
|
|
79
|
+
### Feedback Components
|
|
80
|
+
|
|
81
|
+
- **Alert** - Alert messages
|
|
82
|
+
- **Badge** - Status badges and labels
|
|
83
|
+
- **Progress** - Progress indicators
|
|
84
|
+
- **Sonner** - Toast notifications
|
|
85
|
+
|
|
86
|
+
### Display Components
|
|
87
|
+
|
|
88
|
+
- **Accordion** - Expandable/collapsible sections
|
|
89
|
+
- **Avatar** - User avatar images
|
|
90
|
+
- **Carousel** - Image/content carousels
|
|
91
|
+
- **Chart** - Data visualization charts
|
|
92
|
+
- **Collapsible** - Collapsible content sections
|
|
93
|
+
- **Command** - Command palette/search
|
|
94
|
+
- **Logo** - BrightLocal logo component
|
|
95
|
+
- **Table** - Data tables
|
|
96
|
+
|
|
97
|
+
### Example Usage
|
|
98
|
+
|
|
99
|
+
```tsx
|
|
100
|
+
import { Button } from "@brightlocal/ui-components/button";
|
|
101
|
+
import { Input } from "@brightlocal/ui-components/input";
|
|
102
|
+
import { Card } from "@brightlocal/ui-components/card";
|
|
103
|
+
|
|
104
|
+
function MyComponent() {
|
|
105
|
+
return (
|
|
106
|
+
<Card dataHook="example-card">
|
|
107
|
+
<Input dataHook="name-input" placeholder="Enter your name" />
|
|
108
|
+
<Button dataHook="submit-button">Submit</Button>
|
|
109
|
+
</Card>
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
For detailed component APIs and props, refer to the TypeScript definitions included with this package.
|
|
115
|
+
|
|
116
|
+
## Hooks
|
|
117
|
+
|
|
118
|
+
### useIsMobile
|
|
119
|
+
|
|
120
|
+
A React hook to detect mobile breakpoints.
|
|
121
|
+
|
|
122
|
+
```tsx
|
|
123
|
+
import { useIsMobile } from "@brightlocal/ui-components/hooks/use-mobile";
|
|
124
|
+
|
|
125
|
+
function MyComponent() {
|
|
126
|
+
const isMobile = useIsMobile();
|
|
127
|
+
|
|
128
|
+
return <div>{isMobile ? "Mobile View" : "Desktop View"}</div>;
|
|
129
|
+
}
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
**Features:**
|
|
133
|
+
|
|
134
|
+
- Uses 768px as the mobile breakpoint
|
|
135
|
+
- Returns `boolean | undefined` (undefined during hydration)
|
|
136
|
+
- Automatically updates on window resize
|
|
137
|
+
- Uses `window.matchMedia` for efficient media query listening
|
|
138
|
+
|
|
139
|
+
## Utilities
|
|
140
|
+
|
|
141
|
+
### cn (Class Name Utility)
|
|
142
|
+
|
|
143
|
+
A utility function for conditionally joining class names.
|
|
144
|
+
|
|
145
|
+
```tsx
|
|
146
|
+
import { cn } from "@brightlocal/ui-components/lib/utils";
|
|
147
|
+
|
|
148
|
+
// Usage
|
|
149
|
+
const className = cn(
|
|
150
|
+
"base-class",
|
|
151
|
+
condition && "conditional-class",
|
|
152
|
+
{ "object-class": someCondition },
|
|
153
|
+
["array", "of", "classes"]
|
|
154
|
+
);
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
## TypeScript Support
|
|
158
|
+
|
|
159
|
+
This package is written in TypeScript and provides full type definitions. All components include proper typing for props and data hooks with template literal types for better type safety.
|
|
160
|
+
|
|
161
|
+
## Data Hooks
|
|
162
|
+
|
|
163
|
+
All components in this package follow the BrightLocal data hook pattern:
|
|
164
|
+
|
|
165
|
+
- Components require `dataHook` props for testing and automation
|
|
166
|
+
- Data hooks follow specific naming patterns (e.g., `${string}-collapsibleTrigger`)
|
|
167
|
+
- Template literal types ensure correct data hook formatting
|
|
168
|
+
|
|
169
|
+
## Styling & Theming
|
|
170
|
+
|
|
171
|
+
### Styling Approach
|
|
172
|
+
|
|
173
|
+
Components use a modern, flexible styling system:
|
|
174
|
+
|
|
175
|
+
- **Tailwind CSS** - Utility-first CSS classes for rapid styling
|
|
176
|
+
- **CSS Custom Properties** - For dynamic theming and customization
|
|
177
|
+
- **Data Attributes** - `data-slot` attributes for component part identification
|
|
178
|
+
- **Class Variance Authority** - For component variants and states
|
|
179
|
+
|
|
180
|
+
### Theming & Customization
|
|
181
|
+
|
|
182
|
+
All components are built to be themeable using CSS custom properties. You can customize the look and feel by overriding CSS variables in your application:
|
|
183
|
+
|
|
184
|
+
```css
|
|
185
|
+
:root {
|
|
186
|
+
/* Customize colors, spacing, borders, etc. */
|
|
187
|
+
--radius: 0.5rem;
|
|
188
|
+
--primary: 210 100% 50%;
|
|
189
|
+
--foreground: 222.2 84% 4.9%;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.dark {
|
|
193
|
+
/* Dark mode overrides */
|
|
194
|
+
--background: 222.2 84% 4.9%;
|
|
195
|
+
--foreground: 210 40% 98%;
|
|
196
|
+
}
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
### Dark Mode Support
|
|
200
|
+
|
|
201
|
+
Components support dark mode through CSS custom properties and the `dark` class. Implement dark mode in your application by:
|
|
202
|
+
|
|
203
|
+
1. Adding the `dark` class to your root element
|
|
204
|
+
2. Defining dark mode color values in your CSS
|
|
205
|
+
3. Using the Tailwind `dark:` modifier for custom styles
|
|
206
|
+
|
|
207
|
+
### Custom Styling
|
|
208
|
+
|
|
209
|
+
You can customize individual components using:
|
|
210
|
+
|
|
211
|
+
- **className prop** - Pass additional Tailwind classes
|
|
212
|
+
- **CSS modules** - Target `data-slot` attributes
|
|
213
|
+
- **Wrapper components** - Create your own component variants
|
|
214
|
+
|
|
215
|
+
```tsx
|
|
216
|
+
// Using className prop
|
|
217
|
+
<Button className="bg-blue-600 hover:bg-blue-700">
|
|
218
|
+
Custom Button
|
|
219
|
+
</Button>
|
|
220
|
+
|
|
221
|
+
// Creating a wrapper component
|
|
222
|
+
export function PrimaryButton(props) {
|
|
223
|
+
return <Button className="bg-primary text-primary-foreground" {...props} />;
|
|
224
|
+
}
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
## Accessibility
|
|
228
|
+
|
|
229
|
+
All components in this package are built with accessibility in mind, following WAI-ARIA best practices:
|
|
230
|
+
|
|
231
|
+
### Keyboard Navigation
|
|
232
|
+
|
|
233
|
+
- All interactive components support full keyboard navigation
|
|
234
|
+
- Tab order follows logical flow through the interface
|
|
235
|
+
- Arrow keys navigate through menus, tabs, and other grouped elements
|
|
236
|
+
- Escape key closes overlays and dismisses dialogs
|
|
237
|
+
- Enter/Space activate buttons and toggles
|
|
238
|
+
|
|
239
|
+
### Screen Reader Support
|
|
240
|
+
|
|
241
|
+
- Components use proper ARIA roles, labels, and attributes
|
|
242
|
+
- State changes are announced to screen readers
|
|
243
|
+
- Error messages and validation feedback are associated with form inputs
|
|
244
|
+
- Loading states and progress indicators are announced
|
|
245
|
+
|
|
246
|
+
### Focus Management
|
|
247
|
+
|
|
248
|
+
- Focus indicators are clearly visible using `:focus-visible` patterns
|
|
249
|
+
- Focus is trapped in modal dialogs and drawers
|
|
250
|
+
- Focus returns to the trigger element when closing overlays
|
|
251
|
+
- Skip links and focus management for complex widgets
|
|
252
|
+
|
|
253
|
+
### Color Contrast
|
|
254
|
+
|
|
255
|
+
- All text meets WCAG AA contrast requirements (4.5:1 for normal text)
|
|
256
|
+
- Interactive elements have sufficient contrast in all states
|
|
257
|
+
- Error states use multiple indicators (not just color)
|
|
258
|
+
|
|
259
|
+
### Responsive Design
|
|
260
|
+
|
|
261
|
+
- Components work across all viewport sizes
|
|
262
|
+
- Touch targets meet minimum size requirements (44x44px)
|
|
263
|
+
- Mobile-specific patterns (like bottom sheets) for better mobile UX
|
|
264
|
+
|
|
265
|
+
### Best Practices
|
|
266
|
+
|
|
267
|
+
When using these components:
|
|
268
|
+
|
|
269
|
+
1. **Always provide labels** - Use the `Label` component or `aria-label`
|
|
270
|
+
2. **Include error messages** - Associate errors with form fields using `aria-describedby`
|
|
271
|
+
3. **Test with keyboard only** - Ensure all functionality is accessible via keyboard
|
|
272
|
+
4. **Test with screen readers** - Verify announcements are meaningful
|
|
273
|
+
5. **Maintain focus order** - Keep tab order logical and predictable
|
|
274
|
+
|
|
275
|
+
```tsx
|
|
276
|
+
// Good accessibility example
|
|
277
|
+
<Field>
|
|
278
|
+
<Label htmlFor="email">Email Address</Label>
|
|
279
|
+
<Input
|
|
280
|
+
id="email"
|
|
281
|
+
type="email"
|
|
282
|
+
aria-describedby="email-error"
|
|
283
|
+
aria-invalid={hasError}
|
|
284
|
+
/>
|
|
285
|
+
{hasError && (
|
|
286
|
+
<span id="email-error" role="alert">
|
|
287
|
+
Please enter a valid email address
|
|
288
|
+
</span>
|
|
289
|
+
)}
|
|
290
|
+
</Field>
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
## Available Exports
|
|
294
|
+
|
|
295
|
+
- `@brightlocal/ui-components/collapsible` - Collapsible components
|
|
296
|
+
- `@brightlocal/ui-components/scroll-area` - ScrollArea components
|
|
297
|
+
- `@brightlocal/ui-components/hooks/use-mobile` - Mobile detection hook
|
|
298
|
+
- `@brightlocal/ui-components/lib/utils` - Utility functions
|
|
299
|
+
|
|
300
|
+
## Dependencies
|
|
301
|
+
|
|
302
|
+
This package builds on:
|
|
303
|
+
|
|
304
|
+
- **@radix-ui/react-collapsible** - Collapsible primitive
|
|
305
|
+
- **@radix-ui/react-scroll-area** - ScrollArea primitive
|
|
306
|
+
|
|
307
|
+
## Development
|
|
308
|
+
|
|
309
|
+
This package is part of the BrightLocal Design System monorepo. It publishes source files directly (no build step required) for maximum compatibility with consuming applications.
|
|
310
|
+
|
|
311
|
+
### Bundle Size Monitoring
|
|
312
|
+
|
|
313
|
+
This package uses `size-limit` to monitor and prevent bundle size regressions.
|
|
314
|
+
|
|
315
|
+
**Check bundle sizes:**
|
|
316
|
+
|
|
317
|
+
```bash
|
|
318
|
+
# From ui-components directory
|
|
319
|
+
pnpm size
|
|
320
|
+
|
|
321
|
+
# From monorepo root
|
|
322
|
+
pnpm --filter @brightlocal/ui-components size
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
**Analyze bundle composition:**
|
|
326
|
+
|
|
327
|
+
```bash
|
|
328
|
+
# From ui-components directory
|
|
329
|
+
pnpm analyze
|
|
330
|
+
|
|
331
|
+
# From monorepo root
|
|
332
|
+
pnpm analyze
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
**Bundle size limits:**
|
|
336
|
+
|
|
337
|
+
- Main Bundle (ESM): 50 KB
|
|
338
|
+
- Main Bundle (CJS): 50 KB
|
|
339
|
+
- Total Dist Size: 500 KB
|
|
340
|
+
|
|
341
|
+
These limits are enforced to prevent performance regressions. If you need to increase the limits, update the `size-limit` configuration in [package.json](./package.json).
|
|
342
|
+
|
|
343
|
+
## Repository
|
|
344
|
+
|
|
345
|
+
[GitHub Repository](https://github.com/BrightLocal/design-system/tree/main/packages/ui-components)
|
|
346
|
+
|
|
347
|
+
## License
|
|
348
|
+
|
|
349
|
+
MIT
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),f=require("@radix-ui/react-accordion"),g=require("lucide-react"),r=require("@brightlocal/ui-components/lib/utils");function m(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const a in e)if(a!=="default"){const i=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,i.get?i:{enumerable:!0,get:()=>e[a]})}}return t.default=e,Object.freeze(t)}const o=m(f);function b(e){const{dataHook:t,trackingEl:a,trackingLabel:i,disabled:c,dir:l,orientation:d,className:s,children:u}=e;return e.type==="single"?n.jsx(o.Root,{className:s,collapsible:e.collapsible,"data-hook":t,"data-slot":"accordion","data-tracking-el":a,"data-tracking-label":i,defaultValue:e.defaultValue,dir:l,disabled:c,orientation:d,type:"single",value:e.value,onValueChange:e.onValueChange,children:u}):n.jsx(o.Root,{className:s,"data-hook":t,"data-slot":"accordion","data-tracking-el":a,"data-tracking-label":i,defaultValue:e.defaultValue,dir:l,disabled:c,orientation:d,type:"multiple",value:e.value,onValueChange:e.onValueChange,children:u})}function v({className:e,...t}){return n.jsx(o.Item,{className:r.cn("border-b last:border-b-0",e),"data-slot":"accordion-item",...t})}function x({className:e,children:t,...a}){return n.jsx(o.Header,{className:"flex",children:n.jsxs(o.Trigger,{className:r.cn("focus-visible:border-ring focus-visible:shadow-default flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",e),"data-slot":"accordion-trigger",...a,children:[t,n.jsx(g.ChevronDownIcon,{className:"text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200"})]})})}function h({className:e,children:t,...a}){return n.jsx(o.Content,{className:"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm","data-slot":"accordion-content",...a,children:n.jsx("div",{className:r.cn("pt-0 pb-4",e),children:t})})}exports.Accordion=b;exports.AccordionContent=h;exports.AccordionItem=v;exports.AccordionTrigger=x;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as AccordionPrimitive from "@radix-ui/react-accordion";
|
|
3
|
+
interface BaseAccordionProps {
|
|
4
|
+
dataHook: string;
|
|
5
|
+
trackingEl?: string;
|
|
6
|
+
trackingLabel?: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
dir?: "ltr" | "rtl";
|
|
9
|
+
orientation?: "vertical" | "horizontal";
|
|
10
|
+
className?: string;
|
|
11
|
+
children?: React.ReactNode;
|
|
12
|
+
}
|
|
13
|
+
interface SingleAccordionProps extends BaseAccordionProps {
|
|
14
|
+
type: "single";
|
|
15
|
+
collapsible?: boolean;
|
|
16
|
+
defaultValue?: string;
|
|
17
|
+
value?: string;
|
|
18
|
+
onValueChange?: (value: string) => void;
|
|
19
|
+
}
|
|
20
|
+
interface MultipleAccordionProps extends BaseAccordionProps {
|
|
21
|
+
type: "multiple";
|
|
22
|
+
defaultValue?: string[];
|
|
23
|
+
value?: string[];
|
|
24
|
+
onValueChange?: (value: string[]) => void;
|
|
25
|
+
}
|
|
26
|
+
export type AccordionProps = SingleAccordionProps | MultipleAccordionProps;
|
|
27
|
+
declare function Accordion(props: AccordionProps): import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
declare function AccordionItem({ className, ...props }: React.ComponentProps<typeof AccordionPrimitive.Item>): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
declare function AccordionTrigger({ className, children, ...props }: React.ComponentProps<typeof AccordionPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
declare function AccordionContent({ className, children, ...props }: React.ComponentProps<typeof AccordionPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent };
|
|
32
|
+
//# sourceMappingURL=accordion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accordion.d.ts","sourceRoot":"","sources":["../../src/components/accordion.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,kBAAkB,MAAM,2BAA2B,CAAC;AAKhE,UAAU,kBAAkB;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,GAAG,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC;IACpB,WAAW,CAAC,EAAE,UAAU,GAAG,YAAY,CAAC;IACxC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,UAAU,oBAAqB,SAAQ,kBAAkB;IACvD,IAAI,EAAE,QAAQ,CAAC;IACf,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACzC;AAED,UAAU,sBAAuB,SAAQ,kBAAkB;IACzD,IAAI,EAAE,UAAU,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;CAC3C;AAED,MAAM,MAAM,cAAc,GAAG,oBAAoB,GAAG,sBAAsB,CAAC;AAE3E,iBAAS,SAAS,CAAC,KAAK,EAAE,cAAc,2CAoDvC;AAED,iBAAS,aAAa,CAAC,EACrB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,kBAAkB,CAAC,IAAI,CAAC,2CAQtD;AAED,iBAAS,gBAAgB,CAAC,EACxB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,kBAAkB,CAAC,OAAO,CAAC,2CAgBzD;AAED,iBAAS,gBAAgB,CAAC,EACxB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,kBAAkB,CAAC,OAAO,CAAC,2CAUzD;AAED,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { jsx as t, jsxs as m } from "react/jsx-runtime";
|
|
2
|
+
import * as o from "@radix-ui/react-accordion";
|
|
3
|
+
import { ChevronDownIcon as f } from "lucide-react";
|
|
4
|
+
import { cn as i } from "@brightlocal/ui-components/lib/utils";
|
|
5
|
+
function v(e) {
|
|
6
|
+
const {
|
|
7
|
+
dataHook: a,
|
|
8
|
+
trackingEl: n,
|
|
9
|
+
trackingLabel: l,
|
|
10
|
+
disabled: r,
|
|
11
|
+
dir: d,
|
|
12
|
+
orientation: c,
|
|
13
|
+
className: s,
|
|
14
|
+
children: u
|
|
15
|
+
} = e;
|
|
16
|
+
return e.type === "single" ? /* @__PURE__ */ t(
|
|
17
|
+
o.Root,
|
|
18
|
+
{
|
|
19
|
+
className: s,
|
|
20
|
+
collapsible: e.collapsible,
|
|
21
|
+
"data-hook": a,
|
|
22
|
+
"data-slot": "accordion",
|
|
23
|
+
"data-tracking-el": n,
|
|
24
|
+
"data-tracking-label": l,
|
|
25
|
+
defaultValue: e.defaultValue,
|
|
26
|
+
dir: d,
|
|
27
|
+
disabled: r,
|
|
28
|
+
orientation: c,
|
|
29
|
+
type: "single",
|
|
30
|
+
value: e.value,
|
|
31
|
+
onValueChange: e.onValueChange,
|
|
32
|
+
children: u
|
|
33
|
+
}
|
|
34
|
+
) : /* @__PURE__ */ t(
|
|
35
|
+
o.Root,
|
|
36
|
+
{
|
|
37
|
+
className: s,
|
|
38
|
+
"data-hook": a,
|
|
39
|
+
"data-slot": "accordion",
|
|
40
|
+
"data-tracking-el": n,
|
|
41
|
+
"data-tracking-label": l,
|
|
42
|
+
defaultValue: e.defaultValue,
|
|
43
|
+
dir: d,
|
|
44
|
+
disabled: r,
|
|
45
|
+
orientation: c,
|
|
46
|
+
type: "multiple",
|
|
47
|
+
value: e.value,
|
|
48
|
+
onValueChange: e.onValueChange,
|
|
49
|
+
children: u
|
|
50
|
+
}
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
function k({
|
|
54
|
+
className: e,
|
|
55
|
+
...a
|
|
56
|
+
}) {
|
|
57
|
+
return /* @__PURE__ */ t(
|
|
58
|
+
o.Item,
|
|
59
|
+
{
|
|
60
|
+
className: i("border-b last:border-b-0", e),
|
|
61
|
+
"data-slot": "accordion-item",
|
|
62
|
+
...a
|
|
63
|
+
}
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
function x({
|
|
67
|
+
className: e,
|
|
68
|
+
children: a,
|
|
69
|
+
...n
|
|
70
|
+
}) {
|
|
71
|
+
return /* @__PURE__ */ t(o.Header, { className: "flex", children: /* @__PURE__ */ m(
|
|
72
|
+
o.Trigger,
|
|
73
|
+
{
|
|
74
|
+
className: i(
|
|
75
|
+
"focus-visible:border-ring focus-visible:shadow-default flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",
|
|
76
|
+
e
|
|
77
|
+
),
|
|
78
|
+
"data-slot": "accordion-trigger",
|
|
79
|
+
...n,
|
|
80
|
+
children: [
|
|
81
|
+
a,
|
|
82
|
+
/* @__PURE__ */ t(f, { className: "text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200" })
|
|
83
|
+
]
|
|
84
|
+
}
|
|
85
|
+
) });
|
|
86
|
+
}
|
|
87
|
+
function V({
|
|
88
|
+
className: e,
|
|
89
|
+
children: a,
|
|
90
|
+
...n
|
|
91
|
+
}) {
|
|
92
|
+
return /* @__PURE__ */ t(
|
|
93
|
+
o.Content,
|
|
94
|
+
{
|
|
95
|
+
className: "data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm",
|
|
96
|
+
"data-slot": "accordion-content",
|
|
97
|
+
...n,
|
|
98
|
+
children: /* @__PURE__ */ t("div", { className: i("pt-0 pb-4", e), children: a })
|
|
99
|
+
}
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
export {
|
|
103
|
+
v as Accordion,
|
|
104
|
+
V as AccordionContent,
|
|
105
|
+
k as AccordionItem,
|
|
106
|
+
x as AccordionTrigger
|
|
107
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),d=require("@radix-ui/react-alert-dialog"),o=require("@brightlocal/ui-components/lib/utils"),i=require("@brightlocal/ui-components/button");function g(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:()=>t[r]})}}return e.default=t,Object.freeze(e)}const l=g(d);function u({...t}){return a.jsx(l.Root,{"data-slot":"alert-dialog",...t})}function f({...t}){return a.jsx(l.Trigger,{"data-slot":"alert-dialog-trigger",...t})}function s({...t}){return a.jsx(l.Portal,{"data-slot":"alert-dialog-portal",...t})}function c({className:t,...e}){return a.jsx(l.Overlay,{className:o.cn("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),"data-slot":"alert-dialog-overlay",...e})}function m({className:t,...e}){return a.jsxs(s,{children:[a.jsx(c,{}),a.jsx(l.Content,{className:o.cn("border-border bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",t),"data-slot":"alert-dialog-content",...e})]})}function x({className:t,...e}){return a.jsx("div",{className:o.cn("flex flex-col gap-2 text-center sm:text-left",t),"data-slot":"alert-dialog-header",...e})}function D({className:t,...e}){return a.jsx("div",{className:o.cn("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),"data-slot":"alert-dialog-footer",...e})}function A({className:t,...e}){return a.jsx(l.Title,{className:o.cn("text-lg font-semibold",t),"data-slot":"alert-dialog-title",...e})}function p({className:t,...e}){return a.jsx(l.Description,{className:o.cn("text-muted-foreground text-sm",t),"data-slot":"alert-dialog-description",...e})}function j({className:t,...e}){return a.jsx(l.Action,{className:o.cn(i.ButtonVariants(),t),...e})}function b({className:t,...e}){return a.jsx(l.Cancel,{className:o.cn(i.ButtonVariants({variant:"outline"}),t),...e})}exports.AlertDialog=u;exports.AlertDialogAction=j;exports.AlertDialogCancel=b;exports.AlertDialogContent=m;exports.AlertDialogDescription=p;exports.AlertDialogFooter=D;exports.AlertDialogHeader=x;exports.AlertDialogOverlay=c;exports.AlertDialogPortal=s;exports.AlertDialogTitle=A;exports.AlertDialogTrigger=f;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
|
|
3
|
+
declare function AlertDialog({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function AlertDialogTrigger({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function AlertDialogPortal({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Portal>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare function AlertDialogOverlay({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Overlay>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare function AlertDialogContent({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare function AlertDialogHeader({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare function AlertDialogFooter({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
declare function AlertDialogTitle({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Title>): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
declare function AlertDialogDescription({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Description>): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
declare function AlertDialogAction({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Action>): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
declare function AlertDialogCancel({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Cancel>): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export { AlertDialog, AlertDialogPortal, AlertDialogOverlay, AlertDialogTrigger, AlertDialogContent, AlertDialogHeader, AlertDialogFooter, AlertDialogTitle, AlertDialogDescription, AlertDialogAction, AlertDialogCancel, };
|
|
15
|
+
//# sourceMappingURL=alert-dialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alert-dialog.d.ts","sourceRoot":"","sources":["../../src/components/alert-dialog.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,oBAAoB,MAAM,8BAA8B,CAAC;AAKrE,iBAAS,WAAW,CAAC,EACnB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,IAAI,CAAC,2CAExD;AAED,iBAAS,kBAAkB,CAAC,EAC1B,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,OAAO,CAAC,2CAI3D;AAED,iBAAS,iBAAiB,CAAC,EACzB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,MAAM,CAAC,2CAI1D;AAED,iBAAS,kBAAkB,CAAC,EAC1B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,OAAO,CAAC,2CAW3D;AAED,iBAAS,kBAAkB,CAAC,EAC1B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,OAAO,CAAC,2CAc3D;AAED,iBAAS,iBAAiB,CAAC,EACzB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAQ7B;AAED,iBAAS,iBAAiB,CAAC,EACzB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAW7B;AAED,iBAAS,gBAAgB,CAAC,EACxB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,KAAK,CAAC,2CAQzD;AAED,iBAAS,sBAAsB,CAAC,EAC9B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,WAAW,CAAC,2CAQ/D;AAED,iBAAS,iBAAiB,CAAC,EACzB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,MAAM,CAAC,2CAO1D;AAED,iBAAS,iBAAiB,CAAC,EACzB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,MAAM,CAAC,2CAO1D;AAED,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,sBAAsB,EACtB,iBAAiB,EACjB,iBAAiB,GAClB,CAAC"}
|