@oxyhq/bloom 0.19.1 → 0.21.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/lib/commonjs/benefit-list/index.js +119 -0
- package/lib/commonjs/benefit-list/index.js.map +1 -0
- package/lib/commonjs/benefit-list/types.js +6 -0
- package/lib/commonjs/benefit-list/types.js.map +1 -0
- package/lib/commonjs/connection-dots/ConnectionDots.js +112 -0
- package/lib/commonjs/connection-dots/ConnectionDots.js.map +1 -0
- package/lib/commonjs/connection-dots/ConnectionDots.web.js +116 -0
- package/lib/commonjs/connection-dots/ConnectionDots.web.js.map +1 -0
- package/lib/commonjs/connection-dots/ConnectionDotsBase.js +55 -0
- package/lib/commonjs/connection-dots/ConnectionDotsBase.js.map +1 -0
- package/lib/commonjs/connection-dots/index.js +13 -0
- package/lib/commonjs/connection-dots/index.js.map +1 -0
- package/lib/commonjs/connection-dots/index.web.js +13 -0
- package/lib/commonjs/connection-dots/index.web.js.map +1 -0
- package/lib/commonjs/connection-dots/types.js +6 -0
- package/lib/commonjs/connection-dots/types.js.map +1 -0
- package/lib/commonjs/content-panel/index.js +64 -0
- package/lib/commonjs/content-panel/index.js.map +1 -0
- package/lib/commonjs/content-panel/index.web.js +99 -0
- package/lib/commonjs/content-panel/index.web.js.map +1 -0
- package/lib/commonjs/design-tokens/color-roles.js +112 -0
- package/lib/commonjs/design-tokens/color-roles.js.map +1 -0
- package/lib/commonjs/design-tokens/index.js +89 -0
- package/lib/commonjs/design-tokens/index.js.map +1 -0
- package/lib/commonjs/design-tokens/scales.js +168 -0
- package/lib/commonjs/design-tokens/scales.js.map +1 -0
- package/lib/commonjs/design-tokens/shadows.js +48 -0
- package/lib/commonjs/design-tokens/shadows.js.map +1 -0
- package/lib/commonjs/design-tokens/shadows.native.js +53 -0
- package/lib/commonjs/design-tokens/shadows.native.js.map +1 -0
- package/lib/commonjs/design-tokens/tailwind-preset.js +139 -0
- package/lib/commonjs/design-tokens/tailwind-preset.js.map +1 -0
- package/lib/commonjs/design-tokens/theme-css.js +98 -0
- package/lib/commonjs/design-tokens/theme-css.js.map +1 -0
- package/lib/commonjs/index.js +208 -93
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/index.web.js +223 -108
- package/lib/commonjs/index.web.js.map +1 -1
- package/lib/commonjs/text-field/index.js +156 -0
- package/lib/commonjs/text-field/index.js.map +1 -1
- package/lib/module/benefit-list/index.js +114 -0
- package/lib/module/benefit-list/index.js.map +1 -0
- package/lib/module/benefit-list/types.js +4 -0
- package/lib/module/benefit-list/types.js.map +1 -0
- package/lib/module/connection-dots/ConnectionDots.js +107 -0
- package/lib/module/connection-dots/ConnectionDots.js.map +1 -0
- package/lib/module/connection-dots/ConnectionDots.web.js +111 -0
- package/lib/module/connection-dots/ConnectionDots.web.js.map +1 -0
- package/lib/module/connection-dots/ConnectionDotsBase.js +50 -0
- package/lib/module/connection-dots/ConnectionDotsBase.js.map +1 -0
- package/lib/module/connection-dots/index.js +4 -0
- package/lib/module/connection-dots/index.js.map +1 -0
- package/lib/module/connection-dots/index.web.js +4 -0
- package/lib/module/connection-dots/index.web.js.map +1 -0
- package/lib/module/connection-dots/types.js +4 -0
- package/lib/module/connection-dots/types.js.map +1 -0
- package/lib/module/content-panel/index.js +59 -0
- package/lib/module/content-panel/index.js.map +1 -0
- package/lib/module/content-panel/index.web.js +94 -0
- package/lib/module/content-panel/index.web.js.map +1 -0
- package/lib/module/design-tokens/color-roles.js +108 -0
- package/lib/module/design-tokens/color-roles.js.map +1 -0
- package/lib/module/design-tokens/index.js +27 -0
- package/lib/module/design-tokens/index.js.map +1 -0
- package/lib/module/design-tokens/scales.js +164 -0
- package/lib/module/design-tokens/scales.js.map +1 -0
- package/lib/module/design-tokens/shadows.js +43 -0
- package/lib/module/design-tokens/shadows.js.map +1 -0
- package/lib/module/design-tokens/shadows.native.js +48 -0
- package/lib/module/design-tokens/shadows.native.js.map +1 -0
- package/lib/module/design-tokens/tailwind-preset.js +136 -0
- package/lib/module/design-tokens/tailwind-preset.js.map +1 -0
- package/lib/module/design-tokens/theme-css.js +94 -0
- package/lib/module/design-tokens/theme-css.js.map +1 -0
- package/lib/module/index.js +6 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/index.web.js +6 -1
- package/lib/module/index.web.js.map +1 -1
- package/lib/module/text-field/index.js +158 -2
- package/lib/module/text-field/index.js.map +1 -1
- package/lib/typescript/commonjs/benefit-list/index.d.ts +6 -0
- package/lib/typescript/commonjs/benefit-list/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/benefit-list/types.d.ts +35 -0
- package/lib/typescript/commonjs/benefit-list/types.d.ts.map +1 -0
- package/lib/typescript/commonjs/connection-dots/ConnectionDots.d.ts +4 -0
- package/lib/typescript/commonjs/connection-dots/ConnectionDots.d.ts.map +1 -0
- package/lib/typescript/commonjs/connection-dots/ConnectionDots.web.d.ts +14 -0
- package/lib/typescript/commonjs/connection-dots/ConnectionDots.web.d.ts.map +1 -0
- package/lib/typescript/commonjs/connection-dots/ConnectionDotsBase.d.ts +18 -0
- package/lib/typescript/commonjs/connection-dots/ConnectionDotsBase.d.ts.map +1 -0
- package/lib/typescript/commonjs/connection-dots/index.d.ts +3 -0
- package/lib/typescript/commonjs/connection-dots/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/connection-dots/index.web.d.ts +3 -0
- package/lib/typescript/commonjs/connection-dots/index.web.d.ts.map +1 -0
- package/lib/typescript/commonjs/connection-dots/types.d.ts +41 -0
- package/lib/typescript/commonjs/connection-dots/types.d.ts.map +1 -0
- package/lib/typescript/commonjs/content-panel/index.d.ts +54 -0
- package/lib/typescript/commonjs/content-panel/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/content-panel/index.web.d.ts +59 -0
- package/lib/typescript/commonjs/content-panel/index.web.d.ts.map +1 -0
- package/lib/typescript/commonjs/design-tokens/color-roles.d.ts +102 -0
- package/lib/typescript/commonjs/design-tokens/color-roles.d.ts.map +1 -0
- package/lib/typescript/commonjs/design-tokens/index.d.ts +28 -0
- package/lib/typescript/commonjs/design-tokens/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/design-tokens/scales.d.ts +152 -0
- package/lib/typescript/commonjs/design-tokens/scales.d.ts.map +1 -0
- package/lib/typescript/commonjs/design-tokens/shadows.d.ts +34 -0
- package/lib/typescript/commonjs/design-tokens/shadows.d.ts.map +1 -0
- package/lib/typescript/commonjs/design-tokens/shadows.native.d.ts +19 -0
- package/lib/typescript/commonjs/design-tokens/shadows.native.d.ts.map +1 -0
- package/lib/typescript/commonjs/design-tokens/tailwind-preset.d.ts +59 -0
- package/lib/typescript/commonjs/design-tokens/tailwind-preset.d.ts.map +1 -0
- package/lib/typescript/commonjs/design-tokens/theme-css.d.ts +39 -0
- package/lib/typescript/commonjs/design-tokens/theme-css.d.ts.map +1 -0
- package/lib/typescript/commonjs/index.d.ts +6 -0
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/index.web.d.ts +6 -0
- package/lib/typescript/commonjs/index.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/text-field/index.d.ts +14 -1
- package/lib/typescript/commonjs/text-field/index.d.ts.map +1 -1
- package/lib/typescript/module/benefit-list/index.d.ts +6 -0
- package/lib/typescript/module/benefit-list/index.d.ts.map +1 -0
- package/lib/typescript/module/benefit-list/types.d.ts +35 -0
- package/lib/typescript/module/benefit-list/types.d.ts.map +1 -0
- package/lib/typescript/module/connection-dots/ConnectionDots.d.ts +4 -0
- package/lib/typescript/module/connection-dots/ConnectionDots.d.ts.map +1 -0
- package/lib/typescript/module/connection-dots/ConnectionDots.web.d.ts +14 -0
- package/lib/typescript/module/connection-dots/ConnectionDots.web.d.ts.map +1 -0
- package/lib/typescript/module/connection-dots/ConnectionDotsBase.d.ts +18 -0
- package/lib/typescript/module/connection-dots/ConnectionDotsBase.d.ts.map +1 -0
- package/lib/typescript/module/connection-dots/index.d.ts +3 -0
- package/lib/typescript/module/connection-dots/index.d.ts.map +1 -0
- package/lib/typescript/module/connection-dots/index.web.d.ts +3 -0
- package/lib/typescript/module/connection-dots/index.web.d.ts.map +1 -0
- package/lib/typescript/module/connection-dots/types.d.ts +41 -0
- package/lib/typescript/module/connection-dots/types.d.ts.map +1 -0
- package/lib/typescript/module/content-panel/index.d.ts +54 -0
- package/lib/typescript/module/content-panel/index.d.ts.map +1 -0
- package/lib/typescript/module/content-panel/index.web.d.ts +59 -0
- package/lib/typescript/module/content-panel/index.web.d.ts.map +1 -0
- package/lib/typescript/module/design-tokens/color-roles.d.ts +102 -0
- package/lib/typescript/module/design-tokens/color-roles.d.ts.map +1 -0
- package/lib/typescript/module/design-tokens/index.d.ts +28 -0
- package/lib/typescript/module/design-tokens/index.d.ts.map +1 -0
- package/lib/typescript/module/design-tokens/scales.d.ts +152 -0
- package/lib/typescript/module/design-tokens/scales.d.ts.map +1 -0
- package/lib/typescript/module/design-tokens/shadows.d.ts +34 -0
- package/lib/typescript/module/design-tokens/shadows.d.ts.map +1 -0
- package/lib/typescript/module/design-tokens/shadows.native.d.ts +19 -0
- package/lib/typescript/module/design-tokens/shadows.native.d.ts.map +1 -0
- package/lib/typescript/module/design-tokens/tailwind-preset.d.ts +59 -0
- package/lib/typescript/module/design-tokens/tailwind-preset.d.ts.map +1 -0
- package/lib/typescript/module/design-tokens/theme-css.d.ts +39 -0
- package/lib/typescript/module/design-tokens/theme-css.d.ts.map +1 -0
- package/lib/typescript/module/index.d.ts +6 -0
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/index.web.d.ts +6 -0
- package/lib/typescript/module/index.web.d.ts.map +1 -1
- package/lib/typescript/module/text-field/index.d.ts +14 -1
- package/lib/typescript/module/text-field/index.d.ts.map +1 -1
- package/package.json +66 -1
- package/src/__tests__/BenefitList.test.tsx +108 -0
- package/src/__tests__/ConnectionDots.test.tsx +86 -0
- package/src/__tests__/TextFieldFloatingLabel.test.tsx +93 -0
- package/src/__tests__/design-tokens.test.ts +169 -0
- package/src/benefit-list/BenefitList.stories.tsx +50 -0
- package/src/benefit-list/index.tsx +133 -0
- package/src/benefit-list/types.ts +36 -0
- package/src/connection-dots/ConnectionDots.stories.tsx +54 -0
- package/src/connection-dots/ConnectionDots.tsx +139 -0
- package/src/connection-dots/ConnectionDots.web.tsx +122 -0
- package/src/connection-dots/ConnectionDotsBase.tsx +62 -0
- package/src/connection-dots/index.ts +2 -0
- package/src/connection-dots/index.web.ts +2 -0
- package/src/connection-dots/types.ts +41 -0
- package/src/content-panel/index.tsx +87 -0
- package/src/content-panel/index.web.tsx +134 -0
- package/src/design-tokens/color-roles.ts +110 -0
- package/src/design-tokens/index.ts +45 -0
- package/src/design-tokens/scales.ts +134 -0
- package/src/design-tokens/shadows.native.ts +44 -0
- package/src/design-tokens/shadows.ts +42 -0
- package/src/design-tokens/tailwind-preset.ts +139 -0
- package/src/design-tokens/theme-css.ts +99 -0
- package/src/index.ts +33 -0
- package/src/index.web.ts +33 -0
- package/src/text-field/TextField.stories.tsx +46 -0
- package/src/text-field/index.tsx +212 -1
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.PANEL_TOP_INSET = exports.PANEL_BOTTOM_INSET = exports.GUTTER_MASK_SPREAD = exports.ContentPanel = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _useTheme = require("../theme/use-theme.js");
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
12
|
+
/**
|
|
13
|
+
* Web variant of `ContentPanel` — the framed app-content surface.
|
|
14
|
+
*
|
|
15
|
+
* On the web, app content scrolls the DOCUMENT, and a multi-column shell keeps
|
|
16
|
+
* the routed content in a rounded, bordered center panel. Two problems follow
|
|
17
|
+
* from letting feed content bleed to the rounded panel edge, both solved here
|
|
18
|
+
* with sticky, full-viewport-height overlays inside the panel surface:
|
|
19
|
+
*
|
|
20
|
+
* 1. BLEED-MASK overlay (`z-30`): a `box-shadow` ring in the GUTTER color
|
|
21
|
+
* (Bloom `background` token) drawn OVER content that bleeds into the thin
|
|
22
|
+
* lateral gutter / rounded corners. `clip-path: inset(-12px)` keeps that
|
|
23
|
+
* ring off the side columns. It sits below opaque chrome (headers/banners),
|
|
24
|
+
* so it only masks the content's bleed, never the chrome. No border.
|
|
25
|
+
* (`clip-path` MUST be the arbitrary class — RN-web drops it from `style`.)
|
|
26
|
+
*
|
|
27
|
+
* 2. BORDER-FRAME overlay (`z-[120]`): a single 1px rounded `border-border`
|
|
28
|
+
* outline with a transparent interior, ABOVE all content. Being one element
|
|
29
|
+
* above everything, it draws ONE continuous rounded border around all four
|
|
30
|
+
* sides — no seams, no double lines, no per-chrome borders.
|
|
31
|
+
*
|
|
32
|
+
* Both overlays are `position: sticky; top: 8px` with a negative
|
|
33
|
+
* `margin-bottom` so they occupy zero layout height (they overlay the scrolled
|
|
34
|
+
* content rather than displacing it). They render BEFORE the content wrapper so
|
|
35
|
+
* z-index — not DOM order — decides layering.
|
|
36
|
+
*
|
|
37
|
+
* When `framed` is false (narrow screens) the panel is full-bleed: a single
|
|
38
|
+
* flat surface, no rounding, no overlays.
|
|
39
|
+
*
|
|
40
|
+
* Native bundlers use `./index.tsx` (a plain rounded surface); web bundlers
|
|
41
|
+
* select this file via the `"browser"` export condition in `package.json`.
|
|
42
|
+
*
|
|
43
|
+
* Styling is NativeWind-className-first; the literal class strings below MUST
|
|
44
|
+
* stay literal so a consumer's Tailwind content-scan over `lib/**` picks them up
|
|
45
|
+
* (no dynamic concatenation of the arbitrary `web:[…]` / `rounded-radius-28`
|
|
46
|
+
* parts).
|
|
47
|
+
*/
|
|
48
|
+
|
|
49
|
+
/** Width (in px) of the sticky gutter-mask box-shadow ring. */
|
|
50
|
+
const GUTTER_MASK_SPREAD = exports.GUTTER_MASK_SPREAD = 40;
|
|
51
|
+
/** Top sticky inset (px) the framed panel chrome pins to. */
|
|
52
|
+
const PANEL_TOP_INSET = exports.PANEL_TOP_INSET = 8;
|
|
53
|
+
/** Bottom sticky inset (px) of the framed panel chrome. */
|
|
54
|
+
const PANEL_BOTTOM_INSET = exports.PANEL_BOTTOM_INSET = 8;
|
|
55
|
+
const ContentPanelComponent = ({
|
|
56
|
+
children,
|
|
57
|
+
framed,
|
|
58
|
+
surfaceClassName,
|
|
59
|
+
surfaceStyle,
|
|
60
|
+
contentClassName,
|
|
61
|
+
contentStyle,
|
|
62
|
+
showStickyFrame
|
|
63
|
+
}) => {
|
|
64
|
+
const {
|
|
65
|
+
colors
|
|
66
|
+
} = (0, _useTheme.useTheme)();
|
|
67
|
+
if (!framed) {
|
|
68
|
+
// Full-bleed: a single flat surface. No rounding, no sticky overlays.
|
|
69
|
+
const fullBleedClass = ['flex-1', surfaceClassName ?? 'bg-card', contentClassName].filter(Boolean).join(' ');
|
|
70
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
71
|
+
className: fullBleedClass,
|
|
72
|
+
style: [surfaceStyle, contentStyle],
|
|
73
|
+
children: children
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
const surfaceClass = ['flex-1', 'rounded-radius-28', surfaceClassName ?? 'bg-card'].join(' ');
|
|
77
|
+
const contentClass = ['flex-1', 'rounded-radius-28 web:overflow-x-clip', contentClassName].filter(Boolean).join(' ');
|
|
78
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
79
|
+
className: surfaceClass,
|
|
80
|
+
style: surfaceStyle,
|
|
81
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
82
|
+
pointerEvents: "none",
|
|
83
|
+
className: 'web:sticky web:top-2 z-30 h-[calc(100dvh-16px)] w-full rounded-radius-28 web:[margin-bottom:calc(-100dvh+16px)] web:[clip-path:inset(-12px)]',
|
|
84
|
+
style: {
|
|
85
|
+
boxShadow: `0 0 0 ${GUTTER_MASK_SPREAD}px ${colors.background}`
|
|
86
|
+
}
|
|
87
|
+
}), showStickyFrame !== false && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
88
|
+
pointerEvents: "none",
|
|
89
|
+
className: 'web:sticky web:top-2 z-[120] h-[calc(100dvh-16px)] w-full rounded-radius-28 border border-border web:[margin-bottom:calc(-100dvh+16px)]'
|
|
90
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
91
|
+
className: contentClass,
|
|
92
|
+
style: contentStyle,
|
|
93
|
+
children: children
|
|
94
|
+
})]
|
|
95
|
+
});
|
|
96
|
+
};
|
|
97
|
+
const ContentPanel = exports.ContentPanel = /*#__PURE__*/(0, _react.memo)(ContentPanelComponent);
|
|
98
|
+
ContentPanel.displayName = 'ContentPanel';
|
|
99
|
+
//# sourceMappingURL=index.web.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_useTheme","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","GUTTER_MASK_SPREAD","exports","PANEL_TOP_INSET","PANEL_BOTTOM_INSET","ContentPanelComponent","children","framed","surfaceClassName","surfaceStyle","contentClassName","contentStyle","showStickyFrame","colors","useTheme","fullBleedClass","filter","Boolean","join","jsx","View","className","style","surfaceClass","contentClass","jsxs","pointerEvents","boxShadow","background","ContentPanel","memo","displayName"],"sourceRoot":"../../../src","sources":["content-panel/index.web.tsx"],"mappings":";;;;;;AAoCA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,SAAA,GAAAF,OAAA;AAA8C,IAAAG,WAAA,GAAAH,OAAA;AAAA,SAAAD,wBAAAK,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAP,uBAAA,YAAAA,CAAAK,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,CAAA,CAAAE,CAAA,EAAAP,CAAA,EAAAM,CAAA,IAAAC,CAAA,CAAAP,CAAA,IAAAD,CAAA,CAAAC,CAAA,WAAAO,CAAA,KA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;EAEZ,oBACE,IAAArC,WAAA,CAAA4C,IAAA,EAAC9C,YAAA,CAAAyC,IAAI;IACIC,SAAS,EAAEE,YAAY;IAC9BD,KAAK,EAAEb,YAAa;IAAAH,QAAA,gBAGpB,IAAAzB,WAAA,CAAAsC,GAAA,EAACxC,YAAA,CAAAyC,IAAI;MACHM,aAAa,EAAC,MAAM;MAElBL,SAAS,EACP,8IAA8I;MAElJC,KAAK,EAAE;QAAEK,SAAS,EAAE,SAAS1B,kBAAkB,MAAMY,MAAM,CAACe,UAAU;MAAG;IAAE,CAC5E,CAAC,EAEDhB,eAAe,KAAK,KAAK,iBACxB,IAAA/B,WAAA,CAAAsC,GAAA,EAACxC,YAAA,CAAAyC,IAAI;MACHM,aAAa,EAAC,MAAM;MAElBL,SAAS,EACP;IAAyI,CAE9I,CACF,eAED,IAAAxC,WAAA,CAAAsC,GAAA,EAACxC,YAAA,CAAAyC,IAAI;MACIC,SAAS,EAAEG,YAAY;MAC9BF,KAAK,EAAEX,YAAa;MAAAL,QAAA,EAEnBA;IAAQ,CACL,CAAC;EAAA,CACH,CAAC;AAEX,CAAC;AAEM,MAAMuB,YAAY,GAAA3B,OAAA,CAAA2B,YAAA,gBAAG,IAAAC,WAAI,EAACzB,qBAAqB,CAAC;AACvDwB,YAAY,CAACE,WAAW,GAAG,cAAc","ignoreList":[]}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.TEXT_ROLES = exports.FILL_ROLES = exports.BORDER_ROLES = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* Semantic color-role vocabulary for the Oxy Unified Design Language.
|
|
9
|
+
*
|
|
10
|
+
* Every role is an ALIAS onto one of Bloom's existing canonical theme tokens
|
|
11
|
+
* (`--background`, `--surface`, `--primary`, …) — the SINGLE source of resolved
|
|
12
|
+
* color values produced by `getResolvedTokens` and written to the document root
|
|
13
|
+
* (web) / `rootVariables` (native) by `BloomThemeProvider`. No color VALUE is
|
|
14
|
+
* invented here: a role's value is the `var(--canonical)` reference, so it stays
|
|
15
|
+
* driven by the active light/dark mode and color preset automatically.
|
|
16
|
+
*
|
|
17
|
+
* The maps are consumed by the Bloom Tailwind preset (`tailwind-preset.ts`),
|
|
18
|
+
* which slots them into `theme.extend.{backgroundColor,textColor,borderColor}`.
|
|
19
|
+
* Because the values are `var(--x)` strings, the SAME class names resolve on
|
|
20
|
+
* Tailwind (web) and NativeWind (native): web reads the CSS custom property from
|
|
21
|
+
* `document.documentElement`; native reads it from react-native-css's
|
|
22
|
+
* `rootVariables` family — both populated by Bloom from one pipeline.
|
|
23
|
+
*
|
|
24
|
+
* Web CSS-var contract (see Bloom AGENTS.md): base `--x` tokens already resolve
|
|
25
|
+
* to a FULL `rgb(...)` color at runtime, so the role values reference them with
|
|
26
|
+
* `var(--x)` directly — NEVER `hsl(var(--x))`.
|
|
27
|
+
*
|
|
28
|
+
* ADDITIVE: these are NEW utility names (`bg-fill`, `text-text-tertiary`,
|
|
29
|
+
* `border-border-image`, …). They do not touch the existing app-defined color
|
|
30
|
+
* utilities (`bg-background`, `text-muted-foreground`, …), which keep working.
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
/** A `var(--canonical-token)` reference string. */
|
|
34
|
+
|
|
35
|
+
const ref = token => `var(--${token})`;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Surface / fill roles → background-color utilities (`bg-<role>`).
|
|
39
|
+
*
|
|
40
|
+
* | role | utility | canonical token | rationale |
|
|
41
|
+
* | ----------------- | ------------------ | ----------------- | ------------------------------------------- |
|
|
42
|
+
* | bg | bg-bg | --background | the page background |
|
|
43
|
+
* | fill | bg-fill | --card | default raised surface (cards/sheets) |
|
|
44
|
+
* | fill-secondary | bg-fill-secondary | --muted | muted/secondary fill |
|
|
45
|
+
* | fill-hover | bg-fill-hover | --accent | hover state of a secondary fill |
|
|
46
|
+
* | fill-brand | bg-fill-brand | --primary | brand-colored fill |
|
|
47
|
+
* | fill-brand-hover | bg-fill-brand-hover| --ring | hover of brand fill (ring == primary hue) |
|
|
48
|
+
* | fill-inverse | bg-fill-inverse | --foreground | inverse (high-contrast) fill |
|
|
49
|
+
* | fill-inverse-hover| bg-fill-inverse-hov| --muted-foreground| hover of inverse fill |
|
|
50
|
+
* | fill-placeholder | bg-fill-placeholder| --muted | disabled/placeholder surface |
|
|
51
|
+
*/
|
|
52
|
+
const FILL_ROLES = exports.FILL_ROLES = {
|
|
53
|
+
bg: ref('background'),
|
|
54
|
+
fill: ref('card'),
|
|
55
|
+
'fill-secondary': ref('muted'),
|
|
56
|
+
'fill-hover': ref('accent'),
|
|
57
|
+
'fill-brand': ref('primary'),
|
|
58
|
+
'fill-brand-hover': ref('ring'),
|
|
59
|
+
'fill-inverse': ref('foreground'),
|
|
60
|
+
'fill-inverse-hover': ref('muted-foreground'),
|
|
61
|
+
'fill-placeholder': ref('muted')
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Text roles → text-color utilities (`text-<role>`).
|
|
66
|
+
*
|
|
67
|
+
* Tailwind prefixes text-color utilities with `text-`, so a role literally
|
|
68
|
+
* named `text` becomes the utility `text-text`, `text-secondary` → the utility
|
|
69
|
+
* `text-text-secondary`, etc. (matches the namespaced spec).
|
|
70
|
+
*
|
|
71
|
+
* | role | utility | canonical token | rationale |
|
|
72
|
+
* | ---------------- | --------------------- | --------------------- | ---------------------------------- |
|
|
73
|
+
* | text | text-text | --foreground | primary text |
|
|
74
|
+
* | text-secondary | text-text-secondary | --muted-foreground | secondary text |
|
|
75
|
+
* | text-tertiary | text-text-tertiary | --muted-foreground | tertiary/least-emphasis text |
|
|
76
|
+
* | text-inverse | text-text-inverse | --primary-foreground | text on a brand fill |
|
|
77
|
+
* | text-fixed-light | text-text-fixed-light | --primary-foreground | always-light text (on brand) |
|
|
78
|
+
* | text-placeholder | text-text-placeholder | --muted-foreground | placeholder/input hint |
|
|
79
|
+
*/
|
|
80
|
+
const TEXT_ROLES = exports.TEXT_ROLES = {
|
|
81
|
+
text: ref('foreground'),
|
|
82
|
+
'text-secondary': ref('muted-foreground'),
|
|
83
|
+
'text-tertiary': ref('muted-foreground'),
|
|
84
|
+
'text-inverse': ref('primary-foreground'),
|
|
85
|
+
'text-fixed-light': ref('primary-foreground'),
|
|
86
|
+
'text-placeholder': ref('muted-foreground')
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Border roles → border-color utilities (`border-<role>`).
|
|
91
|
+
*
|
|
92
|
+
* | role | utility | canonical token | rationale |
|
|
93
|
+
* | ------------------ | ----------------------- | --------------- | ------------------------------------------ |
|
|
94
|
+
* | border | border-border | --border | default border |
|
|
95
|
+
* | border-image | border-border-image | --border | hairline border color (0.5px width helper) |
|
|
96
|
+
* | border-secondary | border-border-secondary | --input | secondary/softer border |
|
|
97
|
+
* | border-input | border-border-input | --input | input field border |
|
|
98
|
+
* | border-input-active| border-border-input-active | --ring | focused input border (== primary) |
|
|
99
|
+
*
|
|
100
|
+
* NOTE: the hairline 0.5px WIDTH for `border-image` is shipped as a separate
|
|
101
|
+
* `borderWidth` scale entry (`border-hairline`) in the preset; the color role
|
|
102
|
+
* above only provides the matching color. Consumers compose them:
|
|
103
|
+
* `border-hairline border-border-image`.
|
|
104
|
+
*/
|
|
105
|
+
const BORDER_ROLES = exports.BORDER_ROLES = {
|
|
106
|
+
border: ref('border'),
|
|
107
|
+
'border-image': ref('border'),
|
|
108
|
+
'border-secondary': ref('input'),
|
|
109
|
+
'border-input': ref('input'),
|
|
110
|
+
'border-input-active': ref('ring')
|
|
111
|
+
};
|
|
112
|
+
//# sourceMappingURL=color-roles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["ref","token","FILL_ROLES","exports","bg","fill","TEXT_ROLES","text","BORDER_ROLES","border"],"sourceRoot":"../../../src","sources":["design-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A;AACA;AACA;AACA;AACA;AACA;AACO,MAAMQ,YAAY,GAAAL,OAAA,CAAAK,YAAA,GAAG;EAC1BC,MAAM,EAAET,GAAG,CAAC,QAAQ,CAAC;EACrB,cAAc,EAAEA,GAAG,CAAC,QAAQ,CAAC;EAC7B,kBAAkB,EAAEA,GAAG,CAAC,OAAO,CAAC;EAChC,cAAc,EAAEA,GAAG,CAAC,OAAO,CAAC;EAC5B,qBAAqB,EAAEA,GAAG,CAAC,MAAM;AACnC,CAAU","ignoreList":[]}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "BORDER_ROLES", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _colorRoles.BORDER_ROLES;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "BORDER_WIDTH", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _scales.BORDER_WIDTH;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "FILL_ROLES", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _colorRoles.FILL_ROLES;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "FONT_FAMILY_VARS", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _scales.FONT_FAMILY_VARS;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(exports, "RADIUS", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () {
|
|
33
|
+
return _scales.RADIUS;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
Object.defineProperty(exports, "SHADOW_BOX", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function () {
|
|
39
|
+
return _shadows.SHADOW_BOX;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
Object.defineProperty(exports, "SPACING", {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
get: function () {
|
|
45
|
+
return _scales.SPACING;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
Object.defineProperty(exports, "TEXT_ROLES", {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
get: function () {
|
|
51
|
+
return _colorRoles.TEXT_ROLES;
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
Object.defineProperty(exports, "TYPOGRAPHY", {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
get: function () {
|
|
57
|
+
return _scales.TYPOGRAPHY;
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
Object.defineProperty(exports, "bloomShadowStyle", {
|
|
61
|
+
enumerable: true,
|
|
62
|
+
get: function () {
|
|
63
|
+
return _shadows.bloomShadowStyle;
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
Object.defineProperty(exports, "bloomTailwindPreset", {
|
|
67
|
+
enumerable: true,
|
|
68
|
+
get: function () {
|
|
69
|
+
return _tailwindPreset.bloomTailwindPreset;
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
Object.defineProperty(exports, "bloomThemeBlock", {
|
|
73
|
+
enumerable: true,
|
|
74
|
+
get: function () {
|
|
75
|
+
return _themeCss.bloomThemeBlock;
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
Object.defineProperty(exports, "bloomThemeCss", {
|
|
79
|
+
enumerable: true,
|
|
80
|
+
get: function () {
|
|
81
|
+
return _themeCss.bloomThemeCss;
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
var _tailwindPreset = require("./tailwind-preset.js");
|
|
85
|
+
var _themeCss = require("./theme-css.js");
|
|
86
|
+
var _colorRoles = require("./color-roles.js");
|
|
87
|
+
var _scales = require("./scales.js");
|
|
88
|
+
var _shadows = require("./shadows");
|
|
89
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_tailwindPreset","require","_themeCss","_colorRoles","_scales","_shadows"],"sourceRoot":"../../../src","sources":["design-tokens/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBA,IAAAA,eAAA,GAAAC,OAAA;AAMA,IAAAC,SAAA,GAAAD,OAAA;AAEA,IAAAE,WAAA,GAAAF,OAAA;AAOA,IAAAG,OAAA,GAAAH,OAAA;AASA,IAAAI,QAAA,GAAAJ,OAAA","ignoreList":[]}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.TYPOGRAPHY = exports.SPACING = exports.RADIUS = exports.FONT_FAMILY_VARS = exports.BORDER_WIDTH = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* Numeric design-token scales for the Oxy Unified Design Language.
|
|
9
|
+
*
|
|
10
|
+
* These are platform-agnostic plain numbers / CSS strings consumed by the Bloom
|
|
11
|
+
* Tailwind preset (`tailwind-preset.ts`). The SAME keys produce the SAME utility
|
|
12
|
+
* class names on Tailwind (web) and NativeWind (native):
|
|
13
|
+
* - spacing → `p-space-8`, `gap-space-20`, `px-screen-margin`, `m-space-16`
|
|
14
|
+
* - radius → `rounded-radius-20`
|
|
15
|
+
* - type → `font-body` (family/weight) + `text-body` (size/lineHeight)
|
|
16
|
+
* - shadow → `shadow-s`, `shadow-m`
|
|
17
|
+
*
|
|
18
|
+
* ADDITIVE: every key is namespaced (`space-*`, `radius-*`, the typography role
|
|
19
|
+
* names, `shadow-s/m`) and does not collide with Tailwind's built-in numeric
|
|
20
|
+
* scale (`p-4`, `rounded-lg`, `text-sm`) — those keep working unchanged.
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
/* -------------------------------------------------------------------------- */
|
|
24
|
+
/* Spacing */
|
|
25
|
+
/* -------------------------------------------------------------------------- */
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Spacing scale (px). Consumed via every Tailwind spacing utility:
|
|
29
|
+
* `p-space-8`, `px-space-16`, `gap-space-20`, `m-space-24`, `py-space-12`, …
|
|
30
|
+
*
|
|
31
|
+
* `screen-margin` is the standard page gutter (left/right inset). Default 20px —
|
|
32
|
+
* matches Bloom's existing `space.xl` and the `Dialog` default `contentPadding`.
|
|
33
|
+
*/
|
|
34
|
+
const SPACING = exports.SPACING = {
|
|
35
|
+
'space-2': 2,
|
|
36
|
+
'space-4': 4,
|
|
37
|
+
'space-8': 8,
|
|
38
|
+
'space-12': 12,
|
|
39
|
+
'space-16': 16,
|
|
40
|
+
'space-20': 20,
|
|
41
|
+
'space-24': 24,
|
|
42
|
+
'space-32': 32,
|
|
43
|
+
'screen-margin': 20
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
/* -------------------------------------------------------------------------- */
|
|
47
|
+
/* Radius */
|
|
48
|
+
/* -------------------------------------------------------------------------- */
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Corner-radius scale (px). Consumed via `rounded-radius-*`:
|
|
52
|
+
* `rounded-radius-8`, `rounded-radius-12`, `rounded-radius-20`,
|
|
53
|
+
* `rounded-radius-28`, `rounded-radius-max` (pill / circle).
|
|
54
|
+
*/
|
|
55
|
+
const RADIUS = exports.RADIUS = {
|
|
56
|
+
'radius-8': 8,
|
|
57
|
+
'radius-12': 12,
|
|
58
|
+
'radius-20': 20,
|
|
59
|
+
'radius-28': 28,
|
|
60
|
+
'radius-max': 9999
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
/* -------------------------------------------------------------------------- */
|
|
64
|
+
/* Border width (hairline) */
|
|
65
|
+
/* -------------------------------------------------------------------------- */
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Border-width helpers. `border-hairline` is the 0.5px hairline that pairs with
|
|
69
|
+
* the `border-border-image` color role. (Tailwind's default `border` = 1px
|
|
70
|
+
* stays untouched.)
|
|
71
|
+
*/
|
|
72
|
+
const BORDER_WIDTH = exports.BORDER_WIDTH = {
|
|
73
|
+
hairline: 0.5
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
/* -------------------------------------------------------------------------- */
|
|
77
|
+
/* Typography */
|
|
78
|
+
/* -------------------------------------------------------------------------- */
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* One typography role. `size`/`lineHeight` are px; `weight` is a CSS font-weight
|
|
82
|
+
* string; `family` selects the Bloom font CSS var (`sans` = body/UI,
|
|
83
|
+
* `display` = headings/serif).
|
|
84
|
+
*
|
|
85
|
+
* The Tailwind preset splits each role into TWO utilities so a consumer can
|
|
86
|
+
* apply the size/leading and the family/weight independently or together:
|
|
87
|
+
* - `text-<role>` → `fontSize` + `lineHeight` (via theme.fontSize)
|
|
88
|
+
* - `font-<role>` → `fontFamily` + `fontWeight` (via theme.fontFamily, which
|
|
89
|
+
* maps a key to a [family, { fontWeight }] tuple)
|
|
90
|
+
*/
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* The coherent Oxy type scale. Sizes climb 11 → 28; line-heights use a ~1.3–1.5
|
|
94
|
+
* leading for body roles and tighter leading for large titles.
|
|
95
|
+
*
|
|
96
|
+
* | role | size/line | weight | family | usage |
|
|
97
|
+
* | --------------- | --------- | ------ | ------- | ------------------------------ |
|
|
98
|
+
* | caption | 11 / 14 | 400 | sans | timestamps, meta, fine print |
|
|
99
|
+
* | bodySmall | 13 / 18 | 400 | sans | secondary body, captions |
|
|
100
|
+
* | bodyTitleSmall | 13 / 18 | 600 | sans | small emphasized labels |
|
|
101
|
+
* | body | 15 / 22 | 400 | sans | default body text |
|
|
102
|
+
* | subtitle | 17 / 24 | 500 | sans | list subtitles, lead-ins |
|
|
103
|
+
* | sectionTitle | 20 / 26 | 600 | sans | section headers |
|
|
104
|
+
* | headerBold | 28 / 34 | 700 | display | screen / page titles |
|
|
105
|
+
* | buttonLarge | 17 / 22 | 600 | sans | primary button label |
|
|
106
|
+
*/
|
|
107
|
+
const TYPOGRAPHY = exports.TYPOGRAPHY = {
|
|
108
|
+
caption: {
|
|
109
|
+
size: 11,
|
|
110
|
+
lineHeight: 14,
|
|
111
|
+
weight: '400',
|
|
112
|
+
family: 'sans'
|
|
113
|
+
},
|
|
114
|
+
bodySmall: {
|
|
115
|
+
size: 13,
|
|
116
|
+
lineHeight: 18,
|
|
117
|
+
weight: '400',
|
|
118
|
+
family: 'sans'
|
|
119
|
+
},
|
|
120
|
+
bodyTitleSmall: {
|
|
121
|
+
size: 13,
|
|
122
|
+
lineHeight: 18,
|
|
123
|
+
weight: '600',
|
|
124
|
+
family: 'sans'
|
|
125
|
+
},
|
|
126
|
+
body: {
|
|
127
|
+
size: 15,
|
|
128
|
+
lineHeight: 22,
|
|
129
|
+
weight: '400',
|
|
130
|
+
family: 'sans'
|
|
131
|
+
},
|
|
132
|
+
subtitle: {
|
|
133
|
+
size: 17,
|
|
134
|
+
lineHeight: 24,
|
|
135
|
+
weight: '500',
|
|
136
|
+
family: 'sans'
|
|
137
|
+
},
|
|
138
|
+
sectionTitle: {
|
|
139
|
+
size: 20,
|
|
140
|
+
lineHeight: 26,
|
|
141
|
+
weight: '600',
|
|
142
|
+
family: 'sans'
|
|
143
|
+
},
|
|
144
|
+
headerBold: {
|
|
145
|
+
size: 28,
|
|
146
|
+
lineHeight: 34,
|
|
147
|
+
weight: '700',
|
|
148
|
+
family: 'display'
|
|
149
|
+
},
|
|
150
|
+
buttonLarge: {
|
|
151
|
+
size: 17,
|
|
152
|
+
lineHeight: 22,
|
|
153
|
+
weight: '600',
|
|
154
|
+
family: 'sans'
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
/**
|
|
158
|
+
* Bloom font-family CSS-var stacks, keyed by the `family` field above. Web reads
|
|
159
|
+
* `var(--bloom-font-*)` (set by `applyFontFaces`); the preset falls back to the
|
|
160
|
+
* literal stack so utilities still resolve before the vars are injected and on
|
|
161
|
+
* native (where NativeWind passes the family string straight through).
|
|
162
|
+
*/
|
|
163
|
+
const FONT_FAMILY_VARS = exports.FONT_FAMILY_VARS = {
|
|
164
|
+
sans: 'var(--bloom-font-sans)',
|
|
165
|
+
display: 'var(--bloom-font-display)',
|
|
166
|
+
mono: 'var(--bloom-font-mono)'
|
|
167
|
+
};
|
|
168
|
+
//# sourceMappingURL=scales.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["SPACING","exports","RADIUS","BORDER_WIDTH","hairline","TYPOGRAPHY","caption","size","lineHeight","weight","family","bodySmall","bodyTitleSmall","body","subtitle","sectionTitle","headerBold","buttonLarge","FONT_FAMILY_VARS","sans","display","mono"],"sourceRoot":"../../../src","sources":["design-tokens/scales.ts"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,OAAO,GAAAC,OAAA,CAAAD,OAAA,GAAG;EACrB,SAAS,EAAE,CAAC;EACZ,SAAS,EAAE,CAAC;EACZ,SAAS,EAAE,CAAC;EACZ,UAAU,EAAE,EAAE;EACd,UAAU,EAAE,EAAE;EACd,UAAU,EAAE,EAAE;EACd,UAAU,EAAE,EAAE;EACd,UAAU,EAAE,EAAE;EACd,eAAe,EAAE;AACnB,CAAU;;AAEV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACO,MAAME,MAAM,GAAAD,OAAA,CAAAC,MAAA,GAAG;EACpB,UAAU,EAAE,CAAC;EACb,WAAW,EAAE,EAAE;EACf,WAAW,EAAE,EAAE;EACf,WAAW,EAAE,EAAE;EACf,YAAY,EAAE;AAChB,CAAU;;AAEV;AACA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I,EAAE,EAAE;IAAEC,UAAU,EAAE,EAAE;IAAEC,MAAM,EAAE,KAAK;IAAEC,MAAM,EAAE;EAAO;AACzE,CAA6C;AAI7C;AACA;AACA;AACA;AACA;AACA;AACO,MAAMQ,gBAAgB,GAAAjB,OAAA,CAAAiB,gBAAA,GAAG;EAC9BC,IAAI,EAAE,wBAAwB;EAC9BC,OAAO,EAAE,2BAA2B;EACpCC,IAAI,EAAE;AACR,CAAU","ignoreList":[]}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.SHADOW_BOX = void 0;
|
|
7
|
+
exports.bloomShadowStyle = bloomShadowStyle;
|
|
8
|
+
/**
|
|
9
|
+
* Elevation / shadow tokens for the Oxy Unified Design Language.
|
|
10
|
+
*
|
|
11
|
+
* Two roles: `shadow-s` (subtle raise — cards, chips) and `shadow-m` (overlays —
|
|
12
|
+
* menus, popovers, dialogs). Consumers write ONE class (`shadow-s` / `shadow-m`)
|
|
13
|
+
* and Bloom owns the platform split:
|
|
14
|
+
* - Web: the Bloom Tailwind preset registers `boxShadow.s` / `boxShadow.m`
|
|
15
|
+
* (the `SHADOW_BOX` strings below) → `shadow-s` / `shadow-m` utilities.
|
|
16
|
+
* - Native: NativeWind cannot translate a multi-layer web `box-shadow` to RN
|
|
17
|
+
* elevation reliably, so apps that need the shadow on a React Native surface
|
|
18
|
+
* apply the matching style object from `bloomShadowStyle('s' | 'm')` (this
|
|
19
|
+
* module is platform-forked: `.native.ts` returns RN `shadow*`/`elevation`).
|
|
20
|
+
*
|
|
21
|
+
* This default file is the WEB / consumer-tsc variant. Metro selects the sibling
|
|
22
|
+
* `shadows.native.ts` on iOS/Android. Web bundlers and a consumer's `tsc` see
|
|
23
|
+
* this file (the `box-shadow` CSS string path), matching Bloom's existing
|
|
24
|
+
* `.native`/`.web` split convention.
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Web `box-shadow` strings. Subtle, brand-neutral elevation that reads on both
|
|
29
|
+
* light and dark surfaces. Registered by the Tailwind preset as `boxShadow.s/m`.
|
|
30
|
+
*/
|
|
31
|
+
const SHADOW_BOX = exports.SHADOW_BOX = {
|
|
32
|
+
s: '0 1px 2px rgb(0 0 0 / 0.06), 0 1px 3px rgb(0 0 0 / 0.10)',
|
|
33
|
+
m: '0 4px 12px rgb(0 0 0 / 0.08), 0 2px 6px rgb(0 0 0 / 0.12)'
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Return the platform-appropriate shadow style for a role.
|
|
38
|
+
*
|
|
39
|
+
* On WEB this returns a `{ boxShadow }` style object (so it can also be applied
|
|
40
|
+
* inline without Tailwind). The `.native.ts` fork returns RN
|
|
41
|
+
* `shadowColor/shadowOffset/shadowOpacity/shadowRadius/elevation`.
|
|
42
|
+
*/
|
|
43
|
+
function bloomShadowStyle(role) {
|
|
44
|
+
return {
|
|
45
|
+
boxShadow: SHADOW_BOX[role]
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=shadows.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["SHADOW_BOX","exports","s","m","bloomShadowStyle","role","boxShadow"],"sourceRoot":"../../../src","sources":["design-tokens/shadows.ts"],"mappings":";;;;;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACO,MAAMA,UAAsC,GAAAC,OAAA,CAAAD,UAAA,GAAG;EACpDE,CAAC,EAAE,0DAA0D;EAC7DC,CAAC,EAAE;AACL,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,gBAAgBA,CAACC,IAAgB,EAAa;EAC5D,OAAO;IAAEC,SAAS,EAAEN,UAAU,CAACK,IAAI;EAAE,CAAC;AACxC","ignoreList":[]}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.SHADOW_BOX = void 0;
|
|
7
|
+
exports.bloomShadowStyle = bloomShadowStyle;
|
|
8
|
+
/**
|
|
9
|
+
* NATIVE variant of the shadow tokens (see `shadows.ts` for the rationale and
|
|
10
|
+
* the web `box-shadow` path). Metro selects this file on iOS/Android.
|
|
11
|
+
*
|
|
12
|
+
* The `SHADOW_BOX` map is kept identical to the web file so any code that reads
|
|
13
|
+
* the raw string (e.g. to feed a NativeWind `boxShadow` utility on a host that
|
|
14
|
+
* supports it) stays in lockstep; the canonical native styling path is
|
|
15
|
+
* `bloomShadowStyle`, which returns RN elevation + shadow props tuned to match
|
|
16
|
+
* the web `shadow-s` / `shadow-m` visual weight.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
const SHADOW_BOX = exports.SHADOW_BOX = {
|
|
20
|
+
s: '0 1px 2px rgb(0 0 0 / 0.06), 0 1px 3px rgb(0 0 0 / 0.10)',
|
|
21
|
+
m: '0 4px 12px rgb(0 0 0 / 0.08), 0 2px 6px rgb(0 0 0 / 0.12)'
|
|
22
|
+
};
|
|
23
|
+
const NATIVE_SHADOWS = {
|
|
24
|
+
s: {
|
|
25
|
+
shadowColor: '#000000',
|
|
26
|
+
shadowOffset: {
|
|
27
|
+
width: 0,
|
|
28
|
+
height: 1
|
|
29
|
+
},
|
|
30
|
+
shadowOpacity: 0.12,
|
|
31
|
+
shadowRadius: 3,
|
|
32
|
+
elevation: 2
|
|
33
|
+
},
|
|
34
|
+
m: {
|
|
35
|
+
shadowColor: '#000000',
|
|
36
|
+
shadowOffset: {
|
|
37
|
+
width: 0,
|
|
38
|
+
height: 4
|
|
39
|
+
},
|
|
40
|
+
shadowOpacity: 0.16,
|
|
41
|
+
shadowRadius: 12,
|
|
42
|
+
elevation: 6
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* RN shadow/elevation style matching the web `shadow-<role>` weight. Apply to a
|
|
48
|
+
* React Native `View`/surface: `style={bloomShadowStyle('m')}`.
|
|
49
|
+
*/
|
|
50
|
+
function bloomShadowStyle(role) {
|
|
51
|
+
return NATIVE_SHADOWS[role];
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=shadows.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["SHADOW_BOX","exports","s","m","NATIVE_SHADOWS","shadowColor","shadowOffset","width","height","shadowOpacity","shadowRadius","elevation","bloomShadowStyle","role"],"sourceRoot":"../../../src","sources":["design-tokens/shadows.native.ts"],"mappings":";;;;;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIO,MAAMA,UAAsC,GAAAC,OAAA,CAAAD,UAAA,GAAG;EACpDE,CAAC,EAAE,0DAA0D;EAC7DC,CAAC,EAAE;AACL,CAAC;AAED,MAAMC,cAA6C,GAAG;EACpDF,CAAC,EAAE;IACDG,WAAW,EAAE,SAAS;IACtBC,YAAY,EAAE;MAAEC,KAAK,EAAE,CAAC;MAAEC,MAAM,EAAE;IAAE,CAAC;IACrCC,aAAa,EAAE,IAAI;IACnBC,YAAY,EAAE,CAAC;IACfC,SAAS,EAAE;EACb,CAAC;EACDR,CAAC,EAAE;IACDE,WAAW,EAAE,SAAS;IACtBC,YAAY,EAAE;MAAEC,KAAK,EAAE,CAAC;MAAEC,MAAM,EAAE;IAAE,CAAC;IACrCC,aAAa,EAAE,IAAI;IACnBC,YAAY,EAAE,EAAE;IAChBC,SAAS,EAAE;EACb;AACF,CAAC;;AAED;AACA;AACA;AACA;AACO,SAASC,gBAAgBA,CAACC,IAAgB,EAAa;EAC5D,OAAOT,cAAc,CAACS,IAAI,CAAC;AAC7B","ignoreList":[]}
|