@bubbasfw/ui 0.1.0 → 0.2.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/README.md +65 -42
- package/dist/index.cjs +1106 -14
- package/dist/index.d.cts +358 -4
- package/dist/index.d.ts +358 -4
- package/dist/index.js +1076 -18
- package/dist/tokens.cjs +92 -1
- package/dist/tokens.d.cts +100 -0
- package/dist/tokens.d.ts +100 -0
- package/dist/tokens.js +92 -1
- package/package.json +2 -2
- package/src/components/Button.tsx +18 -18
- package/src/components/actions.tsx +39 -0
- package/src/components/content.tsx +55 -0
- package/src/components/disclosure.tsx +33 -0
- package/src/components/feedback.tsx +68 -0
- package/src/components/forms/Choice.tsx +112 -0
- package/src/components/forms/FormField.tsx +58 -0
- package/src/components/forms/Input.tsx +55 -0
- package/src/components/forms/RadioGroup.tsx +87 -0
- package/src/components/forms/Select.tsx +102 -0
- package/src/components/forms/Tabs.tsx +70 -0
- package/src/components/forms/index.ts +6 -0
- package/src/components/forms/selection.ts +48 -0
- package/src/components/layout.tsx +35 -0
- package/src/components/navigation.tsx +27 -0
- package/src/components/overlays.tsx +64 -0
- package/src/components/typography.tsx +31 -0
- package/src/index.ts +19 -0
- package/src/internal/scroll-lock.ts +101 -0
- package/src/internal/utils.ts +32 -0
- package/src/theme.tsx +56 -0
- package/src/tokens.ts +91 -0
- package/tailwind-preset.cjs +11 -1
package/README.md
CHANGED
|
@@ -1,72 +1,95 @@
|
|
|
1
1
|
# @bubbasfw/ui
|
|
2
2
|
|
|
3
|
-
Bubba’s universal React Native
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
Bubba’s universal component library for React Native, Expo and React Native Web.
|
|
4
|
+
All components use native primitives and NativeWind. React and platform runtimes
|
|
5
|
+
are peers, with no Base UI, Radix UI or DOM component implementation.
|
|
6
|
+
|
|
7
|
+
Version 0.2.0 includes 32 components, scoped light/dark/system themes and shared
|
|
8
|
+
design tokens. Use the same imports in Next.js/React Native Web and Expo.
|
|
9
|
+
|
|
10
|
+
[Browse the visual workbench and setup guides](https://handh-dev.github.io/bubbas-ui/)
|
|
6
11
|
|
|
7
12
|
```tsx
|
|
8
|
-
import { Button } from '@bubbasfw/ui';
|
|
13
|
+
import { Button, ThemeProvider } from '@bubbasfw/ui';
|
|
9
14
|
|
|
10
|
-
<
|
|
11
|
-
|
|
12
|
-
|
|
15
|
+
<ThemeProvider appearance="system">
|
|
16
|
+
<Button onPress={save} loading={saving} loadingLabel="Saving…">
|
|
17
|
+
Save changes
|
|
18
|
+
</Button>
|
|
19
|
+
</ThemeProvider>
|
|
13
20
|
```
|
|
14
21
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
22
|
+
## Catalog
|
|
23
|
+
|
|
24
|
+
- Foundations: Text, Heading, Stack, Inline, Container, Card, Divider.
|
|
25
|
+
- Actions: Button, IconButton, Link.
|
|
26
|
+
- Content: Badge, Avatar, ListItem, EmptyState.
|
|
27
|
+
- Forms: Input, Textarea, FormField, Checkbox, Switch, RadioGroup, Select.
|
|
28
|
+
- Navigation: Tabs, Breadcrumbs, Pagination.
|
|
29
|
+
- Disclosure: Accordion, Dialog, Sheet.
|
|
30
|
+
- Feedback: Alert, Toast, Spinner, Progress, Skeleton.
|
|
31
|
+
|
|
32
|
+
Native props and refs are forwarded where supported. Interactive components
|
|
33
|
+
expose accessible names and state. A consuming app still owns content, routing,
|
|
34
|
+
font loading and acceptance on its devices and assistive technologies.
|
|
35
|
+
|
|
36
|
+
`Button` variants are primary, secondary, outline and ghost; sizes are sm, md and
|
|
37
|
+
lg. Disabled and loading block presses. `ThemeProvider` scopes semantic colors
|
|
38
|
+
for light, dark or system appearance and supports nested previews. Native-only
|
|
39
|
+
apps may omit the optional React Native Web peer.
|
|
19
40
|
|
|
20
41
|
## Consumer setup
|
|
21
42
|
|
|
22
43
|
Baseline: React 19.2.3, React Native 0.86.3, React Native Web 0.21.4,
|
|
23
|
-
NativeWind 4.2.7, Tailwind 3.4.17.
|
|
24
|
-
this package’s source so its utilities are generated:
|
|
44
|
+
NativeWind 4.2.7, Tailwind 3.4.17. Install alongside the app’s compatible peers:
|
|
25
45
|
|
|
26
46
|
```sh
|
|
27
|
-
pnpm add @bubbasfw/ui nativewind@4.2.7
|
|
47
|
+
pnpm add @bubbasfw/ui@0.2.0 nativewind@4.2.7
|
|
28
48
|
pnpm add -D tailwindcss@3.4.17
|
|
29
49
|
```
|
|
30
50
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
```sh
|
|
34
|
-
pnpm add react-native-css-interop@0.2.7
|
|
35
|
-
npx expo install react-native-reanimated react-native-worklets react-native-safe-area-context
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
The Babel preset emits `react-native-css-interop` imports into app files. Its
|
|
39
|
-
transitive dependency through NativeWind does not resolve from those files in
|
|
40
|
-
pnpm's isolated dependency layout.
|
|
51
|
+
The host compiles the package’s utility classes. Include the published source:
|
|
41
52
|
|
|
42
53
|
```js
|
|
43
54
|
const path = require('node:path');
|
|
44
55
|
const uiRoot = path.dirname(require.resolve('@bubbasfw/ui/package.json'));
|
|
45
|
-
|
|
46
56
|
module.exports = {
|
|
57
|
+
darkMode: 'class',
|
|
47
58
|
content: [
|
|
48
59
|
'./App.{js,jsx,ts,tsx}',
|
|
49
|
-
'./app/**/*.{js,jsx,ts,tsx}',
|
|
50
|
-
'./pages/**/*.{js,jsx,ts,tsx}',
|
|
60
|
+
'./{app,pages,src}/**/*.{js,jsx,ts,tsx}',
|
|
51
61
|
path.join(uiRoot, 'src/**/*.{ts,tsx}'),
|
|
52
62
|
],
|
|
53
|
-
presets: [
|
|
54
|
-
require('nativewind/preset'),
|
|
55
|
-
require('@bubbasfw/ui/tailwind-preset'),
|
|
56
|
-
],
|
|
63
|
+
presets: [require('nativewind/preset'), require('@bubbasfw/ui/tailwind-preset')],
|
|
57
64
|
};
|
|
58
65
|
```
|
|
59
66
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
67
|
+
Import the global CSS at the app entry with Tailwind base, components and
|
|
68
|
+
utilities. Expo requires NativeWind’s Metro/Babel setup and compatible native
|
|
69
|
+
dependencies. Declare `react-native-css-interop@0.2.7` directly because NativeWind
|
|
70
|
+
4’s Babel preset emits this import into app files under pnpm’s isolated layout:
|
|
71
|
+
|
|
72
|
+
```sh
|
|
73
|
+
pnpm add react-native-css-interop@0.2.7
|
|
74
|
+
pnpm add -D @babel/plugin-transform-react-jsx@7.29.7
|
|
75
|
+
npx expo install react-native-reanimated react-native-worklets react-native-safe-area-context
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Next.js requires exact React Native → React Native Web aliasing, web extension
|
|
79
|
+
priority, NativeWind’s JSX import source and Tailwind 3/PostCSS. The runnable
|
|
80
|
+
Pages Router example uses webpack and Tailwind `important: true`. Interactive
|
|
81
|
+
App Router consumers need a client boundary. Turbopack is not configured.
|
|
82
|
+
|
|
83
|
+
See the [complete runnable examples](https://github.com/handh-dev/bubbas-ui/tree/main/examples)
|
|
84
|
+
and the [visual workbench](https://handh-dev.github.io/bubbas-ui/) for component previews and platform setup.
|
|
85
|
+
Both example apps include every catalog component from the real package entry.
|
|
86
|
+
|
|
87
|
+
## Exports and rights
|
|
65
88
|
|
|
66
|
-
|
|
67
|
-
`@bubbasfw/ui/
|
|
68
|
-
|
|
89
|
+
ESM, CJS and declarations ship together. Source ships for Tailwind scanning.
|
|
90
|
+
`@bubbasfw/ui/tokens` is independent of React; `@bubbasfw/ui/tailwind-preset` is
|
|
91
|
+
CommonJS. The package bundles no platform runtime, font or artwork binary.
|
|
69
92
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
93
|
+
Software is [MIT](LICENSE). Bubba’s names and marks retain separate rights; no
|
|
94
|
+
trademark license is granted. Publication remains an explicit owner-reviewed
|
|
95
|
+
step, with no automatic npm release on push or merge.
|