@openfin/ui-library 0.1.40 → 0.2.0-alpha.1657388871

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 (160) hide show
  1. package/README.md +0 -7
  2. package/dist/openfin.ui.js +660 -0
  3. package/dist/openfin.ui.js.LICENSE.txt +14 -0
  4. package/dist/{components → types/components}/elements/Badge/badge.d.ts +2 -1
  5. package/dist/types/components/elements/Icon/openfin/BellFilledIcon.d.ts +2 -0
  6. package/dist/{components → types/components}/elements/Icon/openfin/BellIcon.d.ts +0 -1
  7. package/dist/{components → types/components}/elements/Icon/openfin/BrokenLinkIcon.d.ts +0 -1
  8. package/dist/{components → types/components}/elements/Icon/openfin/FilterIcon.d.ts +0 -1
  9. package/dist/{components → types/components}/elements/Icon/openfin/FloppyDiskIcon.d.ts +0 -1
  10. package/dist/types/components/elements/Icon/openfin/FragmentsIcon.d.ts +2 -0
  11. package/dist/{components → types/components}/elements/Icon/openfin/LightBulbFilledIcon.d.ts +0 -1
  12. package/dist/{components → types/components}/elements/Icon/openfin/LightBulbOutlinedIcon.d.ts +0 -1
  13. package/dist/{components → types/components}/elements/Icon/openfin/LockedClosedFilledIcon.d.ts +0 -1
  14. package/dist/{components → types/components}/elements/Icon/openfin/MinimizeIcon.d.ts +0 -1
  15. package/dist/{components → types/components}/elements/Icon/openfin/OpenFinIcon.d.ts +0 -1
  16. package/dist/types/components/elements/Icon/openfin/StackIcon.d.ts +2 -0
  17. package/dist/types/components/elements/Icon/openfin/StorefrontIcon.d.ts +2 -0
  18. package/dist/{components → types/components}/elements/Icon/openfin/WorkspaceIcon.d.ts +0 -1
  19. package/dist/{components → types/components}/elements/Icon/openfin/index.d.ts +4 -0
  20. package/dist/types/components/elements/IconWithBadge/iconWithBadge.d.ts +5 -0
  21. package/dist/types/components/elements/IconWithBadge/index.d.ts +1 -0
  22. package/dist/types/components/input/RadioGroup/index.d.ts +1 -0
  23. package/dist/types/components/input/RadioGroup/radioGroup.d.ts +12 -0
  24. package/dist/types/components/input/RadioInput/index.d.ts +1 -0
  25. package/dist/types/components/input/RadioInput/radioInput.d.ts +11 -0
  26. package/dist/{components → types/components}/system/ThemeProvider/lib/colors.d.ts +2 -2
  27. package/dist/{components → types/components}/system/ThemeProvider/lib/constants.d.ts +4 -2
  28. package/dist/{components → types/components}/system/ThemeProvider/lib/helpers.d.ts +2 -1
  29. package/dist/{components → types/components}/typography/Heading/heading.d.ts +24 -24
  30. package/dist/{index.d.ts → types/index.d.ts} +2 -0
  31. package/dist/{lib → types/lib}/math.d.ts +5 -1
  32. package/dist/{storybookHelpers.d.ts → types/storybookHelpers.d.ts} +1 -1
  33. package/package.json +93 -70
  34. package/dist/assets/fonts/index.d.ts +0 -6
  35. package/dist/assets/fonts/index.js +0 -11
  36. package/dist/components/controls/Button/button.js +0 -83
  37. package/dist/components/controls/Button/button.variants.js +0 -124
  38. package/dist/components/controls/Button/index.js +0 -14
  39. package/dist/components/controls/Toggle/index.js +0 -13
  40. package/dist/components/controls/Toggle/toggle.js +0 -98
  41. package/dist/components/elements/Badge/badge.js +0 -41
  42. package/dist/components/elements/Badge/index.js +0 -13
  43. package/dist/components/elements/Icon/icon.js +0 -56
  44. package/dist/components/elements/Icon/icon.variants.js +0 -60
  45. package/dist/components/elements/Icon/index.js +0 -13
  46. package/dist/components/elements/Icon/openfin/BellIcon.js +0 -24
  47. package/dist/components/elements/Icon/openfin/BrokenLinkIcon.js +0 -21
  48. package/dist/components/elements/Icon/openfin/FilterIcon.js +0 -20
  49. package/dist/components/elements/Icon/openfin/FloppyDiskIcon.js +0 -23
  50. package/dist/components/elements/Icon/openfin/LightBulbFilledIcon.js +0 -21
  51. package/dist/components/elements/Icon/openfin/LightBulbOutlinedIcon.js +0 -20
  52. package/dist/components/elements/Icon/openfin/LockedClosedFilledIcon.js +0 -23
  53. package/dist/components/elements/Icon/openfin/MinimizeIcon.js +0 -23
  54. package/dist/components/elements/Icon/openfin/OpenFinIcon.js +0 -23
  55. package/dist/components/elements/Icon/openfin/WorkspaceIcon.js +0 -26
  56. package/dist/components/elements/Icon/openfin/index.js +0 -22
  57. package/dist/components/elements/Loader/index.js +0 -13
  58. package/dist/components/elements/Loader/loader.js +0 -25
  59. package/dist/components/input/BaseInput/baseInput.js +0 -94
  60. package/dist/components/input/BaseInput/index.js +0 -13
  61. package/dist/components/input/Checkbox/checkbox.js +0 -96
  62. package/dist/components/input/Checkbox/index.js +0 -13
  63. package/dist/components/input/NumberInput/index.js +0 -13
  64. package/dist/components/input/NumberInput/numberInput.js +0 -108
  65. package/dist/components/input/RawInput/index.js +0 -13
  66. package/dist/components/input/RawInput/rawInput.js +0 -12
  67. package/dist/components/input/TextInput/index.js +0 -13
  68. package/dist/components/input/TextInput/textInput.js +0 -10
  69. package/dist/components/layout/Box/box.js +0 -50
  70. package/dist/components/layout/Box/index.js +0 -13
  71. package/dist/components/layout/Box/types.js +0 -2
  72. package/dist/components/layout/DefinitionList/definitionList.js +0 -49
  73. package/dist/components/layout/DefinitionList/index.js +0 -13
  74. package/dist/components/system/GlobalStyles/globalStyles.js +0 -53
  75. package/dist/components/system/GlobalStyles/index.js +0 -13
  76. package/dist/components/system/HOC/index.js +0 -2
  77. package/dist/components/system/ThemeProvider/index.js +0 -21
  78. package/dist/components/system/ThemeProvider/lib/colors.js +0 -21
  79. package/dist/components/system/ThemeProvider/lib/config.js +0 -6
  80. package/dist/components/system/ThemeProvider/lib/constants.js +0 -271
  81. package/dist/components/system/ThemeProvider/lib/createFontFaceCss.js +0 -43
  82. package/dist/components/system/ThemeProvider/lib/createTheme.js +0 -43
  83. package/dist/components/system/ThemeProvider/lib/fonts.d.js +0 -1
  84. package/dist/components/system/ThemeProvider/lib/helpers.js +0 -54
  85. package/dist/components/system/ThemeProvider/lib/interface.js +0 -2
  86. package/dist/components/system/ThemeProvider/lib/mixins.js +0 -85
  87. package/dist/components/system/ThemeProvider/lib/palette.js +0 -38
  88. package/dist/components/system/ThemeProvider/lib/types.js +0 -2
  89. package/dist/components/system/ThemeProvider/theme/index.js +0 -13
  90. package/dist/components/system/ThemeProvider/theme/openfin.js +0 -39
  91. package/dist/components/system/ThemeProvider/themeProvider.js +0 -20
  92. package/dist/components/templates/ContactCard/contactCard.js +0 -114
  93. package/dist/components/templates/ContactCard/index.js +0 -13
  94. package/dist/components/templates/utils/name.js +0 -22
  95. package/dist/components/typography/Heading/heading.js +0 -64
  96. package/dist/components/typography/Heading/index.js +0 -13
  97. package/dist/components/typography/Text/index.js +0 -13
  98. package/dist/components/typography/Text/text.js +0 -21
  99. package/dist/hooks/useColorScheme.js +0 -33
  100. package/dist/hooks/useMediaQuery.js +0 -39
  101. package/dist/hooks/usePrevious.js +0 -12
  102. package/dist/hooks/useTheme.js +0 -34
  103. package/dist/index.js +0 -46
  104. package/dist/lib/math.js +0 -24
  105. package/dist/lib/whenFin.js +0 -13
  106. package/dist/lib/whenFin.spec.js +0 -39
  107. package/dist/react-app-env.d.js +0 -2
  108. package/dist/storybookHelpers.js +0 -58
  109. /package/dist/{components → types/components}/controls/Button/button.d.ts +0 -0
  110. /package/dist/{components → types/components}/controls/Button/button.variants.d.ts +0 -0
  111. /package/dist/{components → types/components}/controls/Button/index.d.ts +0 -0
  112. /package/dist/{components → types/components}/controls/Toggle/index.d.ts +0 -0
  113. /package/dist/{components → types/components}/controls/Toggle/toggle.d.ts +0 -0
  114. /package/dist/{components → types/components}/elements/Badge/index.d.ts +0 -0
  115. /package/dist/{components → types/components}/elements/Icon/icon.d.ts +0 -0
  116. /package/dist/{components → types/components}/elements/Icon/icon.variants.d.ts +0 -0
  117. /package/dist/{components → types/components}/elements/Icon/index.d.ts +0 -0
  118. /package/dist/{components → types/components}/elements/Loader/index.d.ts +0 -0
  119. /package/dist/{components → types/components}/elements/Loader/loader.d.ts +0 -0
  120. /package/dist/{components → types/components}/input/BaseInput/baseInput.d.ts +0 -0
  121. /package/dist/{components → types/components}/input/BaseInput/index.d.ts +0 -0
  122. /package/dist/{components → types/components}/input/Checkbox/checkbox.d.ts +0 -0
  123. /package/dist/{components → types/components}/input/Checkbox/index.d.ts +0 -0
  124. /package/dist/{components → types/components}/input/NumberInput/index.d.ts +0 -0
  125. /package/dist/{components → types/components}/input/NumberInput/numberInput.d.ts +0 -0
  126. /package/dist/{components → types/components}/input/RawInput/index.d.ts +0 -0
  127. /package/dist/{components → types/components}/input/RawInput/rawInput.d.ts +0 -0
  128. /package/dist/{components → types/components}/input/TextInput/index.d.ts +0 -0
  129. /package/dist/{components → types/components}/input/TextInput/textInput.d.ts +0 -0
  130. /package/dist/{components → types/components}/layout/Box/box.d.ts +0 -0
  131. /package/dist/{components → types/components}/layout/Box/index.d.ts +0 -0
  132. /package/dist/{components → types/components}/layout/Box/types.d.ts +0 -0
  133. /package/dist/{components → types/components}/layout/DefinitionList/definitionList.d.ts +0 -0
  134. /package/dist/{components → types/components}/layout/DefinitionList/index.d.ts +0 -0
  135. /package/dist/{components → types/components}/system/GlobalStyles/globalStyles.d.ts +0 -0
  136. /package/dist/{components → types/components}/system/GlobalStyles/index.d.ts +0 -0
  137. /package/dist/{components → types/components}/system/HOC/index.d.ts +0 -0
  138. /package/dist/{components → types/components}/system/ThemeProvider/index.d.ts +0 -0
  139. /package/dist/{components → types/components}/system/ThemeProvider/lib/config.d.ts +0 -0
  140. /package/dist/{components → types/components}/system/ThemeProvider/lib/createFontFaceCss.d.ts +0 -0
  141. /package/dist/{components → types/components}/system/ThemeProvider/lib/createTheme.d.ts +0 -0
  142. /package/dist/{components → types/components}/system/ThemeProvider/lib/interface.d.ts +0 -0
  143. /package/dist/{components → types/components}/system/ThemeProvider/lib/mixins.d.ts +0 -0
  144. /package/dist/{components → types/components}/system/ThemeProvider/lib/palette.d.ts +0 -0
  145. /package/dist/{components → types/components}/system/ThemeProvider/lib/types.d.ts +0 -0
  146. /package/dist/{components → types/components}/system/ThemeProvider/theme/index.d.ts +0 -0
  147. /package/dist/{components → types/components}/system/ThemeProvider/theme/openfin.d.ts +0 -0
  148. /package/dist/{components → types/components}/system/ThemeProvider/themeProvider.d.ts +0 -0
  149. /package/dist/{components → types/components}/templates/ContactCard/contactCard.d.ts +0 -0
  150. /package/dist/{components → types/components}/templates/ContactCard/index.d.ts +0 -0
  151. /package/dist/{components → types/components}/templates/utils/name.d.ts +0 -0
  152. /package/dist/{components → types/components}/typography/Heading/index.d.ts +0 -0
  153. /package/dist/{components → types/components}/typography/Text/index.d.ts +0 -0
  154. /package/dist/{components → types/components}/typography/Text/text.d.ts +0 -0
  155. /package/dist/{hooks → types/hooks}/useColorScheme.d.ts +0 -0
  156. /package/dist/{hooks → types/hooks}/useMediaQuery.d.ts +0 -0
  157. /package/dist/{hooks → types/hooks}/usePrevious.d.ts +0 -0
  158. /package/dist/{hooks → types/hooks}/useTheme.d.ts +0 -0
  159. /package/dist/{lib → types/lib}/whenFin.d.ts +0 -0
  160. /package/dist/{lib → types/lib}/whenFin.spec.d.ts +0 -0
@@ -1,271 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
- }) : (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- o[k2] = m[k];
8
- }));
9
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
- Object.defineProperty(o, "default", { enumerable: true, value: v });
11
- }) : function(o, v) {
12
- o["default"] = v;
13
- });
14
- var __importStar = (this && this.__importStar) || function (mod) {
15
- if (mod && mod.__esModule) return mod;
16
- var result = {};
17
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
- __setModuleDefault(result, mod);
19
- return result;
20
- };
21
- Object.defineProperty(exports, "__esModule", { value: true });
22
- exports.cdnFontFaceCss = exports.IconSize = exports.IconSet = exports.Transition = exports.Typography = exports.LineHeight = exports.FontWeight = exports.FontSize = exports.FontStack = exports.Shadow = exports.Radius = exports.UnitPx = exports.Unit = exports.SizeName = exports.Size = exports.Color = void 0;
23
- const RadixIcons = __importStar(require("@modulz/radix-icons"));
24
- const OpenFinIcons = __importStar(require("../../../elements/Icon/openfin"));
25
- const createFontFaceCss_1 = require("./createFontFaceCss");
26
- /**
27
- * Color --
28
- * Color maps names to values.
29
- * This is the "raw" store of all OpenFin colors
30
- * referenced by their Figma names.
31
- *
32
- * This is the only place Color values should be defined
33
- */
34
- exports.Color = {
35
- white: '#FFFFFF',
36
- lightGray1: '#FAFBFE',
37
- lightGray2: '#F3F5F8',
38
- lightGray3: '#ECEEF1',
39
- lightGray4: '#DDDFE4',
40
- lightGray5: '#C9CBD2',
41
- neutralGray: '#7D808A',
42
- darkGray1: '#53565F',
43
- darkGray2: '#383A40',
44
- darkGray3: '#2F3136',
45
- darkGray4: '#24262B',
46
- darkGray5: '#1E1F23',
47
- darkGray6: '#111214',
48
- openFinDarkest: '#3D39CD',
49
- openFinDarker: '#4642E0',
50
- openFin: '#504CFF',
51
- openFinLight: '#5254FB',
52
- openFinLighter: '#5C5EFE',
53
- openFinLightest: '#6864FF',
54
- functional1: '#35C759',
55
- functional2: '#46C8F1',
56
- functional3: '#0498FB',
57
- functional4: '#3A6FF9',
58
- functional5: '#5C5EFE',
59
- functional6: '#882BFE',
60
- functional7: '#BE1D1F',
61
- functional8: '#C93400',
62
- functional9: '#FF5E60',
63
- functional10: '#F48F00',
64
- purple: '#8C61FF',
65
- lightblue: '#36C3FE',
66
- aqua: '#00CC88',
67
- yellow: '#FFEB00',
68
- salmon: '#FF8C4C',
69
- pink: '#FF5E60',
70
- lightpink: '#FF8FB8',
71
- white00: 'rgba(255,255,255,0.0)',
72
- white10: 'rgba(255,255,255,0.1)',
73
- white20: 'rgba(255,255,255,0.2)',
74
- white30: 'rgba(255,255,255,0.3)',
75
- white40: 'rgba(255,255,255,0.4)',
76
- white50: 'rgba(255,255,255,0.5)',
77
- white60: 'rgba(255,255,255,0.6)',
78
- white70: 'rgba(255,255,255,0.7)',
79
- white80: 'rgba(255,255,255,0.8)',
80
- white90: 'rgba(255,255,255,0.9)',
81
- black00: 'rgba(0,0,0,0.0)',
82
- black10: 'rgba(0,0,0,0.1)',
83
- black20: 'rgba(0,0,0,0.2)',
84
- black30: 'rgba(0,0,0,0.3)',
85
- black40: 'rgba(0,0,0,0.4)',
86
- black50: 'rgba(0,0,0,0.5)',
87
- black60: 'rgba(0,0,0,0.6)',
88
- black70: 'rgba(0,0,0,0.7)',
89
- black80: 'rgba(0,0,0,0.8)',
90
- black90: 'rgba(0,0,0,0.9)',
91
- transparent: 'transparent',
92
- };
93
- /**
94
- * Size --
95
- * Common keys used to describe a range of values
96
- * - Unit, UnitPx, Shadow, FontSize
97
- */
98
- exports.Size = {
99
- xsmall: 'xsmall',
100
- small: 'small',
101
- base: 'base',
102
- large: 'large',
103
- xlarge: 'xlarge',
104
- xxlarge: 'xxlarge',
105
- xxxlarge: 'xxxlarge',
106
- xxxxlarge: 'xxxxlarge',
107
- };
108
- /**
109
- * SizeName --
110
- * Primarly a Storybook Helper for displaying human-friendly size names
111
- * It's more intuitive to maintain this if it lives here
112
- */
113
- exports.SizeName = {
114
- [exports.Size.xsmall]: 'Extra Small',
115
- [exports.Size.small]: 'Small',
116
- [exports.Size.base]: 'Base',
117
- [exports.Size.large]: 'Large',
118
- [exports.Size.xlarge]: 'Extra Large',
119
- [exports.Size.xxlarge]: '2X Large',
120
- [exports.Size.xxxlarge]: '3X Large',
121
- [exports.Size.xxxxlarge]: '4X Large',
122
- };
123
- /**
124
- * Unit --
125
- * Design System works on a 4px Grid
126
- * Units are represented as numbers here for convienence in Javascript, e.g. `Unit.base * 4`
127
- */
128
- exports.Unit = {
129
- [exports.Size.xsmall]: 4,
130
- [exports.Size.small]: 8,
131
- [exports.Size.base]: 12,
132
- [exports.Size.large]: 16,
133
- [exports.Size.xlarge]: 20,
134
- [exports.Size.xxlarge]: 24,
135
- [exports.Size.xxxlarge]: 32,
136
- [exports.Size.xxxxlarge]: 48,
137
- };
138
- /**
139
- * UnitPx / "px" --
140
- * Design System works on a 4px Grid
141
- * UnitPx includes the px suffix for convienence in Styled Components
142
- */
143
- exports.UnitPx = {
144
- [exports.Size.xsmall]: '4px',
145
- [exports.Size.small]: '8px',
146
- [exports.Size.base]: '12px',
147
- [exports.Size.large]: '16px',
148
- [exports.Size.xlarge]: '20px',
149
- [exports.Size.xxlarge]: '24px',
150
- [exports.Size.xxxlarge]: '32px',
151
- [exports.Size.xxxxlarge]: '48px',
152
- };
153
- /**
154
- * Radius --
155
- * The border radius values supported in the design system
156
- */
157
- exports.Radius = {
158
- [exports.Size.small]: '4px',
159
- [exports.Size.base]: '8px',
160
- [exports.Size.large]: '24px',
161
- pill: '100vh',
162
- round: '50%',
163
- none: '0',
164
- };
165
- /**
166
- * Shadow --
167
- * Design System drop shadows
168
- * Note: This does not include any `text-shadow`
169
- */
170
- exports.Shadow = {
171
- [exports.Size.base]: `0 4px 4px rgba(0, 0, 0, 0.25)`,
172
- };
173
- const fonts = [
174
- 'Inter',
175
- '-apple-system',
176
- 'BlinkMacSystemFont',
177
- 'Segoe UI',
178
- 'Roboto',
179
- 'Oxygen-Sans',
180
- 'Ubuntu',
181
- 'Cantarell',
182
- 'Helvetica Neue',
183
- 'sans-serif',
184
- ];
185
- /**
186
- * FontStack --
187
- * Design System uses "Inter" and we include @font-face definitions to load a CDN hosted version of the font
188
- * The rest of the stack includes reasonable fallbacks for contingency cases where the CDN asset fails to load
189
- */
190
- exports.FontStack = fonts.join(', ');
191
- /**
192
- * FontSize --
193
- * Design System font sizes using standard scale
194
- */
195
- exports.FontSize = {
196
- [exports.Size.xsmall]: '8px',
197
- [exports.Size.small]: '10px',
198
- [exports.Size.base]: '12px',
199
- [exports.Size.large]: '14px',
200
- [exports.Size.xlarge]: '16px',
201
- [exports.Size.xxlarge]: '18px',
202
- [exports.Size.xxxlarge]: '20px',
203
- [exports.Size.xxxxlarge]: '40px',
204
- };
205
- /**
206
- * FontWeight --
207
- * Design System font weights (three)
208
- */
209
- exports.FontWeight = {
210
- normal: 400,
211
- bold: 600,
212
- };
213
- /**
214
- * LineHeight --
215
- * Read about "unitless" line-height
216
- * @link https://css-tricks.com/almanac/properties/l/line-height/#unitless-line-heights
217
- */
218
- exports.LineHeight = {
219
- ui: 1,
220
- heading: 1.2,
221
- text: 1.5,
222
- };
223
- /**
224
- * Typography --
225
- * Design System typography is a full set of values for a `font:...` property.
226
- * @example "12px/16px Inter, ..."
227
- * @example "20px/24px Inter, ..."
228
- */
229
- exports.Typography = {
230
- base: `${exports.FontSize.base}/${exports.LineHeight.text} ${exports.FontStack}`,
231
- };
232
- /**
233
- * Transitions --
234
- * Design System transition easings because UI motion feels better if everything moves the same way.
235
- */
236
- exports.Transition = {
237
- base: '200ms cubic-bezier(0.16, 1, 0.3, 1)',
238
- none: '0ms',
239
- };
240
- /**
241
- * IconSet --
242
- * Design System uses Radix Icons `@modulz/radix-icons`
243
- * @link https://icons.modulz.app/
244
- * @link https://github.com/radix-ui/icons
245
- *
246
- * This exposes them as a named set through OpenFin UI Library
247
- */
248
- exports.IconSet = Object.assign(Object.assign({}, RadixIcons), OpenFinIcons);
249
- /**
250
- * IconSize --
251
- * Design System standard set of icon sizes
252
- */
253
- exports.IconSize = {
254
- [exports.Size.xsmall]: exports.UnitPx.small,
255
- [exports.Size.small]: exports.UnitPx.base,
256
- [exports.Size.base]: '15px',
257
- [exports.Size.large]: exports.UnitPx.xlarge,
258
- [exports.Size.xlarge]: exports.UnitPx.xxlarge,
259
- [exports.Size.xxlarge]: exports.UnitPx.xxxlarge,
260
- [exports.Size.xxxlarge]: exports.UnitPx.xxxxlarge,
261
- };
262
- /**
263
- * @font-face --
264
- * Generate @font-face CSS for CDN Loaded fonts
265
- */
266
- exports.cdnFontFaceCss = createFontFaceCss_1.createFontFaceCss({
267
- regular: '//cdn.openfin.co/fonts/inter/Inter-Regular.woff2?v3.15',
268
- italic: '//cdn.openfin.co/fonts/inter/Inter-Italic.woff2?v3.15',
269
- semiBold: '//cdn.openfin.co/fonts/inter/Inter-SemiBold.woff2?v3.15',
270
- semiBoldItalic: '//cdn.openfin.co/fonts/inter/Inter-SemiBoldItalic.woff2?v3.15',
271
- });
@@ -1,43 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createFontFaceCss = void 0;
4
- const styled_components_1 = require("styled-components");
5
- const constants_1 = require("./constants");
6
- /**
7
- * Import global fonts using your own config.
8
- */
9
- function createFontFaceCss(fonts) {
10
- return styled_components_1.css `
11
- @font-face {
12
- font-family: 'Inter';
13
- src: url(${fonts.regular}) format('woff2');
14
- font-weight: ${constants_1.FontWeight.normal};
15
- font-style: normal;
16
- font-display: swap;
17
- }
18
- @font-face {
19
- font-family: 'Inter';
20
- src: url(${fonts.italic}) format('woff2');
21
- font-weight: ${constants_1.FontWeight.normal};
22
- font-style: italic;
23
- font-display: swap;
24
- }
25
-
26
- @font-face {
27
- font-family: 'Inter';
28
- src: url(${fonts.semiBold}) format('woff2');
29
- font-weight: ${constants_1.FontWeight.bold};
30
- font-style: normal;
31
- font-display: swap;
32
- }
33
-
34
- @font-face {
35
- font-family: 'Inter';
36
- src: url(${fonts.semiBoldItalic}) format('woff2');
37
- font-weight: ${constants_1.FontWeight.bold};
38
- font-style: italic;
39
- font-display: swap;
40
- }
41
- `;
42
- }
43
- exports.createFontFaceCss = createFontFaceCss;
@@ -1,43 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createTheme = void 0;
4
- const config_1 = require("../lib/config");
5
- const constants_1 = require("../lib/constants");
6
- const colors_1 = require("./colors");
7
- const palette_1 = require("./palette");
8
- const LIGHTNESS_PERCENTAGE_ACTIVE = 2;
9
- const LIGHTNESS_PERCENTAGE_HOVER = 5;
10
- const LIGHTNESS_PERCENTAGE_FOCUSED = 20;
11
- const base = {
12
- _config: config_1.Configuration,
13
- _color: constants_1.Color,
14
- fontSize: constants_1.FontSize,
15
- fontWeight: constants_1.FontWeight,
16
- lineHeight: constants_1.LineHeight,
17
- iconSize: constants_1.IconSize,
18
- radius: constants_1.Radius,
19
- shadow: constants_1.Shadow,
20
- transition: constants_1.Transition,
21
- unit: constants_1.Unit,
22
- px: constants_1.UnitPx,
23
- };
24
- /**
25
- * Created Active, Hover, and Focused Colors derived from base color
26
- */
27
- const createDerivedPaletteKeys = (key, baseColor) => ({
28
- [`${key}Active`]: colors_1.darkenColor(baseColor, LIGHTNESS_PERCENTAGE_ACTIVE),
29
- [`${key}Hover`]: colors_1.lightenColor(baseColor, LIGHTNESS_PERCENTAGE_HOVER),
30
- [`${key}Focused`]: colors_1.lightenColor(baseColor, LIGHTNESS_PERCENTAGE_FOCUSED),
31
- [`${key}Text`]: colors_1.getMostReadable(baseColor, [constants_1.Color.white, constants_1.Color.darkGray5]),
32
- });
33
- /**
34
- * Create a theme by accepting an incomplete theme object and deriving the remaining colors based on button colors.
35
- *
36
- * @param {Partial<PaletteType>} palettePartial The provided theme keys, whether we or the end user defined them.
37
- * @returns {DefaultTheme}
38
- */
39
- const createTheme = (palettePartial) => {
40
- const foo = Object.assign(Object.assign({}, base), { palette: Object.assign(Object.assign(Object.assign({}, palettePartial), createDerivedPaletteKeys(palette_1.Palette.brandPrimary, palettePartial.brandPrimary)), createDerivedPaletteKeys(palette_1.Palette.brandSecondary, palettePartial.brandSecondary)) });
41
- return foo;
42
- };
43
- exports.createTheme = createTheme;
@@ -1 +0,0 @@
1
- "use strict";
@@ -1,54 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getStatusColor = exports.getFontFaces = exports.getRootCssVars = exports.getVariantCSS = void 0;
4
- const constants_1 = require("./constants");
5
- const palette_1 = require("./palette");
6
- /**
7
- * Get the CSS associated with a variant key
8
- * @param variants -- Component variants data structure
9
- * @param variantProp -- The key (enum) for looking up the variant value
10
- * @todo This needs to be typed better
11
- */
12
- const getVariantCSS = (variants, variantProp) => (props) => {
13
- return variants[variantProp][props[variantProp]];
14
- };
15
- exports.getVariantCSS = getVariantCSS;
16
- /**
17
- * Build :root { --var } key value pairs from Palette
18
- */
19
- const getRootCssVars = ({ theme }) => Object.keys(palette_1.Palette)
20
- .map((key) => `--openfin-ui-${key}: ${theme.palette[key]};`)
21
- .join('\n');
22
- exports.getRootCssVars = getRootCssVars;
23
- /**
24
- * Lazy Load font-faces based on Theme Configuration
25
- */
26
- const getFontFaces = ({ theme }) => {
27
- switch (theme._config.fontLoading) {
28
- case 'import':
29
- return theme._config.fontCss;
30
- case 'cdn':
31
- default:
32
- return constants_1.cdnFontFaceCss;
33
- }
34
- };
35
- exports.getFontFaces = getFontFaces;
36
- /**
37
- * Retrive the correct palette value based on the provided status type.
38
- * Falls back to optionally provided palette key, then to 'inherit'.
39
- */
40
- const getStatusColor = (theme, status, defaultKey) => {
41
- switch (status) {
42
- case 'active':
43
- return theme.palette.statusActive;
44
- case 'critical':
45
- return theme.palette.statusCritical;
46
- case 'warning':
47
- return theme.palette.statusWarning;
48
- case 'success':
49
- return theme.palette.statusSuccess;
50
- default:
51
- return defaultKey ? theme.palette[defaultKey] : 'inherit';
52
- }
53
- };
54
- exports.getStatusColor = getStatusColor;
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,85 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Mixins = void 0;
4
- const constants_1 = require("./constants");
5
- const styled_components_1 = require("styled-components");
6
- /**
7
- * Mixins
8
- */
9
- /**
10
- * Prevent User Selection
11
- */
12
- const noSelect = styled_components_1.css `
13
- user-select: none;
14
- `;
15
- /**
16
- * Prevent Text from Wrapping and truncate with ellipsis
17
- * when it overflows the parent container
18
- */
19
- const textOverflow = styled_components_1.css `
20
- white-space: nowrap;
21
- overflow: hidden;
22
- text-overflow: ellipsis;
23
- `;
24
- /**
25
- * Scrollbar (4px)
26
- * @link https://www.figma.com/file/0Y3pKZj0tJWuleF12h5Sua/Spatial---Components?node-id=2048%3A7477
27
- */
28
- const scrollbar = styled_components_1.css `
29
- &::-webkit-scrollbar {
30
- width: var(--scrollbarSize, ${constants_1.UnitPx.xsmall});
31
- height: var(--scrollbarSize, ${constants_1.UnitPx.xsmall});
32
- }
33
-
34
- &::-webkit-scrollbar-track {
35
- background: ${constants_1.Color.neutralGray};
36
- border-radius: var(--scrollbarSize, ${constants_1.UnitPx.xsmall});
37
- opacity: 0.8;
38
- }
39
-
40
- &::-webkit-scrollbar-thumb {
41
- background: ${constants_1.Color.white};
42
- width: var(--scrollbarSize, ${constants_1.UnitPx.xsmall});
43
- height: var(--scrollbarSize, ${constants_1.UnitPx.xsmall});
44
- border-radius: var(--scrollbarSize, ${constants_1.UnitPx.xsmall});
45
- opacity: 0.8;
46
- }
47
- `;
48
- /**
49
- * Scrollbar Tiny (2px)
50
- * Extends the regular scrollbar
51
- */
52
- const scrollbarSmall = styled_components_1.css `
53
- --scrollbarSize: 2px;
54
- ${scrollbar};
55
- `;
56
- /**
57
- * App Region Drag Behavior
58
- * This affects what parts of the DOM can drag the OpenFin / Electron browser window
59
- * - Apply 'Drag' to make an area behave like a drag handle
60
- * - Apply 'NoDrag' to unset an area inside of a draggable area
61
- *
62
- * Note: DOM elements behaving as draggable regions typically ignore any other event handlers
63
- */
64
- const appRegionDrag = styled_components_1.css `
65
- -webkit-app-region: drag;
66
- `;
67
- const appRegionNoDrag = styled_components_1.css `
68
- -webkit-app-region: no-drag;
69
- `;
70
- /**
71
- * Mixins --
72
- * Reusable utility fragments of CSS that make sense to express once (for consistency, maintainability).
73
- */
74
- exports.Mixins = {
75
- noSelect,
76
- textOverflow,
77
- scrollbar: {
78
- [constants_1.Size.base]: scrollbar,
79
- [constants_1.Size.small]: scrollbarSmall,
80
- },
81
- appRegion: {
82
- drag: appRegionDrag,
83
- noDrag: appRegionNoDrag,
84
- },
85
- };
@@ -1,38 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Palette = void 0;
4
- /**
5
- * Theme Palette -- Canonical list of names we use to reference color values within a theme
6
- */
7
- exports.Palette = {
8
- background1: 'background1',
9
- background2: 'background2',
10
- background3: 'background3',
11
- background4: 'background4',
12
- background5: 'background5',
13
- background6: 'background6',
14
- brandPrimary: 'brandPrimary',
15
- brandSecondary: 'brandSecondary',
16
- // --BEGIN These are calculated during theme creation. See ./createTheme.ts
17
- brandPrimaryActive: 'brandPrimaryActive',
18
- brandPrimaryHover: 'brandPrimaryHover',
19
- brandPrimaryFocused: 'brandPrimaryFocused',
20
- brandPrimaryText: 'brandPrimaryText',
21
- brandSecondaryActive: 'brandSecondaryActive',
22
- brandSecondaryHover: 'brandSecondaryHover',
23
- brandSecondaryFocused: 'brandSecondaryFocused',
24
- brandSecondaryText: 'brandSecondaryText',
25
- // --END
26
- inputBackground: 'inputBackground',
27
- inputColor: 'inputColor',
28
- inputPlaceholder: 'inputPlaceholder',
29
- inputDisabled: 'inputDisabled',
30
- inputFocused: 'inputFocused',
31
- statusSuccess: 'statusSuccess',
32
- statusWarning: 'statusWarning',
33
- statusCritical: 'statusCritical',
34
- statusActive: 'statusActive',
35
- textDefault: 'textDefault',
36
- textHelp: 'textHelp',
37
- textInactive: 'textInactive',
38
- };
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,13 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
- }) : (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- o[k2] = m[k];
8
- }));
9
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
- };
12
- Object.defineProperty(exports, "__esModule", { value: true });
13
- __exportStar(require("./openfin"), exports);
@@ -1,39 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OpenFinDarkTheme = exports.OpenFinLightTheme = void 0;
4
- const palette_1 = require("../lib/palette");
5
- const constants_1 = require("../lib/constants");
6
- const createTheme_1 = require("../lib/createTheme");
7
- const sharedPalette = {
8
- // Brand
9
- [palette_1.Palette.brandPrimary]: constants_1.Color.openFin,
10
- // Status
11
- [palette_1.Palette.statusSuccess]: constants_1.Color.functional1,
12
- [palette_1.Palette.statusWarning]: constants_1.Color.functional10,
13
- [palette_1.Palette.statusCritical]: constants_1.Color.functional7,
14
- [palette_1.Palette.statusActive]: constants_1.Color.functional3,
15
- };
16
- /**
17
- * Light Theme
18
- */
19
- exports.OpenFinLightTheme = createTheme_1.createTheme(Object.assign(Object.assign({}, sharedPalette), {
20
- // Background levels
21
- [palette_1.Palette.background1]: constants_1.Color.white, [palette_1.Palette.background2]: constants_1.Color.lightGray1, [palette_1.Palette.background3]: constants_1.Color.lightGray2, [palette_1.Palette.background4]: constants_1.Color.lightGray3, [palette_1.Palette.background5]: constants_1.Color.lightGray4, [palette_1.Palette.background6]: constants_1.Color.lightGray5,
22
- // Brand
23
- [palette_1.Palette.brandSecondary]: constants_1.Color.darkGray5,
24
- // Inputs
25
- [palette_1.Palette.inputBackground]: constants_1.Color.lightGray3, [palette_1.Palette.inputColor]: constants_1.Color.darkGray5, [palette_1.Palette.inputPlaceholder]: constants_1.Color.darkGray2, [palette_1.Palette.inputDisabled]: constants_1.Color.neutralGray, [palette_1.Palette.inputFocused]: constants_1.Color.lightGray5,
26
- // Text
27
- [palette_1.Palette.textDefault]: constants_1.Color.darkGray5, [palette_1.Palette.textHelp]: constants_1.Color.darkGray3, [palette_1.Palette.textInactive]: constants_1.Color.neutralGray }));
28
- /**
29
- * Dark Theme
30
- */
31
- exports.OpenFinDarkTheme = createTheme_1.createTheme(Object.assign(Object.assign({}, sharedPalette), {
32
- // Background levels
33
- [palette_1.Palette.background1]: constants_1.Color.darkGray6, [palette_1.Palette.background2]: constants_1.Color.darkGray5, [palette_1.Palette.background3]: constants_1.Color.darkGray4, [palette_1.Palette.background4]: constants_1.Color.darkGray3, [palette_1.Palette.background5]: constants_1.Color.darkGray2, [palette_1.Palette.background6]: constants_1.Color.darkGray1,
34
- // Brand
35
- [palette_1.Palette.brandSecondary]: constants_1.Color.darkGray2,
36
- // Inputs
37
- [palette_1.Palette.inputBackground]: constants_1.Color.darkGray1, [palette_1.Palette.inputColor]: constants_1.Color.white, [palette_1.Palette.inputPlaceholder]: constants_1.Color.lightGray5, [palette_1.Palette.inputDisabled]: constants_1.Color.neutralGray, [palette_1.Palette.inputFocused]: constants_1.Color.lightGray5,
38
- // Text
39
- [palette_1.Palette.textDefault]: constants_1.Color.white, [palette_1.Palette.textHelp]: constants_1.Color.lightGray5, [palette_1.Palette.textInactive]: constants_1.Color.neutralGray }));
@@ -1,20 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ThemeProvider = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const styled_components_1 = require("styled-components");
6
- const useTheme_1 = require("../../../hooks/useTheme");
7
- const GlobalStyles_1 = require("../GlobalStyles");
8
- /**
9
- * ## OpenFin ThemeProvider
10
- * - Extends StyledComponents ThemeProvider
11
- * - Applies built-in OpenFin themes automatically using System Preference for Color Scheme
12
- * - Includes global stylesheet with typography, reset, and global css vars
13
- * - Accepts Light / Dark Mode scheme override
14
- * - Accepts Light / Dark Mode palette override
15
- */
16
- const ThemeProvider = ({ children, themes, scheme, config, includeGlobalStyles = true, }) => {
17
- const currentTheme = useTheme_1.useTheme({ themes, scheme, config });
18
- return (jsx_runtime_1.jsx(styled_components_1.ThemeProvider, Object.assign({ theme: currentTheme }, { children: jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [includeGlobalStyles && jsx_runtime_1.jsx(GlobalStyles_1.GlobalStyles, {}, void 0), children] }, void 0) }), void 0));
19
- };
20
- exports.ThemeProvider = ThemeProvider;