@sats-group/ui-lib 74.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (227) hide show
  1. package/.nvmrc +1 -0
  2. package/README.md +35 -0
  3. package/catalog-info.yaml +14 -0
  4. package/eslint.config.mjs +94 -0
  5. package/fonts/Inter-BoldItalic.woff +0 -0
  6. package/fonts/Inter-BoldItalic.woff2 +0 -0
  7. package/fonts/Inter-ExtraBold.woff +0 -0
  8. package/fonts/Inter-ExtraBold.woff2 +0 -0
  9. package/fonts/Inter-Italic.woff +0 -0
  10. package/fonts/Inter-Italic.woff2 +0 -0
  11. package/fonts/Inter-Regular.woff +0 -0
  12. package/fonts/Inter-Regular.woff2 +0 -0
  13. package/fonts/Inter-SemiBold.woff +0 -0
  14. package/fonts/Inter-SemiBold.woff2 +0 -0
  15. package/fonts/LICENSE.txt +92 -0
  16. package/fonts/SATSHeadline-Bold.woff +0 -0
  17. package/fonts/SATSHeadline-BoldItalic.woff +0 -0
  18. package/fonts/SATSHeadline-RegularItalic.woff +0 -0
  19. package/fonts/SATSHeadline-SemiBoldItalic.woff +0 -0
  20. package/logos/e-avatar.svg +3 -0
  21. package/logos/elixia-letter.svg +3 -0
  22. package/logos/elixia-small.svg +8 -0
  23. package/logos/elixia.svg +8 -0
  24. package/logos/s-avatar.svg +3 -0
  25. package/logos/sats-letter.svg +3 -0
  26. package/logos/sats-small.svg +3 -0
  27. package/logos/sats.svg +4 -0
  28. package/package.json +58 -0
  29. package/react/add-bem-modifiers.ts +51 -0
  30. package/react/badge/badge.scss +53 -0
  31. package/react/badge/badge.tsx +28 -0
  32. package/react/badge/badge.types.ts +34 -0
  33. package/react/badge/index.ts +2 -0
  34. package/react/banner/banner.scss +118 -0
  35. package/react/banner/banner.tsx +92 -0
  36. package/react/banner/banner.types.ts +10 -0
  37. package/react/banner/index.ts +2 -0
  38. package/react/bomb/bomb.scss +33 -0
  39. package/react/bomb/bomb.tsx +19 -0
  40. package/react/bomb/bomb.types.ts +1 -0
  41. package/react/bomb/index.ts +2 -0
  42. package/react/button/button.tsx +19 -0
  43. package/react/button/button.types.ts +3 -0
  44. package/react/button/index.ts +2 -0
  45. package/react/checkbox/checkbox.scss +218 -0
  46. package/react/checkbox/checkbox.tsx +176 -0
  47. package/react/checkbox/checkbox.types.ts +19 -0
  48. package/react/checkbox/index.ts +2 -0
  49. package/react/chip/chip.scss +46 -0
  50. package/react/chip/chip.tsx +37 -0
  51. package/react/chip/chip.types.ts +18 -0
  52. package/react/chip/index.ts +2 -0
  53. package/react/chip/remove.tsx +14 -0
  54. package/react/chip-selected/chip-selected.scss +47 -0
  55. package/react/chip-selected/chip-selected.tsx +102 -0
  56. package/react/chip-selected/chip-selected.types.ts +11 -0
  57. package/react/chip-selected/index.ts +2 -0
  58. package/react/confirmation/confirmation.scss +60 -0
  59. package/react/confirmation/confirmation.tsx +85 -0
  60. package/react/confirmation/confirmation.types.ts +24 -0
  61. package/react/confirmation/index.ts +2 -0
  62. package/react/context-menu/context-menu.scss +183 -0
  63. package/react/context-menu/context-menu.tsx +200 -0
  64. package/react/context-menu/context-menu.types.ts +71 -0
  65. package/react/context-menu/index.ts +2 -0
  66. package/react/cropped-image/cropped-image.scss +48 -0
  67. package/react/cropped-image/cropped-image.tsx +36 -0
  68. package/react/cropped-image/cropped-image.types.ts +26 -0
  69. package/react/cropped-image/index.ts +2 -0
  70. package/react/dropdown-list/dropdown-list.scss +170 -0
  71. package/react/dropdown-list/dropdown-list.tsx +116 -0
  72. package/react/dropdown-list/dropdown-list.types.ts +17 -0
  73. package/react/dropdown-list/index.ts +2 -0
  74. package/react/expander/expander.scss +115 -0
  75. package/react/expander/expander.tsx +167 -0
  76. package/react/expander/expander.types.ts +26 -0
  77. package/react/expander/index.ts +2 -0
  78. package/react/filter/filter.scss +94 -0
  79. package/react/filter/filter.tsx +99 -0
  80. package/react/filter/filter.types.ts +8 -0
  81. package/react/filter/index.ts +2 -0
  82. package/react/filter-wrapper/filter-wrapper.scss +46 -0
  83. package/react/filter-wrapper/filter-wrapper.tsx +24 -0
  84. package/react/filter-wrapper/filter-wrapper.types.ts +10 -0
  85. package/react/filter-wrapper/index.ts +2 -0
  86. package/react/flag/flag.scss +26 -0
  87. package/react/flag/flag.tsx +27 -0
  88. package/react/flag/flag.types.ts +17 -0
  89. package/react/flag/index.ts +2 -0
  90. package/react/form-content/checkbox-category.tsx +183 -0
  91. package/react/form-content/form-content.checkbox-list.tsx +126 -0
  92. package/react/form-content/form-content.checkbox-list.types.ts +36 -0
  93. package/react/form-content/form-content.radio-list.tsx +58 -0
  94. package/react/form-content/form-content.range.tsx +20 -0
  95. package/react/form-content/form-content.range.types.ts +14 -0
  96. package/react/form-content/form-content.scss +234 -0
  97. package/react/form-content/form-content.search.tsx +47 -0
  98. package/react/form-content/form-content.tsx +95 -0
  99. package/react/form-content/form-content.types.ts +55 -0
  100. package/react/form-content/index.ts +2 -0
  101. package/react/form-content/types/index.d.ts +1 -0
  102. package/react/hidden-input/hidden-input.tsx +9 -0
  103. package/react/hidden-input/hidden-input.types.ts +6 -0
  104. package/react/hidden-input/index.ts +2 -0
  105. package/react/hooks/focus-previous-element.ts +30 -0
  106. package/react/hooks/is-running-on-client.ts +1 -0
  107. package/react/hooks/use-click-outside.ts +23 -0
  108. package/react/hooks/use-escape.ts +18 -0
  109. package/react/hooks/use-event.ts +29 -0
  110. package/react/hooks/use-is-mounted.ts +11 -0
  111. package/react/hooks/use-toggle.ts +19 -0
  112. package/react/icons/16/close.tsx +12 -0
  113. package/react/icons/18/close.tsx +18 -0
  114. package/react/icons/24/arrow-down.tsx +14 -0
  115. package/react/icons/24/arrow-right.tsx +14 -0
  116. package/react/icons/24/arrow-up.tsx +14 -0
  117. package/react/icons/24/close.tsx +12 -0
  118. package/react/icons/24/remove.tsx +12 -0
  119. package/react/icons/24/search.tsx +10 -0
  120. package/react/icons/icons.md +3 -0
  121. package/react/indexed-access-type.ts +1 -0
  122. package/react/link/index.ts +2 -0
  123. package/react/link/link.scss +44 -0
  124. package/react/link/link.tsx +62 -0
  125. package/react/link/link.types.ts +37 -0
  126. package/react/link-button/index.ts +2 -0
  127. package/react/link-button/link-button.tsx +17 -0
  128. package/react/link-button/link-button.types.ts +5 -0
  129. package/react/link-card/index.ts +2 -0
  130. package/react/link-card/link-card.scss +37 -0
  131. package/react/link-card/link-card.tsx +24 -0
  132. package/react/link-card/link-card.types.ts +5 -0
  133. package/react/logos/e-avatar.tsx +12 -0
  134. package/react/logos/elixia-letter.tsx +12 -0
  135. package/react/logos/elixia-small.tsx +12 -0
  136. package/react/logos/elixia.tsx +12 -0
  137. package/react/logos/index.ts +8 -0
  138. package/react/logos/s-avatar.tsx +12 -0
  139. package/react/logos/sats-letter.tsx +12 -0
  140. package/react/logos/sats-small.tsx +12 -0
  141. package/react/logos/sats.tsx +12 -0
  142. package/react/message/hook/use-message.ts +22 -0
  143. package/react/message/index.ts +2 -0
  144. package/react/message/message.scss +92 -0
  145. package/react/message/message.tsx +60 -0
  146. package/react/message/message.types.ts +39 -0
  147. package/react/message/publish.ts +19 -0
  148. package/react/message-field/index.ts +2 -0
  149. package/react/message-field/message-field.scss +21 -0
  150. package/react/message-field/message-field.tsx +70 -0
  151. package/react/message-field/message-field.types.ts +24 -0
  152. package/react/modal/index.ts +2 -0
  153. package/react/modal/modal.scss +162 -0
  154. package/react/modal/modal.tsx +130 -0
  155. package/react/modal/modal.types.ts +36 -0
  156. package/react/modal/tab-trapper.tsx +68 -0
  157. package/react/progress-bar/index.ts +2 -0
  158. package/react/progress-bar/progress-bar.scss +71 -0
  159. package/react/progress-bar/progress-bar.tsx +81 -0
  160. package/react/progress-bar/progress-bar.types.ts +35 -0
  161. package/react/radio/index.ts +2 -0
  162. package/react/radio/radio.scss +142 -0
  163. package/react/radio/radio.tsx +87 -0
  164. package/react/radio/radio.types.ts +15 -0
  165. package/react/scale-bar/index.ts +2 -0
  166. package/react/scale-bar/scale-bar.scss +22 -0
  167. package/react/scale-bar/scale-bar.tsx +29 -0
  168. package/react/scale-bar/scale-bar.types.ts +4 -0
  169. package/react/search/index.ts +2 -0
  170. package/react/search/search.scss +207 -0
  171. package/react/search/search.tsx +255 -0
  172. package/react/search/search.types.ts +43 -0
  173. package/react/select/chevron-down.tsx +24 -0
  174. package/react/select/index.ts +2 -0
  175. package/react/select/select.scss +135 -0
  176. package/react/select/select.tsx +105 -0
  177. package/react/select/select.types.ts +19 -0
  178. package/react/select-option/README.md +3 -0
  179. package/react/select-option/index.ts +2 -0
  180. package/react/select-option/select-option.tsx +16 -0
  181. package/react/select-option/select-option.types.ts +8 -0
  182. package/react/tag/index.ts +2 -0
  183. package/react/tag/tag.scss +107 -0
  184. package/react/tag/tag.tsx +26 -0
  185. package/react/tag/tag.types.ts +30 -0
  186. package/react/text/index.ts +2 -0
  187. package/react/text/text.scss +109 -0
  188. package/react/text/text.tsx +40 -0
  189. package/react/text/text.types.ts +29 -0
  190. package/react/text-area/index.ts +2 -0
  191. package/react/text-area/text-area.scss +180 -0
  192. package/react/text-area/text-area.tsx +153 -0
  193. package/react/text-area/text-area.types.ts +24 -0
  194. package/react/text-input/index.ts +2 -0
  195. package/react/text-input/text-input.scss +233 -0
  196. package/react/text-input/text-input.tsx +106 -0
  197. package/react/text-input/text-input.types.ts +19 -0
  198. package/react/toggle/index.ts +2 -0
  199. package/react/toggle/toggle.scss +69 -0
  200. package/react/toggle/toggle.tsx +83 -0
  201. package/react/toggle/toggle.types.ts +11 -0
  202. package/react/toolbox/index.ts +2 -0
  203. package/react/toolbox/toolbox.scss +68 -0
  204. package/react/toolbox/toolbox.tsx +43 -0
  205. package/react/toolbox/toolbox.types.ts +39 -0
  206. package/react/ts/debounce.ts +12 -0
  207. package/react/types.ts +38 -0
  208. package/react/use-input-validation.ts +47 -0
  209. package/react/use-input-validation.types.ts +12 -0
  210. package/react/visually-button/index.ts +2 -0
  211. package/react/visually-button/visually-button.scss +470 -0
  212. package/react/visually-button/visually-button.tsx +130 -0
  213. package/react/visually-button/visually-button.types.ts +71 -0
  214. package/react/visually-hidden/index.ts +2 -0
  215. package/react/visually-hidden/visually-hidden.scss +6 -0
  216. package/react/visually-hidden/visually-hidden.tsx +10 -0
  217. package/tokens/corner-radius.scss +5 -0
  218. package/tokens/dark.scss +392 -0
  219. package/tokens/darkmode.scss +131 -0
  220. package/tokens/elevation.scss +57 -0
  221. package/tokens/font-faces.scss +62 -0
  222. package/tokens/font-names.scss +2 -0
  223. package/tokens/font-sizes.scss +95 -0
  224. package/tokens/light.scss +392 -0
  225. package/tokens/lightmode.scss +131 -0
  226. package/tokens/primitives.scss +137 -0
  227. package/tokens/spacing.scss +12 -0
package/.nvmrc ADDED
@@ -0,0 +1 @@
1
+ v18
package/README.md ADDED
@@ -0,0 +1,35 @@
1
+ # 📚 SATS Web UI Library
2
+
3
+ This repo is the home of reusable SATS themed components and tokens, implemented using several parts of [SATS Design System](https://www.figma.com/files/project/2752581/SATS-Design-System):
4
+
5
+ - [Styles](https://www.figma.com/file/WzKCwRY09zn4rzRVfY0YvdRt/sats-ds-styles) includes primitives like color, apect ratio, elevation, spacing, and more.
6
+ - [Assets](https://www.figma.com/file/ZigDYZUrzJDM8RQumAFozjYJ/sats-ds-assets), which we only use for logos. These are also exported and processed with a tool (see the `logos` script).
7
+ - [Shared Web Components](https://www.figma.com/file/CemEcLe6DpoD5ELrFqlwZ7/shared-web-components) includes web UI meant to be the same across all SATS web applications.
8
+
9
+ ## 🍽 Consuming the Library
10
+
11
+ Installing the library as a dependency would in this case be done using
12
+
13
+ ```bash
14
+ npm install --save sats-ui-lib
15
+ ```
16
+
17
+ ## 📖 More Documentation
18
+
19
+ ### 👩‍💻 Using This Library
20
+
21
+ - [Colors](docs/colors.md)
22
+ - [Corner radius](docs/corner-radius.md)
23
+ - [Elevation](docs/elevation.md)
24
+ - [Fonts](docs/fonts.md)
25
+ - [Logos](docs/logos.md)
26
+ - [React components](docs/react.md)
27
+ - [Spacing](docs/spacing.md)
28
+
29
+ ### 🌍 Visualising the components
30
+
31
+ To see the components online, head to [SATS UI Library](https://ui-lib.sats.com/)
32
+
33
+ ### 👷‍♀️ Making This Library
34
+
35
+ - [Contribute](docs/contributing.md)
@@ -0,0 +1,14 @@
1
+ apiVersion: backstage.io/v1alpha1
2
+ kind: Component
3
+ metadata:
4
+ name: sats-ui-lib
5
+ title: SATS UI Library
6
+ links:
7
+ - url: https://ui-lib.sats.com
8
+ title: Website
9
+ - url: https://satsdigital.slack.com/archives/C02U0R4004F
10
+ title: Slack Channel
11
+ spec:
12
+ type: library
13
+ lifecycle: production
14
+ owner: sats-internal-apps-team
@@ -0,0 +1,94 @@
1
+ import { FlatCompat } from '@eslint/eslintrc';
2
+ import js from '@eslint/js';
3
+ import typescriptEslint from '@typescript-eslint/eslint-plugin';
4
+ import tsParser from '@typescript-eslint/parser';
5
+ import prettier from 'eslint-plugin-prettier';
6
+ import react from 'eslint-plugin-react';
7
+ import path from 'node:path';
8
+ import { fileURLToPath } from 'node:url';
9
+
10
+ const __filename = fileURLToPath(import.meta.url);
11
+ const __dirname = path.dirname(__filename);
12
+ const compat = new FlatCompat({
13
+ baseDirectory: __dirname,
14
+ recommendedConfig: js.configs.recommended,
15
+ allConfig: js.configs.all,
16
+ });
17
+
18
+ export default [
19
+ {
20
+ ignores: [
21
+ '**/.vscode',
22
+ '**/site/build',
23
+ '**/dist',
24
+ '**/docs',
25
+ '**/node_modules',
26
+ '**/test-results',
27
+ ],
28
+ },
29
+ ...compat.extends(
30
+ 'eslint:recommended',
31
+ 'plugin:@typescript-eslint/eslint-recommended',
32
+ 'plugin:@typescript-eslint/recommended',
33
+ 'prettier',
34
+ ),
35
+ {
36
+ plugins: {
37
+ '@typescript-eslint': typescriptEslint,
38
+ prettier,
39
+ react,
40
+ },
41
+ languageOptions: {
42
+ globals: {},
43
+ parser: tsParser,
44
+ },
45
+ settings: {
46
+ 'import/extensions': ['.js', '.jsx', '.ts', '.tsx'],
47
+ react: {
48
+ version: '18',
49
+ },
50
+ },
51
+ rules: {
52
+ '@typescript-eslint/no-require-imports': 'off',
53
+ '@typescript-eslint/ban-ts-comment': 'off',
54
+ '@typescript-eslint/ban-types': 'off',
55
+ '@typescript-eslint/explicit-module-boundary-types': 'off',
56
+ '@typescript-eslint/no-empty-function': 'off',
57
+ '@typescript-eslint/no-explicit-any': 'error',
58
+ '@typescript-eslint/no-redeclare': 'error',
59
+ '@typescript-eslint/no-unused-vars': [
60
+ 'warn',
61
+ {
62
+ vars: 'all',
63
+ args: 'after-used',
64
+ argsIgnorePattern: '(^_|^next$)',
65
+ },
66
+ ],
67
+ '@typescript-eslint/prefer-literal-enum-member': 'error',
68
+ 'arrow-parens': ['warn', 'as-needed'],
69
+ eqeqeq: 'error',
70
+ 'no-console': 'warn',
71
+ 'no-dupe-args': 'error',
72
+ 'no-dupe-keys': 'error',
73
+ 'no-irregular-whitespace': 'warn',
74
+ 'no-unreachable': 'error',
75
+ 'no-use-before-define': 'off',
76
+ 'no-warning-comments': 'warn',
77
+ 'prettier/prettier': [
78
+ 'warn',
79
+ {
80
+ endOfLine: 'auto',
81
+ singleQuote: true,
82
+ },
83
+ ],
84
+ semi: 'error',
85
+ strict: 'off',
86
+ },
87
+ },
88
+ {
89
+ files: ['**/*.js', '**/*.ts'],
90
+ rules: {
91
+ '@typescript-eslint/no-var-requires': 'off',
92
+ },
93
+ },
94
+ ];
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,92 @@
1
+ Copyright (c) 2016-2019 The Inter Project Authors (me@rsms.me)
2
+
3
+ This Font Software is licensed under the SIL Open Font License, Version 1.1.
4
+ This license is copied below, and is also available with a FAQ at:
5
+ http://scripts.sil.org/OFL
6
+
7
+ -----------------------------------------------------------
8
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
9
+ -----------------------------------------------------------
10
+
11
+ PREAMBLE
12
+ The goals of the Open Font License (OFL) are to stimulate worldwide
13
+ development of collaborative font projects, to support the font creation
14
+ efforts of academic and linguistic communities, and to provide a free and
15
+ open framework in which fonts may be shared and improved in partnership
16
+ with others.
17
+
18
+ The OFL allows the licensed fonts to be used, studied, modified and
19
+ redistributed freely as long as they are not sold by themselves. The
20
+ fonts, including any derivative works, can be bundled, embedded,
21
+ redistributed and/or sold with any software provided that any reserved
22
+ names are not used by derivative works. The fonts and derivatives,
23
+ however, cannot be released under any other type of license. The
24
+ requirement for fonts to remain under this license does not apply
25
+ to any document created using the fonts or their derivatives.
26
+
27
+ DEFINITIONS
28
+ "Font Software" refers to the set of files released by the Copyright
29
+ Holder(s) under this license and clearly marked as such. This may
30
+ include source files, build scripts and documentation.
31
+
32
+ "Reserved Font Name" refers to any names specified as such after the
33
+ copyright statement(s).
34
+
35
+ "Original Version" refers to the collection of Font Software components as
36
+ distributed by the Copyright Holder(s).
37
+
38
+ "Modified Version" refers to any derivative made by adding to, deleting,
39
+ or substituting -- in part or in whole -- any of the components of the
40
+ Original Version, by changing formats or by porting the Font Software to a
41
+ new environment.
42
+
43
+ "Author" refers to any designer, engineer, programmer, technical
44
+ writer or other person who contributed to the Font Software.
45
+
46
+ PERMISSION AND CONDITIONS
47
+ Permission is hereby granted, free of charge, to any person obtaining
48
+ a copy of the Font Software, to use, study, copy, merge, embed, modify,
49
+ redistribute, and sell modified and unmodified copies of the Font
50
+ Software, subject to the following conditions:
51
+
52
+ 1) Neither the Font Software nor any of its individual components,
53
+ in Original or Modified Versions, may be sold by itself.
54
+
55
+ 2) Original or Modified Versions of the Font Software may be bundled,
56
+ redistributed and/or sold with any software, provided that each copy
57
+ contains the above copyright notice and this license. These can be
58
+ included either as stand-alone text files, human-readable headers or
59
+ in the appropriate machine-readable metadata fields within text or
60
+ binary files as long as those fields can be easily viewed by the user.
61
+
62
+ 3) No Modified Version of the Font Software may use the Reserved Font
63
+ Name(s) unless explicit written permission is granted by the corresponding
64
+ Copyright Holder. This restriction only applies to the primary font name as
65
+ presented to the users.
66
+
67
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
68
+ Software shall not be used to promote, endorse or advertise any
69
+ Modified Version, except to acknowledge the contribution(s) of the
70
+ Copyright Holder(s) and the Author(s) or with their explicit written
71
+ permission.
72
+
73
+ 5) The Font Software, modified or unmodified, in part or in whole,
74
+ must be distributed entirely under this license, and must not be
75
+ distributed under any other license. The requirement for fonts to
76
+ remain under this license does not apply to any document created
77
+ using the Font Software.
78
+
79
+ TERMINATION
80
+ This license becomes null and void if any of the above conditions are
81
+ not met.
82
+
83
+ DISCLAIMER
84
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
85
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
86
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
87
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
88
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
89
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
90
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
91
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
92
+ OTHER DEALINGS IN THE FONT SOFTWARE.
Binary file
@@ -0,0 +1,3 @@
1
+ <svg width="73" height="72" viewBox="0 0 73 72" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M38.2873 24.4807L36.2664 31.382H49.0655L46.6545 39.8283H33.8555L31.6218 47.5537H48.7818L46.3 56H19L30.6291 16H58L55.5182 24.4464H38.2873V24.4807Z" />
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg width="48" height="51" viewBox="0 0 48 51" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M23.7382 10.7782L21.2509 19.5491H37.0036L34.0364 30.2836H18.2836L15.5345 40.1018H36.6545L33.6 50.8364H0L14.3127 0H48L44.9455 10.7345H23.7382V10.7782Z" />
3
+ </svg>
@@ -0,0 +1,8 @@
1
+ <svg width="93" height="21" viewBox="0 0 93 21" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M9.93959 4.2794L8.90242 7.80361H15.3848L14.1747 12.1669H7.60595L6.48234 16.1107H15.2983L14.0019 20.474H0L5.96376 0H19.9656L18.6691 4.36331H9.93959V4.2794Z" />
3
+ <path d="M32.5846 16.1946L31.2881 20.5579H17.8048L23.7686 0.0839119H28.9545L24.2872 16.2785H32.5846V16.1946Z" />
4
+ <path d="M40.5362 0H45.7221L39.7584 20.474H34.5725L40.5362 0Z" />
5
+ <path d="M58.5139 10.4887L62.0576 20.474H56.7853L54.6245 14.0129L49.0065 20.474H43.0427L52.6366 9.81744L49.0929 0H54.3652L56.526 6.29323L61.9712 0H67.9349L58.5139 10.4887Z" />
6
+ <path d="M71.0465 0H76.2323L70.2686 20.474H65.0827L71.0465 0Z" />
7
+ <path d="M93 0V20.474H88.4191V16.1946H81.4182L78.9981 20.474H73.4665L85.9991 0H93ZM88.4191 11.8313V3.85985L83.8383 11.8313H88.4191Z" />
8
+ </svg>
@@ -0,0 +1,8 @@
1
+ <svg width="229" height="52" viewBox="0 0 229 52" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M24.4082 10.8245L21.8612 19.7388H37.7796L34.8082 30.7755H18.6776L15.9184 40.751H37.5674L34.3837 51.7877H0L14.6449 0H49.0286L45.8449 11.0367H24.4082V10.8245Z" />
3
+ <path d="M80.0163 40.9633L76.8327 52H43.7225L58.3673 0.21225H71.102L59.6408 41.1755H80.0163V40.9633Z" />
4
+ <path d="M99.5429 0H112.278L97.6327 51.7877H84.898L99.5429 0Z" />
5
+ <path d="M143.69 26.5306L152.392 51.7877H139.445L134.139 35.4449L120.343 51.7877H105.698L129.257 24.8326L120.555 0H133.502L138.808 15.9184L152.18 0H166.825L143.69 26.5306Z" />
6
+ <path d="M174.465 0H187.2L172.555 51.7877H159.82L174.465 0Z" />
7
+ <path d="M228.376 0V51.7877H217.127V40.9633H199.935L193.992 51.7877H180.408L211.184 0H228.376ZM217.127 29.9265V9.76326L205.878 29.9265H217.127Z" />
8
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg width="73" height="72" viewBox="0 0 73 72" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M42.7539 33.8218L40.1797 31.5776C38.6351 30.2574 37.7663 29.1683 37.7663 27.6832C37.7663 25.802 39.1178 24.1188 41.9817 24.1188C43.9124 24.1188 45.7143 24.8119 47.3554 26.429L54.4668 20.9835C52.5683 18.4422 48.7069 16 43.0114 16C34.6129 16 28.499 21.6106 28.499 29.0033C28.499 32.7327 30.494 35.3069 33.1005 37.5842L35.6747 39.8284C37.4445 41.4125 38.1846 42.4026 38.1846 43.7888C38.1846 45.868 36.7366 47.8482 33.1005 47.8482C30.3975 47.8482 27.9841 46.7591 26.1822 44.6799L19.1351 50.0924C21.7737 53.4257 26.2787 56 32.4569 56C41.9495 56 47.452 50.1254 47.452 42.3696C47.4841 38.4422 45.2317 35.967 42.7539 33.8218Z" />
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg width="48" height="52" viewBox="0 0 48 52" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M31.9917 23.1683L28.5594 20.2508C26.5 18.5347 25.3416 17.1188 25.3416 15.1881C25.3416 12.7426 27.1436 10.5545 30.962 10.5545C33.5363 10.5545 35.9389 11.4554 38.1271 13.5578L47.6089 6.47855C45.0776 3.17492 39.929 0 32.335 0C21.137 0 12.9851 7.29373 12.9851 16.9043C12.9851 21.7525 15.6452 25.099 19.1205 28.0594L22.5528 30.9769C24.9125 33.0363 25.8993 34.3234 25.8993 36.1254C25.8993 38.8284 23.9686 41.4026 19.1205 41.4026C15.5165 41.4026 12.2987 39.9868 9.89604 37.2838L0.5 44.3201C4.01815 48.6535 10.0248 52 18.2624 52C30.9191 52 38.2558 44.363 38.2558 34.2805C38.2987 29.1749 35.2954 25.9571 31.9917 23.1683Z" />
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg width="79" height="25" viewBox="0 0 79 25" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M4.51429 17.4039L0.282146 20.6731C1.88096 22.9808 4.70238 24.7115 8.65238 24.7115C14.4833 24.7115 17.869 21.1539 17.869 16.4423C17.869 14.0385 16.4583 12.5962 14.9536 11.25L13.4488 9.80769C12.5083 8.94231 12.0381 8.26923 12.0381 7.40385C12.0381 6.25 12.7905 5.19231 14.5774 5.19231C15.8 5.19231 17.0226 5.67308 18.1512 6.92308L22.3833 3.65385C21.3488 2.01924 18.9036 0.288467 15.1417 0.288467C10.0631 0.288467 6.30119 3.75 6.30119 8.26923C6.30119 10.4808 7.52381 12.0192 9.12262 13.4615L10.6274 14.9039C11.6619 15.8654 12.1321 16.4423 12.1321 17.3077C12.1321 18.4615 11.2857 19.7115 9.02857 19.7115C7.24167 19.7115 5.64286 18.8462 4.51429 17.4039ZM60.7548 17.4039L56.5226 20.6731C58.0274 22.9808 60.9429 24.7115 64.8929 24.7115C70.7238 24.7115 74.1095 21.1539 74.1095 16.4423C74.1095 14.0385 72.6988 12.5962 71.194 11.25L69.6893 9.80769C68.7488 8.94231 68.2786 8.26923 68.2786 7.40385C68.2786 6.25 69.031 5.19231 70.8179 5.19231C72.0405 5.19231 73.2631 5.67308 74.3917 6.92308L78.6238 3.65385C77.5893 2.01924 75.144 0.288467 71.3821 0.288467C66.3036 0.288467 62.5417 3.75 62.5417 8.26923C62.5417 10.4808 63.7643 12.0192 65.3631 13.4615L66.8679 14.9039C67.9024 15.8654 68.3726 16.4423 68.3726 17.3077C68.3726 18.4615 67.5262 19.7115 65.269 19.7115C63.4821 19.7115 61.8833 18.8462 60.7548 17.4039ZM60.0024 5.67308H54.5476L49.4691 24.1346H43.8262L48.9048 5.67308H43.0738L44.4845 0.673077H61.5071L60.0024 5.67308ZM39.3119 24.2308V0.769237H31.506L17.9631 24.2308H23.9821L26.6155 19.3269H34.3274V24.2308H39.3119ZM34.3274 5.28846V14.3269H29.3429L34.3274 5.28846Z" />
3
+ </svg>
package/logos/sats.svg ADDED
@@ -0,0 +1,4 @@
1
+ <svg width="168" height="52" viewBox="0 0 168 52" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M9.60001 36.2L0.600006 43C4.00001 47.8 9.99999 51.4 18.4 51.4C30.8 51.4 38 44 38 34.2C38 29.2 35 26.2 31.8 23.4L28.6 20.4C26.6 18.6 25.6 17.2 25.6 15.4C25.6 13 27.2 10.8 31 10.8C33.6 10.8 36.2 11.8 38.6 14.4L47.6 7.60001C45.4 4.20001 40.2 0.600006 32.2 0.600006C21.4 0.600006 13.4 7.8 13.4 17.2C13.4 21.8 16 25 19.4 28L22.6 31C24.8 33 25.8 34.2 25.8 36C25.8 38.4 24 41 19.2 41C15.4 41 12 39.2 9.60001 36.2ZM129.2 36.2L120.2 43C123.4 47.8 129.6 51.4 138 51.4C150.4 51.4 157.6 44 157.6 34.2C157.6 29.2 154.6 26.2 151.4 23.4L148.2 20.4C146.2 18.6 145.2 17.2 145.2 15.4C145.2 13 146.8 10.8 150.6 10.8C153.2 10.8 155.8 11.8 158.2 14.4L167.2 7.60001C165 4.20001 159.8 0.600006 151.8 0.600006C141 0.600006 133 7.8 133 17.2C133 21.8 135.6 25 139 28L142.2 31C144.4 33 145.4 34.2 145.4 36C145.4 38.4 143.6 41 138.8 41C135 41 131.6 39.2 129.2 36.2ZM127.6 11.8H116L105.2 50.2H93.2L104 11.8H91.6L94.6 1.39999H130.8L127.6 11.8ZM83.6 50.4V1.60001H67L38.2 50.4H51L56.6 40.2H73V50.4H83.6ZM73 11V29.8H62.4L73 11Z" />
3
+
4
+ </svg>
package/package.json ADDED
@@ -0,0 +1,58 @@
1
+ {
2
+ "name": "@sats-group/ui-lib",
3
+ "version": "74.2.0",
4
+ "description": "SATS web user interface library",
5
+ "engines": {
6
+ "node": "^18 || ^20",
7
+ "npm": "^8 || ^9 || ^10"
8
+ },
9
+ "scripts": {
10
+ "build": "run-s clean logos typecheck colour",
11
+ "clean": "node rimraf.mjs",
12
+ "colour": "node codegen/colours.mjs",
13
+ "dev": "npm run dev --workspace=site",
14
+ "lint": "eslint",
15
+ "lint:ci": "eslint --max-warnings 0",
16
+ "logos": "svgr --expand-props none --typescript --out-dir react/logos --filename-case kebab logos && rimraf react/logos/**/index.*",
17
+ "typecheck": "tsc --noEmit"
18
+ },
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "git@ssh.dev.azure.com:v3/sats-group/SATS%20Web/ui-lib"
22
+ },
23
+ "author": "developer@sats.no",
24
+ "license": "UNLICENSED",
25
+ "peerDependencies": {
26
+ "classnames": "^2.5.1",
27
+ "react": "^18.0.0",
28
+ "react-dom": "^18.0.0"
29
+ },
30
+ "devDependencies": {
31
+ "@svgr/cli": "^8.1.0",
32
+ "@types/fuzzy-search": "^2.1.5",
33
+ "@types/node": "^18.16.19",
34
+ "@types/react": "^18.3.12",
35
+ "@types/react-dom": "^18.3.1",
36
+ "@typescript-eslint/eslint-plugin": "^8.12.2",
37
+ "@typescript-eslint/parser": "^8.12.2",
38
+ "eslint": "^9.13.0",
39
+ "eslint-config-prettier": "^9.1.0",
40
+ "eslint-plugin-prettier": "^5.2.1",
41
+ "eslint-plugin-react": "^7.37.2",
42
+ "globby": "^14.0.2",
43
+ "npm-run-all": "^4.1.5",
44
+ "pascal-case": "^4.0.0",
45
+ "prettier": "^3.3.3",
46
+ "react": "^18.3.1",
47
+ "react-dom": "^18.3.1",
48
+ "rimraf": "^6.0.1",
49
+ "typescript": "^5.6.3"
50
+ },
51
+ "dependencies": {
52
+ "fuzzy-search": "^3.2.1",
53
+ "react-tiny-collapse": "^2.0.0"
54
+ },
55
+ "workspaces": [
56
+ "site"
57
+ ]
58
+ }
@@ -0,0 +1,51 @@
1
+ /* eslint-disable no-var, @typescript-eslint/no-explicit-any */
2
+ var hasOwn = {}.hasOwnProperty;
3
+
4
+ // NOTE: This is copied from the source of 'classnames' and modified to produce BEM modifier classes. (source: https://github.com/JedWatson/classnames/blob/master/index.js)
5
+
6
+ /** Creates modifier classnames of the provided values. The API is similar to `classnames`. All values passed will be prefixed by `className` (the first argument)
7
+ *
8
+ * Note that unlike with `classnames`, when an array is passed all elements must be strings
9
+
10
+ ```
11
+ mod("block__element", "something", { "is-active": true });
12
+ // Returns "block__element block__element--something block__element--is-active"
13
+ ```
14
+ */
15
+ export function mod(...args: any[]) {
16
+ var baseName = args[0];
17
+ if (!baseName) return '';
18
+
19
+ var classes = [baseName];
20
+
21
+ for (var i = 1; i < args.length; i++) {
22
+ var arg = args[i];
23
+ if (!arg) continue;
24
+
25
+ var argType = typeof arg;
26
+
27
+ if (argType === 'string' || argType === 'number') {
28
+ classes.push(baseName + '--' + arg);
29
+ } else if (Array.isArray(arg)) {
30
+ if (arg.length) {
31
+ for (var el of arg) {
32
+ if (el) {
33
+ classes.push(baseName + '--' + el);
34
+ }
35
+ }
36
+ }
37
+ } else if (argType === 'object') {
38
+ if (arg.toString !== Object.prototype.toString) {
39
+ classes.push(baseName + '--' + arg.toString());
40
+ } else {
41
+ for (var key in arg) {
42
+ if (hasOwn.call(arg, key) && arg[key]) {
43
+ classes.push(baseName + '--' + key);
44
+ }
45
+ }
46
+ }
47
+ }
48
+ }
49
+
50
+ return classes.join(' ');
51
+ }
@@ -0,0 +1,53 @@
1
+ @use '../../tokens/light';
2
+ @use '../../tokens/spacing';
3
+ @use '../../tokens/corner-radius';
4
+
5
+ .badge {
6
+ min-width: 20px;
7
+ height: 20px;
8
+ display: inline-flex;
9
+ justify-content: center;
10
+ align-items: center;
11
+ padding: 0 spacing.$xxs;
12
+ border-radius: corner-radius.$l;
13
+
14
+ &--padding-tight {
15
+ padding: 0;
16
+ height: auto;
17
+ min-height: 20px;
18
+ }
19
+
20
+ &--theme-light {
21
+ &-primary {
22
+ color: light.$on-ge-on-badge-primary;
23
+ background: light.$ge-badge-primary;
24
+ }
25
+
26
+ &-secondary {
27
+ color: light.$on-ge-on-badge-secondary;
28
+ background: light.$ge-badge-secondary;
29
+ }
30
+
31
+ &-tertiary {
32
+ color: light.$on-ge-on-badge-tertiary;
33
+ background: light.$ge-badge-tertiary;
34
+ }
35
+ }
36
+
37
+ &--theme-fixed {
38
+ &-primary {
39
+ color: light.$on-ge-on-badge-primary;
40
+ background: light.$ge-badge-primary;
41
+ }
42
+
43
+ &-secondary {
44
+ color: light.$on-ge-on-fixed-badge-secondary;
45
+ background: light.$ge-fixed-badge-secondary;
46
+ }
47
+
48
+ &-tertiary {
49
+ color: light.$on-ge-on-fixed-badge-tertiary;
50
+ background: light.$ge-fixed-badge-tertiary;
51
+ }
52
+ }
53
+ }
@@ -0,0 +1,28 @@
1
+ import React from 'react';
2
+ import cn from 'classnames';
3
+
4
+ import { Badge as Props, variants, themes, Types } from './badge.types';
5
+ import Text from '../text';
6
+
7
+ const Badge: React.FunctionComponent<Props> & {
8
+ variants: typeof variants;
9
+ themes: typeof themes;
10
+ } = ({ content, theme = themes.light, variant = variants.primary }) => (
11
+ <Text
12
+ size={Text.sizes.interface}
13
+ className={cn('badge', `badge--theme-${theme}-${variant}`, {
14
+ 'badge--padding-tight': content.type === Types.Icon,
15
+ })}
16
+ tight
17
+ >
18
+ {content.type === Types.Numerical
19
+ ? content.content >= 1000
20
+ ? '999+'
21
+ : content.content
22
+ : content.content}
23
+ </Text>
24
+ );
25
+
26
+ Badge.variants = variants;
27
+ Badge.themes = themes;
28
+ export default Badge;
@@ -0,0 +1,34 @@
1
+ import type { ReactElement } from 'react';
2
+ import type { ObjectValues } from '../types';
3
+
4
+ export const variants = {
5
+ primary: 'primary',
6
+ secondary: 'secondary',
7
+ tertiary: 'tertiary',
8
+ } as const;
9
+
10
+ export const themes = {
11
+ light: 'light',
12
+ fixed: 'fixed',
13
+ } as const;
14
+
15
+ export enum Types {
16
+ Numerical = 'Numerical',
17
+ Icon = 'Icon',
18
+ }
19
+
20
+ type Icon = {
21
+ type: Types.Icon;
22
+ content: ReactElement;
23
+ };
24
+
25
+ type Numerical = {
26
+ type: Types.Numerical;
27
+ content: number;
28
+ };
29
+
30
+ export type Badge = {
31
+ content: Numerical | Icon;
32
+ theme?: ObjectValues<typeof themes>;
33
+ variant?: ObjectValues<typeof variants>;
34
+ };
@@ -0,0 +1,2 @@
1
+ import Badge from './badge';
2
+ export default Badge;