@forgedevstack/bear 1.3.3 → 1.3.4
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/README.md +145 -292
- package/dist/components/AlertDialog/AlertDialog.cjs +1 -1
- package/dist/components/AlertDialog/AlertDialog.js +67 -84
- package/dist/components/BottomSheet/BottomSheet.cjs +1 -1
- package/dist/components/BottomSheet/BottomSheet.js +72 -64
- package/dist/components/ChipGroup/ChipGroup.cjs +1 -1
- package/dist/components/ChipGroup/ChipGroup.const.cjs +1 -1
- package/dist/components/ChipGroup/ChipGroup.const.d.ts +2 -0
- package/dist/components/ChipGroup/ChipGroup.const.js +6 -4
- package/dist/components/ChipGroup/ChipGroup.js +52 -48
- package/dist/components/CommandPalette/CommandItem.cjs +1 -0
- package/dist/components/CommandPalette/CommandItem.d.ts +6 -0
- package/dist/components/CommandPalette/CommandItem.js +39 -0
- package/dist/components/CommandPalette/CommandPalette.cjs +1 -1
- package/dist/components/CommandPalette/CommandPalette.js +129 -144
- package/dist/components/Drawer/Drawer.cjs +1 -1
- package/dist/components/Drawer/Drawer.js +72 -66
- package/dist/components/EmptyState/EmptyState.cjs +1 -1
- package/dist/components/EmptyState/EmptyState.const.cjs +1 -1
- package/dist/components/EmptyState/EmptyState.const.d.ts +5 -0
- package/dist/components/EmptyState/EmptyState.const.js +30 -15
- package/dist/components/EmptyState/EmptyState.js +35 -35
- package/dist/components/EmptyState/EmptyState.types.d.ts +2 -2
- package/dist/components/HoverCard/HoverCard.cjs +4 -3
- package/dist/components/HoverCard/HoverCard.const.cjs +1 -0
- package/dist/components/HoverCard/HoverCard.const.d.ts +1 -0
- package/dist/components/HoverCard/HoverCard.const.js +10 -0
- package/dist/components/HoverCard/HoverCard.js +62 -56
- package/dist/components/HoverCard/HoverCard.types.d.ts +7 -0
- package/dist/components/Menu/Menu.cjs +1 -1
- package/dist/components/Menu/Menu.const.cjs +1 -0
- package/dist/components/Menu/Menu.const.d.ts +2 -0
- package/dist/components/Menu/Menu.const.js +12 -0
- package/dist/components/Menu/Menu.d.ts +3 -9
- package/dist/components/Menu/Menu.js +57 -89
- package/dist/components/Menu/Menu.types.d.ts +8 -1
- package/dist/components/Menu/MenuDivider.cjs +1 -0
- package/dist/components/Menu/MenuDivider.d.ts +6 -0
- package/dist/components/Menu/MenuDivider.js +7 -0
- package/dist/components/Menu/MenuItem.cjs +1 -0
- package/dist/components/Menu/MenuItem.d.ts +6 -0
- package/dist/components/Menu/MenuItem.js +46 -0
- package/dist/components/Modal/Modal.cjs +1 -1
- package/dist/components/Modal/Modal.const.cjs +1 -1
- package/dist/components/Modal/Modal.const.d.ts +1 -0
- package/dist/components/Modal/Modal.const.js +20 -12
- package/dist/components/Modal/Modal.js +62 -59
- package/dist/components/Modal/Modal.types.d.ts +7 -0
- package/dist/components/Popover/Popover.cjs +1 -1
- package/dist/components/Popover/Popover.const.cjs +1 -0
- package/dist/components/Popover/Popover.const.d.ts +15 -1
- package/dist/components/Popover/Popover.const.js +29 -0
- package/dist/components/Popover/Popover.js +77 -73
- package/dist/components/Popover/Popover.types.d.ts +7 -0
- package/dist/components/Select/Select.cjs +1 -1
- package/dist/components/Select/Select.const.cjs +1 -1
- package/dist/components/Select/Select.const.d.ts +1 -0
- package/dist/components/Select/Select.const.js +7 -6
- package/dist/components/Select/Select.js +101 -96
- package/dist/components/Toast/Toast.cjs +1 -1
- package/dist/components/Toast/Toast.const.cjs +1 -1
- package/dist/components/Toast/Toast.const.d.ts +2 -0
- package/dist/components/Toast/Toast.const.js +11 -8
- package/dist/components/Toast/Toast.context.cjs +1 -0
- package/dist/components/Toast/Toast.context.d.ts +3 -0
- package/dist/components/Toast/Toast.context.js +11 -0
- package/dist/components/Toast/Toast.d.ts +4 -3
- package/dist/components/Toast/Toast.icons.cjs +1 -0
- package/dist/components/Toast/Toast.icons.d.ts +4 -0
- package/dist/components/Toast/Toast.icons.js +29 -0
- package/dist/components/Toast/Toast.js +32 -160
- package/dist/components/Toast/ToastContainer.cjs +1 -0
- package/dist/components/Toast/ToastContainer.d.ts +3 -0
- package/dist/components/Toast/ToastContainer.js +39 -0
- package/dist/components/Toast/ToastItem.cjs +1 -0
- package/dist/components/Toast/ToastItem.d.ts +5 -0
- package/dist/components/Toast/ToastItem.js +86 -0
- package/dist/components/ToggleGroup/ToggleGroup.cjs +1 -0
- package/dist/components/ToggleGroup/ToggleGroup.const.cjs +1 -0
- package/dist/components/ToggleGroup/ToggleGroup.const.d.ts +15 -0
- package/dist/components/ToggleGroup/ToggleGroup.const.js +33 -0
- package/dist/components/ToggleGroup/ToggleGroup.context.cjs +1 -0
- package/dist/components/ToggleGroup/ToggleGroup.context.d.ts +2 -0
- package/dist/components/ToggleGroup/ToggleGroup.context.js +5 -0
- package/dist/components/ToggleGroup/ToggleGroup.d.ts +2 -0
- package/dist/components/ToggleGroup/ToggleGroup.js +86 -0
- package/dist/components/ToggleGroup/ToggleGroup.types.d.ts +48 -0
- package/dist/components/ToggleGroup/ToggleGroupItem.cjs +1 -0
- package/dist/components/ToggleGroup/ToggleGroupItem.d.ts +2 -0
- package/dist/components/ToggleGroup/ToggleGroupItem.js +50 -0
- package/dist/components/ToggleGroup/hooks/useToggleGroupContext.cjs +1 -0
- package/dist/components/ToggleGroup/hooks/useToggleGroupContext.d.ts +1 -0
- package/dist/components/ToggleGroup/hooks/useToggleGroupContext.js +6 -0
- package/dist/components/ToggleGroup/index.d.ts +4 -0
- package/dist/components/Tooltip/Tooltip.cjs +1 -1
- package/dist/components/Tooltip/Tooltip.const.cjs +1 -0
- package/dist/components/Tooltip/Tooltip.const.d.ts +8 -0
- package/dist/components/Tooltip/Tooltip.const.js +18 -0
- package/dist/components/Tooltip/Tooltip.js +59 -61
- package/dist/components/Tooltip/Tooltip.types.d.ts +7 -0
- package/dist/components/index.cjs +1 -1
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +428 -418
- package/dist/constants/numbers.const.cjs +1 -1
- package/dist/constants/numbers.const.d.ts +3 -0
- package/dist/constants/numbers.const.js +37 -34
- package/dist/hooks/index.cjs +1 -1
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.js +6 -4
- package/dist/hooks/useFocusTrap/index.d.ts +2 -0
- package/dist/hooks/useFocusTrap/useFocusTrap.cjs +1 -0
- package/dist/hooks/useFocusTrap/useFocusTrap.d.ts +3 -0
- package/dist/hooks/useFocusTrap/useFocusTrap.js +41 -0
- package/dist/hooks/useFocusTrap/useFocusTrap.types.d.ts +8 -0
- package/dist/hooks/useFocusTrap/useFocusTrap.utils.cjs +1 -0
- package/dist/hooks/useFocusTrap/useFocusTrap.utils.d.ts +1 -0
- package/dist/hooks/useFocusTrap/useFocusTrap.utils.js +23 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +575 -563
- package/dist/styles.css +52 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,357 +1,210 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="portal/public/bear-icon.svg" width="100" height="110" alt="Bear UI Mascot - Lotso Bear" />
|
|
3
|
+
</p>
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
<h1 align="center">@forgedevstack/bear</h1>
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
<p align="center">
|
|
8
|
+
<strong>The Foundation for your React UI.</strong><br />
|
|
9
|
+
190+ accessible, customizable React components with TypeScript, AeroCraft CSS tokens, responsive hooks, and signature Lotso bear aesthetics.
|
|
10
|
+
</p>
|
|
6
11
|
|
|
7
|
-
|
|
12
|
+
<p align="center">
|
|
13
|
+
<a href="https://www.npmjs.com/package/@forgedevstack/bear"><img src="https://img.shields.io/npm/v/@forgedevstack/bear.svg?color=db2777" alt="npm version" /></a>
|
|
14
|
+
<a href="https://github.com/yaghobieh/bear/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="License: MIT" /></a>
|
|
15
|
+
<img src="https://img.shields.io/badge/components-190+-db2777.svg" alt="Components: 190+" />
|
|
16
|
+
<img src="https://img.shields.io/badge/icons-550+-purple.svg" alt="Icons: 550+" />
|
|
17
|
+
<img src="https://img.shields.io/badge/hooks-25+-blue.svg" alt="Hooks: 25+" />
|
|
18
|
+
<img src="https://img.shields.io/badge/TypeScript-Strict-3178c6.svg" alt="TypeScript Strict" />
|
|
19
|
+
<a href="https://bearui.com"><img src="https://img.shields.io/badge/docs-bearui.com-db2777.svg" alt="Docs Portal" /></a>
|
|
20
|
+
</p>
|
|
8
21
|
|
|
9
|
-
|
|
22
|
+
---
|
|
10
23
|
|
|
11
|
-
|
|
24
|
+
## 🌟 Highlights & What's New in v1.3.4
|
|
12
25
|
|
|
13
|
-
|
|
26
|
+
- 🔘 **ToggleGroup & ToggleGroupItem**: Modern segmented controls supporting single (`type="single"`) and multiple (`type="multiple"`) selections with full WAI-ARIA roving tabindex keyboard navigation.
|
|
27
|
+
- 🎯 **Standardized `useFocusTrap`**: Centralized, robust focus trap & focus restore across all overlay components (`Modal`, `Drawer`, `AlertDialog`, `CommandPalette`, `BottomSheet`).
|
|
28
|
+
- 🎬 **Overlay Motion Parity**: Unified `openEffect`, `closeEffect`, and compound `effect={{ open, close }}` across `Modal`, `Menu`, `Popover`, `Tooltip`, and `HoverCard`.
|
|
29
|
+
- 📐 **Density Parity**: First-class support for `compact`, `normal`, and `comfortable` densities across `Select`, `ChipGroup`, and `AppBar`.
|
|
30
|
+
- 🐻 **Lotso Bear Visual Identity**: High-fidelity mascot vectors, dark/light theme integration, and brand new `@bear-icons` (`BearIcon`, `LotsoIcon`, `BearFaceIcon`, `PawIcon`).
|
|
31
|
+
- 🤖 **AI Chat Primitives**: Complete streaming chat suite including `PromptComposer`, `StreamingMessage`, `ThinkingBlock`, `PromptSuggestions`, `ToolCall`, and `ContextMeter`.
|
|
14
32
|
|
|
15
|
-
|
|
16
|
-
# Install browsers once (required — missing Chromium yields 0 passes)
|
|
17
|
-
cd portal && npx playwright install chromium
|
|
18
|
-
|
|
19
|
-
# Critical-path smoke (recommended before release)
|
|
20
|
-
cd portal && npm run test:e2e:smoke
|
|
21
|
-
|
|
22
|
-
# Full portal suite
|
|
23
|
-
cd portal && npm run test:e2e
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
`BEAR_E2E_SMOKE=1` runs `e2e/specs/smoke.spec.ts` only (includes RTL direction + Toast aria-live checks). The e2e webServer builds Bear, then starts the portal on port `5174`.
|
|
27
|
-
|
|
28
|
-
### Auto DOM ids
|
|
29
|
-
|
|
30
|
-
Public components generate root `id` values as `Bear-{Component}-{alphanumeric}` (e.g. `Bear-Button-a48293100123`). Pass `id` to override; keep `testId` on `data-testid`.
|
|
33
|
+
---
|
|
31
34
|
|
|
32
|
-
##
|
|
33
|
-
|
|
34
|
-
- **Tailwind-Powered**: Built with Tailwind CSS, zero config required
|
|
35
|
-
- **React 18+**: Works with React 18 and above
|
|
36
|
-
- **TypeScript**: Full type safety with comprehensive TypeScript definitions
|
|
37
|
-
- **Comprehensive Component Library**: 50+ production-ready components
|
|
38
|
-
- **Accessible**: ARIA attributes and keyboard navigation support
|
|
39
|
-
- **Customizable**: Flexible theming and styling options
|
|
40
|
-
- **Tree-Shakeable**: Import only what you need
|
|
41
|
-
- **Zero Config**: Works out of the box with minimal setup
|
|
42
|
-
|
|
43
|
-
## Installation
|
|
44
|
-
|
|
45
|
-
Bear installs `@forgedevstack/bear-icons` as an **optional dependency**. The default install includes components, theme, and icons.
|
|
35
|
+
## 📦 Installation
|
|
46
36
|
|
|
47
37
|
```bash
|
|
38
|
+
# Recommended default installation (includes components, themes & icons)
|
|
48
39
|
npm install @forgedevstack/bear
|
|
49
|
-
|
|
40
|
+
|
|
41
|
+
# Or with your preferred package manager
|
|
50
42
|
pnpm add @forgedevstack/bear
|
|
51
|
-
# or
|
|
52
43
|
yarn add @forgedevstack/bear
|
|
44
|
+
bun add @forgedevstack/bear
|
|
53
45
|
```
|
|
54
46
|
|
|
55
|
-
###
|
|
56
|
-
|
|
57
|
-
npm has no `--no-icons` flag. Skip the icon package with `--omit=optional`:
|
|
47
|
+
### Quick Scaffolding with Forge CLI
|
|
58
48
|
|
|
59
49
|
```bash
|
|
60
|
-
|
|
61
|
-
# yarn
|
|
62
|
-
yarn add @forgedevstack/bear --ignore-optional
|
|
63
|
-
# pnpm
|
|
64
|
-
pnpm add @forgedevstack/bear --no-optional
|
|
50
|
+
npx @forgedevstack/bear init
|
|
65
51
|
```
|
|
66
52
|
|
|
67
|
-
|
|
53
|
+
### Lightweight Install (Without Icons)
|
|
68
54
|
|
|
69
|
-
|
|
55
|
+
If you only need core components and wish to omit the icon library, pass the optional omission flag:
|
|
70
56
|
|
|
71
57
|
```bash
|
|
72
|
-
npm
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
```tsx
|
|
76
|
-
import { SearchIcon, BearIcons } from '@forgedevstack/bear-icons';
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
### Import CSS (Required)
|
|
58
|
+
# npm
|
|
59
|
+
npm install @forgedevstack/bear --omit=optional
|
|
80
60
|
|
|
81
|
-
|
|
61
|
+
# pnpm
|
|
62
|
+
pnpm add @forgedevstack/bear --no-optional
|
|
82
63
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
import '@forgedevstack/bear/styles.css';
|
|
64
|
+
# yarn
|
|
65
|
+
yarn add @forgedevstack/bear --ignore-optional
|
|
86
66
|
```
|
|
87
67
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
```tsx
|
|
91
|
-
import { Button, Card, CardHeader, CardBody } from '@forgedevstack/bear';
|
|
68
|
+
### Standalone Icons
|
|
92
69
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
<Card>
|
|
96
|
-
<CardHeader>
|
|
97
|
-
<h2>Welcome to Bear</h2>
|
|
98
|
-
</CardHeader>
|
|
99
|
-
<CardBody>
|
|
100
|
-
<Button variant="primary">Get Started</Button>
|
|
101
|
-
</CardBody>
|
|
102
|
-
</Card>
|
|
103
|
-
);
|
|
104
|
-
}
|
|
70
|
+
```bash
|
|
71
|
+
npm install @forgedevstack/bear-icons
|
|
105
72
|
```
|
|
106
73
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
### Layout Components
|
|
110
|
-
|
|
111
|
-
- `Container` - Responsive container with max-width constraints
|
|
112
|
-
- `Flex` - Flexible box layout component
|
|
113
|
-
- `Grid` / `GridItem` - CSS Grid layout system
|
|
114
|
-
- `ResizablePanel` - Two-pane resizable layout with draggable divider (horizontal/vertical)
|
|
115
|
-
|
|
116
|
-
### UI Components
|
|
117
|
-
|
|
118
|
-
- `Button` / `ButtonGroup` - Interactive button components
|
|
119
|
-
- `Card` - Container for content with header, body, and footer
|
|
120
|
-
- `Badge` - Status indicators and labels
|
|
121
|
-
- `Paper` - Elevated surface component
|
|
122
|
-
- `Divider` - Visual separator
|
|
123
|
-
- `Typography` - Text styling with gradient text and typewriter effect
|
|
124
|
-
- `Link` - Styled link component
|
|
125
|
-
|
|
126
|
-
### Form Components
|
|
127
|
-
|
|
128
|
-
- `Input` / `TextField` - Text input with optional `InputProps.startAdornment` / `endAdornment` for start/end slots
|
|
129
|
-
- `Select` / `MultiSelect` - Dropdown selection components
|
|
130
|
-
- `Checkbox` - Checkbox input
|
|
131
|
-
- `Radio` / `RadioGroup` - Radio button inputs
|
|
132
|
-
- `Switch` - Toggle switch
|
|
133
|
-
- `Autocomplete` - Autocomplete input
|
|
134
|
-
- `TransferList` - Transfer items between lists
|
|
135
|
-
- `FileUpload` - File upload component
|
|
136
|
-
- `NumberInput` - Numeric input with controls
|
|
137
|
-
- `OTPInput` - One-time password input
|
|
138
|
-
- `ColorPicker` - Color selection component
|
|
139
|
-
- `DatePicker` - Date selection component
|
|
140
|
-
- `TimePicker` - Time selection component
|
|
141
|
-
- `Slider` - Range slider input
|
|
142
|
-
|
|
143
|
-
### Feedback Components
|
|
144
|
-
|
|
145
|
-
- `Alert` - Alert messages
|
|
146
|
-
- `Spinner` - Loading spinner
|
|
147
|
-
- `Rating` - Star rating component
|
|
148
|
-
- `Progress` - Progress indicator
|
|
149
|
-
- `Skeleton` - Loading skeleton states
|
|
150
|
-
- `Toast` / `useToast` - Toast notifications
|
|
151
|
-
- `BearLoader` - Custom bear-themed loader
|
|
152
|
-
|
|
153
|
-
### Overlay Components
|
|
154
|
-
|
|
155
|
-
- `Modal` - Modal dialog
|
|
156
|
-
- `Drawer` - Slide-out drawer
|
|
157
|
-
- `Tooltip` - Tooltip component
|
|
158
|
-
- `Popover` - Popover component
|
|
159
|
-
- `Menu` / `MenuItem` - Context menu
|
|
160
|
-
- `Dropdown` - Dropdown menu
|
|
161
|
-
- `SpeedDial` - Floating action speed dial
|
|
162
|
-
|
|
163
|
-
### Data Display
|
|
164
|
-
|
|
165
|
-
- `DataTable` - Advanced data table with sorting, filtering, and pagination
|
|
166
|
-
- `Carousel` - Image/content carousel
|
|
167
|
-
- `Accordion` - Collapsible content sections
|
|
168
|
-
- `Tabs` / `TabList` / `Tab` / `TabPanel` - Tabbed interface; `TabList` supports `maxVisibleTabs` (overflow dropdown) and `wrap` (auto-break)
|
|
169
|
-
- `List` - List component with various item types
|
|
170
|
-
- `Avatar` / `AvatarGroup` - User avatar display
|
|
171
|
-
- `Chip` - Compact element for input, attribute, or action
|
|
172
|
-
- `TreeView` - Hierarchical tree structure
|
|
173
|
-
- `FileTree` - File/folder tree with selection and expand/collapse
|
|
174
|
-
- `Timeline` - Timeline component
|
|
175
|
-
- `Statistic` - Statistical display
|
|
176
|
-
- `EmptyState` - Empty state placeholder
|
|
177
|
-
- `Image` - Enhanced image component
|
|
178
|
-
|
|
179
|
-
### Navigation Components
|
|
180
|
-
|
|
181
|
-
- `Breadcrumbs` - Navigation breadcrumbs
|
|
182
|
-
- `Stepper` - Step-by-step navigation
|
|
183
|
-
- `BottomNavigation` - Bottom navigation bar
|
|
184
|
-
- `AppBar` - Application bar/header
|
|
185
|
-
- `Pagination` - Page navigation
|
|
186
|
-
|
|
187
|
-
### Utility Components
|
|
188
|
-
|
|
189
|
-
- `ScrollArea` - Custom scrollable area
|
|
190
|
-
- `Collapsible` - Collapsible content wrapper
|
|
191
|
-
- `Kbd` - Keyboard key display
|
|
192
|
-
- `CopyButton` - Copy to clipboard button
|
|
193
|
-
- `Icon` / `BearIcons` - Icon component library
|
|
194
|
-
- `BearLogo` - Bear logo component
|
|
195
|
-
|
|
196
|
-
## Examples
|
|
197
|
-
|
|
198
|
-
### Button
|
|
74
|
+
---
|
|
199
75
|
|
|
200
|
-
|
|
201
|
-
import { Button } from '@forgedevstack/bear';
|
|
202
|
-
|
|
203
|
-
<Button variant="primary">Primary</Button>
|
|
204
|
-
<Button variant="secondary">Secondary</Button>
|
|
205
|
-
<Button variant="outline">Outline</Button>
|
|
206
|
-
<Button variant="ghost">Ghost</Button>
|
|
207
|
-
|
|
208
|
-
// With icon (icon size matches text)
|
|
209
|
-
<Button variant="primary" leftIcon={<PlayIcon />}>View Demos</Button>
|
|
210
|
-
|
|
211
|
-
// Button label using Typography variant (h1, h2, body1, etc.)
|
|
212
|
-
<Button variant="primary" textVariant="subtitle1">Heading-style label</Button>
|
|
213
|
-
```
|
|
76
|
+
## 🚀 Quick Start
|
|
214
77
|
|
|
215
|
-
|
|
78
|
+
### 1. Import Compiled CSS
|
|
216
79
|
|
|
217
|
-
|
|
80
|
+
Include Bear's compiled stylesheet once in your application entry file (`main.tsx`, `App.tsx`, or `index.css`):
|
|
218
81
|
|
|
219
82
|
```tsx
|
|
220
|
-
import
|
|
221
|
-
|
|
222
|
-
<Card>
|
|
223
|
-
<CardHeader>Title</CardHeader>
|
|
224
|
-
<CardBody>Content goes here</CardBody>
|
|
225
|
-
<CardFooter>Footer content</CardFooter>
|
|
226
|
-
</Card>
|
|
83
|
+
import '@forgedevstack/bear/styles.css';
|
|
227
84
|
```
|
|
228
85
|
|
|
229
|
-
###
|
|
86
|
+
### 2. Wrap with BearProvider & Start Building
|
|
230
87
|
|
|
231
88
|
```tsx
|
|
232
|
-
import
|
|
89
|
+
import React, { useState } from 'react';
|
|
90
|
+
import {
|
|
91
|
+
BearProvider,
|
|
92
|
+
Button,
|
|
93
|
+
Card,
|
|
94
|
+
CardHeader,
|
|
95
|
+
CardBody,
|
|
96
|
+
ToggleGroup,
|
|
97
|
+
ToggleGroupItem,
|
|
98
|
+
Typography,
|
|
99
|
+
} from '@forgedevstack/bear';
|
|
100
|
+
|
|
101
|
+
export function App() {
|
|
102
|
+
const [alignment, setAlignment] = useState('center');
|
|
233
103
|
|
|
234
|
-
function LoginForm() {
|
|
235
104
|
return (
|
|
236
|
-
<
|
|
237
|
-
<
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
105
|
+
<BearProvider>
|
|
106
|
+
<Card className="max-w-md mx-auto p-6 shadow-xl">
|
|
107
|
+
<CardHeader>
|
|
108
|
+
<Typography variant="h4">Bear UI 1.3.4</Typography>
|
|
109
|
+
</CardHeader>
|
|
110
|
+
<CardBody className="space-y-4">
|
|
111
|
+
<Typography variant="body1">
|
|
112
|
+
Choose your layout alignment:
|
|
113
|
+
</Typography>
|
|
114
|
+
|
|
115
|
+
<ToggleGroup
|
|
116
|
+
type="single"
|
|
117
|
+
value={alignment}
|
|
118
|
+
onValueChange={(val) => val && setAlignment(val)}
|
|
119
|
+
>
|
|
120
|
+
<ToggleGroupItem value="left">Left</ToggleGroupItem>
|
|
121
|
+
<ToggleGroupItem value="center">Center</ToggleGroupItem>
|
|
122
|
+
<ToggleGroupItem value="right">Right</ToggleGroupItem>
|
|
123
|
+
</ToggleGroup>
|
|
124
|
+
|
|
125
|
+
<Button variant="primary" fullWidth>
|
|
126
|
+
Confirm Selection ({alignment})
|
|
127
|
+
</Button>
|
|
128
|
+
</CardBody>
|
|
129
|
+
</Card>
|
|
130
|
+
</BearProvider>
|
|
249
131
|
);
|
|
250
132
|
}
|
|
251
133
|
```
|
|
252
134
|
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
```tsx
|
|
256
|
-
import { DataTable, createColumns } from '@forgedevstack/bear';
|
|
257
|
-
|
|
258
|
-
interface User {
|
|
259
|
-
id: number;
|
|
260
|
-
name: string;
|
|
261
|
-
email: string;
|
|
262
|
-
role: string;
|
|
263
|
-
}
|
|
135
|
+
---
|
|
264
136
|
|
|
265
|
-
|
|
266
|
-
{ key: 'name', header: 'Name' },
|
|
267
|
-
{ key: 'email', header: 'Email' },
|
|
268
|
-
{ key: 'role', header: 'Role' },
|
|
269
|
-
]);
|
|
137
|
+
## 🎨 Theming & Lotso Color Palette
|
|
270
138
|
|
|
271
|
-
|
|
272
|
-
{ id: 1, name: 'John Doe', email: 'john@example.com', role: 'admin' },
|
|
273
|
-
{ id: 2, name: 'Jane Smith', email: 'jane@example.com', role: 'user' },
|
|
274
|
-
];
|
|
139
|
+
Bear UI features a built-in strawberry magenta theme inspired by Lotso Bear, with deep contrast and native dark mode support.
|
|
275
140
|
|
|
276
|
-
|
|
141
|
+
```tsx
|
|
142
|
+
import { BearProvider } from '@forgedevstack/bear';
|
|
143
|
+
|
|
144
|
+
<BearProvider
|
|
145
|
+
colorScheme="system" // 'light' | 'dark' | 'system'
|
|
146
|
+
theme={{
|
|
147
|
+
colors: {
|
|
148
|
+
primary: '#db2777', // Lotso Magenta
|
|
149
|
+
accent: '#fed7aa', // Strawberry Cream
|
|
150
|
+
},
|
|
151
|
+
}}
|
|
152
|
+
>
|
|
153
|
+
<App />
|
|
154
|
+
</BearProvider>
|
|
277
155
|
```
|
|
278
156
|
|
|
279
|
-
|
|
157
|
+
---
|
|
280
158
|
|
|
281
|
-
|
|
282
|
-
import { ToastProvider, useToast, Button } from '@forgedevstack/bear';
|
|
159
|
+
## 🧩 Component Suite (190+ Primitives)
|
|
283
160
|
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
161
|
+
| Category | Key Components |
|
|
162
|
+
|---|---|
|
|
163
|
+
| **Buttons & Action** | `Button`, `ButtonGroup`, `ToggleButton`, `ToggleGroup`, `FAB`, `SpeedDial`, `CopyButton`, `CloseButton`, `SplitButton`, `ActionIcon` |
|
|
164
|
+
| **Forms & Input** | `Input`, `Select`, `MultiSelect`, `Autocomplete`, `Checkbox`, `Radio`, `Switch`, `Slider`, `TransferList`, `OTPInput`, `DatePicker`, `TimePicker`, `ColorPicker` |
|
|
165
|
+
| **AI & Conversational** | `PromptComposer`, `StreamingMessage`, `ThinkingBlock`, `PromptSuggestions`, `MessageActions`, `ChatError`, `ToolCall`, `CitationList`, `ApprovalCard`, `ContextMeter` |
|
|
166
|
+
| **Layout & Grid** | `Container`, `Flex`, `Grid`, `Paper`, `Divider`, `ResizablePanel`, `ScrollArea`, `Masonry`, `Dock` |
|
|
167
|
+
| **Overlays & Dialogs** | `Modal`, `Drawer`, `AlertDialog`, `Popover`, `Tooltip`, `HoverCard`, `Menu`, `Dropdown`, `BottomSheet`, `CommandPalette` |
|
|
168
|
+
| **Data Display** | `DataTable`, `Chart` (Bar/Line/Pie/Radar/Funnel), `Kanban`, `TreeSelect`, `Calendar`, `Timeline`, `DiffViewer`, `JsonViewer`, `CodeEditor` |
|
|
169
|
+
| **Feedback & Status** | `Alert`, `Toast`, `BearLoader`, `Spinner`, `Progress`, `Skeleton`, `EmptyState`, `Badge`, `Rating` |
|
|
291
170
|
|
|
292
|
-
|
|
293
|
-
const toast = useToast();
|
|
294
|
-
|
|
295
|
-
return (
|
|
296
|
-
<Button onClick={() => toast.success('Operation successful!')}>
|
|
297
|
-
Show Toast
|
|
298
|
-
</Button>
|
|
299
|
-
);
|
|
300
|
-
}
|
|
301
|
-
```
|
|
171
|
+
---
|
|
302
172
|
|
|
303
|
-
##
|
|
173
|
+
## ⚡ Performance & Comparison
|
|
304
174
|
|
|
305
|
-
|
|
175
|
+
| Feature | Bear UI | Material UI | Shadcn / Radix | Chakra UI |
|
|
176
|
+
|---|---|---|---|---|
|
|
177
|
+
| **Bundle Size (tree-shaken)** | **~18 kB** | ~85 kB | Modular | ~45 kB |
|
|
178
|
+
| **Component Count** | **190+** | ~60 | ~45 | ~35 |
|
|
179
|
+
| **Included Icons** | **550+** | Addon | Addon (Lucide) | Addon |
|
|
180
|
+
| **AI Chat Primitives** | **Built-in** | No | Community | No |
|
|
181
|
+
| **Zero Runtime CSS-in-JS** | **Yes (AeroCraft)**| No (Emotion) | Yes (Tailwind) | No (Emotion) |
|
|
182
|
+
| **Density Parity** | **Compact / Normal / Comfortable** | Limited | Manual | Limited |
|
|
183
|
+
| **TypeScript Strict** | **100%** | 100% | 100% | 100% |
|
|
306
184
|
|
|
307
|
-
|
|
308
|
-
// tailwind.config.js
|
|
309
|
-
module.exports = {
|
|
310
|
-
theme: {
|
|
311
|
-
extend: {
|
|
312
|
-
colors: {
|
|
313
|
-
// Your custom colors
|
|
314
|
-
},
|
|
315
|
-
},
|
|
316
|
-
},
|
|
317
|
-
}
|
|
318
|
-
```
|
|
185
|
+
---
|
|
319
186
|
|
|
320
|
-
##
|
|
187
|
+
## 🛠️ Testing & Verification
|
|
321
188
|
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
import { Button, ButtonProps } from '@forgedevstack/bear';
|
|
189
|
+
```bash
|
|
190
|
+
# Run unit & component build
|
|
191
|
+
npm run build
|
|
326
192
|
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
size: 'md',
|
|
330
|
-
children: 'Click me',
|
|
331
|
-
};
|
|
193
|
+
# Portal E2E Smoke Tests
|
|
194
|
+
cd portal && npm run test:e2e:smoke
|
|
332
195
|
|
|
333
|
-
|
|
196
|
+
# Full Playwright Suite
|
|
197
|
+
cd portal && npm run test:e2e
|
|
334
198
|
```
|
|
335
199
|
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
| Feature | Bear UI | Material UI | Ant Design | Chakra UI |
|
|
339
|
-
|---------|---------|-----|------------|-----------|
|
|
340
|
-
| **Tailwind CSS native** | Yes | No | No | Partial (v3) |
|
|
341
|
-
| **Bundle (tree-shaken)** | ~18 kB | ~80 kB | ~120 kB | ~45 kB |
|
|
342
|
-
| **Dark mode** | `dark:` variants, zero JS | Runtime theme swap | CSS vars + config | ColorMode context |
|
|
343
|
-
| **TypeScript** | 100 % | 100 % | 100 % | 100 % |
|
|
344
|
-
| **Components** | 60+ | 50+ | 60+ | 30+ |
|
|
345
|
-
| **Theming** | BearProvider + Tailwind | Emotion/styled | Less/CSS vars | Styled System |
|
|
346
|
-
| **Modular CSS** | `@BearInclude` PostCSS | N/A | N/A | N/A |
|
|
347
|
-
| **React 18 / 19** | Yes | Yes | Yes | Yes |
|
|
348
|
-
| **Zero runtime CSS-in-JS** | Yes | No (Emotion) | No (Less) | No (Emotion) |
|
|
349
|
-
| **Built-in i18n** | Portal (en/es) | X (add-on) | ConfigProvider | N/A |
|
|
200
|
+
---
|
|
350
201
|
|
|
351
|
-
## Contributing
|
|
202
|
+
## 🤝 Community & Contributing
|
|
352
203
|
|
|
353
|
-
|
|
204
|
+
- **Live Documentation**: [https://bearui.com](https://bearui.com)
|
|
205
|
+
- **Storybook**: Run `npm run storybook` in `/portal` or explore [bearui.com/storybook](https://bearui.com/storybook/)
|
|
206
|
+
- **Contributing**: Please read [CONTRIBUTING.md](./CONTRIBUTING.md) before opening pull requests.
|
|
354
207
|
|
|
355
|
-
## License
|
|
208
|
+
## 📄 License
|
|
356
209
|
|
|
357
|
-
MIT
|
|
210
|
+
Bear UI is open-source software licensed under the [MIT License](./LICENSE). Built with 💖 by John Yaghobieh & the ForgeStack Team.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),l=require("react"),j=require("react-dom"),r=require("../../constants/generals.const.cjs"),s=require("../../utils/cn.cjs"),D=require("../../hooks/useFocusTrap/useFocusTrap.cjs"),g=require("../Button/Button.cjs"),m=require("../Typography/Typography.cjs"),L=x=>{const{isOpen:a,onClose:n,onConfirm:f,title:_,description:o,confirmText:y=r.LABEL_CONFIRM,cancelText:p=r.LABEL_CANCEL,confirmVariant:A=r.VARIANT_DANGER,loading:t=r.BOOLEAN_FALSE,loadingText:E,closeOnBackdrop:h=r.BOOLEAN_FALSE,closeOnEscape:v=r.BOOLEAN_TRUE,icon:i,className:B,testId:N}=x,c=l.useId(),d=`${r.ALERT_TITLE_ID_PREFIX}${c}`,b=`${r.ALERT_DESC_ID_PREFIX}${c}`,u=l.useRef(null);if(D.useFocusTrap(u,{enabled:a,onEscape:v&&!t?n:void 0}),l.useEffect(()=>(a&&(document.body.style.overflow="hidden"),()=>{document.body.style.overflow=""}),[a]),!a)return null;const T=e.jsxs("div",{className:"Bear-AlertDialog bear-fixed bear-inset-0 bear-z-50 bear-flex bear-items-center bear-justify-center bear-p-4","data-testid":N,children:[e.jsx("div",{className:"Bear-AlertDialog__backdrop bear-absolute bear-inset-0 bear-bg-black/60 bear-backdrop-blur-sm bear-transition-opacity animate-fade-in",onClick:h&&!t?n:void 0,"aria-hidden":"true"}),e.jsxs("div",{ref:u,role:"alertdialog","aria-modal":"true","aria-labelledby":d,"aria-describedby":o?b:void 0,tabIndex:-1,className:s.cn("Bear-AlertDialog__container bear-relative bear-w-full bear-max-w-md bear-bg-white dark:bear-bg-zinc-900 bear-rounded-xl bear-shadow-2xl bear-border bear-border-gray-200 dark:bear-border-zinc-700 bear-transform bear-transition-all animate-alert-dialog-in bear-p-6",B),children:[i&&e.jsx("div",{className:"Bear-AlertDialog__icon bear-mb-4 bear-flex bear-justify-center",children:i}),e.jsx(m.Typography,{variant:"h6",id:d,className:s.cn("Bear-AlertDialog__title bear-text-lg bear-font-semibold bear-text-gray-900 dark:bear-text-white",i&&"bear-text-center"),children:_}),o&&e.jsx(m.Typography,{variant:"body2",id:b,className:s.cn("Bear-AlertDialog__description bear-text-sm bear-text-gray-600 dark:bear-text-gray-400 bear-mt-2",i&&"bear-text-center"),children:o}),e.jsxs("div",{className:"Bear-AlertDialog__footer bear-flex bear-items-center bear-justify-end bear-gap-3 bear-pt-6",children:[e.jsx(g.Button,{variant:"ghost",onClick:n,disabled:t,children:p}),e.jsx(g.Button,{variant:A,onClick:f,loading:t,loadingText:E,children:y})]})]})]});return j.createPortal(T,document.body)};exports.AlertDialog=L;
|