@oxyhq/bloom 0.19.0 → 0.20.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.
Files changed (173) hide show
  1. package/lib/commonjs/benefit-list/index.js +119 -0
  2. package/lib/commonjs/benefit-list/index.js.map +1 -0
  3. package/lib/commonjs/benefit-list/types.js +6 -0
  4. package/lib/commonjs/benefit-list/types.js.map +1 -0
  5. package/lib/commonjs/button/Button.web.js +1 -1
  6. package/lib/commonjs/connection-dots/ConnectionDots.js +112 -0
  7. package/lib/commonjs/connection-dots/ConnectionDots.js.map +1 -0
  8. package/lib/commonjs/connection-dots/ConnectionDots.web.js +116 -0
  9. package/lib/commonjs/connection-dots/ConnectionDots.web.js.map +1 -0
  10. package/lib/commonjs/connection-dots/ConnectionDotsBase.js +55 -0
  11. package/lib/commonjs/connection-dots/ConnectionDotsBase.js.map +1 -0
  12. package/lib/commonjs/connection-dots/index.js +13 -0
  13. package/lib/commonjs/connection-dots/index.js.map +1 -0
  14. package/lib/commonjs/connection-dots/index.web.js +13 -0
  15. package/lib/commonjs/connection-dots/index.web.js.map +1 -0
  16. package/lib/commonjs/connection-dots/types.js +6 -0
  17. package/lib/commonjs/connection-dots/types.js.map +1 -0
  18. package/lib/commonjs/design-tokens/color-roles.js +112 -0
  19. package/lib/commonjs/design-tokens/color-roles.js.map +1 -0
  20. package/lib/commonjs/design-tokens/index.js +89 -0
  21. package/lib/commonjs/design-tokens/index.js.map +1 -0
  22. package/lib/commonjs/design-tokens/scales.js +168 -0
  23. package/lib/commonjs/design-tokens/scales.js.map +1 -0
  24. package/lib/commonjs/design-tokens/shadows.js +48 -0
  25. package/lib/commonjs/design-tokens/shadows.js.map +1 -0
  26. package/lib/commonjs/design-tokens/shadows.native.js +53 -0
  27. package/lib/commonjs/design-tokens/shadows.native.js.map +1 -0
  28. package/lib/commonjs/design-tokens/tailwind-preset.js +139 -0
  29. package/lib/commonjs/design-tokens/tailwind-preset.js.map +1 -0
  30. package/lib/commonjs/design-tokens/theme-css.js +98 -0
  31. package/lib/commonjs/design-tokens/theme-css.js.map +1 -0
  32. package/lib/commonjs/index.js +208 -93
  33. package/lib/commonjs/index.js.map +1 -1
  34. package/lib/commonjs/index.web.js +223 -108
  35. package/lib/commonjs/index.web.js.map +1 -1
  36. package/lib/commonjs/text-field/index.js +156 -0
  37. package/lib/commonjs/text-field/index.js.map +1 -1
  38. package/lib/module/benefit-list/index.js +114 -0
  39. package/lib/module/benefit-list/index.js.map +1 -0
  40. package/lib/module/benefit-list/types.js +4 -0
  41. package/lib/module/benefit-list/types.js.map +1 -0
  42. package/lib/module/button/Button.web.js +1 -1
  43. package/lib/module/connection-dots/ConnectionDots.js +107 -0
  44. package/lib/module/connection-dots/ConnectionDots.js.map +1 -0
  45. package/lib/module/connection-dots/ConnectionDots.web.js +111 -0
  46. package/lib/module/connection-dots/ConnectionDots.web.js.map +1 -0
  47. package/lib/module/connection-dots/ConnectionDotsBase.js +50 -0
  48. package/lib/module/connection-dots/ConnectionDotsBase.js.map +1 -0
  49. package/lib/module/connection-dots/index.js +4 -0
  50. package/lib/module/connection-dots/index.js.map +1 -0
  51. package/lib/module/connection-dots/index.web.js +4 -0
  52. package/lib/module/connection-dots/index.web.js.map +1 -0
  53. package/lib/module/connection-dots/types.js +4 -0
  54. package/lib/module/connection-dots/types.js.map +1 -0
  55. package/lib/module/design-tokens/color-roles.js +108 -0
  56. package/lib/module/design-tokens/color-roles.js.map +1 -0
  57. package/lib/module/design-tokens/index.js +27 -0
  58. package/lib/module/design-tokens/index.js.map +1 -0
  59. package/lib/module/design-tokens/scales.js +164 -0
  60. package/lib/module/design-tokens/scales.js.map +1 -0
  61. package/lib/module/design-tokens/shadows.js +43 -0
  62. package/lib/module/design-tokens/shadows.js.map +1 -0
  63. package/lib/module/design-tokens/shadows.native.js +48 -0
  64. package/lib/module/design-tokens/shadows.native.js.map +1 -0
  65. package/lib/module/design-tokens/tailwind-preset.js +136 -0
  66. package/lib/module/design-tokens/tailwind-preset.js.map +1 -0
  67. package/lib/module/design-tokens/theme-css.js +94 -0
  68. package/lib/module/design-tokens/theme-css.js.map +1 -0
  69. package/lib/module/index.js +6 -1
  70. package/lib/module/index.js.map +1 -1
  71. package/lib/module/index.web.js +6 -1
  72. package/lib/module/index.web.js.map +1 -1
  73. package/lib/module/text-field/index.js +158 -2
  74. package/lib/module/text-field/index.js.map +1 -1
  75. package/lib/typescript/commonjs/benefit-list/index.d.ts +6 -0
  76. package/lib/typescript/commonjs/benefit-list/index.d.ts.map +1 -0
  77. package/lib/typescript/commonjs/benefit-list/types.d.ts +35 -0
  78. package/lib/typescript/commonjs/benefit-list/types.d.ts.map +1 -0
  79. package/lib/typescript/commonjs/connection-dots/ConnectionDots.d.ts +4 -0
  80. package/lib/typescript/commonjs/connection-dots/ConnectionDots.d.ts.map +1 -0
  81. package/lib/typescript/commonjs/connection-dots/ConnectionDots.web.d.ts +14 -0
  82. package/lib/typescript/commonjs/connection-dots/ConnectionDots.web.d.ts.map +1 -0
  83. package/lib/typescript/commonjs/connection-dots/ConnectionDotsBase.d.ts +18 -0
  84. package/lib/typescript/commonjs/connection-dots/ConnectionDotsBase.d.ts.map +1 -0
  85. package/lib/typescript/commonjs/connection-dots/index.d.ts +3 -0
  86. package/lib/typescript/commonjs/connection-dots/index.d.ts.map +1 -0
  87. package/lib/typescript/commonjs/connection-dots/index.web.d.ts +3 -0
  88. package/lib/typescript/commonjs/connection-dots/index.web.d.ts.map +1 -0
  89. package/lib/typescript/commonjs/connection-dots/types.d.ts +41 -0
  90. package/lib/typescript/commonjs/connection-dots/types.d.ts.map +1 -0
  91. package/lib/typescript/commonjs/design-tokens/color-roles.d.ts +102 -0
  92. package/lib/typescript/commonjs/design-tokens/color-roles.d.ts.map +1 -0
  93. package/lib/typescript/commonjs/design-tokens/index.d.ts +28 -0
  94. package/lib/typescript/commonjs/design-tokens/index.d.ts.map +1 -0
  95. package/lib/typescript/commonjs/design-tokens/scales.d.ts +152 -0
  96. package/lib/typescript/commonjs/design-tokens/scales.d.ts.map +1 -0
  97. package/lib/typescript/commonjs/design-tokens/shadows.d.ts +34 -0
  98. package/lib/typescript/commonjs/design-tokens/shadows.d.ts.map +1 -0
  99. package/lib/typescript/commonjs/design-tokens/shadows.native.d.ts +19 -0
  100. package/lib/typescript/commonjs/design-tokens/shadows.native.d.ts.map +1 -0
  101. package/lib/typescript/commonjs/design-tokens/tailwind-preset.d.ts +59 -0
  102. package/lib/typescript/commonjs/design-tokens/tailwind-preset.d.ts.map +1 -0
  103. package/lib/typescript/commonjs/design-tokens/theme-css.d.ts +39 -0
  104. package/lib/typescript/commonjs/design-tokens/theme-css.d.ts.map +1 -0
  105. package/lib/typescript/commonjs/index.d.ts +6 -0
  106. package/lib/typescript/commonjs/index.d.ts.map +1 -1
  107. package/lib/typescript/commonjs/index.web.d.ts +6 -0
  108. package/lib/typescript/commonjs/index.web.d.ts.map +1 -1
  109. package/lib/typescript/commonjs/text-field/index.d.ts +14 -1
  110. package/lib/typescript/commonjs/text-field/index.d.ts.map +1 -1
  111. package/lib/typescript/module/benefit-list/index.d.ts +6 -0
  112. package/lib/typescript/module/benefit-list/index.d.ts.map +1 -0
  113. package/lib/typescript/module/benefit-list/types.d.ts +35 -0
  114. package/lib/typescript/module/benefit-list/types.d.ts.map +1 -0
  115. package/lib/typescript/module/connection-dots/ConnectionDots.d.ts +4 -0
  116. package/lib/typescript/module/connection-dots/ConnectionDots.d.ts.map +1 -0
  117. package/lib/typescript/module/connection-dots/ConnectionDots.web.d.ts +14 -0
  118. package/lib/typescript/module/connection-dots/ConnectionDots.web.d.ts.map +1 -0
  119. package/lib/typescript/module/connection-dots/ConnectionDotsBase.d.ts +18 -0
  120. package/lib/typescript/module/connection-dots/ConnectionDotsBase.d.ts.map +1 -0
  121. package/lib/typescript/module/connection-dots/index.d.ts +3 -0
  122. package/lib/typescript/module/connection-dots/index.d.ts.map +1 -0
  123. package/lib/typescript/module/connection-dots/index.web.d.ts +3 -0
  124. package/lib/typescript/module/connection-dots/index.web.d.ts.map +1 -0
  125. package/lib/typescript/module/connection-dots/types.d.ts +41 -0
  126. package/lib/typescript/module/connection-dots/types.d.ts.map +1 -0
  127. package/lib/typescript/module/design-tokens/color-roles.d.ts +102 -0
  128. package/lib/typescript/module/design-tokens/color-roles.d.ts.map +1 -0
  129. package/lib/typescript/module/design-tokens/index.d.ts +28 -0
  130. package/lib/typescript/module/design-tokens/index.d.ts.map +1 -0
  131. package/lib/typescript/module/design-tokens/scales.d.ts +152 -0
  132. package/lib/typescript/module/design-tokens/scales.d.ts.map +1 -0
  133. package/lib/typescript/module/design-tokens/shadows.d.ts +34 -0
  134. package/lib/typescript/module/design-tokens/shadows.d.ts.map +1 -0
  135. package/lib/typescript/module/design-tokens/shadows.native.d.ts +19 -0
  136. package/lib/typescript/module/design-tokens/shadows.native.d.ts.map +1 -0
  137. package/lib/typescript/module/design-tokens/tailwind-preset.d.ts +59 -0
  138. package/lib/typescript/module/design-tokens/tailwind-preset.d.ts.map +1 -0
  139. package/lib/typescript/module/design-tokens/theme-css.d.ts +39 -0
  140. package/lib/typescript/module/design-tokens/theme-css.d.ts.map +1 -0
  141. package/lib/typescript/module/index.d.ts +6 -0
  142. package/lib/typescript/module/index.d.ts.map +1 -1
  143. package/lib/typescript/module/index.web.d.ts +6 -0
  144. package/lib/typescript/module/index.web.d.ts.map +1 -1
  145. package/lib/typescript/module/text-field/index.d.ts +14 -1
  146. package/lib/typescript/module/text-field/index.d.ts.map +1 -1
  147. package/package.json +50 -1
  148. package/src/__tests__/BenefitList.test.tsx +108 -0
  149. package/src/__tests__/ConnectionDots.test.tsx +86 -0
  150. package/src/__tests__/TextFieldFloatingLabel.test.tsx +93 -0
  151. package/src/__tests__/design-tokens.test.ts +169 -0
  152. package/src/benefit-list/BenefitList.stories.tsx +50 -0
  153. package/src/benefit-list/index.tsx +133 -0
  154. package/src/benefit-list/types.ts +36 -0
  155. package/src/button/Button.web.tsx +1 -1
  156. package/src/connection-dots/ConnectionDots.stories.tsx +54 -0
  157. package/src/connection-dots/ConnectionDots.tsx +139 -0
  158. package/src/connection-dots/ConnectionDots.web.tsx +122 -0
  159. package/src/connection-dots/ConnectionDotsBase.tsx +62 -0
  160. package/src/connection-dots/index.ts +2 -0
  161. package/src/connection-dots/index.web.ts +2 -0
  162. package/src/connection-dots/types.ts +41 -0
  163. package/src/design-tokens/color-roles.ts +110 -0
  164. package/src/design-tokens/index.ts +45 -0
  165. package/src/design-tokens/scales.ts +134 -0
  166. package/src/design-tokens/shadows.native.ts +44 -0
  167. package/src/design-tokens/shadows.ts +42 -0
  168. package/src/design-tokens/tailwind-preset.ts +139 -0
  169. package/src/design-tokens/theme-css.ts +99 -0
  170. package/src/index.ts +33 -0
  171. package/src/index.web.ts +33 -0
  172. package/src/text-field/TextField.stories.tsx +46 -0
  173. package/src/text-field/index.tsx +212 -1
@@ -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;AACA;;AAEA;AACA;AACA;AACA;AACA;AACO,MAAMC,YAAY,GAAAF,OAAA,CAAAE,YAAA,GAAG;EAC1BC,QAAQ,EAAE;AACZ,CAAU;;AAEV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAYA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,UAAU,GAAAJ,OAAA,CAAAI,UAAA,GAAG;EACxBC,OAAO,EAAE;IAAEC,IAAI,EAAE,EAAE;IAAEC,UAAU,EAAE,EAAE;IAAEC,MAAM,EAAE,KAAK;IAAEC,MAAM,EAAE;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yle;
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":[]}
@@ -0,0 +1,139 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.bloomTailwindPreset = void 0;
7
+ var _colorRoles = require("./color-roles.js");
8
+ var _scales = require("./scales.js");
9
+ var _shadows = require("./shadows");
10
+ /**
11
+ * The Bloom Tailwind / NativeWind preset — the SINGLE opt-in that gives every
12
+ * Oxy app the same semantic design-token utility classes.
13
+ *
14
+ * Consumers add it to their Tailwind config:
15
+ *
16
+ * // tailwind.config.js (web Tailwind v3/v4 AND native NativeWind)
17
+ * const { bloomTailwindPreset } = require('@oxyhq/bloom/tailwind-preset');
18
+ * module.exports = {
19
+ * presets: [bloomTailwindPreset],
20
+ * content: [ ...existing globs ],
21
+ * theme: { extend: { ...existing app overrides } },
22
+ * };
23
+ *
24
+ * The preset only EXTENDS `theme` (everything lives under `theme.extend`), so it
25
+ * is purely additive: existing Tailwind built-ins (`p-4`, `rounded-lg`,
26
+ * `text-sm`) and the app's own `var(--x)`-backed color utilities keep working.
27
+ *
28
+ * Cross-platform: NativeWind reads the same `tailwind.config.js`, so the SAME
29
+ * class names (`bg-fill`, `text-text-tertiary`, `p-space-8`, `rounded-radius-20`,
30
+ * `text-body`, `font-body`, `shadow-s`) resolve on web (Tailwind → CSS) and
31
+ * native (NativeWind → react-native-css). Color roles are `var(--x)` references
32
+ * that Bloom's `BloomThemeProvider` populates at runtime on both platforms.
33
+ *
34
+ * Type: returned as a `TailwindPreset` (a structural subset of Tailwind's
35
+ * `Config`) so Bloom does not need to depend on `tailwindcss` types.
36
+ */
37
+
38
+ /** A Tailwind `fontSize` value: `[size, { lineHeight }]`. */
39
+
40
+ /** A Tailwind `fontFamily` value: `[family, { fontWeight }]`. */
41
+
42
+ const px = n => `${n}px`;
43
+
44
+ /** `{ 'space-8': 8 }` → `{ 'space-8': '8px' }`. */
45
+ function toPxMap(scale) {
46
+ const out = {};
47
+ for (const [key, value] of Object.entries(scale)) {
48
+ // 9999 (radius-max) and large values are still valid px; pill shapes clamp.
49
+ out[key] = px(value);
50
+ }
51
+ return out;
52
+ }
53
+
54
+ /** Build the `fontSize` extension: `text-<role>` → `[size, { lineHeight }]`. */
55
+ function buildFontSize() {
56
+ const out = {};
57
+ for (const name of Object.keys(_scales.TYPOGRAPHY)) {
58
+ const role = _scales.TYPOGRAPHY[name];
59
+ out[name] = [px(role.size), {
60
+ lineHeight: px(role.lineHeight)
61
+ }];
62
+ }
63
+ return out;
64
+ }
65
+
66
+ /** Build the `fontFamily` extension: `font-<role>` → `[family, { fontWeight }]`. */
67
+ function buildFontFamily() {
68
+ const out = {};
69
+ for (const name of Object.keys(_scales.TYPOGRAPHY)) {
70
+ const role = _scales.TYPOGRAPHY[name];
71
+ out[name] = [_scales.FONT_FAMILY_VARS[role.family], {
72
+ fontWeight: role.weight
73
+ }];
74
+ }
75
+ // Also expose the raw Bloom families directly: `font-bloom-sans`, etc.
76
+ out['bloom-sans'] = [_scales.FONT_FAMILY_VARS.sans, {
77
+ fontWeight: '400'
78
+ }];
79
+ out['bloom-display'] = [_scales.FONT_FAMILY_VARS.display, {
80
+ fontWeight: '700'
81
+ }];
82
+ out['bloom-mono'] = [_scales.FONT_FAMILY_VARS.mono, {
83
+ fontWeight: '400'
84
+ }];
85
+ return out;
86
+ }
87
+ const SPACING_PX = toPxMap(_scales.SPACING);
88
+ const RADIUS_PX = toPxMap({
89
+ ..._scales.RADIUS
90
+ });
91
+ const BORDER_WIDTH_PX = toPxMap(_scales.BORDER_WIDTH);
92
+
93
+ /**
94
+ * Color roles are exposed via `colors` (so they reach `bg-*`, `text-*`,
95
+ * `border-*`, `ring-*`, `divide-*`, `fill-*` …) AND via the dedicated
96
+ * `backgroundColor` / `textColor` / `borderColor` maps (so the namespaced roles
97
+ * land on exactly the intended utility families even where the role name would
98
+ * otherwise be ambiguous). All values are `var(--canonical)` references.
99
+ */
100
+ const COLOR_ROLES = {
101
+ ..._colorRoles.FILL_ROLES,
102
+ ..._colorRoles.TEXT_ROLES,
103
+ ..._colorRoles.BORDER_ROLES
104
+ };
105
+
106
+ /**
107
+ * The Bloom Tailwind/NativeWind preset. Frozen so accidental mutation by a
108
+ * consumer's config merge cannot corrupt the shared vocabulary.
109
+ */
110
+ const bloomTailwindPreset = exports.bloomTailwindPreset = Object.freeze({
111
+ theme: {
112
+ extend: {
113
+ // Generic color bucket — feeds every color utility family.
114
+ colors: {
115
+ ...COLOR_ROLES
116
+ },
117
+ // Targeted buckets so the namespaced roles resolve on the right utility.
118
+ backgroundColor: {
119
+ ..._colorRoles.FILL_ROLES
120
+ },
121
+ textColor: {
122
+ ..._colorRoles.TEXT_ROLES
123
+ },
124
+ borderColor: {
125
+ ..._colorRoles.BORDER_ROLES
126
+ },
127
+ spacing: SPACING_PX,
128
+ borderRadius: RADIUS_PX,
129
+ borderWidth: BORDER_WIDTH_PX,
130
+ fontSize: buildFontSize(),
131
+ fontFamily: buildFontFamily(),
132
+ boxShadow: {
133
+ s: _shadows.SHADOW_BOX.s,
134
+ m: _shadows.SHADOW_BOX.m
135
+ }
136
+ }
137
+ }
138
+ });
139
+ //# sourceMappingURL=tailwind-preset.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_colorRoles","require","_scales","_shadows","px","n","toPxMap","scale","out","key","value","Object","entries","buildFontSize","name","keys","TYPOGRAPHY","role","size","lineHeight","buildFontFamily","FONT_FAMILY_VARS","family","fontWeight","weight","sans","display","mono","SPACING_PX","SPACING","RADIUS_PX","RADIUS","BORDER_WIDTH_PX","BORDER_WIDTH","COLOR_ROLES","FILL_ROLES","TEXT_ROLES","BORDER_ROLES","bloomTailwindPreset","exports","freeze","theme","extend","colors","backgroundColor","textColor","borderColor","spacing","borderRadius","borderWidth","fontSize","fontFamily","boxShadow","s","SHADOW_BOX","m"],"sourceRoot":"../../../src","sources":["design-tokens/tailwind-preset.ts"],"mappings":";;;;;;AA4BA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAA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EC,CAAC,EAAEC,mBAAU,CAACD,CAAC;QAAEE,CAAC,EAAED,mBAAU,CAACC;MAAE;IAChD;EACF;AACF,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,98 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.bloomThemeBlock = bloomThemeBlock;
7
+ exports.bloomThemeCss = bloomThemeCss;
8
+ var _colorRoles = require("./color-roles.js");
9
+ var _scales = require("./scales.js");
10
+ var _shadows = require("./shadows");
11
+ /**
12
+ * Tailwind v4 `@theme` block generator for the Oxy Unified Design Language.
13
+ *
14
+ * Tailwind v4 web apps (auth, console, website) configure their design tokens in
15
+ * CSS via `@theme { --color-X: var(--X); … }` rather than a JS preset. This
16
+ * module produces the exact `@theme` body that mirrors `bloomTailwindPreset`, so
17
+ * a v4 app gets the SAME semantic utilities (`bg-fill`, `text-text-tertiary`,
18
+ * `p-space-8`, `rounded-radius-20`, `text-body`, `font-body`, `shadow-s`) as the
19
+ * NativeWind/Tailwind-v3 apps that consume the JS preset.
20
+ *
21
+ * Each color role is emitted as a `--color-<role>: var(--canonical)` alias.
22
+ * Per Bloom's web CSS-var contract, the canonical `--x` token already resolves
23
+ * to a full `rgb(...)` color at runtime, so the alias is a direct `var(--x)`
24
+ * reference — NEVER `hsl(var(--x))`.
25
+ *
26
+ * Usage (web Tailwind v4, in the app's global stylesheet):
27
+ *
28
+ * import { bloomThemeCss } from '@oxyhq/bloom/design-tokens';
29
+ * // build-time: write `@theme { ${bloomThemeCss()} }` into global.css, OR
30
+ * // paste the generated block once (see docs/design-tokens.md).
31
+ *
32
+ * A consumer that prefers a static stylesheet can copy the output of
33
+ * `bloomThemeCss()` directly into their `@theme { … }` — the values are stable.
34
+ */
35
+
36
+ /**
37
+ * Produce the BODY of a Tailwind v4 `@theme` block (no surrounding braces) that
38
+ * registers the full Bloom semantic vocabulary.
39
+ *
40
+ * - Colors → `--color-<role>: var(--canonical);`
41
+ * - Spacing → `--spacing-<key>: <px>;`
42
+ * - Radius → `--radius-<key>: <px>;`
43
+ * - Type → `--text-<role>: <size>; --text-<role>--line-height: <lh>;`
44
+ * `--font-<role>: var(--bloom-font-*);` (+ weight via utility doc)
45
+ * - Shadow → `--shadow-<s|m>: <box-shadow>;`
46
+ */
47
+ function bloomThemeCss() {
48
+ const lines = [];
49
+
50
+ // Color roles.
51
+ for (const [role, value] of Object.entries({
52
+ ..._colorRoles.FILL_ROLES,
53
+ ..._colorRoles.TEXT_ROLES,
54
+ ..._colorRoles.BORDER_ROLES
55
+ })) {
56
+ lines.push(` --color-${role}: ${value};`);
57
+ }
58
+
59
+ // Spacing.
60
+ for (const [key, value] of Object.entries(_scales.SPACING)) {
61
+ lines.push(` --spacing-${key}: ${value}px;`);
62
+ }
63
+
64
+ // Radius.
65
+ for (const [key, value] of Object.entries(_scales.RADIUS)) {
66
+ lines.push(` --radius-${key}: ${value}px;`);
67
+ }
68
+
69
+ // Hairline border width.
70
+ for (const [key, value] of Object.entries(_scales.BORDER_WIDTH)) {
71
+ lines.push(` --border-width-${key}: ${value}px;`);
72
+ }
73
+
74
+ // Typography: size + line-height + family per role.
75
+ for (const name of Object.keys(_scales.TYPOGRAPHY)) {
76
+ const role = _scales.TYPOGRAPHY[name];
77
+ lines.push(` --text-${name}: ${role.size}px;`);
78
+ lines.push(` --text-${name}--line-height: ${role.lineHeight}px;`);
79
+ lines.push(` --text-${name}--font-weight: ${role.weight};`);
80
+ lines.push(` --font-${name}: ${_scales.FONT_FAMILY_VARS[role.family]};`);
81
+ }
82
+
83
+ // Bloom raw families.
84
+ lines.push(` --font-bloom-sans: ${_scales.FONT_FAMILY_VARS.sans};`);
85
+ lines.push(` --font-bloom-display: ${_scales.FONT_FAMILY_VARS.display};`);
86
+ lines.push(` --font-bloom-mono: ${_scales.FONT_FAMILY_VARS.mono};`);
87
+
88
+ // Shadows.
89
+ lines.push(` --shadow-s: ${_shadows.SHADOW_BOX.s};`);
90
+ lines.push(` --shadow-m: ${_shadows.SHADOW_BOX.m};`);
91
+ return lines.join('\n');
92
+ }
93
+
94
+ /** The full `@theme { … }` block, ready to inject into a v4 stylesheet. */
95
+ function bloomThemeBlock() {
96
+ return `@theme {\n${bloomThemeCss()}\n}`;
97
+ }
98
+ //# sourceMappingURL=theme-css.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_colorRoles","require","_scales","_shadows","bloomThemeCss","lines","role","value","Object","entries","FILL_ROLES","TEXT_ROLES","BORDER_ROLES","push","key","SPACING","RADIUS","BORDER_WIDTH","name","keys","TYPOGRAPHY","size","lineHeight","weight","FONT_FAMILY_VARS","family","sans","display","mono","SHADOW_BOX","s","m","join","bloomThemeBlock"],"sourceRoot":"../../../src","sources":["design-tokens/theme-css.ts"],"mappings":";;;;;;;AAyBA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAQA,IAAAE,QAAA,GAAAF,OAAA;AAlCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAaA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASG,aAAaA,CAAA,EAAW;EACtC,MAAMC,KAAe,GAAG,EAAE;;EAE1B;EACA,KAAK,MAAM,CAACC,IAAI,EAAEC,KAAK,CAAC,IAAIC,MAAM,CAACC,OAAO,CAAC;IACzC,GAAGC,sBAAU;IACb,GAAGC,sBAAU;IACb,GAAGC;EACL,CAAC,CAAC,EAAE;IACFP,KAAK,CAACQ,IAAI,CAAC,aAAaP,IAAI,KAAKC,KAAK,GAAG,CAAC;EAC5C;;EAEA;EACA,KAAK,MAAM,CAACO,GAAG,EAAEP,KAAK,CAAC,IAAIC,MAAM,CAACC,OAAO,CAACM,eAAO,CAAC,EAAE;IAClDV,KAAK,CAACQ,IAAI,CAAC,eAAeC,GAAG,KAAKP,KAAK,K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