@forgedevstack/bear 1.3.3 → 1.3.5
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 +100 -290
- package/dist/components/Alert/Alert.cjs +1 -1
- package/dist/components/Alert/Alert.const.cjs +1 -1
- package/dist/components/Alert/Alert.const.d.ts +1 -6
- package/dist/components/Alert/Alert.const.js +10 -30
- package/dist/components/Alert/Alert.js +49 -54
- 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/Calendar/Calendar.cjs +1 -1
- package/dist/components/Calendar/Calendar.js +122 -112
- package/dist/components/Chart/BarChart.cjs +1 -1
- package/dist/components/Chart/BarChart.js +37 -36
- package/dist/components/Chart/Chart.types.d.ts +2 -0
- package/dist/components/Chart/Chart.utils.cjs +1 -1
- package/dist/components/Chart/Chart.utils.d.ts +2 -0
- package/dist/components/Chart/Chart.utils.js +32 -31
- package/dist/components/Chart/FunnelChart.cjs +1 -1
- package/dist/components/Chart/FunnelChart.js +29 -28
- package/dist/components/Chart/LineChart.cjs +1 -1
- package/dist/components/Chart/LineChart.js +45 -44
- package/dist/components/Chart/PieChart.cjs +1 -1
- package/dist/components/Chart/PieChart.js +52 -51
- package/dist/components/Chart/RadarChart.cjs +1 -1
- package/dist/components/Chart/RadarChart.js +63 -62
- package/dist/components/Chart/index.d.ts +1 -1
- 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 +5 -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 +7 -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 +15 -12
- package/dist/components/Modal/Modal.js +62 -59
- package/dist/components/Modal/Modal.types.d.ts +7 -0
- package/dist/components/ModalsProvider/components/StackedModal/StackedModal.cjs +1 -1
- package/dist/components/ModalsProvider/components/StackedModal/StackedModal.js +10 -9
- package/dist/components/OverlayPortal/OverlayPortal.cjs +1 -1
- package/dist/components/OverlayPortal/OverlayPortal.const.cjs +1 -1
- package/dist/components/OverlayPortal/OverlayPortal.const.d.ts +4 -0
- package/dist/components/OverlayPortal/OverlayPortal.const.js +21 -5
- package/dist/components/OverlayPortal/OverlayPortal.js +44 -38
- 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 +24 -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/Tabs/TabList.cjs +1 -1
- package/dist/components/Tabs/TabList.js +1 -1
- 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 +89 -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 +13 -0
- package/dist/components/Tooltip/Tooltip.js +59 -61
- package/dist/components/Tooltip/Tooltip.types.d.ts +7 -0
- package/dist/components/Transition/Transition.cjs +1 -1
- package/dist/components/Transition/Transition.const.cjs +1 -1
- package/dist/components/Transition/Transition.const.js +26 -8
- package/dist/components/Transition/Transition.js +77 -74
- package/dist/components/Transition/Transition.types.d.ts +8 -2
- package/dist/components/Typography/Typography.const.cjs +1 -1
- package/dist/components/Typography/Typography.const.js +2 -1
- package/dist/components/index.cjs +1 -1
- package/dist/components/index.d.ts +3 -1
- package/dist/components/index.js +429 -419
- package/dist/constants/generals.const.cjs +1 -1
- package/dist/constants/generals.const.js +85 -86
- 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/useFixedAnchorPosition/index.d.ts +1 -1
- package/dist/hooks/useFixedAnchorPosition/useFixedAnchorPosition.const.cjs +1 -1
- package/dist/hooks/useFixedAnchorPosition/useFixedAnchorPosition.const.d.ts +3 -0
- package/dist/hooks/useFixedAnchorPosition/useFixedAnchorPosition.const.js +17 -14
- package/dist/hooks/useFixedAnchorPosition/useFixedAnchorPosition.types.d.ts +1 -1
- 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 +580 -568
- package/dist/styles/_alerts.css +85 -4
- package/dist/styles/_drawer.css +60 -0
- package/dist/styles/_effects.css +33 -0
- package/dist/styles.css +231 -4
- package/package.json +3 -5
package/README.md
CHANGED
|
@@ -1,357 +1,167 @@
|
|
|
1
1
|
# @forgedevstack/bear
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
React components, a theme provider, and AeroCraft tokens. Version 1.3.5 in this repository. The published npm release is still 1.3.4 until 1.3.5 is published.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Author: John Yaghobieh. Docs: [bearui.com](https://bearui.com). Package: [@forgedevstack/bear](https://www.npmjs.com/package/@forgedevstack/bear).
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
## Portal
|
|
10
|
-
|
|
11
|
-
Visit the [Bear UI Portal](https://bearui.com/) to explore all components, view live examples, and browse the documentation.
|
|
12
|
-
|
|
13
|
-
## Sanity / Playwright
|
|
14
|
-
|
|
15
|
-
```bash
|
|
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`.
|
|
31
|
-
|
|
32
|
-
## Features
|
|
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.
|
|
7
|
+
## Install
|
|
46
8
|
|
|
47
9
|
```bash
|
|
48
10
|
npm install @forgedevstack/bear
|
|
49
|
-
# or
|
|
50
|
-
pnpm add @forgedevstack/bear
|
|
51
|
-
# or
|
|
52
|
-
yarn add @forgedevstack/bear
|
|
53
11
|
```
|
|
54
12
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
npm has no `--no-icons` flag. Skip the icon package with `--omit=optional`:
|
|
13
|
+
That install is the component set and the theme. Icons are a separate package. Charts still ship inside the core build today, and they also have a dedicated package entry so you can import them on their own.
|
|
58
14
|
|
|
59
15
|
```bash
|
|
60
|
-
npm install @forgedevstack/bear
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
16
|
+
npm install @forgedevstack/bear-icons
|
|
17
|
+
npm install @forgedevstack/bear-x-charts
|
|
18
|
+
npm install @forgedevstack/bear-x-ai
|
|
19
|
+
npm install @forgedevstack/bear-x-code
|
|
20
|
+
npm install @forgedevstack/bear-map
|
|
21
|
+
npm install @forgedevstack/kanban
|
|
22
|
+
npm install @forgedevstack/calendar
|
|
65
23
|
```
|
|
66
24
|
|
|
67
|
-
|
|
25
|
+
`@forgedevstack/bear-icons` and `@forgedevstack/calendar` are on npm (`calendar` is 1.0.1 there; 1.0.2 with the event calendar is in this repo). Charts, AI, code, map, and kanban are not on npm yet.
|
|
68
26
|
|
|
69
|
-
|
|
27
|
+
Media playback stays [Torch](https://www.npmjs.com/package/@forgedevstack/torch). The rich text editor stays [Ink](https://www.npmjs.com/package/@forgedevstack/ink).
|
|
70
28
|
|
|
71
|
-
|
|
72
|
-
npm install @forgedevstack/bear-icons
|
|
73
|
-
```
|
|
29
|
+
## Bundle size
|
|
74
30
|
|
|
75
|
-
|
|
76
|
-
import { SearchIcon, BearIcons } from '@forgedevstack/bear-icons';
|
|
77
|
-
```
|
|
31
|
+
Sizes change with each publish. Open Bundlephobia for the package you are about to add:
|
|
78
32
|
|
|
79
|
-
|
|
33
|
+
- [Core](https://bundlephobia.com/package/@forgedevstack/bear)
|
|
34
|
+
- [Icons](https://bundlephobia.com/package/@forgedevstack/bear-icons)
|
|
35
|
+
- [Charts](https://bundlephobia.com/package/@forgedevstack/bear-x-charts)
|
|
36
|
+
- [AI](https://bundlephobia.com/package/@forgedevstack/bear-x-ai)
|
|
37
|
+
- [Code](https://bundlephobia.com/package/@forgedevstack/bear-x-code)
|
|
38
|
+
- [Map](https://bundlephobia.com/package/@forgedevstack/bear-map)
|
|
39
|
+
- [Kanban](https://bundlephobia.com/package/@forgedevstack/kanban)
|
|
40
|
+
- [Calendar](https://bundlephobia.com/package/@forgedevstack/calendar)
|
|
80
41
|
|
|
81
|
-
|
|
42
|
+
The portal product pages and the libraries page have the same link as a button.
|
|
82
43
|
|
|
83
|
-
|
|
84
|
-
// In your main entry file (e.g., main.tsx, App.tsx, or index.css)
|
|
85
|
-
import '@forgedevstack/bear/styles.css';
|
|
86
|
-
```
|
|
44
|
+
## Provider
|
|
87
45
|
|
|
88
|
-
|
|
46
|
+
Import the stylesheet once, then wrap the tree.
|
|
89
47
|
|
|
90
48
|
```tsx
|
|
91
|
-
import
|
|
49
|
+
import '@forgedevstack/bear/styles.css';
|
|
50
|
+
import { BearProvider, Button, Card, CardBody, Typography } from '@forgedevstack/bear';
|
|
92
51
|
|
|
93
|
-
function App() {
|
|
52
|
+
export function App() {
|
|
94
53
|
return (
|
|
95
|
-
<
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
<
|
|
100
|
-
<
|
|
101
|
-
|
|
102
|
-
|
|
54
|
+
<BearProvider
|
|
55
|
+
colorScheme="system"
|
|
56
|
+
theme={{ colors: { primary: '#ec4899' } }}
|
|
57
|
+
>
|
|
58
|
+
<Card>
|
|
59
|
+
<CardBody>
|
|
60
|
+
<Typography variant="h4">Bear</Typography>
|
|
61
|
+
<Button variant="primary">Save</Button>
|
|
62
|
+
</CardBody>
|
|
63
|
+
</Card>
|
|
64
|
+
</BearProvider>
|
|
103
65
|
);
|
|
104
66
|
}
|
|
105
67
|
```
|
|
106
68
|
|
|
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
|
|
199
|
-
|
|
200
|
-
```tsx
|
|
201
|
-
import { Button } from '@forgedevstack/bear';
|
|
69
|
+
`colorScheme` is `light`, `dark`, or `system`. Dark mode follows the `.dark` class from the provider.
|
|
202
70
|
|
|
203
|
-
|
|
204
|
-
<Button variant="secondary">Secondary</Button>
|
|
205
|
-
<Button variant="outline">Outline</Button>
|
|
206
|
-
<Button variant="ghost">Ghost</Button>
|
|
71
|
+
## Charts
|
|
207
72
|
|
|
208
|
-
|
|
209
|
-
|
|
73
|
+
```tsx
|
|
74
|
+
import { BarChart } from '@forgedevstack/bear-x-charts';
|
|
75
|
+
import '@forgedevstack/bear/styles.css';
|
|
210
76
|
|
|
211
|
-
|
|
212
|
-
|
|
77
|
+
<BarChart
|
|
78
|
+
data={[
|
|
79
|
+
{ label: 'Jan', value: 30 },
|
|
80
|
+
{ label: 'Feb', value: 45 },
|
|
81
|
+
]}
|
|
82
|
+
showLabels
|
|
83
|
+
/>
|
|
213
84
|
```
|
|
214
85
|
|
|
215
|
-
|
|
86
|
+
Chart views in this repo: `bar`, `line`, `area`, `pie`, `donut`, `radar`, `funnel`, `stacked`. Pie also has `full`, `half`, and `rose`. Sparkline, Gauge, RingProgress, Heatmap, and TimelineChart sit next to those. Motion is `grow`, `fade`, `scale`, or `none`, and `animated` is a boolean. These are zero-dependency SVG charts. They are not Chart.js plugins.
|
|
216
87
|
|
|
217
|
-
|
|
88
|
+
## Icons
|
|
218
89
|
|
|
219
90
|
```tsx
|
|
220
|
-
import {
|
|
91
|
+
import { SearchIcon } from '@forgedevstack/bear-icons';
|
|
221
92
|
|
|
222
|
-
<
|
|
223
|
-
<CardHeader>Title</CardHeader>
|
|
224
|
-
<CardBody>Content goes here</CardBody>
|
|
225
|
-
<CardFooter>Footer content</CardFooter>
|
|
226
|
-
</Card>
|
|
93
|
+
<SearchIcon size={24} />
|
|
227
94
|
```
|
|
228
95
|
|
|
229
|
-
|
|
96
|
+
## Calendar
|
|
97
|
+
|
|
98
|
+
Peer of Bear. 1.0.2 adds the event month and the resource timeline. Popups and filters use Bear.
|
|
230
99
|
|
|
231
100
|
```tsx
|
|
232
|
-
import {
|
|
101
|
+
import { EventCalendar, EventTimeline } from '@forgedevstack/calendar';
|
|
102
|
+
import '@forgedevstack/calendar/styles.css';
|
|
103
|
+
import '@forgedevstack/bear/styles.css';
|
|
233
104
|
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
<form>
|
|
237
|
-
<Input label="Email" type="email" required />
|
|
238
|
-
<Input label="Password" type="password" required />
|
|
239
|
-
<Select
|
|
240
|
-
label="Country"
|
|
241
|
-
options={[
|
|
242
|
-
{ value: 'us', label: 'United States' },
|
|
243
|
-
{ value: 'uk', label: 'United Kingdom' },
|
|
244
|
-
]}
|
|
245
|
-
/>
|
|
246
|
-
<Checkbox label="Remember me" />
|
|
247
|
-
<Button type="submit">Submit</Button>
|
|
248
|
-
</form>
|
|
249
|
-
);
|
|
250
|
-
}
|
|
105
|
+
<EventCalendar events={events} mode="dark" />
|
|
106
|
+
<EventTimeline events={events} />
|
|
251
107
|
```
|
|
252
108
|
|
|
253
|
-
|
|
109
|
+
## Map and kanban
|
|
254
110
|
|
|
255
111
|
```tsx
|
|
256
|
-
import {
|
|
257
|
-
|
|
258
|
-
interface User {
|
|
259
|
-
id: number;
|
|
260
|
-
name: string;
|
|
261
|
-
email: string;
|
|
262
|
-
role: string;
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
const columns = createColumns<User>([
|
|
266
|
-
{ key: 'name', header: 'Name' },
|
|
267
|
-
{ key: 'email', header: 'Email' },
|
|
268
|
-
{ key: 'role', header: 'Role' },
|
|
269
|
-
]);
|
|
270
|
-
|
|
271
|
-
const data: User[] = [
|
|
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
|
-
];
|
|
275
|
-
|
|
276
|
-
<DataTable data={data} columns={columns} />
|
|
112
|
+
import { Map } from '@forgedevstack/bear-map';
|
|
113
|
+
import { Kanban } from '@forgedevstack/kanban';
|
|
277
114
|
```
|
|
278
115
|
|
|
279
|
-
|
|
116
|
+
Hooks stay on core. Date pickers stay on core.
|
|
280
117
|
|
|
281
|
-
|
|
282
|
-
import { ToastProvider, useToast, Button } from '@forgedevstack/bear';
|
|
118
|
+
## CLI
|
|
283
119
|
|
|
284
|
-
|
|
285
|
-
return (
|
|
286
|
-
<ToastProvider>
|
|
287
|
-
<MyComponent />
|
|
288
|
-
</ToastProvider>
|
|
289
|
-
);
|
|
290
|
-
}
|
|
120
|
+
Forge CLI is the installer that exists today.
|
|
291
121
|
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
return (
|
|
296
|
-
<Button onClick={() => toast.success('Operation successful!')}>
|
|
297
|
-
Show Toast
|
|
298
|
-
</Button>
|
|
299
|
-
);
|
|
300
|
-
}
|
|
122
|
+
```bash
|
|
123
|
+
npx create-forge my-app
|
|
301
124
|
```
|
|
302
125
|
|
|
303
|
-
|
|
126
|
+
When you select Bear, the CLI prints the Lotso mascot and asks which libraries to include: icons, charts, AI, code, map, kanban, and calendar. It then asks for the primary color. `--yes` selects Bear and those libraries.
|
|
304
127
|
|
|
305
|
-
|
|
128
|
+
Add one package to an existing app:
|
|
306
129
|
|
|
307
|
-
```
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
extend: {
|
|
312
|
-
colors: {
|
|
313
|
-
// Your custom colors
|
|
314
|
-
},
|
|
315
|
-
},
|
|
316
|
-
},
|
|
317
|
-
}
|
|
130
|
+
```bash
|
|
131
|
+
forge add bear
|
|
132
|
+
forge add bear-icons
|
|
133
|
+
forge add calendar
|
|
318
134
|
```
|
|
319
135
|
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
All components are fully typed with TypeScript:
|
|
136
|
+
`forge add bear` asks the same library question. Icons and calendar install from npm. Charts, AI, code, map, and kanban are recorded in a comment in `src/main.tsx` until those packages are published, so the install does not fail on a missing package.
|
|
323
137
|
|
|
324
|
-
|
|
325
|
-
import { Button, ButtonProps } from '@forgedevstack/bear';
|
|
138
|
+
`npx @forgedevstack/bear-cli` is the name reserved for a Bear-only binary. That binary is not published, so those commands do not run yet.
|
|
326
139
|
|
|
327
|
-
|
|
328
|
-
variant: 'primary',
|
|
329
|
-
size: 'md',
|
|
330
|
-
children: 'Click me',
|
|
331
|
-
};
|
|
140
|
+
## What 1.3.5 adds
|
|
332
141
|
|
|
333
|
-
|
|
334
|
-
|
|
142
|
+
- Optional packages: `@forgedevstack/bear-x-charts`, `@forgedevstack/bear-x-ai`, `@forgedevstack/bear-x-code`, `@forgedevstack/bear-map`, `@forgedevstack/kanban`.
|
|
143
|
+
- Overlay open and close motion on the panel: `none`, `fade`, `slide-down`, `scale`, `fold`, `elastic`, `reveal`, `expand`. The default is `fold`.
|
|
144
|
+
- Portal product pages for each library, with a Bundlephobia button.
|
|
145
|
+
- `@forgedevstack/calendar` 1.0.2: event calendar, resource filter, side editor, and timeline.
|
|
335
146
|
|
|
336
|
-
##
|
|
147
|
+
## Components
|
|
337
148
|
|
|
338
|
-
|
|
|
339
|
-
|
|
340
|
-
|
|
|
341
|
-
|
|
|
342
|
-
|
|
|
343
|
-
|
|
|
344
|
-
|
|
|
345
|
-
|
|
|
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 |
|
|
149
|
+
| Area | Examples |
|
|
150
|
+
|---|---|
|
|
151
|
+
| Actions | Button, ButtonGroup, ToggleGroup, FAB, SplitButton |
|
|
152
|
+
| Forms | Input, Select, Checkbox, Radio, Switch, Slider, DatePicker, TimePicker |
|
|
153
|
+
| Overlays | Modal, Drawer, AlertDialog, Popover, Tooltip, Menu, CommandPalette |
|
|
154
|
+
| Feedback | Alert, Toast, Spinner, Progress, Skeleton, Badge |
|
|
155
|
+
| Layout | Container, Flex, Grid, Paper, Divider, ScrollArea |
|
|
156
|
+
| Data | DataTable, Chart, Calendar, Timeline |
|
|
350
157
|
|
|
351
|
-
##
|
|
158
|
+
## Scripts
|
|
352
159
|
|
|
353
|
-
|
|
160
|
+
```bash
|
|
161
|
+
npm run build
|
|
162
|
+
cd portal && npm run test:e2e:smoke
|
|
163
|
+
```
|
|
354
164
|
|
|
355
165
|
## License
|
|
356
166
|
|
|
357
|
-
MIT
|
|
167
|
+
MIT. John Yaghobieh and 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"),O=require("react"),r=require("../../constants/generals.const.cjs"),m=require("../../utils/cn.cjs"),c=require("../Box/Box.cjs"),T=require("../Button/Button.cjs"),S=require("../Flex/Flex.cjs"),s=require("@forgedevstack/bear-icons"),u=require("../Typography/Typography.cjs"),_=require("./Alert.const.cjs"),j=b=>{const{severity:n=r.INFO,variant:x=r.VARIANT_STANDARD,title:i,icon:t=r.BOOLEAN_TRUE,action:o,closable:B=r.BOOLEAN_FALSE,onClose:a,children:l,className:d,testId:E,...I}=b,[N,h]=O.useState(r.BOOLEAN_TRUE);if(!N)return null;const L=()=>{h(r.BOOLEAN_FALSE),a==null||a()},A=t===r.BOOLEAN_FALSE?null:t!==r.BOOLEAN_TRUE?t:n===r.INFO?e.jsx(s.InfoIcon,{}):n==="success"?e.jsx(s.BearIcons.CheckCircleIcon,{}):n==="warning"?e.jsx(s.BearIcons.WarningIcon,{}):e.jsx(s.BearIcons.ErrorIcon,{});return e.jsxs(S.Flex,{role:"alert","aria-live":"polite",className:m.cn("Bear-Alert bear-items-start bear-gap-3 bear-p-4 bear-rounded-lg",_.ALERT_SEVERITY_CLASS[n],_.ALERT_VARIANT_CLASSES[x](n),d),"data-testid":E,...I,children:[A&&e.jsx(c.Box,{as:"span",className:"Bear-Alert__icon bear-flex-shrink-0 bear-mt-0.5",children:A}),e.jsxs(c.Box,{className:"Bear-Alert__content bear-flex-1 bear-min-w-0",children:[i&&e.jsx(u.Typography,{variant:"subtitle2",weight:"semibold",color:"inherit",className:"Bear-Alert__title bear-mb-1",children:i}),l&&e.jsx(u.Typography,{variant:"body2",color:"inherit",className:"Bear-Alert__message",children:l})]}),o&&e.jsx(c.Box,{className:"Bear-Alert__action bear-flex-shrink-0",children:o}),B&&e.jsx(T.Button,{variant:r.VARIANT_GHOST,onClick:L,className:"Bear-Alert__close bear-flex-shrink-0 bear-p-1","aria-label":r.LABEL_CLOSE_ALERT,children:e.jsx(s.CloseIcon,{})})]})};exports.Alert=j;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../utils/cn.cjs");require("react");const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../utils/cn.cjs");require("react");const l={success:"Bear-Alert--success",info:"Bear-Alert--info",warning:"Bear-Alert--warning",error:"Bear-Alert--error"},a={filled:r=>e.cn("bear-alert-filled",r==="success"&&"bear-alert-filled-success",r==="info"&&"bear-alert-filled-info",r==="warning"&&"bear-alert-filled-warning",r==="error"&&"bear-alert-filled-error"),outlined:()=>"Bear-Alert--outlined",standard:()=>""};exports.ALERT_SEVERITY_CLASS=l;exports.ALERT_VARIANT_CLASSES=a;
|
|
@@ -1,8 +1,3 @@
|
|
|
1
1
|
import { AlertSeverity, AlertVariant } from './Alert.types';
|
|
2
|
-
export declare const
|
|
3
|
-
bg: string;
|
|
4
|
-
border: string;
|
|
5
|
-
text: string;
|
|
6
|
-
icon: string;
|
|
7
|
-
}>;
|
|
2
|
+
export declare const ALERT_SEVERITY_CLASS: Record<AlertSeverity, string>;
|
|
8
3
|
export declare const ALERT_VARIANT_CLASSES: Record<AlertVariant, (severity: AlertSeverity) => string>;
|
|
@@ -1,42 +1,22 @@
|
|
|
1
|
-
import { cn as
|
|
1
|
+
import { cn as e } from "../../utils/cn.js";
|
|
2
2
|
import "react";
|
|
3
|
-
const
|
|
4
|
-
success:
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
icon: "var(--bear-success-600)"
|
|
9
|
-
},
|
|
10
|
-
info: {
|
|
11
|
-
bg: "var(--bear-info-50)",
|
|
12
|
-
border: "var(--bear-info-500)",
|
|
13
|
-
text: "var(--bear-info-800)",
|
|
14
|
-
icon: "var(--bear-info-600)"
|
|
15
|
-
},
|
|
16
|
-
warning: {
|
|
17
|
-
bg: "var(--bear-warning-50)",
|
|
18
|
-
border: "var(--bear-warning-500)",
|
|
19
|
-
text: "var(--bear-warning-800)",
|
|
20
|
-
icon: "var(--bear-warning-600)"
|
|
21
|
-
},
|
|
22
|
-
error: {
|
|
23
|
-
bg: "var(--bear-danger-50)",
|
|
24
|
-
border: "var(--bear-danger-500)",
|
|
25
|
-
text: "var(--bear-danger-800)",
|
|
26
|
-
icon: "var(--bear-danger-600)"
|
|
27
|
-
}
|
|
3
|
+
const n = {
|
|
4
|
+
success: "Bear-Alert--success",
|
|
5
|
+
info: "Bear-Alert--info",
|
|
6
|
+
warning: "Bear-Alert--warning",
|
|
7
|
+
error: "Bear-Alert--error"
|
|
28
8
|
}, o = {
|
|
29
|
-
filled: (r) =>
|
|
30
|
-
"bear-
|
|
9
|
+
filled: (r) => e(
|
|
10
|
+
"bear-alert-filled",
|
|
31
11
|
r === "success" && "bear-alert-filled-success",
|
|
32
12
|
r === "info" && "bear-alert-filled-info",
|
|
33
13
|
r === "warning" && "bear-alert-filled-warning",
|
|
34
14
|
r === "error" && "bear-alert-filled-error"
|
|
35
15
|
),
|
|
36
|
-
outlined: () => "
|
|
16
|
+
outlined: () => "Bear-Alert--outlined",
|
|
37
17
|
standard: () => ""
|
|
38
18
|
};
|
|
39
19
|
export {
|
|
40
|
-
|
|
20
|
+
n as ALERT_SEVERITY_CLASS,
|
|
41
21
|
o as ALERT_VARIANT_CLASSES
|
|
42
22
|
};
|