@oxy.so/bloom 2.0.0 → 2.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 +3 -3
- package/docs/auth-card.mdx +1 -1
- package/docs/migrating-to-2.0.mdx +21 -3
- package/docs/page-header.mdx +101 -0
- package/docs/social-button.mdx +20 -3
- package/lib/commonjs/index.js +128 -116
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/index.web.js +128 -116
- package/lib/commonjs/index.web.js.map +1 -1
- package/lib/commonjs/page-header/PageHeader.js +286 -0
- package/lib/commonjs/page-header/PageHeader.js.map +1 -0
- package/lib/commonjs/page-header/index.js +13 -0
- package/lib/commonjs/page-header/index.js.map +1 -0
- package/lib/commonjs/page-header/types.js +6 -0
- package/lib/commonjs/page-header/types.js.map +1 -0
- package/lib/commonjs/social-button/OxyMark.js +61 -0
- package/lib/commonjs/social-button/OxyMark.js.map +1 -0
- package/lib/commonjs/social-button/SocialButton.js +26 -2
- package/lib/commonjs/social-button/SocialButton.js.map +1 -1
- package/lib/commonjs/social-button/index.js +6 -0
- package/lib/commonjs/social-button/index.js.map +1 -1
- package/lib/commonjs/social-button/providers.js +11 -0
- package/lib/commonjs/social-button/providers.js.map +1 -1
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/index.web.js +1 -0
- package/lib/module/index.web.js.map +1 -1
- package/lib/module/page-header/PageHeader.js +281 -0
- package/lib/module/page-header/PageHeader.js.map +1 -0
- package/lib/module/page-header/index.js +4 -0
- package/lib/module/page-header/index.js.map +1 -0
- package/lib/module/page-header/types.js +4 -0
- package/lib/module/page-header/types.js.map +1 -0
- package/lib/module/social-button/OxyMark.js +55 -0
- package/lib/module/social-button/OxyMark.js.map +1 -0
- package/lib/module/social-button/SocialButton.js +25 -2
- package/lib/module/social-button/SocialButton.js.map +1 -1
- package/lib/module/social-button/index.js +1 -0
- package/lib/module/social-button/index.js.map +1 -1
- package/lib/module/social-button/providers.js +12 -0
- package/lib/module/social-button/providers.js.map +1 -1
- package/lib/typescript/commonjs/index.d.ts +1 -0
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/index.web.d.ts +1 -0
- package/lib/typescript/commonjs/index.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/page-header/PageHeader.d.ts +6 -0
- package/lib/typescript/commonjs/page-header/PageHeader.d.ts.map +1 -0
- package/lib/typescript/commonjs/page-header/index.d.ts +3 -0
- package/lib/typescript/commonjs/page-header/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/page-header/types.d.ts +55 -0
- package/lib/typescript/commonjs/page-header/types.d.ts.map +1 -0
- package/lib/typescript/commonjs/social-button/OxyMark.d.ts +17 -0
- package/lib/typescript/commonjs/social-button/OxyMark.d.ts.map +1 -0
- package/lib/typescript/commonjs/social-button/SocialButton.d.ts +3 -1
- package/lib/typescript/commonjs/social-button/SocialButton.d.ts.map +1 -1
- package/lib/typescript/commonjs/social-button/index.d.ts +2 -1
- package/lib/typescript/commonjs/social-button/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/social-button/providers.d.ts +10 -0
- package/lib/typescript/commonjs/social-button/providers.d.ts.map +1 -1
- package/lib/typescript/commonjs/social-button/types.d.ts +10 -3
- package/lib/typescript/commonjs/social-button/types.d.ts.map +1 -1
- package/lib/typescript/module/index.d.ts +1 -0
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/index.web.d.ts +1 -0
- package/lib/typescript/module/index.web.d.ts.map +1 -1
- package/lib/typescript/module/page-header/PageHeader.d.ts +6 -0
- package/lib/typescript/module/page-header/PageHeader.d.ts.map +1 -0
- package/lib/typescript/module/page-header/index.d.ts +3 -0
- package/lib/typescript/module/page-header/index.d.ts.map +1 -0
- package/lib/typescript/module/page-header/types.d.ts +55 -0
- package/lib/typescript/module/page-header/types.d.ts.map +1 -0
- package/lib/typescript/module/social-button/OxyMark.d.ts +17 -0
- package/lib/typescript/module/social-button/OxyMark.d.ts.map +1 -0
- package/lib/typescript/module/social-button/SocialButton.d.ts +3 -1
- package/lib/typescript/module/social-button/SocialButton.d.ts.map +1 -1
- package/lib/typescript/module/social-button/index.d.ts +2 -1
- package/lib/typescript/module/social-button/index.d.ts.map +1 -1
- package/lib/typescript/module/social-button/providers.d.ts +10 -0
- package/lib/typescript/module/social-button/providers.d.ts.map +1 -1
- package/lib/typescript/module/social-button/types.d.ts +10 -3
- package/lib/typescript/module/social-button/types.d.ts.map +1 -1
- package/package.json +15 -1
- package/src/index.ts +1 -0
- package/src/index.web.ts +1 -0
- package/src/page-header/PageHeader.tsx +319 -0
- package/src/page-header/index.ts +3 -0
- package/src/page-header/types.ts +62 -0
- package/src/social-button/OxyMark.tsx +47 -0
- package/src/social-button/SocialButton.tsx +35 -3
- package/src/social-button/index.ts +2 -0
- package/src/social-button/providers.ts +12 -0
- package/src/social-button/types.ts +11 -3
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
|
|
21
21
|
### What it is
|
|
22
22
|
|
|
23
|
-
Components, hooks and design tokens published as `@oxy.so/bloom` across
|
|
23
|
+
Components, hooks and design tokens published as `@oxy.so/bloom` across 129 subpath exports, shipped as `src` for Metro and as compiled CommonJS and ESM for everyone else. Web builds resolve platform forks automatically through export conditions, so a `.web.tsx` fork never reaches a native bundle.
|
|
24
24
|
|
|
25
25
|
Styling is NativeWind classes throughout. There are no colour props and no wrapper components to theme a button, because a second way to set a colour is a second thing that can disagree.
|
|
26
26
|
|
|
@@ -151,12 +151,12 @@ Every palette is generated from a single seed colour by a dependency free colour
|
|
|
151
151
|
|
|
152
152
|
## Components
|
|
153
153
|
|
|
154
|
-
Bloom publishes
|
|
154
|
+
Bloom publishes 129 subpath exports. Importing from the subpath rather than the root keeps a bundle to what it actually renders.
|
|
155
155
|
|
|
156
156
|
| Group | Exports |
|
|
157
157
|
|---|---|
|
|
158
158
|
| Providers and theme | `provider`, `theme`, `theme-toggle`, `color-presets`, `preset-vars`, `design-tokens`, `tailwind-preset`, `styles`, `hooks` |
|
|
159
|
-
| App shell and navigation | `app-shell`, `sidebar`, `rail`, `breadcrumb`, `pagination`, `tabs`, `tab-bar`, `layout`, `content-panel` |
|
|
159
|
+
| App shell and navigation | `app-shell`, `page-header`, `sidebar`, `rail`, `breadcrumb`, `pagination`, `tabs`, `tab-bar`, `layout`, `content-panel` |
|
|
160
160
|
| Overlays | `dialog`, `alert-dialog`, `bottom-sheet`, `popover`, `context-menu`, `dropdown-menu`, `menubar`, `tooltip`, `overlay`, `portal`, `teleport`, `surfaces`, `settings-modal` |
|
|
161
161
|
| Actions | `button`, `button-group`, `social-button`, `fab`, `frosted-icon-button`, `pressable-scale`, `subtle-hover` |
|
|
162
162
|
| Forms | `text-field`, `textarea`, `phone-input`, `input-otp`, `field`, `input-group`, `label`, `select`, `command`, `checkbox`, `radio`, `switch`, `slider`, `segmented-control`, `search`, `date-picker`, `file-upload`, `auth-card` |
|
package/docs/auth-card.mdx
CHANGED
|
@@ -40,7 +40,7 @@ import { AuthCard, AuthMediaCarousel } from '@oxy.so/bloom/auth-card';
|
|
|
40
40
|
All three sit **below** the form, after an "or continue with" divider, and all take the same `providers` array. The buttons are `SocialButton` at `appearance="white"`.
|
|
41
41
|
|
|
42
42
|
- `stacked` — full-width labelled buttons, 10 apart.
|
|
43
|
-
- `inline` — icon-only 36px buttons, wrapping and centred, 8 apart. Each keeps "Continue with
|
|
43
|
+
- `inline` — icon-only 36px buttons, wrapping and centred, 8 apart. Each keeps "Continue with {brand}" as its accessible name.
|
|
44
44
|
- `grid` — icon-only across equal columns, 10 apart.
|
|
45
45
|
|
|
46
46
|
An empty `providers` array hides the section and its divider.
|
|
@@ -20,7 +20,8 @@ until you migrate it.
|
|
|
20
20
|
2. Run the icon codemod — the one change `tsc` will not catch for you.
|
|
21
21
|
3. Replace the five removed families.
|
|
22
22
|
4. Check the changed defaults below against your screens.
|
|
23
|
-
5.
|
|
23
|
+
5. Import from subpaths, not the root barrel.
|
|
24
|
+
6. Read the license section if you ship Bloom inside a commercial product.
|
|
24
25
|
|
|
25
26
|
## 1. Icons: the Remix set replaces Bloom's own
|
|
26
27
|
|
|
@@ -90,7 +91,24 @@ renders.
|
|
|
90
91
|
| `Toast` | The card is repainted to match `Notification`; the close glyph is fixed, so `closeButtonIconStyle` no longer has an effect. Stacking stays on by default. | — |
|
|
91
92
|
| `Kbd`, `Tooltip`, `Label`, `Field`, `Dialog` actions, `DropdownMenu`, `ContextMenu`, `Menubar`, `Popover`, `Code` / `Pre` | Repainted; no API change. `Label` text is `text-primary` (was secondary). Menus fade and scale in over 150ms. | — |
|
|
92
93
|
|
|
93
|
-
## 5.
|
|
94
|
+
## 5. Import from subpaths
|
|
95
|
+
|
|
96
|
+
Bloom 2.0's root barrel carries all 38 new families, and Metro does not
|
|
97
|
+
tree-shake. An app that imports `Skeleton` or `ErrorBoundary` from
|
|
98
|
+
`@oxy.so/bloom` bundles every chart card, composer and settings modal with them.
|
|
99
|
+
Measured while migrating Oxy's own apps: +272 KB gzipped in one web bundle and
|
|
100
|
+
a bundle budget broken in another, both back below their 1.x size once the root
|
|
101
|
+
imports moved to subpaths.
|
|
102
|
+
|
|
103
|
+
```tsx
|
|
104
|
+
// Pulls the whole library into the bundle
|
|
105
|
+
import { Skeleton } from '@oxy.so/bloom';
|
|
106
|
+
|
|
107
|
+
// Pulls in one family
|
|
108
|
+
import * as Skeleton from '@oxy.so/bloom/skeleton';
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## 6. New in 2.0
|
|
94
112
|
|
|
95
113
|
Nothing to migrate, but worth knowing before you build your own:
|
|
96
114
|
|
|
@@ -102,7 +120,7 @@ Nothing to migrate, but worth knowing before you build your own:
|
|
|
102
120
|
|
|
103
121
|
Each family has its own guide in `docs/`.
|
|
104
122
|
|
|
105
|
-
##
|
|
123
|
+
## 7. License: the Breathe License 1.0
|
|
106
124
|
|
|
107
125
|
Bloom 2.0 is licensed under the [Breathe License 1.0](https://github.com/OxyHQ/Bloom/blob/main/LICENSE)
|
|
108
126
|
(`LicenseRef-Breathe-1.0`; `package.json` reads `"SEE LICENSE IN LICENSE"`).
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: PageHeader
|
|
3
|
+
description: A screen's top bar — back button, title and subtitle, a leading node and actions — sticky on web, safe-area aware on native, with a scroll-linked border, shadow and transparent-over-media mode.
|
|
4
|
+
order: 105
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# PageHeader
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import { PageHeader } from '@oxy.so/bloom/page-header';
|
|
11
|
+
|
|
12
|
+
<PageHeader
|
|
13
|
+
onBack={router.back}
|
|
14
|
+
title="Order #4821"
|
|
15
|
+
subtitle="Placed today"
|
|
16
|
+
actions={<>
|
|
17
|
+
<Button variant="secondary" iconOnly leadingIcon={RiShare2Line} accessibilityLabel="Share" />
|
|
18
|
+
<Button variant="primary" leadingIcon={RiAddFill}>New order</Button>
|
|
19
|
+
</>}
|
|
20
|
+
/>
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Router-agnostic: the back button renders when `onBack` is set. Pass `router.back`, your app's safe-back helper, or omit it on a root screen (`router.canGoBack() ? router.back : undefined`).
|
|
24
|
+
|
|
25
|
+
## Props
|
|
26
|
+
|
|
27
|
+
| Prop | Default | |
|
|
28
|
+
| --- | --- | --- |
|
|
29
|
+
| `title` | — | A string is the heading (`role="heading"`, `aria-level={headingLevel}`); a node renders as-is and owns its semantics. |
|
|
30
|
+
| `subtitle` | — | A string is a secondary line; a node renders as-is. |
|
|
31
|
+
| `titleAlign` | `'start'` | `'center'` centres the title on the bar whatever the two sides hold. |
|
|
32
|
+
| `headingLevel` | `1` | |
|
|
33
|
+
| `onBack` / `backLabel` | — / `"Back"` | `backLabel` is the button's accessible name — localise it. |
|
|
34
|
+
| `leading` | — | After the back button, before the title (an avatar, a logo). |
|
|
35
|
+
| `actions` | — | End of the bar, 10 apart. Use Bloom `Button`s. |
|
|
36
|
+
| `border` | `'auto'` | `auto` fades the separator in with scroll; `always`; `none`. |
|
|
37
|
+
| `transparent` | `false` | Background, shadow and title fade in with scroll — for a header over media. The back button and actions stay (their own fill reads over any photo). |
|
|
38
|
+
| `scrollY` | — | A Reanimated `SharedValue<number>` driving the scroll-linked paint. |
|
|
39
|
+
| `scrollThreshold` | `20` | The offset over which border, shadow and background fade in. Over a hero, use the hero height minus the bar. |
|
|
40
|
+
| `sticky` | `true` | Web: `position: sticky; top: 0`. No effect on native. |
|
|
41
|
+
| `safeArea` | native `true`, web `false` | Pads the top by the safe-area inset (read from `SafeAreaInsetsContext`; no provider → 0). |
|
|
42
|
+
|
|
43
|
+
## Look
|
|
44
|
+
|
|
45
|
+
- Bar min-height 56; side inset 16 below `sm`, 24 from `sm`.
|
|
46
|
+
- Back: the secondary medium icon-only `Button` (36, pill, hairline, shadow-xs) with `RiArrowLeftLine`.
|
|
47
|
+
- Start group gap 6; title `headline-medium` text-primary, 4px side padding (`gap-1.5` + `px-1`, as in the template headers); subtitle `body-2-regular` text-secondary. Both truncate to one line.
|
|
48
|
+
- Background `background/full` (card; dark neutral-925). Separator 1px `separator-border` (neutral-200; dark neutral-800). Shadow `shadow-xs`, only once scrolled.
|
|
49
|
+
- No press scale. The fades are scroll-linked, not timed, so there is no motion to reduce.
|
|
50
|
+
|
|
51
|
+
## Scroll
|
|
52
|
+
|
|
53
|
+
Border (`auto`), shadow and — with `transparent` — background and title interpolate over `[0, scrollThreshold]` of the scroll offset:
|
|
54
|
+
|
|
55
|
+
- **Web, window scroll:** omit `scrollY`; the header follows `window.scrollY`.
|
|
56
|
+
- **A scroll container (any platform):** pass the offset.
|
|
57
|
+
|
|
58
|
+
```tsx
|
|
59
|
+
const scrollY = useSharedValue(0);
|
|
60
|
+
const onScroll = useAnimatedScrollHandler({ onScroll: (e) => { scrollY.value = e.contentOffset.y; } }, [scrollY]);
|
|
61
|
+
|
|
62
|
+
<PageHeader title="Inbox" onBack={back} scrollY={scrollY} sticky={false} />
|
|
63
|
+
<Animated.ScrollView onScroll={onScroll} scrollEventThrottle={16}>…</Animated.ScrollView>
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Without `scrollY` on native the header stays at rest (border `auto` hidden, `transparent` stays transparent). Name `scrollY` in the handler's dependency array — without the worklets Babel plugin (Storybook, some web builds) a shared value missing from it never updates.
|
|
67
|
+
|
|
68
|
+
**Over media** (`transparent`): let the photo start under the bar (`marginTop: -56` on the hero, or absolutely position the header), and set `scrollThreshold` to the hero height minus the bar so the bar arrives as the photo leaves.
|
|
69
|
+
|
|
70
|
+
## Accessibility
|
|
71
|
+
|
|
72
|
+
- The title is a `heading` (level 1 by default: the page header titles the page).
|
|
73
|
+
- The container carries no landmark role. `role="banner"` would be one banner per header, and an app shell already owns the page's banner; a page header inside `main` is not a landmark in HTML either.
|
|
74
|
+
- The back button is named by `backLabel`.
|
|
75
|
+
|
|
76
|
+
## Not included
|
|
77
|
+
|
|
78
|
+
- **iOS large title.** A large title that collapses into the bar needs to live inside the scroll content (so it scrolls under the bar) while the bar lives outside it; a standalone header cannot own both without making content move at twice the scroll speed on native. `Dialog`'s own header (`docs/dialog.mdx`) does it because the Dialog owns its scroller.
|
|
79
|
+
|
|
80
|
+
## Migrating from app headers
|
|
81
|
+
|
|
82
|
+
Mention, Allo and Homiio each hand-roll a `Header` with an `options` object. The mapping:
|
|
83
|
+
|
|
84
|
+
| App header | `PageHeader` |
|
|
85
|
+
| --- | --- |
|
|
86
|
+
| `options.title` | `title` |
|
|
87
|
+
| `options.titlePosition: 'left' \| 'center'` | `titleAlign: 'start' \| 'center'` |
|
|
88
|
+
| `options.subtitle` (string or node) | `subtitle` |
|
|
89
|
+
| `options.showBackButton` (+ `useSafeBack` / `router.back` inside) | `onBack={safeBack}` — omit to hide |
|
|
90
|
+
| Homiio `showBackButton && router.canGoBack()` | `onBack={router.canGoBack() ? router.back : undefined}` |
|
|
91
|
+
| `options.leftComponents: ReactNode[]` | `leading={<>…</>}` |
|
|
92
|
+
| `options.rightComponents: ReactNode[]` | `actions={<>…</>}` |
|
|
93
|
+
| `hideBottomBorder` | `border="none"` (the apps drew it at rest: `border="always"` for the old look) |
|
|
94
|
+
| `disableSticky` | `sticky={false}` |
|
|
95
|
+
| web `window.scrollY > 20` sticky state | built in (`scrollThreshold`, default 20) |
|
|
96
|
+
| Homiio `options.transparent` / `options.scrollThreshold` | `transparent` / `scrollThreshold` |
|
|
97
|
+
| Homiio `scrollY` | `scrollY` |
|
|
98
|
+
| Homiio `useSafeAreaInsets().top` | `safeArea` (default on native) |
|
|
99
|
+
| Mention `options.headerTitleStyle` | pass a node `title` |
|
|
100
|
+
|
|
101
|
+
Two visual changes: the title is `headline-medium` (16/22, 500) instead of 18/800, and the back button is a pill icon button instead of a bare arrow.
|
package/docs/social-button.mdx
CHANGED
|
@@ -1,23 +1,40 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: SocialButton
|
|
3
|
-
description: A sign-in button for
|
|
3
|
+
description: A sign-in button for an identity provider — Oxy, 24 third-party brands, or your own.
|
|
4
4
|
order: 24
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# SocialButton
|
|
8
8
|
|
|
9
|
-
A "Continue with …" button for
|
|
9
|
+
A "Continue with …" / "Sign in with …" button for an identity provider. The brand is **named**, not passed as artwork: `brand="google"` supplies the logo, the brand colour and the accessible label together, so a stack of these cannot drift out of sync.
|
|
10
10
|
|
|
11
11
|
```tsx
|
|
12
12
|
import { SocialButton } from '@oxy.so/bloom/social-button';
|
|
13
13
|
|
|
14
|
+
<SocialButton brand="oxy" action="signIn" onPress={signIn} /> // Sign in with Oxy
|
|
14
15
|
<SocialButton brand="google" onPress={signInWithGoogle} /> // Continue with Google
|
|
15
16
|
<SocialButton brand="github" appearance="white" /> // outlined, colour mark
|
|
16
17
|
<SocialButton brand="apple" iconOnly /> // circle, logo only
|
|
17
18
|
<SocialButton brand="figma" href="https://example.com/auth/figma" /> // a link
|
|
18
19
|
```
|
|
19
20
|
|
|
20
|
-
Providers: `google`, `apple`, `github`, `gitlab`, `microsoft`, `x`, `facebook`, `linkedin`, `discord`, `slack`, `figma`, `notion`, `dropbox`, `spotify`, `twitch`, `reddit`, `tiktok`, `instagram`, `telegram`, `whatsapp`, `amazon`, `bitbucket`, `auth0`, `okta` — also exported as `SOCIAL_PROVIDERS`.
|
|
21
|
+
Providers: `oxy`, `google`, `apple`, `github`, `gitlab`, `microsoft`, `x`, `facebook`, `linkedin`, `discord`, `slack`, `figma`, `notion`, `dropbox`, `spotify`, `twitch`, `reddit`, `tiktok`, `instagram`, `telegram`, `whatsapp`, `amazon`, `bitbucket`, `auth0`, `okta` — also exported as `SOCIAL_PROVIDERS`.
|
|
22
|
+
|
|
23
|
+
## Wording
|
|
24
|
+
|
|
25
|
+
`action` picks the verb of the default label — and of the accessible name when `iconOnly`:
|
|
26
|
+
|
|
27
|
+
| `action` | Label |
|
|
28
|
+
| --- | --- |
|
|
29
|
+
| `continue` (default) | Continue with Google |
|
|
30
|
+
| `signIn` | Sign in with Google |
|
|
31
|
+
| `signUp` | Sign up with Google |
|
|
32
|
+
|
|
33
|
+
Pass `children` to write the label yourself (a localized string, say).
|
|
34
|
+
|
|
35
|
+
## Oxy
|
|
36
|
+
|
|
37
|
+
`brand="oxy"` is Oxy's own mark, drawn two-tone — the mark, and its letters in the colour behind it. It follows Google's treatment: `colorful` is Bloom's **primary button** painted with the theme accent, so it matches the app it sits in; `white` is the secondary button with the mark in the accent; `black` draws it white on near-black. The Oxy SDK's `OxySignInButton` is this button with `action="signIn"`.
|
|
21
38
|
|
|
22
39
|
## Appearance
|
|
23
40
|
|