Skip to content

Commit 2b4159c

Browse files
authored
feat(packages): core-ui migration
* chore: fix migration chore: fix typing chore: move eslint config and prettier config * chore(packages): sync up * chore(packages): fix types * chore(build): npm ci * chore(build): update package-lock.json * chore(build): verbose logging * chore(build): ignore script * chore(build): update package-lock.json * chore(build): update package-lock.json * chore(packages): sync up * chore(packages): update initial version
1 parent 0e95ed0 commit 2b4159c

File tree

257 files changed

+24646
-12409
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

257 files changed

+24646
-12409
lines changed

.github/workflows/verify.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
node-version: '22.3.0'
2121

2222
- name: Install dependencies
23-
run: npm install
23+
run: npm ci --verbose
2424

2525
- name: Lint affected
2626
run: npx nx affected --target=lint --base=origin/main

package-lock.json

Lines changed: 16692 additions & 4644 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"plugins": ["prettier-plugin-tailwindcss"],
3+
"trailingComma": "all",
4+
"tabWidth": 2,
5+
"semi": true,
6+
"printWidth": 120,
7+
"bracketSpacing": true,
8+
"endOfLine": "lf"
9+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { useMemo, useState, useEffect } from "react";
2+
import * as React from "react";
3+
import { addons } from "@storybook/preview-api";
4+
import { DocsContainer, DocsContainerProps } from "@storybook/addon-docs";
5+
import { themes } from "@storybook/theming";
6+
import { DARK_MODE_EVENT_NAME } from "storybook-dark-mode";
7+
8+
const channel = addons.getChannel();
9+
10+
export default function ThemeableDocContainer(props: DocsContainerProps) {
11+
const [isDark, setDark] = useState(false);
12+
13+
const activeTheme = useMemo(
14+
() => (isDark ? { ...themes.dark, appPreviewBg: "#222425" } : themes.light),
15+
[isDark]
16+
);
17+
18+
useEffect(() => {
19+
channel.on(DARK_MODE_EVENT_NAME, setDark);
20+
21+
return () => channel.removeListener(DARK_MODE_EVENT_NAME, setDark);
22+
}, [setDark]);
23+
24+
return <DocsContainer {...props} theme={activeTheme} />;
25+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import type { StorybookConfig } from "@storybook/react-vite";
2+
3+
const config: StorybookConfig = {
4+
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
5+
addons: [
6+
"@storybook/addon-onboarding",
7+
"@storybook/addon-essentials",
8+
"@chromatic-com/storybook",
9+
"@storybook/addon-interactions",
10+
"storybook-dark-mode",
11+
],
12+
framework: {
13+
name: "@storybook/react-vite",
14+
options: {},
15+
},
16+
};
17+
export default config;
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { addons } from "@storybook/manager-api";
2+
import { themes } from "@storybook/theming";
3+
4+
addons.setConfig({
5+
theme: themes.light,
6+
});
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
<style>
2+
@font-face {
3+
font-family: "Px Grotesk";
4+
src: url("/fonts/Px-Grotesk/Px-Grotesk-Black.eot");
5+
src:
6+
url("/fonts/Px-Grotesk/Px-Grotesk-Black.eot?#iefix") format("embedded-opentype"),
7+
url("/fonts/Px-Grotesk/Px-Grotesk-Black.woff2") format("woff2"),
8+
url("/fonts/Px-Grotesk/Px-Grotesk-Black.woff") format("woff");
9+
font-weight: 900;
10+
font-style: normal;
11+
}
12+
13+
@font-face {
14+
font-family: "Px Grotesk";
15+
src: url("/fonts/Px-Grotesk/Px-Grotesk-Bold.eot");
16+
src:
17+
url("/fonts/Px-Grotesk/Px-Grotesk-Bold.eot?#iefix") format("embedded-opentype"),
18+
url("/fonts/Px-Grotesk/Px-Grotesk-Bold.woff2") format("woff2"),
19+
url("/fonts/Px-Grotesk/Px-Grotesk-Bold.woff") format("woff");
20+
font-weight: 700;
21+
font-style: normal;
22+
}
23+
24+
@font-face {
25+
font-family: "Px Grotesk";
26+
src: url("/fonts/Px-Grotesk/Px-Grotesk-Regular.eot");
27+
src:
28+
url("/fonts/Px-Grotesk/Px-Grotesk-Regular.eot?#iefix") format("embedded-opentype"),
29+
url("/fonts/Px-Grotesk/Px-Grotesk-Regular.woff2") format("woff2"),
30+
url("/fonts/Px-Grotesk/Px-Grotesk-Regular.woff") format("woff");
31+
font-weight: 400;
32+
font-style: normal;
33+
}
34+
35+
@font-face {
36+
font-family: "Px Grotesk";
37+
src: url("/fonts/Px-Grotesk/Px-Grotesk-Light.eot");
38+
src:
39+
url("/fonts/Px-Grotesk/Px-Grotesk-Light.eot?#iefix") format("embedded-opentype"),
40+
url("/fonts/Px-Grotesk/Px-Grotesk-Light.woff2") format("woff2"),
41+
url("/fonts/Px-Grotesk/Px-Grotesk-Light.woff") format("woff");
42+
font-weight: 300;
43+
font-style: normal;
44+
}
45+
46+
@font-face {
47+
font-family: "Px Grotesk";
48+
src: url("/fonts/Px-Grotesk/Px-Grotesk-Thin.eot");
49+
src:
50+
url("/fonts/Px-Grotesk/Px-Grotesk-Thin.eot?#iefix") format("embedded-opentype"),
51+
url("/fonts/Px-Grotesk/Px-Grotesk-Thin.woff2") format("woff2"),
52+
url("/fonts/Px-Grotesk/Px-Grotesk-Thin.woff") format("woff");
53+
font-weight: 250;
54+
font-style: normal;
55+
}
56+
57+
@font-face {
58+
font-family: "Px Grotesk";
59+
src: url("/fonts/Px-Grotesk/Px-Grotesk-Screen.eot");
60+
src:
61+
url("/fonts/Px-Grotesk/Px-Grotesk-Screen.eot?#iefix") format("embedded-opentype"),
62+
url("/fonts/Px-Grotesk/Px-Grotesk-Screen.woff2") format("woff2"),
63+
url("/fonts/Px-Grotesk/Px-Grotesk-Screen.woff") format("woff");
64+
font-weight: 200;
65+
font-style: normal;
66+
}
67+
68+
@font-face {
69+
font-family: "Px Grotesk Mono";
70+
src: url("/fonts/Px-Grotesk-Mono/Px-Grotesk-Mono-Light.eot");
71+
src:
72+
url("/fonts/Px-Grotesk-Mono/Px-Grotesk-Mono-Light.eot?#iefix") format("embedded-opentype"),
73+
url("/fonts/Px-Grotesk-Mono/Px-Grotesk-Mono-Light.woff2") format("woff2"),
74+
url("/fonts/Px-Grotesk-Mono/Px-Grotesk-Mono-Light.woff") format("woff");
75+
font-weight: 300;
76+
font-style: normal;
77+
}
78+
79+
@font-face {
80+
font-family: "Px Grotesk Mono";
81+
src: url("/fonts/Px-Grotesk-Mono/Px-Grotesk-Mono-Regular.eot");
82+
src:
83+
url("/fonts/Px-Grotesk-Mono/Px-Grotesk-Mono-Regular.eot?#iefix") format("embedded-opentype"),
84+
url("/fonts/Px-Grotesk-Mono/Px-Grotesk-Mono-Regular.woff2") format("woff2"),
85+
url("/fonts/Px-Grotesk-Mono/Px-Grotesk-Mono-Regular.woff") format("woff");
86+
font-weight: 400;
87+
font-style: normal;
88+
}
89+
90+
@font-face {
91+
font-family: "Px Grotesk Mono";
92+
src: url("/fonts/Px-Grotesk-Mono/Px-Grotesk-Mono-Bold.eot");
93+
src:
94+
url("/fonts/Px-Grotesk-Mono/Px-Grotesk-Mono-Bold.eot?#iefix") format("embedded-opentype"),
95+
url("/fonts/Px-Grotesk-Mono/Px-Grotesk-Mono-Bold.woff2") format("woff2"),
96+
url("/fonts/Px-Grotesk-Mono/Px-Grotesk-Mono-Bold.woff") format("woff");
97+
font-weight: 700;
98+
font-style: normal;
99+
}
100+
101+
body {
102+
letter-spacing: 0;
103+
font-family: Px Grotesk,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";
104+
font-size: 1rem;
105+
line-height: 1.5rem;
106+
font-weight: 400;
107+
line-height: 1.5;
108+
--tw-text-opacity: 1;
109+
color: rgb(18 73 94 / var(--tw-text-opacity));
110+
font-feature-settings: "liga" off,"clig" off;
111+
}
112+
</style>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import type { Preview } from "@storybook/react";
2+
import { themes } from "@storybook/theming";
3+
4+
import ThemeableDocContainer from "./components/ThemeableDocContainer";
5+
6+
import "../src/index.css";
7+
8+
const preview: Preview = {
9+
parameters: {
10+
darkMode: {
11+
current: "light",
12+
darkClass: "dark",
13+
lightClass: "light",
14+
dark: { ...themes.dark, appPreviewBg: "#222425" },
15+
light: themes.light,
16+
stylePreview: true,
17+
},
18+
docs: {
19+
container: ThemeableDocContainer,
20+
},
21+
controls: {
22+
matchers: {
23+
color: /(background|color)$/i,
24+
date: /Date$/i,
25+
},
26+
},
27+
},
28+
};
29+
30+
export default preview;

packages/babylon-core-ui/LICENSE

Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
Business Source License 1.1
2+
3+
License text copyright (c) 2017 MariaDB Corporation Ab, All Rights Reserved.
4+
"Business Source License" is a trademark of MariaDB Corporation Ab.
5+
6+
7+
-----------------------------------------------------------------------------
8+
9+
Parameters
10+
11+
Licensor: Babylon Labs Ltd.
12+
13+
Licensed Work: @babylonlabs-io/core-ui
14+
The Licensed Work is (c) 2024 Babylon Labs Ltd.
15+
16+
Additional Use Grant:
17+
18+
In addition to the uses permitted under the non-production license below,
19+
we grant you a limited, non-exclusive, non-transferable, non-sublicensable,
20+
revocable license, limited as set forth below, to use the Licensed Work
21+
in this repository for production commercial uses built on or using and integrated
22+
with the Babylon Protocol, not including Competing Uses.
23+
24+
Any use beyond the scope of this license, including uses that are not built on or
25+
using and integrated with the Babylon Protocol, or are Competing Uses,
26+
will terminate this license to you, automatically and without notice.
27+
28+
This License applies separately and solely to the specific versions of the Licensed Work
29+
in the specified repository on or before the date of this License, and we may require a
30+
different license and different provisions for each subsequent version of the
31+
Licensed Work released by us.
32+
33+
"Babylon Labs", "we", "our", or "us" means Babylon Labs Ltd.
34+
35+
"Babylon Protocol" means the Bitcoin staking protocol as further described in the documentation
36+
here (https://docs.babylonlabs.io/docs/introduction/babylon-overview), as updated from time to time.
37+
38+
"Competing Use" means any use of the Licensed Work in any product, software, protocol, network,
39+
application, or service that is made available to any party and that
40+
(i) substitutes for the use of the Babylon Protocol,
41+
(ii) offers the same or substantially similar functionality as the Babylon Protocol or
42+
(iii) is built on or uses a protocol with substantially similar functionality as the Babylon Protocol
43+
or otherwise facilitates the staking of bitcoin other than by utilizing the Babylon Protocol.
44+
45+
The provisions in this License apply to each individual, entity, group, or association
46+
(each and collectively, "you" or "your") who uses the Licensed Work for production,
47+
and you agree to such provisions. Your production use of the Licensed Work is conditional on your
48+
agreement to this License. If you do not agree and consent to be bound to this License,
49+
do not so use the Software.
50+
51+
If you do not fall within the limited scope of this license as described above or below,
52+
or are otherwise not in strict compliance with this License, then this production license does not
53+
extend to you and does not grant you any production use, including any copying, distributing, or
54+
making any derivative use of the Licensed Work for production purposes.
55+
56+
Limited Scope of License. Your commercial production license to the Licensed Work
57+
under this License does not extend to any use:
58+
59+
1. unless you have legal capacity to consent and agree to be bound by this License;
60+
2. unless you have the technical knowledge necessary or advisable to understand and evaluate the
61+
risks of using the Licensed Work and the Babylon Protocol;
62+
3. if you are a resident or agent of, or an entity organized, incorporated or doing business in,
63+
Afghanistan, Belarus, Bosnia and Herzegovina, Burundi, Central African Republic, Crimea, Cuba,
64+
Democratic People's Republic of Korea, Democratic Republic of the Congo,
65+
Donetsk or Luhansk Regions of Ukraine, Eritrea, Guinea, Guinea-Bissau, Haiti, Iran, Iraq, Lebanon,
66+
Libya, Mali, Myanmar, Nicaragua, Russia, Somalia, South Sudan, Sudan, Syria, Venezuela, Yemen,
67+
or Zimbabwe or any other country to which the United States, the United Kingdom,
68+
the European Union or any of its member states or the United Nations or any of its member states
69+
(collectively, the "Major Jurisdictions") embargoes goods or imposes sanctions
70+
(such embargoed or sanctioned territories, collectively, the "Restricted Territories");
71+
4. if you are, or if you directly or indirectly own or control, from any person or entity that is
72+
listed on any sanctions list or equivalent maintained by any of the Major Jurisdictions
73+
(collectively, "Sanctions Lists Persons");
74+
5. to transact in or with any Restricted Territories or Sanctions List Persons;
75+
6. if you are a U.S. Person as defined in 17 CFR § 230.902, or currently or ordinarily located or
76+
resident in (or incorporated or organized in) the United States of America, Canada, or
77+
Australia (collectively, "Excluded Jurisdictions"), or to transact in or with Excluded Jurisdictions;
78+
7. to defraud, or otherwise materially mislead, any person;
79+
8. in violation of applicable laws, rules or regulations in your relevant jurisdiction;
80+
9. that circumvents any sanctions or export controls targeting you or the country or territory where
81+
you are located; or
82+
10. in any activity that transmits, exchanges, or is otherwise supported by the direct or indirect
83+
proceeds of criminal or fraudulent activity.
84+
85+
Any production use of the Licensed Work by you confirms your agreement to the foregoing limitations,
86+
and your understanding and agreement that they are limitations and not restrictions.
87+
88+
Change Date: 2027-03-15 (March 15th, 2027)
89+
90+
Change License: Apache 2.0
91+
92+
-----------------------------------------------------------------------------
93+
94+
Terms
95+
96+
The Licensor hereby grants you the right to copy, modify, create derivative
97+
works, redistribute, and make non-production use of the Licensed Work. The
98+
Licensor may make an Additional Use Grant, above, permitting limited
99+
production use.
100+
101+
Effective on the Change Date, or the fourth anniversary of the first publicly
102+
available distribution of a specific version of the Licensed Work under this
103+
License, whichever comes first, the Licensor hereby grants you rights under
104+
the terms of the Change License, and the rights granted in the paragraph
105+
above terminate.
106+
107+
If your use of the Licensed Work does not comply with the requirements
108+
currently in effect as described in this License, you must purchase a
109+
commercial license from the Licensor, its affiliated entities, or authorized
110+
resellers, or you must refrain from using the Licensed Work.
111+
112+
All copies of the original and modified Licensed Work, and derivative works
113+
of the Licensed Work, are subject to this License. This License applies
114+
separately for each version of the Licensed Work and the Change Date may vary
115+
for each version of the Licensed Work released by Licensor.
116+
117+
You must conspicuously display this License on each original or modified copy
118+
of the Licensed Work. If you receive the Licensed Work in original or
119+
modified form from a third party, the terms and conditions set forth in this
120+
License apply to your use of that work.
121+
122+
Any use of the Licensed Work in violation of this License will automatically
123+
terminate your rights under this License for the current and all other
124+
versions of the Licensed Work.
125+
126+
This License does not grant you any right in any trademark or logo of
127+
Licensor or its affiliates (provided that you may use a trademark or logo of
128+
Licensor as expressly required by this License).
129+
130+
TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
131+
AN "AS IS" BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
132+
EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
133+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
134+
TITLE.
135+
136+
MariaDB hereby grants you permission to use this License’s text to license
137+
your works, and to refer to it using the trademark "Business Source License",
138+
as long as you comply with the Covenants of Licensor below.
139+
140+
-----------------------------------------------------------------------------
141+
142+
Covenants of Licensor
143+
144+
In consideration of the right to use this License’s text and the "Business
145+
Source License" name and trademark, Licensor covenants to MariaDB, and to all
146+
other recipients of the licensed work to be provided by Licensor:
147+
148+
1. To specify as the Change License the GPL Version 2.0 or any later version,
149+
or a license that is compatible with GPL Version 2.0 or a later version,
150+
where "compatible" means that software provided under the Change License can
151+
be included in a program with software provided under GPL Version 2.0 or a
152+
later version. Licensor may specify additional Change Licenses without
153+
limitation.
154+
155+
2. To either: (a) specify an additional grant of rights to use that does not
156+
impose any additional restriction on the right granted in this License, as
157+
the Additional Use Grant; or (b) insert the text "None".
158+
159+
3. To specify a Change Date.
160+
161+
4. Not to modify this License in any other way.
162+
163+
-----------------------------------------------------------------------------
164+
165+
Notice
166+
167+
The Business Source License (this document, or the "License") is not an Open
168+
Source license. However, the Licensed Work will eventually be made available
169+
under an Open Source License, as stated in this License.

0 commit comments

Comments
 (0)